chore(process): harden agent handoff, ledger revalidation, and wins classifier - #1840
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 29 minutes Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe PR strengthens verification and handoff evidence, adds authoritative issue reporting from ChangesWorkflow hardening
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Agent
participant IssuesSkill
participant IssuesReport
participant OriginMain
Agent->>IssuesSkill: Request /issues or /issues agent-safe
IssuesSkill->>IssuesReport: Run issues:report -- --json
IssuesReport->>OriginMain: Load cached ledger
OriginMain-->>IssuesReport: Return ledger and divergence metadata
IssuesReport-->>IssuesSkill: Return counts, blockers, queue, and safe wins
IssuesSkill-->>Agent: Present issue report
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
CI triageCI failed on this PR. Automated classification of the 4 failed job(s):
Compared with main CI run #9928 (cancelled). Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d4a6ed940a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex resolve actionable Codex review findings for this pull request and current head using the repository instructions. This is the pull request's single automatic repair pass: do not perform a fresh review, create new standalone findings, or request another review. Work only the existing unresolved Codex threads on the current head. The only repository destination is BigSimmo/Database, and the only branch destination is the pull request head branch codex/implement-process-safety-for-multi-agent-workflows at starting commit d4a6ed9; never publish fixes to a detached or synthetic work branch and never create a stacked pull request. Use the authenticated GitHub connector to commit each approved fix to BigSimmo/Database:codex/implement-process-safety-for-multi-agent-workflows, then verify that the pull request head contains the published commit before reporting success. Always fix P0 and P1 findings. For P2 and lower findings, fix only clear, scoped, low-risk issues; otherwise disposition them with a concise reason. For a fixed thread, reply with as the first line and as the second line. For a no-code disposition, use followed by . These result markers authorize the workflow to close that exact thread only after it verifies a fixed commit is the pull request head; a local-only commit is not a fix. If publication or verification fails, do not use either result marker, do not claim success, and leave the thread open with the blocker. If human input or new authorization is required, do the same. Finish only after every actionable thread is fixed or dispositioned and closed, or explicitly left open for a human decision. Do not update the branch from main, address unrelated reviews, broaden scope, or create more than one scoped fix commit. Do not use external APIs, paid services, credentials, dependency changes, or broad refactors unless explicitly authorized. Add targeted tests where behavior changes and run the narrowest relevant validation. |
Summary
Testing
|
There was a problem hiding this comment.
Pull request overview
Hardens agent handoff and issue-ledger workflows against stale state, concurrent edits, and misleading verification evidence.
Changes:
- Adds revalidated issue reporting and agent-safe task classification.
- Consolidates handoff verification around risk-routed gates and decisive proof.
- Archives completed process-ledger items and adds focused tests.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/issues-report.mjs |
Adds ledger reporting and wins classification. |
scripts/productivity-core.mjs |
Revises verification and handoff routing. |
package.json |
Registers issues:report. |
tests/issues-report.test.ts |
Tests reporting and classification. |
tests/productivity-workflow.test.ts |
Tests handoff routing and proof. |
.claude/skills/issues/SKILL.md |
Requires revalidated ledger reads. |
.claude/skills/handoff/SKILL.md |
Adds concurrency and push safeguards. |
.claude/skills/gates/SKILL.md |
Clarifies minimal-gate evidence requirements. |
.claude/agents/verification-router.md |
Refines verification selection guidance. |
.agents/skills/handover/SKILL.md |
Aligns handover evidence guidance. |
docs/outstanding-issues.md |
Archives completed process items. |
docs/scripts-index.md |
Updates generated script counts. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@copilot Fix the code for all comments in this review thread. When a review comment includes a suggested change, apply the suggestion exactly. Do not make changes beyond what is described in the linked review thread. |
…with issues:report Co-authored-by: BigSimmo <87357024+BigSimmo@users.noreply.github.com>
... Fixed in commit
|
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/skills/handoff/SKILL.md:
- Around line 24-26: Update the handoff procedure around the branch/HEAD checks
to also record the cached index path/state before staging and compare it
immediately before committing. Stop on any index difference, and remove or
revise the unconditional git restore --staged behavior so unrelated staged,
unstaged, and untracked work is preserved.
In `@scripts/issues-report.mjs`:
- Around line 100-102: Update the origin/main fallback in
scripts/issues-report.mjs (lines 100-102) to label the source as cached and set
revalidated to false unless an explicitly confirmed remote refresh succeeded.
Update .claude/skills/issues/SKILL.md (lines 12-16) to state that the command
reads cached origin/main data unless an approved refresh occurred. Update
AGENTS.md (lines 875-877) to remove the claim that this command alone provides
an authoritative revalidated remote read, while preserving the requirement for
explicit user confirmation before provider-backed workflows.
In `@scripts/productivity-core.mjs`:
- Around line 109-115: Update the UI-change plan generation near the existing
npm run ensure and npm run verify:pr-local checks to emit the selected affected
journey between them, using the planner’s existing journey-selection logic.
Extend the related assertions in productivity-workflow.test.ts to verify the
journey appears in that order before the PR-local gate.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 41cac0ff-5ee9-4ced-9504-69eabd01a7c8
📒 Files selected for processing (13)
.agents/skills/handover/SKILL.md.claude/agents/verification-router.md.claude/skills/gates/SKILL.md.claude/skills/handoff/SKILL.md.claude/skills/issues/SKILL.mdAGENTS.mddocs/outstanding-issues.mddocs/scripts-index.mdpackage.jsonscripts/issues-report.mjsscripts/productivity-core.mjstests/issues-report.test.tstests/productivity-workflow.test.ts
Checked all 12 open PRs and mapped them to ledger rows. Twenty-four open rows are actively being fixed right now — #1835 (7 rows), #1840 (4), #1842 (6), #1841 (4), #1836 (2), #1837 (1), #1839 (1) — and none of those rows said so. This is the #292 failure mode with the safety off: a queued row that reads as unclaimed while a PR is open against it is how the same conversion shipped twice on 2026-08-09. Each row now names its PR and says not to start until that PR merges. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017paT42ZVMf8jaLtkjFxdy5
Co-Authored-By: OpenAI Codex <noreply@openai.com>
…cess-safety-for-multi-agent-workflows' into HEAD
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
.claude/skills/handoff/SKILL.md (2)
53-55: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winRequire confirmation before pushing.
Line 53 authorizes
git pushwithout an explicit confirmation gate. Add push and PR creation to the explicit-confirmation section, or require confirmation immediately before Step 5.As per coding guidelines, “Never access OpenAI, Supabase, GitHub/GitLab, hosted CI, or other provider-backed workflows without explicit user confirmation.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.claude/skills/handoff/SKILL.md around lines 53 - 55, Update the handoff instructions around Step 5 so pushing the feature branch requires explicit user confirmation immediately beforehand; also include pull request creation in the explicit-confirmation requirements. Preserve the existing push-status verification instructions after confirmation.Source: Coding guidelines
53-55: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winRequire an exact remote branch-ref check.
If the check uses
git ls-remote origin <branch>, Git can return bothrefs/heads/<branch>andrefs/tags/<branch>with different SHAs. Use a quotedrefs/heads/<branch>pattern, require one result, and compare its SHA withgit rev-parse HEADbefore reporting success.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.claude/skills/handoff/SKILL.md around lines 53 - 55, Update the Push instructions to verify the exact remote branch ref using a quoted refs/heads/<branch> pattern with git ls-remote, require exactly one matching result, and compare its SHA against git rev-parse HEAD before reporting success. Preserve the existing prohibition on masking push status.
🧹 Nitpick comments (1)
tests/issues-report.test.ts (1)
153-156: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winAdd a regression test for an unavailable
origin/mainledger.
tryGit()returnsundefinedwhengit showfails. Assert theworktreesource and unavailable-ref warning after deleting the ref.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/issues-report.test.ts` around lines 153 - 156, Extend the ledger test around loadRevalidatedLedger to delete the origin/main ref before loading, then assert that source.worktree is selected and source.warning reports the unavailable local remote-tracking ref. Preserve the existing cached-ledger assertions for the current scenario and specifically cover the tryGit() undefined path.Source: Learnings
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/skills/handoff/SKILL.md:
- Around line 21-30: Update the handoff procedure around the pre-staging
snapshot to record worktree content and untracked state for every intended path,
in addition to cached index entries. Immediately before staging, compare those
snapshots and stop or switch to an isolated worktree if any intended path was
modified, added, or removed; preserve all existing staged, unstaged, and
untracked user work.
---
Outside diff comments:
In @.claude/skills/handoff/SKILL.md:
- Around line 53-55: Update the handoff instructions around Step 5 so pushing
the feature branch requires explicit user confirmation immediately beforehand;
also include pull request creation in the explicit-confirmation requirements.
Preserve the existing push-status verification instructions after confirmation.
- Around line 53-55: Update the Push instructions to verify the exact remote
branch ref using a quoted refs/heads/<branch> pattern with git ls-remote,
require exactly one matching result, and compare its SHA against git rev-parse
HEAD before reporting success. Preserve the existing prohibition on masking push
status.
---
Nitpick comments:
In `@tests/issues-report.test.ts`:
- Around line 153-156: Extend the ledger test around loadRevalidatedLedger to
delete the origin/main ref before loading, then assert that source.worktree is
selected and source.warning reports the unavailable local remote-tracking ref.
Preserve the existing cached-ledger assertions for the current scenario and
specifically cover the tryGit() undefined path.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5805e83d-96d6-4e92-8b9d-512ee6d2f330
📒 Files selected for processing (9)
.claude/skills/handoff/SKILL.md.claude/skills/issues/SKILL.mdAGENTS.mddocs/branch-review-ledger.mddocs/outstanding-issues.mdscripts/issues-report.mjsscripts/productivity-core.mjstests/issues-report.test.tstests/productivity-workflow.test.ts
💤 Files with no reviewable changes (1)
- docs/outstanding-issues.md
🚧 Files skipped from review as they are similar to previous changes (5)
- tests/productivity-workflow.test.ts
- AGENTS.md
- scripts/productivity-core.mjs
- .claude/skills/issues/SKILL.md
- scripts/issues-report.mjs
Motivation
/issues-style answers and recommendations are revalidated againstorigin/main(avoid re-proposing closed rows from stale worktrees).Description
scripts/issues-report.mjsthat prefersorigin/main:docs/outstanding-issues.md, emitsbehind/aheadmetadata, and exposes an optional--agent-safe-winsclassifier and--jsonoutput.issues:reportintopackage.jsonand add unit tests intests/issues-report.test.ts.issuesskill (.claude/.agents) to require usingnpm run issues:reportfor authoritative reads, to run the revalidation immediately before any mutation, and to refuse Update-branch-style flows for this file.verification-router(orgates) to pick one smallest sufficient gate, require the decisive proving output line (not just exit 0), record branch/HEAD before/after commit, and refuse masked push outputs; update.claude/skills/handoff/SKILL.md,.agents/skills/handover/SKILL.md,.claude/skills/gates/SKILL.md, and.claude/agents/verification-router.md.scripts/productivity-core.mjs) to prefer a single fail-closed risk-routed PR gate (npm run verify:pr-local) for handoff paths and add explicit handoff-proof guidance inproof.classifyAgentSafeWinsfiltering (conservative rules: ≤4h estimate, not Operator, and no provider/RAG/clinical/owner-decision tokens) and surface the wins inissues-report.tests/productivity-workflow.test.tsto check the new routing and proof guidance.scripts/issues-report.mjs,scripts/productivity-core.mjs,scripts/outstanding-issues.mjs(writer usage),package.json,.claude/skills/issues/SKILL.md,.claude/skills/handoff/SKILL.md,.claude/agents/verification-router.md,.claude/skills/gates/SKILL.md,.agents/skills/handover/SKILL.md,tests/issues-report.test.ts,tests/productivity-workflow.test.ts, anddocs/outstanding-issues.md(archival rows and queue updates).Testing
npm exec vitest -- run tests/issues-report.test.ts tests/productivity-workflow.test.tsand the two test files passed (2 files, 27 tests total passed).npm run check:outstanding-issues, which reported the guard pass (unique ids, next-id > max, no merge driver).npm run check:gate-manifest, which reported allverify:cheapgates enforced in CI.npm run docs:check-scriptsto ensure doc references resolve, andnpm run formatto format docs before commit; both passed.git diff --checkandnpm run docs:check-inventory/ script inventory checks; no blocking issues remained.If you want, I can open a PR with this branch or split the changes into smaller PRs (reporter/classifier vs handoff/gates) — tell me which split you prefer.
Codex Task
Summary by CodeRabbit
New Features
Improvements
Documentation