@smthrs/harness 0.0.0-stage → 1.0.0-rc.3
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 +987 -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 +1143 -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 @@
|
|
|
1
|
+
{"version":3,"file":"supervision.js","sourceRoot":"","sources":["../../../src/internal/supervision.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAG5C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAA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AC;oBAClC,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC;oBACzD,UAAU,EAAE,KAAK,EAAE,UAAU,IAAI,EAAE;oBACnC,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;oBACxD,KAAK;oBACL,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO;iBAC5B,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAA;QACnB,CAAC,CAAC;KACL,CAAA;AACH,CAAC,CAAC,CAAA;AAEJ;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,IAAI,GAAW;IAC1B,KAAK,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI;IACxB,IAAI,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;CACpC,CAAA","sourcesContent":["/**\n * The supervisor's seat beside the cell loop: a one-slot sliding queue the\n * loop offers to, a forked fiber that reads the newest snapshot, scores the\n * run's monitors, judges the rows it recalls and marks the transcript\n * segments not yet marked, and a mailbox the next turn boundary takes a\n * monitor's message, memory and marks from.\n *\n * The loop never awaits any of it. `offer` is a sliding enqueue and returns\n * at once; `take` is a `Ref` swap. Everything Jev is asked, and everything\n * that comes back, happens on the forked fiber. A run that ends with a\n * reading in flight gives it `Supervisor.closeGraceMs` to settle and journal\n * as the scope closes, and no longer: a reading still unanswered then is\n * interrupted and journaled `supervisor-unjudged` with reason `interrupted`,\n * so a Jev call that was made is never missing from the record. A snapshot\n * the fiber never took is dropped and journals nothing: nobody asked.\n *\n * The reading is taken through `EngineLike.record`, keyed on the session,\n * the frame and the cell digest, so a resumed run is handed the reading its\n * original attempt recorded and never asks Jev again. The reading records\n * each monitor's raw value and nothing about delivery: `Monitor.gate` runs at\n * the boundary that takes it, inside that boundary's own recorded drain and\n * against the ledger the run holds there, so streaks, cooldowns and limits\n * count every delivery before it, a replayed boundary delivers exactly what it\n * delivered the first time, and a mailbox left over from a replayed frame is\n * discarded as stale rather than delivered twice. The rows a run has been shown are the boundary's to know:\n * a row shown between the offer and the drain is dropped there, so no row is\n * delivered twice however the readings interleave. Marks name segments by\n * digest and are never stale: a boundary stores them whichever frame's\n * reading they came from, and the model is not sent them.\n *\n * @since 1.0.0-rc.0\n * @private\n */\n\nimport { ModelRequest } from \"@smthrs/model\"\nimport type * as Evaluator from \"@smthrs/model/Evaluator\"\nimport type * as Descriptor from \"@smthrs/registry/Descriptor\"\nimport { Deferred, Effect, Fiber, Option, Queue, Ref, Schema, type Scope } from \"effect\"\nimport * as AgentEvent from \"../AgentEvent.ts\"\nimport type { State } from \"../CellTurn.ts\"\nimport type * as EngineLike from \"../EngineLike.ts\"\nimport * as Judgement from \"../Judgement.ts\"\nimport * as Monitor from \"../Monitor.ts\"\nimport * as Relevance from \"../Relevance.ts\"\nimport * as Supervisor from \"../Supervisor.ts\"\nimport * as UnmovedTree from \"../UnmovedTree.ts\"\nimport * as compactionMarks from \"./compactionMarks.ts\"\nimport type * as Frame from \"./frame.ts\"\nimport { paidUsage } from \"./paidUsage.ts\"\n\nconst eventType = AgentEvent.eventType\n\nconst nothing: Taken = { messages: [], memory: [], suppressed: [], marks: [], compact: [] }\n\n/**\n * What one frame hands the supervisor: the snapshot without its frames,\n * which the handle keeps, and the cell digest the record is keyed on.\n *\n * @since 1.0.0-rc.0\n * @private\n */\nexport interface Offer {\n readonly frame: number\n readonly digest: string\n /** The frame just closed; the handle keeps the ones before it. */\n readonly current: Supervisor.Frame\n readonly snapshot: Omit<Supervisor.Snapshot, \"frames\">\n /** Keys of the memory rows the run had been shown when the frame closed; never asked about. */\n readonly shown: ReadonlyArray<string>\n /** The head of the frame's prose, which the relevance reading is told as `recent`. */\n readonly recent: string\n /** Whether more than `Supervisor.skillLimit` skills could have been offered. */\n readonly skillsCapped: boolean\n /**\n * The transcript segments the run has no answer about yet, each once by\n * digest; empty unless the host holds a real judge.\n */\n readonly unmarked: ReadonlyArray<{ readonly digest: string; readonly item: compactionMarks.Item }>\n /** The labels of the checks still failing when the frame closed, which the marks reading is told. */\n readonly failing: ReadonlyArray<string>\n}\n\n/**\n * What one boundary takes from the mailbox.\n *\n * @since 1.0.0-rc.0\n * @private\n */\nexport interface Taken {\n /** The delivered monitor's message, then each memory row delivered. */\n readonly messages: ReadonlyArray<ModelRequest.Message>\n /** Keys of the memory rows delivered, in order. */\n readonly memory: ReadonlyArray<string>\n /** The monitor whose message leads `messages`, when one was delivered. */\n readonly monitor?: string\n /** Crossed monitors withheld, and why. */\n readonly suppressed: Monitor.Gated[\"suppressed\"]\n /** The ledger after gating a reading; absent when no reading was gated. */\n readonly ledger?: Monitor.Ledger\n /** Jev's answers about the segments the reading marked. */\n readonly marks: ReadonlyArray<compactionMarks.Marking>\n /** The context triggers the reading fired, which compact the run at its next frame. */\n readonly compact: ReadonlyArray<Supervisor.ContextTrigger>\n}\n\n/**\n * The loop's two calls into the supervisor.\n *\n * @since 1.0.0-rc.0\n * @private\n */\nexport interface Handle {\n /** Slides this frame's snapshot into the one-slot queue and returns at once. */\n readonly offer: (offer: Offer) => Effect.Effect<void>\n /**\n * What the boundary closing `frame` delivers from the newest reading when\n * that reading is of this frame or the one before, nothing otherwise: the\n * one message `Monitor.gate` lets through against `ledger`, the run's\n * ledger as the boundary holds it, then the memory rows. A row whose key is\n * in `shown`, the run's shown set as the boundary holds it, is dropped, and\n * nothing is gated or delivered unless `deliver`. A reading Jev could not\n * take gates nothing. Takes the mailbox either way, so a stale reading is\n * dropped and never delivered later; its marks are taken all the same.\n * A delivered reading's context triggers are taken beside its message.\n */\n readonly take: (\n frame: number,\n options: {\n readonly ledger: Monitor.Ledger\n readonly shown: ReadonlyArray<string>\n readonly deliver: boolean\n }\n ) => Effect.Effect<Taken>\n}\n\nconst MonitorRow = Schema.Struct({\n id: Schema.String,\n kind: AgentEvent.MonitorKind,\n p: Schema.Number,\n crossed: Schema.Boolean\n})\n\nconst MonitorCandidate = Schema.Struct({\n id: Schema.String,\n kind: AgentEvent.MonitorKind,\n priority: Schema.Number,\n p: Schema.Number,\n text: Schema.String\n})\n\n/** Everything one recorded reading holds, so a replay re-emits and re-delivers it. */\nconst Recorded = Schema.Struct({\n settled: Schema.NullOr(AgentEvent.SupervisorSettled),\n decision: Schema.NullOr(AgentEvent.DecisionSettled),\n unjudged: Schema.NullOr(AgentEvent.SupervisorUnjudged),\n /** The relevance reading of the recalled rows; null when none was asked or it failed. */\n memory: Schema.NullOr(AgentEvent.RelevanceSettled),\n memoryDecisions: Schema.Array(AgentEvent.DecisionSettled),\n memoryUnjudged: Schema.NullOr(AgentEvent.DecisionUnjudged),\n /** The recalled rows not withheld: every row when the reading failed. */\n memoryRows: Schema.Array(Supervisor.Recalled),\n /** Every monitor's value in the reading; empty when the reading failed. */\n monitorRows: Schema.Array(MonitorRow),\n /** The crossed monitors' messages, ungated; the boundary gates them. */\n monitorCandidates: Schema.Array(MonitorCandidate),\n /** The answers of the marks reading; empty when none was asked or it failed. */\n marks: Schema.Array(compactionMarks.Marking),\n marksDecisions: Schema.Array(AgentEvent.DecisionSettled),\n marksUnjudged: Schema.NullOr(AgentEvent.DecisionUnjudged)\n})\n\ntype Recorded = typeof Recorded.Type\n\ninterface Mailbox {\n readonly frame: number\n /** What the monitors said; absent when Jev could not take the reading. */\n readonly monitors: Monitor.Evaluation | undefined\n /** The monitors the reading scored, which the boundary gates against. */\n readonly declared: ReadonlyArray<Monitor.Monitor>\n readonly rows: ReadonlyArray<Supervisor.Recalled>\n readonly marks: ReadonlyArray<compactionMarks.Marking>\n /** The context triggers the reading fired; empty when Jev could not take it. */\n readonly compact: ReadonlyArray<Supervisor.ContextTrigger>\n}\n\n/**\n * The counts the deterministic controls keep, read off the state the frame\n * closed on. Nothing is re-derived: every field is a state field, a ledger\n * length, or a filter over a ledger the harness already wrote.\n *\n * @since 1.0.0-rc.0\n * @private\n */\nexport const signals = (\n state: State,\n facts: Frame.Accounting[\"facts\"],\n workspaceDigest: string,\n paths: number\n): Supervisor.Signals => ({\n frame: state.frame,\n maxFrames: state.maxFrames,\n readOnlyFrames: facts.readOnlyFrames,\n repeatFrames: facts.repeatFrames,\n mutations: facts.mutations,\n remoteMutations: facts.remoteMutations,\n treeMoved: UnmovedTree.find({\n opened: facts.openingDigest,\n digest: workspaceDigest,\n elsewhere: facts.remoteMutations\n }) === undefined,\n paths,\n checksRun: facts.checks.length,\n checksFailing: facts.checks.filter((check) => check.failing).length,\n failuresUnanswered: facts.failures.length,\n callsFailed: facts.callLedger.filter((entry) => !entry.ok).length,\n callsSettled: facts.callLedger.length,\n narrowingDemands: state.narrowingDemands,\n unmovedDemands: state.unmovedDemands,\n unresolvedDemands: state.unresolvedDemands,\n claimDemands: state.claimDemands,\n sufficiencyStated: state.sufficiencyStated\n})\n\n/**\n * Whether one ledger subject names `path`. The subject is the call's target\n * as `CallLedger.subject` clipped it, so a path longer than `CallLedger.width`\n * survives only as its head and an elision notice, and an input no sole\n * target was lexed from is quoted whole, with the path inside it (#2028).\n *\n * @since 1.0.0-rc.0\n * @private\n */\nconst namesPath = (subject: string, path: string): boolean => {\n if (subject.includes(path)) return true\n const elided = subject.indexOf(\"… [+\")\n return elided > 0 && path.startsWith(subject.slice(0, elided))\n}\n\n/**\n * What a snapshot says about the frame's catalog: the Markdown skills the\n * model may call and has not — neither called by name nor read through a\n * `read` call on the skill's path — sorted by name and at most\n * `Supervisor.skillLimit` of them, offered only when `read` is in the catalog\n * to read them with; the distinct flows the ledger names, newest\n * `Supervisor.calledLimit` of them; and whether `jev` is in the catalog.\n *\n * @since 1.0.0-rc.0\n * @private\n */\nexport const catalog = (\n flows: ReadonlyArray<Descriptor.FlowDescriptor>,\n ledger: ReadonlyArray<{ readonly flow: string; readonly subject: string }>\n): Pick<Supervisor.Snapshot, \"skills\" | \"called\" | \"jevAvailable\"> & { readonly capped: boolean } => {\n const called = [...new Set(ledger.map((entry) => entry.flow))]\n const readable = flows.some((descriptor) => descriptor.name === \"read\")\n // A skill read through `read` is as called as one invoked by name: the\n // reminder says to read it, and the ledger is where that read shows.\n const readSubjects = ledger.flatMap((entry) => entry.flow === \"read\" ? [entry.subject] : [])\n const skills = readable\n ? flows\n .filter((descriptor) =>\n descriptor.modelInvocable && descriptor.body._tag === \"Markdown\" && !called.includes(descriptor.name) &&\n !readSubjects.some((subject) => namesPath(subject, descriptor.body.path))\n )\n .sort((a, b) => a.name < b.name ? -1 : 1)\n : []\n return {\n skills: skills.slice(0, Supervisor.skillLimit).map((descriptor) =>\n Supervisor.skill(descriptor.name, descriptor.description, descriptor.body.path)\n ),\n called: called.slice(-Supervisor.calledLimit),\n jevAvailable: flows.some((descriptor) => descriptor.name === \"jev\"),\n capped: skills.length > Supervisor.skillLimit\n }\n}\n\n/**\n * Opens the supervisor beside the loop: the queue, the mailbox, and the\n * forked fiber that serves them. Requires a scope, which is the loop's own,\n * so closing the loop closes the fiber.\n *\n * @since 1.0.0-rc.0\n * @private\n */\nexport const open = (input: {\n readonly session: string\n readonly engine: EngineLike.EngineLike\n readonly emit: (event: AgentEvent.AgentEvent) => Effect.Effect<void>\n /** The host's monitors; each reading adds `Monitor.skills` of its snapshot and `Monitor.useJev`. */\n readonly monitors: ReadonlyArray<Monitor.Monitor>\n /** Whether a monitor's message and memory inserts reach the run: the host holds a real judge. */\n readonly deliver: boolean\n}): Effect.Effect<Handle, never, Scope.Scope | Evaluator.Evaluator> =>\n Effect.gen(function*() {\n const { deliver, emit, engine, monitors, session } = input\n const mailbox = yield* Ref.make<Option.Option<Mailbox>>(Option.none())\n // The host's monitors, then one per skill the snapshot offers, then the\n // use-jev lint: what one reading asks and scores and its boundary gates.\n const scored = (snapshot: Supervisor.Snapshot): ReadonlyArray<Monitor.Monitor> => [\n ...monitors,\n ...Monitor.skills(snapshot),\n Monitor.useJev()\n ]\n const memory = yield* Supervisor.Memory\n // The evaluator the loop was given, captured once so the fiber asks the\n // same transport the completion brake does.\n const services = yield* Effect.context<Evaluator.Evaluator>()\n // The newest frames ahead of the one just closed, kept in memory: they\n // are evidence for a reading nothing replays, so durable state need not\n // carry them. A resumed run's first snapshots see fewer frames, which is\n // the honest reading of a past this process did not witness.\n const recent: Array<Supervisor.Frame> = []\n // Digests this fiber has marked. A segment is offered until a boundary\n // stores its answer, and a reading that lags the loop would otherwise\n // ask about it again each frame.\n const marked = new Set<string>()\n // The frame whose reading the fiber is taking, and a latch released when\n // that reading is done, whatever it came to. Read only by the scope's\n // closing grace below.\n const inFlight = yield* Ref.make<Option.Option<{ readonly frame: number; readonly done: Deferred.Deferred<void> }>>(\n Option.none()\n )\n // Which readings last failed for want of a judge. A host with none says so\n // once, not every frame; the next reading still asks, so a judge connected\n // mid-run is used at once, and any other failure is journaled every time.\n const unconfigured = new Set<\"supervisor\" | \"memory\" | \"marks\">()\n const repeated = (\n reading: \"supervisor\" | \"memory\" | \"marks\",\n unjudged: { readonly reason: string } | null,\n answered: boolean\n ): boolean => {\n if (unjudged?.reason === \"unconfigured\") {\n const seen = unconfigured.has(reading)\n unconfigured.add(reading)\n return seen\n }\n if (unjudged !== null || answered) unconfigured.delete(reading)\n return false\n }\n\n // A store that refused a read is journaled, typed, and the reading goes\n // on: memory is the supervisor's aid, not its evidence.\n const recallFailed = (frame: number, failure: Supervisor.MemoryFailure) =>\n emit(\n new AgentEvent.SupervisorMemoryFailed({\n eventType: eventType.supervisorMemoryFailed,\n scope: session,\n frame,\n operation: \"recall\",\n detail: failure.detail\n })\n )\n\n const supervise = (offer: Offer & { readonly frames: ReadonlyArray<Supervisor.Frame> }): Effect.Effect<void> =>\n Effect.gen(function*() {\n const snapshot: Supervisor.Snapshot = { ...offer.snapshot, frames: offer.frames }\n const declared = scored(snapshot)\n const unmarked = offer.unmarked.filter(({ digest }) => !marked.has(digest))\n const recorded = yield* engine.record({\n name: \"supervisor\",\n identity: { session, frame: offer.frame, boundary: `supervisor:${offer.digest}` },\n success: Recorded,\n // This fiber drops a failed record, so a spent budget is applied by\n // the frame's next primary call rather than parked here (#3010).\n advisory: true,\n // The monitors' reading, then each relevance and marks request: every\n // reading the boundary took is one the run paid for.\n usage: (record) =>\n paidUsage([\n record.settled?.usage,\n ...(record.unjudged?.usage ?? []),\n ...record.memoryDecisions.map((settled) => settled.usage),\n ...(record.memoryUnjudged?.usage ?? []),\n ...record.marksDecisions.map((settled) => settled.usage),\n ...(record.marksUnjudged?.usage ?? [])\n ]),\n execute: Effect.gen(function*() {\n // The task does not change between frames, so the store ranks the\n // same rows first each time: it is asked past every row already\n // shown, and a row shown once is never asked about again.\n const recalled = memory.bound\n ? yield* memory.recall(\n [offer.snapshot.task, offer.recent].filter(Boolean).join(\"\\n\").slice(-16_384),\n Supervisor.recalledLimit + offer.shown.length\n ).pipe(\n Effect.catch((failure) => Effect.as(recallFailed(offer.frame, failure), []))\n )\n : []\n const rows = recalled.filter((row) => !offer.shown.includes(row.key)).slice(0, Supervisor.recalledLimit)\n const [result, relevance, marking] = yield* Effect.all([\n Effect.result(Supervisor.read(snapshot, Monitor.questions(declared, snapshot))),\n rows.length === 0 ? Effect.succeed(undefined) : Effect.result(\n Relevance.judge(\n { task: snapshot.task, recent: offer.recent },\n rows.map((row): Relevance.Item => ({ kind: \"memory\", id: row.key, text: row.text }))\n )\n ),\n unmarked.length === 0 ? Effect.succeed(undefined) : Effect.result(\n compactionMarks.read(\n { task: snapshot.task, failing: offer.failing },\n unmarked.map(({ item }) => item)\n )\n )\n ], { concurrency: 3 }).pipe(Effect.provideContext(services))\n const at = { scope: session, frame: offer.frame }\n // Marking changes nothing the model is sent, so no decision acts.\n const marksRecord = marking === undefined\n ? { marks: [], marksDecisions: [], marksUnjudged: null }\n : marking._tag === \"Failure\"\n ? {\n marks: [],\n marksDecisions: [],\n marksUnjudged: Judgement.unjudgedEvent(marking.failure, {\n ...at,\n classifier: \"compaction/marks\",\n items: unmarked.length\n })\n }\n : {\n marks: unmarked.map(({ digest }, index) => ({ digest, ...marking.success.answers[index]! })),\n marksDecisions: marking.success.asked.map((asked) =>\n Judgement.decision(asked, { ...at, acted: false })\n ),\n marksUnjudged: null\n }\n const memoryRecord = relevance === undefined\n ? { memory: null, memoryDecisions: [], memoryUnjudged: null, memoryRows: [] }\n : relevance._tag === \"Failure\"\n ? {\n memory: null,\n memoryDecisions: [],\n memoryUnjudged: Judgement.unjudgedEvent(relevance.failure, {\n ...at,\n classifier: \"relevance/unnecessary\",\n items: rows.length\n }),\n memoryRows: rows\n }\n : {\n memory: Relevance.settled(relevance.success, { ...at, source: \"supervisor\" }),\n memoryDecisions: relevance.success.asked.map((asked) =>\n Judgement.decision(asked, {\n ...at,\n acted: relevance.success.verdicts.some((verdict) => verdict.withheld)\n })\n ),\n memoryUnjudged: null,\n memoryRows: rows.filter((_, index) => !relevance.success.verdicts[index]!.withheld)\n }\n if (result._tag === \"Failure\") {\n const record: Recorded = {\n settled: null,\n decision: null,\n unjudged: new AgentEvent.SupervisorUnjudged({\n eventType: eventType.supervisorUnjudged,\n ...at,\n reason: result.failure.reason,\n detail: result.failure.detail,\n ...(result.failure.usage === undefined ? {} : { usage: result.failure.usage })\n }),\n ...memoryRecord,\n ...marksRecord,\n monitorRows: [],\n monitorCandidates: []\n }\n return record\n }\n const reading = result.success\n const evaluation = Monitor.evaluate({ monitors: declared, reading, snapshot, values: reading.monitors })\n // Whether a monitor's message is handed to the boundary, which may\n // still withhold it for its streak, cooldown, limit or slot.\n const nudged = deliver && evaluation.candidates.length > 0\n const record: Recorded = {\n settled: new AgentEvent.SupervisorSettled({\n eventType: eventType.supervisorSettled,\n ...at,\n thrashing: reading.thrashing,\n onTarget: reading.onTarget,\n suspect: reading.suspect,\n outdatedContext: reading.outdatedContext,\n irrelevantContext: reading.irrelevantContext,\n ...reading.emotions,\n needsHelp: reading.needsHelp,\n crossed: evaluation.rows.some((row) => row.crossed),\n nudged,\n steer: deliver,\n latencyMs: reading.latencyMs,\n ...(reading.usage === undefined ? {} : { usage: reading.usage }),\n monitors: evaluation.rows,\n ...(offer.skillsCapped ? { skillsCapped: true } : {})\n }),\n decision: new AgentEvent.DecisionSettled({\n eventType: eventType.decisionSettled,\n ...at,\n classifier: Supervisor.classifier.id,\n digest: reading.asked.digest,\n state: reading.asked.state,\n questions: reading.asked.questions,\n answers: reading.asked.answers,\n latencyMs: reading.latencyMs,\n acted: nudged,\n decidedBy: \"jev\"\n }),\n unjudged: null,\n ...memoryRecord,\n ...marksRecord,\n monitorRows: evaluation.rows,\n monitorCandidates: evaluation.candidates\n }\n return record\n })\n })\n // Posted before anything is journaled: an observer's checkpoint sits\n // inside `emit`, and a boundary that wakes on the settled event must\n // find the reading already waiting for it. Every reading Jev took is\n // posted, crossed or not, so the boundary's gate sees each monitor's\n // streak move.\n for (const { digest } of recorded.marks) marked.add(digest)\n if (recorded.settled !== null || recorded.memoryRows.length > 0 || recorded.marks.length > 0) {\n // A reading replaces the one no boundary took, but not its marks.\n yield* Ref.update(mailbox, (held) =>\n Option.some({\n frame: offer.frame,\n declared,\n monitors: recorded.settled === null\n ? undefined\n : { rows: recorded.monitorRows, candidates: recorded.monitorCandidates },\n rows: recorded.memoryRows,\n compact: recorded.settled === null ? [] : Supervisor.compacting({\n ...recorded.settled,\n outdatedContext: recorded.settled.outdatedContext ?? 0,\n irrelevantContext: recorded.settled.irrelevantContext ?? 0\n }),\n marks: [...Option.match(held, { onNone: () => [], onSome: (value) => value.marks }), ...recorded.marks]\n }))\n }\n // The verdict is the last thing this fiber does with a reading: the\n // full decisions and the memory reading go ahead of it, so a host that\n // acts on the verdict the moment it is checkpointed never finds the\n // record behind it missing.\n const quiet = {\n memory: repeated(\"memory\", recorded.memoryUnjudged, recorded.memory !== null),\n marks: repeated(\"marks\", recorded.marksUnjudged, recorded.marksDecisions.length > 0),\n supervisor: repeated(\"supervisor\", recorded.unjudged, recorded.settled !== null)\n }\n if (recorded.decision !== null) yield* emit(recorded.decision)\n for (const decision of recorded.memoryDecisions) yield* emit(decision)\n if (recorded.memory !== null) yield* emit(recorded.memory)\n if (recorded.memoryUnjudged !== null && !quiet.memory) yield* emit(recorded.memoryUnjudged)\n for (const decision of recorded.marksDecisions) yield* emit(decision)\n if (recorded.marksUnjudged !== null && !quiet.marks) yield* emit(recorded.marksUnjudged)\n if (recorded.unjudged !== null && !quiet.supervisor) yield* emit(recorded.unjudged)\n if (recorded.settled !== null) yield* emit(recorded.settled)\n }).pipe(\n // A reading the fiber could not even record is logged and dropped:\n // the supervisor may not fail the run it watches.\n Effect.catchCause((cause) =>\n Effect.annotateLogs(Effect.logWarning(\"A supervisor reading could not be recorded\", cause), {\n frame: offer.frame\n })\n )\n )\n\n const offers = yield* Queue.make<Offer & { readonly frames: ReadonlyArray<Supervisor.Frame> }>({\n capacity: 1,\n strategy: \"sliding\"\n })\n // The reading the fiber was taking when it was interrupted, if it was.\n const cut = yield* Ref.make<Option.Option<number>>(Option.none())\n const serve = (offer: Offer & { readonly frames: ReadonlyArray<Supervisor.Frame> }) =>\n Effect.gen(function*() {\n const done = yield* Deferred.make<void>()\n yield* Ref.set(inFlight, Option.some({ frame: offer.frame, done }))\n yield* supervise(offer).pipe(\n Effect.onInterrupt(() => Ref.set(cut, Option.some(offer.frame))),\n Effect.ensuring(Ref.set(inFlight, Option.none()).pipe(Effect.andThen(Deferred.succeed(done, undefined))))\n )\n })\n const fiber = yield* Effect.forkScoped(Effect.forever(Effect.flatMap(Queue.take(offers), serve)))\n // Registered after the fork, so it runs before the fork's own interruption:\n // a finalizer added later runs earlier. A reading in flight gets the grace\n // to settle and journal itself; one still unanswered after it is\n // interrupted and journaled as such. Nothing here waits past the grace.\n yield* Effect.addFinalizer(() =>\n Effect.gen(function*() {\n const held = yield* Ref.get(inFlight)\n if (Option.isSome(held)) {\n yield* Deferred.await(held.value.done).pipe(Effect.timeoutOption(Supervisor.closeGraceMs))\n }\n yield* Fiber.interrupt(fiber)\n const interrupted = yield* Ref.get(cut)\n if (Option.isNone(interrupted)) return\n yield* emit(\n new AgentEvent.SupervisorUnjudged({\n eventType: eventType.supervisorUnjudged,\n scope: session,\n frame: interrupted.value,\n reason: \"interrupted\",\n detail:\n `The run ended with this reading in flight; it was interrupted after a ${Supervisor.closeGraceMs} ms grace.`\n })\n )\n })\n )\n\n return {\n offer: (offer) =>\n Effect.suspend(() => {\n // Fixed at offer time, on the loop's fiber, so the snapshot is of\n // the frames as they stood when this one closed whatever the fiber\n // reaches it.\n const frames = [...recent.slice(-(Supervisor.recentFrames - 1)), offer.current]\n recent.push(offer.current)\n if (recent.length > Supervisor.recentFrames) recent.splice(0, recent.length - Supervisor.recentFrames)\n return Effect.asVoid(Queue.offer(offers, { ...offer, frames }))\n }),\n take: (frame, { deliver, ledger, shown }) =>\n Ref.modify(mailbox, (held): readonly [Taken, Option.Option<Mailbox>] => {\n if (Option.isNone(held) || !deliver) return [nothing, Option.none()]\n const { marks } = held.value\n if (held.value.frame < frame - 1) return [{ ...nothing, marks }, Option.none()]\n const rows = held.value.rows.filter((row) => !shown.includes(row.key))\n const gated = held.value.monitors === undefined\n ? undefined\n : Monitor.gate({ ...held.value.monitors, monitors: held.value.declared, ledger, frame })\n const message = gated?.message\n return [{\n messages: [...(message === undefined ? [] : [message.text]), ...rows.map(Supervisor.recalledInsert)].map((\n text\n ) => ModelRequest.Message.user(text)),\n memory: rows.map((row) => row.key),\n ...(message === undefined ? {} : { monitor: message.id }),\n suppressed: gated?.suppressed ?? [],\n ...(gated === undefined ? {} : { ledger: gated.ledger }),\n marks,\n compact: held.value.compact\n }, Option.none()]\n })\n }\n })\n\n/**\n * A handle for a loop that supervises nothing: offers are dropped and every\n * boundary takes nothing.\n *\n * @since 1.0.0-rc.0\n * @private\n */\nexport const none: Handle = {\n offer: () => Effect.void,\n take: () => Effect.succeed(nothing)\n}\n"]}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The completion that says, in its own words, that the work is not done.
|
|
3
|
+
*
|
|
4
|
+
* The claim brake's `complete` question may only ask for another frame: its
|
|
5
|
+
* corpus found honest answers and honest reports of unfinished work reading
|
|
6
|
+
* equally low, so a low reading alone is no verdict. What that left open is
|
|
7
|
+
* the run that has no bounce left and still writes "I could not finish X
|
|
8
|
+
* because Y": nothing refused it, so it stood, and a host settled a run that
|
|
9
|
+
* did nothing as a completed one (#3009).
|
|
10
|
+
*
|
|
11
|
+
* So the verdict is asked separately and only there. Where the claim brake
|
|
12
|
+
* read the completion as not done and has no bounce left to spend, one more
|
|
13
|
+
* question asks whether the completion itself reports the work unfinished.
|
|
14
|
+
* A completion that does ends the run as `completion_incomplete`, a typed
|
|
15
|
+
* failure that quotes the run's own report, instead of standing. The question
|
|
16
|
+
* is about the sentence, not the task: an answer, a delivered edit, or a note
|
|
17
|
+
* that something went unverified is not a report of unfinished work, and
|
|
18
|
+
* never reaches this question unless the claim brake had already read it as
|
|
19
|
+
* not done.
|
|
20
|
+
*
|
|
21
|
+
* @since 1.0.0-rc.1
|
|
22
|
+
* @private
|
|
23
|
+
*/
|
|
24
|
+
import * as Classifier from "@smthrs/model/Classifier";
|
|
25
|
+
import * as Evaluator from "@smthrs/model/Evaluator";
|
|
26
|
+
import { Effect } from "effect";
|
|
27
|
+
import * as CompletionClaim from "../CompletionClaim.ts";
|
|
28
|
+
import { HarnessError } from "../HarnessError.ts";
|
|
29
|
+
import * as Judgement from "../Judgement.ts";
|
|
30
|
+
/**
|
|
31
|
+
* The one question, asked of the evidence the claim brake already sent.
|
|
32
|
+
*
|
|
33
|
+
* @since 1.0.0-rc.1
|
|
34
|
+
* @private
|
|
35
|
+
*/
|
|
36
|
+
export declare const classifier: Classifier.Classifier<"completion/unfinished", import("effect/Schema").Struct<{
|
|
37
|
+
readonly task: import("effect/Schema").String;
|
|
38
|
+
readonly claim: import("effect/Schema").String;
|
|
39
|
+
readonly treeMoved: import("effect/Schema").Boolean;
|
|
40
|
+
readonly checksRun: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
41
|
+
readonly command: import("effect/Schema").String;
|
|
42
|
+
readonly outcome: import("effect/Schema").Literals<readonly ["passed", "failed"]>;
|
|
43
|
+
readonly result: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
44
|
+
readonly before: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["passed", "failed"]>>;
|
|
45
|
+
}>>;
|
|
46
|
+
readonly callsRun: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
47
|
+
readonly flow: import("effect/Schema").String;
|
|
48
|
+
readonly input: import("effect/Schema").String;
|
|
49
|
+
readonly ok: import("effect/Schema").Boolean;
|
|
50
|
+
readonly resultSummary: import("effect/Schema").String;
|
|
51
|
+
}>>>;
|
|
52
|
+
readonly lastCheck: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
53
|
+
readonly command: import("effect/Schema").String;
|
|
54
|
+
readonly exitCode: import("effect/Schema").Int;
|
|
55
|
+
readonly output: import("effect/Schema").String;
|
|
56
|
+
}>>;
|
|
57
|
+
}>, {
|
|
58
|
+
readonly unfinished: Evaluator.BooleanQuestion;
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* At or above this probability of "unfinished", the completion ends the run
|
|
62
|
+
* as a failure rather than standing.
|
|
63
|
+
*
|
|
64
|
+
* @since 1.0.0-rc.1
|
|
65
|
+
* @private
|
|
66
|
+
*/
|
|
67
|
+
export declare const reportedAt = 0.9;
|
|
68
|
+
/**
|
|
69
|
+
* One reading of {@link classifier}, and what asking it cost.
|
|
70
|
+
*
|
|
71
|
+
* @since 1.0.0-rc.1
|
|
72
|
+
* @private
|
|
73
|
+
*/
|
|
74
|
+
export interface Reading {
|
|
75
|
+
readonly unfinished: number;
|
|
76
|
+
readonly latencyMs: number;
|
|
77
|
+
readonly usage?: Evaluator.Usage | undefined;
|
|
78
|
+
readonly asked: Judgement.Read<typeof classifier.questions>["asked"];
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Asks the question over the claim brake's evidence. A reading that cannot
|
|
82
|
+
* be had fails the turn as `completion_unjudged`, as the claim brake's own
|
|
83
|
+
* does, and the cause carries what it paid with what the `earlier` readings
|
|
84
|
+
* of the same completion paid, so a failed verdict does not lose their spend.
|
|
85
|
+
*
|
|
86
|
+
* @since 1.0.0-rc.1
|
|
87
|
+
* @private
|
|
88
|
+
*/
|
|
89
|
+
export declare const read: (evidence: CompletionClaim.Evidence, earlier: Evaluator.Usage | undefined) => Effect.Effect<Reading, HarnessError, Evaluator.Evaluator>;
|
|
90
|
+
/**
|
|
91
|
+
* The failure a completion reporting its own work unfinished ends the run
|
|
92
|
+
* with. It quotes the report, so the person keeps the run's explanation of
|
|
93
|
+
* what is left, and carries both readings that decided it.
|
|
94
|
+
*
|
|
95
|
+
* @since 1.0.0-rc.1
|
|
96
|
+
* @private
|
|
97
|
+
*/
|
|
98
|
+
export declare const incomplete: (complete: number, unfinished: number, claim: string) => HarnessError;
|
|
99
|
+
//# sourceMappingURL=unfinishedWork.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unfinishedWork.d.ts","sourceRoot":"","sources":["../../../src/internal/unfinishedWork.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,UAAU,MAAM,0BAA0B,CAAA;AACtD,OAAO,KAAK,SAAS,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAA;AAG5C;;;;;GAKG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;EAgBrB,CAAA;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,MAAM,CAAA;AAE7B;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,KAAK,GAAG,SAAS,CAAA;IAC5C,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAA;CACrE;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI,GACf,UAAU,eAAe,CAAC,QAAQ,EAClC,SAAS,SAAS,CAAC,KAAK,GAAG,SAAS,KACnC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,CAAC,SAAS,CAgBxD,CAAA;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,GAAI,UAAU,MAAM,EAAE,YAAY,MAAM,EAAE,OAAO,MAAM,KAAG,YAM7E,CAAA"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The completion that says, in its own words, that the work is not done.
|
|
3
|
+
*
|
|
4
|
+
* The claim brake's `complete` question may only ask for another frame: its
|
|
5
|
+
* corpus found honest answers and honest reports of unfinished work reading
|
|
6
|
+
* equally low, so a low reading alone is no verdict. What that left open is
|
|
7
|
+
* the run that has no bounce left and still writes "I could not finish X
|
|
8
|
+
* because Y": nothing refused it, so it stood, and a host settled a run that
|
|
9
|
+
* did nothing as a completed one (#3009).
|
|
10
|
+
*
|
|
11
|
+
* So the verdict is asked separately and only there. Where the claim brake
|
|
12
|
+
* read the completion as not done and has no bounce left to spend, one more
|
|
13
|
+
* question asks whether the completion itself reports the work unfinished.
|
|
14
|
+
* A completion that does ends the run as `completion_incomplete`, a typed
|
|
15
|
+
* failure that quotes the run's own report, instead of standing. The question
|
|
16
|
+
* is about the sentence, not the task: an answer, a delivered edit, or a note
|
|
17
|
+
* that something went unverified is not a report of unfinished work, and
|
|
18
|
+
* never reaches this question unless the claim brake had already read it as
|
|
19
|
+
* not done.
|
|
20
|
+
*
|
|
21
|
+
* @since 1.0.0-rc.1
|
|
22
|
+
* @private
|
|
23
|
+
*/
|
|
24
|
+
import * as Classifier from "@smthrs/model/Classifier";
|
|
25
|
+
import * as Evaluator from "@smthrs/model/Evaluator";
|
|
26
|
+
import { Effect } from "effect";
|
|
27
|
+
import * as CompletionClaim from "../CompletionClaim.js";
|
|
28
|
+
import { HarnessError } from "../HarnessError.js";
|
|
29
|
+
import * as Judgement from "../Judgement.js";
|
|
30
|
+
import { failedReading } from "./paidUsage.js";
|
|
31
|
+
/**
|
|
32
|
+
* The one question, asked of the evidence the claim brake already sent.
|
|
33
|
+
*
|
|
34
|
+
* @since 1.0.0-rc.1
|
|
35
|
+
* @private
|
|
36
|
+
*/
|
|
37
|
+
export const classifier = Classifier.make("completion/unfinished", {
|
|
38
|
+
description: "Judge whether one agent's completion message itself reports that the work it was asked to do is unfinished.",
|
|
39
|
+
state: CompletionClaim.Evidence,
|
|
40
|
+
questions: {
|
|
41
|
+
unfinished: Classifier.boolean({
|
|
42
|
+
instructions: "Does the completion explicitly report that the requested work is unfinished, failed, or blocked? Judge what the completion says about its own outcome, not whether the task is actually done.",
|
|
43
|
+
criteria: {
|
|
44
|
+
true: "the completion plainly says it could not finish, could not fix, or was stopped from doing the requested work, instead of reporting success",
|
|
45
|
+
false: "the completion reports success, supplies the requested answer, or only notes that something it did was not verified"
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* At or above this probability of "unfinished", the completion ends the run
|
|
52
|
+
* as a failure rather than standing.
|
|
53
|
+
*
|
|
54
|
+
* @since 1.0.0-rc.1
|
|
55
|
+
* @private
|
|
56
|
+
*/
|
|
57
|
+
export const reportedAt = 0.9;
|
|
58
|
+
/**
|
|
59
|
+
* Asks the question over the claim brake's evidence. A reading that cannot
|
|
60
|
+
* be had fails the turn as `completion_unjudged`, as the claim brake's own
|
|
61
|
+
* does, and the cause carries what it paid with what the `earlier` readings
|
|
62
|
+
* of the same completion paid, so a failed verdict does not lose their spend.
|
|
63
|
+
*
|
|
64
|
+
* @since 1.0.0-rc.1
|
|
65
|
+
* @private
|
|
66
|
+
*/
|
|
67
|
+
export const read = (evidence, earlier) => Judgement.measured(classifier, evidence).pipe(Effect.map(({ answers, asked }) => ({
|
|
68
|
+
unfinished: answers.unfinished.probability,
|
|
69
|
+
latencyMs: asked.latencyMs,
|
|
70
|
+
...(asked.usage === undefined ? {} : { usage: asked.usage }),
|
|
71
|
+
asked
|
|
72
|
+
})), Effect.mapError((error) => CompletionClaim.unjudged(error.code, Evaluator.publicMessage(error), evidence.claim, failedReading(error, earlier))));
|
|
73
|
+
/**
|
|
74
|
+
* The failure a completion reporting its own work unfinished ends the run
|
|
75
|
+
* with. It quotes the report, so the person keeps the run's explanation of
|
|
76
|
+
* what is left, and carries both readings that decided it.
|
|
77
|
+
*
|
|
78
|
+
* @since 1.0.0-rc.1
|
|
79
|
+
* @private
|
|
80
|
+
*/
|
|
81
|
+
export const incomplete = (complete, unfinished, claim) => new HarnessError({
|
|
82
|
+
code: "completion_incomplete",
|
|
83
|
+
message: `A completion reporting its own work unfinished: unfinished ${unfinished.toFixed(2)} (complete ${complete.toFixed(2)}). The run's report, word for word:\n\n${CompletionClaim.refused(claim)}`
|
|
84
|
+
});
|
|
85
|
+
//# sourceMappingURL=unfinishedWork.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unfinishedWork.js","sourceRoot":"","sources":["../../../src/internal/unfinishedWork.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,UAAU,MAAM,0BAA0B,CAAA;AACtD,OAAO,KAAK,SAAS,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC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,CAAC,aAAa,CAAC,KAAK,CAAC,EAC9B,QAAQ,CAAC,KAAK,EACd,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,CAC9B,CACF,CACF,CAAA;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,QAAgB,EAAE,UAAkB,EAAE,KAAa,EAAgB,EAAE,CAC9F,IAAI,YAAY,CAAC;IACf,IAAI,EAAE,uBAAuB;IAC7B,OAAO,EAAE,8DAA8D,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,cAC1F,QAAQ,CAAC,OAAO,CAAC,CAAC,CACpB,0CAA0C,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;CAC3E,CAAC,CAAA","sourcesContent":["/**\n * The completion that says, in its own words, that the work is not done.\n *\n * The claim brake's `complete` question may only ask for another frame: its\n * corpus found honest answers and honest reports of unfinished work reading\n * equally low, so a low reading alone is no verdict. What that left open is\n * the run that has no bounce left and still writes \"I could not finish X\n * because Y\": nothing refused it, so it stood, and a host settled a run that\n * did nothing as a completed one (#3009).\n *\n * So the verdict is asked separately and only there. Where the claim brake\n * read the completion as not done and has no bounce left to spend, one more\n * question asks whether the completion itself reports the work unfinished.\n * A completion that does ends the run as `completion_incomplete`, a typed\n * failure that quotes the run's own report, instead of standing. The question\n * is about the sentence, not the task: an answer, a delivered edit, or a note\n * that something went unverified is not a report of unfinished work, and\n * never reaches this question unless the claim brake had already read it as\n * not done.\n *\n * @since 1.0.0-rc.1\n * @private\n */\n\nimport * as Classifier from \"@smthrs/model/Classifier\"\nimport * as Evaluator from \"@smthrs/model/Evaluator\"\nimport { Effect } from \"effect\"\nimport * as CompletionClaim from \"../CompletionClaim.ts\"\nimport { HarnessError } from \"../HarnessError.ts\"\nimport * as Judgement from \"../Judgement.ts\"\nimport { failedReading } from \"./paidUsage.ts\"\n\n/**\n * The one question, asked of the evidence the claim brake already sent.\n *\n * @since 1.0.0-rc.1\n * @private\n */\nexport const classifier = Classifier.make(\"completion/unfinished\", {\n description:\n \"Judge whether one agent's completion message itself reports that the work it was asked to do is unfinished.\",\n state: CompletionClaim.Evidence,\n questions: {\n unfinished: Classifier.boolean({\n instructions:\n \"Does the completion explicitly report that the requested work is unfinished, failed, or blocked? Judge what the completion says about its own outcome, not whether the task is actually done.\",\n criteria: {\n true:\n \"the completion plainly says it could not finish, could not fix, or was stopped from doing the requested work, instead of reporting success\",\n false:\n \"the completion reports success, supplies the requested answer, or only notes that something it did was not verified\"\n }\n })\n }\n})\n\n/**\n * At or above this probability of \"unfinished\", the completion ends the run\n * as a failure rather than standing.\n *\n * @since 1.0.0-rc.1\n * @private\n */\nexport const reportedAt = 0.9\n\n/**\n * One reading of {@link classifier}, and what asking it cost.\n *\n * @since 1.0.0-rc.1\n * @private\n */\nexport interface Reading {\n readonly unfinished: number\n readonly latencyMs: number\n readonly usage?: Evaluator.Usage | undefined\n readonly asked: Judgement.Read<typeof classifier.questions>[\"asked\"]\n}\n\n/**\n * Asks the question over the claim brake's evidence. A reading that cannot\n * be had fails the turn as `completion_unjudged`, as the claim brake's own\n * does, and the cause carries what it paid with what the `earlier` readings\n * of the same completion paid, so a failed verdict does not lose their spend.\n *\n * @since 1.0.0-rc.1\n * @private\n */\nexport const read = (\n evidence: CompletionClaim.Evidence,\n earlier: Evaluator.Usage | undefined\n): Effect.Effect<Reading, HarnessError, Evaluator.Evaluator> =>\n Judgement.measured(classifier, evidence).pipe(\n Effect.map(({ answers, asked }): Reading => ({\n unfinished: answers.unfinished.probability,\n latencyMs: asked.latencyMs,\n ...(asked.usage === undefined ? {} : { usage: asked.usage }),\n asked\n })),\n Effect.mapError((error) =>\n CompletionClaim.unjudged(\n error.code,\n Evaluator.publicMessage(error),\n evidence.claim,\n failedReading(error, earlier)\n )\n )\n )\n\n/**\n * The failure a completion reporting its own work unfinished ends the run\n * with. It quotes the report, so the person keeps the run's explanation of\n * what is left, and carries both readings that decided it.\n *\n * @since 1.0.0-rc.1\n * @private\n */\nexport const incomplete = (complete: number, unfinished: number, claim: string): HarnessError =>\n new HarnessError({\n code: \"completion_incomplete\",\n message: `A completion reporting its own work unfinished: unfinished ${unfinished.toFixed(2)} (complete ${\n complete.toFixed(2)\n }). The run's report, word for word:\\n\\n${CompletionClaim.refused(claim)}`\n })\n"]}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The completion its own cell wrote before reading the calls it made.
|
|
3
|
+
*
|
|
4
|
+
* Several `cell` blocks in one reply run as one program, and the model writes
|
|
5
|
+
* the whole program before any call in it settles. A reply that probes and
|
|
6
|
+
* answers — `const seen = await ctx.call("bash", …)`, a `console.log` of `seen`,
|
|
7
|
+
* then `ctx.done(…)` — therefore completes the run before the model has read
|
|
8
|
+
* a byte of what it asked to see. Real seats do this about once in three
|
|
9
|
+
* deliveries even when their prompt says to answer in a later reply, and the
|
|
10
|
+
* answer is either an unverified claim or "blocked: output not observed".
|
|
11
|
+
*
|
|
12
|
+
* ## The rule, and what it spares
|
|
13
|
+
*
|
|
14
|
+
* A completion is handed back, once per run, when its own cell made a call,
|
|
15
|
+
* kept that call's result, and left it for the model alone: printed or
|
|
16
|
+
* bound, and read by nothing in the program but `console.*` and guards that
|
|
17
|
+
* only decide what `console.*` prints (`if (r.exitCode)` around a `console.log` of `r.stderr`),
|
|
18
|
+
* so the completion reads no result either. It is also handed back when the
|
|
19
|
+
* program acted on some results but a completion that reads none — in its
|
|
20
|
+
* output or a guard around it — follows a result the program only printed.
|
|
21
|
+
* The next frame is shown the results and asked to answer after reading them.
|
|
22
|
+
*
|
|
23
|
+
* Three shapes are spared because nothing in them was written blind:
|
|
24
|
+
*
|
|
25
|
+
* - a completion that reads a call's result — in its output, or in a guard
|
|
26
|
+
* around it. `if (after.exitCode === 0) ctx.done(…)` is the shape the cell
|
|
27
|
+
* contract teaches: the program, not the model's memory, decides the
|
|
28
|
+
* verdict. Reading is transitive through the program's own bindings, so
|
|
29
|
+
* `result.summary = seen.stdout; ctx.done(JSON.stringify(result))` reads.
|
|
30
|
+
* - a cell whose program acts on a result: passes it into another call, or
|
|
31
|
+
* branches on it. The contract teaches deriving later inputs from earlier
|
|
32
|
+
* results inside one cell, and a cell that asked, saved the answer and
|
|
33
|
+
* completed did what it set out to do without the model reading anything.
|
|
34
|
+
* - a cell whose calls are all effects whose result it discarded, such as
|
|
35
|
+
* `await ctx.call("edit", …)` as a statement of its own. The cell never
|
|
36
|
+
* asked to see anything, and a failed effect is `FailedCall`'s demand.
|
|
37
|
+
*
|
|
38
|
+
* The reading is a parse of the cell's source, so it is a pure function of
|
|
39
|
+
* the cell and a replay reaches the same decision. It reads names, not
|
|
40
|
+
* scopes, and what it cannot see through — a result handed to a function of
|
|
41
|
+
* the program's own, a `.then` callback, a completion reached through an
|
|
42
|
+
* alias — reads as acted on. A wrong refusal takes a legitimate answer away
|
|
43
|
+
* from every consumer of the harness, while a wrong pass costs one unread
|
|
44
|
+
* probe, so the rule fires only where the source leaves no other reading.
|
|
45
|
+
*
|
|
46
|
+
* @since 1.0.0-rc.1
|
|
47
|
+
* @private
|
|
48
|
+
*/
|
|
49
|
+
/**
|
|
50
|
+
* How many completions one run may have handed back for unread calls.
|
|
51
|
+
*
|
|
52
|
+
* One, like every measured demand: the frame that answers it has read the
|
|
53
|
+
* results, and asking again would be the loop grading that answer.
|
|
54
|
+
*
|
|
55
|
+
* @since 1.0.0-rc.1
|
|
56
|
+
* @private
|
|
57
|
+
*/
|
|
58
|
+
export declare const cap = 1;
|
|
59
|
+
/**
|
|
60
|
+
* The heading of the demand, so a transcript and a test can find it.
|
|
61
|
+
*
|
|
62
|
+
* @since 1.0.0-rc.1
|
|
63
|
+
* @private
|
|
64
|
+
*/
|
|
65
|
+
export declare const heading = "Answer written before its calls returned";
|
|
66
|
+
/** The frame accounting's view of one settled call. */
|
|
67
|
+
interface Settled {
|
|
68
|
+
readonly flow: string;
|
|
69
|
+
readonly ok: boolean;
|
|
70
|
+
readonly ordinal: number;
|
|
71
|
+
readonly summary: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* One call a completion was written without reading.
|
|
75
|
+
*
|
|
76
|
+
* @since 1.0.0-rc.1
|
|
77
|
+
* @private
|
|
78
|
+
*/
|
|
79
|
+
export interface Unobserved {
|
|
80
|
+
readonly flow: string;
|
|
81
|
+
readonly ok: boolean;
|
|
82
|
+
readonly ordinal: number;
|
|
83
|
+
readonly summary: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Whether a completing cell's source wrote its completion blind: it kept a
|
|
87
|
+
* call's result for the model alone and completed from code that reads none.
|
|
88
|
+
* A source that does not parse is never read as blind, because nothing here
|
|
89
|
+
* can say what it did.
|
|
90
|
+
*
|
|
91
|
+
* @since 1.0.0-rc.1
|
|
92
|
+
* @private
|
|
93
|
+
*/
|
|
94
|
+
export declare const blind: (source: string) => boolean;
|
|
95
|
+
/**
|
|
96
|
+
* The calls a completion was written without reading, oldest first: every
|
|
97
|
+
* call its own frame settled, when the cell wrote the completion blind.
|
|
98
|
+
*
|
|
99
|
+
* @since 1.0.0-rc.1
|
|
100
|
+
* @private
|
|
101
|
+
*/
|
|
102
|
+
export declare const find: (calls: ReadonlyArray<Settled>, source: string) => ReadonlyArray<Unobserved>;
|
|
103
|
+
/**
|
|
104
|
+
* The demand a blind completion is handed back with: the results it never
|
|
105
|
+
* read, then the correction.
|
|
106
|
+
*
|
|
107
|
+
* @since 1.0.0-rc.1
|
|
108
|
+
* @private
|
|
109
|
+
*/
|
|
110
|
+
export declare const demand: (calls: ReadonlyArray<Unobserved>) => string;
|
|
111
|
+
export {};
|
|
112
|
+
//# sourceMappingURL=unobservedCall.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unobservedCall.d.ts","sourceRoot":"","sources":["../../../src/internal/unobservedCall.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAKH;;;;;;;;GAQG;AACH,eAAO,MAAM,GAAG,IAAI,CAAA;AAEpB;;;;;GAKG;AACH,eAAO,MAAM,OAAO,6CAA6C,CAAA;AAEjE,uDAAuD;AACvD,UAAU,OAAO;IACf,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAED;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAuYD;;;;;;;;GAQG;AACH,eAAO,MAAM,KAAK,GAAI,QAAQ,MAAM,KAAG,OAoBtC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,GAAI,OAAO,aAAa,CAAC,OAAO,CAAC,EAAE,QAAQ,MAAM,KAAG,aAAa,CAAC,UAAU,CAGc,CAAA;AAE3G;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,GAAI,OAAO,aAAa,CAAC,UAAU,CAAC,KAAG,MAIK,CAAA"}
|