Repository navigation
docs(agents): gh addresses upstream by default, and the failure is silent - #278
Conversation
…lent Agents rediscover this every session: with both an `origin` (fork) and an `upstream` (confluentinc) remote and no gh-resolved config, gh prefers upstream, so a bare `gh pr list` / `gh pr view` / `gh pr create` silently addresses the wrong repository. The loud case is harmless - `gh pr view 259` errors because upstream has no such PR, and you go looking. The damaging case is the one that SUCCEEDS: the merged-PR prior-art search returns upstream's history, finds nothing relevant, and reads as "no prior art" - the exact false confidence "Before you investigate anything" exists to prevent. That command sat unqualified in that very table, so every agent that ran it searched confluentinc and had no way to tell. Fixed here, along with the chaos workflow-dispatch, the job-log run view, and the closing-references lookup. The real fix is `gh repo set-default astubbs/parallel-consumer`, run once per clone - it writes to the shared git config, so one run covers every worktree. Documented as a setup step rather than a habit, because a habit is what kept failing. But the config is local and uncommitted, so CI runners and fresh agent sandboxes still start wrong - hence the standing rule to qualify gh commands in anything written down, and to name confluentinc explicitly when upstream really is what you mean. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STG7ygSMtmFuu36BiqdA1m
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
Claude finished @astubbs's task in 1m 36s —— View job Code Review
Summary: This is a clean, well-scoped docs-only change. I read the full diff against Findings:
Minor nit (non-blocking): line 46, No correctness, security, or structural issues found. Approving from a review-feedback standpoint - nothing here blocks merge. |
✅ Duplicate Code ReportTwo engines run in parallel for cross-validation. Each has its own thresholds tuned to its baseline - the real safety net is the per-engine "max increase vs base" check. ✅ PMD CPD
No new clones introduced by this PR. ✅ jscpd (language-agnostic)
No new clones introduced by this PR. Powered by astubbs/duplicate-code-cross-check |
✅ SpotBugs ReportNo bugs found (new bugs only — baseline from base branch excluded). |
Review nit on PR #278: the verification step claimed `gh repo view --json nameWithOwner` "must print astubbs/parallel-consumer", but with --json the output is a JSON object - {"nameWithOwner":"astubbs/parallel-consumer"} - so the literal claim did not hold and a reader could not tell a pass from a near-miss at a glance. Adding -q .nameWithOwner makes the output exactly the string the sentence promises, and keeps it a single scriptable line. The reviewer's alternative - dropping --json - also removes the mismatch, but a bare `gh repo view` prints a whole repo page including the README, which makes "must print X" looser rather than tighter. Also spells out that this one command stays unqualified on purpose: it is testing what the bare default resolves to, so passing -R would defeat the check. That is the one place in the file where the surrounding "always qualify" rule must not be applied, and it was previously left implicit. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STG7ygSMtmFuu36BiqdA1m
|
Claude finished @astubbs's task in 4m 35s —— View job Code Review
Summary: This is a docs-only PR ( Findings (posted inline):
Everything else checked out: all new/edited bash snippets are syntactically valid, both new markdown anchor links ( No blocking correctness/security issues — these two are the same class of gap the PR itself set out to close, so worth fixing before merge for internal consistency. |
Correct, and worth fixing on a page whose whole point is that the verification step must be unambiguous. Confirmed directly: Fixed in ece5bed, though not quite the way suggested. Dropping Took the opportunity to make one thing explicit that the section had left implicit: this is the single command in the file that must stay unqualified, because it is testing what the bare default resolves to - adding On the sweep result - agreed on |
Review findings on PR #278, both the same defect class this PR set out to close - which is the point: the original sweep found four unqualified commands and still left these behind. `gh pr diff <n> --name-only` in the "Open PRs" prior-art row is the real one. It sits in the same table as the merged-PR search this PR fixed, and the row's first half was already qualified, so the second half read as deliberate when it was just missed. Without the local set-default config it resolves against upstream and returns a same-numbered but unrelated PR's file list - a wrong answer to "what would my change collide with", delivered silently. Flag placed after the positional to match the house style already used at the run-view and pr-view examples. The `gh run view --log` mention is reworded rather than qualified. The paragraph cites it to say it does NOT do what you want ("refuses while any job is still going"), so bolting -R onto it would dress a command the text is steering you away from up as a recipe. Naming the flag instead - "the --log flag on gh run view" - removes the copy-pasteable bare command entirely, which is the actual risk, and reads in parallel with the --log-failed clause that follows. Swept the rest of the file again: every other gh mention is either already qualified, carries the repo in its gh api URL path, names confluentinc on purpose, or is one of the deliberately-bare examples in the new section that demonstrate the bug itself. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STG7ygSMtmFuu36BiqdA1m
|
Claude finished @astubbs's task in 4m 14s —— View job Code Review
Summary: Re-reviewed after commit 271cdb1. Both issues raised in the prior review round are fixed:
I also re-verified: both new markdown anchors ( One remaining gap, outside this PR's diff so it can't be posted as an inline comment:
This is the same defect class the PR sweeps for — no No other correctness or consistency issues found. Nothing here blocks merge. |
Third review round on PR #278 pushed back on the one instance I had consciously left alone, and it is right. I had dismissed it as an incomplete fragment inside a point about the PR template rather than a runnable recipe. That undersold it on two counts. It is the highest-stakes command in the class - a bare `gh pr create` against a fork whose upstream is confluentinc opens a public PR on someone else's repository, which is loud, embarrassing and not quietly undoable. And `gh pr create` is one of exactly four commands the new section at the top of this file names as silently misfiring, so leaving the file's only bare example of it two hundred lines further down undercut the rule where a reader is most likely to act on it. Unlike the `gh run view --log` case, this one is qualified rather than reworded: that citation was describing a flag that does not do what you want, while this is a command a reader genuinely runs, so it needs the flag rather than the removal. That closes the class in this file. Every remaining gh mention is qualified, carries the repo in its gh api URL path, names confluentinc deliberately, or is one of the intentionally-bare examples in the new section that demonstrate the bug itself. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STG7ygSMtmFuu36BiqdA1m
Agreed - you've talked me out of my own judgement call. Qualified in ea4216c. I under-weighted it on two counts. It is the highest-stakes member of the class: a bare Qualified rather than reworded, which is the opposite of the That closes the class for this file. Final state of the sweep, for the record: every remaining Separately, and not something this PR should fix: the |
|
(Trimmed - this crossed with the response above, which covers the The class is not self-sustaining as a prose rule. Three review rounds on this PR each found another instance - line 82, line 288, then line 628 - and the first two were missed by a sweep that was specifically looking for them. That holds exactly as long as whoever last swept was thorough, and nothing catches the regression when a future edit adds a bare And it survives outside this file. Per the "search for other instances of the same defect" rule, I swept the rest of the repo rather than just
These are copy-paste recipes aimed at a human at a terminal, which is exactly the population the new section is written for. Also checked and ruled out, so the negative result is on record: Suggested follow-up, deliberately not done here. A script that greps docs, workflows and scripts for Keeping it out of this PR on purpose: this change is docs-only, reviewed and ready, and a new script plus workflow plus its own tests is a different change with a different blast radius. Flagging it so it is tracked rather than quietly lost. |
|
Claude finished @astubbs's task in 54s —— View job Code Review
Summary: Re-reviewed at HEAD ( Verified fixes:
Independent re-sweep of every Other checks:
No remaining correctness or consistency issues. This closes the defect class the PR set out to fix — nothing here blocks merge. |
The reassessment note tells a future reader to re-measure the dependency graph after the next push to master. That instruction was incomplete: GitHub's managed `Automatic Dependency Submission (Maven)` workflow has failed on every run since the feature was enabled, so the graph will not repopulate and the re-measurement would read as "no change" for entirely the wrong reason. The failure is repo-wide, not this branch's - identical on #259 and #278. Its `validate-project` step cannot resolve `parallel-consumer-core` (or its test-jar) on a clean runner, which is exactly the failure mode dependency-audit.yml already documents and works around by running `test-compile` instead of `validate`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STG7ygSMtmFuu36BiqdA1m
Review caught two references calling #281 open. It merged as f89f27f at 02:46Z, twelve minutes before the previous commit on this branch landed, so the reference was stale when it was written rather than drifting later. Swept the same class across every file this PR touches. One more instance: the ossindex note still described the CVE triage write-up as in flight on an unpushed branch, when it is on master as docs/inflight/deps-cve-backlog.md. Everything else checks out - #259 and #278 are marked merged and are, #279 is marked open and is. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STG7ygSMtmFuu36BiqdA1m
Description
Agents rediscover this every session, and it was starting to cost real time - so this fixes it at the source and writes down the rule.
The problem. This checkout has two remotes:
origin→astubbs/parallel-consumer(where the work happens) andupstream→confluentinc/parallel-consumer. With both present and nogh-resolvedconfig set,ghprefers theupstreamone. So a baregh pr list,gh pr view,gh run vieworgh pr createsilently addresses confluentinc.Why it earns a section rather than a footnote: the failure is usually silent.
gh pr view 259errors loudly ("Could not resolve to a PullRequest") only because upstream happens to have no such PR - you notice, and you go looking. The damaging case is the one that succeeds:which is the exact false confidence that section exists to prevent. That very command sat unqualified in that very table, so every agent that ran it searched the wrong repository and had no way to tell.
Fixed here, along with every other instance of the same defect class found by sweeping the file: the chaos workflow dispatch, the job-log
gh run view, theclosingIssuesReferenceslookup, thegh pr diffhalf of the open-PR prior-art row, and thegh pr createexample in the PR-template note. The last two were caught by review on this PR rather than by the original sweep - which is its own small argument for the section existing.Two related corrections in the same pass. The setup step's verification command now uses
-q .nameWithOwner, so it prints the bare string the sentence promises instead of a JSON object. And thegh run view --logcitation was reworded to name the flag rather than qualified with-R: that paragraph cites the command for what it refuses to do, so removing the copy-pasteable bare command is the honest fix, where a command a reader genuinely runs gets the flag instead.The actual fix is
gh repo set-default astubbs/parallel-consumer, run once per clone - it writesremote.origin.gh-resolvedinto the shared git config, so a single run covers every worktree. Verified from a different worktree afterwards. It is documented as a setup step, not a habit, because a habit ("remember to pass-R") is precisely what kept failing.But that config is local and uncommitted, so CI runners, other machines and fresh agent sandboxes still start wrong. Hence the two habits the section keeps: qualify
ghin anything written down (docs, scripts, a handoff prompt), and nameconfluentincexplicitly when upstream genuinely is what you mean - reading an upstream issue is normal here; what must never be accidental is which repo answered.Checklist
CHANGELOG.adoccorrectly untouched: perAGENTS.mda PR never adds an entry, and this is invisible to users and operators.N/A. There is nothing executable here; the enforcement mechanism is the localghconfig, which cannot be committed. The commands corrected in the doc were verified by running them.N/A. No workflow, runner or permissions files touched.