audit-tools 0.34.41 → 0.35.0
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/args.d.ts +6 -0
- package/dist/audit/cli/args.d.ts.map +1 -1
- package/dist/audit/cli/args.js +21 -4
- package/dist/audit/cli/args.js.map +1 -1
- package/dist/audit/cli/auditStep.d.ts +6 -15
- package/dist/audit/cli/auditStep.d.ts.map +1 -1
- package/dist/audit/cli/auditStep.js +1 -1
- package/dist/audit/cli/auditStep.js.map +1 -1
- package/dist/audit/cli/dispatch/hostFanoutGate.d.ts +21 -61
- package/dist/audit/cli/dispatch/hostFanoutGate.d.ts.map +1 -1
- package/dist/audit/cli/dispatch/hostFanoutGate.js +18 -167
- package/dist/audit/cli/dispatch/hostFanoutGate.js.map +1 -1
- package/dist/audit/cli/dispatch/packetFilter.d.ts +2 -2
- package/dist/audit/cli/dispatch/packetFilter.d.ts.map +1 -1
- package/dist/audit/cli/dispatch/packetFilter.js +3 -1
- package/dist/audit/cli/dispatch/packetFilter.js.map +1 -1
- package/dist/audit/cli/dispatch/quotaPool.d.ts +2 -14
- package/dist/audit/cli/dispatch/quotaPool.d.ts.map +1 -1
- package/dist/audit/cli/dispatch/quotaPool.js +16 -6
- package/dist/audit/cli/dispatch/quotaPool.js.map +1 -1
- package/dist/audit/cli/dispatch/tierRouting.d.ts +2 -2
- package/dist/audit/cli/dispatch/tokenUsageObservation.d.ts.map +1 -1
- package/dist/audit/cli/dispatch/tokenUsageObservation.js +10 -2
- package/dist/audit/cli/dispatch/tokenUsageObservation.js.map +1 -1
- package/dist/audit/cli/dispatch.d.ts +14 -3
- package/dist/audit/cli/dispatch.d.ts.map +1 -1
- package/dist/audit/cli/dispatch.js +87 -65
- package/dist/audit/cli/dispatch.js.map +1 -1
- package/dist/audit/cli/forceSynthesisCommand.d.ts.map +1 -1
- package/dist/audit/cli/forceSynthesisCommand.js +9 -1
- package/dist/audit/cli/forceSynthesisCommand.js.map +1 -1
- package/dist/audit/cli/hybridDispatch.d.ts +4 -9
- package/dist/audit/cli/hybridDispatch.d.ts.map +1 -1
- package/dist/audit/cli/hybridDispatch.js +1 -1
- package/dist/audit/cli/hybridDispatch.js.map +1 -1
- package/dist/audit/cli/lineIndex.d.ts +2 -0
- package/dist/audit/cli/lineIndex.d.ts.map +1 -1
- package/dist/audit/cli/lineIndex.js +4 -0
- package/dist/audit/cli/lineIndex.js.map +1 -1
- package/dist/audit/cli/nextStepCommand.d.ts +0 -26
- package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
- package/dist/audit/cli/nextStepCommand.js +14 -358
- package/dist/audit/cli/nextStepCommand.js.map +1 -1
- package/dist/audit/cli/nextStepHelpers.d.ts +5 -16
- package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
- package/dist/audit/cli/nextStepHelpers.js +27 -157
- package/dist/audit/cli/nextStepHelpers.js.map +1 -1
- package/dist/audit/cli/quotaCommand.d.ts.map +1 -1
- package/dist/audit/cli/quotaCommand.js +1 -5
- package/dist/audit/cli/quotaCommand.js.map +1 -1
- package/dist/audit/cli/reviewRun.d.ts.map +1 -1
- package/dist/audit/cli/reviewRun.js +58 -23
- package/dist/audit/cli/reviewRun.js.map +1 -1
- package/dist/audit/cli/rollingAuditDispatch.d.ts +1 -1
- package/dist/audit/cli/semanticReviewStep.d.ts.map +1 -1
- package/dist/audit/cli/semanticReviewStep.js +35 -54
- package/dist/audit/cli/semanticReviewStep.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 +0 -1
- package/dist/audit/cli/steps.js.map +1 -1
- package/dist/audit/cli/workPartitionRuntime.d.ts +11 -0
- package/dist/audit/cli/workPartitionRuntime.d.ts.map +1 -0
- package/dist/audit/cli/workPartitionRuntime.js +39 -0
- package/dist/audit/cli/workPartitionRuntime.js.map +1 -0
- package/dist/audit/contracts/wrapperResponse.d.ts +6 -6
- package/dist/audit/io/artifacts.d.ts +1 -3
- package/dist/audit/io/artifacts.d.ts.map +1 -1
- package/dist/audit/io/artifacts.js +0 -3
- package/dist/audit/io/artifacts.js.map +1 -1
- package/dist/audit/orchestrator/advance.d.ts.map +1 -1
- package/dist/audit/orchestrator/advance.js +0 -35
- package/dist/audit/orchestrator/advance.js.map +1 -1
- package/dist/audit/orchestrator/advanceTypes.d.ts +4 -63
- package/dist/audit/orchestrator/advanceTypes.d.ts.map +1 -1
- package/dist/audit/orchestrator/executorRunners.d.ts.map +1 -1
- package/dist/audit/orchestrator/executorRunners.js +9 -12
- 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 +0 -5
- package/dist/audit/orchestrator/executors.js.map +1 -1
- package/dist/audit/orchestrator/hostInputPause.d.ts +1 -1
- package/dist/audit/orchestrator/hostInputPause.js +1 -1
- package/dist/audit/orchestrator/ingestionExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/ingestionExecutors.js +4 -1
- package/dist/audit/orchestrator/ingestionExecutors.js.map +1 -1
- package/dist/audit/orchestrator/intakeExecutors.d.ts +1 -65
- package/dist/audit/orchestrator/intakeExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/intakeExecutors.js +3 -425
- package/dist/audit/orchestrator/intakeExecutors.js.map +1 -1
- package/dist/audit/orchestrator/nextStep.d.ts +0 -13
- package/dist/audit/orchestrator/nextStep.d.ts.map +1 -1
- package/dist/audit/orchestrator/nextStep.js +0 -7
- package/dist/audit/orchestrator/nextStep.js.map +1 -1
- package/dist/audit/orchestrator/planningExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/planningExecutors.js +4 -1
- package/dist/audit/orchestrator/planningExecutors.js.map +1 -1
- package/dist/audit/orchestrator/rollingDispatch.d.ts +1 -1
- package/dist/audit/orchestrator/rollingDispatch.d.ts.map +1 -1
- package/dist/audit/orchestrator/rollingDispatch.js +5 -4
- package/dist/audit/orchestrator/rollingDispatch.js.map +1 -1
- package/dist/audit/orchestrator/state.d.ts +0 -39
- package/dist/audit/orchestrator/state.d.ts.map +1 -1
- package/dist/audit/orchestrator/state.js +3 -29
- package/dist/audit/orchestrator/state.js.map +1 -1
- package/dist/audit/orchestrator/synthesisExecutors.d.ts +8 -2
- package/dist/audit/orchestrator/synthesisExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/synthesisExecutors.js +7 -5
- package/dist/audit/orchestrator/synthesisExecutors.js.map +1 -1
- package/dist/audit/reporting/findingIdentity.d.ts +2 -2
- package/dist/audit/reporting/findingIdentity.js +2 -2
- package/dist/audit/reporting/synthesis.d.ts +7 -1
- package/dist/audit/reporting/synthesis.d.ts.map +1 -1
- package/dist/audit/reporting/synthesis.js +27 -7
- package/dist/audit/reporting/synthesis.js.map +1 -1
- package/dist/audit/reporting/workBlocks.d.ts +14 -3
- package/dist/audit/reporting/workBlocks.d.ts.map +1 -1
- package/dist/audit/reporting/workBlocks.js +163 -73
- package/dist/audit/reporting/workBlocks.js.map +1 -1
- package/dist/audit/types/activeDispatch.d.ts +8 -7
- package/dist/audit/types/activeDispatch.d.ts.map +1 -1
- package/dist/audit/types/auditState.d.ts +6 -6
- package/dist/audit/types/externalAnalyzer.d.ts +6 -6
- package/dist/audit/validation/auditResults.d.ts.map +1 -1
- package/dist/audit/validation/auditResults.js +6 -1
- package/dist/audit/validation/auditResults.js.map +1 -1
- package/dist/remediate/contractPipeline/phaseCut.d.ts +8 -0
- package/dist/remediate/contractPipeline/phaseCut.d.ts.map +1 -1
- package/dist/remediate/contractPipeline/phaseCut.js +63 -0
- package/dist/remediate/contractPipeline/phaseCut.js.map +1 -1
- package/dist/remediate/contractPipeline/phaseCutArtifact.d.ts.map +1 -1
- package/dist/remediate/contractPipeline/phaseCutArtifact.js +5 -3
- package/dist/remediate/contractPipeline/phaseCutArtifact.js.map +1 -1
- package/dist/remediate/phases/plan.d.ts.map +1 -1
- package/dist/remediate/phases/plan.js +35 -12
- package/dist/remediate/phases/plan.js.map +1 -1
- package/dist/remediate/steps/contractPipeline.d.ts +6 -2
- package/dist/remediate/steps/contractPipeline.d.ts.map +1 -1
- package/dist/remediate/steps/contractPipeline.js +90 -6
- package/dist/remediate/steps/contractPipeline.js.map +1 -1
- package/dist/remediate/steps/contractPipelinePrompts.d.ts.map +1 -1
- package/dist/remediate/steps/contractPipelinePrompts.js +4 -2
- package/dist/remediate/steps/contractPipelinePrompts.js.map +1 -1
- package/dist/remediate/steps/dispatch/marshal.d.ts +6 -0
- package/dist/remediate/steps/dispatch/marshal.d.ts.map +1 -1
- package/dist/remediate/steps/dispatch/marshal.js +16 -17
- package/dist/remediate/steps/dispatch/marshal.js.map +1 -1
- package/dist/remediate/steps/dispatch/waveScheduling.d.ts +7 -15
- package/dist/remediate/steps/dispatch/waveScheduling.d.ts.map +1 -1
- package/dist/remediate/steps/dispatch/waveScheduling.js +26 -19
- package/dist/remediate/steps/dispatch/waveScheduling.js.map +1 -1
- package/dist/remediate/steps/nextStep.d.ts +5 -7
- package/dist/remediate/steps/nextStep.d.ts.map +1 -1
- package/dist/remediate/steps/nextStep.js +100 -82
- package/dist/remediate/steps/nextStep.js.map +1 -1
- package/dist/remediate/steps/rollingSession.d.ts +2 -1
- package/dist/remediate/steps/rollingSession.d.ts.map +1 -1
- package/dist/remediate/steps/rollingSession.js +14 -8
- package/dist/remediate/steps/rollingSession.js.map +1 -1
- package/dist/remediate/steps/sessionConfigLoad.d.ts +3 -2
- package/dist/remediate/steps/sessionConfigLoad.d.ts.map +1 -1
- package/dist/remediate/steps/sessionConfigLoad.js +4 -10
- package/dist/remediate/steps/sessionConfigLoad.js.map +1 -1
- package/dist/remediate/validation/contractPipeline.d.ts +1 -1
- package/dist/remediate/validation/contractPipeline.d.ts.map +1 -1
- package/dist/remediate/validation/contractPipeline.js +7 -1
- package/dist/remediate/validation/contractPipeline.js.map +1 -1
- package/dist/remediate/validation/contractPipelineGates.d.ts +8 -0
- package/dist/remediate/validation/contractPipelineGates.d.ts.map +1 -1
- package/dist/remediate/validation/contractPipelineGates.js +89 -0
- package/dist/remediate/validation/contractPipelineGates.js.map +1 -1
- package/dist/shared/config/resolveSessionConfig.d.ts.map +1 -1
- package/dist/shared/config/resolveSessionConfig.js +6 -5
- package/dist/shared/config/resolveSessionConfig.js.map +1 -1
- package/dist/shared/decompose/workPartition.d.ts +66 -0
- package/dist/shared/decompose/workPartition.d.ts.map +1 -0
- package/dist/shared/decompose/workPartition.js +523 -0
- package/dist/shared/decompose/workPartition.js.map +1 -0
- package/dist/shared/dispatch/admissionLoop.d.ts +5 -44
- package/dist/shared/dispatch/admissionLoop.d.ts.map +1 -1
- package/dist/shared/dispatch/admissionLoop.js +20 -82
- package/dist/shared/dispatch/admissionLoop.js.map +1 -1
- package/dist/shared/dispatch/coordinator.d.ts +5 -5
- package/dist/shared/dispatch/coordinator.d.ts.map +1 -1
- package/dist/shared/dispatch/coordinator.js +12 -11
- package/dist/shared/dispatch/coordinator.js.map +1 -1
- package/dist/shared/dispatch/costRank.d.ts +5 -155
- package/dist/shared/dispatch/costRank.d.ts.map +1 -1
- package/dist/shared/dispatch/costRank.js +2 -179
- package/dist/shared/dispatch/costRank.js.map +1 -1
- package/dist/shared/dispatch/dispatchQuotaContract.d.ts +37 -38
- package/dist/shared/dispatch/dispatchQuotaContract.d.ts.map +1 -1
- package/dist/shared/dispatch/dispatchQuotaContract.js +0 -1
- package/dist/shared/dispatch/dispatchQuotaContract.js.map +1 -1
- package/dist/shared/dispatch/hybridDispatch.d.ts +6 -2
- package/dist/shared/dispatch/hybridDispatch.d.ts.map +1 -1
- package/dist/shared/dispatch/hybridDispatch.js +1 -1
- package/dist/shared/dispatch/hybridDispatch.js.map +1 -1
- package/dist/shared/dispatch/rollingDispatch.d.ts +4 -4
- package/dist/shared/dispatch/rollingDispatch.d.ts.map +1 -1
- package/dist/shared/dispatch/rollingDispatch.js +13 -11
- package/dist/shared/dispatch/rollingDispatch.js.map +1 -1
- package/dist/shared/dispatch/unifiedRolling.d.ts +2 -2
- package/dist/shared/dispatch/unifiedRolling.d.ts.map +1 -1
- package/dist/shared/dispatch/unifiedRolling.js +1 -1
- package/dist/shared/dispatch/unifiedRolling.js.map +1 -1
- package/dist/shared/engine/obligationEngine.d.ts +2 -2
- package/dist/shared/friction/stepBoundaryCapture.d.ts +5 -59
- package/dist/shared/friction/stepBoundaryCapture.d.ts.map +1 -1
- package/dist/shared/friction/stepBoundaryCapture.js +11 -107
- package/dist/shared/friction/stepBoundaryCapture.js.map +1 -1
- package/dist/shared/index.d.ts +13 -16
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +9 -13
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/io/stateDir.d.ts +2 -2
- package/dist/shared/io/stateDir.js +2 -2
- package/dist/shared/providers/auditorSources.d.ts +10 -84
- package/dist/shared/providers/auditorSources.d.ts.map +1 -1
- package/dist/shared/providers/auditorSources.js +42 -261
- package/dist/shared/providers/auditorSources.js.map +1 -1
- package/dist/shared/providers/dispatchExclusion.d.ts +22 -0
- package/dist/shared/providers/dispatchExclusion.d.ts.map +1 -0
- package/dist/shared/providers/dispatchExclusion.js +23 -0
- package/dist/shared/providers/dispatchExclusion.js.map +1 -0
- package/dist/shared/providers/identity.d.ts +2 -66
- package/dist/shared/providers/identity.d.ts.map +1 -1
- package/dist/shared/providers/identity.js +2 -72
- package/dist/shared/providers/identity.js.map +1 -1
- package/dist/shared/providers/providerFactory.d.ts +0 -3
- package/dist/shared/providers/providerFactory.d.ts.map +1 -1
- package/dist/shared/providers/providerFactory.js +5 -32
- package/dist/shared/providers/providerFactory.js.map +1 -1
- package/dist/shared/providers/providerPathGuard.d.ts +3 -3
- package/dist/shared/providers/providerPathGuard.js +7 -7
- package/dist/shared/providers/providerPathGuard.js.map +1 -1
- package/dist/shared/quota/apiPool.d.ts +19 -22
- package/dist/shared/quota/apiPool.d.ts.map +1 -1
- package/dist/shared/quota/apiPool.js +66 -47
- package/dist/shared/quota/apiPool.js.map +1 -1
- package/dist/shared/quota/capacity.d.ts +29 -24
- package/dist/shared/quota/capacity.d.ts.map +1 -1
- package/dist/shared/quota/capacity.js +30 -4
- package/dist/shared/quota/capacity.js.map +1 -1
- package/dist/shared/quota/codexHostConfig.d.ts +6 -13
- package/dist/shared/quota/codexHostConfig.d.ts.map +1 -1
- package/dist/shared/quota/codexHostConfig.js +8 -14
- package/dist/shared/quota/codexHostConfig.js.map +1 -1
- package/dist/shared/quota/fileLock.d.ts +7 -0
- package/dist/shared/quota/fileLock.d.ts.map +1 -1
- package/dist/shared/quota/fileLock.js +32 -4
- package/dist/shared/quota/fileLock.js.map +1 -1
- package/dist/shared/quota/hostLimits.d.ts +1 -1
- package/dist/shared/quota/hostLimits.d.ts.map +1 -1
- package/dist/shared/quota/hostLimits.js +8 -11
- package/dist/shared/quota/hostLimits.js.map +1 -1
- package/dist/shared/quota/hostPool.d.ts +1 -1
- package/dist/shared/quota/hostPool.js +2 -2
- package/dist/shared/quota/hostPool.js.map +1 -1
- package/dist/shared/quota/limits.d.ts.map +1 -1
- package/dist/shared/quota/limits.js +30 -26
- package/dist/shared/quota/limits.js.map +1 -1
- package/dist/shared/quota/scheduler.d.ts +2 -3
- package/dist/shared/quota/scheduler.d.ts.map +1 -1
- package/dist/shared/quota/scheduler.js +1 -1
- package/dist/shared/quota/scheduler.js.map +1 -1
- package/dist/shared/quota/types.d.ts +10 -10
- package/dist/shared/quota/types.d.ts.map +1 -1
- package/dist/shared/quota/types.js +4 -7
- package/dist/shared/quota/types.js.map +1 -1
- package/dist/shared/repair/brokeredDispatch.d.ts.map +1 -1
- package/dist/shared/repair/brokeredDispatch.js +3 -0
- package/dist/shared/repair/brokeredDispatch.js.map +1 -1
- package/dist/shared/reporting/auditDeliverable.d.ts.map +1 -1
- package/dist/shared/reporting/auditDeliverable.js +1 -0
- package/dist/shared/reporting/auditDeliverable.js.map +1 -1
- package/dist/shared/rolling/pausedState.d.ts +7 -7
- package/dist/shared/rolling/pausedState.js +3 -3
- package/dist/shared/tokens.d.ts +2 -5
- package/dist/shared/tokens.d.ts.map +1 -1
- package/dist/shared/tokens.js +15 -15
- package/dist/shared/tokens.js.map +1 -1
- package/dist/shared/types/auditorDescriptor.d.ts +3 -2
- package/dist/shared/types/auditorDescriptor.d.ts.map +1 -1
- package/dist/shared/types/auditorDescriptor.js +3 -2
- package/dist/shared/types/auditorDescriptor.js.map +1 -1
- package/dist/shared/types/finding.d.ts +80 -0
- package/dist/shared/types/finding.d.ts.map +1 -1
- package/dist/shared/types/finding.js +17 -0
- package/dist/shared/types/finding.js.map +1 -1
- package/dist/shared/types/sessionConfig.d.ts +5 -5
- package/dist/shared/types/sessionConfig.js +1 -1
- package/dist/shared/validation/findingsReport.d.ts.map +1 -1
- package/dist/shared/validation/findingsReport.js +3 -0
- package/dist/shared/validation/findingsReport.js.map +1 -1
- package/docs/audit-pkg/development.md +3 -2
- package/docs/audit-pkg/operator-guide.md +13 -106
- package/docs/audit-pkg/product.md +8 -7
- package/docs/audit-pkg/release.md +38 -29
- package/opencode.json +2 -2
- package/package.json +7 -4
- package/skills/audit-code/SKILL.md +2 -1
- package/skills/audit-code/audit-code.prompt.md +4 -3
- package/skills/remediate-code/remediate-code.prompt.md +2 -1
- package/dist/audit/cli/providerConfirmationStep.d.ts +0 -106
- package/dist/audit/cli/providerConfirmationStep.d.ts.map +0 -1
- package/dist/audit/cli/providerConfirmationStep.js +0 -396
- package/dist/audit/cli/providerConfirmationStep.js.map +0 -1
- package/dist/audit/orchestrator/providerConfirmation.d.ts +0 -25
- package/dist/audit/orchestrator/providerConfirmation.d.ts.map +0 -1
- package/dist/audit/orchestrator/providerConfirmation.js +0 -60
- package/dist/audit/orchestrator/providerConfirmation.js.map +0 -1
- package/dist/shared/providers/providerConfirmation.d.ts +0 -141
- package/dist/shared/providers/providerConfirmation.d.ts.map +0 -1
- package/dist/shared/providers/providerConfirmation.js +0 -420
- package/dist/shared/providers/providerConfirmation.js.map +0 -1
- package/dist/shared/providers/proxyCatalog.d.ts +0 -158
- package/dist/shared/providers/proxyCatalog.d.ts.map +0 -1
- package/dist/shared/providers/proxyCatalog.js +0 -658
- package/dist/shared/providers/proxyCatalog.js.map +0 -1
- package/dist/shared/providers/sharedProviderConfirmation.d.ts +0 -802
- package/dist/shared/providers/sharedProviderConfirmation.d.ts.map +0 -1
- package/dist/shared/providers/sharedProviderConfirmation.js +0 -1865
- package/dist/shared/providers/sharedProviderConfirmation.js.map +0 -1
- package/dist/shared/types/providerConfirmation.d.ts +0 -334
- package/dist/shared/types/providerConfirmation.d.ts.map +0 -1
- package/dist/shared/types/providerConfirmation.js +0 -35
- package/dist/shared/types/providerConfirmation.js.map +0 -1
|
@@ -1,802 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DC-2 — shared, session-scoped provider confirmation (Gate-0).
|
|
3
|
-
*
|
|
4
|
-
* The design wants ONE provider confirmation spanning an audit→remediate run:
|
|
5
|
-
* the first tool to run writes the operator's confirmed route DECISION to a
|
|
6
|
-
* SHARED artifact at `<root>/.audit-tools/provider-confirmation.json` (NOT the
|
|
7
|
-
* per-tool audit artifacts dir); the second tool reads and honors it. "Session" =
|
|
8
|
-
* the shared `.audit-tools` dir for that repo+run, so no new identity scheme is
|
|
9
|
-
* needed.
|
|
10
|
-
*
|
|
11
|
-
* **What this artifact carries is POLICY, not reach (G3).** The operator's
|
|
12
|
-
* decision — exclusions, cost order, λ — is a set of *rules*, valid for any
|
|
13
|
-
* auditor. What is *reachable* is per-auditor capability and is re-resolved from
|
|
14
|
-
* live env/PATH at the moment of use, never inherited from whoever wrote this
|
|
15
|
-
* file. So every read here is reach-free: it returns the persisted decision and
|
|
16
|
-
* nothing else.
|
|
17
|
-
*
|
|
18
|
-
* INV-DC1-6 (never-block) is the only invariant left in tension, and it now
|
|
19
|
-
* resolves to a plain two-valued read: a remediate run standalone with no prior
|
|
20
|
-
* audit resolves its provider independently — absence or corruption of the
|
|
21
|
-
* artifact is NOT an error, it is `null`.
|
|
22
|
-
*
|
|
23
|
-
* The former roster-staleness check (and its CE-012 three-valued `reconfirm`
|
|
24
|
-
* state) is GONE. It compared the *writing* auditor's roster against the reader's
|
|
25
|
-
* — meaningless cross-auditor by construction — and answered a real event (a
|
|
26
|
-
* backend the operator never confirmed became reachable) by silently discarding
|
|
27
|
-
* the operator's cost order and λ, while reaching no obligation at all. The
|
|
28
|
-
* `autonomous_mode`-keyed reconciliation gate
|
|
29
|
-
* ({@link computeNewlyReachableBackends}) replaces it: it compares the operator's
|
|
30
|
-
* DECISION against *this* auditor's freshly-resolved reach, which is well-defined
|
|
31
|
-
* across auditors, and it actually fires.
|
|
32
|
-
*
|
|
33
|
-
* CE-003 (lockless read races the writer rename): writes go through the shared
|
|
34
|
-
* atomic writer (temp + atomic rename) under `withFileLock`, so a lockless
|
|
35
|
-
* reader always observes either the complete old file or the complete new file —
|
|
36
|
-
* never a torn intermediate.
|
|
37
|
-
*
|
|
38
|
-
* PB-1 (opencode opt-in): the confirmed pool is derived from `discoverProviders`,
|
|
39
|
-
* which already withholds a bare-PATH opencode unless it is explicitly
|
|
40
|
-
* configured, so the shared confirmation inherits that opt-in for free.
|
|
41
|
-
*/
|
|
42
|
-
import type { DispatchableSource, ResolvedProviderName, SessionConfig } from "../types/sessionConfig.js";
|
|
43
|
-
import type { RunLogger } from "../observability/runLog.js";
|
|
44
|
-
import type { ConfirmedPoolEntry, PersistedPoolEntry, HostModelCostEntry, SourcePoolCostEntry, ProviderConfirmationInput } from "../types/providerConfirmation.js";
|
|
45
|
-
/**
|
|
46
|
-
* Schema version for the shared confirmation artifact. Bumped independently of
|
|
47
|
-
* the per-tool seam contract (PROVIDER_CONFIRMATION_RESULT_VERSION) — this is
|
|
48
|
-
* the cross-tool session artifact carrying the operator's route DECISION
|
|
49
|
-
* (exclusions, cost order, λ), a distinct shape from the seam's pool snapshot.
|
|
50
|
-
*/
|
|
51
|
-
export declare const SHARED_PROVIDER_CONFIRMATION_VERSION: "1.0.0";
|
|
52
|
-
/**
|
|
53
|
-
* Clamp an operator-supplied cost↔speed dispatch bias (λ) to [0, 1], or `undefined`
|
|
54
|
-
* when it is absent/non-finite. Single-sourced so parse-time and read-time agree.
|
|
55
|
-
* (spec/dispatch-quota.md).
|
|
56
|
-
*/
|
|
57
|
-
export declare function clampDispatchBias(value: unknown): number | undefined;
|
|
58
|
-
/** File name of the shared session-level confirmation under `.audit-tools/`. */
|
|
59
|
-
export declare const SHARED_PROVIDER_CONFIRMATION_FILENAME = "provider-confirmation.json";
|
|
60
|
-
/** `<root>/.audit-tools/provider-confirmation.json` (absolute). */
|
|
61
|
-
export declare function sharedProviderConfirmationPath(root: string): string;
|
|
62
|
-
/**
|
|
63
|
-
* The operator's explicit route DECISION — reach-free by construction.
|
|
64
|
-
*
|
|
65
|
-
* This is the POLICY half of the Gate-0 confirmation: it names *rules* (which
|
|
66
|
-
* provider names the operator ruled out, which self-spawn-blocked ones they ruled
|
|
67
|
-
* back in), never *reachable endpoints*. It is deliberately the operator's raw
|
|
68
|
-
* `exclude` / `include` input rather than the derived per-entry `excluded` flag,
|
|
69
|
-
* because that flag folds in the WRITING auditor's `CLAUDECODE`/`CODEX` env via
|
|
70
|
-
* `isSelfSpawnBlocked` — persisting it would make one auditor's environment
|
|
71
|
-
* decide another's routing. Self-spawn-blocked is therefore recomputed in the
|
|
72
|
-
* READING process (see {@link resolveDispatchExclusion}).
|
|
73
|
-
*
|
|
74
|
-
* Because policy is reach-independent, it stays valid when the discovered reach
|
|
75
|
-
* changes. No read of this artifact gates on a reach check, for exactly that
|
|
76
|
-
* reason: an exclusion must fail CLOSED (keep excluding) when reach shifts, never
|
|
77
|
-
* fail open — and neither may the cost order or λ be discarded by a reach event
|
|
78
|
-
* they do not depend on (G3 step 1).
|
|
79
|
-
*/
|
|
80
|
-
export interface ConfirmedDispatchPolicy {
|
|
81
|
-
/**
|
|
82
|
-
* {@link DispatchExclusionPattern}s **the OPERATOR** ruled out of the dispatchable
|
|
83
|
-
* pool. Model-granular by default (`provider:model`) — the operator confirms
|
|
84
|
-
* *model* choices, so excluding one model of a multi-model backend must not drop
|
|
85
|
-
* the backend's other models.
|
|
86
|
-
*
|
|
87
|
-
* ⚠ Operator-authored ONLY. Tool-generated fail-closed patterns live in
|
|
88
|
-
* {@link auto_exclude} and must never be merged into this list: the two have
|
|
89
|
-
* different lifetimes, and once merged they are indistinguishable, so a
|
|
90
|
-
* carry-forward would launder a tool guess into permanent operator policy.
|
|
91
|
-
*/
|
|
92
|
-
exclude?: DispatchExclusionPattern[];
|
|
93
|
-
/**
|
|
94
|
-
* Patterns **the GATE** authored on the operator's behalf — the fail-closed
|
|
95
|
-
* reconciliation excluding a newly-reachable backend that no operator decision
|
|
96
|
-
* covers (autonomous/headless path only).
|
|
97
|
-
*
|
|
98
|
-
* Kept separate from {@link exclude} because provenance decides lifetime. An
|
|
99
|
-
* operator exclusion is a durable rule and is carried forward across promotions; an
|
|
100
|
-
* auto-exclusion is a *placeholder for an answer that was never given*, so the next
|
|
101
|
-
* operator submission SUPERSEDES it. Merged into one list, the carry-forward cannot
|
|
102
|
-
* tell them apart and makes the tool's guess permanent — with no signal, because the
|
|
103
|
-
* backend is a confirmed key by then and the reconciliation delta never re-surfaces
|
|
104
|
-
* it. Honored at dispatch exactly like {@link exclude} (see
|
|
105
|
-
* {@link resolveDispatchExclusion}), so separating them weakens nothing.
|
|
106
|
-
*/
|
|
107
|
-
auto_exclude?: DispatchExclusionPattern[];
|
|
108
|
-
/** Self-spawn-blocked provider names the operator explicitly opted back IN. */
|
|
109
|
-
include?: ResolvedProviderName[];
|
|
110
|
-
/**
|
|
111
|
-
* The operator's RAW capability answer — the `capability_order` key list exactly as
|
|
112
|
-
* submitted, most-capable-first.
|
|
113
|
-
*
|
|
114
|
-
* Stored verbatim rather than reconstructed from the resulting `capability_rank`s,
|
|
115
|
-
* which is the same reason `exclude` stores raw patterns. Reconstruction cannot
|
|
116
|
-
* distinguish a rank the operator authored from one that came from EXTERNAL evidence
|
|
117
|
-
* (a source's own registry rank), so it laundered external numbers into the
|
|
118
|
-
* operator's answer: a no-op promotion silently re-ranked confirmed models, and the
|
|
119
|
-
* laundered id then read as "evidenced" permanently — even after the external
|
|
120
|
-
* evidence disappeared, which is precisely the fail-open this obligation exists to
|
|
121
|
-
* close. Persisting the answer makes the distinction unrepresentable instead of
|
|
122
|
-
* merely documented.
|
|
123
|
-
*/
|
|
124
|
-
capability_order?: string[];
|
|
125
|
-
/**
|
|
126
|
-
* R3-3: the model ids whose CURRENT position in {@link capability_order} was
|
|
127
|
-
* LLM-authored rather than operator-authored — always a subset of
|
|
128
|
-
* `capability_order`, never a superset. Tool-derived provenance, never itself
|
|
129
|
-
* submitted: an autonomous run has no operator to ask, so the CLI asks the host
|
|
130
|
-
* LLM instead (same submission machinery an operator would use), and the
|
|
131
|
-
* executor tags the result here rather than trusting either side to self-report
|
|
132
|
-
* authorship. An operator's later submission naming one of these ids repositions
|
|
133
|
-
* it freely (it is NOT an anchor on that submission) and removes it from this set
|
|
134
|
-
* — it is operator-authored from then on. See `advanceCapabilityOrderLlmRanked`
|
|
135
|
-
* and `capabilityOrderNonAnchors`.
|
|
136
|
-
*/
|
|
137
|
-
capability_order_llm_ranked?: string[];
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* The string form of an exclusion pattern. Axis-explicit: the rule names its
|
|
141
|
-
* axis as a prefix, so the grammar is unambiguous against open namespaces and
|
|
142
|
-
* an unknown axis is a PARSE ERROR, not an inert rule.
|
|
143
|
-
*
|
|
144
|
-
* | Pattern | Axis | Matches |
|
|
145
|
-
* |---|---|---|
|
|
146
|
-
* | `transport:codex` | transport | every model on that adapter |
|
|
147
|
-
* | `transport:openai-compatible/glm-5.2` | transport | one model on that adapter (model after `/`) |
|
|
148
|
-
* | `service:nim` | service | every model from that vendor, however reached |
|
|
149
|
-
* | `service:nim/z-ai/glm-5.2` | service | one model from that vendor |
|
|
150
|
-
* | `host:localhost:8000` | host | by endpoint address (port-specific) |
|
|
151
|
-
* | `host:integrate.api.nvidia.com` | host | by endpoint address (port-agnostic) |
|
|
152
|
-
*
|
|
153
|
-
* There is deliberately **no `model:` axis** — a cross-service model rule
|
|
154
|
-
* recombines the identities the gate exists to keep apart.
|
|
155
|
-
*
|
|
156
|
-
* ⚠ This is a THIRD keyspace, deliberately distinct from the quota-ledger pool
|
|
157
|
-
* identity (`provider[#account]/model`, `quotaPoolKey`): an account is
|
|
158
|
-
* irrelevant to a rule about a backend. Do not unify them.
|
|
159
|
-
*/
|
|
160
|
-
export type DispatchExclusionPattern = string;
|
|
161
|
-
/** A backend an exclusion rule can be evaluated against — structurally a `DispatchableSource`. */
|
|
162
|
-
export interface ExcludableBackend {
|
|
163
|
-
transport: string;
|
|
164
|
-
service?: string;
|
|
165
|
-
model?: string;
|
|
166
|
-
endpoint?: string;
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* The resolved exclusion rule set for THIS process: the operator's persisted
|
|
170
|
-
* patterns plus every locally self-spawn-blocked provider. Applied as a
|
|
171
|
-
* set-difference FILTER over freshly-gathered reach, never additively.
|
|
172
|
-
*/
|
|
173
|
-
export interface DispatchExclusion {
|
|
174
|
-
/** True ⇒ this backend is ruled out and must not become a dispatch pool. */
|
|
175
|
-
excludes(backend: ExcludableBackend): boolean;
|
|
176
|
-
/**
|
|
177
|
-
* The first pattern that rules this backend out, or null when none does.
|
|
178
|
-
*
|
|
179
|
-
* Attribution for the capacity guard: when the rule set removes EVERY gathered
|
|
180
|
-
* source, "zero capacity" alone sends the operator hunting through their whole
|
|
181
|
-
* policy — the guard has to be able to name the rules that did it. `excludes` is
|
|
182
|
-
* derived from this (`excludedBy(b) !== null`), so the boolean verdict and the
|
|
183
|
-
* attributed pattern can never disagree.
|
|
184
|
-
*/
|
|
185
|
-
excludedBy(backend: ExcludableBackend): DispatchExclusionPattern | null;
|
|
186
|
-
}
|
|
187
|
-
export interface SharedProviderConfirmation {
|
|
188
|
-
/** Must equal SHARED_PROVIDER_CONFIRMATION_VERSION. */
|
|
189
|
-
schema_version: typeof SHARED_PROVIDER_CONFIRMATION_VERSION;
|
|
190
|
-
/**
|
|
191
|
-
* The operator's explicit, reach-free route decision. Read at dispatch by
|
|
192
|
-
* {@link resolveDispatchExclusion} and applied as a set-difference filter over
|
|
193
|
-
* freshly-discovered reach — never additively. Absent ⇒ no operator exclusions
|
|
194
|
-
* (self-spawn-blocked providers are still excluded, recomputed locally).
|
|
195
|
-
*/
|
|
196
|
-
policy?: ConfirmedDispatchPolicy;
|
|
197
|
-
/** Always true: the pool applies to the whole audit→remediate session. */
|
|
198
|
-
session_level: true;
|
|
199
|
-
/** ISO-8601 timestamp of when the pool was confirmed. */
|
|
200
|
-
confirmed_at: string;
|
|
201
|
-
/**
|
|
202
|
-
* The confirmed provider pool as PERSISTED — decision only, no reach (G3 B+D).
|
|
203
|
-
* See {@link PersistedPoolEntry}: the reach half is deliberately unrepresentable
|
|
204
|
-
* here, so one auditor's environment can never route another's.
|
|
205
|
-
*/
|
|
206
|
-
provider_pool: PersistedPoolEntry[];
|
|
207
|
-
/**
|
|
208
|
-
* Host self-reported model tiers with their operator-confirmed cost positions
|
|
209
|
-
* (follow-up c). Merged into the model-keyed dispatch positions map by
|
|
210
|
-
* `readConfirmedCostPositions` so host-native tiers route by their confirmed
|
|
211
|
-
* order. Absent/empty on the headless path (no host roster is reported).
|
|
212
|
-
*/
|
|
213
|
-
host_model_cost_order?: HostModelCostEntry[];
|
|
214
|
-
/**
|
|
215
|
-
* Dispatchable SOURCE pools (explicit `sources[]` + proxy expansion) with their
|
|
216
|
-
* operator-confirmed cost positions (Gate-0 source fold). Merged into the model-keyed
|
|
217
|
-
* dispatch positions map by `readConfirmedCostPositions` so a source pool routes by its
|
|
218
|
-
* confirmed order exactly like a provider pool / host tier. Absent when no source is
|
|
219
|
-
* configured (or a confirmation written before this field existed) ⇒ dispatch falls to
|
|
220
|
-
* declared/catalog price then tier, exactly as before.
|
|
221
|
-
*/
|
|
222
|
-
source_pool_cost_order?: SourcePoolCostEntry[];
|
|
223
|
-
/**
|
|
224
|
-
* Operator-confirmed cost↔speed dispatch bias (λ) ∈ [0, 1], the durable operating
|
|
225
|
-
* point on the cost-vs-throughput frontier (spec/dispatch-quota.md). Read
|
|
226
|
-
* back at dispatch by `readConfirmedDispatchBias` and applied by `admitBatch`. Absent
|
|
227
|
-
* ⇒ the cost-first default (λ=0), so a confirmation written before this field existed
|
|
228
|
-
* (or a headless run) behaves exactly as before.
|
|
229
|
-
*/
|
|
230
|
-
dispatch_bias?: number;
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* The Gate-0 confirmation as RENDERED to the operator — identical to the persisted
|
|
234
|
-
* {@link SharedProviderConfirmation} except that `provider_pool` carries the FULL
|
|
235
|
-
* {@link ConfirmedPoolEntry} (this auditor's freshly-derived reach: tier, price, why
|
|
236
|
-
* a backend is excluded). This shape exists ONLY in memory; it never reaches disk.
|
|
237
|
-
*/
|
|
238
|
-
export interface RenderedProviderConfirmation extends Omit<SharedProviderConfirmation, "provider_pool"> {
|
|
239
|
-
provider_pool: ConfirmedPoolEntry[];
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Project the render DTO down to what actually gets PERSISTED: the operator's
|
|
243
|
-
* decision, with this auditor's reach assessment dropped (G3 B+D).
|
|
244
|
-
*
|
|
245
|
-
* The PRODUCER is split — not the write site. `writeSharedProviderConfirmation`
|
|
246
|
-
* receives an already-typed value, so projecting THERE would leave the reach fields
|
|
247
|
-
* representable on the persisted type and a future caller could put them back.
|
|
248
|
-
* Projecting here makes the persisted shape carry no reach BY CONSTRUCTION.
|
|
249
|
-
*/
|
|
250
|
-
export declare function buildSharedProviderConfirmation(...args: Parameters<typeof buildProviderConfirmationRender>): SharedProviderConfirmation;
|
|
251
|
-
/**
|
|
252
|
-
* Build a fresh shared confirmation from auto-discovery. Guarantees the
|
|
253
|
-
* always-available `worker-command` fallback is present in the pool (it blocks
|
|
254
|
-
* auto-dispatch and so is never PATH-detected, but the pool must always be able
|
|
255
|
-
* to fall back to it) and stamps the schema version, session-level flag, and
|
|
256
|
-
* confirmation timestamp.
|
|
257
|
-
*
|
|
258
|
-
* SECURITY (self-spawn exclusion): a provider that `discoverProviders` flags as
|
|
259
|
-
* `selfSpawnBlocked` (claude-code under `CLAUDECODE`, codex under `CODEX`) is set
|
|
260
|
-
* `excluded: true` AND carries the machine-readable `self_spawn_blocked` flag, so
|
|
261
|
-
* it is OUT of the dispatchable pool by default — launching it would self-spawn a
|
|
262
|
-
* fresh agent from inside an active session of the same agent. The operator can
|
|
263
|
-
* deliberately re-include it by naming it in `include`; that overrides the
|
|
264
|
-
* exclusion (the host still always retains the worker-command fallback).
|
|
265
|
-
*
|
|
266
|
-
* @param sessionConfig - Current session config; may be an empty `{}`.
|
|
267
|
-
* @param env - Process env snapshot; defaults to `process.env`.
|
|
268
|
-
* @param exclude - {@link DispatchExclusionPattern}s to pre-exclude (from a
|
|
269
|
-
* prior gate). A `provider:model` pattern marks a pool entry excluded only when
|
|
270
|
-
* that entry's `representativeModelId` IS that model — the same key the routing
|
|
271
|
-
* filter matches on, so display and dispatch cannot disagree.
|
|
272
|
-
* @param include - Provider names the operator explicitly opts back IN,
|
|
273
|
-
* overriding the default self-spawn-blocked exclusion for those names.
|
|
274
|
-
* @param detectCommand - Injectable PATH-detection hook, forwarded to
|
|
275
|
-
* `discoverProviders` so tests can drive discovery deterministically.
|
|
276
|
-
* @param input - Operator's Gate-0 submission (interactive path): its
|
|
277
|
-
* `cost_order` overrides the suggested ordering and its `host_models` become
|
|
278
|
-
* priced, orderable host-native tiers (`host_model_cost_order`). Omit for the
|
|
279
|
-
* headless / no-operator path — the tool then emits its price-ascending
|
|
280
|
-
* suggestion with no host models, exactly as before. `exclude`/`include` are
|
|
281
|
-
* passed via the dedicated params above (the executor forwards them from the
|
|
282
|
-
* same input), so this arg governs ordering + host roster only.
|
|
283
|
-
*/
|
|
284
|
-
export declare function buildProviderConfirmationRender(sessionConfig?: SessionConfig, env?: NodeJS.ProcessEnv, exclude?: DispatchExclusionPattern[], include?: ResolvedProviderName[], detectCommand?: (command: string) => boolean, input?: ProviderConfirmationInput, sources?: DispatchableSource[],
|
|
285
|
-
/**
|
|
286
|
-
* Gate-authored fail-closed patterns, kept SEPARATE from the operator's `exclude`
|
|
287
|
-
* so provenance survives to disk (see {@link ConfirmedDispatchPolicy.auto_exclude}).
|
|
288
|
-
* Both kinds mark a pool entry excluded in the render — the split governs lifetime,
|
|
289
|
-
* not enforcement — so the two are unioned for the display/routing decision below
|
|
290
|
-
* and only split again when the policy is persisted.
|
|
291
|
-
*/
|
|
292
|
-
autoExclude?: DispatchExclusionPattern[],
|
|
293
|
-
/**
|
|
294
|
-
* R3-3: the FINAL `capability_order_llm_ranked` set for this promotion (already
|
|
295
|
-
* advanced across rule 1/2 by the caller — {@link advanceCapabilityOrderLlmRanked}).
|
|
296
|
-
* Persisted verbatim into the policy; empty for the display-only "suggested"
|
|
297
|
-
* render nextStepCommand builds (that call never persists, so provenance is moot).
|
|
298
|
-
*/
|
|
299
|
-
capabilityOrderLlmRanked?: readonly string[]): RenderedProviderConfirmation;
|
|
300
|
-
/**
|
|
301
|
-
* The keys of the operator's persisted DECISION — the CONFIRMED half of the gate.
|
|
302
|
-
*
|
|
303
|
-
* All three pools contribute, and each is load-bearing: `annotateConfirmedPool`
|
|
304
|
-
* folds a source away when its model is already claimed by a provider entry, so a
|
|
305
|
-
* source can be represented ONLY by `provider_pool[].model_id`; and a host tier
|
|
306
|
-
* appears only in `host_model_cost_order`. Reading fewer than all three would
|
|
307
|
-
* manufacture a phantom delta for an already-confirmed backend.
|
|
308
|
-
*
|
|
309
|
-
* A host tier with no `provider` contributes NOTHING, and that is the deliberate
|
|
310
|
-
* fail-SAFE degradation for a confirmation written before the field existed. The
|
|
311
|
-
* alternative — falling back to the bare `model_id` — is precisely the bypass this
|
|
312
|
-
* identity exists to close: a confirmed *host* model would silently approve an
|
|
313
|
-
* identically-named model on some other provider. Contributing no key can only ever
|
|
314
|
-
* cause the gate to ASK about a backend again (loud, and the operator's answer then
|
|
315
|
-
* records the provider); it can never approve one unseen.
|
|
316
|
-
*/
|
|
317
|
-
export declare function confirmedBackendKeys(confirmation: SharedProviderConfirmation): Set<string>;
|
|
318
|
-
/** One backend in the gate's delta: reachable now, absent from the decision. */
|
|
319
|
-
export interface NewlyReachableBackend {
|
|
320
|
-
/**
|
|
321
|
-
* The gate key — {@link backendIdentity}. Stable, operator-facing, and
|
|
322
|
-
* provider-qualified.
|
|
323
|
-
*/
|
|
324
|
-
key: string;
|
|
325
|
-
/** The backend's provider name. Display only — the prompt names it beside `key`. */
|
|
326
|
-
provider: ResolvedProviderName;
|
|
327
|
-
/**
|
|
328
|
-
* The backend's serving vendor / service name (`service ?? transport`).
|
|
329
|
-
*/
|
|
330
|
-
service?: string;
|
|
331
|
-
/**
|
|
332
|
-
* The transport-qualified {@link DispatchExclusionPattern} that rules out
|
|
333
|
-
* **exactly this transport route**, built HERE beside the key it was compared on.
|
|
334
|
-
*/
|
|
335
|
-
exclusion_pattern: DispatchExclusionPattern;
|
|
336
|
-
/**
|
|
337
|
-
* The service-qualified {@link DispatchExclusionPattern} (`service:vendor/model` or `service:vendor`)
|
|
338
|
-
* that rules out **every transport reaching this vendor/service**. Emitted by autonomous fail-closed
|
|
339
|
-
* writes so unconfirmed backends stay excluded across transport/proxy changes.
|
|
340
|
-
*/
|
|
341
|
-
service_exclusion_pattern?: DispatchExclusionPattern;
|
|
342
|
-
}
|
|
343
|
-
/**
|
|
344
|
-
* DELTA = **REACH-NOW \ CONFIRMED**: the backends this auditor can reach *right
|
|
345
|
-
* now* that the operator's persisted decision never mentions. Sorted by key, so the
|
|
346
|
-
* result is stable for prompt rendering + comparison.
|
|
347
|
-
*
|
|
348
|
-
* This is a **set difference — a FILTER over fresh reach, never additive.** The
|
|
349
|
-
* opposite direction (CONFIRMED \ REACH-NOW: a backend the operator confirmed that
|
|
350
|
-
* this auditor cannot reach) is the harmless *subset* case and is deliberately
|
|
351
|
-
* silent — it is also why the synthetic `worker-command` entry and
|
|
352
|
-
* `host_model_cost_order` need no special-casing here.
|
|
353
|
-
*
|
|
354
|
-
* @param confirmation - The persisted decision (CONFIRMED).
|
|
355
|
-
* @param sessionConfig - The EFFECTIVE config, so `representativeModelId` derives
|
|
356
|
-
* keys identically to the write side.
|
|
357
|
-
* @param sources - REACH-NOW's source half. MUST come from the
|
|
358
|
-
* `gatherDispatchableSources` chokepoint — the single async source-gather point
|
|
359
|
-
* both `buildSourcePools` and the Gate-0 surface consume, so what the operator
|
|
360
|
-
* confirms is exactly what routes. Re-deriving it from `resolveAmbientSources`
|
|
361
|
-
* would reintroduce the display/dispatch drift that invariant forbids, and is
|
|
362
|
-
* structurally blind to descriptor-supplied sources, the demoted primary, and the
|
|
363
|
-
* legacy `openai_compatible` fold.
|
|
364
|
-
* @param env - Process env, for `discoverProviders` (REACH-NOW's provider half).
|
|
365
|
-
* @param detectCommand - Injectable PATH-detection hook so tests drive discovery
|
|
366
|
-
* deterministically instead of shelling out.
|
|
367
|
-
*/
|
|
368
|
-
export declare function computeNewlyReachableBackends(confirmation: SharedProviderConfirmation, sessionConfig: SessionConfig, sources?: readonly DispatchableSource[], env?: NodeJS.ProcessEnv, detectCommand?: (command: string) => boolean): NewlyReachableBackend[];
|
|
369
|
-
/**
|
|
370
|
-
* The dispatchable-pool exclusion rules for THIS process: the operator's explicit
|
|
371
|
-
* {@link DispatchExclusionPattern}s, plus every provider that is self-spawn-blocked
|
|
372
|
-
* *in this process's env* and was not explicitly opted back in.
|
|
373
|
-
*
|
|
374
|
-
* Reach is recomputed here rather than read from the artifact's derived `excluded`
|
|
375
|
-
* flag — that flag encodes the WRITING auditor's env, and an auditor for whom a
|
|
376
|
-
* provider is perfectly spawnable must not inherit another's block. The operator's
|
|
377
|
-
* decision is inherited (it is a rule); the reach assessment is not.
|
|
378
|
-
*
|
|
379
|
-
* ⚠ **These rules are only safe to apply to SOURCE pools.** Inside any agent session
|
|
380
|
-
* the self-spawn half ALWAYS names that agent (`CLAUDECODE` ⇒ `claude-code`, `CODEX`
|
|
381
|
-
* ⇒ `codex`) — i.e. the conversation host itself. Applying them to HOST pools would
|
|
382
|
-
* zero out dispatch entirely: the driver would exclude itself. It is harmless at
|
|
383
|
-
* `buildSourcePools` only because a host can never BE a source — `claude-code` is
|
|
384
|
-
* structurally absent from `DISPATCHABLE_TRANSPORTS`, so in a Claude Code
|
|
385
|
-
* session the filter is a no-op. Honoring an operator exclusion of the host/primary
|
|
386
|
-
* provider therefore is NOT a matter of passing these rules to the host-pool builder;
|
|
387
|
-
* it needs a separate decision about what excluding your own driver should even mean.
|
|
388
|
-
*/
|
|
389
|
-
export declare function resolveDispatchExclusion(policy: ConfirmedDispatchPolicy | null | undefined, env?: NodeJS.ProcessEnv): DispatchExclusion;
|
|
390
|
-
/**
|
|
391
|
-
* The operator-authored patterns that no rule grammar can account for — see
|
|
392
|
-
* {@link isGrammaticalExclusionPattern}. Empty ⇒ every pattern is writable.
|
|
393
|
-
*
|
|
394
|
-
* Order is the operator's own submission order (deduplicated, first occurrence
|
|
395
|
-
* kept), so the refusal names their patterns back in the order they wrote them.
|
|
396
|
-
*/
|
|
397
|
-
export declare function ungrammaticalExclusionPatterns(patterns: readonly DispatchExclusionPattern[]): DispatchExclusionPattern[];
|
|
398
|
-
/**
|
|
399
|
-
* The patterns that matched NOTHING in `backends` — the ADVISORY half, and
|
|
400
|
-
* deliberately not an error.
|
|
401
|
-
*
|
|
402
|
-
* A zero-match rule is legitimate: `auto_exclude` entries go zero-match the moment
|
|
403
|
-
* their backend stops being reachable, and an operator may pre-declare an exclusion
|
|
404
|
-
* for a backend they have not configured yet. It is also the only signal available
|
|
405
|
-
* for the grammatically-valid typo `isGrammaticalExclusionPattern` cannot catch
|
|
406
|
-
* (`openai-compatible:model-typo` — real provider head, open model segment). So it
|
|
407
|
-
* is REPORTED at the confirmation summary and never refused anywhere.
|
|
408
|
-
*
|
|
409
|
-
* Patterns are migrated before matching, so an already-saved bare form is evaluated
|
|
410
|
-
* exactly as it will actually apply at dispatch — not as the string it was typed as.
|
|
411
|
-
*
|
|
412
|
-
* **Empty `backends` ⇒ empty result.** With nothing gathered there is no evidence
|
|
413
|
-
* that any rule failed to match, only that there was nothing to match against, and
|
|
414
|
-
* reporting every rule there would be noise the operator learns to read past.
|
|
415
|
-
*
|
|
416
|
-
* Order is the operator's own submission order (deduplicated, first occurrence kept).
|
|
417
|
-
*/
|
|
418
|
-
export declare function unmatchedExclusionPatterns(patterns: readonly DispatchExclusionPattern[], backends: readonly ExcludableBackend[]): DispatchExclusionPattern[];
|
|
419
|
-
/**
|
|
420
|
-
* Read the operator's confirmed route policy from the shared Gate-0 confirmation.
|
|
421
|
-
*
|
|
422
|
-
* Deliberately reads the artifact DIRECTLY rather than going through
|
|
423
|
-
* {@link readSharedProviderConfirmation}, so that **a corrupt sibling field cannot
|
|
424
|
-
* discard the decision**: `parseSharedProviderConfirmation` returns `null` wholesale
|
|
425
|
-
* on any malformed required field or a `schema_version` mismatch. Routing policy
|
|
426
|
-
* through it would make an unrelated corruption (or a future version bump) silently
|
|
427
|
-
* lift the operator's exclusions — failing OPEN on the one field that must fail
|
|
428
|
-
* closed. Parsing `policy` on its own keeps that blast radius out.
|
|
429
|
-
*
|
|
430
|
-
* (Before G3 this bypass carried a second rationale — dodging the roster-freshness
|
|
431
|
-
* gate. That gate is gone: no read of this artifact is reach-gated any more, so the
|
|
432
|
-
* remaining reason is blast radius alone.)
|
|
433
|
-
*
|
|
434
|
-
* **Honest limit — this is not absolutely fail-closed.** An absent or unparseable
|
|
435
|
-
* artifact yields `null` (no operator policy). That residue is irreducible here: with
|
|
436
|
-
* no readable decision on disk there is nothing to fail closed ON. Self-spawn-blocked
|
|
437
|
-
* providers are still excluded locally by {@link resolveDispatchExclusion}, which
|
|
438
|
-
* needs no artifact.
|
|
439
|
-
*/
|
|
440
|
-
export declare function readConfirmedDispatchPolicy(root: string | undefined): Promise<ConfirmedDispatchPolicy | null>;
|
|
441
|
-
/**
|
|
442
|
-
* Atomically write the shared confirmation to
|
|
443
|
-
* `<root>/.audit-tools/provider-confirmation.json`. The durable write goes
|
|
444
|
-
* through the shared atomic writer (temp + atomic rename) and the whole
|
|
445
|
-
* operation is guarded by `withFileLock` so a concurrent writer can never
|
|
446
|
-
* interleave — and a lockless reader (see `readSharedProviderConfirmation`)
|
|
447
|
-
* never observes a torn file (CE-003).
|
|
448
|
-
*/
|
|
449
|
-
export declare function writeSharedProviderConfirmation(root: string, confirmation: SharedProviderConfirmation, logger?: RunLogger): Promise<void>;
|
|
450
|
-
/**
|
|
451
|
-
* Read + parse the shared confirmation for `root`. TWO-valued:
|
|
452
|
-
*
|
|
453
|
-
* - returns `null` when the artifact is ABSENT or MALFORMED — the caller then
|
|
454
|
-
* resolves its provider independently, exactly as today (INV-DC1-6
|
|
455
|
-
* never-block). Absence is the standalone-remediate case and is not an error.
|
|
456
|
-
* - returns the parsed confirmation otherwise — the operator's persisted route
|
|
457
|
-
* DECISION, honored as-is.
|
|
458
|
-
*
|
|
459
|
-
* **Reach-free by construction (G3).** This read does NOT check whether the
|
|
460
|
-
* reachable backend set still matches whatever the writing auditor saw. It cannot
|
|
461
|
-
* meaningfully: a *different* auditor legitimately has different reach, so that
|
|
462
|
-
* comparison was noise cross-auditor — and answering it by discarding the
|
|
463
|
-
* operator's decision fails OPEN on a policy question. A backend becoming newly
|
|
464
|
-
* reachable is a real event, handled by the reconciliation gate
|
|
465
|
-
* ({@link computeNewlyReachableBackends}), which compares the DECISION against
|
|
466
|
-
* *this* auditor's reach and is keyed on `autonomous_mode`.
|
|
467
|
-
*
|
|
468
|
-
* Never throws: a read/parse failure is treated as absent/malformed → `null`.
|
|
469
|
-
* The read is lockless (no lock needed: the writer's atomic rename guarantees a
|
|
470
|
-
* complete file either way — CE-003) and so cannot deadlock against a writer.
|
|
471
|
-
*/
|
|
472
|
-
export declare function readSharedProviderConfirmation(root: string): Promise<SharedProviderConfirmation | null>;
|
|
473
|
-
/**
|
|
474
|
-
* Read the operator-confirmed cost ordering (rung 1 of costRank; see
|
|
475
|
-
* spec/dispatch-quota.md) from the shared Gate-0 confirmation as a model-keyed
|
|
476
|
-
* `Map<model_id, cost_order>` for the dispatch build sites. Single-sourced so audit
|
|
477
|
-
* and remediate honor it identically. Best-effort and never throws: an absent
|
|
478
|
-
* `root` or a missing/malformed confirmation yields an empty map — dispatch then
|
|
479
|
-
* falls to real price then tier.
|
|
480
|
-
*
|
|
481
|
-
* **Not gated on reach (G3 step 1).** The cost order is the operator's POLICY —
|
|
482
|
-
* "the operator may reorder" — so a shift in what happens to be reachable must not
|
|
483
|
-
* silently discard it. The former roster-freshness gate did exactly that, on the
|
|
484
|
-
* false premise that these positions are reach-derived; they are not, and it was
|
|
485
|
-
* the live defect this fixes.
|
|
486
|
-
*/
|
|
487
|
-
export declare function readConfirmedCostPositions(root: string | undefined): Promise<Map<string, number>>;
|
|
488
|
-
export declare function readConfirmedCapabilityRanks(root: string | undefined): Promise<Map<string, number>>;
|
|
489
|
-
/**
|
|
490
|
-
* The capability-evidence delta: dispatchable models with NO resolvable capability
|
|
491
|
-
* rank. Computed once per invocation (it reads the confirmation + gathers sources)
|
|
492
|
-
* and threaded by reference on the gate, exactly like the reach delta.
|
|
493
|
-
*
|
|
494
|
-
* "Evidenced" is deliberately defined as **the dispatch join resolves** — the same
|
|
495
|
-
* lookup the pool constructors take ({@link readConfirmedCapabilityRanks} keyed on the
|
|
496
|
-
* pool's model), never a parallel predicate. Two consequences, both load-bearing:
|
|
497
|
-
* - a pool with NO model is skipped entirely. It is unjoinable, so pinning it could
|
|
498
|
-
* never clear the delta and it would re-prompt forever.
|
|
499
|
-
* - external evidence (`source.capability_rank`) counts, so a fully-ranked roster
|
|
500
|
-
* never fires the gate at all.
|
|
501
|
-
*
|
|
502
|
-
* Returns [] when no confirmation exists yet — the first-time `missing` case already
|
|
503
|
-
* pauses for the operator, and reporting a delta against a pool they have never seen
|
|
504
|
-
* would fold a second question into a prompt that has not asked the first one yet.
|
|
505
|
-
*
|
|
506
|
-
* Lives HERE, beside {@link readConfirmedCapabilityRanks}, rather than in the audit CLI
|
|
507
|
-
* command it is called from: its failure mode is a LIVELOCK (wrongly admitting an
|
|
508
|
-
* unrankable pool re-prompts `provider_confirmation` forever), and a delta computation
|
|
509
|
-
* with that failure mode must be reachable by a test.
|
|
510
|
-
*/
|
|
511
|
-
export declare function resolveUnevidencedCapabilityPools(root: string, effectiveConfig: SessionConfig): Promise<string[]>;
|
|
512
|
-
/**
|
|
513
|
-
* Read the operator-confirmed cost↔speed dispatch bias (λ ∈ [0,1]) from the shared
|
|
514
|
-
* Gate-0 confirmation for the dispatch build sites (spec/dispatch-quota.md).
|
|
515
|
-
* Single-sourced so audit and remediate apply the identical operating point.
|
|
516
|
-
* Best-effort and never throws: an absent `root`, a missing/malformed confirmation,
|
|
517
|
-
* or an absent field all yield the cost-first default `0`.
|
|
518
|
-
*
|
|
519
|
-
* **Not gated on reach (G3 step 1)** — λ is the operator's durable operating point
|
|
520
|
-
* on the cost-vs-throughput frontier, i.e. POLICY. See
|
|
521
|
-
* {@link readConfirmedCostPositions}.
|
|
522
|
-
*/
|
|
523
|
-
export declare function readConfirmedDispatchBias(root: string | undefined): Promise<number>;
|
|
524
|
-
/** File name of the host-written Gate-0 input under the audit artifacts dir. */
|
|
525
|
-
export declare const PROVIDER_CONFIRMATION_INPUT_FILENAME = "provider-confirmation.input.json";
|
|
526
|
-
/**
|
|
527
|
-
* Validate a parsed value as a ProviderConfirmationInput. Degrade-safe: returns
|
|
528
|
-
* `null` for absent/malformed so a missing or corrupt input is never an error
|
|
529
|
-
* (the executor then falls back to the tool's suggested ordering). Only the
|
|
530
|
-
* version is required; every other field is optional and validated to its
|
|
531
|
-
* expected shape (a malformed field is dropped, not fatal).
|
|
532
|
-
*
|
|
533
|
-
* ⚠ **One deliberate exception: an ungrammatical `exclude` rule THROWS.** Every
|
|
534
|
-
* other field degrades because dropping it costs the operator only that field's
|
|
535
|
-
* effect; dropping an exclusion costs them a backend they ruled out, dispatchable
|
|
536
|
-
* and silent. See the `exclude` branch below for the full argument.
|
|
537
|
-
*/
|
|
538
|
-
export declare function parseProviderConfirmationInput(value: unknown): ProviderConfirmationInput | null;
|
|
539
|
-
/**
|
|
540
|
-
* Seed an incoming Gate-0 submission from the PRIOR confirmation, field by field.
|
|
541
|
-
*
|
|
542
|
-
* **The defect class this closes.** `buildProviderConfirmationRender` rebuilds the
|
|
543
|
-
* whole confirmation from the submission ALONE — every operator decision it persists
|
|
544
|
-
* (`cost_order`, `capability_rank`, the host roster, λ, and the `policy` exclusions) is
|
|
545
|
-
* reconstructed from `input` and from nothing else. So *any* field a submission omits
|
|
546
|
-
* is not "left alone", it is DESTROYED. That is one defect with six faces, and fixing
|
|
547
|
-
* it per-field is what let three of them survive a review round: the prompt's capability
|
|
548
|
-
* example is `{ "capability_order": [...] }`, so an operator answering exactly what was
|
|
549
|
-
* asked omits all five other fields and silently wipes them.
|
|
550
|
-
*
|
|
551
|
-
* Two rules, both load-bearing:
|
|
552
|
-
*
|
|
553
|
-
* 1. **`undefined` means "said nothing"; an explicit empty array means "delete".** A
|
|
554
|
-
* submission that never mentions host models is not a decision to remove them; an
|
|
555
|
-
* explicit `"host_models": []` is. `parseProviderConfirmationInput` therefore
|
|
556
|
-
* PRESERVES an empty array rather than dropping it to absent — without that the two
|
|
557
|
-
* cases are indistinguishable here and the carry-forward resurrects a roster the
|
|
558
|
-
* operator deleted.
|
|
559
|
-
* 2. **It applies with `input === null` too.** The autonomous/headless path promotes
|
|
560
|
-
* with no submission at all, and the capability delta is a brand-new trigger for
|
|
561
|
-
* that path — so short-circuiting on `input &&` would let an unattended re-promotion
|
|
562
|
-
* wipe the operator's entire persisted decision and then report convergence.
|
|
563
|
-
*
|
|
564
|
-
* Returns `null` only when there is nothing on either side. A prior confirmation with
|
|
565
|
-
* no incoming submission still yields a synthesized input carrying it forward.
|
|
566
|
-
*/
|
|
567
|
-
/**
|
|
568
|
-
* The gate-authored exclusions that SURVIVE this promotion.
|
|
569
|
-
*
|
|
570
|
-
* Round-3 defect (high, fail-OPEN): `auto_exclude` was rebuilt on every promotion from
|
|
571
|
-
* `gate.newlyReachable` alone. But `confirmedBackendKeys` counts an excluded entry as
|
|
572
|
-
* CONFIRMED, so once the gate fail-closed-excludes backend X and folds it into the pool,
|
|
573
|
-
* the reach delta is empty forever — and the very next promotion rebuilt `auto_exclude`
|
|
574
|
-
* from that empty delta and dropped X, making a backend the operator never confirmed
|
|
575
|
-
* dispatchable. The docstring's "a submission supersedes it" was true; the code
|
|
576
|
-
* superseded it on EVERY promotion, including the no-submission one.
|
|
577
|
-
*
|
|
578
|
-
* The rule is therefore narrower than "any submission clears it". A submission
|
|
579
|
-
* supersedes an auto-exclusion only when it actually ADDRESSES that backend:
|
|
580
|
-
* - the operator re-stated the pattern in `exclude` — it is now operator-authored and
|
|
581
|
-
* lives there, so retaining an `auto_exclude` copy would double-record it; or
|
|
582
|
-
* - the operator named that provider in `include` — an explicit opt-back-IN.
|
|
583
|
-
* Anything else is SILENCE, and silence is not confirmation ("the operator confirms
|
|
584
|
-
* model choices"). A capability-only answer must not lift an exclusion the operator was
|
|
585
|
-
* never even shown — the reach section does not render once the backend is a confirmed
|
|
586
|
-
* key, so they cannot see what they would be lifting.
|
|
587
|
-
*
|
|
588
|
-
* Fail-CLOSED by construction: the uncertain case retains the exclusion.
|
|
589
|
-
*/
|
|
590
|
-
export declare function retainAutoExclusions(priorAuto: readonly DispatchExclusionPattern[], input: ProviderConfirmationInput | null): DispatchExclusionPattern[];
|
|
591
|
-
export declare function carryForwardConfirmationInput(input: ProviderConfirmationInput | null, prior: SharedProviderConfirmation | null | undefined,
|
|
592
|
-
/**
|
|
593
|
-
* R3-3: true when THIS submission is LLM-authored (tool-derived — see
|
|
594
|
-
* `runProviderConfirmationAutoComplete`'s `authoredByLlm`). Governs which
|
|
595
|
-
* previously-ranked ids the capability merge below treats as fixed anchors:
|
|
596
|
-
* an LLM submission anchors every previously-ranked id (operator's and prior
|
|
597
|
-
* LLM's alike — rule 1); an operator submission does NOT anchor ids already in
|
|
598
|
-
* `capability_order_llm_ranked` (rule 2 — they interpolate like new models).
|
|
599
|
-
* Also gates the total-replacement escape in `mergeCapabilityOrder` (operator
|
|
600
|
-
* only — see its docstring). Defaults `false` (today's operator behavior) so
|
|
601
|
-
* every pre-existing call site is unaffected.
|
|
602
|
-
*/
|
|
603
|
-
authoredByLlm?: boolean): ProviderConfirmationInput | null;
|
|
604
|
-
/** How many already-ranked models the capability prompt shows as fixed reference points. */
|
|
605
|
-
export declare const DEFAULT_CAPABILITY_ANCHOR_COUNT = 5;
|
|
606
|
-
/**
|
|
607
|
-
* Pick a BOUNDED, spread sample of an already-confirmed capability ordering to show
|
|
608
|
-
* beside the unevidenced models as fixed reference points.
|
|
609
|
-
*
|
|
610
|
-
* The roster may be HUNDREDS of models, so the prompt must be O(new + constant) — it
|
|
611
|
-
* can never render the whole ordering. First, last, and evenly-spaced interior picks
|
|
612
|
-
* give the operator a usable coordinate space (top / middle / bottom of the confirmed
|
|
613
|
-
* ranking) at constant cost, which is exactly what {@link mergeCapabilityOrder}
|
|
614
|
-
* interpolates against.
|
|
615
|
-
*
|
|
616
|
-
* @param priorOrder - The confirmed ordering, most-capable-first.
|
|
617
|
-
* @param exclude - Models already being asked about (the unevidenced delta); an
|
|
618
|
-
* anchor must be a model whose rank is settled, never one under question.
|
|
619
|
-
* @param max - Ceiling on the sample size.
|
|
620
|
-
*/
|
|
621
|
-
export declare function selectCapabilityAnchors(priorOrder: readonly string[], exclude?: readonly string[], max?: number): string[];
|
|
622
|
-
/**
|
|
623
|
-
* R3-3 — the submission's ANCHOR EXCLUSION set, single-sourced so
|
|
624
|
-
* {@link mergeCapabilityOrder} and {@link detectDiscardedCapabilityReorder} can never
|
|
625
|
-
* disagree about what counts as a fixed reference point for a given submission:
|
|
626
|
-
*
|
|
627
|
-
* - LLM-authored (`authoredByLlm`): every previously-ranked id — the operator's and
|
|
628
|
-
* any prior LLM's alike — stays a fixed anchor (rule 1). Nothing is excluded.
|
|
629
|
-
* - Operator-authored: ids already in `capability_order_llm_ranked` are NOT anchors
|
|
630
|
-
* (rule 2) — the operator may reposition them exactly like new models, and doing
|
|
631
|
-
* so removes them from that set (see {@link advanceCapabilityOrderLlmRanked}).
|
|
632
|
-
*/
|
|
633
|
-
export declare function capabilityOrderNonAnchors(priorLlmRanked: readonly string[], authoredByLlm: boolean): Set<string>;
|
|
634
|
-
/**
|
|
635
|
-
* Advance the R3-3 `capability_order_llm_ranked` authorship SET across one
|
|
636
|
-
* promotion. Always a subset of the resulting `capability_order` — see
|
|
637
|
-
* {@link ConfirmedDispatchPolicy.capability_order_llm_ranked}.
|
|
638
|
-
*
|
|
639
|
-
* - LLM-authored submission: every id this submission newly ranked — i.e. not
|
|
640
|
-
* already in `priorOrder` — is ADDED. `mergeCapabilityOrder` never lets an
|
|
641
|
-
* LLM-authored submission move a previously-ranked id (its total-replacement
|
|
642
|
-
* escape is operator-only), so a prior id is never repositioned on this path and
|
|
643
|
-
* this function does not need to special-case "total" either: it is simply
|
|
644
|
-
* `answer \ priorOrder`.
|
|
645
|
-
* - Operator-authored submission: every id the submission NAMES is REMOVED — naming
|
|
646
|
-
* a previously LLM-ranked id (and, via {@link capabilityOrderNonAnchors}'s
|
|
647
|
-
* non-anchor treatment, freely repositioning it) makes it operator-authored from
|
|
648
|
-
* here on, exactly like a first-time rank.
|
|
649
|
-
* - No submission at all (`submitted` absent/empty): the running set is unchanged.
|
|
650
|
-
*/
|
|
651
|
-
export declare function advanceCapabilityOrderLlmRanked(priorLlmRanked: readonly string[], priorOrder: readonly string[], submitted: readonly string[] | undefined, authoredByLlm: boolean): string[];
|
|
652
|
-
/**
|
|
653
|
-
* The anchor ids whose relative order the submission changed but the merge will NOT
|
|
654
|
-
* honor — i.e. an operator reorder that is about to be silently discarded.
|
|
655
|
-
*
|
|
656
|
-
* {@link mergeCapabilityOrder} treats every submitted id already present in
|
|
657
|
-
* `priorOrder` as a FIXED reference point, so a submission that swaps two of them
|
|
658
|
-
* returns the prior order unchanged. Without this, that is invisible: the promotion
|
|
659
|
-
* succeeds, the artifact is byte-identical, and nothing anywhere says the operator's
|
|
660
|
-
* decision was dropped. `unrankedOnPromotion` cannot catch it either — a reordered id
|
|
661
|
-
* IS present in `capability_order`, so it reports nothing.
|
|
662
|
-
*
|
|
663
|
-
* An accepted-then-discarded operator decision is the same defect class as laundering a
|
|
664
|
-
* tool guess into operator policy: not corruption, but SILENCE. The standing rule is
|
|
665
|
-
* that the operator must never have to notice — so the caller reports this loudly.
|
|
666
|
-
*
|
|
667
|
-
* Returns `[]` when the reorder will actually be honored: an OPERATOR-authored TOTAL
|
|
668
|
-
* submission (every prior id restated) is applied verbatim, and a submission with
|
|
669
|
-
* fewer than two anchors cannot express a reorder at all.
|
|
670
|
-
*
|
|
671
|
-
* NOTE this reports the LIMITATION, it does not lift it. Making a repositioning
|
|
672
|
-
* expressible without restating the whole roster needs the anchor-provenance split
|
|
673
|
-
* tracked in `docs/backlog.md`; this only ensures the drop is never silent.
|
|
674
|
-
*/
|
|
675
|
-
export declare function detectDiscardedCapabilityReorder(priorOrder: readonly string[], submitted: readonly string[],
|
|
676
|
-
/**
|
|
677
|
-
* R3-3: ids to exclude from anchor treatment — must be the SAME set passed to
|
|
678
|
-
* {@link mergeCapabilityOrder} for this submission ({@link capabilityOrderNonAnchors}),
|
|
679
|
-
* or the two disagree about what an "anchor" is and this reports a discard the
|
|
680
|
-
* merge actually honored (or misses one it silently dropped).
|
|
681
|
-
*/
|
|
682
|
-
nonAnchorIds?: ReadonlySet<string>,
|
|
683
|
-
/**
|
|
684
|
-
* R3-3: mirrors the authorship-gated condition in {@link mergeCapabilityOrder} — the
|
|
685
|
-
* total-submission escape is OPERATOR-only, so an LLM-authored submission that
|
|
686
|
-
* happens to restate every prior id (a small roster's anchor sample can cover the
|
|
687
|
-
* whole ordering) still has its anchor reorder detected and reported, never
|
|
688
|
-
* silently honored via the escape.
|
|
689
|
-
*/
|
|
690
|
-
authoredByLlm?: boolean): string[];
|
|
691
|
-
/**
|
|
692
|
-
* Merge an operator's capability answer into the previously confirmed ordering by
|
|
693
|
-
* **ANCHORED INSERTION**.
|
|
694
|
-
*
|
|
695
|
-
* **The livelock this closes.** The capability prompt is DELTA-SCOPED — it renders only
|
|
696
|
-
* the models with no evidence — while `annotateConfirmedPool` built its positions from
|
|
697
|
-
* the submission ALONE, i.e. total replacement. So each answer erased the last: rank A,
|
|
698
|
-
* the delta asks C, rank C, A loses its rank, the delta asks A, forever. `PRIORITY[0]`
|
|
699
|
-
* never converges. Reproduced across three promotions.
|
|
700
|
-
*
|
|
701
|
-
* The fix cannot be "render the whole ordering" (the roster may be hundreds of models —
|
|
702
|
-
* the prompt must stay O(new + constant)) and it cannot be an absolute score or tier
|
|
703
|
-
* (only a RELATIVE ordering is representable, by standing decision). Anchored insertion
|
|
704
|
-
* is what remains: show a bounded, spread sample of the confirmed ordering
|
|
705
|
-
* ({@link selectCapabilityAnchors}) as fixed reference points, and interpolate the new
|
|
706
|
-
* models into the coordinate space those points define.
|
|
707
|
-
*
|
|
708
|
-
* Semantics, exactly:
|
|
709
|
-
*
|
|
710
|
-
* - **Anchors** = submitted entries that already appear in `priorOrder`. They are
|
|
711
|
-
* REFERENCE POINTS: their prior positions define the coordinate space, and **a
|
|
712
|
-
* reordering of anchors relative to each other is deliberately NOT honored** on a
|
|
713
|
-
* partial submission. The operator saw at most a handful of them out of a possibly
|
|
714
|
-
* enormous ordering, so a swap between two anchors carries no information about the
|
|
715
|
-
* models BETWEEN them — honoring it would silently reshuffle models the operator
|
|
716
|
-
* never saw.
|
|
717
|
-
* - **Exception — an OPERATOR-authored TOTAL submission is a total replacement.**
|
|
718
|
-
* When the submission mentions every model in `priorOrder` there are no unmentioned
|
|
719
|
-
* models, so the coordinate space is fully respecified and the answer is honored
|
|
720
|
-
* verbatim. This is the only case where "reorder what you already confirmed" is a
|
|
721
|
-
* well-defined request, and it is the pre-existing behavior for a complete
|
|
722
|
-
* re-ranking. **R3-3: this escape is OPERATOR-only** (`authoredByLlm: false`,
|
|
723
|
-
* the default) — on a SMALL roster the bounded anchor sample
|
|
724
|
-
* ({@link selectCapabilityAnchors}) can cover the entire prior ordering, so an
|
|
725
|
-
* LLM's answer over "new models + all the anchors it was shown" becomes total BY
|
|
726
|
-
* ACCIDENT, not by the LLM's intent to reorder. Honoring it verbatim would let an
|
|
727
|
-
* LLM silently reorder ranks an operator (or a prior LLM) set; an LLM-authored
|
|
728
|
-
* submission therefore NEVER takes this exception — every previously-ranked id
|
|
729
|
-
* stays a fixed anchor regardless of coverage, and an attempted reorder is
|
|
730
|
-
* discarded and reported exactly like a partial submission's would be (see
|
|
731
|
-
* {@link detectDiscardedCapabilityReorder}).
|
|
732
|
-
* - **New models** (not in `priorOrder`) interpolate to a fractional position between
|
|
733
|
-
* the prior positions of the nearest preceding and following anchors IN THE SUBMITTED
|
|
734
|
-
* LIST. Before the first anchor ⇒ just below it (more capable); after the last ⇒ just
|
|
735
|
-
* above it. Consecutive new models keep their submitted relative order.
|
|
736
|
-
* - **Every model in `priorOrder` the submission does not mention keeps its prior
|
|
737
|
-
* position.** THIS IS THE LIVELOCK FIX.
|
|
738
|
-
* - **No anchors at all** (a partial submission naming only unknown models): there is no
|
|
739
|
-
* coordinate to interpolate against, so the new models are appended AFTER the whole
|
|
740
|
-
* prior ordering — the conservative direction, since a higher rank is less capable and
|
|
741
|
-
* therefore trusted with less.
|
|
742
|
-
* - **Duplicates**: first occurrence wins, matching `annotateConfirmedPool`'s rule that a
|
|
743
|
-
* positional list is the operator's ordering and a later repeat must not re-rank it.
|
|
744
|
-
* - **Result** is every model sorted by resolved position, ties broken by model id.
|
|
745
|
-
* Deterministic by construction: an incidentally-ordered array here would churn the
|
|
746
|
-
* confirmation's content hash on every promotion and cascade phantom staleness.
|
|
747
|
-
*
|
|
748
|
-
* Degenerate cases: an empty `priorOrder` (the first-ever answer) returns the submission;
|
|
749
|
-
* an empty submission returns the prior ordering unchanged (an omitted answer is
|
|
750
|
-
* "said nothing" — there is no way to express "delete the whole ranking", and the
|
|
751
|
-
* un-delete direction is the one that cannot livelock).
|
|
752
|
-
*
|
|
753
|
-
* Pure — no I/O, no clock, no config. Exported so the merge that decides whether the
|
|
754
|
-
* gate converges is directly testable.
|
|
755
|
-
*/
|
|
756
|
-
export declare function mergeCapabilityOrder(priorOrder: readonly string[], submitted: readonly string[],
|
|
757
|
-
/**
|
|
758
|
-
* R3-3: ids to treat as NOT anchored even though they already appear in
|
|
759
|
-
* `priorOrder` — the operator-authored path passes the current
|
|
760
|
-
* `capability_order_llm_ranked` set here ({@link capabilityOrderNonAnchors}) so an
|
|
761
|
-
* operator may freely reposition a previously LLM-ranked id, exactly like a new
|
|
762
|
-
* model. Empty by default (today's behavior: every previously-ranked id anchors).
|
|
763
|
-
*/
|
|
764
|
-
nonAnchorIds?: ReadonlySet<string>,
|
|
765
|
-
/**
|
|
766
|
-
* R3-3: true when THIS submission is LLM-authored. Gates the total-replacement
|
|
767
|
-
* escape below (OPERATOR-only — see the docstring's exception): an LLM-authored
|
|
768
|
-
* submission never takes it, so a previously-ranked id is NEVER repositioned on
|
|
769
|
-
* this path, regardless of how much of `priorOrder` the submission happens to
|
|
770
|
-
* cover.
|
|
771
|
-
*/
|
|
772
|
-
authoredByLlm?: boolean): string[];
|
|
773
|
-
/**
|
|
774
|
-
* Read the operator's Gate-0 input from `<artifactsDir>/provider-confirmation.input.json`.
|
|
775
|
-
* Returns `null` when the file is absent, unreadable, or malformed — the "operator
|
|
776
|
-
* has not acted yet" signal the gate uses to decide emit-vs-consume.
|
|
777
|
-
*
|
|
778
|
-
* ⚠ Throws on exactly one condition, inherited from
|
|
779
|
-
* {@link parseProviderConfirmationInput}: an ungrammatical `exclude` rule. That is a
|
|
780
|
-
* REFUSAL, not a degrade — swallowing it here would turn a typo'd exclusion into
|
|
781
|
-
* "operator has not acted yet" and re-emit the same prompt forever, which is the
|
|
782
|
-
* silent failure the check exists to prevent. Every other malformed input still
|
|
783
|
-
* yields `null`.
|
|
784
|
-
*/
|
|
785
|
-
export declare function readProviderConfirmationInput(artifactsDir: string): Promise<ProviderConfirmationInput | null>;
|
|
786
|
-
/**
|
|
787
|
-
* Invalidate a CONSUMED Gate-0 input by deleting it — the second half of
|
|
788
|
-
* consume-and-invalidate, paired here with {@link readProviderConfirmationInput} so
|
|
789
|
-
* the two cannot drift apart.
|
|
790
|
-
*
|
|
791
|
-
* The input's presence is the "operator has acted" signal the gate reads to decide
|
|
792
|
-
* emit-vs-consume. Once promoted into the canonical artifacts it is SPENT: leaving it
|
|
793
|
-
* on disk means a later reconciliation delta silently re-consumes a submission that
|
|
794
|
-
* answered an older question, auto-satisfying the gate instead of asking the
|
|
795
|
-
* operator. Deleting it is what makes the gate able to fire a second time at all.
|
|
796
|
-
*
|
|
797
|
-
* Best-effort and never throws: an already-absent file is the desired end state, and
|
|
798
|
-
* a failed unlink must not break the in-flight obligation (the promotion itself
|
|
799
|
-
* already succeeded).
|
|
800
|
-
*/
|
|
801
|
-
export declare function unlinkProviderConfirmationInput(artifactsDir: string): Promise<void>;
|
|
802
|
-
//# sourceMappingURL=sharedProviderConfirmation.d.ts.map
|