@open-agent-toolkit/cli 0.3.17 → 0.3.19
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/assets/agents/oat-phase-implementer.md +81 -3
- package/assets/agents/oat-reviewer.md +15 -5
- package/assets/bundle-metadata.json +1 -1
- package/assets/docs/reference/cli-reference.md +8 -5
- package/assets/docs/reference/oat-directory-structure.md +1 -0
- package/assets/docs/reference/project-artifacts.md +17 -1
- package/assets/docs/reference/project-state-machine.md +19 -4
- package/assets/docs/skills/brainstorm.md +2 -1
- package/assets/docs/skills/index.md +1 -0
- package/assets/docs/workflows/advanced/autonomy.md +9 -1
- package/assets/docs/workflows/advanced/workflow-gates.md +11 -6
- package/assets/docs/workflows/approvals-and-automation.md +13 -8
- package/assets/docs/workflows/choose-workflow.md +16 -8
- package/assets/docs/workflows/projects/closeout/closeout-skills.md +8 -3
- package/assets/docs/workflows/projects/closeout/pr-flow.md +2 -0
- package/assets/docs/workflows/projects/execution/execution-skills.md +14 -2
- package/assets/docs/workflows/projects/execution/implementation-execution.md +15 -0
- package/assets/docs/workflows/projects/execution/picking-up-projects.md +10 -1
- package/assets/docs/workflows/projects/execution/project-log.md +22 -0
- package/assets/docs/workflows/projects/lifecycle.md +73 -9
- package/assets/docs/workflows/projects/planning/hill-checkpoints.md +18 -1
- package/assets/docs/workflows/projects/planning/planning-skills.md +11 -10
- package/assets/docs/workflows/projects/planning/starting-projects.md +92 -20
- package/assets/docs/workflows/projects/reviews/index.md +15 -2
- package/assets/docs/workflows/projects/reviews/review-flavors.md +5 -3
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/oat-brainstorm/SKILL.md +33 -9
- package/assets/skills/oat-brainstorm/references/destinations.md +9 -4
- package/assets/skills/oat-docs/SKILL.md +9 -4
- package/assets/skills/oat-pjm-review-backlog/SKILL.md +2 -2
- package/assets/skills/oat-project-autonomous/SKILL.md +14 -8
- package/assets/skills/oat-project-autonomous/references/gate-inventory.md +17 -2
- package/assets/skills/oat-project-brief/SKILL.md +592 -0
- package/assets/skills/oat-project-brief/references/brief-contract.md +294 -0
- package/assets/skills/oat-project-brief/references/docs/autonomy-contract.md +393 -0
- package/assets/skills/oat-project-brief/references/docs/gate-approval-record.md +84 -0
- package/assets/skills/oat-project-capture/SKILL.md +2 -2
- package/assets/skills/oat-project-complete/SKILL.md +7 -2
- package/assets/skills/oat-project-discover/SKILL.md +3 -2
- package/assets/skills/oat-project-dispatch-subagents/SKILL.md +9 -1
- package/assets/skills/oat-project-document/SKILL.md +11 -1
- package/assets/skills/oat-project-document/references/docs/autonomy-contract.md +17 -2
- package/assets/skills/oat-project-implement/SKILL.md +1 -1
- package/assets/skills/oat-project-implement/references/completion-and-closeout.md +40 -0
- package/assets/skills/oat-project-implement/references/docs/autonomy-contract.md +17 -2
- package/assets/skills/oat-project-implement/references/docs/gate-approval-record.md +4 -0
- package/assets/skills/oat-project-implement/references/phase-execution.md +166 -1
- package/assets/skills/oat-project-implement/references/plan-and-resume.md +97 -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 +17 -2
- package/assets/skills/oat-project-new/SKILL.md +5 -1
- package/assets/skills/oat-project-next/SKILL.md +31 -4
- package/assets/skills/oat-project-next/references/docs/gate-approval-record.md +4 -0
- package/assets/skills/oat-project-plan/SKILL.md +12 -2
- package/assets/skills/oat-project-plan-writing/SKILL.md +6 -4
- package/assets/skills/oat-project-pr-final/SKILL.md +15 -3
- package/assets/skills/oat-project-pr-final/references/docs/autonomy-contract.md +17 -2
- package/assets/skills/oat-project-pr-progress/SKILL.md +31 -4
- package/assets/skills/oat-project-progress/SKILL.md +30 -8
- package/assets/skills/oat-project-progress/references/docs/gate-approval-record.md +4 -0
- package/assets/skills/oat-project-promote-spec-driven/SKILL.md +2 -2
- package/assets/skills/oat-project-quick-start/SKILL.md +60 -1
- package/assets/skills/oat-project-quick-start/references/docs/autonomy-contract.md +17 -2
- package/assets/skills/oat-project-quick-start/references/docs/gate-approval-record.md +4 -0
- package/assets/skills/oat-project-reconcile/SKILL.md +65 -3
- package/assets/skills/oat-project-review-provide/SKILL.md +331 -12
- package/assets/skills/oat-project-review-receive/SKILL.md +86 -1
- package/assets/skills/oat-project-revise/SKILL.md +27 -4
- package/assets/skills/oat-project-summary/SKILL.md +95 -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/init/tools/shared/skill-script-references.d.ts.map +1 -1
- package/dist/commands/init/tools/shared/skill-script-references.js +8 -1
- package/dist/commands/project/log/append.d.ts.map +1 -1
- package/dist/commands/project/log/append.js +70 -10
- 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 +35 -7
- package/dist/commands/project/promote/promote.d.ts +32 -1
- package/dist/commands/project/promote/promote.d.ts.map +1 -1
- package/dist/commands/project/promote/promote.js +562 -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 +52 -18
- package/dist/commands/project/validate-plan/profiles.d.ts +54 -0
- package/dist/commands/project/validate-plan/profiles.d.ts.map +1 -0
- package/dist/commands/project/validate-plan/profiles.js +269 -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/agents-md-lock.d.ts +3 -0
- package/dist/commands/shared/agents-md-lock.d.ts.map +1 -0
- package/dist/commands/shared/agents-md-lock.js +130 -0
- package/dist/commands/shared/agents-md.d.ts.map +1 -1
- package/dist/commands/shared/agents-md.js +26 -8
- 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 +1 -0
- package/dist/commands/state/generate.d.ts.map +1 -1
- package/dist/commands/state/generate.js +51 -2
- package/dist/commands/tools/shared/pack-manifest.d.ts.map +1 -1
- package/dist/commands/tools/shared/pack-manifest.js +3 -0
- package/package.json +2 -2
|
@@ -1013,7 +1013,57 @@ export async function appendProjectLog(input, overrides = {}) {
|
|
|
1013
1013
|
const logPath = join(projectPath, PROJECT_LOG_FILENAME);
|
|
1014
1014
|
return withProjectLogLock(logPath, dependencies.lock, 'required', async () => appendLockedProjectLog(input, dependencies, logPath));
|
|
1015
1015
|
}
|
|
1016
|
+
async function previewProjectLogAppend(input, dependencies) {
|
|
1017
|
+
const projectPath = await resolveTargetProject(input, dependencies);
|
|
1018
|
+
const prepared = await prepareProjectLogAppend(input, dependencies, join(projectPath, PROJECT_LOG_FILENAME));
|
|
1019
|
+
if (prepared.status === 'skipped') {
|
|
1020
|
+
return {
|
|
1021
|
+
status: 'dry-run',
|
|
1022
|
+
outcome: 'skipped',
|
|
1023
|
+
reason: prepared.reason,
|
|
1024
|
+
wouldAppend: false,
|
|
1025
|
+
wouldCreate: false,
|
|
1026
|
+
};
|
|
1027
|
+
}
|
|
1028
|
+
if (prepared.status === 'already-appended') {
|
|
1029
|
+
return {
|
|
1030
|
+
status: 'dry-run',
|
|
1031
|
+
outcome: 'already-appended',
|
|
1032
|
+
logPath: prepared.logPath,
|
|
1033
|
+
heading: prepared.heading,
|
|
1034
|
+
wouldAppend: false,
|
|
1035
|
+
wouldCreate: false,
|
|
1036
|
+
};
|
|
1037
|
+
}
|
|
1038
|
+
return {
|
|
1039
|
+
status: 'dry-run',
|
|
1040
|
+
outcome: 'append',
|
|
1041
|
+
logPath: prepared.logPath,
|
|
1042
|
+
heading: prepared.heading,
|
|
1043
|
+
wouldAppend: true,
|
|
1044
|
+
wouldCreate: prepared.instantiated !== undefined,
|
|
1045
|
+
...(prepared.normalized ? { normalizedLineEndings: true } : {}),
|
|
1046
|
+
};
|
|
1047
|
+
}
|
|
1016
1048
|
async function appendLockedProjectLog(input, dependencies, logPath) {
|
|
1049
|
+
// Normal append prepares fresh state only after taking its required lock.
|
|
1050
|
+
const prepared = await prepareProjectLogAppend(input, dependencies, logPath);
|
|
1051
|
+
if (prepared.status !== 'ready')
|
|
1052
|
+
return prepared;
|
|
1053
|
+
if (prepared.instantiated !== undefined) {
|
|
1054
|
+
await dependencies.writeLog(logPath, prepared.instantiated);
|
|
1055
|
+
}
|
|
1056
|
+
await appendEntry(logPath, prepared.heading, prepared.body, prepared.versionNote, dependencies);
|
|
1057
|
+
return {
|
|
1058
|
+
status: 'appended',
|
|
1059
|
+
logPath,
|
|
1060
|
+
heading: prepared.heading,
|
|
1061
|
+
created: prepared.instantiated !== undefined,
|
|
1062
|
+
...(prepared.normalized ? { normalizedLineEndings: true } : {}),
|
|
1063
|
+
};
|
|
1064
|
+
}
|
|
1065
|
+
/** Read-only validation shared by advisory previews and locked mutations. */
|
|
1066
|
+
async function prepareProjectLogAppend(input, dependencies, logPath) {
|
|
1017
1067
|
const logExists = await fileExists(logPath);
|
|
1018
1068
|
if (!logExists) {
|
|
1019
1069
|
const effective = await dependencies.resolveEffectiveConfig(input.repoRoot, join(input.home ?? homedir(), '.oat'));
|
|
@@ -1024,7 +1074,7 @@ async function appendLockedProjectLog(input, dependencies, logPath) {
|
|
|
1024
1074
|
const date = dependencies.now().toISOString().slice(0, 10);
|
|
1025
1075
|
const { heading, body, versionNote, normalized } = validateEntry(input, date);
|
|
1026
1076
|
const idempotencyKey = validateIdempotencyKey(input.idempotencyKey, body);
|
|
1027
|
-
let
|
|
1077
|
+
let instantiated;
|
|
1028
1078
|
if (logExists) {
|
|
1029
1079
|
const content = await dependencies.readLog(logPath);
|
|
1030
1080
|
// A log whose markers two readers resolve differently cannot answer
|
|
@@ -1111,7 +1161,7 @@ async function appendLockedProjectLog(input, dependencies, logPath) {
|
|
|
1111
1161
|
if (!logExists) {
|
|
1112
1162
|
const assetsRoot = await dependencies.resolveAssetsRoot();
|
|
1113
1163
|
const template = await readFile(join(assetsRoot, 'templates', PROJECT_LOG_FILENAME), 'utf8');
|
|
1114
|
-
|
|
1164
|
+
instantiated = instantiateProjectLogTemplate(template, basename(dirname(logPath)), date);
|
|
1115
1165
|
// The project directory's basename lands in the template's title line, so a
|
|
1116
1166
|
// directory named `demo<U+2028>## Notes` would create a log this command
|
|
1117
1167
|
// then refuses on its next append. A mutator must never write content it
|
|
@@ -1119,16 +1169,15 @@ async function appendLockedProjectLog(input, dependencies, logPath) {
|
|
|
1119
1169
|
if (containsAmbiguousProjectLogMarker(instantiated)) {
|
|
1120
1170
|
throw new Error(`Project name ${basename(dirname(logPath))} would put a '## ' heading after a carriage return, U+2028, or U+2029 in the new log's title, leaving a file with two readings. Rename the project directory using line feeds only.`);
|
|
1121
1171
|
}
|
|
1122
|
-
await dependencies.writeLog(logPath, instantiated);
|
|
1123
|
-
created = true;
|
|
1124
1172
|
}
|
|
1125
|
-
await appendEntry(logPath, heading, body, versionNote, dependencies);
|
|
1126
1173
|
return {
|
|
1127
|
-
status: '
|
|
1174
|
+
status: 'ready',
|
|
1128
1175
|
logPath,
|
|
1129
1176
|
heading,
|
|
1130
|
-
|
|
1131
|
-
|
|
1177
|
+
body,
|
|
1178
|
+
versionNote,
|
|
1179
|
+
normalized,
|
|
1180
|
+
instantiated,
|
|
1132
1181
|
};
|
|
1133
1182
|
}
|
|
1134
1183
|
async function samePath(left, right) {
|
|
@@ -1277,7 +1326,7 @@ async function runAppendCommand(options, context, dependencies) {
|
|
|
1277
1326
|
}
|
|
1278
1327
|
let result;
|
|
1279
1328
|
try {
|
|
1280
|
-
result = await appendProjectLog({
|
|
1329
|
+
result = await (options.dryRun ? previewProjectLogAppend : appendProjectLog)({
|
|
1281
1330
|
repoRoot,
|
|
1282
1331
|
home: context.home,
|
|
1283
1332
|
...options,
|
|
@@ -1306,7 +1355,9 @@ async function runAppendCommand(options, context, dependencies) {
|
|
|
1306
1355
|
}
|
|
1307
1356
|
let commit;
|
|
1308
1357
|
let receiptRemoved = false;
|
|
1309
|
-
if (options.commit &&
|
|
1358
|
+
if (options.commit &&
|
|
1359
|
+
result.status !== 'skipped' &&
|
|
1360
|
+
result.status !== 'dry-run') {
|
|
1310
1361
|
commit = await commitProjectLog({
|
|
1311
1362
|
repoRoot,
|
|
1312
1363
|
logPath: result.logPath,
|
|
@@ -1330,6 +1381,14 @@ async function runAppendCommand(options, context, dependencies) {
|
|
|
1330
1381
|
: {}),
|
|
1331
1382
|
});
|
|
1332
1383
|
}
|
|
1384
|
+
else if (result.status === 'dry-run') {
|
|
1385
|
+
const prediction = result.outcome === 'append'
|
|
1386
|
+
? `Would append project log entry: ${result.logPath}${result.wouldCreate ? ' (would create log)' : ''}.`
|
|
1387
|
+
: result.outcome === 'already-appended'
|
|
1388
|
+
? `Project log entry already present: ${result.heading}.`
|
|
1389
|
+
: 'Would skip project log append (projectLog=false).';
|
|
1390
|
+
context.logger.success(`${prediction} No changes were made.`);
|
|
1391
|
+
}
|
|
1333
1392
|
else if (result.status === 'appended') {
|
|
1334
1393
|
context.logger.success(`Appended project log entry: ${result.logPath}`);
|
|
1335
1394
|
}
|
|
@@ -1360,6 +1419,7 @@ export function createProjectLogAppendCommand(overrides = {}) {
|
|
|
1360
1419
|
const dependencies = { ...DEFAULT_COMMAND_DEPENDENCIES, ...overrides };
|
|
1361
1420
|
return new Command('append')
|
|
1362
1421
|
.description('Append a validated entry to the active project log')
|
|
1422
|
+
.option('--dry-run', 'Validate and preview without writing files, acquiring locks, or committing')
|
|
1363
1423
|
.option('--structural', 'Write a structural lifecycle entry')
|
|
1364
1424
|
.option('--type <type>', 'Judgment type: bug, friction, worked-well, feedback')
|
|
1365
1425
|
.option('--scope <scope>', 'Judgment scope: project or general')
|
|
@@ -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,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AO,CAAC;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,oBAAoB,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,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;AA2MD,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;AA8QD,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, } 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,11 @@ 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
|
+
],
|
|
46
52
|
};
|
|
47
53
|
function normalizeTemplateEntry(entry) {
|
|
48
54
|
return typeof entry === 'string' ? { source: entry, target: entry } : entry;
|
|
@@ -122,6 +128,23 @@ const STATE_TEMPLATE_BY_MODE = {
|
|
|
122
128
|
],
|
|
123
129
|
nextMilestone: 'Run `oat-project-lite` to author and approve the plan',
|
|
124
130
|
},
|
|
131
|
+
brief: {
|
|
132
|
+
hillCheckpoints: '[]',
|
|
133
|
+
phase: 'plan',
|
|
134
|
+
status: 'Plan',
|
|
135
|
+
currentPhase: 'Plan - Authoring the Project Brief',
|
|
136
|
+
artifacts: [
|
|
137
|
+
'- **Plan:** `plan.md` (scaffolded Project Brief template — not started)',
|
|
138
|
+
'- **Implementation:** `implementation.md` (scaffolded brief journal template — not started)',
|
|
139
|
+
'- **Research:** `references/research/` (empty)',
|
|
140
|
+
],
|
|
141
|
+
progress: [
|
|
142
|
+
'- ✓ Brief project scaffolded',
|
|
143
|
+
'- ✓ Brief and implementation artifacts scaffolded',
|
|
144
|
+
'- ⧗ Awaiting brief interview and authoring',
|
|
145
|
+
],
|
|
146
|
+
nextMilestone: 'Run `oat-project-brief` to author and approve the brief',
|
|
147
|
+
},
|
|
125
148
|
};
|
|
126
149
|
function replaceOatPlaceholders(template, replacements) {
|
|
127
150
|
return template.replace(OAT_PLACEHOLDER_PATTERN, (placeholder, token) => replacements[token] ?? placeholder);
|
|
@@ -219,7 +242,7 @@ async function scaffoldModeTemplates(home, repoRoot, absoluteProjectPath, projec
|
|
|
219
242
|
}
|
|
220
243
|
const { content: template } = await resolveProjectTemplate(home, repoRoot, source);
|
|
221
244
|
let rendered = applyTemplateReplacements(template, projectName, today, nowUtc, mode);
|
|
222
|
-
if (mode === 'lite' && target === 'plan.md') {
|
|
245
|
+
if ((mode === 'lite' || isBriefMode(mode)) && target === 'plan.md') {
|
|
223
246
|
rendered = rendered.replace(/^---\n/, '---\noat_template: true\n');
|
|
224
247
|
}
|
|
225
248
|
assertNoUnresolvedOatPlaceholders(rendered, source);
|
|
@@ -258,12 +281,17 @@ async function ensureStructure(absoluteProjectPath, mode) {
|
|
|
258
281
|
await mkdir(join(absoluteProjectPath, 'reviews'), { recursive: true });
|
|
259
282
|
await mkdir(join(absoluteProjectPath, 'pr'), { recursive: true });
|
|
260
283
|
if (mode === 'import') {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
284
|
+
await ensureGitkeepDir(join(absoluteProjectPath, 'references'));
|
|
285
|
+
}
|
|
286
|
+
if (isBriefMode(mode)) {
|
|
287
|
+
await ensureGitkeepDir(join(absoluteProjectPath, 'references', 'research'));
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
async function ensureGitkeepDir(dir) {
|
|
291
|
+
await mkdir(dir, { recursive: true });
|
|
292
|
+
const gitkeepPath = join(dir, '.gitkeep');
|
|
293
|
+
if (!(await fileExists(gitkeepPath))) {
|
|
294
|
+
await writeFile(gitkeepPath, '', 'utf8');
|
|
267
295
|
}
|
|
268
296
|
}
|
|
269
297
|
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' | '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,7 @@ export type PromotionResult = {
|
|
|
30
30
|
status: 'refused';
|
|
31
31
|
reason: Exclude<PromotionReason, 'promoted'>;
|
|
32
32
|
files: string[];
|
|
33
|
+
phases?: string[];
|
|
33
34
|
recovery?: PromotionRecovery;
|
|
34
35
|
};
|
|
35
36
|
export interface ProjectPromoteDependencies {
|
|
@@ -50,6 +51,36 @@ export interface ProjectPromoteDependencies {
|
|
|
50
51
|
now: () => Date;
|
|
51
52
|
}
|
|
52
53
|
export declare function parseLitePlanSections(planContent: string, liteTemplateContent?: string): LitePlanSections | null;
|
|
54
|
+
export type BriefPhaseState = 'accepted' | 'active' | 'pending' | 'provisional';
|
|
55
|
+
export interface BriefMigration {
|
|
56
|
+
plan: string;
|
|
57
|
+
implementation: string;
|
|
58
|
+
implementationChanged: boolean;
|
|
59
|
+
pendingPhases: string[];
|
|
60
|
+
phaseStates: Record<string, BriefPhaseState>;
|
|
61
|
+
}
|
|
62
|
+
export type BriefMigrationResult = {
|
|
63
|
+
ok: true;
|
|
64
|
+
migration: BriefMigration;
|
|
65
|
+
} | {
|
|
66
|
+
ok: false;
|
|
67
|
+
reason: 'extracted-phases' | 'invalid-brief-plan';
|
|
68
|
+
} | {
|
|
69
|
+
ok: false;
|
|
70
|
+
reason: 'missing-phase-head';
|
|
71
|
+
phases: string[];
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Pure brief → quick migration. Phase states follow the phase-unit progress
|
|
75
|
+
* contract: accepted (journal `completed`, not provisional), active (any other
|
|
76
|
+
* started status), pending, or provisional. An extracted phase refuses.
|
|
77
|
+
*/
|
|
78
|
+
export declare function migrateBriefToQuick(input: {
|
|
79
|
+
planContent: string;
|
|
80
|
+
implementationContent: string;
|
|
81
|
+
projectName: string;
|
|
82
|
+
today: string;
|
|
83
|
+
}): BriefMigrationResult;
|
|
53
84
|
export declare function createProjectPromoteCommand(overrides?: Partial<ProjectPromoteDependencies>): Command;
|
|
54
85
|
export {};
|
|
55
86
|
//# 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,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,UAAU,EAChB,MAAM,iCAAiC,CAAC;AAEzC,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