Skip to content

docs(dev-agent): require staleness check + no self-authorized regressions - #381

Merged
libravault-xyz merged 1 commit into
devfrom
fix/dev-agent-staleness-and-regression-rigor
Aug 20, 2026
Merged

libravault-xyz merged 1 commit into
devfrom
fix/dev-agent-staleness-and-regression-rigor

Conversation

@libravault-xyz

Copy link
Copy Markdown
Collaborator

Summary

Two additions to .claude/agents/dev-agent.md, prompted by a real bug caught during the #352 (EPUB image rendering, build 39) split:

Issue #360's PR (#369) was branched one commit before a sibling issue's fix (#367, EPUBLocator) merged. The agent never saw that fix existed, and — noticing the same problem itself (pre-migration bookmarks resolving incorrectly) — wrote its own replacement that regressed exactly what #367 had already solved, describing the regression in its own PR body as an "accepted approximation" rather than flagging it. QA caught it before merge, and a human (this session) rebased the branch and re-triggered the fix, which then did the right thing (reused EPUBLocator properly). But the pipeline shouldn't need QA-plus-a-human to catch this — it should be structurally harder to happen.

Changes

  1. Staleness check before marking a PR ready: re-fetch dev immediately before marking ready, not just at branch time — multiple issues from the same epic can land within minutes of each other.
  2. "Don't paper over a known regression": treat a real behaviour gap as a stop-and-check moment — search for a sibling issue in the same tracking epic before reinventing a fix, and never soften a genuine regression into acceptable-sounding PR prose instead of flagging it (status:needs-info or an explicit "NEEDS HUMAN DECISION" line) for a human to actually decide.

Note

There's a separate, still-open proposal to change this same file (checkpoint-earlier, to survive max-turns crashes) — that one's already landed on dev independently (the "Open the PR early" section already present in this file). This PR is unrelated to it and doesn't touch that section.

Closes: none (process/docs change, not tied to a numbered issue)

🤖 Generated with Claude Code

…ions

Both gaps caused a real bug on issue #360 (PR #369): the agent branched
one commit before a sibling issue's fix merged, never saw that fix
existed, and then wrote its own replacement that regressed exactly what
the sibling fix had solved — described in its own PR body as an
'accepted approximation' rather than flagged for a human call.

- Re-check dev for movement immediately before marking a PR ready, not
  just at branch time.
- Treat a real behaviour gap as a stop-and-check moment: look for a
  sibling issue in the same epic before reinventing a fix, and never
  soften a genuine regression into acceptable-sounding PR prose instead
  of flagging it for a human decision.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions github-actions Bot added the risk:high Touches a sensitive path or exceeds diff-size threshold — always human merge label Aug 20, 2026
@libravault-pipeline-bot libravault-pipeline-bot Bot added the status:needs-review QA passed, awaiting principal-review-agent label Aug 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR was opened outside the automated pipeline (author isn't libravault-pipeline-bot[bot]) and doesn't link an issue (no Closes #N-style line in its body), so there's no acceptance criteria for qa-agent.yml to verify against — it would otherwise sit with no risk/status label and nothing downstream would pick it up (see issue #223's actual history, and issue #343 for this issue-less case specifically). This deterministic backstop (pr-intake.yml) classified its risk and applied status:needs-review to route it straight to principal review.

@github-actions

Copy link
Copy Markdown
Contributor

Pipeline is at capacity (3/3 active runs) — skipping this review run. Re-apply status:needs-review once activity settles, or re-trigger manually via workflow_dispatch.

@github-actions

Copy link
Copy Markdown
Contributor

📱 iOS Build Status: PASSED

✅ iOS Simulator Build & Unit Tests - success
✅ Android Core Modules - success

iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those.

View run details

@libravault-xyz libravault-xyz added status:needs-review QA passed, awaiting principal-review-agent and removed status:needs-review QA passed, awaiting principal-review-agent labels Aug 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Principal review — PR #381

Risk re-check: re-ran the logic behind classify_pr_risk.py by hand — single commit efbc86b, no commits landed after risk:high was applied (19:34:04Z). The diff touches .claude/agents/dev-agent.md, which matches the .claude/agents/** entry in agent-policy.yml's sensitive_paths. risk:high is correct and current. Per policy this always routes to human-merge regardless of findings below.

Pipeline note (not a defect): this PR was opened outside the normal dev-agent pipeline (author isn't libravault-pipeline-bot[bot]) and has no linked issue, so qa-agent.yml never ran — pr-intake.yml's deterministic backstop classified risk and routed it straight to status:needs-review, matching documented precedent (#223, #343) for issue-less/process PRs. The first review attempt hit the 3/3 concurrency cap and was skipped; this is the actual first review pass.

Content review

This is a pure prose addition to the dev-agent persona (two new sections, +30/-0 lines) — no code, no tests, nothing else in the file touched.

Verdict

No CONFIRMED findings. risk:high is correctly applied (sensitive path), so this routes to human-merge on the label alone, independent of the (clean) content review above.

@github-actions github-actions Bot added status:needs-human-merge Principal review done, requires human merge decision and removed status:needs-review QA passed, awaiting principal-review-agent labels Aug 20, 2026
@libravault-xyz
libravault-xyz merged commit 577a65d into dev Aug 20, 2026
15 checks passed
@libravault-xyz
libravault-xyz deleted the fix/dev-agent-staleness-and-regression-rigor branch August 20, 2026 20:21
libravault-xyz added a commit that referenced this pull request Aug 20, 2026
…ped runs (#385)

* docs(pipeline): add Part 4 to human-merge-sweep — retry capacity-skipped runs

dev-agent.yml/qa-agent.yml/principal-review.yml all skip their agent step
and leave the label unchanged when count_active_agent_runs.sh reports the
pipeline at capacity, posting a 'Re-apply status:X once activity settles'
comment with no automated follow-through. Nothing retries this: the skip
never transitions to status:needs-info, so Part 3's existing sweep never
sees it either — it's structurally outside every current backlog this
workflow covers. Confirmed live on PR #381 (opened during heavy pipeline
load, capacity-skipped, would have sat at status:needs-review indefinitely
without a human noticing).

Adds Part 4: find items whose most recent comment is an unresolved
capacity-skip message, retry once (same shared <!-- human-merge-sweep-retry
--> marker/budget as Part 3, same PIPELINE_APP_TOKEN mechanism), flag
anything still stuck after that retry for a human.

Closes #383

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix(ci): wire Part 4 into human-merge-sweep.yml's invocation prompt

QA on PR #385 found the persona file's new Part 4 (capacity-skip
retries) was never reachable from the scheduled run: the workflow's
prompt still told the agent to work only "Parts 1, 2, and 3", and the
PIPELINE_APP_TOKEN scoping note described it as exclusive to Part 3's
retry even though Part 4's retry needs it too.

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high Touches a sensitive path or exceeds diff-size threshold — always human merge status:needs-human-merge Principal review done, requires human merge decision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant