@open-agent-toolkit/cli 0.3.18 → 0.3.20
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 +2 -1
- package/assets/agents/oat-phase-implementer.md +104 -3
- package/assets/agents/oat-reviewer.md +20 -5
- package/assets/bundle-metadata.json +1 -1
- package/assets/docs/reference/cli-reference.md +15 -7
- package/assets/docs/reference/oat-directory-structure.md +2 -0
- package/assets/docs/reference/project-artifacts.md +72 -1
- package/assets/docs/reference/project-state-machine.md +55 -6
- package/assets/docs/skills/brainstorm.md +3 -1
- package/assets/docs/skills/index.md +13 -9
- package/assets/docs/workflows/advanced/autonomy.md +12 -2
- package/assets/docs/workflows/advanced/dispatch-ceiling.md +2 -2
- package/assets/docs/workflows/advanced/workflow-gates.md +25 -7
- package/assets/docs/workflows/approvals-and-automation.md +25 -9
- package/assets/docs/workflows/choose-workflow.md +24 -8
- package/assets/docs/workflows/ideas/index.md +1 -1
- package/assets/docs/workflows/ideas/lifecycle.md +3 -2
- package/assets/docs/workflows/projects/closeout/closeout-skills.md +83 -5
- package/assets/docs/workflows/projects/closeout/pr-flow.md +9 -1
- package/assets/docs/workflows/projects/execution/execution-skills.md +27 -2
- package/assets/docs/workflows/projects/execution/implementation-execution.md +15 -0
- package/assets/docs/workflows/projects/execution/picking-up-projects.md +20 -1
- package/assets/docs/workflows/projects/lifecycle.md +172 -9
- package/assets/docs/workflows/projects/planning/hill-checkpoints.md +18 -1
- package/assets/docs/workflows/projects/planning/planning-skills.md +13 -10
- package/assets/docs/workflows/projects/planning/starting-projects.md +138 -20
- package/assets/docs/workflows/projects/reviews/index.md +36 -2
- package/assets/docs/workflows/projects/reviews/review-flavors.md +7 -3
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/oat-brainstorm/SKILL.md +58 -9
- package/assets/skills/oat-brainstorm/references/destinations.md +12 -4
- package/assets/skills/oat-docs/SKILL.md +13 -4
- package/assets/skills/oat-pjm-review-backlog/SKILL.md +2 -2
- package/assets/skills/oat-project-autonomous/SKILL.md +20 -8
- package/assets/skills/oat-project-autonomous/references/gate-inventory.md +156 -122
- package/assets/skills/oat-project-brief/SKILL.md +592 -0
- package/assets/skills/oat-project-brief/references/brief-contract.md +743 -0
- package/assets/skills/oat-project-brief/references/docs/autonomy-contract.md +412 -0
- package/assets/skills/oat-project-brief/references/docs/gate-approval-record.md +93 -0
- package/assets/skills/oat-project-capture/SKILL.md +2 -2
- package/assets/skills/oat-project-complete/SKILL.md +16 -2
- package/assets/skills/oat-project-discover/SKILL.md +4 -2
- package/assets/skills/oat-project-dispatch-subagents/SKILL.md +9 -1
- package/assets/skills/oat-project-document/SKILL.md +17 -1
- package/assets/skills/oat-project-document/references/docs/autonomy-contract.md +156 -122
- package/assets/skills/oat-project-goal/SKILL.md +697 -0
- package/assets/skills/oat-project-goal/references/docs/autonomy-contract.md +412 -0
- package/assets/skills/oat-project-goal/references/docs/gate-approval-record.md +93 -0
- package/assets/skills/oat-project-implement/SKILL.md +1 -1
- package/assets/skills/oat-project-implement/references/completion-and-closeout.md +107 -0
- package/assets/skills/oat-project-implement/references/docs/autonomy-contract.md +156 -122
- package/assets/skills/oat-project-implement/references/docs/gate-approval-record.md +13 -0
- package/assets/skills/oat-project-implement/references/phase-execution.md +173 -1
- package/assets/skills/oat-project-implement/references/plan-and-resume.md +124 -3
- package/assets/skills/oat-project-import-plan/SKILL.md +5 -1
- package/assets/skills/oat-project-lite/SKILL.md +4 -1
- package/assets/skills/oat-project-lite/references/docs/autonomy-contract.md +156 -122
- package/assets/skills/oat-project-new/SKILL.md +5 -1
- package/assets/skills/oat-project-next/SKILL.md +71 -14
- package/assets/skills/oat-project-next/references/docs/gate-approval-record.md +13 -0
- package/assets/skills/oat-project-plan/SKILL.md +24 -3
- package/assets/skills/oat-project-plan-writing/SKILL.md +8 -4
- package/assets/skills/oat-project-pr-final/SKILL.md +65 -3
- package/assets/skills/oat-project-pr-final/references/docs/autonomy-contract.md +156 -122
- package/assets/skills/oat-project-pr-progress/SKILL.md +125 -4
- package/assets/skills/oat-project-progress/SKILL.md +63 -8
- package/assets/skills/oat-project-progress/references/docs/gate-approval-record.md +13 -0
- package/assets/skills/oat-project-promote-spec-driven/SKILL.md +2 -2
- package/assets/skills/oat-project-quick-start/SKILL.md +65 -1
- package/assets/skills/oat-project-quick-start/references/docs/autonomy-contract.md +156 -122
- package/assets/skills/oat-project-quick-start/references/docs/gate-approval-record.md +13 -0
- package/assets/skills/oat-project-reconcile/SKILL.md +94 -3
- package/assets/skills/oat-project-review-provide/SKILL.md +397 -12
- package/assets/skills/oat-project-review-receive/SKILL.md +155 -1
- package/assets/skills/oat-project-revise/SKILL.md +51 -4
- package/assets/skills/oat-project-summary/SKILL.md +150 -2
- package/assets/skills/oat-wave-execute/SKILL.md +3 -2
- package/assets/templates/implementation-brief.md +165 -0
- package/assets/templates/plan-brief.md +140 -0
- package/assets/templates/plan.md +1 -1
- package/assets/templates/state.md +8 -2
- package/dist/commands/project/closeout-check/closeout-invariant.d.ts +119 -3
- package/dist/commands/project/closeout-check/closeout-invariant.d.ts.map +1 -1
- package/dist/commands/project/closeout-check/closeout-invariant.js +454 -2
- package/dist/commands/project/closeout-check/index.d.ts +21 -3
- package/dist/commands/project/closeout-check/index.d.ts.map +1 -1
- package/dist/commands/project/closeout-check/index.js +190 -4
- package/dist/commands/project/complete-state/index.d.ts +2 -1
- package/dist/commands/project/complete-state/index.d.ts.map +1 -1
- package/dist/commands/project/complete-state/index.js +7 -1
- package/dist/commands/project/delivery/check.d.ts +66 -0
- package/dist/commands/project/delivery/check.d.ts.map +1 -0
- package/dist/commands/project/delivery/check.js +232 -0
- package/dist/commands/project/delivery/evidence.d.ts +171 -0
- package/dist/commands/project/delivery/evidence.d.ts.map +1 -0
- package/dist/commands/project/delivery/evidence.js +902 -0
- package/dist/commands/project/delivery/index.d.ts +7 -0
- package/dist/commands/project/delivery/index.d.ts.map +1 -0
- package/dist/commands/project/delivery/index.js +13 -0
- package/dist/commands/project/delivery/refresh.d.ts +110 -0
- package/dist/commands/project/delivery/refresh.d.ts.map +1 -0
- package/dist/commands/project/delivery/refresh.js +441 -0
- package/dist/commands/project/index.d.ts.map +1 -1
- package/dist/commands/project/index.js +2 -0
- package/dist/commands/project/log/append.d.ts +6 -0
- package/dist/commands/project/log/append.d.ts.map +1 -1
- package/dist/commands/project/log/append.js +6 -1
- package/dist/commands/project/new/scaffold.d.ts +1 -1
- package/dist/commands/project/new/scaffold.d.ts.map +1 -1
- package/dist/commands/project/new/scaffold.js +81 -7
- package/dist/commands/project/promote/promote.d.ts +46 -1
- package/dist/commands/project/promote/promote.d.ts.map +1 -1
- package/dist/commands/project/promote/promote.js +646 -5
- package/dist/commands/project/validate-plan/frontmatter.d.ts +12 -0
- package/dist/commands/project/validate-plan/frontmatter.d.ts.map +1 -0
- package/dist/commands/project/validate-plan/frontmatter.js +27 -0
- package/dist/commands/project/validate-plan/index.d.ts.map +1 -1
- package/dist/commands/project/validate-plan/index.js +62 -18
- package/dist/commands/project/validate-plan/profiles.d.ts +69 -0
- package/dist/commands/project/validate-plan/profiles.d.ts.map +1 -0
- package/dist/commands/project/validate-plan/profiles.js +420 -0
- package/dist/commands/project/validate-plan/validate-plan.d.ts +3 -19
- package/dist/commands/project/validate-plan/validate-plan.d.ts.map +1 -1
- package/dist/commands/project/validate-plan/validate-plan.js +5 -82
- package/dist/commands/shared/frontmatter.d.ts +1 -1
- package/dist/commands/shared/frontmatter.d.ts.map +1 -1
- package/dist/commands/shared/frontmatter.js +2 -0
- package/dist/commands/state/generate.d.ts.map +1 -1
- package/dist/commands/state/generate.js +82 -2
- package/dist/commands/tools/shared/pack-manifest.d.ts.map +1 -1
- package/dist/commands/tools/shared/pack-manifest.js +4 -0
- package/package.json +2 -2
|
@@ -4,7 +4,7 @@ import { writeSyncedRecord } from '../../project/sync/record.js';
|
|
|
4
4
|
import { commitRecordChange, createSyncedProject, pushSynced, rollbackCreatedSyncedProject } from '../../project/sync/ref-sync.js';
|
|
5
5
|
import { resolveDefaultScope, type ProjectScope } from '../../shared/project-scope.js';
|
|
6
6
|
import { setActiveProject } from '../../../config/oat-config.js';
|
|
7
|
-
import type
|
|
7
|
+
import { type WorkflowMode } from '@open-agent-toolkit/control-plane';
|
|
8
8
|
export interface ScaffoldProjectOptions {
|
|
9
9
|
repoRoot: string;
|
|
10
10
|
projectName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../../../src/commands/project/new/scaffold.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAEL,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEL,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,EACV,4BAA4B,EAC7B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAGL,mBAAmB,EAGnB,KAAK,YAAY,EAClB,MAAM,gCAAgC,CAAC;AAMxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAKtD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../../../src/commands/project/new/scaffold.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAEL,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEL,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,EACV,4BAA4B,EAC7B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAGL,mBAAmB,EAGnB,KAAK,YAAY,EAClB,MAAM,gCAAgC,CAAC;AAMxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAA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AG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,2BAA2B;IAC1C,mBAAmB,EAAE,OAAO,mBAAmB,CAAC;IAChD,SAAS,EAAE,SAAS,CAAC;IACrB,mBAAmB,EAAE,OAAO,mBAAmB,CAAC;IAChD,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;IAC9C,4BAA4B,EAAE,OAAO,4BAA4B,CAAC;IAClE,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;IAC5C,yBAAyB,EAAE,OAAO,yBAAyB,CAAC;IAC5D,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;CAC3C;AAoOD,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,YAAY,GACjB,MAAM,CAyBR;AAiTD,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,EAC/B,SAAS,GAAE,OAAO,CAAC,2BAA2B,CAAM,GACnD,OAAO,CAAC,qBAAqB,CAAC,CAqXhC"}
|
|
@@ -15,6 +15,7 @@ import { resolveEffectiveConfig } from '../../../config/resolve.js';
|
|
|
15
15
|
import { CliError } from '../../../errors/cli-error.js';
|
|
16
16
|
import { resolveAssetsRoot } from '../../../fs/assets.js';
|
|
17
17
|
import { dirExists, fileExists } from '../../../fs/io.js';
|
|
18
|
+
import { isBriefMode, MILESTONES_TABLE_HEADER, } from '@open-agent-toolkit/control-plane';
|
|
18
19
|
import { assertValidProjectStateContent } from '../../../validation/project-state.js';
|
|
19
20
|
const DEFAULT_DEPENDENCIES = {
|
|
20
21
|
resolveDefaultScope,
|
|
@@ -43,6 +44,18 @@ const TEMPLATES_BY_MODE = {
|
|
|
43
44
|
{ source: 'plan-lite.md', target: 'plan.md' },
|
|
44
45
|
'implementation.md',
|
|
45
46
|
],
|
|
47
|
+
brief: [
|
|
48
|
+
'state.md',
|
|
49
|
+
{ source: 'plan-brief.md', target: 'plan.md' },
|
|
50
|
+
{ source: 'implementation-brief.md', target: 'implementation.md' },
|
|
51
|
+
],
|
|
52
|
+
// Goal shares the brief templates; scaffold renders its plan source and the
|
|
53
|
+
// canonical Milestones table header (see renderGoalBrief).
|
|
54
|
+
goal: [
|
|
55
|
+
'state.md',
|
|
56
|
+
{ source: 'plan-brief.md', target: 'plan.md' },
|
|
57
|
+
{ source: 'implementation-brief.md', target: 'implementation.md' },
|
|
58
|
+
],
|
|
46
59
|
};
|
|
47
60
|
function normalizeTemplateEntry(entry) {
|
|
48
61
|
return typeof entry === 'string' ? { source: entry, target: entry } : entry;
|
|
@@ -122,6 +135,40 @@ const STATE_TEMPLATE_BY_MODE = {
|
|
|
122
135
|
],
|
|
123
136
|
nextMilestone: 'Run `oat-project-lite` to author and approve the plan',
|
|
124
137
|
},
|
|
138
|
+
brief: {
|
|
139
|
+
hillCheckpoints: '[]',
|
|
140
|
+
phase: 'plan',
|
|
141
|
+
status: 'Plan',
|
|
142
|
+
currentPhase: 'Plan - Authoring the Project Brief',
|
|
143
|
+
artifacts: [
|
|
144
|
+
'- **Plan:** `plan.md` (scaffolded Project Brief template — not started)',
|
|
145
|
+
'- **Implementation:** `implementation.md` (scaffolded brief journal template — not started)',
|
|
146
|
+
'- **Research:** `references/research/` (empty)',
|
|
147
|
+
],
|
|
148
|
+
progress: [
|
|
149
|
+
'- ✓ Brief project scaffolded',
|
|
150
|
+
'- ✓ Brief and implementation artifacts scaffolded',
|
|
151
|
+
'- ⧗ Awaiting brief interview and authoring',
|
|
152
|
+
],
|
|
153
|
+
nextMilestone: 'Run `oat-project-brief` to author and approve the brief',
|
|
154
|
+
},
|
|
155
|
+
goal: {
|
|
156
|
+
hillCheckpoints: '[]',
|
|
157
|
+
phase: 'plan',
|
|
158
|
+
status: 'Plan',
|
|
159
|
+
currentPhase: 'Plan - Authoring the goal Project Brief and its milestones',
|
|
160
|
+
artifacts: [
|
|
161
|
+
'- **Plan:** `plan.md` (scaffolded goal Project Brief template — not started)',
|
|
162
|
+
'- **Implementation:** `implementation.md` (scaffolded brief journal template — not started)',
|
|
163
|
+
'- **Research:** `references/research/` (empty)',
|
|
164
|
+
],
|
|
165
|
+
progress: [
|
|
166
|
+
'- ✓ Goal project scaffolded',
|
|
167
|
+
'- ✓ Brief and implementation artifacts scaffolded',
|
|
168
|
+
'- ⧗ Awaiting goal interview, milestones and brief authoring',
|
|
169
|
+
],
|
|
170
|
+
nextMilestone: 'Run `oat-project-goal` to author the brief and its milestones and approve the first milestone',
|
|
171
|
+
},
|
|
125
172
|
};
|
|
126
173
|
function replaceOatPlaceholders(template, replacements) {
|
|
127
174
|
return template.replace(OAT_PLACEHOLDER_PATTERN, (placeholder, token) => replacements[token] ?? placeholder);
|
|
@@ -219,9 +266,12 @@ async function scaffoldModeTemplates(home, repoRoot, absoluteProjectPath, projec
|
|
|
219
266
|
}
|
|
220
267
|
const { content: template } = await resolveProjectTemplate(home, repoRoot, source);
|
|
221
268
|
let rendered = applyTemplateReplacements(template, projectName, today, nowUtc, mode);
|
|
222
|
-
if (mode === 'lite' && target === 'plan.md') {
|
|
269
|
+
if ((mode === 'lite' || isBriefMode(mode)) && target === 'plan.md') {
|
|
223
270
|
rendered = rendered.replace(/^---\n/, '---\noat_template: true\n');
|
|
224
271
|
}
|
|
272
|
+
if (mode === 'goal' && target === 'plan.md') {
|
|
273
|
+
rendered = renderGoalBrief(rendered);
|
|
274
|
+
}
|
|
225
275
|
assertNoUnresolvedOatPlaceholders(rendered, source);
|
|
226
276
|
if (target === 'state.md') {
|
|
227
277
|
assertValidProjectStateContent(rendered, { filePath: dest });
|
|
@@ -231,6 +281,25 @@ async function scaffoldModeTemplates(home, repoRoot, absoluteProjectPath, projec
|
|
|
231
281
|
}
|
|
232
282
|
return { createdFiles, skippedFiles };
|
|
233
283
|
}
|
|
284
|
+
const BRIEF_PLAN_SOURCE_PATTERN = /^oat_plan_source:[ \t]*brief\b[^\n]*$/m;
|
|
285
|
+
const BRIEF_MILESTONES_PLACEHOLDER_PATTERN = /^<!-- Reserved for goal mode\.[^\n]*-->[ \t]*$/m;
|
|
286
|
+
const MILESTONES_HEADING_LINE_PATTERN = /^## Milestones[ \t]*$/m;
|
|
287
|
+
const GOAL_MILESTONES_GUIDANCE = '<!-- One row per milestone: its id (m01, m02, …) and its ordered, comma-separated phase ids. Every phase, including revision phases, belongs to exactly one milestone. -->';
|
|
288
|
+
/**
|
|
289
|
+
* Goal shares the brief template: render `oat_plan_source: goal` (the
|
|
290
|
+
* template hardcodes `brief`) and replace the brief-only Milestones
|
|
291
|
+
* placeholder with the canonical table header the shared Milestones reader
|
|
292
|
+
* parses. A template without the placeholder still gets the header under its
|
|
293
|
+
* `## Milestones` heading.
|
|
294
|
+
*/
|
|
295
|
+
function renderGoalBrief(rendered) {
|
|
296
|
+
const withSource = rendered.replace(BRIEF_PLAN_SOURCE_PATTERN, 'oat_plan_source: goal');
|
|
297
|
+
const milestonesBlock = `${GOAL_MILESTONES_GUIDANCE}\n\n${MILESTONES_TABLE_HEADER}`;
|
|
298
|
+
if (BRIEF_MILESTONES_PLACEHOLDER_PATTERN.test(withSource)) {
|
|
299
|
+
return withSource.replace(BRIEF_MILESTONES_PLACEHOLDER_PATTERN, milestonesBlock);
|
|
300
|
+
}
|
|
301
|
+
return withSource.replace(MILESTONES_HEADING_LINE_PATTERN, `## Milestones\n\n${milestonesBlock}`);
|
|
302
|
+
}
|
|
234
303
|
async function scaffoldProjectLog(home, repoRoot, absoluteProjectPath, projectName, today) {
|
|
235
304
|
const templateFile = 'project-log.md';
|
|
236
305
|
const dest = join(absoluteProjectPath, templateFile);
|
|
@@ -258,12 +327,17 @@ async function ensureStructure(absoluteProjectPath, mode) {
|
|
|
258
327
|
await mkdir(join(absoluteProjectPath, 'reviews'), { recursive: true });
|
|
259
328
|
await mkdir(join(absoluteProjectPath, 'pr'), { recursive: true });
|
|
260
329
|
if (mode === 'import') {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
330
|
+
await ensureGitkeepDir(join(absoluteProjectPath, 'references'));
|
|
331
|
+
}
|
|
332
|
+
if (isBriefMode(mode)) {
|
|
333
|
+
await ensureGitkeepDir(join(absoluteProjectPath, 'references', 'research'));
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
async function ensureGitkeepDir(dir) {
|
|
337
|
+
await mkdir(dir, { recursive: true });
|
|
338
|
+
const gitkeepPath = join(dir, '.gitkeep');
|
|
339
|
+
if (!(await fileExists(gitkeepPath))) {
|
|
340
|
+
await writeFile(gitkeepPath, '', 'utf8');
|
|
267
341
|
}
|
|
268
342
|
}
|
|
269
343
|
async function ensureScopedProjectIgnored(repoRoot, absoluteScopeRoot, scope, dependencies) {
|
|
@@ -15,7 +15,7 @@ export interface LitePlanSections {
|
|
|
15
15
|
productBehavior?: string;
|
|
16
16
|
technicalDesign?: string;
|
|
17
17
|
}
|
|
18
|
-
type PromotionReason = 'promoted' | 'unsupported-target' | 'not-lite' | 'lite-plan-reference-exists' | 'invalid-lite-plan' | 'scope-unresolved' | 'project-unreadable' | 'template-unreadable' | 'write-failed' | 'persistence-failed';
|
|
18
|
+
type PromotionReason = 'promoted' | 'unsupported-target' | 'not-lite' | 'lite-plan-reference-exists' | 'invalid-lite-plan' | 'brief-archive-exists' | 'goal-milestone-active' | 'goal-delivery-unsettled' | 'goal-recovery-pending' | 'extracted-phases' | 'invalid-brief-plan' | 'missing-phase-head' | 'scope-unresolved' | 'project-unreadable' | 'template-unreadable' | 'write-failed' | 'persistence-failed';
|
|
19
19
|
interface PromotionRecovery extends ExactPathCommitResult {
|
|
20
20
|
identity: string;
|
|
21
21
|
message: string;
|
|
@@ -30,6 +30,9 @@ export type PromotionResult = {
|
|
|
30
30
|
status: 'refused';
|
|
31
31
|
reason: Exclude<PromotionReason, 'promoted'>;
|
|
32
32
|
files: string[];
|
|
33
|
+
phases?: string[];
|
|
34
|
+
/** Goal: the registry entries that are not yet settled. */
|
|
35
|
+
deliveries?: string[];
|
|
33
36
|
recovery?: PromotionRecovery;
|
|
34
37
|
};
|
|
35
38
|
export interface ProjectPromoteDependencies {
|
|
@@ -50,6 +53,48 @@ export interface ProjectPromoteDependencies {
|
|
|
50
53
|
now: () => Date;
|
|
51
54
|
}
|
|
52
55
|
export declare function parseLitePlanSections(planContent: string, liteTemplateContent?: string): LitePlanSections | null;
|
|
56
|
+
/**
|
|
57
|
+
* A goal promotes only at a settled delivery boundary: the active milestone
|
|
58
|
+
* is `delivered`, every registry entry is `at_endpoint` or `superseded` (none
|
|
59
|
+
* `registering` or `open`; an empty registry is not settled), and no recovery
|
|
60
|
+
* is pending. Extracted phases are
|
|
61
|
+
* refused by the shared migration. Returns the refusal, or null when settled.
|
|
62
|
+
*/
|
|
63
|
+
export declare function goalPromotionRefusal(stateFrontmatter: Record<string, unknown>): PromotionResult | null;
|
|
64
|
+
export type BriefPhaseState = 'accepted' | 'active' | 'pending' | 'provisional';
|
|
65
|
+
/** The brief-family mode a promotion starts from. */
|
|
66
|
+
export type BriefSourceMode = 'brief' | 'goal';
|
|
67
|
+
export interface BriefMigration {
|
|
68
|
+
plan: string;
|
|
69
|
+
implementation: string;
|
|
70
|
+
implementationChanged: boolean;
|
|
71
|
+
pendingPhases: string[];
|
|
72
|
+
phaseStates: Record<string, BriefPhaseState>;
|
|
73
|
+
}
|
|
74
|
+
export type BriefMigrationResult = {
|
|
75
|
+
ok: true;
|
|
76
|
+
migration: BriefMigration;
|
|
77
|
+
} | {
|
|
78
|
+
ok: false;
|
|
79
|
+
reason: 'extracted-phases' | 'invalid-brief-plan';
|
|
80
|
+
} | {
|
|
81
|
+
ok: false;
|
|
82
|
+
reason: 'missing-phase-head';
|
|
83
|
+
phases: string[];
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Pure brief → quick migration. Phase states follow the phase-unit progress
|
|
87
|
+
* contract: accepted (journal `completed`, not provisional), active (any other
|
|
88
|
+
* started status), pending, or provisional. An extracted phase refuses.
|
|
89
|
+
*/
|
|
90
|
+
export declare function migrateBriefToQuick(input: {
|
|
91
|
+
planContent: string;
|
|
92
|
+
implementationContent: string;
|
|
93
|
+
projectName: string;
|
|
94
|
+
today: string;
|
|
95
|
+
/** The actual source mode, named in provenance; defaults to `brief`. */
|
|
96
|
+
sourceMode?: BriefSourceMode;
|
|
97
|
+
}): BriefMigrationResult;
|
|
53
98
|
export declare function createProjectPromoteCommand(overrides?: Partial<ProjectPromoteDependencies>): Command;
|
|
54
99
|
export {};
|
|
55
100
|
//# sourceMappingURL=promote.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promote.d.ts","sourceRoot":"","sources":["../../../../src/commands/project/promote/promote.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,IAAI,YAAY,EACrB,QAAQ,IAAI,eAAe,EAC3B,MAAM,IAAI,aAAa,EACvB,SAAS,IAAI,gBAAgB,EAC9B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,UAAU,EAChB,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"promote.d.ts","sourceRoot":"","sources":["../../../../src/commands/project/promote/promote.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,IAAI,YAAY,EACrB,QAAQ,IAAI,eAAe,EAC3B,MAAM,IAAI,aAAa,EACvB,SAAS,IAAI,gBAAgB,EAC9B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAoB,KAAK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