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
|
@@ -5,10 +5,32 @@
|
|
|
5
5
|
// derives the sites from the staged diff and refuses an unbound one.
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
8
|
-
import { FindingSchema, FindingLocationObjectSchema, LensSchema, refineFindingLocationLines, } from "audit-tools/shared";
|
|
8
|
+
import { AUDIT_FINDING_QUOTE_OR_DECLARATION_RULE, FindingSchema, FindingLocationObjectSchema, LensSchema, refineFindingLocationLines, } from "audit-tools/shared";
|
|
9
9
|
import { AuditTaskSchema, AuditResultSchema, AuditVerificationSchema, } from "../types.js";
|
|
10
10
|
import { AuditCodeResponseSchema } from "./wrapperResponse.js";
|
|
11
|
-
export const WorkerFindingLocationSchema = FindingLocationObjectSchema.strict()
|
|
11
|
+
export const WorkerFindingLocationSchema = FindingLocationObjectSchema.strict()
|
|
12
|
+
.superRefine(refineFindingLocationLines)
|
|
13
|
+
// The audit draw's grounding rule, enforced at the SCHEMA so the host door
|
|
14
|
+
// (`parseFindings`) and the generated JSON schema state it without a second
|
|
15
|
+
// hand-written check. The sentence is the shared constant the dispatch prompt
|
|
16
|
+
// renders, so the ask and the refusal are the same words.
|
|
17
|
+
//
|
|
18
|
+
// It is on the WORKER projection and not on the shared location schema on
|
|
19
|
+
// purpose: a remediator plan finding is re-minted from graph nodes, so it has
|
|
20
|
+
// no reviewer who could quote a span or declare that none exists.
|
|
21
|
+
.superRefine((location, ctx) => {
|
|
22
|
+
const quoted = typeof location.quoted_text === "string" &&
|
|
23
|
+
location.quoted_text.trim().length > 0;
|
|
24
|
+
const declared = typeof location.no_quotable_span === "string" &&
|
|
25
|
+
location.no_quotable_span.trim().length > 0;
|
|
26
|
+
if (quoted === declared) {
|
|
27
|
+
ctx.addIssue({
|
|
28
|
+
code: z.ZodIssueCode.custom,
|
|
29
|
+
path: [quoted ? "no_quotable_span" : "quoted_text"],
|
|
30
|
+
message: AUDIT_FINDING_QUOTE_OR_DECLARATION_RULE,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
});
|
|
12
34
|
// `grounding`, `verification_status`, `severity_downgraded_from`,
|
|
13
35
|
// `evidence_lane` and `lead_lineage` are OMITTED, not merely left un-extended:
|
|
14
36
|
// each is a TOOL-owned verdict — the re-check of the worker's quote (computed at
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workerSchemas.js","sourceRoot":"","sources":["../../../src/audit/contracts/workerSchemas.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAEzE,EAAE;AACF,uGAAuG;AACvG,sFAAsF;AACtF,uEAAuE;AAEvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,aAAa,EACb,2BAA2B,EAC3B,UAAU,EACV,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC;A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AAO,EACL,qFAAqF;YACrF,4FAA4F;YAC5F,gBAAgB;KACnB;CACF,CAAC;AAEF,MAAM,UAAU,sBAAsB,CACpC,QAAgB;IAEhB,MAAM,KAAK,GAAG,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,2CAA2C,QAAQ,GAAG,CAAC,CAAC;IAC1E,CAAC;IACD,MAAM,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC,MAAM,EAAE;QAC9C,YAAY,EAAE,MAAM;QACpB,MAAM,EAAE,aAAa;KACtB,CAA4B,CAAC;IAC9B,OAAO,SAAS,CAAC,OAAO,CAAC;IACzB,OAAO;QACL,OAAO,EAAE,8CAA8C;QACvD,GAAG,EAAE,QAAQ;QACb,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,GAAG,SAAS;KACb,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charterClarificationExecutor.d.ts","sourceRoot":"","sources":["../../../src/audit/orchestrator/charterClarificationExecutor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,EAGL,KAAK,sBAAsB,EAE3B,KAAK,8BAA8B,
|
|
1
|
+
{"version":3,"file":"charterClarificationExecutor.d.ts","sourceRoot":"","sources":["../../../src/audit/orchestrator/charterClarificationExecutor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,EAGL,KAAK,sBAAsB,EAE3B,KAAK,8BAA8B,EAMnC,KAAK,gBAAgB,EAEtB,MAAM,oBAAoB,CAAC;AAM5B;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,gBAAgB,GAAG,SAAS,GACvC,sBAAsB,CAGxB;AA4GD;;;;;;;;;;GAUG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,cAAc,EACtB,OAAO,CAAC,EAAE,8BAA8B,GACvC,iBAAiB,CA8DnB"}
|
|
@@ -12,6 +12,44 @@ export function resolveClarificationAttention(checkpoint) {
|
|
|
12
12
|
const attention = resolveRunBoundDesignReview(checkpoint)?.attention;
|
|
13
13
|
return attention ?? 0;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Refuse an answers submission that keys an answer on a `request_id` this run
|
|
17
|
+
* never asked.
|
|
18
|
+
*
|
|
19
|
+
* WHY IT REFUSES RATHER THAN IGNORES. `request_id` is a free string at the gate,
|
|
20
|
+
* so an invented, mistyped or placeholder id parses. The answer then lands in a
|
|
21
|
+
* map nothing reads, every question the run DID ask falls to the `leave_open`
|
|
22
|
+
* default below, and the register records a success. The host relayed the
|
|
23
|
+
* questions, the user answered them, and the answers were discarded in silence —
|
|
24
|
+
* the one outcome this step must not have, because attention is the scarcest of
|
|
25
|
+
* the three currencies the control surface spends (owner decision, 2026-09-17:
|
|
26
|
+
* refuse the whole submission).
|
|
27
|
+
*
|
|
28
|
+
* THE WHOLE SUBMISSION, not the offending entry. A partial acceptance still
|
|
29
|
+
* completes the round, so the dropped answers would be gone by the time anyone
|
|
30
|
+
* read the validation issue; a refusal keeps the queue open and the staged
|
|
31
|
+
* payload rescuable through `recover-submission`.
|
|
32
|
+
*
|
|
33
|
+
* THIS BOUNDARY owns the check because it is the first one holding both halves:
|
|
34
|
+
* the asked queue lives in the bundle and the gate never sees it. The prompt
|
|
35
|
+
* states the rule (`charterClarificationPrompt`) and this enforces it, so a host
|
|
36
|
+
* that obeys the prompt exactly is never refused here.
|
|
37
|
+
*/
|
|
38
|
+
function refuseUnaskedRequestIds(answers, asked) {
|
|
39
|
+
const askedIds = new Set(asked.map((q) => q.request_id));
|
|
40
|
+
const unasked = [...new Set(answers.answers.map((a) => a.request_id))]
|
|
41
|
+
.filter((id) => !askedIds.has(id))
|
|
42
|
+
.sort();
|
|
43
|
+
if (unasked.length === 0)
|
|
44
|
+
return;
|
|
45
|
+
throw new Error(`charter clarification answers name ${unasked.length} request_id(s) this run never asked: ` +
|
|
46
|
+
`${unasked.map((id) => JSON.stringify(id)).join(", ")} — ` +
|
|
47
|
+
(askedIds.size === 0
|
|
48
|
+
? "this round asked no interactive questions at all, so there is nothing to answer."
|
|
49
|
+
: `copy an id exactly as the prompt printed it (asked: ${[...askedIds].sort().join(", ")}). ` +
|
|
50
|
+
"The whole submission is refused: an unmatched id is an answer the tool would drop while " +
|
|
51
|
+
"recording every question you did answer as left open."));
|
|
52
|
+
}
|
|
15
53
|
/** The union of the corresponding nodes' file scopes — the question's affected files. */
|
|
16
54
|
function correspondenceFiles(correspondence, graphs) {
|
|
17
55
|
const files = new Set();
|
|
@@ -96,6 +134,7 @@ export function runCharterClarificationExecutor(bundle, answers) {
|
|
|
96
134
|
// every interactive question the host DIDN'T answer defaults to `leave_open`.
|
|
97
135
|
const priorAnswers = new Map();
|
|
98
136
|
if (answers) {
|
|
137
|
+
refuseUnaskedRequestIds(answers, bundle.charter_clarification?.asked ?? []);
|
|
99
138
|
for (const a of answers.answers)
|
|
100
139
|
priorAnswers.set(a.request_id, a.answer);
|
|
101
140
|
for (const q of bundle.charter_clarification?.asked ?? []) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charterClarificationExecutor.js","sourceRoot":"","sources":["../../../src/audit/orchestrator/charterClarificationExecutor.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,6BAA6B,EAC7B,oBAAoB,
|
|
1
|
+
{"version":3,"file":"charterClarificationExecutor.js","sourceRoot":"","sources":["../../../src/audit/orchestrator/charterClarificationExecutor.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,6BAA6B,EAC7B,oBAAoB,EAUpB,2BAA2B,GAC5B,M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C,CAAC;IACxE,OAAO;QACL,OAAO,EAAE,EAAE,GAAG,MAAM,EAAE,qBAAqB,EAAE,aAAa,EAAE;QAC5D,iBAAiB,EAAE,CAAC,4BAA4B,CAAC;QACjD,gBAAgB,EACd,mCAAmC,aAAa,CAAC,KAAK,CAAC,MAAM,2BAA2B;YACxF,cAAc,MAAM,CAAC,SAAS,CAAC,MAAM,aAAa,CAAC,MAAM,CAAC,MAAM,YAAY;YAC5E,GAAG,aAAa,CAAC,QAAQ,CAAC,MAAM,aAAa;YAC7C,WAAW;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import type { ArtifactBundle } from "../io/artifacts.js";
|
|
2
2
|
import type { ExecutorRunResult } from "./executorResult.js";
|
|
3
3
|
import { type CharterRegister } from "../types/charterRegister.js";
|
|
4
|
-
import { type CharterPacketManifest, type CharterLaneGraph, type
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import { type CharterPacketManifest, type CharterLaneGraph, type CharterExtractionMerged, type Ceiling, type CitationValidationSummary, type IntentCheckpoint } from "audit-tools/shared";
|
|
5
|
+
/**
|
|
6
|
+
* The tool-merged extraction submission: every lane's DAG, in canonical kind
|
|
7
|
+
* order, each lane stamped with the kind the TOOL resolved from its bound path.
|
|
8
|
+
*
|
|
9
|
+
* ONE home. The shape is declared by `CharterExtractionMergedSchema` in
|
|
10
|
+
* `audit-tools/shared` and only re-exported here. It was a second, hand-written
|
|
11
|
+
* interface until 2026-09-17, when dropping the lane-stated `kind` made the two
|
|
12
|
+
* declarations disagree — a lane submission no longer carries a kind, and the
|
|
13
|
+
* merged lane does.
|
|
14
|
+
*/
|
|
15
|
+
export type { CharterExtractionMerged };
|
|
9
16
|
/**
|
|
10
17
|
* Resolve the charter-layer ceiling from the confirmed checkpoint. The ceiling is
|
|
11
18
|
* the consent dial captured at `intent_checkpoint`; when the host never set it we
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charterExtractionExecutor.d.ts","sourceRoot":"","sources":["../../../src/audit/orchestrator/charterExtractionExecutor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,
|
|
1
|
+
{"version":3,"file":"charterExtractionExecutor.d.ts","sourceRoot":"","sources":["../../../src/audit/orchestrator/charterExtractionExecutor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAWL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,OAAO,EACZ,KAAK,yBAAyB,EAE9B,KAAK,gBAAgB,EAEtB,MAAM,oBAAoB,CAAC;AAI5B;;;;;;;;;GASG;AACH,YAAY,EAAE,uBAAuB,EAAE,CAAC;AAExC;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,gBAAgB,GAAG,SAAS,GACvC,OAAO,CAOT;AAED,wFAAwF;AACxF,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAEjE;AAwCD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,SAAS,gBAAgB,EAAE,EAClC,OAAO,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,SAAS,qBAAqB,EAAE,CAAA;CAAE,GACtE;IAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,yBAAyB,CAAA;CAAE,CAwG1D;AAED,0FAA0F;AAC1F,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,SAAS,GAAG,SAAS,GAC5B,eAAe,CAyBjB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,cAAc,EACtB,UAAU,EAAE,uBAAuB,GAAG,SAAS,EAC/C,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAO,GACrD,OAAO,CAAC,iBAAiB,CAAC,CA0D5B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// sites-pinned: tests/audit/charter-extraction-executor.test.ts
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { CHARTER_REGISTER_SCHEMA_VERSION, } from "../types/charterRegister.js";
|
|
4
|
-
import { CHARTER_PACKET_MANIFEST_SCHEMA_VERSION, CharterLaneKindSchema, assembleLaneGraph, proposeCorrespondences, checkCitations, laneAssetsDir, readOptionalJsonFile, resolveRunBoundDesignReview, } from "audit-tools/shared";
|
|
4
|
+
import { CHARTER_PACKET_MANIFEST_SCHEMA_VERSION, CharterLaneKindSchema, assembleLaneGraph, proposeCorrespondences, checkCitations, provenancePath, PATH_SHAPED_PROVENANCE_KINDS, laneAssetsDir, readOptionalJsonFile, resolveRunBoundDesignReview, } from "audit-tools/shared";
|
|
5
5
|
import { charterExtractionCoverageFilename } from "../cli/laneSubmissions.js";
|
|
6
6
|
import { charterExtractionKindsForCeiling } from "../cli/charterExtractionPrompt.js";
|
|
7
7
|
/**
|
|
@@ -24,8 +24,6 @@ export function resolveCharterCeiling(checkpoint) {
|
|
|
24
24
|
export function ceilingRequestsCharters(ceiling) {
|
|
25
25
|
return ceiling.rung === "deep" || ceiling.rung === "deepest";
|
|
26
26
|
}
|
|
27
|
-
/** Provenance kinds whose `ref` is a repository path, so a citation check applies. */
|
|
28
|
-
const PATH_SHAPED_PROVENANCE = new Set(["doc", "code", "comment"]);
|
|
29
27
|
/**
|
|
30
28
|
* Read the per-kind packet manifests the EMIT pass persisted. The packet is built
|
|
31
29
|
* at emit and the register is written at ingest — different invocations — so the
|
|
@@ -70,7 +68,7 @@ export function checkLaneCitations(lanes, options) {
|
|
|
70
68
|
for (const owner of owners) {
|
|
71
69
|
for (const provenance of owner.provenance) {
|
|
72
70
|
citationCount += 1;
|
|
73
|
-
if (!
|
|
71
|
+
if (!PATH_SHAPED_PROVENANCE_KINDS.has(provenance.kind))
|
|
74
72
|
continue;
|
|
75
73
|
citations.push({
|
|
76
74
|
owner_id: owner.id,
|
|
@@ -80,16 +78,43 @@ export function checkLaneCitations(lanes, options) {
|
|
|
80
78
|
}
|
|
81
79
|
}
|
|
82
80
|
}
|
|
81
|
+
// The QUOTE-PRESENCE leg. It runs against the manifests alone, so it is
|
|
82
|
+
// computed before the grounding leg's root abstention and reported by BOTH
|
|
83
|
+
// exits: a missing repository root says nothing about what the packets
|
|
84
|
+
// delivered.
|
|
85
|
+
//
|
|
86
|
+
// Why the lane gate does not already cover this. The gate refuses a quoteless
|
|
87
|
+
// citation that names a SPAN — a `#symbol` anchor or a line suffix — because
|
|
88
|
+
// that one is unverifiable by construction and needs no context to judge. What
|
|
89
|
+
// it cannot judge is a quoteless citation of a BARE path, because the two
|
|
90
|
+
// meanings of that citation are told apart only by the evidence packet: for a
|
|
91
|
+
// file the packet delivered as a tree entry with no excerpt, the bare path is
|
|
92
|
+
// the lane's ONLY truthful citation and demanding a quote would invite a
|
|
93
|
+
// fabricated one; for a file the packet EXCERPTED, the lane was handed the text
|
|
94
|
+
// and declining to copy it is the defect. The gate holds the repository's path
|
|
95
|
+
// set, never the manifests, so it cannot see which file is which. This boundary
|
|
96
|
+
// holds the manifests, so the distinction is decidable here and nowhere else
|
|
97
|
+
// (owner decision, 2026-09-17: put each rule at the boundary that owns it).
|
|
98
|
+
const excerptedPaths = new Set(options.manifests.flatMap((manifest) => manifest.excerpts.map((excerpt) => excerpt.source_path)));
|
|
99
|
+
const quotePresenceChecked = options.manifests.length > 0;
|
|
100
|
+
const quoteIssues = quotePresenceChecked
|
|
101
|
+
? citations
|
|
102
|
+
.filter((citation) => (citation.quote === undefined || citation.quote.trim().length === 0) &&
|
|
103
|
+
excerptedPaths.has(provenancePath(citation.ref)))
|
|
104
|
+
.map((citation) => `${citation.owner_id}: citation "${citation.ref}" carries no quote — ` +
|
|
105
|
+
"your packet excerpted that file, so copy the text your claim rests on")
|
|
106
|
+
: [];
|
|
83
107
|
if (!options.root) {
|
|
84
|
-
// A RECORDED ABSTENTION, never an implicit pass.
|
|
108
|
+
// A RECORDED ABSTENTION for the grounding leg, never an implicit pass.
|
|
85
109
|
return {
|
|
86
|
-
issues:
|
|
110
|
+
issues: quoteIssues,
|
|
87
111
|
summary: {
|
|
88
112
|
status: "not_run",
|
|
89
113
|
citation_count: citationCount,
|
|
90
114
|
checked_count: 0,
|
|
91
|
-
failed_count:
|
|
115
|
+
failed_count: quoteIssues.length,
|
|
92
116
|
delivered_evidence_checked: false,
|
|
117
|
+
quote_presence_checked: quotePresenceChecked,
|
|
93
118
|
},
|
|
94
119
|
};
|
|
95
120
|
}
|
|
@@ -106,13 +131,17 @@ export function checkLaneCitations(lanes, options) {
|
|
|
106
131
|
});
|
|
107
132
|
const failures = result.checks.filter((check) => check.verdict !== "ok");
|
|
108
133
|
return {
|
|
109
|
-
issues:
|
|
134
|
+
issues: [
|
|
135
|
+
...failures.map((check) => `${check.owner_id}: citation "${check.ref}" ${check.verdict}${check.detail ? ` — ${check.detail}` : ""}`),
|
|
136
|
+
...quoteIssues,
|
|
137
|
+
],
|
|
110
138
|
summary: {
|
|
111
139
|
status: "checked",
|
|
112
140
|
citation_count: citationCount,
|
|
113
141
|
checked_count: result.checked_count,
|
|
114
|
-
failed_count: failures.length,
|
|
142
|
+
failed_count: failures.length + quoteIssues.length,
|
|
115
143
|
delivered_evidence_checked: result.delivered_evidence_checked,
|
|
144
|
+
quote_presence_checked: quotePresenceChecked,
|
|
116
145
|
},
|
|
117
146
|
};
|
|
118
147
|
}
|
|
@@ -138,6 +167,7 @@ export function emptyCharterRegister(ceiling, generated_at, status) {
|
|
|
138
167
|
citation_count: 0,
|
|
139
168
|
checked_count: 0,
|
|
140
169
|
failed_count: 0,
|
|
170
|
+
quote_presence_checked: false,
|
|
141
171
|
delivered_evidence_checked: false,
|
|
142
172
|
},
|
|
143
173
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charterExtractionExecutor.js","sourceRoot":"","sources":["../../../src/audit/orchestrator/charterExtractionExecutor.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EACL,+BAA+B,GAEhC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,sCAAsC,EACtC,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,EACd,aAAa,EACb,oBAAoB,EASpB,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iCAAiC,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,gCAAgC,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"charterExtractionExecutor.js","sourceRoot":"","sources":["../../../src/audit/orchestrator/charterExtractionExecutor.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EACL,+BAA+B,GAEhC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,sCAAsC,EACtC,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,EACd,cAAc,EACd,4BAA4B,EAC5B,aAAa,EACb,oBAAoB,EASpB,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iCAAiC,EAAE,MAAM,2BAA2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,OAAO,EAAE,EAAE,GAAG,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE;QAClD,iBAAiB,EAAE,CAAC,uBAAuB,CAAC;QAC5C,gBAAgB,EACd,gCAAgC,KAAK,CAAC,MAAM,iBAAiB,SAAS,YAAY;YAClF,GAAG,UAAU,CAAC,MAAM,8BAA8B;YAClD,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC,CAAC,EAAE,CAAC;YACtE,WAAW;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -74,6 +74,13 @@ export declare function clampPerspectiveCount(requested?: number): number;
|
|
|
74
74
|
* of 2 is exactly the reserved count, so the guarantee holds at every legal count.
|
|
75
75
|
*/
|
|
76
76
|
export declare function selectPerspectives(count?: number): ConceptualPerspective[];
|
|
77
|
+
/**
|
|
78
|
+
* The contract pass's category vocabulary. Named data, beside the conceptual
|
|
79
|
+
* one, because the example and the prose that states the permitted values are
|
|
80
|
+
* now built from the SAME array — a second hand-written copy is how the two
|
|
81
|
+
* drifted apart in the first place.
|
|
82
|
+
*/
|
|
83
|
+
export declare const CONTRACT_FINDING_CATEGORIES: readonly ["inferred_contract_gap", "trust_boundary_gap", "invariant_counterexample", "critical_invariant_coverage_gap"];
|
|
77
84
|
export declare const CONCEPTUAL_FINDING_CATEGORIES: readonly ["fundamental_approach", "core_assumption", "structural_risk", "architecture_pattern", "design_simplification", "tool_opportunity", "integration", "missing_capability"];
|
|
78
85
|
/**
|
|
79
86
|
* Render the charter-layer context block (Phase C) for the conceptual passes:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"designReviewPrompt.d.ts","sourceRoot":"","sources":["../../../src/audit/orchestrator/designReviewPrompt.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAQzD,OAAO,EACL,0BAA0B,EAC1B,KAAK,oBAAoB,EAC1B,MAAM,6BAA6B,CAAC;AAErC,OA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AA2B,yHAK9B,CAAC;AA8FX,eAAO,MAAM,6BAA6B,mLAShC,CAAC;AAkCX;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAoCnE;AAgCD;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,MAAM,GACf,MAAM,CA8CR;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,cAAc,EACtB,OAAO,GAAE,mBAAwB,GAChC,MAAM,CA2CR;AAED;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,cAAc,EACtB,OAAO,GAAE,mBAAwB,GAChC,MAAM,CAwBR;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,cAAc,EACtB,WAAW,EAAE,qBAAqB,EAClC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,mBAAwB,GAChC,MAAM,CA8BR;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,cAAc,EACtB,kBAAkB,EAAE,KAAK,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC,EACF,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,mBAAwB,GAChC,MAAM,CAoDR"}
|
|
@@ -177,9 +177,32 @@ function renderLensScope(options) {
|
|
|
177
177
|
"",
|
|
178
178
|
];
|
|
179
179
|
}
|
|
180
|
-
/**
|
|
180
|
+
/**
|
|
181
|
+
* The lens literal the findings example echoes: the first selected, else a real
|
|
182
|
+
* lens from the eleven-lens vocabulary.
|
|
183
|
+
*
|
|
184
|
+
* It used to fall back to the DESCRIPTION `"the lens this finding belongs to"`.
|
|
185
|
+
* `lens` is a free string in the finding contract, so a host that copied the
|
|
186
|
+
* example was accepted, and `lens_breakdown` — a `countBy` over what was
|
|
187
|
+
* produced — then reported a lens named after the placeholder. An example
|
|
188
|
+
* teaches by being copied, so every literal in it must be a value the tool would
|
|
189
|
+
* be content to receive (owner decision, 2026-09-17).
|
|
190
|
+
*/
|
|
181
191
|
function exampleLens(options) {
|
|
182
|
-
return options.lenses?.[0] ?? "
|
|
192
|
+
return options.lenses?.[0] ?? "architecture";
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* A real repository path for the example's `affected_files`, taken from the
|
|
196
|
+
* manifest this prompt already prints in its file inventory.
|
|
197
|
+
*
|
|
198
|
+
* The example used to cite `relevant/file.ts`, which is not in any repository.
|
|
199
|
+
* `groundDesignFindings` resolves `affected_files` against the manifest, so a
|
|
200
|
+
* copied example grounds as
|
|
201
|
+
* `{"status":"ungrounded","reason":"cited component(s) not found …"}` — the
|
|
202
|
+
* prompt taught the one citation its own grounding pass refuses.
|
|
203
|
+
*/
|
|
204
|
+
function examplePath(bundle) {
|
|
205
|
+
return bundle.repo_manifest?.files?.[0]?.path ?? "src/index.ts";
|
|
183
206
|
}
|
|
184
207
|
/**
|
|
185
208
|
* Built-in conceptual perspectives. Each is a maximally dissimilar value system
|
|
@@ -335,30 +358,144 @@ function conceptualCritiqueInstructions() {
|
|
|
335
358
|
* envelope is universally emittable and matches every other host-gate
|
|
336
359
|
* submission. The design-review ingest
|
|
337
360
|
* (`unwrapSubmissionArray`) tolerantly unwraps the single `findings` array, so
|
|
338
|
-
* the shape round-trips. `
|
|
339
|
-
* line that differs between the TWO passes the tool runs: the contract pass
|
|
361
|
+
* the shape round-trips. `categories` is the per-pass category vocabulary — the
|
|
362
|
+
* one line that differs between the TWO passes the tool runs: the contract pass
|
|
340
363
|
* (`renderContractReviewPrompt`) and the conceptual pass
|
|
341
364
|
* (`CONCEPTUAL_FINDING_CATEGORIES`).
|
|
365
|
+
*
|
|
366
|
+
* EVERY LITERAL IN THE EXAMPLE IS A VALUE THE TOOL ACCEPTS (owner decision,
|
|
367
|
+
* 2026-09-17). This example used to put each closed enum's ALTERNATION in the
|
|
368
|
+
* field value — `"severity": "one of: critical, high, medium, low, info"` — so a
|
|
369
|
+
* host that copied it wrote a string no code recognises. The judge door refused
|
|
370
|
+
* it; the contract and shallow-conceptual doors did not, and the finding was
|
|
371
|
+
* stamped `grounded` with a severity `SEVERITY_RANK` cannot rank. The vocabulary
|
|
372
|
+
* now sits BESIDE the example, where it reads as a list of permitted values
|
|
373
|
+
* rather than as one.
|
|
342
374
|
*/
|
|
343
|
-
function findingsEnvelopeExample(
|
|
375
|
+
function findingsEnvelopeExample(categories, lensExample, examplePathValue) {
|
|
344
376
|
return [
|
|
345
377
|
"```json",
|
|
346
378
|
"{",
|
|
347
379
|
' "findings": [',
|
|
348
380
|
" {",
|
|
349
381
|
' "id": "DR-001",',
|
|
350
|
-
' "title": "
|
|
351
|
-
` "category": "${
|
|
352
|
-
' "severity": "
|
|
353
|
-
' "confidence": "
|
|
382
|
+
' "title": "Retry limit is enforced in two places that can disagree",',
|
|
383
|
+
` "category": "${categories[0]}",`,
|
|
384
|
+
' "severity": "high",',
|
|
385
|
+
' "confidence": "medium",',
|
|
354
386
|
` "lens": "${lensExample}",`,
|
|
355
387
|
' "summary": "detailed explanation of the observation and the recommended change",',
|
|
356
|
-
|
|
388
|
+
` "affected_files": [{"path": ${JSON.stringify(examplePathValue)}}],`,
|
|
357
389
|
' "systemic": true',
|
|
358
390
|
" }",
|
|
359
391
|
" ]",
|
|
360
392
|
"}",
|
|
361
393
|
"```",
|
|
394
|
+
"",
|
|
395
|
+
`Write the literal value, never the list of permitted ones. \`category\` is one of: ${categories.join(", ")}. ` +
|
|
396
|
+
"`severity` is one of: critical, high, medium, low, info. `confidence` is one of: high, medium, low. " +
|
|
397
|
+
"`affected_files` cites a real path from the file inventory above. Every finding is parsed against " +
|
|
398
|
+
"this contract at ingestion, and a submission carrying one that fails is refused whole — not " +
|
|
399
|
+
"partly accepted — so a placeholder value costs you the round.",
|
|
400
|
+
"",
|
|
401
|
+
"Do NOT supply `verification_status`, `evidence_lane` or `lead_lineage`. The tool derives all three " +
|
|
402
|
+
"at ingestion, and a submission that supplies any of them is refused by name.",
|
|
403
|
+
];
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* The contract pass's category vocabulary. Named data, beside the conceptual
|
|
407
|
+
* one, because the example and the prose that states the permitted values are
|
|
408
|
+
* now built from the SAME array — a second hand-written copy is how the two
|
|
409
|
+
* drifted apart in the first place.
|
|
410
|
+
*/
|
|
411
|
+
export const CONTRACT_FINDING_CATEGORIES = [
|
|
412
|
+
"inferred_contract_gap",
|
|
413
|
+
"trust_boundary_gap",
|
|
414
|
+
"invariant_counterexample",
|
|
415
|
+
"critical_invariant_coverage_gap",
|
|
416
|
+
];
|
|
417
|
+
/**
|
|
418
|
+
* The grounding rule, stated identically to every design-review pass because
|
|
419
|
+
* every design-review pass is grounded by the same function
|
|
420
|
+
* (`groundDesignFindings`).
|
|
421
|
+
*/
|
|
422
|
+
const GROUND_EVERY_FINDING = "**Ground every finding.** Cite at least one real `affected_files` path that exists in this repository — the component your observation is actually about. A finding that cites no real component is surfaced as ungrounded (quarantined), not admitted as confirmed: point at the code, do not invent paths. A whole-system observation should anchor on the file(s) where the structure is clearest.";
|
|
423
|
+
/**
|
|
424
|
+
* The JUDGE's worked example: the whole submission, not the findings half.
|
|
425
|
+
*
|
|
426
|
+
* It is built from the round's REAL identifiers — the round id the prompt
|
|
427
|
+
* already prints and the contributor ids of the perspective files it lists — so
|
|
428
|
+
* a host that copies it and edits the substance still submits ids this round
|
|
429
|
+
* knows. A placeholder id would parse (`z.string().min(1)`) and then fail the
|
|
430
|
+
* adjudication's own reference checks.
|
|
431
|
+
*/
|
|
432
|
+
function judgeEnvelopeExample(roundId, contributorIds, lensExample, examplePathValue) {
|
|
433
|
+
const perspective = contributorIds[0] ?? "design_review_conceptual_perspective_1";
|
|
434
|
+
return [
|
|
435
|
+
"```json",
|
|
436
|
+
"{",
|
|
437
|
+
` "round_id": ${JSON.stringify(roundId)},`,
|
|
438
|
+
' "findings": [',
|
|
439
|
+
" {",
|
|
440
|
+
' "id": "DR-001",',
|
|
441
|
+
' "title": "Retry limit is enforced in two places that can disagree",',
|
|
442
|
+
` "category": "${CONCEPTUAL_FINDING_CATEGORIES[0]}",`,
|
|
443
|
+
' "severity": "high",',
|
|
444
|
+
' "confidence": "medium",',
|
|
445
|
+
` "lens": "${lensExample}",`,
|
|
446
|
+
' "summary": "detailed explanation of the observation and the recommended change",',
|
|
447
|
+
` "affected_files": [{"path": ${JSON.stringify(examplePathValue)}}],`,
|
|
448
|
+
' "systemic": true',
|
|
449
|
+
" }",
|
|
450
|
+
" ],",
|
|
451
|
+
' "candidate_dispositions": [',
|
|
452
|
+
" {",
|
|
453
|
+
` "candidate_id": ${JSON.stringify(`${perspective}::DR-004`)},`,
|
|
454
|
+
` "contributor_id": ${JSON.stringify(perspective)},`,
|
|
455
|
+
' "source_finding_id": "DR-004",',
|
|
456
|
+
' "disposition": "retained",',
|
|
457
|
+
' "target_final_finding_ids": ["DR-001"],',
|
|
458
|
+
' "modification_percent": 20,',
|
|
459
|
+
' "rationale": "kept the observation, tightened the statement of the disagreement",',
|
|
460
|
+
' "verification_status": "judge_confirmed",',
|
|
461
|
+
' "verification_note": "read both enforcement sites and confirmed they read different constants"',
|
|
462
|
+
" }",
|
|
463
|
+
" ],",
|
|
464
|
+
' "final_finding_shares": [',
|
|
465
|
+
" {",
|
|
466
|
+
' "final_finding_id": "DR-001",',
|
|
467
|
+
' "contributors": [',
|
|
468
|
+
" {",
|
|
469
|
+
` "contributor_id": ${JSON.stringify(perspective)},`,
|
|
470
|
+
` "source_candidate_ids": [${JSON.stringify(`${perspective}::DR-004`)}],`,
|
|
471
|
+
' "contribution_percent": 80,',
|
|
472
|
+
' "rationale": "raised the observation and supplied both call sites"',
|
|
473
|
+
" },",
|
|
474
|
+
" {",
|
|
475
|
+
' "contributor_id": "design_review_conceptual",',
|
|
476
|
+
' "source_candidate_ids": [],',
|
|
477
|
+
' "contribution_percent": 20,',
|
|
478
|
+
' "rationale": "verified the defect at HEAD and sharpened the title"',
|
|
479
|
+
" }",
|
|
480
|
+
" ]",
|
|
481
|
+
" }",
|
|
482
|
+
" ]",
|
|
483
|
+
"}",
|
|
484
|
+
"```",
|
|
485
|
+
"",
|
|
486
|
+
`Write the literal value, never the list of permitted ones. \`category\` is one of: ${CONCEPTUAL_FINDING_CATEGORIES.join(", ")}. ` +
|
|
487
|
+
"`severity` is one of: critical, high, medium, low, info. `confidence` is one of: high, medium, low. " +
|
|
488
|
+
"`disposition` is one of: retained, merged, rejected. `verification_status` is one of: " +
|
|
489
|
+
"judge_confirmed, asserted, refuted_at_head. `affected_files` cites a real path from the file " +
|
|
490
|
+
"inventory above.",
|
|
491
|
+
"",
|
|
492
|
+
"All four top-level keys are REQUIRED and no others are permitted. The submission is parsed whole: " +
|
|
493
|
+
"a missing key, an extra key, or one finding that fails the contract refuses the entire merge " +
|
|
494
|
+
"round, and the round's work is lost.",
|
|
495
|
+
"",
|
|
496
|
+
"Do NOT supply `verification_status`, `evidence_lane` or `lead_lineage` ON A FINDING. The tool " +
|
|
497
|
+
"derives all three at ingestion. The `verification_status` above belongs to a CANDIDATE " +
|
|
498
|
+
"DISPOSITION, which is yours to state.",
|
|
362
499
|
];
|
|
363
500
|
}
|
|
364
501
|
export const CONCEPTUAL_FINDING_CATEGORIES = [
|
|
@@ -371,16 +508,27 @@ export const CONCEPTUAL_FINDING_CATEGORIES = [
|
|
|
371
508
|
"integration",
|
|
372
509
|
"missing_capability",
|
|
373
510
|
];
|
|
374
|
-
/**
|
|
375
|
-
|
|
511
|
+
/**
|
|
512
|
+
* Shared finding-output-format block for any conceptual-review prompt.
|
|
513
|
+
*
|
|
514
|
+
* `exampleLines` is the worked example itself, because the judge's envelope is
|
|
515
|
+
* not the perspectives'. The judge submission carries three required top-level
|
|
516
|
+
* keys the others do not — `round_id`, `candidate_dispositions` and
|
|
517
|
+
* `final_finding_shares` — and `ConceptualJudgeSubmissionSchema` is `.strict()`,
|
|
518
|
+
* so the findings-only envelope every pass used to show failed the judge's own
|
|
519
|
+
* parse with three `Required` issues. The prose above it stated all three; the
|
|
520
|
+
* example a host copies contradicted the prose, and the whole merge round was
|
|
521
|
+
* quarantined (owner decision, 2026-09-17).
|
|
522
|
+
*/
|
|
523
|
+
function conceptualOutputFormat(resultsPathNote, exampleLines) {
|
|
376
524
|
return [
|
|
377
525
|
"## Output format",
|
|
378
526
|
"",
|
|
379
|
-
"Produce
|
|
527
|
+
"Produce ONE JSON object in exactly this shape. Every entry in `findings` must conform to the contract shown:",
|
|
380
528
|
"",
|
|
381
|
-
...
|
|
529
|
+
...exampleLines,
|
|
382
530
|
"",
|
|
383
|
-
|
|
531
|
+
GROUND_EVERY_FINDING,
|
|
384
532
|
"",
|
|
385
533
|
resultsPathNote,
|
|
386
534
|
"",
|
|
@@ -548,7 +696,14 @@ export function renderContractReviewPrompt(bundle, options = {}) {
|
|
|
548
696
|
"",
|
|
549
697
|
"Produce a JSON object with a top-level `findings` array. Each finding in that array must conform to:",
|
|
550
698
|
"",
|
|
551
|
-
...findingsEnvelopeExample(
|
|
699
|
+
...findingsEnvelopeExample(CONTRACT_FINDING_CATEGORIES, exampleLens(options), examplePath(bundle)),
|
|
700
|
+
"",
|
|
701
|
+
// The grounding rule is stated here as well as in `conceptualOutputFormat`
|
|
702
|
+
// because the contract pass IS grounded: `nextStepHelpers` runs
|
|
703
|
+
// `groundDesignFindings` over `contract_findings` exactly as it does over
|
|
704
|
+
// the conceptual ones. The rule was stated to the conceptual reviewer only,
|
|
705
|
+
// so the contract reviewer was judged by a rule it was never told.
|
|
706
|
+
GROUND_EVERY_FINDING,
|
|
552
707
|
"",
|
|
553
708
|
// Where the object goes (and what to do when this lane cannot write files)
|
|
554
709
|
// is stated once, by the lane materializer's results-path footer.
|
|
@@ -581,7 +736,7 @@ export function renderConceptualReviewPrompt(bundle, options = {}) {
|
|
|
581
736
|
...renderLensScope(options),
|
|
582
737
|
...(charterContext ? [charterContext] : []),
|
|
583
738
|
...conceptualCritiqueInstructions(),
|
|
584
|
-
...conceptualOutputFormat("Use finding IDs starting with DR-001.", exampleLens(options)),
|
|
739
|
+
...conceptualOutputFormat("Use finding IDs starting with DR-001.", findingsEnvelopeExample(CONCEPTUAL_FINDING_CATEGORIES, exampleLens(options), examplePath(bundle))),
|
|
585
740
|
].join("\n");
|
|
586
741
|
}
|
|
587
742
|
/**
|
|
@@ -611,7 +766,7 @@ export function renderConceptualPerspectivePrompt(bundle, perspective, index, to
|
|
|
611
766
|
...renderLensScope(options),
|
|
612
767
|
...(charterContext ? [charterContext] : []),
|
|
613
768
|
...conceptualCritiqueInstructions(),
|
|
614
|
-
...conceptualOutputFormat("Report findings *from your perspective only*. Use finding IDs starting with DR-001.", exampleLens(options)),
|
|
769
|
+
...conceptualOutputFormat("Report findings *from your perspective only*. Use finding IDs starting with DR-001.", findingsEnvelopeExample(CONCEPTUAL_FINDING_CATEGORIES, exampleLens(options), examplePath(bundle))),
|
|
615
770
|
].join("\n");
|
|
616
771
|
}
|
|
617
772
|
/**
|
|
@@ -659,7 +814,7 @@ export function renderConceptualJudgePrompt(bundle, perspectiveResults, roundId,
|
|
|
659
814
|
"- **State what you verified, per candidate.** Every candidate carries a `verification_status`: `judge_confirmed` (you checked the named defect against the current code and it holds), `asserted` (you did not check), or `refuted_at_head` (you checked and it is absent or already fixed). A `judge_confirmed` or `refuted_at_head` candidate ALSO carries a `verification_note` saying what you checked and what you found; an `asserted` candidate must NOT carry one. `asserted` is the honest default — do not claim a check you did not perform.",
|
|
660
815
|
"- **Attribute every final finding.** Allocate contributor shares totaling exactly 100%. Each contributor appears exactly once per final finding: when several of that contributor's candidates feed the same finding, put all their IDs in one `source_candidate_ids` array and allocate one combined share. Perspective shares cite their candidate IDs. Include exactly one explicit `design_review_conceptual` judge share (zero is allowed when the judge only selected unchanged work; positive when the judge added or materially synthesized content). State a rationale for every share.",
|
|
661
816
|
`- Set top-level \`round_id\` to exactly \`${roundId}\`. In the SAME top-level object as \`findings\`, include \`candidate_dispositions\` entries with \`candidate_id\`, \`contributor_id\`, \`source_finding_id\`, \`disposition\`, \`target_final_finding_ids\`, \`modification_percent\`, \`rationale\`, \`verification_status\`, and \`verification_note\` (only when the status is not \`asserted\`); and \`final_finding_shares\` entries with \`final_finding_id\` plus \`contributors\`, each carrying \`contributor_id\`, \`source_candidate_ids\`, \`contribution_percent\`, and \`rationale\`.`,
|
|
662
|
-
...conceptualOutputFormat("Produce ONE merged, ranked object. Renumber finding IDs sequentially from DR-001.", exampleLens(options)),
|
|
817
|
+
...conceptualOutputFormat("Produce ONE merged, ranked object. Renumber finding IDs sequentially from DR-001.", judgeEnvelopeExample(roundId, perspectiveResults.map((p) => p.contributor_id), exampleLens(options), examplePath(bundle))),
|
|
663
818
|
].join("\n");
|
|
664
819
|
}
|
|
665
820
|
//# sourceMappingURL=designReviewPrompt.js.map
|