@planu/cli 8.11.0 → 8.12.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/CHANGELOG.md +7 -0
- package/README.md +2 -2
- package/dist/sdd-engine/contracts.js +1 -1
- package/dist/sdd-engine/patch-sandbox.js +7 -11
- package/dist/sdd-engine/task-content.d.ts +3 -1
- package/dist/sdd-engine/task-content.js +82 -7
- package/dist/sdd-engine/trinity-structure.js +94 -78
- package/dist/types/sdd-engine.d.ts +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [8.12.0] - 2026-11-16
|
|
2
|
+
|
|
3
|
+
- Bind task completion strictly to the active first open task checkbox, preventing implicit task IDs from matching prose in later task titles.
|
|
4
|
+
- Reject malformed File Manifest bullets and duplicate explicit task IDs during lock validation with exact 1-based line diagnostics.
|
|
5
|
+
- Include bounded match line numbers, line-ending mismatch flags, and slice line-number prefix diagnostics on MODIFY patch failures.
|
|
6
|
+
- Refresh direct secretlint development dependencies to 14.0.0.
|
|
7
|
+
|
|
1
8
|
## [8.11.0]
|
|
2
9
|
|
|
3
10
|
- Add versioned static advisory next actions to engine-formatted failures, exposed by the version 1 capability descriptor.
|
package/README.md
CHANGED
|
@@ -159,7 +159,7 @@ The existing nine tools expose additive diagnostics since 8.4.0; 8.5.0 adds comp
|
|
|
159
159
|
```json
|
|
160
160
|
{
|
|
161
161
|
"version": 1,
|
|
162
|
-
"bundledVersion": "8.
|
|
162
|
+
"bundledVersion": "8.12.0",
|
|
163
163
|
"baseline": "available",
|
|
164
164
|
"catalog": "unverified",
|
|
165
165
|
"issues": [{
|
|
@@ -392,7 +392,7 @@ See the [Planu Proprietary Free-Use License](LICENSE) and [planu.dev/license](ht
|
|
|
392
392
|
"mcpServers": {
|
|
393
393
|
"planu": {
|
|
394
394
|
"command": "npx",
|
|
395
|
-
"args": ["-y", "@planu/cli@8.
|
|
395
|
+
"args": ["-y", "@planu/cli@8.12.0"],
|
|
396
396
|
"cwd": ".",
|
|
397
397
|
"env": {
|
|
398
398
|
"PLANU_WORKSPACE": "."
|
|
@@ -5,7 +5,7 @@ export const FeatureIdSchema = z
|
|
|
5
5
|
.string()
|
|
6
6
|
.min(1)
|
|
7
7
|
.regex(/^FEAT[-_][A-Z0-9_-]+$/, {
|
|
8
|
-
message: '
|
|
8
|
+
message: 'Feature ID must match FEAT-XXXX or FEAT_XXXX (uppercase ASCII letters, digits, hyphens, or underscores).',
|
|
9
9
|
});
|
|
10
10
|
export const ArtifactTypeSchema = z.enum(['spec', 'plan', 'tasks']);
|
|
11
11
|
export const FilePermissionSchema = z.enum(['CREATE', 'MODIFY', 'READ_ONLY', 'DELETE']);
|
|
@@ -2,6 +2,7 @@ import * as fs from 'node:fs/promises';
|
|
|
2
2
|
import * as path from 'node:path';
|
|
3
3
|
import { parseManifestContent, toPosixPath } from './feature-manifest.js';
|
|
4
4
|
import { CompletionGuardError, readArtifact, rewriteArtifact } from './feature-authority.js';
|
|
5
|
+
import { buildModifyPatchDiagnostics } from './task-content.js';
|
|
5
6
|
export class PatchSandbox {
|
|
6
7
|
workspaceRoot;
|
|
7
8
|
constructor(workspaceRoot) {
|
|
@@ -88,16 +89,11 @@ export class PatchSandbox {
|
|
|
88
89
|
return null;
|
|
89
90
|
}
|
|
90
91
|
rejectsProtectedRoot(workspacePath, fullPath, normalizedTarget, permission) {
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
isProtectedPrefix(normalizedTarget, 'planu/specs') ||
|
|
97
|
-
this.isWithin(sddRoot, fullPath) ||
|
|
98
|
-
this.isWithin(gitRoot, fullPath) ||
|
|
99
|
-
this.isWithin(legacySpecsRoot, fullPath)) {
|
|
100
|
-
return true;
|
|
92
|
+
for (const root of ['.sdd', '.git', 'planu/specs']) {
|
|
93
|
+
if (isProtectedPrefix(normalizedTarget, root) ||
|
|
94
|
+
this.isWithin(path.resolve(workspacePath, root), fullPath)) {
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
101
97
|
}
|
|
102
98
|
return permission === 'DELETE' && fullPath === workspacePath;
|
|
103
99
|
}
|
|
@@ -209,7 +205,7 @@ export class PatchSandbox {
|
|
|
209
205
|
code: 'ERR_PATCH_FAILED',
|
|
210
206
|
message: `MODIFY search_content must occur exactly once in '${normalizedTarget}'.`,
|
|
211
207
|
trigger: 'sdd_apply_file_patch',
|
|
212
|
-
details:
|
|
208
|
+
details: buildModifyPatchDiagnostics(artifact.content, searchContent, matchCount, normalizedTarget),
|
|
213
209
|
},
|
|
214
210
|
};
|
|
215
211
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TaskBlock } from '../types/completion.js';
|
|
2
|
-
import type { ActiveTaskResult, FeatureSummary, SddResult } from '../types/sdd-engine.js';
|
|
2
|
+
import type { ActiveTaskResult, FeatureSummary, SddResult, TrinityIssue } from '../types/sdd-engine.js';
|
|
3
3
|
export declare function activeTaskFromContent(content: string, extractCommand: (markdown: string) => string | null): SddResult<ActiveTaskResult>;
|
|
4
4
|
export declare function summarizeTaskContent(content: string, extractCommand: (markdown: string) => string | null): {
|
|
5
5
|
current: SddResult<ActiveTaskResult>;
|
|
@@ -10,6 +10,8 @@ export declare function summarizeTaskContent(content: string, extractCommand: (m
|
|
|
10
10
|
};
|
|
11
11
|
export declare function taskBlocks(content: string): TaskBlock[];
|
|
12
12
|
export declare function markTaskVerified(lines: string[], taskId: string, cleanOutput: string): string[] | null;
|
|
13
|
+
export declare function findDuplicateTaskIssues(tasksContent: string): TrinityIssue[];
|
|
14
|
+
export declare function buildModifyPatchDiagnostics(content: string, searchContent: string, matchCount: number, requestedPath: string): Record<string, unknown>;
|
|
13
15
|
export declare function markReceiptTaskVerified(content: string, lineIndex: number, summary: string): string | undefined;
|
|
14
16
|
export declare function remainingTaskCount(checkRes: SddResult<ActiveTaskResult>): number;
|
|
15
17
|
export declare function summarizeEvidence(output: string): string;
|
|
@@ -113,17 +113,92 @@ function extractTaskId(rawTitle, index) {
|
|
|
113
113
|
return { id: `TASK-${index}`, title: rawTitle };
|
|
114
114
|
}
|
|
115
115
|
export function markTaskVerified(lines, taskId, cleanOutput) {
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
for (let i = 0; i <
|
|
119
|
-
const line =
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
116
|
+
const targetId = taskId.toUpperCase();
|
|
117
|
+
let ordinal = 0;
|
|
118
|
+
for (let i = 0; i < lines.length; i++) {
|
|
119
|
+
const line = lines[i] ?? '';
|
|
120
|
+
const match = TASK_CHECKBOX.exec(line.trim());
|
|
121
|
+
if (!match?.[1] || !match[2]) {
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
ordinal += 1;
|
|
125
|
+
if (match[1].trim().toLowerCase() === 'x') {
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
if (extractTaskId(match[2].trim(), ordinal).id !== targetId) {
|
|
129
|
+
return null;
|
|
123
130
|
}
|
|
131
|
+
const next = [...lines];
|
|
132
|
+
next[i] = formatVerifiedTaskLine(line, targetId, cleanOutput);
|
|
133
|
+
return next;
|
|
124
134
|
}
|
|
125
135
|
return null;
|
|
126
136
|
}
|
|
137
|
+
function formatVerifiedTaskLine(line, targetId, cleanOutput) {
|
|
138
|
+
const lineEnding = line.endsWith('\r') ? '\r' : '';
|
|
139
|
+
const body = lineEnding ? line.slice(0, -1) : line;
|
|
140
|
+
const explicitPrefix = /^(\s*[-*]\s*\[)[\s/](\]\s*(?:TASK-[A-Z0-9_-]+|[A-Z0-9_-]+))(:\s*.*)$/iu.exec(body);
|
|
141
|
+
if (explicitPrefix?.[1] && explicitPrefix[2] && explicitPrefix[3]) {
|
|
142
|
+
return `${explicitPrefix[1]}x${explicitPrefix[2]} — [Verified: ${cleanOutput}]${explicitPrefix[3]}${lineEnding}`;
|
|
143
|
+
}
|
|
144
|
+
return (body.replace(/^(\s*[-*]\s*\[)[\s/](\]\s*)(.*)$/u, `$1x$2${targetId} — [Verified: ${cleanOutput}]: $3`) + lineEnding);
|
|
145
|
+
}
|
|
146
|
+
export function findDuplicateTaskIssues(tasksContent) {
|
|
147
|
+
const seen = new Set();
|
|
148
|
+
const issues = [];
|
|
149
|
+
for (const block of taskBlocks(tasksContent)) {
|
|
150
|
+
const explicit = (block.explicitId ?? block.legacyId)?.toUpperCase();
|
|
151
|
+
if (!explicit) {
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
if (seen.has(explicit)) {
|
|
155
|
+
issues.push({
|
|
156
|
+
artifact: 'tasks.md',
|
|
157
|
+
rule: 'duplicate_task_id',
|
|
158
|
+
line: block.lineIndex + 1,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
seen.add(explicit);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return issues;
|
|
166
|
+
}
|
|
167
|
+
const DIAGNOSTIC_BYTE_LIMIT = 262_144;
|
|
168
|
+
const SLICE_LINE_PREFIX = /^\d+: /u;
|
|
169
|
+
export function buildModifyPatchDiagnostics(content, searchContent, matchCount, requestedPath) {
|
|
170
|
+
if (!searchContent || content.length > DIAGNOSTIC_BYTE_LIMIT) {
|
|
171
|
+
return { matchCount, requestedPath };
|
|
172
|
+
}
|
|
173
|
+
if (matchCount > 1) {
|
|
174
|
+
return {
|
|
175
|
+
matchCount,
|
|
176
|
+
requestedPath,
|
|
177
|
+
matchLines: findMatchLines(content, searchContent),
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
const normContent = content.replaceAll('\r\n', '\n');
|
|
181
|
+
const normSearch = searchContent.replaceAll('\r\n', '\n');
|
|
182
|
+
const searchLines = normSearch.split('\n');
|
|
183
|
+
const stripped = searchLines.some((line) => SLICE_LINE_PREFIX.test(line))
|
|
184
|
+
? searchLines.map((line) => line.replace(SLICE_LINE_PREFIX, '')).join('\n')
|
|
185
|
+
: '';
|
|
186
|
+
const totalLines = sourceLines(normContent).length;
|
|
187
|
+
return {
|
|
188
|
+
matchCount,
|
|
189
|
+
requestedPath,
|
|
190
|
+
totalLines,
|
|
191
|
+
hasCrlfMismatch: normContent.includes(normSearch),
|
|
192
|
+
hasLineNumberPrefixes: Boolean(stripped && normContent.includes(stripped)),
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
function findMatchLines(haystack, needle) {
|
|
196
|
+
const lines = [];
|
|
197
|
+
for (let at = haystack.indexOf(needle); at !== -1 && lines.length < 10; at = haystack.indexOf(needle, at + needle.length)) {
|
|
198
|
+
lines.push(haystack.slice(0, at).split('\n').length);
|
|
199
|
+
}
|
|
200
|
+
return lines;
|
|
201
|
+
}
|
|
127
202
|
export function markReceiptTaskVerified(content, lineIndex, summary) {
|
|
128
203
|
const lines = content.split('\n');
|
|
129
204
|
const line = lines[lineIndex];
|
|
@@ -1,57 +1,53 @@
|
|
|
1
|
-
import { hasReceiptDirective, insideMarkdownBlock } from './task-content.js';
|
|
1
|
+
import { findDuplicateTaskIssues, hasReceiptDirective, insideMarkdownBlock, } from './task-content.js';
|
|
2
2
|
import { taskIdPattern } from './receipt-assessment.js';
|
|
3
3
|
import { disjointPaths, isEvidencePath, CompletionGuardError } from './feature-authority.js';
|
|
4
4
|
import * as path from 'node:path';
|
|
5
5
|
const CHECKBOX_TASK = /^[-*]\s*\[[ xX]\]/u;
|
|
6
6
|
const BDD_KEYWORDS = [/\bGIVEN\b/u, /\bWHEN\b/u, /\bTHEN\b/u];
|
|
7
|
+
const EMPTY_SCAFFOLD_MANIFEST = /^(CREATE|MODIFY|READ_ONLY|DELETE):\s*$/iu;
|
|
7
8
|
export function assessTrinityCompleteness(specContent, planContent, tasksContent) {
|
|
8
|
-
const missing = [];
|
|
9
|
-
if (!hasHeading(specContent, 'Out-of-Scope')) {
|
|
10
|
-
missing.push('out_of_scope');
|
|
11
|
-
}
|
|
12
|
-
if (!hasHeading(specContent, 'Error Matrix')) {
|
|
13
|
-
missing.push('error_matrix');
|
|
14
|
-
}
|
|
15
|
-
if (!BDD_KEYWORDS.every((keyword) => keyword.test(specContent))) {
|
|
16
|
-
missing.push('bdd');
|
|
17
|
-
}
|
|
18
|
-
if (!hasHeading(planContent, 'Frozen Dependencies')) {
|
|
19
|
-
missing.push('frozen_dependencies');
|
|
20
|
-
}
|
|
21
9
|
const hasTask = tasksContent.split('\n').some((line) => CHECKBOX_TASK.test(line.trim()));
|
|
22
10
|
const manifest = scanManifest(planContent);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
11
|
+
const duplicateTaskIssues = findDuplicateTaskIssues(tasksContent);
|
|
12
|
+
const checks = [
|
|
13
|
+
[hasHeading(specContent, 'Out-of-Scope'), 'out_of_scope'],
|
|
14
|
+
[hasHeading(specContent, 'Error Matrix'), 'error_matrix'],
|
|
15
|
+
[BDD_KEYWORDS.every((keyword) => keyword.test(specContent)), 'bdd'],
|
|
16
|
+
[hasHeading(planContent, 'Frozen Dependencies'), 'frozen_dependencies'],
|
|
17
|
+
[manifest.hasPath, 'manifest_path'],
|
|
18
|
+
[hasTask, 'checkbox_task'],
|
|
19
|
+
];
|
|
20
|
+
const missing = checks.filter(([present]) => !present).map(([, rule]) => rule);
|
|
21
|
+
const issues = boundedTrinityIssues([
|
|
22
|
+
...missing.map(missingIssue),
|
|
23
|
+
...manifest.issues,
|
|
24
|
+
...duplicateTaskIssues,
|
|
25
|
+
]);
|
|
26
|
+
const errorMessage = manifest.globDelete
|
|
27
|
+
? 'DELETE File Manifest entries must be exact paths, not globs.'
|
|
28
|
+
: manifest.protectedWrite
|
|
29
|
+
? 'File Manifest cannot grant writes on protected root paths.'
|
|
30
|
+
: manifest.invalidEntry
|
|
31
|
+
? 'File Manifest entries must use canonical "PERMISSION: path" or "path: PERMISSION" syntax with CREATE, MODIFY, READ_ONLY, or DELETE.'
|
|
32
|
+
: duplicateTaskIssues.length > 0
|
|
33
|
+
? 'Task checkbox identifiers in tasks.md must be unique.'
|
|
34
|
+
: null;
|
|
35
|
+
if (errorMessage !== null) {
|
|
31
36
|
return {
|
|
32
37
|
ok: false,
|
|
33
38
|
code: 'ERR_TRINITY_INCOMPLETE',
|
|
34
|
-
message:
|
|
39
|
+
message: errorMessage,
|
|
35
40
|
details: { issues },
|
|
36
41
|
};
|
|
37
42
|
}
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
return missing.length === 0
|
|
44
|
+
? { ok: true }
|
|
45
|
+
: {
|
|
40
46
|
ok: false,
|
|
41
47
|
code: 'ERR_TRINITY_INCOMPLETE',
|
|
42
|
-
message: 'File Manifest
|
|
43
|
-
details: { issues },
|
|
48
|
+
message: 'Lock requires H1-H3 Out-of-Scope, Error Matrix, and Frozen Dependencies headings, GIVEN/WHEN/THEN acceptance criteria, a File Manifest path, and at least one checkbox task.',
|
|
49
|
+
details: { missing, issues },
|
|
44
50
|
};
|
|
45
|
-
}
|
|
46
|
-
if (missing.length === 0) {
|
|
47
|
-
return { ok: true };
|
|
48
|
-
}
|
|
49
|
-
return {
|
|
50
|
-
ok: false,
|
|
51
|
-
code: 'ERR_TRINITY_INCOMPLETE',
|
|
52
|
-
message: 'Lock requires Out-of-Scope, Error Matrix, GIVEN/WHEN/THEN acceptance criteria, Frozen Dependencies, a File Manifest path, and at least one checkbox task.',
|
|
53
|
-
details: { missing, issues },
|
|
54
|
-
};
|
|
55
51
|
}
|
|
56
52
|
function hasHeading(content, needle) {
|
|
57
53
|
const escaped = needle.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
@@ -59,10 +55,11 @@ function hasHeading(content, needle) {
|
|
|
59
55
|
}
|
|
60
56
|
const PROTECTED_ROOTS = ['.sdd', '.git', 'planu/specs'];
|
|
61
57
|
function scanManifest(planContent) {
|
|
62
|
-
const
|
|
63
|
-
const
|
|
58
|
+
const { entries, invalidIssues } = scanManifestLines(planContent);
|
|
59
|
+
const effective = new Map(entries.map((entry) => [toPosixPath(entry.rawPath), entry]));
|
|
60
|
+
const issues = [...invalidIssues];
|
|
64
61
|
let globDelete = false;
|
|
65
|
-
let protectedWrite =
|
|
62
|
+
let protectedWrite = false;
|
|
66
63
|
for (const [entryPath, { permission, line }] of effective) {
|
|
67
64
|
if (permission === 'DELETE' && entryPath.includes('*')) {
|
|
68
65
|
globDelete = true;
|
|
@@ -71,19 +68,57 @@ function scanManifest(planContent) {
|
|
|
71
68
|
const normalized = path.posix.normalize(entryPath).toLowerCase();
|
|
72
69
|
if (permission !== 'READ_ONLY' &&
|
|
73
70
|
PROTECTED_ROOTS.some((root) => normalized === root || normalized.startsWith(`${root}/`))) {
|
|
74
|
-
protectedWrite
|
|
71
|
+
protectedWrite = true;
|
|
75
72
|
issues.push({ artifact: 'plan.md', rule: 'protected_write', line });
|
|
76
73
|
}
|
|
77
74
|
}
|
|
78
|
-
return {
|
|
75
|
+
return {
|
|
76
|
+
hasPath: effective.size > 0,
|
|
77
|
+
globDelete,
|
|
78
|
+
protectedWrite,
|
|
79
|
+
invalidEntry: invalidIssues.length > 0,
|
|
80
|
+
issues,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function scanManifestLines(content) {
|
|
84
|
+
const lines = content.replaceAll('\r\n', '\n').split('\n');
|
|
85
|
+
const entries = [];
|
|
86
|
+
const invalidIssues = [];
|
|
87
|
+
let inManifest = false;
|
|
88
|
+
for (const [index, rawLine] of lines.entries()) {
|
|
89
|
+
const line = rawLine.trim();
|
|
90
|
+
if (/^#{1,3}\s+/.test(line)) {
|
|
91
|
+
inManifest = /^#{1,3}\s+.*file\s+manifest/i.test(line);
|
|
92
|
+
}
|
|
93
|
+
else if (inManifest && /^[-*]\s+/.test(line)) {
|
|
94
|
+
const entry = parseManifestLine(line);
|
|
95
|
+
if (entry && toPosixPath(entry.rawPath).toLowerCase() !== 'none') {
|
|
96
|
+
entries.push({ ...entry, line: index + 1 });
|
|
97
|
+
}
|
|
98
|
+
else if (!entry && !insideMarkdownBlock(lines.slice(0, index))) {
|
|
99
|
+
const item = line.replace(/^[-*]\s+/, '').trim();
|
|
100
|
+
if (item
|
|
101
|
+
.replace(/^`+|`+$/g, '')
|
|
102
|
+
.trim()
|
|
103
|
+
.toLowerCase() !== 'none' &&
|
|
104
|
+
!EMPTY_SCAFFOLD_MANIFEST.test(item)) {
|
|
105
|
+
invalidIssues.push({
|
|
106
|
+
artifact: 'plan.md',
|
|
107
|
+
rule: 'invalid_manifest_entry',
|
|
108
|
+
line: index + 1,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return { entries, invalidIssues };
|
|
79
115
|
}
|
|
80
116
|
function missingIssue(rule) {
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
: rule === 'checkbox_task'
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return { artifact, rule: rule };
|
|
117
|
+
const spec = ['out_of_scope', 'error_matrix', 'bdd'].includes(rule);
|
|
118
|
+
return {
|
|
119
|
+
artifact: spec ? 'spec.md' : rule === 'checkbox_task' ? 'tasks.md' : 'plan.md',
|
|
120
|
+
rule: rule,
|
|
121
|
+
};
|
|
87
122
|
}
|
|
88
123
|
function boundedTrinityIssues(issues) {
|
|
89
124
|
const order = ['spec.md', 'plan.md', 'tasks.md'];
|
|
@@ -101,40 +136,21 @@ export function parseManifestContent(content) {
|
|
|
101
136
|
return { allowedFiles };
|
|
102
137
|
}
|
|
103
138
|
export function manifestEntries(content) {
|
|
104
|
-
|
|
105
|
-
let inManifestSection = false;
|
|
106
|
-
for (const [index, rawLine] of content.split('\n').entries()) {
|
|
107
|
-
const line = rawLine.trim();
|
|
108
|
-
if (/^#{1,3}\s+/.test(line)) {
|
|
109
|
-
inManifestSection = /^#{1,3}\s+.*file\s+manifest/i.test(line);
|
|
110
|
-
continue;
|
|
111
|
-
}
|
|
112
|
-
if (inManifestSection && /^[-*]\s+/.test(line)) {
|
|
113
|
-
const entry = parseManifestLine(line);
|
|
114
|
-
if (entry && toPosixPath(entry.rawPath).toLowerCase() !== 'none') {
|
|
115
|
-
entries.push({ ...entry, line: index + 1 });
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return entries;
|
|
139
|
+
return scanManifestLines(content).entries;
|
|
120
140
|
}
|
|
121
141
|
function parseManifestLine(rawLine) {
|
|
122
142
|
const item = rawLine.replace(/^[-*]\s+/, '').trim();
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
permission: prefix[1].toUpperCase(),
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
const postfix = /^`?([^`\s:#]+)`?:\s*(CREATE|MODIFY|READ_ONLY|DELETE)\s*$/i.exec(item);
|
|
131
|
-
if (postfix?.[1] && postfix[2]) {
|
|
132
|
-
return {
|
|
133
|
-
rawPath: postfix[1],
|
|
134
|
-
permission: postfix[2].toUpperCase(),
|
|
135
|
-
};
|
|
143
|
+
const match = /^(CREATE|MODIFY|READ_ONLY|DELETE):\s*`?([^`\s#]+)`?\s*$/i.exec(item) ??
|
|
144
|
+
/^`?([^`\s:#]+)`?:\s*(CREATE|MODIFY|READ_ONLY|DELETE)\s*$/i.exec(item);
|
|
145
|
+
if (!match?.[1] || !match[2]) {
|
|
146
|
+
return undefined;
|
|
136
147
|
}
|
|
137
|
-
|
|
148
|
+
const firstUpper = match[1].toUpperCase();
|
|
149
|
+
const isPrefix = ['CREATE', 'MODIFY', 'READ_ONLY', 'DELETE'].includes(firstUpper);
|
|
150
|
+
return {
|
|
151
|
+
rawPath: isPrefix ? match[2] : match[1],
|
|
152
|
+
permission: (isPrefix ? firstUpper : match[2].toUpperCase()),
|
|
153
|
+
};
|
|
138
154
|
}
|
|
139
155
|
export function toPosixPath(value) {
|
|
140
156
|
const posix = value.replaceAll('\\', '/');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { VerificationEvidence, VerificationPreflight, VerificationProcessEvidence } from './verification.js';
|
|
2
2
|
export type { VerificationReceipt, ReceiptRejectionReason, ReceiptSetResult, GateAssessment, PreflightBlockerReason, PreflightAction, VerificationPreflight, ReceiptSetAssessment, VerificationGate, VerificationEvidence, } from './verification.js';
|
|
3
|
-
export type TrinityRule = 'out_of_scope' | 'error_matrix' | 'bdd' | 'frozen_dependencies' | 'manifest_path' | 'checkbox_task' | 'glob_delete' | 'protected_write' | 'receipt_policy_invalid' | 'artifact_missing' | 'artifact_unreadable';
|
|
3
|
+
export type TrinityRule = 'out_of_scope' | 'error_matrix' | 'bdd' | 'frozen_dependencies' | 'manifest_path' | 'checkbox_task' | 'glob_delete' | 'protected_write' | 'invalid_manifest_entry' | 'duplicate_task_id' | 'receipt_policy_invalid' | 'artifact_missing' | 'artifact_unreadable';
|
|
4
4
|
export interface TrinityIssue {
|
|
5
5
|
artifact: 'spec.md' | 'plan.md' | 'tasks.md';
|
|
6
6
|
rule: TrinityRule;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planu/cli",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.12.0",
|
|
4
4
|
"description": "Planu — MCP server for Spec Driven Development. Planning and file operations on macOS/Linux/Windows; automated verification requires macOS/Linux (POSIX).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@commitlint/cli": "^21.2.4",
|
|
75
75
|
"@commitlint/config-conventional": "^21.2.4",
|
|
76
76
|
"@eslint/js": "^10.0.1",
|
|
77
|
-
"@secretlint/secretlint-rule-no-homedir": "^
|
|
77
|
+
"@secretlint/secretlint-rule-no-homedir": "^14.0.0",
|
|
78
78
|
"@secretlint/secretlint-rule-preset-recommend": "^13.1.0",
|
|
79
79
|
"@types/node": "^22.20.5",
|
|
80
80
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"madge": "^8.0.0",
|
|
92
92
|
"prettier": "^3.10.1",
|
|
93
93
|
"qrcode": "1.5.4",
|
|
94
|
-
"secretlint": "^
|
|
94
|
+
"secretlint": "^14.0.0",
|
|
95
95
|
"tsc-alias": "^1.9.10",
|
|
96
96
|
"type-coverage": "^2.31.2",
|
|
97
97
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|