Repository navigation
refactor: run the gate's verification with Effect - #487
Merged
Merged
Conversation
Sequela02
force-pushed
the
feat/effect-gate
branch
from
October 18, 2026 07:12
54c3c64 to
d76a00f
Compare
Verification is now an Effect the operator's stop interrupts (#408): the step under way ends with what it started, a check's processes or Dafny's, and no later step starts. The gate kept working for over a second after a stop, building evidence the receipt no longer claims; a stop during verification now settles in about 200 ms with a receipt that says the operator stopped it and claims no evidence, as a stop before verification does. Each step is awaited after its signal is aborted, so the gate never reports while a process still runs.
On Linux CI a killed orphan stays until its new parent reaps it, which kill(pid, 0) counts as alive, so the check right after the stop saw one; Windows CI saw both. The test now waits up to 10 s, far less than the minute the processes would otherwise run.
Prints each surviving process's chain of parents when a stopped check's processes outlive the stop on Windows. To be removed before merging.
To be removed before merging.
The gate loads with the shell, and importing Effect at its top evaluated it at startup: Linux CI measured the shell at 131.4 MB against a 128 MB limit, where other pull requests measured 119-125 MB. The gate now imports Effect's types and loads effect/Effect with its checks, the first time a run settles. The inventory test also checks namespace and dynamic imports of effect, which it missed, and docs/development.md records both lessons of this part.
Sequela02
force-pushed
the
feat/effect-gate
branch
from
October 18, 2026 08:04
bed1bd4 to
ed24e82
Compare
The shell's measurement settles a run, which now loads Effect's runtime with the gate's checks: Linux CI measured 128.0 MB against a 128 MB limit, where pull requests before measured 119-125 MB. The owner approved 135 MB.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second part of moving Tesota's coordination code to Effect 4 (after #486): the gate's verification.
What a stop did
Measured on Windows with a scratch script running the real gate on the engine, a check whose test script starts a process of its own and waits a minute, stopped once both run: the run ended 1.3-1.5 s after the stop, and the gate's handler finished at the same moment.
runProcessalone stops that tree (Git's bash, npm, node and its child) in about 200 ms, andtaskkill /Ttakes about 190 ms. So the gate went on working for over a second after the stop, building evidence for a receipt.Change
settle,proveandmeasureareEffect.genprograms, one step per stage and per file, run withEffect.runPromise(…, { signal }). The stop interrupts between steps: no later step starts and no later progress is published. The gate no longer threadsctx.signal ?? new AbortController().signalthrough its stages.stepruns each stage: on interruption it aborts the stage's signal and waits for it, so a check's processes or Dafny's have stopped before the gate reports. The first version usedEffect.promise, which does not wait; measured, the run then ended in 8 ms with both processes still alive.stopped, builds both.docs/concepts/verification.mdanddocs/guides/receipts.mdsay what a stop during verification does.Checks
Stop during that check, four runs each:
New test in
packages/core/tests/gate.test.ts: a stop while a project's check runs ends the run aborted, with the stopped receipt, and with both processes the check started gone. It fails on the gate before this change.Gate tests: root 48 passed, engine 35 passed.
bun run checklocally: root 264 passed; engine 320 passed, 3 skipped; lint and types clean. The budget fails on shell memory (115.6 MB, limit 115 MB), this machine's noise (Windows first-frame budget fails on runner noise #462); CI decides.