The refused run is refused everywhere - #606
Open
felipesauer wants to merge 1 commit into
Open
Conversation
A `MNEMA_RUN` the record cannot vouch for is refused once, at the transport, and every verb that stamps a run has to fail without writing. That sentence is written at fourteen sites and was asserted at one — `memory`. The other thirteen were the same four lines copied, with nothing observing that they ran. The guard has two halves and only one was protected. Deleting the whole guard does not typecheck: the resolver's sentinel is a symbol and the adapter takes `run?: string`, so a site written the naive way cannot be committed. Deleting only the `io.fail()` typechecks clean — the write is refused and the shell is told the command succeeded. Nothing anywhere would have noticed. So the second half is now a property over the whole surface. The command paths are walked off the program the entry builds and each line is synthesised from its own declaration, so a subcommand added tomorrow is exercised without an edit; the paths that ask for a run are measured rather than listed, by the refusal code only the resolver produces. Fifteen paths from fourteen sites, each shown to fail and print nothing, and each shown to write nothing beside a run of the same line that writes. Two more holes closed by the same walk. Outside a project the surface says so in one sentence, read off the wording rather than retyped, with the three verbs that name their own way back asserted and the paths that legitimately answer declared — which is what reaches the four refusals no test had ever run. And `processIo`, the three lines that are the product at a terminal, is asked to talk to the real process: which stream, the newline it adds, and the exit code, borrowed and given back. `packages/code/src/wiring` goes from 51 uncovered lines to 11; the workspace from 94.98/88.36/96.83/96.16 to 95.50/88.93/97.00/96.73. The ledger of files no test names loses two rows. The count of sites in two doc-comments said eleven: true when first written, stale when copied, and now derived from the program instead.
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.
A
MNEMA_RUNthe record cannot vouch for is proven once, at the transport, and fromthere the verb "only has to fail". That sentence is written at fourteen sites in nine
files and was asserted at one —
memory, through threecli-e2ecases. The otherthirteen were the same four lines copied, with nothing observing that they ran.
The guard has two halves, and only one was protected
Measured on the trunk by writing the mutation and asking the compiler:
the resolver answers
string | undefined | typeof PIN_REFUSED, the spread then carriesstring | symbol, and the adapter takesrun?: string.TS2379, at the call, insrc. A fifteenth site written the naive way cannot be committed.io.fail()typechecksclean. The write is still refused, and the shell is told the command SUCCEEDED — a
script that stops on a non-zero exit walks straight past a write that never happened.
So this closes the second half, and does not unify the fourteen sites into one function:
that would trade a build-time guard for a test-time one.
The list is derived, not written
The command paths are walked off the program the entry builds, and each line is
synthesised from its own declaration (required positionals, mandatory options, and the
closed set a declaration names). A subcommand added tomorrow is exercised without an edit
anywhere. Which paths ask for a run is measured, by the refusal code only the resolver
produces —
UNPROVEN_RUN. The obvious discriminant has an impostor:mnema run endreadsMNEMA_RUNon its own account and refuses an unknown id underUNKNOWN_RUN, so a scanfor that would have called a verb that stamps nothing a site of this rule.
Two passes, because one instrument cannot carry both halves: every path, outside a
project, must fail and print nothing; and every path found to ask runs twice in a
project of its own — refused (writes nothing) beside unpinned (writes something), so "it
wrote nothing" is read next to a line that could.
Fifteen paths from fourteen written sites —
switch offandswitch onare declaredby one function, and mutating that one site accuses both by name.
Two more holes closed by the same walk
than retyped, with the three verbs that name their own way back asserted and the paths
that legitimately answer declared, both directions reconciled. This is what reaches the
four
reportRefusalcalls no test had ever run: three because nothing ran a readoutside a project, and
witnessbecause its refusal isNO_TAILand needed a recordwith nothing in it.
processIo— the three lines that are the product at a terminal — is asked to talkto the real process: which stream, the newline it adds, and the exit code. Both streams
are borrowed together and given back in a
finally, and nothing is asserted until theyare back, so the suite still exits 0.
Also in here
written (Every verb says whether it writes #476, when there were eleven), stale by the time it was copied into
record-effect.ts(Both surfaces say if they write #591, when there were fourteen). Both rewritten, saying whatfalsified them, and now pointing at the guard that derives the figure.
mergeAForeignTailmoved out ofevery-verb-says-if-it-writes.test.tsintotests/support/, where the second caller can reach it.wiring/io.tsandwiring/run-pin.ts— and the row that claimed "processIo never runs" is gone with it.Numbers
packages/code/src/wiring: 51 uncovered lines → 11, 94.94% → 98.91%.Workspace: 94.98/88.36/96.83/96.16 → 95.50/88.95/97.00/96.73.
thresholdsuntouched.No verb's behaviour changed. The only change under
src/is prose.Ten mutations, none of them silent: dropping
io.fail()at a site accuses that site byname; dropping it at
switch.tsaccuses both paths it serves; the compiling escape(
typeof run === 'string') is caught withappended 1 with the run refused; a verb thatstops asking reddens the derived list naming it; the three port mutations each light the
one case that owns them, and nothing else in 4412.
build 0 · lint 0 · typecheck 0 · 4412 tests in 281 files (was 4401 in 278).