Skip to content

chore(claude): allow dev commits and card-branch pushes - #35443

Merged
os-zhuang merged 4 commits into
mainfrom
claude/project-thread-xmk6ug
Nov 24, 2026
Merged

os-zhuang merged 4 commits into
mainfrom
claude/project-thread-xmk6ug

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ

What changes

.claude/settings.json:

  • permissions.allow gains two entries:
    "Bash(git commit -F *)",
    "Bash(git push -u origin claude/issue-*)"
    
  • A new permissions.ask list holds three entries scoped to those two rules, so that only the bare forms run without approval. Ask takes precedence over allow.
    "Bash(git commit -F * *)",
    "Bash(git push -u origin claude/issue-* *)",
    "Bash(git push -u origin claude/issue-*:*)"
    

Why

The maintainer chose to allow these durably on 2026-11-19 (in the data-2 thread), and agreed at 09:25Z to the seat opening this PR. Card developers' commits on two card branches (#35401, #35047) were stopped for an approval no one was present to give. The maintainer merges this PR himself.

Reach

  • Runs without approval: exactly git commit -F FILE and git push -u origin claude/issue-BRANCH, the forms os-dev uses.
  • Still asks: anything after the message file (for example -a, --amend, -n, --no-verify or a pathspec), anything after the card branch (a second refspec, a tag, a force, delete, prune or mirror flag, --no-verify), and a src:dst refspec on the card branch.
  • Spelling: a message file path containing a space also asks, because the matcher reads the space as "something after". A push or commit spelt any other way (-m, a bare git push) still asks, as today.
  • Chained lines: a line that starts with either allowed form and continues (for example the commit chained to the push, or the push piped into tail) asks, because ask rules are tried against the whole line. Developers type each command on its own.
  • Commit spelling: os-dev.md names no commit spelling yet; a follow-up adds git commit -F FILE there.
  • Other sessions: every rule starts with the allowed command's own prefix, so no push or commit outside these two forms changes behaviour.
  • Unchanged: main's ruleset (merge queue, no force-push, no deletion), the deny roster (17 GitHub content-write tools) and the hooks.

Verification

  • node scripts/pm/check-settings-deny-roster.mjs passes locally.
  • The file parses as JSON.
  • The contract review records (round 1, delta 1) are on this PR, and a delta on this head follows.

Clause-②: no
Metadata-protocol: none

🤖 Generated with Claude Code

https://claude.ai/code/session_01Utp6CbUb7TcZK1XUAddUmQ

Adds two permissions.allow entries so card developers can commit and push
their card branch without a per-command approval:
- Bash(git commit -F *)
- Bash(git push -u origin claude/issue-* *)

Maintainer ruling: Bill chose this on 2026-11-19 (data-2 thread) and agreed
to the seat opening this PR (09:25Z).

Claude-Session: https://claude.ai/code/session_01Utp6CbUb7TcZK1XUAddUmQ
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 19, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: ba0ec7c92b3476951c7ef42898477b7efc7def53
Local-runs: probe — text search of the rule matcher inside the installed Claude Code 2.1.328 bundle, nothing executed: no file in the repo states what a two-wildcard Bash rule matches
Scope: .claude/settings.json + none
Security-touching: yes
The diff widens what an agent session may run without a prompt: a commit, and a push to the remote.

① Derived judgments

  • Net diff against main: one file, .claude/settings.json, 3 added and 1 removed. Two entries are appended to permissions.allow (85 to 87). permissions.deny (17 entries) and hooks are byte-identical. The file parses. Right as described.
  • Nothing published moves: no package, schema, export, route or doc. The surface that moves is the agent permission surface, and this file is read by every session opened in the repo, PM seats and a session on a maintainer's own machine included, not card developers alone.
  • Client-side enforcement that could restrain the two commands, read in the tree: none. The four Bash PreToolUse hooks (guard-shared-stash, guard-process-kill, guard-main-checkout-bash, guard-tree-enum) read neither git commit nor git push. No deny entry names Bash. check-settings-deny-roster asserts the mcp__github__ deny set alone and, by its own header, does not read allow. So for whatever these two entries match, the entry is the whole client-side decision.

② Semver level

skip-changeset is right: the diff publishes nothing from any released package. The body carries Clause-②: no and Metadata-protocol: none, both right. Check Changeset concluded success.

③ Boundary flags

