@ikunin/sprintpilot 2.2.11 → 2.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -39,6 +39,7 @@ const userCommands = require('../lib/orchestrator/user-commands');
|
|
|
39
39
|
const divergence = require('../lib/orchestrator/divergence');
|
|
40
40
|
const reportRenderer = require('../lib/orchestrator/report');
|
|
41
41
|
const gitPlan = require('../lib/orchestrator/git-plan');
|
|
42
|
+
const land = require('../lib/orchestrator/land');
|
|
42
43
|
const {
|
|
43
44
|
parseStatuses: parseSprintStatuses,
|
|
44
45
|
remainingFrom: remainingStoriesFrom,
|
|
@@ -844,6 +845,42 @@ function decorateGitOp(action, state, profile, projectRoot) {
|
|
|
844
845
|
}
|
|
845
846
|
}
|
|
846
847
|
|
|
848
|
+
// run_script actions for op=land_story carry only metadata (helper,
|
|
849
|
+
// land_when, squash_on_merge, ...) — the state machine's comment
|
|
850
|
+
// promises "The CLI edge composes the actual argv via land.js#planLand"
|
|
851
|
+
// but that wiring was missing pre-v2.2.12. Without it, LLMs driving
|
|
852
|
+
// land_as_you_go got a metadata-only action and had to improvise.
|
|
853
|
+
// Symmetric to decorateGitOp: call land.planLand(state, profile,
|
|
854
|
+
// options), inline the resulting `steps[]` onto the action.
|
|
855
|
+
function decorateRunScript(action, state, profile, projectRoot) {
|
|
856
|
+
if (!action || action.type !== 'run_script') return action;
|
|
857
|
+
if (action.op !== 'land_story') return action;
|
|
858
|
+
try {
|
|
859
|
+
const root = projectRoot || process.cwd();
|
|
860
|
+
const scriptsDir = path.join(root, '_Sprintpilot', 'scripts');
|
|
861
|
+
const snapshotPath = path.join(
|
|
862
|
+
root,
|
|
863
|
+
'_bmad-output',
|
|
864
|
+
'implementation-artifacts',
|
|
865
|
+
'.land-snapshots',
|
|
866
|
+
`${state.story_key || 'sprint'}.json`,
|
|
867
|
+
);
|
|
868
|
+
const branch = gitPlan.branchName(profile, state.story_key, state.current_epic, state);
|
|
869
|
+
const platform = profile.platform_provider || 'auto';
|
|
870
|
+
const planned = land.planLand(state, profile, {
|
|
871
|
+
scriptsDir,
|
|
872
|
+
snapshotPath,
|
|
873
|
+
branch,
|
|
874
|
+
platform,
|
|
875
|
+
projectRoot: root,
|
|
876
|
+
});
|
|
877
|
+
return { ...action, branch: planned.branch, steps: planned.steps };
|
|
878
|
+
} catch (e) {
|
|
879
|
+
log.warn(`land-plan failed for op=${action.op}: ${e.message}`);
|
|
880
|
+
return action;
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
|
|
847
884
|
// Detect whether a branch exists, locally OR on origin. Used by
|
|
848
885
|
// decorateGitOp so the create_branch plan can degrade to a plain switch
|
|
849
886
|
// when the branch is already known. Checking remote refs avoids the
|
|
@@ -1108,7 +1145,12 @@ function cmdStart(opts) {
|
|
|
1108
1145
|
return 0;
|
|
1109
1146
|
}
|
|
1110
1147
|
|
|
1111
|
-
const action =
|
|
1148
|
+
const action = decorateRunScript(
|
|
1149
|
+
decorateGitOp(stateMachine.nextAction(runtime, profile), runtime, profile, projectRoot),
|
|
1150
|
+
runtime,
|
|
1151
|
+
profile,
|
|
1152
|
+
projectRoot,
|
|
1153
|
+
);
|
|
1112
1154
|
ledger.append({ kind: 'action_emitted', phase: runtime.phase, action }, { projectRoot });
|
|
1113
1155
|
persistRuntimeState(runtime, profile, projectRoot);
|
|
1114
1156
|
if (profile.coalesce_state_writes) stateStore.flush(profile, { projectRoot, story: runtime.story_key });
|
|
@@ -1137,7 +1179,12 @@ function cmdNext(opts) {
|
|
|
1137
1179
|
return 0;
|
|
1138
1180
|
}
|
|
1139
1181
|
|
|
1140
|
-
const action =
|
|
1182
|
+
const action = decorateRunScript(
|
|
1183
|
+
decorateGitOp(stateMachine.nextAction(runtime, profile), runtime, profile, projectRoot),
|
|
1184
|
+
runtime,
|
|
1185
|
+
profile,
|
|
1186
|
+
projectRoot,
|
|
1187
|
+
);
|
|
1141
1188
|
ledger.append({ kind: 'action_emitted', phase: runtime.phase, action }, { projectRoot });
|
|
1142
1189
|
// Persist any mutations done by lockUserBranchIfNeeded — without this
|
|
1143
1190
|
// every cmdNext under reuse_user_branch=true re-detects the branch and
|
|
@@ -1264,7 +1311,12 @@ function cmdRecord(opts) {
|
|
|
1264
1311
|
}
|
|
1265
1312
|
|
|
1266
1313
|
const payload = {
|
|
1267
|
-
action:
|
|
1314
|
+
action: decorateRunScript(
|
|
1315
|
+
decorateGitOp(result.nextAction, result.newState, result.newProfile, projectRoot),
|
|
1316
|
+
result.newState,
|
|
1317
|
+
result.newProfile,
|
|
1318
|
+
projectRoot,
|
|
1319
|
+
),
|
|
1268
1320
|
verdict: result.verdict,
|
|
1269
1321
|
phase: result.newState.phase,
|
|
1270
1322
|
profile: result.newProfile.name,
|
|
@@ -1353,4 +1405,4 @@ if (require.main === module) {
|
|
|
1353
1405
|
process.exit(main(process.argv.slice(2)));
|
|
1354
1406
|
}
|
|
1355
1407
|
|
|
1356
|
-
module.exports = { main, SUBCOMMANDS, decorateGitOp, composeRuntimeState };
|
|
1408
|
+
module.exports = { main, SUBCOMMANDS, decorateGitOp, decorateRunScript, composeRuntimeState };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikunin/sprintpilot",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.12",
|
|
4
4
|
"description": "Sprintpilot — autopilot and multi-agent addon for BMad Method v6: git workflow, parallel agents, autonomous story execution",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|