audit-tools 0.32.6 → 0.32.8
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/LICENSE +15 -0
- package/README.md +2 -0
- package/dist/audit/cli/args.d.ts.map +1 -1
- package/dist/audit/cli/args.js +5 -5
- package/dist/audit/cli/args.js.map +1 -1
- package/dist/audit/cli/dispatch.d.ts.map +1 -1
- package/dist/audit/cli/dispatch.js +7 -1
- package/dist/audit/cli/dispatch.js.map +1 -1
- package/dist/audit/cli/rollingAuditDispatch.d.ts.map +1 -1
- package/dist/audit/cli/rollingAuditDispatch.js +26 -0
- package/dist/audit/cli/rollingAuditDispatch.js.map +1 -1
- package/dist/audit/cli/semanticReviewStep.d.ts.map +1 -1
- package/dist/audit/cli/semanticReviewStep.js +8 -1
- package/dist/audit/cli/semanticReviewStep.js.map +1 -1
- package/dist/audit/extractors/fileInventory.d.ts.map +1 -1
- package/dist/audit/extractors/fileInventory.js +12 -2
- package/dist/audit/extractors/fileInventory.js.map +1 -1
- package/dist/audit/orchestrator/planningExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/planningExecutors.js +1 -0
- package/dist/audit/orchestrator/planningExecutors.js.map +1 -1
- package/dist/audit/quota/hostLimits.d.ts +3 -2
- package/dist/audit/quota/hostLimits.d.ts.map +1 -1
- package/dist/audit/quota/hostLimits.js +2 -2
- package/dist/audit/quota/hostLimits.js.map +1 -1
- package/dist/audit/quota/index.d.ts +16 -16
- package/dist/remediate/contractPipeline/changeClassification.d.ts +7 -4
- package/dist/remediate/contractPipeline/changeClassification.d.ts.map +1 -1
- package/dist/remediate/contractPipeline/changeClassification.js +37 -5
- package/dist/remediate/contractPipeline/changeClassification.js.map +1 -1
- package/dist/remediate/contractPipeline/derive.d.ts +34 -4
- package/dist/remediate/contractPipeline/derive.d.ts.map +1 -1
- package/dist/remediate/contractPipeline/derive.js +148 -4
- package/dist/remediate/contractPipeline/derive.js.map +1 -1
- package/dist/remediate/contractPipeline/phaseCut.d.ts +6 -4
- package/dist/remediate/contractPipeline/phaseCut.d.ts.map +1 -1
- package/dist/remediate/contractPipeline/phaseCut.js +83 -7
- package/dist/remediate/contractPipeline/phaseCut.js.map +1 -1
- package/dist/remediate/contractPipeline/phaseCutArtifact.d.ts +3 -1
- package/dist/remediate/contractPipeline/phaseCutArtifact.d.ts.map +1 -1
- package/dist/remediate/contractPipeline/phaseCutArtifact.js +3 -1
- package/dist/remediate/contractPipeline/phaseCutArtifact.js.map +1 -1
- package/dist/remediate/index.d.ts +5 -3
- package/dist/remediate/index.d.ts.map +1 -1
- package/dist/remediate/index.js +24 -6
- package/dist/remediate/index.js.map +1 -1
- package/dist/remediate/phases/close.d.ts.map +1 -1
- package/dist/remediate/phases/close.js +3 -2
- package/dist/remediate/phases/close.js.map +1 -1
- package/dist/remediate/quota/hostLimits.d.ts +3 -2
- package/dist/remediate/quota/hostLimits.d.ts.map +1 -1
- package/dist/remediate/quota/hostLimits.js +2 -2
- package/dist/remediate/quota/hostLimits.js.map +1 -1
- package/dist/remediate/riskSignal.d.ts +6 -3
- package/dist/remediate/riskSignal.d.ts.map +1 -1
- package/dist/remediate/riskSignal.js +6 -3
- package/dist/remediate/riskSignal.js.map +1 -1
- package/dist/remediate/steps/contractPipeline.d.ts +1 -2
- package/dist/remediate/steps/contractPipeline.d.ts.map +1 -1
- package/dist/remediate/steps/contractPipeline.js +83 -108
- package/dist/remediate/steps/contractPipeline.js.map +1 -1
- package/dist/remediate/steps/contractPipelinePrompts.js +3 -3
- package/dist/remediate/steps/contractPipelinePrompts.js.map +1 -1
- package/dist/remediate/steps/dispatch.d.ts.map +1 -1
- package/dist/remediate/steps/dispatch.js +26 -13
- package/dist/remediate/steps/dispatch.js.map +1 -1
- package/dist/remediate/steps/nextStep.d.ts.map +1 -1
- package/dist/remediate/steps/nextStep.js +10 -3
- package/dist/remediate/steps/nextStep.js.map +1 -1
- package/dist/remediate/steps/rollingSession.d.ts +67 -0
- package/dist/remediate/steps/rollingSession.d.ts.map +1 -1
- package/dist/remediate/steps/rollingSession.js +124 -1
- package/dist/remediate/steps/rollingSession.js.map +1 -1
- package/dist/remediate/validation/contractPipeline.d.ts.map +1 -1
- package/dist/remediate/validation/contractPipeline.js +62 -0
- package/dist/remediate/validation/contractPipeline.js.map +1 -1
- package/dist/shared/friction/frictionRecord.d.ts +31 -6
- package/dist/shared/friction/frictionRecord.d.ts.map +1 -1
- package/dist/shared/friction/frictionRecord.js.map +1 -1
- package/dist/shared/friction/stepBoundaryCapture.d.ts +4 -1
- package/dist/shared/friction/stepBoundaryCapture.d.ts.map +1 -1
- package/dist/shared/friction/stepBoundaryCapture.js.map +1 -1
- package/dist/shared/friction/triage.d.ts +30 -5
- package/dist/shared/friction/triage.d.ts.map +1 -1
- package/dist/shared/friction/triage.js +65 -19
- package/dist/shared/friction/triage.js.map +1 -1
- package/dist/shared/index.d.ts +6 -3
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +5 -2
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/io/auditToolsPaths.d.ts +15 -1
- package/dist/shared/io/auditToolsPaths.d.ts.map +1 -1
- package/dist/shared/io/auditToolsPaths.js +23 -3
- package/dist/shared/io/auditToolsPaths.js.map +1 -1
- package/dist/shared/io/repoRoot.d.ts +28 -0
- package/dist/shared/io/repoRoot.d.ts.map +1 -0
- package/dist/shared/io/repoRoot.js +39 -0
- package/dist/shared/io/repoRoot.js.map +1 -0
- package/dist/shared/providers/openAiCompatibleProvider.d.ts.map +1 -1
- package/dist/shared/providers/openAiCompatibleProvider.js +68 -17
- package/dist/shared/providers/openAiCompatibleProvider.js.map +1 -1
- package/dist/shared/providers/providerFactory.d.ts +9 -2
- package/dist/shared/providers/providerFactory.d.ts.map +1 -1
- package/dist/shared/providers/providerFactory.js +19 -4
- package/dist/shared/providers/providerFactory.js.map +1 -1
- package/dist/shared/providers/types.d.ts +13 -0
- package/dist/shared/providers/types.d.ts.map +1 -1
- package/dist/shared/quota/capacity.d.ts +7 -7
- package/dist/shared/quota/codexHostConfig.d.ts +24 -0
- package/dist/shared/quota/codexHostConfig.d.ts.map +1 -0
- package/dist/shared/quota/codexHostConfig.js +49 -0
- package/dist/shared/quota/codexHostConfig.js.map +1 -0
- package/dist/shared/quota/hostLimits.d.ts +4 -7
- package/dist/shared/quota/hostLimits.d.ts.map +1 -1
- package/dist/shared/quota/hostLimits.js +18 -11
- package/dist/shared/quota/hostLimits.js.map +1 -1
- package/dist/shared/quota/types.d.ts +4 -4
- package/dist/shared/quota/types.d.ts.map +1 -1
- package/dist/shared/quota/types.js +7 -0
- package/dist/shared/quota/types.js.map +1 -1
- package/dist/shared/types/sessionConfig.d.ts +12 -0
- package/dist/shared/types/sessionConfig.d.ts.map +1 -1
- package/dist/shared/types/sessionConfig.js.map +1 -1
- package/docs/audit-pkg/contracts.md +4 -2
- package/docs/audit-pkg/development.md +11 -8
- package/docs/audit-pkg/operator-guide.md +3 -3
- package/docs/audit-pkg/product.md +1 -1
- package/docs/audit-pkg/release.md +15 -12
- package/package.json +8 -5
- package/remediate-code.mjs +3 -1
- package/skills/audit-code/SKILL.md +8 -4
- package/skills/audit-code/audit-code.prompt.md +15 -18
- package/skills/audit-code/opencode-command-template.txt +4 -5
- package/skills/remediate-code/remediate-code.prompt.md +9 -5
- package/wrapper/audit-code-wrapper-install-hosts.mjs +1 -1
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
* `spec/self-scaling-pipeline-design.md`): the ONE shared risk/complexity signal
|
|
4
4
|
* that BOTH self-scaling dials (adversarial depth, phase granularity) will read.
|
|
5
5
|
*
|
|
6
|
-
* This module
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* This module *produces and carries* the signal; the two dials that consume it
|
|
7
|
+
* are now wired in `src/remediate/steps/contractPipeline.ts` — the adversarial-depth
|
|
8
|
+
* dial (`adversarialDepthForTier`, T1 slice 4a) and the round-trip granularity-collapse
|
|
9
|
+
* dial (`roundTripGranularityForTier`, T1 slice 4b) both key off the (possibly escalated)
|
|
10
|
+
* tier, so the signal actively shapes pipeline behavior. This module remains the single
|
|
11
|
+
* source both dials read.
|
|
9
12
|
*
|
|
10
13
|
* Hard constraints (from the spec):
|
|
11
14
|
* - Computed CHEAPLY at intake from data available at the routing point only:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"riskSignal.d.ts","sourceRoot":"","sources":["../../src/remediate/riskSignal.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"riskSignal.d.ts","sourceRoot":"","sources":["../../src/remediate/riskSignal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH,eAAO,MAAM,iCAAiC,EAC5C,4CAAqD,CAAC;AAExD;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAIjD,uEAAuE;AACvE,wBAAgB,WAAW,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAE9D;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,MAAM,CAAC;AAEhD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,gBAAgB,CAEpF;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG,MAAM,CAAC;AAExD,2EAA2E;AAC3E,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,QAAQ,GAAG,SAAS,GACzB,oBAAoB,CAEtB;AAED,0FAA0F;AAC1F,MAAM,WAAW,eAAe;IAC9B,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,EAAE,SAAS,eAAe,EAOhE,CAAC;AAEF;;;;GA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/B,gBAAgB,CAWlB;AAED,MAAM,WAAW,0BAA0B;IACzC,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB,yEAAyE;IACzE,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,0BAA0B,GAChC,sBAAsB,GAAG,SAAS,CAwBpC;AAED,iFAAiF;AACjF,wBAAsB,oBAAoB,CACxC,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAEvC;AAED,kDAAkD;AAClD,wBAAsB,qBAAqB,CACzC,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,sBAAsB,CAC1C,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC,GAC3E,OAAO,CAAC,gBAAgB,CAAC,CAQ3B"}
|
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
* `spec/self-scaling-pipeline-design.md`): the ONE shared risk/complexity signal
|
|
4
4
|
* that BOTH self-scaling dials (adversarial depth, phase granularity) will read.
|
|
5
5
|
*
|
|
6
|
-
* This module
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* This module *produces and carries* the signal; the two dials that consume it
|
|
7
|
+
* are now wired in `src/remediate/steps/contractPipeline.ts` — the adversarial-depth
|
|
8
|
+
* dial (`adversarialDepthForTier`, T1 slice 4a) and the round-trip granularity-collapse
|
|
9
|
+
* dial (`roundTripGranularityForTier`, T1 slice 4b) both key off the (possibly escalated)
|
|
10
|
+
* tier, so the signal actively shapes pipeline behavior. This module remains the single
|
|
11
|
+
* source both dials read.
|
|
9
12
|
*
|
|
10
13
|
* Hard constraints (from the spec):
|
|
11
14
|
* - Computed CHEAPLY at intake from data available at the routing point only:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"riskSignal.js","sourceRoot":"","sources":["../../src/remediate/riskSignal.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"riskSignal.js","sourceRoot":"","sources":["../../src/remediate/riskSignal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,CAAC,MAAM,iCAAiC,GAC5C,4CAAqD,CAAC;AAUxD,MAAM,SAAS,GAA6B,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;AAE3E,uEAAuE;AACvE,MAAM,UAAU,WAAW,CAAC,CAAW,EAAE,CAAW;IAClD,OAAO,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9C,CAAC;AAaD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAA0B;IAChE,OAAO,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;AAC3C,CAAC;AAiBD,2EAA2E;AAC3E,MAAM,UAAU,2BAA2B,CACzC,IAA0B;IAE1B,OAAO,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC;AAC/C,CAAC;AAUD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAA+B;IACpE,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,uDAAuD,EAAE;IAC1F,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,i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CAAC;QAC1B,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,0BAA0B,KAAK,CAAC,WAAW,0CAA0C;SAC9F,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,iFAAiF;AACjF,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,YAAoB;IAEpB,OAAO,oBAAoB,CAAmB,WAAW,CAAC,YAAY,CAAC,CAAC,UAAU,CAAC,CAAC;AACtF,CAAC;AAED,kDAAkD;AAClD,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,YAAoB,EACpB,MAAwB;IAExB,MAAM,aAAa,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AACpE,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,YAAoB,EACpB,YAA4E;IAE5E,MAAM,QAAQ,GAAG,MAAM,oBAAoB,CAAC,YAAY,CAAC,CAAC;IAC1D,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,MAAM,MAAM,GAAG,uBAAuB,CAAC,MAAM,YAAY,EAAE,CAAC,CAAC;IAC7D,MAAM,qBAAqB,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IAClD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -262,10 +262,9 @@ export declare function evaluatePreCriticStructuralGate(artifactsDir: string): P
|
|
|
262
262
|
export declare function evaluatePromotedPlanCitationGrounding(artifactsDir: string, repoRoot: string): Promise<{
|
|
263
263
|
violations: string[];
|
|
264
264
|
} | null>;
|
|
265
|
-
/** The
|
|
265
|
+
/** The phase(s) that fan out per module, and the artifact each produces. */
|
|
266
266
|
declare const PARALLEL_MODULE_PHASES: {
|
|
267
267
|
readonly module_contract_drafting: "module_contracts";
|
|
268
|
-
readonly contract_finalization: "finalized_module_contracts";
|
|
269
268
|
};
|
|
270
269
|
type ParallelModulePhase = keyof typeof PARALLEL_MODULE_PHASES;
|
|
271
270
|
export declare function isParallelModulePhase(phase: string): phase is ParallelModulePhase;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contractPipeline.d.ts","sourceRoot":"","sources":["../../../src/remediate/steps/contractPipeline.ts"],"names":[],"mappings":"AAwBA,OAAO,EAOL,KAAK,eAAe,EACpB,KAAK,WAAW,EAIhB,KAAK,aAAa,EAEnB,MAAM,oBAAoB,CAAC;AA+E5B,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AAIzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AA6ClD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAEhD,8EAA8E;AAC9E,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAE/C;;;GAGG;AACH,eAAO,MAAM,mCAAmC,IAAI,CAAC;AAwDrD,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,oEAAoE,CAAC;IACrF,qFAAqF;IACrF,QAAQ,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;IACzE,qDAAqD;IACrD,qBAAqB,EAAE,OAAO,CAAC;CAChC;AAMD,wBAAsB,yBAAyB,CAC7C,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,qBAAqB,CAAC,CAWhC;AAED,wBAAsB,0BAA0B,CAC9C,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,IAAI,CAAC,CAGf;
|
|
1
|
+
{"version":3,"file":"contractPipeline.d.ts","sourceRoot":"","sources":["../../../src/remediate/steps/contractPipeline.ts"],"names":[],"mappings":"AAwBA,OAAO,EAOL,KAAK,eAAe,EACpB,KAAK,WAAW,EAIhB,KAAK,aAAa,EAEnB,MAA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W,6BAA6B;IAC5C,EAAE,EAAE,OAAO,CAAC;IACZ,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,wCAAwC,CAC5D,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,6BAA6B,CAAC,CAsCxC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,+BAA+B,CACnD,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC;IAAE,KAAK,EAAE,uBAAuB,GAAG,qBAAqB,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,IAAI,CAAC,CAgDlG;AAgFD;;;GAGG;AACH,wBAAsB,qCAAqC,CACzD,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,UAAU,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,IAAI,CAAC,CAa1C;AAiBD,4EAA4E;AAC5E,QAAA,MAAM,sBAAsB;;CAElB,CAAC;AAEX,KAAK,mBAAmB,GAAG,MAAM,OAAO,sBAAsB,CAAC;AAE/D,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,mBAAmB,CAEjF;AAmOD;;;GAGG;AACH,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAmwCjC;AAkED;;;GAGG;AACH,wBAAsB,uCAAuC,CAC3D,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAoLf"}
|
|
@@ -28,12 +28,12 @@ import { readIntakeRiskSignal, writeIntakeRiskSignal, escalateRiskSignal, decomp
|
|
|
28
28
|
import { phaseOrdinalForObligations, moduleSlug, renderPhaseCutSection, } from "../contractPipeline/phaseCut.js";
|
|
29
29
|
import { ensurePhaseCutArtifact, readPhaseCutArtifact } from "../contractPipeline/phaseCutArtifact.js";
|
|
30
30
|
import { detectCyclicSeamObligations, validateCycleBreak, } from "../contractPipeline/cyclicSeamResolution.js";
|
|
31
|
-
import { deriveObligationLedger, buildTestValidatorPlanScaffold, buildImplementationDagScaffold, acceptedCounterexampleIds, advisoryCritiqueItems, } from "../contractPipeline/derive.js";
|
|
31
|
+
import { deriveObligationLedger, deriveFinalizedModuleContracts, buildTestValidatorPlanScaffold, buildImplementationDagScaffold, acceptedCounterexampleIds, advisoryCritiqueItems, } from "../contractPipeline/derive.js";
|
|
32
32
|
import { ensureNodeId, toBlockId } from "../contractPipeline/idRegistry.js";
|
|
33
33
|
import { captureReviewSnapshot, computeReReviewDelta, isReviewArtifact, readReviewSnapshot, renderReReviewSection, reviewSnapshotExists, } from "../contractPipeline/reviewSnapshot.js";
|
|
34
34
|
import { captureTestPlanCarry, readTestPlanCarry, } from "../contractPipeline/testPlanCarry.js";
|
|
35
35
|
import { renderContractPipelinePrompt, renderContractRepairPrompt, CONTRACT_PIPELINE_PHASE_ORDER, PHASE_TO_ARTIFACT, } from "./contractPipelinePrompts.js";
|
|
36
|
-
import { CONTRACT_PIPELINE_VALIDATORS, CP_MODULE_CONTRACTS_VERSION,
|
|
36
|
+
import { CONTRACT_PIPELINE_VALIDATORS, CP_MODULE_CONTRACTS_VERSION, validateDesignSpecGates, validateGoalIdConsistency, validateImplementationDAGIntegrity, validatePairedObligations, validateEvidenceThreaded, validateDigestCoverage, validateReconciliationDerivation, validateContractCitationGrounding, deriveNodeModelTierFromNode, } from "../validation/contractPipeline.js";
|
|
37
37
|
import { scheduleWave } from "./dispatch.js";
|
|
38
38
|
import { writeCurrentStep } from "./stepWriter.js";
|
|
39
39
|
import { loaderCommand } from "./prompts.js";
|
|
@@ -152,7 +152,8 @@ Self-check before next-step: \`${loaderCommand(`validate-artifact --name test_va
|
|
|
152
152
|
}
|
|
153
153
|
if (phase === "implementation_planning") {
|
|
154
154
|
const judge = envelopePayload(await readContractArtifact(artifactsDir, "judge_report"));
|
|
155
|
-
const
|
|
155
|
+
const finalized = envelopePayload(await readContractArtifact(artifactsDir, "finalized_module_contracts"));
|
|
156
|
+
const scaffold = buildImplementationDagScaffold(ledger, acceptedCounterexampleIds(judge), finalized);
|
|
156
157
|
if (scaffold.nodes.length === 0)
|
|
157
158
|
return undefined;
|
|
158
159
|
const advisory = advisoryCritiqueItems(envelopePayload(await readContractArtifact(artifactsDir, "conceptual_design_critique")));
|
|
@@ -164,7 +165,7 @@ Self-check before next-step: \`${loaderCommand(`validate-artifact --name test_va
|
|
|
164
165
|
const path = contractInputFilePath(artifactsDir, "implementation_dag");
|
|
165
166
|
return `## Pre-filled Skeleton — fill only the blank slots
|
|
166
167
|
|
|
167
|
-
Below is the implementation-DAG skeleton: ONE node per module (its obligations already grouped), covering every obligation and accepted counterexample. Fill ONLY each node's \`title\`, \`description\`, and \`targeted_commands\`. You MAY further merge or split nodes and
|
|
168
|
+
Below is the implementation-DAG skeleton: ONE node per module (its obligations already grouped), covering every obligation and accepted counterexample. Each node's \`depends_on\` is already DERIVED from the finalized contracts' data-flow (a node depends on the modules whose \`artifact:<name>\` outputs it consumes) — keep it unless you know an ordering is wrong. Fill ONLY each node's \`title\`, \`description\`, and \`targeted_commands\`. You MAY further merge or split nodes and refine \`depends_on\`/\`edges\` ordering, as long as every obligation stays covered (in \`satisfies_obligations\` or \`verification_obligation_ids\`) and every accepted counterexample stays in some node's \`addresses_counterexamples\`.${advisoryBlock}
|
|
168
169
|
|
|
169
170
|
\`\`\`json
|
|
170
171
|
${JSON.stringify(scaffold, null, 2)}
|
|
@@ -285,13 +286,12 @@ export async function ingestContractArtifacts(artifactsDir) {
|
|
|
285
286
|
}
|
|
286
287
|
await writeContractArtifact(artifactsDir, name, payload);
|
|
287
288
|
ingested.push(name);
|
|
288
|
-
// Repair-revert fix:
|
|
289
|
-
//
|
|
290
|
-
//
|
|
291
|
-
//
|
|
292
|
-
//
|
|
293
|
-
//
|
|
294
|
-
// the approved repair. No-op for every non-module-phase artifact.
|
|
289
|
+
// Repair-revert fix: an ingested aggregated `module_contracts` payload (a
|
|
290
|
+
// degenerate single-agent draft, or a direct edit) is written back through to
|
|
291
|
+
// the per-module shards so shards ≡ aggregate stays an invariant — otherwise a
|
|
292
|
+
// later upstream cascade (e.g. a module_decomposition edit) re-merges the STALE
|
|
293
|
+
// shards and silently reverts the change. No-op for every non-sharded artifact
|
|
294
|
+
// (`finalized_module_contracts` is deterministically derived, never sharded).
|
|
295
295
|
await propagateAggregateToShards(artifactsDir, name, payload);
|
|
296
296
|
// Snapshot a freshly-produced review verdict + the upstreams it reviewed, so
|
|
297
297
|
// a later staleness re-emit can be diff-based (B2). No-op for non-review
|
|
@@ -762,24 +762,26 @@ export async function evaluatePromotedPlanCitationGrounding(artifactsDir, repoRo
|
|
|
762
762
|
return null;
|
|
763
763
|
return { violations: errors.map((issue) => `[${issue.path}] ${issue.message}`) };
|
|
764
764
|
}
|
|
765
|
-
// ── DC-3: parallel per-module contract
|
|
765
|
+
// ── DC-3: parallel per-module contract drafting ───────────────────────────────
|
|
766
766
|
//
|
|
767
|
-
// `module_contract_drafting` (→ module_contracts)
|
|
768
|
-
//
|
|
769
|
-
// keyed by module name. DC-3 fans these out to ONE agent per module through the
|
|
767
|
+
// `module_contract_drafting` (→ module_contracts) aggregates a `module_contracts[]`
|
|
768
|
+
// array keyed by module name. DC-3 fans it out to ONE agent per module through the
|
|
770
769
|
// shared wave scheduler (`scheduleWave`, the SAME quota/host machinery implement
|
|
771
|
-
// dispatch uses), replacing the former single sequential agent
|
|
772
|
-
//
|
|
773
|
-
//
|
|
774
|
-
//
|
|
775
|
-
//
|
|
776
|
-
|
|
770
|
+
// dispatch uses), replacing the former single sequential agent — each agent reads
|
|
771
|
+
// its own module's file scope, so no single agent owns both sides of a seam. Each
|
|
772
|
+
// agent writes a per-module SHARD; the orchestrator merges all shards into the
|
|
773
|
+
// aggregated artifact — byte-identical in shape to the single-agent output — and
|
|
774
|
+
// guarantees the merge is COMPLETE (every decomposed module present) before
|
|
775
|
+
// downstream derivation runs. A missing shard re-emits the wave (never a partial
|
|
776
|
+
// aggregate). `contract_finalization` is NOT a parallel wave: it is derived
|
|
777
|
+
// deterministically from the drafts + seam report (see the deterministic
|
|
778
|
+
// contract_finalization fast path), no fresh source read.
|
|
779
|
+
/** The phase(s) that fan out per module, and the artifact each produces. */
|
|
777
780
|
const PARALLEL_MODULE_PHASES = {
|
|
778
781
|
module_contract_drafting: "module_contracts",
|
|
779
|
-
contract_finalization: "finalized_module_contracts",
|
|
780
782
|
};
|
|
781
783
|
export function isParallelModulePhase(phase) {
|
|
782
|
-
return phase === "module_contract_drafting"
|
|
784
|
+
return phase === "module_contract_drafting";
|
|
783
785
|
}
|
|
784
786
|
/** Read the decomposed modules (name + responsibilities + file_scope) in order. */
|
|
785
787
|
async function readDecomposedModules(artifactsDir) {
|
|
@@ -862,16 +864,14 @@ function extractShardContract(shard, moduleName) {
|
|
|
862
864
|
return null;
|
|
863
865
|
}
|
|
864
866
|
/**
|
|
865
|
-
* Merge complete per-module shards into the aggregated
|
|
866
|
-
* byte-identical in shape to the former single-agent output: the same envelope
|
|
867
|
+
* Merge complete per-module shards into the aggregated `module_contracts`
|
|
868
|
+
* artifact, byte-identical in shape to the former single-agent output: the same envelope
|
|
867
869
|
* (`contract_version`, `goal_id`, `module_contracts[]`, `created_at`) with one
|
|
868
870
|
* entry per module in DECOMPOSITION order (deterministic, not directory order).
|
|
869
871
|
* Caller guarantees completeness first.
|
|
870
872
|
*/
|
|
871
|
-
function mergeModuleShards(
|
|
872
|
-
const contractVersion =
|
|
873
|
-
? CP_MODULE_CONTRACTS_VERSION
|
|
874
|
-
: CP_FINALIZED_MODULE_CONTRACTS_VERSION;
|
|
873
|
+
function mergeModuleShards(modules, present, goalId) {
|
|
874
|
+
const contractVersion = CP_MODULE_CONTRACTS_VERSION;
|
|
875
875
|
const moduleContracts = modules.map((mod) => present.get(mod.name));
|
|
876
876
|
return {
|
|
877
877
|
contract_version: contractVersion,
|
|
@@ -882,14 +882,14 @@ function mergeModuleShards(phase, modules, present, goalId) {
|
|
|
882
882
|
}
|
|
883
883
|
/**
|
|
884
884
|
* Write-through invariant (repair-revert fix): the per-module shards under
|
|
885
|
-
* `module-waves
|
|
886
|
-
*
|
|
887
|
-
*
|
|
888
|
-
*
|
|
889
|
-
*
|
|
890
|
-
*
|
|
891
|
-
* shards
|
|
892
|
-
*
|
|
885
|
+
* `module-waves/module_contract_drafting/` are the single source of truth for the
|
|
886
|
+
* aggregated `module_contracts` artifact — the aggregate is a pure re-merge of
|
|
887
|
+
* them. When that aggregate is instead ingested directly (a degenerate
|
|
888
|
+
* single-agent draft, or a direct edit), decompose it back into its shards
|
|
889
|
+
* (matched by module `name`, in decomposition order) so a later cascade that
|
|
890
|
+
* re-merges the shards reproduces the change instead of reverting to the stale
|
|
891
|
+
* shards. No-op for any artifact that is not a sharded module-phase artifact
|
|
892
|
+
* (`finalized_module_contracts` is deterministically derived, never sharded), or a
|
|
893
893
|
* payload lacking a `module_contracts[]` array.
|
|
894
894
|
*/
|
|
895
895
|
async function propagateAggregateToShards(artifactsDir, name, payload) {
|
|
@@ -1079,10 +1079,8 @@ ${outputPaths.map((p, i) => `${i + 1}. \`${p}\` (${phases[i]})`).join("\n")}`;
|
|
|
1079
1079
|
env: process.env,
|
|
1080
1080
|
});
|
|
1081
1081
|
const maxConcurrent = schedule.max_concurrent;
|
|
1082
|
-
const inputArtifact =
|
|
1083
|
-
const inputPaths =
|
|
1084
|
-
? ["goal_spec", "context_bundle", "module_decomposition"]
|
|
1085
|
-
: ["module_contracts", "seam_reconciliation_report"]).map((key) => `- \`${artifactPaths[key]}\` (${key})`);
|
|
1082
|
+
const inputArtifact = "module_decomposition";
|
|
1083
|
+
const inputPaths = ["goal_spec", "context_bundle", "module_decomposition"].map((key) => `- \`${artifactPaths[key]}\` (${key})`);
|
|
1086
1084
|
const moduleLines = modules
|
|
1087
1085
|
.map((mod, i) => {
|
|
1088
1086
|
const shardPath = moduleShardPath(artifactsDir, phase, mod.name);
|
|
@@ -1092,8 +1090,7 @@ ${outputPaths.map((p, i) => `${i + 1}. \`${p}\` (${phases[i]})`).join("\n")}`;
|
|
|
1092
1090
|
return `${i + 1}. **${mod.name}** — file scope: ${scope}\n - Write this module's contract to exactly: \`${shardPath}\``;
|
|
1093
1091
|
})
|
|
1094
1092
|
.join("\n");
|
|
1095
|
-
const perModuleSchema =
|
|
1096
|
-
? `{
|
|
1093
|
+
const perModuleSchema = `{
|
|
1097
1094
|
"name": "<module-name — must equal the assigned module>",
|
|
1098
1095
|
"inputs": ["<what this module receives>"],
|
|
1099
1096
|
"outputs": ["<what this module produces>"],
|
|
@@ -1102,23 +1099,11 @@ ${outputPaths.map((p, i) => `${i + 1}. \`${p}\` (${phases[i]})`).join("\n")}`;
|
|
|
1102
1099
|
"validation_boundary": "<what this module validates vs. what callers must guarantee>",
|
|
1103
1100
|
"failure_modes": ["<ways this module can fail and how callers should handle them>"],
|
|
1104
1101
|
"neighbor_needs": [{ "neighbor": "<module-name>", "needs": "<what this module needs>" }]
|
|
1105
|
-
}`
|
|
1106
|
-
: `{
|
|
1107
|
-
"name": "<module-name — must equal the assigned module>",
|
|
1108
|
-
"inputs": ["<final — incorporating reconciliation decisions>"],
|
|
1109
|
-
"outputs": ["<final — incorporating reconciliation decisions>"],
|
|
1110
|
-
"invariants": ["<invariant id + description>"],
|
|
1111
|
-
"side_effects": ["<side-effect with owner>"],
|
|
1112
|
-
"validation_boundary": "<finalized validation boundary>",
|
|
1113
|
-
"failure_modes": ["<failure mode + caller handling>"],
|
|
1114
|
-
"seam_adjustments": ["<adjustments made per seam_reconciliation_report, if any>"]
|
|
1115
1102
|
}`;
|
|
1116
|
-
const taskVerb =
|
|
1117
|
-
? "draft its module contract"
|
|
1118
|
-
: "incorporate the reconciliation decisions from seam_reconciliation_report and produce its finalized module contract";
|
|
1103
|
+
const taskVerb = "draft its module contract";
|
|
1119
1104
|
const cwdNote = `\n> Set the shell/tool working directory to \`${root}\` before running any commands.\n`;
|
|
1120
1105
|
const nextCommand = loaderCommand("next-step");
|
|
1121
|
-
const prompt = `#
|
|
1106
|
+
const prompt = `# Per-Module Contract Drafting — Parallel Wave (${modules.length} modules)
|
|
1122
1107
|
|
|
1123
1108
|
This phase fans out to ONE sub-agent PER MODULE. Dispatch the ${modules.length} modules below as parallel sub-agents in waves of at most **${maxConcurrent}** concurrent agents (the quota/host concurrency cap). Each sub-agent reads only its module's file scope, then writes ONLY that module's contract shard — no agent owns both sides of a seam, and no agent writes the aggregated artifact.
|
|
1124
1109
|
${cwdNote}
|
|
@@ -1198,7 +1183,7 @@ The orchestrator verifies every module shard is present, merges them into \`${PH
|
|
|
1198
1183
|
.map((c) => (typeof c.goal_id === "string" ? c.goal_id : undefined))
|
|
1199
1184
|
.find((g) => Boolean(g)) ||
|
|
1200
1185
|
"";
|
|
1201
|
-
const merged = mergeModuleShards(
|
|
1186
|
+
const merged = mergeModuleShards(modules, scan.present, goalId);
|
|
1202
1187
|
await writeContractArtifact(artifactsDir, PARALLEL_MODULE_PHASES[phase], merged);
|
|
1203
1188
|
return "merged";
|
|
1204
1189
|
};
|
|
@@ -1356,55 +1341,45 @@ Read conceptual_design_critique.json, decide with the user how to resolve each b
|
|
|
1356
1341
|
await writeContractArtifact(artifactsDir, "obligation_ledger", ledger);
|
|
1357
1342
|
return buildNextContractPipelineStep(options);
|
|
1358
1343
|
}
|
|
1359
|
-
// 2.8. Degenerate
|
|
1360
|
-
//
|
|
1361
|
-
//
|
|
1362
|
-
//
|
|
1363
|
-
//
|
|
1364
|
-
//
|
|
1365
|
-
//
|
|
1366
|
-
|
|
1367
|
-
// validateReconciliationDerivation pass vacuously; the finalized contracts
|
|
1368
|
-
// copy the drafted ones, so validateFinalizedModuleContracts (same entry
|
|
1369
|
-
// validator as drafting) and the obligation-ledger derivation are satisfied.
|
|
1370
|
-
if (nextPhase === "seam_reconciliation" || nextPhase === "contract_finalization") {
|
|
1344
|
+
// 2.8. Degenerate seam_reconciliation collapse. A single-module decomposition
|
|
1345
|
+
// has NO inter-module seams, so seam_reconciliation is a structural no-op:
|
|
1346
|
+
// write an empty seam report deterministically (no host round-trip),
|
|
1347
|
+
// mirroring the obligation_ledger / cyclic_seam no-op fast paths. The empty
|
|
1348
|
+
// report makes validateReconciliationDerivation pass vacuously. A
|
|
1349
|
+
// multi-module decomposition falls through to the LLM seam_reconciliation
|
|
1350
|
+
// step (which mismatches exist is a judgment call).
|
|
1351
|
+
if (nextPhase === "seam_reconciliation") {
|
|
1371
1352
|
const modules = await readDecomposedModules(artifactsDir);
|
|
1372
1353
|
if (modules.length <= 1) {
|
|
1373
1354
|
const drafted = envelopePayload(await readContractArtifact(artifactsDir, "module_contracts"));
|
|
1374
1355
|
const goalId = isRecord(drafted) && typeof drafted.goal_id === "string" ? drafted.goal_id : "";
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
});
|
|
1382
|
-
}
|
|
1383
|
-
else {
|
|
1384
|
-
const draftedContracts = isRecord(drafted) && Array.isArray(drafted.module_contracts)
|
|
1385
|
-
? drafted.module_contracts
|
|
1386
|
-
: [];
|
|
1387
|
-
await writeContractArtifact(artifactsDir, "finalized_module_contracts", {
|
|
1388
|
-
contract_version: "remediate-code-contract-pipeline/finalized-module-contracts/v1alpha1",
|
|
1389
|
-
goal_id: goalId,
|
|
1390
|
-
module_contracts: draftedContracts.map((mod) => isRecord(mod)
|
|
1391
|
-
? {
|
|
1392
|
-
name: mod.name,
|
|
1393
|
-
inputs: mod.inputs,
|
|
1394
|
-
outputs: mod.outputs,
|
|
1395
|
-
invariants: mod.invariants,
|
|
1396
|
-
side_effects: mod.side_effects,
|
|
1397
|
-
validation_boundary: mod.validation_boundary,
|
|
1398
|
-
failure_modes: mod.failure_modes,
|
|
1399
|
-
seam_adjustments: [],
|
|
1400
|
-
}
|
|
1401
|
-
: mod),
|
|
1402
|
-
created_at: new Date().toISOString(),
|
|
1403
|
-
});
|
|
1404
|
-
}
|
|
1356
|
+
await writeContractArtifact(artifactsDir, "seam_reconciliation_report", {
|
|
1357
|
+
contract_version: "remediate-code-contract-pipeline/seam-reconciliation-report/v1alpha1",
|
|
1358
|
+
goal_id: goalId,
|
|
1359
|
+
mismatches: [],
|
|
1360
|
+
created_at: new Date().toISOString(),
|
|
1361
|
+
});
|
|
1405
1362
|
return buildNextContractPipelineStep(options);
|
|
1406
1363
|
}
|
|
1407
1364
|
}
|
|
1365
|
+
// 2.9. Deterministic contract_finalization (all module counts). Finalization is
|
|
1366
|
+
// a mechanical merge, not fresh authoring: carry each drafted module
|
|
1367
|
+
// contract verbatim (preserving neighbor_needs for the ordering derivation)
|
|
1368
|
+
// and attach the agreed_interface of every seam that touches the module as a
|
|
1369
|
+
// seam_adjustment. The tool derives it instead of dispatching a per-module
|
|
1370
|
+
// LLM wave — the judgment already happened at seam_reconciliation. Attaching
|
|
1371
|
+
// each agreed interface verbatim guarantees the INV-CO-12 reconciliation-
|
|
1372
|
+
// derivation gate passes. A downstream gate that still finds the merge
|
|
1373
|
+
// inadequate (e.g. a draft with empty inputs/outputs, or a seam naming a
|
|
1374
|
+
// module out of scope) re-emits contract_finalization as an LLM step via
|
|
1375
|
+
// buildPhaseStep — the only path that still needs judgment.
|
|
1376
|
+
if (nextPhase === "contract_finalization") {
|
|
1377
|
+
const drafted = envelopePayload(await readContractArtifact(artifactsDir, "module_contracts"));
|
|
1378
|
+
const seamReport = envelopePayload(await readContractArtifact(artifactsDir, "seam_reconciliation_report"));
|
|
1379
|
+
const finalized = deriveFinalizedModuleContracts(drafted, seamReport);
|
|
1380
|
+
await writeContractArtifact(artifactsDir, "finalized_module_contracts", finalized);
|
|
1381
|
+
return buildNextContractPipelineStep(options);
|
|
1382
|
+
}
|
|
1408
1383
|
// 3. Judge gate: implementation planning is reachable only through an approved
|
|
1409
1384
|
// verdict (the fixpoint) or a convergent targeted repair. A stalled /
|
|
1410
1385
|
// non-converging repair loop escalates to the user (blocked) instead of
|
|
@@ -1961,14 +1936,14 @@ ${preCriticCitationGate.errorLines.join("\n")}
|
|
|
1961
1936
|
`);
|
|
1962
1937
|
}
|
|
1963
1938
|
}
|
|
1964
|
-
// Parallel-capable
|
|
1965
|
-
//
|
|
1966
|
-
//
|
|
1967
|
-
//
|
|
1968
|
-
//
|
|
1969
|
-
//
|
|
1970
|
-
//
|
|
1971
|
-
//
|
|
1939
|
+
// Parallel-capable phase (DC-3): module_contract_drafting fans out to one agent
|
|
1940
|
+
// per module. The aggregated `module_contracts` artifact is missing here, so
|
|
1941
|
+
// first try to merge per-module shards (the worker may have just written them) —
|
|
1942
|
+
// a COMPLETE shard set merges into the aggregated artifact and the pipeline
|
|
1943
|
+
// re-derives; an incomplete set re-emits the wave; a degenerate (≤1 module)
|
|
1944
|
+
// decomposition falls through to a single aggregated step. The seam_reconciliation
|
|
1945
|
+
// / contract_finalization / critique pass downstream remains the consistency gate
|
|
1946
|
+
// over the merged contracts.
|
|
1972
1947
|
if (isParallelModulePhase(nextPhase)) {
|
|
1973
1948
|
const mergeOutcome = await tryMergeModuleShards(nextPhase);
|
|
1974
1949
|
if (mergeOutcome === "merged") {
|