Skip to content

Commit e586cfd

Browse files
docs(os-dev): a run past the foreground limit is declared NOT MEASURED, not sent to the background (#38684)
<!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi98ZAtPQK4A8ABvN79TALFDE)_ Fixes #38668 Clause-②: no Metadata-protocol: none Rule-change: yes ## 维护者速读 - 用户能看到什么变化:用户无感;派出去的开发 agent 遇到十分钟内跑不完的本地检查,不再把它转到后台去跑,而是如实记成「本地没测」并交给 CI。 - 为什么做:属于车队规则维护;原规则教的后台跑法正是权限审查会拒绝的做法,照做的 agent 白丢一次检查,还要事后解释。 - 出错会怎样:带破坏性改动的 PR 原本在本地跑的全量实景回归,今后多半只能等合并队列第一次报红;撤回本 PR 即恢复原文。 - 要你做什么:这是一次规则变更,请审阅后亲手合并。 ## What changes Two sentences of `.claude/agents/os-dev.md` and one reading line of `.claude/skills/pm-dispatch/references/readings-ci.md`. No script, no test, no ceiling row. 1. `os-dev.md`, 资源纪律 item 1, the background-run bullet. It prescribed `nohup … &` plus `tail --pid` for anything past the foreground limit, the form the dev sessions' permission classifier refused. It now reads: a run that cannot finish inside the foreground limit is never moved to the background, in any spelling; it is declared in the `--ran` record as `NOT-MEASURED COMMAND :: REASON` (the file spells the two placeholders in its own notation) and CI carries it. 2. `os-dev.md`, 干净收尾 item 4. The line told a dev to read a still-running gate's log (the redirect target) at report time, which only makes sense beside a detached run. It now reads: a report holds no gate that is still running; one that did not finish in the foreground is recorded NOT MEASURED with the measured reason, and CI carries it. 3. `readings-ci.md`, the `check:pm-dispatch-gates` reading. It carried the same prescription (detach plus `tail --pid`) beside a reading of 1216 to 1246 s. It now carries the reading taken for this PR, 404 s in the foreground for the fast tier, and says to run it in the foreground. Nothing here looks for another way to get a background run past the permission check. The change removes the request to run in the background. ### Byte arithmetic (`wc -c`, ceilings from `scripts/pm/check-skill-line-ratchet.mjs`, not edited) | File | Before | Out | In | After | Ceiling | Net | |:---|---:|---:|---:|---:|---:|---:| | `.claude/agents/os-dev.md` | 33491 | 113 + 119 | 129 + 103 | 33491 | 33491 | 0 | | `.claude/skills/pm-dispatch/references/readings-ci.md` | 4896 | 119 | 114 | 4891 | 4900 | -5 | No ceiling moves. `pnpm check:pm-skill-ratchet` exits 0 at `b469dcec`. ### Read first 1. `.claude/agents/os-dev.md` line 90: the rule itself. The risk is the phrase 「任何拼法」: it is meant to rule out a renamed background run, not a dev server. 2. `.claude/agents/os-dev.md` line 293: the report-side half of the same rule. 3. `.claude/skills/pm-dispatch/references/readings-ci.md` line 48: a reading replaced by a newer one. See the first acceptance note for why this file is in the diff. ## Tests No test changed and none is owed: the diff is rule text and one reading. `git grep` over the tree at `b469dcec` finds the two replaced sentences nowhere else, so no test or gate pins them. No ablation: no tested behaviour changed. Measurements taken for the rule (the card asked which gates actually pass the foreground limit today): <details><summary>check:pm-dispatch-gates in the foreground: 404 s, exit 0 (limit 600 s)</summary> Tree `0124851b` (the branch point; the diff does not touch the instrument), 4 cores, load average 0.42 at the start and 1.03 at the end, no lock, stdin from `/dev/null`, exit captured before any pipe. ``` exit 0 wall 404s head 0124851 dispatch-gates self-test tiers: fast 2686 case(s) in 402.9s · slow tier deferred (9 section(s)) — run without --fast for both. ✓ dispatch-gates self-test (fast tier): 2686 cases pass; 9 slow section(s) deferred. check:pm-dispatch-gates: the battery (the fast tier) took 403.1s on this box. ``` It fits with about 196 s to spare on a quiet box. On a busy box it may not; the rule then applies as written (killed at the limit, declared NOT MEASURED, CI runs it in `lint-pm-dispatch-gates`). </details> <details><summary>Full dogfood: NOT MEASURED locally; the CI reading says it cannot fit</summary> Not run locally: a run known to pass the limit would hold the shared lock for ten minutes and reach no verdict. Read instead from CI on main `39064f62`, the step `Boot example apps and exercise real user flows` of the three `Dogfood Regression Gate (k/3)` jobs: 1063 s (1/3), 778 s (2/3), 698 s (3/3). Each third alone is past 600 s, so the unsharded command the agent file prescribes cannot finish in one foreground call. </details> <details><summary>The record spelling the new bullet names, probed against the instrument</summary> On copies of this PR's own run record at `b469dcec` (the real record is untouched): ``` # one family replaced by a NOT-MEASURED line with a reason Run reconciliation — 26 derived, 25 run, 1 NOT-MEASURED, 0 UNRUN. ✓ dispatch-gates --ran: 26 derived famil(ies) accounted for — 25 run, 1 NOT-MEASURED (0 DERIVED from a recorded exit 3, 1 claimed). exit 0 # the same family recorded with a bare kill code and no declaration Run reconciliation — 26 derived, 25 run, 0 NOT-MEASURED, 1 UNRUN. ✗ dispatch-gates --ran: 1 of 26 derived famil(ies) UNRUN. exit 1 ``` So the declared path already exists in `scripts/pm/dispatch-gates.mjs` (`parseRunRecord`, `runReconciliation`): a kill code alone is UNRUN, and the declaration with a reason is what makes it NOT-MEASURED. The instrument prints the spelling itself when it meets a bare kill code. </details> ## Acceptance notes - **`readings-ci.md` is in the diff — seat ruled A (keep it); claim amendment 7268968229 names it.** The claim allows "the pm-dispatch reference that states the declared-narrowing path for `--ran` records if its text must name the new case". No pm-dispatch reference mentions `--ran` at all; the only pm-dispatch text on a gate past the limit is this one line, and it prescribed the refused form. I took it to be the reference meant. It is its own commit (`b469dcec`), so dropping it is one revert if the seat reads the fence differently. - **The instruments still prescribe the detached form, and this PR does not touch them — follow-up #38689 (Blocked-by this PR)** (outside the claim; `dispatch-gates.mjs` is a Tier H instrument). `scripts/pm/check-dispatch-gates.mjs` has a header section telling an agent container to run detached, and its kill branch prints `nohup pnpm check:pm-dispatch-gates > pm-dispatch-gates.log 2>&1 &` as the remedy to a dev whose foreground run was just killed; `scripts/pm/dispatch-gates.mjs` carries the same header section. After this PR the agent file and the instrument's printed remedy disagree. - **Full dogfood has no local route left — follow-up #38688 (maintainer decision; not this PR).** The definition-of-done lines of `os-dev.md` still order one full dogfood run under the lock on a PR whose title carries `!` or whose clause line carries the narrowing arm, with no shard and never skipped. By the CI reading above that run cannot finish in the foreground, and PR runs do not carry the dogfood shards (queue runs do). Those lines are outside this claim; the question is in the report. - `.claude/skills/scenario-eval/SKILL.md` and `packages/qa/scenarios/README.md` prescribe `nohup` plus `tail --pid` for scenario and gallery runs. Those are another seat's runs and no refusal is recorded for them; noted, not edited. - `readings-shell.md` holds a reading that a refused compound command is retried as bare actions before reporting blocked. It is a general reading about command shape, not about background runs, and is untouched; a reader may still put it beside the new bullet. ## Verification Two minutes: `git diff origin/main...HEAD --stat` shows 2 files, 3 insertions, 3 deletions; then `git grep -n -E 'nohup|tail --pid' -- .claude/agents .claude/skills/pm-dispatch` at the head shows one hit, the `readings-shell.md` line that warns against `nohup` inside a background tool call, and none that prescribes it. <details><summary>Local gate union at b469dce: 26 derived, 26 run, exit 0</summary> `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` (no paths) derived 26 commands from 2 changed paths against merge base `0124851b`. Each ran in the foreground with stdin from `/dev/null`, the exit captured before any pipe, and was recorded as `COMMAND :: exit N`; the whole loop took 325 s in one foreground call. ``` Run reconciliation — 26 derived, 26 run, 0 NOT-MEASURED, 0 UNRUN. ✓ dispatch-gates --ran: 26 derived famil(ies) accounted for — 26 run, 0 NOT-MEASURED (a DERIVED zero — all 26 recorded an exit code and none of them is 3). ``` The first pass recorded `pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 3` (PREREQUISITE NOT MET: `@objectstack/formula` and `@objectstack/lint` were not built). I built the two under the shared lock (`VERDICT command-exit 0`, held 80 s) and ran the whole list again; the record above is that second pass, with no line edited. Longest single gate: `node scripts/check-comment-mask-corpus.mjs`, 188 s. Local-only family also run: `pnpm check:skill-frame-freshness`, exit 0. </details> `node scripts/pm/overlap-check.mjs --branch=HEAD` at `b469dcec`: `VERDICT clean exit 0` against `origin/main` and against the one open PR that shares `os-dev.md` (#38683, other sections). --- _Generated by [Claude Code](https://claude.ai/code/session_01ADHkmRJUY9Ncce14hVHd25)_ <!-- signed: repo:objectstack#3 · os-steve · session_01ADHkmRJUY9Ncce14hVHd25 --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent e6b424b commit e586cfd

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎.claude/agents/os-dev.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ model: opus
8787
- `bash scripts/pm/os-verify-lock.sh -c '<command>'`(或 `-- <argv>`);⛔ 永不手搓 `flock`/lockfile。
8888
- 一次前台调用领全部等待预算,阻塞到拿锁或 99;⛔ 不轮询重试。
8989
- 它不保证机器空闲:`check:*` 门禁、install、dev server 不走它,与持锁同核并跑。
90-
- 超前台上限者(`check:pm-dispatch-gates`、全量 dogfood):`nohup … > LOG 2>&1 &` 后 `tail --pid`。
90+
- 前台上限内跑不完者 ⛔ 不转后台(任何拼法):`--ran` 记 `NOT-MEASURED <command> :: <实测原因>`,归 CI。
9191
- 锁下墙钟绝对值是共享盒读数;只包命令本身,不包你的阅读与判断。
9292
- 结论读它印的 `VERDICT command-exit` 行,⛔ 不读裸 `$?`;按到达序授予。
9393
2. **压住堆**:重命令前缀 `NODE_OPTIONS=--max-old-space-size=4096`,要抬需给理由。
@@ -285,7 +285,7 @@ model: opus
285285
- 两条合法出路:在轮内同步等它(资源纪律的排队条款:限时获取 ⇒ 无锁工作 ⇒ 再取)。
286286
- 或者收窄这次检查的范围并在报告里申报:已申报的收窄是被接受的偏差,CI 跑满农场。
287287
- PM L1 审核的是 CI 收敛,不是你本地的覆盖面;未申报的收窄不在此列,那是漏跑。
288-
- 比回合长的门禁在写报告那一刻读日志(重定向目标);未完成的记 NOT MEASURED 并写原因。
288+
- 报告里没有还在跑的门禁:前台没跑完的记 NOT MEASURED 并写实测原因,归 CI。
289289
- 结束一轮之前自检:最后一条消息是否在描述你不拥有的进程给你的唤醒?
290290

291291
## 何时停手不写码

‎.claude/skills/pm-dispatch/references/readings-ci.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@
4545
- corepack 下载 pnpm 可在检查体开跑前崩 undici(`assert(!this.paused)`)⇒ 是基础设施红。
4646
- `check-governed-merges` 浅克隆上拒答而非少报,并报未审计仓数;补救 `git fetch --shallow-since=`。
4747
- ⛔ 不越过该拒答自行枚举:短清单读作合规;加深日期取窗口起点之前,不猜深度。
48-
- `check:pm-dispatch-gates` 1216–1246 秒超容器上限 ⇒ 不走锁,detach 加 `tail --pid=$!`;超时非读数。
48+
- `check:pm-dispatch-gates` 快档前台 404 秒(闲盒 4 核,0124851b)⇒ 前台跑,不走锁;超时非读数。
4949
- `check-half-states.mjs` 连 `--help` 都跑整仓 I/O ⇒ 早读到的输出文件是空的,不是干净的。

0 commit comments

Comments
 (0)