8000 feat(claude): align global allow rules with planwright and add the hub's relay rules by inkatze · Pull Request #226 · inkatze/dotfiles · GitHub
[go: up one dir, main page]

Skip to content

feat(claude): align global allow rules with planwright and add the hub's relay rules - #226

< 8000 div class="d-flex flex-items-center gap-2 flex-shrink-0">Merged
inkatze merged 10 commits into
mainfrom
planwright/flight/mc-c-corp-worker-9b008db4
Nov 9, 2026
Merged

inkatze merged 10 commits into
mainfrom
planwright/flight/mc-c-corp-worker-9b008db4

Conversation

@inkatze
@inkatze inkatze commented Nov 7, 2026 •
Copy link
Copy Markdown
Owner

Brings the global Claude allow list in line with what planwright already provides. Carries over the rules that are live on this machine but that the next render would drop (the merge replaces permissions.allow wholesale). Adds the mission-control hub's new pane-kill and relay rules.

Nothing is removed. planwright's allow layers (the worker, tower and mission-control --settings profiles and their command guards) reach only the sessions planwright launches with --settings. The plugin's own global hooks run only the deny floor, never an allow guard. The hand-started hub and ordinary interactive sessions get none of it, so every read-only rule here is still needed. For the record, config/worker-settings.json duplicates git status, git rev-parse, git ls-files, git merge-base, ls and stat, but only for the workers planwright launches.

