@aperant/framework 0.8.6 → 0.9.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 +103 -0
- package/agents/apt-pr-review-fixer.md +9 -4
- package/dist/cli/commands/init.mjs +140 -22
- package/dist/cli/commands/init.mjs.map +1 -1
- package/dist/cli/commands/toolchain-detect.d.mts.map +1 -1
- package/dist/cli/commands/toolchain-detect.mjs +44 -0
- package/dist/cli/commands/toolchain-detect.mjs.map +1 -1
- package/dist/cli/commands/triage.d.mts.map +1 -1
- package/dist/cli/commands/triage.mjs +346 -13
- package/dist/cli/commands/triage.mjs.map +1 -1
- package/dist/cli/commands/uninstall.d.mts.map +1 -1
- package/dist/cli/commands/uninstall.mjs +11 -8
- package/dist/cli/commands/uninstall.mjs.map +1 -1
- package/dist/cli/install/manifest.d.mts +13 -0
- package/dist/cli/install/manifest.d.mts.map +1 -1
- package/dist/cli/install/manifest.mjs +5 -0
- package/dist/cli/install/manifest.mjs.map +1 -1
- package/dist/cli/install/pipeline.d.mts +15 -0
- package/dist/cli/install/pipeline.d.mts.map +1 -1
- package/dist/cli/install/pipeline.mjs +27 -0
- package/dist/cli/install/pipeline.mjs.map +1 -1
- package/dist/cli/install/runtime-detect.d.mts +26 -0
- package/dist/cli/install/runtime-detect.d.mts.map +1 -1
- package/dist/cli/install/runtime-detect.mjs +27 -0
- package/dist/cli/install/runtime-detect.mjs.map +1 -1
- package/dist/cli/install/transforms/codex.d.mts +1 -1
- package/dist/cli/install/transforms/codex.d.mts.map +1 -1
- package/dist/cli/install/transforms/codex.mjs +43 -2
- package/dist/cli/install/transforms/codex.mjs.map +1 -1
- package/dist/cli/install/version-header.d.mts.map +1 -1
- package/dist/cli/install/version-header.mjs +7 -1
- package/dist/cli/install/version-header.mjs.map +1 -1
- package/dist/cli/util/aperant-section.d.mts +12 -0
- package/dist/cli/util/aperant-section.d.mts.map +1 -1
- package/dist/cli/util/aperant-section.mjs +12 -0
- package/dist/cli/util/aperant-section.mjs.map +1 -1
- package/dist/cli/util/copy.d.mts +27 -0
- package/dist/cli/util/copy.d.mts.map +1 -1
- package/dist/cli/util/copy.mjs +49 -5
- package/dist/cli/util/copy.mjs.map +1 -1
- package/dist/cli/verify-proof/idl/index.d.mts +12 -1
- package/dist/cli/verify-proof/idl/index.d.mts.map +1 -1
- package/dist/cli/verify-proof/idl/index.mjs +50 -1
- package/dist/cli/verify-proof/idl/index.mjs.map +1 -1
- package/dist/cli/verify-proof/resolver.d.mts.map +1 -1
- package/dist/cli/verify-proof/resolver.mjs +51 -1
- package/dist/cli/verify-proof/resolver.mjs.map +1 -1
- package/dist/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/plugin/agents/apt-pr-review-fixer.md +9 -4
- package/dist/plugin/skills/apt-pr-review/SKILL.md +52 -15
- package/dist/plugin/skills/apt-setup/SKILL.md +7 -6
- package/dist/plugin/skills/apt-triage/SKILL.md +8 -6
- package/dist/plugin/skills/apt-update/SKILL.md +1 -1
- package/package.json +1 -1
- package/skills/apt-pr-review/SKILL.md +52 -15
- package/skills/apt-setup/SKILL.md +7 -6
- package/skills/apt-triage/SKILL.md +8 -6
- package/skills/apt-update/SKILL.md +1 -1
- package/src/cli/commands/init.mjs +144 -19
- package/src/cli/commands/toolchain-detect.mjs +44 -0
- package/src/cli/commands/triage.mjs +352 -11
- package/src/cli/commands/uninstall.mjs +11 -8
- package/src/cli/install/manifest.mjs +5 -0
- package/src/cli/install/pipeline.mjs +28 -0
- package/src/cli/install/runtime-detect.mjs +27 -0
- package/src/cli/install/transforms/codex.mjs +51 -2
- package/src/cli/install/version-header.mjs +7 -1
- package/src/cli/util/aperant-section.mjs +14 -0
- package/src/cli/util/copy.mjs +53 -8
- package/src/cli/verify-proof/idl/index.mjs +49 -11
- package/src/cli/verify-proof/resolver.mjs +49 -2
|
@@ -31,4 +31,16 @@ export function buildAptSection({ canonicalRoot, targetDir, cli }: {
|
|
|
31
31
|
* @returns {string[]} Row IDs in file order, e.g. `['/apt', '/apt:quick', …]`.
|
|
32
32
|
*/
|
|
33
33
|
export function extractAptSectionRowIds(text: string): string[];
|
|
34
|
+
/**
|
|
35
|
+
* Matches the full APT managed block (start marker through end marker,
|
|
36
|
+
* inclusive). Exported so callers in the same package can reference a
|
|
37
|
+
* single source rather than inlining duplicate regex literals.
|
|
38
|
+
*
|
|
39
|
+
* `APT_SECTION_RE` — no trailing newline; used for in-place replace.
|
|
40
|
+
* `APT_SECTION_STRIP_RE` — includes optional trailing newline; used for
|
|
41
|
+
* strip operations that want to remove the newline
|
|
42
|
+
* the block was preceded/followed by.
|
|
43
|
+
*/
|
|
44
|
+
export const APT_SECTION_RE: RegExp;
|
|
45
|
+
export const APT_SECTION_STRIP_RE: RegExp;
|
|
34
46
|
//# sourceMappingURL=aperant-section.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aperant-section.d.mts","sourceRoot":"","sources":["../../../src/cli/util/aperant-section.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aperant-section.d.mts","sourceRoot":"","sources":["../../../src/cli/util/aperant-section.mjs"],"names":[],"mappings":"AAqEA;;;;;;;;;;;;;;;GAeG;AACH,mEAXG;IAAqB,aAAa,EAA1B,MAAM;IAGO,SAAS,EAAtB,MAAM;IACQ,GAAG;CAGzB,GAAU,MAAM,CAqClB;AAED;;;;;;;;;;GAUG;AACH,8CAHW,MAAM,GACJ,MAAM,EAAE,CAoBpB;AA5HD;;;;;;;;;GASG;AACH,oCAA8F;AAC9F,0CACoE"}
|
|
@@ -20,6 +20,18 @@ import { getTrustedSkillSources } from '../config/load.mjs';
|
|
|
20
20
|
import { discoverSkills } from '../route/skill-discover.mjs';
|
|
21
21
|
const SECTION_START = '<!-- APT:framework-start -->';
|
|
22
22
|
const SECTION_END = '<!-- APT:framework-end -->';
|
|
23
|
+
/**
|
|
24
|
+
* Matches the full APT managed block (start marker through end marker,
|
|
25
|
+
* inclusive). Exported so callers in the same package can reference a
|
|
26
|
+
* single source rather than inlining duplicate regex literals.
|
|
27
|
+
*
|
|
28
|
+
* `APT_SECTION_RE` — no trailing newline; used for in-place replace.
|
|
29
|
+
* `APT_SECTION_STRIP_RE` — includes optional trailing newline; used for
|
|
30
|
+
* strip operations that want to remove the newline
|
|
31
|
+
* the block was preceded/followed by.
|
|
32
|
+
*/
|
|
33
|
+
export const APT_SECTION_RE = /<!-- APT:framework-start -->[\s\S]*?<!-- APT:framework-end -->/;
|
|
34
|
+
export const APT_SECTION_STRIP_RE = /<!-- APT:framework-start -->[\s\S]*?<!-- APT:framework-end -->\n?/;
|
|
23
35
|
const SECTION_HEADING = '## Aperant Framework';
|
|
24
36
|
const APPENDIX_REL_PATH = ['templates', 'aperant-claude-md-appendix.md'];
|
|
25
37
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aperant-section.mjs","sourceRoot":"","sources":["../../../src/cli/util/aperant-section.mjs"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAE5D,MAAM,aAAa,GAAG,8BAA8B,CAAA;AACpD,MAAM,WAAW,GAAG,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"aperant-section.mjs","sourceRoot":"","sources":["../../../src/cli/util/aperant-section.mjs"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAA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CAAC,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAA;IACxD,MAAM,GAAG,GAAG,EAAE,CAAA;IACd,0EAA0E;IAC1E,sEAAsE;IACtE,uEAAuE;IACvE,sEAAsE;IACtE,MAAM,KAAK,GAAG,wCAAwC,CAAA;IACtD,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC3B,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;QACnB,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACd,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IACxB,CAAC;IACD,OAAO,GAAG,CAAA;AACX,CAAC"}
|
package/dist/cli/util/copy.d.mts
CHANGED
|
@@ -1,4 +1,31 @@
|
|
|
1
1
|
export function copyDirRecursive(src: any, dest: any): void;
|
|
2
|
+
/**
|
|
3
|
+
* Preflight-only sibling of `injectInstructionFile`. Runs the same
|
|
4
|
+
* foreign-row defensive check against `filePath` but NEVER writes — used by
|
|
5
|
+
* the multi-target init flow to check every instruction target up-front so a
|
|
6
|
+
* single aborting target leaves NO file partially written (US-03 / AC3).
|
|
7
|
+
*
|
|
8
|
+
* Returns the same status vocabulary as `injectInstructionFile` minus the
|
|
9
|
+
* write side-effect: `'created'` (file absent → would be appended-to),
|
|
10
|
+
* `'updated'` (markers present, no foreign rows → would be replaced),
|
|
11
|
+
* `'aborted-foreign-rows'` (markers present with rows not in the generated
|
|
12
|
+
* set → init must abort). `force` short-circuits the foreign-row gate exactly
|
|
13
|
+
* as the writer does.
|
|
14
|
+
*
|
|
15
|
+
* @param {string} filePath
|
|
16
|
+
* @param {Object} opts
|
|
17
|
+
* @param {string} opts.aptSection Output of buildAptSection().
|
|
18
|
+
* @param {boolean} [opts.force=false]
|
|
19
|
+
* Bypass the foreign-row check.
|
|
20
|
+
* @returns {{ status: 'created' | 'updated' | 'aborted-foreign-rows', foreignRowIds?: string[] }}
|
|
21
|
+
*/
|
|
22
|
+
export function checkInstructionFile(filePath: string, { aptSection, force }: {
|
|
23
|
+
aptSection: string;
|
|
24
|
+
force?: boolean | undefined;
|
|
25
|
+
}): {
|
|
26
|
+
status: "created" | "updated" | "aborted-foreign-rows";
|
|
27
|
+
foreignRowIds?: string[];
|
|
28
|
+
};
|
|
2
29
|
/**
|
|
3
30
|
* Write the (already-generated) APT section into `filePath`. Creates the
|
|
4
31
|
* file if missing; replaces the section in-place if the markers are
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy.d.mts","sourceRoot":"","sources":["../../../src/cli/util/copy.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"copy.d.mts","sourceRoot":"","sources":["../../../src/cli/util/copy.mjs"],"names":[],"mappings":"AAsCA,4DAWC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,+CAPW,MAAM,yBAEd;IAAqB,UAAU,EAAvB,MAAM;IACS,KAAK;CAE5B,GAAU;IAAE,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,sBAAsB,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAgBhG;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,gDARW,MAAM,yBAEd;IAAqB,UAAU,EAAvB,MAAM;IAES,KAAK;CAE5B,GAAU;IAAE,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,sBAAsB,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAqBlH"}
|
package/dist/cli/util/copy.mjs
CHANGED
|
@@ -12,7 +12,20 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { copyFileSync, existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync, } from 'node:fs';
|
|
14
14
|
import { join } from 'node:path';
|
|
15
|
-
import { extractAptSectionRowIds } from './aperant-section.mjs';
|
|
15
|
+
import { APT_SECTION_RE, extractAptSectionRowIds } from './aperant-section.mjs';
|
|
16
|
+
/**
|
|
17
|
+
* Return the row IDs present in `existing` that are NOT present in
|
|
18
|
+
* `aptSection`. An empty array means no foreign rows (safe to overwrite).
|
|
19
|
+
*
|
|
20
|
+
* @param {string} existing Current on-disk file contents.
|
|
21
|
+
* @param {string} aptSection Output of buildAptSection().
|
|
22
|
+
* @returns {string[]}
|
|
23
|
+
*/
|
|
24
|
+
function computeForeignRowIds(existing, aptSection) {
|
|
25
|
+
const existingIds = new Set(extractAptSectionRowIds(existing));
|
|
26
|
+
const generatedIds = new Set(extractAptSectionRowIds(aptSection));
|
|
27
|
+
return [...existingIds].filter((id) => !generatedIds.has(id));
|
|
28
|
+
}
|
|
16
29
|
export function copyDirRecursive(src, dest) {
|
|
17
30
|
mkdirSync(dest, { recursive: true });
|
|
18
31
|
for (const entry of readdirSync(src, { withFileTypes: true })) {
|
|
@@ -26,6 +39,39 @@ export function copyDirRecursive(src, dest) {
|
|
|
26
39
|
}
|
|
27
40
|
}
|
|
28
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Preflight-only sibling of `injectInstructionFile`. Runs the same
|
|
44
|
+
* foreign-row defensive check against `filePath` but NEVER writes — used by
|
|
45
|
+
* the multi-target init flow to check every instruction target up-front so a
|
|
46
|
+
* single aborting target leaves NO file partially written (US-03 / AC3).
|
|
47
|
+
*
|
|
48
|
+
* Returns the same status vocabulary as `injectInstructionFile` minus the
|
|
49
|
+
* write side-effect: `'created'` (file absent → would be appended-to),
|
|
50
|
+
* `'updated'` (markers present, no foreign rows → would be replaced),
|
|
51
|
+
* `'aborted-foreign-rows'` (markers present with rows not in the generated
|
|
52
|
+
* set → init must abort). `force` short-circuits the foreign-row gate exactly
|
|
53
|
+
* as the writer does.
|
|
54
|
+
*
|
|
55
|
+
* @param {string} filePath
|
|
56
|
+
* @param {Object} opts
|
|
57
|
+
* @param {string} opts.aptSection Output of buildAptSection().
|
|
58
|
+
* @param {boolean} [opts.force=false]
|
|
59
|
+
* Bypass the foreign-row check.
|
|
60
|
+
* @returns {{ status: 'created' | 'updated' | 'aborted-foreign-rows', foreignRowIds?: string[] }}
|
|
61
|
+
*/
|
|
62
|
+
export function checkInstructionFile(filePath, { aptSection, force = false }) {
|
|
63
|
+
const existing = existsSync(filePath) ? readFileSync(filePath, 'utf-8') : '';
|
|
64
|
+
if (existing.includes('<!-- APT:framework-start -->')) {
|
|
65
|
+
if (!force) {
|
|
66
|
+
const foreignRowIds = computeForeignRowIds(existing, aptSection);
|
|
67
|
+
if (foreignRowIds.length > 0) {
|
|
68
|
+
return { status: 'aborted-foreign-rows', foreignRowIds };
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return { status: 'updated' };
|
|
72
|
+
}
|
|
73
|
+
return { status: 'created' };
|
|
74
|
+
}
|
|
29
75
|
/**
|
|
30
76
|
* Write the (already-generated) APT section into `filePath`. Creates the
|
|
31
77
|
* file if missing; replaces the section in-place if the markers are
|
|
@@ -50,14 +96,12 @@ export function injectInstructionFile(filePath, { aptSection, force = false }) {
|
|
|
50
96
|
const existing = existsSync(filePath) ? readFileSync(filePath, 'utf-8') : '';
|
|
51
97
|
if (existing.includes('<!-- APT:framework-start -->')) {
|
|
52
98
|
if (!force) {
|
|
53
|
-
const
|
|
54
|
-
const generatedIds = new Set(extractAptSectionRowIds(aptSection));
|
|
55
|
-
const foreignRowIds = [...existingIds].filter((id) => !generatedIds.has(id));
|
|
99
|
+
const foreignRowIds = computeForeignRowIds(existing, aptSection);
|
|
56
100
|
if (foreignRowIds.length > 0) {
|
|
57
101
|
return { status: 'aborted-foreign-rows', written: false, foreignRowIds };
|
|
58
102
|
}
|
|
59
103
|
}
|
|
60
|
-
const updated = existing.replace(
|
|
104
|
+
const updated = existing.replace(APT_SECTION_RE, aptSection);
|
|
61
105
|
writeFileSync(filePath, updated, 'utf-8');
|
|
62
106
|
return { status: 'updated', written: true };
|
|
63
107
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy.mjs","sourceRoot":"","sources":["../../../src/cli/util/copy.mjs"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACN,YAAY,EACZ,UAAU,EACV,SAAS,EACT,WAAW,EACX,YAAY,EACZ,aAAa,GACb,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAE/
|
|
1
|
+
{"version":3,"file":"copy.mjs","sourceRoot":"","sources":["../../../src/cli/util/copy.mjs"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACN,YAAY,EACZ,UAAU,EACV,SAAS,EACT,WAAW,EACX,YAAY,EACZ,aAAa,GACb,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAE/E;;;;;;;GAOG;AACH,SAAS,oBAAoB,CAAC,QAAQ,EAAE,UAAU;IACjD,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC,CAAA;IAC9D,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC,CAAA;IACjE,OAAO,CAAC,GAAG,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;AAC9D,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,GAAG,EAAE,IAAI;IACzC,SAAS,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IACpC,KAAK,MAAM,KAAK,IAAI,WAAW,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,EA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CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAE5E,IAAI,QAAQ,CAAC,QAAQ,CAAC,8BAA8B,CAAC,EAAE,CAAC;QACvD,IAAI,CAAC,KAAK,EAAE,CAAC;YACZ,MAAM,aAAa,GAAG,oBAAoB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAA;YAChE,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC9B,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA;YACzE,CAAC;QACF,CAAC;QACD,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,cAAc,EAAE,UAAU,CAAC,CAAA;QAC5D,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;QACzC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IAC5C,CAAC;IAED,uDAAuD;IACvD,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAA;IACnD,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,IAAI,EAAE,OAAO,CAAC,CAAA;IAC1E,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;AAC5C,CAAC"}
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const ASSERTION_VERBS: readonly ["assert_visible", "assert_text", "assert_output", "assert_network"];
|
|
2
|
+
export const ASYNC_VERBS: readonly ["trigger", "await_signal"];
|
|
3
|
+
export const EVIDENCE_VERBS: readonly ["screenshot", "record_video", "capture_logs", "dump_state", "dom_dump"];
|
|
4
|
+
export const IDL_VERB_ARGS: Readonly<Record<string, {
|
|
5
|
+
readonly required: readonly string[];
|
|
6
|
+
readonly optional: readonly string[];
|
|
7
|
+
}>>;
|
|
8
|
+
export const IDL_VERB_NAMES: readonly string[];
|
|
9
|
+
export const INTERACTION_VERBS: readonly ["click", "type", "key", "navigate", "select", "upload_file", "drag_drop", "swipe", "switch_context", "execute_js", "wait_for_event", "wait_for_idle"];
|
|
10
|
+
export const isVerbResult: typeof import("@aperant/framework/driver-sdk").isVerbResult;
|
|
11
|
+
export const LIFECYCLE_VERBS: readonly ["launch", "teardown"];
|
|
12
|
+
export const validateVerbArgs: typeof import("@aperant/framework/driver-sdk").validateVerbArgs;
|
|
2
13
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/cli/verify-proof/idl/index.mjs"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/cli/verify-proof/idl/index.mjs"],"names":[],"mappings":"AAoDA,4GAAmD;AACnD,+DAA2C;AAC3C,+GAAiD;AACjD;;;IAA+C;AAC/C,+CAAiD;AACjD,gMAAuD;AACvD,uFAA6C;AAC7C,8DAAmD;AACnD,+FAAqD"}
|
|
@@ -8,6 +8,55 @@
|
|
|
8
8
|
* refactor of every callsite.
|
|
9
9
|
*
|
|
10
10
|
* If you add a verb, edit packages/framework/src/driver-sdk/idl.ts.
|
|
11
|
+
*
|
|
12
|
+
* Defense-in-depth (issue #248). `@aperant/framework/driver-sdk` resolves
|
|
13
|
+
* via the package `exports` map to `dist/driver-sdk/index.js`. A *static*
|
|
14
|
+
* `export … from '@aperant/framework/driver-sdk'` here made this barrel —
|
|
15
|
+
* and therefore the whole apt-tools CLI, since `dispatch.mjs` eagerly
|
|
16
|
+
* imports `driver-doctor.mjs` which imports this barrel — crash at
|
|
17
|
+
* module-resolution time with an opaque `ERR_MODULE_NOT_FOUND` when the
|
|
18
|
+
* dist was not built (e.g. a CI step that skipped `pnpm build`), before
|
|
19
|
+
* any command body could run. Resolving the registry via a *dynamic*
|
|
20
|
+
* `await import()` wrapped in try/catch keeps that dependency off the
|
|
21
|
+
* hard module-link path: dist present (tests, post-build CI, published
|
|
22
|
+
* tarball) → the REAL registry values are re-exported unchanged; dist
|
|
23
|
+
* absent → empty/no-op fallbacks let the CLI load (so commands that don't
|
|
24
|
+
* touch the IDL registry, like `route`, still run) instead of crashing.
|
|
11
25
|
*/
|
|
12
|
-
|
|
26
|
+
/** @type {typeof import('@aperant/framework/driver-sdk')} */
|
|
27
|
+
let _sdk;
|
|
28
|
+
try {
|
|
29
|
+
_sdk = await import('@aperant/framework/driver-sdk');
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
// Only the intended "dist not built" condition degrades. A corrupt or
|
|
33
|
+
// partially-written dist (SyntaxError, broken transitive load) raises a
|
|
34
|
+
// different code and MUST surface, not be masked into an empty registry.
|
|
35
|
+
if (err?.code !== 'ERR_MODULE_NOT_FOUND')
|
|
36
|
+
throw err;
|
|
37
|
+
// dist/driver-sdk absent — degrade to empty registry so module load
|
|
38
|
+
// does not crash. Any code path that actually needs a verb registry
|
|
39
|
+
// (driver-doctor, the bundled drivers) requires a built dist anyway;
|
|
40
|
+
// commands that don't (e.g. `route`) keep working.
|
|
41
|
+
_sdk = {
|
|
42
|
+
ASSERTION_VERBS: [],
|
|
43
|
+
ASYNC_VERBS: [],
|
|
44
|
+
EVIDENCE_VERBS: [],
|
|
45
|
+
IDL_VERB_ARGS: {},
|
|
46
|
+
IDL_VERB_NAMES: [],
|
|
47
|
+
INTERACTION_VERBS: [],
|
|
48
|
+
isVerbResult: () => false,
|
|
49
|
+
LIFECYCLE_VERBS: [],
|
|
50
|
+
validateVerbArgs: () => ({ ok: true, errors: [] }),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export const ASSERTION_VERBS = _sdk.ASSERTION_VERBS;
|
|
54
|
+
export const ASYNC_VERBS = _sdk.ASYNC_VERBS;
|
|
55
|
+
export const EVIDENCE_VERBS = _sdk.EVIDENCE_VERBS;
|
|
56
|
+
export const IDL_VERB_ARGS = _sdk.IDL_VERB_ARGS;
|
|
57
|
+
export const IDL_VERB_NAMES = _sdk.IDL_VERB_NAMES;
|
|
58
|
+
export const INTERACTION_VERBS = _sdk.INTERACTION_VERBS;
|
|
59
|
+
export const isVerbResult = _sdk.isVerbResult;
|
|
60
|
+
export const LIFECYCLE_VERBS = _sdk.LIFECYCLE_VERBS;
|
|
61
|
+
export const validateVerbArgs = _sdk.validateVerbArgs;
|
|
13
62
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../src/cli/verify-proof/idl/index.mjs"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../src/cli/verify-proof/idl/index.mjs"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,6DAA6D;AAC7D,IAAI,IAAI,CAAA;AACR,IAAI,CAAC;IACJ,IAAI,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC,CAAA;AACrD,CAAC;AAAC,OAAO,GAAG,EAAE,CAAC;IACd,sEAAsE;IACtE,wEAAwE;IACxE,yEAAyE;IACzE,IAAI,GAAG,EAAE,IAAI,KAAK,sBAAsB;QAAE,MAAM,GAAG,CAAA;IACnD,oEAAoE;IACpE,oEAAoE;IACpE,qEAAqE;IACrE,mDAAmD;IACnD,IAAI,GAAG;QACN,eAAe,EAAE,EAAE;QACnB,WAAW,EAAE,EAAE;QACf,cAAc,EAAE,EAAE;QAClB,aAAa,EAAE,EAAE;QACjB,cAAc,EAAE,EAAE;QAClB,iBAAiB,EAAE,EAAE;QACrB,YAAY,EAAE,GAAG,EAAE,CAAC,KAAK;QACzB,eAAe,EAAE,EAAE;QACnB,gBAAgB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;KAClD,CAAA;AACF,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,eAAe,CAAA;AACnD,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAA;AAC3C,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAA;AACjD,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAA;AAC/C,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAA;AACjD,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAA;AACvD,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,CAAA;AAC7C,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,eAAe,CAAA;AACnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.d.mts","sourceRoot":"","sources":["../../../src/cli/verify-proof/resolver.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolver.d.mts","sourceRoot":"","sources":["../../../src/cli/verify-proof/resolver.mjs"],"names":[],"mappings":"AAyFA;;;;;;;GAOG;AACH,sCALW,cAAc,GAAG;IAAC,QAAQ,CAAC,EAAE,SAAS,GAAC,MAAM,GAAC,UAAU,CAAA;CAAC,WACzD,mBAAmB,YACnB,MAAM,EAAE,GACN;IAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAC,CAU9C;AA0CD;;;;;;;;;;;;GAYG;AACH,oCARG;IAA+B,OAAO,EAA9B,cAAc,EAAE;IACU,OAAO,EAAjC,mBAAmB;IACJ,qBAAqB,EAApC,MAAM,EAAE;IACQ,kBAAkB;IAClB,QAAQ;CAChC,GAAU;IAAC,QAAQ,EAAE,cAAc,CAAC;IAAC,iBAAiB,EAAE,KAAK,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAAC,CAAA;CAAC,CAqFrG;AAED;;;;;;;;;;GAUG;AACH,+CAHW,CAAC,UAAU,GAAC,KAAK,GAAC,KAAK,GAAC,KAAK,CAAC,GAC5B,CAAC,aAAa,GAAC,iBAAiB,GAAC,UAAU,CAAC,CAcxD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,gDARG;IAA+B,OAAO,EAA9B,cAAc,EAAE;IACU,OAAO,EAAjC,mBAAmB;IAC6D,QAAQ,EAAxF,KAAK,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,UAAU,GAAC,KAAK,GAAC,KAAK,GAAC,KAAK,GAAC,cAAc,CAAA;KAAC,CAAC;IACzD,QAAQ;IACR,kBAAkB;IAClB,qBAAqB;CAC7C,GAAU,KAAK,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,cAAc,CAAC;IAAC,iBAAiB,EAAE,KAAK,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAAC,CAAA;CAAC,CAAC,CA2C/I;6BApTY,OAAO,+BAA+B,EAAE,cAAc;kCACtD,OAAO,sBAAsB,EAAE,mBAAmB"}
|
|
@@ -29,11 +29,61 @@
|
|
|
29
29
|
*
|
|
30
30
|
* Existing `resolveDriver()` and `scoreDriver()` exports are unchanged.
|
|
31
31
|
*/
|
|
32
|
-
import { UnsatisfiedRequiredCapabilityError } from '@aperant/framework/driver-sdk';
|
|
33
32
|
/**
|
|
34
33
|
* @typedef {import('@aperant/framework/driver-sdk').DriverManifest} DriverManifest
|
|
35
34
|
* @typedef {import('./runtime-detect.mjs').RuntimeCapabilities} RuntimeCapabilities
|
|
36
35
|
*/
|
|
36
|
+
/**
|
|
37
|
+
* Defense-in-depth (issue #248). The driver-sdk error class lives in
|
|
38
|
+
* `@aperant/framework/driver-sdk`, whose `exports` map resolves to
|
|
39
|
+
* `dist/driver-sdk/index.js`. An eager *static* top-level
|
|
40
|
+
* `import { UnsatisfiedRequiredCapabilityError } from '@aperant/framework/driver-sdk'`
|
|
41
|
+
* made the WHOLE apt-tools CLI crash at module-resolution time when the
|
|
42
|
+
* dist was not built (e.g. a CI step that skipped `pnpm build`): the
|
|
43
|
+
* static import is resolved at module-link, so an opaque
|
|
44
|
+
* `ERR_MODULE_NOT_FOUND` was raised before any command body — or any
|
|
45
|
+
* `--no-fail` downgrade in run-route-eval.mjs — could run.
|
|
46
|
+
*
|
|
47
|
+
* We instead resolve the class via a *dynamic* `await import()` that is
|
|
48
|
+
* wrapped in try/catch. Dynamic import is still evaluated at module
|
|
49
|
+
* load (top-level await), but its failure is now swallowable rather than
|
|
50
|
+
* a hard link-time crash:
|
|
51
|
+
* - dist present (tests, post-build CI, published tarball) → the REAL
|
|
52
|
+
* class is bound, so any thrown error stays
|
|
53
|
+
* `instanceof UnsatisfiedRequiredCapabilityError` for every consumer
|
|
54
|
+
* (including the resolver suites that import the class from the same
|
|
55
|
+
* `@aperant/framework/driver-sdk` ESM specifier);
|
|
56
|
+
* - dist absent → we fall back to a structurally identical local class
|
|
57
|
+
* (same `.name` / `.capability` / `.attempts` shape, which
|
|
58
|
+
* `detect-runtime.mjs` inspects via `.attempts`) so the CLI degrades
|
|
59
|
+
* to a clear, catchable error instead of crashing at load.
|
|
60
|
+
*
|
|
61
|
+
* `resolveDriver` stays fully synchronous — the class is already bound by
|
|
62
|
+
* the time any importer of this module finishes linking.
|
|
63
|
+
*
|
|
64
|
+
* @type {new (message: string, capability?: string, attempts?: ReadonlyArray<{driver_id: string, reason: string}>) => Error}
|
|
65
|
+
*/
|
|
66
|
+
let UnsatisfiedRequiredCapabilityError;
|
|
67
|
+
try {
|
|
68
|
+
;
|
|
69
|
+
({ UnsatisfiedRequiredCapabilityError } = await import('@aperant/framework/driver-sdk'));
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
// Only the intended "dist not built" condition degrades. A corrupt or
|
|
73
|
+
// partially-written dist (SyntaxError, broken transitive load) raises a
|
|
74
|
+
// different code and MUST surface, not be masked into a silent fallback.
|
|
75
|
+
if (err?.code !== 'ERR_MODULE_NOT_FOUND')
|
|
76
|
+
throw err;
|
|
77
|
+
// dist/driver-sdk absent — degrade instead of crashing the CLI.
|
|
78
|
+
UnsatisfiedRequiredCapabilityError = class UnsatisfiedRequiredCapabilityError extends Error {
|
|
79
|
+
constructor(message, capability, attempts = []) {
|
|
80
|
+
super(message);
|
|
81
|
+
this.name = 'UnsatisfiedRequiredCapabilityError';
|
|
82
|
+
this.capability = capability;
|
|
83
|
+
this.attempts = attempts;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
37
87
|
const STABILITY_RANK = { ga: 3, beta: 2, experimental: 1 };
|
|
38
88
|
const LOCALITY_RANK = { bundled: 3, user: 2, registry: 1 };
|
|
39
89
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.mjs","sourceRoot":"","sources":["../../../src/cli/verify-proof/resolver.mjs"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,
|
|
1
|
+
{"version":3,"file":"resolver.mjs","sourceRoot":"","sources":["../../../src/cli/verify-proof/resolver.mjs"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,IAAI,kCAAkC,CAAA;AACtC,IAAI,CAAC;IACJ,CAAC;IAAA,CAAC,EAAE,kCAAkC,EAAE,GAAG,MAAM,MAAM,CAAC,+BAA+B,C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,OAAO,CAAC,IAAI,CAAC;gBACZ,UAAU,EAAE,OAAO,CAAC,EAAE;gBACtB,OAAO;gBACP,MAAM,EAAE,QAAQ,CAAC,QAAQ;gBACzB,iBAAiB,EAAE,QAAQ,CAAC,iBAAiB;aAC7C,CAAC,CAAA;QACH,CAAC;IACF,CAAC;IAED,OAAO,OAAO,CAAA;AACf,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,qBAAqB,CAAC,OAAO,EAAE,IAAI;IAC3C,kCAAkC;IAClC,MAAM,MAAM,GAAG;QACd,WAAW,EAAE,KAAK;QAClB,QAAQ,EAAE,KAAK;QACf,SAAS,EAAE,KAAK;QAChB,OAAO,EAAE,KAAK;QACd,eAAe,EAAE,KAAK;QACtB,OAAO,EAAE,KAAK;QACd,eAAe,EAAE,KAAK;QACtB,QAAQ,EAAE,KAAK;KACf,CAAA;IACD,qEAAqE;IACrE,gEAAgE;IAChE,IAAI,IAAI,KAAK,aAAa,IAAI,OAAO,CAAC,WAAW;QAAE,MAAM,CAAC,WAAW,GAAG,IAAI,CAAA;IAC5E,IAAI,IAAI,KAAK,iBAAiB,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;QAC3D,MAAM,CAAC,eAAe,GAAG,IAAI,CAAA;QAC7B,gEAAgE;QAChE,mDAAmD;QACnD,MAAM,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAA;QACpC,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;IACjC,CAAC;IACD,IAAI,IAAI,KAAK,UAAU;QAAE,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;IAC3D,OAAO,MAAM,CAAA;AACd,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aperant",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "AI coding framework — composable skills for planning, executing, verifying, and reviewing code with any LLM provider. Works as Claude Code commands, Codex tasks, or programmatically.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Mikalsen AI",
|
|
@@ -71,9 +71,14 @@ The only valid reasons to skip a finding:
|
|
|
71
71
|
|
|
72
72
|
## Coordination Protocol
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
**Fixers run SEQUENTIALLY, never concurrently (FRAMEWORK-BUG-006).** At most one fixer touches the
|
|
75
|
+
shared worktree at any moment — the orchestrator spawns fixer-1, waits for it to return and audits it,
|
|
76
|
+
THEN spawns fixer-2, and so on. You are the ONLY fixer touching this worktree right now. `[PARALLEL_FIXERS]`
|
|
77
|
+
is always `false`; do NOT assume a sibling fixer is editing, staging, or committing at the same time.
|
|
78
|
+
Concurrent `git add`/`git commit` against a shared index either sweeps another fixer's staged files
|
|
79
|
+
into your commit or clobbers their working-tree edits — which is exactly the race this rule prevents.
|
|
80
|
+
|
|
81
|
+
1. **Only edit files in your `[FIX_ASSIGNMENT]`** — do NOT touch files outside your assigned group (the grouping keeps fixes scoped and the history clean)
|
|
77
82
|
2. **If a finding spans files across groups** — fix only the parts in your group, note the cross-group dependency in your report
|
|
78
83
|
3. **If you discover NEW issues** while fixing — note them in your report but do NOT fix them (they aren't validated)
|
|
79
84
|
|
|
@@ -89,7 +94,7 @@ Findings with severity `critical`:
|
|
|
89
94
|
|
|
90
95
|
## Report Format
|
|
91
96
|
|
|
92
|
-
Write to `[REVIEW_DIR]/iterations/[N]/fixes-applied-[FIXER_NAME].md` (BUG-030 canonical naming — the audit gate resolves `fixes-applied-${FIXER_NAME}.md` ahead of the legacy `fixes-applied.md
|
|
97
|
+
Write to `[REVIEW_DIR]/iterations/[N]/fixes-applied-[FIXER_NAME].md` (BUG-030 canonical naming — the audit gate resolves `fixes-applied-${FIXER_NAME}.md` ahead of the legacy `fixes-applied.md`. Each fixer owns its own report file; this per-fixer path stays correct now that fixers run sequentially — FRAMEWORK-BUG-006):
|
|
93
98
|
|
|
94
99
|
```markdown
|
|
95
100
|
# Fix Report — Iteration [N]
|
|
@@ -65,11 +65,12 @@ PHASE 3 -- PARALLEL REVIEW (6 agents, independent, all spawned in ONE message):
|
|
|
65
65
|
PHASE 4 -- VALIDATION (1 agent):
|
|
66
66
|
validator -> Re-investigates every finding, confirms or dismisses
|
|
67
67
|
|
|
68
|
-
PHASE 6 -- FIX LOOP (up to 3
|
|
69
|
-
fixer-1, fixer-2, fixer-3
|
|
68
|
+
PHASE 6 -- FIX LOOP (up to 3 fixers per iteration, spawned ONE AT A TIME, max 4 iterations):
|
|
69
|
+
fixer-1, fixer-2, fixer-3 (groups still exist; they run SEQUENTIALLY, never concurrently)
|
|
70
70
|
- Read validated finding files directly
|
|
71
|
-
- Fix assigned issues, run verification,
|
|
71
|
+
- Fix assigned issues, run verification, commit atomically per finding
|
|
72
72
|
- Report brief status to orchestrator
|
|
73
|
+
- NEVER run pr-review fixers in parallel in a shared worktree (FRAMEWORK-BUG-006)
|
|
73
74
|
|
|
74
75
|
PHASE 7 -- SELF-REVIEW (1 fresh agent):
|
|
75
76
|
self-reviewer
|
|
@@ -594,6 +595,16 @@ Construct a toolchain commands object:
|
|
|
594
595
|
|
|
595
596
|
Save to `.aperant/pr-reviews/${REVIEW_ID}/toolchain.json`.
|
|
596
597
|
|
|
598
|
+
**Cache-bypass variant (FRAMEWORK-BUG-006 Part B).** `toolchain-detect` emits an additive
|
|
599
|
+
`no_cache_command` field on `typecheck` (and `test`) when the project's verify command is turbo-backed
|
|
600
|
+
(e.g. `typecheck: { tool, command, no_cache_command: "pnpm run typecheck --force" }`). A turbo-backed
|
|
601
|
+
verify can return a STALE CACHE HIT ("replaying logs") that reports PASS while a fixer-introduced broken
|
|
602
|
+
import sits on disk — sighted on PR #244, where only a `--force` (no-cache) typecheck exposed it.
|
|
603
|
+
**Whenever a `no_cache_command` exists for a check, every POST-FIX verification (auto-checks re-runs,
|
|
604
|
+
the Phase 6 fixer verification, and the Phase 7 self-reviewer) MUST use it instead of the plain
|
|
605
|
+
`command`** so a stale cache cannot mask a broken import. Non-turbo projects have no `no_cache_command`
|
|
606
|
+
(plain `tsc`/`vitest` have no cache to bust) and use the plain command unchanged.
|
|
607
|
+
|
|
597
608
|
Update `metadata.json` with the toolchain summary and trigger count.
|
|
598
609
|
|
|
599
610
|
---
|
|
@@ -663,8 +674,8 @@ cd {WORKTREE_PATH}
|
|
|
663
674
|
```
|
|
664
675
|
|
|
665
676
|
1. Lint: {LINT_COMMAND}
|
|
666
|
-
2. Typecheck: {TYPECHECK_COMMAND}
|
|
667
|
-
3. Tests: {TEST_COMMAND}
|
|
677
|
+
2. Typecheck: {TYPECHECK_COMMAND} (use toolchain.json `typecheck.no_cache_command` if present — FRAMEWORK-BUG-006: a turbo-backed typecheck can replay a stale cached PASS and mask a broken import)
|
|
678
|
+
3. Tests: {TEST_COMMAND} (use toolchain.json `test.no_cache_command` if present, same cache-bypass rationale)
|
|
668
679
|
|
|
669
680
|
## Output
|
|
670
681
|
|
|
@@ -1171,8 +1182,9 @@ This is the owned-mode path. External-mode invocations run Phase 6b instead of t
|
|
|
1171
1182
|
for ITERATION in 1 2 3 4:
|
|
1172
1183
|
1. Create iteration directory
|
|
1173
1184
|
2. Group findings into fix assignments (max 3 groups)
|
|
1174
|
-
3. Spawn fix agents
|
|
1175
|
-
|
|
1185
|
+
3. Spawn fix agents ONE AT A TIME (never in parallel — FRAMEWORK-BUG-006):
|
|
1186
|
+
for each group: spawn fixer → wait → audit (Step 4b) → next group
|
|
1187
|
+
4. (folded into step 3's per-fixer wait)
|
|
1176
1188
|
5. Generate new diff
|
|
1177
1189
|
6. If fixes were applied: spawn fresh review on new diff
|
|
1178
1190
|
7. If ITERATION <= 2: accept new findings into the backlog
|
|
@@ -1197,6 +1209,14 @@ Take all confirmed, fixable findings and group them into up to 3 independent gro
|
|
|
1197
1209
|
|
|
1198
1210
|
#### Step 3: Spawn Fix Agents
|
|
1199
1211
|
|
|
1212
|
+
> **HARD RULE (FRAMEWORK-BUG-006): NEVER run pr-review fixers in parallel in a shared worktree.**
|
|
1213
|
+
> All fixers share ONE worktree, ONE git index, and ONE branch. git's index is not a
|
|
1214
|
+
> concurrency-safe surface — concurrent `git add` / `git commit` / self-audit `git log`/`git diff`
|
|
1215
|
+
> from sibling fixers either SWEEP one fixer's staged files into another's commit (PR #114
|
|
1216
|
+
> entanglement) or CLOBBER another fixer's working-tree edits entirely (PR #244 work-loss). Spawn
|
|
1217
|
+
> fixers **one at a time**: spawn fixer-1, wait for it to return, run the Step 4b audit-fixer gate on
|
|
1218
|
+
> it, THEN spawn fixer-2, and so on. At most one fixer touches the shared worktree at any moment.
|
|
1219
|
+
|
|
1200
1220
|
**Capture the iteration-start SHA BEFORE spawning fixers** (used by both the Step 4b audit gate AND the per-fixer Pre-Return Self-Audit added in BUG-016 — fixers now commit atomically per finding, and the audit window is scoped by this SHA):
|
|
1201
1221
|
|
|
1202
1222
|
```bash
|
|
@@ -1211,9 +1231,9 @@ For each fix group, spawn a fix agent. Read the agent definition from `.claude/a
|
|
|
1211
1231
|
| `[FIX_ASSIGNMENT]` | List of finding IDs and files for this group |
|
|
1212
1232
|
| `[N]` | Current iteration number |
|
|
1213
1233
|
| `[FIXER_NAME]` | `fixer-1`, `fixer-2`, or `fixer-3` |
|
|
1214
|
-
| `[TOOLCHAIN_COMMANDS]` | Commands from `toolchain.json` (the `all` command, or individual commands) |
|
|
1234
|
+
| `[TOOLCHAIN_COMMANDS]` | Commands from `toolchain.json` (the `all` command, or individual commands). **For the post-fix typecheck/test, pass the `no_cache_command` variant when `toolchain.json` provides one** (FRAMEWORK-BUG-006: a turbo-backed verify can replay a stale cached PASS and mask the fixer's own broken import). |
|
|
1215
1235
|
| `[CRITICAL_APPROVAL]` | `true` or `false` for each critical finding in this group |
|
|
1216
|
-
| `[PARALLEL_FIXERS]` | `
|
|
1236
|
+
| `[PARALLEL_FIXERS]` | Always `false` (FRAMEWORK-BUG-006). Fixers are spawned one at a time in the shared worktree — never concurrently. The placeholder is retained only so the fixer-agent Coordination Protocol can assert "you are the only fixer touching this worktree right now." |
|
|
1217
1237
|
| `[WORKTREE_PATH]` | The worktree path — fix agents edit files HERE, not in the user's working directory |
|
|
1218
1238
|
| `[ITERATION_START_SHA]` | The SHA captured BEFORE spawning fixers (see Step 4b's `ITERATION_START_SHA=$(...)` capture). Required for BUG-016 commit-discipline Pre-Return Self-Audit. |
|
|
1219
1239
|
|
|
@@ -1226,18 +1246,31 @@ Agent(
|
|
|
1226
1246
|
)
|
|
1227
1247
|
```
|
|
1228
1248
|
|
|
1229
|
-
If there are 2-3 groups, spawn
|
|
1249
|
+
If there are 2-3 groups, spawn the fixers **sequentially — one fixer at a time, never in parallel**
|
|
1250
|
+
(FRAMEWORK-BUG-006). Concretely, loop over the groups:
|
|
1251
|
+
|
|
1252
|
+
```
|
|
1253
|
+
for each fix group (in order):
|
|
1254
|
+
1. Spawn the fixer for THIS group only (a single Agent call in its own message)
|
|
1255
|
+
2. Wait for it to return its brief status line (Step 4)
|
|
1256
|
+
3. Run the Step 4b audit-fixer gate on it
|
|
1257
|
+
4. Only THEN spawn the fixer for the next group
|
|
1258
|
+
```
|
|
1259
|
+
|
|
1260
|
+
Do NOT batch multiple `Agent(...)` fixer calls into one message — that is the parallel-shared-worktree
|
|
1261
|
+
race this bug fixes. The atomic-per-finding commit discipline (BUG-016) and the Step 4b audit gate are
|
|
1262
|
+
UNCHANGED; they now simply run without a concurrent sibling mutating the index.
|
|
1230
1263
|
|
|
1231
1264
|
#### Step 4: Wait for Completion
|
|
1232
1265
|
|
|
1233
|
-
Wait for
|
|
1266
|
+
Wait for the **current** fix agent to return its brief status (you spawned only one this turn):
|
|
1234
1267
|
```
|
|
1235
1268
|
FIXED: X | FAILED: Y | SKIPPED: Z | VERIFICATION: PASS/FAIL
|
|
1236
1269
|
```
|
|
1237
1270
|
|
|
1238
1271
|
#### Step 4b: Audit Fixer Output (Hallucination Gate)
|
|
1239
1272
|
|
|
1240
|
-
On 2026-04-20 a live fix agent returned `FIXED: 2 | FAILED: 0 | SKIPPED: 0 | VERIFICATION: PASS` and wrote a convincing 140-line `fixes-applied.md` — but the worktree had zero edits matching the claimed files. The orchestrator trusted the self-reported status line and nearly shipped two fabricated fixes. This step is the deterministic gate that closes that hole: for
|
|
1273
|
+
On 2026-04-20 a live fix agent returned `FIXED: 2 | FAILED: 0 | SKIPPED: 0 | VERIFICATION: PASS` and wrote a convincing 140-line `fixes-applied.md` — but the worktree had zero edits matching the claimed files. The orchestrator trusted the self-reported status line and nearly shipped two fabricated fixes. This step is the deterministic gate that closes that hole: for the fixer that just returned in Step 4 (fixers run one at a time — FRAMEWORK-BUG-006), run the audit CLI and cross-check the fixer's claims against the actual git state BEFORE spawning the next group's fixer.
|
|
1241
1274
|
|
|
1242
1275
|
**Capture the iteration-start SHA BEFORE spawning fixers** so the audit can cover committed fixes (bug-5, 2026-04-23 — fixers that commit their edits before returning would otherwise present an empty working tree and trip a false-positive hallucination verdict):
|
|
1243
1276
|
|
|
@@ -1271,7 +1304,7 @@ Rule of thumb: pass `--since-sha "${ITERATION_START_SHA}"` on every audit invoca
|
|
|
1271
1304
|
|
|
1272
1305
|
The CLI returns a JSON envelope with `verdict` ∈ `verified | hallucinated | skipped`, writes `iterations/${ITERATION}/audit.json` (append-only), and bumps `metadata.json.fixer_hallucinations_total` on every `hallucinated` outcome. The envelope's `observed.since_sha` + `observed.since_sha_source` fields record which SHA was used and where it came from (`flag` | `merge-base` | `null`). The same envelope is used for the fixer and the self-reviewer (Phase 7) — `--fixer self-reviewer` reads from `self-review.md`.
|
|
1273
1306
|
|
|
1274
|
-
**Canonical fix-report filename per fixer (BUG-030):** each fixer agent writes to `fixes-applied-${FIXER_NAME}.md` (e.g. `fixes-applied-fixer-1.md`). The audit CLI resolves candidates in strict order: `fixes-applied-group{N}.md` (legacy group-named, pre-BUG-030 reviews) → `fixes-applied-fixer-{N}.md` (NEW fixer-named) → `fixes-applied-${FIXER_NAME}.md` (exact match, preferred for non-numeric fixer names) → `fixes-applied.md` (legacy unscoped, single-fixer reviews only). Writing the canonical name eliminates the cross-fixer false-positive `hallucinated` verdict that fired when
|
|
1307
|
+
**Canonical fix-report filename per fixer (BUG-030):** each fixer agent writes to `fixes-applied-${FIXER_NAME}.md` (e.g. `fixes-applied-fixer-1.md`). The audit CLI resolves candidates in strict order: `fixes-applied-group{N}.md` (legacy group-named, pre-BUG-030 reviews) → `fixes-applied-fixer-{N}.md` (NEW fixer-named) → `fixes-applied-${FIXER_NAME}.md` (exact match, preferred for non-numeric fixer names) → `fixes-applied.md` (legacy unscoped, single-fixer reviews only). Writing the canonical name eliminates the cross-fixer false-positive `hallucinated` verdict that fired when fixers shared `fixes-applied.md` (a per-fixer report path is still correct now that fixers run sequentially — each fixer owns its own report file).
|
|
1275
1308
|
|
|
1276
1309
|
| Verdict | Orchestrator Action |
|
|
1277
1310
|
|---------|---------------------|
|
|
@@ -1430,7 +1463,7 @@ Read the agent definition from `.claude/agents/apt-pr-review-self-reviewer.md` a
|
|
|
1430
1463
|
|-------------|-------|
|
|
1431
1464
|
| `[FIX_DIFF]` | The combined fix diff content or path to the concatenated file |
|
|
1432
1465
|
| `[REVIEW_DIR]` | `.aperant/pr-reviews/{REVIEW_ID}` |
|
|
1433
|
-
| `[TOOLCHAIN_COMMANDS]` | Commands from `toolchain.json` |
|
|
1466
|
+
| `[TOOLCHAIN_COMMANDS]` | Commands from `toolchain.json`. **Use the `no_cache_command` variant for the typecheck/test when one is present** (FRAMEWORK-BUG-006: a turbo-backed verify can replay a stale cached PASS and mask a broken import the fixes introduced). |
|
|
1434
1467
|
| `[WORKTREE_PATH]` | The worktree path — self-reviewer works HERE |
|
|
1435
1468
|
|
|
1436
1469
|
```
|
|
@@ -1683,11 +1716,15 @@ Fix agents self-report their outcome via a status line (`FIXED: X | FAILED: Y |
|
|
|
1683
1716
|
**Wrong:** Reading the full finding text from agent responses and processing it in orchestrator context.
|
|
1684
1717
|
**Right:** Agent responses are brief (3-5 lines). All detail goes to files. Orchestrator reads files via Read tool only when needed.
|
|
1685
1718
|
|
|
1686
|
-
### Mistake 2: Spawning Agents Sequentially
|
|
1719
|
+
### Mistake 2: Spawning the Phase 3 REVIEW Agents Sequentially
|
|
1687
1720
|
|
|
1688
1721
|
**Wrong:** Spawn security agent, wait, spawn quality agent, wait, etc.
|
|
1689
1722
|
**Right:** Spawn all 6 review agents in ONE message using 6 parallel Agent tool calls. They run concurrently.
|
|
1690
1723
|
|
|
1724
|
+
> Scope note: this applies ONLY to the Phase 3 review specialists, which are read-only (Read/Grep/Glob,
|
|
1725
|
+
> no Edit/Bash, no git writes) and therefore cannot race the index. The Phase 6 FIXERS are the
|
|
1726
|
+
> opposite — they MUST be spawned one at a time (FRAMEWORK-BUG-006). Never parallelize fixers.
|
|
1727
|
+
|
|
1691
1728
|
### Mistake 3: Skipping the Validator
|
|
1692
1729
|
|
|
1693
1730
|
**Wrong:** Sending raw review findings directly to fix agents.
|
|
@@ -966,8 +966,9 @@ ST-3 apt:execute --tdd).
|
|
|
966
966
|
|
|
967
967
|
Per ID-01 (Framework full-featured locally; backends are pluggable), the
|
|
968
968
|
default is `local-only` — zero GitHub auth required on first run. Users
|
|
969
|
-
can switch to `github-issues` (
|
|
970
|
-
the
|
|
969
|
+
can switch to `github-issues` (implemented — creates + syncs real issues
|
|
970
|
+
via the `gh` CLI) or `app-inbox` (still a stub) later; the framework
|
|
971
|
+
abstraction is open for further adapter implementations.
|
|
971
972
|
|
|
972
973
|
### 3g.1 Present the task-tracking picker
|
|
973
974
|
|
|
@@ -979,10 +980,10 @@ AskUserQuestion([
|
|
|
979
980
|
options: [
|
|
980
981
|
{ label: "Local files only (recommended for solo / 2-founder)",
|
|
981
982
|
description: "Writes to .aperant/tasks/{id}/triage.json. Zero net dep." },
|
|
982
|
-
{ label: "GitHub Issues (
|
|
983
|
-
description: "
|
|
984
|
-
{ label: "App inbox (post-app-launch — stub
|
|
985
|
-
description: "Convex-backed; same state machine, app-rendered." }
|
|
983
|
+
{ label: "GitHub Issues (creates + syncs real issues via the gh CLI)",
|
|
984
|
+
description: "First mirror creates an issue; transitions update the same issue (label swap), wontfix closes it as not-planned. Requires gh installed + authed + a git remote." },
|
|
985
|
+
{ label: "App inbox (post-app-launch — stub)",
|
|
986
|
+
description: "Convex-backed; same state machine, app-rendered. Still a stub." }
|
|
986
987
|
]
|
|
987
988
|
},
|
|
988
989
|
{
|