Repository navigation
feat: implement issue #708 — [Phase 3] Re-plan in place: reconcile an in-flight epic's remaining plan as issues resolve and dev-lead feedback lands - #1136
Conversation
… in-flight epic's remaining plan as issues resolve and dev-lead feedback lands
|
Warning Review limit reached
Next review available in: 52 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. 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: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (9)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-07-10T01:49:48Z. |
There was a problem hiding this comment.
Pull request overview
Implements “reconcile-in-place” for the initiative-planner (issue #708, Phase 3), enabling re-dispatch against an already-planned epic to add newly-surfaced, maintainer-accepted work without rewriting in-flight stories, with offline Bats coverage and workflow wiring.
Changes:
- Added
RECONCILE=1mode to bind to an existing epic and materialize only newly acceptedproposed_storyfindings (deduped via a stamped reconcile-key). - Extended workflow + redispatch bridge to support
reconcileas aworkflow_dispatchinput andinitiative:reconcilelabel path. - Added offline Bats coverage for reconcile behavior and wired the new test into
lint.yml.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/initiative-planner/apply-plan.sh |
Adds reconcile-in-place mode and shared materialization helper with reconcile-key stamping + dedup. |
scripts/initiative-planner/lib/mutations.sh |
Adds helper to read existing reconcile keys from an epic’s sub-issues for deduping. |
scripts/initiative-planner/gather-context.sh |
Under RECONCILE=1, binds to the existing epic and harvests sub-issue metadata + comments into context. |
scripts/initiative-planner/redispatch.sh |
Threads RECONCILE env into workflow_dispatch input reconcile. |
.github/workflows/initiative-planner.yml |
Adds reconcile input, label bridge, env threading, and updated agent prompt for reconcile mode. |
tests/test_initiative_reconcile.bats |
New offline Bats suite asserting reconcile idempotency, gating, and harvesting behavior. |
tests/test_initiative_planner_redispatch.bats |
Adds unit tests for forwarding reconcile workflow input defaults/overrides. |
.github/workflows/lint.yml |
Runs the new reconcile Bats test in CI. |
scripts/initiative-planner/README.md |
Documents reconcile-in-place behavior and invariants. |
There was a problem hiding this comment.
Code Review
This pull request introduces a "reconcile-in-place" feature to the initiative planner, allowing newly-surfaced work to be added to an existing epic in an additive, idempotent manner without recreating or rewriting in-flight stories. The changes span workflow dispatch configurations, context gathering, plan application, and extensive test coverage. The review feedback highlights valuable optimization and robustness improvements, including safely handling null fields in jq filters, avoiding API and process spawning inside loops by utilizing single-fetch operations and Bash associative arrays, and preventing premature test failures in BATS by guarding grep -c commands.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8d44922dff
ℹ️ 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".
Dev-Lead — fix-reviews (applied)Changes committed and pushed. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Dev-Lead — fix-reviews (applied)Changes committed and pushed. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Dev-Lead — waiting on PR blockers (intent: fix-reviews)PR: #1136 |
Dev-Lead — fix-reviews (no-changes)Agent reasoning |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: MEDIUM
Reviewed commit: 2b4484a98a392abd80ae109935b4c27bf68e62ce
Review mode: triage-approved (single reviewer)
Summary
Implements reconcile-in-place (#708) for the initiative planner: a new reconcile workflow_dispatch input and initiative:reconcile label bridge re-trigger the planner against a live epic, harvest newly-flagged follow-ups from sub-issue/review comments, and materialize only maintainer-accepted findings not already tracked (deduped via a sha256 reconcile-key stamped into each sub-issue body). The #706 materialization loop is refactored into a single shared function rather than duplicated. 302 lines of new offline bats tests cover all six acceptance criteria via the DRY_RUN mutation log.
Linked issue analysis
Closes #708 ([Phase 3] reconcile an in-flight epic's remaining plan). All acceptance criteria are substantively addressed with matching bats assertions: AC1 re-trigger binds via find_existing_epic and never creates a new epic; AC2 additive-only (in-flight/base stories never recreated/edited/closed — zero close_issue ops asserted); AC3 gather-context harvests the bound epic's sub-issues, labels, and comments under RECONCILE=1; AC4 proposals route through #706's materialization + maintainer acceptance gate (un-accepted findings create nothing and post 'Not yet planned'); AC5 idempotent re-runs are clean no-ops via reconcile-key dedup (existing_reconcile_keys paginates all sub-issues); AC6 everything proven offline in bats. RECONCILE and FORCE_REPLAN are mutually exclusive (hard error), matching the issue's intent split.
Findings
No blocking findings.
- Workflow changes are injection-safe: label names are compared in expressions (not interpolated into scripts) and RECONCILE reaches the shell only as a literal '1'/'0'. No new permissions.
- All 12 prior bot review threads (Copilot, Gemini, Codex, CodeRabbit) are resolved and their fixes are visible in the final diff: existing_reconcile_keys now paginates (--paginate), the per-sub-issue comment harvest is deliberately capped to the first page to stay bounded, null bodies are guarded (.body // ""), and the Codex P1 concern (maintainer acceptance) is preserved — the prompt forbids Bob from setting accepted:true, keeping acceptance a human-only gate.
- Observation (non-blocking): reconcile feeds untrusted sub-issue comment text into the planner agent's context. Blast radius is acceptable — nothing materializes without explicit maintainer accepted:true, created issues are labelled initiative only (never initiative:auto), and writes are limited to new sub-issues + edges. This mirrors the pre-existing pattern of ingesting discussion comments at plan time.
- MCP secret-scanning tool was not available in this run; the gitleaks CI check passed and the diff introduces no credentials.
CI status
All checks green (30 completed): shellcheck, bats, unit-tests, CodeQL (actions + python), AgentShield, Agent Security Scan, gitleaks secret scan, SonarCloud, lint, template-drift, holdout-guard, validate-agent-profiles all SUCCESS. Skipped checks are conditional dependency-audit ecosystems (npm/pnpm/pip/cargo/go) not applicable to this change.
Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: MEDIUM
Reviewed commit: 2b4484a98a392abd80ae109935b4c27bf68e62ce
Review mode: triage-approved (single reviewer)
Summary
Implements reconcile-in-place (#708) for the initiative-planner: a RECONCILE=1 mode that binds to an existing epic and additively materializes only newly-surfaced, maintainer-accepted proposed_story findings, deduped via a sha256 reconcile-key stamped into sub-issue bodies. Plan-time materialization (#706) is refactored into a single shared function rather than duplicated. Includes redispatch/workflow wiring for an initiative:reconcile label and a 15-test offline bats suite covering every acceptance criterion.
Linked issue analysis
Closes #708. All acceptance criteria are substantively addressed and each is proven by the offline DRY_RUN bats suite: AC1 (bind to existing epic, never create a new one), AC2 (in-flight/base stories never recreated/edited/closed), AC3 (gather-context harvests bound epic sub-issues + comments under RECONCILE=1), AC4 (routes through #706 materialization + maintainer accepted:true gate; un-accepted findings gate cleanly), AC5 (idempotent re-run via reconcile-key diff is a zero-op), AC6 (offline bats, wired into lint.yml). Mutual exclusion with FORCE_REPLAN is hard-errored as documented.
Findings
No blocking findings.
- Workflow changes are safe: no new permissions, expression interpolation limited to boolean '1'/'0' mappings, label names compared in if:/env expressions rather than interpolated into shell.
- Shell changes are shellcheck-clean; variables quoted; pipefail-safe (|| true guards on grep pipelines); DRY_RUN stubs keep tests offline.
- Informational: harvested sub-issue comment bodies are untrusted input to the planning agent (prompt-injection surface), but the maintainer-only accepted:true gate means nothing self-promotes — consistent with the #708 design.
- Informational: reconcile-key is keyed on discussion + exact title, so retitling a proposed story would re-materialize it; acceptable and documented.
- MCP secret-scanning tool unavailable in this run; gitleaks CI check passed (green).
- Triage assessment confirmed: change is well-bounded and additive; risk is MEDIUM (non-trivial logic + workflow wiring), not HIGH — no auth/secrets/migrations touched.
CI status
All completed checks green: shellcheck, bats, Lint, unit-tests, CodeQL (actions+python), SonarCloud Quality Gate passed (0 new issues), gitleaks secret scan, Agent Security Scan, AgentShield, holdout-guard, template-drift, gh-aw-compile, validate-agent-profiles, CodeRabbit review. Remaining checks skipped by design (dependency-audit ecosystems not present, dependabot, ci-relay). 0 unresolved review threads; CodeRabbit approved.
Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.



Closes #708
Implemented by dev-lead agent. Please review.