No card, so no dev flags and no open_questions. The PR body's claims stand in their place, each read against the tree:

  • "the same Bash(cmd *) wildcard form as the file's other entries": true of the spelling, wrong of the effect for the push entry (M1).
  • "The commit rule ... does not allow git add, reset or rebase": true of those commands (N1 for what rides after the message file).
  • "The push rule matches by prefix": wrong on this head. It does not match the prefix command itself (M1). The body's own example, git push -u origin claude/issue-1:main, does not match either, for the same reason; the class it stands for matches as soon as any argument follows (S1).
  • "What keeps main safe is its branch protection and merge queue": holds as read over REST with the session's credential. Ruleset main (id 12119582) is active on the default branch with deletion, non_fast_forward, merge_queue, pull_request and required_status_checks; current_user_can_bypass reads never. The bypass-actor list is not readable with this credential (it returns null), so the claim is established for the fleet identity and not for any other.
  • "The deny roster is unchanged": true. "Deny entries and hooks still run first": true of precedence, and empty for these two commands (①).
  • "check-settings-deny-roster passes on this head": its step lives in Lint · repo & tooling gates, which concluded success.
  • SQL push-down: not applicable, the diff holds no query code.

Check-runs on the head at reading: Governed Surface Queue Guard, Test Core, Test UI, Dogfood Regression Gate, Check Changeset, Check PR Size, the PR-body guards, Type Check · workspace, Type Check · source gates and every Lint · lane but one concluded success. Lint · CI, release & engine gates and the Type Check · lanes consumer gates and debt ledger were still in progress, so the head is not green yet. No check concluded failure.

④ Design judgment

.claude/settings.json, judged against the ruling (commits and card-branch pushes run without an approval) and against its first consumer, .claude/agents/os-dev.md rule 1, which prescribes git push -u origin BRANCH on a branch named claude/issue-N-slug.

M1 (must-fix) — the push entry does not match the bare card-branch push it exists for. The matcher turns each * into "any run of characters" and makes a trailing space-plus-wildcard optional only when that wildcard is the pattern's ONLY one. Bash(git push -u origin claude/issue-* *) carries two, so it means: git push -u origin claude/issue-, any run, ONE SPACE, any run. git push -u origin claude/issue-35401-slug ends at the branch name and has no such space, so it is not matched and meets the same approval stop as before. What the entry does match is every spelling with a further argument after the branch. The file's other two-wildcard entries are curl lines that always carry trailing header arguments, which is why the same spelling works there and not here; Bash(git commit -F *) has one wildcard and is unaffected. The single-wildcard spelling Bash(git push -u origin claude/issue-*) matches the bare command and every longer one. That is read from the matcher, not run.

S1 (should-fix) — where the push entry matches, it is not confined to a card branch. Everything after claude/issue- is free text, on this head and equally after the M1 respelling. Matching forms include a second refspec (git push -u origin claude/issue-1 HEAD:OTHER, the same with a leading plus, or :OTHER to delete), --force, --delete, --mirror, --tags, a tag name, and --no-verify. Server side main alone is protected: the protected-branch listing returns main only, there is no tag ruleset, and no rule applies to claude/issue-*. For every other ref the prompt this entry removes was the last thing in front of rules that already bind every seat:

  • Multi-agent discipline §3: never force-push a shared branch, never bare --force. claude/issue-* is every developer's branch, not the caller's own.
  • Prime Directive 15: never push a version tag. changeset-release/main, the Version Packages head, is unprotected too.
  • .githooks/pre-push, which --no-verify skips, and whose header names it the place card relations in commit messages are refused.

The body discloses the :main case and none of these. The reach is damage to refs, not a publish: the only on: push triggers in .github/workflows/ are filtered to main. An allow wildcard cannot express "one refspec and no flag", so the entry cannot be narrowed by respelling it. What can hold the line is the file's own second mechanism: permissions.ask entries for the excess shapes (ask outranks allow), or a PreToolUse Bash guard in the shape of the four already registered. This closes by one of those in the tree, or by the maintainer's own word on the PR accepting the wider reach as stated here.

Nits:

  • N1 (nit) — the commit entry's wildcard carries anything after the message file: -a (stages every tracked change, the work of git add -u), --amend, pathspecs, and --no-verify, which skips .githooks/pre-commit. All local and reversible, and the push hook still collects a deferred regeneration, so no effect on the contract; the body's "does not allow git add" is true of the command and silent on staging.
  • N2 (nit) — each entry matches one spelling: git commit -F FILE (not -m, not git -C DIR commit, no flag before -F) and git push -u origin BRANCH (not a later bare git push, not git push origin BRANCH). os-dev.md names the push spelling and no commit spelling, and no instruction file teaches git commit -F, so a developer who spells either differently meets the same stop. A follow-up for the os-dev.md owner; that file is outside this diff, read and not reviewed.

