Skip to content

docs: improve the spec-driven loop (stack maintenance, re-entry, stacked-PR upkeep)#166

Merged
gregorydemay merged 2 commits into
mainfrom
gdemay/pr-stack-maintenance
Jun 23, 2026
Merged

docs: improve the spec-driven loop (stack maintenance, re-entry, stacked-PR upkeep)#166
gregorydemay merged 2 commits into
mainfrom
gdemay/pr-stack-maintenance

Conversation

@gregorydemay

@gregorydemay gregorydemay commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Purpose

Tighten the spec-driven build loop in CLAUDE.md (and the implementer agent) based on gaps that surfaced while running the DEFI-2853 stack.

Changes

  1. PR-stack maintenance is the orchestrator's job. When a PR is added to / removed from / reordered in a stack, the orchestrator refreshes the "📚 PR stack" section of every other PR (and the spec's Delivery sequence); the implementer only maintains its own PR's section (implementer.md clarified).
  2. Re-run comments and CI after any push. Step 3 now says: after any push (a fix, a main-merge, a rebase) re-run both the CI check and the unresolved-comment check — never one without the other. (A maintenance push that re-triggered CI also re-triggers bot review.)
  3. "Ready for review" is a pause, not the end. Step 4 now states the STOP is non-terminal: while a PR stays open it keeps accruing activity (human review, bot re-review, a merge), so any new commit/comment re-enters the loop at step 3.
  4. Stacked-PR upkeep when a base merges. Added the recurring procedure: retarget the dependent to the new parent, merge it in + resolve conflicts, re-green, and refresh its stack section.

Why

Detection of unresolved comments was already specified in the loop, but the loop terminated at "ready" and a later maintenance push only re-checked CI — so comments that landed afterward went unseen. These edits make re-entry explicit and codify the stacked-PR upkeep we'd been doing ad hoc.

When a PR is added/removed/reordered in a stack, the other PRs' "📚 PR
stack" sections (and the spec's Delivery sequence) go stale. Nothing
assigned that refresh: the implementer is scoped to one PR and only kept
its own section, and the build loop didn't mention the stack at all.

- CLAUDE.md: the orchestrator refreshes every other PR's stack section
  (and the spec) whenever the stack changes.
- implementer.md: clarify the implementer maintains only its own PR's
  stack section.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 22, 2026 07:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Clarifies ownership of “📚 PR stack” maintenance across stacked PRs by explicitly assigning cross-stack refresh duties to the orchestrator (in CLAUDE.md) while scoping the implementer agent to only maintain the current PR’s stack section (in .claude/agents/implementer.md).

Changes:

  • Add orchestrator responsibility to refresh other PRs’ “📚 PR stack” sections (and the spec’s Delivery / PR sequence) whenever the stack changes.
  • Update implementer guidance to maintain only its own PR’s “📚 PR stack” section, deferring cross-PR consistency to the orchestrator.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
CLAUDE.md Adds explicit orchestrator instruction to keep stacked-PR metadata consistent across the stack and in the spec’s delivery sequence.
.claude/agents/implementer.md Clarifies implementer scope: maintain stack section only for the PR it is building; orchestrator handles cross-stack updates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gregorydemay gregorydemay marked this pull request as ready for review June 22, 2026 07:38
@gregorydemay gregorydemay requested a review from a team as a code owner June 22, 2026 07:38
@zeropath-ai

zeropath-ai Bot commented Jun 22, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 735d3cd.

Security Overview
Detected Code Changes
Change Type Relevant files
Refactor ► .claude/agents/implementer.md
    Clarify responsibilities for maintaining PR stack sections
► CLAUDE.md
    Add details on handling stacked PRs and updating stack sections
    Update descriptions related to PR checks and loop termination conditions

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown

canbench 🏋 (dir: canister) fe86539 2026-06-22 14:41:15 UTC

canister/canbench_results.yml is up to date
📦 canbench_results_benchmark.csv available in artifacts

---------------------------------------------------

Summary:
  instructions:
    status:   No significant changes 👍
    counts:   [total 12 | regressed 0 | improved 0 | new 0 | unchanged 12]
    change:   [max +282.01K | p75 +51 | median 0 | p25 0 | min -1.75K]
    change %: [max +0.52% | p75 0.00% | median 0.00% | p25 0.00% | min -0.00%]

  heap_increase:
    status:   No significant changes 👍
    counts:   [total 12 | regressed 0 | improved 0 | new 0 | unchanged 12]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

  stable_memory_increase:
    status:   No significant changes 👍
    counts:   [total 12 | regressed 0 | improved 0 | new 0 | unchanged 12]
    change:   [max 0 | p75 0 | median 0 | p25 0 | min 0]
    change %: [max 0.00% | p75 0.00% | median 0.00% | p25 0.00% | min 0.00%]

---------------------------------------------------
CSV results saved to canbench_results.csv

Three additions to the spec-driven loop, from gaps that surfaced in
practice (an open PR accrued review comments after the loop "stopped",
and a maintenance push re-checked CI but not comments):

- Step 3: after ANY push (fix, main-merge, rebase) re-run both the CI
  check and the unresolved-comment check — never one without the other.
- Step 4: "ready for review" / STOP is a pause, not the end — new commits
  or comments on an open PR re-enter the loop at step 3.
- Stacked PRs: when a base PR merges, retarget + merge parent + resolve +
  re-green + refresh the stack section of each dependent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gregorydemay gregorydemay changed the title docs: assign PR-stack maintenance to the orchestrator docs: improve the spec-driven loop (stack maintenance, re-entry, stacked-PR upkeep) Jun 22, 2026
@gregorydemay gregorydemay added this pull request to the merge queue Jun 23, 2026
Merged via the queue into main with commit 4f31f1a Jun 23, 2026
25 checks passed
@gregorydemay gregorydemay deleted the gdemay/pr-stack-maintenance branch June 23, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants