@rasensio/aidlc 2.20.0 → 2.22.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/autopilot/answers.d.ts.map +1 -1
- package/dist/autopilot/answers.js +4 -1
- package/dist/autopilot/answers.js.map +1 -1
- package/dist/autopilot/driver.d.ts +19 -0
- package/dist/autopilot/driver.d.ts.map +1 -1
- package/dist/autopilot/driver.js +221 -51
- package/dist/autopilot/driver.js.map +1 -1
- package/dist/autopilot/presets.d.ts.map +1 -1
- package/dist/autopilot/presets.js +14 -4
- package/dist/autopilot/presets.js.map +1 -1
- package/dist/autopilot/typed.d.ts +3 -9
- package/dist/autopilot/typed.d.ts.map +1 -1
- package/dist/autopilot/typed.js +4 -6
- package/dist/autopilot/typed.js.map +1 -1
- package/dist/commands/init.d.ts +10 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +24 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/roadmap.d.ts.map +1 -1
- package/dist/commands/roadmap.js +3 -1
- package/dist/commands/roadmap.js.map +1 -1
- package/dist/cost/gitignore.d.ts +6 -5
- package/dist/cost/gitignore.d.ts.map +1 -1
- package/dist/cost/gitignore.js +6 -6
- package/dist/cost/gitignore.js.map +1 -1
- package/dist/cost/hooks/shim.js +3 -3
- package/dist/cost/hooks/shim.js.map +1 -1
- package/dist/doctor/migrations/cost-gitignore.d.ts +2 -1
- package/dist/doctor/migrations/cost-gitignore.d.ts.map +1 -1
- package/dist/doctor/migrations/cost-gitignore.js +13 -11
- package/dist/doctor/migrations/cost-gitignore.js.map +1 -1
- package/dist/doctor/migrations/index.d.ts.map +1 -1
- package/dist/doctor/migrations/index.js +5 -0
- package/dist/doctor/migrations/index.js.map +1 -1
- package/dist/doctor/migrations/knowledge-gitignore.d.ts +8 -1
- package/dist/doctor/migrations/knowledge-gitignore.d.ts.map +1 -1
- package/dist/doctor/migrations/knowledge-gitignore.js +20 -13
- package/dist/doctor/migrations/knowledge-gitignore.js.map +1 -1
- package/dist/doctor/migrations/nested-gitignore.d.ts +24 -5
- package/dist/doctor/migrations/nested-gitignore.d.ts.map +1 -1
- package/dist/doctor/migrations/nested-gitignore.js +62 -6
- package/dist/doctor/migrations/nested-gitignore.js.map +1 -1
- package/dist/doctor/migrations/tracked-nested-ignored.d.ts +26 -0
- package/dist/doctor/migrations/tracked-nested-ignored.d.ts.map +1 -0
- package/dist/doctor/migrations/tracked-nested-ignored.js +69 -0
- package/dist/doctor/migrations/tracked-nested-ignored.js.map +1 -0
- package/dist/knowledge/engine.d.ts.map +1 -1
- package/dist/knowledge/engine.js +5 -0
- package/dist/knowledge/engine.js.map +1 -1
- package/dist/knowledge/gitignore.d.ts +18 -0
- package/dist/knowledge/gitignore.d.ts.map +1 -0
- package/dist/knowledge/gitignore.js +25 -0
- package/dist/knowledge/gitignore.js.map +1 -0
- package/dist/roadmap/next.d.ts +6 -3
- package/dist/roadmap/next.d.ts.map +1 -1
- package/dist/roadmap/next.js +17 -1
- package/dist/roadmap/next.js.map +1 -1
- package/dist/roadmap/ready.d.ts +39 -0
- package/dist/roadmap/ready.d.ts.map +1 -0
- package/dist/roadmap/ready.js +101 -0
- package/dist/roadmap/ready.js.map +1 -0
- package/dist/roadmap/triage.d.ts +7 -0
- package/dist/roadmap/triage.d.ts.map +1 -1
- package/dist/roadmap/triage.js +12 -2
- package/dist/roadmap/triage.js.map +1 -1
- package/dist/roadmap/view-assets.d.ts.map +1 -1
- package/dist/roadmap/view-assets.js +21 -6
- package/dist/roadmap/view-assets.js.map +1 -1
- package/dist/roadmap/view-html.d.ts +12 -0
- package/dist/roadmap/view-html.d.ts.map +1 -1
- package/dist/roadmap/view-html.js +81 -7
- package/dist/roadmap/view-html.js.map +1 -1
- package/dist/roadmap/view-model.d.ts +28 -1
- package/dist/roadmap/view-model.d.ts.map +1 -1
- package/dist/roadmap/view-model.js +48 -4
- package/dist/roadmap/view-model.js.map +1 -1
- package/package.json +2 -2
|
@@ -3,13 +3,21 @@
|
|
|
3
3
|
* (.aidlc/knowledge/index.db, disposable cache per knowledge/index/
|
|
4
4
|
* sqlite-index.ts) is git-ignored via a nested .gitignore.
|
|
5
5
|
*
|
|
6
|
+
* Also removes the self-ignore line older versions wrote
|
|
7
|
+
* (nested-gitignores-ignore-themselves/AC-3).
|
|
8
|
+
*
|
|
6
9
|
* Pending only when .aidlc/knowledge/ already exists — never creates the
|
|
7
10
|
* feature directory for repos not using the knowledge graph.
|
|
11
|
+
*
|
|
12
|
+
* The ignore lines live in knowledge/gitignore.ts, because opening the index
|
|
13
|
+
* applies them too.
|
|
8
14
|
*/
|
|
9
15
|
import { existsSync } from 'node:fs';
|
|
10
16
|
import { join } from 'node:path';
|
|
11
|
-
import {
|
|
12
|
-
|
|
17
|
+
import { describeIgnoreWork, missingIgnoreLines, removeSelfIgnoreLines, selfIgnoreLineCount, summarizeIgnoreWork, } from './nested-gitignore.js';
|
|
18
|
+
import { KNOWLEDGE_IGNORE_LINES, ensureKnowledgeGitignore, knowledgeIgnorePath, } from '../../knowledge/gitignore.js';
|
|
19
|
+
export { KNOWLEDGE_IGNORE_LINES };
|
|
20
|
+
const REL_PATH = '.aidlc/knowledge/.gitignore';
|
|
13
21
|
function knowledgeDir(projectRoot) {
|
|
14
22
|
return join(projectRoot, '.aidlc', 'knowledge');
|
|
15
23
|
}
|
|
@@ -23,21 +31,20 @@ export const knowledgeGitignore = {
|
|
|
23
31
|
if (!existsSync(knowledgeDir(ctx.projectRoot))) {
|
|
24
32
|
return { applicable: true, pending: false };
|
|
25
33
|
}
|
|
26
|
-
const ignore =
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
34
|
+
const ignore = knowledgeIgnorePath(ctx.projectRoot);
|
|
35
|
+
const description = describeIgnoreWork(REL_PATH, selfIgnoreLineCount(ignore), missingIgnoreLines(ignore, KNOWLEDGE_IGNORE_LINES));
|
|
36
|
+
if (description === null)
|
|
29
37
|
return { applicable: true, pending: false };
|
|
30
|
-
return {
|
|
31
|
-
applicable: true,
|
|
32
|
-
pending: true,
|
|
33
|
-
description: `would add ${missing.length} line(s) to .aidlc/knowledge/.gitignore (${missing.join(', ')})`,
|
|
34
|
-
};
|
|
38
|
+
return { applicable: true, pending: true, description };
|
|
35
39
|
},
|
|
36
40
|
apply(ctx) {
|
|
37
|
-
|
|
41
|
+
// Remove first: a file that held only the self-ignore line is then empty, and the
|
|
42
|
+
// lines are written into it without a leading blank line.
|
|
43
|
+
const removed = removeSelfIgnoreLines(knowledgeIgnorePath(ctx.projectRoot));
|
|
44
|
+
const added = ensureKnowledgeGitignore(ctx.projectRoot);
|
|
38
45
|
return {
|
|
39
|
-
changed: added.length > 0,
|
|
40
|
-
summary:
|
|
46
|
+
changed: removed > 0 || added.length > 0,
|
|
47
|
+
summary: summarizeIgnoreWork(REL_PATH, removed, added),
|
|
41
48
|
};
|
|
42
49
|
},
|
|
43
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knowledge-gitignore.js","sourceRoot":"","sources":["../../../src/doctor/migrations/knowledge-gitignore.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"knowledge-gitignore.js","sourceRoot":"","sources":["../../../src/doctor/migrations/knowledge-gitignore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAElC,MAAM,QAAQ,GAAG,6BAA6B,CAAC;AAE/C,SAAS,YAAY,CAAC,WAAmB;IACv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Q,EAAE,OAAO,EAAE,KAAK,CAAC;SACvD,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1,14 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared helper for nested selective .gitignore migrations (AC-15, AC-16).
|
|
3
3
|
*
|
|
4
|
-
* Ignore rules live in a .gitignore INSIDE the governed directory
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* Ignore rules live in a .gitignore INSIDE the governed directory — the
|
|
5
|
+
* project root .gitignore is never modified. Lines are SELECTIVE, not '*':
|
|
6
|
+
* directories like .aidlc/cost/ mix ephemera with files that must remain
|
|
7
|
+
* trackable (unattributed.ndjson). Do not simplify to '*'.
|
|
8
|
+
*
|
|
9
|
+
* The files never list themselves. They are committed so a new worktree gets
|
|
10
|
+
* them from git before any `aidlc` command runs there; older versions wrote a
|
|
11
|
+
* `.gitignore` line, which these helpers remove
|
|
12
|
+
* (nested-gitignores-ignore-themselves/AC-3).
|
|
9
13
|
*/
|
|
10
14
|
/** Lines from `ignorePath` missing the required entries (empty = healthy). */
|
|
11
15
|
export declare function missingIgnoreLines(ignorePath: string, required: string[]): string[];
|
|
12
16
|
/** Idempotently ensure `required` lines exist in `ignorePath`. Returns lines added. */
|
|
13
17
|
export declare function ensureIgnoreLines(ignorePath: string, required: string[]): string[];
|
|
18
|
+
/** The self-ignore lines in `ignorePath`: lines that, trimmed, are exactly `.gitignore`. 0 when absent. */
|
|
19
|
+
export declare function selfIgnoreLineCount(ignorePath: string): number;
|
|
20
|
+
/**
|
|
21
|
+
* Delete every self-ignore line, keeping every other line byte for byte, in order,
|
|
22
|
+
* including a trailing newline and any `\r`. Writes only when something is removed.
|
|
23
|
+
* Returns the number of lines removed.
|
|
24
|
+
*/
|
|
25
|
+
export declare function removeSelfIgnoreLines(ignorePath: string): number;
|
|
26
|
+
/**
|
|
27
|
+
* The one-line "would ..." for a nested ignore file, naming each part that applies
|
|
28
|
+
* (nested-gitignores-ignore-themselves/AC-4). `null` when there is nothing to do.
|
|
29
|
+
*/
|
|
30
|
+
export declare function describeIgnoreWork(relPath: string, selfIgnore: number, missing: string[]): string | null;
|
|
31
|
+
/** The one-line apply summary for a nested ignore file. */
|
|
32
|
+
export declare function summarizeIgnoreWork(relPath: string, removed: number, added: string[]): string;
|
|
14
33
|
//# sourceMappingURL=nested-gitignore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nested-gitignore.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/nested-gitignore.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"nested-gitignore.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/nested-gitignore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CASnF;AAED,uFAAuF;AACvF,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAYlF;AAOD,2GAA2G;AAC3G,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAG9D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAShE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAOxG;AAED,2DAA2D;AAC3D,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAK7F"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared helper for nested selective .gitignore migrations (AC-15, AC-16).
|
|
3
3
|
*
|
|
4
|
-
* Ignore rules live in a .gitignore INSIDE the governed directory
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* Ignore rules live in a .gitignore INSIDE the governed directory — the
|
|
5
|
+
* project root .gitignore is never modified. Lines are SELECTIVE, not '*':
|
|
6
|
+
* directories like .aidlc/cost/ mix ephemera with files that must remain
|
|
7
|
+
* trackable (unattributed.ndjson). Do not simplify to '*'.
|
|
8
|
+
*
|
|
9
|
+
* The files never list themselves. They are committed so a new worktree gets
|
|
10
|
+
* them from git before any `aidlc` command runs there; older versions wrote a
|
|
11
|
+
* `.gitignore` line, which these helpers remove
|
|
12
|
+
* (nested-gitignores-ignore-themselves/AC-3).
|
|
9
13
|
*/
|
|
10
14
|
import { existsSync, mkdirSync, readFileSync, appendFileSync, writeFileSync } from 'node:fs';
|
|
11
15
|
import { dirname } from 'node:path';
|
|
@@ -28,8 +32,60 @@ export function ensureIgnoreLines(ignorePath, required) {
|
|
|
28
32
|
writeFileSync(ignorePath, missing.join('\n') + '\n', 'utf8');
|
|
29
33
|
return missing;
|
|
30
34
|
}
|
|
31
|
-
const
|
|
35
|
+
const content = readFileSync(ignorePath, 'utf8');
|
|
36
|
+
const prefix = content === '' || content.endsWith('\n') ? '' : '\n';
|
|
32
37
|
appendFileSync(ignorePath, prefix + missing.join('\n') + '\n', 'utf8');
|
|
33
38
|
return missing;
|
|
34
39
|
}
|
|
40
|
+
/** A line that, trimmed, is exactly `.gitignore`. `/.gitignore` and other patterns are the user's. */
|
|
41
|
+
function isSelfIgnoreLine(line) {
|
|
42
|
+
return line.trim() === '.gitignore';
|
|
43
|
+
}
|
|
44
|
+
/** The self-ignore lines in `ignorePath`: lines that, trimmed, are exactly `.gitignore`. 0 when absent. */
|
|
45
|
+
export function selfIgnoreLineCount(ignorePath) {
|
|
46
|
+
if (!existsSync(ignorePath))
|
|
47
|
+
return 0;
|
|
48
|
+
return readFileSync(ignorePath, 'utf8').split('\n').filter(isSelfIgnoreLine).length;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Delete every self-ignore line, keeping every other line byte for byte, in order,
|
|
52
|
+
* including a trailing newline and any `\r`. Writes only when something is removed.
|
|
53
|
+
* Returns the number of lines removed.
|
|
54
|
+
*/
|
|
55
|
+
export function removeSelfIgnoreLines(ignorePath) {
|
|
56
|
+
if (!existsSync(ignorePath))
|
|
57
|
+
return 0;
|
|
58
|
+
// Split and rejoin on the same separator: every kept line, `\r` included, comes
|
|
59
|
+
// back exactly as it was (nested-gitignores-ignore-themselves/AC-3).
|
|
60
|
+
const lines = readFileSync(ignorePath, 'utf8').split('\n');
|
|
61
|
+
const kept = lines.filter((l) => !isSelfIgnoreLine(l));
|
|
62
|
+
const removed = lines.length - kept.length;
|
|
63
|
+
if (removed > 0)
|
|
64
|
+
writeFileSync(ignorePath, kept.join('\n'), 'utf8');
|
|
65
|
+
return removed;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The one-line "would ..." for a nested ignore file, naming each part that applies
|
|
69
|
+
* (nested-gitignores-ignore-themselves/AC-4). `null` when there is nothing to do.
|
|
70
|
+
*/
|
|
71
|
+
export function describeIgnoreWork(relPath, selfIgnore, missing) {
|
|
72
|
+
const parts = [];
|
|
73
|
+
if (selfIgnore > 0)
|
|
74
|
+
parts.push('remove the self-ignore line');
|
|
75
|
+
if (missing.length > 0)
|
|
76
|
+
parts.push(`add ${missing.length} line(s)`);
|
|
77
|
+
if (parts.length === 0)
|
|
78
|
+
return null;
|
|
79
|
+
const detail = missing.length > 0 ? ` (${missing.join(', ')})` : '';
|
|
80
|
+
return `would ${parts.join(' and ')} ${selfIgnore > 0 && missing.length === 0 ? 'from' : 'to'} ${relPath}${detail}`;
|
|
81
|
+
}
|
|
82
|
+
/** The one-line apply summary for a nested ignore file. */
|
|
83
|
+
export function summarizeIgnoreWork(relPath, removed, added) {
|
|
84
|
+
const parts = [];
|
|
85
|
+
if (removed > 0)
|
|
86
|
+
parts.push(`removed ${removed} self-ignore line(s)`);
|
|
87
|
+
if (added.length > 0 || removed === 0)
|
|
88
|
+
parts.push(`added ${added.length} line(s)`);
|
|
89
|
+
return `${parts.join(' and ')} ${removed > 0 && added.length === 0 ? 'from' : 'to'} ${relPath}`;
|
|
90
|
+
}
|
|
35
91
|
//# sourceMappingURL=nested-gitignore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nested-gitignore.js","sourceRoot":"","sources":["../../../src/doctor/migrations/nested-gitignore.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"nested-gitignore.js","sourceRoot":"","sources":["../../../src/doctor/migrations/nested-gitignore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7F,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,8EAA8E;AAC9E,MAAM,UAAU,kBAAkB,CAAC,UAAkB,EAAE,QAAkB;IACvE,MAAM,QAAQ,GAAG,UAAU,CAAC,UAAU,CAAC;QACrC,CAAC,CAAC,IAAI,GAAG,CACL,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC;aAC7B,KAAK,CAAC,IAAI,CAAC;aACX,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CACxB;QACH,CAAC,CAAC,IAAI,GAAG,EAAU,CAAC;IACtB,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAClD,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,iBAAiB,CAAC,UAAkB,EAAE,QAAkB;IACtE,MAAM,O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,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,mBAAmB,CAAC,OAAe,EAAE,OAAe,EAAE,KAAe;IACnF,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,OAAO,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,WAAW,OAAO,sBAAsB,CAAC,CAAC;IACtE,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,KAAK,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,MAAM,UAAU,CAAC,CAAC;IACnF,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,OAAO,EAAE,CAAC;AAClG,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tracked-nested-ignored migration (report tier): names files git tracks under
|
|
3
|
+
* `.aidlc/knowledge/` or `.aidlc/cost/` that one of that directory's ignore lines
|
|
4
|
+
* covers. An ignore rule does nothing for a file git already tracks, so a
|
|
5
|
+
* repository that committed `capture.sh` before the rule existed keeps
|
|
6
|
+
* committing it (nested-gitignores-ignore-themselves/AC-9).
|
|
7
|
+
*
|
|
8
|
+
* It reads only. What to do about a committed file is the user's call, and the
|
|
9
|
+
* report never gates doctor's exit code (nested-gitignores-ignore-themselves/AC-10).
|
|
10
|
+
*
|
|
11
|
+
* Matched in code against the constants, not with `git ls-files -ci
|
|
12
|
+
* --exclude-standard`: that reads every ignore source — the root file,
|
|
13
|
+
* `info/exclude`, global excludes — and would report paths the user's own root
|
|
14
|
+
* lines cover.
|
|
15
|
+
*/
|
|
16
|
+
import type { Migration } from '../types.js';
|
|
17
|
+
/**
|
|
18
|
+
* True when `relPath` (relative to the governed dir) matches one plain gitignore line.
|
|
19
|
+
*
|
|
20
|
+
* Gitignore's meaning for a line with no glob character and no inner slash, which
|
|
21
|
+
* every line of both lists is: a trailing `/` matches a directory at any depth,
|
|
22
|
+
* anything else matches a file or directory by name at any depth.
|
|
23
|
+
*/
|
|
24
|
+
export declare function matchesIgnoreLine(relPath: string, line: string): boolean;
|
|
25
|
+
export declare const trackedNestedIgnored: Migration;
|
|
26
|
+
//# sourceMappingURL=tracked-nested-ignored.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracked-nested-ignored.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/tracked-nested-ignored.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAW7C;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAOxE;AAOD,eAAO,MAAM,oBAAoB,EAAE,SAyBlC,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tracked-nested-ignored migration (report tier): names files git tracks under
|
|
3
|
+
* `.aidlc/knowledge/` or `.aidlc/cost/` that one of that directory's ignore lines
|
|
4
|
+
* covers. An ignore rule does nothing for a file git already tracks, so a
|
|
5
|
+
* repository that committed `capture.sh` before the rule existed keeps
|
|
6
|
+
* committing it (nested-gitignores-ignore-themselves/AC-9).
|
|
7
|
+
*
|
|
8
|
+
* It reads only. What to do about a committed file is the user's call, and the
|
|
9
|
+
* report never gates doctor's exit code (nested-gitignores-ignore-themselves/AC-10).
|
|
10
|
+
*
|
|
11
|
+
* Matched in code against the constants, not with `git ls-files -ci
|
|
12
|
+
* --exclude-standard`: that reads every ignore source — the root file,
|
|
13
|
+
* `info/exclude`, global excludes — and would report paths the user's own root
|
|
14
|
+
* lines cover.
|
|
15
|
+
*/
|
|
16
|
+
import { trackedFiles } from '../git.js';
|
|
17
|
+
import { COST_IGNORE_LINES } from '../../cost/gitignore.js';
|
|
18
|
+
import { KNOWLEDGE_IGNORE_LINES } from '../../knowledge/gitignore.js';
|
|
19
|
+
import { EPHEMERA_PATHSPECS } from './untrack-cost-ephemera.js';
|
|
20
|
+
const GOVERNED = [
|
|
21
|
+
{ dir: '.aidlc/knowledge', lines: KNOWLEDGE_IGNORE_LINES },
|
|
22
|
+
{ dir: '.aidlc/cost', lines: COST_IGNORE_LINES },
|
|
23
|
+
];
|
|
24
|
+
/**
|
|
25
|
+
* True when `relPath` (relative to the governed dir) matches one plain gitignore line.
|
|
26
|
+
*
|
|
27
|
+
* Gitignore's meaning for a line with no glob character and no inner slash, which
|
|
28
|
+
* every line of both lists is: a trailing `/` matches a directory at any depth,
|
|
29
|
+
* anything else matches a file or directory by name at any depth.
|
|
30
|
+
*/
|
|
31
|
+
export function matchesIgnoreLine(relPath, line) {
|
|
32
|
+
const segments = relPath.split('/');
|
|
33
|
+
if (line.endsWith('/')) {
|
|
34
|
+
const name = line.slice(0, -1);
|
|
35
|
+
return segments.slice(0, -1).includes(name);
|
|
36
|
+
}
|
|
37
|
+
return segments.includes(line);
|
|
38
|
+
}
|
|
39
|
+
/** Left to untrack-cost-ephemera, which already offers to untrack it: one condition, one voice. */
|
|
40
|
+
function ownedByUntrack(path) {
|
|
41
|
+
return EPHEMERA_PATHSPECS.some((spec) => path === spec || path.startsWith(`${spec}/`));
|
|
42
|
+
}
|
|
43
|
+
export const trackedNestedIgnored = {
|
|
44
|
+
id: 'tracked-nested-ignored',
|
|
45
|
+
tier: 'report',
|
|
46
|
+
check(ctx) {
|
|
47
|
+
if (ctx.gitCommonDir === null) {
|
|
48
|
+
return { applicable: false, reason: 'requires a git repository' };
|
|
49
|
+
}
|
|
50
|
+
const tracked = trackedFiles(ctx.projectRoot, GOVERNED.map((g) => g.dir));
|
|
51
|
+
const matched = tracked.filter((path) => {
|
|
52
|
+
if (ownedByUntrack(path))
|
|
53
|
+
return false;
|
|
54
|
+
const governed = GOVERNED.find((g) => path.startsWith(`${g.dir}/`));
|
|
55
|
+
if (!governed)
|
|
56
|
+
return false;
|
|
57
|
+
const rel = path.slice(governed.dir.length + 1);
|
|
58
|
+
return governed.lines.some((line) => matchesIgnoreLine(rel, line));
|
|
59
|
+
});
|
|
60
|
+
if (matched.length === 0)
|
|
61
|
+
return { applicable: true, pending: false };
|
|
62
|
+
return {
|
|
63
|
+
applicable: true,
|
|
64
|
+
pending: true,
|
|
65
|
+
description: `${matched.length} tracked file(s) match a nested .gitignore line — git keeps tracking them until you untrack them: ${matched.join(', ')}`,
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=tracked-nested-ignored.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracked-nested-ignored.js","sourceRoot":"","sources":["../../../src/doctor/migrations/tracked-nested-ignored.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,QAAQ,GAAuC;IACnD,EAAE,GAAG,EAAE,kBAAkB,EAAE,KAAK,EAAE,sBAAsB,EAAE;IAC1D,EAAE,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,iBAAiB,EAAE;CACjD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAe,EAAE,IAAY;IAC7D,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACpC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CA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,MAAM,GAAG,CAAC,CAAC,CAAC;YAChD,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,iBAAiB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;QACH,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QACtE,OAAO;YACL,UAAU,EAAE,IAAI;YAChB,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,GAAG,OAAO,CAAC,MAAM,qGAAqG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;SACxJ,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/knowledge/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAiB,MAAM,yBAAyB,CAAC;AAGrE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/knowledge/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAiB,MAAM,yBAAyB,CAAC;AAGrE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC;;;;;;GAMG;AACH,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,WAAW,CAAC;IACnB,MAAM,EAAE,eAAe,CAAC;IACxB,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,SAAS,EAAE,iBAAiB,CAAC;IAC7B,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB;;;;;;;;;;OAUG;IACH,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC1B,KAAK,IAAI,IAAI,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,eAAe,CAwElE;AAED,2DAA2D;AAC3D,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAE5D"}
|
package/dist/knowledge/engine.js
CHANGED
|
@@ -25,6 +25,7 @@ import { KnowledgeReader } from './reader.js';
|
|
|
25
25
|
import { ContextGenerator } from './context-generator.js';
|
|
26
26
|
import { StalenessDetector } from './staleness.js';
|
|
27
27
|
import { KNOWLEDGE_DIR } from './types.js';
|
|
28
|
+
import { ensureKnowledgeGitignore } from './gitignore.js';
|
|
28
29
|
/**
|
|
29
30
|
* Relative path of the knowledge directory within a project.
|
|
30
31
|
*
|
|
@@ -43,6 +44,10 @@ export function openKnowledge(projectRoot) {
|
|
|
43
44
|
const source = new YamlSourceStore(knowledgeDir);
|
|
44
45
|
const warnings = [];
|
|
45
46
|
const dbPath = join(knowledgeDir, INDEX_DB_FILE);
|
|
47
|
+
// Ignore before the database exists, so `git add -A` can never pick it up — not
|
|
48
|
+
// even before doctor has run (nested-gitignores-ignore-themselves/AC-6). The
|
|
49
|
+
// rebuild below reuses this directory, so one call covers both opens.
|
|
50
|
+
ensureKnowledgeGitignore(projectRoot);
|
|
46
51
|
let index;
|
|
47
52
|
try {
|
|
48
53
|
index = new SqliteIndex(knowledgeDir);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../../src/knowledge/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../../src/knowledge/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAE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E,OAAO;QACL,MAAM;QACN,KAAK;QACL,MAAM;QACN,MAAM;QACN,OAAO;QACP,SAAS;QACT,QAAQ;QACR,QAAQ;QACR,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE;KAC3B,CAAC;AACJ,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,eAAe,CAAC,WAAmB;IACjD,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The selective .aidlc/knowledge/.gitignore (update-spring-clean/AC-16).
|
|
3
|
+
*
|
|
4
|
+
* `index.db` is a disposable cache rebuilt from the YAML sources
|
|
5
|
+
* (index/sqlite-index.ts), and SQLite writes `-wal` and `-shm` beside it
|
|
6
|
+
* (nested-gitignores-ignore-themselves/AC-2). The YAML sources stay trackable,
|
|
7
|
+
* so the lines are selective, never '*'.
|
|
8
|
+
*
|
|
9
|
+
* The file does not list itself: it is committed, so a new worktree gets it
|
|
10
|
+
* from git before any `aidlc` command runs there. The knowledge-gitignore
|
|
11
|
+
* doctor migration writes it, and so does `openKnowledge`, so the database is
|
|
12
|
+
* never on disk without it (nested-gitignores-ignore-themselves/AC-6).
|
|
13
|
+
*/
|
|
14
|
+
export declare const KNOWLEDGE_IGNORE_LINES: string[];
|
|
15
|
+
export declare function knowledgeIgnorePath(projectRoot: string): string;
|
|
16
|
+
/** Idempotently write the knowledge ignore lines. Returns the lines added. */
|
|
17
|
+
export declare function ensureKnowledgeGitignore(projectRoot: string): string[];
|
|
18
|
+
//# sourceMappingURL=gitignore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitignore.d.ts","sourceRoot":"","sources":["../../src/knowledge/gitignore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,eAAO,MAAM,sBAAsB,UAA+C,CAAC;AAEnF,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,8EAA8E;AAC9E,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAEtE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The selective .aidlc/knowledge/.gitignore (update-spring-clean/AC-16).
|
|
3
|
+
*
|
|
4
|
+
* `index.db` is a disposable cache rebuilt from the YAML sources
|
|
5
|
+
* (index/sqlite-index.ts), and SQLite writes `-wal` and `-shm` beside it
|
|
6
|
+
* (nested-gitignores-ignore-themselves/AC-2). The YAML sources stay trackable,
|
|
7
|
+
* so the lines are selective, never '*'.
|
|
8
|
+
*
|
|
9
|
+
* The file does not list itself: it is committed, so a new worktree gets it
|
|
10
|
+
* from git before any `aidlc` command runs there. The knowledge-gitignore
|
|
11
|
+
* doctor migration writes it, and so does `openKnowledge`, so the database is
|
|
12
|
+
* never on disk without it (nested-gitignores-ignore-themselves/AC-6).
|
|
13
|
+
*/
|
|
14
|
+
import { join } from 'node:path';
|
|
15
|
+
import { ensureIgnoreLines } from '../doctor/migrations/nested-gitignore.js';
|
|
16
|
+
import { KNOWLEDGE_DIR } from './types.js';
|
|
17
|
+
export const KNOWLEDGE_IGNORE_LINES = ['index.db', 'index.db-wal', 'index.db-shm'];
|
|
18
|
+
export function knowledgeIgnorePath(projectRoot) {
|
|
19
|
+
return join(projectRoot, KNOWLEDGE_DIR, '.gitignore');
|
|
20
|
+
}
|
|
21
|
+
/** Idempotently write the knowledge ignore lines. Returns the lines added. */
|
|
22
|
+
export function ensureKnowledgeGitignore(projectRoot) {
|
|
23
|
+
return ensureIgnoreLines(knowledgeIgnorePath(projectRoot), KNOWLEDGE_IGNORE_LINES);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=gitignore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitignore.js","sourceRoot":"","sources":["../../src/knowledge/gitignore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,UAAU,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;AAEnF,MAAM,UAAU,mBAAmB,CAAC,WAAmB;IACrD,OAAO,IAAI,CAAC,WAAW,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;AACxD,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,wBAAwB,CAAC,WAAmB;IAC1D,OAAO,iBAAiB,CAAC,mBAAmB,CAAC,WAAW,CAAC,EAAE,sBAAsB,CAAC,CAAC;AACrF,CAAC"}
|
package/dist/roadmap/next.d.ts
CHANGED
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
*
|
|
13
13
|
* With `autopilot`, items whose `run` is `attended` — or unreadable — are left for a
|
|
14
14
|
* person (autopilot-or-attended-field/AC-1..AC-3); without it they are offered as before,
|
|
15
|
-
* because a person can pick them (AC-4).
|
|
15
|
+
* because a person can pick them (AC-4). Also with `autopilot`, an item that is not ready to
|
|
16
|
+
* build (`itemReadiness`) is skipped `not-ready`, after every other reason — a person picking
|
|
17
|
+
* an item reads its body, so without `autopilot` nothing checks it
|
|
18
|
+
* (autopilot-refuses-unready-items/AC-1, AC-9, AC-10).
|
|
16
19
|
*
|
|
17
20
|
* @module
|
|
18
21
|
*/
|
|
@@ -26,7 +29,7 @@ export interface NextCandidate {
|
|
|
26
29
|
}
|
|
27
30
|
export interface Skipped {
|
|
28
31
|
file: string;
|
|
29
|
-
reason: 'bad-priority' | 'blocked' | 'promoted' | 'attended' | 'bad-run';
|
|
32
|
+
reason: 'bad-priority' | 'blocked' | 'promoted' | 'attended' | 'bad-run' | 'not-ready';
|
|
30
33
|
detail: string;
|
|
31
34
|
}
|
|
32
35
|
/**
|
|
@@ -59,7 +62,7 @@ export interface NextResult {
|
|
|
59
62
|
}
|
|
60
63
|
export type RunMode = 'autopilot' | 'attended';
|
|
61
64
|
export interface PickOptions {
|
|
62
|
-
/** Leave `run: attended
|
|
65
|
+
/** Leave `run: attended`, malformed-`run` and not-ready items out of the ready order. */
|
|
63
66
|
autopilot?: boolean;
|
|
64
67
|
}
|
|
65
68
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../src/roadmap/next.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../src/roadmap/next.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,OAAO,EAA8C,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC7F,OAAO,EAA4D,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAGxG,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,cAAc,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,CAAC;IACvF,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,GAAG,MAAM,GAAG,IAAI,CAErF;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC;IAC3B,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,yGAAyG;IACzG,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,EAAE,CAAC;IACnD,+HAA+H;IAC/H,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC3C,uHAAuH;IACvH,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B,4FAA4F;IAC5F,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG,UAAU,CAAC;AAE/C,MAAM,WAAW,WAAW;IAC1B,yFAAyF;IACzF,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,GAAG,KAAK,CAGtD;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,GAAG,KAAK,CAIjE;AAED,wFAAwF;AACxF,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,aAAa,GAAG,MAAM,CAO5E;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,UAAU,CAExE;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,UAAU,CAiG3E"}
|
package/dist/roadmap/next.js
CHANGED
|
@@ -12,12 +12,17 @@
|
|
|
12
12
|
*
|
|
13
13
|
* With `autopilot`, items whose `run` is `attended` — or unreadable — are left for a
|
|
14
14
|
* person (autopilot-or-attended-field/AC-1..AC-3); without it they are offered as before,
|
|
15
|
-
* because a person can pick them (AC-4).
|
|
15
|
+
* because a person can pick them (AC-4). Also with `autopilot`, an item that is not ready to
|
|
16
|
+
* build (`itemReadiness`) is skipped `not-ready`, after every other reason — a person picking
|
|
17
|
+
* an item reads its body, so without `autopilot` nothing checks it
|
|
18
|
+
* (autopilot-refuses-unready-items/AC-1, AC-9, AC-10).
|
|
16
19
|
*
|
|
17
20
|
* @module
|
|
18
21
|
*/
|
|
22
|
+
import { resolve } from 'node:path';
|
|
19
23
|
import { assignedId, milestonesView, readMilestones } from './milestones.js';
|
|
20
24
|
import { frontmatter, listStatusAt, roadmapRoot, ROADMAP_STATUSES } from './paths.js';
|
|
25
|
+
import { itemReadiness, readinessRoots } from './ready.js';
|
|
21
26
|
/**
|
|
22
27
|
* Why `start --roadmap-item` refuses this item, or null when it would take it.
|
|
23
28
|
*
|
|
@@ -80,6 +85,8 @@ export function pickNextAt(root, opts = {}) {
|
|
|
80
85
|
const skipped = [];
|
|
81
86
|
const unranked = [];
|
|
82
87
|
const badRun = [];
|
|
88
|
+
// `root` is `<project>/.aidlc/roadmap`.
|
|
89
|
+
const roots = opts.autopilot ? readinessRoots(resolve(root, '..', '..')) : [];
|
|
83
90
|
for (const item of listStatusAt(root, 'backlog')) {
|
|
84
91
|
const data = frontmatter(item.raw)?.data ?? {};
|
|
85
92
|
const priority = parsePriority(data.priority);
|
|
@@ -120,6 +127,15 @@ export function pickNextAt(root, opts = {}) {
|
|
|
120
127
|
: { file: item.filename, reason: 'bad-run', detail: runDetail });
|
|
121
128
|
continue;
|
|
122
129
|
}
|
|
130
|
+
// Last of all, so only items autopilot would otherwise start are checked
|
|
131
|
+
// (autopilot-refuses-unready-items/AC-10).
|
|
132
|
+
if (opts.autopilot) {
|
|
133
|
+
const readiness = itemReadiness(item.raw, roots);
|
|
134
|
+
if (!readiness.ready) {
|
|
135
|
+
skipped.push({ file: item.filename, reason: 'not-ready', detail: readiness.detail });
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
123
139
|
ready.push({ file: item.filename, id: item.id, title: item.title, priority });
|
|
124
140
|
}
|
|
125
141
|
ready.sort(compareCandidates);
|
package/dist/roadmap/next.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.js","sourceRoot":"","sources":["../../src/roadmap/next.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"next.js","sourceRoot":"","sources":["../../src/roadmap/next.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAkB,MAAM,iBAAiB,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAoB,MAAM,YAAY,CAAC;AACxG,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAe3D;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAqC;IACpE,OAAO,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,wBAAwB,IAAI,CAAC,UAAU,GAAG,CAAC;AACtF,CAAC;AAuBD;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAY;IACnC,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,WAAW,CAAC;IAC1D,OAAO,GAAG,KAAK,WAAW,IAAI,GAAG,KAAK,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;AACjE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,GAAY;IACxC,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACnD,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,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+
* Ready means: at least one active `AC-n` line, read with the grammar the testing gate
|
|
5
|
+
* reads; at least one of those lines names a file path; and every path they name exists,
|
|
6
|
+
* or its parent folder does — an AC may name a file it creates. Presence and shape only:
|
|
7
|
+
* nothing here judges whether the criteria are any good.
|
|
8
|
+
*
|
|
9
|
+
* One rule, called by `pickNextAt` under `--autopilot` and by triage, so autopilot's skip
|
|
10
|
+
* and triage's warning cannot disagree (design D1).
|
|
11
|
+
*
|
|
12
|
+
* Read-only and inside the repository: `statSync` on paths built from the item's own
|
|
13
|
+
* tokens, never a read of a named file and never a write. A token that is absolute, starts
|
|
14
|
+
* with `~` or has a `..` segment is never probed (secure-defaults, path traversal).
|
|
15
|
+
*
|
|
16
|
+
* @module
|
|
17
|
+
*/
|
|
18
|
+
export type Readiness = {
|
|
19
|
+
ready: true;
|
|
20
|
+
} | {
|
|
21
|
+
ready: false;
|
|
22
|
+
detail: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The roots a named path is looked up under: the project, then the repository top when the
|
|
26
|
+
* project sits below it. Found by walking up for `.git`, not by asking git (design D3).
|
|
27
|
+
*/
|
|
28
|
+
export declare function readinessRoots(projectRoot: string): string[];
|
|
29
|
+
/** The path tokens one AC line names, in order, AC-7 exclusions removed (AC-3, AC-7). */
|
|
30
|
+
export declare function pathTokens(line: string): string[];
|
|
31
|
+
/**
|
|
32
|
+
* True when the token, or its parent folder, exists under one of the roots. With a glob or
|
|
33
|
+
* placeholder segment, the folders before the first one must exist — the parent-folder
|
|
34
|
+
* allowance does not apply to them, so `.aidlc/stat/<instance>/x` fails (AC-6, design D5).
|
|
35
|
+
*/
|
|
36
|
+
export declare function pathExists(token: string, roots: string[]): boolean;
|
|
37
|
+
/** Ready to build, or the first failing rule as `not ready: …` (AC-1, AC-2, AC-3). */
|
|
38
|
+
export declare function itemReadiness(raw: string, roots: string[]): Readiness;
|
|
39
|
+
//# sourceMappingURL=ready.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ready.d.ts","sourceRoot":"","sources":["../../src/roadmap/ready.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAQH,MAAM,MAAM,SAAS,GAAG;IAAE,KAAK,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAiB3E;;;GAGG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAM5D;AAED,yFAAyF;AACzF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAYjD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAQlE;AAED,sFAAsF;AACtF,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,CAkBrE"}
|