Implemented-by: claude/project-thread-xmk6ug
Reviewed-by: isolated-l2-35443

VERDICT: FAIL

Contract review M1: a pattern with two wildcards needs trailing text, so the
bare `git push -u origin claude/issue-N-slug` did not match. Respelt as
`Bash(git push -u origin claude/issue-*)`.

Contract review S1: the push wildcard also reached force, delete, mirror,
tags, refspecs and --no-verify. Those forms now go to `permissions.ask`,
which takes precedence over allow, so they still stop for approval. The
same for `git commit --no-verify`.

Claude-Session: https://claude.ai/code/session_01Utp6CbUb7TcZK1XUAddUmQ
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/s and removed size/xs labels Nov 19, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 0c3601b1aa1ddfff2edcf1b7ac0a685dafeb6eda
Local-runs: probe — text search of the rule matcher and the deny, ask, allow order inside the installed Claude Code 2.1.328 bundle, nothing executed: no file in the repo states either
Scope: .claude/settings.json + none
Security-touching: yes
The diff widens what an agent session may run without a prompt, and adds the rules that decide which push and commit forms still ask.

Delta review of the round-1 record on the prior head. Read: the net diff against main on this head, the rewritten PR body, the check-runs on this head.

① Derived judgments

  • Net diff against main: one file, .claude/settings.json, 15 added and 1 removed. permissions.allow gains Bash(git commit -F *) and Bash(git push -u origin claude/issue-*) (85 to 87). A new permissions.ask list holds ten entries. permissions.deny (17) and hooks are byte-identical. The file parses.
  • Order of decision, read in the bundle: a matching deny rule decides first, then a matching ask rule, then a matching allow rule. So an ask entry outranks the allow entry, as the body says.
  • New since round 1: the nine push entries in ask begin git push *, so they read every git push in every session, not only the pushes the allow entry reaches (N3).

② Semver level

Unchanged and right: skip-changeset, Clause-②: no, Metadata-protocol: none. Check Changeset reads skipped on this head.

③ Boundary flags

The rewritten body, claim by claim:

  • "Ask takes precedence over allow": true (①).
  • "including the bare form os-dev uses": true (M1 below).
  • "It covers push with --force/-f, --delete/-d ...": -d is covered only when another argument follows it, and -f only when it starts its own token (S1).
  • "... are all asked, so they cannot rewrite or delete another ref": not true on this head for the trailing -d (S1).
  • Commit, "--no-verify is asked": true of the long form; git commit also spells it -n, which is not asked (N1).
  • "main is also protected by its ruleset": true as read in round 1.
  • "Other spellings ... still asks, as today": not exact for a push the ask list now catches (N3).
  • "Unchanged: the deny roster and the hooks": true. "check-settings-deny-roster passes": its step lives in Lint · repo & tooling gates, still in progress at reading.
  • "Contract review round 1 ... is on this PR": true, one comment naming the prior head.
  • SQL push-down: not applicable.

Check-runs on this head at reading: Governed Surface Queue Guard, Test Core, Test UI, Dogfood Regression Gate, Check PR Size, Lint · PM dispatch-gates, the three scoped lint lanes, Type Check · workspace and Type Check · debt ledger concluded success. Four Lint · lanes (CI, release & engine gates, ESLint, docs & code guards, repo & tooling gates) and two Type Check · lanes (consumer gates, source gates) were still in progress. One PR-body guards run is cancelled and its sibling concluded success. No check concluded failure. The head is not green yet.

④ Design judgment

M1: closed. Bash(git push -u origin claude/issue-*) has one wildcard and does not end in space-plus-wildcard, so it means git push -u origin claude/issue- followed by any run, the empty run included. git push -u origin claude/issue-35401-slug matches. The allow-only guard the matcher applies to wildcard rules does not bite this pattern.

Do the ask entries catch the plain card push? No. Each was read as the matcher compiles it against git push -u origin claude/issue-1-fix-foo:

  • * -f* and * -d * need a space directly before the dash. A branch name holds no space, so -fix-foo or -d inside a slug is never caught.
  • *:* needs a colon and * +* a space then a plus. A ref name can hold no colon, and the bare push has neither.
  • *--force*, *--delete*, *--mirror*, *--tags*, *--no-verify* would need the slug itself to carry the double-dash word.
  • git commit *--no-verify* does not touch git commit -F FILE.

