@rasensio/aidlc 1.29.2 → 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/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +12 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +13 -0
- package/dist/commands/update.js.map +1 -1
- package/dist/compile/question-rendering.d.ts +83 -0
- package/dist/compile/question-rendering.d.ts.map +1 -0
- package/dist/compile/question-rendering.js +177 -0
- package/dist/compile/question-rendering.js.map +1 -0
- 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
|
@@ -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;AAC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GAAG,SAAS,GAAG,QAAQ,CAAC;AAEhE,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAKlD;AAED,gDAAgD;AAChD,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,aAAa,CAAC;IACrB,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,EAAE,UAAU,CAAC;CACtB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,MAAM,EAAE,SAAS,aAAa,EAAE,GAC/B;IAAE,OAAO,EAAE,aAAa,EAAE,CAAC;IAAC,UAAU,EAAE,aAAa,EAAE,CAAA;CAAE,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,CA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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,Y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AAwC;QACxC,yCAAyC;QACzC,EAAE;QACF,iBAAiB,KAAK,CAAC,GAAG,OAAO,IAAI,+CAA+C;QACpF,mFAAmF;QACnF,wCAAwC;QACxC,EAAE;QACF,WAAW;QACX,EAAE;QACF,gBAAgB,KAAK,CAAC,GAAG,EAAE;QAC3B,qBAAqB,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE;QAChD,kBAAkB,KAAK,CAAC,MAAM,EAAE;QAChC,EAAE;QACF,sFAAsF;QACtF,4CAA4C;QAC5C,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
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",
|