The Operator's own settings allow SendMessage and ListAgents: an Operator-only rule beside the city's allow list #81

Merged
city-root merged 1 commit from worker/gascitypacks-f4a2 into main 2026-11-12 15:32:11 +00:00
Contributor

The Operator's own settings (the roles pack's overlay roles/agents/operator/overlay/per-provider/claude/.claude/settings.json) now allow SendMessage and ListAgents beside Bash(gc *) and Bash(bd *). The user's decision of 2026-11-12: an Operator-only rule. Bead gascitypacks-f4a2. Stage 2 of dropping bypass mode (gascity-root#43, root-zib).

Changes: the two entries in the overlay; tests/operator-overlay.sh, run by CI's lint job beside tests/reviewer.sh; a changelog fragment (.changelog/operator-overlay-messaging.md).

1. How the rule reaches the Operator: with the city's list, not in place of it

  • Claude Code (https://code.claude.com/docs/en/settings, "Settings precedence" and "Lists merge instead of overriding"): --settings <file> sits at the "Command line" level, above project settings. "When you set the same list key, such as permissions.allow, in more than one file, Claude Code combines the lists instead of picking one." So the city's --settings <city>/.gc/settings.json (the allow list of <city>/.claude/settings.json) and the Operator's project file merge. The project file is read from the session's primary working directory (same page, "Where Claude Code keeps the local file"), which for the Operator is .gc/agents/operator, where gc puts the overlay.
  • gc at the city's pin 6bd609f (internal/overlay/overlay.go, copyOrMergeFile; internal/overlay/merge.go, MergeSettingsJSON): gc copies the overlay's per-provider/claude/ into the work directory at each session start. .claude/settings.json is a mergeable path: if the file exists, gc merges the overlay over it, and a top-level key other than hooks is the overlay's (last writer wins), so permissions is the overlay's as written; hooks are unioned. gc does not touch the city's list: that is <city>/.gc/settings.json, gc's own file, reached by --settings. The live Operator's .gc/agents/operator/.claude/settings.json is exactly this merge result today.
  • What the city does when it imports this: gascity-root's assets/overlays/operator/per-provider/claude/.claude/settings.json is a copy (the city's patch overlay_dir replaces the pack's overlay, it does not add to it), and CI's step "operator overlay matches the roles pack" runs cmp on the two. The pull request of the city that moves the roles pin to the release carrying this must copy this file byte for byte to that path, or its config job fails.
  • Not tried: I did not start an Operator with acceptEdits to watch a call go through; the reading is from the documentation and source above. One more documented condition: permissions.allow rules from a shared project file apply only after the folder is trusted ("A committed key doesn't reach teammates", second bullet). The two new rules sit in the same file and scope as the existing Bash(gc *) and Bash(bd *), so they take effect wherever those do.

2. No other agent gets the two names

In a throwaway city that imports roles and forgejo at the city and in a rig, gc config show --json gives OverlayDir to one agent only: the Operator (roles/agents/operator/overlay); the Worker and the Reviewer, of the city and of the rig, resolve to an empty OverlayDir. Neither pack has a pack-level overlay/ directory (gc gives one to every agent of the pack), and neither the Worker's nor the Reviewer's agent files name the tools. tests/operator-overlay.sh checks all of this, and it fails on the overlay as it was before this change (I ran it so).

3. Other tools the Operator uses that neither list covers

From the Operator's own transcripts (.../-Users-mikluko-Forge-mikluko-gascity-root--gc-agents-operator/*.jsonl, 12 sessions, the Operator's calls only, not its sub-agents'): Bash 1294, Agent 88, Read 66, SendMessage 60, Write 50, Edit 47, Skill 37, AskUserQuestion 12, ToolSearch 8, TaskStop 3, ListAgents 3. Everything except AskUserQuestion is on the city's list or is added here. AskUserQuestion (the question dialog the Operator's skills use for decisions) is on neither list. The tools reference (https://code.claude.com/docs/en/tools-reference) says it needs no permission, and the call is the dialog itself, which waits for the user either way, so I did not add it. The tools the reference marks as needing permission and that neither list names (ExitPlanMode, EnterWorktree, NotebookEdit, Workflow, Artifact) do not appear in the transcripts or in the Operator's skills.

4. Something the reading found, for the Operator and the user to weigh

The tools reference gives "Permission required: No" for both SendMessage and ListAgents (as for Agent, TaskStop and ToolSearch, which the city's list names anyway), and the cross-session messaging page (https://code.claude.com/docs/en/cross-session-messaging) says same-machine messages prompt for nothing; its only approval is isolatePeerMachines, for a session beyond this machine. By that reading an Operator on acceptEdits is not prompted for either call, and the explicit rule is harmless but not needed for the prompt this bead was filed for; I made it as decided and did not test it. The same page says the way to stop a session sending and listing is a deny rule naming the two tools. The Worker and the Reviewer are on unrestricted here, and nothing in this change or in the city's list denies them: the bead's premise that they "must not message or list other sessions" is held by nothing but this overlay not allowing them, which stops only a mode that prompts. A deny of the two names for the Worker and the Reviewer is a separate piece of work, which I did not do on this branch.

Checks run

bash tests/operator-overlay.sh (new, passes; fails on the old overlay), bash tests/reviewer.sh, go vet ./..., gc lint ., and the v2 changelog checker with -base main (valid=true). The new test adds no shell logic beyond what the existing tests have (docs/shell.md budget: a test script, no new script or order).

Bead: gascitypacks-f4a2

The Operator's own settings (the roles pack's overlay `roles/agents/operator/overlay/per-provider/claude/.claude/settings.json`) now allow `SendMessage` and `ListAgents` beside `Bash(gc *)` and `Bash(bd *)`. The user's decision of 2026-11-12: an Operator-only rule. Bead gascitypacks-f4a2. Stage 2 of dropping bypass mode (gascity-root#43, root-zib). Changes: the two entries in the overlay; `tests/operator-overlay.sh`, run by CI's `lint` job beside `tests/reviewer.sh`; a changelog fragment (`.changelog/operator-overlay-messaging.md`). ## 1. How the rule reaches the Operator: with the city's list, not in place of it - **Claude Code** (https://code.claude.com/docs/en/settings, "Settings precedence" and "Lists merge instead of overriding"): `--settings <file>` sits at the "Command line" level, above project settings. "When you set the same list key, such as `permissions.allow`, in more than one file, Claude Code combines the lists instead of picking one." So the city's `--settings <city>/.gc/settings.json` (the allow list of `<city>/.claude/settings.json`) and the Operator's project file merge. The project file is read from the session's primary working directory (same page, "Where Claude Code keeps the local file"), which for the Operator is `.gc/agents/operator`, where gc puts the overlay. - **gc at the city's pin 6bd609f** (`internal/overlay/overlay.go`, `copyOrMergeFile`; `internal/overlay/merge.go`, `MergeSettingsJSON`): gc copies the overlay's `per-provider/claude/` into the work directory at each session start. `.claude/settings.json` is a mergeable path: if the file exists, gc merges the overlay over it, and a top-level key other than `hooks` is the overlay's (last writer wins), so `permissions` is the overlay's as written; hooks are unioned. gc does not touch the city's list: that is `<city>/.gc/settings.json`, gc's own file, reached by `--settings`. The live Operator's `.gc/agents/operator/.claude/settings.json` is exactly this merge result today. - **What the city does when it imports this**: gascity-root's `assets/overlays/operator/per-provider/claude/.claude/settings.json` is a copy (the city's patch `overlay_dir` replaces the pack's overlay, it does not add to it), and CI's step "operator overlay matches the roles pack" runs `cmp` on the two. The pull request of the city that moves the roles pin to the release carrying this must copy this file byte for byte to that path, or its `config` job fails. - **Not tried**: I did not start an Operator with `acceptEdits` to watch a call go through; the reading is from the documentation and source above. One more documented condition: `permissions.allow` rules from a shared project file apply only after the folder is trusted ("A committed key doesn't reach teammates", second bullet). The two new rules sit in the same file and scope as the existing `Bash(gc *)` and `Bash(bd *)`, so they take effect wherever those do. ## 2. No other agent gets the two names In a throwaway city that imports `roles` and `forgejo` at the city and in a rig, `gc config show --json` gives `OverlayDir` to one agent only: the Operator (`roles/agents/operator/overlay`); the Worker and the Reviewer, of the city and of the rig, resolve to an empty `OverlayDir`. Neither pack has a pack-level `overlay/` directory (gc gives one to every agent of the pack), and neither the Worker's nor the Reviewer's agent files name the tools. `tests/operator-overlay.sh` checks all of this, and it fails on the overlay as it was before this change (I ran it so). ## 3. Other tools the Operator uses that neither list covers From the Operator's own transcripts (`.../-Users-mikluko-Forge-mikluko-gascity-root--gc-agents-operator/*.jsonl`, 12 sessions, the Operator's calls only, not its sub-agents'): Bash 1294, Agent 88, Read 66, SendMessage 60, Write 50, Edit 47, Skill 37, AskUserQuestion 12, ToolSearch 8, TaskStop 3, ListAgents 3. Everything except `AskUserQuestion` is on the city's list or is added here. **`AskUserQuestion`** (the question dialog the Operator's skills use for decisions) is on neither list. The tools reference (https://code.claude.com/docs/en/tools-reference) says it needs no permission, and the call is the dialog itself, which waits for the user either way, so I did not add it. The tools the reference marks as needing permission and that neither list names (`ExitPlanMode`, `EnterWorktree`, `NotebookEdit`, `Workflow`, `Artifact`) do not appear in the transcripts or in the Operator's skills. ## 4. Something the reading found, for the Operator and the user to weigh The tools reference gives "Permission required: No" for both `SendMessage` and `ListAgents` (as for `Agent`, `TaskStop` and `ToolSearch`, which the city's list names anyway), and the cross-session messaging page (https://code.claude.com/docs/en/cross-session-messaging) says same-machine messages prompt for nothing; its only approval is `isolatePeerMachines`, for a session beyond this machine. By that reading an Operator on `acceptEdits` is not prompted for either call, and the explicit rule is harmless but not needed for the prompt this bead was filed for; I made it as decided and did not test it. The same page says the way to stop a session sending and listing is a deny rule naming the two tools. The Worker and the Reviewer are on `unrestricted` here, and nothing in this change or in the city's list denies them: the bead's premise that they "must not message or list other sessions" is held by nothing but this overlay not allowing them, which stops only a mode that prompts. A deny of the two names for the Worker and the Reviewer is a separate piece of work, which I did not do on this branch. ## Checks run `bash tests/operator-overlay.sh` (new, passes; fails on the old overlay), `bash tests/reviewer.sh`, `go vet ./...`, `gc lint .`, and the v2 changelog checker with `-base main` (`valid=true`). The new test adds no shell logic beyond what the existing tests have (docs/shell.md budget: a test script, no new script or order). Bead: gascitypacks-f4a2
feat: the Operator's overlay allows SendMessage and ListAgents (gascitypacks-f4a2)
All checks were successful
test / changelog (pull_request) Successful in 5s
test / lint (pull_request) Successful in 22s
test / scripts (pull_request) Successful in 39s
644d466fe1
Stage 2 of dropping bypass mode puts the Operator on acceptEdits with the city's allow list. The Operator calls two tools that list does not name: SendMessage (it resumes a reviewing sub-agent with it) and ListAgents. The city's list reaches every Claude session of the city, so the rule belongs to the Operator alone: it goes in the roles pack's Operator overlay, which already adds Bash(gc *) and Bash(bd *).

Only the Operator has an overlay_dir; gc resolves none for the Worker or the Reviewer (of the city or of a rig), and neither pack has a pack-level overlay/, which would go to every agent. tests/operator-overlay.sh holds the overlay's allow list and hook, and those facts, against a throwaway city that imports both packs; CI runs it in the lint job beside tests/reviewer.sh.

Validation: bash tests/operator-overlay.sh passes, and fails on the overlay as it was before this commit.
city-root-review left a comment

Review of 644d466fe1 for gascitypacks-f4a2. Checks of the head: success.

Verdict

pass

Findings

  • [minor] tests/operator-overlay.sh:114: the check that no other agent names the two tools greps only roles/agents/worker and forgejo/agents. The shared skills the Worker and the Reviewer load (city, contact) are not covered. They are prompts, not permissions, so this is about coverage only. Widening the grep to the shared skills, or saying in the comment that they are out of scope, would close it.
  • [minor] tests/operator-overlay.sh:14: trap 'rm -rf "$tmp"' EXIT removes a path that comes from $(mktemp -d ...). The work bead says "Never rm -rf a path that comes from a command substitution". The line copies tests/reviewer.sh:13 and every other test in tests/, and I read the bead's rule as being about the Worker's own commands, not about test code. Noted here so that the Operator can decide.
  • [note, not a defect of this change] Section 4 of the description: by the Claude Code tools reference, SendMessage and ListAgents need no permission, so the new allow rules may not be needed against the prompt the bead was filed for. Nothing denies the two tools to the Worker or the Reviewer either. The bead's premise, that they "must not message or list other sessions", is held only in modes that prompt. A deny rule for those agents is separate work. The Operator should take this to the user.

Verified

  • The work bead's five items against the diff. (1) The overlay allows exactly Bash(gc *), Bash(bd *), SendMessage and ListAgents, the hooks are unchanged and the JSON is valid. (2)–(4) are answered in the description with the pages and the gc source they cite: how the lists merge, what the city must copy byte for byte to assets/overlays/operator/..., which agents get the overlay, and that AskUserQuestion is the one tool on neither list. (5) A new test, run by the lint job, and a changelog fragment in main's form (### Added).
  • Merged the head into origin/main (be97be3) in a clean clone: the merge is clean and the forge says mergeable.
  • I ran these on the merge result, with the city's variables removed (proved: 0 GC_/REX_/BD_ variables). gc lint . passed with 2 packs ok. bash tests/operator-overlay.sh printed ok. bash tests/reviewer.sh and bash tests/formula.sh printed ok. go vet ./... was clean and go test -race ./... passed. The changelog checker v2.1.0 (the v2 tag), built from its tagged source, gave valid=true with -base main.
  • Put main's overlay back in the merged tree and ran the new test: it fails with "the overlay allows [Bash(gc *),Bash(bd *)], not [...]". So the test tests the change.
  • docs/shell.md, section 3.4, keeps in tests/ "whatever runs the real gc", and this test runs the real gc in a throwaway city. It adds no script the city runs.
  • No README section is needed: the README does not describe the Operator's overlay.
Review of 644d466fe14de28c1e18e92f24316c2a4a261d13 for gascitypacks-f4a2. Checks of the head: success. ### Verdict pass ### Findings - [minor] tests/operator-overlay.sh:114: the check that no other agent names the two tools greps only `roles/agents/worker` and `forgejo/agents`. The shared skills the Worker and the Reviewer load (`city`, `contact`) are not covered. They are prompts, not permissions, so this is about coverage only. Widening the grep to the shared skills, or saying in the comment that they are out of scope, would close it. - [minor] tests/operator-overlay.sh:14: `trap 'rm -rf "$tmp"' EXIT` removes a path that comes from `$(mktemp -d ...)`. The work bead says "Never rm -rf a path that comes from a command substitution". The line copies `tests/reviewer.sh:13` and every other test in `tests/`, and I read the bead's rule as being about the Worker's own commands, not about test code. Noted here so that the Operator can decide. - [note, not a defect of this change] Section 4 of the description: by the Claude Code tools reference, `SendMessage` and `ListAgents` need no permission, so the new allow rules may not be needed against the prompt the bead was filed for. Nothing denies the two tools to the Worker or the Reviewer either. The bead's premise, that they "must not message or list other sessions", is held only in modes that prompt. A deny rule for those agents is separate work. The Operator should take this to the user. ### Verified - The work bead's five items against the diff. (1) The overlay allows exactly `Bash(gc *)`, `Bash(bd *)`, `SendMessage` and `ListAgents`, the hooks are unchanged and the JSON is valid. (2)–(4) are answered in the description with the pages and the gc source they cite: how the lists merge, what the city must copy byte for byte to `assets/overlays/operator/...`, which agents get the overlay, and that `AskUserQuestion` is the one tool on neither list. (5) A new test, run by the `lint` job, and a changelog fragment in main's form (`### Added`). - Merged the head into origin/main (be97be3) in a clean clone: the merge is clean and the forge says `mergeable`. - I ran these on the merge result, with the city's variables removed (proved: 0 GC_/REX_/BD_ variables). `gc lint .` passed with 2 packs ok. `bash tests/operator-overlay.sh` printed ok. `bash tests/reviewer.sh` and `bash tests/formula.sh` printed ok. `go vet ./...` was clean and `go test -race ./...` passed. The changelog checker v2.1.0 (the `v2` tag), built from its tagged source, gave `valid=true` with `-base main`. - Put main's overlay back in the merged tree and ran the new test: it fails with "the overlay allows [Bash(gc *),Bash(bd *)], not [...]". So the test tests the change. - docs/shell.md, section 3.4, keeps in `tests/` "whatever runs the real gc", and this test runs the real gc in a throwaway city. It adds no script the city runs. - No README section is needed: the README does not describe the Operator's overlay.
Commenting is not possible because the repository is archived.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mikluko/gascitypacks!81
No description provided.