audit-tools 0.32.16 → 0.32.18
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/audit/cli/conceptualDispatch.d.ts +9 -1
- package/dist/audit/cli/conceptualDispatch.d.ts.map +1 -1
- package/dist/audit/cli/conceptualDispatch.js +3 -0
- package/dist/audit/cli/conceptualDispatch.js.map +1 -1
- package/dist/audit/contracts/workerSchemas.d.ts +13 -0
- package/dist/audit/contracts/workerSchemas.d.ts.map +1 -1
- package/dist/audit/decompose/buildStructureDecomposition.d.ts +14 -0
- package/dist/audit/decompose/buildStructureDecomposition.d.ts.map +1 -0
- package/dist/audit/decompose/buildStructureDecomposition.js +107 -0
- package/dist/audit/decompose/buildStructureDecomposition.js.map +1 -0
- package/dist/audit/decompose/findings.d.ts +23 -0
- package/dist/audit/decompose/findings.d.ts.map +1 -0
- package/dist/audit/decompose/findings.js +121 -0
- package/dist/audit/decompose/findings.js.map +1 -0
- package/dist/audit/decompose/sources.d.ts +21 -0
- package/dist/audit/decompose/sources.d.ts.map +1 -0
- package/dist/audit/decompose/sources.js +168 -0
- package/dist/audit/decompose/sources.js.map +1 -0
- package/dist/audit/extractors/commentDecomposition.d.ts +52 -0
- package/dist/audit/extractors/commentDecomposition.d.ts.map +1 -0
- package/dist/audit/extractors/commentDecomposition.js +298 -0
- package/dist/audit/extractors/commentDecomposition.js.map +1 -0
- package/dist/audit/extractors/dataStateCoupling.d.ts +26 -0
- package/dist/audit/extractors/dataStateCoupling.d.ts.map +1 -0
- package/dist/audit/extractors/dataStateCoupling.js +71 -0
- package/dist/audit/extractors/dataStateCoupling.js.map +1 -0
- package/dist/audit/io/artifacts.d.ts +3 -0
- package/dist/audit/io/artifacts.d.ts.map +1 -1
- package/dist/audit/io/artifacts.js +1 -0
- package/dist/audit/io/artifacts.js.map +1 -1
- package/dist/audit/orchestrator/dependencyMap.d.ts +1 -0
- package/dist/audit/orchestrator/dependencyMap.d.ts.map +1 -1
- package/dist/audit/orchestrator/dependencyMap.js +11 -0
- package/dist/audit/orchestrator/dependencyMap.js.map +1 -1
- package/dist/audit/orchestrator/executorRunners.d.ts.map +1 -1
- package/dist/audit/orchestrator/executorRunners.js +2 -1
- package/dist/audit/orchestrator/executorRunners.js.map +1 -1
- package/dist/audit/orchestrator/executors.d.ts.map +1 -1
- package/dist/audit/orchestrator/executors.js +5 -0
- package/dist/audit/orchestrator/executors.js.map +1 -1
- package/dist/audit/orchestrator/nextStep.d.ts.map +1 -1
- package/dist/audit/orchestrator/nextStep.js +1 -0
- package/dist/audit/orchestrator/nextStep.js.map +1 -1
- package/dist/audit/orchestrator/state.d.ts.map +1 -1
- package/dist/audit/orchestrator/state.js +4 -0
- package/dist/audit/orchestrator/state.js.map +1 -1
- package/dist/audit/orchestrator/structureExecutors.d.ts +8 -0
- package/dist/audit/orchestrator/structureExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/structureExecutors.js +30 -0
- package/dist/audit/orchestrator/structureExecutors.js.map +1 -1
- package/dist/audit/orchestrator/synthesisExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/synthesisExecutors.js +1 -0
- package/dist/audit/orchestrator/synthesisExecutors.js.map +1 -1
- package/dist/audit/orchestrator/taskAffinityGraph.d.ts +2 -2
- package/dist/audit/reporting/mergeFindings.d.ts +2 -1
- package/dist/audit/reporting/mergeFindings.d.ts.map +1 -1
- package/dist/audit/reporting/mergeFindings.js +9 -1
- package/dist/audit/reporting/mergeFindings.js.map +1 -1
- package/dist/audit/reporting/synthesis.d.ts +2 -0
- package/dist/audit/reporting/synthesis.d.ts.map +1 -1
- package/dist/audit/reporting/synthesis.js +1 -1
- package/dist/audit/reporting/synthesis.js.map +1 -1
- package/dist/audit/types/structureDecomposition.d.ts +27 -0
- package/dist/audit/types/structureDecomposition.d.ts.map +1 -0
- package/dist/audit/types/structureDecomposition.js +2 -0
- package/dist/audit/types/structureDecomposition.js.map +1 -0
- package/dist/audit/types.d.ts +5 -0
- package/dist/audit/types.d.ts.map +1 -1
- package/dist/audit/validation/artifacts.d.ts.map +1 -1
- package/dist/audit/validation/artifacts.js +19 -1
- package/dist/audit/validation/artifacts.js.map +1 -1
- package/dist/remediate/state/types.d.ts +5 -0
- package/dist/remediate/state/types.d.ts.map +1 -1
- package/dist/shared/decompose/consensus.d.ts +66 -0
- package/dist/shared/decompose/consensus.d.ts.map +1 -0
- package/dist/shared/decompose/consensus.js +213 -0
- package/dist/shared/decompose/consensus.js.map +1 -0
- package/dist/shared/decompose/modularity.d.ts +44 -0
- package/dist/shared/decompose/modularity.d.ts.map +1 -0
- package/dist/shared/decompose/modularity.js +249 -0
- package/dist/shared/decompose/modularity.js.map +1 -0
- package/dist/shared/index.d.ts +7 -0
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +4 -0
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/types/charter.d.ts +242 -0
- package/dist/shared/types/charter.d.ts.map +1 -0
- package/dist/shared/types/charter.js +146 -0
- package/dist/shared/types/charter.js.map +1 -0
- package/dist/shared/types/finding.d.ts +40 -0
- package/dist/shared/types/finding.d.ts.map +1 -1
- package/dist/shared/types/finding.js +10 -0
- package/dist/shared/types/finding.js.map +1 -1
- package/dist/shared/types/intentCheckpoint.d.ts +224 -0
- package/dist/shared/types/intentCheckpoint.d.ts.map +1 -1
- package/dist/shared/types/intentCheckpoint.js +16 -0
- package/dist/shared/types/intentCheckpoint.js.map +1 -1
- package/dist/shared/validation/charterGate.d.ts +38 -0
- package/dist/shared/validation/charterGate.d.ts.map +1 -0
- package/dist/shared/validation/charterGate.js +73 -0
- package/dist/shared/validation/charterGate.js.map +1 -0
- package/package.json +1 -1
- package/schemas/audit_result.schema.json +4 -0
- package/schemas/audit_results.schema.json +4 -0
- package/schemas/finding.schema.json +4 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type DispatchModelHint, type DispatchModelTier, type SessionConfig } from "audit-tools/shared";
|
|
2
2
|
import type { ArtifactBundle } from "../io/artifacts.js";
|
|
3
3
|
export interface ConceptualReviewSettings {
|
|
4
4
|
max_units?: number;
|
|
@@ -9,6 +9,14 @@ export interface ConceptualReviewSettings {
|
|
|
9
9
|
* `"standard"`; the judge always routes `"deep"`.
|
|
10
10
|
*/
|
|
11
11
|
perspective_tier?: DispatchModelTier;
|
|
12
|
+
/**
|
|
13
|
+
* True when any confirmed charter is low-confidence (Phase A conceptual spine):
|
|
14
|
+
* a review depending on a low-confidence charter must "flag for human intent
|
|
15
|
+
* input, never opine" (`charterReviewDisposition`). Absent/false when no charters
|
|
16
|
+
* are present or all are confident. The charter-aware prompt path consumes this
|
|
17
|
+
* (Phase C); until then it records the disposition on the settings contract.
|
|
18
|
+
*/
|
|
19
|
+
flag_for_human?: boolean;
|
|
12
20
|
}
|
|
13
21
|
/**
|
|
14
22
|
* Resolve the conceptual-review depth + fan-out count just before dispatch.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conceptualDispatch.d.ts","sourceRoot":"","sources":["../../../src/audit/cli/conceptualDispatch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"conceptualDispatch.d.ts","sourceRoot":"","sources":["../../../src/audit/cli/conceptualDispatch.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAEnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AASzD,MAAM,WAAW,wBAAwB;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,SAAS,GAAG,MAAM,CAAC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IACrC;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,cAAc,EACtB,aAAa,EAAE,aAAa,GAC3B,wBAAwB,CAc1B;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,OAAO,CAAC;IACd;;;OAGG;IACH,qBAAqB,EAAE,MAAM,CAAC;IAC9B,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,mDAAmD;IACnD,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,8CAA8C;IAC9C,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,+CAA+C;IAC/C,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE;QAAE,YAAY,EAAE,iBAAiB,CAAC;QAAC,KAAK,EAAE,iBAAiB,CAAA;KAAE,CAAC;CAC5E;AAED;;;;;;;;GAQG;AACH,wBAAsB,yBAAyB,CAAC,IAAI,EAAE;IACpD,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,wBAAwB,CAAC;IACnC;;;;OAIG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAmI9B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
+
import { charterReviewDisposition, } from "audit-tools/shared";
|
|
3
4
|
import { renderConceptualReviewPrompt, renderConceptualPerspectivePrompt, renderConceptualJudgePrompt, selectPerspectives, } from "../orchestrator/designReviewPrompt.js";
|
|
4
5
|
/**
|
|
5
6
|
* Resolve the conceptual-review depth + fan-out count just before dispatch.
|
|
@@ -10,11 +11,13 @@ import { renderConceptualReviewPrompt, renderConceptualPerspectivePrompt, render
|
|
|
10
11
|
export function resolveConceptualReviewSettings(bundle, sessionConfig) {
|
|
11
12
|
const checkpoint = bundle.intent_checkpoint?.design_review;
|
|
12
13
|
const cfg = sessionConfig.design_review;
|
|
14
|
+
const flagForHuman = (checkpoint?.charters ?? []).some((charter) => charterReviewDisposition(charter) === "flag_for_human");
|
|
13
15
|
return {
|
|
14
16
|
max_units: cfg?.max_units,
|
|
15
17
|
conceptual_depth: checkpoint?.conceptual_depth ?? cfg?.conceptual_depth ?? "shallow",
|
|
16
18
|
perspectives: checkpoint?.perspectives ?? cfg?.perspectives,
|
|
17
19
|
perspective_tier: cfg?.perspective_tier,
|
|
20
|
+
...(flagForHuman ? { flag_for_human: true } : {}),
|
|
18
21
|
};
|
|
19
22
|
}
|
|
20
23
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conceptualDispatch.js","sourceRoot":"","sources":["../../../src/audit/cli/conceptualDispatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"conceptualDispatch.js","sourceRoot":"","sources":["../../../src/audit/cli/conceptualDispatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAIL,wBAAwB,GACzB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAEL,4BAA4B,EAC5B,iCAAiC,EACjC,2BAA2B,EAC3B,kBAAkB,GACnB,MAAM,uCAAuC,CAAC;AAqB/C;;;;;GAKG;AACH,MAAM,UAAU,+BAA+B,CAC7C,MAAsB,EACtB,aAA4B;IAE5B,MAAM,UAAU,GAAG,MAAM,CAAC,iBAAiB,EAAE,aAAa,CAAC;IAC3D,MAAM,GAAG,GAAG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;IAEH,OAAO;QACL,IAAI,EAAE,IAAI;QACV,qBAAqB;QACrB,gBAAgB,EAAE;YAChB,6CAA6C,KAAK,wBAAwB;YAC1E,qBAAqB,KAAK,yIAAyI;YACnK,GAAG,gBAAgB;YACnB,eAAe,KAAK,4KAA4K,eAAe,sCAAsC,qBAAqB,MAAM,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;YAC9S,gUAAgU;YAChU,GAAG,CAAC,IAAI,CAAC,0BAA0B;gBACjC,CAAC,CAAC;oBACE,8HAA8H;iBAC/H;gBACH,CAAC,CAAC,EAAE,CAAC;SACR;QACD,aAAa;QACb,0EAA0E;QAC1E,gEAAgE;QAChE,SAAS,EAAE;YACT,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;YAC5C,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;YAC7C,eAAe;SAChB;QACD,UAAU,EAAE;YACV,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;YAC7C,qBAAqB;SACtB;QACD,UAAU;KACX,CAAC;AACJ,CAAC"}
|
|
@@ -38,6 +38,7 @@ export declare const WorkerFindingSchema: z.ZodObject<{
|
|
|
38
38
|
likelihood: z.ZodOptional<z.ZodString>;
|
|
39
39
|
systemic: z.ZodOptional<z.ZodBoolean>;
|
|
40
40
|
theme_id: z.ZodOptional<z.ZodString>;
|
|
41
|
+
blast_radius: z.ZodOptional<z.ZodNumber>;
|
|
41
42
|
evidence_grounded: z.ZodOptional<z.ZodBoolean>;
|
|
42
43
|
executable_anchor: z.ZodOptional<z.ZodObject<{
|
|
43
44
|
command: z.ZodArray<z.ZodString, "many">;
|
|
@@ -168,6 +169,7 @@ export declare const WorkerFindingSchema: z.ZodObject<{
|
|
|
168
169
|
systemic?: boolean | undefined;
|
|
169
170
|
related_findings?: string[] | undefined;
|
|
170
171
|
theme_id?: string | undefined;
|
|
172
|
+
blast_radius?: number | undefined;
|
|
171
173
|
evidence_grounded?: boolean | undefined;
|
|
172
174
|
grounding?: {
|
|
173
175
|
status: "grounded" | "ungrounded" | "refuted";
|
|
@@ -215,6 +217,7 @@ export declare const WorkerFindingSchema: z.ZodObject<{
|
|
|
215
217
|
systemic?: boolean | undefined;
|
|
216
218
|
related_findings?: string[] | undefined;
|
|
217
219
|
theme_id?: string | undefined;
|
|
220
|
+
blast_radius?: number | undefined;
|
|
218
221
|
evidence_grounded?: boolean | undefined;
|
|
219
222
|
grounding?: {
|
|
220
223
|
status: "grounded" | "ungrounded" | "refuted";
|
|
@@ -362,6 +365,7 @@ export declare const WorkerAuditResultSchema: z.ZodObject<{
|
|
|
362
365
|
likelihood: z.ZodOptional<z.ZodString>;
|
|
363
366
|
systemic: z.ZodOptional<z.ZodBoolean>;
|
|
364
367
|
theme_id: z.ZodOptional<z.ZodString>;
|
|
368
|
+
blast_radius: z.ZodOptional<z.ZodNumber>;
|
|
365
369
|
evidence_grounded: z.ZodOptional<z.ZodBoolean>;
|
|
366
370
|
executable_anchor: z.ZodOptional<z.ZodObject<{
|
|
367
371
|
command: z.ZodArray<z.ZodString, "many">;
|
|
@@ -492,6 +496,7 @@ export declare const WorkerAuditResultSchema: z.ZodObject<{
|
|
|
492
496
|
systemic?: boolean | undefined;
|
|
493
497
|
related_findings?: string[] | undefined;
|
|
494
498
|
theme_id?: string | undefined;
|
|
499
|
+
blast_radius?: number | undefined;
|
|
495
500
|
evidence_grounded?: boolean | undefined;
|
|
496
501
|
grounding?: {
|
|
497
502
|
status: "grounded" | "ungrounded" | "refuted";
|
|
@@ -539,6 +544,7 @@ export declare const WorkerAuditResultSchema: z.ZodObject<{
|
|
|
539
544
|
systemic?: boolean | undefined;
|
|
540
545
|
related_findings?: string[] | undefined;
|
|
541
546
|
theme_id?: string | undefined;
|
|
547
|
+
blast_radius?: number | undefined;
|
|
542
548
|
evidence_grounded?: boolean | undefined;
|
|
543
549
|
grounding?: {
|
|
544
550
|
status: "grounded" | "ungrounded" | "refuted";
|
|
@@ -737,6 +743,7 @@ export declare const WorkerAuditResultSchema: z.ZodObject<{
|
|
|
737
743
|
systemic?: boolean | undefined;
|
|
738
744
|
related_findings?: string[] | undefined;
|
|
739
745
|
theme_id?: string | undefined;
|
|
746
|
+
blast_radius?: number | undefined;
|
|
740
747
|
evidence_grounded?: boolean | undefined;
|
|
741
748
|
grounding?: {
|
|
742
749
|
status: "grounded" | "ungrounded" | "refuted";
|
|
@@ -834,6 +841,7 @@ export declare const WorkerAuditResultSchema: z.ZodObject<{
|
|
|
834
841
|
systemic?: boolean | undefined;
|
|
835
842
|
related_findings?: string[] | undefined;
|
|
836
843
|
theme_id?: string | undefined;
|
|
844
|
+
blast_radius?: number | undefined;
|
|
837
845
|
evidence_grounded?: boolean | undefined;
|
|
838
846
|
grounding?: {
|
|
839
847
|
status: "grounded" | "ungrounded" | "refuted";
|
|
@@ -942,6 +950,7 @@ export declare const WorkerAuditResultsSchema: z.ZodArray<z.ZodObject<{
|
|
|
942
950
|
likelihood: z.ZodOptional<z.ZodString>;
|
|
943
951
|
systemic: z.ZodOptional<z.ZodBoolean>;
|
|
944
952
|
theme_id: z.ZodOptional<z.ZodString>;
|
|
953
|
+
blast_radius: z.ZodOptional<z.ZodNumber>;
|
|
945
954
|
evidence_grounded: z.ZodOptional<z.ZodBoolean>;
|
|
946
955
|
executable_anchor: z.ZodOptional<z.ZodObject<{
|
|
947
956
|
command: z.ZodArray<z.ZodString, "many">;
|
|
@@ -1072,6 +1081,7 @@ export declare const WorkerAuditResultsSchema: z.ZodArray<z.ZodObject<{
|
|
|
1072
1081
|
systemic?: boolean | undefined;
|
|
1073
1082
|
related_findings?: string[] | undefined;
|
|
1074
1083
|
theme_id?: string | undefined;
|
|
1084
|
+
blast_radius?: number | undefined;
|
|
1075
1085
|
evidence_grounded?: boolean | undefined;
|
|
1076
1086
|
grounding?: {
|
|
1077
1087
|
status: "grounded" | "ungrounded" | "refuted";
|
|
@@ -1119,6 +1129,7 @@ export declare const WorkerAuditResultsSchema: z.ZodArray<z.ZodObject<{
|
|
|
1119
1129
|
systemic?: boolean | undefined;
|
|
1120
1130
|
related_findings?: string[] | undefined;
|
|
1121
1131
|
theme_id?: string | undefined;
|
|
1132
|
+
blast_radius?: number | undefined;
|
|
1122
1133
|
evidence_grounded?: boolean | undefined;
|
|
1123
1134
|
grounding?: {
|
|
1124
1135
|
status: "grounded" | "ungrounded" | "refuted";
|
|
@@ -1317,6 +1328,7 @@ export declare const WorkerAuditResultsSchema: z.ZodArray<z.ZodObject<{
|
|
|
1317
1328
|
systemic?: boolean | undefined;
|
|
1318
1329
|
related_findings?: string[] | undefined;
|
|
1319
1330
|
theme_id?: string | undefined;
|
|
1331
|
+
blast_radius?: number | undefined;
|
|
1320
1332
|
evidence_grounded?: boolean | undefined;
|
|
1321
1333
|
grounding?: {
|
|
1322
1334
|
status: "grounded" | "ungrounded" | "refuted";
|
|
@@ -1414,6 +1426,7 @@ export declare const WorkerAuditResultsSchema: z.ZodArray<z.ZodObject<{
|
|
|
1414
1426
|
systemic?: boolean | undefined;
|
|
1415
1427
|
related_findings?: string[] | undefined;
|
|
1416
1428
|
theme_id?: string | undefined;
|
|
1429
|
+
blast_radius?: number | undefined;
|
|
1417
1430
|
evidence_grounded?: boolean | undefined;
|
|
1418
1431
|
grounding?: {
|
|
1419
1432
|
status: "grounded" | "ungrounded" | "refuted";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workerSchemas.d.ts","sourceRoot":"","sources":["../../../src/audit/contracts/workerSchemas.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,kFAAkF;AAClF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;EAG7B,CAAC;AAEZ;;;;GAIG;AACH,eAAO,M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AAO,CAAC,CAkBhF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FileDisposition, GraphBundle } from "audit-tools/shared";
|
|
2
|
+
import type { RepoManifest } from "../types.js";
|
|
3
|
+
import type { StructureDecomposition } from "../types/structureDecomposition.js";
|
|
4
|
+
export interface BuildStructureDecompositionParams {
|
|
5
|
+
/** Repo root (absolute); when absent, comment/doc extraction is skipped. */
|
|
6
|
+
root?: string;
|
|
7
|
+
repoManifest: RepoManifest;
|
|
8
|
+
disposition: FileDisposition;
|
|
9
|
+
graphBundle: GraphBundle;
|
|
10
|
+
/** Injectable file reader (tests supply a map-backed reader). */
|
|
11
|
+
readFileText?: (absPath: string) => Promise<string | undefined>;
|
|
12
|
+
}
|
|
13
|
+
export declare function buildStructureDecomposition(params: BuildStructureDecompositionParams): Promise<StructureDecomposition>;
|
|
14
|
+
//# sourceMappingURL=buildStructureDecomposition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildStructureDecomposition.d.ts","sourceRoot":"","sources":["../../../src/audit/decompose/buildStructureDecomposition.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EAEZ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAgBjF,MAAM,WAAW,iCAAiC;IAChD,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,YAAY,CAAC;IAC3B,WAAW,EAAE,eAAe,CAAC;IAC7B,WAAW,EAAE,WAAW,CAAC;IACzB,iEAAiE;IACjE,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CACjE;AAmBD,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,iCAAiC,GACxC,OAAO,CAAC,sBAAsB,CAAC,CA+EjC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// Top-level Phase B orchestration: gather the structure-layer sources (behavior
|
|
2
|
+
// graphs + the two new intent extractors), run the overlay-and-delta operator,
|
|
3
|
+
// emit the non-co-localization findings, and assemble the
|
|
4
|
+
// structure_decomposition.json artifact. The single async entry point the
|
|
5
|
+
// executor calls; the pure pieces it composes are individually tested.
|
|
6
|
+
import { clustersFromPartitions, decompose } from "audit-tools/shared";
|
|
7
|
+
import { deriveCommentDecomposition, deriveDocGroups, } from "../extractors/commentDecomposition.js";
|
|
8
|
+
import { buildStructureSources } from "./sources.js";
|
|
9
|
+
import { detectNonColocalization } from "./findings.js";
|
|
10
|
+
const DOC_EXTENSION = /\.(md|markdown|adoc|rst|txt)$/i;
|
|
11
|
+
/** Threshold at which an intent source's partitions collapse into boundary groups. */
|
|
12
|
+
const INTENT_BOUNDARY_FRACTION = 0.5;
|
|
13
|
+
function toPosix(path) {
|
|
14
|
+
return path.replace(/\\/g, "/");
|
|
15
|
+
}
|
|
16
|
+
/** Convert a partition into its non-trivial member groups (size ≥ 2). */
|
|
17
|
+
function partitionGroups(partition) {
|
|
18
|
+
const byComm = new Map();
|
|
19
|
+
for (const [node, comm] of partition) {
|
|
20
|
+
const list = byComm.get(comm);
|
|
21
|
+
if (list)
|
|
22
|
+
list.push(node);
|
|
23
|
+
else
|
|
24
|
+
byComm.set(comm, [node]);
|
|
25
|
+
}
|
|
26
|
+
const groups = [];
|
|
27
|
+
for (const members of byComm.values()) {
|
|
28
|
+
if (members.length >= 2) {
|
|
29
|
+
groups.push([...members].sort((a, b) => a.localeCompare(b)));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return groups;
|
|
33
|
+
}
|
|
34
|
+
export async function buildStructureDecomposition(params) {
|
|
35
|
+
// In-scope code universe = disposition-included files; doc files (prose intent)
|
|
36
|
+
// are the doc_only status plus markdown/asciidoc/rst by extension.
|
|
37
|
+
const universe = [];
|
|
38
|
+
const docFiles = [];
|
|
39
|
+
for (const item of params.disposition.files) {
|
|
40
|
+
const path = toPosix(item.path);
|
|
41
|
+
if (item.status === "included")
|
|
42
|
+
universe.push(path);
|
|
43
|
+
if (item.status === "doc_only" || DOC_EXTENSION.test(path)) {
|
|
44
|
+
if (item.status !== "excluded" && item.status !== "binary") {
|
|
45
|
+
docFiles.push(path);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const sortedUniverse = [...new Set(universe)].sort((a, b) => a.localeCompare(b));
|
|
50
|
+
const sortedDocs = [...new Set(docFiles)].sort((a, b) => a.localeCompare(b));
|
|
51
|
+
// Async intent extraction (skipped without a root — degrades to empty).
|
|
52
|
+
const commentResult = params.root
|
|
53
|
+
? await deriveCommentDecomposition({
|
|
54
|
+
root: params.root,
|
|
55
|
+
files: sortedUniverse,
|
|
56
|
+
readFileText: params.readFileText,
|
|
57
|
+
})
|
|
58
|
+
: { edges: [], scannedFiles: 0 };
|
|
59
|
+
const docGroups = params.root
|
|
60
|
+
? await deriveDocGroups({
|
|
61
|
+
root: params.root,
|
|
62
|
+
docFiles: sortedDocs,
|
|
63
|
+
codeFiles: sortedUniverse,
|
|
64
|
+
readFileText: params.readFileText,
|
|
65
|
+
})
|
|
66
|
+
: [];
|
|
67
|
+
const sources = buildStructureSources({
|
|
68
|
+
universe: sortedUniverse,
|
|
69
|
+
graphBundle: params.graphBundle,
|
|
70
|
+
commentEdges: commentResult.edges,
|
|
71
|
+
docGroups,
|
|
72
|
+
});
|
|
73
|
+
const result = decompose(sources, "structure");
|
|
74
|
+
// Finding inputs: pooled behavior partitions, all intent-declared boundaries,
|
|
75
|
+
// and the stated-purpose subset (docs + comments) for the smeared-purpose side.
|
|
76
|
+
const behaviorPartitions = sources
|
|
77
|
+
.filter((s) => s.family === "behavior")
|
|
78
|
+
.flatMap((s) => s.partitions);
|
|
79
|
+
const intentBoundaries = [];
|
|
80
|
+
const purposeGroups = [];
|
|
81
|
+
for (const source of sources) {
|
|
82
|
+
if (source.family !== "intent")
|
|
83
|
+
continue;
|
|
84
|
+
const groups = source.partitions.length === 1
|
|
85
|
+
? partitionGroups(source.partitions[0])
|
|
86
|
+
: clustersFromPartitions(source.partitions, INTENT_BOUNDARY_FRACTION);
|
|
87
|
+
intentBoundaries.push(...groups);
|
|
88
|
+
if (source.id === "docs" || source.id === "comments") {
|
|
89
|
+
purposeGroups.push(...groups);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
const findings = detectNonColocalization({
|
|
93
|
+
behaviorPartitions,
|
|
94
|
+
intentBoundaries,
|
|
95
|
+
purposeGroups,
|
|
96
|
+
});
|
|
97
|
+
return {
|
|
98
|
+
generated_at: new Date().toISOString(),
|
|
99
|
+
target: result.target,
|
|
100
|
+
node_universe_size: sortedUniverse.length,
|
|
101
|
+
source_ids: sources.map((s) => s.id),
|
|
102
|
+
consensus: result.consensus,
|
|
103
|
+
contested: result.contested,
|
|
104
|
+
findings,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=buildStructureDecomposition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildStructureDecomposition.js","sourceRoot":"","sources":["../../../src/audit/decompose/buildStructureDecomposition.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,+EAA+E;AAC/E,0DAA0D;AAC1D,0EAA0E;AAC1E,uEAAuE;AAOvE,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGvE,OAAO,EACL,0BAA0B,EAC1B,eAAe,GAChB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAExD,MAAM,aAAa,GAAG,gCAAgC,CAAC;AACvD,sFAAsF;AACtF,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAErC,SAAS,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AAM;QACrB,kBAAkB,EAAE,cAAc,CAAC,MAAM;QACzC,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACpC,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Finding } from "../types.js";
|
|
2
|
+
import type { Partition } from "audit-tools/shared";
|
|
3
|
+
export interface NonColocalizationInput {
|
|
4
|
+
/** Pooled behavior partitions (every resolution of every behavior source). */
|
|
5
|
+
behaviorPartitions: Partition[];
|
|
6
|
+
/** All intent-declared boundaries (directory + docs + comments groups). */
|
|
7
|
+
intentBoundaries: string[][];
|
|
8
|
+
/** Explicit stated-purpose groups (docs + comments only — not directory). */
|
|
9
|
+
purposeGroups: string[][];
|
|
10
|
+
agreementThreshold?: number;
|
|
11
|
+
overlapThreshold?: number;
|
|
12
|
+
/** Minimum behavior-cluster size to report a no-purpose finding. */
|
|
13
|
+
minClusterSize?: number;
|
|
14
|
+
/** Cap on findings emitted per kind (deterministic top-by-size). */
|
|
15
|
+
maxPerKind?: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Emit the two non-co-localization finding kinds. Deterministic: clusters/groups
|
|
19
|
+
* are processed largest-first (ties by first member), and ids are a stable
|
|
20
|
+
* instance-scoped SD-### sequence.
|
|
21
|
+
*/
|
|
22
|
+
export declare function detectNonColocalization(input: NonColocalizationInput): Finding[];
|
|
23
|
+
//# sourceMappingURL=findings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findings.d.ts","sourceRoot":"","sources":["../../../src/audit/decompose/findings.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AA8BpD,MAAM,WAAW,sBAAsB;IACrC,8EAA8E;IAC9E,kBAAkB,EAAE,SAAS,EAAE,CAAC;IAChC,2EAA2E;IAC3E,gBAAgB,EAAE,MAAM,EAAE,EAAE,CAAC;IAC7B,6EAA6E;IAC7E,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oEAAoE;IACpE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAOD;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,sBAAsB,GAC5B,OAAO,EAAE,CA+EX"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// The two non-co-localization findings (Phase B; design of record
|
|
2
|
+
// spec/conceptual-design-review-design.md §"The two non-co-localizations are
|
|
3
|
+
// first-class findings"). When structure-consensus (behavior) and the
|
|
4
|
+
// intent-declared boundaries FAIL to coincide:
|
|
5
|
+
// - behavioral cluster with no coherent purpose → accidental complexity / dead
|
|
6
|
+
// subsystem (a coupling cluster no declared boundary owns).
|
|
7
|
+
// - a purpose with no behavioral cluster → a goal smeared across the codebase,
|
|
8
|
+
// never modularized (often the highest-value refactor).
|
|
9
|
+
//
|
|
10
|
+
// Deterministic LEADS, not verdicts (confidence: low): they mark where the
|
|
11
|
+
// behavior graphs and the human-declared boundaries disagree, for the Phase C
|
|
12
|
+
// charter pass to confirm against real charters. blast_radius is left unset
|
|
13
|
+
// (Phase C populates goal-graph linkage).
|
|
14
|
+
import { clustersFromPartitions } from "audit-tools/shared";
|
|
15
|
+
/** Structural boundary-integrity findings carry the architecture lens. */
|
|
16
|
+
const LENS = "architecture";
|
|
17
|
+
function createIdGenerator() {
|
|
18
|
+
let n = 1;
|
|
19
|
+
return () => `SD-${String(n++).padStart(3, "0")}`;
|
|
20
|
+
}
|
|
21
|
+
/** |subset ∩ group| / |subset|. */
|
|
22
|
+
function overlapFraction(subset, group) {
|
|
23
|
+
if (subset.length === 0)
|
|
24
|
+
return 0;
|
|
25
|
+
let hit = 0;
|
|
26
|
+
for (const m of subset)
|
|
27
|
+
if (group.has(m))
|
|
28
|
+
hit += 1;
|
|
29
|
+
return hit / subset.length;
|
|
30
|
+
}
|
|
31
|
+
/** Best fraction of `members` contained in any single group. */
|
|
32
|
+
function bestContainment(members, groups) {
|
|
33
|
+
let best = 0;
|
|
34
|
+
for (const group of groups) {
|
|
35
|
+
const set = new Set(group);
|
|
36
|
+
const frac = overlapFraction(members, set);
|
|
37
|
+
if (frac > best)
|
|
38
|
+
best = frac;
|
|
39
|
+
}
|
|
40
|
+
return best;
|
|
41
|
+
}
|
|
42
|
+
const DEFAULT_AGREEMENT = 0.5;
|
|
43
|
+
const DEFAULT_OVERLAP = 0.6;
|
|
44
|
+
const DEFAULT_MIN_CLUSTER = 3;
|
|
45
|
+
const DEFAULT_MAX_PER_KIND = 20;
|
|
46
|
+
/**
|
|
47
|
+
* Emit the two non-co-localization finding kinds. Deterministic: clusters/groups
|
|
48
|
+
* are processed largest-first (ties by first member), and ids are a stable
|
|
49
|
+
* instance-scoped SD-### sequence.
|
|
50
|
+
*/
|
|
51
|
+
export function detectNonColocalization(input) {
|
|
52
|
+
const agreementThreshold = input.agreementThreshold ?? DEFAULT_AGREEMENT;
|
|
53
|
+
const overlapThreshold = input.overlapThreshold ?? DEFAULT_OVERLAP;
|
|
54
|
+
const minClusterSize = input.minClusterSize ?? DEFAULT_MIN_CLUSTER;
|
|
55
|
+
const maxPerKind = input.maxPerKind ?? DEFAULT_MAX_PER_KIND;
|
|
56
|
+
const nextId = createIdGenerator();
|
|
57
|
+
const bySizeThenFirst = (a, b) => b.length - a.length || (a[0] ?? "").localeCompare(b[0] ?? "");
|
|
58
|
+
const findings = [];
|
|
59
|
+
// One clustering pass shared by both detectors: the full set for the
|
|
60
|
+
// purpose-side containment check, the size-filtered set for the no-purpose one.
|
|
61
|
+
const allBehaviorClusters = clustersFromPartitions(input.behaviorPartitions, agreementThreshold);
|
|
62
|
+
// --- Behavioral cluster with no coherent purpose ---
|
|
63
|
+
const behaviorClusters = allBehaviorClusters
|
|
64
|
+
.filter((c) => c.length >= minClusterSize)
|
|
65
|
+
.sort(bySizeThenFirst);
|
|
66
|
+
for (const cluster of behaviorClusters.slice(0, maxPerKind)) {
|
|
67
|
+
const best = bestContainment(cluster, input.intentBoundaries);
|
|
68
|
+
if (best + 1e-12 >= overlapThreshold)
|
|
69
|
+
continue; // aligns to a declared boundary
|
|
70
|
+
findings.push({
|
|
71
|
+
id: nextId(),
|
|
72
|
+
title: `Behavioral cluster spans declared boundaries: ${cluster.length} files`,
|
|
73
|
+
category: "non_colocalization_behavioral",
|
|
74
|
+
severity: "low",
|
|
75
|
+
confidence: "low",
|
|
76
|
+
lens: LENS,
|
|
77
|
+
summary: `These ${cluster.length} files are tightly coupled by behavior (call/import, ` +
|
|
78
|
+
`co-change, and/or shared state) yet no single declared boundary ` +
|
|
79
|
+
`(directory, doc, or comment grouping) contains most of them ` +
|
|
80
|
+
`(best overlap ${(best * 100).toFixed(0)}%). A coupling cluster no ` +
|
|
81
|
+
`declared purpose owns is accidental complexity or a dead subsystem — a ` +
|
|
82
|
+
`lead for the conceptual charter pass to confirm.`,
|
|
83
|
+
affected_files: cluster.map((path) => ({ path })),
|
|
84
|
+
evidence: [
|
|
85
|
+
`Behavioral coupling consensus across ${input.behaviorPartitions.length} resolution levels.`,
|
|
86
|
+
`Best containment in any declared boundary: ${(best * 100).toFixed(0)}% (threshold ${(overlapThreshold * 100).toFixed(0)}%).`,
|
|
87
|
+
],
|
|
88
|
+
systemic: true,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
// --- A purpose with no behavioral cluster (smeared) ---
|
|
92
|
+
const purposeGroups = [...input.purposeGroups]
|
|
93
|
+
.filter((g) => g.length >= 2)
|
|
94
|
+
.sort(bySizeThenFirst);
|
|
95
|
+
for (const group of purposeGroups.slice(0, maxPerKind)) {
|
|
96
|
+
const best = bestContainment(group, allBehaviorClusters);
|
|
97
|
+
if (best + 1e-12 >= overlapThreshold)
|
|
98
|
+
continue; // the purpose IS a behavior cluster
|
|
99
|
+
findings.push({
|
|
100
|
+
id: nextId(),
|
|
101
|
+
title: `Declared purpose is behaviorally smeared: ${group.length} files`,
|
|
102
|
+
category: "non_colocalization_purpose",
|
|
103
|
+
severity: "low",
|
|
104
|
+
confidence: "low",
|
|
105
|
+
lens: LENS,
|
|
106
|
+
summary: `A doc/comment grouping declares these ${group.length} files a unit, but ` +
|
|
107
|
+
`they do not form a behavioral cluster — no single coupling cluster ` +
|
|
108
|
+
`contains most of them (best overlap ${(best * 100).toFixed(0)}%). A ` +
|
|
109
|
+
`purpose smeared across the codebase and never modularized is often the ` +
|
|
110
|
+
`highest-value refactor — a lead for the conceptual charter pass.`,
|
|
111
|
+
affected_files: group.map((path) => ({ path })),
|
|
112
|
+
evidence: [
|
|
113
|
+
`Declared as one unit by an intent-declared source (doc/comment).`,
|
|
114
|
+
`Best containment in any behavioral cluster: ${(best * 100).toFixed(0)}% (threshold ${(overlapThreshold * 100).toFixed(0)}%).`,
|
|
115
|
+
],
|
|
116
|
+
systemic: true,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
return findings;
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=findings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findings.js","sourceRoot":"","sources":["../../../src/audit/decompose/findings.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,6EAA6E;AAC7E,sEAAsE;AACtE,+CAA+C;AAC/C,iFAAiF;AACjF,gEAAgE;AAChE,iFAAiF;AACjF,4DAA4D;AAC5D,EAAE;AACF,2EAA2E;AAC3E,8EAA8E;AAC9E,4EAA4E;AAC5E,0CAA0C;AAI1C,OAAO,EAAE,sBA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EAAE,KAAK;YACf,UAAU,EAAE,KAAK;YACjB,IAAI,EAAE,IAAI;YACV,OAAO,EACL,yCAAyC,KAAK,CAAC,MAAM,qBAAqB;gBAC1E,qEAAqE;gBACrE,uCAAuC,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ;gBACtE,yEAAyE;gBACzE,kEAAkE;YACpE,cAAc,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;YAC/C,QAAQ,EAAE;gBACR,kEAAkE;gBAClE,+CAA+C,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,gBAAgB,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK;aAC/H;YACD,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { DecompositionSource, GraphBundle } from "audit-tools/shared";
|
|
2
|
+
import { type CouplingEdge } from "../extractors/dataStateCoupling.js";
|
|
3
|
+
export interface StructureSourcesInput {
|
|
4
|
+
/** In-scope files (posix, sorted, unique) — the shared node universe. */
|
|
5
|
+
universe: string[];
|
|
6
|
+
graphBundle: GraphBundle;
|
|
7
|
+
/** Comment cross-reference edges from deriveCommentDecomposition. */
|
|
8
|
+
commentEdges: CouplingEdge[];
|
|
9
|
+
/** Doc-declared groups from deriveDocGroups. */
|
|
10
|
+
docGroups: string[][];
|
|
11
|
+
resolutions?: readonly number[];
|
|
12
|
+
/** Directory depths for the intent directory family (default [1,2,3]). */
|
|
13
|
+
directoryDepths?: number[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Build the structure-layer decomposition sources. Behavior sources with no edges
|
|
17
|
+
* and intent sources with no non-trivial grouping are omitted so an empty source
|
|
18
|
+
* never dilutes the agreement mean.
|
|
19
|
+
*/
|
|
20
|
+
export declare function buildStructureSources(input: StructureSourcesInput): DecompositionSource[];
|
|
21
|
+
//# sourceMappingURL=sources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../../src/audit/decompose/sources.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,mBAAmB,EACnB,WAAW,EAEZ,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAEL,KAAK,YAAY,EAClB,MAAM,oCAAoC,CAAC;AAqF5C,MAAM,WAAW,qBAAqB;IACpC,yEAAyE;IACzE,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,EAAE,WAAW,CAAC;IACzB,qEAAqE;IACrE,YAAY,EAAE,YAAY,EAAE,CAAC;IAC7B,gDAAgD;IAChD,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;IACtB,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,0EAA0E;IAC1E,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAID;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,qBAAqB,GAC3B,mBAAmB,EAAE,CAmFvB"}
|