Skip to content

Commit 3579cf1

Browse files
chore(pm): probe classifier carve-out, paste-safe rerun line, runnable probe rule (#35237 slice 13) (#38393)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XHogQ9ogKPxHhiFfT2UQgJi)_ Fixes #35237 Claim on the card naming this branch: 7247494260 (slice 13; base claim 7245952141). Clause-②: no Metadata-protocol: none Rule-change: none ## 维护者速读 - 用户无感:车队开发代理用的内部脚本和开发代理规则里的一行命令写法做了收尾修整,推送前后的行为对用户不可见。 - 属于「车队技能整理」里「把每次手敲的流程改成脚本」这一步,本次清掉这一步最后几项遗留小问题,做完后这一步可以关闭。 - 最坏情况是开发代理推送遇到超时、限流类错误时多重试几次(有固定上限)或照旧提前停下;一个提交即可整体撤回。 - 无 Slice 13 of the card: carrier item 24, the rule half of item 14 N7, and items 26–29 (notes 7246458172 and 7246788470), plus the card's done-when check below. 6 files, +54 / −16. | Item | Where | What changed | |:---|:---|:---| | 24 | `scripts/pm/check-owed-reviews.mjs:140` | "The name is kept: importers read it" was false (nothing imports `TRIAGE_ROUND_MINUTES`). It now says the name is kept because this file reads it, in the trigger (b) docblock and `owedReviewRow`, and that nothing imports it. Comment only. | | 14 N7 (rule half) | `.claude/agents/os-dev.md:31` | The probe command now spells `--branch=BRANCH`, so it runs as written instead of ending in a usage exit. Bytes are offset on the same line (see Acceptance notes). | | 14 N7 (ratchet) | `scripts/pm/check-skill-line-ratchet.mjs` | The `os-dev.md` row is lowered 33500 → 33492, the landed size. No row raised. | | 26 | `scripts/pm/dev-worktree.sh` `classify_push_failure` | A new arm, ahead of the 4xx arm and keyed exactly as it is, reads 408, 421, 429 and every 5xx as `network`. "Received HTTP code 502 from proxy after CONNECT" is now placed. The comment now says why. 5 classifier cases; floor 14 → 19. | | 27 | `scripts/pm/dev-worktree.sh` `rerun_with_probe` | A flag made only of characters no shell reads specially is printed as typed (`--backoff=2,4`). Any other flag is still quoted with `printf %q`. The pinned line now carries `--backoff=2,4`. One round-trip case; floor 20 → 21. | | 28 | `scripts/pm/git-history.mjs` self-test | The case titled "a problem the CLI refuses as usage" now asserts through the CLI: `ancestor --cwd=` pointed at a missing directory exits 1, prints nothing on stdout and says "could not be checked" on stderr. | | 29 | `scripts/pm/check-handover.mjs` `--inflight` clear line | The line now names the unjudged case: "a claimed path fragment deeper inside a dispatched directory, spelled DIR, DIR/** or DIR/**/GLOB alike". It is pinned in the N12 case. | ### Why 408, 421 and 429 are network errors under rule 1 (`os-dev.md:33`, only a network error is retried) The rule separates two kinds of failure. A refusal on the merits stops the run (403, and every other judged 4xx). A failure of the path is retried on a bounded schedule. Each of these three statuses says the path failed and says nothing about the push itself: - **408 Request Timeout.** The server closed the connection because the request did not arrive whole in time. It is the same event as the `Operation timed out` the classifier already retries; this time the server noticed the timeout first. - **421 Misdirected Request.** The request reached a connection that cannot answer for this host, usually a reused HTTP/2 connection or a proxy route. It describes the connection, not the request, and the retry's new connection is the fix. - **429 Too Many Requests.** The path is throttled for now. HTTP's own remedy is to wait and retry, and the backoff schedule is that wait: four retries, 30 s in all, never a loop. All three read `network` before #38387 (through the words "RPC failed"). This PR restores that reading and keeps 401, 404, 407 and 409 as `other`. Every 5xx already read `network` in the `error:` and `HTTP` spellings. The new arm adds the key words the 4xx arm uses (`status`, `code`, `response`, `HTTP/N`), so a proxy's "Received HTTP code 502" reads the same way. ### Done-when check, item by item The card's done-when: each listed procedure is a script with a self-test, its prose is a one-line pointer, and the card-pick reader works against the live board. The closing check also asks that no carrier item stays open apart from item 7 option B, which landing ruled out of scope (7222751511 ③). | Part | State | Evidence | |:---|:---|:---| | Slice 1: card-pick, lock depth, prior-rulings `--paths` | landed | PR #35482 | | Slice 2: `landing-k`, `pr-state`, `sweep-closed-cards --pr` | landed | PR #35576 | | Slices 3, 5, 6: `fleet-roster --health`, the dispatch-runbook pointer, `l1-face` | landed | PR #35671 | | Slice 4: `check-handover --inflight`, `round-open` | landed | PR #37878 | | Slice 7: `git-history ancestor`, `dev-worktree.sh` | landed | PR #38018 | | Card-pick against the live board | works | `node scripts/pm/card-pick.mjs --order area:fleet --seat repo:objectstack#5 --limit 3` at 23:04Z: read 231 open `pm:queue` issues over 3 pages, the platform counts 231, `card-pick COMPLETE — 3 pick(s)`, exit 0 | | Carrier items 1, 2 | done | slice 4 (landing note 7226135228) | | 3, 5, 6, 11 (10's N6 too) | done | slice 8, PR #38146 | | 16–19 | done | slice 9, PR #38212 | | 4, 12, 13, 15 | done | slice 10, PR #38222 | | 20–22 | done | slice 11, PR #38243 | | 7 N11, 9, 14 N3/N5/N6 and N7's script half, 23, 25 | done | slice 12, PR #38387 | | 24, N7's rule half, 26–29 | done | this PR | | 8, 10 | owe nothing | listed for completeness and accepted as deviations (7222785044) | | 7 option B | out of scope | landing kept option A (7222751511 ③) | Each part holds as far as it can be measured, so the first line is `Fixes #35237`. One limit: the review reports' section 4, the candidate list the card names, cannot be read from this project, and slice 3's claim (7022183772) recorded the same gap. "Each listed procedure" is therefore checked against the slice plan in claim 7006559529, amendment 7013022048 and release 7017468070. If the seat holds a section-4 candidate outside that plan, the first line should become `Part of`. ## What changes The four scripts and one comment above, one rule line and one ratchet row. Nothing here ships in a package. ## Tests All runs are at head `084b6dba7a`. <details><summary>Self-tests of every script edited</summary> - `bash scripts/pm/dev-worktree.sh --self-test`: `✓ dev-worktree self-test: 95 cases pass across 7 batteries` (89 before: 5 classifier cases and 1 probe case added). - `node scripts/pm/git-history.mjs --self-test`: `git-history --self-test: all cases passed.` - `node scripts/pm/check-handover.mjs --self-test`: `✓ check-handover self-test: 114 cases pass`. - `node scripts/pm/check-owed-reviews.mjs --self-test`: `✓ check-owed-reviews self-test: 96 cases pass in 10 batteries`. - `node scripts/pm/check-skill-line-ratchet.mjs --self-test`: `116 cases pass`. The gate itself exits 0. </details> <details><summary>Ablations (scripts/ablation-replace.mjs; each mutation was proven on disk and the restore proven blob == HEAD with an empty git diff HEAD)</summary> - A1 `(408|421|429|5[0-9][0-9])` → `(5[0-9][0-9])` in the new arm: 3 of 95 red, the 408, 429 and 421 cases. - A2 `(408|421|429|5[0-9][0-9])` → `(408|421|429)`: 1 of 95 red, the proxy CONNECT 502 case. - A3 the as-typed branch of `rerun_with_probe` back to `printf %q`: 2 of 95 red, the pinned second-run line and the round-trip case. - A4 the `--inflight` clear line back to its old text: 1 of 114 red, the N12 case. - A5 the CLI's usage refusal skipped for a "could not be checked" problem: 1 red, the item 28 case, through its CLI half alone (the direct calls stay green). </details> <details><summary>Classifier false-match probe (the shapes record 7246776227 tried against the 4xx arm, run against the new arm, at this head and at the merge base)</summary> A port (`port 429`, `github.com:502`), an errno (`errno 408`, `errno=502`), an OpenSSL code (`error:0A000126`, `error:42900000`), a byte count (`408 bytes`, `Total 429`, `(502/502)`) and an HTTP/2 stream number (`HTTP/2 stream 421`, `stream 503`) read the same at head as at base. Only two answers moved: `RPC failed; HTTP 429` and `Received HTTP code 503 from proxy after CONNECT`, both from `other` to `network`. </details> ## Acceptance notes - **os-dev.md byte offset.** Adding `--branch=BRANCH ` costs 16 bytes against 9 bytes of headroom. The same line drops 「建好分支后」 (15 bytes), so the file lands at 33492 (+1 against main's 33491), within the 33500 ceiling. The row is then lowered to 33492. The rule is unchanged: the timing it sets is still 「任何编辑前」, and the one command now builds the branch and sends the probe in a single run. `BRANCH` is the placeholder the file already uses three lines up (`Resume-from: BRANCH@SHA`). The edit stays one line, adding one argument, with the offset on the same line. - **The old 5xx alternative is kept.** The case-insensitive `(error:|HTTP)[ :]+5xx` alternative stays in the transport-words arm, so no spelling that read `network` before reads anything else now. - **`check-owed-reviews.mjs` keeps `export`.** Nothing imports the name, and the sentence now says so. Removing the export would be a surface change this item did not ask for. ## Verification Read first, by risk: `scripts/pm/dev-worktree.sh` (the new arm in `classify_push_failure`, then `rerun_with_probe`), `.claude/agents/os-dev.md:31`, `scripts/pm/git-history.mjs` (the item 28 case). Two-minute check: `bash scripts/pm/dev-worktree.sh --self-test` should print `95 cases pass across 7 batteries`. --- _Generated by [Claude Code](https://claude.ai/code/session_01FEkQ5oPfjnm2yWHEwkiYrn)_ <!-- signed: repo:objectstack#5 · os-project-manager · session_01FEkQ5oPfjnm2yWHEwkiYrn --> Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3511432 commit 3579cf1

6 files changed

Lines changed: 54 additions & 16 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ model: opus
2828
- 认领带 `Resume-from: BRANCH@SHA` ⇒ 从 `origin/BRANCH` 建同名分支续写,先合 `origin/main`。
2929
- ⛔ 永不编辑共享检出;修复横跨姊妹仓时一仓一 worktree。
3030
- 动笔前记下基点 `BASE=$(git rev-parse HEAD)`,它是标准条款节里家族规则的锚。
31-
- 建好分支后先推空分支(任何编辑前 `dev-worktree.sh --probe`):落地标记兼写路由探针。
31+
- 先推空分支(任何编辑前 `dev-worktree.sh --branch=BRANCH --probe`):落地标记兼写路由探针。
3232
- 卡线程分支由平台指定、harness 推送,⛔ 不推空分支;探针规则只对自建分支。
3333
- 探针遇 403 ⇒ 停下报 `blocked`,⛔ 不进重试循环;只有网络错误才退避重试。
3434
- Scratchpad 按 issue 隔离:在 scratchpad 目录下建 `issue-<n>/` 子目录,临时文件全写进去。

‎scripts/pm/check-handover.mjs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ export function inflightText(verdict, { repo, paths, read, reconcile = null }) {
924924
? `check-handover --inflight: OVERLAP — ${verdict.overlaps.length} in-flight claim(s) on ${repo} meet the surface about to be dispatched.`
925925
: verdict.exit === EXIT_SURFACE_UNREAD
926926
? `check-handover --inflight: NO OVERLAP READ, ${verdict.unread.length} SURFACE(S) UNREAD — no readable in-flight surface on ${repo} meets this one; the cards below name no path, so read their claims by hand.`
927-
: `check-handover --inflight: clear — no in-flight claim on ${repo} declares a surface that meets this one${verdict.notCompared?.length > 0 ? `; ${verdict.notCompared.length} claimed bare name(s) NOT COMPARED, listed below` : ''}. A claimed path fragment deeper inside a dispatched directory, and a claimed glob fragment, are never judged.`;
927+
: `check-handover --inflight: clear — no in-flight claim on ${repo} declares a surface that meets this one${verdict.notCompared?.length > 0 ? `; ${verdict.notCompared.length} claimed bare name(s) NOT COMPARED, listed below` : ''}. A claimed path fragment deeper inside a dispatched directory, spelled DIR, DIR/** or DIR/**/GLOB alike, and a claimed glob fragment, are never judged.`;
928928
const lines = [head, ` Dispatch surface: ${paths.map((p) => `\`${p}\``).join(', ')}.`];
929929
verdict.overlaps.forEach((h, i) => {
930930
const how = { path: '', name: ' (a bare file name on the claim, read anywhere)', suffix: ' (a path fragment on the claim, read as a suffix)' };
@@ -1609,7 +1609,7 @@ export function selfTest() {
16091609
t('inflight: N4 — a clear run NAMES the claimed bare names it could not judge against a directory or `DIR/**`; a `No changes outside …` clause is surface, not a fence', n4.exit === EXIT_OK && n4.notCompared.map((x) => x.claimed).join() === 'package.json' && inflightText(n4, { repo: 'o/r', paths: ['scripts/pm/**'], read: 'x' }).includes('1 claimed bare name(s) NOT COMPARED') && surfaceTokens('No changes outside `packages/lint/**`.').paths.join() === 'packages/lint/**');
16101610

16111611
t('inflight: ⭐ S5 — ONE directory, two spellings, one answer: a fragment that starts inside `DIR` meets `DIR` and `DIR/**` alike; a deeper fragment meets neither, and the clear line says so', meetKind('.claude/skills/pm-dispatch/references', 'references/contract-review.md') === 'suffix' && meetKind('.claude/skills/pm-dispatch/references/**', 'references/contract-review.md') === 'suffix' && meetKind('.claude/skills/pm-dispatch/references/**', 'lanes/director.md') === null && meetKind('.claude/skills/pm-dispatch/references', 'lanes/director.md') === null && inflightText(inflightVerdict({ paths: ['x/y.md'], held: [] }), { repo: 'o/r', paths: ['x/y.md'], read: 'x' }).includes('deeper inside a dispatched directory'));
1612-
t('inflight: ⭐ N12 — a glob under the directory a fragment starts inside answers as the bare `DIR/**` does: `references/**/*.md` meets `references/contract-review.md`, a remainder that does not match (`**/*.ts`) and a fragment that would sit deeper (`pm-dispatch/**/*.md`) do not', meetKind('.claude/skills/pm-dispatch/references/**/*.md', 'references/contract-review.md') === 'suffix' && meetKind('.claude/skills/pm-dispatch/references/**/*.md', 'references/lanes/director.md') === 'suffix' && meetKind('.claude/skills/pm-dispatch/references/**/*.ts', 'references/contract-review.md') === null && meetKind('.claude/skills/pm-dispatch/**/*.md', 'references/contract-review.md') === null && meetKind('.claude/skills/pm-dispatch/xreferences/**/*.md', 'references/contract-review.md') === null);
1612+
t('inflight: ⭐ N12 — a glob under the directory a fragment starts inside answers as the bare `DIR/**` does: `references/**/*.md` meets `references/contract-review.md`, a remainder that does not match (`**/*.ts`) and a fragment that would sit deeper (`pm-dispatch/**/*.md`) do not, and the clear line names that deeper case', meetKind('.claude/skills/pm-dispatch/references/**/*.md', 'references/contract-review.md') === 'suffix' && meetKind('.claude/skills/pm-dispatch/references/**/*.md', 'references/lanes/director.md') === 'suffix' && meetKind('.claude/skills/pm-dispatch/references/**/*.ts', 'references/contract-review.md') === null && meetKind('.claude/skills/pm-dispatch/**/*.md', 'references/contract-review.md') === null && meetKind('.claude/skills/pm-dispatch/xreferences/**/*.md', 'references/contract-review.md') === null && inflightText(inflightVerdict({ paths: ['x/y.md'], held: [] }), { repo: 'o/r', paths: ['x/y.md'], read: 'x' }).includes('deeper inside a dispatched directory, spelled DIR, DIR/** or DIR/**/GLOB alike'));
16131613
t('inflight: N8 — a single-segment dispatch directory (`scripts/`) lists a claimed bare name NOT COMPARED, like `scripts/pm/` and `scripts/**`', ['scripts/', 'scripts/pm/', 'scripts/**'].map((d) => inflightVerdict({ paths: [d], held: [{ issue: IF_CARD(), ...inflightSurface(IF_CARD(), [IF_CLAIM('File surface: `card-pick.mjs`.')]) }] }).notCompared.length).join() === '1,1,1');
16141614

16151615
// The claim-surface card, PR A: the qualified key, each claim's width, and the reconciliation against its pull.

‎scripts/pm/check-owed-reviews.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export const EXIT_USAGE = 2;
137137
export const DEFAULT_REPO = 'objectstack-ai/objectstack';
138138
/** The waiting label the dispatching seat hangs at ACCEPT (`references/contract-review.md` 〈等 L2 标记〉). */
139139
export const WAITING_LABEL = 'needs:contract-review';
140-
/** One full round, trigger (b): `round-open.mjs`'s `ROUND_MINUTES`, the number on `seat-lifecycle.md`'s round line — one source, never a second copy. The name is kept: importers read it. */
140+
/** One full round, trigger (b): `round-open.mjs`'s `ROUND_MINUTES`, the number on `seat-lifecycle.md`'s round line — one source, never a second copy. The name is kept because this file reads it (the trigger (b) docblock above, `owedReviewRow`); nothing imports it. */
141141
export const TRIAGE_ROUND_MINUTES = ROUND_MINUTES;
142142
/** The seat posts' label (`seat-post-protocol.md`); `parseSeat` reads each one. */
143143
export const SEAT_LABEL = 'pm:seat';

‎scripts/pm/check-skill-line-ratchet.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export const CEILINGS = new Map([
136136
['.claude/skills/pm-dispatch/references/lanes/queue.md', 2003],
137137
['.claude/skills/pm-dispatch/references/lanes/cloud.md', 1232],
138138
['.claude/skills/pm-dispatch/references/lanes/objectstack.md', 2540], // raised 2270 → 2540 by the ruled text (one seat per lane by default; a new `area:*` is a partition of that seat), ruling record 7030459053
139-
['.claude/agents/os-dev.md', 33500], // lowered 33504 → 33500 by the #35237 slice-10 entry-pointers PR (the file's landed size, headroom 0); before that: lowered 38986 → 33504 by the entry-file slimming PR (four one-path blocks moved verbatim to references/dev-traps.md and references/dev-ablation.md, one pointer line left for each); before that: lowered 39008 → 38848 by the re-basing PR's own edit; raised 38848 → 38986 (+138) by ruling record 7076315104 (Q13, the decision card 「定一下:五条新增规则要不要写进技能」: 「五条都写」): a card thread's first step reads the tier it is served and compares it with the order
139+
['.claude/agents/os-dev.md', 33492], // lowered 33500 → 33492 by the #35237 slice-13 PR (rule 1's probe line spells its --branch; the file's landed size, headroom 0); before that: lowered 33504 → 33500 by the #35237 slice-10 entry-pointers PR (the file's landed size, headroom 0); before that: lowered 38986 → 33504 by the entry-file slimming PR (four one-path blocks moved verbatim to references/dev-traps.md and references/dev-ablation.md, one pointer line left for each); before that: lowered 39008 → 38848 by the re-basing PR's own edit; raised 38848 → 38986 (+138) by ruling record 7076315104 (Q13, the decision card 「定一下:五条新增规则要不要写进技能」: 「五条都写」): a card thread's first step reads the tier it is served and compares it with the order
140140
['.claude/skills/checklist-test/SKILL.md', 14209], // lowered 19558 → 14209 by the entry-file slimming PR (the bodies of §5 and §6 moved verbatim to the two reference files below, one pointer line left in each section)
141141
['.claude/skills/checklist-test/references/closure.md', 4553], // new row, landed size, headroom 0
142142
['.claude/skills/checklist-test/references/standing-regression.md', 1261], // new row, landed size, headroom 0

‎scripts/pm/dev-worktree.sh‎

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,16 +139,26 @@ refuse() {
139139
# The two misreadings are not equal: a failure wrongly read as 403 stops one
140140
# run early, and one wrongly read as network costs a bounded handful of pushes
141141
# — neither is a loop, and anything this cannot place is `other`: stop.
142-
# Every other 4xx status is `other` in each spelling git prints it — the bare
143-
# line and `RPC failed; HTTP 401` alike, although the second carries the words
144-
# of a transport failure: a client error does not change on a retry.
142+
# Three 4xx statuses, and every 5xx, are the path failing rather than the push
143+
# being judged, so they read `network`: 408 (the connection timed out before
144+
# the request arrived whole), 421 (the request reached a connection that cannot
145+
# answer for this host; a new connection can) and 429 (the path is throttled
146+
# for now, and its remedy is the wait the backoff schedule already is). They
147+
# are keyed exactly as the next arm is, ahead of it. Every other 4xx status is
148+
# `other` in each spelling git prints it — the bare line and `RPC failed; HTTP
149+
# 401` alike, although the second carries the words of a transport failure: a
150+
# client error the server judged on the request does not change on a retry.
145151
# ---------------------------------------------------------------------------
146152
classify_push_failure() {
147153
local out="$1"
148154
if printf '%s\n' "$out" | grep -Eq '(error:|HTTP(/[0-9.]+)?|status|code|response)[ :]+403([^0-9]|$)|Permission to .+ denied'; then
149155
printf '403\n'
150156
return 0
151157
fi
158+
if printf '%s\n' "$out" | grep -Eq '(error:|HTTP(/[0-9.]+)?|status|code|response)[ :]+(408|421|429|5[0-9][0-9])([^0-9]|$)'; then
159+
printf 'network\n'
160+
return 0
161+
fi
152162
if printf '%s\n' "$out" | grep -Eq '(error:|HTTP(/[0-9.]+)?|status|code|response)[ :]+4[0-9][0-9]([^0-9]|$)'; then
153163
printf 'other\n'
154164
return 0
@@ -263,11 +273,17 @@ probe_push() {
263273

264274
# The second run that completes a tree built without --probe: this run's own
265275
# flags, verbatim, plus `--probe --no-install` — the tree is already installed,
266-
# or was left to you, so the second run repeats no install.
276+
# or was left to you, so the second run repeats no install. A flag made only of
277+
# characters no shell reads specially is printed as typed; any other is quoted
278+
# with `printf %q`, which alone would print `--backoff=2,4` as `--backoff=2\,4`.
267279
rerun_with_probe() {
268280
local a line='bash scripts/pm/dev-worktree.sh'
269281
for a in "${ORIG_ARGS[@]}"; do
270-
[ "$a" = '--no-install' ] || line="$line $(printf '%q' "$a")"
282+
[ "$a" = '--no-install' ] && continue
283+
case "$a" in
284+
'' | *[!A-Za-z0-9_./=:,@%+-]*) line="$line $(printf '%q' "$a")" ;;
285+
*) line="$line $a" ;;
286+
esac
271287
done
272288
printf '%s --probe --no-install' "$line"
273289
}
@@ -450,11 +466,11 @@ mode_build() {
450466
# name=minimum, one per line. A battery below its minimum means cases stopped
451467
# running; the roster's own length is pinned too, so a deleted row cannot take
452468
# its floor with it.
453-
ST_BATTERIES='the probe failure classifier=14
469+
ST_BATTERIES='the probe failure classifier=19
454470
a fresh worktree=13
455471
refusals before anything is created=13
456472
resume from a claimed sha=11
457-
the probe=20
473+
the probe=21
458474
re-run, scratchpad and install=14
459475
what the script never spells=4'
460476
ST_BATTERY_FLOOR=7
@@ -626,6 +642,16 @@ SHIM
626642
"$(classify_push_failure 'error: RPC failed; HTTP 401 curl 22 The requested URL returned error: 401')|$(classify_push_failure 'error: RPC failed; HTTP/2 404')" 'other|other'
627643
st_case 'OpenSSL'\''s "Connection was reset" and an HTTP/2 stream or framing error are network errors, retried like a reset by peer' \
628644
"$(classify_push_failure 'fatal: unable to access: OpenSSL SSL_read: Connection was reset, errno 10054')|$(classify_push_failure "fatal: unable to access 'https://github.com/o/r/': HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR (err 1)")|$(classify_push_failure "fatal: unable to access 'https://github.com/o/r/': Error in the HTTP2 framing layer")" 'network|network|network'
645+
st_case '408 is the path failing, not the push judged: a request timeout is a network error in either spelling, retried on the schedule' \
646+
"$(classify_push_failure 'error: RPC failed; HTTP 408 curl 22 The requested URL returned error: 408')|$(classify_push_failure "fatal: unable to access 'https://github.com/o/r/': The requested URL returned error: 408")" 'network|network'
647+
st_case '429 is the path throttled for now: a network error, whose remedy is the wait the schedule already is' \
648+
"$(classify_push_failure 'error: RPC failed; HTTP 429 curl 22 The requested URL returned error: 429')|$(classify_push_failure 'error: RPC failed; HTTP/2 429')" 'network|network'
649+
st_case '421 is a connection that cannot answer for this host: a network error, which a new connection on the retry can clear' \
650+
"$(classify_push_failure 'error: RPC failed; HTTP/2 421')|$(classify_push_failure "fatal: unable to access 'https://github.com/o/r/': The requested URL returned error: 421")" 'network|network'
651+
st_case 'a proxy that answers the CONNECT with a 5xx is a network error: the 5xx statuses are keyed as the 4xx arm keys its own' \
652+
"$(classify_push_failure "fatal: unable to access 'https://github.com/o/r/': Received HTTP code 502 from proxy after CONNECT")" network
653+
st_case 'a number no status word keys, or one digit too long, is not a status: a 502-byte count, `code 4290`, an OpenSSL code' \
654+
"$(classify_push_failure 'Writing objects: 100% (3/3), 502 bytes | 502.00 KiB/s, done.')|$(classify_push_failure 'remote: fatal: pack rejected (code 4290)')|$(classify_push_failure 'error:0A000126:SSL routines::unexpected eof while reading')" 'other|other|other'
629655

630656
# ── a fresh worktree ──────────────────────────────────────────────────────
631657
st_battery 'a fresh worktree'
@@ -741,14 +767,18 @@ SHIM
741767
# ── the probe ─────────────────────────────────────────────────────────────
742768
st_battery 'the probe'
743769
reset_shim
744-
out="$(run "$dir/objectstack" --branch=claude/issue-30-noflag --no-install)"
770+
out="$(run "$dir/objectstack" --branch=claude/issue-30-noflag --no-install --backoff=2,4)"
745771
rc=$?
746772
st_case '⛔ NO FLAG, the very spelling rule 1 prints (claude/issue-<n>-<slug>): the tree is built and NOTHING is pushed — zero pushes, origin has no such branch' \
747773
"$rc|$(pushes)|$(field "$out" PROBE)|$(on_origin claude/issue-30-noflag)|$([ -d "$dir/objectstack-issue-30" ] && echo dir)" '0|0|skipped|absent|dir'
748774
st_case '…the base is pinned all the same, and the line printed says what a self-built branch still owes' \
749775
"$(field "$out" BASE)|$(grep -c 'run this command again with --probe' "$err")" "$main_sha|1"
750776
st_case '…and that line spells the whole second run: this run'\''s flags, plus --probe --no-install, never a bare --probe' \
751-
"$(grep -c -- 'run this command again with --probe: bash scripts/pm/dev-worktree.sh --branch=claude/issue-30-noflag --probe --no-install\.' "$err")" 1
777+
"$(grep -c -- 'run this command again with --probe: bash scripts/pm/dev-worktree.sh --branch=claude/issue-30-noflag --backoff=2,4 --probe --no-install\.' "$err")" 1
778+
out="$(ORIG_ARGS=(--branch=claude/issue-31-quoted '--scratchpad=/tmp/a b' --backoff=2,4 --no-install) && rerun_with_probe)"
779+
st_case '…a flag is printed as typed when no character of it needs quoting (`--backoff=2,4`, never `2\,4`), quoted when one does, and the line pastes back to the very words typed' \
780+
"$(printf '%s\n' "$out" | grep -c -- ' --backoff=2,4 ')|$(eval "set -- ${out#bash scripts/pm/dev-worktree.sh }" && printf '%s|' "$@")" \
781+
'1|--branch=claude/issue-31-quoted|--scratchpad=/tmp/a b|--backoff=2,4|--probe|--no-install|'
752782
reset_shim
753783
out="$(run "$dir/objectstack" --branch=claude/issue-30-noflag --probe --no-install)"
754784
st_case '…and the same command WITH --probe completes it: one push, the empty branch on origin, nothing re-created' \

‎scripts/pm/git-history.mjs‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2231,10 +2231,18 @@ function selfTest() {
22312231
/ambiguous/.test(hexPrefixProblem(full, '0148abc', () => [c2, c38]) ?? '')
22322232
&& /not a commit/.test(hexPrefixProblem(full, '0148abc', () => [c2]) ?? '')
22332233
&& hexPrefixProblem(full, 'deadbeefdeadbeef') === null);
2234+
// Through the CLI: spawned from a directory that exists, asking about one that does not, so git's listing fails.
2235+
const unlistable = spawnSync(process.execPath, [self, 'ancestor', '--commit=deadbeefdeadbeef', `--cwd=${join(full, 'no-such-dir')}`], {
2236+
cwd: full,
2237+
encoding: 'utf8',
2238+
stdio: ['ignore', 'pipe', 'pipe'],
2239+
});
22342240
t('⛔ a listing git could not give is NOT an empty one: a failed `rev-parse --disambiguate` (injected, and real — '
2235-
+ 'a cwd that does not exist) is a problem the CLI refuses as usage, never "absent"',
2241+
+ 'a cwd that does not exist) is a problem the CLI refuses as usage, exit 1 with empty stdout, never "absent"',
22362242
/could not be checked/.test(hexPrefixProblem(full, '0148abc', () => null) ?? '')
2237-
&& /could not be checked/.test(hexPrefixProblem(join(full, 'no-such-dir'), 'deadbeefdeadbeef') ?? ''));
2243+
&& /could not be checked/.test(hexPrefixProblem(join(full, 'no-such-dir'), 'deadbeefdeadbeef') ?? '')
2244+
&& unlistable.status === 1 && unlistable.stdout === '' && /could not be checked/.test(unlistable.stderr),
2245+
JSON.stringify({ status: unlistable.status, stdout: unlistable.stdout, stderr: unlistable.stderr }));
22382246
const usageText = spawnSync(process.execPath, [self, 'ancestor'], { encoding: 'utf8' });
22392247
t('the usage line says a proven no is proven against the ref AS LAST FETCHED, so "PROVEN" is not read as "fresh"',
22402248
usageText.status === 1 && /a no is proven against <ref> as last fetched/.test(usageText.stderr), JSON.stringify(usageText.stderr));

0 commit comments

Comments
 (0)