One friction, in the safe direction: an ask wildcard is also tried against a whole chained or piped line, so a line that starts with the push and carries a colon or one of those flags anywhere later asks.

S1 (should-fix) — kept, narrowed: one ask entry misses its own form, and a plain second refspec still rides.

  • Bash(git push * -d *) carries two wildcards, so its trailing space-plus-wildcard is not optional: the same trap as M1. git accepts options after the refspecs, and git push -u origin claude/issue-999-other -d ends at -d. It matches the allow entry and no ask entry, so it deletes that remote card branch with no prompt. No ruleset covers claude/issue-*. Bash(git push * -d*), spelt like its -f sibling, catches both positions and still cannot catch a slug.
  • Not reached by any ask entry, all inside the allow entry's reach. The first is the ordinary spelling; the rest are read from git's documented option parsing, not run:
    • a further plain refspec: git push -u origin claude/issue-1 OTHER creates or fast-forwards another ref, and v1.2.3 or tag v1.2.3 pushes a tag (Prime Directive 15; no tag ruleset);
    • --follow-tags;
    • --prune with a pattern refspec, which deletes;
    • a bundled short flag (-qf, -qd);
    • a unique long-option prefix (--del, --mir, --no-veri).
  • An enumerated list cannot close that class. One entry can: Bash(git push -u origin * *) asks whenever anything follows the first refspec, leaving the bare push as the only promptless form. Its price is a prompt on a push line that is chained or piped.
  • This closes with the -d entry respelt, and the rest either asked or stated in the body for the maintainer to accept by his own merge.

Nits:

  • N1 (nit) — narrowed. The body now states -a, --amend and pathspecs. git commit -F FILE -n is the short spelling of --no-verify and is not asked. Local, and the push hook still collects.
  • N2: closed for this PR. The body states that other spellings still stop. The os-dev.md follow-up stands.
  • N3 (nit) — the nine push ask entries reach every git push in every session. --force-with-lease=BRANCH:SHA, the only force form Multi-agent discipline §3 permits, and any SRC:DST push now ask by rule wherever they are typed. The bundle's own text says that a run where nobody can be asked denies such a call. That may be exactly what is wanted; "still asks, as today" does not say it. Prefixing the entries git push -u origin claude/issue-* would confine them to the allow entry's reach.

Implemented-by: claude/project-thread-xmk6ug
Reviewed-by: isolated-l2-35443

VERDICT: PASS

Contract review delta S1/N3: an enumerated flag list cannot close the class
(bundled short flags, option prefixes, extra refspecs, a trailing -d), and
`git push *` entries reached every push in every session. Replaced by three
entries scoped to the two allow rules: anything after the commit message
file asks, anything after the card branch asks, and a colon refspec on the
card branch asks. The bare forms stay allowed.

Claude-Session: https://claude.ai/code/session_01Utp6CbUb7TcZK1XUAddUmQ
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/xs and removed size/s labels Nov 19, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 1255c914abf397e007f5340814f2f6ab6d976a31
Local-runs: probe — text search of the rule matcher, the deny, ask, allow order and the command analysis inside the installed Claude Code 2.1.328 bundle, nothing executed: no file in the repo states them
Scope: .claude/settings.json + none
Security-touching: yes
The diff widens what an agent session may run without a prompt, and adds the rules that keep every longer form of those two commands asking.

Second delta, on the record for the prior head. Read: the net diff against main on this head, the rewritten PR body, the check-runs on this head.

① Derived judgments

  • Net diff against main: one file, .claude/settings.json, 8 added and 1 removed. permissions.allow gains Bash(git commit -F *) and Bash(git push -u origin claude/issue-*) (85 to 87). A new permissions.ask list holds three entries. permissions.deny (17) and hooks are byte-identical. The file parses.
  • As the matcher compiles them:
    • allow, commit: git commit -F, then nothing or a space and any run.
    • allow, push: git push -u origin claude/issue- and any run.
    • ask, commit: git commit -F , any run, ONE SPACE, any run.
    • ask, push: git push -u origin claude/issue-, any run, ONE SPACE, any run.
    • ask, refspec: git push -u origin claude/issue-, any run, a colon, any run.
  • Order of decision, as read in delta 1: deny, then ask, then allow.

② Semver level

Unchanged and right: skip-changeset, Clause-②: no, Metadata-protocol: none.

③ Boundary flags