Allow and ask rules

  • Bash($HOME/.claude/plugins/cache/planwright/planwright/*/scripts/fleet-streamjson.sh answer *): renders to the rule already live. Accepted exposure (your pick): * spans spaces and /.., so this rule also pre-approves any command that merely contains that path and verb. planwright's own matcher model matches <cache>/0.67.0/../../../../../../bin/rm -rf <dir> /scripts/fleet-streamjson.sh answer y. This is documented in docs/claude-config.md.
  • pending and mc-reclaim.sh reclaim stay pinned, bumped from 0.66.0 (stale since the 0.67.0 install) to 0.67.0, so neither shares that exposure. scripts/claude-planwright-pin-check.sh now treats a * version as a glob rather than a stale pin, so the check passes with the answer rule present.
  • Bash(gh pr review:*), Bash(tmux send-keys:*), Bash(tmux kill-window:*): previously live-only. Worth your look: a global allow reaches every session, dispatched workers included, and send-keys can type into any pane. planwright's tower guard never approves it. A narrower home would be the hub repo's own .claude/settings.local.json.
  • Bash(tmux kill-pane -t %*), with ask rules Bash(tmux kill-pane -t %* -*) and Bash(tmux kill-pane *;*): a flag after the pane id (-a kills every other pane) or a ; (tmux's own separator) prompts instead. Checked in planwright's matcher model: -a, -Za, \; kill-server, ;kill-server and a second -t all prompt, and -t %691 is allowed.
  • Bash(ssh -o BatchMode=yes -o ConnectTimeout=10 planwright-relay 'tmux load-buffer - && tmux paste-buffer -t %570 && sleep 1 && tmux send-keys -t %570 Enter'): exact, no wildcard, because any extra word would run on the remote side. Moving the remote pane means editing the rule.

The planwright-relay ssh alias

roles/ssh/files/config.lan.tpl gains a Host planwright-relay block, with no agent forwarding and BatchMode yes, so the public rule names no host. No new 1Password field is needed: the alias reuses the existing server_host and server_user fields on the LAN item (dotfiles-lan-ssh), which already point at the relay host. If the relay host ever differs from the server, add relay_host and relay_user fields and point the block at them. The alias exists only after the LAN config renders (scripts/ssh-lan-config-sync.sh, run by the playbook), and the hub has to switch its command to the alias.

planwright adopter layer (requested through mission control)

Keys checked against the installed planwright's config/defaults.yml and docs/options-reference.md. None was already set in the rendered layer.

  • allocation_model_offload: sonnet, allocation_effort_offload: medium: the tier /offload launches at.
  • mission_control_guidance: standard.

The render was not run. Merging and running the role is yours.

Checks and review
  • lefthook pre-commit is green on every commit, including the claude-settings-merge, claude-statusline, op-render, skill-contracts and instruction-budget suites. scripts/ssh-lan-config-sync-test.sh passed 20 assertions with 0 failures, with a new check that the relay alias renders without agent forwarding. claude-planwright-pin-check.sh against the live install: OK.

  • A render dry-run against a copy of the live ~/.claude/settings.json (before the pane-kill and relay commits) kept every live entry and added only pending and reclaim.

  • Local snag, not caused by this PR: the merge, statusline and op-render suites fail when mise's jq shim is first on PATH, because they run under a fake HOME where mise refuses its config. They pass with the real jq binary first, and every commit ran that way.

  • identifier-check.sh could not run: there is no ~/.config/dotfiles/private-identifiers on this machine. I checked by hand that no file this PR touches names the relay host or user.

  • Polish (inline) stopped at a hard pause on the version glob, which went to Diego as a decision. It then converged. Panel-review (codex, nested) converged at iteration 1 with nothing to apply. Its declined items: the paste-buffer race (single hub, so no concurrent relays), the fixed %570 pane (as picked), and a false claim that the ; ask rule never fires (the split reads escapes, per MB-3).

  • The cadence's isolated polish step ran in-session: in its tmux window, the prompts could not be answered, and mission control closed it. The panel-review record's start time is wrong: written as 2026-11-06T22:40:00Z, it actually started around 05:00Z on 2026-11-07. The records are append-only, so the correction lives here.

  • Synced with main by a merge commit (no rebase). The only conflict was roles/ssh/files/config.lan.tpl, which keeps both main's offload host block and this PR's planwright-relay block. A follow-up commit scopes the relay test's assertions to its own block, since main's offload block also sets ForwardAgent no.

  • After the sync, polish and a Gemini panel review ran in-session (a third worker was over the cap). Panel findings were dropped or declined on validation. cubic did not review: the operator kept its quota for other PRs, and the panel review stands in.

  • Synced with main again by a merge commit (main 0dcc648, which fixed the inherited lint failure). The merge was clean, but main's new overlay-render test asserted no mission_control_guidance: line after a no-snapshot render, which this PR's template now declares; the follow-up commit checks that the planted value is dropped instead, and rewords the template comment, since main now keeps mission control's own writes across a render.

  • Polish and a Gemini panel review ran in-session on the new head. All Gemini findings were declined or dropped on validation (details in the run 000003 records). cubic did not review: its quota is reserved for other PRs, and the panel review stands in.

  • Synced with main again by a merge commit (main e296c92, which fixed the lint job's hang). The merge was clean and the branch's own delta is unchanged. Polish ran one inline pass (a small, narrow diff) and found nothing; the pin-check, op-render, ssh LAN sync and settings-merge suites pass. A Gemini panel review raised four items, all declined on validation: a claimed && injection through the tmux kill-pane -t %* allow (Claude Code checks each chained subcommand against the rules separately), the matching doc claim, a missing reference row for planwright's own mission_control_guidance knob, and IdentityAgent none on the relay alias (it authenticates with the agent; ForwardAgent no already keeps the agent off the remote). cubic did not review: its quota is reserved for other PRs, and the panel review stands in.

Cadence records

Steps at pre-implementation (run 000001)

# Step Kind Target Hosting Backend Session Head Start End Outcome Excerpt Output
none

Ended on 57a40a1136f6.

Steps at pre-ci (run 000001)

# Step Kind Target Hosting Backend Session Head Start End Outcome Excerpt Output
none

Ended on ec5afea2ed7c.

Steps at convergence (run 000001)

# Step Kind Target Hosting Backend Session Head Start End Outcome Excerpt Output
1 polish skill polish in-session in-session ec5afea to af7c169 2026-11-08T00:42:51Z 2026-11-08T00:47:17Z applied | Documentation | 2 (iter 1) | falsified prose: per-repo `.claude/settings.json` named as the hub's tracked layer though `.gitignore:16` ignores it; doc guard: two over-long lines from the reword | / | Tests / verification | none | pin-check suite 6/6, ssh-lan suite 20/20 | / | Cross-file consistency | none | CI step and doc agree that lefthook does not run the suite | / / #​#​ Buckets / / Auto-applicable (applied, commit 4th on branch, "docs(claude): correct the hub-layer and relay-forwarding claims"): / 1. docs/claude-config.md: name the un-ignore the per-repo settings layer needs. / 2. docs/claude-config.md: reflow two over-long lines. / 3. roles/ssh/files/config.lan.tpl: comment says what the relay block withholds (agent forwarding, extra SendEnv), not "no environment forwarding". / / Agent-resolvable: unavailable (no brief). Needs sign-off: none. Needs human judgment: none. / / Declined log (carried from the prior worker's run, not re-routed): tmux paste-buffer race; fixed `%570` pane id; the `*` version-glob exposure (operator chose to keep it, documented). / / Pending sign-off checklist: none (no sign-off trailers ahead of base). / / #​#​ Pass summary / / Iterations: 2; converged (iteration 2 produced no new dispositions). Tooling: lefthook pre-commit green (shellcheck, yamllint, ansible-lint with one pre-existing jinja[spacing] warning in roles/claude/tasks/op-render.yml, gitleaks, instruction-budget, settings-merge, statusline). Reverts: none.

Steps at pre-pr (run 000001)

# Step Kind Target Hosting Backend Session Head Start End Outcome Excerpt Output
none

Ended on 57a40a1136f6.

Steps at pre-implementation (run 000002)

# Step Kind Target Hosting Backend Session Head Start End Outcome Excerpt Output
none

Ended on af7c1696b22c.

Steps at pre-ci (run 000002)

# Step Kind Target Hosting Backend Session Head Start End Outcome Excerpt Output
none

Ended on 4eed759d2849.

Steps at convergence (run 000002)

# Step Kind Target Hosting Backend Session Head Start End Outcome Excerpt Output
1 polish skill polish in-session in-session 4eed759 to 3f5ec5d 2026-11-08T13:40:00Z 2026-11-08T23:55:06Z applied / | Lens | Findings | Note | / | --- | --- | --- | / | Correctness | none | both host blocks kept; relay and offload blocks are independent Host sections | / | Tests / verification | 1 | relay `ForwardAgent no` assertion matched the offload block after the merge | / | Cross-file consistency | none | workflow carries the pin-check step once; roles/ssh/README.md fields list matches the template | / | Security | none | relay keeps no agent forwarding and no extra SendEnv; offload keeps IdentityAgent none | / / #​#​ Buckets / / Auto-applicable (applied, 3f5ec5d "test(ssh): check the relay alias's settings within its own block"): / 1. scripts/ssh-lan-config-sync-test.sh: scope the relay assertions to its own Host block, adding BatchMode and no-SendEnv checks. / / Agent-resolvable: unavailable. Needs sign-off: none. Needs human judgment: none. Declined: none. / / Pending sign-off checklist: none. / / #​#​ Pass summary / / Iterations: 2; converged (iteration 2 produced no new dispositions). Tooling: ssh-lan suite 29/29; lefthook pre-commit green with the ansible-driven suites excluded per the operator's skip-slow-suites rule (CI runs them).
2 panel-review skill panel-review in-session in-session 3f5ec5d 2026-11-08T15:50:00Z 2026-11-09T00:00:20Z passed #​ Panel review (convergence, run 000002, nested, in-session) / / Backend: gemini (server profile default; egress consent on file for inkatze/dotfiles), one pass, 116s, prompt gitleaks-clean. Diff: origin/main...HEAD at 3f5ec5d. Converged at iteration 1: nothing to apply, no forks. The session registry and writer lock (review-shared/state.md) were not taken, since no write was made. / / #​#​ Lens coverage / / | Lens | Backend row | Disposition | / | --- | --- | --- | / | Correctness | fixed `%570` pane in the relay allow rule | declined (already in the declined log: operator chose the fixed pane) | / | Security | `tmux kill-pane -t %*` bypassable with `&&`, `\|`, `$()` | dropped: Claude Code matches each subcommand of a compound command separately and prompts on substitutions, so the allow never covers a chained command | / | Error handling, Performance, Concurrency, Naming, Tests, Cross-file | none | - | / | Documentation | new planwright.yml.tpl knobs undocumented in docs/claude-config.md | declined: planwright owns each knob's meaning; the template's existing knobs are documented at planwright's source too (no fragile copies) | / | Defensive completeness | relay block test lacks Hostname/User checks | declined: low value; those lines reuse the server item's references, already rendered and asserted | / / #​#​ Buckets / / Auto-applicable: none. Agent-resolvable: unavailable (no brief). Needs sign-off: none. Needs human judgment: none. / / Declined log: fixed `%570` pane (carried); planwright knob docs; relay Hostname/User assertions. Dropped: kill-pane chaining bypass (did not converge on validation).

Ended on 3f5ec5d24223.

  • Warning: isolated polish and panel-review ran in-session: hub refused a third live worker (2-worker cap)

Steps at pre-pr (run 000002)

# Step Kind Target Hosting Backend Session Head Start End Outcome Excerpt Output
none

Ended on 3f5ec5d24223.

Steps at post-pr (run 000002)

# Step Kind Target Hosting Backend Session Head Start End Outcome Excerpt Output
1 bot-review skill bot-review in-session in-session 3f5ec5d 2026-11-09T02:07:12Z 2026-11-09T02:07:12Z skipped: missing (not run by operator decision via the hub: cubic quota reserved for other PRs; the gemini panel review (000002 convergence 004) stands in for the bot review)

Ended on 3f5ec5d24223.

  • Warning: bot-review not run: operator replaced it with the panel review (cubic quota)

Steps at pre-implementation (run 000003)

# Step Kind Target Hosting Backend Session Head Start End Outcome Excerpt Output
none

Ended on d92c37b736de.

Steps at pre-ci (run 000003)

# Step Kind Target Hosting Backend Session Head Start End Outcome Excerpt Output
none

Ended on d92c37b736de.

Steps at convergence (run 000003)

# Step Kind Target Hosting Backend Session Head Start End Outcome Excerpt Output
1 polish skill polish in-session in-session d92c37b to 9800629 2026-11-09T17:31:00Z 2026-11-09T17:42:00Z applied #​ Polish (convergence, run 000003, nested, in-session by the launch brief: no dispatched sessions) / / Scope: what the merge of origin/main 0dcc648 changed against the branch (merge d92c37b was clean; one file both sides touched, roles/claude/files/planwright/planwright.yml.tpl). / / | Lens | Findings | Note | / | --- | --- | --- | / | Tests / verification | 1 | main's op-render test "no snapshot: nothing harvested" asserted no `mission_control_guidance:` line, but this branch's overlay template declares one, so the suite failed 248/249 after the sync | / | Cross-file consistency | 1 | the template comment said a `mc-config.sh knob` write is rendered over; main's supplement now keeps mission control's own keys across the render | / | Correctness, Security, Concurrency, Docs, Naming, Performance, Error handling | none | merged hunks are disjoint from the branch's otherwise | / / #​#​ Buckets / / Auto-applicable (applied, 9800629): 1. scripts/op-render-test.sh: assert the planted `expert` value is dropped (the supplement-absent check still catches a harvest). 2. planwright.yml.tpl: comment states the template is the fleet default a knob write overrides per machine. / / Agent-resolvable: none. Needs sign-off: none. Needs human judgment: none. Declined: none. / / #​#​ Pass summary / / Iterations: 2; converged. Tooling: op-render-test 249/249, user-config-selection-test, claude-planwright-pin-check-test, ssh-lan-config-sync-test 29/29, instruction-budget: pass; lefthook pre-commit green with the slow suites excluded (CI runs them).
2 panel-review skill panel-review in-session in-session 9800629 2026-11-09T17:43:50Z 2026-11-09T17:49:21Z passed #​ Panel review (convergence, run 000003, nested, in-session) / / Backend: gemini (egress consent on file for inkatze/dotfiles), one pass, prompt gitleaks-clean. Diff: origin/main...HEAD at 9800629 plus the base's op-render supplement logic as context. Converged at iteration 1: nothing to apply, no forks. No writer lock taken, no write made. / / | #​ | Lens | Finding | Disposition | / | --- | --- | --- | --- | / | 1 | Correctness | fixed `%570` pane in the relay rule | declined: operator chose the fixed pane | / | 2 | Security | `fleet-streamjson.sh answer *` glob | declined: operator accepted the documented exposure | / | 3 | Error handling | pin-check jq validity check hides a missing file | declined: unchanged pre-existing line, message still fails closed | / | 5 | Concurrency | shared tmux paste buffer races | declined: single hub, already in the declined log | / | 7 | Docs | allocation_*_offload undocumented | dropped: planwright owns and documents those knobs | / | 8 | Tests | exact negative match at op-render-test.sh:922 | dropped: the harvest copies the line verbatim and `[ ! -e "$sup" ]` independently catches any harvest | / | 9 | Cross-file consistency | settings.json "tracked once un-ignored" vs "un-ignores one path" | dropped: conditional future vs current state, consistent | / | 4, 6 | Performance, Naming | none | - |

Ended on 9800629e8451.

  • Warning: polish and panel-review declared isolated, run in-session by the launch brief

Steps at pre-pr (run 000003)

# Step Kind Target Hosting Backend Session Head Start End Outcome Excerpt Output
none

Ended on 9800629e8451.

Steps at post-pr (run 000003)

# Step Kind Target Hosting Backend Session Head Start End Outcome Excerpt Output
1 bot-review skill bot-review in-session in-session 9800629 2026-11-09T17:51:31Z 2026-11-09T17:51:31Z skipped: missing (not run by operator decision via the hub (cubic-quota, usage-pause rules): cubic quota reserved for other PRs; the gemini panel review (000003 convergence 004) stands in for the bot review)

Ended on 9800629e8451.

  • Warning: bot-review not run: operator replaced it with the panel review (cubic quota)

Steps at pre-ci (run 000004)

# Step Kind Target Hosting Backend Session Head Start End Outcome Excerpt Output
none

Ended on 5db2c9f312d9.

Steps at convergence (run 000004)

# Step Kind Target Hosting Backend Session Head Start End Outcome Excerpt Output
1 polish skill polish in-session in-session 5db2c9f 2026-11-09T21:12:53Z 2026-11-09T21:17:00Z passed
2 panel-review skill panel-review in-session in-session 5db2c9f 2026-11-09T21:17:12Z 2026-11-09T21:23:44Z passed

Ended on 5db2c9f312d9.

Steps at pre-pr (run 000004)

# Step Kind Target Hosting Backend Session Head Start End Outcome Excerpt Output
none

Ended on 5db2c9f312d9.

Steps at post-pr (run 000004)

# Step Kind Target Hosting Backend Session Head Start End Outcome Excerpt Output
1 bot-review skill bot-review in-session in-session 5db2c9f 2026-11-09T21:24:12Z 2026-11-09T21:24:12Z skipped: missing (not run by operator decision via the hub (cubic-quota rule): cubic quota reserved for other PRs; the gemini panel review (000004 convergence 003) stands in for the bot review)

Ended on 5db2c9f312d9.


Summary by cubic

Merges the global Claude allow rules with what planwright already provides and carries over the hub's live-only rules that the next render would drop, since the merge replaces permissions.allow wholesale. Nothing is removed: planwright's own allow layers reach only the sessions it launches with --settings, so the hand-started hub and ordinary interactive sessions still need these rules.

  • The three plugin-cache rules (fleet-streamjson.sh answer and pending, mc-reclaim.sh reclaim) write the version directory as *, so no rule goes stale on a planwright update. The glob pre-approves any command containing that path and verb, an accepted exposure documented in docs/claude-config.md. The pin check now takes only the tracked settings, fails on any concrete version, and CI runs its suite.
  • gh pr review, tmux send-keys, and tmux kill-window stay out of the global layer, since a global allow reaches every dispatched worker and send-keys can type into any pane; their durable home would be the hub repo's own per-repo .claude/settings.json, once its un-ignore is tracked.
  • tmux kill-pane -t %* is allowed, with ask rules prompting when a flag after the pane id (-a kills every other pane) or a ; separator appears.
  • The relay rule is the exact ssh ... planwright-relay '<tmux paste>' command with no wildcard; any extra word would run on the remote side.
  • Adds a planwright-relay ssh alias reusing the existing LAN item's server host and user fields — no new 1Password field — with no agent forwarding and BatchMode yes. The system-wide locale SendEnv still applies. The alias exists only after the LAN config renders.
  • Sets the planwright offload tier (allocation_model_offload: sonnet, allocation_effort_offload: medium) and mission_control_guidance: standard in the adopter layer. Since the template now declares the guidance default, the overlay render test checks a planted write is dropped rather than that no guidance line exists, and the template comment no longer claims a knob write is rendered over.

Written for commit 5db2c9f. Summary will update on new commits.

View guided diff Turn on auto-fix

…hub's live rules

Unpin the plugin-cache rules to a version glob so a planwright update no
longer strands them, and keep the read-only and hub rules the hand-started
mission-control hub needs, since planwright's profiles reach only the
sessions it launches. Set the offload tier and mission-control guidance in
the adopter layer.
…ane kills

Keep only the answer rule on a version glob, which also matches unrelated
commands containing its path, and document that exposure. Pin pending and
reclaim back to the installed version. Allow the hub to kill one pane by id,
with ask rules for a trailing flag or a tmux command separator.
…ssion

The rule names a fixed ssh alias, rendered from the existing LAN item's
server host and user with no agent or environment forwarding, so the public
file carries no hostname and no wildcard lets extra remote words through.
The pending and reclaim rules now take `*` for the version directory like
the answer rule, so no rule goes stale on a planwright update. The pin check
takes only the tracked settings and fails on any concrete version; CI runs
its suite. The broad tmux send-keys, tmux kill-window and gh pr review allows
leave the global layer, since a global allow reaches every dispatched worker.
The per-repo .claude/settings.json the hub's broad rules would live in is
gitignored today, so name the un-ignore it needs. The relay alias's comment
claimed no environment forwarding, but the system-wide locale SendEnv still
applies; say what the block actually withholds.
…c-corp-worker-9b008db4

# Conflicts:
#	roles/ssh/files/config.lan.tpl
… kept mission-control writes

The template now declares mission_control_guidance, so the no-snapshot
render test checks that the planted write is dropped rather than that no
guidance line exists, and the template comment no longer says a knob
write is rendered over.
@inkatze
inkatze marked this pull request as ready for review November 9, 2026 23:03
@inkatze
inkatze merged commit 811e1e7 into main Nov 9, 2026
12 checks passed
@inkatze
inkatze deleted the planwright/flight/mc-c-corp-worker-9b008db4 branch November 9, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0