@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,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The truncation ledger: which bytes this run was handed as a fragment.
|
|
3
|
+
*
|
|
4
|
+
* A flow that caps a captured stream returns the part that fit and declares the
|
|
5
|
+
* cut in a sibling flag. What the cell reads is an ordinary string, and by the
|
|
6
|
+
* time that string reaches a write there is nothing on it that remembers it was
|
|
7
|
+
* cut — so an agent that restores a file with `git show <rev>:<path>` and writes
|
|
8
|
+
* the captured stdout back replaces the file with its last 30,000 bytes. That is
|
|
9
|
+
* not hypothetical: on a graded benchmark instance a 645-line module became its
|
|
10
|
+
* own tail, the compile check failed with an indentation error, the run repeated
|
|
11
|
+
* the identical restore without re-reading the flag, and the mangled file was
|
|
12
|
+
* the answer submitted.
|
|
13
|
+
*
|
|
14
|
+
* The call boundary is the only place that sees both halves — the result that
|
|
15
|
+
* declared the truncation, and the later input carrying those same bytes — so
|
|
16
|
+
* the ledger lives there. A write of bytes a call already reported as truncated
|
|
17
|
+
* is refused rather than warned about, because there is no case in which
|
|
18
|
+
* writing a known fragment over a file is what the caller meant.
|
|
19
|
+
*
|
|
20
|
+
* The producing half is `@smthrs/std`: `Bash` declares `stdoutTruncated` beside
|
|
21
|
+
* `stdout`, and the paged flows declare a bare `truncated` beside the text they
|
|
22
|
+
* cut. Neither is a shared type — the controller must not depend on the tool
|
|
23
|
+
* library — so both are read here as documented wire conventions, exactly as
|
|
24
|
+
* `invalidProbe` is read by `CellTurn`.
|
|
25
|
+
*
|
|
26
|
+
* @since 0.1.0
|
|
27
|
+
*/
|
|
28
|
+
import { Schema } from "effect";
|
|
29
|
+
/**
|
|
30
|
+
* The suffix a flow flags one named payload's truncation with.
|
|
31
|
+
*
|
|
32
|
+
* `stdoutTruncated: true` says the sibling `stdout` is a fragment. The prefix
|
|
33
|
+
* names the field, which is what lets the ledger record what was cut without
|
|
34
|
+
* knowing the flow.
|
|
35
|
+
*
|
|
36
|
+
* @category constants
|
|
37
|
+
* @since 0.1.0
|
|
38
|
+
* @slop
|
|
39
|
+
*/
|
|
40
|
+
export declare const flagSuffix = "Truncated";
|
|
41
|
+
/**
|
|
42
|
+
* The suffix a flow states one named payload's discarded byte count with.
|
|
43
|
+
*
|
|
44
|
+
* @category constants
|
|
45
|
+
* @since 0.1.0
|
|
46
|
+
* @slop
|
|
47
|
+
*/
|
|
48
|
+
export declare const droppedSuffix = "DroppedBytes";
|
|
49
|
+
/**
|
|
50
|
+
* The bare flag a single-payload flow declares its truncation with.
|
|
51
|
+
*
|
|
52
|
+
* A paged read returns `content` and `truncated`, with no field name to pair
|
|
53
|
+
* them, so every long string beside the flag is treated as the cut payload.
|
|
54
|
+
*
|
|
55
|
+
* @category constants
|
|
56
|
+
* @since 0.1.0
|
|
57
|
+
* @slop
|
|
58
|
+
*/
|
|
59
|
+
export declare const flagKey = "truncated";
|
|
60
|
+
/**
|
|
61
|
+
* Smallest payload, in UTF-8 bytes, the ledger records or refuses.
|
|
62
|
+
*
|
|
63
|
+
* The refusal exists because a truncated capture is a file-sized fragment; a
|
|
64
|
+
* short one is neither destructive to write nor distinctive enough to match
|
|
65
|
+
* safely. Every real capture clears this by an order of magnitude — a shell
|
|
66
|
+
* stream is cut at 30,000 bytes and a paged read at 60,000 — so the floor costs
|
|
67
|
+
* the guard nothing and keeps a one-line notice out of the ledger.
|
|
68
|
+
*
|
|
69
|
+
* @category constants
|
|
70
|
+
* @since 0.1.0
|
|
71
|
+
* @slop
|
|
72
|
+
*/
|
|
73
|
+
export declare const minimumBytes = 1024;
|
|
74
|
+
/**
|
|
75
|
+
* How many *distinct* captures one run carries forward.
|
|
76
|
+
*
|
|
77
|
+
* The ledger is durable controller state, so it is bounded: the digest of a
|
|
78
|
+
* capture is what the guard compares, and a run that has produced sixteen newer
|
|
79
|
+
* fragments is no longer plausibly about to write the seventeenth.
|
|
80
|
+
*
|
|
81
|
+
* The bound counts distinct payloads because the run this guard exists for
|
|
82
|
+
* repeats itself: the graded instance ran the identical `git show` restore
|
|
83
|
+
* frame after frame. Counting each repetition would let one command evict every
|
|
84
|
+
* other fragment the run was handed and re-open the hole sixteen calls later.
|
|
85
|
+
*
|
|
86
|
+
* @category constants
|
|
87
|
+
* @since 0.1.0
|
|
88
|
+
* @slop
|
|
89
|
+
*/
|
|
90
|
+
export declare const retained = 16;
|
|
91
|
+
declare const Capture_base: Schema.Class<Capture, Schema.Struct<{
|
|
92
|
+
/** The flow whose result declared the cut. */
|
|
93
|
+
readonly flow: Schema.String;
|
|
94
|
+
/** The result field that carries the fragment. */
|
|
95
|
+
readonly field: Schema.String;
|
|
96
|
+
/** Bytes the flow discarded, as it reported them; zero when it did not say. */
|
|
97
|
+
readonly droppedBytes: Schema.Int;
|
|
98
|
+
/** The digest of the exact string the flow returned. */
|
|
99
|
+
readonly digest: Schema.String;
|
|
100
|
+
}>, {}>;
|
|
101
|
+
/**
|
|
102
|
+
* One payload a flow returned after cutting it.
|
|
103
|
+
*
|
|
104
|
+
* The bytes themselves are not kept. A capture carries their digest, which is
|
|
105
|
+
* all an exact-match refusal needs and is what keeps the ledger small enough to
|
|
106
|
+
* live in journaled controller state.
|
|
107
|
+
*
|
|
108
|
+
* @category models
|
|
109
|
+
* @since 0.1.0
|
|
110
|
+
* @slop
|
|
111
|
+
*/
|
|
112
|
+
export declare class Capture extends Capture_base {
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* One input field found to carry the exact bytes of an earlier capture.
|
|
116
|
+
*
|
|
117
|
+
* @category models
|
|
118
|
+
* @since 0.1.0
|
|
119
|
+
* @slop
|
|
120
|
+
*/
|
|
121
|
+
export interface Reuse {
|
|
122
|
+
/** Where in the refused input the fragment was found. */
|
|
123
|
+
readonly path: string;
|
|
124
|
+
/** The capture those bytes came from. */
|
|
125
|
+
readonly capture: Capture;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Reads every truncated payload one settled call result declares.
|
|
129
|
+
*
|
|
130
|
+
* @category conversions
|
|
131
|
+
* @since 0.1.0
|
|
132
|
+
* @slop
|
|
133
|
+
*/
|
|
134
|
+
export declare const captures: (flow: string, value: Schema.Json) => ReadonlyArray<Capture>;
|
|
135
|
+
/**
|
|
136
|
+
* Finds the first input field that carries an earlier capture verbatim.
|
|
137
|
+
*
|
|
138
|
+
* Only an exact match counts. Content the agent derived from a fragment —
|
|
139
|
+
* re-indented, spliced, summarized — is its own value and is not this
|
|
140
|
+
* function's business; the one case being caught is the fragment handed
|
|
141
|
+
* straight back as if it were whole.
|
|
142
|
+
*
|
|
143
|
+
* @category conversions
|
|
144
|
+
* @since 0.1.0
|
|
145
|
+
* @slop
|
|
146
|
+
*/
|
|
147
|
+
export declare const reuse: (input: Schema.Json, ledger: ReadonlyArray<Capture>) => Reuse | undefined;
|
|
148
|
+
/**
|
|
149
|
+
* States why a call carrying a known fragment was refused.
|
|
150
|
+
*
|
|
151
|
+
* The message names the alternative, because a refusal an agent cannot act on
|
|
152
|
+
* costs a frame and changes nothing: a file is restored from git with git
|
|
153
|
+
* itself, never by piping a revision through captured output.
|
|
154
|
+
*
|
|
155
|
+
* @category constructors
|
|
156
|
+
* @since 0.1.0
|
|
157
|
+
* @slop
|
|
158
|
+
*/
|
|
159
|
+
export declare const refusal: (flow: string, found: Reuse) => string;
|
|
160
|
+
/**
|
|
161
|
+
* Bounds the ledger to the {@link retained} most recent distinct captures.
|
|
162
|
+
*
|
|
163
|
+
* A repeated call returns the same bytes and so the same digest, and the guard
|
|
164
|
+
* compares digests, so a second copy adds nothing but costs a slot. Collapsing
|
|
165
|
+
* them keeps the bound a bound on what the run was handed rather than on how
|
|
166
|
+
* many times it asked: a cell looping on one truncated `git show` no longer
|
|
167
|
+
* pushes the fragment it captured before that loop out of the ledger.
|
|
168
|
+
*
|
|
169
|
+
* The newest position of a repeated digest is the one kept, so the record
|
|
170
|
+
* states when the run was last handed those bytes.
|
|
171
|
+
*
|
|
172
|
+
* @category conversions
|
|
173
|
+
* @since 0.1.0
|
|
174
|
+
* @slop
|
|
175
|
+
*/
|
|
176
|
+
export declare const retain: (ledger: ReadonlyArray<Capture>) => ReadonlyArray<Capture>;
|
|
177
|
+
/**
|
|
178
|
+
* The ledger schema carried in controller state.
|
|
179
|
+
*
|
|
180
|
+
* @category schemas
|
|
181
|
+
* @since 0.1.0
|
|
182
|
+
* @slop
|
|
183
|
+
*/
|
|
184
|
+
export declare const Ledger: Schema.withDecodingDefaultKey<Schema.withConstructorDefault<Schema.$Array<typeof Capture>>, never>;
|
|
185
|
+
export {};
|
|
186
|
+
//# sourceMappingURL=TruncatedOutput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TruncatedOutput.d.ts","sourceRoot":"","sources":["../../src/TruncatedOutput.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAA;AAGvC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,cAAc,CAAA;AAErC;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,iBAAiB,CAAA;AAE3C;;;;;;;;;GASG;AACH,eAAO,MAAM,OAAO,cAAc,CAAA;AAElC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY,OAAO,CAAA;AAEhC;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,QAAQ,KAAK,CAAA;;IAcxB,8CAA8C;;IAE9C,kDAAkD;;IAElD,+EAA+E;;IAE/E,wDAAwD;;;AAlB1D;;;;;;;;;;GAUG;AACH,qBAAa,OAAQ,SAAQ,YAS3B;CAAG;AAEL;;;;;;GAMG;AACH,MAAM,WAAW,KAAK;IACpB,yDAAyD;IACzD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,yCAAyC;IACzC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAC1B;AAsDD;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,CAAC,IAAI,KAAG,aAAa,CAAC,OAAO,CAIhF,CAAA;AA2BD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,KAAK,GAChB,OAAO,MAAM,CAAC,IAAI,EAClB,QAAQ,aAAa,CAAC,OAAO,CAAC,KAC7B,KAAK,GAAG,SAGyE,CAAA;AAEpF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,OAAO,GAAI,MAAM,MAAM,EAAE,OAAO,KAAK,KAAG,MAC6Y,CAAA;AAElc;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM,GAAI,QAAQ,aAAa,CAAC,OAAO,CAAC,KAAG,aAAa,CAAC,OAAO,CAS5E,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,oGAGlB,CAAA"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var TruncatedOutput_exports = {};
|
|
30
|
+
__export(TruncatedOutput_exports, {
|
|
31
|
+
Capture: () => Capture,
|
|
32
|
+
Ledger: () => Ledger,
|
|
33
|
+
captures: () => captures,
|
|
34
|
+
droppedSuffix: () => droppedSuffix,
|
|
35
|
+
flagKey: () => flagKey,
|
|
36
|
+
flagSuffix: () => flagSuffix,
|
|
37
|
+
minimumBytes: () => minimumBytes,
|
|
38
|
+
refusal: () => refusal,
|
|
39
|
+
retain: () => retain,
|
|
40
|
+
retained: () => retained,
|
|
41
|
+
reuse: () => reuse
|
|
42
|
+
});
|
|
43
|
+
module.exports = __toCommonJS(TruncatedOutput_exports);
|
|
44
|
+
var Digest = __toESM(require("@smthrs/core/Digest"), 1);
|
|
45
|
+
var import_effect = require("effect");
|
|
46
|
+
var import_nonNegativeSafeInt = require("./internal/nonNegativeSafeInt.js");
|
|
47
|
+
const flagSuffix = "Truncated";
|
|
48
|
+
const droppedSuffix = "DroppedBytes";
|
|
49
|
+
const flagKey = "truncated";
|
|
50
|
+
const minimumBytes = 1024;
|
|
51
|
+
const retained = 16;
|
|
52
|
+
class Capture extends import_effect.Schema.Class("flows/harness/TruncatedOutput/Capture")({
|
|
53
|
+
/** The flow whose result declared the cut. */
|
|
54
|
+
flow: import_effect.Schema.String,
|
|
55
|
+
/** The result field that carries the fragment. */
|
|
56
|
+
field: import_effect.Schema.String,
|
|
57
|
+
/** Bytes the flow discarded, as it reported them; zero when it did not say. */
|
|
58
|
+
droppedBytes: import_nonNegativeSafeInt.NonNegativeSafeInt,
|
|
59
|
+
/** The digest of the exact string the flow returned. */
|
|
60
|
+
digest: import_effect.Schema.String
|
|
61
|
+
}) {
|
|
62
|
+
}
|
|
63
|
+
const encoder = new TextEncoder();
|
|
64
|
+
const byteLength = (text) => encoder.encode(text).byteLength;
|
|
65
|
+
const isObject = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
66
|
+
const droppedBytes = (node, field) => {
|
|
67
|
+
const declared = node[`${field}${droppedSuffix}`];
|
|
68
|
+
return typeof declared === "number" && Number.isSafeInteger(declared) && declared >= 0 ? declared : 0;
|
|
69
|
+
};
|
|
70
|
+
const captureField = (flow, node, field, into) => {
|
|
71
|
+
const text = node[field];
|
|
72
|
+
if (typeof text !== "string" || byteLength(text) < minimumBytes) return;
|
|
73
|
+
into.push(
|
|
74
|
+
new Capture({
|
|
75
|
+
flow,
|
|
76
|
+
field,
|
|
77
|
+
droppedBytes: droppedBytes(node, field),
|
|
78
|
+
digest: Digest.digest(text)
|
|
79
|
+
})
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
const captureNode = (flow, node, into) => {
|
|
83
|
+
for (const [key, value] of Object.entries(node)) {
|
|
84
|
+
if (value !== true) continue;
|
|
85
|
+
if (key === flagKey) {
|
|
86
|
+
for (const sibling of Object.keys(node)) captureField(flow, node, sibling, into);
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
if (!key.endsWith(flagSuffix) || key.length === flagSuffix.length) continue;
|
|
90
|
+
captureField(flow, node, key.slice(0, -flagSuffix.length), into);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
const collect = (flow, value, into) => {
|
|
94
|
+
if (Array.isArray(value)) {
|
|
95
|
+
for (const item of value) collect(flow, item, into);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (!isObject(value)) return;
|
|
99
|
+
captureNode(flow, value, into);
|
|
100
|
+
for (const item of Object.values(value)) collect(flow, item, into);
|
|
101
|
+
};
|
|
102
|
+
const captures = (flow, value) => {
|
|
103
|
+
const found = [];
|
|
104
|
+
collect(flow, value, found);
|
|
105
|
+
return found;
|
|
106
|
+
};
|
|
107
|
+
const search = (value, path, known) => {
|
|
108
|
+
if (typeof value === "string") {
|
|
109
|
+
if (byteLength(value) < minimumBytes) return void 0;
|
|
110
|
+
const capture = known.get(Digest.digest(value));
|
|
111
|
+
return capture === void 0 ? void 0 : { path: path === "" ? "input" : path, capture };
|
|
112
|
+
}
|
|
113
|
+
if (Array.isArray(value)) {
|
|
114
|
+
for (let index = 0; index < value.length; index++) {
|
|
115
|
+
const found = search(value[index], `${path}[${index}]`, known);
|
|
116
|
+
if (found !== void 0) return found;
|
|
117
|
+
}
|
|
118
|
+
return void 0;
|
|
119
|
+
}
|
|
120
|
+
if (!isObject(value)) return void 0;
|
|
121
|
+
for (const [key, member] of Object.entries(value)) {
|
|
122
|
+
const found = search(member, path === "" ? key : `${path}.${key}`, known);
|
|
123
|
+
if (found !== void 0) return found;
|
|
124
|
+
}
|
|
125
|
+
return void 0;
|
|
126
|
+
};
|
|
127
|
+
const reuse = (input, ledger) => ledger.length === 0 ? void 0 : search(input, "", new Map(ledger.map((capture) => [capture.digest, capture])));
|
|
128
|
+
const refusal = (flow, found) => `Flow ${flow} was refused: its ${found.path} is byte-identical to output this run already returned truncated \u2014 ${found.capture.flow} cut ${found.capture.field} and dropped ${found.capture.droppedBytes} bytes. Those bytes are a fragment of the value, not the value, so writing them replaces the target with a piece of itself. To restore a file from git, run git checkout or git restore on the path; never route file content through captured stdout.`;
|
|
129
|
+
const retain = (ledger) => {
|
|
130
|
+
const newest = /* @__PURE__ */ new Map();
|
|
131
|
+
for (const capture of ledger) {
|
|
132
|
+
newest.delete(capture.digest);
|
|
133
|
+
newest.set(capture.digest, capture);
|
|
134
|
+
}
|
|
135
|
+
if (newest.size === ledger.length && ledger.length <= retained) return ledger;
|
|
136
|
+
const distinct = [...newest.values()];
|
|
137
|
+
return distinct.length <= retained ? distinct : distinct.slice(distinct.length - retained);
|
|
138
|
+
};
|
|
139
|
+
const Ledger = import_effect.Schema.Array(Capture).pipe(
|
|
140
|
+
import_effect.Schema.withConstructorDefault(import_effect.Effect.succeed([])),
|
|
141
|
+
import_effect.Schema.withDecodingDefaultKey(import_effect.Effect.succeed([]))
|
|
142
|
+
);
|
|
143
|
+
//# sourceMappingURL=TruncatedOutput.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/TruncatedOutput.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * The truncation ledger: which bytes this run was handed as a fragment.\n *\n * A flow that caps a captured stream returns the part that fit and declares the\n * cut in a sibling flag. What the cell reads is an ordinary string, and by the\n * time that string reaches a write there is nothing on it that remembers it was\n * cut \u2014 so an agent that restores a file with `git show <rev>:<path>` and writes\n * the captured stdout back replaces the file with its last 30,000 bytes. That is\n * not hypothetical: on a graded benchmark instance a 645-line module became its\n * own tail, the compile check failed with an indentation error, the run repeated\n * the identical restore without re-reading the flag, and the mangled file was\n * the answer submitted.\n *\n * The call boundary is the only place that sees both halves \u2014 the result that\n * declared the truncation, and the later input carrying those same bytes \u2014 so\n * the ledger lives there. A write of bytes a call already reported as truncated\n * is refused rather than warned about, because there is no case in which\n * writing a known fragment over a file is what the caller meant.\n *\n * The producing half is `@smthrs/std`: `Bash` declares `stdoutTruncated` beside\n * `stdout`, and the paged flows declare a bare `truncated` beside the text they\n * cut. Neither is a shared type \u2014 the controller must not depend on the tool\n * library \u2014 so both are read here as documented wire conventions, exactly as\n * `invalidProbe` is read by `CellTurn`.\n *\n * @since 0.1.0\n */\n\nimport * as Digest from \"@smthrs/core/Digest\"\nimport { Effect, Schema } from \"effect\"\nimport { NonNegativeSafeInt } from \"./internal/nonNegativeSafeInt.ts\"\n\n/**\n * The suffix a flow flags one named payload's truncation with.\n *\n * `stdoutTruncated: true` says the sibling `stdout` is a fragment. The prefix\n * names the field, which is what lets the ledger record what was cut without\n * knowing the flow.\n *\n * @category constants\n * @since 0.1.0\n * @slop\n */\nexport const flagSuffix = \"Truncated\"\n\n/**\n * The suffix a flow states one named payload's discarded byte count with.\n *\n * @category constants\n * @since 0.1.0\n * @slop\n */\nexport const droppedSuffix = \"DroppedBytes\"\n\n/**\n * The bare flag a single-payload flow declares its truncation with.\n *\n * A paged read returns `content` and `truncated`, with no field name to pair\n * them, so every long string beside the flag is treated as the cut payload.\n *\n * @category constants\n * @since 0.1.0\n * @slop\n */\nexport const flagKey = \"truncated\"\n\n/**\n * Smallest payload, in UTF-8 bytes, the ledger records or refuses.\n *\n * The refusal exists because a truncated capture is a file-sized fragment; a\n * short one is neither destructive to write nor distinctive enough to match\n * safely. Every real capture clears this by an order of magnitude \u2014 a shell\n * stream is cut at 30,000 bytes and a paged read at 60,000 \u2014 so the floor costs\n * the guard nothing and keeps a one-line notice out of the ledger.\n *\n * @category constants\n * @since 0.1.0\n * @slop\n */\nexport const minimumBytes = 1024\n\n/**\n * How many *distinct* captures one run carries forward.\n *\n * The ledger is durable controller state, so it is bounded: the digest of a\n * capture is what the guard compares, and a run that has produced sixteen newer\n * fragments is no longer plausibly about to write the seventeenth.\n *\n * The bound counts distinct payloads because the run this guard exists for\n * repeats itself: the graded instance ran the identical `git show` restore\n * frame after frame. Counting each repetition would let one command evict every\n * other fragment the run was handed and re-open the hole sixteen calls later.\n *\n * @category constants\n * @since 0.1.0\n * @slop\n */\nexport const retained = 16\n\n/**\n * One payload a flow returned after cutting it.\n *\n * The bytes themselves are not kept. A capture carries their digest, which is\n * all an exact-match refusal needs and is what keeps the ledger small enough to\n * live in journaled controller state.\n *\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport class Capture extends Schema.Class<Capture>(\"flows/harness/TruncatedOutput/Capture\")({\n /** The flow whose result declared the cut. */\n flow: Schema.String,\n /** The result field that carries the fragment. */\n field: Schema.String,\n /** Bytes the flow discarded, as it reported them; zero when it did not say. */\n droppedBytes: NonNegativeSafeInt,\n /** The digest of the exact string the flow returned. */\n digest: Schema.String\n}) {}\n\n/**\n * One input field found to carry the exact bytes of an earlier capture.\n *\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport interface Reuse {\n /** Where in the refused input the fragment was found. */\n readonly path: string\n /** The capture those bytes came from. */\n readonly capture: Capture\n}\n\nconst encoder = new TextEncoder()\n\nconst byteLength = (text: string): number => encoder.encode(text).byteLength\n\nconst isObject = (value: Schema.Json): value is Schema.JsonObject =>\n value !== null && typeof value === \"object\" && !Array.isArray(value)\n\nconst droppedBytes = (node: Schema.JsonObject, field: string): number => {\n const declared = node[`${field}${droppedSuffix}`]\n return typeof declared === \"number\" && Number.isSafeInteger(declared) && declared >= 0 ? declared : 0\n}\n\nconst captureField = (\n flow: string,\n node: Schema.JsonObject,\n field: string,\n into: Array<Capture>\n): void => {\n const text = node[field]\n if (typeof text !== \"string\" || byteLength(text) < minimumBytes) return\n into.push(\n new Capture({\n flow,\n field,\n droppedBytes: droppedBytes(node, field),\n digest: Digest.digest(text)\n })\n )\n}\n\nconst captureNode = (flow: string, node: Schema.JsonObject, into: Array<Capture>): void => {\n for (const [key, value] of Object.entries(node)) {\n if (value !== true) continue\n if (key === flagKey) {\n for (const sibling of Object.keys(node)) captureField(flow, node, sibling, into)\n continue\n }\n if (!key.endsWith(flagSuffix) || key.length === flagSuffix.length) continue\n captureField(flow, node, key.slice(0, -flagSuffix.length), into)\n }\n}\n\nconst collect = (flow: string, value: Schema.Json, into: Array<Capture>): void => {\n if (Array.isArray(value)) {\n for (const item of value) collect(flow, item, into)\n return\n }\n if (!isObject(value)) return\n captureNode(flow, value, into)\n for (const item of Object.values(value)) collect(flow, item, into)\n}\n\n/**\n * Reads every truncated payload one settled call result declares.\n *\n * @category conversions\n * @since 0.1.0\n * @slop\n */\nexport const captures = (flow: string, value: Schema.Json): ReadonlyArray<Capture> => {\n const found: Array<Capture> = []\n collect(flow, value, found)\n return found\n}\n\nconst search = (\n value: Schema.Json,\n path: string,\n known: ReadonlyMap<string, Capture>\n): Reuse | undefined => {\n if (typeof value === \"string\") {\n if (byteLength(value) < minimumBytes) return undefined\n const capture = known.get(Digest.digest(value))\n return capture === undefined ? undefined : { path: path === \"\" ? \"input\" : path, capture }\n }\n if (Array.isArray(value)) {\n for (let index = 0; index < value.length; index++) {\n const found = search(value[index], `${path}[${index}]`, known)\n if (found !== undefined) return found\n }\n return undefined\n }\n if (!isObject(value)) return undefined\n for (const [key, member] of Object.entries(value)) {\n const found = search(member, path === \"\" ? key : `${path}.${key}`, known)\n if (found !== undefined) return found\n }\n return undefined\n}\n\n/**\n * Finds the first input field that carries an earlier capture verbatim.\n *\n * Only an exact match counts. Content the agent derived from a fragment \u2014\n * re-indented, spliced, summarized \u2014 is its own value and is not this\n * function's business; the one case being caught is the fragment handed\n * straight back as if it were whole.\n *\n * @category conversions\n * @since 0.1.0\n * @slop\n */\nexport const reuse = (\n input: Schema.Json,\n ledger: ReadonlyArray<Capture>\n): Reuse | undefined =>\n ledger.length === 0\n ? undefined\n : search(input, \"\", new Map(ledger.map((capture) => [capture.digest, capture])))\n\n/**\n * States why a call carrying a known fragment was refused.\n *\n * The message names the alternative, because a refusal an agent cannot act on\n * costs a frame and changes nothing: a file is restored from git with git\n * itself, never by piping a revision through captured output.\n *\n * @category constructors\n * @since 0.1.0\n * @slop\n */\nexport const refusal = (flow: string, found: Reuse): string =>\n `Flow ${flow} was refused: its ${found.path} is byte-identical to output this run already returned truncated \u2014 ${found.capture.flow} cut ${found.capture.field} and dropped ${found.capture.droppedBytes} bytes. Those bytes are a fragment of the value, not the value, so writing them replaces the target with a piece of itself. To restore a file from git, run git checkout or git restore on the path; never route file content through captured stdout.`\n\n/**\n * Bounds the ledger to the {@link retained} most recent distinct captures.\n *\n * A repeated call returns the same bytes and so the same digest, and the guard\n * compares digests, so a second copy adds nothing but costs a slot. Collapsing\n * them keeps the bound a bound on what the run was handed rather than on how\n * many times it asked: a cell looping on one truncated `git show` no longer\n * pushes the fragment it captured before that loop out of the ledger.\n *\n * The newest position of a repeated digest is the one kept, so the record\n * states when the run was last handed those bytes.\n *\n * @category conversions\n * @since 0.1.0\n * @slop\n */\nexport const retain = (ledger: ReadonlyArray<Capture>): ReadonlyArray<Capture> => {\n const newest = new Map<string, Capture>()\n for (const capture of ledger) {\n newest.delete(capture.digest)\n newest.set(capture.digest, capture)\n }\n if (newest.size === ledger.length && ledger.length <= retained) return ledger\n const distinct = [...newest.values()]\n return distinct.length <= retained ? distinct : distinct.slice(distinct.length - retained)\n}\n\n/**\n * The ledger schema carried in controller state.\n *\n * @category schemas\n * @since 0.1.0\n * @slop\n */\nexport const Ledger = Schema.Array(Capture).pipe(\n Schema.withConstructorDefault(Effect.succeed<ReadonlyArray<Capture>>([])),\n Schema.withDecodingDefaultKey(Effect.succeed<ReadonlyArray<Capture>>([]))\n)\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BA,aAAwB;AACxB,oBAA+B;AAC/B,gCAAmC;AAa5B,MAAM,aAAa;AASnB,MAAM,gBAAgB;AAYtB,MAAM,UAAU;AAehB,MAAM,eAAe;AAkBrB,MAAM,WAAW;AAajB,MAAM,gBAAgB,qBAAO,MAAe,uCAAuC,EAAE;AAAA;AAAA,EAE1F,MAAM,qBAAO;AAAA;AAAA,EAEb,OAAO,qBAAO;AAAA;AAAA,EAEd,cAAc;AAAA;AAAA,EAEd,QAAQ,qBAAO;AACjB,CAAC,EAAE;AAAC;AAgBJ,MAAM,UAAU,IAAI,YAAY;AAEhC,MAAM,aAAa,CAAC,SAAyB,QAAQ,OAAO,IAAI,EAAE;AAElE,MAAM,WAAW,CAAC,UAChB,UAAU,QAAQ,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK;AAErE,MAAM,eAAe,CAAC,MAAyB,UAA0B;AACvE,QAAM,WAAW,KAAK,GAAG,KAAK,GAAG,aAAa,EAAE;AAChD,SAAO,OAAO,aAAa,YAAY,OAAO,cAAc,QAAQ,KAAK,YAAY,IAAI,WAAW;AACtG;AAEA,MAAM,eAAe,CACnB,MACA,MACA,OACA,SACS;AACT,QAAM,OAAO,KAAK,KAAK;AACvB,MAAI,OAAO,SAAS,YAAY,WAAW,IAAI,IAAI,aAAc;AACjE,OAAK;AAAA,IACH,IAAI,QAAQ;AAAA,MACV;AAAA,MACA;AAAA,MACA,cAAc,aAAa,MAAM,KAAK;AAAA,MACtC,QAAQ,OAAO,OAAO,IAAI;AAAA,IAC5B,CAAC;AAAA,EACH;AACF;AAEA,MAAM,cAAc,CAAC,MAAc,MAAyB,SAA+B;AACzF,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,IAAI,GAAG;AAC/C,QAAI,UAAU,KAAM;AACpB,QAAI,QAAQ,SAAS;AACnB,iBAAW,WAAW,OAAO,KAAK,IAAI,EAAG,cAAa,MAAM,MAAM,SAAS,IAAI;AAC/E;AAAA,IACF;AACA,QAAI,CAAC,IAAI,SAAS,UAAU,KAAK,IAAI,WAAW,WAAW,OAAQ;AACnE,iBAAa,MAAM,MAAM,IAAI,MAAM,GAAG,CAAC,WAAW,MAAM,GAAG,IAAI;AAAA,EACjE;AACF;AAEA,MAAM,UAAU,CAAC,MAAc,OAAoB,SAA+B;AAChF,MAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,eAAW,QAAQ,MAAO,SAAQ,MAAM,MAAM,IAAI;AAClD;AAAA,EACF;AACA,MAAI,CAAC,SAAS,KAAK,EAAG;AACtB,cAAY,MAAM,OAAO,IAAI;AAC7B,aAAW,QAAQ,OAAO,OAAO,KAAK,EAAG,SAAQ,MAAM,MAAM,IAAI;AACnE;AASO,MAAM,WAAW,CAAC,MAAc,UAA+C;AACpF,QAAM,QAAwB,CAAC;AAC/B,UAAQ,MAAM,OAAO,KAAK;AAC1B,SAAO;AACT;AAEA,MAAM,SAAS,CACb,OACA,MACA,UACsB;AACtB,MAAI,OAAO,UAAU,UAAU;AAC7B,QAAI,WAAW,KAAK,IAAI,aAAc,QAAO;AAC7C,UAAM,UAAU,MAAM,IAAI,OAAO,OAAO,KAAK,CAAC;AAC9C,WAAO,YAAY,SAAY,SAAY,EAAE,MAAM,SAAS,KAAK,UAAU,MAAM,QAAQ;AAAA,EAC3F;AACA,MAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,aAAS,QAAQ,GAAG,QAAQ,MAAM,QAAQ,SAAS;AACjD,YAAM,QAAQ,OAAO,MAAM,KAAK,GAAG,GAAG,IAAI,IAAI,KAAK,KAAK,KAAK;AAC7D,UAAI,UAAU,OAAW,QAAO;AAAA,IAClC;AACA,WAAO;AAAA,EACT;AACA,MAAI,CAAC,SAAS,KAAK,EAAG,QAAO;AAC7B,aAAW,CAAC,KAAK,MAAM,KAAK,OAAO,QAAQ,KAAK,GAAG;AACjD,UAAM,QAAQ,OAAO,QAAQ,SAAS,KAAK,MAAM,GAAG,IAAI,IAAI,GAAG,IAAI,KAAK;AACxE,QAAI,UAAU,OAAW,QAAO;AAAA,EAClC;AACA,SAAO;AACT;AAcO,MAAM,QAAQ,CACnB,OACA,WAEA,OAAO,WAAW,IACd,SACA,OAAO,OAAO,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,QAAQ,OAAO,CAAC,CAAC,CAAC;AAa5E,MAAM,UAAU,CAAC,MAAc,UACpC,QAAQ,IAAI,qBAAqB,MAAM,IAAI,2EAAsE,MAAM,QAAQ,IAAI,QAAQ,MAAM,QAAQ,KAAK,gBAAgB,MAAM,QAAQ,YAAY;AAkBnM,MAAM,SAAS,CAAC,WAA2D;AAChF,QAAM,SAAS,oBAAI,IAAqB;AACxC,aAAW,WAAW,QAAQ;AAC5B,WAAO,OAAO,QAAQ,MAAM;AAC5B,WAAO,IAAI,QAAQ,QAAQ,OAAO;AAAA,EACpC;AACA,MAAI,OAAO,SAAS,OAAO,UAAU,OAAO,UAAU,SAAU,QAAO;AACvE,QAAM,WAAW,CAAC,GAAG,OAAO,OAAO,CAAC;AACpC,SAAO,SAAS,UAAU,WAAW,WAAW,SAAS,MAAM,SAAS,SAAS,QAAQ;AAC3F;AASO,MAAM,SAAS,qBAAO,MAAM,OAAO,EAAE;AAAA,EAC1C,qBAAO,uBAAuB,qBAAO,QAAgC,CAAC,CAAC,CAAC;AAAA,EACxE,qBAAO,uBAAuB,qBAAO,QAAgC,CAAC,CAAC,CAAC;AAC1E;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The completion with nothing behind it.
|
|
3
|
+
*
|
|
4
|
+
* A run finishes by claiming its work is done. Every other control in this
|
|
5
|
+
* package asks whether the *evidence* for that claim holds up. This one asks a
|
|
6
|
+
* question that comes before evidence: is there anything for the evidence to be
|
|
7
|
+
* about. A run that has not changed the workspace at any point in its life has
|
|
8
|
+
* produced nothing, and a sentence describing a change it did not make is not a
|
|
9
|
+
* result — it is a description of one.
|
|
10
|
+
*
|
|
11
|
+
* It is not hypothetical. On a graded benchmark one instance ran seven frames,
|
|
12
|
+
* issued eleven flow calls — three `read`, seven `grep`, one `bash` — made no
|
|
13
|
+
* editing call of any kind, and closed all seven frames on the identical
|
|
14
|
+
* workspace digest the run had opened on. It then completed with "Updated
|
|
15
|
+
* `AdminSite.catch_all_view()` to preserve query strings when `APPEND_SLASH`
|
|
16
|
+
* redirects add a trailing slash." The captured patch was zero bytes. The same
|
|
17
|
+
* instance had resolved in five frames one wave earlier.
|
|
18
|
+
*
|
|
19
|
+
* Every armed control let that through, and each for a reason that was correct
|
|
20
|
+
* about its own subject: the read-only cap is a stall detector and the run
|
|
21
|
+
* finished below it, the narrowing demand judges the shape of a check and there
|
|
22
|
+
* was no check to narrow, and the phantom-write veto vetoes a write that was
|
|
23
|
+
* declared and did not happen — this run declared none. The harness held the
|
|
24
|
+
* fact that decides it the whole time, in seven `mutation-observed` events on
|
|
25
|
+
* one digest, and never consulted it at the `complete` transition.
|
|
26
|
+
*
|
|
27
|
+
* The comparison is between two measurements the harness already took: the
|
|
28
|
+
* digest of the tree the run opened on, and the digest the completing frame
|
|
29
|
+
* closed on. Equal digests mean the tree the completion describes is the tree
|
|
30
|
+
* the run was handed. Nothing here reads the completion's text, and nothing
|
|
31
|
+
* here decides whether the run was right: "no change is needed" is a legitimate
|
|
32
|
+
* answer to a task, and the demand names it as one of the two ways out.
|
|
33
|
+
*
|
|
34
|
+
* @since 0.1.0
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* A completion taken over the tree the run was handed.
|
|
38
|
+
*
|
|
39
|
+
* @category models
|
|
40
|
+
* @since 0.1.0
|
|
41
|
+
*/
|
|
42
|
+
export interface Unmoved {
|
|
43
|
+
/** Content address of the workspace the run opened on. */
|
|
44
|
+
readonly opened: string;
|
|
45
|
+
/** Content address of the workspace the completing frame closed on. */
|
|
46
|
+
readonly closed: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Whether a completing frame is finishing on the tree the run started with.
|
|
50
|
+
*
|
|
51
|
+
* Both conditions are read off measurements the controller already took, and
|
|
52
|
+
* both are required:
|
|
53
|
+
*
|
|
54
|
+
* 1. the run has an opening measurement that covered the whole tree, and the
|
|
55
|
+
* completing frame closed on one — an incomplete walk cannot say a tree held
|
|
56
|
+
* still, and an empty digest is recorded for exactly that case;
|
|
57
|
+
* 2. the two digests are equal.
|
|
58
|
+
*
|
|
59
|
+
* Digest equality, rather than a count of frames that reported a mutation, is
|
|
60
|
+
* what the demand's own sentence claims: that nothing in this workspace differs
|
|
61
|
+
* from the tree the run opened on. That is true of a run that never wrote and
|
|
62
|
+
* equally true of a run that wrote and undid it, and the sentence holds in both
|
|
63
|
+
* cases. A run whose tree moved and stayed moved is not this failure, whatever
|
|
64
|
+
* else may be wrong with it.
|
|
65
|
+
*
|
|
66
|
+
* @category conversions
|
|
67
|
+
* @since 0.1.0
|
|
68
|
+
*/
|
|
69
|
+
export declare const find: (options: {
|
|
70
|
+
/** The digest the run opened on; empty when the run never measured one. */
|
|
71
|
+
readonly opened: string;
|
|
72
|
+
/** The digest the completing frame closed on; empty when unmeasured. */
|
|
73
|
+
readonly digest: string;
|
|
74
|
+
/**
|
|
75
|
+
* Writes this run recorded on trees the two digests do not cover.
|
|
76
|
+
*
|
|
77
|
+
* A `bash` call routed into a container measures that container's working
|
|
78
|
+
* directory itself and reports a move under the reserved `mutated` key; the
|
|
79
|
+
* host walk behind `opened` and `digest` never saw that tree. One such write
|
|
80
|
+
* is the tree moving, and the two digests agreeing says nothing against it.
|
|
81
|
+
* Absent or zero leaves the comparison exactly as it was.
|
|
82
|
+
*/
|
|
83
|
+
readonly elsewhere?: number | undefined;
|
|
84
|
+
}) => Unmoved | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* States that the tree never moved, and names the two answers that end it.
|
|
87
|
+
*
|
|
88
|
+
* The two ways out are stated as equals because they are equals. A task whose
|
|
89
|
+
* right answer is "nothing needs changing" exists, and a run that reaches that
|
|
90
|
+
* conclusion honestly must be able to say so and finish; a demand that only
|
|
91
|
+
* accepted an edit would be pushing such a run into making one. What the demand
|
|
92
|
+
* refuses is the third thing, which is what the recorded run did: a sentence
|
|
93
|
+
* describing an edit, with no edit behind it.
|
|
94
|
+
*
|
|
95
|
+
* The second answer asks for its own working, and the wave that armed this is
|
|
96
|
+
* why. The run this module was built from was bounced off a fabricated
|
|
97
|
+
* completion and answered with "No change is needed", from a run that had made
|
|
98
|
+
* *one* call in its whole life. Nothing is gated on the answer — the harness
|
|
99
|
+
* cannot know whether the claim is true, and grading it would be the harness
|
|
100
|
+
* deciding the task — but the sentence no longer hands the exit over for free:
|
|
101
|
+
* a run that concluded the repository is already correct concluded it from
|
|
102
|
+
* something, and saying what that was costs a truthful run nothing and costs a
|
|
103
|
+
* run that checked nothing the whole answer.
|
|
104
|
+
*
|
|
105
|
+
* It also says plainly that nothing makes the change for the run, and that the
|
|
106
|
+
* next answer stands. Anything softer invites a re-submission of the same
|
|
107
|
+
* frame; anything harder would be the harness grading the run's conclusion.
|
|
108
|
+
*
|
|
109
|
+
* @category constructors
|
|
110
|
+
* @since 0.1.0
|
|
111
|
+
*/
|
|
112
|
+
export declare const demand: (found: Unmoved) => string;
|
|
113
|
+
//# sourceMappingURL=UnmovedTree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnmovedTree.d.ts","sourceRoot":"","sources":["../../src/UnmovedTree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAIH;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACtB,0DAA0D;IAC1D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,uEAAuE;IACvE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,IAAI,GAAI,SAAS;IAC5B,2EAA2E;IAC3E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,wEAAwE;IACxE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB;;;;;;;;OAQG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACxC,KAAG,OAAO,GAAG,SAI0C,CAAA;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,MAAM,GAAI,OAAO,OAAO,KAAG,MAAwD,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var UnmovedTree_exports = {};
|
|
30
|
+
__export(UnmovedTree_exports, {
|
|
31
|
+
demand: () => demand,
|
|
32
|
+
find: () => find
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(UnmovedTree_exports);
|
|
35
|
+
var DemandText = __toESM(require("./internal/demandText.js"), 1);
|
|
36
|
+
const find = (options) => options.opened === "" || options.digest === "" || options.opened !== options.digest || (options.elsewhere ?? 0) > 0 ? void 0 : { opened: options.opened, closed: options.digest };
|
|
37
|
+
const demand = (found) => DemandText.unmoved(found.opened, found.closed);
|
|
38
|
+
//# sourceMappingURL=UnmovedTree.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/UnmovedTree.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * The completion with nothing behind it.\n *\n * A run finishes by claiming its work is done. Every other control in this\n * package asks whether the *evidence* for that claim holds up. This one asks a\n * question that comes before evidence: is there anything for the evidence to be\n * about. A run that has not changed the workspace at any point in its life has\n * produced nothing, and a sentence describing a change it did not make is not a\n * result \u2014 it is a description of one.\n *\n * It is not hypothetical. On a graded benchmark one instance ran seven frames,\n * issued eleven flow calls \u2014 three `read`, seven `grep`, one `bash` \u2014 made no\n * editing call of any kind, and closed all seven frames on the identical\n * workspace digest the run had opened on. It then completed with \"Updated\n * `AdminSite.catch_all_view()` to preserve query strings when `APPEND_SLASH`\n * redirects add a trailing slash.\" The captured patch was zero bytes. The same\n * instance had resolved in five frames one wave earlier.\n *\n * Every armed control let that through, and each for a reason that was correct\n * about its own subject: the read-only cap is a stall detector and the run\n * finished below it, the narrowing demand judges the shape of a check and there\n * was no check to narrow, and the phantom-write veto vetoes a write that was\n * declared and did not happen \u2014 this run declared none. The harness held the\n * fact that decides it the whole time, in seven `mutation-observed` events on\n * one digest, and never consulted it at the `complete` transition.\n *\n * The comparison is between two measurements the harness already took: the\n * digest of the tree the run opened on, and the digest the completing frame\n * closed on. Equal digests mean the tree the completion describes is the tree\n * the run was handed. Nothing here reads the completion's text, and nothing\n * here decides whether the run was right: \"no change is needed\" is a legitimate\n * answer to a task, and the demand names it as one of the two ways out.\n *\n * @since 0.1.0\n */\n\nimport * as DemandText from \"./internal/demandText.ts\"\n\n/**\n * A completion taken over the tree the run was handed.\n *\n * @category models\n * @since 0.1.0\n */\nexport interface Unmoved {\n /** Content address of the workspace the run opened on. */\n readonly opened: string\n /** Content address of the workspace the completing frame closed on. */\n readonly closed: string\n}\n\n/**\n * Whether a completing frame is finishing on the tree the run started with.\n *\n * Both conditions are read off measurements the controller already took, and\n * both are required:\n *\n * 1. the run has an opening measurement that covered the whole tree, and the\n * completing frame closed on one \u2014 an incomplete walk cannot say a tree held\n * still, and an empty digest is recorded for exactly that case;\n * 2. the two digests are equal.\n *\n * Digest equality, rather than a count of frames that reported a mutation, is\n * what the demand's own sentence claims: that nothing in this workspace differs\n * from the tree the run opened on. That is true of a run that never wrote and\n * equally true of a run that wrote and undid it, and the sentence holds in both\n * cases. A run whose tree moved and stayed moved is not this failure, whatever\n * else may be wrong with it.\n *\n * @category conversions\n * @since 0.1.0\n */\nexport const find = (options: {\n /** The digest the run opened on; empty when the run never measured one. */\n readonly opened: string\n /** The digest the completing frame closed on; empty when unmeasured. */\n readonly digest: string\n /**\n * Writes this run recorded on trees the two digests do not cover.\n *\n * A `bash` call routed into a container measures that container's working\n * directory itself and reports a move under the reserved `mutated` key; the\n * host walk behind `opened` and `digest` never saw that tree. One such write\n * is the tree moving, and the two digests agreeing says nothing against it.\n * Absent or zero leaves the comparison exactly as it was.\n */\n readonly elsewhere?: number | undefined\n}): Unmoved | undefined =>\n options.opened === \"\" || options.digest === \"\" || options.opened !== options.digest ||\n (options.elsewhere ?? 0) > 0\n ? undefined\n : { opened: options.opened, closed: options.digest }\n\n/**\n * States that the tree never moved, and names the two answers that end it.\n *\n * The two ways out are stated as equals because they are equals. A task whose\n * right answer is \"nothing needs changing\" exists, and a run that reaches that\n * conclusion honestly must be able to say so and finish; a demand that only\n * accepted an edit would be pushing such a run into making one. What the demand\n * refuses is the third thing, which is what the recorded run did: a sentence\n * describing an edit, with no edit behind it.\n *\n * The second answer asks for its own working, and the wave that armed this is\n * why. The run this module was built from was bounced off a fabricated\n * completion and answered with \"No change is needed\", from a run that had made\n * *one* call in its whole life. Nothing is gated on the answer \u2014 the harness\n * cannot know whether the claim is true, and grading it would be the harness\n * deciding the task \u2014 but the sentence no longer hands the exit over for free:\n * a run that concluded the repository is already correct concluded it from\n * something, and saying what that was costs a truthful run nothing and costs a\n * run that checked nothing the whole answer.\n *\n * It also says plainly that nothing makes the change for the run, and that the\n * next answer stands. Anything softer invites a re-submission of the same\n * frame; anything harder would be the harness grading the run's conclusion.\n *\n * @category constructors\n * @since 0.1.0\n */\nexport const demand = (found: Unmoved): string => DemandText.unmoved(found.opened, found.closed)\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoCA,iBAA4B;AAoCrB,MAAM,OAAO,CAAC,YAgBnB,QAAQ,WAAW,MAAM,QAAQ,WAAW,MAAM,QAAQ,WAAW,QAAQ,WAC1E,QAAQ,aAAa,KAAK,IACzB,SACA,EAAE,QAAQ,QAAQ,QAAQ,QAAQ,QAAQ,OAAO;AA6BhD,MAAM,SAAS,CAAC,UAA2B,WAAW,QAAQ,MAAM,QAAQ,MAAM,MAAM;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|