@rasensio/aidlc 1.30.0 → 1.31.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/dist/compile/roadmap-skill.d.ts +7 -1
- package/dist/compile/roadmap-skill.d.ts.map +1 -1
- package/dist/compile/roadmap-skill.js +86 -5
- package/dist/compile/roadmap-skill.js.map +1 -1
- package/dist/doctor/migrations/index.d.ts.map +1 -1
- package/dist/doctor/migrations/index.js +8 -0
- package/dist/doctor/migrations/index.js.map +1 -1
- package/dist/doctor/migrations/roadmap-item-fields.d.ts +81 -0
- package/dist/doctor/migrations/roadmap-item-fields.d.ts.map +1 -0
- package/dist/doctor/migrations/roadmap-item-fields.js +174 -0
- package/dist/doctor/migrations/roadmap-item-fields.js.map +1 -0
- package/dist/doctor/migrations/roadmap-layout.d.ts +8 -1
- package/dist/doctor/migrations/roadmap-layout.d.ts.map +1 -1
- package/dist/doctor/migrations/roadmap-layout.js +15 -3
- package/dist/doctor/migrations/roadmap-layout.js.map +1 -1
- package/dist/roadmap/item-fields.d.ts +157 -0
- package/dist/roadmap/item-fields.d.ts.map +1 -0
- package/dist/roadmap/item-fields.js +259 -0
- package/dist/roadmap/item-fields.js.map +1 -0
- package/dist/roadmap/sync/import.d.ts.map +1 -1
- package/dist/roadmap/sync/import.js +13 -2
- package/dist/roadmap/sync/import.js.map +1 -1
- package/package.json +2 -2
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
*
|
|
35
35
|
* @module
|
|
36
36
|
*/
|
|
37
|
+
import { type ItemFieldDecl } from '../roadmap/item-fields.js';
|
|
37
38
|
/** Repo-relative target, for reports and tests. */
|
|
38
39
|
export declare const ROADMAP_SKILL_PATH: string;
|
|
39
40
|
/** Outcome of one emission pass. */
|
|
@@ -51,8 +52,9 @@ export interface RoadmapSkillReport {
|
|
|
51
52
|
*
|
|
52
53
|
* @param source - Raw source template contents.
|
|
53
54
|
* @param version - Version to stamp, e.g. `1.12.0`.
|
|
55
|
+
* @param fields - The project's declared item fields; empty for the stock template.
|
|
54
56
|
*/
|
|
55
|
-
export declare function renderRoadmapSkill(source: string, version: string): string;
|
|
57
|
+
export declare function renderRoadmapSkill(source: string, version: string, fields?: readonly ItemFieldDecl[]): string;
|
|
56
58
|
/**
|
|
57
59
|
* Install the portable authoring skill into a project.
|
|
58
60
|
*
|
|
@@ -62,9 +64,13 @@ export declare function renderRoadmapSkill(source: string, version: string): str
|
|
|
62
64
|
* rather than read here so tests can pin it and this module needs no opinion
|
|
63
65
|
* about where a package manifest lives.
|
|
64
66
|
* @param opts.dryRun - Compute the report without writing.
|
|
67
|
+
* @param opts.fields - Declared item fields, overriding what the project's config
|
|
68
|
+
* says. A test seam: rendering is the thing worth asserting, and threading a
|
|
69
|
+
* config file through a temp directory to assert it would test the reader twice.
|
|
65
70
|
*/
|
|
66
71
|
export declare function installRoadmapSkill(projectRoot: string, contentRoot: string, version: string, opts?: {
|
|
67
72
|
dryRun?: boolean;
|
|
73
|
+
fields?: readonly ItemFieldDecl[];
|
|
68
74
|
}): RoadmapSkillReport;
|
|
69
75
|
/**
|
|
70
76
|
* One-line summary of an emission pass, or null when there is nothing to say.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roadmap-skill.d.ts","sourceRoot":"","sources":["../../src/compile/roadmap-skill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;
|
|
1
|
+
{"version":3,"file":"roadmap-skill.d.ts","sourceRoot":"","sources":["../../src/compile/roadmap-skill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAKH,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,2BAA2B,CAAC;AAYnC,mDAAmD;AACnD,eAAO,MAAM,kBAAkB,QAA4B,CAAC;AA4F5D,oCAAoC;AACpC,MAAM,WAAW,kBAAkB;IACjC,oEAAoE;IACpE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;IACvE,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,SAAS,aAAa,EAAO,GACpC,MAAM,CAiBR;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,IAAI,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,SAAS,aAAa,EAAE,CAAA;CAAO,GACjE,kBAAkB,CAwCpB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,GAAG,IAAI,CAS/E"}
|
|
@@ -36,6 +36,8 @@
|
|
|
36
36
|
*/
|
|
37
37
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
38
38
|
import { join } from 'node:path';
|
|
39
|
+
import { itemFieldsOrEmpty, renderFieldDefault, renderFieldLines, } from '../roadmap/item-fields.js';
|
|
40
|
+
import { primaryCheckout } from '../roadmap/paths.js';
|
|
39
41
|
/** Directory name of the skill, shared by source and target. */
|
|
40
42
|
const SKILL_DIR = 'roadmap-item';
|
|
41
43
|
/** Path segments below the content package root. */
|
|
@@ -46,6 +48,73 @@ const TARGET_SEGMENTS = ['.aidlc', 'resources', 'skills', SKILL_DIR, 'SKILL.md']
|
|
|
46
48
|
export const ROADMAP_SKILL_PATH = TARGET_SEGMENTS.join('/');
|
|
47
49
|
/** The token the source carries in place of a version literal. */
|
|
48
50
|
const VERSION_PLACEHOLDER = '{{version}}';
|
|
51
|
+
/**
|
|
52
|
+
* The two project-field placeholders, each occupying a **whole line** of the source.
|
|
53
|
+
*
|
|
54
|
+
* Whole-line, not inline, and that is what makes a project declaring nothing get a
|
|
55
|
+
* byte-identical file to the one before this feature existed
|
|
56
|
+
* (item-extension-fields/AC-10): the line is *deleted*, not substituted with an
|
|
57
|
+
* empty string, so no stray blank line survives. An inline token could not manage
|
|
58
|
+
* that, and byte-identity is the only version of "behaves exactly as today" that
|
|
59
|
+
* can be asserted rather than eyeballed.
|
|
60
|
+
*/
|
|
61
|
+
const FIELDS_PLACEHOLDER = '{{project_item_fields}}';
|
|
62
|
+
const FIELDS_RULE_PLACEHOLDER = '{{project_item_fields_rule}}';
|
|
63
|
+
/**
|
|
64
|
+
* The rule as it reads when the project has declared nothing.
|
|
65
|
+
*
|
|
66
|
+
* Byte-for-byte the wording the source carried before this feature, because AC-10
|
|
67
|
+
* is asserted against the committed emitted file.
|
|
68
|
+
*/
|
|
69
|
+
const ABSOLUTE_RULE = [
|
|
70
|
+
'- Do not add any other field, and do not add a `status` field. Status is recorded by which',
|
|
71
|
+
' folder the file sits in, not inside the file.',
|
|
72
|
+
];
|
|
73
|
+
/**
|
|
74
|
+
* The rule as it reads when the project has declared fields.
|
|
75
|
+
*
|
|
76
|
+
* The absolute "do not add any other field" is what made the framework's own
|
|
77
|
+
* instruction and a project's own gate jointly unsatisfiable, so it becomes a
|
|
78
|
+
* bounded rule rather than being dropped (AC-8). The `status` prohibition stays
|
|
79
|
+
* absolute in both renderings — that one is not a schema choice, it is the layout.
|
|
80
|
+
*
|
|
81
|
+
* Each field states its required-ness and default (AC-9) so an agent that cannot
|
|
82
|
+
* read the project's config still knows what to write. The agent loading this skill
|
|
83
|
+
* usually has no checkout at all, which is the entire reason the skill is portable.
|
|
84
|
+
*/
|
|
85
|
+
function projectRule(fields) {
|
|
86
|
+
const lines = [
|
|
87
|
+
'- Add no field beyond the template above — which already includes the fields this project',
|
|
88
|
+
' has declared — and never add a `status` field. Status is recorded by which folder the',
|
|
89
|
+
' file sits in, not inside the file.',
|
|
90
|
+
"- This project's own declared fields, which the template above already carries:",
|
|
91
|
+
];
|
|
92
|
+
for (const field of fields) {
|
|
93
|
+
lines.push(` - \`${field.name}\` — ${field.required ? 'required, include it even when empty' : 'optional'}; ` +
|
|
94
|
+
`write \`${renderFieldDefault(field.default)}\` if you have nothing better.`);
|
|
95
|
+
}
|
|
96
|
+
lines.push(' The project checks that these are present and of the right shape. What goes *in* them is', " the project's own business — if you do not know, write the default and say so.");
|
|
97
|
+
return lines;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Replace a whole-line placeholder with a block, or delete the line when the block
|
|
101
|
+
* is empty.
|
|
102
|
+
*
|
|
103
|
+
* Operates on lines rather than on the raw string so "delete the line" means
|
|
104
|
+
* exactly that, including its newline.
|
|
105
|
+
*/
|
|
106
|
+
function substituteLine(text, placeholder, block) {
|
|
107
|
+
const lines = text.split('\n');
|
|
108
|
+
const out = [];
|
|
109
|
+
for (const line of lines) {
|
|
110
|
+
if (line.trim() !== placeholder) {
|
|
111
|
+
out.push(line);
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
out.push(...block);
|
|
115
|
+
}
|
|
116
|
+
return out.join('\n');
|
|
117
|
+
}
|
|
49
118
|
/**
|
|
50
119
|
* Ownership notice written into the emitted file.
|
|
51
120
|
*
|
|
@@ -63,9 +132,11 @@ const OWNERSHIP_MARKER = '<!-- aidlc:generated — framework-owned. Edits are ov
|
|
|
63
132
|
*
|
|
64
133
|
* @param source - Raw source template contents.
|
|
65
134
|
* @param version - Version to stamp, e.g. `1.12.0`.
|
|
135
|
+
* @param fields - The project's declared item fields; empty for the stock template.
|
|
66
136
|
*/
|
|
67
|
-
export function renderRoadmapSkill(source, version) {
|
|
68
|
-
const
|
|
137
|
+
export function renderRoadmapSkill(source, version, fields = []) {
|
|
138
|
+
const withFields = substituteLine(substituteLine(source, FIELDS_PLACEHOLDER, renderFieldLines(fields)), FIELDS_RULE_PLACEHOLDER, fields.length > 0 ? projectRule(fields) : ABSOLUTE_RULE);
|
|
139
|
+
const stamped = withFields.split(VERSION_PLACEHOLDER).join(version);
|
|
69
140
|
// Insert the marker after the frontmatter's closing fence. A source without
|
|
70
141
|
// frontmatter is not something we produce, but degrading to "prepend nothing"
|
|
71
142
|
// beats emitting a file whose first bytes are a comment.
|
|
@@ -85,6 +156,9 @@ export function renderRoadmapSkill(source, version) {
|
|
|
85
156
|
* rather than read here so tests can pin it and this module needs no opinion
|
|
86
157
|
* about where a package manifest lives.
|
|
87
158
|
* @param opts.dryRun - Compute the report without writing.
|
|
159
|
+
* @param opts.fields - Declared item fields, overriding what the project's config
|
|
160
|
+
* says. A test seam: rendering is the thing worth asserting, and threading a
|
|
161
|
+
* config file through a temp directory to assert it would test the reader twice.
|
|
88
162
|
*/
|
|
89
163
|
export function installRoadmapSkill(projectRoot, contentRoot, version, opts = {}) {
|
|
90
164
|
const source = join(contentRoot, ...SOURCE_SEGMENTS);
|
|
@@ -95,13 +169,20 @@ export function installRoadmapSkill(projectRoot, contentRoot, version, opts = {}
|
|
|
95
169
|
warnings: [`the content package ships no roadmap authoring skill at ${source}`],
|
|
96
170
|
};
|
|
97
171
|
}
|
|
98
|
-
|
|
172
|
+
// Declared fields come from the PRIMARY checkout, never this working tree: items
|
|
173
|
+
// and their schema are one fact, so a feature branch must not be able to change
|
|
174
|
+
// what a colleague's items are validated against (AC-3).
|
|
175
|
+
const declared = opts.fields !== undefined
|
|
176
|
+
? { fields: opts.fields, warning: null }
|
|
177
|
+
: itemFieldsOrEmpty(primaryCheckout(projectRoot));
|
|
178
|
+
const warnings = declared.warning === null ? [] : [declared.warning];
|
|
179
|
+
const rendered = renderRoadmapSkill(readFileSync(source, 'utf8'), version, declared.fields);
|
|
99
180
|
const target = join(projectRoot, ...TARGET_SEGMENTS);
|
|
100
181
|
const existed = existsSync(target);
|
|
101
182
|
// Skipping an identical write keeps output deterministic and stops `update`
|
|
102
183
|
// from producing a diff on every run.
|
|
103
184
|
if (existed && readFileSync(target, 'utf8') === rendered) {
|
|
104
|
-
return { path: null, status: 'already-current', warnings
|
|
185
|
+
return { path: null, status: 'already-current', warnings };
|
|
105
186
|
}
|
|
106
187
|
if (!opts.dryRun) {
|
|
107
188
|
mkdirSync(join(projectRoot, ...TARGET_SEGMENTS.slice(0, -1)), { recursive: true });
|
|
@@ -110,7 +191,7 @@ export function installRoadmapSkill(projectRoot, contentRoot, version, opts = {}
|
|
|
110
191
|
return {
|
|
111
192
|
path: ROADMAP_SKILL_PATH,
|
|
112
193
|
status: existed ? 'updated' : 'installed',
|
|
113
|
-
warnings
|
|
194
|
+
warnings,
|
|
114
195
|
};
|
|
115
196
|
}
|
|
116
197
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roadmap-skill.js","sourceRoot":"","sources":["../../src/compile/roadmap-skill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,gEAAgE;AAChE,MAAM,SAAS,GAAG,cAAc,CAAC;AAEjC,oDAAoD;AACpD,MAAM,eAAe,GAAG,CAAC,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAU,CAAC;AAEhF,4CAA4C;AAC5C,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAU,CAAC;AAE1F,mDAAmD;AACnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE5D,kEAAkE;AAClE,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAE1C;;;;;;;GAOG;AACH,MAAM,gBAAgB,GACpB,sFAAsF,CAAC;AAUzF
|
|
1
|
+
{"version":3,"file":"roadmap-skill.js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"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAkC7C,eAAO,MAAM,UAAU,EAAE,SAAS,EA6FjC,CAAC"}
|
|
@@ -23,6 +23,7 @@ import { trustRunActions } from './trust-run-actions.js';
|
|
|
23
23
|
import { staleIdeaSkill } from './stale-idea-skill.js';
|
|
24
24
|
import { roadmapLayout } from './roadmap-layout.js';
|
|
25
25
|
import { roadmapItemTitles } from './roadmap-item-titles.js';
|
|
26
|
+
import { roadmapItemFields } from './roadmap-item-fields.js';
|
|
26
27
|
import { instanceCompletion } from './instance-completion.js';
|
|
27
28
|
import { findingsFilenameMigration } from './findings-filename.js';
|
|
28
29
|
import { roadmapSyncGhMissing } from './roadmap-sync-gh-missing.js';
|
|
@@ -47,6 +48,13 @@ export const MIGRATIONS = [
|
|
|
47
48
|
// an item that will not parse. Repairing titles between the two means one
|
|
48
49
|
// doctor run both creates the item and can see it.
|
|
49
50
|
roadmapItemTitles,
|
|
51
|
+
// Ordered after roadmap-item-titles, load-bearing: an item whose frontmatter will
|
|
52
|
+
// not parse cannot be checked for a declared field, and this migration skips those
|
|
53
|
+
// in silence rather than reporting the same file twice. Quoting titles first means
|
|
54
|
+
// one doctor run both makes an item readable and backfills its declared fields.
|
|
55
|
+
// After roadmap-layout for the same reason — the legacy rewrite creates the items
|
|
56
|
+
// this then validates (item-extension-fields/AC-15).
|
|
57
|
+
roadmapItemFields,
|
|
50
58
|
// Ordered after roadmap-layout: that migration creates the status directories
|
|
51
59
|
// and can itself place an item in `in-progress/` for an instance that has
|
|
52
60
|
// since completed, which is exactly what this one then moves to `done/`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":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e;IACf,eAAe;IACf,gFAAgF;IAChF,iEAAiE;IACjE,iBAAiB;IACjB,yEAAyE;IACzE,0EAA0E;IAC1E,eAAe;IACf,sFAAsF;IACtF,sFAAsF;IACtF,qFAAqF;IACrF,uDAAuD;IACvD,EAAE;IACF,iFAAiF;IACjF,qFAAqF;IACrF,wFAAwF;IACxF,gDAAgD;IAChD,wFAAwF;IACxF,mFAAmF;IACnF,iFAAiF;IACjF,wBAAwB;IACxB,0BAA0B;IAC1B,0BAA0B;IAC1B,sBAAsB;IACtB,iFAAiF;IACjF,qDAAqD;IACrD,uBAAuB;IACvB,sFAAsF;IACtF,oFAAoF;IACpF,uFAAuF;IACvF,uFAAuF;IACvF,oEAAoE;IACpE,qBAAqB;IACrB,gFAAgF;IAChF,kFAAkF;IAClF,+EAA+E;IAC/E,6CAA6C;IAC7C,8CAA8C;IAC9C,EAAE;IACF,6EAA6E;IAC7E,6EAA6E;IAC7E,iFAAiF;IACjF,sBAAsB;IACtB,mBAAmB;IACnB,eAAe;CAChB,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* roadmap-item-fields migration (confirm tier): backfill a project-declared item
|
|
3
|
+
* field that an item is missing, and report one whose value is the wrong shape.
|
|
4
|
+
*
|
|
5
|
+
* Requirements: item-extension-fields/AC-15, AC-16, AC-18, AC-19, AC-20
|
|
6
|
+
*
|
|
7
|
+
* Declaring a field is cheap; retrofitting it across a roadmap that already holds
|
|
8
|
+
* fifty items is not. Without a backfill, `roadmap.item_fields` would report fifty
|
|
9
|
+
* problems on the day it was added and offer no way to act on any of them — the
|
|
10
|
+
* shape of gate this project has learned to distrust.
|
|
11
|
+
*
|
|
12
|
+
* The line between what this repairs and what it only reports is the same line the
|
|
13
|
+
* feature draws everywhere: **presence, never contents.**
|
|
14
|
+
*
|
|
15
|
+
* - A *missing* required field is repaired by writing the value the project itself
|
|
16
|
+
* declared as the default. That is presence repair with the project's own answer,
|
|
17
|
+
* not a semantic judgment, so it stays inside the boundary AC-17 sets.
|
|
18
|
+
* - A *wrong-shaped* value is reported and never rewritten. Wrapping a scalar in a
|
|
19
|
+
* list to make it fit would be the confident-wrong-fix `roadmap-item-titles`
|
|
20
|
+
* already refuses, and only the person who wrote the value knows what they meant.
|
|
21
|
+
*
|
|
22
|
+
* Wrong shapes and an invalid declaration are both reported as NOT APPLICABLE
|
|
23
|
+
* rather than pending, following `roadmap-item-titles` exactly: `aidlc doctor`
|
|
24
|
+
* exits 1 on pending confirm work, so calling a condition `apply` will never fix
|
|
25
|
+
* "pending" fails doctor forever on a repo holding one such item, which trains
|
|
26
|
+
* people to ignore doctor output. `not-applicable` still prints the detail, which
|
|
27
|
+
* is the entire point.
|
|
28
|
+
*
|
|
29
|
+
* Items whose frontmatter will not parse are skipped in silence. They are
|
|
30
|
+
* `roadmap-item-titles`' condition, that migration is registered ahead of this one,
|
|
31
|
+
* and reporting the same file from two migrations would double every line without
|
|
32
|
+
* adding a fact.
|
|
33
|
+
*
|
|
34
|
+
* Confirm tier, because this edits the user's own content — the reason
|
|
35
|
+
* `roadmap-layout` and `roadmap-item-titles` are confirm tier too. `check` and
|
|
36
|
+
* `apply` both derive everything from `planItemFields` and nothing else computes
|
|
37
|
+
* pending-ness, the rule `../types.ts` states, so a dry run and a real run cannot
|
|
38
|
+
* disagree.
|
|
39
|
+
*/
|
|
40
|
+
import type { DoctorContext, Migration } from '../types.js';
|
|
41
|
+
import { type ItemFieldDecl, type ShapeMismatch } from '../../roadmap/item-fields.js';
|
|
42
|
+
/** One item with fields to add, and the rewritten contents that add them. */
|
|
43
|
+
export interface FieldBackfill {
|
|
44
|
+
/** `<status>/<filename>` — the form used in doctor output. */
|
|
45
|
+
label: string;
|
|
46
|
+
file: string;
|
|
47
|
+
fields: ItemFieldDecl[];
|
|
48
|
+
contents: string;
|
|
49
|
+
}
|
|
50
|
+
/** One item carrying a declared field of the wrong shape. */
|
|
51
|
+
export interface FieldShapeReport {
|
|
52
|
+
label: string;
|
|
53
|
+
mismatches: ShapeMismatch[];
|
|
54
|
+
}
|
|
55
|
+
export interface ItemFieldsPlan {
|
|
56
|
+
/** Null when the project declares nothing; a message when its declaration is wrong. */
|
|
57
|
+
notApplicable: string | null;
|
|
58
|
+
backfills: FieldBackfill[];
|
|
59
|
+
shapes: FieldShapeReport[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Insert `name: <default>` lines at the **end** of an item's frontmatter block.
|
|
63
|
+
*
|
|
64
|
+
* End-of-block rather than "after `history`", deliberately. `history` is a block
|
|
65
|
+
* list whose extent has to be walked, and `writeHistoryEntry` appends to it — a key
|
|
66
|
+
* inserted between the `history:` line and its last entry would be swallowed into
|
|
67
|
+
* the list on the next move. End-of-block is unambiguous, needs no walk, and is
|
|
68
|
+
* where `writeHistoryEntry` itself puts a `history` key when none exists.
|
|
69
|
+
*
|
|
70
|
+
* @returns The rewritten contents, or null when there is no frontmatter to edit.
|
|
71
|
+
*/
|
|
72
|
+
export declare function insertFields(raw: string, fields: readonly ItemFieldDecl[]): string | null;
|
|
73
|
+
/**
|
|
74
|
+
* Everything the migration would do, computed without writing.
|
|
75
|
+
*
|
|
76
|
+
* The single source of pending-ness. Items are walked in status order and then
|
|
77
|
+
* filename order, so the plan never depends on directory read order.
|
|
78
|
+
*/
|
|
79
|
+
export declare function planItemFields(ctx: DoctorContext): ItemFieldsPlan;
|
|
80
|
+
export declare const roadmapItemFields: Migration;
|
|
81
|
+
//# sourceMappingURL=roadmap-item-fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roadmap-item-fields.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/roadmap-item-fields.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAIH,OAAO,KAAK,EAAe,aAAa,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAQzE,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,aAAa,EACnB,MAAM,8BAA8B,CAAC;AAEtC,6EAA6E;AAC7E,MAAM,WAAW,aAAa;IAC5B,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,6DAA6D;AAC7D,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,aAAa,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,cAAc;IAC7B,uFAAuF;IACvF,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,MAAM,EAAE,gBAAgB,EAAE,CAAC;CAC5B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,aAAa,EAAE,GAAG,MAAM,GAAG,IAAI,CAUzF;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAwCjE;AA8BD,eAAO,MAAM,iBAAiB,EAAE,SAkD/B,CAAC"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* roadmap-item-fields migration (confirm tier): backfill a project-declared item
|
|
3
|
+
* field that an item is missing, and report one whose value is the wrong shape.
|
|
4
|
+
*
|
|
5
|
+
* Requirements: item-extension-fields/AC-15, AC-16, AC-18, AC-19, AC-20
|
|
6
|
+
*
|
|
7
|
+
* Declaring a field is cheap; retrofitting it across a roadmap that already holds
|
|
8
|
+
* fifty items is not. Without a backfill, `roadmap.item_fields` would report fifty
|
|
9
|
+
* problems on the day it was added and offer no way to act on any of them — the
|
|
10
|
+
* shape of gate this project has learned to distrust.
|
|
11
|
+
*
|
|
12
|
+
* The line between what this repairs and what it only reports is the same line the
|
|
13
|
+
* feature draws everywhere: **presence, never contents.**
|
|
14
|
+
*
|
|
15
|
+
* - A *missing* required field is repaired by writing the value the project itself
|
|
16
|
+
* declared as the default. That is presence repair with the project's own answer,
|
|
17
|
+
* not a semantic judgment, so it stays inside the boundary AC-17 sets.
|
|
18
|
+
* - A *wrong-shaped* value is reported and never rewritten. Wrapping a scalar in a
|
|
19
|
+
* list to make it fit would be the confident-wrong-fix `roadmap-item-titles`
|
|
20
|
+
* already refuses, and only the person who wrote the value knows what they meant.
|
|
21
|
+
*
|
|
22
|
+
* Wrong shapes and an invalid declaration are both reported as NOT APPLICABLE
|
|
23
|
+
* rather than pending, following `roadmap-item-titles` exactly: `aidlc doctor`
|
|
24
|
+
* exits 1 on pending confirm work, so calling a condition `apply` will never fix
|
|
25
|
+
* "pending" fails doctor forever on a repo holding one such item, which trains
|
|
26
|
+
* people to ignore doctor output. `not-applicable` still prints the detail, which
|
|
27
|
+
* is the entire point.
|
|
28
|
+
*
|
|
29
|
+
* Items whose frontmatter will not parse are skipped in silence. They are
|
|
30
|
+
* `roadmap-item-titles`' condition, that migration is registered ahead of this one,
|
|
31
|
+
* and reporting the same file from two migrations would double every line without
|
|
32
|
+
* adding a fact.
|
|
33
|
+
*
|
|
34
|
+
* Confirm tier, because this edits the user's own content — the reason
|
|
35
|
+
* `roadmap-layout` and `roadmap-item-titles` are confirm tier too. `check` and
|
|
36
|
+
* `apply` both derive everything from `planItemFields` and nothing else computes
|
|
37
|
+
* pending-ness, the rule `../types.ts` states, so a dry run and a real run cannot
|
|
38
|
+
* disagree.
|
|
39
|
+
*/
|
|
40
|
+
import { writeFileSync } from 'node:fs';
|
|
41
|
+
import { relative } from 'node:path';
|
|
42
|
+
import { ROADMAP_STATUSES, frontmatter, listStatus, primaryCheckout, } from '../../roadmap/paths.js';
|
|
43
|
+
import { checkItemFrontmatter, readItemFields, renderFieldDefault, } from '../../roadmap/item-fields.js';
|
|
44
|
+
/**
|
|
45
|
+
* Insert `name: <default>` lines at the **end** of an item's frontmatter block.
|
|
46
|
+
*
|
|
47
|
+
* End-of-block rather than "after `history`", deliberately. `history` is a block
|
|
48
|
+
* list whose extent has to be walked, and `writeHistoryEntry` appends to it — a key
|
|
49
|
+
* inserted between the `history:` line and its last entry would be swallowed into
|
|
50
|
+
* the list on the next move. End-of-block is unambiguous, needs no walk, and is
|
|
51
|
+
* where `writeHistoryEntry` itself puts a `history` key when none exists.
|
|
52
|
+
*
|
|
53
|
+
* @returns The rewritten contents, or null when there is no frontmatter to edit.
|
|
54
|
+
*/
|
|
55
|
+
export function insertFields(raw, fields) {
|
|
56
|
+
const fm = frontmatter(raw);
|
|
57
|
+
if (fm === null)
|
|
58
|
+
return null;
|
|
59
|
+
if (fields.length === 0)
|
|
60
|
+
return raw;
|
|
61
|
+
const lines = fm.text.split('\n');
|
|
62
|
+
// `fm.text` ends with the newline before the closing `---`, so splitting leaves a
|
|
63
|
+
// trailing empty element; the insert goes immediately before it.
|
|
64
|
+
lines.splice(lines.length - 1, 0, ...fields.map((f) => `${f.name}: ${renderFieldDefault(f.default)}`));
|
|
65
|
+
return `${raw.slice(0, fm.start)}${lines.join('\n')}${raw.slice(fm.end)}`;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Everything the migration would do, computed without writing.
|
|
69
|
+
*
|
|
70
|
+
* The single source of pending-ness. Items are walked in status order and then
|
|
71
|
+
* filename order, so the plan never depends on directory read order.
|
|
72
|
+
*/
|
|
73
|
+
export function planItemFields(ctx) {
|
|
74
|
+
const empty = { notApplicable: null, backfills: [], shapes: [] };
|
|
75
|
+
// The schema is the primary checkout's: items and the rules they are checked
|
|
76
|
+
// against are one fact, so a feature branch must not change what a colleague's
|
|
77
|
+
// items are validated against (AC-3).
|
|
78
|
+
const declared = readItemFields(primaryCheckout(ctx.projectRoot));
|
|
79
|
+
if (declared.kind === 'not-configured')
|
|
80
|
+
return empty;
|
|
81
|
+
if (declared.kind === 'invalid') {
|
|
82
|
+
return { ...empty, notApplicable: `roadmap.item_fields is not usable: ${declared.error}` };
|
|
83
|
+
}
|
|
84
|
+
const fields = declared.fields;
|
|
85
|
+
if (fields.length === 0)
|
|
86
|
+
return empty;
|
|
87
|
+
const backfills = [];
|
|
88
|
+
const shapes = [];
|
|
89
|
+
for (const status of ROADMAP_STATUSES) {
|
|
90
|
+
for (const item of listStatus(ctx.projectRoot, status)) {
|
|
91
|
+
const fm = frontmatter(item.raw);
|
|
92
|
+
// Unparseable frontmatter is roadmap-item-titles' condition, and `listStatus`
|
|
93
|
+
// has already dropped those; this is the belt for the braces.
|
|
94
|
+
if (fm === null)
|
|
95
|
+
continue;
|
|
96
|
+
const { missing, mismatched } = checkItemFrontmatter(fm.data, fields);
|
|
97
|
+
const label = itemLabel(item);
|
|
98
|
+
if (missing.length > 0) {
|
|
99
|
+
const contents = insertFields(item.raw, missing);
|
|
100
|
+
if (contents !== null) {
|
|
101
|
+
backfills.push({ label, file: item.file, fields: missing, contents });
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (mismatched.length > 0) {
|
|
105
|
+
shapes.push({ label, mismatches: mismatched });
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return { notApplicable: null, backfills, shapes };
|
|
110
|
+
}
|
|
111
|
+
function itemLabel(item) {
|
|
112
|
+
return `${item.status}/${item.filename}`;
|
|
113
|
+
}
|
|
114
|
+
/** One-line summary shared by `check` and `apply`. */
|
|
115
|
+
function describe(plan, verb) {
|
|
116
|
+
const named = plan.backfills
|
|
117
|
+
.map((b) => `${b.label} (${b.fields.map((f) => f.name).join(', ')})`)
|
|
118
|
+
.join('; ');
|
|
119
|
+
const count = plan.backfills.reduce((n, b) => n + b.fields.length, 0);
|
|
120
|
+
const suffix = plan.shapes.length > 0
|
|
121
|
+
? `; ${plan.shapes.length} item(s) carry a declared field of the wrong shape and need a human: ${describeShapes(plan)}`
|
|
122
|
+
: '';
|
|
123
|
+
return `${verb} ${count} declared field value(s) to ${plan.backfills.length} roadmap item(s): ${named}${suffix}`;
|
|
124
|
+
}
|
|
125
|
+
function describeShapes(plan) {
|
|
126
|
+
return plan.shapes
|
|
127
|
+
.map((s) => `${s.label} — ${s.mismatches
|
|
128
|
+
.map((m) => `${m.field.name} is ${m.found}, declared as ${m.expected}`)
|
|
129
|
+
.join(', ')}`)
|
|
130
|
+
.join('; ');
|
|
131
|
+
}
|
|
132
|
+
export const roadmapItemFields = {
|
|
133
|
+
id: 'roadmap-item-fields',
|
|
134
|
+
tier: 'confirm',
|
|
135
|
+
check(ctx) {
|
|
136
|
+
const plan = planItemFields(ctx);
|
|
137
|
+
if (plan.notApplicable !== null) {
|
|
138
|
+
return { applicable: false, reason: plan.notApplicable };
|
|
139
|
+
}
|
|
140
|
+
if (plan.backfills.length === 0) {
|
|
141
|
+
if (plan.shapes.length > 0) {
|
|
142
|
+
return {
|
|
143
|
+
applicable: false,
|
|
144
|
+
reason: `${plan.shapes.length} roadmap item(s) carry a project-declared field of the wrong ` +
|
|
145
|
+
'shape. The framework checks presence and shape only, so it will not rewrite a value ' +
|
|
146
|
+
`somebody chose — a human must: ${describeShapes(plan)}`,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
return { applicable: true, pending: false };
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
applicable: true,
|
|
153
|
+
pending: true,
|
|
154
|
+
description: describe(plan, 'would add'),
|
|
155
|
+
// No shell equivalent: this is an in-place insert into a frontmatter block,
|
|
156
|
+
// not a move. Listing the files and fields is the honest version of "the
|
|
157
|
+
// exact commands".
|
|
158
|
+
commands: plan.backfills.map((b) => `edit ${relative(ctx.projectRoot, b.file)} — add ${b.fields
|
|
159
|
+
.map((f) => `${f.name}: ${renderFieldDefault(f.default)}`)
|
|
160
|
+
.join(', ')}`),
|
|
161
|
+
};
|
|
162
|
+
},
|
|
163
|
+
apply(ctx) {
|
|
164
|
+
const plan = planItemFields(ctx);
|
|
165
|
+
for (const backfill of plan.backfills) {
|
|
166
|
+
writeFileSync(backfill.file, backfill.contents, 'utf8');
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
changed: plan.backfills.length > 0,
|
|
170
|
+
summary: plan.backfills.length > 0 ? describe(plan, 'added') : 'no declared fields to add',
|
|
171
|
+
};
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
//# sourceMappingURL=roadmap-item-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roadmap-item-fields.js","sourceRoot":"","sources":["../../../src/doctor/migrations/roadmap-item-fields.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,eAAe,GAEhB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,kBAAkB,GAGnB,MAAM,8BAA8B,CAAC;AAwBtC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW,EAAE,MAAgC;IACxE,MAAM,EAAE,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,EAAE,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC7B,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC;IAEpC,MAAM,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAClC,kFAAkF;IAClF,iEAAiE;IACjE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,kBAAkB,CAAC,CAAC,CAAC,OAAO,CAAC,E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AAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,2BAA2B;SAC3F,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
*/
|
|
25
25
|
import type { Migration } from '../types.js';
|
|
26
26
|
import type { DoctorContext } from '../types.js';
|
|
27
|
+
import { type ItemFieldDecl } from '../../roadmap/item-fields.js';
|
|
27
28
|
import { type RoadmapStatus } from '../../roadmap/paths.js';
|
|
28
29
|
/** One planned relocation, with everything `apply` needs to carry it out. */
|
|
29
30
|
export interface RoadmapMove {
|
|
@@ -57,8 +58,14 @@ export interface RoadmapPlan {
|
|
|
57
58
|
* `author` is deliberately omitted rather than guessed. The legacy format never
|
|
58
59
|
* recorded one, and `created_by` from an unrelated instance is not the author of
|
|
59
60
|
* an idea.
|
|
61
|
+
*
|
|
62
|
+
* Project-declared fields (item-extension-fields/AC-14) are appended with their
|
|
63
|
+
* declared defaults. Legacy ideas predate extension fields by definition, so
|
|
64
|
+
* without this a project that has declared a field and then migrates its old inbox
|
|
65
|
+
* ends up with a directory of items its own check rejects — the migration
|
|
66
|
+
* manufacturing the very failure the feature exists to remove.
|
|
60
67
|
*/
|
|
61
|
-
export declare function rewriteFrontmatter(raw: string, filename: string, status: RoadmapStatus): {
|
|
68
|
+
export declare function rewriteFrontmatter(raw: string, filename: string, status: RoadmapStatus, fields?: readonly ItemFieldDecl[]): {
|
|
62
69
|
contents: string;
|
|
63
70
|
id: string;
|
|
64
71
|
} | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roadmap-layout.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/roadmap-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aA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AC"}
|
|
@@ -28,7 +28,8 @@ import { basename, dirname, join } from 'node:path';
|
|
|
28
28
|
import { parse as parseYaml } from 'yaml';
|
|
29
29
|
import { trackedFiles } from '../git.js';
|
|
30
30
|
import { completionInfo, loadAllTemplates, loadInstance } from '../../metrics/report.js';
|
|
31
|
-
import {
|
|
31
|
+
import { itemFieldsOrEmpty, renderFieldLines } from '../../roadmap/item-fields.js';
|
|
32
|
+
import { ITEM_FILENAME_RE, LEGACY_IDEAS_DIR, ROADMAP_DIR, primaryCheckout, } from '../../roadmap/paths.js';
|
|
32
33
|
/** Map a legacy `status:` value onto a roadmap directory. */
|
|
33
34
|
function targetStatus(legacy, promotedTo, ctx, templates) {
|
|
34
35
|
if (legacy === 'raw')
|
|
@@ -57,8 +58,14 @@ function targetStatus(legacy, promotedTo, ctx, templates) {
|
|
|
57
58
|
* `author` is deliberately omitted rather than guessed. The legacy format never
|
|
58
59
|
* recorded one, and `created_by` from an unrelated instance is not the author of
|
|
59
60
|
* an idea.
|
|
61
|
+
*
|
|
62
|
+
* Project-declared fields (item-extension-fields/AC-14) are appended with their
|
|
63
|
+
* declared defaults. Legacy ideas predate extension fields by definition, so
|
|
64
|
+
* without this a project that has declared a field and then migrates its old inbox
|
|
65
|
+
* ends up with a directory of items its own check rejects — the migration
|
|
66
|
+
* manufacturing the very failure the feature exists to remove.
|
|
60
67
|
*/
|
|
61
|
-
export function rewriteFrontmatter(raw, filename, status) {
|
|
68
|
+
export function rewriteFrontmatter(raw, filename, status, fields = []) {
|
|
62
69
|
const nameMatch = ITEM_FILENAME_RE.exec(filename);
|
|
63
70
|
if (!nameMatch)
|
|
64
71
|
return null;
|
|
@@ -105,6 +112,7 @@ export function rewriteFrontmatter(raw, filename, status) {
|
|
|
105
112
|
`depends_on: [${deps.join(', ')}]`,
|
|
106
113
|
'history:',
|
|
107
114
|
` - { status: ${status}, at: ${createdAt} }`,
|
|
115
|
+
...renderFieldLines(fields),
|
|
108
116
|
'---',
|
|
109
117
|
];
|
|
110
118
|
return { contents: `${lines.join('\n')}\n${body}`, id };
|
|
@@ -121,6 +129,10 @@ export function planRoadmapMoves(ctx) {
|
|
|
121
129
|
return { moves: [], unclassified: [] };
|
|
122
130
|
const templates = loadAllTemplates(ctx.projectRoot);
|
|
123
131
|
const tracked = new Set(trackedFiles(ctx.projectRoot, [LEGACY_IDEAS_DIR]));
|
|
132
|
+
// Legacy ideas live in `.aidlc/ideas/` of this checkout, but the schema is the
|
|
133
|
+
// primary checkout's — `primaryCheckout` of a primary checkout is itself, so the
|
|
134
|
+
// ordinary case is unaffected.
|
|
135
|
+
const declaredFields = itemFieldsOrEmpty(primaryCheckout(ctx.projectRoot)).fields;
|
|
124
136
|
const moves = [];
|
|
125
137
|
const unclassified = [];
|
|
126
138
|
for (const name of readdirSync(legacyDir).sort()) {
|
|
@@ -155,7 +167,7 @@ export function planRoadmapMoves(ctx) {
|
|
|
155
167
|
unclassified.push(fromRel);
|
|
156
168
|
continue;
|
|
157
169
|
}
|
|
158
|
-
const rewritten = rewriteFrontmatter(raw, name, status);
|
|
170
|
+
const rewritten = rewriteFrontmatter(raw, name, status, declaredFields);
|
|
159
171
|
if (rewritten === null) {
|
|
160
172
|
unclassified.push(fromRel);
|
|
161
173
|
continue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roadmap-layout.js","sourceRoot":"","sources":["../../../src/doctor/migrations/roadmap-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,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AK,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,MAAM,qBAAqB,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/F,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC5B,KAAK,CAAC,IAAI,CACR,QAAQ,YAAY,CAAC,MAAM,qCAAqC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAClH,CAAC;QACJ,CAAC;QACD,IAAI,OAAO;YAAE,KAAK,CAAC,IAAI,CAAC,iBAAiB,gBAAgB,EAAE,CAAC,CAAC;QAE7D,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO;YACpC,OAAO,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,iBAAiB;SACjE,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project-declared roadmap item frontmatter fields
|
|
3
|
+
* (item-extension-fields/AC-1 … item-extension-fields/AC-6, AC-16, AC-17).
|
|
4
|
+
*
|
|
5
|
+
* The portable `roadmap-item` skill hands an agent a frontmatter template and one
|
|
6
|
+
* absolute rule — *"Do not add any other field."* A project that has added a field
|
|
7
|
+
* of its own and a check that enforces it cannot be served by that: following the
|
|
8
|
+
* skill produces an item its build rejects, and satisfying the build means
|
|
9
|
+
* disobeying a framework-owned file the project may not edit. The two rules are
|
|
10
|
+
* individually correct and jointly unsatisfiable, and neither side can fix it
|
|
11
|
+
* alone. This module is how a project tells the framework about its field.
|
|
12
|
+
*
|
|
13
|
+
* Two boundaries are drawn deliberately, both inherited from `sync/config.ts`
|
|
14
|
+
* because a second convention for reading one file is how the two come to
|
|
15
|
+
* disagree:
|
|
16
|
+
*
|
|
17
|
+
* - A malformed **container** reads as *not configured*: unparseable YAML,
|
|
18
|
+
* `roadmap` not a mapping, `item_fields` absent. One bad section must never
|
|
19
|
+
* break an unrelated command.
|
|
20
|
+
* - Anything wrong **inside** a well-formed `item_fields` list is a *named
|
|
21
|
+
* refusal*. `required: "yes"` is a mistake somebody made on purpose and wants
|
|
22
|
+
* told about; reading it as "you have not configured this" sends them looking
|
|
23
|
+
* in the wrong place.
|
|
24
|
+
*
|
|
25
|
+
* The section is read from the **primary checkout**, the same tree the items come
|
|
26
|
+
* from. Items and their schema are one fact; reading them from two trees would let
|
|
27
|
+
* a feature branch change what a colleague's items are validated against.
|
|
28
|
+
*
|
|
29
|
+
* The framework validates **presence and shape only** (AC-17). There is no key
|
|
30
|
+
* here that could express a rule about a field's contents, and that absence is the
|
|
31
|
+
* feature: `requirements: [not-a-real-id]` is the project's own script's business,
|
|
32
|
+
* and a framework that adjudicated it would have become a general schema engine —
|
|
33
|
+
* the overreach the roadmap item named as the main way this goes wrong.
|
|
34
|
+
*
|
|
35
|
+
* @module
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* The stock item keys, which a declaration may not shadow.
|
|
39
|
+
*
|
|
40
|
+
* `status` is absent on purpose — it is not merely taken, it is forbidden, and it
|
|
41
|
+
* gets its own refusal below.
|
|
42
|
+
*/
|
|
43
|
+
export declare const RESERVED_ITEM_KEYS: readonly string[];
|
|
44
|
+
/**
|
|
45
|
+
* Legal field names.
|
|
46
|
+
*
|
|
47
|
+
* Conservative on purpose: a YAML key that needs quoting, or one that differs from
|
|
48
|
+
* another only by case, turns a declaration into a debugging session in a file
|
|
49
|
+
* nobody looks at twice.
|
|
50
|
+
*/
|
|
51
|
+
export declare const ITEM_FIELD_NAME_RE: RegExp;
|
|
52
|
+
/** One declared field. */
|
|
53
|
+
export interface ItemFieldDecl {
|
|
54
|
+
name: string;
|
|
55
|
+
/** Default `true` — see the roadmap item: an optional key silently under-reports. */
|
|
56
|
+
required: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Written into new items, and the shape every item's value is checked against.
|
|
59
|
+
*
|
|
60
|
+
* There is no separate `type:` key. The default is already a worked example of
|
|
61
|
+
* the shape, so a second one would be two representations of one fact.
|
|
62
|
+
*/
|
|
63
|
+
default: unknown;
|
|
64
|
+
}
|
|
65
|
+
export type ItemFieldsResult = {
|
|
66
|
+
kind: 'ok';
|
|
67
|
+
fields: ItemFieldDecl[];
|
|
68
|
+
} | {
|
|
69
|
+
kind: 'not-configured';
|
|
70
|
+
} | {
|
|
71
|
+
kind: 'invalid';
|
|
72
|
+
error: string;
|
|
73
|
+
};
|
|
74
|
+
/** Absolute path of a checkout's config file. */
|
|
75
|
+
export declare function itemFieldsConfigPath(root: string): string;
|
|
76
|
+
/**
|
|
77
|
+
* Validate the `item_fields` list.
|
|
78
|
+
*
|
|
79
|
+
* Exported separately from the reader so any writer — `aidlc init`, a future
|
|
80
|
+
* wizard — can check its own answer against the reader's rule rather than
|
|
81
|
+
* reimplementing it. `validateStatuses` is exported for the same reason, after a
|
|
82
|
+
* setup command produced a config its own reader rejected.
|
|
83
|
+
*/
|
|
84
|
+
export declare function validateItemFields(raw: unknown): {
|
|
85
|
+
ok: true;
|
|
86
|
+
fields: ItemFieldDecl[];
|
|
87
|
+
} | {
|
|
88
|
+
ok: false;
|
|
89
|
+
error: string;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Read and validate `roadmap.item_fields`.
|
|
93
|
+
*
|
|
94
|
+
* @param primaryCheckoutRoot - The primary checkout's working tree.
|
|
95
|
+
*/
|
|
96
|
+
export declare function readItemFields(primaryCheckoutRoot: string): ItemFieldsResult;
|
|
97
|
+
/**
|
|
98
|
+
* The shape every *consumer* wants: the fields, plus a warning when the section is
|
|
99
|
+
* there but wrong.
|
|
100
|
+
*
|
|
101
|
+
* An invalid declaration yields no fields and a message, never a throw. A consumer
|
|
102
|
+
* that refused to act would leave the project with no emitted skill at all, which
|
|
103
|
+
* is worse than the contradiction this feature removes; one that acted silently
|
|
104
|
+
* would restore that contradiction. Warning and continuing is the honest middle,
|
|
105
|
+
* and `aidlc doctor` reports the same condition independently.
|
|
106
|
+
*/
|
|
107
|
+
export declare function itemFieldsOrEmpty(primaryCheckoutRoot: string): {
|
|
108
|
+
fields: ItemFieldDecl[];
|
|
109
|
+
warning: string | null;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Serialize a declared default to **exactly one line** of YAML.
|
|
113
|
+
*
|
|
114
|
+
* One line is load-bearing, not cosmetic: every consumer inserts the field as a
|
|
115
|
+
* single frontmatter line, so a block-style collection would break the insertion
|
|
116
|
+
* rather than merely look odd. Hence `collectionStyle: 'flow'`.
|
|
117
|
+
*
|
|
118
|
+
* Strings are quoted unconditionally, the rule `title` follows — a plain scalar
|
|
119
|
+
* may not begin with a reserved indicator character, and the characters that break
|
|
120
|
+
* it are exactly the ones that look harmless.
|
|
121
|
+
*/
|
|
122
|
+
export declare function renderFieldDefault(value: unknown): string;
|
|
123
|
+
/** One `name: <default>` frontmatter line per declared field, in declaration order. */
|
|
124
|
+
export declare function renderFieldLines(fields: readonly ItemFieldDecl[]): string[];
|
|
125
|
+
/**
|
|
126
|
+
* The shape kinds a declared field is checked against.
|
|
127
|
+
*
|
|
128
|
+
* Deliberately coarse. `scalar` lumps string, number and boolean together because
|
|
129
|
+
* a framework that distinguished `1` from `"1"` would be validating contents, not
|
|
130
|
+
* shape.
|
|
131
|
+
*/
|
|
132
|
+
export type FieldShape = 'null' | 'list' | 'mapping' | 'scalar';
|
|
133
|
+
export declare function shapeOf(value: unknown): FieldShape;
|
|
134
|
+
/** One field whose value is the wrong shape. */
|
|
135
|
+
export interface ShapeMismatch {
|
|
136
|
+
field: ItemFieldDecl;
|
|
137
|
+
found: FieldShape;
|
|
138
|
+
expected: FieldShape;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Check one item's parsed frontmatter against the declared fields.
|
|
142
|
+
*
|
|
143
|
+
* Presence and shape, nothing else (AC-17).
|
|
144
|
+
*
|
|
145
|
+
* A field whose default is `null` declares no shape, so only presence is checked —
|
|
146
|
+
* nothing was declared to compare against, and inventing a constraint would be the
|
|
147
|
+
* framework deciding what the project meant.
|
|
148
|
+
*
|
|
149
|
+
* A present-but-`null` value (`requirements:` with nothing after it) is reported as
|
|
150
|
+
* a *mismatch*, not as missing: the key is there, so presence holds, and the value
|
|
151
|
+
* is not the declared shape. It is deliberately not repairable — see the migration.
|
|
152
|
+
*/
|
|
153
|
+
export declare function checkItemFrontmatter(data: Record<string, unknown>, fields: readonly ItemFieldDecl[]): {
|
|
154
|
+
missing: ItemFieldDecl[];
|
|
155
|
+
mismatched: ShapeMismatch[];
|
|
156
|
+
};
|
|
157
|
+
//# sourceMappingURL=item-fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-fields.d.ts","sourceRoot":"","sources":["../../src/roadmap/item-fields.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAMH;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAS/C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,QAAsB,CAAC;AAEtD,0BAA0B;AAC1B,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,qFAAqF;IACrF,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,gBAAgB,GACxB;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,aAAa,EAAE,CAAA;CAAE,GACvC;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE,GAC1B;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvC,iDAAiD;AACjD,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,CAgB3D"}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project-declared roadmap item frontmatter fields
|
|
3
|
+
* (item-extension-fields/AC-1 … item-extension-fields/AC-6, AC-16, AC-17).
|
|
4
|
+
*
|
|
5
|
+
* The portable `roadmap-item` skill hands an agent a frontmatter template and one
|
|
6
|
+
* absolute rule — *"Do not add any other field."* A project that has added a field
|
|
7
|
+
* of its own and a check that enforces it cannot be served by that: following the
|
|
8
|
+
* skill produces an item its build rejects, and satisfying the build means
|
|
9
|
+
* disobeying a framework-owned file the project may not edit. The two rules are
|
|
10
|
+
* individually correct and jointly unsatisfiable, and neither side can fix it
|
|
11
|
+
* alone. This module is how a project tells the framework about its field.
|
|
12
|
+
*
|
|
13
|
+
* Two boundaries are drawn deliberately, both inherited from `sync/config.ts`
|
|
14
|
+
* because a second convention for reading one file is how the two come to
|
|
15
|
+
* disagree:
|
|
16
|
+
*
|
|
17
|
+
* - A malformed **container** reads as *not configured*: unparseable YAML,
|
|
18
|
+
* `roadmap` not a mapping, `item_fields` absent. One bad section must never
|
|
19
|
+
* break an unrelated command.
|
|
20
|
+
* - Anything wrong **inside** a well-formed `item_fields` list is a *named
|
|
21
|
+
* refusal*. `required: "yes"` is a mistake somebody made on purpose and wants
|
|
22
|
+
* told about; reading it as "you have not configured this" sends them looking
|
|
23
|
+
* in the wrong place.
|
|
24
|
+
*
|
|
25
|
+
* The section is read from the **primary checkout**, the same tree the items come
|
|
26
|
+
* from. Items and their schema are one fact; reading them from two trees would let
|
|
27
|
+
* a feature branch change what a colleague's items are validated against.
|
|
28
|
+
*
|
|
29
|
+
* The framework validates **presence and shape only** (AC-17). There is no key
|
|
30
|
+
* here that could express a rule about a field's contents, and that absence is the
|
|
31
|
+
* feature: `requirements: [not-a-real-id]` is the project's own script's business,
|
|
32
|
+
* and a framework that adjudicated it would have become a general schema engine —
|
|
33
|
+
* the overreach the roadmap item named as the main way this goes wrong.
|
|
34
|
+
*
|
|
35
|
+
* @module
|
|
36
|
+
*/
|
|
37
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
38
|
+
import { join } from 'node:path';
|
|
39
|
+
import { parse as parseYaml, stringify as stringifyYaml } from 'yaml';
|
|
40
|
+
/**
|
|
41
|
+
* The stock item keys, which a declaration may not shadow.
|
|
42
|
+
*
|
|
43
|
+
* `status` is absent on purpose — it is not merely taken, it is forbidden, and it
|
|
44
|
+
* gets its own refusal below.
|
|
45
|
+
*/
|
|
46
|
+
export const RESERVED_ITEM_KEYS = [
|
|
47
|
+
'id',
|
|
48
|
+
'title',
|
|
49
|
+
'created_at',
|
|
50
|
+
'author',
|
|
51
|
+
'source',
|
|
52
|
+
'promoted_to',
|
|
53
|
+
'depends_on',
|
|
54
|
+
'history',
|
|
55
|
+
];
|
|
56
|
+
/**
|
|
57
|
+
* Legal field names.
|
|
58
|
+
*
|
|
59
|
+
* Conservative on purpose: a YAML key that needs quoting, or one that differs from
|
|
60
|
+
* another only by case, turns a declaration into a debugging session in a file
|
|
61
|
+
* nobody looks at twice.
|
|
62
|
+
*/
|
|
63
|
+
export const ITEM_FIELD_NAME_RE = /^[a-z][a-z0-9_]*$/;
|
|
64
|
+
/** Absolute path of a checkout's config file. */
|
|
65
|
+
export function itemFieldsConfigPath(root) {
|
|
66
|
+
return join(root, '.aidlc', 'config.yaml');
|
|
67
|
+
}
|
|
68
|
+
/** Describe a value's type for an error message, without printing a whole object. */
|
|
69
|
+
function describe(value) {
|
|
70
|
+
if (value === null)
|
|
71
|
+
return 'null';
|
|
72
|
+
if (Array.isArray(value))
|
|
73
|
+
return 'a list';
|
|
74
|
+
if (typeof value === 'object')
|
|
75
|
+
return 'a mapping';
|
|
76
|
+
return JSON.stringify(value);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Validate the `item_fields` list.
|
|
80
|
+
*
|
|
81
|
+
* Exported separately from the reader so any writer — `aidlc init`, a future
|
|
82
|
+
* wizard — can check its own answer against the reader's rule rather than
|
|
83
|
+
* reimplementing it. `validateStatuses` is exported for the same reason, after a
|
|
84
|
+
* setup command produced a config its own reader rejected.
|
|
85
|
+
*/
|
|
86
|
+
export function validateItemFields(raw) {
|
|
87
|
+
if (!Array.isArray(raw)) {
|
|
88
|
+
return {
|
|
89
|
+
ok: false,
|
|
90
|
+
error: `roadmap.item_fields must be a list of field declarations, got ${describe(raw)}`,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
const fields = [];
|
|
94
|
+
const seen = new Set();
|
|
95
|
+
for (const [index, entry] of raw.entries()) {
|
|
96
|
+
const at = `roadmap.item_fields[${index}]`;
|
|
97
|
+
if (typeof entry !== 'object' || entry === null || Array.isArray(entry)) {
|
|
98
|
+
return { ok: false, error: `${at} must be a mapping with a \`name\`, got ${describe(entry)}` };
|
|
99
|
+
}
|
|
100
|
+
const e = entry;
|
|
101
|
+
if (typeof e.name !== 'string' || e.name.length === 0) {
|
|
102
|
+
return { ok: false, error: `${at}.name is required and must be a string, got ${describe(e.name)}` };
|
|
103
|
+
}
|
|
104
|
+
const name = e.name;
|
|
105
|
+
if (name === 'status') {
|
|
106
|
+
return {
|
|
107
|
+
ok: false,
|
|
108
|
+
error: `${at}.name is \`status\`, which no item may carry. An item's status is the ` +
|
|
109
|
+
'directory it sits in — two representations of one fact drift apart, and a wrong ' +
|
|
110
|
+
'status is indistinguishable from a right one.',
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
if (RESERVED_ITEM_KEYS.includes(name)) {
|
|
114
|
+
return {
|
|
115
|
+
ok: false,
|
|
116
|
+
error: `${at}.name is \`${name}\`, which is one of the stock item fields (${RESERVED_ITEM_KEYS.join(', ')})`,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
if (!ITEM_FIELD_NAME_RE.test(name)) {
|
|
120
|
+
return {
|
|
121
|
+
ok: false,
|
|
122
|
+
error: `${at}.name ${JSON.stringify(name)} must start with a lowercase letter and contain ` +
|
|
123
|
+
'only lowercase letters, digits and underscores',
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
if (seen.has(name)) {
|
|
127
|
+
return { ok: false, error: `roadmap.item_fields declares \`${name}\` more than once` };
|
|
128
|
+
}
|
|
129
|
+
seen.add(name);
|
|
130
|
+
if (e.required !== undefined && typeof e.required !== 'boolean') {
|
|
131
|
+
return { ok: false, error: `${at}.required must be true or false, got ${describe(e.required)}` };
|
|
132
|
+
}
|
|
133
|
+
fields.push({
|
|
134
|
+
name,
|
|
135
|
+
required: e.required === undefined ? true : e.required,
|
|
136
|
+
default: e.default === undefined ? null : e.default,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
return { ok: true, fields };
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Read and validate `roadmap.item_fields`.
|
|
143
|
+
*
|
|
144
|
+
* @param primaryCheckoutRoot - The primary checkout's working tree.
|
|
145
|
+
*/
|
|
146
|
+
export function readItemFields(primaryCheckoutRoot) {
|
|
147
|
+
const path = itemFieldsConfigPath(primaryCheckoutRoot);
|
|
148
|
+
if (!existsSync(path))
|
|
149
|
+
return { kind: 'not-configured' };
|
|
150
|
+
let doc;
|
|
151
|
+
try {
|
|
152
|
+
const parsed = parseYaml(readFileSync(path, 'utf8'));
|
|
153
|
+
if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
|
|
154
|
+
return { kind: 'not-configured' };
|
|
155
|
+
}
|
|
156
|
+
doc = parsed;
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
return { kind: 'not-configured' };
|
|
160
|
+
}
|
|
161
|
+
const roadmap = doc.roadmap;
|
|
162
|
+
if (typeof roadmap !== 'object' || roadmap === null || Array.isArray(roadmap)) {
|
|
163
|
+
return { kind: 'not-configured' };
|
|
164
|
+
}
|
|
165
|
+
const raw = roadmap.item_fields;
|
|
166
|
+
if (raw === undefined)
|
|
167
|
+
return { kind: 'not-configured' };
|
|
168
|
+
const checked = validateItemFields(raw);
|
|
169
|
+
if (!checked.ok)
|
|
170
|
+
return { kind: 'invalid', error: checked.error };
|
|
171
|
+
return { kind: 'ok', fields: checked.fields };
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* The shape every *consumer* wants: the fields, plus a warning when the section is
|
|
175
|
+
* there but wrong.
|
|
176
|
+
*
|
|
177
|
+
* An invalid declaration yields no fields and a message, never a throw. A consumer
|
|
178
|
+
* that refused to act would leave the project with no emitted skill at all, which
|
|
179
|
+
* is worse than the contradiction this feature removes; one that acted silently
|
|
180
|
+
* would restore that contradiction. Warning and continuing is the honest middle,
|
|
181
|
+
* and `aidlc doctor` reports the same condition independently.
|
|
182
|
+
*/
|
|
183
|
+
export function itemFieldsOrEmpty(primaryCheckoutRoot) {
|
|
184
|
+
const result = readItemFields(primaryCheckoutRoot);
|
|
185
|
+
if (result.kind === 'ok')
|
|
186
|
+
return { fields: result.fields, warning: null };
|
|
187
|
+
if (result.kind === 'invalid') {
|
|
188
|
+
return {
|
|
189
|
+
fields: [],
|
|
190
|
+
warning: `roadmap.item_fields is ignored: ${result.error}`,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
return { fields: [], warning: null };
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Serialize a declared default to **exactly one line** of YAML.
|
|
197
|
+
*
|
|
198
|
+
* One line is load-bearing, not cosmetic: every consumer inserts the field as a
|
|
199
|
+
* single frontmatter line, so a block-style collection would break the insertion
|
|
200
|
+
* rather than merely look odd. Hence `collectionStyle: 'flow'`.
|
|
201
|
+
*
|
|
202
|
+
* Strings are quoted unconditionally, the rule `title` follows — a plain scalar
|
|
203
|
+
* may not begin with a reserved indicator character, and the characters that break
|
|
204
|
+
* it are exactly the ones that look harmless.
|
|
205
|
+
*/
|
|
206
|
+
export function renderFieldDefault(value) {
|
|
207
|
+
if (value === null || value === undefined)
|
|
208
|
+
return 'null';
|
|
209
|
+
if (typeof value === 'string')
|
|
210
|
+
return JSON.stringify(value);
|
|
211
|
+
if (typeof value === 'number' || typeof value === 'boolean')
|
|
212
|
+
return String(value);
|
|
213
|
+
return stringifyYaml(value, { collectionStyle: 'flow', flowCollectionPadding: false }).trim();
|
|
214
|
+
}
|
|
215
|
+
/** One `name: <default>` frontmatter line per declared field, in declaration order. */
|
|
216
|
+
export function renderFieldLines(fields) {
|
|
217
|
+
return fields.map((f) => `${f.name}: ${renderFieldDefault(f.default)}`);
|
|
218
|
+
}
|
|
219
|
+
export function shapeOf(value) {
|
|
220
|
+
if (value === null || value === undefined)
|
|
221
|
+
return 'null';
|
|
222
|
+
if (Array.isArray(value))
|
|
223
|
+
return 'list';
|
|
224
|
+
if (typeof value === 'object')
|
|
225
|
+
return 'mapping';
|
|
226
|
+
return 'scalar';
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Check one item's parsed frontmatter against the declared fields.
|
|
230
|
+
*
|
|
231
|
+
* Presence and shape, nothing else (AC-17).
|
|
232
|
+
*
|
|
233
|
+
* A field whose default is `null` declares no shape, so only presence is checked —
|
|
234
|
+
* nothing was declared to compare against, and inventing a constraint would be the
|
|
235
|
+
* framework deciding what the project meant.
|
|
236
|
+
*
|
|
237
|
+
* A present-but-`null` value (`requirements:` with nothing after it) is reported as
|
|
238
|
+
* a *mismatch*, not as missing: the key is there, so presence holds, and the value
|
|
239
|
+
* is not the declared shape. It is deliberately not repairable — see the migration.
|
|
240
|
+
*/
|
|
241
|
+
export function checkItemFrontmatter(data, fields) {
|
|
242
|
+
const missing = [];
|
|
243
|
+
const mismatched = [];
|
|
244
|
+
for (const field of fields) {
|
|
245
|
+
if (!(field.name in data)) {
|
|
246
|
+
if (field.required)
|
|
247
|
+
missing.push(field);
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
const expected = shapeOf(field.default);
|
|
251
|
+
if (expected === 'null')
|
|
252
|
+
continue;
|
|
253
|
+
const found = shapeOf(data[field.name]);
|
|
254
|
+
if (found !== expected)
|
|
255
|
+
mismatched.push({ field, found, expected });
|
|
256
|
+
}
|
|
257
|
+
return { missing, mismatched };
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=item-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-fields.js","sourceRoot":"","sources":["../../src/roadmap/item-fields.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;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,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD,IAAI;IACJ,OAAO;IACP,YAAY;IACZ,QAAQ;IACR,QAAQ;IACR,aAAa;IACb,YAAY;IACZ,SAAS;CACV,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAqBtD,iDAAiD;AACjD,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,OAAO,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC;AAC7C,CAAC;AAED,qFAAqF;AACrF,SAAS,QAAQ,CAAC,KAAc;IAC9B,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC;IAClC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,WAAW,CAAC;IAClD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAChC,GAAY;IAEZ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB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K,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,MAAM,CAAC;IACxC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAChD,OAAO,QAAQ,CAAC;AAClB,CAAC;AASD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,oBAAoB,CAClC,IAA6B,EAC7B,MAAgC;IAEhC,MAAM,OAAO,GAAoB,EAAE,CAAC;IACpC,MAAM,UAAU,GAAoB,EAAE,CAAC;IAEvC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,CAAC;YAC1B,IAAI,KAAK,CAAC,QAAQ;gBAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACxC,SAAS;QACX,CAAC;QACD,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACxC,IAAI,QAAQ,KAAK,MAAM;YAAE,SAAS;QAClC,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QACxC,IAAI,KAAK,KAAK,QAAQ;YAAE,UAAU,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AACjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../../src/roadmap/sync/import.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAYH,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../../src/roadmap/sync/import.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAYH,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGnD,qDAAqD;AACrD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,GAC1D;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvC,oDAAoD;AACpD,eAAO,MAAM,oBAAoB,mBAAmB,CAAC;AAKrD;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CA2B5D;AAQD,2DAA2D;AAC3D,wBAAgB,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAElD;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CA8B7D;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAYnE;AAuBD,sCAAsC;AACtC,wBAAgB,WAAW,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,YAAY,CAoDhF"}
|
|
@@ -20,6 +20,7 @@ import { existsSync, readFileSync, readdirSync, writeFileSync } from 'node:fs';
|
|
|
20
20
|
import { join, resolve, sep } from 'node:path';
|
|
21
21
|
import { ITEM_FILENAME_RE, ROADMAP_STATUSES, isoDate, primaryCheckout, statusDir, } from '../paths.js';
|
|
22
22
|
import { firstLine } from './gh.js';
|
|
23
|
+
import { itemFieldsOrEmpty, renderFieldLines } from '../item-fields.js';
|
|
23
24
|
/** Slug used when a title yields nothing usable. */
|
|
24
25
|
export const FALLBACK_SLUG_PREFIX = 'imported-issue';
|
|
25
26
|
/** Keeps filenames reasonable; `ITEM_FILENAME_RE` imposes no length limit itself. */
|
|
@@ -197,7 +198,11 @@ export function importIssue(gh, cwd, url) {
|
|
|
197
198
|
if (!ITEM_FILENAME_RE.test(filename)) {
|
|
198
199
|
return { kind: 'refused', error: `derived filename ${filename} is not a valid roadmap item name` };
|
|
199
200
|
}
|
|
200
|
-
|
|
201
|
+
// An imported item that omits the project's declared fields is born failing the
|
|
202
|
+
// project's own gate (item-extension-fields/AC-13). Read from the primary
|
|
203
|
+
// checkout, the tree `root` already resolves to.
|
|
204
|
+
const declared = itemFieldsOrEmpty(root).fields;
|
|
205
|
+
writeFileSync(target, renderItem(read.issue, coord, compact, slug, date, declared), 'utf8');
|
|
201
206
|
return { kind: 'written', path: target };
|
|
202
207
|
}
|
|
203
208
|
/**
|
|
@@ -224,8 +229,13 @@ function uniqueFilename(root, compact, slug) {
|
|
|
224
229
|
* warns that a summary drafted before the detail "is a guess wearing a summary's clothes";
|
|
225
230
|
* filling six labels from an issue nobody has triaged would be exactly that. Triage is
|
|
226
231
|
* where they get answered.
|
|
232
|
+
*
|
|
233
|
+
* Declared fields go **last**, after `history`, matching the order the portable skill's
|
|
234
|
+
* template emits them in. Their values are the project's declared defaults: this writer
|
|
235
|
+
* knows nothing about what they mean, and the default is the one value the project has
|
|
236
|
+
* said is acceptable when nothing better is known.
|
|
227
237
|
*/
|
|
228
|
-
function renderItem(issue, coord, compact, slug, date) {
|
|
238
|
+
function renderItem(issue, coord, compact, slug, date, fields = []) {
|
|
229
239
|
const id = `item-${compact}-${slug}`;
|
|
230
240
|
return [
|
|
231
241
|
'---',
|
|
@@ -238,6 +248,7 @@ function renderItem(issue, coord, compact, slug, date) {
|
|
|
238
248
|
'depends_on: []',
|
|
239
249
|
'history:',
|
|
240
250
|
` - { status: inbox, at: ${date} }`,
|
|
251
|
+
...renderFieldLines(fields),
|
|
241
252
|
'---',
|
|
242
253
|
'',
|
|
243
254
|
`# Idea: ${issue.title}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import.js","sourceRoot":"","sources":["../../../src/roadmap/sync/import.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,OAAO,EACP,eAAe,EACf,SAAS,GACV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAiB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"import.js","sourceRoot":"","sources":["../../../src/roadmap/sync/import.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,OAAO,EACP,eAAe,EACf,SAAS,GACV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAiB,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAsB,MAAM,mBAAmB,CAAC;AAe5F,oDAAoD;AACpD,MAAM,CAAC,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;AAErD,qFAAqF;AACrF,MAAM,eAAe,GAAG,EAAE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2
2
|
"name": "@rasensio/aidlc",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.31.0",
|
|
4
4
|
"description": "AI Development Lifecycle Framework — structured lifecycle guidance for AI coding agents across platforms",
|
|
5
5
|
"homepage": "https://aidlc.rodrigoasensio.com",
|
|
6
6
|
"repository": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"commander": "15.0.0",
|
|
32
32
|
"picomatch": "4.0.5",
|
|
33
33
|
"yaml": "2.9.0",
|
|
34
|
-
"@rasensio/aidlc-content": "1.
|
|
34
|
+
"@rasensio/aidlc-content": "1.31.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "22.15.32",
|