@smthrs/harness 0.0.0-stage → 1.0.0-rc.4
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/CHANGELOG.md +387 -0
- package/LICENSE +21 -0
- package/README.md +138 -2
- package/dist/cjs/AgentEvent.d.ts +3092 -0
- package/dist/cjs/AgentEvent.d.ts.map +1 -0
- package/dist/cjs/AgentEvent.js +1116 -0
- package/dist/cjs/AgentEvent.js.map +7 -0
- package/dist/cjs/CallLedger.d.ts +378 -0
- package/dist/cjs/CallLedger.d.ts.map +1 -0
- package/dist/cjs/CallLedger.js +240 -0
- package/dist/cjs/CallLedger.js.map +7 -0
- package/dist/cjs/Cell.d.ts +774 -0
- package/dist/cjs/Cell.d.ts.map +1 -0
- package/dist/cjs/Cell.js +431 -0
- package/dist/cjs/Cell.js.map +7 -0
- package/dist/cjs/CellCalls.d.ts +115 -0
- package/dist/cjs/CellCalls.d.ts.map +1 -0
- package/dist/cjs/CellCalls.js +98 -0
- package/dist/cjs/CellCalls.js.map +7 -0
- package/dist/cjs/CellHistory.d.ts +102 -0
- package/dist/cjs/CellHistory.d.ts.map +1 -0
- package/dist/cjs/CellHistory.js +54 -0
- package/dist/cjs/CellHistory.js.map +7 -0
- package/dist/cjs/CellTurn.d.ts +1071 -0
- package/dist/cjs/CellTurn.d.ts.map +1 -0
- package/dist/cjs/CellTurn.js +2618 -0
- package/dist/cjs/CellTurn.js.map +7 -0
- package/dist/cjs/CellValidation.d.ts +94 -0
- package/dist/cjs/CellValidation.d.ts.map +1 -0
- package/dist/cjs/CellValidation.js +218 -0
- package/dist/cjs/CellValidation.js.map +7 -0
- package/dist/cjs/Compaction.d.ts +158 -0
- package/dist/cjs/Compaction.d.ts.map +1 -0
- package/dist/cjs/Compaction.js +189 -0
- package/dist/cjs/Compaction.js.map +7 -0
- package/dist/cjs/CompletionClaim.d.ts +801 -0
- package/dist/cjs/CompletionClaim.d.ts.map +1 -0
- package/dist/cjs/CompletionClaim.js +303 -0
- package/dist/cjs/CompletionClaim.js.map +7 -0
- package/dist/cjs/ContextWindow.d.ts +435 -0
- package/dist/cjs/ContextWindow.d.ts.map +1 -0
- package/dist/cjs/ContextWindow.js +319 -0
- package/dist/cjs/ContextWindow.js.map +7 -0
- package/dist/cjs/EngineLike.d.ts +546 -0
- package/dist/cjs/EngineLike.d.ts.map +1 -0
- package/dist/cjs/EngineLike.js +114 -0
- package/dist/cjs/EngineLike.js.map +7 -0
- package/dist/cjs/ExternalTranscript.d.ts +349 -0
- package/dist/cjs/ExternalTranscript.d.ts.map +1 -0
- package/dist/cjs/ExternalTranscript.js +826 -0
- package/dist/cjs/ExternalTranscript.js.map +7 -0
- package/dist/cjs/FailedCall.d.ts +132 -0
- package/dist/cjs/FailedCall.d.ts.map +1 -0
- package/dist/cjs/FailedCall.js +53 -0
- package/dist/cjs/FailedCall.js.map +7 -0
- package/dist/cjs/FlowBinding.d.ts +289 -0
- package/dist/cjs/FlowBinding.d.ts.map +1 -0
- package/dist/cjs/FlowBinding.js +251 -0
- package/dist/cjs/FlowBinding.js.map +7 -0
- package/dist/cjs/HarnessError.d.ts +57 -0
- package/dist/cjs/HarnessError.d.ts.map +1 -0
- package/dist/cjs/HarnessError.js +75 -0
- package/dist/cjs/HarnessError.js.map +7 -0
- package/dist/cjs/Judgement.d.ts +289 -0
- package/dist/cjs/Judgement.d.ts.map +1 -0
- package/dist/cjs/Judgement.js +240 -0
- package/dist/cjs/Judgement.js.map +7 -0
- package/dist/cjs/Monitor.d.ts +374 -0
- package/dist/cjs/Monitor.d.ts.map +1 -0
- package/dist/cjs/Monitor.js +233 -0
- package/dist/cjs/Monitor.js.map +7 -0
- package/dist/cjs/NarrowedCheck.d.ts +523 -0
- package/dist/cjs/NarrowedCheck.d.ts.map +1 -0
- package/dist/cjs/NarrowedCheck.js +263 -0
- package/dist/cjs/NarrowedCheck.js.map +7 -0
- package/dist/cjs/Notifications.d.ts +42 -0
- package/dist/cjs/Notifications.d.ts.map +1 -0
- package/dist/cjs/Notifications.js +177 -0
- package/dist/cjs/Notifications.js.map +7 -0
- package/dist/cjs/Plan.d.ts +127 -0
- package/dist/cjs/Plan.d.ts.map +1 -0
- package/dist/cjs/Plan.js +77 -0
- package/dist/cjs/Plan.js.map +7 -0
- package/dist/cjs/QuickJSSandbox.d.ts +151 -0
- package/dist/cjs/QuickJSSandbox.d.ts.map +1 -0
- package/dist/cjs/QuickJSSandbox.js +987 -0
- package/dist/cjs/QuickJSSandbox.js.map +7 -0
- package/dist/cjs/Relevance.d.ts +213 -0
- package/dist/cjs/Relevance.d.ts.map +1 -0
- package/dist/cjs/Relevance.js +183 -0
- package/dist/cjs/Relevance.js.map +7 -0
- package/dist/cjs/Sandbox.d.ts +637 -0
- package/dist/cjs/Sandbox.d.ts.map +1 -0
- package/dist/cjs/Sandbox.js +260 -0
- package/dist/cjs/Sandbox.js.map +7 -0
- package/dist/cjs/Steering.d.ts +464 -0
- package/dist/cjs/Steering.d.ts.map +1 -0
- package/dist/cjs/Steering.js +153 -0
- package/dist/cjs/Steering.js.map +7 -0
- package/dist/cjs/StructuredOutput.d.ts +252 -0
- package/dist/cjs/StructuredOutput.d.ts.map +1 -0
- package/dist/cjs/StructuredOutput.js +266 -0
- package/dist/cjs/StructuredOutput.js.map +7 -0
- package/dist/cjs/Sufficiency.d.ts +195 -0
- package/dist/cjs/Sufficiency.d.ts.map +1 -0
- package/dist/cjs/Sufficiency.js +110 -0
- package/dist/cjs/Sufficiency.js.map +7 -0
- package/dist/cjs/Supervisor.d.ts +719 -0
- package/dist/cjs/Supervisor.d.ts.map +1 -0
- package/dist/cjs/Supervisor.js +313 -0
- package/dist/cjs/Supervisor.js.map +7 -0
- package/dist/cjs/Tokens.d.ts +86 -0
- package/dist/cjs/Tokens.d.ts.map +1 -0
- package/dist/cjs/Tokens.js +72 -0
- package/dist/cjs/Tokens.js.map +7 -0
- package/dist/cjs/Transcript.d.ts +171 -0
- package/dist/cjs/Transcript.d.ts.map +1 -0
- package/dist/cjs/Transcript.js +342 -0
- package/dist/cjs/Transcript.js.map +7 -0
- package/dist/cjs/TruncatedOutput.d.ts +186 -0
- package/dist/cjs/TruncatedOutput.d.ts.map +1 -0
- package/dist/cjs/TruncatedOutput.js +143 -0
- package/dist/cjs/TruncatedOutput.js.map +7 -0
- package/dist/cjs/UnmovedTree.d.ts +113 -0
- package/dist/cjs/UnmovedTree.d.ts.map +1 -0
- package/dist/cjs/UnmovedTree.js +38 -0
- package/dist/cjs/UnmovedTree.js.map +7 -0
- package/dist/cjs/UnresolvedFailure.d.ts +196 -0
- package/dist/cjs/UnresolvedFailure.d.ts.map +1 -0
- package/dist/cjs/UnresolvedFailure.js +77 -0
- package/dist/cjs/UnresolvedFailure.js.map +7 -0
- package/dist/cjs/VacuousVerification.d.ts +237 -0
- package/dist/cjs/VacuousVerification.d.ts.map +1 -0
- package/dist/cjs/VacuousVerification.js +91 -0
- package/dist/cjs/VacuousVerification.js.map +7 -0
- package/dist/cjs/VariablesPanel.d.ts +117 -0
- package/dist/cjs/VariablesPanel.d.ts.map +1 -0
- package/dist/cjs/VariablesPanel.js +108 -0
- package/dist/cjs/VariablesPanel.js.map +7 -0
- package/dist/cjs/index.d.ts +172 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +99 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/internal/bytes.d.ts +36 -0
- package/dist/cjs/internal/bytes.d.ts.map +1 -0
- package/dist/cjs/internal/bytes.js +57 -0
- package/dist/cjs/internal/bytes.js.map +7 -0
- package/dist/cjs/internal/cellPrompt.d.ts +122 -0
- package/dist/cjs/internal/cellPrompt.d.ts.map +1 -0
- package/dist/cjs/internal/cellPrompt.js +146 -0
- package/dist/cjs/internal/cellPrompt.js.map +7 -0
- package/dist/cjs/internal/compactable.d.ts +44 -0
- package/dist/cjs/internal/compactable.d.ts.map +1 -0
- package/dist/cjs/internal/compactable.js +56 -0
- package/dist/cjs/internal/compactable.js.map +7 -0
- package/dist/cjs/internal/compactionMarks.d.ts +278 -0
- package/dist/cjs/internal/compactionMarks.d.ts.map +1 -0
- package/dist/cjs/internal/compactionMarks.js +212 -0
- package/dist/cjs/internal/compactionMarks.js.map +7 -0
- package/dist/cjs/internal/demandText.d.ts +95 -0
- package/dist/cjs/internal/demandText.d.ts.map +1 -0
- package/dist/cjs/internal/demandText.js +70 -0
- package/dist/cjs/internal/demandText.js.map +7 -0
- package/dist/cjs/internal/elide.d.ts +109 -0
- package/dist/cjs/internal/elide.d.ts.map +1 -0
- package/dist/cjs/internal/elide.js +59 -0
- package/dist/cjs/internal/elide.js.map +7 -0
- package/dist/cjs/internal/frame.d.ts +463 -0
- package/dist/cjs/internal/frame.d.ts.map +1 -0
- package/dist/cjs/internal/frame.js +514 -0
- package/dist/cjs/internal/frame.js.map +7 -0
- package/dist/cjs/internal/nonNegativeSafeInt.d.ts +20 -0
- package/dist/cjs/internal/nonNegativeSafeInt.d.ts.map +1 -0
- package/dist/cjs/internal/nonNegativeSafeInt.js +29 -0
- package/dist/cjs/internal/nonNegativeSafeInt.js.map +7 -0
- package/dist/cjs/internal/paidUsage.d.ts +52 -0
- package/dist/cjs/internal/paidUsage.d.ts.map +1 -0
- package/dist/cjs/internal/paidUsage.js +70 -0
- package/dist/cjs/internal/paidUsage.js.map +7 -0
- package/dist/cjs/internal/printChannel.d.ts +233 -0
- package/dist/cjs/internal/printChannel.d.ts.map +1 -0
- package/dist/cjs/internal/printChannel.js +165 -0
- package/dist/cjs/internal/printChannel.js.map +7 -0
- package/dist/cjs/internal/printsObservation.d.ts +26 -0
- package/dist/cjs/internal/printsObservation.d.ts.map +1 -0
- package/dist/cjs/internal/printsObservation.js +27 -0
- package/dist/cjs/internal/printsObservation.js.map +7 -0
- package/dist/cjs/internal/refusal.d.ts +40 -0
- package/dist/cjs/internal/refusal.d.ts.map +1 -0
- package/dist/cjs/internal/refusal.js +45 -0
- package/dist/cjs/internal/refusal.js.map +7 -0
- package/dist/cjs/internal/supervision.d.ts +174 -0
- package/dist/cjs/internal/supervision.d.ts.map +1 -0
- package/dist/cjs/internal/supervision.js +402 -0
- package/dist/cjs/internal/supervision.js.map +7 -0
- package/dist/cjs/internal/unfinishedWork.d.ts +99 -0
- package/dist/cjs/internal/unfinishedWork.d.ts.map +1 -0
- package/dist/cjs/internal/unfinishedWork.js +80 -0
- package/dist/cjs/internal/unfinishedWork.js.map +7 -0
- package/dist/cjs/internal/unobservedCall.d.ts +112 -0
- package/dist/cjs/internal/unobservedCall.d.ts.map +1 -0
- package/dist/cjs/internal/unobservedCall.js +345 -0
- package/dist/cjs/internal/unobservedCall.js.map +7 -0
- package/dist/cjs/internal/untrustedData.d.ts +14 -0
- package/dist/cjs/internal/untrustedData.d.ts.map +1 -0
- package/dist/cjs/internal/untrustedData.js +30 -0
- package/dist/cjs/internal/untrustedData.js.map +7 -0
- package/dist/cjs/package.json +1 -0
- package/dist/esm/AgentEvent.d.ts +3092 -0
- package/dist/esm/AgentEvent.d.ts.map +1 -0
- package/dist/esm/AgentEvent.js +1610 -0
- package/dist/esm/AgentEvent.js.map +1 -0
- package/dist/esm/CallLedger.d.ts +378 -0
- package/dist/esm/CallLedger.d.ts.map +1 -0
- package/dist/esm/CallLedger.js +506 -0
- package/dist/esm/CallLedger.js.map +1 -0
- package/dist/esm/Cell.d.ts +774 -0
- package/dist/esm/Cell.d.ts.map +1 -0
- package/dist/esm/Cell.js +772 -0
- package/dist/esm/Cell.js.map +1 -0
- package/dist/esm/CellCalls.d.ts +115 -0
- package/dist/esm/CellCalls.d.ts.map +1 -0
- package/dist/esm/CellCalls.js +97 -0
- package/dist/esm/CellCalls.js.map +1 -0
- package/dist/esm/CellHistory.d.ts +102 -0
- package/dist/esm/CellHistory.d.ts.map +1 -0
- package/dist/esm/CellHistory.js +91 -0
- package/dist/esm/CellHistory.js.map +1 -0
- package/dist/esm/CellTurn.d.ts +1071 -0
- package/dist/esm/CellTurn.d.ts.map +1 -0
- package/dist/esm/CellTurn.js +3410 -0
- package/dist/esm/CellTurn.js.map +1 -0
- package/dist/esm/CellValidation.d.ts +94 -0
- package/dist/esm/CellValidation.d.ts.map +1 -0
- package/dist/esm/CellValidation.js +335 -0
- package/dist/esm/CellValidation.js.map +1 -0
- package/dist/esm/Compaction.d.ts +158 -0
- package/dist/esm/Compaction.d.ts.map +1 -0
- package/dist/esm/Compaction.js +216 -0
- package/dist/esm/Compaction.js.map +1 -0
- package/dist/esm/CompletionClaim.d.ts +801 -0
- package/dist/esm/CompletionClaim.d.ts.map +1 -0
- package/dist/esm/CompletionClaim.js +833 -0
- package/dist/esm/CompletionClaim.js.map +1 -0
- package/dist/esm/ContextWindow.d.ts +435 -0
- package/dist/esm/ContextWindow.d.ts.map +1 -0
- package/dist/esm/ContextWindow.js +427 -0
- package/dist/esm/ContextWindow.js.map +1 -0
- package/dist/esm/EngineLike.d.ts +546 -0
- package/dist/esm/EngineLike.d.ts.map +1 -0
- package/dist/esm/EngineLike.js +218 -0
- package/dist/esm/EngineLike.js.map +1 -0
- package/dist/esm/ExternalTranscript.d.ts +349 -0
- package/dist/esm/ExternalTranscript.d.ts.map +1 -0
- package/dist/esm/ExternalTranscript.js +985 -0
- package/dist/esm/ExternalTranscript.js.map +1 -0
- package/dist/esm/FailedCall.d.ts +132 -0
- package/dist/esm/FailedCall.d.ts.map +1 -0
- package/dist/esm/FailedCall.js +131 -0
- package/dist/esm/FailedCall.js.map +1 -0
- package/dist/esm/FlowBinding.d.ts +289 -0
- package/dist/esm/FlowBinding.d.ts.map +1 -0
- package/dist/esm/FlowBinding.js +376 -0
- package/dist/esm/FlowBinding.js.map +1 -0
- package/dist/esm/HarnessError.d.ts +57 -0
- package/dist/esm/HarnessError.d.ts.map +1 -0
- package/dist/esm/HarnessError.js +85 -0
- package/dist/esm/HarnessError.js.map +1 -0
- package/dist/esm/Judgement.d.ts +289 -0
- package/dist/esm/Judgement.d.ts.map +1 -0
- package/dist/esm/Judgement.js +305 -0
- package/dist/esm/Judgement.js.map +1 -0
- package/dist/esm/Monitor.d.ts +374 -0
- package/dist/esm/Monitor.d.ts.map +1 -0
- package/dist/esm/Monitor.js +370 -0
- package/dist/esm/Monitor.js.map +1 -0
- package/dist/esm/NarrowedCheck.d.ts +523 -0
- package/dist/esm/NarrowedCheck.d.ts.map +1 -0
- package/dist/esm/NarrowedCheck.js +612 -0
- package/dist/esm/NarrowedCheck.js.map +1 -0
- package/dist/esm/Notifications.d.ts +42 -0
- package/dist/esm/Notifications.d.ts.map +1 -0
- package/dist/esm/Notifications.js +215 -0
- package/dist/esm/Notifications.js.map +1 -0
- package/dist/esm/Plan.d.ts +127 -0
- package/dist/esm/Plan.d.ts.map +1 -0
- package/dist/esm/Plan.js +97 -0
- package/dist/esm/Plan.js.map +1 -0
- package/dist/esm/QuickJSSandbox.d.ts +151 -0
- package/dist/esm/QuickJSSandbox.d.ts.map +1 -0
- package/dist/esm/QuickJSSandbox.js +1364 -0
- package/dist/esm/QuickJSSandbox.js.map +1 -0
- package/dist/esm/Relevance.d.ts +213 -0
- package/dist/esm/Relevance.d.ts.map +1 -0
- package/dist/esm/Relevance.js +254 -0
- package/dist/esm/Relevance.js.map +1 -0
- package/dist/esm/Sandbox.d.ts +637 -0
- package/dist/esm/Sandbox.d.ts.map +1 -0
- package/dist/esm/Sandbox.js +464 -0
- package/dist/esm/Sandbox.js.map +1 -0
- package/dist/esm/Steering.d.ts +464 -0
- package/dist/esm/Steering.d.ts.map +1 -0
- package/dist/esm/Steering.js +193 -0
- package/dist/esm/Steering.js.map +1 -0
- package/dist/esm/StructuredOutput.d.ts +252 -0
- package/dist/esm/StructuredOutput.d.ts.map +1 -0
- package/dist/esm/StructuredOutput.js +430 -0
- package/dist/esm/StructuredOutput.js.map +1 -0
- package/dist/esm/Sufficiency.d.ts +195 -0
- package/dist/esm/Sufficiency.d.ts.map +1 -0
- package/dist/esm/Sufficiency.js +207 -0
- package/dist/esm/Sufficiency.js.map +1 -0
- package/dist/esm/Supervisor.d.ts +719 -0
- package/dist/esm/Supervisor.d.ts.map +1 -0
- package/dist/esm/Supervisor.js +575 -0
- package/dist/esm/Supervisor.js.map +1 -0
- package/dist/esm/Tokens.d.ts +86 -0
- package/dist/esm/Tokens.d.ts.map +1 -0
- package/dist/esm/Tokens.js +92 -0
- package/dist/esm/Tokens.js.map +1 -0
- package/dist/esm/Transcript.d.ts +171 -0
- package/dist/esm/Transcript.d.ts.map +1 -0
- package/dist/esm/Transcript.js +424 -0
- package/dist/esm/Transcript.js.map +1 -0
- package/dist/esm/TruncatedOutput.d.ts +186 -0
- package/dist/esm/TruncatedOutput.d.ts.map +1 -0
- package/dist/esm/TruncatedOutput.js +257 -0
- package/dist/esm/TruncatedOutput.js.map +1 -0
- package/dist/esm/UnmovedTree.d.ts +113 -0
- package/dist/esm/UnmovedTree.d.ts.map +1 -0
- package/dist/esm/UnmovedTree.js +90 -0
- package/dist/esm/UnmovedTree.js.map +1 -0
- package/dist/esm/UnresolvedFailure.d.ts +196 -0
- package/dist/esm/UnresolvedFailure.d.ts.map +1 -0
- package/dist/esm/UnresolvedFailure.js +218 -0
- package/dist/esm/UnresolvedFailure.js.map +1 -0
- package/dist/esm/VacuousVerification.d.ts +237 -0
- package/dist/esm/VacuousVerification.d.ts.map +1 -0
- package/dist/esm/VacuousVerification.js +245 -0
- package/dist/esm/VacuousVerification.js.map +1 -0
- package/dist/esm/VariablesPanel.d.ts +117 -0
- package/dist/esm/VariablesPanel.d.ts.map +1 -0
- package/dist/esm/VariablesPanel.js +142 -0
- package/dist/esm/VariablesPanel.js.map +1 -0
- package/dist/esm/index.d.ts +172 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +172 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/internal/bytes.d.ts +36 -0
- package/dist/esm/internal/bytes.d.ts.map +1 -0
- package/dist/esm/internal/bytes.js +70 -0
- package/dist/esm/internal/bytes.js.map +1 -0
- package/dist/esm/internal/cellPrompt.d.ts +122 -0
- package/dist/esm/internal/cellPrompt.d.ts.map +1 -0
- package/dist/esm/internal/cellPrompt.js +276 -0
- package/dist/esm/internal/cellPrompt.js.map +1 -0
- package/dist/esm/internal/compactable.d.ts +44 -0
- package/dist/esm/internal/compactable.d.ts.map +1 -0
- package/dist/esm/internal/compactable.js +71 -0
- package/dist/esm/internal/compactable.js.map +1 -0
- package/dist/esm/internal/compactionMarks.d.ts +278 -0
- package/dist/esm/internal/compactionMarks.d.ts.map +1 -0
- package/dist/esm/internal/compactionMarks.js +317 -0
- package/dist/esm/internal/compactionMarks.js.map +1 -0
- package/dist/esm/internal/demandText.d.ts +95 -0
- package/dist/esm/internal/demandText.d.ts.map +1 -0
- package/dist/esm/internal/demandText.js +128 -0
- package/dist/esm/internal/demandText.js.map +1 -0
- package/dist/esm/internal/elide.d.ts +109 -0
- package/dist/esm/internal/elide.d.ts.map +1 -0
- package/dist/esm/internal/elide.js +123 -0
- package/dist/esm/internal/elide.js.map +1 -0
- package/dist/esm/internal/frame.d.ts +463 -0
- package/dist/esm/internal/frame.d.ts.map +1 -0
- package/dist/esm/internal/frame.js +861 -0
- package/dist/esm/internal/frame.js.map +1 -0
- package/dist/esm/internal/nonNegativeSafeInt.d.ts +20 -0
- package/dist/esm/internal/nonNegativeSafeInt.d.ts.map +1 -0
- package/dist/esm/internal/nonNegativeSafeInt.js +20 -0
- package/dist/esm/internal/nonNegativeSafeInt.js.map +1 -0
- package/dist/esm/internal/paidUsage.d.ts +52 -0
- package/dist/esm/internal/paidUsage.d.ts.map +1 -0
- package/dist/esm/internal/paidUsage.js +72 -0
- package/dist/esm/internal/paidUsage.js.map +1 -0
- package/dist/esm/internal/printChannel.d.ts +233 -0
- package/dist/esm/internal/printChannel.d.ts.map +1 -0
- package/dist/esm/internal/printChannel.js +376 -0
- package/dist/esm/internal/printChannel.js.map +1 -0
- package/dist/esm/internal/printsObservation.d.ts +26 -0
- package/dist/esm/internal/printsObservation.d.ts.map +1 -0
- package/dist/esm/internal/printsObservation.js +29 -0
- package/dist/esm/internal/printsObservation.js.map +1 -0
- package/dist/esm/internal/refusal.d.ts +40 -0
- package/dist/esm/internal/refusal.d.ts.map +1 -0
- package/dist/esm/internal/refusal.js +47 -0
- package/dist/esm/internal/refusal.js.map +1 -0
- package/dist/esm/internal/supervision.d.ts +174 -0
- package/dist/esm/internal/supervision.d.ts.map +1 -0
- package/dist/esm/internal/supervision.js +485 -0
- package/dist/esm/internal/supervision.js.map +1 -0
- package/dist/esm/internal/unfinishedWork.d.ts +99 -0
- package/dist/esm/internal/unfinishedWork.d.ts.map +1 -0
- package/dist/esm/internal/unfinishedWork.js +85 -0
- package/dist/esm/internal/unfinishedWork.js.map +1 -0
- package/dist/esm/internal/unobservedCall.d.ts +112 -0
- package/dist/esm/internal/unobservedCall.d.ts.map +1 -0
- package/dist/esm/internal/unobservedCall.js +501 -0
- package/dist/esm/internal/unobservedCall.js.map +1 -0
- package/dist/esm/internal/untrustedData.d.ts +14 -0
- package/dist/esm/internal/untrustedData.d.ts.map +1 -0
- package/dist/esm/internal/untrustedData.js +15 -0
- package/dist/esm/internal/untrustedData.js.map +1 -0
- package/docs/README.md +129 -0
- package/docs/api.md +1869 -0
- package/docs/concepts.md +238 -0
- package/docs/external-transcripts.md +245 -0
- package/docs/guides/bind-flows.md +167 -0
- package/docs/guides/drive-the-loop.md +265 -0
- package/docs/guides/run-cells.md +262 -0
- package/docs/guides/workerd.md +144 -0
- package/docs/installation.md +69 -0
- package/docs/quickstart.md +121 -0
- package/docs/reference.md +954 -0
- package/docs/troubleshooting.md +177 -0
- package/package.json +463 -3
- package/src/AgentEvent.ts +1772 -0
- package/src/CallLedger.ts +560 -0
- package/src/Cell.ts +926 -0
- package/src/CellCalls.ts +198 -0
- package/src/CellHistory.ts +128 -0
- package/src/CellTurn.ts +4450 -0
- package/src/CellValidation.ts +382 -0
- package/src/Compaction.ts +330 -0
- package/src/CompletionClaim.ts +1013 -0
- package/src/ContextWindow.ts +669 -0
- package/src/EngineLike.ts +614 -0
- package/src/ExternalTranscript.ts +1142 -0
- package/src/FailedCall.ts +163 -0
- package/src/FlowBinding.ts +603 -0
- package/src/HarnessError.ts +98 -0
- package/src/Judgement.ts +526 -0
- package/src/Monitor.ts +579 -0
- package/src/NarrowedCheck.ts +694 -0
- package/src/Notifications.ts +262 -0
- package/src/Plan.ts +113 -0
- package/src/QuickJSSandbox.ts +1557 -0
- package/src/Relevance.ts +352 -0
- package/src/Sandbox.ts +908 -0
- package/src/Steering.ts +405 -0
- package/src/StructuredOutput.ts +484 -0
- package/src/Sufficiency.ts +247 -0
- package/src/Supervisor.ts +798 -0
- package/src/Tokens.ts +108 -0
- package/src/Transcript.ts +513 -0
- package/src/TruncatedOutput.ts +297 -0
- package/src/UnmovedTree.ts +121 -0
- package/src/UnresolvedFailure.ts +240 -0
- package/src/VacuousVerification.ts +280 -0
- package/src/VariablesPanel.ts +165 -0
- package/src/index.ts +204 -0
- package/src/internal/bytes.ts +70 -0
- package/src/internal/cellPrompt.ts +337 -0
- package/src/internal/compactable.ts +76 -0
- package/src/internal/compactionMarks.ts +454 -0
- package/src/internal/demandText.ts +145 -0
- package/src/internal/elide.ts +130 -0
- package/src/internal/frame.ts +1178 -0
- package/src/internal/nonNegativeSafeInt.ts +24 -0
- package/src/internal/paidUsage.ts +90 -0
- package/src/internal/printChannel.ts +434 -0
- package/src/internal/printsObservation.ts +31 -0
- package/src/internal/refusal.ts +53 -0
- package/src/internal/supervision.ts +652 -0
- package/src/internal/unfinishedWork.ts +123 -0
- package/src/internal/unobservedCall.ts +536 -0
- package/src/internal/untrustedData.ts +19 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The evidence that is already complete.
|
|
3
|
+
*
|
|
4
|
+
* Every armed control in this package pushes a run to do more. The read-only
|
|
5
|
+
* cap says nothing has been written. The repeat demand says nothing new has
|
|
6
|
+
* been learned. `UnmovedTree` says there is no change behind the completion,
|
|
7
|
+
* `UnresolvedFailure` says a failing check was stepped around, `NarrowedCheck`
|
|
8
|
+
* says the evidence is narrower than it looks. Five brakes and no accelerator,
|
|
9
|
+
* and the asymmetry is not free: on a graded benchmark the best rounds pay one
|
|
10
|
+
* frame re-checking work they had already proved and one more frame doing
|
|
11
|
+
* nothing but writing the completion, because nothing ever tells a careful run
|
|
12
|
+
* that it is finished. Two of the seventeen strokes those rounds spent over par
|
|
13
|
+
* are that, measured.
|
|
14
|
+
*
|
|
15
|
+
* Pure braking also produces compliance rather than work. The wave that armed
|
|
16
|
+
* the completion demands answered the read-only demand with a paragraph and no
|
|
17
|
+
* write, and answered the unmoved-tree demand with "no change is needed" and an
|
|
18
|
+
* empty patch. A control set that only ever says *not yet* teaches a run to
|
|
19
|
+
* write the sentence that makes the notice go away.
|
|
20
|
+
*
|
|
21
|
+
* This is the counterweight, and it is built out of what the controller already
|
|
22
|
+
* records. Three facts, in this order:
|
|
23
|
+
*
|
|
24
|
+
* 1. a check reported a failing exit status over a tree the run had not yet
|
|
25
|
+
* changed;
|
|
26
|
+
* 2. the run changed the workspace after that;
|
|
27
|
+
* 3. the same check, or a broader one, reported a passing exit status after the
|
|
28
|
+
* change.
|
|
29
|
+
*
|
|
30
|
+
* That is failing-before and passing-after over one subject, which is the whole
|
|
31
|
+
* of what the contract asks a run to hold before it completes. So the harness
|
|
32
|
+
* says so, once, in one sentence, and asks for nothing: the run may complete
|
|
33
|
+
* citing it or name what is still missing. It is an observation and not a
|
|
34
|
+
* demand — nothing is bounced, nothing is refused, no cap is spent — because a
|
|
35
|
+
* harness that decided a run was finished would be grading the agent's work
|
|
36
|
+
* with its own, which is the line every other control in this package holds.
|
|
37
|
+
*
|
|
38
|
+
* It reads no output and parses no runner. `exitCode` is the one wire key the
|
|
39
|
+
* controller already reads, `UnresolvedFailure` owns what it means, and the
|
|
40
|
+
* ordering comes from the run's own count of frames that changed the workspace.
|
|
41
|
+
*
|
|
42
|
+
* @since 0.1.0
|
|
43
|
+
*/
|
|
44
|
+
import { Schema } from "effect";
|
|
45
|
+
import * as NarrowedCheck from "./NarrowedCheck.ts";
|
|
46
|
+
/**
|
|
47
|
+
* How many distinct failing checks one run carries forward.
|
|
48
|
+
*
|
|
49
|
+
* The ledger is durable controller state, so it is bounded, and it holds only
|
|
50
|
+
* the checks that reported a failure — a small fraction of what a run runs. The
|
|
51
|
+
* longest graded run recorded nine of them across 42 frames, so sixteen covers
|
|
52
|
+
* a whole run with room to spare. A run that outlives the bound forgets its
|
|
53
|
+
* oldest failures first, which can cost the observation and can never invent
|
|
54
|
+
* one.
|
|
55
|
+
*
|
|
56
|
+
* @category constants
|
|
57
|
+
* @since 0.1.0
|
|
58
|
+
*/
|
|
59
|
+
export declare const retained = 16;
|
|
60
|
+
declare const Failure_base: Schema.Class<Failure, Schema.Struct<{
|
|
61
|
+
/** The flow the call named. */
|
|
62
|
+
readonly flow: Schema.String;
|
|
63
|
+
/** The call's identity, as the controller's own signature names it. */
|
|
64
|
+
readonly signature: Schema.String;
|
|
65
|
+
/** The distinct terms of the call's input, sorted; see `NarrowedCheck` `terms`. */
|
|
66
|
+
readonly terms: Schema.$Array<Schema.String>;
|
|
67
|
+
/** The call's input as it was written, clipped, for the observation to quote. */
|
|
68
|
+
readonly label: Schema.String;
|
|
69
|
+
/**
|
|
70
|
+
* How many frames had changed the workspace when this check failed.
|
|
71
|
+
*
|
|
72
|
+
* The run's own count of mutating frames is the clock here, rather than a
|
|
73
|
+
* workspace digest, because the fact being established is an ordering — this
|
|
74
|
+
* failed, then something changed, then that passed — and a count is an
|
|
75
|
+
* ordering on any host, including one that measures nothing and knows only
|
|
76
|
+
* what its calls declared.
|
|
77
|
+
*/
|
|
78
|
+
readonly epoch: Schema.Int;
|
|
79
|
+
}>, {}>;
|
|
80
|
+
/**
|
|
81
|
+
* One check that reported a failure, and where the run was when it did.
|
|
82
|
+
*
|
|
83
|
+
* @category models
|
|
84
|
+
* @since 0.1.0
|
|
85
|
+
*/
|
|
86
|
+
export declare class Failure extends Failure_base {
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The failing checks this run carries, oldest first and bounded.
|
|
90
|
+
*
|
|
91
|
+
* @category schemas
|
|
92
|
+
* @since 0.1.0
|
|
93
|
+
*/
|
|
94
|
+
export declare const Ledger: Schema.withDecodingDefaultKey<Schema.withConstructorDefault<Schema.$Array<typeof Failure>>, never>;
|
|
95
|
+
/**
|
|
96
|
+
* The failing checks this run carries, oldest first and bounded.
|
|
97
|
+
*
|
|
98
|
+
* @category models
|
|
99
|
+
* @since 0.1.0
|
|
100
|
+
*/
|
|
101
|
+
export type Ledger = typeof Ledger.Type;
|
|
102
|
+
/**
|
|
103
|
+
* Records one frame's failing checks against the epoch it ran in.
|
|
104
|
+
*
|
|
105
|
+
* A check from a frame that also changed the workspace is dropped rather than
|
|
106
|
+
* recorded. A frame's calls are not ordered against its edits in anything the
|
|
107
|
+
* harness records, so such a check might have failed before the change or after
|
|
108
|
+
* it, and a failure stamped on the wrong side of an edit is exactly the false
|
|
109
|
+
* before-and-after this module must never manufacture. `UnresolvedFailure`
|
|
110
|
+
* refuses the same stamp for the same reason; see `NarrowedCheck` `Check`
|
|
111
|
+
* `stable`.
|
|
112
|
+
*
|
|
113
|
+
* A repeated signature moves to the newest position and restamps, so a check
|
|
114
|
+
* that failed again over a later tree is remembered where it last failed.
|
|
115
|
+
*
|
|
116
|
+
* @category combinators
|
|
117
|
+
* @since 0.1.0
|
|
118
|
+
*/
|
|
119
|
+
export declare const remember: (ledger: Ledger, options: {
|
|
120
|
+
/** The checks this frame ran. */
|
|
121
|
+
readonly frame: ReadonlyArray<NarrowedCheck.Check>;
|
|
122
|
+
/** Frames that had changed the workspace before this one. */
|
|
123
|
+
readonly epoch: number;
|
|
124
|
+
}) => Ledger;
|
|
125
|
+
/**
|
|
126
|
+
* A failure this run has answered, and the check that answered it.
|
|
127
|
+
*
|
|
128
|
+
* @category models
|
|
129
|
+
* @since 0.1.0
|
|
130
|
+
*/
|
|
131
|
+
export interface Sufficient {
|
|
132
|
+
/** The check that reported a failure before the run changed anything. */
|
|
133
|
+
readonly failed: Failure;
|
|
134
|
+
/** The check that reported a pass after it, over the changed tree. */
|
|
135
|
+
readonly passed: NarrowedCheck.Check;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Finds a failing-before, passing-after pair this frame has completed.
|
|
139
|
+
*
|
|
140
|
+
* Four conditions, each read off the run's own record:
|
|
141
|
+
*
|
|
142
|
+
* 0. no check of this frame reported a *failing* exit status. The sentence says
|
|
143
|
+
* the evidence the contract asks for exists, and a frame that is looking at
|
|
144
|
+
* a red check right now is a frame for which that reading is at best half
|
|
145
|
+
* the record — a narrow probe going green while the broad check beside it
|
|
146
|
+
* stays red is the exact shape that has lost one graded instance for six
|
|
147
|
+
* consecutive waves. The harness will not pick the good half out of a frame
|
|
148
|
+
* that holds both; it says nothing and lets the run finish reading. This
|
|
149
|
+
* only ever suppresses the observation and can never manufacture one, and it
|
|
150
|
+
* changes neither of the two frames that fire across the ten journals two
|
|
151
|
+
* graded waves recorded;
|
|
152
|
+
* 1. some stable check of this frame reported a *passing* exit status — silence
|
|
153
|
+
* is not a pass, and an unstable reading may precede this frame's edits.
|
|
154
|
+
* Checkpoint-attributed readings are already stamped stable by `CellTurn`;
|
|
155
|
+
* 2. some remembered failure names the same flow and is the same call, or one
|
|
156
|
+
* that check is broader than, as `NarrowedCheck` `narrows` reads "broader":
|
|
157
|
+
* every term of the passing check is carried by the failing one, which added
|
|
158
|
+
* conditions to it.
|
|
159
|
+
* A broader reading passing is stronger evidence than the narrow one
|
|
160
|
+
* passing, never weaker, so it is admitted;
|
|
161
|
+
* 3. the run changed the workspace between the two — the failure's epoch is
|
|
162
|
+
* below the epoch this frame closes at.
|
|
163
|
+
*
|
|
164
|
+
* The broadest qualifying passing check wins — fewest terms, the least
|
|
165
|
+
* constrained question — so the sentence quotes the strongest evidence the run
|
|
166
|
+
* holds rather than the first one found. Ties go to the earliest-settled check.
|
|
167
|
+
* Among the failures that check answers, the most recent one wins, because it
|
|
168
|
+
* is the reading the run was working against most lately.
|
|
169
|
+
*
|
|
170
|
+
* @category conversions
|
|
171
|
+
* @since 0.1.0
|
|
172
|
+
*/
|
|
173
|
+
export declare const find: (options: {
|
|
174
|
+
/** Failing checks this run has remembered, oldest first. */
|
|
175
|
+
readonly ledger: Ledger;
|
|
176
|
+
/** The checks this frame ran, in the order they settled. */
|
|
177
|
+
readonly frame: ReadonlyArray<NarrowedCheck.Check>;
|
|
178
|
+
/** Frames that have changed the workspace, this one included. */
|
|
179
|
+
readonly epoch: number;
|
|
180
|
+
}) => Sufficient | undefined;
|
|
181
|
+
/**
|
|
182
|
+
* States that the run holds both halves of its own evidence.
|
|
183
|
+
*
|
|
184
|
+
* It quotes both readings and says what they establish, then names the two
|
|
185
|
+
* things the run may do with that — complete citing it, or say what is still
|
|
186
|
+
* missing — as equals. It asks for nothing and refuses nothing: the harness
|
|
187
|
+
* does not know whether the change is right, only that the evidence the
|
|
188
|
+
* contract asks for exists, and the sentence claims exactly that much.
|
|
189
|
+
*
|
|
190
|
+
* @category constructors
|
|
191
|
+
* @since 0.1.0
|
|
192
|
+
*/
|
|
193
|
+
export declare const observation: (found: Sufficient) => string;
|
|
194
|
+
export {};
|
|
195
|
+
//# sourceMappingURL=Sufficiency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sufficiency.d.ts","sourceRoot":"","sources":["../../src/Sufficiency.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEvC,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,QAAQ,KAAK,CAAA;;IASxB,+BAA+B;;IAE/B,uEAAuE;;IAEvE,mFAAmF;;IAEnF,iFAAiF;;IAEjF;;;;;;;;OAQG;;;AAvBL;;;;;GAKG;AACH,qBAAa,OAAQ,SAAQ,YAmB3B;CAAG;AAEL;;;;;GAKG;AACH,eAAO,MAAM,MAAM,oGAGlB,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAA;AAEvC;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,QAAQ,GACnB,QAAQ,MAAM,EACd,SAAS;IACP,iCAAiC;IACjC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;IAClD,6DAA6D;IAC7D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB,KACA,MAkBF,CAAA;AAED;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,yEAAyE;IACzE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,sEAAsE;IACtE,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,KAAK,CAAA;CACrC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,IAAI,GAAI,SAAS;IAC5B,4DAA4D;IAC5D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;IAClD,iEAAiE;IACjE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB,KAAG,UAAU,GAAG,SAgBhB,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,UAAU,KAAG,MAMqZ,CAAA"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The evidence that is already complete.
|
|
3
|
+
*
|
|
4
|
+
* Every armed control in this package pushes a run to do more. The read-only
|
|
5
|
+
* cap says nothing has been written. The repeat demand says nothing new has
|
|
6
|
+
* been learned. `UnmovedTree` says there is no change behind the completion,
|
|
7
|
+
* `UnresolvedFailure` says a failing check was stepped around, `NarrowedCheck`
|
|
8
|
+
* says the evidence is narrower than it looks. Five brakes and no accelerator,
|
|
9
|
+
* and the asymmetry is not free: on a graded benchmark the best rounds pay one
|
|
10
|
+
* frame re-checking work they had already proved and one more frame doing
|
|
11
|
+
* nothing but writing the completion, because nothing ever tells a careful run
|
|
12
|
+
* that it is finished. Two of the seventeen strokes those rounds spent over par
|
|
13
|
+
* are that, measured.
|
|
14
|
+
*
|
|
15
|
+
* Pure braking also produces compliance rather than work. The wave that armed
|
|
16
|
+
* the completion demands answered the read-only demand with a paragraph and no
|
|
17
|
+
* write, and answered the unmoved-tree demand with "no change is needed" and an
|
|
18
|
+
* empty patch. A control set that only ever says *not yet* teaches a run to
|
|
19
|
+
* write the sentence that makes the notice go away.
|
|
20
|
+
*
|
|
21
|
+
* This is the counterweight, and it is built out of what the controller already
|
|
22
|
+
* records. Three facts, in this order:
|
|
23
|
+
*
|
|
24
|
+
* 1. a check reported a failing exit status over a tree the run had not yet
|
|
25
|
+
* changed;
|
|
26
|
+
* 2. the run changed the workspace after that;
|
|
27
|
+
* 3. the same check, or a broader one, reported a passing exit status after the
|
|
28
|
+
* change.
|
|
29
|
+
*
|
|
30
|
+
* That is failing-before and passing-after over one subject, which is the whole
|
|
31
|
+
* of what the contract asks a run to hold before it completes. So the harness
|
|
32
|
+
* says so, once, in one sentence, and asks for nothing: the run may complete
|
|
33
|
+
* citing it or name what is still missing. It is an observation and not a
|
|
34
|
+
* demand — nothing is bounced, nothing is refused, no cap is spent — because a
|
|
35
|
+
* harness that decided a run was finished would be grading the agent's work
|
|
36
|
+
* with its own, which is the line every other control in this package holds.
|
|
37
|
+
*
|
|
38
|
+
* It reads no output and parses no runner. `exitCode` is the one wire key the
|
|
39
|
+
* controller already reads, `UnresolvedFailure` owns what it means, and the
|
|
40
|
+
* ordering comes from the run's own count of frames that changed the workspace.
|
|
41
|
+
*
|
|
42
|
+
* @since 0.1.0
|
|
43
|
+
*/
|
|
44
|
+
import { Effect, Schema } from "effect";
|
|
45
|
+
import { NonNegativeSafeInt } from "./internal/nonNegativeSafeInt.js";
|
|
46
|
+
import * as NarrowedCheck from "./NarrowedCheck.js";
|
|
47
|
+
/**
|
|
48
|
+
* How many distinct failing checks one run carries forward.
|
|
49
|
+
*
|
|
50
|
+
* The ledger is durable controller state, so it is bounded, and it holds only
|
|
51
|
+
* the checks that reported a failure — a small fraction of what a run runs. The
|
|
52
|
+
* longest graded run recorded nine of them across 42 frames, so sixteen covers
|
|
53
|
+
* a whole run with room to spare. A run that outlives the bound forgets its
|
|
54
|
+
* oldest failures first, which can cost the observation and can never invent
|
|
55
|
+
* one.
|
|
56
|
+
*
|
|
57
|
+
* @category constants
|
|
58
|
+
* @since 0.1.0
|
|
59
|
+
*/
|
|
60
|
+
export const retained = 16;
|
|
61
|
+
/**
|
|
62
|
+
* One check that reported a failure, and where the run was when it did.
|
|
63
|
+
*
|
|
64
|
+
* @category models
|
|
65
|
+
* @since 0.1.0
|
|
66
|
+
*/
|
|
67
|
+
export class Failure extends Schema.Class("flows/harness/Sufficiency/Failure")({
|
|
68
|
+
/** The flow the call named. */
|
|
69
|
+
flow: Schema.String,
|
|
70
|
+
/** The call's identity, as the controller's own signature names it. */
|
|
71
|
+
signature: Schema.String,
|
|
72
|
+
/** The distinct terms of the call's input, sorted; see `NarrowedCheck` `terms`. */
|
|
73
|
+
terms: Schema.Array(Schema.String),
|
|
74
|
+
/** The call's input as it was written, clipped, for the observation to quote. */
|
|
75
|
+
label: Schema.String,
|
|
76
|
+
/**
|
|
77
|
+
* How many frames had changed the workspace when this check failed.
|
|
78
|
+
*
|
|
79
|
+
* The run's own count of mutating frames is the clock here, rather than a
|
|
80
|
+
* workspace digest, because the fact being established is an ordering — this
|
|
81
|
+
* failed, then something changed, then that passed — and a count is an
|
|
82
|
+
* ordering on any host, including one that measures nothing and knows only
|
|
83
|
+
* what its calls declared.
|
|
84
|
+
*/
|
|
85
|
+
epoch: NonNegativeSafeInt
|
|
86
|
+
}) {
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The failing checks this run carries, oldest first and bounded.
|
|
90
|
+
*
|
|
91
|
+
* @category schemas
|
|
92
|
+
* @since 0.1.0
|
|
93
|
+
*/
|
|
94
|
+
export const Ledger = Schema.Array(Failure).pipe(Schema.withConstructorDefault(Effect.succeed([])), Schema.withDecodingDefaultKey(Effect.succeed([])));
|
|
95
|
+
/**
|
|
96
|
+
* Records one frame's failing checks against the epoch it ran in.
|
|
97
|
+
*
|
|
98
|
+
* A check from a frame that also changed the workspace is dropped rather than
|
|
99
|
+
* recorded. A frame's calls are not ordered against its edits in anything the
|
|
100
|
+
* harness records, so such a check might have failed before the change or after
|
|
101
|
+
* it, and a failure stamped on the wrong side of an edit is exactly the false
|
|
102
|
+
* before-and-after this module must never manufacture. `UnresolvedFailure`
|
|
103
|
+
* refuses the same stamp for the same reason; see `NarrowedCheck` `Check`
|
|
104
|
+
* `stable`.
|
|
105
|
+
*
|
|
106
|
+
* A repeated signature moves to the newest position and restamps, so a check
|
|
107
|
+
* that failed again over a later tree is remembered where it last failed.
|
|
108
|
+
*
|
|
109
|
+
* @category combinators
|
|
110
|
+
* @since 0.1.0
|
|
111
|
+
*/
|
|
112
|
+
export const remember = (ledger, options) => {
|
|
113
|
+
const newest = new Map(ledger.map((entry) => [entry.signature, entry]));
|
|
114
|
+
for (const check of options.frame) {
|
|
115
|
+
if (!check.failing || !check.stable)
|
|
116
|
+
continue;
|
|
117
|
+
newest.delete(check.signature);
|
|
118
|
+
newest.set(check.signature, new Failure({
|
|
119
|
+
flow: check.flow,
|
|
120
|
+
signature: check.signature,
|
|
121
|
+
terms: check.terms,
|
|
122
|
+
label: check.label,
|
|
123
|
+
epoch: options.epoch
|
|
124
|
+
}));
|
|
125
|
+
}
|
|
126
|
+
const distinct = [...newest.values()];
|
|
127
|
+
return distinct.slice(Math.max(0, distinct.length - retained));
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Finds a failing-before, passing-after pair this frame has completed.
|
|
131
|
+
*
|
|
132
|
+
* Four conditions, each read off the run's own record:
|
|
133
|
+
*
|
|
134
|
+
* 0. no check of this frame reported a *failing* exit status. The sentence says
|
|
135
|
+
* the evidence the contract asks for exists, and a frame that is looking at
|
|
136
|
+
* a red check right now is a frame for which that reading is at best half
|
|
137
|
+
* the record — a narrow probe going green while the broad check beside it
|
|
138
|
+
* stays red is the exact shape that has lost one graded instance for six
|
|
139
|
+
* consecutive waves. The harness will not pick the good half out of a frame
|
|
140
|
+
* that holds both; it says nothing and lets the run finish reading. This
|
|
141
|
+
* only ever suppresses the observation and can never manufacture one, and it
|
|
142
|
+
* changes neither of the two frames that fire across the ten journals two
|
|
143
|
+
* graded waves recorded;
|
|
144
|
+
* 1. some stable check of this frame reported a *passing* exit status — silence
|
|
145
|
+
* is not a pass, and an unstable reading may precede this frame's edits.
|
|
146
|
+
* Checkpoint-attributed readings are already stamped stable by `CellTurn`;
|
|
147
|
+
* 2. some remembered failure names the same flow and is the same call, or one
|
|
148
|
+
* that check is broader than, as `NarrowedCheck` `narrows` reads "broader":
|
|
149
|
+
* every term of the passing check is carried by the failing one, which added
|
|
150
|
+
* conditions to it.
|
|
151
|
+
* A broader reading passing is stronger evidence than the narrow one
|
|
152
|
+
* passing, never weaker, so it is admitted;
|
|
153
|
+
* 3. the run changed the workspace between the two — the failure's epoch is
|
|
154
|
+
* below the epoch this frame closes at.
|
|
155
|
+
*
|
|
156
|
+
* The broadest qualifying passing check wins — fewest terms, the least
|
|
157
|
+
* constrained question — so the sentence quotes the strongest evidence the run
|
|
158
|
+
* holds rather than the first one found. Ties go to the earliest-settled check.
|
|
159
|
+
* Among the failures that check answers, the most recent one wins, because it
|
|
160
|
+
* is the reading the run was working against most lately.
|
|
161
|
+
*
|
|
162
|
+
* @category conversions
|
|
163
|
+
* @since 0.1.0
|
|
164
|
+
*/
|
|
165
|
+
export const find = (options) => {
|
|
166
|
+
if (options.frame.some((check) => check.failing))
|
|
167
|
+
return undefined;
|
|
168
|
+
let found = undefined;
|
|
169
|
+
for (const passed of options.frame) {
|
|
170
|
+
if (!passed.passing || !passed.stable)
|
|
171
|
+
continue;
|
|
172
|
+
if (found !== undefined && found.passed.terms.length <= passed.terms.length)
|
|
173
|
+
continue;
|
|
174
|
+
let answered = undefined;
|
|
175
|
+
for (const failed of options.ledger) {
|
|
176
|
+
if (failed.epoch >= options.epoch)
|
|
177
|
+
continue;
|
|
178
|
+
if (failed.flow !== passed.flow)
|
|
179
|
+
continue;
|
|
180
|
+
if (failed.signature !== passed.signature && !NarrowedCheck.narrows(failed.terms, passed.terms))
|
|
181
|
+
continue;
|
|
182
|
+
answered = failed;
|
|
183
|
+
}
|
|
184
|
+
if (answered !== undefined)
|
|
185
|
+
found = { failed: answered, passed };
|
|
186
|
+
}
|
|
187
|
+
return found;
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* States that the run holds both halves of its own evidence.
|
|
191
|
+
*
|
|
192
|
+
* It quotes both readings and says what they establish, then names the two
|
|
193
|
+
* things the run may do with that — complete citing it, or say what is still
|
|
194
|
+
* missing — as equals. It asks for nothing and refuses nothing: the harness
|
|
195
|
+
* does not know whether the change is right, only that the evidence the
|
|
196
|
+
* contract asks for exists, and the sentence claims exactly that much.
|
|
197
|
+
*
|
|
198
|
+
* @category constructors
|
|
199
|
+
* @since 0.1.0
|
|
200
|
+
*/
|
|
201
|
+
export const observation = (found) => `Evidence held — you have watched a check fail before your change and pass after it, which is the evidence this contract asks for.
|
|
202
|
+
|
|
203
|
+
- failed, before the workspace changed: ${found.failed.flow} ${found.failed.label}
|
|
204
|
+
- passed, after it changed: ${found.passed.flow} ${found.passed.label}
|
|
205
|
+
|
|
206
|
+
Nothing is being asked of you and nothing has been refused; this is the record read back. If that pair is the proof of the change you set out to make, complete now and name both commands and what they printed in your output. If it is not — the pair covers less than you changed, or a check you have not run yet is the one that would tell you — say in your next context which reading is still missing and go take it. This notice is written once per run.`;
|
|
207
|
+
//# sourceMappingURL=Sufficiency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sufficiency.js","sourceRoot":"","sources":["../../src/Sufficiency.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AACrE,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,EAAE,CAAA;AAE1B;;;;;GAKG;AACH,MAAM,OAAO,OAAQ,SAAQ,MAAM,CAAC,KAAK,CAAU,mCAAmC,CAAC,CAAC;IACtF,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC,MAAM;IACnB,uEAAuE;IACvE,SAAS,EAAE,MAAM,CAAC,MAAM;IACxB,mFAAmF;IACnF,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;IAClC,iFAAiF;IACjF,KAAK,EAAE,MAAM,CAAC,MAAM;IACpB;;;;;;;;OAQG;IACH,KAAK,EAAE,kBAAkB;CAC1B,CAAC;CAAG;AAEL;;;;;GAKG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAC9C,MAAM,CAAC,sBAAsB,CAAC,MAAM,CAAC,OAAO,CAAyB,EAAE,CAAC,CAAC,EACzE,MAAM,CAAC,sBAAsB,CAAC,MAAM,CAAC,OAAO,CAAyB,EAAE,CAAC,CAAC,CAC1E,CAAA;AAUD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,MAAc,EACd,OAKC,EACO,EAAE;IACV,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,CAAA;IACvE,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAClC,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM;YAAE,SAAQ;QAC7C,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;QAC9B,MAAM,CAAC,GAAG,CACR,KAAK,CAAC,SAAS,EACf,IAAI,OAAO,CAAC;YACV,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,KAAK,EAAE,OAAO,CAAC,KAAK;SACrB,CAAC,CACH,CAAA;IACH,CAAC;IACD,MAAM,QAAQ,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;IACrC,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAA;AAChE,CAAC,CAAA;AAeD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,OAOpB,EAA0B,EAAE;IAC3B,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;QAAE,OAAO,SAAS,CAAA;IAClE,IAAI,KAAK,GAA2B,SAAS,CAAA;IAC7C,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QACnC,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM;YAAE,SAAQ;QAC/C,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM;YAAE,SAAQ;QACrF,IAAI,QAAQ,GAAwB,SAAS,CAAA;QAC7C,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;YACpC,IAAI,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK;gBAAE,SAAQ;YAC3C,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI;gBAAE,SAAQ;YACzC,IAAI,MAAM,CAAC,SAAS,KAAK,MAAM,CAAC,SAAS,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;gBAAE,SAAQ;YACzG,QAAQ,GAAG,MAAM,CAAA;QACnB,CAAC;QACD,IAAI,QAAQ,KAAK,SAAS;YAAE,KAAK,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClE,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAiB,EAAU,EAAE,CACvD;;0CAEwC,KAAK,CAAC,MAAM,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK;8BACnD,KAAK,CAAC,MAAM,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK;;qcAEgY,CAAA","sourcesContent":["/**\n * The evidence that is already complete.\n *\n * Every armed control in this package pushes a run to do more. The read-only\n * cap says nothing has been written. The repeat demand says nothing new has\n * been learned. `UnmovedTree` says there is no change behind the completion,\n * `UnresolvedFailure` says a failing check was stepped around, `NarrowedCheck`\n * says the evidence is narrower than it looks. Five brakes and no accelerator,\n * and the asymmetry is not free: on a graded benchmark the best rounds pay one\n * frame re-checking work they had already proved and one more frame doing\n * nothing but writing the completion, because nothing ever tells a careful run\n * that it is finished. Two of the seventeen strokes those rounds spent over par\n * are that, measured.\n *\n * Pure braking also produces compliance rather than work. The wave that armed\n * the completion demands answered the read-only demand with a paragraph and no\n * write, and answered the unmoved-tree demand with \"no change is needed\" and an\n * empty patch. A control set that only ever says *not yet* teaches a run to\n * write the sentence that makes the notice go away.\n *\n * This is the counterweight, and it is built out of what the controller already\n * records. Three facts, in this order:\n *\n * 1. a check reported a failing exit status over a tree the run had not yet\n * changed;\n * 2. the run changed the workspace after that;\n * 3. the same check, or a broader one, reported a passing exit status after the\n * change.\n *\n * That is failing-before and passing-after over one subject, which is the whole\n * of what the contract asks a run to hold before it completes. So the harness\n * says so, once, in one sentence, and asks for nothing: the run may complete\n * citing it or name what is still missing. It is an observation and not a\n * demand — nothing is bounced, nothing is refused, no cap is spent — because a\n * harness that decided a run was finished would be grading the agent's work\n * with its own, which is the line every other control in this package holds.\n *\n * It reads no output and parses no runner. `exitCode` is the one wire key the\n * controller already reads, `UnresolvedFailure` owns what it means, and the\n * ordering comes from the run's own count of frames that changed the workspace.\n *\n * @since 0.1.0\n */\n\nimport { Effect, Schema } from \"effect\"\nimport { NonNegativeSafeInt } from \"./internal/nonNegativeSafeInt.ts\"\nimport * as NarrowedCheck from \"./NarrowedCheck.ts\"\n\n/**\n * How many distinct failing checks one run carries forward.\n *\n * The ledger is durable controller state, so it is bounded, and it holds only\n * the checks that reported a failure — a small fraction of what a run runs. The\n * longest graded run recorded nine of them across 42 frames, so sixteen covers\n * a whole run with room to spare. A run that outlives the bound forgets its\n * oldest failures first, which can cost the observation and can never invent\n * one.\n *\n * @category constants\n * @since 0.1.0\n */\nexport const retained = 16\n\n/**\n * One check that reported a failure, and where the run was when it did.\n *\n * @category models\n * @since 0.1.0\n */\nexport class Failure extends Schema.Class<Failure>(\"flows/harness/Sufficiency/Failure\")({\n /** The flow the call named. */\n flow: Schema.String,\n /** The call's identity, as the controller's own signature names it. */\n signature: Schema.String,\n /** The distinct terms of the call's input, sorted; see `NarrowedCheck` `terms`. */\n terms: Schema.Array(Schema.String),\n /** The call's input as it was written, clipped, for the observation to quote. */\n label: Schema.String,\n /**\n * How many frames had changed the workspace when this check failed.\n *\n * The run's own count of mutating frames is the clock here, rather than a\n * workspace digest, because the fact being established is an ordering — this\n * failed, then something changed, then that passed — and a count is an\n * ordering on any host, including one that measures nothing and knows only\n * what its calls declared.\n */\n epoch: NonNegativeSafeInt\n}) {}\n\n/**\n * The failing checks this run carries, oldest first and bounded.\n *\n * @category schemas\n * @since 0.1.0\n */\nexport const Ledger = Schema.Array(Failure).pipe(\n Schema.withConstructorDefault(Effect.succeed<ReadonlyArray<Failure>>([])),\n Schema.withDecodingDefaultKey(Effect.succeed<ReadonlyArray<Failure>>([]))\n)\n\n/**\n * The failing checks this run carries, oldest first and bounded.\n *\n * @category models\n * @since 0.1.0\n */\nexport type Ledger = typeof Ledger.Type\n\n/**\n * Records one frame's failing checks against the epoch it ran in.\n *\n * A check from a frame that also changed the workspace is dropped rather than\n * recorded. A frame's calls are not ordered against its edits in anything the\n * harness records, so such a check might have failed before the change or after\n * it, and a failure stamped on the wrong side of an edit is exactly the false\n * before-and-after this module must never manufacture. `UnresolvedFailure`\n * refuses the same stamp for the same reason; see `NarrowedCheck` `Check`\n * `stable`.\n *\n * A repeated signature moves to the newest position and restamps, so a check\n * that failed again over a later tree is remembered where it last failed.\n *\n * @category combinators\n * @since 0.1.0\n */\nexport const remember = (\n ledger: Ledger,\n options: {\n /** The checks this frame ran. */\n readonly frame: ReadonlyArray<NarrowedCheck.Check>\n /** Frames that had changed the workspace before this one. */\n readonly epoch: number\n }\n): Ledger => {\n const newest = new Map(ledger.map((entry) => [entry.signature, entry]))\n for (const check of options.frame) {\n if (!check.failing || !check.stable) continue\n newest.delete(check.signature)\n newest.set(\n check.signature,\n new Failure({\n flow: check.flow,\n signature: check.signature,\n terms: check.terms,\n label: check.label,\n epoch: options.epoch\n })\n )\n }\n const distinct = [...newest.values()]\n return distinct.slice(Math.max(0, distinct.length - retained))\n}\n\n/**\n * A failure this run has answered, and the check that answered it.\n *\n * @category models\n * @since 0.1.0\n */\nexport interface Sufficient {\n /** The check that reported a failure before the run changed anything. */\n readonly failed: Failure\n /** The check that reported a pass after it, over the changed tree. */\n readonly passed: NarrowedCheck.Check\n}\n\n/**\n * Finds a failing-before, passing-after pair this frame has completed.\n *\n * Four conditions, each read off the run's own record:\n *\n * 0. no check of this frame reported a *failing* exit status. The sentence says\n * the evidence the contract asks for exists, and a frame that is looking at\n * a red check right now is a frame for which that reading is at best half\n * the record — a narrow probe going green while the broad check beside it\n * stays red is the exact shape that has lost one graded instance for six\n * consecutive waves. The harness will not pick the good half out of a frame\n * that holds both; it says nothing and lets the run finish reading. This\n * only ever suppresses the observation and can never manufacture one, and it\n * changes neither of the two frames that fire across the ten journals two\n * graded waves recorded;\n * 1. some stable check of this frame reported a *passing* exit status — silence\n * is not a pass, and an unstable reading may precede this frame's edits.\n * Checkpoint-attributed readings are already stamped stable by `CellTurn`;\n * 2. some remembered failure names the same flow and is the same call, or one\n * that check is broader than, as `NarrowedCheck` `narrows` reads \"broader\":\n * every term of the passing check is carried by the failing one, which added\n * conditions to it.\n * A broader reading passing is stronger evidence than the narrow one\n * passing, never weaker, so it is admitted;\n * 3. the run changed the workspace between the two — the failure's epoch is\n * below the epoch this frame closes at.\n *\n * The broadest qualifying passing check wins — fewest terms, the least\n * constrained question — so the sentence quotes the strongest evidence the run\n * holds rather than the first one found. Ties go to the earliest-settled check.\n * Among the failures that check answers, the most recent one wins, because it\n * is the reading the run was working against most lately.\n *\n * @category conversions\n * @since 0.1.0\n */\nexport const find = (options: {\n /** Failing checks this run has remembered, oldest first. */\n readonly ledger: Ledger\n /** The checks this frame ran, in the order they settled. */\n readonly frame: ReadonlyArray<NarrowedCheck.Check>\n /** Frames that have changed the workspace, this one included. */\n readonly epoch: number\n}): Sufficient | undefined => {\n if (options.frame.some((check) => check.failing)) return undefined\n let found: Sufficient | undefined = undefined\n for (const passed of options.frame) {\n if (!passed.passing || !passed.stable) continue\n if (found !== undefined && found.passed.terms.length <= passed.terms.length) continue\n let answered: Failure | undefined = undefined\n for (const failed of options.ledger) {\n if (failed.epoch >= options.epoch) continue\n if (failed.flow !== passed.flow) continue\n if (failed.signature !== passed.signature && !NarrowedCheck.narrows(failed.terms, passed.terms)) continue\n answered = failed\n }\n if (answered !== undefined) found = { failed: answered, passed }\n }\n return found\n}\n\n/**\n * States that the run holds both halves of its own evidence.\n *\n * It quotes both readings and says what they establish, then names the two\n * things the run may do with that — complete citing it, or say what is still\n * missing — as equals. It asks for nothing and refuses nothing: the harness\n * does not know whether the change is right, only that the evidence the\n * contract asks for exists, and the sentence claims exactly that much.\n *\n * @category constructors\n * @since 0.1.0\n */\nexport const observation = (found: Sufficient): string =>\n `Evidence held — you have watched a check fail before your change and pass after it, which is the evidence this contract asks for.\n\n- failed, before the workspace changed: ${found.failed.flow} ${found.failed.label}\n- passed, after it changed: ${found.passed.flow} ${found.passed.label}\n\nNothing is being asked of you and nothing has been refused; this is the record read back. If that pair is the proof of the change you set out to make, complete now and name both commands and what they printed in your output. If it is not — the pair covers less than you changed, or a check you have not run yet is the one that would tell you — say in your next context which reading is still missing and go take it. This notice is written once per run.`\n"]}
|