audit-tools 0.32.19 → 0.32.22
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/clarification/blastRadius.d.ts +23 -0
- package/dist/audit/clarification/blastRadius.d.ts.map +1 -0
- package/dist/audit/clarification/blastRadius.js +65 -0
- package/dist/audit/clarification/blastRadius.js.map +1 -0
- package/dist/audit/clarification/dials.d.ts +28 -0
- package/dist/audit/clarification/dials.d.ts.map +1 -0
- package/dist/audit/clarification/dials.js +37 -0
- package/dist/audit/clarification/dials.js.map +1 -0
- package/dist/audit/clarification/partition.d.ts +25 -0
- package/dist/audit/clarification/partition.d.ts.map +1 -0
- package/dist/audit/clarification/partition.js +77 -0
- package/dist/audit/clarification/partition.js.map +1 -0
- package/dist/audit/clarification/riskGate.d.ts +24 -0
- package/dist/audit/clarification/riskGate.d.ts.map +1 -0
- package/dist/audit/clarification/riskGate.js +38 -0
- package/dist/audit/clarification/riskGate.js.map +1 -0
- package/dist/audit/clarification/voiQueue.d.ts +17 -0
- package/dist/audit/clarification/voiQueue.d.ts.map +1 -0
- package/dist/audit/clarification/voiQueue.js +37 -0
- package/dist/audit/clarification/voiQueue.js.map +1 -0
- package/dist/audit/cli/auditStep.d.ts +2 -0
- package/dist/audit/cli/auditStep.d.ts.map +1 -1
- package/dist/audit/cli/auditStep.js +9 -1
- package/dist/audit/cli/auditStep.js.map +1 -1
- package/dist/audit/cli/charterClarificationPrompt.d.ts +19 -0
- package/dist/audit/cli/charterClarificationPrompt.d.ts.map +1 -0
- package/dist/audit/cli/charterClarificationPrompt.js +60 -0
- package/dist/audit/cli/charterClarificationPrompt.js.map +1 -0
- package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
- package/dist/audit/cli/nextStepCommand.js +74 -0
- package/dist/audit/cli/nextStepCommand.js.map +1 -1
- package/dist/audit/cli/nextStepHelpers.d.ts +62 -0
- package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
- package/dist/audit/cli/nextStepHelpers.js +129 -0
- package/dist/audit/cli/nextStepHelpers.js.map +1 -1
- package/dist/audit/cli/steps.d.ts +4 -4
- package/dist/audit/cli/steps.d.ts.map +1 -1
- package/dist/audit/cli/steps.js +2 -0
- package/dist/audit/cli/steps.js.map +1 -1
- package/dist/audit/io/artifacts.d.ts +6 -0
- package/dist/audit/io/artifacts.d.ts.map +1 -1
- package/dist/audit/io/artifacts.js +2 -0
- package/dist/audit/io/artifacts.js.map +1 -1
- package/dist/audit/orchestrator/advance.d.ts +23 -0
- package/dist/audit/orchestrator/advance.d.ts.map +1 -1
- package/dist/audit/orchestrator/advance.js +122 -4
- package/dist/audit/orchestrator/advance.js.map +1 -1
- package/dist/audit/orchestrator/advanceTypes.d.ts +22 -1
- package/dist/audit/orchestrator/advanceTypes.d.ts.map +1 -1
- package/dist/audit/orchestrator/charterClarificationExecutor.d.ts +28 -0
- package/dist/audit/orchestrator/charterClarificationExecutor.d.ts.map +1 -0
- package/dist/audit/orchestrator/charterClarificationExecutor.js +130 -0
- package/dist/audit/orchestrator/charterClarificationExecutor.js.map +1 -0
- package/dist/audit/orchestrator/dependencyMap.d.ts +2 -0
- package/dist/audit/orchestrator/dependencyMap.d.ts.map +1 -1
- package/dist/audit/orchestrator/dependencyMap.js +24 -0
- package/dist/audit/orchestrator/dependencyMap.js.map +1 -1
- package/dist/audit/orchestrator/designReviewPrompt.d.ts +17 -0
- package/dist/audit/orchestrator/designReviewPrompt.d.ts.map +1 -1
- package/dist/audit/orchestrator/designReviewPrompt.js +50 -0
- package/dist/audit/orchestrator/designReviewPrompt.js.map +1 -1
- package/dist/audit/orchestrator/executorRunners.d.ts.map +1 -1
- package/dist/audit/orchestrator/executorRunners.js +4 -0
- package/dist/audit/orchestrator/executorRunners.js.map +1 -1
- package/dist/audit/orchestrator/executors.d.ts.map +1 -1
- package/dist/audit/orchestrator/executors.js +20 -0
- package/dist/audit/orchestrator/executors.js.map +1 -1
- package/dist/audit/orchestrator/nextStep.d.ts +11 -1
- package/dist/audit/orchestrator/nextStep.d.ts.map +1 -1
- package/dist/audit/orchestrator/nextStep.js +6 -2
- package/dist/audit/orchestrator/nextStep.js.map +1 -1
- package/dist/audit/orchestrator/staleness.d.ts +27 -1
- package/dist/audit/orchestrator/staleness.d.ts.map +1 -1
- package/dist/audit/orchestrator/staleness.js +33 -16
- package/dist/audit/orchestrator/staleness.js.map +1 -1
- package/dist/audit/orchestrator/state.d.ts +12 -1
- package/dist/audit/orchestrator/state.d.ts.map +1 -1
- package/dist/audit/orchestrator/state.js +41 -2
- package/dist/audit/orchestrator/state.js.map +1 -1
- package/dist/audit/orchestrator/synthesisExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/synthesisExecutors.js +1 -0
- package/dist/audit/orchestrator/synthesisExecutors.js.map +1 -1
- package/dist/audit/orchestrator/systemicChallengeExecutor.d.ts +25 -0
- package/dist/audit/orchestrator/systemicChallengeExecutor.d.ts.map +1 -0
- package/dist/audit/orchestrator/systemicChallengeExecutor.js +107 -0
- package/dist/audit/orchestrator/systemicChallengeExecutor.js.map +1 -0
- package/dist/audit/reporting/mergeFindings.d.ts +2 -1
- package/dist/audit/reporting/mergeFindings.d.ts.map +1 -1
- package/dist/audit/reporting/mergeFindings.js +6 -1
- package/dist/audit/reporting/mergeFindings.js.map +1 -1
- package/dist/audit/reporting/synthesis.d.ts +2 -0
- package/dist/audit/reporting/synthesis.d.ts.map +1 -1
- package/dist/audit/reporting/synthesis.js +1 -1
- package/dist/audit/reporting/synthesis.js.map +1 -1
- package/dist/audit/systemic/aggregateMetricsDigest.d.ts +11 -0
- package/dist/audit/systemic/aggregateMetricsDigest.d.ts.map +1 -0
- package/dist/audit/systemic/aggregateMetricsDigest.js +84 -0
- package/dist/audit/systemic/aggregateMetricsDigest.js.map +1 -0
- package/dist/audit/systemic/metricsDigestTypes.d.ts +35 -0
- package/dist/audit/systemic/metricsDigestTypes.d.ts.map +1 -0
- package/dist/audit/systemic/metricsDigestTypes.js +10 -0
- package/dist/audit/systemic/metricsDigestTypes.js.map +1 -0
- package/dist/audit/systemic/secondOrderAdversaryPrompt.d.ts +16 -0
- package/dist/audit/systemic/secondOrderAdversaryPrompt.d.ts.map +1 -0
- package/dist/audit/systemic/secondOrderAdversaryPrompt.js +85 -0
- package/dist/audit/systemic/secondOrderAdversaryPrompt.js.map +1 -0
- package/dist/audit/systemic/systemicChallengeLoop.d.ts +48 -0
- package/dist/audit/systemic/systemicChallengeLoop.d.ts.map +1 -0
- package/dist/audit/systemic/systemicChallengeLoop.js +107 -0
- package/dist/audit/systemic/systemicChallengeLoop.js.map +1 -0
- package/dist/audit/types/charterClarification.d.ts +52 -0
- package/dist/audit/types/charterClarification.d.ts.map +1 -0
- package/dist/audit/types/charterClarification.js +2 -0
- package/dist/audit/types/charterClarification.js.map +1 -0
- package/dist/audit/types/systemicChallenge.d.ts +69 -0
- package/dist/audit/types/systemicChallenge.d.ts.map +1 -0
- package/dist/audit/types/systemicChallenge.js +2 -0
- package/dist/audit/types/systemicChallenge.js.map +1 -0
- package/dist/remediate/phases/triage.d.ts.map +1 -1
- package/dist/remediate/phases/triage.js +16 -1
- package/dist/remediate/phases/triage.js.map +1 -1
- package/dist/remediate/steps/dispatch/acceptNode.d.ts +178 -0
- package/dist/remediate/steps/dispatch/acceptNode.d.ts.map +1 -0
- package/dist/remediate/steps/dispatch/acceptNode.js +351 -0
- package/dist/remediate/steps/dispatch/acceptNode.js.map +1 -0
- package/dist/remediate/steps/dispatch/common.d.ts +123 -0
- package/dist/remediate/steps/dispatch/common.d.ts.map +1 -0
- package/dist/remediate/steps/dispatch/common.js +236 -0
- package/dist/remediate/steps/dispatch/common.js.map +1 -0
- package/dist/remediate/steps/dispatch/dagNodeFields.d.ts +37 -0
- package/dist/remediate/steps/dispatch/dagNodeFields.d.ts.map +1 -0
- package/dist/remediate/steps/dispatch/dagNodeFields.js +19 -0
- package/dist/remediate/steps/dispatch/dagNodeFields.js.map +1 -0
- package/dist/remediate/steps/dispatch/implementPrompt.d.ts +70 -0
- package/dist/remediate/steps/dispatch/implementPrompt.d.ts.map +1 -0
- package/dist/remediate/steps/dispatch/implementPrompt.js +577 -0
- package/dist/remediate/steps/dispatch/implementPrompt.js.map +1 -0
- package/dist/remediate/steps/dispatch/marshal.d.ts +32 -0
- package/dist/remediate/steps/dispatch/marshal.d.ts.map +1 -0
- package/dist/remediate/steps/dispatch/marshal.js +935 -0
- package/dist/remediate/steps/dispatch/marshal.js.map +1 -0
- package/dist/remediate/steps/dispatch/verifyCommands.d.ts +97 -0
- package/dist/remediate/steps/dispatch/verifyCommands.d.ts.map +1 -0
- package/dist/remediate/steps/dispatch/verifyCommands.js +204 -0
- package/dist/remediate/steps/dispatch/verifyCommands.js.map +1 -0
- package/dist/remediate/steps/dispatch/waveScheduling.d.ts +90 -0
- package/dist/remediate/steps/dispatch/waveScheduling.d.ts.map +1 -0
- package/dist/remediate/steps/dispatch/waveScheduling.js +352 -0
- package/dist/remediate/steps/dispatch/waveScheduling.js.map +1 -0
- package/dist/remediate/steps/dispatch/worktreeLifecycle.d.ts +189 -0
- package/dist/remediate/steps/dispatch/worktreeLifecycle.d.ts.map +1 -0
- package/dist/remediate/steps/dispatch/worktreeLifecycle.js +643 -0
- package/dist/remediate/steps/dispatch/worktreeLifecycle.js.map +1 -0
- package/dist/remediate/steps/dispatch/writeScope.d.ts +151 -0
- package/dist/remediate/steps/dispatch/writeScope.d.ts.map +1 -0
- package/dist/remediate/steps/dispatch/writeScope.js +376 -0
- package/dist/remediate/steps/dispatch/writeScope.js.map +1 -0
- package/dist/remediate/steps/dispatch.d.ts +16 -863
- package/dist/remediate/steps/dispatch.d.ts.map +1 -1
- package/dist/remediate/steps/dispatch.js +18 -3613
- package/dist/remediate/steps/dispatch.js.map +1 -1
- package/dist/shared/decompose/charterClarification.d.ts +80 -0
- package/dist/shared/decompose/charterClarification.d.ts.map +1 -0
- package/dist/shared/decompose/charterClarification.js +105 -0
- package/dist/shared/decompose/charterClarification.js.map +1 -0
- package/dist/shared/decompose/systemicChallenge.d.ts +326 -0
- package/dist/shared/decompose/systemicChallenge.d.ts.map +1 -0
- package/dist/shared/decompose/systemicChallenge.js +30 -0
- package/dist/shared/decompose/systemicChallenge.js.map +1 -0
- package/dist/shared/index.d.ts +10 -5
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +6 -4
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/opencodePermissions.d.ts +73 -0
- package/dist/shared/opencodePermissions.d.ts.map +1 -1
- package/dist/shared/opencodePermissions.js +172 -0
- package/dist/shared/opencodePermissions.js.map +1 -1
- package/dist/shared/tooling/exec.d.ts +10 -1
- package/dist/shared/tooling/exec.d.ts.map +1 -1
- package/dist/shared/tooling/exec.js +13 -1
- package/dist/shared/tooling/exec.js.map +1 -1
- package/dist/shared/types/charter.d.ts +89 -0
- package/dist/shared/types/charter.d.ts.map +1 -1
- package/dist/shared/types/charter.js +68 -0
- package/dist/shared/types/charter.js.map +1 -1
- package/dist/shared/types/intentCheckpoint.d.ts +15 -0
- package/dist/shared/types/intentCheckpoint.d.ts.map +1 -1
- package/dist/shared/types/intentCheckpoint.js +11 -0
- package/dist/shared/types/intentCheckpoint.js.map +1 -1
- package/dist/shared/validation/charterGate.d.ts +20 -1
- package/dist/shared/validation/charterGate.d.ts.map +1 -1
- package/dist/shared/validation/charterGate.js +23 -0
- package/dist/shared/validation/charterGate.js.map +1 -1
- package/docs/audit-pkg/contracts.md +1 -1
- package/docs/audit-pkg/development.md +8 -7
- package/docs/audit-pkg/product.md +7 -4
- package/docs/audit-pkg/release.md +4 -2
- package/opencode.json +36 -20
- package/package.json +1 -1
- package/scripts/postinstall.mjs +2 -1
- package/wrapper/audit-code-wrapper-opencode.mjs +38 -12
- package/wrapper/remediate-code-wrapper-opencode.mjs +38 -12
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Finding } from "../types.js";
|
|
2
|
+
import type { Ceiling } from "audit-tools/shared";
|
|
3
|
+
import type { AggregateMetricsDigest } from "../systemic/metricsDigestTypes.js";
|
|
4
|
+
/**
|
|
5
|
+
* The `systemic_challenge.json` artifact — Phase E of the conceptual design-review:
|
|
6
|
+
* the SYSTEMIC IMPROVEMENT-SEEKING CHALLENGE LOOP. A second-order adversary (a
|
|
7
|
+
* SEPARATE agent — [[delegate-adversarial-phases-to-separate-agent]]) re-interrogates
|
|
8
|
+
* the whole system with human-grade pressure and folds newly-surfaced improvements
|
|
9
|
+
* back in, LOOP-UNTIL-DRY: the pass is done only when a challenge round yields
|
|
10
|
+
* NOTHING NEW, not when it first has an answer (design of record
|
|
11
|
+
* spec/conceptual-design-review-design.md §"Convergence (loop-until-dry)"; backlog
|
|
12
|
+
* "Systemic reviewers must be pushed adversarially for improvement").
|
|
13
|
+
*
|
|
14
|
+
* The mandate is OPTIMIZATION / BETTER-WAY, not only defect-finding: the pass
|
|
15
|
+
* actively seeks superior alternatives to things that currently WORK — the class no
|
|
16
|
+
* correctness lens flags because nothing is broken (redundant, serial-that-could-be-
|
|
17
|
+
* parallel, duplicated, over-built, an unquestioned assumption, a categorically
|
|
18
|
+
* better approach).
|
|
19
|
+
*
|
|
20
|
+
* It is an OUTPUT artifact seeded from the intent checkpoint (ceiling) and the whole
|
|
21
|
+
* upstream picture (repo_manifest / structure_decomposition / charter register).
|
|
22
|
+
* `status:"omitted"` when the ceiling did not request the systemic layer (shallow —
|
|
23
|
+
* the default), so the obligation is satisfied without a host turn.
|
|
24
|
+
*
|
|
25
|
+
* Each host-delegation round appends to `rounds`; a round that returns zero new
|
|
26
|
+
* findings sets `converged:true` and terminates the loop. `findings` are every
|
|
27
|
+
* distinct improvement surfaced across rounds — carrying their TRUE lens (a
|
|
28
|
+
* test-parallelization finding is `tests`/`performance`, an ops finding is
|
|
29
|
+
* `operability`), NEVER a hardcoded `architecture` tag.
|
|
30
|
+
*/
|
|
31
|
+
export interface SystemicChallengeRound {
|
|
32
|
+
/** 1-based round ordinal (the Nth loop-until-dry challenge). */
|
|
33
|
+
round: number;
|
|
34
|
+
/** Distinct finding ids this round surfaced that no prior round had. */
|
|
35
|
+
new_finding_ids: string[];
|
|
36
|
+
/** Whether this round yielded nothing new (the loop-until-dry terminator). */
|
|
37
|
+
dry: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface SystemicChallengeRegister {
|
|
40
|
+
generated_at: string;
|
|
41
|
+
/** The decomposition target — `"systemic_challenge"` at this layer. */
|
|
42
|
+
target: "systemic_challenge";
|
|
43
|
+
/**
|
|
44
|
+
* The ceiling authorized at `intent_checkpoint` — echoed so the register is
|
|
45
|
+
* self-describing about the depth that produced it.
|
|
46
|
+
*/
|
|
47
|
+
ceiling: Ceiling;
|
|
48
|
+
/**
|
|
49
|
+
* `"omitted"` when the ceiling did not request the systemic layer (shallow — the
|
|
50
|
+
* default) — the register is written empty so the obligation is satisfied without
|
|
51
|
+
* a host turn (mirrors the charter-extraction / clarification omit).
|
|
52
|
+
*/
|
|
53
|
+
status?: "omitted";
|
|
54
|
+
/**
|
|
55
|
+
* The language-neutral aggregate-metrics digest fed to the adversary as NECESSARY
|
|
56
|
+
* supporting evidence — explicitly NOT sufficient alone (the adversary reasons
|
|
57
|
+
* from the whole picture, not the counts). Absent on an omitted register.
|
|
58
|
+
*/
|
|
59
|
+
metrics?: AggregateMetricsDigest;
|
|
60
|
+
/** The loop-until-dry challenge rounds, in order; the last one is `dry`. */
|
|
61
|
+
rounds: SystemicChallengeRound[];
|
|
62
|
+
/** True once a challenge round surfaced nothing new (the loop terminated). */
|
|
63
|
+
converged: boolean;
|
|
64
|
+
/** Every distinct improvement finding surfaced, carrying its TRUE lens. */
|
|
65
|
+
findings: Finding[];
|
|
66
|
+
/** Gate/assembly notes (e.g. a round dropped an ungrounded finding) — surfaced. */
|
|
67
|
+
validation_issues: string[];
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=systemicChallenge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"systemicChallenge.d.ts","sourceRoot":"","sources":["../../../src/audit/types/systemicChallenge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAEhF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,WAAW,sBAAsB;IACrC,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,8EAA8E;IAC9E,GAAG,EAAE,OAAO,CAAC;CACd;AAED,MAAM,WAAW,yBAAyB;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,MAAM,EAAE,oBAAoB,CAAC;IAC7B;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,sBAAsB,CAAC;IACjC,4EAA4E;IAC5E,MAAM,EAAE,sBAAsB,EAAE,CAAC;IACjC,8EAA8E;IAC9E,SAAS,EAAE,OAAO,CAAC;IACnB,2EAA2E;IAC3E,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,mFAAmF;IACnF,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"systemicChallenge.js","sourceRoot":"","sources":["../../../src/audit/types/systemicChallenge.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triage.d.ts","sourceRoot":"","sources":["../../../src/remediate/phases/triage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"triage.d.ts","sourceRoot":"","sources":["../../../src/remediate/phases/triage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AA+L1D,wBAAsB,cAAc,CAClC,KAAK,EAAE,gBAAgB,EACvB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,gBAAgB,CAAC,CAyK3B"}
|
|
@@ -4,7 +4,7 @@ import { rename } from "node:fs/promises";
|
|
|
4
4
|
import { readOptionalJsonFile, writeJsonFile, formatValidationIssues, withFsRetry } from "audit-tools/shared";
|
|
5
5
|
import { validateTriageResolution } from "../validation/remediationState.js";
|
|
6
6
|
import { rationaleAsksForRetry } from "../steps/stepUtils.js";
|
|
7
|
-
import { verifyNodeInWorktree } from "../steps/dispatch.js";
|
|
7
|
+
import { verifyNodeInWorktree, implementResultPath } from "../steps/dispatch.js";
|
|
8
8
|
function markRetry(item) {
|
|
9
9
|
item.started_at ??= new Date().toISOString();
|
|
10
10
|
delete item.completed_at;
|
|
@@ -72,6 +72,21 @@ function reverifyBlockedItemAgainstTree(item, state, options) {
|
|
|
72
72
|
? state.plan?.blocks.find((b) => b.block_id === item.block_id)
|
|
73
73
|
: undefined) ??
|
|
74
74
|
state.plan?.blocks.find((b) => b.items.includes(item.finding_id));
|
|
75
|
+
// No-worker guard (2026-07-06): a passing tree verify only proves this node's
|
|
76
|
+
// work was DONE if an implement worker actually RAN and left a result. When the
|
|
77
|
+
// provider produced nothing (e.g. `local-subprocess` no-op) the merge marks the
|
|
78
|
+
// node blocked with no result file; a GENERIC `build && check` targeted_command
|
|
79
|
+
// then passes on ANY green tree and would FALSE-resolve an un-implemented node.
|
|
80
|
+
// This is distinct from the deliverable-existence guard below — an edit-node's
|
|
81
|
+
// touched paths PRE-EXIST, so that guard can't catch a never-implemented edit;
|
|
82
|
+
// only the missing worker result can. No result on disk ⇒ "no worker ran" ⇒
|
|
83
|
+
// unsatisfied (route to retry / re-dispatch), never `resolved_no_change`.
|
|
84
|
+
const runId = state.plan?.plan_id;
|
|
85
|
+
if (runId &&
|
|
86
|
+
block?.block_id &&
|
|
87
|
+
!existsSync(implementResultPath(options.artifactsDir, runId, block.block_id))) {
|
|
88
|
+
return "unsatisfied";
|
|
89
|
+
}
|
|
75
90
|
// Deliverable-existence guard (2026-07-03): a node cannot be "already satisfied" if
|
|
76
91
|
// its declared deliverables aren't in the tree. A passing `targeted_command` may be
|
|
77
92
|
// satisfied by a SIBLING's work while THIS node's file was never created — proven
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triage.js","sourceRoot":"","sources":["../../../src/remediate/phases/triage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC9G,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"triage.js","sourceRoot":"","sources":["../../../src/remediate/phases/triage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC9G,OAAO,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,EAAE,mBAAmB,CAAC,EAC/C,WAAW,CACZ,CAAC;YAEF,OAAO,CAAC,KAAK,CACX,WAAW,YAAY,CAAC,MAAM,0CAA0C,CACzE,CAAC;YACF,OAAO,CAAC,KAAK,CACX,gEAAgE,CACjE,CAAC;YACF,OAAO,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAC;QACpD,CAAC;IACH,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC;IAC9D,CAAC;IAED,qEAAqE;IACrE,OAAO,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import type { RemediationBlock } from "../../state/types.js";
|
|
2
|
+
import type { ProviderSlot, RollingDispatchResult } from "audit-tools/shared";
|
|
3
|
+
/** Worker transport outcome (mirrors shared `RollingDispatchResult["outcome"]`). */
|
|
4
|
+
export type NodeWorkerOutcome = "success" | "error" | "rate_limited" | "timeout";
|
|
5
|
+
export interface AcceptNodeWorktreeParams {
|
|
6
|
+
root: string;
|
|
7
|
+
runId: string;
|
|
8
|
+
blockId: string;
|
|
9
|
+
/** The node's isolated worktree directory. */
|
|
10
|
+
worktreeRoot: string;
|
|
11
|
+
/** The node's worktree branch (`worktreeBranchForBlock`). */
|
|
12
|
+
branch: string;
|
|
13
|
+
/** The worker's transport outcome from the node dispatcher. */
|
|
14
|
+
workerOutcome: NodeWorkerOutcome;
|
|
15
|
+
/**
|
|
16
|
+
* Per-node verify commands. OMIT (leave `undefined`) for the real rolling drivers:
|
|
17
|
+
* the gate then DERIVES the verify from the node's actually-touched test files
|
|
18
|
+
* post-commit ({@link deriveVerifyCommandsFromBranch}) — correct paths/runner by
|
|
19
|
+
* construction, never the whole suite. Pass `[]` to skip the gate (lifecycle unit
|
|
20
|
+
* tests on a minimal temp repo), or an explicit list to force specific commands.
|
|
21
|
+
*/
|
|
22
|
+
targetedCommands?: string[];
|
|
23
|
+
/**
|
|
24
|
+
* The node's own `targeted_commands` (the auditor/finding-specified verification),
|
|
25
|
+
* run IN ADDITION to the derived commands — filtered to the build-free subset and
|
|
26
|
+
* deduped against the derive. The derive gives correct-paths-by-construction; these
|
|
27
|
+
* add the fix-specific regression checks the derive misses when a fix touches no test
|
|
28
|
+
* (task_7d35176d). Omit / `[]` → derive-only (the prior behaviour). Ignored when
|
|
29
|
+
* `targetedCommands` is an explicit override (the lifecycle unit-test path).
|
|
30
|
+
*/
|
|
31
|
+
additionalVerifyCommands?: string[];
|
|
32
|
+
/**
|
|
33
|
+
* Accept-time write-scope inputs (OBL-DS-06). The write-scope gate runs HERE —
|
|
34
|
+
* after the verify, BEFORE the cherry-pick — so an out-of-scope or seam-conflicting
|
|
35
|
+
* edit is PREVENTED from landing in the main tree rather than reported post-hoc once
|
|
36
|
+
* it is already merged. REQUIRED (not optional): both rolling drivers always derive
|
|
37
|
+
* it from the plan, so a production caller can never silently skip the gate — that
|
|
38
|
+
* enforcement is the type, not host discretion (E1). A lifecycle test that does not
|
|
39
|
+
* exercise scope passes `{ allBlockScopes: [] }`: an empty registry owns nothing, so
|
|
40
|
+
* every edit is unowned-and-granted → the gate is a sound no-op, never a skip.
|
|
41
|
+
*/
|
|
42
|
+
scope: {
|
|
43
|
+
/** Every block's declared write scope, for amendment ownership adjudication. */
|
|
44
|
+
allBlockScopes: Array<{
|
|
45
|
+
block_id: string;
|
|
46
|
+
write_paths: string[];
|
|
47
|
+
}>;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* The block's OWN declared write paths (INV-1). Threaded into `commitWorktree`
|
|
51
|
+
* so worker-created new SOURCE files under scope are force-added past
|
|
52
|
+
* `.gitignore` and a generated-artifact / out-of-scope new file fails loudly.
|
|
53
|
+
* Omit (lifecycle unit tests with no scope) → no new-file inclusion.
|
|
54
|
+
*/
|
|
55
|
+
writePaths?: string[];
|
|
56
|
+
/**
|
|
57
|
+
* The cross-package check command (argv) run in the MAIN checkout AFTER the
|
|
58
|
+
* cherry-pick lands (INV-2): a RED check rolls the base back to its captured HEAD
|
|
59
|
+
* OID. When omitted, the command is PINNED — derived from the repo via
|
|
60
|
+
* `mergedBaseCheckArgv` (the `check`-layer of the tool-owned gate set), not a
|
|
61
|
+
* hardcoded string — and skipped (`null`) on a non-monorepo target. Tests inject a
|
|
62
|
+
* deterministic pass/fail argv (a `t.mock.module` seam is unusable under tsx/esm).
|
|
63
|
+
* Pass `null` to skip the merged-base check entirely (legacy lifecycle unit tests
|
|
64
|
+
* on a minimal repo with no check script).
|
|
65
|
+
*/
|
|
66
|
+
mergedBaseCheckCommand?: string[] | null;
|
|
67
|
+
}
|
|
68
|
+
export interface AcceptNodeWorktreeResult {
|
|
69
|
+
/** The LIFECYCLE outcome (verify/merge applied), distinct from the worker transport outcome. */
|
|
70
|
+
outcome: NodeWorkerOutcome;
|
|
71
|
+
verifyPassed: boolean;
|
|
72
|
+
merged: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* On a failure outcome, the captured failing command + its output — the verify
|
|
75
|
+
* stdout/stderr (`$ <cmd>\n<output>`), or the git commit / cherry-pick error text.
|
|
76
|
+
* Persisted into the accept-outcome sidecar so triage can see the root cause
|
|
77
|
+
* instead of an `outcome:error` with no captured stderr. Absent on success.
|
|
78
|
+
*/
|
|
79
|
+
diagnostic?: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The shared post-worker "accept node" lifecycle, extracted so BOTH rolling
|
|
83
|
+
* drivers reuse identical correctness: the in-process provider engine
|
|
84
|
+
* (`driveRollingImplementDispatch`) calls it inline once the worker returns; the
|
|
85
|
+
* host-subagent driver calls it from the `accept-node` callback once a host
|
|
86
|
+
* subagent finishes.
|
|
87
|
+
*
|
|
88
|
+
* Given a completed worker run in an isolated worktree, this: (1) TOOL-commits
|
|
89
|
+
* the worker's edits onto the branch (deterministic, never the worker/host) so
|
|
90
|
+
* the branch diff is the write-scope ground truth; (2) runs the per-node verify
|
|
91
|
+
* IN the worktree BEFORE accepting; (3) merges via cherry-pick only on a passing
|
|
92
|
+
* verify; and (4) drops the worktree on any failure so the main tree is never
|
|
93
|
+
* dirtied by an unverified change. It returns the LIFECYCLE outcome (which the
|
|
94
|
+
* caller records for the deterministic merge); the caller still returns the
|
|
95
|
+
* worker's TRANSPORT outcome to the rolling engine (so a `rate_limited` worker
|
|
96
|
+
* re-queues, while a verify-failure is adjudicated by the merge → triage).
|
|
97
|
+
*
|
|
98
|
+
* SAFETY: the main tree is touched only through `mergeWorktree` (cherry-pick of a
|
|
99
|
+
* verified branch, aborts cleanly on conflict). No state mutation here — the
|
|
100
|
+
* caller persists via `mergeImplementResults`.
|
|
101
|
+
*/
|
|
102
|
+
export declare function acceptNodeWorktree(params: AcceptNodeWorktreeParams): Promise<AcceptNodeWorktreeResult>;
|
|
103
|
+
/**
|
|
104
|
+
* Sidecar path for a node's tool-owned accept (verify/merge) outcome. Written by
|
|
105
|
+
* BOTH rolling drivers as each node is accepted, read by `mergeImplementResults`.
|
|
106
|
+
* Block ids here follow the same filename-safe convention as the per-node result
|
|
107
|
+
* files in the same dir.
|
|
108
|
+
*/
|
|
109
|
+
export declare function nodeAcceptOutcomePath(artifactsDir: string, runId: string, blockId: string): string;
|
|
110
|
+
/**
|
|
111
|
+
* Persist a node's `acceptNodeWorktree` lifecycle outcome so finalization can tell
|
|
112
|
+
* a node whose edits actually LANDED (merged) from one that self-reported "resolved"
|
|
113
|
+
* but failed tool-owned verify / merge (OBL-DS-06: never trust the worker's self
|
|
114
|
+
* report). Both rolling drivers (host-subagent `advanceHostRolling` and in-process
|
|
115
|
+
* `driveRollingImplementDispatch`) call this; the interim main-tree path writes none,
|
|
116
|
+
* so the merge-state gate is inert there.
|
|
117
|
+
*/
|
|
118
|
+
export declare function recordNodeAcceptOutcome(artifactsDir: string, runId: string, blockId: string, result: AcceptNodeWorktreeResult): Promise<void>;
|
|
119
|
+
/** Load a node's recorded accept outcome, or null when none was written. */
|
|
120
|
+
export declare function loadNodeAcceptOutcome(artifactsDir: string, runId: string, blockId: string): Promise<AcceptNodeWorktreeResult | null>;
|
|
121
|
+
/**
|
|
122
|
+
* The per-node worktree worker an in-process driver launches: it edits within the
|
|
123
|
+
* node's isolated worktree (cwd-confined), writes its result file, and returns the
|
|
124
|
+
* transport outcome. `makeProviderNodeDispatcher` is the live implementation; tests
|
|
125
|
+
* inject a stub. Structurally identical to `nextStep`'s `ProgrammaticNodeDispatcher`.
|
|
126
|
+
*/
|
|
127
|
+
export type WorktreeNodeWorker = (args: {
|
|
128
|
+
block: RemediationBlock;
|
|
129
|
+
slot: ProviderSlot;
|
|
130
|
+
worktreeRoot: string;
|
|
131
|
+
resultPath: string;
|
|
132
|
+
}) => Promise<RollingDispatchResult<{
|
|
133
|
+
block_id: string;
|
|
134
|
+
}>>;
|
|
135
|
+
/** One node's worktree-lifecycle result: the worker transport outcome + the accept lifecycle. */
|
|
136
|
+
export interface NodeWorktreeExecution {
|
|
137
|
+
/** Worker transport outcome the rolling engine consumes (success/error/rate_limited/timeout). */
|
|
138
|
+
result: RollingDispatchResult<{
|
|
139
|
+
block_id: string;
|
|
140
|
+
}>;
|
|
141
|
+
/** Tool-owned accept outcome (commit→verify→merge), already persisted via recordNodeAcceptOutcome. */
|
|
142
|
+
accept: AcceptNodeWorktreeResult;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Run ONE node's full in-process lifecycle in an isolated worktree — shared by BOTH
|
|
146
|
+
* in-process callers (the reactive `driveRollingImplementDispatch` engine and the
|
|
147
|
+
* A-8 hybrid executor) so they create / commit / verify / merge identically:
|
|
148
|
+
*
|
|
149
|
+
* reset + create the node's worktree → link node_modules → seed declared targets →
|
|
150
|
+
* launch the worker (`dispatchNode`) → `acceptNodeWorktree` (tool-commit, rebase,
|
|
151
|
+
* verify, write-scope gate, cherry-pick) → persist the accept outcome.
|
|
152
|
+
*
|
|
153
|
+
* Claim ownership is the CALLER's concern (the reactive engine claims through the
|
|
154
|
+
* shared registry; the hybrid executor is handed a coordinator-minted claim), so
|
|
155
|
+
* this fn neither claims nor releases — it returns the worker transport result AND
|
|
156
|
+
* the accept lifecycle outcome and lets the caller record `nodeOutcomes` / release.
|
|
157
|
+
* Any thrown error degrades to a dropped worktree + a persisted `error` accept
|
|
158
|
+
* outcome, never an unhandled rejection into the engine.
|
|
159
|
+
*/
|
|
160
|
+
export declare function executeNodeInWorktree(args: {
|
|
161
|
+
block: RemediationBlock;
|
|
162
|
+
slot: ProviderSlot;
|
|
163
|
+
root: string;
|
|
164
|
+
artifactsDir: string;
|
|
165
|
+
runId: string;
|
|
166
|
+
resultPath: string;
|
|
167
|
+
/** Untracked declared targets to seed into the worktree (the node's write set or write∪read). */
|
|
168
|
+
seedPaths: string[];
|
|
169
|
+
/** Every block's declared write scope, for the accept-time write-scope gate (OBL-DS-06). */
|
|
170
|
+
allBlockScopes: Array<{
|
|
171
|
+
block_id: string;
|
|
172
|
+
write_paths: string[];
|
|
173
|
+
}>;
|
|
174
|
+
/** The node's own targeted_commands, run IN ADDITION to the derived verify (task_7d35176d). */
|
|
175
|
+
additionalVerifyCommands?: string[];
|
|
176
|
+
dispatchNode: WorktreeNodeWorker;
|
|
177
|
+
}): Promise<NodeWorktreeExecution>;
|
|
178
|
+
//# sourceMappingURL=acceptNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acceptNode.d.ts","sourceRoot":"","sources":["../../../../src/remediate/steps/dispatch/acceptNode.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AA6B9E,oFAAoF;AACpF,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,OAAO,GAAG,cAAc,GAAG,SAAS,CAAC;AAEjF,MAAM,WAAW,wBAAwB;IACvC,IAAI,E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