@smthrs/std 0.0.0-stage → 1.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +130 -0
- package/LICENSE +21 -0
- package/README.md +152 -2
- package/dist/cjs/ApplyPatch.d.ts +174 -0
- package/dist/cjs/ApplyPatch.d.ts.map +1 -0
- package/dist/cjs/ApplyPatch.js +309 -0
- package/dist/cjs/ApplyPatch.js.map +7 -0
- package/dist/cjs/Bash.d.ts +380 -0
- package/dist/cjs/Bash.d.ts.map +1 -0
- package/dist/cjs/Bash.js +332 -0
- package/dist/cjs/Bash.js.map +7 -0
- package/dist/cjs/Checkpoints.d.ts +279 -0
- package/dist/cjs/Checkpoints.d.ts.map +1 -0
- package/dist/cjs/Checkpoints.js +145 -0
- package/dist/cjs/Checkpoints.js.map +7 -0
- package/dist/cjs/Container.d.ts +132 -0
- package/dist/cjs/Container.d.ts.map +1 -0
- package/dist/cjs/Container.js +113 -0
- package/dist/cjs/Container.js.map +7 -0
- package/dist/cjs/Edit.d.ts +203 -0
- package/dist/cjs/Edit.d.ts.map +1 -0
- package/dist/cjs/Edit.js +258 -0
- package/dist/cjs/Edit.js.map +7 -0
- package/dist/cjs/ExaWebSearch.d.ts +22 -0
- package/dist/cjs/ExaWebSearch.d.ts.map +1 -0
- package/dist/cjs/ExaWebSearch.js +138 -0
- package/dist/cjs/ExaWebSearch.js.map +7 -0
- package/dist/cjs/Explore.d.ts +328 -0
- package/dist/cjs/Explore.d.ts.map +1 -0
- package/dist/cjs/Explore.js +90 -0
- package/dist/cjs/Explore.js.map +7 -0
- package/dist/cjs/Fetch.d.ts +130 -0
- package/dist/cjs/Fetch.d.ts.map +1 -0
- package/dist/cjs/Fetch.js +64 -0
- package/dist/cjs/Fetch.js.map +7 -0
- package/dist/cjs/Glob.d.ts +204 -0
- package/dist/cjs/Glob.d.ts.map +1 -0
- package/dist/cjs/Glob.js +94 -0
- package/dist/cjs/Glob.js.map +7 -0
- package/dist/cjs/Grep.d.ts +347 -0
- package/dist/cjs/Grep.d.ts.map +1 -0
- package/dist/cjs/Grep.js +181 -0
- package/dist/cjs/Grep.js.map +7 -0
- package/dist/cjs/HttpPost.d.ts +130 -0
- package/dist/cjs/HttpPost.d.ts.map +1 -0
- package/dist/cjs/HttpPost.js +72 -0
- package/dist/cjs/HttpPost.js.map +7 -0
- package/dist/cjs/LanguageServer.d.ts +90 -0
- package/dist/cjs/LanguageServer.d.ts.map +1 -0
- package/dist/cjs/LanguageServer.js +60 -0
- package/dist/cjs/LanguageServer.js.map +7 -0
- package/dist/cjs/Ls.d.ts +164 -0
- package/dist/cjs/Ls.d.ts.map +1 -0
- package/dist/cjs/Ls.js +136 -0
- package/dist/cjs/Ls.js.map +7 -0
- package/dist/cjs/Lsp.d.ts +125 -0
- package/dist/cjs/Lsp.d.ts.map +1 -0
- package/dist/cjs/Lsp.js +137 -0
- package/dist/cjs/Lsp.js.map +7 -0
- package/dist/cjs/Manifest.d.ts +918 -0
- package/dist/cjs/Manifest.d.ts.map +1 -0
- package/dist/cjs/Manifest.js +144 -0
- package/dist/cjs/Manifest.js.map +7 -0
- package/dist/cjs/NativeSearch.d.ts +38 -0
- package/dist/cjs/NativeSearch.d.ts.map +1 -0
- package/dist/cjs/NativeSearch.js +326 -0
- package/dist/cjs/NativeSearch.js.map +7 -0
- package/dist/cjs/NodeLanguageServer.d.ts +128 -0
- package/dist/cjs/NodeLanguageServer.d.ts.map +1 -0
- package/dist/cjs/NodeLanguageServer.js +796 -0
- package/dist/cjs/NodeLanguageServer.js.map +7 -0
- package/dist/cjs/PortableSearch.d.ts +24 -0
- package/dist/cjs/PortableSearch.d.ts.map +1 -0
- package/dist/cjs/PortableSearch.js +233 -0
- package/dist/cjs/PortableSearch.js.map +7 -0
- package/dist/cjs/Probe.d.ts +193 -0
- package/dist/cjs/Probe.d.ts.map +1 -0
- package/dist/cjs/Probe.js +134 -0
- package/dist/cjs/Probe.js.map +7 -0
- package/dist/cjs/Read.d.ts +189 -0
- package/dist/cjs/Read.d.ts.map +1 -0
- package/dist/cjs/Read.js +223 -0
- package/dist/cjs/Read.js.map +7 -0
- package/dist/cjs/Relocate.d.ts +73 -0
- package/dist/cjs/Relocate.d.ts.map +1 -0
- package/dist/cjs/Relocate.js +72 -0
- package/dist/cjs/Relocate.js.map +7 -0
- package/dist/cjs/Search.d.ts +163 -0
- package/dist/cjs/Search.d.ts.map +1 -0
- package/dist/cjs/Search.js +51 -0
- package/dist/cjs/Search.js.map +7 -0
- package/dist/cjs/SearchConformance.d.ts +115 -0
- package/dist/cjs/SearchConformance.d.ts.map +1 -0
- package/dist/cjs/SearchConformance.js +172 -0
- package/dist/cjs/SearchConformance.js.map +7 -0
- package/dist/cjs/SearchContract.d.ts +114 -0
- package/dist/cjs/SearchContract.d.ts.map +1 -0
- package/dist/cjs/SearchContract.js +339 -0
- package/dist/cjs/SearchContract.js.map +7 -0
- package/dist/cjs/ShellCommand.d.ts +164 -0
- package/dist/cjs/ShellCommand.d.ts.map +1 -0
- package/dist/cjs/ShellCommand.js +102 -0
- package/dist/cjs/ShellCommand.js.map +7 -0
- package/dist/cjs/StdError.d.ts +55 -0
- package/dist/cjs/StdError.d.ts.map +1 -0
- package/dist/cjs/StdError.js +74 -0
- package/dist/cjs/StdError.js.map +7 -0
- package/dist/cjs/TestRun.d.ts +311 -0
- package/dist/cjs/TestRun.d.ts.map +1 -0
- package/dist/cjs/TestRun.js +228 -0
- package/dist/cjs/TestRun.js.map +7 -0
- package/dist/cjs/TestRunner.d.ts +102 -0
- package/dist/cjs/TestRunner.d.ts.map +1 -0
- package/dist/cjs/TestRunner.js +54 -0
- package/dist/cjs/TestRunner.js.map +7 -0
- package/dist/cjs/TreeFingerprint.d.ts +140 -0
- package/dist/cjs/TreeFingerprint.d.ts.map +1 -0
- package/dist/cjs/TreeFingerprint.js +87 -0
- package/dist/cjs/TreeFingerprint.js.map +7 -0
- package/dist/cjs/UpdatePlan.d.ts +152 -0
- package/dist/cjs/UpdatePlan.d.ts.map +1 -0
- package/dist/cjs/UpdatePlan.js +87 -0
- package/dist/cjs/UpdatePlan.js.map +7 -0
- package/dist/cjs/WebFetch.d.ts +134 -0
- package/dist/cjs/WebFetch.d.ts.map +1 -0
- package/dist/cjs/WebFetch.js +140 -0
- package/dist/cjs/WebFetch.js.map +7 -0
- package/dist/cjs/WebSearch.d.ts +181 -0
- package/dist/cjs/WebSearch.d.ts.map +1 -0
- package/dist/cjs/WebSearch.js +86 -0
- package/dist/cjs/WebSearch.js.map +7 -0
- package/dist/cjs/Write.d.ts +147 -0
- package/dist/cjs/Write.d.ts.map +1 -0
- package/dist/cjs/Write.js +122 -0
- package/dist/cjs/Write.js.map +7 -0
- package/dist/cjs/index.d.ts +127 -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/ApplyPatch.d.ts +145 -0
- package/dist/cjs/internal/ApplyPatch.d.ts.map +1 -0
- package/dist/cjs/internal/ApplyPatch.js +462 -0
- package/dist/cjs/internal/ApplyPatch.js.map +7 -0
- package/dist/cjs/internal/CodexText.d.ts +73 -0
- package/dist/cjs/internal/CodexText.d.ts.map +1 -0
- package/dist/cjs/internal/CodexText.js +108 -0
- package/dist/cjs/internal/CodexText.js.map +7 -0
- package/dist/cjs/internal/Declaration.d.ts +49 -0
- package/dist/cjs/internal/Declaration.d.ts.map +1 -0
- package/dist/cjs/internal/Declaration.js +46 -0
- package/dist/cjs/internal/Declaration.js.map +7 -0
- package/dist/cjs/internal/Diagnostics.d.ts +77 -0
- package/dist/cjs/internal/Diagnostics.d.ts.map +1 -0
- package/dist/cjs/internal/Diagnostics.js +89 -0
- package/dist/cjs/internal/Diagnostics.js.map +7 -0
- package/dist/cjs/internal/EnvelopePrecheck.d.ts +67 -0
- package/dist/cjs/internal/EnvelopePrecheck.d.ts.map +1 -0
- package/dist/cjs/internal/EnvelopePrecheck.js +124 -0
- package/dist/cjs/internal/EnvelopePrecheck.js.map +7 -0
- package/dist/cjs/internal/Exec.d.ts +139 -0
- package/dist/cjs/internal/Exec.d.ts.map +1 -0
- package/dist/cjs/internal/Exec.js +158 -0
- package/dist/cjs/internal/Exec.js.map +7 -0
- package/dist/cjs/internal/FileMutation.d.ts +109 -0
- package/dist/cjs/internal/FileMutation.d.ts.map +1 -0
- package/dist/cjs/internal/FileMutation.js +116 -0
- package/dist/cjs/internal/FileMutation.js.map +7 -0
- package/dist/cjs/internal/FsFailure.d.ts +38 -0
- package/dist/cjs/internal/FsFailure.d.ts.map +1 -0
- package/dist/cjs/internal/FsFailure.js +40 -0
- package/dist/cjs/internal/FsFailure.js.map +7 -0
- package/dist/cjs/internal/GitWorktree.d.ts +108 -0
- package/dist/cjs/internal/GitWorktree.d.ts.map +1 -0
- package/dist/cjs/internal/GitWorktree.js +276 -0
- package/dist/cjs/internal/GitWorktree.js.map +7 -0
- package/dist/cjs/internal/Grouping.d.ts +51 -0
- package/dist/cjs/internal/Grouping.d.ts.map +1 -0
- package/dist/cjs/internal/Grouping.js +83 -0
- package/dist/cjs/internal/Grouping.js.map +7 -0
- package/dist/cjs/internal/Html.d.ts +20 -0
- package/dist/cjs/internal/Html.d.ts.map +1 -0
- package/dist/cjs/internal/Html.js +81 -0
- package/dist/cjs/internal/Html.js.map +7 -0
- package/dist/cjs/internal/Http.d.ts +95 -0
- package/dist/cjs/internal/Http.d.ts.map +1 -0
- package/dist/cjs/internal/Http.js +153 -0
- package/dist/cjs/internal/Http.js.map +7 -0
- package/dist/cjs/internal/HttpNetwork.d.ts +27 -0
- package/dist/cjs/internal/HttpNetwork.d.ts.map +1 -0
- package/dist/cjs/internal/HttpNetwork.js +146 -0
- package/dist/cjs/internal/HttpNetwork.js.map +7 -0
- package/dist/cjs/internal/Ignore.d.ts +37 -0
- package/dist/cjs/internal/Ignore.d.ts.map +1 -0
- package/dist/cjs/internal/Ignore.js +100 -0
- package/dist/cjs/internal/Ignore.js.map +7 -0
- package/dist/cjs/internal/LinearRegex.d.ts +19 -0
- package/dist/cjs/internal/LinearRegex.d.ts.map +1 -0
- package/dist/cjs/internal/LinearRegex.js +166 -0
- package/dist/cjs/internal/LinearRegex.js.map +7 -0
- package/dist/cjs/internal/Match.d.ts +85 -0
- package/dist/cjs/internal/Match.d.ts.map +1 -0
- package/dist/cjs/internal/Match.js +99 -0
- package/dist/cjs/internal/Match.js.map +7 -0
- package/dist/cjs/internal/Paths.d.ts +23 -0
- package/dist/cjs/internal/Paths.d.ts.map +1 -0
- package/dist/cjs/internal/Paths.js +52 -0
- package/dist/cjs/internal/Paths.js.map +7 -0
- package/dist/cjs/internal/Preserve.d.ts +25 -0
- package/dist/cjs/internal/Preserve.d.ts.map +1 -0
- package/dist/cjs/internal/Preserve.js +88 -0
- package/dist/cjs/internal/Preserve.js.map +7 -0
- package/dist/cjs/internal/Prune.d.ts +35 -0
- package/dist/cjs/internal/Prune.d.ts.map +1 -0
- package/dist/cjs/internal/Prune.js +54 -0
- package/dist/cjs/internal/Prune.js.map +7 -0
- package/dist/cjs/internal/SearchContract.d.ts +63 -0
- package/dist/cjs/internal/SearchContract.d.ts.map +1 -0
- package/dist/cjs/internal/SearchContract.js +46 -0
- package/dist/cjs/internal/SearchContract.js.map +7 -0
- package/dist/cjs/internal/Symbols.d.ts +39 -0
- package/dist/cjs/internal/Symbols.d.ts.map +1 -0
- package/dist/cjs/internal/Symbols.js +59 -0
- package/dist/cjs/internal/Symbols.js.map +7 -0
- package/dist/cjs/internal/TestReport.d.ts +52 -0
- package/dist/cjs/internal/TestReport.d.ts.map +1 -0
- package/dist/cjs/internal/TestReport.js +131 -0
- package/dist/cjs/internal/TestReport.js.map +7 -0
- package/dist/cjs/internal/Text.d.ts +114 -0
- package/dist/cjs/internal/Text.d.ts.map +1 -0
- package/dist/cjs/internal/Text.js +82 -0
- package/dist/cjs/internal/Text.js.map +7 -0
- package/dist/cjs/internal/Url.d.ts +13 -0
- package/dist/cjs/internal/Url.d.ts.map +1 -0
- package/dist/cjs/internal/Url.js +35 -0
- package/dist/cjs/internal/Url.js.map +7 -0
- package/dist/cjs/internal/Walk.d.ts +72 -0
- package/dist/cjs/internal/Walk.d.ts.map +1 -0
- package/dist/cjs/internal/Walk.js +108 -0
- package/dist/cjs/internal/Walk.js.map +7 -0
- package/dist/cjs/package.json +1 -0
- package/dist/esm/ApplyPatch.d.ts +174 -0
- package/dist/esm/ApplyPatch.d.ts.map +1 -0
- package/dist/esm/ApplyPatch.js +346 -0
- package/dist/esm/ApplyPatch.js.map +1 -0
- package/dist/esm/Bash.d.ts +380 -0
- package/dist/esm/Bash.d.ts.map +1 -0
- package/dist/esm/Bash.js +505 -0
- package/dist/esm/Bash.js.map +1 -0
- package/dist/esm/Checkpoints.d.ts +279 -0
- package/dist/esm/Checkpoints.d.ts.map +1 -0
- package/dist/esm/Checkpoints.js +298 -0
- package/dist/esm/Checkpoints.js.map +1 -0
- package/dist/esm/Container.d.ts +132 -0
- package/dist/esm/Container.d.ts.map +1 -0
- package/dist/esm/Container.js +151 -0
- package/dist/esm/Container.js.map +1 -0
- package/dist/esm/Edit.d.ts +203 -0
- package/dist/esm/Edit.d.ts.map +1 -0
- package/dist/esm/Edit.js +296 -0
- package/dist/esm/Edit.js.map +1 -0
- package/dist/esm/ExaWebSearch.d.ts +22 -0
- package/dist/esm/ExaWebSearch.d.ts.map +1 -0
- package/dist/esm/ExaWebSearch.js +107 -0
- package/dist/esm/ExaWebSearch.js.map +1 -0
- package/dist/esm/Explore.d.ts +328 -0
- package/dist/esm/Explore.d.ts.map +1 -0
- package/dist/esm/Explore.js +106 -0
- package/dist/esm/Explore.js.map +1 -0
- package/dist/esm/Fetch.d.ts +130 -0
- package/dist/esm/Fetch.d.ts.map +1 -0
- package/dist/esm/Fetch.js +91 -0
- package/dist/esm/Fetch.js.map +1 -0
- package/dist/esm/Glob.d.ts +204 -0
- package/dist/esm/Glob.d.ts.map +1 -0
- package/dist/esm/Glob.js +177 -0
- package/dist/esm/Glob.js.map +1 -0
- package/dist/esm/Grep.d.ts +347 -0
- package/dist/esm/Grep.d.ts.map +1 -0
- package/dist/esm/Grep.js +289 -0
- package/dist/esm/Grep.js.map +1 -0
- package/dist/esm/HttpPost.d.ts +130 -0
- package/dist/esm/HttpPost.d.ts.map +1 -0
- package/dist/esm/HttpPost.js +89 -0
- package/dist/esm/HttpPost.js.map +1 -0
- package/dist/esm/LanguageServer.d.ts +90 -0
- package/dist/esm/LanguageServer.d.ts.map +1 -0
- package/dist/esm/LanguageServer.js +57 -0
- package/dist/esm/LanguageServer.js.map +1 -0
- package/dist/esm/Ls.d.ts +164 -0
- package/dist/esm/Ls.d.ts.map +1 -0
- package/dist/esm/Ls.js +178 -0
- package/dist/esm/Ls.js.map +1 -0
- package/dist/esm/Lsp.d.ts +125 -0
- package/dist/esm/Lsp.d.ts.map +1 -0
- package/dist/esm/Lsp.js +165 -0
- package/dist/esm/Lsp.js.map +1 -0
- package/dist/esm/Manifest.d.ts +918 -0
- package/dist/esm/Manifest.d.ts.map +1 -0
- package/dist/esm/Manifest.js +153 -0
- package/dist/esm/Manifest.js.map +1 -0
- package/dist/esm/NativeSearch.d.ts +38 -0
- package/dist/esm/NativeSearch.d.ts.map +1 -0
- package/dist/esm/NativeSearch.js +378 -0
- package/dist/esm/NativeSearch.js.map +1 -0
- package/dist/esm/NodeLanguageServer.d.ts +128 -0
- package/dist/esm/NodeLanguageServer.d.ts.map +1 -0
- package/dist/esm/NodeLanguageServer.js +843 -0
- package/dist/esm/NodeLanguageServer.js.map +1 -0
- package/dist/esm/PortableSearch.d.ts +24 -0
- package/dist/esm/PortableSearch.d.ts.map +1 -0
- package/dist/esm/PortableSearch.js +240 -0
- package/dist/esm/PortableSearch.js.map +1 -0
- package/dist/esm/Probe.d.ts +193 -0
- package/dist/esm/Probe.d.ts.map +1 -0
- package/dist/esm/Probe.js +225 -0
- package/dist/esm/Probe.js.map +1 -0
- package/dist/esm/Read.d.ts +189 -0
- package/dist/esm/Read.d.ts.map +1 -0
- package/dist/esm/Read.js +300 -0
- package/dist/esm/Read.js.map +1 -0
- package/dist/esm/Relocate.d.ts +73 -0
- package/dist/esm/Relocate.d.ts.map +1 -0
- package/dist/esm/Relocate.js +153 -0
- package/dist/esm/Relocate.js.map +1 -0
- package/dist/esm/Search.d.ts +163 -0
- package/dist/esm/Search.d.ts.map +1 -0
- package/dist/esm/Search.js +47 -0
- package/dist/esm/Search.js.map +1 -0
- package/dist/esm/SearchConformance.d.ts +115 -0
- package/dist/esm/SearchConformance.d.ts.map +1 -0
- package/dist/esm/SearchConformance.js +193 -0
- package/dist/esm/SearchConformance.js.map +1 -0
- package/dist/esm/SearchContract.d.ts +114 -0
- package/dist/esm/SearchContract.d.ts.map +1 -0
- package/dist/esm/SearchContract.js +461 -0
- package/dist/esm/SearchContract.js.map +1 -0
- package/dist/esm/ShellCommand.d.ts +164 -0
- package/dist/esm/ShellCommand.d.ts.map +1 -0
- package/dist/esm/ShellCommand.js +159 -0
- package/dist/esm/ShellCommand.js.map +1 -0
- package/dist/esm/StdError.d.ts +55 -0
- package/dist/esm/StdError.d.ts.map +1 -0
- package/dist/esm/StdError.js +71 -0
- package/dist/esm/StdError.js.map +1 -0
- package/dist/esm/TestRun.d.ts +311 -0
- package/dist/esm/TestRun.d.ts.map +1 -0
- package/dist/esm/TestRun.js +316 -0
- package/dist/esm/TestRun.js.map +1 -0
- package/dist/esm/TestRunner.d.ts +102 -0
- package/dist/esm/TestRunner.d.ts.map +1 -0
- package/dist/esm/TestRunner.js +68 -0
- package/dist/esm/TestRunner.js.map +1 -0
- package/dist/esm/TreeFingerprint.d.ts +140 -0
- package/dist/esm/TreeFingerprint.d.ts.map +1 -0
- package/dist/esm/TreeFingerprint.js +170 -0
- package/dist/esm/TreeFingerprint.js.map +1 -0
- package/dist/esm/UpdatePlan.d.ts +152 -0
- package/dist/esm/UpdatePlan.d.ts.map +1 -0
- package/dist/esm/UpdatePlan.js +129 -0
- package/dist/esm/UpdatePlan.js.map +1 -0
- package/dist/esm/WebFetch.d.ts +134 -0
- package/dist/esm/WebFetch.d.ts.map +1 -0
- package/dist/esm/WebFetch.js +151 -0
- package/dist/esm/WebFetch.js.map +1 -0
- package/dist/esm/WebSearch.d.ts +181 -0
- package/dist/esm/WebSearch.d.ts.map +1 -0
- package/dist/esm/WebSearch.js +134 -0
- package/dist/esm/WebSearch.js.map +1 -0
- package/dist/esm/Write.d.ts +147 -0
- package/dist/esm/Write.d.ts.map +1 -0
- package/dist/esm/Write.js +144 -0
- package/dist/esm/Write.js.map +1 -0
- package/dist/esm/index.d.ts +127 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +127 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/internal/ApplyPatch.d.ts +145 -0
- package/dist/esm/internal/ApplyPatch.d.ts.map +1 -0
- package/dist/esm/internal/ApplyPatch.js +489 -0
- package/dist/esm/internal/ApplyPatch.js.map +1 -0
- package/dist/esm/internal/CodexText.d.ts +73 -0
- package/dist/esm/internal/CodexText.d.ts.map +1 -0
- package/dist/esm/internal/CodexText.js +156 -0
- package/dist/esm/internal/CodexText.js.map +1 -0
- package/dist/esm/internal/Declaration.d.ts +49 -0
- package/dist/esm/internal/Declaration.d.ts.map +1 -0
- package/dist/esm/internal/Declaration.js +42 -0
- package/dist/esm/internal/Declaration.js.map +1 -0
- package/dist/esm/internal/Diagnostics.d.ts +77 -0
- package/dist/esm/internal/Diagnostics.d.ts.map +1 -0
- package/dist/esm/internal/Diagnostics.js +99 -0
- package/dist/esm/internal/Diagnostics.js.map +1 -0
- package/dist/esm/internal/EnvelopePrecheck.d.ts +67 -0
- package/dist/esm/internal/EnvelopePrecheck.d.ts.map +1 -0
- package/dist/esm/internal/EnvelopePrecheck.js +167 -0
- package/dist/esm/internal/EnvelopePrecheck.js.map +1 -0
- package/dist/esm/internal/Exec.d.ts +139 -0
- package/dist/esm/internal/Exec.d.ts.map +1 -0
- package/dist/esm/internal/Exec.js +193 -0
- package/dist/esm/internal/Exec.js.map +1 -0
- package/dist/esm/internal/FileMutation.d.ts +109 -0
- package/dist/esm/internal/FileMutation.d.ts.map +1 -0
- package/dist/esm/internal/FileMutation.js +123 -0
- package/dist/esm/internal/FileMutation.js.map +1 -0
- package/dist/esm/internal/FsFailure.d.ts +38 -0
- package/dist/esm/internal/FsFailure.d.ts.map +1 -0
- package/dist/esm/internal/FsFailure.js +39 -0
- package/dist/esm/internal/FsFailure.js.map +1 -0
- package/dist/esm/internal/GitWorktree.d.ts +108 -0
- package/dist/esm/internal/GitWorktree.d.ts.map +1 -0
- package/dist/esm/internal/GitWorktree.js +352 -0
- package/dist/esm/internal/GitWorktree.js.map +1 -0
- package/dist/esm/internal/Grouping.d.ts +51 -0
- package/dist/esm/internal/Grouping.d.ts.map +1 -0
- package/dist/esm/internal/Grouping.js +99 -0
- package/dist/esm/internal/Grouping.js.map +1 -0
- package/dist/esm/internal/Html.d.ts +20 -0
- package/dist/esm/internal/Html.d.ts.map +1 -0
- package/dist/esm/internal/Html.js +70 -0
- package/dist/esm/internal/Html.js.map +1 -0
- package/dist/esm/internal/Http.d.ts +95 -0
- package/dist/esm/internal/Http.d.ts.map +1 -0
- package/dist/esm/internal/Http.js +154 -0
- package/dist/esm/internal/Http.js.map +1 -0
- package/dist/esm/internal/HttpNetwork.d.ts +27 -0
- package/dist/esm/internal/HttpNetwork.d.ts.map +1 -0
- package/dist/esm/internal/HttpNetwork.js +114 -0
- package/dist/esm/internal/HttpNetwork.js.map +1 -0
- package/dist/esm/internal/Ignore.d.ts +37 -0
- package/dist/esm/internal/Ignore.d.ts.map +1 -0
- package/dist/esm/internal/Ignore.js +128 -0
- package/dist/esm/internal/Ignore.js.map +1 -0
- package/dist/esm/internal/LinearRegex.d.ts +19 -0
- package/dist/esm/internal/LinearRegex.d.ts.map +1 -0
- package/dist/esm/internal/LinearRegex.js +176 -0
- package/dist/esm/internal/LinearRegex.js.map +1 -0
- package/dist/esm/internal/Match.d.ts +85 -0
- package/dist/esm/internal/Match.d.ts.map +1 -0
- package/dist/esm/internal/Match.js +142 -0
- package/dist/esm/internal/Match.js.map +1 -0
- package/dist/esm/internal/Paths.d.ts +23 -0
- package/dist/esm/internal/Paths.d.ts.map +1 -0
- package/dist/esm/internal/Paths.js +40 -0
- package/dist/esm/internal/Paths.js.map +1 -0
- package/dist/esm/internal/Preserve.d.ts +25 -0
- package/dist/esm/internal/Preserve.d.ts.map +1 -0
- package/dist/esm/internal/Preserve.js +70 -0
- package/dist/esm/internal/Preserve.js.map +1 -0
- package/dist/esm/internal/Prune.d.ts +35 -0
- package/dist/esm/internal/Prune.d.ts.map +1 -0
- package/dist/esm/internal/Prune.js +60 -0
- package/dist/esm/internal/Prune.js.map +1 -0
- package/dist/esm/internal/SearchContract.d.ts +63 -0
- package/dist/esm/internal/SearchContract.d.ts.map +1 -0
- package/dist/esm/internal/SearchContract.js +66 -0
- package/dist/esm/internal/SearchContract.js.map +1 -0
- package/dist/esm/internal/Symbols.d.ts +39 -0
- package/dist/esm/internal/Symbols.d.ts.map +1 -0
- package/dist/esm/internal/Symbols.js +79 -0
- package/dist/esm/internal/Symbols.js.map +1 -0
- package/dist/esm/internal/TestReport.d.ts +52 -0
- package/dist/esm/internal/TestReport.d.ts.map +1 -0
- package/dist/esm/internal/TestReport.js +172 -0
- package/dist/esm/internal/TestReport.js.map +1 -0
- package/dist/esm/internal/Text.d.ts +114 -0
- package/dist/esm/internal/Text.d.ts.map +1 -0
- package/dist/esm/internal/Text.js +130 -0
- package/dist/esm/internal/Text.js.map +1 -0
- package/dist/esm/internal/Url.d.ts +13 -0
- package/dist/esm/internal/Url.d.ts.map +1 -0
- package/dist/esm/internal/Url.js +27 -0
- package/dist/esm/internal/Url.js.map +1 -0
- package/dist/esm/internal/Walk.d.ts +72 -0
- package/dist/esm/internal/Walk.d.ts.map +1 -0
- package/dist/esm/internal/Walk.js +126 -0
- package/dist/esm/internal/Walk.js.map +1 -0
- package/docs/README.md +117 -0
- package/docs/api.md +472 -0
- package/docs/concepts/effects-and-capabilities.md +136 -0
- package/docs/concepts/flows-and-handlers.md +115 -0
- package/docs/concepts/limits-and-disclosure.md +102 -0
- package/docs/concepts/search-contract.md +182 -0
- package/docs/guides/bind-the-standard-flows.md +114 -0
- package/docs/guides/implement-a-search-peer.md +133 -0
- package/docs/guides/pin-a-checkpoint.md +141 -0
- package/docs/guides/query-a-language-server.md +257 -0
- package/docs/guides/reach-the-network.md +141 -0
- package/docs/guides/read-and-edit-a-file.md +240 -0
- package/docs/guides/run-a-shell-command.md +215 -0
- package/docs/guides/run-the-test-suite.md +154 -0
- package/docs/guides/search-a-workspace.md +148 -0
- package/docs/installation.md +111 -0
- package/docs/quickstart.md +125 -0
- package/docs/reference/flows.md +556 -0
- package/docs/troubleshooting.md +322 -0
- package/package.json +439 -3
- package/src/ApplyPatch.ts +458 -0
- package/src/Bash.ts +607 -0
- package/src/Checkpoints.ts +422 -0
- package/src/Container.ts +212 -0
- package/src/Edit.ts +366 -0
- package/src/ExaWebSearch.ts +145 -0
- package/src/Explore.ts +139 -0
- package/src/Fetch.ts +117 -0
- package/src/Glob.ts +200 -0
- package/src/Grep.ts +320 -0
- package/src/HttpPost.ts +120 -0
- package/src/LanguageServer.ts +110 -0
- package/src/Ls.ts +228 -0
- package/src/Lsp.ts +184 -0
- package/src/Manifest.ts +162 -0
- package/src/NativeSearch.ts +457 -0
- package/src/NodeLanguageServer.ts +1148 -0
- package/src/PortableSearch.ts +264 -0
- package/src/Probe.ts +284 -0
- package/src/Read.ts +359 -0
- package/src/Relocate.ts +166 -0
- package/src/Search.ts +185 -0
- package/src/SearchConformance.ts +288 -0
- package/src/SearchContract.ts +489 -0
- package/src/ShellCommand.ts +201 -0
- package/src/StdError.ts +80 -0
- package/src/TestRun.ts +401 -0
- package/src/TestRunner.ts +119 -0
- package/src/TreeFingerprint.ts +200 -0
- package/src/UpdatePlan.ts +171 -0
- package/src/WebFetch.ts +194 -0
- package/src/WebSearch.ts +165 -0
- package/src/Write.ts +195 -0
- package/src/index.ts +154 -0
- package/src/internal/ApplyPatch.ts +601 -0
- package/src/internal/CodexText.ts +182 -0
- package/src/internal/Declaration.ts +60 -0
- package/src/internal/Diagnostics.ts +134 -0
- package/src/internal/EnvelopePrecheck.ts +233 -0
- package/src/internal/Exec.ts +314 -0
- package/src/internal/FileMutation.ts +231 -0
- package/src/internal/FsFailure.ts +51 -0
- package/src/internal/GitWorktree.ts +491 -0
- package/src/internal/Grouping.ts +106 -0
- package/src/internal/Html.ts +87 -0
- package/src/internal/Http.ts +209 -0
- package/src/internal/HttpNetwork.ts +153 -0
- package/src/internal/Ignore.ts +135 -0
- package/src/internal/LinearRegex.ts +173 -0
- package/src/internal/Match.ts +172 -0
- package/src/internal/Paths.ts +42 -0
- package/src/internal/Preserve.ts +108 -0
- package/src/internal/Prune.ts +62 -0
- package/src/internal/SearchContract.ts +77 -0
- package/src/internal/Symbols.ts +88 -0
- package/src/internal/TestReport.ts +194 -0
- package/src/internal/Text.ts +170 -0
- package/src/internal/Url.ts +23 -0
- package/src/internal/Walk.ts +176 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TestRun.js","sourceRoot":"","sources":["../../src/TestRun.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAIH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,IAAI,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAA;AAC5C,OAAO,KAAK,UA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;QAClB,IAAI,EAAE,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;QACjE,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;KAChD,CAAA;AACH,CAAC,CAAC,CAAA","sourcesContent":["/**\n * The `test` flow: run the declared suite, and answer with the two facts.\n *\n * Two things this returns that a shell command cannot. First, a *reading*:\n * `{passed, failed}` parsed from the runner's own report, with the raw tail\n * kept for whatever the parse could not carry — a suite's answer is a number\n * and a list of names, not twenty kilobytes of stdout for a model to re-read.\n *\n * Second, `against: \"base\"`: the same selection also runs against the pristine\n * base commit in a scratch checkout, and the two failure sets are differenced\n * here. That is the whole of attribution, in one call. Without it, agents pay\n * for it in frames — sphinx-8721 spent fourteen frames because a pre-existing\n * failure was never baselined, sympy-13878 spent $0.90 on the same mistake, and\n * django-24970 spent three frames. The rule the harness teaches (\"before\n * blaming your own edit, run the same command on the unmodified tree\") is only\n * cheap when the tool can do it.\n *\n * A third thing is answered on the way out: whether a non-zero exit is the\n * tree's failure at all, or the command failing to resolve a name. Jev decides\n * it through `Probe.classify`, so the flow needs an `Evaluator` and a host\n * uses its configured subscription seat. A judge that does not answer fails the call with\n * the code `Probe.unjudged` names, because a run nobody judged is not a run\n * this flow can report on.\n *\n * @since 1.0.0\n */\n\nimport type * as ChildProcessSpawner from \"@smthrs/kernel/ChildProcessSpawner\"\nimport type * as Evaluator from \"@smthrs/model/Evaluator\"\nimport * as Effect from \"effect/Effect\"\nimport * as Option from \"effect/Option\"\nimport * as Schema from \"effect/Schema\"\nimport * as Container from \"./Container.ts\"\nimport { capability, envelope } from \"./internal/Declaration.ts\"\nimport * as Exec from \"./internal/Exec.ts\"\nimport { GitWorktree } from \"./internal/GitWorktree.ts\"\nimport * as Prune from \"./internal/Prune.ts\"\nimport * as TestReport from \"./internal/TestReport.ts\"\nimport { MAX_SHELL_OUTPUT_BYTES, truncateBytes } from \"./internal/Text.ts\"\nimport * as Probe from \"./Probe.ts\"\nimport * as StdError from \"./StdError.ts\"\nimport * as TestRunner from \"./TestRunner.ts\"\n\n/**\n * Registry name for the test flow.\n *\n * @category identifiers\n * @since 1.0.0\n */\nexport const name = \"test\"\n\n/**\n * Model-facing description of the test flow.\n *\n * @category descriptions\n * @since 1.0.0\n */\nexport const description =\n \"Run this repository's declared test runner and get {passed, failed[ids]}, not raw output. against:'base' also runs it on the pristine base commit, so a pre-existing failure is named, not investigated.\"\n\n/**\n * The parent directory baseline checkouts are written into, relative to the\n * repository root, and therefore also relative to the runner's own directory.\n *\n * @category constants\n * @since 1.0.0\n */\nexport const scratchDirectory = Prune.testBaseScratch\n\n/**\n * Default wall-clock budget for one test run.\n *\n * @category constants\n * @since 1.0.0\n */\nexport const DEFAULT_TIMEOUT_MS = 600_000\n\n/**\n * Maximum bytes retained from each stream while a test run executes.\n *\n * @category constants\n * @since 1.0.0\n */\nexport const MAX_CAPTURE_BYTES = 8_000_000\n\n/**\n * Input schema for the test flow.\n *\n * @category schemas\n * @since 1.0.0\n */\nexport const Input = Schema.Struct({\n selection: Schema.optional(Schema.Array(Schema.String)).annotate({\n description: \"Test ids, paths or selectors passed to the runner as arguments; all tests when omitted\"\n }),\n against: Schema.optional(Schema.Literals([\"workspace\", \"base\"])).annotate({\n description:\n \"workspace (default) runs the tree as it stands; base also runs the pristine base commit and reports which failures are new\"\n }),\n timeoutMs: Schema.optional(Schema.Number).annotate({ description: \"Wall-clock timeout in milliseconds\" })\n})\n\n/**\n * Decoded input accepted by the `test` flow.\n *\n * @category models\n * @since 1.0.0\n */\nexport type Input = typeof Input.Type\n\n/**\n * One run's outcome.\n *\n * @category schemas\n * @since 1.0.0\n */\nexport const Outcome = Schema.Struct({\n command: Schema.String.annotate({\n description: \"The logical invocation that ran, without container transport arguments\"\n }),\n exitCode: Schema.Number,\n passed: Schema.Number.annotate({ description: \"Tests reported passing; 0 when parsed is false\" }),\n failed: Schema.Array(Schema.String).annotate({ description: \"Ids of the tests reported failing or erroring\" }),\n parsed: Schema.Boolean.annotate({\n description:\n \"Whether the runner's complete report could be read; when false, tail is all there is. Base attribution is omitted unless both reports are complete\"\n }),\n tail: Schema.String.annotate({ description: \"The end of the runner's combined output\" }),\n // `<field>Truncated` beside `<field>` is the wire convention\n // `@smthrs/harness/TruncatedOutput` reads to refuse a later write of these\n // exact bytes. A tail written over a file replaces it with its own end.\n tailTruncated: Schema.Boolean.annotate({\n description: \"Whether the runner printed more than tail carries, leaving tail a fragment that must not be written\"\n }),\n tailDroppedBytes: Schema.Number.annotate({ description: \"UTF-8 bytes omitted from the start of tail\" }),\n invalidProbe: Schema.optional(Probe.InvalidProbe)\n})\n\n/**\n * Output schema for the test flow.\n *\n * @category schemas\n * @since 1.0.0\n */\nexport const Output = Schema.Struct({\n ...Outcome.fields,\n base: Schema.optional(Schema.Struct({\n ...Outcome.fields,\n ref: Schema.String.annotate({ description: \"The ref the baseline tree came from\" }),\n commit: Schema.String.annotate({ description: \"The commit the baseline tree came from\" })\n })),\n introduced: Schema.optional(Schema.Array(Schema.String)).annotate({\n description: \"Failing here and not on the base tree: the failures this working tree is responsible for\"\n }),\n preexisting: Schema.optional(Schema.Array(Schema.String)).annotate({\n description: \"Failing on both trees: not yours, and not worth investigating\"\n }),\n fixed: Schema.optional(Schema.Array(Schema.String)).annotate({\n description: \"Failing on the base tree and passing here\"\n })\n})\n\n/**\n * Decoded output returned by the `test` flow.\n *\n * @category models\n * @since 1.0.0\n */\nexport type Output = typeof Output.Type\n\n/**\n * Static conservative effect envelope for the test flow.\n *\n * @category effects\n * @since 1.0.0\n */\nexport const effects = envelope({ tier: \"irreversible\", mode: \"expected\", reads: [], writes: [] })\n\n/**\n * Narrows the effect envelope for a decoded invocation.\n *\n * @category effects\n * @since 1.0.0\n */\nexport const effectsFor = (_input: typeof Input.Type) => effects\n\n/**\n * Capabilities required by the test flow.\n *\n * @category capabilities\n * @since 1.0.0\n */\nexport const capabilities = [capability(\"proc:spawn\", \"*\")]\n\n/**\n * Declaration-only test flow.\n *\n * @category flows\n * @since 1.0.0\n */\nexport const flow = { name, description, input: Input, output: Output, capabilities, effects } as const\n\n/**\n * What a call to this flow does, for a reader of a run.\n *\n * Display metadata only. `@smthrs/registry` `Descriptor.FlowActivity` is the\n * governing vocabulary and `StandardFlows` binds this value onto the flow's\n * descriptor, where the binding site checks it. `declarationDigest` excludes\n * it, so declaring it cannot invalidate a call identity or a cached prompt.\n *\n * @category presentation\n * @since 1.0.0-rc.0\n */\nexport const activity = \"tests\" as const\n\n/**\n * How one recorded call to this flow reads: the verb for each settlement, the\n * input field that is its subject, and the measured output fields a one-line\n * summary may count.\n *\n * Display metadata only, governed by `@smthrs/registry`\n * `Descriptor.CallPresentation` and checked where `StandardFlows` binds it.\n *\n * @category presentation\n * @since 1.0.0-rc.0\n */\nexport const presentation = {\n verb: { pending: \"running\", success: \"ran\", failure: \"failed to run\" },\n subject: \"selection\",\n result: \"tests\"\n} as const\n\n/**\n * The invocation for one run: the declared command line with the selection\n * appended as arguments rather than as text.\n *\n * `bash -c '<command> \"$@\"' <command> id…` is how a selection reaches a runner\n * without being quoted into it. A test id holds `::`, `[`, `]`, spaces and\n * shell metacharacters routinely, and every one of them is data here.\n */\nconst invocation = (\n runner: TestRunner.Runner,\n selection: ReadonlyArray<string>\n): { readonly file: string; readonly args: ReadonlyArray<string> } => ({\n file: \"bash\",\n args: [\"-c\", `${runner.command} \"$@\"`, runner.command, ...selection]\n})\n\nconst failed = (message: string, code: StdError.Code = \"command_failed\"): StdError.StdError =>\n new StdError.StdError({ code, message })\n\n/** Runs one invocation, in the container when the declaration names one. */\nconst execute = (\n runner: TestRunner.Runner,\n transport: Option.Option<Container.Container>,\n options: {\n readonly selection: ReadonlyArray<string>\n readonly cwd: string | undefined\n readonly timeoutMs: number\n }\n): Effect.Effect<\n { readonly outcome: typeof Outcome.Type; readonly report: TestReport.Report },\n StdError.StdError,\n ChildProcessSpawner.ChildProcessSpawner | Evaluator.Evaluator\n> =>\n Effect.gen(function*() {\n const plan = invocation(runner, options.selection)\n const routed: Container.Plan = runner.container === undefined ?\n { ...plan, env: runner.env } :\n Option.isNone(transport)\n ? yield* Effect.fail(Container.unavailable(runner.container))\n : yield* transport.value.exec({\n container: runner.container,\n file: plan.file,\n args: plan.args,\n ...(options.cwd === undefined ? {} : { cwd: options.cwd }),\n ...(runner.env === undefined ? {} : { env: runner.env }),\n stdin: false\n })\n // Report the logical invocation, never the transport or its credentials.\n const quoted = [plan.file, ...plan.args].join(\" \")\n const result = yield* Exec.exec(routed.file, {\n args: [...routed.args],\n ...(options.cwd === undefined || runner.container !== undefined ? {} : { cwd: options.cwd }),\n ...(routed.env === undefined ? {} : { env: routed.env }),\n timeoutMs: options.timeoutMs,\n maxCaptureBytes: MAX_CAPTURE_BYTES\n }).pipe(\n Effect.mapError((error) =>\n new StdError.StdError({\n code: Exec.toStdErrorCode(error),\n message: `The test runner did not run: ${error.message}`,\n ...(error.limitMillis === undefined ? {} : { limitMillis: error.limitMillis })\n })\n )\n )\n const combined = result.stderr === \"\"\n ? result.stdout\n : result.stdout === \"\"\n ? result.stderr\n : `${result.stdout}\\n${result.stderr}`\n const tail = truncateBytes(combined, MAX_SHELL_OUTPUT_BYTES, { keep: \"tail\" })\n const report = TestReport.parse(combined)\n // Judged on the text this call returns rather than the text it captured,\n // so the attribution is made from the output the reader can see. A judge\n // that does not answer fails the call: see `Probe.unjudged`.\n const probe = yield* Probe.classify({\n command: quoted,\n exitCode: result.exitCode,\n output: tail.text\n }).pipe(Effect.mapError(Probe.unjudged))\n const capturedDroppedBytes = result.stdoutDroppedBytes + result.stderrDroppedBytes\n return {\n outcome: {\n command: quoted,\n exitCode: result.exitCode,\n passed: report.passed,\n failed: report.failed,\n parsed: report.parsed,\n tail: tail.text,\n tailTruncated: capturedDroppedBytes > 0 || tail.truncated,\n tailDroppedBytes: capturedDroppedBytes + tail.droppedBytes,\n ...(probe.invalidProbe === undefined ? {} : { invalidProbe: probe.invalidProbe })\n },\n report\n }\n })\n\n/**\n * Runs the declared suite, and on request the same suite on the pristine base.\n *\n * Baseline Git and both runners use the caller-provided process service.\n * A host that cannot safely stage the base declares `baseline: false`, which\n * refuses the request before running either suite or Git. Library hosts that\n * support staging remove the detached checkout when the call ends.\n *\n * @category handlers\n * @since 1.0.0\n */\nexport const run = Effect.fn(\"TestRun.run\")(function*(\n input: typeof Input.Type\n): Effect.fn.Return<\n typeof Output.Type,\n StdError.StdError,\n ChildProcessSpawner.ChildProcessSpawner | Evaluator.Evaluator | TestRunner.TestRunner\n> {\n const declaration = yield* TestRunner.TestRunner\n const runner = yield* declaration.declared\n if (input.against === \"base\" && runner.baseline === false) {\n return yield* Effect.fail(failed(\n \"Baseline comparison is unavailable on this host. Run against the workspace.\",\n \"provider_unavailable\"\n ))\n }\n const transport = yield* Effect.serviceOption(Container.Container)\n const selection = input.selection ?? []\n const timeoutMs = input.timeoutMs ?? runner.timeoutMs ?? DEFAULT_TIMEOUT_MS\n const current = yield* execute(runner, transport, {\n selection,\n cwd: runner.cwd,\n timeoutMs\n })\n if (input.against !== \"base\") return current.outcome\n\n const root = runner.root ?? runner.cwd\n if (root === undefined) {\n return yield* Effect.fail(\n failed(\n \"The declared runner names no repository directory, so there is no base tree to check out\",\n \"invalid_input\"\n )\n )\n }\n const base = yield* GitWorktree.resolveCommit(\n root,\n runner.baseRef === undefined ? [TestRunner.captureBase, \"HEAD\"] : [runner.baseRef]\n ).pipe(Effect.mapError((error) =>\n error.code === \"not_found\"\n ? failed(`No pristine base to compare against: ${error.message} Run against the workspace instead.`, \"not_found\")\n : error\n ))\n const baseline = yield* GitWorktree.withDetachedWorktree(\n root,\n `${scratchDirectory}/run`,\n base.commit,\n (scratch) =>\n execute(runner, transport, {\n selection,\n cwd: runner.cwd === undefined\n ? scratch\n : `${runner.cwd.replace(/\\/+$/, \"\")}${scratch.slice(root.replace(/\\/+$/, \"\").length)}`,\n timeoutMs\n })\n )\n const difference = TestReport.attribute(current.report, baseline.report)\n return {\n ...current.outcome,\n base: { ...baseline.outcome, ref: base.ref, commit: base.commit },\n ...(difference === undefined ? {} : difference)\n }\n})\n"]}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The repository's own test invocation, declared once by the host.
|
|
3
|
+
*
|
|
4
|
+
* Every repository already knows how to run its tests, and the harness is told
|
|
5
|
+
* so at setup. What the measured program shows is what happens when that fact
|
|
6
|
+
* is not a *callable* thing: agents guess labels
|
|
7
|
+
* (`management_commands.test_flush`, `tests/related_lookup`, `test_axis.py` —
|
|
8
|
+
* none of which exist), and a guessed label costs a frame each time. Seven such
|
|
9
|
+
* invocations are documented across the 45 instances.
|
|
10
|
+
*
|
|
11
|
+
* So the invocation is a declaration, not a parameter: a caller of the `test`
|
|
12
|
+
* flow selects *which* tests, never *how* to run them.
|
|
13
|
+
*
|
|
14
|
+
* @since 1.0.0
|
|
15
|
+
*/
|
|
16
|
+
import { Context, Effect, Layer } from "effect";
|
|
17
|
+
import * as StdError from "./StdError.ts";
|
|
18
|
+
/**
|
|
19
|
+
* The default ref naming a tree as it stood before the agent touched it.
|
|
20
|
+
*
|
|
21
|
+
* The engine records the pristine checkout under this ref, so a baseline run
|
|
22
|
+
* reuses what already exists instead of inventing a second notion of "base".
|
|
23
|
+
*
|
|
24
|
+
* @category constants
|
|
25
|
+
* @since 1.0.0
|
|
26
|
+
*/
|
|
27
|
+
export declare const captureBase = "refs/flows/capture-base";
|
|
28
|
+
/**
|
|
29
|
+
* How this repository runs its tests.
|
|
30
|
+
*
|
|
31
|
+
* `cwd` is where the runner runs, and `root` is the host directory holding the
|
|
32
|
+
* git repository. They differ exactly when the runner runs in a container: the
|
|
33
|
+
* container sees the repository at `cwd`, the host sees it at `root`, and a
|
|
34
|
+
* baseline checkout created at `<root>/<name>` is visible to the runner at
|
|
35
|
+
* `<cwd>/<name>` because it is the same directory under two names.
|
|
36
|
+
*
|
|
37
|
+
* @category models
|
|
38
|
+
* @since 1.0.0
|
|
39
|
+
*/
|
|
40
|
+
export interface Runner {
|
|
41
|
+
/** The runner command line, without any test selection. */
|
|
42
|
+
readonly command: string;
|
|
43
|
+
/** Where the runner runs; the container's path when `container` is set. */
|
|
44
|
+
readonly cwd?: string | undefined;
|
|
45
|
+
/** The host path of the repository, when it differs from `cwd`. */
|
|
46
|
+
readonly root?: string | undefined;
|
|
47
|
+
/** A container to route the run through, via the `Container` transport. */
|
|
48
|
+
readonly container?: string | undefined;
|
|
49
|
+
/** Environment the runner needs. */
|
|
50
|
+
readonly env?: Record<string, string> | undefined;
|
|
51
|
+
/** The ref whose commit is the pristine base; defaults to {@link captureBase}, then HEAD. */
|
|
52
|
+
readonly baseRef?: string | undefined;
|
|
53
|
+
/** False refuses baseline requests before any process runs. */
|
|
54
|
+
readonly baseline?: false | undefined;
|
|
55
|
+
/** Default wall-clock budget for one run. */
|
|
56
|
+
readonly timeoutMs?: number | undefined;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The declaration service.
|
|
60
|
+
*
|
|
61
|
+
* @category services
|
|
62
|
+
* @since 1.0.0
|
|
63
|
+
*/
|
|
64
|
+
export interface TestRunner {
|
|
65
|
+
readonly declared: Effect.Effect<Runner, StdError.StdError>;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The {@link TestRunner} service tag.
|
|
69
|
+
*
|
|
70
|
+
* @category services
|
|
71
|
+
* @since 1.0.0
|
|
72
|
+
*/
|
|
73
|
+
export declare const TestRunner: Context.Service<TestRunner, TestRunner>;
|
|
74
|
+
/**
|
|
75
|
+
* Declares one repository's runner.
|
|
76
|
+
*
|
|
77
|
+
* @category constructors
|
|
78
|
+
* @since 1.0.0
|
|
79
|
+
*/
|
|
80
|
+
export declare const make: (runner: Runner) => TestRunner;
|
|
81
|
+
/**
|
|
82
|
+
* Declares that this host knows of no runner.
|
|
83
|
+
*
|
|
84
|
+
* @category constructors
|
|
85
|
+
* @since 1.0.0
|
|
86
|
+
*/
|
|
87
|
+
export declare const makeNoop: () => TestRunner;
|
|
88
|
+
/**
|
|
89
|
+
* Provides {@link make}.
|
|
90
|
+
*
|
|
91
|
+
* @category layers
|
|
92
|
+
* @since 1.0.0
|
|
93
|
+
*/
|
|
94
|
+
export declare const layer: (runner: Runner) => Layer.Layer<TestRunner>;
|
|
95
|
+
/**
|
|
96
|
+
* Provides {@link makeNoop}.
|
|
97
|
+
*
|
|
98
|
+
* @category layers
|
|
99
|
+
* @since 1.0.0
|
|
100
|
+
*/
|
|
101
|
+
export declare const layerNoop: Layer.Layer<TestRunner>;
|
|
102
|
+
//# sourceMappingURL=TestRunner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TestRunner.d.ts","sourceRoot":"","sources":["../../src/TestRunner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC/C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AAEzC;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,4BAA4B,CAAA;AAEpD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,MAAM;IACrB,2DAA2D;IAC3D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,2EAA2E;IAC3E,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,mEAAmE;IACnE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,2EAA2E;IAC3E,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvC,oCAAoC;IACpC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAA;IACjD,6FAA6F;IAC7F,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACrC,+DAA+D;IAC/D,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,GAAG,SAAS,CAAA;IACrC,6CAA6C;IAC7C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACxC;AAED;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAA;CAC5D;AAED;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EAAE,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,UAAU,CAA6C,CAAA;AAE5G;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GAAI,QAAQ,MAAM,KAAG,UAAiE,CAAA;AAEvG;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,QAAO,UASxB,CAAA;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAAI,QAAQ,MAAM,KAAG,KAAK,CAAC,KAAK,CAAC,UAAU,CAA4C,CAAA;AAEzG;;;;;GAKG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,UAAU,CAAyC,CAAA"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The repository's own test invocation, declared once by the host.
|
|
3
|
+
*
|
|
4
|
+
* Every repository already knows how to run its tests, and the harness is told
|
|
5
|
+
* so at setup. What the measured program shows is what happens when that fact
|
|
6
|
+
* is not a *callable* thing: agents guess labels
|
|
7
|
+
* (`management_commands.test_flush`, `tests/related_lookup`, `test_axis.py` —
|
|
8
|
+
* none of which exist), and a guessed label costs a frame each time. Seven such
|
|
9
|
+
* invocations are documented across the 45 instances.
|
|
10
|
+
*
|
|
11
|
+
* So the invocation is a declaration, not a parameter: a caller of the `test`
|
|
12
|
+
* flow selects *which* tests, never *how* to run them.
|
|
13
|
+
*
|
|
14
|
+
* @since 1.0.0
|
|
15
|
+
*/
|
|
16
|
+
import { Context, Effect, Layer } from "effect";
|
|
17
|
+
import * as StdError from "./StdError.js";
|
|
18
|
+
/**
|
|
19
|
+
* The default ref naming a tree as it stood before the agent touched it.
|
|
20
|
+
*
|
|
21
|
+
* The engine records the pristine checkout under this ref, so a baseline run
|
|
22
|
+
* reuses what already exists instead of inventing a second notion of "base".
|
|
23
|
+
*
|
|
24
|
+
* @category constants
|
|
25
|
+
* @since 1.0.0
|
|
26
|
+
*/
|
|
27
|
+
export const captureBase = "refs/flows/capture-base";
|
|
28
|
+
/**
|
|
29
|
+
* The {@link TestRunner} service tag.
|
|
30
|
+
*
|
|
31
|
+
* @category services
|
|
32
|
+
* @since 1.0.0
|
|
33
|
+
*/
|
|
34
|
+
export const TestRunner = Context.Service("@smthrs/std/TestRunner");
|
|
35
|
+
/**
|
|
36
|
+
* Declares one repository's runner.
|
|
37
|
+
*
|
|
38
|
+
* @category constructors
|
|
39
|
+
* @since 1.0.0
|
|
40
|
+
*/
|
|
41
|
+
export const make = (runner) => TestRunner.of({ declared: Effect.succeed(runner) });
|
|
42
|
+
/**
|
|
43
|
+
* Declares that this host knows of no runner.
|
|
44
|
+
*
|
|
45
|
+
* @category constructors
|
|
46
|
+
* @since 1.0.0
|
|
47
|
+
*/
|
|
48
|
+
export const makeNoop = () => TestRunner.of({
|
|
49
|
+
declared: Effect.fail(new StdError.StdError({
|
|
50
|
+
code: "provider_unavailable",
|
|
51
|
+
message: "No test runner is declared for this repository, so there is nothing for the test flow to run. Use bash with the command this project's own documentation gives."
|
|
52
|
+
}))
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* Provides {@link make}.
|
|
56
|
+
*
|
|
57
|
+
* @category layers
|
|
58
|
+
* @since 1.0.0
|
|
59
|
+
*/
|
|
60
|
+
export const layer = (runner) => Layer.succeed(TestRunner, make(runner));
|
|
61
|
+
/**
|
|
62
|
+
* Provides {@link makeNoop}.
|
|
63
|
+
*
|
|
64
|
+
* @category layers
|
|
65
|
+
* @since 1.0.0
|
|
66
|
+
*/
|
|
67
|
+
export const layerNoop = Layer.succeed(TestRunner, makeNoop());
|
|
68
|
+
//# sourceMappingURL=TestRunner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TestRunner.js","sourceRoot":"","sources":["../../src/TestRunner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC/C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AAEzC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,yBAAyB,CAAA;AA2CpD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAA4C,OAAO,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAA;AAE5G;;;;;GAKG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,MAAc,EAAc,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;AAEvG;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAe,EAAE,CACvC,UAAU,CAAC,EAAE,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC,IAAI,CACnB,IAAI,QAAQ,CAAC,QAAQ,CAAC;QACpB,IAAI,EAAE,sBAAsB;QAC5B,OAAO,EACL,iKAAiK;KACpK,CAAC,CACH;CACF,CAAC,CAAA;AAEJ;;;;;GAKG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,MAAc,EAA2B,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;AAEzG;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAA4B,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAA","sourcesContent":["/**\n * The repository's own test invocation, declared once by the host.\n *\n * Every repository already knows how to run its tests, and the harness is told\n * so at setup. What the measured program shows is what happens when that fact\n * is not a *callable* thing: agents guess labels\n * (`management_commands.test_flush`, `tests/related_lookup`, `test_axis.py` —\n * none of which exist), and a guessed label costs a frame each time. Seven such\n * invocations are documented across the 45 instances.\n *\n * So the invocation is a declaration, not a parameter: a caller of the `test`\n * flow selects *which* tests, never *how* to run them.\n *\n * @since 1.0.0\n */\n\nimport { Context, Effect, Layer } from \"effect\"\nimport * as StdError from \"./StdError.ts\"\n\n/**\n * The default ref naming a tree as it stood before the agent touched it.\n *\n * The engine records the pristine checkout under this ref, so a baseline run\n * reuses what already exists instead of inventing a second notion of \"base\".\n *\n * @category constants\n * @since 1.0.0\n */\nexport const captureBase = \"refs/flows/capture-base\"\n\n/**\n * How this repository runs its tests.\n *\n * `cwd` is where the runner runs, and `root` is the host directory holding the\n * git repository. They differ exactly when the runner runs in a container: the\n * container sees the repository at `cwd`, the host sees it at `root`, and a\n * baseline checkout created at `<root>/<name>` is visible to the runner at\n * `<cwd>/<name>` because it is the same directory under two names.\n *\n * @category models\n * @since 1.0.0\n */\nexport interface Runner {\n /** The runner command line, without any test selection. */\n readonly command: string\n /** Where the runner runs; the container's path when `container` is set. */\n readonly cwd?: string | undefined\n /** The host path of the repository, when it differs from `cwd`. */\n readonly root?: string | undefined\n /** A container to route the run through, via the `Container` transport. */\n readonly container?: string | undefined\n /** Environment the runner needs. */\n readonly env?: Record<string, string> | undefined\n /** The ref whose commit is the pristine base; defaults to {@link captureBase}, then HEAD. */\n readonly baseRef?: string | undefined\n /** False refuses baseline requests before any process runs. */\n readonly baseline?: false | undefined\n /** Default wall-clock budget for one run. */\n readonly timeoutMs?: number | undefined\n}\n\n/**\n * The declaration service.\n *\n * @category services\n * @since 1.0.0\n */\nexport interface TestRunner {\n readonly declared: Effect.Effect<Runner, StdError.StdError>\n}\n\n/**\n * The {@link TestRunner} service tag.\n *\n * @category services\n * @since 1.0.0\n */\nexport const TestRunner: Context.Service<TestRunner, TestRunner> = Context.Service(\"@smthrs/std/TestRunner\")\n\n/**\n * Declares one repository's runner.\n *\n * @category constructors\n * @since 1.0.0\n */\nexport const make = (runner: Runner): TestRunner => TestRunner.of({ declared: Effect.succeed(runner) })\n\n/**\n * Declares that this host knows of no runner.\n *\n * @category constructors\n * @since 1.0.0\n */\nexport const makeNoop = (): TestRunner =>\n TestRunner.of({\n declared: Effect.fail(\n new StdError.StdError({\n code: \"provider_unavailable\",\n message:\n \"No test runner is declared for this repository, so there is nothing for the test flow to run. Use bash with the command this project's own documentation gives.\"\n })\n )\n })\n\n/**\n * Provides {@link make}.\n *\n * @category layers\n * @since 1.0.0\n */\nexport const layer = (runner: Runner): Layer.Layer<TestRunner> => Layer.succeed(TestRunner, make(runner))\n\n/**\n * Provides {@link makeNoop}.\n *\n * @category layers\n * @since 1.0.0\n */\nexport const layerNoop: Layer.Layer<TestRunner> = Layer.succeed(TestRunner, makeNoop())\n"]}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The identity of one directory tree, measured where the tree is.
|
|
3
|
+
*
|
|
4
|
+
* `@smthrs/agent/WorkspaceObservation` measures the host workspace around
|
|
5
|
+
* every frame so the loop's mutation accounting is a fact rather than a
|
|
6
|
+
* claim. A command routed into a container writes to a filesystem that walk
|
|
7
|
+
* never sees: the SWE-bench rig bind-mounts the checkout into its container,
|
|
8
|
+
* so a container edit lands on the host too, but a container Harbor or Pier
|
|
9
|
+
* starts has no such mount, and every edit an agent made there read as an
|
|
10
|
+
* idle frame. Measured 2026-09-22 on Terminal-Bench 4.0: `read_only_cap`
|
|
11
|
+
* ended one run after twenty-four frames of container writes, and the claim
|
|
12
|
+
* judge refused another's completion as "work this run never recorded".
|
|
13
|
+
*
|
|
14
|
+
* This module is the same measurement taken inside the container: one POSIX
|
|
15
|
+
* shell script that lists every kept file under a directory with its size and
|
|
16
|
+
* modification time, in sorted order, and prints one checksum of the listing.
|
|
17
|
+
* `bash` runs it through the container transport before and after a
|
|
18
|
+
* containerised command and reports whether the two answers differ under the
|
|
19
|
+
* reserved {@link key}. The harness reads that key as a measured write, the
|
|
20
|
+
* way it reads `invalidProbe` as a measured refusal.
|
|
21
|
+
*
|
|
22
|
+
* The same properties as the host walk, and the same stated limits:
|
|
23
|
+
*
|
|
24
|
+
* - **Identity, not content.** Size and mtime per file; a rewrite that
|
|
25
|
+
* restores both is invisible.
|
|
26
|
+
* - **Pruning is the signal.** {@link defaultPrune} and
|
|
27
|
+
* {@link defaultIgnoreSuffixes} are the one list both measurements use, so
|
|
28
|
+
* a derived artifact the host walk skips is skipped here too.
|
|
29
|
+
* - **A partial listing says so.** The listing stops at {@link maxPaths}, and
|
|
30
|
+
* a measurement that stopped there reports `complete: false`; `bash` then
|
|
31
|
+
* reports nothing rather than a guess.
|
|
32
|
+
* - **Every tool it needs is POSIX or busybox.** `find -prune`, `stat -c`,
|
|
33
|
+
* `sort`, `head`, `cksum` and `grep -c` are in every Linux base image this
|
|
34
|
+
* has been run against, GNU and busybox alike. A container that lacks one
|
|
35
|
+
* answers with a non-zero exit, which is read as "unmeasured".
|
|
36
|
+
*
|
|
37
|
+
* @since 1.0.0
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* The reserved output key a flow reports a measured write under.
|
|
41
|
+
*
|
|
42
|
+
* A wire contract with the harness rather than a shared type, exactly as
|
|
43
|
+
* `Probe.key` is: `@smthrs/harness` reads this key off a `Schema.Json` result
|
|
44
|
+
* and must not depend on the tool library to do it. `true` means the tree the
|
|
45
|
+
* call targeted differed after the call from before it; `false` means it was
|
|
46
|
+
* measured and held still; absent means it was not measured.
|
|
47
|
+
*
|
|
48
|
+
* @category identifiers
|
|
49
|
+
* @since 1.0.0
|
|
50
|
+
*/
|
|
51
|
+
export declare const key = "mutated";
|
|
52
|
+
/**
|
|
53
|
+
* Directory names never descended into.
|
|
54
|
+
*
|
|
55
|
+
* Every entry is a place a tool writes derived state while the run is working:
|
|
56
|
+
* version-control internals, dependency trees, and the caches Python, Node,
|
|
57
|
+
* Rust and their test runners keep beside the sources. A run that changes only
|
|
58
|
+
* these has changed nothing it will be judged on.
|
|
59
|
+
*
|
|
60
|
+
* @category constants
|
|
61
|
+
* @since 1.0.0
|
|
62
|
+
*/
|
|
63
|
+
export declare const defaultPrune: ReadonlyArray<string>;
|
|
64
|
+
/**
|
|
65
|
+
* File and directory name suffixes left out of a measurement.
|
|
66
|
+
*
|
|
67
|
+
* Compiled output is the case that matters: several SWE-bench projects build
|
|
68
|
+
* extensions in place, which drops `.so` files next to the `.py` files they
|
|
69
|
+
* came from. Those move whenever the run executes its test suite, and
|
|
70
|
+
* counting them would report every probe as an edit.
|
|
71
|
+
*
|
|
72
|
+
* @category constants
|
|
73
|
+
* @since 1.0.0
|
|
74
|
+
*/
|
|
75
|
+
export declare const defaultIgnoreSuffixes: ReadonlyArray<string>;
|
|
76
|
+
/**
|
|
77
|
+
* The largest number of files one measurement covers.
|
|
78
|
+
*
|
|
79
|
+
* The same bound the host walk uses, for the same reason: a listing that
|
|
80
|
+
* stopped here covers a prefix chosen by sort order, and a prefix holding
|
|
81
|
+
* still says nothing about the files being edited outside it.
|
|
82
|
+
*
|
|
83
|
+
* @category constants
|
|
84
|
+
* @since 1.0.0
|
|
85
|
+
*/
|
|
86
|
+
export declare const maxPaths = 50000;
|
|
87
|
+
/**
|
|
88
|
+
* One measurement, as {@link parse} reads it off the script's output.
|
|
89
|
+
*
|
|
90
|
+
* @category models
|
|
91
|
+
* @since 1.0.0
|
|
92
|
+
*/
|
|
93
|
+
export interface Measurement {
|
|
94
|
+
/** The checksum of the whole listing; equal for two measurements of an unchanged tree. */
|
|
95
|
+
readonly digest: string;
|
|
96
|
+
/** How many files the listing covered. */
|
|
97
|
+
readonly paths: number;
|
|
98
|
+
/** Whether the listing covered the whole tree rather than a bounded prefix. */
|
|
99
|
+
readonly complete: boolean;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The POSIX shell script that measures the current directory.
|
|
103
|
+
*
|
|
104
|
+
* Prints two lines: `cksum`'s `<crc> <bytes>` over the sorted listing, then
|
|
105
|
+
* the number of listing lines. The listing is capped one past
|
|
106
|
+
* {@link maxPaths} so the count alone says whether the bound was reached.
|
|
107
|
+
* Errors from `find` and `stat` are discarded: a path that vanished mid-walk
|
|
108
|
+
* is movement the next measurement reports, and a file the shell may not
|
|
109
|
+
* stat is one it could not have measured either way.
|
|
110
|
+
*
|
|
111
|
+
* @category constructors
|
|
112
|
+
* @since 1.0.0
|
|
113
|
+
*/
|
|
114
|
+
export declare const script: (options?: {
|
|
115
|
+
readonly prune?: ReadonlyArray<string> | undefined;
|
|
116
|
+
readonly ignoreSuffixes?: ReadonlyArray<string> | undefined;
|
|
117
|
+
}) => string;
|
|
118
|
+
/**
|
|
119
|
+
* Reads one measurement off the script's standard output.
|
|
120
|
+
*
|
|
121
|
+
* `undefined` for anything that is not two well-formed lines: the script did
|
|
122
|
+
* not run, a tool it needs is missing, or the output was cut. An unmeasured
|
|
123
|
+
* tree is reported as unmeasured, never as unchanged.
|
|
124
|
+
*
|
|
125
|
+
* @category conversions
|
|
126
|
+
* @since 1.0.0
|
|
127
|
+
*/
|
|
128
|
+
export declare const parse: (stdout: string) => Measurement | undefined;
|
|
129
|
+
/**
|
|
130
|
+
* Whether two measurements say the tree moved, or nothing at all.
|
|
131
|
+
*
|
|
132
|
+
* `true` and `false` are answers; `undefined` is the honest reading whenever
|
|
133
|
+
* either measurement is absent or bounded, because a prefix that held still
|
|
134
|
+
* is not a tree that held still.
|
|
135
|
+
*
|
|
136
|
+
* @category conversions
|
|
137
|
+
* @since 1.0.0
|
|
138
|
+
*/
|
|
139
|
+
export declare const moved: (before: Measurement | undefined, after: Measurement | undefined) => boolean | undefined;
|
|
140
|
+
//# sourceMappingURL=TreeFingerprint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeFingerprint.d.ts","sourceRoot":"","sources":["../../src/TreeFingerprint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAIH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,GAAG,YAAY,CAAA;AAE5B;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,EAAE,aAAa,CAAC,MAAM,CAM9C,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,MAAM,CAUvD,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,QAAS,CAAA;AAE9B;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,0FAA0F;IAC1F,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,0CAA0C;IAC1C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,+EAA+E;IAC/E,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;CAC3B;AAKD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,MAAM,GAAI,UAAS;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;IAClD,QAAQ,CAAC,cAAc,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;CACvD,KAAG,MAaR,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,KAAK,GAAI,QAAQ,MAAM,KAAG,WAAW,GAAG,SAapD,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,KAAK,GAChB,QAAQ,WAAW,GAAG,SAAS,EAC/B,OAAO,WAAW,GAAG,SAAS,KAC7B,OAAO,GAAG,SAGuB,CAAA"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The identity of one directory tree, measured where the tree is.
|
|
3
|
+
*
|
|
4
|
+
* `@smthrs/agent/WorkspaceObservation` measures the host workspace around
|
|
5
|
+
* every frame so the loop's mutation accounting is a fact rather than a
|
|
6
|
+
* claim. A command routed into a container writes to a filesystem that walk
|
|
7
|
+
* never sees: the SWE-bench rig bind-mounts the checkout into its container,
|
|
8
|
+
* so a container edit lands on the host too, but a container Harbor or Pier
|
|
9
|
+
* starts has no such mount, and every edit an agent made there read as an
|
|
10
|
+
* idle frame. Measured 2026-09-22 on Terminal-Bench 4.0: `read_only_cap`
|
|
11
|
+
* ended one run after twenty-four frames of container writes, and the claim
|
|
12
|
+
* judge refused another's completion as "work this run never recorded".
|
|
13
|
+
*
|
|
14
|
+
* This module is the same measurement taken inside the container: one POSIX
|
|
15
|
+
* shell script that lists every kept file under a directory with its size and
|
|
16
|
+
* modification time, in sorted order, and prints one checksum of the listing.
|
|
17
|
+
* `bash` runs it through the container transport before and after a
|
|
18
|
+
* containerised command and reports whether the two answers differ under the
|
|
19
|
+
* reserved {@link key}. The harness reads that key as a measured write, the
|
|
20
|
+
* way it reads `invalidProbe` as a measured refusal.
|
|
21
|
+
*
|
|
22
|
+
* The same properties as the host walk, and the same stated limits:
|
|
23
|
+
*
|
|
24
|
+
* - **Identity, not content.** Size and mtime per file; a rewrite that
|
|
25
|
+
* restores both is invisible.
|
|
26
|
+
* - **Pruning is the signal.** {@link defaultPrune} and
|
|
27
|
+
* {@link defaultIgnoreSuffixes} are the one list both measurements use, so
|
|
28
|
+
* a derived artifact the host walk skips is skipped here too.
|
|
29
|
+
* - **A partial listing says so.** The listing stops at {@link maxPaths}, and
|
|
30
|
+
* a measurement that stopped there reports `complete: false`; `bash` then
|
|
31
|
+
* reports nothing rather than a guess.
|
|
32
|
+
* - **Every tool it needs is POSIX or busybox.** `find -prune`, `stat -c`,
|
|
33
|
+
* `sort`, `head`, `cksum` and `grep -c` are in every Linux base image this
|
|
34
|
+
* has been run against, GNU and busybox alike. A container that lacks one
|
|
35
|
+
* answers with a non-zero exit, which is read as "unmeasured".
|
|
36
|
+
*
|
|
37
|
+
* @since 1.0.0
|
|
38
|
+
*/
|
|
39
|
+
import * as Prune from "./internal/Prune.js";
|
|
40
|
+
/**
|
|
41
|
+
* The reserved output key a flow reports a measured write under.
|
|
42
|
+
*
|
|
43
|
+
* A wire contract with the harness rather than a shared type, exactly as
|
|
44
|
+
* `Probe.key` is: `@smthrs/harness` reads this key off a `Schema.Json` result
|
|
45
|
+
* and must not depend on the tool library to do it. `true` means the tree the
|
|
46
|
+
* call targeted differed after the call from before it; `false` means it was
|
|
47
|
+
* measured and held still; absent means it was not measured.
|
|
48
|
+
*
|
|
49
|
+
* @category identifiers
|
|
50
|
+
* @since 1.0.0
|
|
51
|
+
*/
|
|
52
|
+
export const key = "mutated";
|
|
53
|
+
/**
|
|
54
|
+
* Directory names never descended into.
|
|
55
|
+
*
|
|
56
|
+
* Every entry is a place a tool writes derived state while the run is working:
|
|
57
|
+
* version-control internals, dependency trees, and the caches Python, Node,
|
|
58
|
+
* Rust and their test runners keep beside the sources. A run that changes only
|
|
59
|
+
* these has changed nothing it will be judged on.
|
|
60
|
+
*
|
|
61
|
+
* @category constants
|
|
62
|
+
* @since 1.0.0
|
|
63
|
+
*/
|
|
64
|
+
export const defaultPrune = [
|
|
65
|
+
...Prune.repositoryDirectories,
|
|
66
|
+
// Build and environment directories a search still reads, since a project
|
|
67
|
+
// may keep sources under these names, but a measurement leaves out.
|
|
68
|
+
"venv",
|
|
69
|
+
"target"
|
|
70
|
+
];
|
|
71
|
+
/**
|
|
72
|
+
* File and directory name suffixes left out of a measurement.
|
|
73
|
+
*
|
|
74
|
+
* Compiled output is the case that matters: several SWE-bench projects build
|
|
75
|
+
* extensions in place, which drops `.so` files next to the `.py` files they
|
|
76
|
+
* came from. Those move whenever the run executes its test suite, and
|
|
77
|
+
* counting them would report every probe as an edit.
|
|
78
|
+
*
|
|
79
|
+
* @category constants
|
|
80
|
+
* @since 1.0.0
|
|
81
|
+
*/
|
|
82
|
+
export const defaultIgnoreSuffixes = [
|
|
83
|
+
".pyc",
|
|
84
|
+
".pyo",
|
|
85
|
+
".pyd",
|
|
86
|
+
".so",
|
|
87
|
+
".o",
|
|
88
|
+
".a",
|
|
89
|
+
".dylib",
|
|
90
|
+
".class",
|
|
91
|
+
".egg-info"
|
|
92
|
+
];
|
|
93
|
+
/**
|
|
94
|
+
* The largest number of files one measurement covers.
|
|
95
|
+
*
|
|
96
|
+
* The same bound the host walk uses, for the same reason: a listing that
|
|
97
|
+
* stopped here covers a prefix chosen by sort order, and a prefix holding
|
|
98
|
+
* still says nothing about the files being edited outside it.
|
|
99
|
+
*
|
|
100
|
+
* @category constants
|
|
101
|
+
* @since 1.0.0
|
|
102
|
+
*/
|
|
103
|
+
export const maxPaths = 50_000;
|
|
104
|
+
/** One name, single-quoted for a POSIX shell. Every name here is a constant without quotes in it. */
|
|
105
|
+
const quoted = (name) => `'${name.replaceAll("'", `'\\''`)}'`;
|
|
106
|
+
/**
|
|
107
|
+
* The POSIX shell script that measures the current directory.
|
|
108
|
+
*
|
|
109
|
+
* Prints two lines: `cksum`'s `<crc> <bytes>` over the sorted listing, then
|
|
110
|
+
* the number of listing lines. The listing is capped one past
|
|
111
|
+
* {@link maxPaths} so the count alone says whether the bound was reached.
|
|
112
|
+
* Errors from `find` and `stat` are discarded: a path that vanished mid-walk
|
|
113
|
+
* is movement the next measurement reports, and a file the shell may not
|
|
114
|
+
* stat is one it could not have measured either way.
|
|
115
|
+
*
|
|
116
|
+
* @category constructors
|
|
117
|
+
* @since 1.0.0
|
|
118
|
+
*/
|
|
119
|
+
export const script = (options = {}) => {
|
|
120
|
+
const prune = (options.prune ?? defaultPrune).map((name) => `-name ${quoted(name)}`).join(" -o ");
|
|
121
|
+
const skipped = (options.ignoreSuffixes ?? defaultIgnoreSuffixes)
|
|
122
|
+
.map((suffix) => `! -name ${quoted(`*${suffix}`)}`)
|
|
123
|
+
.join(" ");
|
|
124
|
+
return [
|
|
125
|
+
"set -f",
|
|
126
|
+
`L=$(find . -xdev \\( ${prune} \\) -prune -o -type f ${skipped} -exec stat -c '%s %Y %n' {} + 2>/dev/null | LC_ALL=C sort | head -n ${maxPaths + 1})`,
|
|
127
|
+
`printf '%s' "$L" | cksum`,
|
|
128
|
+
`printf '%s' "$L" | grep -c ''`
|
|
129
|
+
].join("\n");
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Reads one measurement off the script's standard output.
|
|
133
|
+
*
|
|
134
|
+
* `undefined` for anything that is not two well-formed lines: the script did
|
|
135
|
+
* not run, a tool it needs is missing, or the output was cut. An unmeasured
|
|
136
|
+
* tree is reported as unmeasured, never as unchanged.
|
|
137
|
+
*
|
|
138
|
+
* @category conversions
|
|
139
|
+
* @since 1.0.0
|
|
140
|
+
*/
|
|
141
|
+
export const parse = (stdout) => {
|
|
142
|
+
const lines = stdout.trim().split("\n").map((line) => line.trim());
|
|
143
|
+
if (lines.length !== 2)
|
|
144
|
+
return undefined;
|
|
145
|
+
const checksum = /^(\d+) (\d+)$/.exec(lines[0]);
|
|
146
|
+
const count = /^(\d+)$/.exec(lines[1]);
|
|
147
|
+
if (checksum === null || count === null)
|
|
148
|
+
return undefined;
|
|
149
|
+
const paths = Number(count[1]);
|
|
150
|
+
const bounded = paths > maxPaths;
|
|
151
|
+
return {
|
|
152
|
+
digest: `${checksum[1]}:${checksum[2]}`,
|
|
153
|
+
paths: bounded ? maxPaths : paths,
|
|
154
|
+
complete: !bounded
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Whether two measurements say the tree moved, or nothing at all.
|
|
159
|
+
*
|
|
160
|
+
* `true` and `false` are answers; `undefined` is the honest reading whenever
|
|
161
|
+
* either measurement is absent or bounded, because a prefix that held still
|
|
162
|
+
* is not a tree that held still.
|
|
163
|
+
*
|
|
164
|
+
* @category conversions
|
|
165
|
+
* @since 1.0.0
|
|
166
|
+
*/
|
|
167
|
+
export const moved = (before, after) => before === undefined || after === undefined || !before.complete || !after.complete
|
|
168
|
+
? undefined
|
|
169
|
+
: before.digest !== after.digest;
|
|
170
|
+
//# sourceMappingURL=TreeFingerprint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeFingerprint.js","sourceRoot":"","sources":["../../src/TreeFingerprint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAA;AAE5C;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,SAAS,CAAA;AAE5B;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,YAAY,GAA0B;IACjD,GAAG,KAAK,CAAC,qBAAqB;IAC9B,0EAA0E;IAC1E,oEAAoE;IACpE,MAAM;IACN,QAAQ;CACT,CAAA;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAA0B;IAC1D,MAAM;IACN,MAAM;IACN,MAAM;IACN,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,QAAQ;IACR,WAAW;CACZ,CAAA;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAA;AAiB9B,qGAAqG;AACrG,MAAM,MAAM,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAA;AAE7E;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,UAGnB,EAAE,EAAU,EAAE;IAChB,MAAM,KAAK,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACjG,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QACjC,QAAQ,EAAE,CAAC,OAAO;KACnB,CAAA;AACH,CAAC,CAAA;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CACnB,MAA+B,EAC/B,KAA8B,EACT,EAAE,CACvB,MAAM,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,QAAQ;IAChF,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,CAAA","sourcesContent":["/**\n * The identity of one directory tree, measured where the tree is.\n *\n * `@smthrs/agent/WorkspaceObservation` measures the host workspace around\n * every frame so the loop's mutation accounting is a fact rather than a\n * claim. A command routed into a container writes to a filesystem that walk\n * never sees: the SWE-bench rig bind-mounts the checkout into its container,\n * so a container edit lands on the host too, but a container Harbor or Pier\n * starts has no such mount, and every edit an agent made there read as an\n * idle frame. Measured 2026-09-22 on Terminal-Bench 4.0: `read_only_cap`\n * ended one run after twenty-four frames of container writes, and the claim\n * judge refused another's completion as \"work this run never recorded\".\n *\n * This module is the same measurement taken inside the container: one POSIX\n * shell script that lists every kept file under a directory with its size and\n * modification time, in sorted order, and prints one checksum of the listing.\n * `bash` runs it through the container transport before and after a\n * containerised command and reports whether the two answers differ under the\n * reserved {@link key}. The harness reads that key as a measured write, the\n * way it reads `invalidProbe` as a measured refusal.\n *\n * The same properties as the host walk, and the same stated limits:\n *\n * - **Identity, not content.** Size and mtime per file; a rewrite that\n * restores both is invisible.\n * - **Pruning is the signal.** {@link defaultPrune} and\n * {@link defaultIgnoreSuffixes} are the one list both measurements use, so\n * a derived artifact the host walk skips is skipped here too.\n * - **A partial listing says so.** The listing stops at {@link maxPaths}, and\n * a measurement that stopped there reports `complete: false`; `bash` then\n * reports nothing rather than a guess.\n * - **Every tool it needs is POSIX or busybox.** `find -prune`, `stat -c`,\n * `sort`, `head`, `cksum` and `grep -c` are in every Linux base image this\n * has been run against, GNU and busybox alike. A container that lacks one\n * answers with a non-zero exit, which is read as \"unmeasured\".\n *\n * @since 1.0.0\n */\n\nimport * as Prune from \"./internal/Prune.ts\"\n\n/**\n * The reserved output key a flow reports a measured write under.\n *\n * A wire contract with the harness rather than a shared type, exactly as\n * `Probe.key` is: `@smthrs/harness` reads this key off a `Schema.Json` result\n * and must not depend on the tool library to do it. `true` means the tree the\n * call targeted differed after the call from before it; `false` means it was\n * measured and held still; absent means it was not measured.\n *\n * @category identifiers\n * @since 1.0.0\n */\nexport const key = \"mutated\"\n\n/**\n * Directory names never descended into.\n *\n * Every entry is a place a tool writes derived state while the run is working:\n * version-control internals, dependency trees, and the caches Python, Node,\n * Rust and their test runners keep beside the sources. A run that changes only\n * these has changed nothing it will be judged on.\n *\n * @category constants\n * @since 1.0.0\n */\nexport const defaultPrune: ReadonlyArray<string> = [\n ...Prune.repositoryDirectories,\n // Build and environment directories a search still reads, since a project\n // may keep sources under these names, but a measurement leaves out.\n \"venv\",\n \"target\"\n]\n\n/**\n * File and directory name suffixes left out of a measurement.\n *\n * Compiled output is the case that matters: several SWE-bench projects build\n * extensions in place, which drops `.so` files next to the `.py` files they\n * came from. Those move whenever the run executes its test suite, and\n * counting them would report every probe as an edit.\n *\n * @category constants\n * @since 1.0.0\n */\nexport const defaultIgnoreSuffixes: ReadonlyArray<string> = [\n \".pyc\",\n \".pyo\",\n \".pyd\",\n \".so\",\n \".o\",\n \".a\",\n \".dylib\",\n \".class\",\n \".egg-info\"\n]\n\n/**\n * The largest number of files one measurement covers.\n *\n * The same bound the host walk uses, for the same reason: a listing that\n * stopped here covers a prefix chosen by sort order, and a prefix holding\n * still says nothing about the files being edited outside it.\n *\n * @category constants\n * @since 1.0.0\n */\nexport const maxPaths = 50_000\n\n/**\n * One measurement, as {@link parse} reads it off the script's output.\n *\n * @category models\n * @since 1.0.0\n */\nexport interface Measurement {\n /** The checksum of the whole listing; equal for two measurements of an unchanged tree. */\n readonly digest: string\n /** How many files the listing covered. */\n readonly paths: number\n /** Whether the listing covered the whole tree rather than a bounded prefix. */\n readonly complete: boolean\n}\n\n/** One name, single-quoted for a POSIX shell. Every name here is a constant without quotes in it. */\nconst quoted = (name: string): string => `'${name.replaceAll(\"'\", `'\\\\''`)}'`\n\n/**\n * The POSIX shell script that measures the current directory.\n *\n * Prints two lines: `cksum`'s `<crc> <bytes>` over the sorted listing, then\n * the number of listing lines. The listing is capped one past\n * {@link maxPaths} so the count alone says whether the bound was reached.\n * Errors from `find` and `stat` are discarded: a path that vanished mid-walk\n * is movement the next measurement reports, and a file the shell may not\n * stat is one it could not have measured either way.\n *\n * @category constructors\n * @since 1.0.0\n */\nexport const script = (options: {\n readonly prune?: ReadonlyArray<string> | undefined\n readonly ignoreSuffixes?: ReadonlyArray<string> | undefined\n} = {}): string => {\n const prune = (options.prune ?? defaultPrune).map((name) => `-name ${quoted(name)}`).join(\" -o \")\n const skipped = (options.ignoreSuffixes ?? defaultIgnoreSuffixes)\n .map((suffix) => `! -name ${quoted(`*${suffix}`)}`)\n .join(\" \")\n return [\n \"set -f\",\n `L=$(find . -xdev \\\\( ${prune} \\\\) -prune -o -type f ${skipped} -exec stat -c '%s %Y %n' {} + 2>/dev/null | LC_ALL=C sort | head -n ${\n maxPaths + 1\n })`,\n `printf '%s' \"$L\" | cksum`,\n `printf '%s' \"$L\" | grep -c ''`\n ].join(\"\\n\")\n}\n\n/**\n * Reads one measurement off the script's standard output.\n *\n * `undefined` for anything that is not two well-formed lines: the script did\n * not run, a tool it needs is missing, or the output was cut. An unmeasured\n * tree is reported as unmeasured, never as unchanged.\n *\n * @category conversions\n * @since 1.0.0\n */\nexport const parse = (stdout: string): Measurement | undefined => {\n const lines = stdout.trim().split(\"\\n\").map((line) => line.trim())\n if (lines.length !== 2) return undefined\n const checksum = /^(\\d+) (\\d+)$/.exec(lines[0]!)\n const count = /^(\\d+)$/.exec(lines[1]!)\n if (checksum === null || count === null) return undefined\n const paths = Number(count[1])\n const bounded = paths > maxPaths\n return {\n digest: `${checksum[1]}:${checksum[2]}`,\n paths: bounded ? maxPaths : paths,\n complete: !bounded\n }\n}\n\n/**\n * Whether two measurements say the tree moved, or nothing at all.\n *\n * `true` and `false` are answers; `undefined` is the honest reading whenever\n * either measurement is absent or bounded, because a prefix that held still\n * is not a tree that held still.\n *\n * @category conversions\n * @since 1.0.0\n */\nexport const moved = (\n before: Measurement | undefined,\n after: Measurement | undefined\n): boolean | undefined =>\n before === undefined || after === undefined || !before.complete || !after.complete\n ? undefined\n : before.digest !== after.digest\n"]}
|