nimai-core 0.4.8 → 0.5.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/data/FORGE-quickref.md +326 -0
- package/data/nimai-spec-full.md +63 -0
- package/data/nimai-spec-lite.md +39 -0
- package/dist/forge-root.d.ts +2 -0
- package/dist/forge-root.d.ts.map +1 -0
- package/dist/forge-root.js +61 -0
- package/dist/forge-root.js.map +1 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/lint.d.ts.map +1 -1
- package/dist/lint.js +88 -311
- package/dist/lint.js.map +1 -1
- package/dist/prompts.d.ts +18 -8
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +108 -53
- package/dist/prompts.js.map +1 -1
- package/dist/template.d.ts +12 -1
- package/dist/template.d.ts.map +1 -1
- package/dist/template.js +32 -0
- package/dist/template.js.map +1 -1
- package/dist/types.d.ts +3 -7
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -2
- package/dist/clarification.d.ts +0 -22
- package/dist/clarification.d.ts.map +0 -1
- package/dist/clarification.js +0 -106
- package/dist/clarification.js.map +0 -1
- package/dist/context.d.ts +0 -3
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js +0 -186
- package/dist/context.js.map +0 -1
package/dist/lint.js
CHANGED
|
@@ -36,329 +36,62 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.lintSpec = lintSpec;
|
|
37
37
|
exports.lintContent = lintContent;
|
|
38
38
|
const fs = __importStar(require("fs"));
|
|
39
|
+
const template_1 = require("./template");
|
|
39
40
|
// Matches unfilled placeholder fields: ___ (3 or more underscores)
|
|
40
|
-
const
|
|
41
|
+
const BLANK_PLACEHOLDER_RE = /_{3,}/;
|
|
41
42
|
// Matches [NEEDS HUMAN INPUT...] flags
|
|
42
43
|
const NHFI_RE = /\[NEEDS HUMAN INPUT/i;
|
|
43
|
-
// Matches
|
|
44
|
-
const
|
|
45
|
-
//
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const UNRESOLVED_INLINE_RE = /(?:(?:e\.g\.|such as|for example)\s+\w[^\n.;]*\bor\b|\b(?:could|might)\s+(?:use|implement|be\s+(?:used|implemented?))\s+\w[^\n.;]*\bor\b)/i;
|
|
54
|
-
// Headings that introduce critical sections where a single mechanism must be chosen.
|
|
55
|
-
// No trailing \b so that plurals/suffixes like "Constraints", "Implementation", "Tasks" all match.
|
|
56
|
-
const CRITICAL_SECTION_RE = /\b(?:deliverable|scope|constraints?|must|sub-?tasks?|tasks?|implement\w*|pipeline|mechanism|architect\w*|approach)/i;
|
|
57
|
-
const HEADING_LINE_RE = /^#{1,6}\s+(.+)/;
|
|
58
|
-
const UNRESOLVED_ARCH_VALUE_RE = /(?:_{3,}|\bTBD\b)/i;
|
|
59
|
-
/** Return 1-based line numbers where unresolved mechanism patterns are found. */
|
|
60
|
-
function detectUnresolvedMechanisms(lines) {
|
|
61
|
-
const matches = [];
|
|
62
|
-
let inCritical = false;
|
|
63
|
-
for (let i = 0; i < lines.length; i++) {
|
|
64
|
-
const headingMatch = lines[i].match(HEADING_LINE_RE);
|
|
65
|
-
if (headingMatch) {
|
|
66
|
-
inCritical = CRITICAL_SECTION_RE.test(headingMatch[1]);
|
|
67
|
-
continue;
|
|
68
|
-
}
|
|
69
|
-
// Pattern A: parenthetical "(e.g., X or Y)" — high enough confidence to flag anywhere
|
|
70
|
-
if (UNRESOLVED_PAREN_RE.test(lines[i])) {
|
|
71
|
-
matches.push(i + 1);
|
|
72
|
-
continue;
|
|
73
|
-
}
|
|
74
|
-
// Pattern B: inline options — only inside critical sections to avoid prose false-positives
|
|
75
|
-
if (inCritical && UNRESOLVED_INLINE_RE.test(lines[i])) {
|
|
76
|
-
matches.push(i + 1);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return matches;
|
|
80
|
-
}
|
|
81
|
-
// Required top-level sections (by heading text, case-insensitive)
|
|
82
|
-
const REQUIRED_SECTIONS = [
|
|
83
|
-
'pre-flight',
|
|
84
|
-
'specification layer',
|
|
85
|
-
'intent layer',
|
|
86
|
-
'context layer',
|
|
87
|
-
'prompt layer',
|
|
88
|
-
'governance & validation',
|
|
44
|
+
// Matches the nimai-spec marker (with or without tier attribute)
|
|
45
|
+
const NIMAI_MARKER_RE = /<!--\s*nimai-spec(?:\s+tier=(lite|full))?\s*-->/;
|
|
46
|
+
// ─── Required sections per tier ─────────────────────────────────────────────
|
|
47
|
+
// Headings are matched literally against these exact strings.
|
|
48
|
+
const LITE_REQUIRED_SECTIONS = [
|
|
49
|
+
'Deliverable',
|
|
50
|
+
'Scope',
|
|
51
|
+
'Acceptance Criteria',
|
|
52
|
+
'Mechanism Decisions',
|
|
53
|
+
'Spec Convergence',
|
|
89
54
|
];
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
type: 'missing_module_boundary',
|
|
97
|
-
keywords: ['module boundary', 'package boundary', 'layer boundary', 'separation of concerns', 'packages/core', 'packages/mcp', 'packages/cli', 'app/models', 'app/state', 'app/db'],
|
|
98
|
-
message: 'No module boundary definition found — document package/layer boundaries and which layers may not import each other',
|
|
99
|
-
hardFailTiers: ['medium', 'high'],
|
|
100
|
-
codingOnly: true,
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
type: 'missing_interface_contract',
|
|
104
|
-
keywords: ['interface contract', 'api contract', 'tool schema', 'modeladapter', 'input schema', 'output shape', 'zod'],
|
|
105
|
-
message: 'No interface contract found — consider documenting API/tool schemas or interfaces',
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
type: 'missing_non_goals',
|
|
109
|
-
keywords: ['non-goal', 'non-goals', 'must-not', 'scope — out', 'out of scope', 'deferred', 'excluded'],
|
|
110
|
-
message: 'No non-goals or out-of-scope section found — document what this spec explicitly excludes',
|
|
111
|
-
hardFailTiers: ['medium', 'high'],
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
type: 'missing_change_surface',
|
|
115
|
-
keywords: ['change surface', 'breaking change', 'migration', 'backward compat', 'semver', 'versioning', 'deprecat'],
|
|
116
|
-
message: 'No change surface documentation found — document compatibility expectations and what this spec must not break',
|
|
117
|
-
hardFailTiers: ['medium', 'high'],
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
type: 'missing_dependency_direction',
|
|
121
|
-
keywords: ['dependency direction', 'may not import', 'must not import', 'import from', 'no cross-layer', 'dependency rule', 'import rule'],
|
|
122
|
-
message: 'No dependency direction rules found — document which modules/layers may import which (prevents circular and cross-layer dependencies)',
|
|
123
|
-
hardFailTiers: ['medium', 'high'],
|
|
124
|
-
codingOnly: true,
|
|
125
|
-
skipAdvisoryForTiers: ['low', 'unknown'],
|
|
126
|
-
},
|
|
55
|
+
const FULL_REQUIRED_SECTIONS = [
|
|
56
|
+
...LITE_REQUIRED_SECTIONS,
|
|
57
|
+
'Task Decomposition',
|
|
58
|
+
'Architecture Lock',
|
|
59
|
+
'Change Surface',
|
|
60
|
+
'Edge Cases and Failure Modes',
|
|
127
61
|
];
|
|
128
|
-
function lintSpec(filePath) {
|
|
129
|
-
let content;
|
|
130
|
-
try {
|
|
131
|
-
content = fs.readFileSync(filePath, 'utf-8');
|
|
132
|
-
}
|
|
133
|
-
catch (err) {
|
|
134
|
-
throw new Error(`Cannot read spec at "${filePath}": ${err.message}`);
|
|
135
|
-
}
|
|
136
|
-
return lintContent(content);
|
|
137
|
-
}
|
|
138
|
-
/** Detect risk tier from checked checkbox in spec content */
|
|
139
|
-
function detectRiskTier(content) {
|
|
140
|
-
if (/\[x\]\s*high/i.test(content))
|
|
141
|
-
return 'high';
|
|
142
|
-
if (/\[x\]\s*medium/i.test(content))
|
|
143
|
-
return 'medium';
|
|
144
|
-
if (/\[x\]\s*low/i.test(content))
|
|
145
|
-
return 'low';
|
|
146
|
-
return 'unknown';
|
|
147
|
-
}
|
|
148
|
-
/** Detect if this is a coding/tooling/server spec (vs docs/research/strategy) */
|
|
149
|
-
function isCodingSpec(content) {
|
|
150
|
-
const lower = content.toLowerCase();
|
|
151
|
-
return (lower.includes('if coding') ||
|
|
152
|
-
lower.includes('language / framework') ||
|
|
153
|
-
lower.includes('language/framework') ||
|
|
154
|
-
lower.includes('test coverage expectation') ||
|
|
155
|
-
lower.includes('performance targets'));
|
|
156
|
-
}
|
|
157
|
-
function lintContent(content) {
|
|
158
|
-
const issues = [];
|
|
159
|
-
const lines = content.split('\n');
|
|
160
|
-
for (let i = 0; i < lines.length; i++) {
|
|
161
|
-
const line = lines[i];
|
|
162
|
-
const lineNum = i + 1;
|
|
163
|
-
if (BLANK_FIELD_RE.test(line)) {
|
|
164
|
-
issues.push(issue(lineNum, 'blank_field', `Unfilled placeholder on line ${lineNum}`));
|
|
165
|
-
}
|
|
166
|
-
if (NHFI_RE.test(line)) {
|
|
167
|
-
issues.push(issue(lineNum, 'needs_human_input', `Unresolved [NEEDS HUMAN INPUT] flag on line ${lineNum}`));
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
// Pre-checked acceptance criteria — hard fail: ACs must be unchecked in a draft spec
|
|
171
|
-
if (PRE_CHECKED_AC_RE.test(content)) {
|
|
172
|
-
const matchLines = lines.reduce((acc, l, i) => {
|
|
173
|
-
if (/^[-*]\s+\[x\]/i.test(l))
|
|
174
|
-
acc.push(i + 1);
|
|
175
|
-
return acc;
|
|
176
|
-
}, []);
|
|
177
|
-
for (const lineNum of matchLines) {
|
|
178
|
-
issues.push(issue(lineNum, 'pre_checked_ac', `Pre-checked list item on line ${lineNum} — acceptance criteria must be unchecked ([ ]) in a draft spec`));
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
const lower = content.toLowerCase();
|
|
182
|
-
for (const section of REQUIRED_SECTIONS) {
|
|
183
|
-
if (!lower.includes(section)) {
|
|
184
|
-
issues.push(issue(0, 'missing_section', `Required section missing: "${section}"`));
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
// Missing nimai-spec marker — advisory: spec was not created or registered by nimai
|
|
188
|
-
if (!NIMAI_MARKER_RE.test(content)) {
|
|
189
|
-
issues.push(advisoryIssue(0, 'missing_marker', 'No <!-- nimai-spec --> marker found — add it so nimai can discover this spec automatically (nimai new stamps it)'));
|
|
190
|
-
}
|
|
191
|
-
// Unresolved mechanism — spec offers options instead of committing to one path.
|
|
192
|
-
// Hard-fail for medium/high risk specs; advisory for low/unknown.
|
|
193
|
-
const riskTier = detectRiskTier(content);
|
|
194
|
-
const coding = isCodingSpec(content);
|
|
195
|
-
const unresolvedMatches = detectUnresolvedMechanisms(lines);
|
|
196
|
-
for (const lineNum of unresolvedMatches) {
|
|
197
|
-
const isHard = riskTier === 'medium' || riskTier === 'high';
|
|
198
|
-
const msg = `Unresolved mechanism on line ${lineNum} — spec must commit to a single implementation path, not offer options (e.g. "e.g., X or Y")`;
|
|
199
|
-
issues.push(isHard
|
|
200
|
-
? issue(lineNum, 'unresolved_mechanism', msg)
|
|
201
|
-
: advisoryIssue(lineNum, 'unresolved_mechanism', msg));
|
|
202
|
-
}
|
|
203
|
-
// Mechanism Decision section — deterministic contract lock
|
|
204
|
-
issues.push(...mechanismDecisionIssues(content, lines, riskTier));
|
|
205
|
-
// Spec Convergence section — GO gate: zero open questions, zero ambiguities
|
|
206
|
-
issues.push(...convergenceIssues(content, lines, riskTier));
|
|
207
|
-
// Architecture Lock section — process-level architecture completeness gate
|
|
208
|
-
issues.push(...architectureLockIssues(lines, riskTier, coding));
|
|
209
|
-
// Edge Cases and Failure Modes — adversarial gap check (Option 3)
|
|
210
|
-
issues.push(...edgeCasesIssues(lines, riskTier));
|
|
211
|
-
for (const rule of ADVISORY_RULES) {
|
|
212
|
-
const found = rule.keywords.some(kw => lower.includes(kw.toLowerCase()));
|
|
213
|
-
if (!found) {
|
|
214
|
-
const shouldHardFail = rule.hardFailTiers !== undefined &&
|
|
215
|
-
rule.hardFailTiers.includes(riskTier) &&
|
|
216
|
-
(!rule.codingOnly || coding);
|
|
217
|
-
if (shouldHardFail) {
|
|
218
|
-
issues.push(issue(0, rule.type, `${rule.message} [required for ${riskTier}-risk${rule.codingOnly ? ' coding' : ''} specs]`));
|
|
219
|
-
}
|
|
220
|
-
else if (!rule.skipAdvisoryForTiers?.includes(riskTier)) {
|
|
221
|
-
issues.push(advisoryIssue(0, rule.type, rule.message));
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
return issues;
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Validate the Architecture Lock section contract.
|
|
229
|
-
* - For medium/high coding specs: missing section or unresolved field is hard fail.
|
|
230
|
-
* - For low/unknown/non-coding specs: advisory only.
|
|
231
|
-
* - Unresolved values include blank, placeholder underscores, or "TBD".
|
|
232
|
-
*/
|
|
233
|
-
function architectureLockIssues(lines, riskTier, coding) {
|
|
234
|
-
const result = [];
|
|
235
|
-
const requiresHardFail = coding && (riskTier === 'medium' || riskTier === 'high');
|
|
236
|
-
const startIdx = lines.findIndex(l => /^#{1,3}\s+.*architecture\s*lock/i.test(l));
|
|
237
|
-
if (startIdx === -1) {
|
|
238
|
-
const msg = 'No "Architecture Lock" section found — add "## 1.6 Architecture Lock" with all required architecture fields before builder handoff';
|
|
239
|
-
result.push(requiresHardFail ? issue(0, 'missing_architecture_lock', msg) : advisoryIssue(0, 'missing_architecture_lock', msg));
|
|
240
|
-
return result;
|
|
241
|
-
}
|
|
242
|
-
const headingLevel = (lines[startIdx].match(/^(#{1,6})/) ?? ['', '#'])[1].length;
|
|
243
|
-
let endIdx = lines.length;
|
|
244
|
-
for (let i = startIdx + 1; i < lines.length; i++) {
|
|
245
|
-
const m = lines[i].match(/^(#{1,6})\s+/);
|
|
246
|
-
if (m && m[1].length <= headingLevel) {
|
|
247
|
-
endIdx = i;
|
|
248
|
-
break;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
const sectionLines = lines.slice(startIdx, endIdx);
|
|
252
|
-
const REQUIRED_FIELDS = [
|
|
253
|
-
{ label: 'Persistence layer', keys: ['persistence layer:'] },
|
|
254
|
-
{ label: 'File/object storage', keys: ['file/object storage:', 'file / object storage:'] },
|
|
255
|
-
{ label: 'External model/service + env var', keys: ['external model/service + env var:', 'external model / service + env var:'] },
|
|
256
|
-
{ label: 'API trigger flow', keys: ['api trigger flow:'] },
|
|
257
|
-
{ label: 'Entity status state machine', keys: ['entity status state machine:'] },
|
|
258
|
-
{ label: 'Auth implementation', keys: ['auth implementation:'] },
|
|
259
|
-
];
|
|
260
|
-
for (const field of REQUIRED_FIELDS) {
|
|
261
|
-
const localIdx = sectionLines.findIndex((line) => {
|
|
262
|
-
const lower = line.trim().toLowerCase();
|
|
263
|
-
return field.keys.some((k) => lower.startsWith(k));
|
|
264
|
-
});
|
|
265
|
-
if (localIdx === -1) {
|
|
266
|
-
const msg = `Architecture Lock is missing required field "${field.label}:"`;
|
|
267
|
-
result.push(requiresHardFail ? issue(startIdx + 1, 'missing_architecture_lock', msg) : advisoryIssue(startIdx + 1, 'missing_architecture_lock', msg));
|
|
268
|
-
continue;
|
|
269
|
-
}
|
|
270
|
-
const absLine = startIdx + localIdx + 1;
|
|
271
|
-
const value = sectionLines[localIdx].slice(sectionLines[localIdx].indexOf(':') + 1).trim();
|
|
272
|
-
if (!value || UNRESOLVED_ARCH_VALUE_RE.test(value)) {
|
|
273
|
-
const msg = `Architecture Lock field "${field.label}" on line ${absLine} is unresolved (blank/placeholder/TBD)`;
|
|
274
|
-
result.push(requiresHardFail ? issue(absLine, 'missing_architecture_lock', msg) : advisoryIssue(absLine, 'missing_architecture_lock', msg));
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
return result;
|
|
278
|
-
}
|
|
279
62
|
/**
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
* - If present: all four required fields must be non-blank; "Chosen approach" must not contain
|
|
283
|
-
* option language. Validation is scoped to the section, not the whole file.
|
|
63
|
+
* The pre_checked_ac rule fires only on "- [x]" items inside the
|
|
64
|
+
* Acceptance Criteria and Task Decomposition sections — not globally.
|
|
284
65
|
*/
|
|
285
|
-
function
|
|
66
|
+
function findPreCheckedAcsInScope(lines) {
|
|
286
67
|
const result = [];
|
|
287
|
-
const
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
const
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
}
|
|
294
|
-
// Determine section end: next heading at same or higher level (fewer #s), or EOF
|
|
295
|
-
const headingLevel = (lines[sectionStartIdx].match(/^(#{1,6})/) ?? ['', '#'])[1].length;
|
|
296
|
-
let sectionEndIdx = lines.length;
|
|
297
|
-
for (let i = sectionStartIdx + 1; i < lines.length; i++) {
|
|
298
|
-
const m = lines[i].match(/^(#{1,6})\s+/);
|
|
299
|
-
if (m && m[1].length <= headingLevel) {
|
|
300
|
-
sectionEndIdx = i;
|
|
301
|
-
break;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
const sectionLines = lines.slice(sectionStartIdx, sectionEndIdx);
|
|
305
|
-
// All four required fields must be present and non-blank (N/A is accepted)
|
|
306
|
-
const REQUIRED_FIELDS = [
|
|
307
|
-
{ key: 'chosen approach:', label: 'Chosen approach' },
|
|
308
|
-
{ key: 'rejected alternatives:', label: 'Rejected alternatives' },
|
|
309
|
-
{ key: 'why rejected:', label: 'Why rejected' },
|
|
310
|
-
{ key: 'impact on acs:', label: 'Impact on ACs' },
|
|
311
|
-
];
|
|
312
|
-
for (const { key, label } of REQUIRED_FIELDS) {
|
|
313
|
-
const lineIdx = sectionLines.findIndex(l => l.trim().toLowerCase().startsWith(key));
|
|
314
|
-
if (lineIdx === -1) {
|
|
315
|
-
result.push(issue(sectionStartIdx + 1, 'ambiguous_chosen_approach', `Mechanism Decision section is missing required field "${label}:" — add it for every core mechanism`));
|
|
68
|
+
const scopeSections = new Set(['Acceptance Criteria', 'Task Decomposition']);
|
|
69
|
+
let inScope = false;
|
|
70
|
+
for (let i = 0; i < lines.length; i++) {
|
|
71
|
+
const headingMatch = lines[i].match(/^#{1,6}\s+(.+)$/);
|
|
72
|
+
if (headingMatch) {
|
|
73
|
+
inScope = scopeSections.has(headingMatch[1].trim());
|
|
316
74
|
continue;
|
|
317
75
|
}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
const value = sectionLines[lineIdx].slice(colonPos + 1).trim();
|
|
321
|
-
if (!value || /_{3,}/.test(value)) {
|
|
322
|
-
result.push(issue(absLine, 'ambiguous_chosen_approach', `"${label}" on line ${absLine} is blank — fill it in or write "N/A" with justification`));
|
|
323
|
-
}
|
|
324
|
-
else if (key === 'chosen approach:' &&
|
|
325
|
-
/\b(?:or|could|might)\b|\be\.g\.|\bsuch as\b|\bfor example\b/i.test(value)) {
|
|
326
|
-
result.push(issue(absLine, 'ambiguous_chosen_approach', `"Chosen approach" on line ${absLine} contains option language ("or/could/might/e.g./such as/for example") — must commit to one mechanism, not offer choices`));
|
|
76
|
+
if (inScope && /^[-*]\s+\[x\]/i.test(lines[i])) {
|
|
77
|
+
result.push(i + 1);
|
|
327
78
|
}
|
|
328
79
|
}
|
|
329
80
|
return result;
|
|
330
81
|
}
|
|
331
82
|
/**
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
* -
|
|
335
|
-
* -
|
|
336
|
-
*
|
|
337
|
-
*/
|
|
338
|
-
function edgeCasesIssues(lines, riskTier) {
|
|
339
|
-
const found = lines.some(l => /^#{1,3}\s+.*(?:edge\s*cases|failure\s*modes)/i.test(l));
|
|
340
|
-
if (found)
|
|
341
|
-
return [];
|
|
342
|
-
const msg = 'No "Edge Cases and Failure Modes" section found — add one to red-team the spec before builder handoff (scope creep, hallucinated completion, intent drift, domain-specific edge cases)';
|
|
343
|
-
const isHard = riskTier === 'medium' || riskTier === 'high';
|
|
344
|
-
return [isHard ? issue(0, 'missing_edge_cases', msg) : advisoryIssue(0, 'missing_edge_cases', msg)];
|
|
345
|
-
}
|
|
346
|
-
/**
|
|
347
|
-
* Validate the Spec Convergence section — the formal GO declaration.
|
|
348
|
-
* - If absent on a medium/high spec: hard-fail. Advisory on low/unknown.
|
|
349
|
-
* - If present: open_questions and ambiguities_remaining must both be "0".
|
|
350
|
-
* ready_for_build: "no" is always a hard-fail (explicit NO_GO declaration).
|
|
83
|
+
* Check the Spec Convergence section.
|
|
84
|
+
* - Absent: hard fail (unresolved_convergence via missing_convergence_section mapping)
|
|
85
|
+
* - open_questions non-zero: hard fail
|
|
86
|
+
* - ambiguities_remaining non-zero: hard fail
|
|
87
|
+
* - ready_for_build "no": hard fail
|
|
351
88
|
*/
|
|
352
|
-
function convergenceIssues(
|
|
89
|
+
function convergenceIssues(lines) {
|
|
353
90
|
const result = [];
|
|
354
|
-
const sectionStartIdx = lines.findIndex(l => /^#{1,
|
|
91
|
+
const sectionStartIdx = lines.findIndex(l => /^#{1,6}\s+Spec Convergence\s*$/.test(l));
|
|
355
92
|
if (sectionStartIdx === -1) {
|
|
356
|
-
|
|
357
|
-
const isHard = riskTier === 'medium' || riskTier === 'high';
|
|
358
|
-
result.push(isHard ? issue(0, 'missing_convergence_section', msg) : advisoryIssue(0, 'missing_convergence_section', msg));
|
|
359
|
-
return result;
|
|
93
|
+
return [issue(0, 'missing_convergence_section', 'No "Spec Convergence" section found — add one with "open_questions: 0", "ambiguities_remaining: 0", and "ready_for_build: yes"')];
|
|
360
94
|
}
|
|
361
|
-
// Determine section end: next heading at same or higher level (fewer #s), or EOF
|
|
362
95
|
const headingLevel = (lines[sectionStartIdx].match(/^(#{1,6})/) ?? ['', '#'])[1].length;
|
|
363
96
|
let sectionEndIdx = lines.length;
|
|
364
97
|
for (let i = sectionStartIdx + 1; i < lines.length; i++) {
|
|
@@ -369,7 +102,6 @@ function convergenceIssues(content, lines, riskTier) {
|
|
|
369
102
|
}
|
|
370
103
|
}
|
|
371
104
|
const sectionLines = lines.slice(sectionStartIdx, sectionEndIdx);
|
|
372
|
-
// Check required integer fields — must be present and equal "0"
|
|
373
105
|
const INTEGER_FIELDS = [
|
|
374
106
|
{ key: 'open_questions:', label: 'open_questions' },
|
|
375
107
|
{ key: 'ambiguities_remaining:', label: 'ambiguities_remaining' },
|
|
@@ -377,28 +109,73 @@ function convergenceIssues(content, lines, riskTier) {
|
|
|
377
109
|
for (const { key, label } of INTEGER_FIELDS) {
|
|
378
110
|
const lineIdx = sectionLines.findIndex(l => l.trim().toLowerCase().startsWith(key));
|
|
379
111
|
if (lineIdx === -1) {
|
|
380
|
-
result.push(issue(sectionStartIdx + 1, 'unresolved_convergence', `Spec Convergence section is missing required field "${label}:" —
|
|
112
|
+
result.push(issue(sectionStartIdx + 1, 'unresolved_convergence', `Spec Convergence section is missing required field "${label}:" — set it to 0 when resolved`));
|
|
381
113
|
continue;
|
|
382
114
|
}
|
|
383
115
|
const absLine = sectionStartIdx + lineIdx + 1;
|
|
384
|
-
const
|
|
385
|
-
const value = sectionLines[lineIdx].slice(colonPos + 1).trim();
|
|
116
|
+
const value = sectionLines[lineIdx].slice(sectionLines[lineIdx].indexOf(':') + 1).trim();
|
|
386
117
|
if (value !== '0') {
|
|
387
118
|
result.push(issue(absLine, 'unresolved_convergence', `"${label}" on line ${absLine} is "${value}" — must be 0 before handoff to builder`));
|
|
388
119
|
}
|
|
389
120
|
}
|
|
390
|
-
// Check ready_for_build — explicit "no" is always a hard-fail
|
|
391
121
|
const rfbLineIdx = sectionLines.findIndex(l => l.trim().toLowerCase().startsWith('ready_for_build:'));
|
|
392
122
|
if (rfbLineIdx !== -1) {
|
|
393
123
|
const absLine = sectionStartIdx + rfbLineIdx + 1;
|
|
394
|
-
const
|
|
395
|
-
const value = sectionLines[rfbLineIdx].slice(colonPos + 1).trim().toLowerCase();
|
|
124
|
+
const value = sectionLines[rfbLineIdx].slice(sectionLines[rfbLineIdx].indexOf(':') + 1).trim().toLowerCase();
|
|
396
125
|
if (value === 'no') {
|
|
397
126
|
result.push(issue(absLine, 'unresolved_convergence', `"ready_for_build" on line ${absLine} is "no" — spec is explicitly declared not ready for build`));
|
|
398
127
|
}
|
|
399
128
|
}
|
|
400
129
|
return result;
|
|
401
130
|
}
|
|
131
|
+
function lintSpec(filePath) {
|
|
132
|
+
let content;
|
|
133
|
+
try {
|
|
134
|
+
content = fs.readFileSync(filePath, 'utf-8');
|
|
135
|
+
}
|
|
136
|
+
catch (err) {
|
|
137
|
+
throw new Error(`Cannot read spec at "${filePath}": ${err.message}`);
|
|
138
|
+
}
|
|
139
|
+
return lintContent(content);
|
|
140
|
+
}
|
|
141
|
+
function lintContent(content) {
|
|
142
|
+
const issues = [];
|
|
143
|
+
const lines = content.split('\n');
|
|
144
|
+
// ── Rule: blank_placeholder — hard fail when a required section has ___
|
|
145
|
+
for (let i = 0; i < lines.length; i++) {
|
|
146
|
+
if (BLANK_PLACEHOLDER_RE.test(lines[i])) {
|
|
147
|
+
issues.push(issue(i + 1, 'blank_placeholder', `Unfilled placeholder on line ${i + 1} — fill in or remove underscore runs of 3+`));
|
|
148
|
+
}
|
|
149
|
+
if (NHFI_RE.test(lines[i])) {
|
|
150
|
+
// Treat NHFI as a blank_placeholder variant (hard fail)
|
|
151
|
+
issues.push(issue(i + 1, 'blank_placeholder', `Unresolved [NEEDS HUMAN INPUT] flag on line ${i + 1}`));
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
// ── Rule: missing_marker — advisory: no nimai-spec marker found
|
|
155
|
+
if (!NIMAI_MARKER_RE.test(content)) {
|
|
156
|
+
issues.push(advisoryIssue(0, 'missing_marker', 'No <!-- nimai-spec --> marker found — add it so nimai can discover this spec (use tier=lite or tier=full)'));
|
|
157
|
+
}
|
|
158
|
+
// ── Determine tier from marker (bare marker = full for legacy compat)
|
|
159
|
+
const tier = (0, template_1.parseTierFromMarker)(content);
|
|
160
|
+
const requiredSections = tier === 'lite' ? LITE_REQUIRED_SECTIONS : FULL_REQUIRED_SECTIONS;
|
|
161
|
+
// ── Rule: missing_required_section — tier-aware; literal heading match
|
|
162
|
+
const headings = lines
|
|
163
|
+
.filter(l => /^#{1,6}\s+/.test(l))
|
|
164
|
+
.map(l => l.replace(/^#{1,6}\s+/, '').trim());
|
|
165
|
+
for (const section of requiredSections) {
|
|
166
|
+
if (!headings.includes(section)) {
|
|
167
|
+
issues.push(issue(0, 'missing_required_section', `Required section missing for ${tier}-tier spec: "## ${section}"`));
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
// ── Rule: pre_checked_ac — hard fail, scoped to AC and Task Decomposition sections
|
|
171
|
+
const preCheckedLines = findPreCheckedAcsInScope(lines);
|
|
172
|
+
for (const lineNum of preCheckedLines) {
|
|
173
|
+
issues.push(issue(lineNum, 'pre_checked_ac', `Pre-checked item on line ${lineNum} — acceptance criteria must be unchecked ([ ]) in a draft spec`));
|
|
174
|
+
}
|
|
175
|
+
// ── Rule: unresolved_convergence — hard fail when convergence section has issues
|
|
176
|
+
issues.push(...convergenceIssues(lines));
|
|
177
|
+
return issues;
|
|
178
|
+
}
|
|
402
179
|
function issue(line, type, message) {
|
|
403
180
|
return { line, type, message };
|
|
404
181
|
}
|
package/dist/lint.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.js","sourceRoot":"","sources":["../src/lint.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuGA,4BAQC;AAsBD,kCAmFC;AAxND,uCAAyB;AAGzB,mEAAmE;AACnE,MAAM,cAAc,GAAG,OAAO,CAAC;AAC/B,uCAAuC;AACvC,MAAM,OAAO,GAAG,sBAAsB,CAAC;AACvC,6DAA6D;AAC7D,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AAC5C,uDAAuD;AACvD,MAAM,eAAe,GAAG,wBAAwB,CAAC;AACjD,6CAA6C;AAC7C,kFAAkF;AAClF,MAAM,mBAAmB,GAAG,sCAAsC,CAAC;AACnE,kEAAkE;AAClE,+D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AAC;AAED,SAAS,aAAa,CAAC,IAAY,EAAE,IAAmB,EAAE,OAAe;IACvE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACjD,CAAC"}
|
package/dist/prompts.d.ts
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* These live in
|
|
4
|
-
* depending on
|
|
2
|
+
* Nimai prompt builders — pure string functions, no IO, no LLM calls.
|
|
3
|
+
* These live in nimai-core so any package can import them without
|
|
4
|
+
* depending on nimai-mcp internals.
|
|
5
|
+
*
|
|
6
|
+
* Template texts are passed in by callers (MCP server, CLI spec command)
|
|
7
|
+
* which load them via template.ts. prompts.ts stays pure (no fs/IO).
|
|
5
8
|
*/
|
|
6
9
|
/**
|
|
7
|
-
*
|
|
8
|
-
* Returns the
|
|
10
|
+
* Nimai Spec Protocol — PHASE 1 through PHASE 4.
|
|
11
|
+
* Returns the protocol prompt the host model runs to turn a loose request
|
|
12
|
+
* into a graded, build-ready spec.
|
|
13
|
+
*
|
|
14
|
+
* Callers load liteTemplate and fullTemplate via loadTierTemplate() from template.ts
|
|
15
|
+
* and pass them here. The [EMBED] placeholder is replaced with both template texts.
|
|
16
|
+
*
|
|
17
|
+
* Signature: buildSpecProtocol(request, repoPath, liteTemplate, fullTemplate)
|
|
9
18
|
*/
|
|
10
|
-
export declare function
|
|
19
|
+
export declare function buildSpecProtocol(request: string, repoPath: string, liteTemplate: string, fullTemplate: string): string;
|
|
11
20
|
/**
|
|
12
|
-
*
|
|
21
|
+
* Nimai Prompt 1.5 — Spec-Quality Reviewer.
|
|
13
22
|
* Returns a prompt for a reviewing LLM to evaluate whether a draft spec is
|
|
14
23
|
* executable by an agent without requiring clarifying questions.
|
|
15
24
|
*
|
|
@@ -23,8 +32,9 @@ export declare function buildPrompt1(request: string, contextSummary: string): s
|
|
|
23
32
|
*/
|
|
24
33
|
export declare function buildPrompt15(specContent: string): string;
|
|
25
34
|
/**
|
|
26
|
-
*
|
|
35
|
+
* Nimai Prompt 2 — Implementation Reviewer Prompt Generator.
|
|
27
36
|
* Returns the populated reviewer prompt derived from an approved spec.
|
|
37
|
+
* Used for reviewing an implementation against the spec (target=implementation).
|
|
28
38
|
*/
|
|
29
39
|
export declare function buildPrompt2(specContent: string): string;
|
|
30
40
|
//# sourceMappingURL=prompts.d.ts.map
|
package/dist/prompts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,GACnB,MAAM,CAsER;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CA4GzD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAgBxD"}
|