audit-tools 0.55.16 → 0.55.17
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/confirmIntentStep.d.ts.map +1 -1
- package/dist/audit/cli/confirmIntentStep.js +0 -1
- package/dist/audit/cli/confirmIntentStep.js.map +1 -1
- package/dist/audit/cli/dispatch/hostHandoff.d.ts +22 -1
- package/dist/audit/cli/dispatch/hostHandoff.d.ts.map +1 -1
- package/dist/audit/cli/dispatch/hostHandoff.js +164 -68
- package/dist/audit/cli/dispatch/hostHandoff.js.map +1 -1
- package/dist/audit/cli/submitCommand.d.ts +26 -0
- package/dist/audit/cli/submitCommand.d.ts.map +1 -0
- package/dist/audit/cli/submitCommand.js +79 -0
- package/dist/audit/cli/submitCommand.js.map +1 -0
- package/dist/audit/cli.d.ts.map +1 -1
- package/dist/audit/cli.js +4 -1
- package/dist/audit/cli.js.map +1 -1
- package/dist/audit/contracts/findingContractPrompt.d.ts +229 -0
- package/dist/audit/contracts/findingContractPrompt.d.ts.map +1 -1
- package/dist/audit/contracts/findingContractPrompt.js +31 -20
- package/dist/audit/contracts/findingContractPrompt.js.map +1 -1
- package/dist/audit/extractors/graph.d.ts +1 -1
- package/dist/audit/extractors/graph.js +1 -1
- package/dist/audit/extractors/pathPatterns.d.ts +3 -0
- package/dist/audit/extractors/pathPatterns.d.ts.map +1 -1
- package/dist/audit/extractors/pathPatterns.js +9 -4
- package/dist/audit/extractors/pathPatterns.js.map +1 -1
- package/dist/audit/extractors/surfaces.d.ts.map +1 -1
- package/dist/audit/extractors/surfaces.js +6 -1
- package/dist/audit/extractors/surfaces.js.map +1 -1
- package/dist/audit/orchestrator/unitBuilder.d.ts.map +1 -1
- package/dist/audit/orchestrator/unitBuilder.js +29 -8
- package/dist/audit/orchestrator/unitBuilder.js.map +1 -1
- package/dist/audit/reporting/criticalFlowFallbackPrompt.d.ts +6 -0
- package/dist/audit/reporting/criticalFlowFallbackPrompt.d.ts.map +1 -1
- package/dist/audit/reporting/criticalFlowFallbackPrompt.js +55 -34
- package/dist/audit/reporting/criticalFlowFallbackPrompt.js.map +1 -1
- package/dist/remediate/index.d.ts.map +1 -1
- package/dist/remediate/index.js +44 -0
- package/dist/remediate/index.js.map +1 -1
- package/dist/remediate/steps/dispatch/hostHandoff.d.ts +29 -0
- package/dist/remediate/steps/dispatch/hostHandoff.d.ts.map +1 -1
- package/dist/remediate/steps/dispatch/hostHandoff.js +63 -4
- package/dist/remediate/steps/dispatch/hostHandoff.js.map +1 -1
- package/dist/remediate/steps/submitResult.d.ts +13 -0
- package/dist/remediate/steps/submitResult.d.ts.map +1 -0
- package/dist/remediate/steps/submitResult.js +24 -0
- package/dist/remediate/steps/submitResult.js.map +1 -0
- package/dist/shared/index.d.ts +1 -1
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +1 -1
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/mcp/submitServer.d.ts +26 -0
- package/dist/shared/mcp/submitServer.d.ts.map +1 -0
- package/dist/shared/mcp/submitServer.js +74 -0
- package/dist/shared/mcp/submitServer.js.map +1 -0
- package/dist/shared/submission/hostHandoffCore.d.ts +10 -0
- package/dist/shared/submission/hostHandoffCore.d.ts.map +1 -1
- package/dist/shared/submission/hostHandoffCore.js +19 -0
- package/dist/shared/submission/hostHandoffCore.js.map +1 -1
- package/dist/shared/submission/submissionClassifier.d.ts +7 -0
- package/dist/shared/submission/submissionClassifier.d.ts.map +1 -1
- package/dist/shared/submission/submissionClassifier.js +9 -0
- package/dist/shared/submission/submissionClassifier.js.map +1 -1
- package/dist/shared/submission/submissionScan.d.ts +7 -0
- package/dist/shared/submission/submissionScan.d.ts.map +1 -1
- package/dist/shared/submission/submissionScan.js +6 -2
- package/dist/shared/submission/submissionScan.js.map +1 -1
- package/package.json +2 -1
- package/scripts/audit/postinstall.mjs +21 -7
- package/scripts/remediate/postinstall.mjs +44 -1
- package/scripts/shared/install-host-assets.mjs +134 -1
- package/wrapper/audit-code-wrapper-lib.mjs +9 -46
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirmIntentStep.d.ts","sourceRoot":"","sources":["../../../src/audit/cli/confirmIntentStep.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAyB,MAAM,6CAA6C,CAAC;AAYzG;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,aAAa,CAAC,EAAE,MAAM,EACtB,cAAc,CAAC,EAAE,MAAM,EACvB,SAAS,GAAE,cAAc,CAAC,MAAM,CAAU,GACzC,SAAS,GAAG,MAAM,CAUpB;AAwBD;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,cAAc,EACzB,IAAI,EAAE;IACJ,oBAAoB,EAAE,MAAM,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB;;;;;;OAMG;IACH,2BAA2B,CAAC,EAAE,KAAK,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,mBAAmB,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtG,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GACA,MAAM,
|
|
1
|
+
{"version":3,"file":"confirmIntentStep.d.ts","sourceRoot":"","sources":["../../../src/audit/cli/confirmIntentStep.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAyB,MAAM,6CAA6C,CAAC;AAYzG;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,aAAa,CAAC,EAAE,MAAM,EACtB,cAAc,CAAC,EAAE,MAAM,EACvB,SAAS,GAAE,cAAc,CAAC,MAAM,CAAU,GACzC,SAAS,GAAG,MAAM,CAUpB;AAwBD;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,cAAc,EACzB,IAAI,EAAE;IACJ,oBAAoB,EAAE,MAAM,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB;;;;;;OAMG;IACH,2BAA2B,CAAC,EAAE,KAAK,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,mBAAmB,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtG,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GACA,MAAM,CAySR"}
|
|
@@ -57,7 +57,6 @@ const SCOPE_GUARD_GLOSS = {
|
|
|
57
57
|
*/
|
|
58
58
|
export function renderConfirmIntentPrompt(preDigest, opts) {
|
|
59
59
|
const dirLines = preDigest.scope_dirs
|
|
60
|
-
.slice(0, 20)
|
|
61
60
|
.map((d) => `- \`${d.dir}\` — ${d.files} file(s)`)
|
|
62
61
|
.join("\n") || "_(none)_";
|
|
63
62
|
// Render collapsed excluded-scope summary
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirmIntentStep.js","sourceRoot":"","sources":["../../../src/audit/cli/confirmIntentStep.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACjG,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACL,uBAAuB,EACvB,+BAA+B,GAChC,MAAM,uCAAuC,CAAC;AAG/C,SAAS,eAAe,CAAC,GAAuC;IAC9D,OAAO,QAAQ,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC;AACrD,CAAC;AAED,0EAA0E;AAC1E,6EAA6E;AAC7E,2EAA2E;AAC3E,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAEnC;;;;GAIG;AACH,MAAM,UAAU,s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ACF,SAAS;QACT,GAAG;QACH,6CAA6C;QAC7C,2CAA2C;QAC3C,2BAA2B;QAC3B,0CAA0C;QAC1C,uEAAuE;QACvE,wJAAwJ;QACxJ,2EAA2E;QAC3E,oEAAoE;QACpE,+CAA+C;QAC/C,GAAG,CAAC,kBAAkB;YACpB,CAAC,CAAC;gBACE,6NAA6N;aAC9N;YACH,CAAC,CAAC,EAAE,CAAC;QACP,0EAA0E;QAC1E,iCAAiC;QACjC,+DAA+D,2BAA2B,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,2BAA2B;QACvI,uEAAuE;QACvE,yEAAyE;QACzE,sEAAsE;QACtE,2EAA2E;QAC3E,6GAA6G,aAAa,IACxH,aAAa,KAAK,MAAM,CAAC,CAAC,CAAC,qBAAqB,+BAA+B,EAAE,CAAC,CAAC,CAAC,EACtF,IAAI;QACJ,GAAG;QACH,KAAK;QACL,EAAE;QACF,GAAG,CAAC,kBAAkB;YACpB,CAAC,CAAC;gBACE,8EAA8E;gBAC9E,4EAA4E;gBAC5E,gFAAgF;gBAChF,iFAAiF;gBACjF,6EAA6E;gBAC7E,kCAAkC;aACnC;YACH,CAAC,CAAC,EAAE,CAAC;QACP,6EAA6E;QAC7E,qEAAqE;QACrE,8BAA8B;QAC9B,wEAAwE;QACxE,kEAAkE;QAClE,+EAA+E;QAC/E,8EAA8E;QAC9E,mEAAmE;QACnE,+EAA+E;QAC/E,4EAA4E;QAC5E,6EAA6E;QAC7E,sEAAsE;QACtE,wEAAwE;QACxE,wFAAwF;QACxF,oEAAoE;QACpE,qEAAqE;QACrE,EAAE;QACF,aAAa,IAAI,CAAC,eAAe,EAAE;QACnC,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -2,7 +2,7 @@ import type { ArtifactBundle } from "../../io/artifacts.js";
|
|
|
2
2
|
import { type LaneDemand, type RunLogger } from "audit-tools/shared";
|
|
3
3
|
import { type AuditResult, type AuditTask } from "../../types.js";
|
|
4
4
|
import type { AuditHostIngestIssue } from "../../validation/ingestIssueCodes.js";
|
|
5
|
-
declare const WORKLOAD_CONTRACT_VERSION: "audit-host-workload/
|
|
5
|
+
declare const WORKLOAD_CONTRACT_VERSION: "audit-host-workload/v1alpha6";
|
|
6
6
|
declare const RESULT_MAP_CONTRACT_VERSION: "audit-host-result-map/v1alpha1";
|
|
7
7
|
export interface AuditHostTask {
|
|
8
8
|
readonly task_id: string;
|
|
@@ -200,6 +200,27 @@ export declare function checkAuditHostResult(params: {
|
|
|
200
200
|
readonly auditTasks: readonly AuditTask[];
|
|
201
201
|
readonly lineIndex?: Record<string, number>;
|
|
202
202
|
}): Promise<AuditHostResultCheck>;
|
|
203
|
+
/**
|
|
204
|
+
* Judge a submitted result for one work item of the CURRENT run and, only when
|
|
205
|
+
* ingestion would accept it, write it atomically to that item's bound result
|
|
206
|
+
* path (decision 4, 2026-11-06). The reader never names a path: the tool
|
|
207
|
+
* derives it from the work-item id. A refused result writes nothing, and the
|
|
208
|
+
* report carries the same refusal ingestion would give, so the reader fixes
|
|
209
|
+
* the document and submits again. No lock is held: the write is the one a
|
|
210
|
+
* reader made before, and the next-step fold still ingests the file under the
|
|
211
|
+
* artifact-tree lock. Bindings are read on every call, never cached, so an item
|
|
212
|
+
* a re-plan retired fails with the classified refusal.
|
|
213
|
+
*/
|
|
214
|
+
export declare function submitAuditHostResult(params: {
|
|
215
|
+
readonly root: string;
|
|
216
|
+
readonly sourceRoot: string;
|
|
217
|
+
readonly artifactsDir: string;
|
|
218
|
+
readonly workItemId: string;
|
|
219
|
+
/** The submitted document's text, written byte-exact when it is accepted. */
|
|
220
|
+
readonly source: string;
|
|
221
|
+
readonly auditTasks: readonly AuditTask[];
|
|
222
|
+
readonly lineIndex?: Record<string, number>;
|
|
223
|
+
}): Promise<AuditHostResultCheck>;
|
|
203
224
|
/** The set-level scheduling facts beside a published workload. */
|
|
204
225
|
declare const COHERENCE_GROUPS_CONTRACT_VERSION: "audit-host-coherence-groups/v1alpha1";
|
|
205
226
|
export interface AuditHostCoherenceGroup {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hostHandoff.d.ts","sourceRoot":"","sources":["../../../../src/audit/cli/dispatch/hostHandoff.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAQ5D,OAAO,
|
|
1
|
+
{"version":3,"file":"hostHandoff.d.ts","sourceRoot":"","sources":["../../../../src/audit/cli/dispatch/hostHandoff.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAQ5D,OAAO,EA4CL,KAAK,UAAU,EACf,KAAK,SAAS,EAEf,MAAM,oBAAoB,CAAC;AAQ5B,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,SAAS,EACf,MAAM,gBAAgB,CAAC;AAUxB,OAAO,KAAK,EACV,oBAAoB,EAErB,MAAM,sCAAsC,CAAC;AA8C9C,QAAA,MAAM,yBAAyB,EAAG,8BAAuC,CAAC;AAC1E,QAAA,MAAM,2BAA2B,EAAG,gCAAyC,CAAC;AA0E9E,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC5D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CA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;;;GAYG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE;IAChD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,wBAAwB;IACxB,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IACvB,sDAAsD;IACtD,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;CAC7B,GAAG,OAAO,CAAC;IAAE,QAAQ,CAAC,qBAAqB,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC,CAyEjE"}
|
|
@@ -5,7 +5,7 @@ import { CURRENT_TASK_FILENAME } from "../../supervisor/operatorHandoff.js";
|
|
|
5
5
|
import { mkdir } from "node:fs/promises";
|
|
6
6
|
import { join, relative, resolve } from "node:path";
|
|
7
7
|
import { lensDefinition } from "../../types.js";
|
|
8
|
-
import { createMemoizedSourceReader, enumerateTrackedFilePaths, deriveLaneDemand, appendSubmissionEvent, assertSubmissionRunId, SUBMISSION_LEDGER_EVENT_CONTRACT_VERSION, bindingIdentity, compareCodeUnits, contentSha256, firstDuplicateIdentity, hasExactKeys, hostHandoffResultPath, identityFailureDiagnostic, isFileMissingError, isJsonParseError, isRecord, isSha256, LaneDemandSchema, parseAllWorkloadItems, parseWorkloadEnvelope, bindWorkerPrompt, deriveResultId, workerPromptBindingHolds, enrichMissingSubmissionIssues, readTrailingSubmissionRefusals, readJsonFile, repoRelativePath, requireNonEmptyString, resolveContainedPath, resolveHostHandoffPaths, resultMapIdentity, scanBoundSubmission, siblingLockPath, sameStrings, stableStringify, groundFinding, withFileLock, writeBlockedStepContract, writeJsonFile, toPosixPath, } from "audit-tools/shared";
|
|
8
|
+
import { createMemoizedSourceReader, enumerateTrackedFilePaths, deriveLaneDemand, appendSubmissionEvent, assertSubmissionRunId, SUBMISSION_LEDGER_EVENT_CONTRACT_VERSION, bindingIdentity, compareCodeUnits, contentSha256, firstDuplicateIdentity, hasExactKeys, hostHandoffResultPath, workerPromptPath, identityFailureDiagnostic, isFileMissingError, isJsonParseError, isRecord, isSha256, LaneDemandSchema, parseAllWorkloadItems, parseWorkloadEnvelope, bindWorkerPrompt, deriveResultId, workerPromptBindingHolds, enrichMissingSubmissionIssues, readTrailingSubmissionRefusals, readJsonFile, repoRelativePath, requireNonEmptyString, resolveContainedPath, resolveHostHandoffPaths, resultMapIdentity, scanBoundSubmission, siblingLockPath, sameStrings, stableStringify, groundFinding, withFileLock, writeBlockedStepContract, writeTextFile, writeJsonFile, toPosixPath, } from "audit-tools/shared";
|
|
9
9
|
import { findingContractPromptLines } from "../../contracts/findingContractPrompt.js";
|
|
10
10
|
import { WORKER_REFUSED_FINDING_VERDICTS, WORKER_REFUSED_LOCATION_FIELDS, WorkerFindingSchema, } from "../../contracts/workerSchemas.js";
|
|
11
11
|
import { AuditResultSchema, AuditTaskSchema, } from "../../types.js";
|
|
@@ -51,7 +51,12 @@ import { buildTaskCoherencePartition } from "../../orchestrator/partitionTaskGra
|
|
|
51
51
|
// the result path ABSOLUTE, so the persisted template a work item is checked
|
|
52
52
|
// against changed shape. A v1alpha4 document refuses closed as stale — the same
|
|
53
53
|
// `next-step` re-prepares it.
|
|
54
|
-
|
|
54
|
+
//
|
|
55
|
+
// v1alpha6 (decision 5 of the 2026-11-06 dogfood audit): each fact stated once.
|
|
56
|
+
// The template no longer names the path (line 2 of the body does), and its
|
|
57
|
+
// wording depends on the lane, so the persisted template changed shape again. A
|
|
58
|
+
// v1alpha5 document refuses closed as stale — the same `next-step` re-prepares it.
|
|
59
|
+
const WORKLOAD_CONTRACT_VERSION = "audit-host-workload/v1alpha6";
|
|
55
60
|
const RESULT_MAP_CONTRACT_VERSION = "audit-host-result-map/v1alpha1";
|
|
56
61
|
const RESULT_CONTRACT_VERSION = "audit-host-result/v1alpha1";
|
|
57
62
|
/**
|
|
@@ -369,30 +374,13 @@ function isVerificationLane(tags) {
|
|
|
369
374
|
return tags?.includes(LENS_VERIFICATION_TAG) ?? false;
|
|
370
375
|
}
|
|
371
376
|
/**
|
|
372
|
-
* The
|
|
373
|
-
*
|
|
374
|
-
*
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
* The result path as a worker is told it: ABSOLUTE and forward-slashed. The
|
|
378
|
-
* persisted `result_path` is repository-relative (it is the binding's identity),
|
|
379
|
-
* and a relative path in a prompt resolves against whatever directory the
|
|
380
|
-
* worker runs in — a worker launched in its own directory wrote somewhere the
|
|
381
|
-
* ingest never reads. Stated absolute, the instruction is cwd-independent.
|
|
377
|
+
* The tail every work-item prompt ends with. The destination is NOT repeated
|
|
378
|
+
* here: line 2 of the body states it, once (decision 5, cut C1). The base lane's
|
|
379
|
+
* key set is stated by the template itself ("Keep exactly these keys", cut C2);
|
|
380
|
+
* the steward lane adds `verification`, so its body keeps the result-contract
|
|
381
|
+
* line and its tail does not claim an exact key set.
|
|
382
382
|
*/
|
|
383
|
-
function
|
|
384
|
-
// The drive letter is case-insensitive on every system that has one, so it is
|
|
385
|
-
// folded to ONE spelling: a run prepared as `c:/repo` and resumed as
|
|
386
|
-
// `C:/repo` must re-render the identical prompt, or its digest — and every
|
|
387
|
-
// result bound to it — would go stale for no change at all. A root that
|
|
388
|
-
// really moved still re-renders differently, and that binding failure is
|
|
389
|
-
// classified `workload_stale` (see `AuditHostBindingError`): the fold
|
|
390
|
-
// re-prepares under the new root.
|
|
391
|
-
return toPosixPath(resolve(root, resultPath)).replace(/^[a-z](?=:)/u, (letter) => letter.toUpperCase());
|
|
392
|
-
}
|
|
393
|
-
function renderResultTemplate(runId, workItemId,
|
|
394
|
-
/** Absolute, from {@link workerResultPath}. */
|
|
395
|
-
resultPath, promptDigest) {
|
|
383
|
+
function renderResultTemplate(runId, workItemId, promptDigest, verificationLane) {
|
|
396
384
|
const template = {
|
|
397
385
|
contract_version: RESULT_CONTRACT_VERSION,
|
|
398
386
|
result_id: deriveResultId(workItemId, promptDigest),
|
|
@@ -403,7 +391,9 @@ resultPath, promptDigest) {
|
|
|
403
391
|
findings: [],
|
|
404
392
|
};
|
|
405
393
|
return [
|
|
406
|
-
|
|
394
|
+
verificationLane
|
|
395
|
+
? "When you finish, submit this JSON as line 2 says. Keep the five identity values as they are. Fill in `file_coverage` and `findings`:"
|
|
396
|
+
: "When you finish, submit this JSON as line 2 says. Keep exactly these keys, and keep the five identity values as they are. Fill in `file_coverage` and `findings`:",
|
|
407
397
|
"```json",
|
|
408
398
|
JSON.stringify(template, null, 2),
|
|
409
399
|
"```",
|
|
@@ -428,23 +418,13 @@ function lensGuidanceLines(lens) {
|
|
|
428
418
|
`Do not report under this lens: ${definition.do_not_report}`,
|
|
429
419
|
];
|
|
430
420
|
}
|
|
431
|
-
function buildPrompt(task,
|
|
421
|
+
function buildPrompt(task, destination, workloadPath, sourceRoot) {
|
|
432
422
|
// A `"selective"` lane's file list is NOT inlined. Its assignment is the whole
|
|
433
423
|
// surface its lens was applied to, which runs to hundreds of files on a real
|
|
434
424
|
// run, so inlining it would make the prompt mostly a path list and the prompt
|
|
435
425
|
// DIGEST a function of the surface's size. The list and its per-file metrics
|
|
436
426
|
// ride the workload the tool already writes, and the prompt names where.
|
|
437
427
|
const selective = task.coverage_policy === "selective";
|
|
438
|
-
const assignment = stableStringify({
|
|
439
|
-
...(selective
|
|
440
|
-
? { surface_file_count: task.file_paths.length }
|
|
441
|
-
: { file_line_counts: task.file_line_counts, files: task.file_paths }),
|
|
442
|
-
lens: task.lens,
|
|
443
|
-
pass_id: task.pass_id,
|
|
444
|
-
rationale: task.rationale,
|
|
445
|
-
task_id: task.task_id,
|
|
446
|
-
unit_id: task.unit_id,
|
|
447
|
-
});
|
|
448
428
|
// LANE-AWARE, because the two lanes' contracts genuinely differ: the steward
|
|
449
429
|
// lane is INSTRUCTED (by its task rationale) to return verification metadata,
|
|
450
430
|
// and the base lane is not. Rendering one envelope sentence for both would
|
|
@@ -453,14 +433,27 @@ function buildPrompt(task, resultPath, workloadPath, sourceRoot) {
|
|
|
453
433
|
// demands. The ask and the envelope are the same fact, so they are stated
|
|
454
434
|
// from the same predicate.
|
|
455
435
|
const verificationLane = isVerificationLane(task.tags);
|
|
436
|
+
// Each fact once (decision 5): `file_line_counts` already names every file
|
|
437
|
+
// (cut C3), and the base lane's reader uses neither `task_id` (the template's
|
|
438
|
+
// `work_item_id`) nor `pass_id` (`pass:<lens>`) (cut C4). The steward keeps
|
|
439
|
+
// both: each of its `verification.followup_tasks` entries must carry them.
|
|
440
|
+
const assignment = stableStringify({
|
|
441
|
+
...(selective
|
|
442
|
+
? { surface_file_count: task.file_paths.length }
|
|
443
|
+
: { file_line_counts: task.file_line_counts }),
|
|
444
|
+
lens: task.lens,
|
|
445
|
+
...(verificationLane ? { pass_id: task.pass_id, task_id: task.task_id } : {}),
|
|
446
|
+
rationale: task.rationale,
|
|
447
|
+
unit_id: task.unit_id,
|
|
448
|
+
});
|
|
456
449
|
return [
|
|
457
450
|
"Perform the bounded semantic audit work item below.",
|
|
458
451
|
// THE DESTINATION FIRST, on its own line. It used to be one field inside a
|
|
459
452
|
// single long JSON blob, which buries the one fact a reader must not have to
|
|
460
453
|
// search for: a result written anywhere else is never ingested.
|
|
461
|
-
// ABSOLUTE (`
|
|
454
|
+
// ABSOLUTE (`workerPromptPath`): the worker's working directory is the
|
|
462
455
|
// host's choice, so no path here may depend on it.
|
|
463
|
-
|
|
456
|
+
destination,
|
|
464
457
|
// WHERE TO READ, stated rather than left to the host's working directory:
|
|
465
458
|
// the run audits a frozen snapshot, and the live tree may have moved since
|
|
466
459
|
// the run started. Line counts and cited text are checked against this tree.
|
|
@@ -485,23 +478,41 @@ function buildPrompt(task, resultPath, workloadPath, sourceRoot) {
|
|
|
485
478
|
assignment,
|
|
486
479
|
"```",
|
|
487
480
|
...lensGuidanceLines(task.lens),
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
481
|
+
// `verification` is REQUIRED on the steward lane, and the prompt states ONE
|
|
482
|
+
// rule. It used to say "exactly … and verification" and then call the field
|
|
483
|
+
// optional, which is a contradiction a reader cannot obey both halves of.
|
|
484
|
+
// Required is the honest reading: a steward returns `findings: []`, so a
|
|
485
|
+
// steward with no `verification` carries no answer at all and is
|
|
486
|
+
// indistinguishable from a lane that failed. The base lane has no such
|
|
487
|
+
// line: its template states the exact key set (decision 5, cut C2).
|
|
488
|
+
...(verificationLane
|
|
489
|
+
? ["Result contract: audit-host-result/v1alpha1 with exactly result_id, run_id, work_item_id, prompt_sha256, file_coverage, findings, and verification in addition to contract_version. On this lane verification is REQUIRED."]
|
|
490
|
+
: []),
|
|
497
491
|
"Each file_coverage entry must contain exactly path, reviewed_lines, and total_lines.",
|
|
498
492
|
// The finding contract is CARRIED, not referenced: it is rendered from the
|
|
499
493
|
// very schema ingestion enforces, so a host never has to remember or fetch it.
|
|
500
494
|
...findingContractPromptLines(),
|
|
501
|
-
"
|
|
495
|
+
"Never supply a `grounding` field: the tool computes it at ingest from your quoted_text.",
|
|
502
496
|
...(verificationLane ? verificationContractPromptLines() : []),
|
|
497
|
+
// Stated ONCE, last, so it covers every rule above it (decision 5, cut C7).
|
|
498
|
+
"A result that breaks any rule above is rejected whole.",
|
|
503
499
|
].join("\n");
|
|
504
500
|
}
|
|
501
|
+
/**
|
|
502
|
+
* Line 2 of every work-item prompt: how the result reaches the tool, and the one
|
|
503
|
+
* statement of the absolute destination (owner decision, 2026-11-07). The
|
|
504
|
+
* submit tool comes first because it checks the result before it writes it, and
|
|
505
|
+
* it needs the root and the work-item id, so the line states both. The file path
|
|
506
|
+
* stays as the fallback for a host without the tool. A shell is excluded by
|
|
507
|
+
* name: the dogfood audit lost a backslash in a quoted span that way.
|
|
508
|
+
*/
|
|
509
|
+
function destinationLine(root, workItemId, resultPath) {
|
|
510
|
+
return (`Submit one JSON object with the submit_result tool (root: ${workerPromptPath(root, ".")}, work_item_id: ${workItemId}). ` +
|
|
511
|
+
`If you do not have that tool, write the object with a file-write tool to this exact absolute path: ${workerPromptPath(root, resultPath)}. ` +
|
|
512
|
+
"Do not write it through a shell.");
|
|
513
|
+
}
|
|
514
|
+
/** The first line of the steward's verification contract; only a steward body holds it. */
|
|
515
|
+
const VERIFICATION_CONTRACT_LEAD = "This work item is a LENS STEWARD VERIFICATION task, so it must also carry a `verification` object.";
|
|
505
516
|
/**
|
|
506
517
|
* The `verification` contract rendered into a steward-lane work item's prompt.
|
|
507
518
|
*
|
|
@@ -514,7 +525,7 @@ function buildPrompt(task, resultPath, workloadPath, sourceRoot) {
|
|
|
514
525
|
*/
|
|
515
526
|
function verificationContractPromptLines() {
|
|
516
527
|
return [
|
|
517
|
-
|
|
528
|
+
VERIFICATION_CONTRACT_LEAD,
|
|
518
529
|
`verification must contain exactly ${VERIFICATION_CONTRACT_KEYS.join(", ")} — all ${String(VERIFICATION_CONTRACT_KEYS.length)}, with no extra key: verified and needs_followup are booleans, concerns, coverage_concerns and confidence_concerns are arrays of non-empty strings (a genuine "nothing to report" is an empty array, not an omitted field), selection_rationale is a non-empty string, and followup_tasks is an array of objects.`,
|
|
519
530
|
"verification.selection_rationale states how you chose which surface files to open and which to leave: name the signals you followed and say what you decided was not worth opening. A file you did not open is not a coverage failure, but an unexplained choice is.",
|
|
520
531
|
`Each verification.followup_tasks entry must contain exactly ${VERIFICATION_FOLLOWUP_KEYS.join(", ")} — all ${String(VERIFICATION_FOLLOWUP_KEYS.length)}, with no extra key: file_paths is a non-empty array of non-empty repo-relative strings, each naming a file on THIS work item's assigned surface (scope.files) — a file you did not open is still on the surface and may be named; lens must be the lens of THIS task; task_id, unit_id, pass_id and rationale must be non-empty strings.`,
|
|
@@ -666,10 +677,9 @@ function verificationContractFailure(verification, binding, envelope) {
|
|
|
666
677
|
}
|
|
667
678
|
function buildWorkItem(paths, task) {
|
|
668
679
|
const resultPath = resultPathFor(paths, task.task_id);
|
|
669
|
-
const promptResultPath = workerResultPath(paths.root, resultPath);
|
|
670
680
|
// The SAME path the caller writes the workload to, so a selective lane is told
|
|
671
681
|
// where its surface actually is rather than where it is expected to be.
|
|
672
|
-
const prompt = bindWorkerPrompt(buildPrompt(task,
|
|
682
|
+
const prompt = bindWorkerPrompt(buildPrompt(task, destinationLine(paths.root, task.task_id, resultPath), paths.workloadPath, boundarySourceRoot(paths)), (digest) => renderResultTemplate(paths.runId, task.task_id, digest, isVerificationLane(task.tags)));
|
|
673
683
|
return {
|
|
674
684
|
id: task.task_id,
|
|
675
685
|
lens: task.lens,
|
|
@@ -896,7 +906,18 @@ function parseWorkItem(value, runId, root) {
|
|
|
896
906
|
!hasExactKeys(value.prompt, ["sha256", "text"]) ||
|
|
897
907
|
!isSha256(value.prompt.sha256) ||
|
|
898
908
|
typeof value.prompt.text !== "string" ||
|
|
899
|
-
!workerPromptBindingHolds({ text: value.prompt.text, sha256: value.prompt.sha256 },
|
|
909
|
+
!workerPromptBindingHolds({ text: value.prompt.text, sha256: value.prompt.sha256 },
|
|
910
|
+
// The lane is read from the digest-bound BODY: only a steward body states
|
|
911
|
+
// the verification contract, and the body cannot change without the digest.
|
|
912
|
+
(digest) => renderResultTemplate(runId, value.id, digest,
|
|
913
|
+
// A WHOLE line: a rationale is free text inside the assignment JSON, so a
|
|
914
|
+
// substring match would let it flip the lane.
|
|
915
|
+
value.prompt.text.split("\n").includes(VERIFICATION_CONTRACT_LEAD))) ||
|
|
916
|
+
// Line 2 states the absolute destination under the root the workload was
|
|
917
|
+
// prepared at. Re-derived under the CURRENT root, a root that really moved
|
|
918
|
+
// no longer matches, and the workload is refused as stale (see
|
|
919
|
+
// `workerPromptPath`) rather than sending readers to the old tree.
|
|
920
|
+
value.prompt.text.split("\n")[1] !== destinationLine(root, value.id, value.result_path) ||
|
|
900
921
|
!isRecord(value.scope) ||
|
|
901
922
|
!hasExactKeys(value.scope, [
|
|
902
923
|
"files",
|
|
@@ -1128,28 +1149,38 @@ function validateHandoffBinding(paths, workload, resultMap, taskBindings) {
|
|
|
1128
1149
|
}
|
|
1129
1150
|
return items;
|
|
1130
1151
|
}
|
|
1131
|
-
/**
|
|
1132
|
-
|
|
1152
|
+
/**
|
|
1153
|
+
* The run the current-review-run pointer names, or `undefined` when there is
|
|
1154
|
+
* no usable pointer. The pointer schema accepts strings; only the existing
|
|
1155
|
+
* run-id grammar may authorize a directory segment, so an unusable pointer is
|
|
1156
|
+
* not publication.
|
|
1157
|
+
*/
|
|
1158
|
+
async function readActiveRunId(artifactsDir) {
|
|
1133
1159
|
let run;
|
|
1134
1160
|
try {
|
|
1135
|
-
run = ActiveReviewRunSchema.safeParse(await readJsonFile(join(
|
|
1161
|
+
run = ActiveReviewRunSchema.safeParse(await readJsonFile(join(artifactsDir, "dispatch", CURRENT_TASK_FILENAME)));
|
|
1136
1162
|
}
|
|
1137
1163
|
catch (error) {
|
|
1138
1164
|
if (isFileMissingError(error) || isJsonParseError(error))
|
|
1139
|
-
return
|
|
1165
|
+
return undefined;
|
|
1140
1166
|
throw error;
|
|
1141
1167
|
}
|
|
1142
1168
|
if (!run.success)
|
|
1143
|
-
return
|
|
1144
|
-
// The pointer schema accepts strings; only the existing run-id grammar may
|
|
1145
|
-
// authorize a directory segment. An unusable pointer is not publication.
|
|
1169
|
+
return undefined;
|
|
1146
1170
|
try {
|
|
1147
1171
|
assertSubmissionRunId(run.data.run_id);
|
|
1148
1172
|
}
|
|
1149
1173
|
catch {
|
|
1150
|
-
return
|
|
1174
|
+
return undefined;
|
|
1151
1175
|
}
|
|
1152
|
-
|
|
1176
|
+
return run.data.run_id;
|
|
1177
|
+
}
|
|
1178
|
+
/** Snapshot current publication under its existing lock; release before planning. */
|
|
1179
|
+
export async function readPublishedAuditTaskIds(params) {
|
|
1180
|
+
const runId = await readActiveRunId(params.artifactsDir);
|
|
1181
|
+
if (runId === undefined)
|
|
1182
|
+
return new Set();
|
|
1183
|
+
const paths = resolveBoundaryPaths({ root: params.root, sourceRoot: params.sourceRoot, artifactsDir: params.artifactsDir, runId });
|
|
1153
1184
|
return withAcceptedResultsLock(paths, params.logger, async () => {
|
|
1154
1185
|
let items;
|
|
1155
1186
|
let bindings;
|
|
@@ -1525,6 +1556,7 @@ async function judgeAuditHostSubmission(params) {
|
|
|
1525
1556
|
resultId: (result) => result.result_id,
|
|
1526
1557
|
seen: params.seen,
|
|
1527
1558
|
messages: auditScanMessages(entry.work_item_id),
|
|
1559
|
+
source: params.source,
|
|
1528
1560
|
});
|
|
1529
1561
|
if (!outcome.ok)
|
|
1530
1562
|
return { ok: false, issue: outcome.issue };
|
|
@@ -1674,15 +1706,28 @@ export async function checkAuditHostResult(params) {
|
|
|
1674
1706
|
validation_warnings: [],
|
|
1675
1707
|
};
|
|
1676
1708
|
}
|
|
1677
|
-
const
|
|
1678
|
-
|
|
1679
|
-
const item = entry === undefined ? undefined : items.get(entry.work_item_id);
|
|
1680
|
-
const binding = entry === undefined ? undefined : taskBindings.get(entry.work_item_id);
|
|
1681
|
-
if (entry === undefined || item === undefined || binding === undefined) {
|
|
1709
|
+
const entry = bindingSet.resultMap.entries.find((candidate) => resolve(paths.root, candidate.result_path) === absolute);
|
|
1710
|
+
if (entry === undefined) {
|
|
1682
1711
|
throw new Error(`${toPosixPath(absolute)} is not the bound result path of any work item in run ${runId}. ` +
|
|
1683
1712
|
`Each work item in ${toPosixPath(paths.workloadPath)} names its own result_path; write the result there and validate that file.`);
|
|
1684
1713
|
}
|
|
1685
|
-
const
|
|
1714
|
+
const judged = await judgeBoundEntry({ ...params, paths, bindingSet, entry });
|
|
1715
|
+
return checkReport(runId, entry, judged);
|
|
1716
|
+
}
|
|
1717
|
+
/**
|
|
1718
|
+
* The judgment both doors share once a run's binding set and one of its entries
|
|
1719
|
+
* are resolved: the ledger read, the duplicate predicate, and the ONE
|
|
1720
|
+
* submission judgment. `source` carries `submit`'s in-memory document.
|
|
1721
|
+
*/
|
|
1722
|
+
async function judgeBoundEntry(params) {
|
|
1723
|
+
const { paths, bindingSet, entry } = params;
|
|
1724
|
+
const item = bindingSet.items.get(entry.work_item_id);
|
|
1725
|
+
const binding = bindingSet.taskBindings.get(entry.work_item_id);
|
|
1726
|
+
if (item === undefined || binding === undefined) {
|
|
1727
|
+
throw new Error(`work item '${entry.work_item_id}' has a result path in run ${paths.runId} but no work item or task binding; ` +
|
|
1728
|
+
"run next-step to publish a current workload.");
|
|
1729
|
+
}
|
|
1730
|
+
const accepted = await loadAcceptedResults(paths.acceptedLedgerPath, paths.runId);
|
|
1686
1731
|
const alreadyAccepted = accepted.entries.some((candidate) => bindingIdentity(candidate) === bindingIdentity(entry));
|
|
1687
1732
|
// An accepted binding's own id is not a duplicate of itself: the check judges
|
|
1688
1733
|
// the bytes, and says separately that ingestion will not re-read them.
|
|
@@ -1701,7 +1746,11 @@ export async function checkAuditHostResult(params) {
|
|
|
1701
1746
|
lineIndex: params.lineIndex,
|
|
1702
1747
|
readSource: createMemoizedSourceReader(),
|
|
1703
1748
|
knownPaths: async () => (knownPaths ??= await enumerateTrackedFilePaths(boundarySourceRoot(paths))),
|
|
1749
|
+
source: params.source,
|
|
1704
1750
|
});
|
|
1751
|
+
return { alreadyAccepted, judged };
|
|
1752
|
+
}
|
|
1753
|
+
function checkReport(runId, entry, { alreadyAccepted, judged }) {
|
|
1705
1754
|
return {
|
|
1706
1755
|
run_id: runId,
|
|
1707
1756
|
work_item_id: entry.work_item_id,
|
|
@@ -1711,6 +1760,53 @@ export async function checkAuditHostResult(params) {
|
|
|
1711
1760
|
validation_warnings: judged.ok ? judged.warnings : [],
|
|
1712
1761
|
};
|
|
1713
1762
|
}
|
|
1763
|
+
/**
|
|
1764
|
+
* Judge a submitted result for one work item of the CURRENT run and, only when
|
|
1765
|
+
* ingestion would accept it, write it atomically to that item's bound result
|
|
1766
|
+
* path (decision 4, 2026-11-06). The reader never names a path: the tool
|
|
1767
|
+
* derives it from the work-item id. A refused result writes nothing, and the
|
|
1768
|
+
* report carries the same refusal ingestion would give, so the reader fixes
|
|
1769
|
+
* the document and submits again. No lock is held: the write is the one a
|
|
1770
|
+
* reader made before, and the next-step fold still ingests the file under the
|
|
1771
|
+
* artifact-tree lock. Bindings are read on every call, never cached, so an item
|
|
1772
|
+
* a re-plan retired fails with the classified refusal.
|
|
1773
|
+
*/
|
|
1774
|
+
export async function submitAuditHostResult(params) {
|
|
1775
|
+
const runId = await readActiveRunId(params.artifactsDir);
|
|
1776
|
+
if (runId === undefined) {
|
|
1777
|
+
throw new Error("no audit run has published a workload (the current-review-run pointer is missing or unusable); " +
|
|
1778
|
+
"run next-step to publish one, then submit each result by its work-item id.");
|
|
1779
|
+
}
|
|
1780
|
+
const paths = resolveBoundaryPaths({
|
|
1781
|
+
root: params.root,
|
|
1782
|
+
sourceRoot: params.sourceRoot,
|
|
1783
|
+
artifactsDir: params.artifactsDir,
|
|
1784
|
+
runId,
|
|
1785
|
+
});
|
|
1786
|
+
const bindingSet = await readHandoffBindingSet(paths);
|
|
1787
|
+
if (!bindingSet.ok) {
|
|
1788
|
+
return {
|
|
1789
|
+
run_id: runId,
|
|
1790
|
+
already_accepted: false,
|
|
1791
|
+
issues: [{ code: bindingSet.refusal.code, check: bindingSet.refusal.check, message: bindingSet.refusal.message }],
|
|
1792
|
+
validation_warnings: [],
|
|
1793
|
+
};
|
|
1794
|
+
}
|
|
1795
|
+
const entry = bindingSet.resultMap.entries.find((candidate) => candidate.work_item_id === params.workItemId);
|
|
1796
|
+
if (entry === undefined) {
|
|
1797
|
+
throw new Error(`'${params.workItemId}' is not a work item of the current run ${runId}. ` +
|
|
1798
|
+
`Submit with the work-item id your prompt names; the run's items are listed in ${toPosixPath(paths.workloadPath)}.`);
|
|
1799
|
+
}
|
|
1800
|
+
const judgment = await judgeBoundEntry({ ...params, paths, bindingSet, entry });
|
|
1801
|
+
if (judgment.alreadyAccepted) {
|
|
1802
|
+
throw new Error(`work item '${entry.work_item_id}' is already accepted in run ${runId}, and ingestion does not read an accepted result again. ` +
|
|
1803
|
+
`To replace it, run \`audit-code unaccept-results --work-item ${entry.work_item_id}\` first, then submit again.`);
|
|
1804
|
+
}
|
|
1805
|
+
if (judgment.judged.ok) {
|
|
1806
|
+
await writeTextFile(resolveContainedPath(paths.root, entry.result_path, `result path for ${entry.work_item_id}`), params.source);
|
|
1807
|
+
}
|
|
1808
|
+
return checkReport(runId, entry, judgment);
|
|
1809
|
+
}
|
|
1714
1810
|
/** The set-level scheduling facts beside a published workload. */
|
|
1715
1811
|
const COHERENCE_GROUPS_CONTRACT_VERSION = "audit-host-coherence-groups/v1alpha1";
|
|
1716
1812
|
/**
|