The rewritten body, claim by claim:

  • "only the bare forms run without approval. Ask takes precedence over allow": true.
  • "Runs without approval: exactly git commit -F FILE and git push -u origin claude/issue-BRANCH": true when either is typed as its own command. At the head of a chained or piped line it asks (N4).
  • "the forms os-dev uses": true of the push; os-dev.md names no commit spelling (the N2 follow-up).
  • "Still asks: anything after the message file ..., anything after the card branch ..., and a src:dst refspec": true, each checked in ④.
  • "a message file path containing a space also asks": true.
  • "every rule starts with the allowed command's own prefix, so no push or commit outside these two forms changes behaviour": true of the prefixes; the one exception is the chained line of N4.
  • "Unchanged: main's ruleset, the deny roster and the hooks": true.
  • "check-settings-deny-roster passes locally": its CI step lives in Lint · repo & tooling gates, still in progress at reading.
  • "The contract review records (round 1, delta 1) are on this PR": true, two comments.
  • SQL push-down: not applicable.

Check-runs on this head at reading: Governed Surface Queue Guard, Test Core, Test UI, Dogfood Regression Gate, Check PR Size, Lint · PM dispatch-gates and the three scoped lint lanes concluded success. Four Lint · lanes (CI, release & engine gates, ESLint, docs & code guards, repo & tooling gates) and all four Type Check · lanes were still in progress. One PR-body guards run is cancelled and its sibling concluded success. No check concluded failure. The head is not green yet, and this record does not stand in for those conclusions.

④ Design judgment

No must-fix, no should-fix.

M1: closed. The bare git push -u origin claude/issue-35401-slug matches the allow entry and neither push ask entry: after claude/issue- it holds no space and no colon. The bare git commit -F FILE matches its allow entry and not its ask entry: one token follows -F, so there is no second space.

S1: closed. Every form the two earlier records listed now meets an ask entry before the allow entry is read:

  • a further refspec, a tag name or tag NAME, --follow-tags, --prune with a pattern, a bundled -qf or -qd, a long-option prefix such as --del, a trailing -d, --force in any spelling, --no-verify: each puts a space after the branch token, so the push ask entry matches;
  • claude/issue-1:main and any other SRC:DST on the card token: the refspec ask entry matches with no space needed;
  • git commit -F FILE followed by -n, --no-verify, -a, --amend or a pathspec: the commit ask entry matches.

What is left inside the allow entries' reach with no ask entry is one token and nothing else. For the push that is a single refspec beginning claude/issue-, with no colon, pushed without force through the pre-push hook: it creates or fast-forwards the remote branch of that name. That is any card branch, not only the caller's own, which is what the ruling's words cover. For the commit it is the message file. Shell operators cannot ride in the token: a chained line is split and each command is judged alone for allow. Brace expansion inside the token is refused as unanalysable before any rule is read, so it asks.

Nits:

  • N1: closed. -n now asks.
  • N2: closed for this PR. The os-dev.md follow-up stands: that file names no commit spelling.
  • N3: closed. All three ask entries begin with their allow entry's own literal.
  • N4 (nit) — an ask wildcard is also tried against a whole chained or piped line. A line that BEGINS with either allowed form and continues, such as the commit followed by a chained push, or the push piped into tail, asks by rule. A trailing stderr redirect alone should not, since rules are tried against the command with its redirections removed; I did not trace that step to its end. The asking is the safe direction and matches the fleet's own reading that a refused compound is retried as bare actions (platform-readings.md), but the body's "exactly" and "no ... changes behaviour" lines do not say it, and a developer has to know to type each command alone.
  • N5 (nit) — not settled from the bundle: an unquoted variable or command substitution completing the branch or file token could word-split into further arguments at run time while the typed text holds no space. The analysis that refuses brace expansion sits in the same place, and I did not establish what it does with those two shapes. It is the deliberate-evader shape the repo's own Bash guards leave open by declared choice.

Implemented-by: claude/project-thread-xmk6ug
Reviewed-by: isolated-l2-35443

VERDICT: PASS

