azcodr 2.6.0 → 2.7.1
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/.agents/hooks.json +3 -3
- package/.agents/hooks.json.example +4 -4
- package/.agents/lib/agent-guard-command.js +6 -0
- package/.agents/lib/agent-guard-file.js +15 -0
- package/.agents/lib/agent-guard-tdd.js +30 -0
- package/.agents/lib/boundaries.js +35 -0
- package/.agents/scripts/desktop_doctor.js +108 -0
- package/.agents/scripts/safety_guard.js +82 -0
- package/.agents/scripts/smoke_test.js +78 -0
- package/.agents/scripts/verify_completion.js +76 -0
- package/.agents/skills/lets-build/scripts/bootstrap_workspace.sh +6 -0
- package/.gitignore +1 -0
- package/lib/agent-guard-command.d.ts +17 -0
- package/lib/agent-guard-command.d.ts.map +1 -1
- package/lib/agent-guard-command.js +6 -0
- package/lib/agent-guard-command.js.map +1 -1
- package/lib/agent-guard-file.d.ts +31 -0
- package/lib/agent-guard-file.d.ts.map +1 -1
- package/lib/agent-guard-file.js +15 -0
- package/lib/agent-guard-file.js.map +1 -1
- package/lib/agent-guard-tdd.d.ts +42 -0
- package/lib/agent-guard-tdd.d.ts.map +1 -1
- package/lib/agent-guard-tdd.js +30 -0
- package/lib/agent-guard-tdd.js.map +1 -1
- package/lib/agent-guard.d.ts +17 -0
- package/lib/agent-guard.d.ts.map +1 -1
- package/lib/agent-guard.js.map +1 -1
- package/lib/boundaries.d.ts +54 -0
- package/lib/boundaries.d.ts.map +1 -1
- package/lib/boundaries.js +35 -0
- package/lib/boundaries.js.map +1 -1
- package/lib/errors.d.ts +16 -0
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +8 -0
- package/lib/errors.js.map +1 -1
- package/lib/guards.d.ts +4 -0
- package/lib/guards.d.ts.map +1 -1
- package/lib/guards.js.map +1 -1
- package/lib/links.d.ts +4 -0
- package/lib/links.d.ts.map +1 -1
- package/lib/links.js.map +1 -1
- package/lib/repo.d.ts +2 -0
- package/lib/repo.d.ts.map +1 -1
- package/lib/repo.js.map +1 -1
- package/lib/scaffold.d.ts +19 -0
- package/lib/scaffold.d.ts.map +1 -1
- package/lib/scaffold.js +4 -0
- package/lib/scaffold.js.map +1 -1
- package/lib/validate.d.ts +17 -0
- package/lib/validate.d.ts.map +1 -1
- package/lib/validate.js.map +1 -1
- package/memory.md +8 -0
- package/package.json +1 -1
- package/src/agent-guard-command.ts +17 -0
- package/src/agent-guard-file.ts +31 -0
- package/src/agent-guard-tdd.ts +42 -0
- package/src/agent-guard.ts +17 -0
- package/src/boundaries.ts +54 -0
- package/src/errors.ts +10 -0
- package/src/guards.ts +4 -0
- package/src/links.ts +4 -0
- package/src/repo.ts +2 -0
- package/src/scaffold.ts +22 -7
- package/src/validate.ts +17 -0
package/lib/links.d.ts
CHANGED
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
* Configuration options for symlink and pointer creation.
|
|
3
3
|
*/
|
|
4
4
|
export interface EnsureSymlinkOptions {
|
|
5
|
+
/** Target directory containing the files and proposed link. */
|
|
5
6
|
targetDir: string;
|
|
7
|
+
/** Name of the symbolic link or alias pointer file to create. */
|
|
6
8
|
linkName: string;
|
|
9
|
+
/** Name of the target file that the symlink or pointer points to. */
|
|
7
10
|
targetFileName: string;
|
|
11
|
+
/** When true, simulate link creation without disk mutations. */
|
|
8
12
|
dryRun?: boolean;
|
|
9
13
|
}
|
|
10
14
|
/**
|
package/lib/links.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../src/links.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AA6DD;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,GACrB,OAAO,CAWT;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAapE;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAmB7E;;;;;;AAED,wBAIE"}
|
|
1
|
+
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../src/links.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,+DAA+D;IAC/D,SAAS,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,cAAc,EAAE,MAAM,CAAC;IACvB,gEAAgE;IAChE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AA6DD;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,GACrB,OAAO,CAWT;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAapE;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAmB7E;;;;;;AAED,wBAIE"}
|
package/lib/links.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"links.js","sourceRoot":"","sources":["../src/links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"links.js","sourceRoot":"","sources":["../src/links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAuB7B,SAAS,qBAAqB,CAAC,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CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACnF,IAAI,QAAQ,CAAC,IAAI,EAAE,KAAK,cAAc;gBAAE,OAAO,IAAI,CAAC;YACpD,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACvC,CAAC;QAAC,MAAM,CAAC;YACP,+BAA+B;QACjC,CAAC;QACD,EAAE,CAAC,WAAW,CAAC,cAAc,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QACjD,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,GAAG,cAAc,IAAI,EAAE,OAAO,CAAC,CAAC;QAC3D,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,eAAe;IACb,yBAAyB;IACzB,aAAa;IACb,sBAAsB;CACvB,CAAC"}
|
package/lib/repo.d.ts
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
* Options controlling git repository initialization.
|
|
3
3
|
*/
|
|
4
4
|
export interface InitGitOptions {
|
|
5
|
+
/** If true, skip git repository initialization entirely. */
|
|
5
6
|
noGit?: boolean;
|
|
7
|
+
/** If true, simulate git repository initialization without invoking git. */
|
|
6
8
|
dryRun?: boolean;
|
|
7
9
|
}
|
|
8
10
|
/**
|
package/lib/repo.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../src/repo.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAW9D;AA8CD;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAchF;;;;;AAED,wBAAgD"}
|
|
1
|
+
{"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../src/repo.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,4DAA4D;IAC5D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAW9D;AA8CD;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAchF;;;;;AAED,wBAAgD"}
|
package/lib/repo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo.js","sourceRoot":"","sources":["../src/repo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,sBAAsB,GAAG,8CAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"repo.js","sourceRoot":"","sources":["../src/repo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,sBAAsB,GAAG,8CAA8C,CAAC;AAY9E;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAiB;IACnD,IAAI,CAAC;QACH,MAAM,QAAQ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;QAC1B,aAAa,CAAC,SAAS,CAAC,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,eAAe,EAAE,mBAAmB,EAAE,OAAO,EAAE,CAAC"}
|
package/lib/scaffold.d.ts
CHANGED
|
@@ -16,36 +16,52 @@ export declare const TEMPLATE_ITEMS: readonly string[];
|
|
|
16
16
|
* Configuration options for the primary scaffold orchestration function.
|
|
17
17
|
*/
|
|
18
18
|
export interface ScaffoldOptions {
|
|
19
|
+
/** Target directory path where project will be scaffolded (defaults to process.cwd()). */
|
|
19
20
|
targetDir?: string;
|
|
21
|
+
/** Force overwrite if target directory exists and is non-empty. */
|
|
20
22
|
force?: boolean;
|
|
23
|
+
/** Skip git repository initialization. */
|
|
21
24
|
noGit?: boolean;
|
|
25
|
+
/** Optional custom template directory path. */
|
|
22
26
|
templateDir?: string;
|
|
27
|
+
/** Simulate scaffolding without writing files to disk. */
|
|
23
28
|
dryRun?: boolean;
|
|
29
|
+
/** Suppress non-error console output. */
|
|
24
30
|
silent?: boolean;
|
|
25
31
|
}
|
|
26
32
|
/**
|
|
27
33
|
* Result object returned upon completion of a scaffold operation.
|
|
28
34
|
*/
|
|
29
35
|
export interface ScaffoldResult {
|
|
36
|
+
/** Whether the scaffolding operation completed successfully. */
|
|
30
37
|
success: boolean;
|
|
38
|
+
/** Absolute filesystem path of the scaffolded target directory. */
|
|
31
39
|
targetDir: string;
|
|
40
|
+
/** Whether a git repository was initialized and committed. */
|
|
32
41
|
gitInitialized: boolean;
|
|
42
|
+
/** Whether execution was a dry-run simulation without disk mutations. */
|
|
33
43
|
dryRun: boolean;
|
|
44
|
+
/** List of recorded scaffolding action descriptions taken. */
|
|
34
45
|
actions: string[];
|
|
35
46
|
}
|
|
36
47
|
/**
|
|
37
48
|
* Options controlling pre-scaffold target directory validation.
|
|
38
49
|
*/
|
|
39
50
|
export interface ValidateTargetOptions {
|
|
51
|
+
/** Custom template root directory path. */
|
|
40
52
|
templateDir?: string;
|
|
53
|
+
/** Allow non-empty directory when force is true. */
|
|
41
54
|
force?: boolean;
|
|
55
|
+
/** Simulate validation checks without erroring on non-empty targets. */
|
|
42
56
|
dryRun?: boolean;
|
|
57
|
+
/** Allow targeting protected directories (internal testing only). */
|
|
43
58
|
allowProtected?: boolean;
|
|
44
59
|
}
|
|
45
60
|
/**
|
|
46
61
|
* Options controlling template file copying and file generation.
|
|
47
62
|
*/
|
|
48
63
|
export interface CopyTemplateOptions {
|
|
64
|
+
/** Simulate copying without disk mutations. */
|
|
49
65
|
dryRun?: boolean;
|
|
50
66
|
}
|
|
51
67
|
/**
|
|
@@ -75,6 +91,9 @@ export declare function copyTemplate(targetDir: string, templateDir?: string, op
|
|
|
75
91
|
export declare function scaffold(options?: ScaffoldOptions): ScaffoldResult;
|
|
76
92
|
export { ensureSymlink, ensureSymlinkOrPointer, isSameCaseInsensitiveFile, makeScriptsExecutable, isInsideGitWorkTree, initGit, runGit, assertInside, ScaffoldError, ERROR_CODES, isProtectedTarget };
|
|
77
93
|
export type { EnsureSymlinkOptions, InitGitOptions, ScaffoldErrorCode, ScaffoldErrorShape };
|
|
94
|
+
/**
|
|
95
|
+
* Unified azcodr scaffolding functions, guards, utilities, and constants module.
|
|
96
|
+
*/
|
|
78
97
|
declare const _default: {
|
|
79
98
|
scaffold: typeof scaffold;
|
|
80
99
|
validateTarget: typeof validateTarget;
|
package/lib/scaffold.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,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ACxB,yEAAyE;IACzE,MAAM,EAAE,OAAO,CAAC;IAChB,8DAA8D;IAC9D,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wEAAwE;IACxE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qEAAqE;IACrE,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,+CAA+C;IAC/C,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAkCD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,GAAG,IAAI,CAW3F;AA8FD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MAAM,EACjB,WAAW,GAAE,MAAyB,EACtC,OAAO,GAAE,mBAAwB,GAChC,MAAM,EAAE,CAeV;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,OAAO,GAAE,eAAoB,GAAG,cAAc,CAWtE;AAED,OAAO,EACL,aAAa,EAAE,sBAAsB,EAAE,yBAAyB,EAChE,qBAAqB,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,EAC3D,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB,EAC5D,CAAC;AACF,YAAY,EAAE,oBAAoB,EAAE,cAAc,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,CAAC;AAE5F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBAKE"}
|
package/lib/scaffold.js
CHANGED
|
@@ -133,6 +133,7 @@ function starterPackageJson(resolvedTarget) {
|
|
|
133
133
|
'test:coverage': 'jest --coverage',
|
|
134
134
|
lint: 'echo "No linter configured yet. Run /lets-build to configure toolchain."',
|
|
135
135
|
boundaries: 'node .agents/scripts/boundary_guard.js',
|
|
136
|
+
smoke: 'node .agents/scripts/smoke_test.js',
|
|
136
137
|
validate: 'node scripts/validate-cli.js'
|
|
137
138
|
}
|
|
138
139
|
};
|
|
@@ -197,6 +198,9 @@ export function scaffold(options = {}) {
|
|
|
197
198
|
return { success: true, targetDir: resolvedTarget, gitInitialized, dryRun, actions };
|
|
198
199
|
}
|
|
199
200
|
export { ensureSymlink, ensureSymlinkOrPointer, isSameCaseInsensitiveFile, makeScriptsExecutable, isInsideGitWorkTree, initGit, runGit, assertInside, ScaffoldError, ERROR_CODES, isProtectedTarget };
|
|
201
|
+
/**
|
|
202
|
+
* Unified azcodr scaffolding functions, guards, utilities, and constants module.
|
|
203
|
+
*/
|
|
200
204
|
export default {
|
|
201
205
|
scaffold, validateTarget, copyTemplate, ensureSymlink,
|
|
202
206
|
ensureSymlinkOrPointer, isSameCaseInsensitiveFile, makeScriptsExecutable,
|
package/lib/scaffold.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzD,OAAO,EAAE,cAA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AAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB;CAC5E,CAAC"}
|
package/lib/validate.d.ts
CHANGED
|
@@ -1,16 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tally and results returned by the architecture governance validator.
|
|
3
|
+
*/
|
|
1
4
|
export interface ValidationResult {
|
|
5
|
+
/** Total count of fatal governance errors encountered. */
|
|
2
6
|
errors: number;
|
|
7
|
+
/** Total count of non-fatal governance warnings encountered. */
|
|
3
8
|
warnings: number;
|
|
9
|
+
/** Number of progressive disclosure domain rule files verified. */
|
|
4
10
|
validatedRules: number;
|
|
11
|
+
/** Number of agent skills verified under .agents/skills/. */
|
|
5
12
|
validatedSkills: number;
|
|
13
|
+
/** Total count of internal markdown links verified. */
|
|
6
14
|
totalLinks: number;
|
|
15
|
+
/** List of broken link targets detected across workspace markdown files. */
|
|
7
16
|
brokenLinks: string[];
|
|
8
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Pluggable reporter interface receiving live validation events.
|
|
20
|
+
*/
|
|
9
21
|
export interface ValidationReporter {
|
|
22
|
+
/** Called when a check passes. */
|
|
10
23
|
pass: (msg: string) => void;
|
|
24
|
+
/** Called when a non-fatal warning is raised. */
|
|
11
25
|
warn: (msg: string) => void;
|
|
26
|
+
/** Called when a validation check fails. */
|
|
12
27
|
fail: (msg: string) => void;
|
|
28
|
+
/** Called for informative messages and section spacing. */
|
|
13
29
|
log: (msg: string) => void;
|
|
30
|
+
/** Called when a new validation phase begins. */
|
|
14
31
|
heading: (msg: string) => void;
|
|
15
32
|
}
|
|
16
33
|
/**
|
package/lib/validate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;I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AAC;IAC5B,4CAA4C;IAC5C,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,2DAA2D;IAC3D,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3B,iDAAiD;IACjD,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAED;;;;;;GAMG;AACH,wBAAsB,QAAQ,CAC5B,aAAa,GAAE,MAAsB,EACrC,QAAQ,CAAC,EAAE,kBAAkB,GAC5B,OAAO,CAAC,gBAAgB,CAAC,CAK3B;AAID;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,kBAAkB,CAEzD;;;;;AAED,wBAAkD"}
|
package/lib/validate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAoCxD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,gBAAwB,OAAO,CAAC,GAAG,EAAE,EACrC,QAA6B;IAE7B,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACpF,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,wBAAwB,CAAC,CAAC;IACnE,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC;IACzD,OAAO,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,QAAQ,CAAC,CAAC;AAClE,CAAC;AAED,MAAM,IAAI,GAAG,GAAS,EAAE,GAAE,CAAC,CAAC;AAE5B;;GAEG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC1E,CAAC;AAED,eAAe,EAAE,QAAQ,EAAE,oBAAoB,EAAE,CAAC"}
|
package/memory.md
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
| [ADR-019](./memory.md#adr-019-honest-claims-100-percent-all-metrics-gate-and-benchmark-limits-on-the-record) | Honest claims, 100% all-metrics gate, and benchmark limits on the record | 2026-10-08 | ACCEPTED | [`test_driven_development.md`](./docs/rules/test_driven_development.md) |
|
|
39
39
|
| [ADR-020](./memory.md#adr-020-generated-projects-get-deterministic-enforcement) | Generated projects get deterministic enforcement | 2026-10-08 | ACCEPTED | [`clean_code.md`](./docs/rules/clean_code.md) |
|
|
40
40
|
| [ADR-021](./memory.md#adr-021-default-on-guards-boundaries-and-starter-ci-ship-in-the-scaffold) | Default-on guards; boundaries & starter CI ship in the scaffold | 2026-10-09 | ACCEPTED | [`clean_code.md`](./docs/rules/clean_code.md) |
|
|
41
|
+
| [ADR-022](./memory.md#adr-022-cross-platform-hook-resolution-scaffolding-handover-gate-desktop-doctor--smoke-standard) | Cross-platform hook resolution, scaffolding handover gate, desktop doctor & smoke standard | 2026-10-10 | ACCEPTED | [`agentic_configuration.md`](./docs/rules/agentic_configuration.md) |
|
|
41
42
|
|
|
42
43
|
---
|
|
43
44
|
|
|
@@ -134,6 +135,13 @@
|
|
|
134
135
|
- **Consequences:** ✅ The catastrophic `--force` paths are closed, locked by `tests/protected-target.test.js` (14 tests, including symlink-alias and fault-injection cases for the two defensive catches). ✅ Only the exact protected directories are blocked: `~/my-project` and any normal subdirectory still scaffold. ✅ New stable error code follows the existing contract (branch on `code`, never message). ⚠️ A user who genuinely wants a project AT `~` must pick a subdirectory; that friction is the point.
|
|
135
136
|
- **Enforced In:** `lib/scaffold.js` (`isProtectedTarget`, `validateTarget`), `bin/azcodr.js` (fail-fast), `lib/index.d.ts`, `tests/protected-target.test.js`, `tests/error-codes.test.js`, `README.md` (security notes)
|
|
136
137
|
|
|
138
|
+
#### ADR-022: Cross-Platform Hook Resolution, Scaffolding Handover Gate, Desktop Doctor & Smoke Standard
|
|
139
|
+
- **Date:** 2026-10-10 | **Status:** ACCEPTED
|
|
140
|
+
- **Context:** Retrospectives across `thebrowser` and `sthanori` revealed recurring operational and architectural friction: (1) Running on Windows hosts under Antigravity/cmd.exe, hook commands specified as POSIX paths (`./.agents/...`) failed with `'.' is not recognized as an internal or external command`, and Antigravity sets CWD to `.agents/`, breaking relative paths. (2) During scaffolding, eager agents fabricated domain entities without user discovery, violating the bootstrapping boundary (ISSUE-005). (3) Hybrid desktop builds suffered silent defects (missing `custom-protocol`, hollow <5KB CSS bundles due to missing PostCSS, and background WebView2 process lock crashes `0x800700AA`). (4) In-memory unit test suites gave false confidence while live reverse proxies, TCP sockets, and Content-Types failed (ISSUE-004), alongside local dev port collisions (port 5173 RPMS collision in `thebrowser`).
|
|
141
|
+
- **Decision:** (1) Standardize all lifecycle hook commands in `.agents/hooks.json` (+`.example`) on cross-platform `node` runtime invocations (`node .agents/scripts/...`), supported by forwarders resolving seamlessly whether CWD is workspace root or `.agents/`. (2) Ship pure Node.js implementations for `safety_guard.js` and `verify_completion.js`, eliminating bash dependencies on Windows. (3) Enforce the mandatory Phase 5 Handover Gate in `bootstrap_workspace.sh` and `/lets-build`, halting code generation after technical plumbing and `/healthz`. (4) Author `.agents/scripts/desktop_doctor.js` (verifying `Cargo.toml` Tauri `custom-protocol` and CSS bundle density ≥ 5KB) and `.agents/scripts/smoke_test.js` (boundary graph check and port collision doctoring). Wire `smoke` into starter `package.json`.
|
|
142
|
+
- **Consequences:** ✅ Zero Windows cmd shell syntax errors during PreToolUse/PostToolUse/Stop hook execution. ✅ Full cross-platform test and verification parity across Windows, macOS, and Linux. ✅ Deterministic prevention of premature domain scaffolding, hybrid desktop build defects, and silent port collisions. ✅ 100.00% test coverage and Clean Code fitness functions preserved across all 49 test suites and 560 tests.
|
|
143
|
+
- **Enforced In:** `.agents/hooks.json`, `.agents/hooks.json.example`, `.agents/scripts/safety_guard.js`, `.agents/scripts/verify_completion.js`, `.agents/scripts/desktop_doctor.js`, `.agents/scripts/smoke_test.js`, `.agents/skills/lets-build/scripts/bootstrap_workspace.sh`, `src/scaffold.ts`, `tests/hooks-default.test.ts`, `tests/desktop-doctor.test.ts`, `tests/smoke-test.test.ts`, `tests/bootstrap-toolchain.test.ts`
|
|
144
|
+
|
|
137
145
|
#### ADR-021: Default-On Guards; Boundaries & Starter CI Ship in the Scaffold
|
|
138
146
|
- **Date:** 2026-10-09 | **Status:** ACCEPTED
|
|
139
147
|
- **Context:** The 2026-10-08 consolidated external review left three open severity items: (1) the benchmark read as a live-agent trial while its fixtures were synthetic ("100% drift elimination" over fixtures no agent produced); (2) "your agent cannot skip" was false because every shipped hook in `.agents/hooks.json` was `enabled: false`; (3) the boundary engine — the component that stopped the cycle and the layer breach in the results — was not wired into generated projects or their CI. A further finding from the review's follow-up audit: scaffolded projects inherited azcodr's own `ci.yml`/`publish.yml`, which call scripts (build, mutation, benchmark) a fresh project does not have, so generated CI failed on every push out of the box.
|
package/package.json
CHANGED
|
@@ -2,14 +2,25 @@
|
|
|
2
2
|
* Command safety guard inspecting shell commands against a destructive denylist.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Represents the result of evaluating a shell command against the safety denylist.
|
|
7
|
+
*/
|
|
5
8
|
export interface CommandViolation {
|
|
9
|
+
/** Whether the command is prohibited by the safety denylist. */
|
|
6
10
|
blocked: boolean;
|
|
11
|
+
/** Explanatory rationale if the command is blocked. */
|
|
7
12
|
reason?: string;
|
|
13
|
+
/** Normalized command string evaluated. */
|
|
8
14
|
command?: string;
|
|
9
15
|
}
|
|
10
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Denylist pattern definition matching prohibited shell commands.
|
|
19
|
+
*/
|
|
11
20
|
export interface DenylistRule {
|
|
21
|
+
/** Regular expression pattern detecting prohibited command syntax. */
|
|
12
22
|
pattern: RegExp;
|
|
23
|
+
/** Human-readable explanation of why the command is unsafe. */
|
|
13
24
|
reason: string;
|
|
14
25
|
}
|
|
15
26
|
|
|
@@ -88,6 +99,12 @@ export const DESTRUCTIVE_RULES: readonly DenylistRule[] = [
|
|
|
88
99
|
}
|
|
89
100
|
];
|
|
90
101
|
|
|
102
|
+
/**
|
|
103
|
+
* Collapses multi-line strings and extra whitespace into a single normalized shell command string.
|
|
104
|
+
*
|
|
105
|
+
* @param raw - Raw command string.
|
|
106
|
+
* @returns Cleaned single-line command string.
|
|
107
|
+
*/
|
|
91
108
|
export function normalizeCommand(raw: string): string {
|
|
92
109
|
return raw.replace(/[\r\n\t]+/g, ' ').replace(/\s+/g, ' ').trim();
|
|
93
110
|
}
|
package/src/agent-guard-file.ts
CHANGED
|
@@ -1,29 +1,60 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Default maximum lines allowed per file before triggering Refactor-Before-Add enforcement.
|
|
6
|
+
*/
|
|
4
7
|
export const DEFAULT_MAX_FILE_LINES = 300;
|
|
5
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Parameters provided to evaluate a proposed file write or edit operation.
|
|
11
|
+
*/
|
|
6
12
|
export interface FileCheckInput {
|
|
13
|
+
/** Path of the file being written or edited. */
|
|
7
14
|
filePath: string;
|
|
15
|
+
/** Proposed full file content when creating or overwriting a file. */
|
|
8
16
|
incomingContent?: string;
|
|
17
|
+
/** Chunk replacement string when applying an in-place edit. */
|
|
9
18
|
replacementContent?: string;
|
|
19
|
+
/** Target content chunk being matched and replaced. */
|
|
10
20
|
targetContent?: string;
|
|
21
|
+
/** Optional custom maximum line threshold (defaults to DEFAULT_MAX_FILE_LINES). */
|
|
11
22
|
maxLines?: number;
|
|
12
23
|
}
|
|
13
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Outcome of evaluating a proposed file modification against file size fitness functions.
|
|
27
|
+
*/
|
|
14
28
|
export interface FileCheckResult {
|
|
29
|
+
/** Whether the file edit is blocked under Refactor-Before-Add. */
|
|
15
30
|
blocked: boolean;
|
|
31
|
+
/** Human-readable explanation when the write is blocked. */
|
|
16
32
|
reason?: string;
|
|
33
|
+
/** Current line count of the file on disk. */
|
|
17
34
|
currentLines: number;
|
|
35
|
+
/** Projected line count after applying the proposed modification. */
|
|
18
36
|
projectedLines: number;
|
|
37
|
+
/** Maximum line limit enforced for this file. */
|
|
19
38
|
maxLines: number;
|
|
20
39
|
}
|
|
21
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Calculates the number of newline-delimited lines in a given text string.
|
|
43
|
+
*
|
|
44
|
+
* @param text - Input string to evaluate.
|
|
45
|
+
* @returns Total count of lines.
|
|
46
|
+
*/
|
|
22
47
|
export function countLines(text: string): number {
|
|
23
48
|
if (!text) return 0;
|
|
24
49
|
return text.split('\n').length;
|
|
25
50
|
}
|
|
26
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Reads an existing file from disk and returns its current line count.
|
|
54
|
+
*
|
|
55
|
+
* @param filePath - Path of the file to inspect.
|
|
56
|
+
* @returns Total number of lines, or 0 if unreadable or non-existent.
|
|
57
|
+
*/
|
|
27
58
|
export function readExistingLines(filePath: string): number {
|
|
28
59
|
if (!fs.existsSync(filePath)) return 0;
|
|
29
60
|
try {
|
package/src/agent-guard-tdd.ts
CHANGED
|
@@ -1,18 +1,36 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Persistent state tracking test-first TDD progress across an agent session.
|
|
6
|
+
*/
|
|
4
7
|
export interface SessionTddState {
|
|
8
|
+
/** Whether a failing test execution (RED phase) has been recorded in the session. */
|
|
5
9
|
lastFailingTestRecorded: boolean;
|
|
10
|
+
/** Unix timestamp in milliseconds when the last test execution occurred. */
|
|
6
11
|
lastTestRunTime?: number;
|
|
12
|
+
/** File path of the most recently executed test file. */
|
|
7
13
|
lastTestPath?: string;
|
|
8
14
|
}
|
|
9
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Result of evaluating a file edit against RED-before-GREEN TDD rules.
|
|
18
|
+
*/
|
|
10
19
|
export interface TddCheckResult {
|
|
20
|
+
/** Whether the file edit is blocked due to missing failing test. */
|
|
11
21
|
blocked: boolean;
|
|
22
|
+
/** Explanatory reason if the operation is blocked. */
|
|
12
23
|
reason?: string;
|
|
24
|
+
/** Whether the target file was identified as production source code. */
|
|
13
25
|
isProductionFile: boolean;
|
|
14
26
|
}
|
|
15
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Identifies whether a given path is a unit or integration test file.
|
|
30
|
+
*
|
|
31
|
+
* @param filePath - File path to inspect.
|
|
32
|
+
* @returns True if path matches test directory or file extension patterns.
|
|
33
|
+
*/
|
|
16
34
|
export function isTestFile(filePath: string): boolean {
|
|
17
35
|
const norm = filePath.replace(/\\/g, '/').toLowerCase();
|
|
18
36
|
if (/(^|\/)(tests?|__tests__)(\/|$)/i.test(norm)) {
|
|
@@ -21,12 +39,24 @@ export function isTestFile(filePath: string): boolean {
|
|
|
21
39
|
return /\.(test|spec)\.[a-z0-9]+$/i.test(norm);
|
|
22
40
|
}
|
|
23
41
|
|
|
42
|
+
/**
|
|
43
|
+
* Identifies whether a given path is a non-code file (markdown, json, yaml, images).
|
|
44
|
+
*
|
|
45
|
+
* @param filePath - File path to inspect.
|
|
46
|
+
* @returns True if file extension indicates non-code asset or configuration.
|
|
47
|
+
*/
|
|
24
48
|
export function isNonCodeFile(filePath: string): boolean {
|
|
25
49
|
const ext = path.extname(filePath).toLowerCase();
|
|
26
50
|
const nonCodeExts = new Set(['.md', '.json', '.yml', '.yaml', '.txt', '.toml', '.lock', '.svg', '.png']);
|
|
27
51
|
return nonCodeExts.has(ext);
|
|
28
52
|
}
|
|
29
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Identifies whether a given file path corresponds to production code under src/, lib/, or app/.
|
|
56
|
+
*
|
|
57
|
+
* @param filePath - File path to inspect.
|
|
58
|
+
* @returns True if path is production source code subject to RED-before-GREEN discipline.
|
|
59
|
+
*/
|
|
30
60
|
export function isProductionFile(filePath: string): boolean {
|
|
31
61
|
if (isNonCodeFile(filePath)) return false;
|
|
32
62
|
if (isTestFile(filePath)) return false;
|
|
@@ -34,6 +64,12 @@ export function isProductionFile(filePath: string): boolean {
|
|
|
34
64
|
return norm.includes('src/') || norm.includes('lib/') || norm.includes('app/');
|
|
35
65
|
}
|
|
36
66
|
|
|
67
|
+
/**
|
|
68
|
+
* Loads session TDD tracking state from disk, defaulting to unrecorded state if missing.
|
|
69
|
+
*
|
|
70
|
+
* @param stateFile - Path to the persistent session state JSON file.
|
|
71
|
+
* @returns Parsed SessionTddState object.
|
|
72
|
+
*/
|
|
37
73
|
export function readTddState(stateFile: string): SessionTddState {
|
|
38
74
|
if (!fs.existsSync(stateFile)) {
|
|
39
75
|
return { lastFailingTestRecorded: false };
|
|
@@ -46,6 +82,12 @@ export function readTddState(stateFile: string): SessionTddState {
|
|
|
46
82
|
}
|
|
47
83
|
}
|
|
48
84
|
|
|
85
|
+
/**
|
|
86
|
+
* Persists session TDD state to disk with fail-safe error handling to avoid disrupting execution.
|
|
87
|
+
*
|
|
88
|
+
* @param stateFile - Path to the persistent session state JSON file.
|
|
89
|
+
* @param state - SessionTddState object to record.
|
|
90
|
+
*/
|
|
49
91
|
export function writeTddState(stateFile: string, state: SessionTddState): void {
|
|
50
92
|
try {
|
|
51
93
|
const dir = path.dirname(stateFile);
|
package/src/agent-guard.ts
CHANGED
|
@@ -10,20 +10,37 @@ import {
|
|
|
10
10
|
} from './agent-guard-tdd.js';
|
|
11
11
|
import type { SessionTddState } from './agent-guard-tdd.js';
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Verdict returned by agent-runtime safety and architecture inspection guards.
|
|
15
|
+
*/
|
|
13
16
|
export interface GuardDecision {
|
|
17
|
+
/** Whether the requested tool operation is permitted. */
|
|
14
18
|
allowed: boolean;
|
|
19
|
+
/** Explanatory failure reason when the action is blocked. */
|
|
15
20
|
reason?: string;
|
|
21
|
+
/** Subsystem that produced the decision ('command', 'file', or 'tdd'). */
|
|
16
22
|
source?: 'command' | 'file' | 'tdd';
|
|
17
23
|
}
|
|
18
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Normalized representation of an agent tool invocation payload.
|
|
27
|
+
*/
|
|
19
28
|
export interface ToolEnvelope {
|
|
29
|
+
/** Name of the tool invoked by the agent. */
|
|
20
30
|
tool_name?: string;
|
|
31
|
+
/** Parameter payload passed to the tool invocation. */
|
|
21
32
|
tool_input?: Record<string, unknown>;
|
|
22
33
|
}
|
|
23
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Configuration options governing agent guard enforcement behavior.
|
|
37
|
+
*/
|
|
24
38
|
export interface GuardOptions {
|
|
39
|
+
/** Target workspace root directory (defaults to process.cwd()). */
|
|
25
40
|
workspaceRoot?: string;
|
|
41
|
+
/** When true, strictly mandates RED failing test before modifying production code. */
|
|
26
42
|
enforceTestFirst?: boolean;
|
|
43
|
+
/** Maximum non-overflow file line threshold before Refactor-Before-Add triggers. */
|
|
27
44
|
maxFileLines?: number;
|
|
28
45
|
}
|
|
29
46
|
|
package/src/boundaries.ts
CHANGED
|
@@ -1,25 +1,47 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Defines an architectural layer boundary rule disallowing imports from foreign layers.
|
|
6
|
+
*/
|
|
4
7
|
export interface BoundaryRule {
|
|
8
|
+
/** Name of the architectural layer (e.g., 'domain', 'core'). */
|
|
5
9
|
fromLayer: string;
|
|
10
|
+
/** Array of layer names that fromLayer is forbidden from importing. */
|
|
6
11
|
disallowImportsFrom: readonly string[];
|
|
7
12
|
}
|
|
8
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Represents an architectural boundary violation where a module imported a prohibited layer.
|
|
16
|
+
*/
|
|
9
17
|
export interface BoundaryViolation {
|
|
18
|
+
/** Path of the file containing the illegal import. */
|
|
10
19
|
file: string;
|
|
20
|
+
/** Path of the imported file that violates the rule. */
|
|
11
21
|
importedFile: string;
|
|
22
|
+
/** Origin layer of the importing file. */
|
|
12
23
|
fromLayer: string;
|
|
24
|
+
/** Target layer that was forbidden to import. */
|
|
13
25
|
toLayer: string;
|
|
14
26
|
}
|
|
15
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Report summarizing module count, detected circular cycles, and boundary violations.
|
|
30
|
+
*/
|
|
16
31
|
export interface BoundaryReport {
|
|
32
|
+
/** Total number of source modules scanned. */
|
|
17
33
|
moduleCount: number;
|
|
34
|
+
/** List of detected circular dependency cycles. */
|
|
18
35
|
cycles: string[][];
|
|
36
|
+
/** List of detected boundary violations. */
|
|
19
37
|
violations: BoundaryViolation[];
|
|
38
|
+
/** Whether the architecture is completely compliant (no cycles and no violations). */
|
|
20
39
|
ok: boolean;
|
|
21
40
|
}
|
|
22
41
|
|
|
42
|
+
/**
|
|
43
|
+
* Canonical architectural boundary rules enforcing Hexagonal / Clean Architecture layer constraints.
|
|
44
|
+
*/
|
|
23
45
|
export const DEFAULT_BOUNDARY_RULES: readonly BoundaryRule[] = [
|
|
24
46
|
{
|
|
25
47
|
fromLayer: 'domain',
|
|
@@ -41,6 +63,13 @@ function isEligibleSource(name: string): boolean {
|
|
|
41
63
|
return !name.includes('.test.') && !name.includes('.spec.');
|
|
42
64
|
}
|
|
43
65
|
|
|
66
|
+
/**
|
|
67
|
+
* Recursively discovers all eligible source files (.ts and .js) within a directory,
|
|
68
|
+
* ignoring skipped directories (e.g. node_modules, lib) and test files.
|
|
69
|
+
*
|
|
70
|
+
* @param dir - Root directory to search.
|
|
71
|
+
* @returns Sorted array of absolute file paths.
|
|
72
|
+
*/
|
|
44
73
|
export function findSourceFiles(dir: string): string[] {
|
|
45
74
|
if (!fs.existsSync(dir)) return [];
|
|
46
75
|
const results: string[] = [];
|
|
@@ -71,6 +100,12 @@ function resolveImportTarget(sourceFile: string, specifier: string): string | nu
|
|
|
71
100
|
return null;
|
|
72
101
|
}
|
|
73
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Scans a source file and extracts all local relative import and export paths.
|
|
105
|
+
*
|
|
106
|
+
* @param filePath - Absolute or relative path to the source file.
|
|
107
|
+
* @returns Sorted array of resolved local file paths imported or re-exported.
|
|
108
|
+
*/
|
|
74
109
|
export function extractLocalImports(filePath: string): string[] {
|
|
75
110
|
if (!fs.existsSync(filePath)) return [];
|
|
76
111
|
const content = fs.readFileSync(filePath, 'utf-8');
|
|
@@ -90,6 +125,12 @@ export function extractLocalImports(filePath: string): string[] {
|
|
|
90
125
|
return imports.sort();
|
|
91
126
|
}
|
|
92
127
|
|
|
128
|
+
/**
|
|
129
|
+
* Constructs a dependency graph mapping each source file to its imported local files.
|
|
130
|
+
*
|
|
131
|
+
* @param files - Array of source file paths.
|
|
132
|
+
* @returns Map where keys are source file paths and values are arrays of imported local file paths.
|
|
133
|
+
*/
|
|
93
134
|
export function buildDependencyGraph(files: readonly string[]): Map<string, string[]> {
|
|
94
135
|
const graph = new Map<string, string[]>();
|
|
95
136
|
for (const file of files) {
|
|
@@ -98,6 +139,12 @@ export function buildDependencyGraph(files: readonly string[]): Map<string, stri
|
|
|
98
139
|
return graph;
|
|
99
140
|
}
|
|
100
141
|
|
|
142
|
+
/**
|
|
143
|
+
* Analyzes a dependency graph using depth-first search to detect circular import cycles.
|
|
144
|
+
*
|
|
145
|
+
* @param graph - Map of file paths to their imported dependency file paths.
|
|
146
|
+
* @returns Array of cycle paths, where each cycle path is an array of file paths.
|
|
147
|
+
*/
|
|
101
148
|
export function detectDependencyCycles(graph: Map<string, string[]>): string[][] {
|
|
102
149
|
const cycles: string[][] = [];
|
|
103
150
|
const visited = new Set<string>();
|
|
@@ -135,6 +182,13 @@ function hasLayerSegment(pathStr: string, segment: string): boolean {
|
|
|
135
182
|
return new RegExp(`(^|[/\\\\])${segment}([/\\\\]|$)`, 'i').test(pathStr);
|
|
136
183
|
}
|
|
137
184
|
|
|
185
|
+
/**
|
|
186
|
+
* Evaluates a dependency graph against architectural boundary rules to detect prohibited cross-layer imports.
|
|
187
|
+
*
|
|
188
|
+
* @param graph - Map of file paths to their imported dependency file paths.
|
|
189
|
+
* @param rules - Architectural boundary rules to enforce (defaults to DEFAULT_BOUNDARY_RULES).
|
|
190
|
+
* @returns Array of detected boundary violations.
|
|
191
|
+
*/
|
|
138
192
|
export function detectBoundaryViolations(
|
|
139
193
|
graph: Map<string, string[]>,
|
|
140
194
|
rules: readonly BoundaryRule[] = DEFAULT_BOUNDARY_RULES
|