Repository navigation
chore(claude): allow dev commits and card-branch pushes - #35443
Conversation
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>
|
repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flagsNo card, so no dev flags and no
Check-runs on the head at reading: ④ Design judgment
M1 (must-fix) — the push entry does not match the bare card-branch push it exists for. The matcher turns each S1 (should-fix) — where the push entry matches, it is not confined to a card branch. Everything after
The body discloses the Nits:
Implemented-by: 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>
|
repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ Contract reviewServed-tier: Delta review of the round-1 record on the prior head. Read: the net diff against ① Derived judgments
② Semver levelUnchanged and right: ③ Boundary flagsThe rewritten body, claim by claim:
Check-runs on this head at reading: ④ Design judgmentM1: closed. Do the ask entries catch the plain card push? No. Each was read as the matcher compiles it against
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.
Nits:
Implemented-by: 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>
|
repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ Contract reviewServed-tier: Second delta, on the record for the prior head. Read: the net diff against ① Derived judgments
② Semver levelUnchanged and right: ③ Boundary flagsThe rewritten body, claim by claim:
Check-runs on this head at reading: ④ Design judgmentNo must-fix, no should-fix. M1: closed. The bare S1: closed. Every form the two earlier records listed now meets an ask entry before the allow entry is read:
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 Nits:
Implemented-by: VERDICT: PASS |
…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>
repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ
What changes
.claude/settings.json:permissions.allowgains two entries:permissions.asklist holds three entries scoped to those two rules, so that only the bare forms run without approval. Ask takes precedence over allow.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
git commit -F FILEandgit push -u origin claude/issue-BRANCH, the forms os-dev uses.-a,--amend,-n,--no-verifyor a pathspec), anything after the card branch (a second refspec, a tag, a force, delete, prune or mirror flag,--no-verify), and asrc:dstrefspec on the card branch.-m, a baregit push) still asks, as today.tail) asks, because ask rules are tried against the whole line. Developers type each command on its own.git commit -F FILEthere.main's ruleset (merge queue, no force-push, no deletion), thedenyroster (17 GitHub content-write tools) and the hooks.Verification
node scripts/pm/check-settings-deny-roster.mjspasses locally.Clause-②: no
Metadata-protocol: none
🤖 Generated with Claude Code
https://claude.ai/code/session_01Utp6CbUb7TcZK1XUAddUmQ