Repository navigation
docs: rules for client-specific code and a client coverage table - #1323
Conversation
7c77e84 to
6e87182
Compare
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (glm, user of @amiddavid) | GLM rits/zai-org/glm-5-3 via Claude Code 2.1.331 | offload-review skill, @amiddavid's session | fresh | 2 of 2 | 1 of 2 | 6e871820f714 |
approve |
Verdict: approve
Findings
None.
Non-blocking
docs/client-coverage.md:28saysclient.Identify. Every other place in this PR says
agent.Identify(#1312, #1331). Use one name for one meaning.agent/all/coverage_test.go:31takes the first table in the page, not the one under
"## By client". A table added above it later makes the test fail loudly, not silently. Acceptable.
The comment could say the code checks position, not the heading.agent/all/coverage_test.go:20—pendingRowsis a manual list. A client that registers while
its entry stays does not fail. The TODO already says to remove entries. Fine for now.CLAUDE.md:103lists the clients as Claude Code, Codex, OpenCode, Pi, Bob.
dash/event.go:1265also knows cursor, cline, aider, gemini-cli as client families. Those are
dashboard labels, not client rules. Say somewhere that the list covers clients with agent rules,
not every label.
What I checked
- Read the full diff: 6 files, 183 insertions, 1 deletion. Docs, rules and one new test. No Go
behavior change, so no data-dependence row and no behavior-change note is owed. - Traced
agent/all/coverage_test.goby hand against the real doc. The parser returns exactly
claude code, codex, opencode, pi, bob. Onlybobregisters (agent/bob/bob.go:25, via the
agent/allblank import), andBobhas a row. The other four are inpendingRows. All three
loops in the test pass on this doc. Header and separator rows are skipped correctly. - Checked the test compiles by reading
agent/registry.goandagent/agent.go:agent.All()
andAgent.Name()exist;agent/allexists and registers bob. The file is in package
all_testnext toall_test.go, same package, no clash. No timing waits, so the
timingguardrule is met. - Checked the doc's claims against the code on this head:
- Codex session key:
proxy/proxy.go:813usescodex.Identify, which readssession-id
(agent/codex/codex.go:41). Matches "covered:session-idheader (#1322)". - Claude Code subagent thread:
thread/host.go:13readsx-claude-code-agent-id. Matches. - Bob wait cause:
internal/waitcause/waitcause.go:40definesWaitingHuman = "human".
Matches "readshuman". - Bifrost adapter:
adapters/bifrost/plugin.go:78resolveSessionreads a context value, not
request headers. Matches "never sees request headers". agent/codexis a helper with noRegistercall. Matches the test's comment.
- Codex session key:
- Checked the new rules in
CLAUDE.md,RELEASING.md,offload-review/review-prompt.mdand
refactor-scan/SKILL.mdagainst each other. They agree on the rule, the exception (Bob's
gateway route), the fallback requirement, and "report once, as a client rule". - Confirmed the PR follows its own new rule 6: no Go client rule is added, so no coverage-table
update was owed beyond the table itself.
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (glm, user of @amiddavid) | GLM rits/zai-org/glm-5-3 via Claude Code 2.1.331 | offload-review skill, @amiddavid's session | fresh | 1 of 2 | 1 of 2 | 6e871820f714 |
approve |
Verdict: approve
Findings
None.
Non-blocking
agent/all/coverage_test.go:40—clientRowsreads "the first table in the page", not the table under## By client. A new table added above it changes which table the test reads. Anchor the scan on the## By clientheading to make the failure mode clear.agent/all/coverage_test.go:22— the error text says "add it to pendingRows with an issue", but the map holds no issue. The TODO comment covers all entries at once. A per-entry issue would age better..claude/skills/refactor-scan/SKILL.md:84— the signs list namesclaude-code,codex,opencode,bobshellbut not Pi. I assume this is deliberate: the string "pi" matches too much Go code. One line saying so would stop a reader taking it for an oversight.
What I checked
- Read the full diff of all 5 commits:
CLAUDE.md,RELEASING.md,docs/client-coverage.md,agent/all/coverage_test.go,.claude/skills/offload-review/review-prompt.md,.claude/skills/refactor-scan/SKILL.md. - Traced the test by hand against the doc.
agent/allregisters only Bob (agent/all/all.go). The doc's first table has rows for Claude Code, Codex, OpenCode, Pi, Bob. Bob is registered; the other four are inpendingRows. All three checks inTestClientCoverageHasARowForEveryAgentpass. The parser stops at the first non-table line, so the "By host" table is not read. - Confirmed
agent.All()andagent/allexist as the test uses them (agent/registry.go,agent/all/all.go), and thatagent/codexis a helper with no registration, as the test comment says. - Checked the doc's claims against the code:
x-claude-code-agent-id(thread/host.go:13), Codexsession-id/thread-id/x-codex-parent-thread-id(agent/codex/codex.go), the generichumanwait cause (internal/waitcause/waitcause.go:40), Codex hook payloads on/signal(proxy/clientsignal.go:50), andresolveSessionin the bifrost adapter reading only the context value and metadata, never headers (adapters/bifrost/plugin.go:78). - Checked the cited PR and issue states: #1317 and #1322 are merged and the doc marks them covered; #1318, #1331 and #1335 are open and the doc marks them "(open)"; #1309, #1312 and #1321 are open issues.
- Checked the CLAUDE.md rule set against the review-prompt and refactor-scan text. The three say the same thing: where a client rule lives, what the fallback must state, and who checks it.
- Confirmed the base
290898d3is the tip oforigin/main, so the diff is the whole PR. - No behavior change, no data dependence: the PR adds docs and a test only. No row in
docs/data-dependence.mdis needed. - Live tests were not approved, so I did not build or run Go.
|
Round 1 notes, fixed in Reviewer 1
Reviewer 2
Tests: |
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (glm, user of @amiddavid) | GLM rits/zai-org/glm-5-3 via Claude Code 2.1.331 | offload-review skill, @amiddavid's session | resumed | 2 of 2 | 2 of 2 | 3fe0b6302dc5 |
blocking |
Verdict: blocking
Findings
- agent/all/coverage_test.go:70 — the second case of
TestParseClientRowsFailsLoudlypasses for the wrong reason, and the branch it names is untested- What fails: the case feeds
"## By client\n\nno table\n\n## By host\n\n" + tableand its
message says "a heading without a table must fail, not read the next table". But
parseClientRowscuts on"\n## By client\n"(line 35): the heading needs a newline before
it, and here it is the first line of the string.Cutfinds nothing, so the error comes from
the "no heading" path (line 37), not the path the case claims to test. - Proof: I ran the parser logic on all three inputs. Case 2 returns
no "## By client" heading, the same error as case 1. The intended path — heading found, the
##break at line 46-48 fires,rowsstays empty, the "no client rows" error at line 60
returns — is reached by no test input. So the##break and the empty-table error are new
behavior with no effective test. If someone removed the##break, this test would still
pass, and a page whose "By client" section lost its table could read the "By host" table
instead. Cases 1 and 3 behave as claimed; I checked them the same way. - Fix: give the input a line before the heading, for example
"# T\n\n## By client\n\nno table\n\n## By host\n\n" + table. ThenCutmatches, the loop
stops at## By host, and the case fails through the empty-rows error it means to test.
- What fails: the case feeds
Non-blocking
agent/all/coverage_test.go:35—strings.Cut(doc, "\n## By client\n")also misses a heading
at byte 0 of the file. The real doc has a title line, so this cannot bite today. The fix for
finding 1 makes the same true of the test input.
What I checked
- Last review: round 1, 6e87182, 2026-11-24T12:06:52Z.
- New commits read: 1 (
3fe0b630docs: address round 1 notes on the client coverage test and
rules). Read its full diff and each changed file around the changes. - Read in full: 2 reviews, 1 comment, 0 inline comments (from the three saved files). The inline
file is empty. - New items since my last review: reviewer 1's round-1 review (12:07:04Z), the author's fix note
(12:08:54Z), and commit3fe0b630. I checked each one. - Earlier findings, mine:
client.Identifynaming — fixed (docs/client-coverage.md:28now says
agent.Identify). First-table-vs-heading — fixed by the anchor; I ran the new parser on the real
doc and it returns the same five clients.pendingRowsmanual list — author kept it, with the
comment and a per-entry issue; the reason is right, I accept it. Client list vs dashboard labels
— fixed (CLAUDE.mdnow says the list covers clients with agent rules and names
cursor, cline, aider, gemini-cli as labels with no rules, which matchesdash/event.go:1265). - Earlier findings, reviewer 1: anchor the scan — fixed, and the anchor works on the real doc.
Per-entry issue — fixed (pendingRowsmaps to #1312 and #1331). Pi sign in refactor-scan —
fixed (SKILL.mdsays why "pi" is not a sign and what to look for instead). I checked each in
the diff myself; no new proof to add. - Checked the rest of the new commit:
fmtis imported and used;strings.Cutand the map change
tomap[string]stringcompile against the loops that use them; no timing waits. The refactor-scan
and CLAUDE.md edits match the code they describe. - Did not run Go: live tests are not approved. The author's PR comment says
go vetand
go test -race ./agent/allpass on macOS, Go 1.27.4; my finding does not contradict that, since
the flawed case passes.
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (glm, user of @amiddavid) | GLM rits/zai-org/glm-5-3 via Claude Code 2.1.331 | offload-review skill, @amiddavid's session | resumed | 1 of 2 | 2 of 2 | 3fe0b6302dc5 |
approve |
Verdict: approve
Findings
None.
Earlier findings
- Mine, round 1, all three non-blocking: fixed. The table scan is anchored on the
## By clientheading (parseClientRows,agent/all/coverage_test.go:35);pendingRowsmaps each client to #1312 or #1331; the refactor-scan signs say why Pi has no plain-string sign and namex-context-guru-clientinstead. - Reviewer 2, round 1, four non-blocking notes:
client.Identify→agent.Identifyfixed (docs/client-coverage.md:28); the position comment fixed by the same anchor change; the manualpendingRowslist accepted as is — the author kept it with the per-entry issue and the removal note, and I agree the reason is sound; the client list fixed (CLAUDE.mdnow says cursor, cline, aider and gemini-cli are dashboard labels with no rules, which matchesdash/event.go:1265).
Non-blocking
agent/all/coverage_test.go:70— the second case ofTestParseClientRowsFailsLoudlydoes not reach the##break it is written for.parseClientRowscuts on"\n## By client\n", but the fixture starts with the heading, so there is no newline before it:strings.Cutreports "not found" and the case passes through the missing-heading branch. The##guard at lines 46-48 runs in no test. Deleting it would go unnoticed. The asserted outcome (an error) still holds, and the real doc has the heading mid-page, so nothing is wrong today. Fix: prefix the fixture with a line, for example"# T\n\n## By client\n\nno table\n\n## By host\n\n" + table.agent/all/coverage_test.go:94— thelen(rows) == 0check is dead:clientRowsfatals on error, andparseClientRowsnever returns empty rows without an error. Harmless leftover from round 1.
What I checked
- Last review: round 1, 6e87182, 2026-11-24T12:07:04Z.
- New commits read: 1 (
3fe0b630docs: address round 1 notes on the client coverage test and rules). Readgit log --statand the full diff6e871820..HEAD: 4 files, 63 insertions, 23 deletions. - Read in full: 2 reviews, 1 comment, 0 inline comments (from
.review-in-reviews.txt,.review-in-comments.txt,.review-in-inline.txt; the inline file is empty). - New items since my last review: commit
3fe0b630(reviewed below); the author's reply comment at 12:08:54 (checked each claim against the diff — all true); reviewer 2's round-1 review (read in full now, per the round-2 rules; its findings are dispositioned above). - Traced
parseClientRowsby hand against the real doc.strings.Cutfinds"\n## By client\n"mid-page;afterholds the client table; the loop returns exactlyclaude code, codex, opencode, pi, bob. The## By hosttable is not read. With only Bob registered, all three checks inTestClientCoverageHasARowForEveryAgentpass. - Traced all three cases of
TestParseClientRowsFailsLoudly. Cases 1 and 3 behave as asserted. Case 2 passes for a different reason than its comment says — see Non-blocking. - Checked
pendingRowsagainst the issues: #1312 and #1331 are open, and their titles cover the clients each entry names. - Checked the CLAUDE.md wording change against
dash/event.go:1265: cursor, cline, aider and gemini-cli are label-only families there. Consistent. - Checked the commit's DCO sign-off and
Assisted-By:attribution: present and in the repo's form. - No behavior change, no data dependence: docs and test only. No
docs/data-dependence.mdrow is owed. - Live tests were not approved, so I did not build or run Go. The author reports
go vet ./agent/...andCGO_ENABLED=1 go test -race ./agent/allpass on macOS, Go 1.27.4; my traces agree.
|
Round 2 notes, fixed in the commit after Reviewer 2 (block)
Reviewer 1
Tests: |
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (glm, user of @amiddavid) | GLM rits/zai-org/glm-5-3 via Claude Code 2.1.331 | offload-review skill, @amiddavid's session | resumed | 2 of 2 | 3 of 3 | a76496ff1146 |
approve |
Verdict: approve
Findings
None.
Non-blocking
None.
What I checked
- Last review: round 2, 3fe0b63, 2026-11-24T12:11:15Z.
- New commits read: 1 (
a76496fftest: fix the heading fixtures of the client coverage parser
test). It changes onlyagent/all/coverage_test.go, 5 insertions, 5 deletions. I read the diff
and the whole file around it. - Read in full: 4 reviews, 2 comments, 0 inline comments (from the three saved files). The inline
file is empty. - New items since my last review: reviewer 1's round-2 review (12:11:58Z, approve with two
non-blocking notes), the author's round-2 fix note (12:13:17Z), and commita76496ff. I checked
each one. - My round-2 finding (case 2 passed through the missing-heading path): fixed. The fixture now
starts with# T\n\n, soCutfinds the heading. I ran the parser logic on the new input: it
returns theno client rows under "## By client"error, the path the case names. - My round-2 non-blocking note (heading at byte 0 missed by
Cut): fixed.parseClientRows
now cuts on"\n" + doc, and a new case feeds a page that starts with## By clientand expects
bob. I checked both by simulation. - Reviewer 1's round-2 notes: the case-2 note is the same defect as my finding — fixed as
above. The deadlen(rows) == 0check — removed, and the removal is right:clientRows
fatals on any parse error, andparseClientRowsnever returns empty rows without an error, so
the check could not fire. - Mutation check of my own: I deleted the
##guard from the parser logic and ran case 2. It
then returns{bob}with no error, so the test fails. The guard is now genuinely covered. This
matches the author's mutation note. - Ran the new parser on the real doc: it returns
claude code, codex, opencode, pi, bob, the same
five clients as before. With onlybobregistered,TestClientCoverageHasARowForEveryAgent
still passes. - Compile check by reading: no import changes,
fmtandstringsstill used, no timing waits. - Did not run Go: live tests are not approved. The author reports
go vet ./agent/alland
CGO_ENABLED=1 go test -race ./agent/allpass on macOS, Go 1.27.4; my traces agree.
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (glm, user of @amiddavid) | GLM rits/zai-org/glm-5-3 via Claude Code 2.1.331 | offload-review skill, @amiddavid's session | resumed | 1 of 2 | 3 of 3 | a76496ff1146 |
approve |
Verdict: approve
Findings
None.
Earlier findings
- Reviewer 2, round 2, blocking (the
TestParseClientRowsFailsLoudlyfixture passed through the missing-heading branch, leaving the##guard untested): fixed. I raised the same defect as non-blocking in my round 2. The fixture now starts with# T, sostrings.Cutfinds the heading and the## By hostbreak fires. My trace of the new input: heading found, loop stops at## By host, rows stay empty, the "no client rows" error returns. The guard is now exercised. The author also reports a mutation check — deleting the guard fails case 2 — and my trace agrees. - Reviewer 2, round 2, non-blocking (a heading at byte 0 of the page is not found): fixed.
parseClientRowsnow cuts on"\n" + doc, and a new case feeds a page that starts with## By client. My trace: the cut matches at position 0 and the case returnsbob. - Mine, round 2, both non-blocking: the fixture gap fixed by the same change; the dead
len(rows) == 0check removed.clientRowsfatals on error andparseClientRowserrors on an empty table, so the removed check was unreachable.
Non-blocking
None.
What I checked
- Last review: round 2, 3fe0b63, 2026-11-24T12:11:58Z.
- New commits read: 1 (
a76496fftest: fix the heading fixtures of the client coverage parser test). Readgit log --statand the full diff3fe0b630..HEAD: 1 file, 5 insertions, 5 deletions. - Read in full: 4 reviews, 2 comments, 0 inline comments (from
.review-in-reviews.txt,.review-in-comments.txt,.review-in-inline.txt; the inline file is empty). - New items since my last review: commit
a76496ff(reviewed above); reviewer 2's round-2 review at 12:11:15Z (read in full; its blocking finding matches my round-2 note and is now fixed); the author's reply at 12:13:17Z (each claim checked against the diff — all true). - Traced every case of
TestParseClientRowsFailsLoudlyon the new head. Case 1 (no heading) errors. Case 2 (# Ttitle, heading, no table, then## By host) now reaches the##break and errors on empty rows. Case 3 (heading at byte 0) returnsbob. Case 4 (an earlier table above the heading) returns onlybob. All behave as asserted. - Traced
parseClientRowson the real doc: the cut still finds## By clientmid-page and returnsclaude code, codex, opencode, pi, bob. With only Bob registered,TestClientCoverageHasARowForEveryAgentpasses. - Checked the
"\n" + docprepend for false matches: a longer heading such as### By clientor## By clientsdoes not match the separator"\n## By client\n". - Checked the commit's DCO sign-off and
Assisted-By:attribution: present and in the repo's form. - No behavior change, no data dependence: a test-only commit. No
docs/data-dependence.mdrow is owed. - Live tests were not approved, so I did not build or run Go. The author reports
go vet ./agent/allandCGO_ENABLED=1 go test -race ./agent/allpass on macOS, Go 1.27.4; my traces agree.
|
The head moved after the approvals. A human developer checked the change by hand.
|
Add "Client-specific code" to CLAUDE.md, a client-rule check to the offload-review prompt, a third refactor-scan pattern, and a wider step 5 in RELEASING.md. Add docs/client-coverage.md and a test that fails when a registered agent has no row. Closes #1321 Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
Cite #1317, #1318 and #1322 per client. Record Cortex facts from its plugin: host session id, no thread tracker, no signal route. Note that the bifrost adapter needs the transport to pass headers. Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
Anchor the table scan on the By client heading, map each pending row to its issue, name one Identify, say why Pi has no plain-string sign, and note that dashboard-only labels have no rules. Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
Find the heading at the start of the page. Prefix the no-table case with a title so the next-heading guard runs. Drop a dead empty-rows check. Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
Write each rule as a general rule with an example. State the coverage table as facts on main. Map pending rows to a reason, not an issue. Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
ac018dc to
d409f0e
Compare
|
The head moved again. A human developer checked the change by hand.
|
Signed-off-by: DAVID AMID <[email protected]>
|
Merge of
|
Closes #1321
Summary
What changed
CLAUDE.md: new section Client-specific code (test, Client rules, Not client rules, 6 numbered rules, pointer to docs: rules and review/release checks for client-specific code and its fallbacks #1321). One link from Hard boundaries.offload-review/review-prompt.md: a Client rules bullet after Host boundary. Code that fails both is reported once, as a client rule.refactor-scan/SKILL.md: Third pattern: client rule outside agent.Identify.RELEASING.md: no new step. Step 5 now runsrefactor-scanin its host-leak and client-rule modes.docs/client-coverage.md: coverage by client and by host. Open PRs feat(opencode-plugin): send lifecycle signals to the proxy #1317, fix(keepalive): read Codex and OpenCode subagents, stop reading human for other clients #1318, feat(agent): key Codex sessions by Codex's own session-id header (#1311) #1322 and issues refactor(agent): move Claude Code rules into agent/claudecode; add OpenCode and Pi labels #1312, fix(thread): detect client compaction for Codex, OpenCode and Pi #1314 are notes.agent/all/coverage_test.go: fails when a registered agent has no row, or a row names no registered agent.Why
A rule that names one client must live in
agent.Identify(#1312). Without a check, such rules spread over shared packages, and a client or host without the signal gets a worse result.Data dependence and behaviour
docs/data-dependenceedit.How it was tested
go vet ./agent/...andCGO_ENABLED=1 go test -race -timeout 30m ./agent/...pass.Open questions
agent/codexis a helper, not a registered agent. Claude Code, Codex, OpenCode and Pi sit inpendingRowswith aTODO(#1312, #1331). Empty the list as each registers.