audit-tools 0.52.0 → 0.52.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/dist/audit/cli/auditStep.d.ts.map +1 -1
- package/dist/audit/cli/auditStep.js +2 -2
- package/dist/audit/cli/auditStep.js.map +1 -1
- package/dist/audit/cli/charterClarificationPrompt.d.ts +16 -8
- package/dist/audit/cli/charterClarificationPrompt.d.ts.map +1 -1
- package/dist/audit/cli/charterClarificationPrompt.js +95 -42
- package/dist/audit/cli/charterClarificationPrompt.js.map +1 -1
- package/dist/audit/cli/charterComparisonPrompt.d.ts +16 -6
- package/dist/audit/cli/charterComparisonPrompt.d.ts.map +1 -1
- package/dist/audit/cli/charterComparisonPrompt.js +76 -29
- package/dist/audit/cli/charterComparisonPrompt.js.map +1 -1
- package/dist/audit/cli/charterExtractionPrompt.d.ts +5 -4
- package/dist/audit/cli/charterExtractionPrompt.d.ts.map +1 -1
- package/dist/audit/cli/charterExtractionPrompt.js +64 -42
- package/dist/audit/cli/charterExtractionPrompt.js.map +1 -1
- package/dist/audit/cli/charterFidelityPrompt.d.ts +17 -4
- package/dist/audit/cli/charterFidelityPrompt.d.ts.map +1 -1
- package/dist/audit/cli/charterFidelityPrompt.js +72 -21
- package/dist/audit/cli/charterFidelityPrompt.js.map +1 -1
- package/dist/audit/cli/dispatch/hostHandoff.d.ts +23 -1
- package/dist/audit/cli/dispatch/hostHandoff.d.ts.map +1 -1
- package/dist/audit/cli/dispatch/hostHandoff.js +204 -41
- package/dist/audit/cli/dispatch/hostHandoff.js.map +1 -1
- package/dist/audit/cli/dispatch/packetFilter.d.ts +8 -0
- package/dist/audit/cli/dispatch/packetFilter.d.ts.map +1 -1
- package/dist/audit/cli/fanoutLanes.d.ts.map +1 -1
- package/dist/audit/cli/fanoutLanes.js +20 -4
- package/dist/audit/cli/fanoutLanes.js.map +1 -1
- package/dist/audit/cli/laneValidators.d.ts +19 -7
- package/dist/audit/cli/laneValidators.d.ts.map +1 -1
- package/dist/audit/cli/laneValidators.js +73 -18
- package/dist/audit/cli/laneValidators.js.map +1 -1
- package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
- package/dist/audit/cli/nextStepCommand.js +13 -6
- package/dist/audit/cli/nextStepCommand.js.map +1 -1
- package/dist/audit/cli/nextStepHelpers.d.ts +25 -2
- package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
- package/dist/audit/cli/nextStepHelpers.js +105 -35
- package/dist/audit/cli/nextStepHelpers.js.map +1 -1
- package/dist/audit/cli/recoverSubmissionCommand.d.ts.map +1 -1
- package/dist/audit/cli/recoverSubmissionCommand.js +89 -4
- package/dist/audit/cli/recoverSubmissionCommand.js.map +1 -1
- package/dist/audit/cli/sampleRunCommand.d.ts +10 -0
- package/dist/audit/cli/sampleRunCommand.d.ts.map +1 -1
- package/dist/audit/cli/semanticReviewStep.d.ts +4 -4
- package/dist/audit/cli/semanticReviewStep.d.ts.map +1 -1
- package/dist/audit/cli/semanticReviewStep.js +35 -71
- package/dist/audit/cli/semanticReviewStep.js.map +1 -1
- package/dist/audit/contracts/findingContractPrompt.d.ts.map +1 -1
- package/dist/audit/contracts/findingContractPrompt.js +7 -1
- package/dist/audit/contracts/findingContractPrompt.js.map +1 -1
- package/dist/audit/contracts/workerSchemas.d.ts +280 -4
- package/dist/audit/contracts/workerSchemas.d.ts.map +1 -1
- package/dist/audit/contracts/workerSchemas.js +24 -2
- package/dist/audit/contracts/workerSchemas.js.map +1 -1
- package/dist/audit/orchestrator/charterClarificationExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/charterClarificationExecutor.js +39 -0
- package/dist/audit/orchestrator/charterClarificationExecutor.js.map +1 -1
- package/dist/audit/orchestrator/charterExtractionExecutor.d.ts +12 -5
- package/dist/audit/orchestrator/charterExtractionExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/charterExtractionExecutor.js +39 -9
- package/dist/audit/orchestrator/charterExtractionExecutor.js.map +1 -1
- package/dist/audit/orchestrator/designReviewPrompt.d.ts +7 -0
- package/dist/audit/orchestrator/designReviewPrompt.d.ts.map +1 -1
- package/dist/audit/orchestrator/designReviewPrompt.js +174 -19
- package/dist/audit/orchestrator/designReviewPrompt.js.map +1 -1
- package/dist/audit/orchestrator/intentCheckpointGate.d.ts.map +1 -1
- package/dist/audit/orchestrator/intentCheckpointGate.js +1 -5
- package/dist/audit/orchestrator/intentCheckpointGate.js.map +1 -1
- package/dist/audit/orchestrator/requeueCommand.d.ts +8 -0
- package/dist/audit/orchestrator/requeueCommand.d.ts.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/lensVerification.d.ts.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/lensVerification.js +94 -71
- package/dist/audit/orchestrator/selectiveDeepening/lensVerification.js.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/shared.d.ts +0 -2
- package/dist/audit/orchestrator/selectiveDeepening/shared.d.ts.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/shared.js +9 -2
- package/dist/audit/orchestrator/selectiveDeepening/shared.js.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/stewardFollowup.d.ts.map +1 -1
- package/dist/audit/orchestrator/selectiveDeepening/stewardFollowup.js +28 -4
- package/dist/audit/orchestrator/selectiveDeepening/stewardFollowup.js.map +1 -1
- package/dist/audit/reporting/synthesis.d.ts +16 -3
- package/dist/audit/reporting/synthesis.d.ts.map +1 -1
- package/dist/audit/reporting/synthesis.js +40 -11
- package/dist/audit/reporting/synthesis.js.map +1 -1
- package/dist/audit/reporting/synthesisNarrativePrompt.d.ts +26 -1
- package/dist/audit/reporting/synthesisNarrativePrompt.d.ts.map +1 -1
- package/dist/audit/reporting/synthesisNarrativePrompt.js +53 -13
- package/dist/audit/reporting/synthesisNarrativePrompt.js.map +1 -1
- package/dist/audit/systemic/secondOrderAdversaryPrompt.d.ts.map +1 -1
- package/dist/audit/systemic/secondOrderAdversaryPrompt.js +67 -40
- package/dist/audit/systemic/secondOrderAdversaryPrompt.js.map +1 -1
- package/dist/audit/systemic/systemicChallengeLoop.d.ts.map +1 -1
- package/dist/audit/systemic/systemicChallengeLoop.js +13 -1
- package/dist/audit/systemic/systemicChallengeLoop.js.map +1 -1
- package/dist/audit/types/conceptualAdjudication.d.ts +26 -2
- package/dist/audit/types/conceptualAdjudication.d.ts.map +1 -1
- package/dist/audit/types/conceptualAdjudication.js +26 -7
- package/dist/audit/types/conceptualAdjudication.js.map +1 -1
- package/dist/audit/types.d.ts +279 -0
- package/dist/audit/types.d.ts.map +1 -1
- package/dist/audit/types.js +52 -0
- package/dist/audit/types.js.map +1 -1
- package/dist/audit/validation/auditResults.d.ts.map +1 -1
- package/dist/audit/validation/auditResults.js +51 -6
- package/dist/audit/validation/auditResults.js.map +1 -1
- package/dist/audit/validation/ingestIssueCodes.d.ts +3 -1
- package/dist/audit/validation/ingestIssueCodes.d.ts.map +1 -1
- package/dist/audit/validation/ingestIssueCodes.js +27 -15
- package/dist/audit/validation/ingestIssueCodes.js.map +1 -1
- package/dist/remediate/contractPipeline/sketchSource.d.ts +13 -3
- package/dist/remediate/contractPipeline/sketchSource.d.ts.map +1 -1
- package/dist/remediate/contractPipeline/sketchSource.js +14 -8
- package/dist/remediate/contractPipeline/sketchSource.js.map +1 -1
- package/dist/remediate/intake.d.ts +140 -36
- package/dist/remediate/intake.d.ts.map +1 -1
- package/dist/remediate/intake.js +159 -38
- package/dist/remediate/intake.js.map +1 -1
- package/dist/remediate/intent/checkpointFilter.d.ts +1 -2
- package/dist/remediate/intent/checkpointFilter.d.ts.map +1 -1
- package/dist/remediate/intent/checkpointFilter.js +1 -5
- package/dist/remediate/intent/checkpointFilter.js.map +1 -1
- package/dist/remediate/phases/close.d.ts.map +1 -1
- package/dist/remediate/phases/close.js +2 -2
- package/dist/remediate/phases/close.js.map +1 -1
- package/dist/remediate/phases/plan.d.ts +1 -1
- package/dist/remediate/review/reviewGate.d.ts +68 -39
- package/dist/remediate/review/reviewGate.d.ts.map +1 -1
- package/dist/remediate/review/reviewGate.js +133 -50
- package/dist/remediate/review/reviewGate.js.map +1 -1
- package/dist/remediate/state/store.d.ts +1 -2
- package/dist/remediate/state/store.d.ts.map +1 -1
- package/dist/remediate/state/store.js +124 -3
- package/dist/remediate/state/store.js.map +1 -1
- package/dist/remediate/state/types.d.ts +28 -4
- package/dist/remediate/state/types.d.ts.map +1 -1
- package/dist/remediate/state/types.js.map +1 -1
- package/dist/remediate/steps/contractPipeline.d.ts +17 -1
- package/dist/remediate/steps/contractPipeline.d.ts.map +1 -1
- package/dist/remediate/steps/contractPipeline.js +100 -52
- package/dist/remediate/steps/contractPipeline.js.map +1 -1
- package/dist/remediate/steps/contractPipelinePrompts.d.ts +32 -8
- package/dist/remediate/steps/contractPipelinePrompts.d.ts.map +1 -1
- package/dist/remediate/steps/contractPipelinePrompts.js +145 -131
- package/dist/remediate/steps/contractPipelinePrompts.js.map +1 -1
- package/dist/remediate/steps/dispatch/hostHandoff.d.ts +6 -4
- package/dist/remediate/steps/dispatch/hostHandoff.d.ts.map +1 -1
- package/dist/remediate/steps/dispatch/hostHandoff.js +291 -155
- package/dist/remediate/steps/dispatch/hostHandoff.js.map +1 -1
- package/dist/remediate/steps/intakeResolver.d.ts +1 -1
- package/dist/remediate/steps/intakeResolver.d.ts.map +1 -1
- package/dist/remediate/steps/intakeResolver.js +50 -49
- package/dist/remediate/steps/intakeResolver.js.map +1 -1
- package/dist/remediate/steps/nextStep.d.ts.map +1 -1
- package/dist/remediate/steps/nextStep.js +315 -288
- package/dist/remediate/steps/nextStep.js.map +1 -1
- package/dist/remediate/steps/prompts.d.ts +10 -3
- package/dist/remediate/steps/prompts.d.ts.map +1 -1
- package/dist/remediate/steps/prompts.js +191 -228
- package/dist/remediate/steps/prompts.js.map +1 -1
- package/dist/remediate/steps/types.d.ts +2 -2
- package/dist/remediate/steps/types.d.ts.map +1 -1
- package/dist/remediate/steps/types.js +10 -3
- package/dist/remediate/steps/types.js.map +1 -1
- package/dist/remediate/validation/artifacts.d.ts.map +1 -1
- package/dist/remediate/validation/artifacts.js +5 -22
- package/dist/remediate/validation/artifacts.js.map +1 -1
- package/dist/remediate/validation/contractPipeline.d.ts.map +1 -1
- package/dist/remediate/validation/contractPipeline.js +25 -8
- package/dist/remediate/validation/contractPipeline.js.map +1 -1
- package/dist/remediate/validation/remediationState.d.ts +0 -1
- package/dist/remediate/validation/remediationState.d.ts.map +1 -1
- package/dist/remediate/validation/remediationState.js +1 -20
- package/dist/remediate/validation/remediationState.js.map +1 -1
- package/dist/shared/decompose/charterClarification.d.ts +7 -0
- package/dist/shared/decompose/charterClarification.d.ts.map +1 -1
- package/dist/shared/decompose/charterClarification.js +8 -1
- package/dist/shared/decompose/charterClarification.js.map +1 -1
- package/dist/shared/decompose/charterExtraction.d.ts +204 -16
- package/dist/shared/decompose/charterExtraction.d.ts.map +1 -1
- package/dist/shared/decompose/charterExtraction.js +70 -13
- package/dist/shared/decompose/charterExtraction.js.map +1 -1
- package/dist/shared/decompose/systemicChallenge.d.ts +42 -1
- package/dist/shared/decompose/systemicChallenge.d.ts.map +1 -1
- package/dist/shared/decompose/systemicChallenge.js +51 -0
- package/dist/shared/decompose/systemicChallenge.js.map +1 -1
- package/dist/shared/index.d.ts +14 -11
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +16 -9
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/io/stepContractWriter.d.ts.map +1 -1
- package/dist/shared/io/stepContractWriter.js +13 -4
- package/dist/shared/io/stepContractWriter.js.map +1 -1
- package/dist/shared/submission/hostHandoffCore.d.ts +7 -0
- package/dist/shared/submission/hostHandoffCore.d.ts.map +1 -1
- package/dist/shared/submission/hostHandoffCore.js +15 -2
- package/dist/shared/submission/hostHandoffCore.js.map +1 -1
- package/dist/shared/submission/hostResultOutcomes.d.ts +60 -10
- package/dist/shared/submission/hostResultOutcomes.d.ts.map +1 -1
- package/dist/shared/submission/hostResultOutcomes.js +42 -10
- package/dist/shared/submission/hostResultOutcomes.js.map +1 -1
- package/dist/shared/submission/ingestReport.d.ts +54 -0
- package/dist/shared/submission/ingestReport.d.ts.map +1 -0
- package/dist/shared/submission/ingestReport.js +44 -0
- package/dist/shared/submission/ingestReport.js.map +1 -0
- package/dist/shared/submission/ingestionChecks.d.ts +8 -13
- package/dist/shared/submission/ingestionChecks.d.ts.map +1 -1
- package/dist/shared/submission/ingestionChecks.js +9 -14
- package/dist/shared/submission/ingestionChecks.js.map +1 -1
- package/dist/shared/submission/submissionClassifier.d.ts +6 -0
- package/dist/shared/submission/submissionClassifier.d.ts.map +1 -1
- package/dist/shared/submission/submissionClassifier.js +16 -0
- package/dist/shared/submission/submissionClassifier.js.map +1 -1
- package/dist/shared/submission/workerPromptBinding.d.ts +18 -0
- package/dist/shared/submission/workerPromptBinding.d.ts.map +1 -0
- package/dist/shared/submission/workerPromptBinding.js +38 -0
- package/dist/shared/submission/workerPromptBinding.js.map +1 -0
- package/dist/shared/tooling/exec.d.ts +24 -0
- package/dist/shared/tooling/exec.d.ts.map +1 -1
- package/dist/shared/tooling/exec.js +30 -0
- package/dist/shared/tooling/exec.js.map +1 -1
- package/dist/shared/types/charter.d.ts +143 -7
- package/dist/shared/types/charter.d.ts.map +1 -1
- package/dist/shared/types/charter.js +63 -7
- package/dist/shared/types/charter.js.map +1 -1
- package/dist/shared/types/charterPacket.d.ts +13 -0
- package/dist/shared/types/charterPacket.d.ts.map +1 -1
- package/dist/shared/types/charterPacket.js.map +1 -1
- package/dist/shared/types/contractPipeline/obligations.d.ts +30 -11
- package/dist/shared/types/contractPipeline/obligations.d.ts.map +1 -1
- package/dist/shared/types/contractPipeline/obligations.js +6 -1
- package/dist/shared/types/contractPipeline/obligations.js.map +1 -1
- package/dist/shared/types/contractPropertyShapes.d.ts.map +1 -1
- package/dist/shared/types/contractPropertyShapes.js +13 -0
- package/dist/shared/types/contractPropertyShapes.js.map +1 -1
- package/dist/shared/types/finding.d.ts +154 -15
- package/dist/shared/types/finding.d.ts.map +1 -1
- package/dist/shared/types/finding.js +41 -5
- package/dist/shared/types/finding.js.map +1 -1
- package/dist/shared/types/intentCheckpoint.d.ts +26 -40
- package/dist/shared/types/intentCheckpoint.d.ts.map +1 -1
- package/dist/shared/types/intentCheckpoint.js +30 -33
- package/dist/shared/types/intentCheckpoint.js.map +1 -1
- package/dist/shared/types/remediationOutcome.d.ts +8 -8
- package/dist/shared/validation/citationGrounding.d.ts +29 -5
- package/dist/shared/validation/citationGrounding.d.ts.map +1 -1
- package/dist/shared/validation/citationGrounding.js +56 -9
- package/dist/shared/validation/citationGrounding.js.map +1 -1
- package/dist/shared/validation/designFindingGrounding.d.ts +30 -9
- package/dist/shared/validation/designFindingGrounding.d.ts.map +1 -1
- package/dist/shared/validation/designFindingGrounding.js +32 -12
- package/dist/shared/validation/designFindingGrounding.js.map +1 -1
- package/docs/audit-pkg/contracts.md +4 -5
- package/package.json +1 -1
- package/schemas/audit_result.schema.json +51 -0
- package/schemas/audit_results.schema.json +51 -0
- package/schemas/audit_task.schema.json +44 -0
- package/schemas/finding.schema.json +4 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// sites-pinned: tests/remediate/contract-pipeline-prompts.test.ts, tests/remediate/step-prompt-sketch-drift.test.ts, tests/remediate/contract-validation-gates.test.ts
|
|
1
2
|
/**
|
|
2
3
|
* Bounded prompt renderers for each of the contract-pipeline roles.
|
|
3
4
|
* Each renderer accepts only the required artifact paths for its role and
|
|
@@ -5,9 +6,18 @@
|
|
|
5
6
|
* schema-grounded rather than embedding raw artifact content.
|
|
6
7
|
*/
|
|
7
8
|
import { DEPENDENCY_MAP } from "../contractPipeline/artifactStore.js";
|
|
8
|
-
import {
|
|
9
|
+
import { GOAL_ID_MAX_LENGTH } from "../contractPipeline/idRegistry.js";
|
|
10
|
+
import { ASSESSMENT_FINDING_STATUSES, ASSESSMENT_VERDICTS, CONTRACT_REPAIR_TARGETS_OFFERED, CONTEXT_ENTRY_KINDS, COUNTEREXAMPLE_CLASSIFICATIONS, CRITIQUE_ITEM_KINDS, CRITIQUE_ITEM_SEVERITIES, CRITIQUE_VERDICTS, GOAL_SOURCE_TYPES, IMPLEMENTATION_EDGE_KINDS, IMPLEMENTATION_NODE_STATUSES, JUDGE_VERDICTS, OBLIGATION_KINDS, OBLIGATION_STATUSES, SEAM_RESOLUTION_DECISIONS, TEST_SPEC_KINDS, sketchValues, } from "../contractPipeline/sketchSource.js";
|
|
9
11
|
import { renderIndependentReviewMandate } from "audit-tools/shared";
|
|
10
12
|
import { loaderCommand } from "./prompts.js";
|
|
13
|
+
/**
|
|
14
|
+
* The ONE statement of the `targeted_commands` rule. The tool executes each
|
|
15
|
+
* entry verbatim through a shell, one invocation per entry; the rule is
|
|
16
|
+
* single-sourced in `audit-tools/shared` (`commandLeavesDeclaredShape`), and
|
|
17
|
+
* this text states it where the field is written. A worker that emitted
|
|
18
|
+
* `npm run build && npm run check` on 23 nodes cost a whole DAG regeneration.
|
|
19
|
+
*/
|
|
20
|
+
const TARGETED_COMMANDS_RULE = "`targeted_commands`: one command per entry, run verbatim through a shell. Write `\"npm run build\"` and `\"npm run check\"` as two entries, never `\"npm run build && npm run check\"`. Do not use a pipe, a redirect, `;` or command substitution: the tool refuses those, and the whole DAG is written again.";
|
|
11
21
|
export const ROLES = {
|
|
12
22
|
goal_normalization: {
|
|
13
23
|
title: "Goal Normalization",
|
|
@@ -20,7 +30,11 @@ export const ROLES = {
|
|
|
20
30
|
"success_criteria": ["<measurable criteria>"],
|
|
21
31
|
"source_type": "${sketchValues(GOAL_SOURCE_TYPES)}"
|
|
22
32
|
}`,
|
|
23
|
-
description: "
|
|
33
|
+
description: "State the remediation objective as one bounded goal.",
|
|
34
|
+
fieldRules: [
|
|
35
|
+
`\`goal_id\` is kebab-case: a lowercase letter first, then lowercase letters, digits and single \`-\` separators, at most ${GOAL_ID_MAX_LENGTH} characters.`,
|
|
36
|
+
],
|
|
37
|
+
pathASeed: "Frame the goal around these findings.",
|
|
24
38
|
},
|
|
25
39
|
context_collection: {
|
|
26
40
|
title: "Context Collection",
|
|
@@ -31,7 +45,10 @@ export const ROLES = {
|
|
|
31
45
|
"entries": [{ "path": "<repo-relative>", "kind": "${sketchValues(CONTEXT_ENTRY_KINDS)}", "relevance_reason": "..." }],
|
|
32
46
|
"context_summary": "<free-text summary>"
|
|
33
47
|
}`,
|
|
34
|
-
description: "Collect the code and
|
|
48
|
+
description: "Collect the code and documents that the goal touches. Give one reason for each entry.",
|
|
49
|
+
fieldRules: ["Every `path` is relative to the repository root."],
|
|
50
|
+
repoReads: "that are relevant to the goal",
|
|
51
|
+
pathASeed: "Include every file these findings name.",
|
|
35
52
|
},
|
|
36
53
|
decomposition: {
|
|
37
54
|
title: "Module Decomposition",
|
|
@@ -47,7 +64,14 @@ export const ROLES = {
|
|
|
47
64
|
"prepares_seam_ids": ["<required audit seam ids prepared by this module before parallel refactors; [] when none>"]
|
|
48
65
|
}]
|
|
49
66
|
}`,
|
|
50
|
-
description: "
|
|
67
|
+
description: "Split the goal into named modules. Give each module its responsibility and the files it owns. On Path A, map modules to work blocks with `source_work_block_ids`, and add one seam-preparation module for each seam in the seed where `requires_preparation` is true (one module may prepare several seams). Do not draft contracts.",
|
|
68
|
+
fieldRules: [
|
|
69
|
+
"Scope each module at the file that holds its logic, never at a file that only re-exports (`export * from …`, `export { x } from …`).",
|
|
70
|
+
"Every `file_scope` path exists in the repository.",
|
|
71
|
+
"A seam-preparation module lists the seams in `prepares_seam_ids`, and its `file_scope` includes each prepared seam's `file`.",
|
|
72
|
+
],
|
|
73
|
+
repoReads: "to confirm where each module's logic lives",
|
|
74
|
+
pathASeed: "Map every work block in the seed to a module.",
|
|
51
75
|
},
|
|
52
76
|
module_contract_drafting: {
|
|
53
77
|
title: "Per-Module Contract Drafting",
|
|
@@ -69,7 +93,14 @@ export const ROLES = {
|
|
|
69
93
|
}]
|
|
70
94
|
}]
|
|
71
95
|
}`,
|
|
72
|
-
description: "
|
|
96
|
+
description: "Draft a contract for each module in the decomposition: inputs, outputs, invariants, side effects, validation boundary, failure modes, and what it needs from each neighbor.",
|
|
97
|
+
fieldRules: [
|
|
98
|
+
"Each `name` equals a module name in the decomposition.",
|
|
99
|
+
"`inputs` and `outputs` are not empty.",
|
|
100
|
+
"On Path A, each finding id in the seed appears in an invariant, a failure mode, an input or an output.",
|
|
101
|
+
],
|
|
102
|
+
repoReads: "in each module's file scope",
|
|
103
|
+
pathASeed: "Cover every finding id in the seed.",
|
|
73
104
|
},
|
|
74
105
|
seam_reconciliation: {
|
|
75
106
|
title: "Seam Reconciliation",
|
|
@@ -88,7 +119,10 @@ export const ROLES = {
|
|
|
88
119
|
}
|
|
89
120
|
}]
|
|
90
121
|
}`,
|
|
91
|
-
description: "
|
|
122
|
+
description: "For each seam where one module's output differs from its neighbor's input or need, record the mismatch, which side adjusts, and the agreed interface. An empty `mismatches` list is correct when every seam agrees.",
|
|
123
|
+
fieldRules: [
|
|
124
|
+
"`module_a` and `module_b` are exact module names from the module contracts.",
|
|
125
|
+
],
|
|
92
126
|
},
|
|
93
127
|
contract_finalization: {
|
|
94
128
|
title: "Per-Module Contract Finalization",
|
|
@@ -107,30 +141,17 @@ export const ROLES = {
|
|
|
107
141
|
"seam_adjustments": ["<adjustments made per seam_reconciliation_report, if any>"]
|
|
108
142
|
}]
|
|
109
143
|
}`,
|
|
110
|
-
description: "
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
"contract_version": "remediate-code-contract-pipeline/cyclic-seam-resolution/v1alpha1",
|
|
117
|
-
"goal_id": "<from obligation_ledger>",
|
|
118
|
-
"cycles": [{
|
|
119
|
-
"members": ["<obligation-id>", "..."],
|
|
120
|
-
"break_strategy": "${sketchValues(CYCLIC_SEAM_BREAK_STRATEGIES)}",
|
|
121
|
-
"designated_obligation_id": "<the mediating obligation, or the single authority — must exist in the rewritten ledger>",
|
|
122
|
-
"resolution_description": "<what was changed and why>",
|
|
123
|
-
"exception_registration": "<scoped exception name when single_authority, otherwise null>"
|
|
124
|
-
}],
|
|
125
|
-
"status": "${sketchValues(CYCLIC_SEAM_RESOLUTION_STATUSES)}"
|
|
126
|
-
}`,
|
|
127
|
-
description: "Detect and resolve circular interface-definition obligations in the obligation ledger. If no cycles exist, record status=no_cycles and an empty cycles array. For each detected cycle, choose a sanctioned break strategy (mediator module or single authority) and record the resolution. Verify mentally that the break does not re-introduce a cycle before writing the output.",
|
|
144
|
+
description: "Apply each reconciliation decision and write the final contract for each module. Record the seam adjustments you applied. When one module produces something another consumes, tag it as `artifact:<name>` (for example `artifact:validated-roster`) in the producer's `outputs` and in the consumer's `inputs`: the tool orders the implementation from these tokens.",
|
|
145
|
+
fieldRules: [
|
|
146
|
+
"Keep the module set exactly: one contract for each module in `module_contracts`, and no other.",
|
|
147
|
+
"`inputs` and `outputs` are not empty.",
|
|
148
|
+
"Do not add `depends_on`.",
|
|
149
|
+
],
|
|
128
150
|
},
|
|
129
|
-
//
|
|
130
|
-
// (
|
|
131
|
-
//
|
|
132
|
-
//
|
|
133
|
-
// `obligation_ledger`) and as the canonical shape documentation.
|
|
151
|
+
// Repair only: the tool derives the obligation ledger itself
|
|
152
|
+
// (`contractPipeline/derive.ts`), so this role reaches a worker only as the
|
|
153
|
+
// target of a judge repair. The text states that derivation, because a
|
|
154
|
+
// repaired ledger passes the same gates as a derived one.
|
|
134
155
|
obligation_ledger: {
|
|
135
156
|
title: "Obligation Ledger",
|
|
136
157
|
outputKey: "obligation_ledger",
|
|
@@ -138,14 +159,23 @@ export const ROLES = {
|
|
|
138
159
|
"contract_version": "remediate-code-contract-pipeline/obligation-ledger/v1alpha1",
|
|
139
160
|
"goal_id": "<from goal_spec>",
|
|
140
161
|
"obligations": [{
|
|
141
|
-
"id": "
|
|
162
|
+
"id": "OBL-<module-slug>-<suffix>",
|
|
142
163
|
"description": "<concrete obligation>",
|
|
143
164
|
"kind": "${sketchValues(OBLIGATION_KINDS)}",
|
|
144
165
|
"depends_on": [],
|
|
145
|
-
"status": "${sketchValues(OBLIGATION_STATUSES)}"
|
|
166
|
+
"status": "${sketchValues(OBLIGATION_STATUSES)}",
|
|
167
|
+
"module": "<module-name>",
|
|
168
|
+
"change_classification": "<keep the value from the current ledger>",
|
|
169
|
+
"source_finding_ids": ["<audit finding id this obligation implements, when any>"]
|
|
146
170
|
}]
|
|
147
171
|
}`,
|
|
148
|
-
description: "
|
|
172
|
+
description: "Rewrite the obligation ledger from the finalized module contracts.",
|
|
173
|
+
fieldRules: [
|
|
174
|
+
"One `structural` obligation for each module, one `invariant` obligation for each module invariant, and one `behavioral` obligation for each module failure mode.",
|
|
175
|
+
"Each id is `OBL-<module-slug>-<suffix>`. The suffix is `contract` for the structural obligation, `inv-<n>` for the n-th invariant and `fail-<n>` for the n-th failure mode. `<module-slug>` is the module name in lowercase, with each run of other characters replaced by one `-`.",
|
|
176
|
+
"`module` is the module name. Keep each obligation's `change_classification` from the current ledger.",
|
|
177
|
+
"Keep every audit finding id that the current ledger names, in `source_finding_ids` or in the description.",
|
|
178
|
+
],
|
|
149
179
|
},
|
|
150
180
|
critique: {
|
|
151
181
|
title: "Conceptual Design Critique",
|
|
@@ -156,7 +186,10 @@ export const ROLES = {
|
|
|
156
186
|
"items": [{ "id": "<id>", "kind": "${sketchValues(CRITIQUE_ITEM_KINDS)}", "description": "...", "severity": "${sketchValues(CRITIQUE_ITEM_SEVERITIES)}" }],
|
|
157
187
|
"verdict": "${sketchValues(CRITIQUE_VERDICTS)}"
|
|
158
188
|
}`,
|
|
159
|
-
description: "
|
|
189
|
+
description: "Critique the finalized module contracts: philosophy, alternatives, direction.",
|
|
190
|
+
fieldRules: [
|
|
191
|
+
"Mark an item `blocking` only when the finalized contracts must change and can express the change. Mark every other item `advisory`.",
|
|
192
|
+
],
|
|
160
193
|
isIndependentCritic: true,
|
|
161
194
|
},
|
|
162
195
|
test_validator_plan: {
|
|
@@ -176,7 +209,11 @@ export const ROLES = {
|
|
|
176
209
|
}
|
|
177
210
|
}]
|
|
178
211
|
}`,
|
|
179
|
-
description: "
|
|
212
|
+
description: "Write one test spec for each invariant and behavioral obligation, before any implementation. To dispute an obligation, write an `inapplicable_claim` with a reason that the ledger can disprove. Do not invent obligations.",
|
|
213
|
+
fieldRules: [
|
|
214
|
+
"A spec for a behavior change has at least one positive (success-path) assertion and one negative (failure-path) assertion. The negative assertion names the changed symbol or file, not the whole repository. An obligation classified as an addition needs one assertion of either kind.",
|
|
215
|
+
"A disputed spec has only `obligation_id`, `name` and `inapplicable_claim`, and the claim's `obligation_id` equals the spec's.",
|
|
216
|
+
],
|
|
180
217
|
},
|
|
181
218
|
assessment: {
|
|
182
219
|
title: "Contract Assessment",
|
|
@@ -187,7 +224,8 @@ export const ROLES = {
|
|
|
187
224
|
"findings": [{ "obligation_id": "<id>", "status": "${sketchValues(ASSESSMENT_FINDING_STATUSES)}", "evidence": ["..."], "rationale": "..." }],
|
|
188
225
|
"verdict": "${sketchValues(ASSESSMENT_VERDICTS)}"
|
|
189
226
|
}`,
|
|
190
|
-
description: "
|
|
227
|
+
description: "For each obligation, state whether the design satisfies it, with evidence.",
|
|
228
|
+
fieldRules: ["A `violated` finding lists at least one evidence entry."],
|
|
191
229
|
},
|
|
192
230
|
critic: {
|
|
193
231
|
title: "Adversarial Critic (Counterexample Search)",
|
|
@@ -224,7 +262,11 @@ export const ROLES = {
|
|
|
224
262
|
"instruction": "<bounded instruction for regenerating the target artifact>"
|
|
225
263
|
}
|
|
226
264
|
}`,
|
|
227
|
-
description: "Judge every counterexample from the critic: `accepted` (real flaw the contract must address), `out_of_scope` (outside the goal spec), `duplicate`, `invalid` (does not
|
|
265
|
+
description: "Judge every counterexample from the critic: `accepted` (a real flaw the contract must address), `out_of_scope` (outside the goal spec), `duplicate`, `invalid` (does not falsify the claim), or `residual_risk` (real but tolerable; recorded, not repaired). The verdict is `approved` only when no accepted counterexample needs a contract repair; then omit `repair_directive`. Otherwise the verdict is `needs_repair`, and `repair_directive` names the one artifact whose rewrite addresses the accepted counterexamples.",
|
|
266
|
+
fieldRules: [
|
|
267
|
+
`\`repair_directive.target\` is one of ${CONTRACT_REPAIR_TARGETS_OFFERED.map((t) => `\`${t}\``).join(", ")}.`,
|
|
268
|
+
"A repair must be expressible in the target's own schema. For `finalized_module_contracts`, that is the seven interface fields, prose `seam_adjustments`, and implementation order only as `artifact:<name>` tokens in `inputs` and `outputs`, with the module set kept. A counterexample whose remedy needs anything else (a new schema field, a new module, structured per-block data) is `residual_risk`, not `accepted`.",
|
|
269
|
+
],
|
|
228
270
|
isIndependentCritic: true,
|
|
229
271
|
},
|
|
230
272
|
implementation_planning: {
|
|
@@ -248,22 +290,13 @@ export const ROLES = {
|
|
|
248
290
|
}],
|
|
249
291
|
"edges": [{ "from": "<id>", "to": "<id>", "kind": "${sketchValues(IMPLEMENTATION_EDGE_KINDS)}" }]
|
|
250
292
|
}`,
|
|
251
|
-
description: "
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
"goal_id": "<from goal_spec>",
|
|
259
|
-
"findings": [{
|
|
260
|
-
"finding_id": "<id>",
|
|
261
|
-
"traces": [{ "trace_id": "<id>", "kind": "${sketchValues(VERIFICATION_TRACE_KINDS)}", "label": "...", "evidence": ["..."], "status": "${sketchValues(VERIFICATION_TRACE_STATUSES)}" }],
|
|
262
|
-
"overall_status": "${sketchValues(VERIFICATION_FINDING_STATUSES)}"
|
|
263
|
-
}],
|
|
264
|
-
"overall_status": "${sketchValues(VERIFICATION_REPORT_STATUSES)}"
|
|
265
|
-
}`,
|
|
266
|
-
description: "Verify all obligations are satisfied and produce the verification report.",
|
|
293
|
+
description: "Split the implementation into a dependency DAG of bounded tasks.",
|
|
294
|
+
fieldRules: [
|
|
295
|
+
"Every node lists at least one obligation id (in `satisfies_obligations` or `verification_obligation_ids`) or one accepted counterexample id (in `addresses_counterexamples`).",
|
|
296
|
+
"Every accepted counterexample that is not waived is in some node's `addresses_counterexamples`.",
|
|
297
|
+
"`output_files` lists every file the node creates or edits: the tests it writes, the sources a generated artifact mirrors, new shared modules and manifests. Each file is in a directory that exists.",
|
|
298
|
+
TARGETED_COMMANDS_RULE,
|
|
299
|
+
],
|
|
267
300
|
},
|
|
268
301
|
};
|
|
269
302
|
/**
|
|
@@ -313,39 +346,29 @@ function renderIndependentCriticDirective(role, adversarialDepth) {
|
|
|
313
346
|
return renderIndependentReviewMandate(adversarialDepth === "light" ? "light" : "full");
|
|
314
347
|
}
|
|
315
348
|
/**
|
|
316
|
-
*
|
|
317
|
-
*
|
|
318
|
-
*
|
|
319
|
-
* Why these live in the prompt at all, given the tool also enforces them: the
|
|
320
|
-
* tool's enforcement is the guarantee, but it can only REFUSE — repair costs a
|
|
321
|
-
* bounded re-emit, and a re-emit that does not state the rule re-earns the same
|
|
322
|
-
* refusal. Stating the rule where the field is authored is what makes the first
|
|
323
|
-
* attempt admissible; the tool still refuses an inadmissible one regardless of
|
|
324
|
-
* whether the producer read this. The rule is single-sourced in
|
|
325
|
-
* `audit-tools/shared` (`commandLeavesDeclaredShape`), so this text and the
|
|
326
|
-
* refusal cannot drift on what the rule IS.
|
|
327
|
-
*
|
|
328
|
-
* `implementation_planning` is the one role with such a constraint today: its
|
|
329
|
-
* `targeted_commands` are executed verbatim through a shell, one invocation per
|
|
330
|
-
* entry. A worker that emitted `npm run build && npm run check` on 23 nodes
|
|
331
|
-
* burned a whole DAG regeneration on a defect the tool can also repair
|
|
332
|
-
* mechanically — but the repair still costs a round-trip, and the one-invocation
|
|
333
|
-
* rule was nowhere in the prompt that asked for the field.
|
|
349
|
+
* The `## Field Rules` section, or nothing when a role has no enforced rule.
|
|
350
|
+
* The worker prompt and the repair prompt both render it, from the same role.
|
|
334
351
|
*/
|
|
335
|
-
function
|
|
336
|
-
if (
|
|
352
|
+
function renderFieldRules(rules) {
|
|
353
|
+
if (!rules || rules.length === 0)
|
|
337
354
|
return "";
|
|
355
|
+
return `\n## Field Rules\n\n${rules.map((rule) => `- ${rule}`).join("\n")}\n`;
|
|
356
|
+
}
|
|
357
|
+
/** The self-check block both prompts end with. */
|
|
358
|
+
function renderSelfCheck(outputKey, outputPath, repoRoot) {
|
|
338
359
|
return `
|
|
339
|
-
|
|
360
|
+
Check the file before you stop:
|
|
340
361
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
redirect, \`;\` or command substitution. A bare \`&&\` chain is split for you, but
|
|
345
|
-
every other chained or substituting form is REFUSED and costs a full DAG
|
|
346
|
-
regeneration.
|
|
362
|
+
\`${loaderCommand(`validate-artifact --name ${outputKey} --file ${outputPath}${repoRoot ? ` --root ${repoRoot}` : ""}`)}\`
|
|
363
|
+
|
|
364
|
+
\`status: "ok"\` means the file is admissible. Otherwise, fix each problem it names.
|
|
347
365
|
`;
|
|
348
366
|
}
|
|
367
|
+
function renderCwdNote(repoRoot) {
|
|
368
|
+
return repoRoot
|
|
369
|
+
? `\n> Set the shell/tool working directory to \`${repoRoot}\` before running any commands.\n`
|
|
370
|
+
: "";
|
|
371
|
+
}
|
|
349
372
|
/**
|
|
350
373
|
* The artifacts a role must read, DERIVED from the artifact store's dependency
|
|
351
374
|
* DAG rather than re-declared per role.
|
|
@@ -388,50 +411,37 @@ export function renderContractPipelinePrompt(input) {
|
|
|
388
411
|
const sourceSections = input.sourcePaths && input.sourcePaths.length > 0
|
|
389
412
|
? `\n## Source Inputs\n\n${input.sourcePaths.map((p) => `- \`${p}\``).join("\n")}\n`
|
|
390
413
|
: "";
|
|
391
|
-
const
|
|
392
|
-
? `\n
|
|
393
|
-
: "";
|
|
394
|
-
// Path-A seed section: included for goal_normalization and context_collection
|
|
395
|
-
// when the intake source is a structured audit-findings report.
|
|
396
|
-
const PATH_A_SEED_ROLES = new Set([
|
|
397
|
-
"goal_normalization",
|
|
398
|
-
"context_collection",
|
|
399
|
-
"decomposition",
|
|
400
|
-
"module_contract_drafting",
|
|
401
|
-
]);
|
|
402
|
-
const pathASeedSection = input.pathASeedPath && PATH_A_SEED_ROLES.has(input.role)
|
|
403
|
-
? `\n## Path-A Audit Seed\n\nThis run originates from a structured audit-findings report. The seed file below contains the findings summary and affected files — your output must frame the goal and context around these findings so every subsequent pipeline node traces to an auditor finding:\n\n- \`${input.pathASeedPath}\` (path_a_seed)\n`
|
|
414
|
+
const pathASeedSection = input.pathASeedPath && role.pathASeed
|
|
415
|
+
? `\n## Path-A Audit Seed\n\n- \`${input.pathASeedPath}\` (path_a_seed) — ${role.pathASeed}\n`
|
|
404
416
|
: "";
|
|
417
|
+
const readScope = role.repoReads
|
|
418
|
+
? `Read the files above. You may also read repository files ${role.repoReads}.`
|
|
419
|
+
: "Read the files above. Do not read other files.";
|
|
405
420
|
const independentCriticDirective = renderIndependentCriticDirective(input.role, input.adversarialDepth);
|
|
406
|
-
const outputConstraints = renderOutputConstraints(input.role);
|
|
407
421
|
const prompt = `# ${role.title}
|
|
408
422
|
|
|
409
423
|
${role.description}
|
|
410
|
-
${
|
|
424
|
+
${renderCwdNote(input.repoRoot)}${independentCriticDirective}
|
|
411
425
|
## Required Inputs
|
|
412
426
|
${inputSections.length > 0 ? inputSections.join("\n") : "_No artifact inputs required for this role._"}
|
|
413
427
|
${sourceSections}${pathASeedSection}
|
|
414
|
-
##
|
|
428
|
+
## What You May Read
|
|
415
429
|
|
|
416
|
-
|
|
430
|
+
${readScope}
|
|
431
|
+
|
|
432
|
+
## Your Task
|
|
417
433
|
|
|
418
|
-
Write
|
|
434
|
+
Write the complete artifact to exactly:
|
|
419
435
|
|
|
420
436
|
\`${outputPath}\`
|
|
421
437
|
|
|
422
|
-
|
|
438
|
+
It must have this JSON shape:
|
|
423
439
|
|
|
424
440
|
\`\`\`json
|
|
425
441
|
${role.outputSchema}
|
|
426
442
|
\`\`\`
|
|
427
|
-
${
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
\`${loaderCommand(`validate-artifact --name ${role.outputKey} --file ${outputPath}${input.repoRoot ? ` --root ${input.repoRoot}` : ""}`)}\`
|
|
431
|
-
|
|
432
|
-
A \`status: "ok"\` result means the structure is valid; otherwise fix the reported issues before running next-step.
|
|
433
|
-
|
|
434
|
-
**Stop after writing the output file.** Do not edit source files. Do not advance to the next pipeline step.
|
|
443
|
+
${renderFieldRules(role.fieldRules)}${renderSelfCheck(role.outputKey, outputPath, input.repoRoot)}
|
|
444
|
+
**Stop after you write the output file.** Do not edit source files. Do not start the next phase.
|
|
435
445
|
`;
|
|
436
446
|
return { prompt, outputPath, role };
|
|
437
447
|
}
|
|
@@ -440,6 +450,11 @@ A \`status: "ok"\` result means the structure is valid; otherwise fix the report
|
|
|
440
450
|
* and the phase progression order (object insertion order is the dependency
|
|
441
451
|
* order). `CONTRACT_PIPELINE_PHASE_ORDER` and contractPipeline.ts's
|
|
442
452
|
* `ARTIFACT_TO_PHASE` both derive from this — never re-list the phases.
|
|
453
|
+
*
|
|
454
|
+
* `cyclic_seam_resolution` has no entry in `ROLES`: its one prompt is rendered
|
|
455
|
+
* by the gate that owns the phase (`renderCyclicSeamResolutionPrompt` in
|
|
456
|
+
* `contractPipeline.ts`), because it needs the detected cycles. There is no
|
|
457
|
+
* `closing` phase: the close phase writes the verification report itself.
|
|
443
458
|
*/
|
|
444
459
|
export const PHASE_TO_ARTIFACT = {
|
|
445
460
|
goal_normalization: "goal_spec",
|
|
@@ -456,7 +471,6 @@ export const PHASE_TO_ARTIFACT = {
|
|
|
456
471
|
critic: "counterexample",
|
|
457
472
|
judge: "judge_report",
|
|
458
473
|
implementation_planning: "implementation_dag",
|
|
459
|
-
closing: "verification_report",
|
|
460
474
|
};
|
|
461
475
|
/**
|
|
462
476
|
* Dependency order for pipeline phase progression — derived from
|
|
@@ -488,7 +502,7 @@ export const CONTRACT_PIPELINE_PHASE_ORDER = Object.keys(PHASE_TO_ARTIFACT);
|
|
|
488
502
|
*/
|
|
489
503
|
const REPAIR_TRIGGER_CONTRACT = {
|
|
490
504
|
judge: {
|
|
491
|
-
lead: (target) => `The adversarial judge rejected the current contract.
|
|
505
|
+
lead: (target) => `The adversarial judge rejected the current contract. Rewrite \`${target}\` in full so that it addresses every accepted counterexample.`,
|
|
492
506
|
instructionHeading: "Judge Instruction",
|
|
493
507
|
requiredInputs: [
|
|
494
508
|
"goal_spec",
|
|
@@ -498,10 +512,10 @@ const REPAIR_TRIGGER_CONTRACT = {
|
|
|
498
512
|
"counterexample",
|
|
499
513
|
"judge_report",
|
|
500
514
|
],
|
|
501
|
-
readingNote: "
|
|
515
|
+
readingNote: "the accepted counterexamples in the judge report's classifications",
|
|
502
516
|
},
|
|
503
517
|
critique: {
|
|
504
|
-
lead: (target) => `The conceptual design critique raised
|
|
518
|
+
lead: (target) => `The conceptual design critique raised blocking concerns. Rewrite \`${target}\` in full so that no blocking concern still applies.`,
|
|
505
519
|
instructionHeading: "Blocking Concerns",
|
|
506
520
|
// The critique gate runs BEFORE any downstream artifact is derived, so the
|
|
507
521
|
// judge-side artifacts do not exist yet. Listing them is what sent workers
|
|
@@ -511,20 +525,24 @@ const REPAIR_TRIGGER_CONTRACT = {
|
|
|
511
525
|
"finalized_module_contracts",
|
|
512
526
|
"conceptual_design_critique",
|
|
513
527
|
],
|
|
514
|
-
readingNote: "
|
|
528
|
+
readingNote: "each blocking concern in the conceptual design critique",
|
|
515
529
|
},
|
|
516
530
|
};
|
|
517
|
-
/**
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
531
|
+
/**
|
|
532
|
+
* The role that first writes each repair target. The repair prompt renders
|
|
533
|
+
* that role's sketch AND its field rules: a repaired artifact passes the same
|
|
534
|
+
* validator and the same gates as a first write, so the two prompts state one
|
|
535
|
+
* set of rules from one place.
|
|
536
|
+
*/
|
|
537
|
+
const REPAIR_TARGET_ROLE = {
|
|
538
|
+
finalized_module_contracts: ROLES.contract_finalization,
|
|
539
|
+
obligation_ledger: ROLES.obligation_ledger,
|
|
540
|
+
contract_assessment_report: ROLES.assessment,
|
|
522
541
|
};
|
|
523
542
|
/**
|
|
524
|
-
* Render the bounded repair step for a failing
|
|
525
|
-
*
|
|
526
|
-
* the
|
|
527
|
-
* re-derives everything downstream via the staleness DAG.
|
|
543
|
+
* Render the bounded repair step for a failing gate: rewrite the named contract
|
|
544
|
+
* artifact in full, addressing the gate's instruction. The worker edits only the
|
|
545
|
+
* target; the pipeline brings every later artifact back on its own.
|
|
528
546
|
*/
|
|
529
547
|
export function renderContractRepairPrompt(input) {
|
|
530
548
|
const outputPath = input.artifactPaths[input.target];
|
|
@@ -538,13 +556,11 @@ export function renderContractRepairPrompt(input) {
|
|
|
538
556
|
throw new Error(`Contract repair (${input.trigger}) requires artifact path for "${key}" but it was not provided.`);
|
|
539
557
|
}
|
|
540
558
|
}
|
|
541
|
-
const
|
|
542
|
-
? `\n> Set the shell/tool working directory to \`${input.repoRoot}\` before running any commands.\n`
|
|
543
|
-
: "";
|
|
559
|
+
const role = REPAIR_TARGET_ROLE[input.target];
|
|
544
560
|
const prompt = `# Contract Repair: ${input.target}
|
|
545
561
|
|
|
546
562
|
${contract.lead(input.target)}
|
|
547
|
-
${
|
|
563
|
+
${renderCwdNote(input.repoRoot)}
|
|
548
564
|
## ${contract.instructionHeading}
|
|
549
565
|
|
|
550
566
|
${input.instruction}
|
|
@@ -555,19 +571,17 @@ ${requiredInputs.map((key) => `- \`${input.artifactPaths[key]}\` (${key})`).join
|
|
|
555
571
|
|
|
556
572
|
## Your Task
|
|
557
573
|
|
|
558
|
-
Read the inputs above
|
|
574
|
+
Read the inputs above. Attend to ${contract.readingNote}. Write the complete artifact, not a diff, to exactly:
|
|
559
575
|
|
|
560
576
|
\`${outputPath}\`
|
|
561
577
|
|
|
562
|
-
|
|
578
|
+
It must have this JSON shape:
|
|
563
579
|
|
|
564
580
|
\`\`\`json
|
|
565
|
-
${
|
|
581
|
+
${role.outputSchema}
|
|
566
582
|
\`\`\`
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
**Stop after writing the output file.** Do not edit source files. Do not advance to the next pipeline step.
|
|
583
|
+
${renderFieldRules(role.fieldRules)}${renderSelfCheck(input.target, outputPath, input.repoRoot)}
|
|
584
|
+
**Stop after you write the output file.** Do not edit any other artifact or any source file. Do not start the next phase.
|
|
571
585
|
`;
|
|
572
586
|
return { prompt, outputPath };
|
|
573
587
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contractPipelinePrompts.js","sourceRoot":"","sources":["../../../src/remediate/steps/contractPipelinePrompts.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,+BAA+B,EAC/B,mBAAmB,EACnB,8BAA8B,EAC9B,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"contractPipelinePrompts.js","sourceRoot":"","sources":["../../../src/remediate/steps/contractPipelinePrompts.ts"],"names":[],"mappings":"AAAA,uKAAuK;AACvK;;;;;GAKG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,+BAA+B,EAC/B,mBAAmB,EACnB,8BAA8B,EAC9B,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,4BAA4B,EAC5B,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,eAAe,EACf,YAAY,GACb,MAAM,qCAAqC,CAAC;AAG7C,OAAO,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AA8C7C;;;;;;GAMG;AACH,MAAM,sBAAsB,GAC1B,iTAAiT,CAAC;AAEpT,MAAM,CAAC,MAAM,KAAK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Q,CAAC;;CAE9F,CAAC;IAEA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;AAChC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type WorkItemOutcome, type FindingSeverity, type LaneDemand, type SubmissionIssue } from "audit-tools/shared";
|
|
1
|
+
import { type IssueRemedy, type WorkItemOutcome, type FindingSeverity, type LaneDemand, type SubmissionIssue } from "audit-tools/shared";
|
|
2
2
|
import { type RemediationState } from "../../state/store.js";
|
|
3
3
|
import { type RemediationBlock, type RemediationHostHandoffRecord, type RemediationItemState, type RemediationPlan } from "../../state/types.js";
|
|
4
4
|
import { REMEDIATION_HOST_WORKLOAD_CONTRACT_VERSION as WORKLOAD_CONTRACT_VERSION } from "../types.js";
|
|
@@ -60,8 +60,10 @@ export interface PreparedRemediationHostHandoff {
|
|
|
60
60
|
* git/worktree/test half stays here: audit has no analogue and dragging
|
|
61
61
|
* `commit_not_landed` into the shared core would suggest it could emit one.
|
|
62
62
|
*/
|
|
63
|
-
export declare const REMEDIATION_ISSUE_CODES: readonly ["submission_missing", "submission_malformed", "submission_contract_invalid", "submission_rejected", "duplicate_submission_id", "workload_missing", "workload_invalid", "trusted_binding_missing", "commit_missing", "commit_not_landed", "baseline_not_ancestor", "changed_files_mismatch", "run_start_dirty_overlap", "required_test_failed", "required_test_timed_out", "required_test_output_overflow", "dependency_missing", "block_contract_invalid", "recovery_unrecorded", "tree_moved_between_phases", "state_moved_between_phases"];
|
|
63
|
+
export declare const REMEDIATION_ISSUE_CODES: readonly ["submission_missing", "submission_malformed", "submission_contract_invalid", "submission_rejected", "duplicate_submission_id", "workload_missing", "workload_invalid", "trusted_binding_missing", "commit_missing", "commit_not_landed", "baseline_not_ancestor", "changed_files_mismatch", "run_start_dirty_overlap", "required_test_failed", "required_test_timed_out", "required_test_output_overflow", "dependency_missing", "block_contract_invalid", "recovery_unrecorded", "tree_moved_between_phases", "state_moved_between_phases", "baseline_missing", "baseline_orphaned", "landed_commit_invalid", "work_item_not_eligible", "workload_stale"];
|
|
64
64
|
export type RemediationIssueCode = (typeof REMEDIATION_ISSUE_CODES)[number];
|
|
65
|
+
/** The remedy for one classified remediation ingest failure. */
|
|
66
|
+
export declare function remediationIssueRemedy(issue: SubmissionIssue<RemediationIssueCode>): IssueRemedy;
|
|
65
67
|
export type RemediationHostIngestIssue = SubmissionIssue<RemediationIssueCode>;
|
|
66
68
|
export interface RemediationHostIngestSummary {
|
|
67
69
|
readonly accepted_count: number;
|
|
@@ -313,8 +315,8 @@ export declare function prepareRemediationHostHandoff(params: {
|
|
|
313
315
|
* remote ref) also fails the ancestry test when work lands elsewhere, and that
|
|
314
316
|
* is the ordinary stale-worker case — recovery refuses it. Every other
|
|
315
317
|
* corroboration check runs unchanged (the landed commit exists and is reachable
|
|
316
|
-
* from HEAD; its mechanically derived changed files
|
|
317
|
-
*
|
|
318
|
+
* from HEAD; its mechanically derived changed files lie within the
|
|
319
|
+
* prompt-bound `allowed_files`; no overlap
|
|
318
320
|
* with run-start dirt; the required tests rerun green), `parseResult` stays
|
|
319
321
|
* fully strict, and dependency/phase eligibility is enforced exactly as on the
|
|
320
322
|
* normal lane.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hostHandoff.d.ts","sourceRoot":"","sources":["../../../../src/remediate/steps/dispatch/hostHandoff.ts"],"names":[],"mappings":"AAOA,OAAO,
|
|
1
|
+
{"version":3,"file":"hostHandoff.d.ts","sourceRoot":"","sources":["../../../../src/remediate/steps/dispatch/hostHandoff.ts"],"names":[],"mappings":"AAOA,OAAO,EAWL,KAAK,WAAW,EAKhB,KAAK,eAAe,EAqCpB,KAAK,eAAe,EAGpB,KAAK,UAAU,EACf,KAAK,eAAe,EAGrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAOL,KAAK,gBAAgB,EACrB,KAAK,4BAA4B,EACjC,KAAK,oBAA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