@os-zhuang
os-zhuang enabled auto-merge November 24, 2026 10:35
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit 5385759 Nov 24, 2026
43 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-xmk6ug branch November 24, 2026 11:16
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…ch (objectstack-ai#38077)

Closes objectstack-ai#38074

Clause-②: no
Metadata-protocol: none
Rule-change: ruled
Ruling-ref: the maintainer, verbatim in the security#2 session on
2026-11-28 (recorded on the card's Source line): 「在仓库的
.claude/settings.json 里加一条允许规则再提交。立卡」, then 「立卡并派发」. The `:**` spelling
of both `src:dst` guards, including the card-branch guard from objectstack-ai#35443,
is the maintainer's ruling 「38077 一起修」 of 2026-11-28T10:03Z, recorded in
comment 7237654867 on objectstack-ai#38074. The six ask rows for a literal-`*` branch
and for xargs-fed arguments, and this Reach section, are the
maintainer's ruling 「按建议」 of 2026-11-28T14:55Z on the delta review
7238071861, recorded in comment 7241046206 on objectstack-ai#38074.

## 维护者速读

- 用户无感:云端值班席位开信箱时,自建信箱分支的提交与推送在自动模式下不再弹审批。
- 为什么做:让每个云端值班席位在自动模式下自己就能坐席,不必等账号主人切模式。
-
出错会怎样:免审批的范围比四条裸写法略宽(带前缀包装、重定向、两条放行命令串联),下文逐项列明;分支名里的通配符仍未拦,另开一张卡处理;撤回即删这几行。
- 要你做什么:审阅后亲自合并这个草稿 PR。

## What changes

`.claude/settings.json`:

- `permissions.allow` gains two entries:
  ```
  "Bash(git commit --allow-empty -F *)",
  "Bash(git push -u origin claude/mailbox-*)"
  ```
- `permissions.ask` gains three entries scoped to those two rules. Ask
takes precedence over allow.
  ```
  "Bash(git commit --allow-empty -F * *)",
  "Bash(git push -u origin claude/mailbox-* *)",
  "Bash(git push -u origin claude/mailbox-*:**)"
  ```
- `permissions.ask`: the existing card-branch guard from objectstack-ai#35443,
`Bash(git push -u origin claude/issue-*:*)`, becomes `Bash(git push -u
origin claude/issue-*:**)`. A rule ending in `:*` is the legacy
literal-prefix syntax, so its inner `*` was not expanded and neither
guard ever matched a `src:dst` refspec. Ending in `:**` makes each a
wildcard with a literal colon. The CLI's settings validator still prints
a warning on the two `:**` rows; the end-to-end measurement below shows
they match as wildcards.
- `permissions.ask` gains six more rows (this round, per the 14:55Z
ruling):
  ```
  "Bash(git push -u origin claude/issue-*\\**)",
  "Bash(git push -u origin claude/mailbox-*\\**)",
  "Bash(xargs git push -u origin claude/issue-*)",
  "Bash(xargs git push -u origin claude/mailbox-*)",
  "Bash(xargs git commit -F *)",
  "Bash(xargs git commit --allow-empty -F *)"
  ```
The first two restore the ask for a branch argument containing a literal
`*`, on both branch families; the old literal-prefix guard caught that
case by accident. The other four make arguments fed through a pipe into
the four allowed forms ask, the card-branch pair from objectstack-ai#35443 included.

`scripts/pm/mailbox-open.mjs`:

- The refusal printed when the default branch's push is refused (a cloud
seat) moves into a pure exported `pushRefusedMessage(plan, status)`. It
now names the switch, the empty commit and the push, one per line, then
keeps the `--head` re-run:
  ```
  git switch -c claude/mailbox-SLUG origin/main
  git commit --allow-empty -F FILE
  git push -u origin claude/mailbox-SLUG
  then pass --head claude/mailbox-SLUG (--close deletes that name) ...
  ```
The commit and push lines match the allow rules above. The switch
matches no rule.
- The self-test pins it: one new case in the open-plan battery (floor 13
to 14) asserts the five lines, the three commands verbatim for seat
`domain:ui#4`, the `--head` line and the exit status.

## Why

The relay has no ref-creating op, so a cloud seat must create one empty
commit on `origin/main` and push it to `claude/mailbox-SLUG` itself. In
an auto-mode cloud session no allow rule covered that commit or push. On
2026-11-28 the classifier denied the push from the security#2 seat three
times, once after the maintainer had approved it in chat. The seat could
sit only after the session was switched out of Auto mode. The
card-branch forms already had this shape (objectstack-ai#35443); mailbox branches had
no equivalent. The maintainer merges this PR himself.

## Reach

Measured end to end: the CLI binary, driven against a mocked model
endpoint in throwaway sandbox repos, default mode unless stated (table
under Verification). Precedence is deny, then ask, then allow.

**Runs without approval:**

- the four bare forms: `git commit --allow-empty -F FILE` and `git push
-u origin claude/mailbox-SLUG` (both new), and the existing `git commit
-F FILE` and `git push -u origin claude/issue-N-SLUG` (objectstack-ai#35443);
- the same forms behind a wrapper the CLI strips before matching, such
as `timeout 30` or `nohup`;
- the same forms with output redirected to the null device or with
stderr folded into stdout, or piped into a read-only command such as
`tail`; in acceptEdits mode, also a redirect to a file in the working
directory;
- a chain of two individually allowed commands, for example the empty
commit followed by the mailbox push with `&&` or `;`, or two allowed
pushes;
- a few branch spellings the allow wildcard accepts that create no new
ref here: `claude/mailbox-x/../main`, `claude/mailbox-SLUG@{u}`, a
trailing `#` comment.

**Not guarded here:** shell-glob characters other than `*` in the branch
argument (`?`, `[...]`). The shell expands these against files in the
working directory before git runs, so a crafted file name can turn them
into a `src:dst` refspec. The same hole exists on `main` for the
card-branch rule. It is carded separately: objectstack-ai#38356. A message-file
argument with a glob (`-F m*`) also still runs.

**An ask rule prompts for:**

- anything after the branch: a second refspec, a tag, `--force`,
`--delete`, `--force-with-lease`, `-o`;
- a `src:dst` refspec on either branch family, for example
`claude/mailbox-SLUG:main`, `claude/mailbox-SLUG:refs/tags/v1` or
`claude/issue-N-SLUG:main`, also behind `timeout` or `nohup` and in a
chain;
- a branch argument containing a literal `*`, on either family (new this
round);
- arguments fed through `xargs` into any of the four allowed forms, from
a pipe or a file on stdin (new this round), or a here-string (already
asked before this round). A piped `xargs` line is reported as a
subcommand prompt; a bare `xargs` line as a rule prompt. Both come from
these rows;
- anything after the commit's message file: `-a`, `--amend`, `-n`,
`--no-verify`, a pathspec, or a message file path containing a space;
- a line piping an allowed form into a command that is not read-only,
such as `sh` or a local script.

**Prompts for another reason:**

- a chain or newline-separated line where one part is not allowed, such
as `&& git push origin main`: the CLI checks each subcommand and prompts
for the one no rule allows;
- expansions the CLI cannot check before running: command substitution
with `$(...)` or backticks, process substitution, `${IFS}`, a variable,
ANSI-C quoting, brace expansion with more than one branch;
- a redirect outside the working directory or into `.git/hooks` (the
CLI's own path safety check).

**Matches no rule**, so it falls to the permission prompt or, in Auto
mode, to the classifier: a push or commit spelt any other way, such as
`git push --force -u origin ...`, `git push -uf origin ...`,
`+claude/mailbox-SLUG`, `:claude/mailbox-SLUG`, `git push origin
claude/mailbox-SLUG` without `-u`, a bare `git push`, `--allow-empty`
after `-F` or after `--amend`/`-a`, `-Fmsg`, `-m`, `env git push ...`,
and `git switch -c claude/mailbox-SLUG origin/main` (the card names no
rule for the switch, which only creates a local branch).

**Other sessions:** every rule starts with the allowed command's own
prefix, or `xargs` and that prefix, so no other push or commit changes
behaviour. The existing `git commit -F *` allow does not match `git
commit --allow-empty -F ...`, since the prefix differs.

**Unchanged:** `main`'s ruleset, the `deny` roster (17 GitHub
content-write tools) and the hooks, including
`check:commit-card-trailers`, which still judges the mailbox commit's
trailer pair.

## Verification

- `node scripts/pm/check-settings-deny-roster.mjs` passes locally.
- The file parses as JSON.
- `node scripts/pm/mailbox-open.mjs --self-test` passes.
- End to end, at 92724d0 against d0abe2c, 196 command shapes: 22
that ran without approval now ask, and nothing else changes.

<details><summary>Readings at 92724d0</summary>

```
node scripts/pm/check-settings-deny-roster.mjs  EXIT=0
  check-settings-deny-roster: 17 content-write tool(s) declared = enforced in .claude/settings.json (17 mcp__github__ deny entr(ies), 0 outside this gate's population and ignored).
JSON.parse(.claude/settings.json)  EXIT=0
node scripts/pm/mailbox-open.mjs --self-test  EXIT=0
  mailbox-open self-test: 93 cases in 10 batteries pass.
node scripts/check-nul-bytes.mjs  EXIT=0
```

This round adds six strings to `.claude/settings.json` and nothing else.
NOT MEASURED locally: the derived gate families, reason: this worktree
has no install and sits 150 commits behind `origin/main`. CI runs every
family on this head.

</details>

<details><summary>End to end, before (d0abe2c) and after
(92724d0)</summary>

Each shape is one fresh CLI session in its own sandbox repo with a bare
`origin`, a mocked model endpoint that emits the one Bash call, and the
head's `permissions` block as project settings. Every prompt was
answered "deny". RAN = executed with no prompt. ASK(rule) = an ask rule
matched the line. PROMPT(subcommandResults) = a prompt raised by a part
of the line. Both heads were run in this session, same binary.

Totals over 196 shapes (main 116, xargs/wrapper/chain 41,
glob/continuation 29, acceptEdits 10):

```
                              before  after
RAN                           68      46
ASK(rule)                     55      62
PROMPT(subcommandResults)     18      33
PROMPT(other)                 45      45
PROMPT(safetyCheck)            4       4
PROMPT(unclassified)           6       6
```

Every row that changed:

```
id   before  after                      command
p17  RAN     ASK(rule)                  git push -u origin claude/mailbox-*
y02  RAN     ASK(rule)                  git push -u origin claude/mailbox-ui-4*
y03  RAN     ASK(rule)                  git push -u origin claude/mailbox-*
i07  RAN     ASK(rule)                  git push -u origin claude/issue-*
y05  RAN     ASK(rule)                  git push -u origin claude/issue-*
p47  RAN     ASK(rule)                  xargs git push -u origin claude/mailbox-ui-4
x14  RAN     ASK(rule)                  xargs git push -u origin claude/mailbox-ui-4, stdin from a file
p46  RAN     PROMPT(subcommandResults)  echo main | xargs git push -u origin claude/mailbox-ui-4
i06  RAN     PROMPT(subcommandResults)  echo main | xargs git push -u origin claude/issue-1-x
c37  RAN     PROMPT(subcommandResults)  echo --amend | xargs git commit --allow-empty -F msg
x07  RAN     PROMPT(subcommandResults)  echo main:refs/heads/pwned-xargs | xargs git push -u origin claude/mailbox-ui-4
x08  RAN     PROMPT(subcommandResults)  echo --force | xargs git push -u origin claude/mailbox-ui-4
x09  RAN     PROMPT(subcommandResults)  echo claude/mailbox-ui-4:refs/tags/v99 | xargs git push -u origin claude/issue-1-x
x10  RAN     PROMPT(subcommandResults)  echo --no-verify | xargs git commit --allow-empty -F msg
x11  RAN     PROMPT(subcommandResults)  echo --amend | xargs git commit -F msg
x12  RAN     PROMPT(subcommandResults)  printf main | xargs git push -u origin claude/mailbox-ui-4
x20  RAN     PROMPT(subcommandResults)  echo main | timeout 30 xargs git push -u origin claude/mailbox-ui-4
x21  RAN     PROMPT(subcommandResults)  cat msg | xargs git push -u origin claude/mailbox-ui-4
x22  RAN     PROMPT(subcommandResults)  git branch --list 'claude/*' | xargs git push -u origin claude/mailbox-ui-4
x39  RAN     PROMPT(subcommandResults)  echo main:refs/heads/pwned-xargs | xargs git push -u origin claude/issue-1-x
y14  RAN     PROMPT(subcommandResults)  echo main | nice xargs git push -u origin claude/mailbox-ui-4
y17  RAN     PROMPT(subcommandResults)  echo --amend | xargs git commit --allow-empty -F msg 2>&1
```

Held at both heads: the four bare forms RAN (p01, i01, c01, c18); the 20
direct `src:dst` spellings on both families ASK(rule) (p02 to p06, p18,
p28 to p30, p56, i02, i04, x05, x15, x17, y04, y24 to y27); every xargs
shape in the run asks or prompts after; no shape that asked or prompted
before runs after. Still RAN after, and listed under Reach: the wrapper,
redirect and chain shapes, and the `?` glob pushes y01 and y06, which
created `refs/heads/pwned-glob` on the sandbox origin (carded
separately).

</details>

Files to read first: `.claude/settings.json` (the ask block, the six new
rows last), then `scripts/pm/mailbox-open.mjs` (the `pushRefusedMessage`
hunk and its self-test case).

Two-minute check: `node scripts/pm/mailbox-open.mjs --self-test` prints
`93 cases in 10 batteries pass`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_017xRBcW9L8Noz9BxEwjwiov

<!-- signed: security#2 · sunhaolin · session_017xRBcW9L8Noz9BxEwjwiov
-->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xs skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants