Repository navigation
Repair the init model: all six of review 5089156132's findings - #10069
Conversation
A working 'gunbc scm' CLI existed and was lost with an uncommitted /tmp worktree, along with the plan doc describing it. This commits the survey so the rebuild does not start by re-reading every scm module, and so the next context loss costs nothing. The useful finding from re-surveying: the gap is smaller and more specific than 'build a CLI'. gunbc.scm.render ALREADY reaches CliWireResponse via scm_log_cli_response and scm_status_cli_response -- they simply have no consumer outside dag/test/claim/scm/scm_render_witness_test.dag, which is the unwired-renderer state gunbc.cli_dispatch_surface already records. It also states why the corpus's idiomatic instrument shape cannot substitute for the host binding: 'fn check(...) -> ProcessExit' can only emit text on FAILURE (exit_failure's reason), and log/status must print on success. That is the argument for the main.rs work rather than a workaround, and it is the thing I would otherwise have had to re-derive. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wy8wRfzTK2kvFzj9nAEbyT
gunbc.scm.render already produces CliWireResponse (scm_log_cli_response,
scm_status_cli_response) and nothing outside its witness test consumes it -- the answer is
computed and discarded, which is the unwired-renderer state gunbc.cli_dispatch_surface
records. This adds the two host-side pieces that binding needs.
classify_cli_wire sits beside classify_exit as the single authority for reading the
variant shape, so the driver seam cannot fork it. A missing or wrongly-shaped field is
NotCliWire rather than a default: defaulting bytes to "" would print nothing and exit 0,
which is a fabricated plausible output.
cli_wire_outcome is the total, pure map from that class to what the host does -- bytes,
status, message. Pure for the reason exit_status_for records about itself: the inlined
version of that decision dropped a case and reported success for every failure. It lives
in the LIB, not beside the driver, because main.rs is a BIN target and the rust-unit-tests
job runs 'cargo test -p v1-compiler --lib' -- a test written next to the driver is compiled
by clippy and executed by nobody. exit_status_for_class is shared by both paths so the wire
path and the plain ProcessExit path cannot disagree about what a verdict means.
NotCliWire yields None rather than a failure, so the driver falls through to classify_exit
and every existing ProcessExit entry behaves exactly as before; a test pins that.
5 executing witnesses: bytes written with the response's own exit, a rendered answer that
still fails, the renderer's refusal not reading as an empty success, the fall-through, and
the inherited ExitFailure{code:0} refusal.
NOT YET WIRED into run_verb -- that is the next commit, and until it lands this reader has
no production consumer.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wy8wRfzTK2kvFzj9nAEbyT
gunbc.scm.render has produced CliWireResponse since it was written, and outside its
witness test nothing consumed it. A function returning one hit classify_exit's
NotProcessExit arm and the run refused with 'wrap the result in ExitSuccess /
ExitFailure', so every gunbc scm answer was computed and discarded -- the unwired-renderer
state gunbc.cli_dispatch_surface records.
run_verb now tries cli_wire_outcome first and falls through to classify_exit unchanged for
every other value. Binding it in the OUTCOME SEAM rather than under a new 'scm' subcommand
keeps dispatch peripheral (§3): one binding serves every wire-returning entry instead of
the host growing an arm per verb.
dag/gunbc/scm/cli.dag is the entry the host invokes -- scm_log and scm_status, composing
the read side onto a declared plain-terminal capability. The capability is declared, not
detected: a host that learns to report a real one passes it in.
PROVEN BY EXECUTION, not by typecheck:
gunbc run --entry dag/gunbc/scm/cli.dag --function scm_log --arg path=/tmp/no-such-repo
cannot read repository at /tmp/no-such-repo
No such file or directory (os error 2)
repository unavailable
EXIT=1
That is the renderer's own document on stdout AND a nonzero exit -- the
'printable response carrying a failing exit' case, which is the one an absorbing
implementation would have turned into either silence or a spurious 0.
Also dissolves a fork I had just created: main.rs's exit_status_for carried its own copy of
the verdict map, and once the wire path needed the same decision that copy was two places
free to drift. The body now lives in cli_run::exit_status_for_class, where an executing
test can reach it -- rust-unit-tests runs 'cargo test --lib', and main.rs is a bin whose
tests are compiled by clippy and run by nobody.
clippy --all-targets -D warnings: clean.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wy8wRfzTK2kvFzj9nAEbyT
Receipts for the three executed cases, including the load-bearing one (bytes printed AND a nonzero exit), so the next session does not re-derive them. States the rung honestly rather than implying the e2e is covered: the five cli_wire_outcome tests execute in CI, and the end-to-end runs are a MANUAL receipt. An integration test would live in src/v1/tests/, which clippy compiles and no CI step runs; a .dag witness cannot substitute because scm_log reads a file and the SCM witnesses are SubstrateInputsOnly. So the e2e path is mitigatable and its next-rung trigger is a CI step that runs an integration target -- not another test file. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wy8wRfzTK2kvFzj9nAEbyT
gunbc.scm.render is already witnessed against PlainTerminal and an ASCII no-colour capability. Nothing held gunbc.scm.cli to passing THOSE: setting color: true on plain_terminal_capability would have turned no claim red, which is the inert-check shape DESIGN calls worse than absent. The composition is split from the read -- scm_log_response / scm_status_response take the read's RESULT and are pure, while scm_log / scm_status supply it from a path. That split is what makes the claims authorable at all: the verbs read a file and this witness family is SubstrateInputsOnly, so a claim can never call them. Five enrolled claims: the unavailable-repository bytes (pinned to the same expected string the render-level witness uses, so an equal answer is evidence the PLAIN target and capability were passed, not merely that something was), its failing exit, the empty-log answer with a succeeding exit, the same for status, and the capability row itself so a reader editing it learns it is a contract. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wy8wRfzTK2kvFzj9nAEbyT
gunbc run --entry dag/gunbc/scm/cli.dag --function scm_init --arg path=/tmp/demo-repo.json initialized repository at /tmp/demo-repo.json rc=0, file created ... --function scm_log --arg path=/tmp/demo-repo.json no commits yet init writes the document, log reads it back. That settles the open question the plan doc recorded: a host WRITE is permitted from gunbc run, so the remaining write verbs are a modeling question rather than a permissions one. render.dag gains the write-answer renderer. A write verb answers with what the write DID, and its four outcomes are not one line with a flag -- each names a different failure and a different next action. RepositoryWriteByteCountUnrepresentable EXITS FAILURE even though bytes reached the disk: a write whose reported size is not a magnitude has not been confirmed, and reporting success for it is the fabricated plausible output §5 forbids. TWO LOSSES NAMED IN THE SOURCE RATHER THAN HIDDEN: - The codec refusal carries a typed RepositoryEncodeRefusal with six arms (uncontained target, root not in store, checkout not in commits, duplicated reference, reference outside allocator, parent not in commits) and this renderer does not decompose it, so an operator learns THAT encoding refused and not WHICH invariant failed. Rendering it needs a per-arm function over ObjectId and RepositoryCommitRef. - init does NOT refuse an existing repository. save_repository writes unconditionally, so init over a populated path overwrites it. Refusing needs a read-before-write that is not expressible as one outcome here. That is why this verb is not offered as a safe default. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wy8wRfzTK2kvFzj9nAEbyT
Settles by execution what was open: a host write IS permitted from gunbc run, content enters via store_node, a Node is built with node_synthetic (the test modules' 'atom' is a LOCAL helper, not an authority), and mint_repository_commit requires store_contains(root), so add must precede commit -- and because identity is content-derived, commit can re-derive an added object's ObjectId by rebuilding the same node. Names the design step rather than sketching it: add composes store_node's 2 arms with save_repository's 4, and commit composes mint's 4 with the same save. A renderer taking two outcome values would encode 'which one failed' positionally and the arms multiply. One modeled ScmWriteOutcome is the increment's real content. I deliberately did not improvise it into cli.dag at the end of a long session, because a write-verb outcome invented at a call site is the anemic modeling this repository keeps paying for. Also records that 'add' has no staging authority to persist to -- repository_status takes pending as a PARAMETER because what is staged is not a fact the document carries -- so a literal stage-now-commit-later add needs a staging authority to exist first. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wy8wRfzTK2kvFzj9nAEbyT
…ake it fail-closed
Review 58044 was right and this was the worst thing in the PR. save_repository writes
unconditionally -- correctly, it is persistence and not policy -- so a verb offering
initialization has to decide for itself whether there is anything at the path it would
destroy. The previous revision skipped that decision, called save directly, and NAMED the
overwrite in a comment. DESIGN §5's review bar is that a diff landing a non-fail-closed
failure arm is a hard reject regardless of what else it delivers; an annotation is not a
refusal.
gunbc.scm.init owns the decision, because whether there is anything to destroy is a fact
about the repository and deciding it in the CLI module would put policy in the realization
layer. ScmInitOutcome has three arms and no 'initialized: Bool' beside a save outcome -- a
value whose flag disagreed with its shape would have no spelling -- and the two refusals are
distinct because the operator's next action differs: a path that already IS a repository is
not the same as a path holding someone else's bytes.
MEASURED, including the case that proves the destruction is actually closed:
fresh path -> initialized repository at /tmp/d2.json
same path again -> refusing to initialize /tmp/d2.json
a repository is already there, and init would replace its whole history
foreign file -> refusing to initialize /tmp/foreign.json
a file is already there that is not a repository, and init would destroy it
foreign file after-> 'not a repo' (intact -- read back, not assumed)
THE RESIDUAL IS STATED IN THE MODULE RATHER THAN IMPLIED. RepositoryFileUnreadable fuses
'absent' with 'present but unreadable' and carries the host's error STRING. This module
refuses to branch on that text, because deciding a destructive question by matching an errno
spelling is the stringly reasoning the substrate exists to remove. So the proceed arm is
'unreadable', not 'absent'. Closing it needs a modeled path-existence observation distinct
from a read failure, which does not exist yet and is the module's next-rung trigger.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wy8wRfzTK2kvFzj9nAEbyT
…he wire host Rust Three blocking findings from review 58060 on #9864. 1. `init` was fail-open on `RepositoryFileUnreadable`. Proceeding there is a guess about the host's permission model, not an observation -- a file can be unreadable and perfectly truncatable, so the proceed arm could destroy the bytes it existed to protect. The residual was NAMED in the module header, and a named residual does not refuse. `initialize_repository` now takes a DIRECTORY and a NAME and routes through `extdeps.filesystem.filesystem_io` `filesystem_file_observation`: absence is established from a listing that succeeded and did not name the entry, and only that arm reaches `save_repository`. Present bytes are classified (repository vs foreign) for the operator's benefit but both refuse; indeterminate and disagree refuse as `ScmInitRefusedPathUnobserved`, carrying the host's cause. Executed, four cases: fresh directory writes 166 bytes; an existing repository refuses; a foreign file refuses and reads back byte-intact; a directory with mode 000 refuses naming `Permission denied (os error 13)` rather than widening to "nothing is there". Three hermetic claims enrolled beside them in test.claim.scm.scm_cli_witness -- no refusal renders as a success exit, the three refusals render differently, and the unobserved arm names what could not be observed. 2. The hand-authored Rust had no seed-growth receipt. `gunbc.cli_wire_host_admission` enumerates all 11 declarations at identity grain, states why the host process and the interpreter Value both lack a .dag denotation today, records that `exit_status_for_class` is a relocation rather than new behaviour, and names two capability-grain triggers. It does NOT admit the growth; the disposition is Terminal and fails closed without an operator ruling. Wired into `gunbc.seed_growth_admission`. 3. `gunbc.cli_dispatch_surface` still asserted there is NO route a user can invoke for the scm family, which this branch made false. The row now names the real route and says what changed, and its stage0 mirror is regenerated from the emitter (the candidate tree differed from the committed mirror by exactly this one string). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wy8wRfzTK2kvFzj9nAEbyT
seed_growth_admission conflicted on the justification roster: two lanes appended one row each — cli_wire_host_seed_growth_justification from this branch, required_lane_judgment_seed_growth_justification from main. The rows are independent, so both are kept, and each name was re-checked against its import edge rather than read off the diff: this carrier is exactly the shape merge_region_excludes_shared_tail describes, and its rows being one-liners is what makes the additive resolution safe here rather than something to assume. The generated projections are regenerated from the merged authorities via the sanctioned actuator, not resolved by picking a side. Verified locally on the merged tree with a claim_executor rebuilt from it: build lane regen first_generation_equal=true, generated-artifact 35/35 matched 0 drifted; witnesses lane 3 phases 0 failures, 4484 files parse-clean, namespace-wave-admission ADMITTED. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQ4iThiZ1B9LPB9ePr8qa9
# Conflicts: # src/v1/stage0/src/cli_run.rs
main carries an updated `proof` row in gunbc.rust_source_type_bindings whose committed projection was never regenerated, so origin/main is itself in a drifted state and every branch that merges it inherits a failing regen phase. Measured here rather than assumed: both the .dag authority and the .rs projection on this branch are byte-identical to origin/main, and regen still reports first_generation_equal=false for this one file. The fix is the projection, not the authority: the generated file now carries what the row says. The build lane is green at this head -- regen first_generation_equal=true, generated-artifact 35/35 matched, 0 drifted. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQ4iThiZ1B9LPB9ePr8qa9
cli_wire_host_relocation_note was a `data ... : String` whose only purpose was commentary, with no consumer -- the neighbouring SeedGrowthJustification did not reference the symbol, it referenced the NAME inside its own prose. That is the state DESIGN §4c names: an ordinary String declaration carrying commentary is mechanically indistinguishable from program data, and `//` is the quarantine boundary that keeps the two apart. It is authored rationale about why the roster counts a relocation, so it becomes an annotation on the declaration it explains. The FACT it carried does not disappear with it: that exit_status_for_class is a relocation rather than new behaviour is now stated inside the justification's own `reason`, where a consumer reading the receipt sees it, rather than in a sibling row a consumer would have to know to look up. Found by review 58455 on gunbc#9864. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQ4iThiZ1B9LPB9ePr8qa9
Two of the four findings in review 5085479276 on gunbc#9864. THE NAME WAS USED TWICE AND GUARANTEED ONCE. initialize_repository asked the listing about `name` and separately joined directory + "/" + name into a path, with nothing making those the same subject. `subdir/repo.json` is asked about as a child of the listed directory while the join reaches past it, `../victim` leaves it entirely, `.`/`..`/`""` name no child at all, and -- the case that belongs to the filesystem module rather than to any caller -- a name carrying a newline can make the membership test answer yes for an entry that is not there, because newline is Filesystem.List's own delimiter. FilesystemEntryName is sole_constructor, so admission is unavoidable rather than advisory, and the refusal names which rule rejected the spelling. Its scope is stated honestly: it is adopted at this consumer, filesystem_entry_presence still takes a String, and widening that is a replacement migration over the whole population with its own next-rung trigger -- not smuggled into the change that introduces the carrier. THE DECISION WAS NOT WITNESSED, ONLY ITS RENDERING. Every enrolled init claim built a refusal outcome and checked how it printed, so nothing executed the step that CHOOSES an outcome from an observation; a mutation routing indeterminate to the write arm left the family green. scm_init_decision is that step with the two operations lifted out, and the four arms are now driven one fact apart through the REAL fold -- FilesystemEstablishedAbsence being sole_constructor means a witness cannot hand in a fabricated absence, which forces the evidence to cover filesystem_file_observation and the decision together. Executed: routing indeterminate to a present-refusal takes an_unobservable_path_does_not_authorize_a_write red; routing a real absence away from the write arm takes only_an_established_absence_may_create red. The third mutation -- routing DISAGREEMENT to the write arm -- is unwritable, because ScmInitMayCreate carries the sole_constructor absence and no arm can manufacture one. The rung is split on that boundary rather than averaged. The refusal vocabulary is one type (ScmInitRefusal) consumed by both the decision and the outcome, so a refusal has one spelling rather than two, and the outcome never carries an arm that is only ever intermediate. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQ4iThiZ1B9LPB9ePr8qa9
Third of the four findings in review 5085479276 on gunbc#9864. classify_cli_wire returned NotCliWire for two materially different situations: a value of some other type, and a value that NAMES CliWireResponse but does not inhabit it. cli_wire_outcome answers None for NotCliWire so the caller falls through to classify_exit, which meant a malformed wire response was reported as error: function `f` returned `...`, not `ProcessExit` -- true, useless, and about a type the value never claimed. It hides that the value claimed a type it does not inhabit, and it sends the caller to the wrong remedy: wrap this in ExitSuccess, when the actual defect is a missing `bytes`. MalformedCliWire is its own arm and REFUSES rather than falling through, exiting 2 like the other shape refusal. NotCliWire keeps its fall-through unchanged, which is what preserves every pre-existing ProcessExit entry point. THE TESTS THE REVIEW SAID DID NOT EXIST. All five original tests started from an already-classified CliWireClass, so classify_cli_wire had no coverage at all -- the boundary carrying the defect was the one nothing executed. Seven tests now build real interpreter values: a positive control that a well-formed printable still classifies as printable, a control that a plain ProcessExit and a bare string still fall through (the case that must NOT become malformed, or every existing entry point breaks), the four malformed shapes, and one that the refusal reaches the host with status 2 and no stdout. Executed: restoring the fall-through for MalformedCliWire takes a_malformed_wire_response_refuses_rather_than_falling_through red and leaves the other twelve green, so the arm is load-bearing for exactly the reported case. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQ4iThiZ1B9LPB9ePr8qa9
Adding cli_wire_classify_tests put thirteen hand-authored declarations into cli_run.rs that the receipt did not name, while it went on asserting "+11 FROM THE MERGE BASE, ENUMERATED ABOVE". A roster whose subject is hand-authored declarations, silently missing thirteen of them, is the defect it exists to prevent -- and it was introduced by the change that fixed a different one. Enumerated at 25 and recomputed: 449 insertions in cli_run.rs, 84 changed lines in main.rs, re-derived against origin/main rather than a stale local `main` ref. The five test HELPERS are counted, not just the seven test fns. The roster's subject is declarations, and a helper is one; waving them through as "just tests" is the same netting this receipt already refuses for the relocated exit_status_for_class. Two further .rs files differ and the row says WHY they are outside the subject rather than omitting them: gunbc_cli_dispatch_surface.rs and gunbc_rust_source_type_bindings.rs are generated projections regenerated from their .dag authority, so they are excluded by construction, not by exemption. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQ4iThiZ1B9LPB9ePr8qa9
Review 5085479276 on gunbc#9864, finding 1: initialize_repository established an absence from a directory listing and then called save_repository, which writes UNCONDITIONALLY. The decision was honest and the write was simply not conditioned on it, so an actor creating the file between the two made init truncate exactly the bytes it advertises that it refuses to touch. THIS IS NOT REPAIRABLE BY OBSERVING MORE CAREFULLY. Check-then-write is two acts with a gap, and re-observing only makes the gap smaller. The existence test and the creation have to BE one act, which is a property of open(2) with O_CREAT|O_EXCL and not something a fold over two modeled operations can express. Construction over validation at a boundary where validation structurally cannot win. So the substrate gains the operation rather than the caller gaining a check: extdeps.filesystem.filesystem_io WriteCreateNew, a FileWriteCreateNew verb in the emit stage, and one hand-authored realization. gunbc.scm.repository_save gains create_repository beside save_repository -- persisting a repository that exists and creating one that must not exist are different subjects, and the unconditional write stays correct for the first. NOT WriteOwnerOnly, WHICH ALREADY CALLS create_new. Its O_EXCL is incidental to setting a mode at creation -- meaningless on a path that already exists -- and is not a contract. Owner-only MODE and create-only EXISTENCE are independent facts; a caller taking create-only from it would silently also take 0600 and would break the day owner-only stopped needing O_EXCL. Reusing a realization detail in place of a modeled fact is the inversion §3 names, and the review rejected it explicitly before this landed. THE REFUSAL DOES NOT CLASSIFY ITSELF, and that is deliberate. It carries the host's error verbatim and does not report whether the cause was "already existed" or "permission denied": the transport's channels cannot separate them, and deciding it by matching the error TEXT would be a heuristic standing in for an observation. The caller learns what it needs in order to refuse and does not learn a classification nothing measured. That gap has its own next-rung trigger. Executed, and the mutation is the original defect rather than an invented one: replacing create_new with create+truncate -- what the code did before -- takes create_new_refuses_a_path_that_already_exists_and_leaves_its_bytes red while the positive control stays green. The load-bearing assertion is that the EXISTING BYTES SURVIVE, not that an error is returned: a write that truncated and then reported failure would satisfy a weaker test and still have destroyed the file. Seed growth is receipted in gunbc.filesystem_create_new_admission and rostered, with a trigger naming the capability (creation exclusivity declarable as a property of a write, with the realization deriving the flags) rather than an artifact. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQ4iThiZ1B9LPB9ePr8qa9
Two defects my own build lane caught rather than a reviewer. The WriteCreateNew annotation sat INSIDE the service body, which §4c refuses: only module-item grain is modeled, and an operation lives inside a service's declaration. It now sits above the service that contains it, and says why it is there rather than on the operation it describes -- so the next author does not repeat the move. The seed-growth row imported DeclarationRef and WholeDeclaration from gunbc.seed_growth, which does not export them; std.decl_ref does. Build lane green: regen first_generation_equal=true, generated-artifact 35/35, 0 drifted. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQ4iThiZ1B9LPB9ePr8qa9
…ions the driver refused The generated-artifact merge driver fired on v1_compiler_emit.rs and v1_compiler_emit_rust.rs: both sides changed them since the merge base, so neither side's bytes are the projection of the MERGED authorities. It refused, left them unmerged with no conflict markers, and printed the repair. Resolved by regeneration, not by picking a side. main's copies were installed only as a BOOTSTRAP -- main added unmodeled_shell_transport_diagnostics plus a consumer in the hand-written v1_compiler_compile.rs, so the ours side no longer compiled and no seed could run the regenerator at all. The regenerated bytes carry BOTH main's unmodeled_shell_transport_diagnostics AND this branch's FileWriteCreateNew. Neither side alone was correct, which is exactly the drop the driver exists to prevent. Evidence, per the driver's own recipe: pass 1 (bootstrap seed): FAIL naming exactly those two files; candidate installed pass 2 (seed rebuilt from the installed candidate): first_generation_equal=true fixed point: fixed_point_equal=true referenced_first_generation_equal=true The recipe warns that pass 1 runs a binary predating the change it emits, so one pass can self-verify at divergence 0 for the wrong reason. Hence passes 2 and 3. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQ4iThiZ1B9LPB9ePr8qa9
#10026 landed with these open. Each was verified against the code before being accepted, and each carries a control that goes red on the defect. 1. ScmInitialized could contain a FAILED creation. It carried the whole RepositorySave, so `ScmInitialized { save: RepositoryFileUnwritable { .. } }` was spellable and told every consumer matching the outer arm that initialization happened. The renderer noticed and exited nonzero, which repaired the message and not the carrier. ScmInitialized now carries only { path, written } from a successful create; init_outcome_of_save is a total fold over all four save arms and every other arm reaches ScmInitWriteRefused. 2. The established-absence authority was discarded before actuation. The code matched ScmInitMayCreate(_) and wrote to an independently supplied path, so an absence established for one subject could sit beside a create against another and no mutation to the write target went red. The token carries { directory, name }, so create_repository_at_absence now DERIVES the target from it -- there is no second target to disagree with. The rung prose is corrected rather than softened. Four external reviews read the sole_constructor and endorsed a rung-4 authorization claim; the designated reviewer read the MATCH and found the token was never consumed. A capability carried past its actuation authorizes nothing. The annotation now splits the rung honestly and says plainly that no preflight closes a TOCTOU -- O_EXCL does -- so the observation decides what the operator is told and which subject may be written, not whether the race exists. 3. WriteCreateNew erased the post-create write-failure state. open-then-write leaves a created, zero-or-partial file if write_all fails, while the model reports the create did not happen. That is worse than the overwrite race this operation closed: the race could destroy someone else's bytes, this FABRICATES a repository nobody wrote. Fixed by construction rather than by modeling two dispositions -- content is staged to an O_EXCL sibling and the target name is claimed with hard_link, which fails if the target exists, so exclusivity moves to the publish step and every earlier failure leaves the target absent. THE FIRST CONTROL I WROTE FOR THIS WAS A DECORATION, and the dead attempt is documented in the test module so it is not rebuilt. It put a DIRECTORY at the target; measured against the old construction it PASSED, because create_new fails at the OPEN when the name exists so nothing was ever created. The replacement injects RLIMIT_FSIZE in a forked child so the create succeeds and the write fails -- the one ordering that separates the constructions. Proven both ways: green on the fix, RED on the pre-fix construction with "a write that failed after creation must leave NO target behind". 4. FilesystemEntryName rejected `/` but admitted backslash and NUL while WriteCreateNew is implemented on non-Unix. `..\victim` is a parent traversal there, and a NUL makes the syscall see a PREFIX of the name the listing was asked about. The grammar is the UNION over supported targets, not the one the author happens to run on. Still open from that review: finding 5 (the emitted realization in 05_emit_rust.dag is independently mutable, plus two weak assertions) and finding 6 (compose #9864's final authority, which must land first). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQ4iThiZ1B9LPB9ePr8qa9
… the fourth refusal 5.2 -- present_bytes_do_not_authorize_a_write_and_are_classified asserted only `!= may_create` for a DECODABLE repository. That is satisfied by mapping every present file, valid repository included, to ScmInitForeignFilePresent -- which would tell an operator a foreign file is in the way of their own repository, and the claim would have stayed green. The two present arms are one fact apart (same listing and read, differing only in whether the content decodes), so each is now pinned to its own arm. That is the difference between classification evidence and a not-the-write-arm check. 5.3 -- ScmInitNameNotAnEntry became a fourth refusal arm while both renderer claims still enumerated three. The direct admission test proved the name refuses EARLY; nothing proved it reaches an operator as its own answer with a failing exit. Both claims now cover four arms, and the claim is RENAMED to the_four_init_refusals_render_differently so its name moves with its population -- a claim that names a population and does not move silently covers a shrinking fraction of its subject. Not done, and deliberately not guessed at: 5.1, the emitted realization in 05_emit_rust.dag being independently mutable to create/truncate while the Rust unit tests stay green. That is the same class as the decoration I shipped and withdrew earlier in this branch, one layer out, and it wants either an executing emitted-program probe or a construction that prevents the two realizations from drifting. I have asked the reviewer which shape they want rather than build the wrong one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQ4iThiZ1B9LPB9ePr8qa9
…fix removed Review 58797 on gunbc#10069 is correct, and it is a sharper statement than my own framing of the same row. I had called this "the emitted realization is independently mutable" -- a testing gap. It is not: the DEFECT ITSELF was still present. v1_interpreter::write_file_create_new was repaired to stage-then-link while src/v1/05_emit_rust.dag's file_write_create_new_expr still spelled open-then-write against the target, so a failed emitted write could still leave a partial repository while reporting failure. The fabricated-repository failure survived, in the realization my tests do not execute. That is one fact with two authorities (DESIGN sections 2 and 3), where repairing the reachable one leaves the other lying; and it is section 4b rung honesty, because a class's rung is the MINIMUM across its paths and a fix on the interpreted path does not raise the emitted one. The emitted expression now uses the same construction: stage to an O_EXCL sibling, publish by hard_link (which fails if the target exists), remove the staging file on every path. Projection regenerated. EVIDENCE, over the EMITTED BYTES rather than the interpreter. The expression is decoded out of 05_emit_rust.dag, compiled as a standalone program, and executed: an absent path is created with the right content; an existing path REFUSES and its bytes survive; no staging temporary is left behind. Proven discriminating by the mutation the review itself named -- replacing the body with create/truncate turns the probe RED at "an existing path must refuse". WHAT THIS DOES NOT CLOSE, stated rather than left to be rediscovered: these are still two spellings. An emitted standalone program cannot call the seed's helper, so nothing but review holds them in step, and the drift this review caught can recur. The note in 05_emit_rust.dag carries a next-rung trigger naming the CAPABILITY -- one file-transport realization authority that both the seed and the emitted program consume -- rather than an artifact that would merely contribute to one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQ4iThiZ1B9LPB9ePr8qa9
…red literal The floor red on 78a5220 was my own tightened claim: I had pinned the valid-repository arm of present_bytes_do_not_authorize_a_write_and_are_classified from `!= "may_create"` to `== "repository_present"`, and the hand-authored payload `{"format":"gunbc-scm-repository-v2"}` does not decode as a v2 repository, so the classifier answered `foreign_present`. Reverting the pin would re-weaken the claim to one that cannot tell a repository from a foreign file, so the fixture is what changes. A literal here is a second authority for the repository wire format (DESIGN section 3): it agrees with the codec only while someone keeps retyping it, and the version it drifts to is silently classified as a foreign file -- the classifier reporting a repository this program just wrote as not one. The fixture is now `serialize_json` of `encode_repository_checked(empty_repository())`, the same two calls repository_save makes, so writer and classifier are held to agreeing BY EXECUTION. The encode-refused arm yields "", which decodes as foreign rather than as a repository, so a refusal fails this claim instead of vacuously satisfying it. Mutation-proven discriminating: substituting the old literal back into saved_repository_bytes turns the claim RED; the derived bytes turn it green. All 20 claims in test.claim.scm.scm_cli_witness pass. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQ4iThiZ1B9LPB9ePr8qa9
briansrls
left a comment
There was a problem hiding this comment.
Re-review on exact head bc3bbb9. The code-side 5.1 repair is present: the emitted create-only realization is exercised as emitted bytes, while the remaining two-spelling residue is explicitly classified as a next-rung single-authority problem. The 5.2 fixture correction is also directionally right: derive valid repository bytes through encode_repository_checked + serialize_json rather than hand-authoring a second wire-format authority, with encode refusal failing the claim instead of vacuously passing it. One blocker remains before approval: the PR body still says only five findings are fixed, says the sixth is deliberately not guessed, and lists 5.1 under 'Not done'. That disposition ledger is false for bc3bbb9. Update the PR body to describe the actual six-finding state and the separate remaining next-rung authority residue. This is metadata-only and need not restart the running exact-head CI. CI itself is still in progress, so merge admission is not yet adjudicable regardless. After the body is corrected and exact-head CI terminates, I will apply the forward-delta gate to the then-current main.
|
Thanks — taking the staging-path nit from review 58836 as correct, with one narrowing, and deferring it deliberately rather than silently. Verified against the code. The staging name is What it is not. I checked the failure arm on both realizations before agreeing, because the dangerous version of this bug would be the loser deleting the winner's staged bytes. It does not: the interpreter returns on the open error before reaching any What it is. A diagnostic-quality defect, and refusing is itself correct — with two threads racing one target, one must lose. The defect is that the loser is told Why not in this PR. The reviewer's ruling on this head was that the only outstanding item was the PR body, explicitly as metadata with no head move and no CI restart. Pushing a code change now would move Recorded in my pinned plan against that PR so it cannot be lost if this session is replaced. — sent from deep-carp-676 |
briansrls
left a comment
There was a problem hiding this comment.
The substantive PR-body blocker from review 5093293350 is closed: the body now says all six findings are addressed, records 5.1 as a live emitted-path defect rather than a testing gap, separates the remaining two-spelling §3 residue, records the 5.2 fixture-authority correction, and says #9864 has landed/composed. Two metadata corrections still remain before I can clear the prior REQUEST_CHANGES: (1) the PR title still says “five of ... six findings”; (2) the 5.1 section says “Review 5093286191's predecessor”, but 5093286191 is my APPROVE on #10095, not the review that reclassified 5.1. Remove or correct that citation rather than leaving a false referent. Both are metadata-only; do not move bc3bbb9 or restart CI. Exact-head CI is also still running, so native APPROVE remains withheld until it terminates and the forward delta is adjudicated.
briansrls
left a comment
There was a problem hiding this comment.
Re-review update on exact head bc3bbb9. Exact-head workflow 33663448232 is now terminal SUCCESS, so CI qualification of this composition is closed. I am not lifting CHANGES_REQUESTED yet. Two metadata defects named in review 5093448662 remain live: the PR title still says “five ... six findings”, and the 5.1 body cites “Review 5093286191’s predecessor” even though 5093286191 is the #10095 approval, not the review that reclassified 5.1. Both are metadata-only; fix them without moving the head. Separately, merge admission against current main requires recomposition: the forward delta from composed base de531c3 to observed main cd3cf69 overlaps both qualification machinery (.github/workflows/witnesses.yml) and #10069’s own implementation/generated closure (src/v1/05_emit_rust.dag and src/v1/stage0/src/v1_compiler_emit_rust.rs). Therefore the green bc3bbb9 receipt cannot authorize the combined tree. After metadata correction, compose current main once, regenerate, obtain one exact-head run, then adjudicate only later forward movement.
…ed projection The reviewer ruled bc3bbb9 not merge-admissible onto cd3cf69: its successful run composed de531c3, and de531c3..cd3cf69 changes both src/v1/05_emit_rust.dag and its generated v1_compiler_emit_rust.rs mirror -- the exact implementation and generated closure this PR edits -- plus the witnesses workflow. So this composes current main and re-qualifies on the new head rather than reusing the old green run. The generated-artifact merge driver refused v1_compiler_emit_rust.rs, correctly: both sides changed it since the merge base, so neither side's bytes are the projection of the merged authorities. Resolved by its own recipe rather than by taking a side -- the .dag authorities merged cleanly (both main's changes and this branch's FileWriteCreateNew staging construction survive), and the projection was regenerated from them. Regeneration is a fixed point and took two rounds, which is the reason the recipe asks for the second pass: the first run executes a binary that predates the change it emits, so one pass can report divergence 0 for the wrong reason. Round one named compiler_tests.rs, lib.rs and v1_compiler_emit_rust.rs; after installing those and rebuilding, the emitter's own output moved again for the first two. Round two converged. Verified by execution, not assumed: required-regen first_generation_equal=true, 150/150 adjudicated required-regen-fixed-point fixed_point_equal=true referenced_first_generation_equal=true Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQ4iThiZ1B9LPB9ePr8qa9
|
Review 58882 raises What it is.
The asymmetry that allowed it. Reachability, measured rather than assumed. I traced both realizations. So the honest rung: this is not a live defect, and it is not structurally impossible either — it is prevented by a host accident rather than by construction, which is precisely the shape this PR spent six findings removing elsewhere. Not fixing it here, deliberately. This head ( Filing it as its own follow-up: give The PID-only staging temp from review 58836 remains folded into the transport PR, as the SCM reviewer directed, with a discriminating same-process concurrent control. — sent from deep-carp-676 |
…y did
The composed head's rust-unit-tests job failed on clippy::question_mark (the repo
clippy command runs with -D warnings): write_file_create_new opened its staging file
through `match { Ok(f) => f, Err(e) => return Err(e) }` where `?` is exact.
Clippy is right and this is not a lint to allow. That arm creates nothing, so there is
no staging file to clean up -- which is precisely why it is the one failure path in this
function that does NOT remove_file, and the comment now says so rather than leaving the
`?` looking careless next to three neighbours that do clean up.
It also removes a difference that was never semantic: file_write_create_new_expr already
spelled this `?`, so the two realizations disagreed on the spelling of one line while
agreeing on its meaning. One less thing for the commissioned single-authority cut to
reconcile.
Verified with the exact CI command rather than by inspection:
cargo clippy --all-targets -- -D warnings clean
cargo test --release -p v1-compiler --lib write_file_create_new
create_new_writes_when_nothing_is_there ok
create_new_refuses_a_path_that_already_exists_and_leaves_its_bytes ok
a_write_failure_after_creation_leaves_no_target_behind ok
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VQ4iThiZ1B9LPB9ePr8qa9
The requested content and metadata changes are closed: the title now says all six findings, the 5.1 citation names review 58797, and exact head 5d0d8b8 is terminal green. Dismissing this stale content blocker does not authorize merge: the forward delta from composed main cd3cf69 to observed main 8e025f8 overlaps the PR's emitter authority, generated mirror, interpreter, and qualification machinery, so a frozen or queued composed-candidate qualification is still required.
briansrls
left a comment
There was a problem hiding this comment.
Content and metadata are accepted on exact head 5d0d8b8. Workflow 33678358909 is terminal green across required build, floor, Rust unit/clippy, fabric evidence, and aggregate witnesses. I dismissed stale REQUEST_CHANGES review 5093293350 because every change it requested is closed.
Merge is not authorized on this head. Its composed-main checkpoint is cd3cf69; observed main is 8e025f8. That nine-commit forward delta overlaps src/v1/05_emit_rust.dag, src/v1/stage0/src/v1_compiler_emit_rust.rs, src/v1/stage0/src/v1_interpreter.rs, and required-floor machinery. #10073 may leave the create-new hunk text untouched, but it changes the authority/generated/host compilation surfaces and the clippy judge that already found a branch defect, so hunk disjointness cannot waive combined-tree execution.
RULING: use the quiet/queued-slot arm, not another unprotected treadmill cycle. This does not waive one final composition and run. It bounds them. Obtain either (1) a real merge queue that tests the exact synthetic merge result and holds it for native approval, or (2) an operator-enforced exclusive main freeze with #10069 as the next merge. When the slot opens: name main checkpoint T0; compose T0 once; resolve generated artifacts through the driver; regenerate to first-generation and referenced fixed point; run the full required suite on exact head H1; verify main is still exactly T0 and the slot remains held. Bring H1, T0, run ID, fixed-point receipts, and the live freeze/queue confirmation. I will then issue native APPROVE on H1, and it should merge immediately with expected-head protection. If main advances during the slot, the slot failed; do not call the stale candidate admitted.
Do not start another blind compose/run before the operator grants the slot. Current 5d0d8b8 remains useful qualification evidence, but not merge authority.
…ject `Filesystem.WriteCreateNew` had TWO Rust realizations. The seed interpreter carried a hand-written `write_file_create_new`; v1.compiler.emit_rust carried a string of Rust source inlined into every compiled program. Review 5089156132 on gunbc#10069 measured the consequence: finding 3 repaired the interpreter to stage-then-publish while the emitted spelling still opened the target directly, so a failed emitted write left a partial repository the model reported as never created. Repairing the reachable authority left the other lying -- section 4b rung honesty, where a class's rung is the MINIMUM across paths. #10069 brought them back into agreement BY HAND and said so: nothing but review held them there. This is the construction that replaces the review, commissioned by the designated SCM reviewer as the gate before any new write consumer, because landing add/commit against a duplicated realization makes the old spelling an attractor. THE SEAM IS A COMPLETE NAMED FUNCTION, NOT A BLOCK. My first proposal kept the bare block and taught the seed to build a function from it; the reviewer refused it and was right. That translator would have to know what the block assumes in scope and how its result channel maps onto io::Result, making it a THIRD hand-maintained authority on the seam -- worse than the fork, because a fork fails loudly when the sides disagree while a translator keeps producing something plausible. So extdeps.filesystem.rust_realization holds one complete named definition and both consumers copy its exact bytes. VERIFIED BY COMPARING THE COMMITTED ARTIFACTS, not by trusting a regen receipt, which is a different property: 953 bytes on both sides, byte-identical. IT RETURNS io::Result<()>, NOT THE FILE RESULT TUPLE, per the reviewer's one adjustment. The tuple is the File transport's result-channel POLICY; making it canonical would stringify std::io::Error inside the realization and discard the host's structured failure before any consumer asked for that loss. Each consumer projects the outcome into its own channel -- ordinary consumer code, not a second implementation. THE DEFINITION LIVES IN THE RUNTIME MODULE, AND A CRATE-ROOT ONE WOULD NOT WORK. I told the reviewer emit_non_empty_wrappers answered the emission-site question. It answers where a definition goes once; it does NOT make it reachable. The seed splits into ~8 partition crates that re-export only what stage0_crates names explicitly -- NonEmptyVec is mirrored by name for exactly this reason -- so `crate::` resolved in the monolith and failed E0432 in every partitioned crate. v1_rt is the route that reaches all of them: emit_prelude already emits `use crate::v1_rt;` everywhere, and the runtime is already mirrored into the foundation crate. It also sits beside rt_filesystem(), where the filesystem runtime lives. THE STAGING NAME CARRIES A SEQUENCE, closing review 58836's finding in the one place that now exists. `{path}.gunbc-create-{pid}` was unique per TARGET but not per THREAD, so two threads racing one target collided on the TEMPORARY and the loser reported EEXIST against an internal name it never asked to write -- a refusal that did not locate itself at the operator's subject, and if the winner then failed too, both could refuse with nothing published. THE CONTROL FOR IT IS DETERMINISTIC BECAUSE THE OBVIOUS ONE IS A DECORATION. Racing N threads and asserting one winner PASSES under the defective naming: same verdict, same ErrorKind, no information. So the discriminating control plants exactly the staging file the old rule would derive and leaves the TARGET ABSENT -- the old rule refuses a legitimate create, the sequence lets it proceed. Mutation-proven: reverting the row to PID-only naming turns `a_leftover_staging_file_does_not_refuse_a_legitimate_create` RED while the N-thread race stays green, which is the measurement that shows which of the two carries information. Seed projection is an enrolled generated artifact (location, commit-requirement, equality and emit rows, a WetActuatorGeneratedRegistration, and merge-driver enrollment in .gitattributes), so drift is refused by the gates rather than noticed by a reviewer. Verified by execution: required-regen first_generation_equal=true, 151/151 adjudicated required-regen-fixed-point fixed_point_equal=true cargo clippy --all-targets -- -D warnings clean cargo fmt --all --check clean cargo test -p v1-compiler --lib write_file_create_new 5 passed, 0 failed Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQ4iThiZ1B9LPB9ePr8qa9
Two required changes from external review of the first revision, and the first of them is a defect I had missed rather than a refinement. ALLOCATION, NOT CALCULATION. A per-attempt sequence makes the staging name unique among LIVE calls in one process. It does NOT make an occupied candidate unobservable, and this function deliberately ignores removal failure after publication, so stale staging files are an ADMITTED physical state -- and a later process may reuse the pid and restart its sequence at zero. A one-shot candidate returning its own AlreadyExists therefore reproduces the identical #10069 defect -- target absent, legitimate create refused because an INTERNAL filename was occupied -- at a frequency low enough to be harder to observe. So the loop allocates: an occupied candidate is skipped and the next tried; any other open error is the host's and returns unchanged; exhaustion is CHECKED and refuses with a typed cause rather than wrapping onto a sequence already used. The occupied arm does not remove the file it found -- that file belongs to another attempt, and deleting it would convert a naming collision into data loss. MY OWN CONTROL COULD NOT HAVE CAUGHT THIS. The previous test plants the PID-only name #10069 used, which under the new rule is not a candidate at all, so it passes without ever exercising an occupied candidate -- it proved the literal suffix changed, not the class closed. The generalized control plants the FIRST candidate the CURRENT rule derives, in a forked child so the sequence is known to start at zero, and requires the operation to skip it, acquire the next, publish the target, and leave the planted file untouched. The old control is kept beside it as the historical mutation for #10069's naming. PROJECTION IDENTITY NOW EXECUTES. The first revision proved byte identity by a one-time manual comparison and explained in an annotation why rustfmt shape is load-bearing. An annotation cannot be the enforcement: a future rustfmt release or generator edit could reopen the difference without touching the authority, and nothing would say so. The witness asserts the definition appears in emitted v1_rt exactly once, that the two extracted byte ranges are identical, and that the seed artifact is already at rustfmt's fixed point -- the last of which nothing else would notice, since fmt as a merge gate is a declared rung drop. This is NOT the forbidden equality witness: that pins two independently authored implementations to each other. There is one implementation here, and this checks its two PROJECTIONS carry it unchanged -- necessary precisely because one path passes through an external canonicalizer this repo does not own. IT EARNED ITS KEEP IMMEDIATELY. On its first run it went red on real drift: the gate had regenerated the seed artifact with the allocation loop while v1_rt still carried the one-shot, because wet-actuator artifacts and emitted mirrors regenerate through DIFFERENT commands. The manual comparison it replaces would have passed when run and said nothing. Verified by execution: required-ci --required-lane build rostered=37 adjudicated=37 matches=37 drifted=0 required-regen first_generation_equal=true, 151/151 required-regen-fixed-point fixed_point_equal=true cargo clippy --all-targets -- -D warnings clean cargo fmt --all --check clean write_file_create_new tests 7 passed, 0 failed committed-copy comparison byte-identical, 1586 bytes Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQ4iThiZ1B9LPB9ePr8qa9
… limit External review of a3437c3 found three defects and then corrected one of its own rulings. This carries all of it, plus the composition main's movement forced. THE WRAP GUARD IS WITHDRAWN, AND THE REASONING IS THE REVIEWER'S, NOT MINE. I argued the loop TOLERATES a revisited sequence value. That is true but shallow. The counter neither allocates nor certifies a staging identity -- it only chooses which pathname to PROBE, and the successful create_new IS the allocation event, so a revisited candidate is re-adjudicated by the filesystem rather than trusted. fetch_add and Relaxed stay; there is no sequence-exhaustion state to model, because process-lifetime counter wrap is not a failure of anything. The annotation now describes the atomic as a candidate-ORDER input. EXHAUSTION IS NOT AlreadyExists. It was, and that is #10069's defect re-expressed one level up: AlreadyExists is precisely how a caller of a create-only write concludes THE TARGET IS PRESENT, DO NOT OVERWRITE. Returning it when the target is ABSENT and the cause is an internal staging deficit is an internal condition wearing the domain refusal's identity. Now ErrorKind::Other; the one surviving AlreadyExists is the occupied-candidate arm, where it means what it says. It is a distinct DIAGNOSTIC, not a typed cause -- there is no payload to downcast to, and the earlier prose claiming otherwise overclaimed and is corrected. THE 1024 IS ONE NAMED AUTHORITY, NOT THREE SPELLINGS. It was a literal inside generated Rust. It is now rust_file_create_staging_candidate_attempt_limit, rendered into a pub const that travels with the function as ONE canonical block, read by the function and by the controls. A control that retyped the number would be a second authority for the same fact -- the failure this whole PR removes, in miniature -- and would keep passing after the row changed. There is no second numeric spelling anywhere. MY FORK CONTROL WAS VACUOUS, AND MY COMMENT ASSERTED THE FALSE GUARANTEE OUT LOUD. fork COPIES the counter; cargo runs these as threads of ONE process where siblings have already advanced it, so the planted -0 candidate was very likely never probed and the test passed without exercising an occupied candidate at all. Re-exec instead: a new process image gets the static's initializer. The controller discovers the helper's full name from the harness rather than hardcoding a module path that would rot, and requires "1 passed", so a renamed or filtered-out helper cannot leave it green. THE BUDGET ARM IS NOW REACHED RATHER THAN ASSERTED. Nothing executed it before, so the limit was a number no path ever met. The new control occupies exactly the CONFIGURED number of candidates, then requires refusal, kind Other, the cause and both counts named, NO target published, and every planted file byte-intact. It also protects the other control: if candidate naming ever changes so the planted names stop being probed, this one publishes instead of exhausting and goes red. PROMOTING THE LIMIT PUT A BLIND SPOT IN MY OWN PROJECTION TEST, which the reviewer caught. Extraction began at `pub fn`, so seed rendering 1024 against v1_rt rendering a stale 512 would compare identical function bytes, compile on both sides, stay green, and behave differently. "It would not compile without the constant" proves presence, never agreement. The compared range now begins at the generated pub const. MUTATION-PROVEN: setting v1_rt's constant to 512 with the function bytes untouched turns it RED; the previous version was green on that exact mutation. The projection control also caught its second real drift unaided: my first spelling of the refusal was not at rustfmt's fixed point (rustfmt collapses Error::other(\n format!(..)\n)), so the two copies diverged. Re-authored in rustfmt's shape and verified mechanically BEFORE regenerating. Nothing else gates this -- fmt as a merge gate is a declared rung drop. COMPOSITION. The B..T delta was NOT disjoint: main moved v1_interpreter.rs, lib.rs, stage0_crate_layout.dag and 05_emit_rust.dag, all files this PR authors, so the old head's artifacts were no longer the projection of the merged authorities -- which is exactly what failed CI there (drifted .github/workflows/witnesses.yml). Three generated projections came back UNMERGED from the driver with no conflict markers; regenerated rather than resolved by hand. Two pub mod lines were seeded only to break the generator's dependency on its own stale output, and the regenerator then MOVED one of them, proving the seeding conferred no authority. Verified by execution on this exact tree: required-ci --required-lane build rostered=37 adjudicated=37 matches=37 drifted=0 failed=0 required-regen first_generation_equal=true, 154/154, converged round 1 cargo clippy --all-targets -- -D warnings clean cargo fmt --all --check clean write_file_create_new battery 10 passed, 0 failed stale-constant mutation RED, as required Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQ4iThiZ1B9LPB9ePr8qa9
…ject (#10142) * One file-transport realization authority: delete the two-spelling subject `Filesystem.WriteCreateNew` had TWO Rust realizations. The seed interpreter carried a hand-written `write_file_create_new`; v1.compiler.emit_rust carried a string of Rust source inlined into every compiled program. Review 5089156132 on gunbc#10069 measured the consequence: finding 3 repaired the interpreter to stage-then-publish while the emitted spelling still opened the target directly, so a failed emitted write left a partial repository the model reported as never created. Repairing the reachable authority left the other lying -- section 4b rung honesty, where a class's rung is the MINIMUM across paths. #10069 brought them back into agreement BY HAND and said so: nothing but review held them there. This is the construction that replaces the review, commissioned by the designated SCM reviewer as the gate before any new write consumer, because landing add/commit against a duplicated realization makes the old spelling an attractor. THE SEAM IS A COMPLETE NAMED FUNCTION, NOT A BLOCK. My first proposal kept the bare block and taught the seed to build a function from it; the reviewer refused it and was right. That translator would have to know what the block assumes in scope and how its result channel maps onto io::Result, making it a THIRD hand-maintained authority on the seam -- worse than the fork, because a fork fails loudly when the sides disagree while a translator keeps producing something plausible. So extdeps.filesystem.rust_realization holds one complete named definition and both consumers copy its exact bytes. VERIFIED BY COMPARING THE COMMITTED ARTIFACTS, not by trusting a regen receipt, which is a different property: 953 bytes on both sides, byte-identical. IT RETURNS io::Result<()>, NOT THE FILE RESULT TUPLE, per the reviewer's one adjustment. The tuple is the File transport's result-channel POLICY; making it canonical would stringify std::io::Error inside the realization and discard the host's structured failure before any consumer asked for that loss. Each consumer projects the outcome into its own channel -- ordinary consumer code, not a second implementation. THE DEFINITION LIVES IN THE RUNTIME MODULE, AND A CRATE-ROOT ONE WOULD NOT WORK. I told the reviewer emit_non_empty_wrappers answered the emission-site question. It answers where a definition goes once; it does NOT make it reachable. The seed splits into ~8 partition crates that re-export only what stage0_crates names explicitly -- NonEmptyVec is mirrored by name for exactly this reason -- so `crate::` resolved in the monolith and failed E0432 in every partitioned crate. v1_rt is the route that reaches all of them: emit_prelude already emits `use crate::v1_rt;` everywhere, and the runtime is already mirrored into the foundation crate. It also sits beside rt_filesystem(), where the filesystem runtime lives. THE STAGING NAME CARRIES A SEQUENCE, closing review 58836's finding in the one place that now exists. `{path}.gunbc-create-{pid}` was unique per TARGET but not per THREAD, so two threads racing one target collided on the TEMPORARY and the loser reported EEXIST against an internal name it never asked to write -- a refusal that did not locate itself at the operator's subject, and if the winner then failed too, both could refuse with nothing published. THE CONTROL FOR IT IS DETERMINISTIC BECAUSE THE OBVIOUS ONE IS A DECORATION. Racing N threads and asserting one winner PASSES under the defective naming: same verdict, same ErrorKind, no information. So the discriminating control plants exactly the staging file the old rule would derive and leaves the TARGET ABSENT -- the old rule refuses a legitimate create, the sequence lets it proceed. Mutation-proven: reverting the row to PID-only naming turns `a_leftover_staging_file_does_not_refuse_a_legitimate_create` RED while the N-thread race stays green, which is the measurement that shows which of the two carries information. Seed projection is an enrolled generated artifact (location, commit-requirement, equality and emit rows, a WetActuatorGeneratedRegistration, and merge-driver enrollment in .gitattributes), so drift is refused by the gates rather than noticed by a reviewer. Verified by execution: required-regen first_generation_equal=true, 151/151 adjudicated required-regen-fixed-point fixed_point_equal=true cargo clippy --all-targets -- -D warnings clean cargo fmt --all --check clean cargo test -p v1-compiler --lib write_file_create_new 5 passed, 0 failed Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQ4iThiZ1B9LPB9ePr8qa9 * Allocate the staging candidate, and make projection identity execute Two required changes from external review of the first revision, and the first of them is a defect I had missed rather than a refinement. ALLOCATION, NOT CALCULATION. A per-attempt sequence makes the staging name unique among LIVE calls in one process. It does NOT make an occupied candidate unobservable, and this function deliberately ignores removal failure after publication, so stale staging files are an ADMITTED physical state -- and a later process may reuse the pid and restart its sequence at zero. A one-shot candidate returning its own AlreadyExists therefore reproduces the identical #10069 defect -- target absent, legitimate create refused because an INTERNAL filename was occupied -- at a frequency low enough to be harder to observe. So the loop allocates: an occupied candidate is skipped and the next tried; any other open error is the host's and returns unchanged; exhaustion is CHECKED and refuses with a typed cause rather than wrapping onto a sequence already used. The occupied arm does not remove the file it found -- that file belongs to another attempt, and deleting it would convert a naming collision into data loss. MY OWN CONTROL COULD NOT HAVE CAUGHT THIS. The previous test plants the PID-only name #10069 used, which under the new rule is not a candidate at all, so it passes without ever exercising an occupied candidate -- it proved the literal suffix changed, not the class closed. The generalized control plants the FIRST candidate the CURRENT rule derives, in a forked child so the sequence is known to start at zero, and requires the operation to skip it, acquire the next, publish the target, and leave the planted file untouched. The old control is kept beside it as the historical mutation for #10069's naming. PROJECTION IDENTITY NOW EXECUTES. The first revision proved byte identity by a one-time manual comparison and explained in an annotation why rustfmt shape is load-bearing. An annotation cannot be the enforcement: a future rustfmt release or generator edit could reopen the difference without touching the authority, and nothing would say so. The witness asserts the definition appears in emitted v1_rt exactly once, that the two extracted byte ranges are identical, and that the seed artifact is already at rustfmt's fixed point -- the last of which nothing else would notice, since fmt as a merge gate is a declared rung drop. This is NOT the forbidden equality witness: that pins two independently authored implementations to each other. There is one implementation here, and this checks its two PROJECTIONS carry it unchanged -- necessary precisely because one path passes through an external canonicalizer this repo does not own. IT EARNED ITS KEEP IMMEDIATELY. On its first run it went red on real drift: the gate had regenerated the seed artifact with the allocation loop while v1_rt still carried the one-shot, because wet-actuator artifacts and emitted mirrors regenerate through DIFFERENT commands. The manual comparison it replaces would have passed when run and said nothing. Verified by execution: required-ci --required-lane build rostered=37 adjudicated=37 matches=37 drifted=0 required-regen first_generation_equal=true, 151/151 required-regen-fixed-point fixed_point_equal=true cargo clippy --all-targets -- -D warnings clean cargo fmt --all --check clean write_file_create_new tests 7 passed, 0 failed committed-copy comparison byte-identical, 1586 bytes Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQ4iThiZ1B9LPB9ePr8qa9 * Delete three false mechanism claims from the authority text External review 5098133640 filed REQUEST_CHANGES on 7c80b88 for three statements in this module that describe mechanisms the tree does not have. All three are correct findings. None of them touch the implementation -- which is the point: an annotation that describes a guarantee the code does not provide is worse than no annotation, because it is the thing a later reader cites instead of checking. 1. "Nothing transforms the text on either path" is FALSE. One projection route passes through rustfmt, a canonicalizer this repo does not own, and it has already moved these bytes twice during this change. The true statement -- now written -- is that no HAND-MAINTAINED SEMANTIC TRANSLATOR stands between the authority and either projection, and that the route containing rustfmt is CHECKED by an executed fixed-point assertion. The seam is not absent; it is guarded, and saying "absent" retires the reason the guard exists. 2. The generated-artifact annotation still said the emitted copy is crate-root and needs no qualifier. It is in v1_rt, and emitted modules reach it as `v1_rt::gunbc_file_write_create_new`. `pub` is required by BOTH projections, not just the seed's. The crate-root arrangement was tried first and does not work under the split-crate seed, which the module says thirty lines earlier -- so the file contradicted itself. 3. The canonical-block comment claimed that copying the function while leaving the constant behind WOULD NOT COMPILE, and that this is what keeps the projections from drifting. I falsified that sentence myself and did not notice: the 1024-vs-512 mutation I ran to prove the widened control discriminates compiles on BOTH sides, matches byte-for-byte across the entire function, and behaves differently. Compilation proves the PRESENCE of a constant with the expected name; it says nothing about AGREEMENT on its value. What proves agreement is extracting from the constant through the function and comparing bytes, which is why the control's range begins where it does. The comment now records that it was falsified by a mutation against this very module, so the next reader inherits the experiment rather than the claim. The PR body carried two stale facts against the same head and is corrected: the occupied-candidate control runs in a RE-EXECUTED test binary, not a forked child (the fork version was the vacuous one), and the battery is 10 tests, not 7. The compared subject is now named as the canonical constant-plus-function block rather than "the definition", so the blind-spot repair is explicit rather than implied. Annotation-only, and the tree proves it: after regeneration the ONLY changed file is this .dag. No generated byte moved, which is section 4c's erasure property holding -- semantic passes receive the annotation-erased projection, so prose cannot reach the emitted program. Verified by execution on this exact tree: required-regen first_generation_equal=true, 154/154 required-ci --required-lane build rostered=37 matches=37 drifted=0 phases_failed=0 cargo clippy --all-targets -- -D warnings 0 errors cargo fmt --all --check clean write_file_create_new battery 10 passed, 0 failed Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQ4iThiZ1B9LPB9ePr8qa9 --------- Co-authored-by: gunbc-ci-auto-heal <gunbc-ci-auto-heal@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Repairing the init model that #10026 landed with its findings open
#10026 merged while review
5089156132stood at REQUEST_CHANGES with six findings. This is thefollow-up on the same branch. All six are addressed here.
Every finding was verified against the code before being accepted, and every fix carries a control
that goes red on the defect.
1.
ScmInitializedcould contain a FAILED creationIt carried the whole
RepositorySave, soScmInitialized { save: RepositoryFileUnwritable { .. } }was a spellable value telling every consumer matching the outer arm that initialization happened.
The renderer noticed the nested failure and exited nonzero — which repaired the message, not the
carrier. A consumer reading the arm rather than re-folding its payload was simply lied to, on the
ordinary write-refusal path.
ScmInitializednow carries only{ path, written }from a successful create.init_outcome_of_saveis a total fold over all four save arms; everything else reaches a new
ScmInitWriteRefused.2. The established-absence authority was discarded before actuation
The code matched
ScmInitMayCreate(_)— throwing the token away — and wrote to an independentlysupplied
path. So an absence established for subject A could sit beside a create against subjectB, and no mutation to the write target went red.
FilesystemEstablishedAbsencecarries{ directory, name }, socreate_repository_at_absencenowderives the target from the token. There is no second target to disagree with.
The claim was hollow and four reviews endorsed it anyway. They read the
sole_constructorandcalled it rung-4 "structurally impossible"; the designated reviewer read the match and found the
token was never consumed. A capability carried past its actuation authorizes nothing. The annotation
is corrected rather than softened, and now says plainly that no preflight closes a TOCTOU —
O_EXCLdoes; the observation decides what the operator is told and which subject may be written.3.
WriteCreateNewerased the post-create write-failure stateopen-then-writeleaves a created, zero-or-partial file ifwrite_allfails, while the modelreports the create did not happen. That is worse than the race this operation was added to close:
the race could destroy someone else's bytes; this fabricates a repository nobody wrote.
Fixed by construction rather than by modeling two dispositions. Content is staged to an
O_EXCLsibling and the target name is claimed with
hard_link, which fails if the target exists — soexclusivity moves to the publish step and every earlier failure leaves the target absent. The
admission prose becomes true instead of being weakened.
My first control for this was a decoration, and the dead attempt is documented in the test module
so it is not rebuilt. It put a directory at the target and asserted the target survived; measured
against the old construction it passed, because
create_newfails at the open when the nameexists, so nothing was ever created and the assertion was satisfied by the defect. The replacement
injects
RLIMIT_FSIZEin a forked child so the create succeeds and the write fails — the oneordering that separates the constructions. Proven both ways: green on the fix, red on the
pre-fix construction with
a write that failed after creation must leave NO target behind.4. The filename grammar admitted another host's separator
FilesystemEntryNamerejected/but admitted backslash and NUL, whileWriteCreateNewisimplemented on non-Unix rather than refusing there.
..\victimis a parent traversal on Windowsthat passes a check named for making traversal impossible, and a NUL makes the syscall see a
prefix of the name the listing was asked about. Both now refuse. The grammar is the union over
supported targets, not the one the author happens to run on.
5. Two of the three evidence gaps
5.2 — the valid-repository case asserted only
!= may_create, which stays green if everypresent file maps to
ScmInitForeignFilePresent(telling an operator a foreign file blocks theirown repository). Now pinned to
repository_present, one fact apart from the foreign case.Tightening it exposed a second authority in my own fixture, and that is the later commit on this
branch. The pinned claim went red in CI: the hand-authored payload
{"format":"gunbc-scm-repository-v2"}does not decode as a v2 repository, so the classifieranswered
foreign_present. Reverting the pin would restore a claim that cannot tell a repositoryfrom a foreign file, so the fixture is what changed. A literal here is a second authority for
the repository wire format (DESIGN §3): it agrees with the codec only while someone keeps retyping
it, and the version it drifts to is silently classified foreign — the classifier reporting a
repository this program just wrote as not one. The fixture is now
serialize_jsonofencode_repository_checked(empty_repository()), the same two callsrepository_savemakes, sowriter and classifier are held to agreeing by execution. The encode-refused arm yields
"",which decodes as foreign, so a refusal fails the claim instead of vacuously satisfying it.
Mutation-proven: substituting the old literal back turns the claim red.
5.3 —
ScmInitNameNotAnEntrybecame a fourth refusal arm while both renderer claims stillenumerated three. Both now cover four, and the claim is renamed so its name moves with its
population.
5.1 — the emitted realization kept the defect the interpreter fix removed
Review 58797 reclassified this correctly, and I had it wrong: I filed it as a
testing gap, and it was the defect being live. One fact — how a create-only file write is
performed — had two authorities, and finding 3 repaired only the seed interpreter. Rung honesty is
the minimum across in-scope paths, so a repaired seed beside an unrepaired emitted program is
not a repaired class.
05_emit_rust.dag'sfile_write_create_new_exprnow emits the same staging-plus-hard_linkconstruction, so the emitted program no longer fabricates a repository nobody wrote.
What this does not claim. Two realization spellings still exist and are held in step by review
rather than by construction, and the source says so at the site. That residue is a DESIGN §3
single-authority defect in its own right; the reviewer has ruled it should be lifted as its own
atomic PR immediately after this one — one file-transport realization authority from which both seed
and emitted behavior are derived, deleting the two-spelling subject rather than adding another
equality witness. Deliberately not folded into this PR: repairing the unsafe emitted path and
raising the whole mechanism to the next construction rung are different bars.
6 — compose #9864's final authority
#9864 has landed, and this branch composes it.
🤖 Generated with Claude Code
https://claude.ai/code/session_01VQ4iThiZ1B9LPB9ePr8qa9