atris 3.30.4 → 3.30.5
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.
- package/commands/mission.js +57 -0
- package/package.json +1 -1
package/commands/mission.js
CHANGED
|
@@ -872,6 +872,61 @@ function findActiveContinuationMission(parent, root = process.cwd()) {
|
|
|
872
872
|
)) || null;
|
|
873
873
|
}
|
|
874
874
|
|
|
875
|
+
function findActiveMissionRunContinuation(root = process.cwd(), excludeId = '') {
|
|
876
|
+
const excluded = String(excludeId || '');
|
|
877
|
+
const candidates = listMissions(root)
|
|
878
|
+
.filter((mission) => (
|
|
879
|
+
mission.id !== excluded
|
|
880
|
+
&& mission.started_from === 'mission_run_continuation'
|
|
881
|
+
&& mission.continuation_policy === 'choose_next_mission'
|
|
882
|
+
&& !TERMINAL_STATUSES.has(mission.status)
|
|
883
|
+
));
|
|
884
|
+
candidates.sort((a, b) => missionSortTime(b) - missionSortTime(a));
|
|
885
|
+
return candidates[0] || null;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
function completeActiveContinuationForStartedMission(nextMission, root = process.cwd()) {
|
|
889
|
+
const continuation = findActiveMissionRunContinuation(root, nextMission?.id);
|
|
890
|
+
if (!continuation || !nextMission) return null;
|
|
891
|
+
if (continuation.objective === nextMission.objective) return null;
|
|
892
|
+
|
|
893
|
+
const proof = `Started next mission ${nextMission.id}: ${nextMission.objective}`;
|
|
894
|
+
const completionGate = { ok: true, source: 'mission_run_continuation', forced: false };
|
|
895
|
+
const baseNext = {
|
|
896
|
+
...continuation,
|
|
897
|
+
status: 'complete',
|
|
898
|
+
completed_at: stampIso(),
|
|
899
|
+
proof,
|
|
900
|
+
completion_gate: completionGate,
|
|
901
|
+
continued_by_mission_id: nextMission.id,
|
|
902
|
+
continued_by_objective: nextMission.objective,
|
|
903
|
+
next_action: 'mission complete',
|
|
904
|
+
};
|
|
905
|
+
const completion = missionCompletionReceipt(baseNext, proof);
|
|
906
|
+
const { mission: saved } = saveMission({
|
|
907
|
+
...baseNext,
|
|
908
|
+
landing: completion.landing,
|
|
909
|
+
result: completion.result,
|
|
910
|
+
}, root, 'mission_continuation_completed', {
|
|
911
|
+
proof,
|
|
912
|
+
continued_by_mission_id: nextMission.id,
|
|
913
|
+
continued_by_objective: nextMission.objective,
|
|
914
|
+
});
|
|
915
|
+
appendMemberLog(saved.owner, 'Mission continuation completed', {
|
|
916
|
+
mission: saved.objective,
|
|
917
|
+
continued_by: nextMission.id,
|
|
918
|
+
proof,
|
|
919
|
+
}, root);
|
|
920
|
+
return {
|
|
921
|
+
completed: true,
|
|
922
|
+
mission: saved,
|
|
923
|
+
continued_by: {
|
|
924
|
+
mission_id: nextMission.id,
|
|
925
|
+
objective: nextMission.objective,
|
|
926
|
+
},
|
|
927
|
+
};
|
|
928
|
+
}
|
|
929
|
+
|
|
875
930
|
function seedMissionRunContinuation(parent, root = process.cwd(), proof = '') {
|
|
876
931
|
if (!parent || parent.status !== 'complete') return null;
|
|
877
932
|
if (parent.continue_on_complete !== true) return null;
|
|
@@ -1032,6 +1087,7 @@ function startMissionFromRunObjective(objective, args) {
|
|
|
1032
1087
|
verifier: saved.verifier,
|
|
1033
1088
|
});
|
|
1034
1089
|
const worktreeBaseline = captureMissionWorktreeBaseline(saved, process.cwd());
|
|
1090
|
+
const completedContinuationGoal = completeActiveContinuationForStartedMission(saved, process.cwd());
|
|
1035
1091
|
const codexGoalState = refreshCodexGoalController(process.cwd());
|
|
1036
1092
|
printJsonOrText(
|
|
1037
1093
|
{
|
|
@@ -1047,6 +1103,7 @@ function startMissionFromRunObjective(objective, args) {
|
|
|
1047
1103
|
dirty_count: worktreeBaseline.dirty_count,
|
|
1048
1104
|
dirty_hash: worktreeBaseline.dirty_hash,
|
|
1049
1105
|
} : null,
|
|
1106
|
+
completed_continuation_goal: completedContinuationGoal,
|
|
1050
1107
|
codex_goal_state: codexGoalState,
|
|
1051
1108
|
next_command: codexGoalState.goal?.next_command || `atris mission tick ${saved.id} --verify`,
|
|
1052
1109
|
},
|