Repository navigation
Commit e586cfd
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | | - | |
| 288 | + | |
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
0 commit comments