@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":"Supervisor.d.ts","sourceRoot":"","sources":["../../src/Supervisor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AAEH,OAAO,KAAK,UAAU,MAAM,0BAA0B,CAAA;AACtD,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,WAAW,KAAG,aAAa,CAAC,OAAO,CACe,CAAA;AAErF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,qDAAsD,CAAA;AAElF;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,eAAe,CAAC,MAAM,CAAC,CAAA;AAK3D;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,GAAI,SAAS,WAAW,KAAG,OAAoE,CAAA;AAEnH;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,SAAS,WAAW,KAAG,aAAa,CAAC,cAAc,CAAyC,CAAA;AAEvH;;;;;;;;;GASG;AACH,eAAO,MAAM,KAAK,GAAI,UAAU,QAAQ,EAAE,SAAS,OAAO,KAAG,MA8B5D,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,KAAK,QAAQ,KAAG,MAAqE,CAAA;AAEpH;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GAAI,MAAM,MAAM,KAAG,MAAwD,CAAA;AAE5F;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GAAI,MAAM,MAAM,KAAG,MAInC,CAAA;AAID;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK,GAAI,MAAM,MAAM,KAAG,MAA6C,CAAA"}
|
|
@@ -0,0 +1,575 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The reading Jev takes of a run while it is still running.
|
|
3
|
+
*
|
|
4
|
+
* Every other control in this package reads a completion, or reads one fact
|
|
5
|
+
* the harness measured: a tree that never moved, a check that was narrowed, a
|
|
6
|
+
* frame that repeated itself. Each is exact, each fires late, and each is
|
|
7
|
+
* silent about the run between its brakes. A run that edits the wrong file
|
|
8
|
+
* for twenty frames, re-runs one failing check after every edit and never
|
|
9
|
+
* once claims to be done trips none of them until its budget is gone.
|
|
10
|
+
*
|
|
11
|
+
* So this module asks Jev about the run's *shape* rather than its sentence.
|
|
12
|
+
* One classifier, `supervisor/turn`, over a {@link Snapshot} the controller
|
|
13
|
+
* assembles from what it already holds: the task, the newest frames, and the
|
|
14
|
+
* counts the deterministic controls keep — read-only streak, repeat streak,
|
|
15
|
+
* mutations, checks run and failing, unanswered failures, demands spent. It
|
|
16
|
+
* re-derives none of them. Beside the run's state it carries the skills it has
|
|
17
|
+
* not called, the flows it has, and whether it can call `jev`. One Jev call per
|
|
18
|
+
* snapshot answers every question at once.
|
|
19
|
+
*
|
|
20
|
+
* Eleven questions are fixed. Five are about the run: whether it is
|
|
21
|
+
* thrashing, whether it is still on the task, whether its evidence is
|
|
22
|
+
* suspect, and whether it carries outdated or irrelevant context. Five are
|
|
23
|
+
* operational states a person would recognise in a colleague, each scored
|
|
24
|
+
* `none`, `mild` or `strong` against evidence the snapshot names, and
|
|
25
|
+
* `needs_help` is the one word a person is shown. The five about the run are
|
|
26
|
+
* the {@link triggers}: any one past its threshold crosses. Each monitor the
|
|
27
|
+
* host arms may add one boolean of its own, under {@link monitorPrefix}.
|
|
28
|
+
*
|
|
29
|
+
* Rows recalled from {@link Memory} are not asked about here. Beside each
|
|
30
|
+
* reading, the supervisor asks `Relevance` which of up to
|
|
31
|
+
* {@link recalledLimit} rows, none already shown to the run, are unnecessary
|
|
32
|
+
* for the task; the rest are shown at the next boundary as
|
|
33
|
+
* {@link recalledInsert} renders them, and a row is shown to a run once.
|
|
34
|
+
*
|
|
35
|
+
* It is a supervisor and not a brake: nothing here ends a run, refuses a
|
|
36
|
+
* completion, or decides anything on the cell loop's hot path. `CellTurn`
|
|
37
|
+
* offers each frame's snapshot to a one-slot sliding queue and continues; a
|
|
38
|
+
* forked fiber takes the newest snapshot, asks, journals what came back, and
|
|
39
|
+
* hands the monitors' values and any recalled rows to the *next* turn boundary,
|
|
40
|
+
* which decides there what the run is told. A reading that arrives after the boundary it was for is
|
|
41
|
+
* journaled and never delivered, and a snapshot the fiber never reached is
|
|
42
|
+
* dropped: the run is never told something about a frame two frames gone.
|
|
43
|
+
*
|
|
44
|
+
* It never falls back. A snapshot Jev could not read is journaled as
|
|
45
|
+
* {@link AgentEvent.SupervisorUnjudged} with the transport's own reason; it
|
|
46
|
+
* nudges nothing, and is never counted as a reading that
|
|
47
|
+
* found the run calm or on target. A host with no judge (`unconfigured`) is
|
|
48
|
+
* journaled once per streak rather than every frame; each reading still asks,
|
|
49
|
+
* so a judge connected mid-run is used at once. Nothing here is a default value: every
|
|
50
|
+
* level and every word on the settled event came back from the transport.
|
|
51
|
+
*
|
|
52
|
+
* What a reading says is delivered wherever the host holds a real judge
|
|
53
|
+
* (`CellTurn.Input.judged`), and only through a monitor that crossed and
|
|
54
|
+
* passed its gates; the text of the legacy nudge is {@link nudge}, which the
|
|
55
|
+
* `supervisor` lint monitor says. The offline replay of archived journals
|
|
56
|
+
* (`evals/swebench/lib/jev-replay.mjs`, which scores {@link triggers} itself
|
|
57
|
+
* rather than a copy of it) measures their precision. The verdict is
|
|
58
|
+
* journaled whenever an `Evaluator` is bound. The supervisor writes no
|
|
59
|
+
* memory: a run's transcript is mined once, at run end, by `@smthrs/agent`'s
|
|
60
|
+
* `MemoryMine`.
|
|
61
|
+
*
|
|
62
|
+
* @since 1.0.0-rc.0
|
|
63
|
+
*/
|
|
64
|
+
import * as Classifier from "@smthrs/model/Classifier";
|
|
65
|
+
import * as Context from "effect/Context";
|
|
66
|
+
import * as Effect from "effect/Effect";
|
|
67
|
+
import * as Schema from "effect/Schema";
|
|
68
|
+
import * as elide from "./internal/elide.js";
|
|
69
|
+
import { NonNegativeSafeInt } from "./internal/nonNegativeSafeInt.js";
|
|
70
|
+
import { untrustedData } from "./internal/untrustedData.js";
|
|
71
|
+
import * as Judgement from "./Judgement.js";
|
|
72
|
+
/**
|
|
73
|
+
* The most of one frame's cell, prose or prints the snapshot carries, in
|
|
74
|
+
* UTF-8 bytes. The head of a cell and the tail of its prints: a cell states
|
|
75
|
+
* its plan first and a runner states its verdict last.
|
|
76
|
+
*
|
|
77
|
+
* @category constants
|
|
78
|
+
* @since 1.0.0-rc.0
|
|
79
|
+
*/
|
|
80
|
+
export const frameBytes = 1024;
|
|
81
|
+
/**
|
|
82
|
+
* How many of the newest frames a snapshot carries.
|
|
83
|
+
*
|
|
84
|
+
* @category constants
|
|
85
|
+
* @since 1.0.0-rc.0
|
|
86
|
+
*/
|
|
87
|
+
export const recentFrames = 3;
|
|
88
|
+
/**
|
|
89
|
+
* The most rows one reading recalls from {@link Memory}.
|
|
90
|
+
*
|
|
91
|
+
* @category constants
|
|
92
|
+
* @since 1.0.0-rc.0
|
|
93
|
+
*/
|
|
94
|
+
export const recalledLimit = 6;
|
|
95
|
+
/**
|
|
96
|
+
* How long a run that ends with a reading in flight waits for it to settle
|
|
97
|
+
* and journal, in milliseconds. A reading still unanswered then is interrupted
|
|
98
|
+
* and journaled `supervisor-unjudged` with reason `interrupted`; the run never
|
|
99
|
+
* waits longer than this for its supervisor.
|
|
100
|
+
*
|
|
101
|
+
* @category constants
|
|
102
|
+
* @since 1.0.0-rc.0
|
|
103
|
+
*/
|
|
104
|
+
export const closeGraceMs = 1_500;
|
|
105
|
+
/**
|
|
106
|
+
* At or above this probability of `thrashing`, the reading crosses.
|
|
107
|
+
*
|
|
108
|
+
* @category constants
|
|
109
|
+
* @since 1.0.0-rc.0
|
|
110
|
+
*/
|
|
111
|
+
export const thrashingAt = 0.5;
|
|
112
|
+
/**
|
|
113
|
+
* At or below this probability of `on_target`, the reading crosses.
|
|
114
|
+
*
|
|
115
|
+
* @category constants
|
|
116
|
+
* @since 1.0.0-rc.0
|
|
117
|
+
*/
|
|
118
|
+
export const offTargetAt = 0.5;
|
|
119
|
+
/**
|
|
120
|
+
* At or above this probability of `suspect`, the reading crosses.
|
|
121
|
+
*
|
|
122
|
+
* @category constants
|
|
123
|
+
* @since 1.0.0-rc.0
|
|
124
|
+
*/
|
|
125
|
+
export const suspectAt = 0.5;
|
|
126
|
+
/**
|
|
127
|
+
* At or above this probability of `outdated_context` or
|
|
128
|
+
* `irrelevant_context`, a judged run compacts at its next frame.
|
|
129
|
+
*
|
|
130
|
+
* @category constants
|
|
131
|
+
* @since 1.0.0-rc.0
|
|
132
|
+
*/
|
|
133
|
+
export const contextAt = 0.5;
|
|
134
|
+
/**
|
|
135
|
+
* The three rungs every operational-state question is scored on.
|
|
136
|
+
*
|
|
137
|
+
* @category schemas
|
|
138
|
+
* @since 1.0.0-rc.0
|
|
139
|
+
*/
|
|
140
|
+
export const Level = Schema.Literals(["none", "mild", "strong"]);
|
|
141
|
+
/**
|
|
142
|
+
* The rungs as the score question declares them, in order.
|
|
143
|
+
*
|
|
144
|
+
* @category constants
|
|
145
|
+
* @since 1.0.0-rc.0
|
|
146
|
+
*/
|
|
147
|
+
export const levels = ["none", "mild", "strong"];
|
|
148
|
+
/**
|
|
149
|
+
* The one word a person is shown about a run.
|
|
150
|
+
*
|
|
151
|
+
* @category schemas
|
|
152
|
+
* @since 1.0.0-rc.0
|
|
153
|
+
*/
|
|
154
|
+
export const Help = Schema.Literals(["none", "clarification", "permission", "stuck", "risky_action"]);
|
|
155
|
+
/**
|
|
156
|
+
* The five operational states, in the order they are asked and journaled.
|
|
157
|
+
*
|
|
158
|
+
* @category constants
|
|
159
|
+
* @since 1.0.0-rc.0
|
|
160
|
+
*/
|
|
161
|
+
export const emotions = ["frustrated", "anxious", "scared", "confused", "confident"];
|
|
162
|
+
/**
|
|
163
|
+
* One recent frame as the snapshot carries it: the cell the model wrote, the
|
|
164
|
+
* prose around it, what the cell printed, and how it ended.
|
|
165
|
+
*
|
|
166
|
+
* @category schemas
|
|
167
|
+
* @since 1.0.0-rc.0
|
|
168
|
+
*/
|
|
169
|
+
export const Frame = Schema.Struct({
|
|
170
|
+
frame: NonNegativeSafeInt,
|
|
171
|
+
cell: Schema.String.annotate({ description: "The cell the model wrote, head kept" }),
|
|
172
|
+
prose: Schema.String.annotate({ description: "What the model wrote outside the cell, head kept" }),
|
|
173
|
+
printed: Schema.String.annotate({ description: "What the cell printed, newest bytes kept" }),
|
|
174
|
+
transition: Schema.Literals(["continue", "complete", "park", "raised", "rejected"]),
|
|
175
|
+
mutated: Schema.Boolean.annotate({ description: "Whether this frame changed the workspace" })
|
|
176
|
+
});
|
|
177
|
+
/**
|
|
178
|
+
* The counts the deterministic controls keep, handed over as they stand.
|
|
179
|
+
*
|
|
180
|
+
* Every field is read off `CellTurn.State` or the frame's accounting and none
|
|
181
|
+
* is re-derived here: the supervisor is a reader of the harness's evidence,
|
|
182
|
+
* not a second measurer of it.
|
|
183
|
+
*
|
|
184
|
+
* @category schemas
|
|
185
|
+
* @since 1.0.0-rc.0
|
|
186
|
+
*/
|
|
187
|
+
export const Signals = Schema.Struct({
|
|
188
|
+
frame: NonNegativeSafeInt.annotate({ description: "The frame just closed, counting from zero" }),
|
|
189
|
+
maxFrames: NonNegativeSafeInt.annotate({ description: "The frame budget; zero is unbounded" }),
|
|
190
|
+
readOnlyFrames: NonNegativeSafeInt.annotate({ description: "Consecutive frames that changed nothing" }),
|
|
191
|
+
repeatFrames: NonNegativeSafeInt.annotate({
|
|
192
|
+
description: "Consecutive frames that issued only calls already issued and changed nothing"
|
|
193
|
+
}),
|
|
194
|
+
mutations: NonNegativeSafeInt.annotate({ description: "Frames that changed the workspace" }),
|
|
195
|
+
remoteMutations: NonNegativeSafeInt.annotate({ description: "Writes recorded on trees the host cannot see" }),
|
|
196
|
+
treeMoved: Schema.Boolean.annotate({ description: "Whether the workspace differs from the tree the run opened on" }),
|
|
197
|
+
paths: NonNegativeSafeInt.annotate({
|
|
198
|
+
description: "Paths the closing workspace measurement covered; zero unmeasured"
|
|
199
|
+
}),
|
|
200
|
+
checksRun: NonNegativeSafeInt.annotate({ description: "Distinct checks the run has run" }),
|
|
201
|
+
checksFailing: NonNegativeSafeInt.annotate({ description: "Of those, how many last reported a failing status" }),
|
|
202
|
+
failuresUnanswered: NonNegativeSafeInt.annotate({
|
|
203
|
+
description: "Failing checks no later passing check has answered"
|
|
204
|
+
}),
|
|
205
|
+
callsFailed: NonNegativeSafeInt.annotate({ description: "Settled calls in the ledger that failed" }),
|
|
206
|
+
callsSettled: NonNegativeSafeInt.annotate({ description: "Settled calls in the ledger" }),
|
|
207
|
+
narrowingDemands: NonNegativeSafeInt.annotate({ description: "Completions bounced for narrowed evidence" }),
|
|
208
|
+
unmovedDemands: NonNegativeSafeInt.annotate({ description: "Completions bounced for an unmoved tree" }),
|
|
209
|
+
unresolvedDemands: NonNegativeSafeInt.annotate({ description: "Completions bounced for a stepped-around failure" }),
|
|
210
|
+
claimDemands: NonNegativeSafeInt.annotate({ description: "Completions bounced for an unsupported claim" }),
|
|
211
|
+
sufficiencyStated: Schema.Boolean.annotate({ description: "Whether the run was told its evidence is complete" })
|
|
212
|
+
});
|
|
213
|
+
/**
|
|
214
|
+
* One row recalled from memory.
|
|
215
|
+
*
|
|
216
|
+
* @category schemas
|
|
217
|
+
* @since 1.0.0-rc.0
|
|
218
|
+
*/
|
|
219
|
+
export const Recalled = Schema.Struct({
|
|
220
|
+
key: Schema.String,
|
|
221
|
+
text: Schema.String
|
|
222
|
+
});
|
|
223
|
+
/**
|
|
224
|
+
* The most skills one snapshot offers.
|
|
225
|
+
*
|
|
226
|
+
* @category constants
|
|
227
|
+
* @since 1.0.0-rc.0
|
|
228
|
+
*/
|
|
229
|
+
export const skillLimit = 12;
|
|
230
|
+
/**
|
|
231
|
+
* The most of one skill's description a snapshot carries, in UTF-8 bytes.
|
|
232
|
+
*
|
|
233
|
+
* @category constants
|
|
234
|
+
* @since 1.0.0-rc.0
|
|
235
|
+
*/
|
|
236
|
+
export const skillBytes = 256;
|
|
237
|
+
/**
|
|
238
|
+
* The most distinct flow names {@link Snapshot} `called` carries.
|
|
239
|
+
*
|
|
240
|
+
* @category constants
|
|
241
|
+
* @since 1.0.0-rc.0
|
|
242
|
+
*/
|
|
243
|
+
export const calledLimit = 64;
|
|
244
|
+
/**
|
|
245
|
+
* One skill the run could read and has neither called nor read.
|
|
246
|
+
*
|
|
247
|
+
* @category schemas
|
|
248
|
+
* @since 1.0.0-rc.0
|
|
249
|
+
*/
|
|
250
|
+
export const Skill = Schema.Struct({
|
|
251
|
+
name: Schema.String,
|
|
252
|
+
description: Schema.String.annotate({ description: "The description's head, wrapped as untrusted data" }),
|
|
253
|
+
path: Schema.String.annotate({ description: "Where the skill's Markdown body is" })
|
|
254
|
+
});
|
|
255
|
+
/**
|
|
256
|
+
* One skill as a snapshot offers it: its description's head within
|
|
257
|
+
* {@link skillBytes}, wrapped as untrusted data.
|
|
258
|
+
*
|
|
259
|
+
* @category constructors
|
|
260
|
+
* @since 1.0.0-rc.0
|
|
261
|
+
*/
|
|
262
|
+
export const skill = (name, description, path) => ({
|
|
263
|
+
name,
|
|
264
|
+
description: untrustedData(elide.head(description, skillBytes, "clipped"), `description of skill ${name}`),
|
|
265
|
+
path
|
|
266
|
+
});
|
|
267
|
+
/**
|
|
268
|
+
* Everything one supervisor reading is a reading of.
|
|
269
|
+
*
|
|
270
|
+
* @category schemas
|
|
271
|
+
* @since 1.0.0-rc.0
|
|
272
|
+
*/
|
|
273
|
+
export const Snapshot = Schema.Struct({
|
|
274
|
+
task: Schema.String.annotate({ description: "The task, as the person stated it" }),
|
|
275
|
+
frames: Schema.Array(Frame).annotate({ description: "The newest frames, oldest first" }),
|
|
276
|
+
signals: Signals,
|
|
277
|
+
skills: Schema.Array(Skill).annotate({
|
|
278
|
+
description: "Skills the run could read and has neither called nor read, by index"
|
|
279
|
+
}),
|
|
280
|
+
called: Schema.Array(Schema.String).annotate({ description: "Distinct flows the run has called" }),
|
|
281
|
+
jevAvailable: Schema.Boolean.annotate({ description: "Whether the run can call the jev flow" })
|
|
282
|
+
});
|
|
283
|
+
/**
|
|
284
|
+
* The fixed questions, asked of every snapshot.
|
|
285
|
+
*
|
|
286
|
+
* Each criterion names the evidence it reads, so a reading is answerable from
|
|
287
|
+
* the snapshot and never from what the transport imagines the repository holds.
|
|
288
|
+
*/
|
|
289
|
+
const fixedQuestions = {
|
|
290
|
+
thrashing: Classifier.boolean({
|
|
291
|
+
instructions: "Is the run going in circles rather than converging? Compare the newest frames with each other and with signals.checksFailing, signals.failuresUnanswered, signals.readOnlyFrames and signals.repeatFrames. Any one sign below is enough.",
|
|
292
|
+
criteria: {
|
|
293
|
+
true: "a check fails again after an edit meant to fix it, an edit is redone or reverted, or the newest frames re-read or re-run what earlier frames already saw without learning anything new",
|
|
294
|
+
false: "the newest frames learn something new or make progress: a failing check now passes, or a new cause is found and acted on"
|
|
295
|
+
}
|
|
296
|
+
}),
|
|
297
|
+
on_target: Classifier.boolean({
|
|
298
|
+
instructions: "Is the run still working on the task as stated? Read the task and the newest frames' cells and prose.",
|
|
299
|
+
criteria: {
|
|
300
|
+
true: "the newest frames read, edit or check the thing the task names",
|
|
301
|
+
false: "the newest frames work on something the task does not ask for, or have drifted from it"
|
|
302
|
+
}
|
|
303
|
+
}),
|
|
304
|
+
suspect: Classifier.boolean({
|
|
305
|
+
instructions: "Is the run's evidence suspect? Read the newest frames for tests edited to pass, edits to a file the task does not concern, or prose claiming a result no printed output shows.",
|
|
306
|
+
criteria: {
|
|
307
|
+
true: "a test was changed rather than the code under test, the wrong file was edited, or a claim has no check behind it",
|
|
308
|
+
false: "edits are to the code the task names and every claim has a printed result behind it"
|
|
309
|
+
}
|
|
310
|
+
}),
|
|
311
|
+
outdated_context: Classifier.boolean({
|
|
312
|
+
instructions: "Do the newest frames show earlier context that is now factually wrong or stale? Judge only evidence visible in the task and frames; do not assume unseen history is outdated.",
|
|
313
|
+
criteria: {
|
|
314
|
+
true: "a later observation explicitly contradicts an earlier assumption or file state in the visible frames",
|
|
315
|
+
false: "no visible contradiction, or the earlier context is still accurate"
|
|
316
|
+
}
|
|
317
|
+
}),
|
|
318
|
+
irrelevant_context: Classifier.boolean({
|
|
319
|
+
instructions: "Do the newest frames show earlier context that is accurate but no longer useful for the task? Do not treat the task, a reusable PRD, or decisions still needed as irrelevant.",
|
|
320
|
+
criteria: {
|
|
321
|
+
true: "the visible frames explicitly move away from earlier work that will not be needed again",
|
|
322
|
+
false: "the earlier work may still be needed, or the visible frames do not establish irrelevance"
|
|
323
|
+
}
|
|
324
|
+
}),
|
|
325
|
+
frustrated: Classifier.score({
|
|
326
|
+
instructions: "How frustrated is the run: the same check failing repeatedly, edits reverted, attempts not converging? Read signals.checksFailing, signals.failuresUnanswered, signals.repeatFrames, signals.readOnlyFrames and the newest frames.",
|
|
327
|
+
criteria: levels
|
|
328
|
+
}),
|
|
329
|
+
anxious: Classifier.score({
|
|
330
|
+
instructions: "How anxious is the run: its own prose hedges or expresses uncertainty while the evidence is thin? Read the frames' prose against signals.checksRun and signals.callsSettled.",
|
|
331
|
+
criteria: levels
|
|
332
|
+
}),
|
|
333
|
+
scared: Classifier.score({
|
|
334
|
+
instructions: "How scared should a person be: is the run taking or considering a destructive, irreversible or out-of-scope action, or hitting permission or sandbox refusals? Read the newest frames' cells, prints and failed calls.",
|
|
335
|
+
criteria: levels
|
|
336
|
+
}),
|
|
337
|
+
confused: Classifier.score({
|
|
338
|
+
instructions: "How confused is the run: the task is ambiguous or contradicted by the repository, and the run keeps switching interpretations or files? Read the task against the newest frames.",
|
|
339
|
+
criteria: levels
|
|
340
|
+
}),
|
|
341
|
+
confident: Classifier.score({
|
|
342
|
+
instructions: "How confident should a person be that the work converges on the task: checks pass and each frame builds on the last? Read signals.checksRun, signals.checksFailing, signals.mutations and the newest frames.",
|
|
343
|
+
criteria: levels
|
|
344
|
+
}),
|
|
345
|
+
needs_help: Classifier.choice({
|
|
346
|
+
instructions: "What, if anything, does the run need from a person right now? Read the states above and the newest frames.",
|
|
347
|
+
criteria: {
|
|
348
|
+
none: "nothing; the run can carry on",
|
|
349
|
+
clarification: "the task is ambiguous or contradicted and a person must say which reading is meant",
|
|
350
|
+
permission: "the run is blocked on a permission or sandbox refusal a person can grant",
|
|
351
|
+
stuck: "the run is not converging and a person should intervene",
|
|
352
|
+
risky_action: "the run is about to do something destructive, irreversible or out of scope"
|
|
353
|
+
}
|
|
354
|
+
})
|
|
355
|
+
};
|
|
356
|
+
/**
|
|
357
|
+
* The prefix of every question a monitor adds to a reading; the rest of the
|
|
358
|
+
* id is the monitor's own.
|
|
359
|
+
*
|
|
360
|
+
* @category constants
|
|
361
|
+
* @since 1.0.0-rc.0
|
|
362
|
+
*/
|
|
363
|
+
export const monitorPrefix = "monitor_";
|
|
364
|
+
const declare = (extra) => Classifier.make("supervisor/turn", {
|
|
365
|
+
description: "Read one running agent's newest frames and the counts its harness keeps: whether it is thrashing, on the task and honest; its operational state in five scored words; and what it needs from a person.",
|
|
366
|
+
state: Snapshot,
|
|
367
|
+
questions: { ...fixedQuestions, ...extra }
|
|
368
|
+
});
|
|
369
|
+
const cache = new Map();
|
|
370
|
+
/**
|
|
371
|
+
* The classifier for a snapshot with these monitor questions.
|
|
372
|
+
*
|
|
373
|
+
* The fixed questions are the same for every snapshot and the monitors' follow
|
|
374
|
+
* them, so a snapshot with no monitor questions asks the eleven fixed
|
|
375
|
+
* questions and no others. Declared once per set of monitor ids, and again
|
|
376
|
+
* when a monitor id asks a different question, because the digest is the
|
|
377
|
+
* canonical hash of the questions and the journal names it.
|
|
378
|
+
*
|
|
379
|
+
* @category classifiers
|
|
380
|
+
* @since 1.0.0-rc.0
|
|
381
|
+
*/
|
|
382
|
+
export const classifierFor = (extra) => {
|
|
383
|
+
const ids = Object.keys(extra).sort();
|
|
384
|
+
const key = ids.join(",");
|
|
385
|
+
const held = cache.get(key);
|
|
386
|
+
if (held !== undefined && ids.every((id) => held.extra[id] === extra[id]))
|
|
387
|
+
return held.made;
|
|
388
|
+
const made = declare(extra);
|
|
389
|
+
cache.set(key, { extra, made });
|
|
390
|
+
return made;
|
|
391
|
+
};
|
|
392
|
+
/**
|
|
393
|
+
* The classifier over a bare snapshot: the eleven fixed questions and no
|
|
394
|
+
* monitor booleans. Its id is the id every shape shares.
|
|
395
|
+
*
|
|
396
|
+
* @category classifiers
|
|
397
|
+
* @since 1.0.0-rc.0
|
|
398
|
+
*/
|
|
399
|
+
export const classifier = classifierFor({});
|
|
400
|
+
/**
|
|
401
|
+
* Asks Jev about one snapshot, and the monitor questions `extra` adds.
|
|
402
|
+
*
|
|
403
|
+
* Fails, typed, whenever an answer could not be obtained: no evaluator bound,
|
|
404
|
+
* a transport refusal, a deadline, an answer that does not decode. There is
|
|
405
|
+
* no reading of a snapshot Jev did not read.
|
|
406
|
+
*
|
|
407
|
+
* @category conversions
|
|
408
|
+
* @since 1.0.0-rc.0
|
|
409
|
+
*/
|
|
410
|
+
export const read = (snapshot, extra) => Effect.gen(function* () {
|
|
411
|
+
const { answers, asked } = yield* Judgement.read(classifierFor(extra), snapshot);
|
|
412
|
+
const all = answers;
|
|
413
|
+
// Every declared question is answered or the decode above failed, and a
|
|
414
|
+
// monitor question is declared exactly for the ids read below.
|
|
415
|
+
const bool = (id) => all[id].probability;
|
|
416
|
+
return {
|
|
417
|
+
thrashing: answers.thrashing.probability,
|
|
418
|
+
onTarget: answers.on_target.probability,
|
|
419
|
+
suspect: answers.suspect.probability,
|
|
420
|
+
outdatedContext: answers.outdated_context.probability,
|
|
421
|
+
irrelevantContext: answers.irrelevant_context.probability,
|
|
422
|
+
emotions: {
|
|
423
|
+
frustrated: answers.frustrated.label,
|
|
424
|
+
anxious: answers.anxious.label,
|
|
425
|
+
scared: answers.scared.label,
|
|
426
|
+
confused: answers.confused.label,
|
|
427
|
+
confident: answers.confident.label
|
|
428
|
+
},
|
|
429
|
+
needsHelp: answers.needs_help.value,
|
|
430
|
+
monitors: Object.fromEntries(Object.keys(extra).map((id) => [id.slice(monitorPrefix.length), bool(id)])),
|
|
431
|
+
latencyMs: asked.latencyMs,
|
|
432
|
+
...(asked.usage === undefined ? {} : { usage: asked.usage }),
|
|
433
|
+
asked: { digest: asked.digest, questions: asked.questions, state: asked.state, answers: asked.answers }
|
|
434
|
+
};
|
|
435
|
+
});
|
|
436
|
+
/**
|
|
437
|
+
* A memory with nothing behind it.
|
|
438
|
+
*
|
|
439
|
+
* @category constructors
|
|
440
|
+
* @since 1.0.0-rc.0
|
|
441
|
+
*/
|
|
442
|
+
export const memoryNone = {
|
|
443
|
+
bound: false,
|
|
444
|
+
recall: () => Effect.succeed([]),
|
|
445
|
+
remember: () => Effect.void
|
|
446
|
+
};
|
|
447
|
+
/**
|
|
448
|
+
* The {@link Memory} reference, defaulting to {@link memoryNone}.
|
|
449
|
+
*
|
|
450
|
+
* @category services
|
|
451
|
+
* @since 1.0.0-rc.0
|
|
452
|
+
*/
|
|
453
|
+
export const Memory = Context.Reference("@smthrs/harness/Supervisor/Memory", {
|
|
454
|
+
defaultValue: () => memoryNone
|
|
455
|
+
});
|
|
456
|
+
/**
|
|
457
|
+
* The five triggers a reading fires, by name, each with the inequality that
|
|
458
|
+
* fires it. The one rule: the `supervisor` lint monitor crosses on it,
|
|
459
|
+
* {@link nudge} names from it, {@link compacting} reads its context triggers,
|
|
460
|
+
* and the offline replay scores it, so they cannot drift apart.
|
|
461
|
+
*
|
|
462
|
+
* @category constants
|
|
463
|
+
* @since 1.0.0-rc.0
|
|
464
|
+
*/
|
|
465
|
+
export const triggers = {
|
|
466
|
+
thrashing: (reading) => reading.thrashing >= thrashingAt,
|
|
467
|
+
off_target: (reading) => reading.onTarget <= offTargetAt,
|
|
468
|
+
suspect: (reading) => reading.suspect >= suspectAt,
|
|
469
|
+
outdated_context: (reading) => reading.outdatedContext >= contextAt,
|
|
470
|
+
irrelevant_context: (reading) => reading.irrelevantContext >= contextAt
|
|
471
|
+
};
|
|
472
|
+
/**
|
|
473
|
+
* The triggers one reading fires, in declaration order.
|
|
474
|
+
*
|
|
475
|
+
* @category conversions
|
|
476
|
+
* @since 1.0.0-rc.0
|
|
477
|
+
*/
|
|
478
|
+
export const triggered = (reading) => Object.keys(triggers).filter((name) => triggers[name](reading));
|
|
479
|
+
/**
|
|
480
|
+
* The triggers that compact the run's context instead of nudging it.
|
|
481
|
+
*
|
|
482
|
+
* @category constants
|
|
483
|
+
* @since 1.0.0-rc.0
|
|
484
|
+
*/
|
|
485
|
+
export const contextTriggers = ["outdated_context", "irrelevant_context"];
|
|
486
|
+
const isContext = (trigger) => contextTriggers.includes(trigger);
|
|
487
|
+
/**
|
|
488
|
+
* Whether one reading crosses: any trigger but a context one fires. A context
|
|
489
|
+
* trigger compacts the run's context at the next frame instead; see
|
|
490
|
+
* {@link compacting}.
|
|
491
|
+
*
|
|
492
|
+
* @category conversions
|
|
493
|
+
* @since 1.0.0-rc.0
|
|
494
|
+
*/
|
|
495
|
+
export const crosses = (reading) => triggered(reading).some((trigger) => !isContext(trigger));
|
|
496
|
+
/**
|
|
497
|
+
* The context triggers one reading fires, in declaration order: why a judged
|
|
498
|
+
* run that is sent this reading compacts at its next frame.
|
|
499
|
+
*
|
|
500
|
+
* @category conversions
|
|
501
|
+
* @since 1.0.0-rc.0
|
|
502
|
+
*/
|
|
503
|
+
export const compacting = (reading) => triggered(reading).filter(isContext);
|
|
504
|
+
/**
|
|
505
|
+
* The nudge a crossed reading puts in front of the run, naming its evidence.
|
|
506
|
+
*
|
|
507
|
+
* Concise on purpose, and built from counts rather than from the model's
|
|
508
|
+
* prose: what the run is told is what the harness measured, and the reading's
|
|
509
|
+
* probabilities say only which measurements to name.
|
|
510
|
+
*
|
|
511
|
+
* @category conversions
|
|
512
|
+
* @since 1.0.0-rc.0
|
|
513
|
+
*/
|
|
514
|
+
export const nudge = (snapshot, reading) => {
|
|
515
|
+
const { signals } = snapshot;
|
|
516
|
+
const said = {
|
|
517
|
+
thrashing: `repeating itself (thrashing ${reading.thrashing.toFixed(2)})`,
|
|
518
|
+
off_target: `drifting from the task (on target ${reading.onTarget.toFixed(2)})`,
|
|
519
|
+
suspect: `standing on suspect evidence (suspect ${reading.suspect.toFixed(2)})`
|
|
520
|
+
};
|
|
521
|
+
const found = triggered(reading).flatMap((name) => isContext(name) ? [] : [said[name]]);
|
|
522
|
+
const evidence = [];
|
|
523
|
+
if (signals.checksFailing > 0) {
|
|
524
|
+
evidence.push(`${signals.checksFailing} check${signals.checksFailing === 1 ? "" : "s"} last reported failing`);
|
|
525
|
+
}
|
|
526
|
+
if (signals.failuresUnanswered > 0) {
|
|
527
|
+
evidence.push(`${signals.failuresUnanswered} failing check${signals.failuresUnanswered === 1 ? "" : "s"} never answered by a pass`);
|
|
528
|
+
}
|
|
529
|
+
if (signals.repeatFrames > 0)
|
|
530
|
+
evidence.push(`${signals.repeatFrames} consecutive frames repeated earlier calls`);
|
|
531
|
+
if (signals.readOnlyFrames > 0)
|
|
532
|
+
evidence.push(`${signals.readOnlyFrames} consecutive frames changed nothing`);
|
|
533
|
+
if (signals.callsFailed > 0)
|
|
534
|
+
evidence.push(`${signals.callsFailed} of ${signals.callsSettled} calls failed`);
|
|
535
|
+
evidence.push(`${signals.mutations} frame${signals.mutations === 1 ? "" : "s"} changed the workspace`);
|
|
536
|
+
// The counts are the ones the run held when frame N closed; by the time the
|
|
537
|
+
// run reads this it has written at least one frame more, so the frame is named.
|
|
538
|
+
return `Supervisor: a reading of this run's last ${snapshot.frames.length} frames, through frame ${signals.frame}, finds it ${found.join(", ")}. Evidence at frame ${signals.frame}: ${evidence.join("; ")}. Before the next call, state in one sentence which mechanism you now believe is wrong and which single call would show it; then make that call. Do not re-run a check over an unchanged tree, and do not edit a test to make it pass.`;
|
|
539
|
+
};
|
|
540
|
+
/**
|
|
541
|
+
* Renders one recalled row as the run reads it.
|
|
542
|
+
*
|
|
543
|
+
* @category conversions
|
|
544
|
+
* @since 1.0.0-rc.0
|
|
545
|
+
*/
|
|
546
|
+
export const recalledInsert = (row) => `From memory of this repository (${row.key}):\n${row.text}`;
|
|
547
|
+
/**
|
|
548
|
+
* The head of a frame's cell or prose, bounded by {@link frameBytes}.
|
|
549
|
+
*
|
|
550
|
+
* @category conversions
|
|
551
|
+
* @since 1.0.0-rc.0
|
|
552
|
+
*/
|
|
553
|
+
export const head = (text) => elide.head(text.trim(), frameBytes, "clipped");
|
|
554
|
+
/**
|
|
555
|
+
* The newest {@link frameBytes} of a frame's prints.
|
|
556
|
+
*
|
|
557
|
+
* @category conversions
|
|
558
|
+
* @since 1.0.0-rc.0
|
|
559
|
+
*/
|
|
560
|
+
export const tail = (text) => {
|
|
561
|
+
const trimmed = text.trim();
|
|
562
|
+
const kept = elide.tailSlice(trimmed, frameBytes);
|
|
563
|
+
return kept.length === trimmed.length ? trimmed : `[… older bytes elided]\n${kept}`;
|
|
564
|
+
};
|
|
565
|
+
const fencedCell = /```(?:cell|typescript|ts|javascript|js)[^\n]*\n[\s\S]*?(?:```|$)/g;
|
|
566
|
+
/**
|
|
567
|
+
* What the model wrote around its cell: the reply with every fenced cell
|
|
568
|
+
* removed. The anxiety question reads it, and so does the run-end
|
|
569
|
+
* transcript miner.
|
|
570
|
+
*
|
|
571
|
+
* @category conversions
|
|
572
|
+
* @since 1.0.0-rc.0
|
|
573
|
+
*/
|
|
574
|
+
export const prose = (text) => text.replace(fencedCell, "").trim();
|
|
575
|
+
//# sourceMappingURL=Supervisor.js.map
|