Skip to content

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

Merged
don-petry merged 4 commits into
mainfrom
dev-lead/issue-708-20260710-0025
Jul 10, 2026
Merged

don-petry merged 4 commits into
mainfrom
dev-lead/issue-708-20260710-0025

Conversation

@don-petry

Copy link
Copy Markdown
Collaborator

Closes #708

Implemented by dev-lead agent. Please review.

… in-flight epic's remaining plan as issues resolve and dev-lead feedback lands
@don-petry
don-petry requested a review from a team as a code owner July 10, 2026 00:47
Copilot AI review requested due to automatic review settings July 10, 2026 00:47
@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@don-petry, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 52 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: fba4ac02-fb12-4e32-9ac4-cf98f3231535

📥 Commits

Reviewing files that changed from the base of the PR and between 999cc88 and 2b4484a.

📒 Files selected for processing (9)
  • .github/workflows/initiative-planner.yml
  • .github/workflows/lint.yml
  • scripts/initiative-planner/README.md
  • scripts/initiative-planner/apply-plan.sh
  • scripts/initiative-planner/gather-context.sh
  • scripts/initiative-planner/lib/mutations.sh
  • scripts/initiative-planner/redispatch.sh
  • tests/test_initiative_planner_redispatch.bats
  • tests/test_initiative_reconcile.bats
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-lead/issue-708-20260710-0025

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) July 10, 2026 00:48
@don-petry
don-petry disabled auto-merge July 10, 2026 00:49
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
Issues addressed: 0
Files changed: none
Skipped (informational): 0
Quality Gate passed — no actionable issues to address.
```
The PR is clean. All security, quality, and code analysis checks have passed with no findings.

@don-petry
don-petry enabled auto-merge (squash) July 10, 2026 00:49
@donpetry-bot

Copy link
Copy Markdown
Contributor

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.

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

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=1 mode to bind to an existing epic and materialize only newly accepted proposed_story findings (deduped via a stamped reconcile-key).
  • Extended workflow + redispatch bridge to support reconcile as a workflow_dispatch input and initiative:reconcile label 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.

Comment thread scripts/initiative-planner/README.md Resolved

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread tests/test_initiative_reconcile.bats Resolved
@don-petry
don-petry disabled auto-merge July 10, 2026 00:54

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 10, 2026
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 10, 2026
@don-petry
don-petry disabled auto-merge July 10, 2026 01:07
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed.

@don-petry
don-petry disabled auto-merge July 10, 2026 01:11
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — waiting on PR blockers (intent: fix-reviews)

PR: #1136
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-07-10T01:42:05Z

@don-petry
don-petry enabled auto-merge (squash) July 10, 2026 01:12
@don-petry
don-petry disabled auto-merge July 10, 2026 04:14
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-reviews (no-changes)

Agent reasoning
Addressed 0 threads:
(no open threads)
Test verification: pass — CI bats/shellcheck/lint jobs all completed success; bats not installed locally but CI confirms passing; shellcheck shows only info-level notices (SC2016, SC1091), no errors or warnings.
Files changed: none
```

@don-petry
don-petry enabled auto-merge (squash) July 10, 2026 04:17
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@don-petry
don-petry disabled auto-merge July 10, 2026 12:09
@sonarqubecloud

Copy link
Copy Markdown

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) July 10, 2026 12:10

@donpetry-bot donpetry-bot 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.

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.

@don-petry
don-petry merged commit 6d11d64 into main Jul 10, 2026
30 checks passed
@don-petry
don-petry deleted the dev-lead/issue-708-20260710-0025 branch July 10, 2026 12:13

@donpetry-bot donpetry-bot 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.

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.

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.

[Phase 3] Re-plan in place: reconcile an in-flight epic's remaining plan as issues resolve and dev-lead feedback lands

3 participants