Repository navigation
skills(running-tend): give the Codex auth-manager check a method the compare cap can't fake - #1344
Conversation
…compare cap can't fake
tend-agent
left a comment
There was a problem hiding this comment.
Every other check in this section ships a command; this one describes the API walk in prose, so each weekly session re-derives it. CLAUDE.md's "Authoring skills" asks for the other form here: "Prefer recipe over narrative. A code block plus a one-sentence framing beats a multi-paragraph explanation."
Two things get lost in the derivation. "Recurse both trees" prescribes a manual walk that git/trees/<tag>?recursive=1 does in one call per tag (8,606 entries at rust-v0.155.1, truncated: false). And codex_version is pinned as an npm version (0.154.0) while the trees are addressed by git tag (rust-v0.154.0) — "at each tag" doesn't carry that mapping, and a bare 0.154.0 404s against the trees endpoint.
Pushing the recipe form: a login_blobs helper over that single call, diffed between the two tags. It reproduces this PR's own evidence — auth/manager.rs and token_data.rs as the blobs that moved — and makes empty output a proven all-clear. Not posted as an inline suggestion because the replacement carries a fenced block.
The cap claims check out
compare/rust-v0.154.0...rust-v0.155.1 returns {"files": 300, "total_commits": 220}, and --paginate emits 300, 0, 0 — it pages commits, not files. codex-rs/login/ is absent from those 300, while the directory's tree SHA differs across the two tags (63f3c5fc787e370d2d79b48dd31cda1e2ff0cb9c → 080a830a35cd4f231997c2e5a4b490f206b6b910).
Replaces the prose walk with the tree listing that does it in one call per tag, and names the rust-v prefix the codex_version pin does not carry.
tend-agent
left a comment
There was a problem hiding this comment.
Verified the recipe against rust-v0.154.0...rust-v0.155.1: it names auth/manager.rs and token_data.rs, the two blobs the compare filter missed. Two reporting issues, both of which I'm pushing a fix for since this is my own PR.
The sort key scatters each changed path. "\(.sha) \(.path)" sorts by SHA, so a modified file's before and after lines land wherever their hashes fall — manager.rs prints at output lines 4 and 43 in that window. Modified files and genuinely-new ones (internal_identity.rs here) then look alike unless you re-match paths by eye. "\(.path) \(.sha)" puts each path's two lines adjacent.
"a tree listing carries no file cap" overstates it. The trees endpoint truncates too, setting truncated: true past ~100k entries or 7 MB; openai/codex is at 8,606, so this is remote today. But the sentence asks a future session to trust an absolute that isn't one — the same trust the PR is removing from compare. The accurate version is the stronger claim anyway: trees reports truncation instead of silently dropping entries, which is why it can back an all-clear that a 300-file cap can't.
Recipe output on that window
4d3
< 18b94ef930b0fb869db54f1cd5b1b56653713f6a codex-rs/login/src/auth/manager.rs
8d6
< 2952ecb2a7cb50fb7c1b1d462eb6f2f16231baf3 codex-rs/login/src/token_data.rs
27a26
> 95ac0cc959fcf235435ad97ba716137c83b691e3 codex-rs/login/src/internal_identity.rs
35a35,36
> ac9db21352a3b699a7dd3a8277490e07d3cc181e codex-rs/login/src/auth/account_user_id_tests.rs
> af80bf3733da758eb193e63206fe4f28a7f83580 codex-rs/login/src/token_data.rs
41a43
> de1f26ca0c447edcffe7d6fabb6f8de28201d830 codex-rs/login/src/auth/manager.rs
gh api repos/openai/codex/git/trees/rust-v0.155.1?recursive=1 returns {"entries":8606,"truncated":false}.
…es cap Sorting the blob listing by SHA scattered each changed path's before and after lines through the diff output, so a modified file was indistinguishable from an added one without re-matching paths by eye. Sorting by path puts both lines of each path adjacent. "a tree listing carries no file cap" also overstated it: the trees endpoint sets `truncated` past ~100k entries or 7 MB. That is remote for openai/codex (8,606 entries), but the accurate version is the stronger claim anyway -- trees reports truncation instead of silently dropping entries, which is why it can back an all-clear that compare's 300-file cap cannot.
tend-agent
left a comment
There was a problem hiding this comment.
Both fixes check out against rust-v0.154.0...rust-v0.155.1: sorting by path now prints manager.rs and token_data.rs as adjacent </> pairs, so they read as modifications rather than blending in with the genuine additions (internal_identity.rs, account_user_id_tests.rs). One gap remains in the increment, which I'm pushing a fix for since this is my own PR.
The recipe discards the signal the new sentence rests on. --jq '.tree[] | select(...)' projects the array and drops .truncated, so a truncated response yields a short listing with nothing to distinguish it from a complete one — and diff of two short listings can come back empty. The sentence then tells a future session that empty output is a real all-clear because trees "sets truncated rather than silently dropping entries", but the endpoint setting a flag the recipe never reads buys nothing. That is this PR's own failure mode, one endpoint over: a method that silently caps, backing an all-clear it can't support.
Guarding it in the filter keeps the block at three lines and turns the one limit trees does have from something to trust into something proven:
--jq 'if .truncated then error("tree truncated") else .tree[] | select(.type == "blob" and (.path | startswith("codex-rs/login/"))) | "\(.path) \(.sha)" end'
gh api propagates a jq error() to stderr and exits non-zero. Inside diff <(…) <(…) the exit status isn't observable, but the message is: error: tree truncated twice over instead of a silent empty diff. That is the whole distinction between reported and dropped.
Headroom is wide today — 8,606 entries against the endpoint's ~100k-or-7MB limit — so this is about what the recipe can back, not a live failure.
Claims verified against the live API
The prose's load-bearing claims all hold:
compare/rust-v0.154.0...rust-v0.155.1returns{"files": 300, "total_commits": 220}, and--paginateemits300, 0, 0— it pages commits, not files.codex-rs/login/contributes 0 filenames to those 300, while the trees method names all four moved blobs. The compare filter's all-clear was false.git/trees/rust-v0.155.1?recursive=1reports{"entries": 8606, "truncated": false}— the field the current filter discards.codex_versionis pinned0.154.0, with norust-vprefix, so the sentence about the tag prefix is load-bearing rather than incidental.
Guard behavior, forcing the error branch with an inverted condition: gh api exits 1 and prints error: tree truncated; through diff <(…) <(…) both sides print it while diff itself still exits 0.
The recipe justified "empty output is a real all-clear" by noting that the trees endpoint sets `truncated` rather than silently dropping entries, but the --jq filter projected .tree[] and discarded the flag. A truncated response therefore returned a short listing indistinguishable from a complete one, and a diff of two short listings can come back empty -- reproducing, one endpoint over, the false all-clear this section exists to prevent. Guard the flag in the filter instead. gh api propagates a jq error() to stderr and exits non-zero; inside the process substitutions the exit status is not observable, but the message is, so truncation now reports rather than passing as an all-clear.
The weekly pin sweep's
codex_versionrule asks for an inspection of Codex's auth manager before a bump, but names no method. The obvious one — filterrepos/openai/codex/compare/<old>...<new>tocodex-rs/login/— silently reports an all-clear it cannot support: that endpoint caps itsfilesarray at 300 and--paginatedoes not lift the cap, so any release window of a few hundred commits drops the directory from the list whether or not it changed.Nothing downstream catches the false all-clear.
test-codex-surfaceis credential-free and does not reach the auth manager, and the rule's own live rotation gate cannot run from an agent session, so a real change to the refresh-token chain would ship into every consumer's Codex jobs under a PR body reporting that the surface was checked.This adds the method that does hold: compare
codex-rs/login's tree SHA at each tag, and where the SHAs differ, recurse both trees, diff the blob SHAs, and read the blobs that moved. Tree SHAs are unaffected by any file cap, so the check either finds the change or proves there was none.Evidence: #1342, where the compare-filter method reported
codex-rs/login/unchanged acrossrust-v0.154.0...rust-v0.155.1while the directory's tree SHA differed and bothauth/manager.rsandtoken_data.rshad moved.