@rasensio/aidlc 2.27.0 → 2.30.0
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/README.md +7 -1
- package/dist/autopilot/driver.d.ts +69 -7
- package/dist/autopilot/driver.d.ts.map +1 -1
- package/dist/autopilot/driver.js +371 -118
- package/dist/autopilot/driver.js.map +1 -1
- package/dist/autopilot/gitlab.d.ts +9 -0
- package/dist/autopilot/gitlab.d.ts.map +1 -1
- package/dist/autopilot/gitlab.js +21 -0
- package/dist/autopilot/gitlab.js.map +1 -1
- package/dist/autopilot/outcome.d.ts +72 -0
- package/dist/autopilot/outcome.d.ts.map +1 -0
- package/dist/autopilot/outcome.js +107 -0
- package/dist/autopilot/outcome.js.map +1 -0
- package/dist/autopilot/result.d.ts.map +1 -1
- package/dist/autopilot/result.js +8 -1
- package/dist/autopilot/result.js.map +1 -1
- package/dist/autopilot/retro.d.ts +7 -3
- package/dist/autopilot/retro.d.ts.map +1 -1
- package/dist/autopilot/retro.js +6 -2
- package/dist/autopilot/retro.js.map +1 -1
- package/dist/autopilot/state.d.ts +16 -1
- package/dist/autopilot/state.d.ts.map +1 -1
- package/dist/autopilot/state.js.map +1 -1
- package/dist/autopilot/team.d.ts +21 -1
- package/dist/autopilot/team.d.ts.map +1 -1
- package/dist/autopilot/team.js +27 -2
- package/dist/autopilot/team.js.map +1 -1
- package/dist/autopilot/typed.d.ts +10 -0
- package/dist/autopilot/typed.d.ts.map +1 -1
- package/dist/autopilot/typed.js +21 -0
- package/dist/autopilot/typed.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +9 -0
- package/dist/cli.js.map +1 -1
- package/dist/closeout/gate-criterion.d.ts +33 -0
- package/dist/closeout/gate-criterion.d.ts.map +1 -0
- package/dist/closeout/gate-criterion.js +61 -0
- package/dist/closeout/gate-criterion.js.map +1 -0
- package/dist/closeout/hand-closeout.d.ts +43 -0
- package/dist/closeout/hand-closeout.d.ts.map +1 -0
- package/dist/closeout/hand-closeout.js +139 -0
- package/dist/closeout/hand-closeout.js.map +1 -0
- package/dist/closeout/outcome.d.ts +38 -0
- package/dist/closeout/outcome.d.ts.map +1 -0
- package/dist/closeout/outcome.js +141 -0
- package/dist/closeout/outcome.js.map +1 -0
- package/dist/commands/autopilot.d.ts +11 -1
- package/dist/commands/autopilot.d.ts.map +1 -1
- package/dist/commands/autopilot.js +97 -4
- package/dist/commands/autopilot.js.map +1 -1
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +51 -3
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +5 -0
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/transition.d.ts.map +1 -1
- package/dist/commands/transition.js +70 -1
- package/dist/commands/transition.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +23 -4
- package/dist/commands/update.js.map +1 -1
- package/dist/compile/register-template.d.ts +12 -9
- package/dist/compile/register-template.d.ts.map +1 -1
- package/dist/compile/register-template.js +14 -31
- package/dist/compile/register-template.js.map +1 -1
- package/dist/compile/resource-template.d.ts +45 -0
- package/dist/compile/resource-template.d.ts.map +1 -0
- package/dist/compile/resource-template.js +53 -0
- package/dist/compile/resource-template.js.map +1 -0
- package/dist/compile/skill-metadata.d.ts +22 -1
- package/dist/compile/skill-metadata.d.ts.map +1 -1
- package/dist/compile/skill-metadata.js +55 -8
- package/dist/compile/skill-metadata.js.map +1 -1
- package/dist/compile/system-template.d.ts +38 -0
- package/dist/compile/system-template.d.ts.map +1 -0
- package/dist/compile/system-template.js +40 -0
- package/dist/compile/system-template.js.map +1 -0
- package/dist/concurrency/common-dir.d.ts +13 -0
- package/dist/concurrency/common-dir.d.ts.map +1 -1
- package/dist/concurrency/common-dir.js +9 -8
- package/dist/concurrency/common-dir.js.map +1 -1
- package/dist/concurrency/gitattributes.d.ts +2 -2
- package/dist/concurrency/gitattributes.d.ts.map +1 -1
- package/dist/concurrency/gitattributes.js +5 -14
- package/dist/concurrency/gitattributes.js.map +1 -1
- package/dist/console/operator/read.d.ts.map +1 -1
- package/dist/console/operator/read.js +2 -1
- package/dist/console/operator/read.js.map +1 -1
- package/dist/core/next-steps.d.ts.map +1 -1
- package/dist/core/next-steps.js +8 -0
- package/dist/core/next-steps.js.map +1 -1
- package/dist/core/project-version.d.ts +52 -0
- package/dist/core/project-version.d.ts.map +1 -0
- package/dist/core/project-version.js +188 -0
- package/dist/core/project-version.js.map +1 -0
- package/dist/core/template-resolver.d.ts.map +1 -1
- package/dist/core/template-resolver.js +90 -8
- package/dist/core/template-resolver.js.map +1 -1
- package/dist/core/types.d.ts +4 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/cost/dedupe-history.d.ts.map +1 -1
- package/dist/cost/dedupe-history.js +3 -2
- package/dist/cost/dedupe-history.js.map +1 -1
- package/dist/cost/gitignore.d.ts +9 -4
- package/dist/cost/gitignore.d.ts.map +1 -1
- package/dist/cost/gitignore.js +16 -5
- package/dist/cost/gitignore.js.map +1 -1
- package/dist/cost/ledger.d.ts +1 -4
- package/dist/cost/ledger.d.ts.map +1 -1
- package/dist/cost/ledger.js +25 -21
- package/dist/cost/ledger.js.map +1 -1
- package/dist/cost/purge.d.ts.map +1 -1
- package/dist/cost/purge.js +3 -2
- package/dist/cost/purge.js.map +1 -1
- package/dist/cost/record-paths.d.ts +42 -0
- package/dist/cost/record-paths.d.ts.map +1 -0
- package/dist/cost/record-paths.js +119 -0
- package/dist/cost/record-paths.js.map +1 -0
- package/dist/cost/rederive.d.ts.map +1 -1
- package/dist/cost/rederive.js +4 -3
- package/dist/cost/rederive.js.map +1 -1
- package/dist/cost/sessions.d.ts +1 -1
- package/dist/cost/sessions.d.ts.map +1 -1
- package/dist/cost/sessions.js +22 -12
- package/dist/cost/sessions.js.map +1 -1
- package/dist/discover/scanner.d.ts +11 -1
- package/dist/discover/scanner.d.ts.map +1 -1
- package/dist/discover/scanner.js +23 -2
- package/dist/discover/scanner.js.map +1 -1
- package/dist/doctor/migrations/cost-gitignore.d.ts.map +1 -1
- package/dist/doctor/migrations/cost-gitignore.js +18 -8
- package/dist/doctor/migrations/cost-gitignore.js.map +1 -1
- package/dist/doctor/migrations/cost-records-out-of-git.d.ts +39 -0
- package/dist/doctor/migrations/cost-records-out-of-git.d.ts.map +1 -0
- package/dist/doctor/migrations/cost-records-out-of-git.js +158 -0
- package/dist/doctor/migrations/cost-records-out-of-git.js.map +1 -0
- package/dist/doctor/migrations/decision-register-location.d.ts +59 -0
- package/dist/doctor/migrations/decision-register-location.d.ts.map +1 -0
- package/dist/doctor/migrations/decision-register-location.js +226 -0
- package/dist/doctor/migrations/decision-register-location.js.map +1 -0
- package/dist/doctor/migrations/deployment-outcome.d.ts +29 -0
- package/dist/doctor/migrations/deployment-outcome.d.ts.map +1 -0
- package/dist/doctor/migrations/deployment-outcome.js +89 -0
- package/dist/doctor/migrations/deployment-outcome.js.map +1 -0
- package/dist/doctor/migrations/index.d.ts.map +1 -1
- package/dist/doctor/migrations/index.js +16 -0
- package/dist/doctor/migrations/index.js.map +1 -1
- package/dist/doctor/migrations/nested-gitignore.d.ts +2 -2
- package/dist/doctor/migrations/nested-gitignore.js +2 -2
- package/dist/doctor/migrations/tracked-nested-ignored.d.ts.map +1 -1
- package/dist/doctor/migrations/tracked-nested-ignored.js +4 -1
- package/dist/doctor/migrations/tracked-nested-ignored.js.map +1 -1
- package/dist/doctor/migrations/untrack-cost-ephemera.d.ts +3 -1
- package/dist/doctor/migrations/untrack-cost-ephemera.d.ts.map +1 -1
- package/dist/doctor/migrations/untrack-cost-ephemera.js +3 -1
- package/dist/doctor/migrations/untrack-cost-ephemera.js.map +1 -1
- package/dist/knowledge/index/sqlite-index.d.ts.map +1 -1
- package/dist/knowledge/index/sqlite-index.js +13 -0
- package/dist/knowledge/index/sqlite-index.js.map +1 -1
- package/dist/knowledge/storable.d.ts +6 -3
- package/dist/knowledge/storable.d.ts.map +1 -1
- package/dist/knowledge/storable.js +10 -6
- package/dist/knowledge/storable.js.map +1 -1
- package/dist/metrics/report.d.ts.map +1 -1
- package/dist/metrics/report.js +2 -1
- package/dist/metrics/report.js.map +1 -1
- package/dist/roadmap/view-assets.d.ts +7 -0
- package/dist/roadmap/view-assets.d.ts.map +1 -1
- package/dist/roadmap/view-assets.js +10 -0
- package/dist/roadmap/view-assets.js.map +1 -1
- package/dist/roadmap/view-html.d.ts +6 -0
- package/dist/roadmap/view-html.d.ts.map +1 -1
- package/dist/roadmap/view-html.js +35 -4
- package/dist/roadmap/view-html.js.map +1 -1
- package/dist/roadmap/view-model.d.ts +26 -0
- package/dist/roadmap/view-model.d.ts.map +1 -1
- package/dist/roadmap/view-model.js +27 -1
- package/dist/roadmap/view-model.js.map +1 -1
- package/dist/setup/setup-compute.d.ts +5 -0
- package/dist/setup/setup-compute.d.ts.map +1 -1
- package/dist/setup/setup-compute.js +1 -0
- package/dist/setup/setup-compute.js.map +1 -1
- package/dist/setup/tier-models.d.ts +51 -0
- package/dist/setup/tier-models.d.ts.map +1 -0
- package/dist/setup/tier-models.js +175 -0
- package/dist/setup/tier-models.js.map +1 -0
- package/package.json +2 -2
package/dist/autopilot/team.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Team defaults for autopilot: the `autopilot:` section of the committed
|
|
3
3
|
* `.aidlc/config.yaml` (init-sets-work-mode/AC-21..AC-23).
|
|
4
4
|
*
|
|
5
|
-
* Only the cost cap, the release step, the stops
|
|
5
|
+
* Only the cost cap, the release step, the stops, notifications and the deploy workflow are team
|
|
6
|
+
* decisions. The agent, its
|
|
6
7
|
* permissions and how many items build at once belong to the machine that runs
|
|
7
8
|
* them, so those keys are never read from a committed file — a clone must not be
|
|
8
9
|
* able to hand an agent full access on somebody else's machine.
|
|
@@ -19,6 +20,21 @@ import { parsePauseAfter, parseStopAt } from './stops.js';
|
|
|
19
20
|
* select a command the code already offers (init-sets-work-mode/AC-18).
|
|
20
21
|
*/
|
|
21
22
|
export const TEAM_RELEASE_IDS = ['repo-script', 'merge-only'];
|
|
23
|
+
/**
|
|
24
|
+
* A plain workflow file name. No `/`, so it cannot name a path, and no leading `-`, so `gh`
|
|
25
|
+
* cannot read it as a flag (closeout-requires-outcome-half NFR Security).
|
|
26
|
+
*/
|
|
27
|
+
export const DEPLOY_WORKFLOW_RE = /^[A-Za-z0-9][A-Za-z0-9._-]{0,99}\.ya?ml$/;
|
|
28
|
+
const INVALID_SHOWN = 100;
|
|
29
|
+
/** Read `autopilot.deploy_workflow`: absent or null is not set; anything else is a name or invalid. */
|
|
30
|
+
export function parseDeployWorkflow(value) {
|
|
31
|
+
if (value === undefined || value === null)
|
|
32
|
+
return undefined;
|
|
33
|
+
if (typeof value === 'string' && DEPLOY_WORKFLOW_RE.test(value))
|
|
34
|
+
return { name: value };
|
|
35
|
+
const shown = typeof value === 'string' ? value : JSON.stringify(value) ?? String(value);
|
|
36
|
+
return { invalid: shown.slice(0, INVALID_SHOWN) };
|
|
37
|
+
}
|
|
22
38
|
/**
|
|
23
39
|
* The validated `autopilot:` section of `<projectRoot>/.aidlc/config.yaml`. Never
|
|
24
40
|
* throws; a missing or unreadable file is no defaults.
|
|
@@ -66,6 +82,9 @@ export function loadTeamDefaults(projectRoot) {
|
|
|
66
82
|
// A yes or no only: `notify: off` is ignored, not read as off (autopilot-live-progress/AC-23).
|
|
67
83
|
if (typeof raw.notify === 'boolean')
|
|
68
84
|
team.notify = raw.notify;
|
|
85
|
+
const deploy = parseDeployWorkflow(raw.deploy_workflow);
|
|
86
|
+
if (deploy !== undefined)
|
|
87
|
+
team.deploy_workflow = deploy;
|
|
69
88
|
return team;
|
|
70
89
|
}
|
|
71
90
|
/**
|
|
@@ -99,6 +118,12 @@ export function withTeamDefaults(machine, team, projectRoot) {
|
|
|
99
118
|
base.pause_after = team.pause_after;
|
|
100
119
|
if (team.notify !== undefined)
|
|
101
120
|
base.notify = team.notify;
|
|
102
|
-
|
|
121
|
+
const config = { ...base, ...machine };
|
|
122
|
+
// A team key only: the committed file names the project's deploy workflow, so a machine's
|
|
123
|
+
// config can neither set nor clear it.
|
|
124
|
+
delete config.deploy_workflow;
|
|
125
|
+
if (team.deploy_workflow !== undefined)
|
|
126
|
+
config.deploy_workflow = team.deploy_workflow;
|
|
127
|
+
return config;
|
|
103
128
|
}
|
|
104
129
|
//# sourceMappingURL=team.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team.js","sourceRoot":"","sources":["../../src/autopilot/team.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"team.js","sourceRoot":"","sources":["../../src/autopilot/team.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,WAAW,EAAgC,MAAM,YAAY,CAAC;AAExF;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,aAAa,EAAE,YAAY,CAAU,CAAC;AAWvE;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,0CAA0C,CAAC;AAE7E,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B,uGAAuG;AACvG,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5D,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACxF,MAAM,KAAK,GA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, design D5).
|
|
75
75
|
*/
|
|
76
76
|
disallowedTools?: string[];
|
|
77
|
+
/**
|
|
78
|
+
* The phase tier's model and effort; absent adds no flag
|
|
79
|
+
* (phase-agents-on-tier-models/AC-14, AC-15, AC-16).
|
|
80
|
+
*/
|
|
81
|
+
tier?: TierFlags;
|
|
82
|
+
}
|
|
83
|
+
/** A phase launch's model and effort, from its tier in `skill_tiers`. */
|
|
84
|
+
export interface TierFlags {
|
|
85
|
+
model?: string;
|
|
86
|
+
effort?: string;
|
|
77
87
|
}
|
|
78
88
|
/**
|
|
79
89
|
* The preset argv with `{prompt}` substituted and the typed flags added; null when
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typed.d.ts","sourceRoot":"","sources":["../../src/autopilot/typed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"typed.d.ts","sourceRoot":"","sources":["../../src/autopilot/typed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzC,eAAO,MAAM,QAAQ,qDAAsD,CAAC;AAC5E,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhD,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;CAUjB,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,OAAO,QAAoE,CAAC;AAKzF;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,GAAG,IAAI,CAIvE;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,OAAO,CAAC;IACj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|
|
11
12
|
import { AGENT_PRESETS } from './presets.js';
|
|
12
13
|
export const OUTCOMES = ['shipped', 'paused', 'parked', 'blocked'];
|
|
13
14
|
/**
|
|
@@ -44,6 +45,24 @@ export function typedHarness(command) {
|
|
|
44
45
|
return null;
|
|
45
46
|
return preset.platform === 'codex' ? 'codex' : 'claude';
|
|
46
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* The tier flags that are safe to put in an argv. Checked here as well as where the
|
|
50
|
+
* config is read, because a resume brings them back from `state.json`, which can be
|
|
51
|
+
* edited — the reason `resume` is checked here too (design D3).
|
|
52
|
+
*/
|
|
53
|
+
function tierArgv(harness, tier) {
|
|
54
|
+
if (tier === undefined)
|
|
55
|
+
return [];
|
|
56
|
+
const out = [];
|
|
57
|
+
if (isModelName(tier.model))
|
|
58
|
+
out.push(harness === 'claude' ? '--model' : '-m', tier.model);
|
|
59
|
+
// Codex gets no effort flag: no Codex setting for it could be grounded in its docs
|
|
60
|
+
// (phase-agents-on-tier-models/AC-15, design D8).
|
|
61
|
+
if (harness === 'claude' && typeof tier.effort === 'string' && EFFORTS.includes(tier.effort)) {
|
|
62
|
+
out.push('--effort', tier.effort);
|
|
63
|
+
}
|
|
64
|
+
return out;
|
|
65
|
+
}
|
|
47
66
|
/**
|
|
48
67
|
* The preset argv with `{prompt}` substituted and the typed flags added; null when
|
|
49
68
|
* `resume` is not a UUID. Checked here, where the id enters the argv, and not only where
|
|
@@ -67,6 +86,7 @@ export function typedArgv(command, args) {
|
|
|
67
86
|
argv.push('--max-budget-usd', centsText(args.maxBudgetCents));
|
|
68
87
|
if (args.resume !== null)
|
|
69
88
|
argv.push('--resume', args.resume);
|
|
89
|
+
argv.push(...tierArgv('claude', args.tier));
|
|
70
90
|
return argv;
|
|
71
91
|
}
|
|
72
92
|
const at = command.indexOf('{prompt}');
|
|
@@ -74,6 +94,7 @@ export function typedArgv(command, args) {
|
|
|
74
94
|
return null;
|
|
75
95
|
return [
|
|
76
96
|
...command.slice(0, at),
|
|
97
|
+
...tierArgv('codex', args.tier),
|
|
77
98
|
'--json',
|
|
78
99
|
'--output-schema', args.schemaFile,
|
|
79
100
|
'-o', args.outcomeFile,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typed.js","sourceRoot":"","sources":["../../src/autopilot/typed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAI7C,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAU,CAAC;AAU5E;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,GAAG,QAAQ,CAAC,EAAE;QAChD,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC1B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC5B,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC1B;IACD,QAAQ,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC;IACpD,oBAAoB,EAAE,KAAK;CACnB,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,iEAAiE,CAAC;AAEzF,MAAM,QAAQ,GAAG,CAAC,CAAoB,EAAE,CAAoB,EAAW,EAAE,CACvE,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEzD;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,OAA0B;IACrD,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,C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AAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5C,CAAC;AAED,wBAAwB;AACxB,MAAM,UAAU,SAAS,CAAC,KAAa;IACrC,OAAO,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAClC,CAAC"}
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;GAOG;AAcH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;GAOG;AAcH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqCpC;;;;;;GAMG;AACH,wBAAgB,YAAY,IAAI,OAAO,CA2CtC;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,MAAM,GAAG,SAA2B,GAC1C,OAAO,CAQT"}
|
package/dist/cli.js
CHANGED
|
@@ -54,6 +54,8 @@ import { registerMenu } from './commands/menu.js';
|
|
|
54
54
|
import { isBareInvocation } from './menu/invocation.js';
|
|
55
55
|
import { openConsole } from './console/index.js';
|
|
56
56
|
import { VERSION } from './core/version.js';
|
|
57
|
+
import { findProjectRoot } from './core/project-root.js';
|
|
58
|
+
import { formatVersionReport, isVersionInvocation } from './core/project-version.js';
|
|
57
59
|
/**
|
|
58
60
|
* Build the fully-registered commander program.
|
|
59
61
|
*
|
|
@@ -132,6 +134,13 @@ if (isMainModule(import.meta.url)) {
|
|
|
132
134
|
// arguments" (interactive-cli-menu/AC-3, interactive-cli-menu/AC-8).
|
|
133
135
|
await openConsole(buildProgram, 'bare');
|
|
134
136
|
}
|
|
137
|
+
else if (isVersionInvocation(process.argv)) {
|
|
138
|
+
// A lone `--version` / `-V` reports the project's version beside the CLI's
|
|
139
|
+
// (version-shows-project-version/AC-5 … AC-9). `.version(VERSION)` stays
|
|
140
|
+
// registered so `program.version()` and the help line are unchanged; other
|
|
141
|
+
// shapes commander reads as a version request keep the bare output (design D1).
|
|
142
|
+
process.stdout.write(formatVersionReport(VERSION, findProjectRoot()));
|
|
143
|
+
}
|
|
135
144
|
else {
|
|
136
145
|
// parseAsync: async command actions (doctor's confirm prompt, knowledge's
|
|
137
146
|
// merge-driver install) must be awaited so exit codes land reliably.
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;GAOG;AAEH,6EAA6E;AAC7E,6EAA6E;AAC7E,yDAAyD;AACzD,MAAM,uBAAuB,GAAG,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;AAC7D,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;AACtC,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE;IAChC,IAAI,OAAO,CAAC,IAAI,KAAK,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO;IACzF,KAAK,MAAM,QAAQ,IAAI,uBAAuB;QAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;AACpE,CAAC,CAAC,CAAC;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,gBAAgB,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;SAAM,IAAI,mBAAmB,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7C,2EAA2E;QAC3E,yEAAyE;QACzE,2EAA2E;QAC3E,gFAAgF;QAChF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC;IACxE,CAAC;SAAM,CAAC;QACN,0EAA0E;QAC1E,qEAAqE;QACrE,MAAM,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;IACpC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Outcome gate criterion: leaving deployment needs a written `## Outcome` in the instance's
|
|
3
|
+
* `deployment-record.md`. Computed at the command layer after `evaluateTransition`, like the
|
|
4
|
+
* receipt and tasks criteria, so `--override` — which reaches only the ownership gate — cannot
|
|
5
|
+
* skip it (closeout-requires-outcome-half/AC-8).
|
|
6
|
+
*
|
|
7
|
+
* Before this, a record was "complete" by its artifact `status` alone, whatever it said.
|
|
8
|
+
*
|
|
9
|
+
* Returns `null` — no check — outside deployment, and for a template whose deployment phase does
|
|
10
|
+
* not require `deployment-record.md`: such a template has no record for the check to read
|
|
11
|
+
* (design D6).
|
|
12
|
+
*
|
|
13
|
+
* Requirements: closeout-requires-outcome-half/AC-3, closeout-requires-outcome-half/AC-4,
|
|
14
|
+
* closeout-requires-outcome-half/AC-5, closeout-requires-outcome-half/AC-6,
|
|
15
|
+
* closeout-requires-outcome-half/AC-8
|
|
16
|
+
*/
|
|
17
|
+
import type { WorkflowTemplate } from '../core/types.js';
|
|
18
|
+
import { type OutcomeVerdict } from './outcome.js';
|
|
19
|
+
export declare const DEPLOYMENT_RECORD = "deployment-record.md";
|
|
20
|
+
export interface OutcomeCriterion {
|
|
21
|
+
/** `.aidlc/state/<instance>/deployment-record.md`, relative to the project. */
|
|
22
|
+
record: string;
|
|
23
|
+
verdict: OutcomeVerdict | {
|
|
24
|
+
written: false;
|
|
25
|
+
kind: 'no-record';
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/** The project-relative path of an instance's deployment record. */
|
|
29
|
+
export declare function recordPath(instance: string): string;
|
|
30
|
+
export declare function evaluateOutcomeCriterion(projectRoot: string, instance: string, phase: string, template: WorkflowTemplate): OutcomeCriterion | null;
|
|
31
|
+
/** One line naming the record, the section and what is wrong with it (AC-3, AC-4). */
|
|
32
|
+
export declare function outcomeMessage(c: OutcomeCriterion): string;
|
|
33
|
+
//# sourceMappingURL=gate-criterion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gate-criterion.d.ts","sourceRoot":"","sources":["../../src/closeout/gate-criterion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAEhE,eAAO,MAAM,iBAAiB,yBAAyB,CAAC;AAExD,MAAM,WAAW,gBAAgB;IAC/B,+EAA+E;IAC/E,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,cAAc,GAAG;QAAE,OAAO,EAAE,KAAK,CAAC;QAAC,IAAI,EAAE,WAAW,CAAA;KAAE,CAAC;CACjE;AAED,oEAAoE;AACpE,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,gBAAgB,GACzB,gBAAgB,GAAG,IAAI,CAazB;AAED,sFAAsF;AACtF,wBAAgB,cAAc,CAAC,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAoB1D"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Outcome gate criterion: leaving deployment needs a written `## Outcome` in the instance's
|
|
3
|
+
* `deployment-record.md`. Computed at the command layer after `evaluateTransition`, like the
|
|
4
|
+
* receipt and tasks criteria, so `--override` — which reaches only the ownership gate — cannot
|
|
5
|
+
* skip it (closeout-requires-outcome-half/AC-8).
|
|
6
|
+
*
|
|
7
|
+
* Before this, a record was "complete" by its artifact `status` alone, whatever it said.
|
|
8
|
+
*
|
|
9
|
+
* Returns `null` — no check — outside deployment, and for a template whose deployment phase does
|
|
10
|
+
* not require `deployment-record.md`: such a template has no record for the check to read
|
|
11
|
+
* (design D6).
|
|
12
|
+
*
|
|
13
|
+
* Requirements: closeout-requires-outcome-half/AC-3, closeout-requires-outcome-half/AC-4,
|
|
14
|
+
* closeout-requires-outcome-half/AC-5, closeout-requires-outcome-half/AC-6,
|
|
15
|
+
* closeout-requires-outcome-half/AC-8
|
|
16
|
+
*/
|
|
17
|
+
import { readFileSync } from 'node:fs';
|
|
18
|
+
import { join } from 'node:path';
|
|
19
|
+
import { readOutcome } from './outcome.js';
|
|
20
|
+
export const DEPLOYMENT_RECORD = 'deployment-record.md';
|
|
21
|
+
/** The project-relative path of an instance's deployment record. */
|
|
22
|
+
export function recordPath(instance) {
|
|
23
|
+
return `.aidlc/state/${instance}/${DEPLOYMENT_RECORD}`;
|
|
24
|
+
}
|
|
25
|
+
export function evaluateOutcomeCriterion(projectRoot, instance, phase, template) {
|
|
26
|
+
if (phase !== 'deployment')
|
|
27
|
+
return null;
|
|
28
|
+
const deployment = template.phases.find((p) => p.name === 'deployment');
|
|
29
|
+
if (!deployment?.required_artifacts?.some((a) => a.name === DEPLOYMENT_RECORD))
|
|
30
|
+
return null;
|
|
31
|
+
const record = recordPath(instance);
|
|
32
|
+
let text;
|
|
33
|
+
try {
|
|
34
|
+
text = readFileSync(join(projectRoot, record), 'utf8');
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return { record, verdict: { written: false, kind: 'no-record' } };
|
|
38
|
+
}
|
|
39
|
+
return { record, verdict: readOutcome(text) };
|
|
40
|
+
}
|
|
41
|
+
/** One line naming the record, the section and what is wrong with it (AC-3, AC-4). */
|
|
42
|
+
export function outcomeMessage(c) {
|
|
43
|
+
const section = `the ## Outcome section of ${c.record}`;
|
|
44
|
+
switch (c.verdict.kind) {
|
|
45
|
+
case 'no-record':
|
|
46
|
+
return `${c.record} does not exist — it must hold a ## Outcome section`;
|
|
47
|
+
case 'missing':
|
|
48
|
+
return (`${c.record} has no ## Outcome section — write what happened after the merge, ` +
|
|
49
|
+
'or "Nothing deployed — <reason>"');
|
|
50
|
+
case 'empty':
|
|
51
|
+
return `${section} is empty — write what happened after the merge`;
|
|
52
|
+
case 'placeholder':
|
|
53
|
+
return `${section} is still the placeholder — write what happened after the merge`;
|
|
54
|
+
case 'no-reason':
|
|
55
|
+
return `${section} says "Nothing deployed" without a reason — write "Nothing deployed — <reason>"`;
|
|
56
|
+
case 'text':
|
|
57
|
+
case 'nothing-deployed':
|
|
58
|
+
return `${section} is written`;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=gate-criterion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gate-criterion.js","sourceRoot":"","sources":["../../src/closeout/gate-criterion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,WAAW,EAAuB,MAAM,cAAc,CAAC;AAEhE,MAAM,CAAC,MAAM,iBAAiB,GAAG,sBAAsB,CAAC;AAQxD,oEAAoE;AACpE,MAAM,UAAU,UAAU,CAAC,QAAgB;IACzC,OAAO,gBAAgB,QAAQ,IAAI,iBAAiB,EAAE,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,WAAmB,EACnB,QAAgB,EAChB,KAAa,EACb,QAA0B;IAE1B,IAAI,KAAK,KAAK,Y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CAAC;QACrG,KAAK,MAAM,CAAC;QACZ,KAAK,kBAAkB;YACrB,OAAO,GAAG,OAAO,aAAa,CAAC;IACnC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a person's own close-out does after `aidlc transition` reaches the completion
|
|
3
|
+
* moment outside autopilot: start the retrospective autopilot would have run
|
|
4
|
+
* (finished-work-tidies-itself/AC-5) and tidy the instance's worktree (AC-6).
|
|
5
|
+
*
|
|
6
|
+
* The transition calls these only when `recordCompletion` fired on that invocation and
|
|
7
|
+
* `--autopilot` is absent, so exactly one retrospective starts (design D5). Each returns
|
|
8
|
+
* the one line the transition prints, or nothing.
|
|
9
|
+
*/
|
|
10
|
+
export interface HandCloseoutDeps {
|
|
11
|
+
/** Start `argv` detached with output to `logFile`; its pid, or null when it did not start. */
|
|
12
|
+
spawnDetached(argv: string[], opts: {
|
|
13
|
+
cwd: string;
|
|
14
|
+
logFile: string;
|
|
15
|
+
}): number | null;
|
|
16
|
+
/** The argv prefix that runs this CLI: `[process.execPath, process.argv[1]]`. */
|
|
17
|
+
cli: string[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Start the retrospective in the background, or say why not (finished-work-tidies-itself/AC-5,
|
|
21
|
+
* design §5). Checked in this order: the primary checkout, `main` checked out there, no
|
|
22
|
+
* `retrospective.md` yet (silent: the person already ran it), the retro-pending marker, an
|
|
23
|
+
* agent command configured for autopilot. The transition does not wait.
|
|
24
|
+
*
|
|
25
|
+
* @returns the line to print; '' when there is nothing to say.
|
|
26
|
+
*/
|
|
27
|
+
export declare function startHandRetro(projectRoot: string, instance: string, deps: HandCloseoutDeps): string;
|
|
28
|
+
/**
|
|
29
|
+
* Remove the instance's registered worktree, or the one line naming what kept it
|
|
30
|
+
* (finished-work-tidies-itself/AC-6, design §6). Kept when the transition ran inside it,
|
|
31
|
+
* when it has uncommitted changes, or when its branch has a commit `main` lacks.
|
|
32
|
+
*
|
|
33
|
+
* Before removing, the worktree's old-path record files are appended into the records
|
|
34
|
+
* directory, never deleted from it: `git worktree remove` deletes ignored files, and the
|
|
35
|
+
* new ignore lines make an old untracked `costs.ndjson` ignored, so without this the only
|
|
36
|
+
* record of an instance could go with its worktree.
|
|
37
|
+
*
|
|
38
|
+
* @returns the line to print; null when the instance has no registered worktree.
|
|
39
|
+
*/
|
|
40
|
+
export declare function tidyWorktree(projectRoot: string, instance: string): string | null;
|
|
41
|
+
/** The real dependencies: this CLI, spawned detached with its output appended to the log. */
|
|
42
|
+
export declare function realHandCloseoutDeps(): HandCloseoutDeps;
|
|
43
|
+
//# sourceMappingURL=hand-closeout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hand-closeout.d.ts","sourceRoot":"","sources":["../../src/closeout/hand-closeout.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAYH,MAAM,WAAW,gBAAgB;IAC/B,8FAA8F;IAC9F,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,GAAG,IAAI,CAAC;IACrF,iFAAiF;IACjF,GAAG,EAAE,MAAM,EAAE,CAAC;CACf;AAYD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAoBpG;AAeD;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAuBjF;AAED,6FAA6F;AAC7F,wBAAgB,oBAAoB,IAAI,gBAAgB,CAgBvD"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a person's own close-out does after `aidlc transition` reaches the completion
|
|
3
|
+
* moment outside autopilot: start the retrospective autopilot would have run
|
|
4
|
+
* (finished-work-tidies-itself/AC-5) and tidy the instance's worktree (AC-6).
|
|
5
|
+
*
|
|
6
|
+
* The transition calls these only when `recordCompletion` fired on that invocation and
|
|
7
|
+
* `--autopilot` is absent, so exactly one retrospective starts (design D5). Each returns
|
|
8
|
+
* the one line the transition prints, or nothing.
|
|
9
|
+
*/
|
|
10
|
+
import { execFileSync, spawn } from 'node:child_process';
|
|
11
|
+
import { existsSync, mkdirSync, openSync, realpathSync } from 'node:fs';
|
|
12
|
+
import { dirname, isAbsolute, join, relative, resolve } from 'node:path';
|
|
13
|
+
import { gitDirs, primaryProjectRoot, projectPathInCheckout } from '../concurrency/common-dir.js';
|
|
14
|
+
import { openRegistry } from '../concurrency/registry.js';
|
|
15
|
+
import { removeWorktree } from '../concurrency/worktree.js';
|
|
16
|
+
import { appendRecordFiles, legacyRecordFiles } from '../doctor/migrations/cost-records-out-of-git.js';
|
|
17
|
+
import { autopilotDir, autopilotPaths, loadConfig, retroMarker } from '../autopilot/state.js';
|
|
18
|
+
import { loadTeamDefaults, withTeamDefaults } from '../autopilot/team.js';
|
|
19
|
+
const MARKER_STAYS = 'the marker stays for aidlc autopilot pending';
|
|
20
|
+
function gitOut(cwd, args) {
|
|
21
|
+
try {
|
|
22
|
+
return execFileSync('git', args, { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim();
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Start the retrospective in the background, or say why not (finished-work-tidies-itself/AC-5,
|
|
30
|
+
* design §5). Checked in this order: the primary checkout, `main` checked out there, no
|
|
31
|
+
* `retrospective.md` yet (silent: the person already ran it), the retro-pending marker, an
|
|
32
|
+
* agent command configured for autopilot. The transition does not wait.
|
|
33
|
+
*
|
|
34
|
+
* @returns the line to print; '' when there is nothing to say.
|
|
35
|
+
*/
|
|
36
|
+
export function startHandRetro(projectRoot, instance, deps) {
|
|
37
|
+
const notStarted = (why) => `retrospective not started: ${why}; ${MARKER_STAYS}`;
|
|
38
|
+
const dirs = gitDirs(projectRoot);
|
|
39
|
+
if (dirs === null)
|
|
40
|
+
return notStarted('not a git repository');
|
|
41
|
+
if (dirs.linked)
|
|
42
|
+
return notStarted('the close-out ran in a worktree, not the primary checkout');
|
|
43
|
+
const branch = gitOut(projectRoot, ['symbolic-ref', '--short', 'HEAD']);
|
|
44
|
+
if (branch !== 'main')
|
|
45
|
+
return notStarted(`main is not checked out here (${branch ?? 'no branch'})`);
|
|
46
|
+
if (existsSync(join(projectRoot, '.aidlc', 'state', instance, 'retrospective.md')))
|
|
47
|
+
return '';
|
|
48
|
+
const dir = autopilotDir(projectRoot);
|
|
49
|
+
if (dir === null)
|
|
50
|
+
return notStarted('the git common directory cannot be written');
|
|
51
|
+
const paths = autopilotPaths(dir);
|
|
52
|
+
if (!existsSync(retroMarker(paths, instance)))
|
|
53
|
+
return 'retrospective not started: no retro-pending marker';
|
|
54
|
+
const config = withTeamDefaults(loadConfig(paths), loadTeamDefaults(projectRoot), projectRoot);
|
|
55
|
+
if ((config?.agent_command ?? []).length === 0) {
|
|
56
|
+
return notStarted('no agent command is configured (aidlc autopilot setup)');
|
|
57
|
+
}
|
|
58
|
+
const logFile = join(paths.logs, `${instance}.retro.log`);
|
|
59
|
+
const pid = deps.spawnDetached([...deps.cli, 'autopilot', 'retro-after-close', instance], { cwd: projectRoot, logFile });
|
|
60
|
+
if (pid === null)
|
|
61
|
+
return notStarted('its runner could not be started');
|
|
62
|
+
return `Retrospective started in the background (pid ${pid}); log: ${logFile}`;
|
|
63
|
+
}
|
|
64
|
+
function real(path) {
|
|
65
|
+
try {
|
|
66
|
+
return realpathSync(path);
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return resolve(path);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function isInside(child, parent) {
|
|
73
|
+
const rel = relative(real(parent), real(child));
|
|
74
|
+
return rel === '' || (!rel.startsWith('..') && !isAbsolute(rel));
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Remove the instance's registered worktree, or the one line naming what kept it
|
|
78
|
+
* (finished-work-tidies-itself/AC-6, design §6). Kept when the transition ran inside it,
|
|
79
|
+
* when it has uncommitted changes, or when its branch has a commit `main` lacks.
|
|
80
|
+
*
|
|
81
|
+
* Before removing, the worktree's old-path record files are appended into the records
|
|
82
|
+
* directory, never deleted from it: `git worktree remove` deletes ignored files, and the
|
|
83
|
+
* new ignore lines make an old untracked `costs.ndjson` ignored, so without this the only
|
|
84
|
+
* record of an instance could go with its worktree.
|
|
85
|
+
*
|
|
86
|
+
* @returns the line to print; null when the instance has no registered worktree.
|
|
87
|
+
*/
|
|
88
|
+
export function tidyWorktree(projectRoot, instance) {
|
|
89
|
+
const entry = openRegistry(projectRoot)?.lookup(instance) ?? null;
|
|
90
|
+
if (entry === null || entry.worktree_path === null)
|
|
91
|
+
return null;
|
|
92
|
+
const path = entry.worktree_path;
|
|
93
|
+
if (isInside(projectRoot, path))
|
|
94
|
+
return `kept ${path}: the transition ran inside it`;
|
|
95
|
+
if (entry.branch === null)
|
|
96
|
+
return `kept ${path}: no branch is on record for it`;
|
|
97
|
+
const branch = entry.branch;
|
|
98
|
+
const exists = existsSync(path);
|
|
99
|
+
if (exists) {
|
|
100
|
+
const status = gitOut(path, ['status', '--porcelain']);
|
|
101
|
+
if (status === null)
|
|
102
|
+
return `kept ${path}: its status cannot be read`;
|
|
103
|
+
if (status !== '')
|
|
104
|
+
return `kept ${path}: it has uncommitted changes`;
|
|
105
|
+
}
|
|
106
|
+
if (gitOut(projectRoot, ['merge-base', '--is-ancestor', branch, 'main']) === null) {
|
|
107
|
+
return `kept ${path}: branch ${branch} has commits main lacks`;
|
|
108
|
+
}
|
|
109
|
+
const inCheckout = projectPathInCheckout(projectRoot) ?? '';
|
|
110
|
+
const projectPath = inCheckout === '' ? path : join(path, inCheckout);
|
|
111
|
+
if (exists)
|
|
112
|
+
appendRecordFiles(projectPath, legacyRecordFiles(projectPath));
|
|
113
|
+
const report = removeWorktree({ branch, path, projectPath }, primaryProjectRoot(projectRoot) ?? projectRoot);
|
|
114
|
+
if (!report.removedWorktree)
|
|
115
|
+
return `kept ${path}: ${report.reason ?? 'git worktree remove refused'}`;
|
|
116
|
+
if (report.deletedBranch)
|
|
117
|
+
return `removed worktree ${path} and deleted branch ${branch}`;
|
|
118
|
+
return `removed worktree ${path}; ${report.reason ?? `branch ${branch} kept`}`;
|
|
119
|
+
}
|
|
120
|
+
/** The real dependencies: this CLI, spawned detached with its output appended to the log. */
|
|
121
|
+
export function realHandCloseoutDeps() {
|
|
122
|
+
return {
|
|
123
|
+
cli: [process.execPath, process.argv[1]],
|
|
124
|
+
spawnDetached: (argv, { cwd, logFile }) => {
|
|
125
|
+
try {
|
|
126
|
+
mkdirSync(dirname(logFile), { recursive: true });
|
|
127
|
+
const fd = openSync(logFile, 'a');
|
|
128
|
+
const child = spawn(argv[0], argv.slice(1), { cwd, detached: true, stdio: ['ignore', fd, fd] });
|
|
129
|
+
child.on('error', () => undefined);
|
|
130
|
+
child.unref();
|
|
131
|
+
return child.pid ?? null;
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=hand-closeout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hand-closeout.js","sourceRoot":"","sources":["../../src/closeout/hand-closeout.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,UAAU,EA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AO,EAAE,EAAE,EAAE;YACxC,IAAI,CAAC;gBACH,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;gBACjD,MAAM,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBAClC,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;gBAChG,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;gBACnC,KAAK,CAAC,KAAK,EAAE,CAAC;gBACd,OAAO,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC;YAC3B,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one reading of a deployment record's `## Outcome` section. The transition's outcome
|
|
3
|
+
* criterion, autopilot's close-out and doctor's report all import it, so what doctor lists and
|
|
4
|
+
* what the transition refuses cannot drift apart (closeout-requires-outcome-half D1).
|
|
5
|
+
*
|
|
6
|
+
* Pure: no file system, no clock, no network. The same record always gives the same verdict.
|
|
7
|
+
*
|
|
8
|
+
* The heading pattern was run over this repo's records before it was written: `## Outcome`,
|
|
9
|
+
* `## Outcome (2026-10-03)` and `## Outcome — 2026-10-01` all occur, so a bare `=== '## Outcome'`
|
|
10
|
+
* would have made four of eleven written outcomes invisible.
|
|
11
|
+
*
|
|
12
|
+
* Requirements: closeout-requires-outcome-half/AC-3, closeout-requires-outcome-half/AC-4,
|
|
13
|
+
* closeout-requires-outcome-half/AC-5, closeout-requires-outcome-half/AC-6,
|
|
14
|
+
* closeout-requires-outcome-half/AC-10, closeout-requires-outcome-half/AC-17
|
|
15
|
+
*/
|
|
16
|
+
export declare const OUTCOME_HEADING = "## Outcome";
|
|
17
|
+
/** The line the deployment skill tells a record to leave before the merge (AC-1). */
|
|
18
|
+
export declare const PLACEHOLDER_LINE = "Pending \u2014 written after the merge.";
|
|
19
|
+
export type OutcomeVerdict = {
|
|
20
|
+
written: true;
|
|
21
|
+
kind: 'text' | 'nothing-deployed';
|
|
22
|
+
} | {
|
|
23
|
+
written: false;
|
|
24
|
+
kind: 'missing' | 'empty' | 'placeholder' | 'no-reason';
|
|
25
|
+
};
|
|
26
|
+
/** The section's body lines as read: no heading, no HTML comments, no blank lines. */
|
|
27
|
+
export declare function outcomeBody(record: string): string[] | null;
|
|
28
|
+
export declare function readOutcome(record: string): OutcomeVerdict;
|
|
29
|
+
/** Why a record's outcome reads as it does, for doctor's list and the transition's message. */
|
|
30
|
+
export declare function unwrittenReason(kind: OutcomeVerdict['kind']): string;
|
|
31
|
+
/**
|
|
32
|
+
* `record` with `section` in place of an unwritten outcome. With a heading present, the
|
|
33
|
+
* heading line and everything outside the section are kept byte for byte and only the body is
|
|
34
|
+
* replaced; with none, the section is appended at the end (AC-9: "No other part of the record
|
|
35
|
+
* changes"). `section` starts with its own `## Outcome` line, which an existing heading wins over.
|
|
36
|
+
*/
|
|
37
|
+
export declare function withOutcome(record: string, section: string): string;
|
|
38
|
+
//# sourceMappingURL=outcome.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outcome.d.ts","sourceRoot":"","sources":["../../src/closeout/outcome.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,eAAe,eAAe,CAAC;AAC5C,qFAAqF;AACrF,eAAO,MAAM,gBAAgB,4CAAuC,CAAC;AAErE,MAAM,MAAM,cAAc,GACtB;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAAA;CAAE,GACpD;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,aAAa,GAAG,WAAW,CAAA;CAAE,CAAC;AA6ChF,sFAAsF;AACtF,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAQ3D;AAUD,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CAkB1D;AAED,+FAA+F;AAC/F,wBAAgB,eAAe,CAAC,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,MAAM,CAepE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAkBnE"}
|