Repository navigation
feat: implement issue #604 — [Phase 3] Plan/apply split: apply consumes the dry-run's authoritative plan.json #772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d1c62d3
feat: implement issue #604 — [Phase 3] Plan/apply split: apply consum…
donpetry-bot 699de51
fix(reviews): address review comments [skip ci-relay]
donpetry-bot 601ab0e
fix(reviews): address review comments [skip ci-relay]
donpetry-bot 9ba5eb6
fix(reviews): address review comments [skip ci-relay]
donpetry-bot df7eb84
fix(reviews): address review comments [skip ci-relay]
donpetry-bot f721a0b
fix(bot): address bot feedback [skip ci-relay]
donpetry-bot 9c48a18
fix(initiative-planner): properly validate source_discussion field wi…
donpetry-bot f8824a9
Merge branch 'main' into dev-lead/issue-604-20260617-2115
don-petry 0a37acb
chore: apply manual instructions [skip ci-relay]
donpetry-bot 0831414
Merge branch 'main' into dev-lead/issue-604-20260617-2115
don-petry File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| #!/usr/bin/env bash | ||
| # apply-reviewed-plan.sh — apply a maintainer-REVIEWED plan.json WITHOUT re-planning. | ||
| # | ||
| # The plan/apply split (#604): a dry-run uploads an authoritative plan.json | ||
| # artifact; a maintainer reviews it; then the apply run is pointed at THAT | ||
| # artifact instead of asking the LLM to plan again. This script is the | ||
| # apply-side handoff — it never invokes the BMAD Scrum Master. What the | ||
| # maintainer reviewed is what materializes. | ||
| # | ||
| # It does exactly two things, in order: | ||
| # 1. Re-validate the supplied plan with validate-plan.py | ||
| # — we never apply an unvalidated artifact. | ||
| # 2. Hand it to apply-plan.sh, which owns all materialization (incl. the | ||
| # blocking-open-questions gate, the idempotency/supersede guard, and the | ||
| # `initiative:auto` invariant). DRY_RUN is honored throughout. | ||
| # | ||
| # Env (PLAN_PATH consumed here; the rest are passed straight through to | ||
| # apply-plan.sh — see its header): PLAN_PATH (required), REPO, DISCUSSION_NUMBER, | ||
| # DISCUSSION_NODE_ID, FORCE_REPLAN, DRY_RUN / DRY_RUN_LOG. | ||
| set -euo pipefail | ||
|
|
||
| SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" | ||
|
|
||
| PLAN_PATH="${PLAN_PATH:?PLAN_PATH required (path to the reviewed plan.json)}" | ||
| [ -f "$PLAN_PATH" ] && [ -s "$PLAN_PATH" ] || { echo "::error::reviewed plan '$PLAN_PATH' missing, empty, or not a regular file" >&2; exit 1; } | ||
|
|
||
| echo "==> applying reviewed plan (no re-plan): $PLAN_PATH" | ||
|
|
||
| # Re-validate before applying — a reviewed artifact may have been hand-edited. | ||
| python3 "$SCRIPT_DIR/validate-plan.py" "$PLAN_PATH" | ||
|
|
||
| # Materialize. apply-plan.sh inherits PLAN_PATH and the rest from the environment. | ||
| exec bash "$SCRIPT_DIR/apply-plan.sh" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.