Skip to content

Commit f3cb941

Browse files
committed
docs(plan): amend the route plan with the 2026-11-17 rulings and review
Owner rulings OD-35 to OD-37: #229 is split on two branches, the journal is redesigned before the runtime holes are fixed, and the forward plan lives in the route plan. New section 14 records what the review measured (eight of the fourteen runtime holes re-run and still open, a new one where rollback leaves reversed operations live, the crash-harness result on the two-file journal, the workflows that fail to start), the revised phases with their status, the result and limits of the Agda journal model (C1), the decisions still open, the added stop rules, and what was not verified. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J4QvDjNR1ZoYKEPxSKE2nq
1 parent 13ea833 commit f3cb941

1 file changed

Lines changed: 290 additions & 0 deletions

File tree

‎docs/plans/VSH-ROUTE-PLAN-2026-11-04.adoc‎

Lines changed: 290 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ Review findings at that level of detail are recorded here as gate requirements a
2525

2626
*Revision 2026-11-09:* owner rulings OD-30 to OD-34 bring the plan into line with the estate proof policy (`hyperpolymath/standards` `3-practice/PROOF-POLICY.adoc`). Where they conflict with anything below, the 2026-11-09 rulings win. The section "Owner rulings (2026-11-09)" lists each superseded part. Ground truth for the same day: `docs/audits/2026-11-09-proof-ground-truth.adoc`.
2727

28+
*Revision 2026-11-17:* owner rulings OD-35 to OD-37 change the running order (the journal is redesigned before the runtime holes are fixed) and record a review of the work since 2026-11-09. Where they conflict with anything below, the 2026-11-17 rulings win. The section "Owner rulings (2026-11-17)" gives the rulings; section 14 gives the review, the revised phases and their status.
29+
2830
*How the evidence was gathered:*
2931

3032
* An ultracode workflow ran 50 agents, all of which completed:
@@ -116,6 +118,35 @@ the deviation records; a lane that installs a prover without one fails review.
116118

117119
*Why proof-first still fixes runtime holes first.* The proof-first architect's own thesis orders the work as "holes come first (rungs 0–1), wiring next (CI lanes before claims), features last". It also argues that the drift guard and the WAL are _proof-necessary_: they discharge, at runtime, the one hypothesis a refinement proof cannot cover, namely that the real OS state equals the abstract state. So the Rust hole fixes (Phase 1) are part of the spine, not a departure from it. They also touch disjoint files from the Lean work (Phase 2), so the two run in parallel and the proofs are not held up.
118120

121+
== Owner rulings (2026-11-17)
122+
123+
Given by selector after a review of the work since 2026-11-09 (section 14).
124+
125+
[cols="1,4,5",options="header"]
126+
|===
127+
|# |Ruling |Supersedes, and what changes
128+
129+
|*OD-35* |*valence-shell#229 is split, on two branches.* The stress-suite repair
130+
and the history journal leave #229 and continue on a second branch,
131+
`claude/vsh-journal-redesign` (valence-shell#230). This is the elegant arm
132+
(E 9 / D 9), chosen over keeping #229 whole (E 7 / D 7).
133+
|Section 9, "Branch and PR discipline" (one branch). #229 keeps the small
134+
Hypatia follow-ups and the descriptile-to-deed migration. Done with `git revert`,
135+
so no history was rewritten. When #229 merges, `main` is merged into the journal
136+
branch.
137+
138+
|*OD-36* |*The journal is redesigned first, before the runtime holes.* Running
139+
order: A (unblock) → C (journal) → B (holes) → D → E → F.
140+
|Section 9's phase order, and the paragraph above ("holes first"). Recorded once,
141+
as the estate's "elegance by default" rule asks: this departs from "holes before
142+
anything else". The sandbox escapes measured in section 14.1 stay open while the
143+
journal is redone. The reason for the order is that journal code already exists
144+
on a branch and was not converging under point fixes (section 14.2).
145+
146+
|*OD-37* |*The forward plan lives in this document*, as a dated amendment.
147+
|The separate working plan written on 2026-11-17. Section 14 is that plan.
148+
|===
149+
119150
'''''
120151

121152
== 0. Bottom line
@@ -839,3 +870,262 @@ _Repository and owner boundaries_
839870
* The CI run states come from `gh` snapshots taken by the readers on 2026-10-27, not re-queried today.
840871
* Not cloned: ochrance, echidna, oblibeny, affinescript, resource-algebra, systemet, tangle.
841872
* The raw workflow output (synthesis, judgements, critique and per-claim skeptic evidence) stayed in the planning session's container and is not committed. Every measured claim here gives its file and line, or the command used to reproduce it, so it can be re-checked from the repo.
873+
874+
'''''
875+
876+
== 14. Amendment 2026-11-17: review, revised phases and status
877+
878+
Status words in this section: *Measured* means a command was run on that date.
879+
*Inferred* means reasoned from measured facts. *Not checked* means exactly that.
880+
881+
=== 14.1 What the review measured
882+
883+
*The runtime holes of section 3.2 are still open.* Phase 1 has not started and
884+
`tests/regressions_parsed_path.rs` does not exist. Eight of the fourteen holes
885+
were re-run on the build of 2026-11-17:
886+
887+
[cols="1,4,4",options="header"]
888+
|===
889+
|Hole |Reproduction |Result (Measured)
890+
891+
|g |`cd ..; touch escaped` |Still escapes the sandbox
892+
|j |`echo PWNED > link`, where `link` is an in-root symlink to an outside file |The outside file is overwritten
893+
|k |`touch lp/new`, where `lp` is an in-root symlink to an outside directory |A file is created outside the root
894+
|m |`obliterate vl --force`, where `vl` is a symlink to an outside file |The outside file's contents are destroyed
895+
|f |`touch f; cd sub; undo` |Deletes the user's `sub/f` and leaves `f`
896+
|h |`chmod 600 s; rm s; undo` |The mode comes back as 0644
897+
|c |obliterate inside a transaction, then rollback |Changed: a failed rollback is now reported. Obliterate inside a transaction is still allowed
898+
|e |i64 overflow in arithmetic |Inconclusive: the test form hit a parse error first
899+
|===
900+
901+
Not re-run: a, b, d, i, l, n.
902+
903+
*A new hole, found in review on 2026-11-17 (Measured, also on `main`):*
904+
`rollback` reverses the operations on disk but leaves them live in the history.
905+
`begin t; touch f; rollback; undo` ends with "Undo touch failed: No such file or
906+
directory". It joins the list as hole *o*.
907+
908+
*`ShellState::new` discards a failed load* (`state.load().ok()`), on `main` too.
909+
E1d says a corrupt load must fail loudly.
910+
911+
*CI does not start the Rust or shared workflows* on the open PRs (Measured;
912+
cause Inferred). Seven workflows end in `startup_failure`. Each uses
913+
`dtolnay/rust-toolchain`, `Swatinem/rust-cache` or a `metadatastician/standards`
914+
reusable workflow; every workflow that still starts uses none of them. The
915+
inferred cause is the repository's allowed-actions list. Until the owner changes
916+
that setting, the evidence for Rust changes is local runs only.
917+
918+
=== 14.2 Why the journal is being redesigned
919+
920+
The stress-suite repair on #229 added an append log beside the state file, which
921+
is the arm this plan rated lower (OD-5b), with no model and no crash test. Two
922+
review bots then raised seventeen findings of one class, crash consistency and
923+
state-file handling, over several rounds. Nine were fixed one at a time. The
924+
other eight are not being patched; they are listed in valence-shell#230.
925+
926+
A crash-point harness now measures the design instead
927+
(`impl/rust-cli/tests/journal_crash_tests.rs`). It replays a scripted session,
928+
builds every disk state a crash could leave between two acknowledged steps, and
929+
requires that the shell reopens, that the recovered state is the one before or
930+
after the interrupted step, and that later work survives another reopen.
931+
932+
Result on the two-file journal, 2,075 crash states (Measured):
933+
934+
* A journal append cut at any byte, a stray temporary file and a clean shutdown
935+
all recover.
936+
* Two classes fail, both after a power loss, because nothing is synced: the
937+
journal is truncated while the old snapshot is still in place (3 states); and
938+
the first snapshot is cut short, after which the failed load is ignored and
939+
the shell starts empty beside an intact journal (666 states).
940+
941+
The test pins exactly those two classes in `KNOWN_OPEN` and fails if the list is
942+
wrong in either direction. The list must be empty before #230 can merge.
943+
944+
=== 14.3 Revised phases
945+
946+
One PR per phase, signed. Phase C runs on `claude/vsh-journal-redesign`; the
947+
others on `claude/laughing-hawking-pibzji`. Each phase starts with an experiment
948+
and ends at a machine-checked gate.
949+
950+
*Phase A. Unblock and land what exists.*
951+
952+
[cols="1,5,3,2",options="header"]
953+
|===
954+
|Step |What |Gate |Status
955+
956+
|A1 (owner) |Add `dtolnay/rust-toolchain@*`, `Swatinem/rust-cache@*` and `metadatastician/standards/.github/workflows/*@*` to the allowed-actions list of valence-shell, maa-framework and absolute-zero |The seven workflows start |Open
957+
|A2 (owner) |Mark GitGuardian incident 36740437 a false positive |- |Open
958+
|A3 |Crash-point harness (section 14.2) |Zero failures, or a pinned list of failure classes |Done: two classes pinned
959+
|A4 |Split #229 (OD-35) |#229 green with Rust CI run |Split done; waits on A1
960+
|A5 |maa-framework#259 and absolute-zero#203 |Both merged |Wait on A1
961+
|===
962+
963+
*Phase C. The journal (this plan's E3, E4 and P8, pulled forward by OD-36).*
964+
965+
[cols="1,5,3,2",options="header"]
966+
|===
967+
|Step |What |Gate |Status
968+
969+
|C1 |Journal model in Agda (OD-30): record framing, event replay, a file and crash model |Checks under the estate invocation, in `All.agda` |Done (section 14.4)
970+
|C2 |One file of length-prefixed, checksummed records behind a small storage interface (append, sync, atomic replace, read), with a real implementation and a simulated one that loses exactly what the model's crash may lose. Compaction writes one snapshot record to a new file, syncs it, renames it over the old one and syncs the directory. A failed load is an error that stops the shell from writing; the files are kept. Rollback writes a record that marks each reversed operation undone. Old `.vsh_state.json` files still load (fixture test) |`KNOWN_OPEN` is empty; the harness also runs against the simulated storage |Next
971+
|C3 |State moves out of the command root to an owner-only directory keyed by session root (OD-12a), opened with `O_NOFOLLOW`, checked through the descriptor, and held under an exclusive lock for the life of the shell |Shell commands cannot delete or edit state; a second shell on the same root is refused; a two-instance test passes |Open
972+
|C4 |Deleted-file contents go to a content-addressed blob store, not into the history |Removing 100 MB no longer writes about 300 MB of JSON |Open
973+
|===
974+
975+
*Phase B. Runtime holes (this plan's Phase 1).*
976+
977+
[cols="1,5,3",options="header"]
978+
|===
979+
|Step |What |Gate
980+
981+
|B0 = E0 |`tests/regressions_parsed_path.rs`: one fail-first test per hole a to o, through the parsed `vsh -c` path. Rewrite `security_no_privilege_escalation` with real assertions |Each test fails on `main` for the documented reason
982+
|B1 |Experiment, one day: port `touch`, `mkdir` and `>` redirection to a root directory handle from the `cap-std` crate; run tests j, k, l |GO or NO-GO written down; decides the containment mechanism (section 14.5)
983+
|B2 = E1b |Session root fixed at start and separate from the working directory; `cd` confined (OD-26a); history paths relative to the session root; content operations refuse symlink escapes and files with more than one hard link; obliterate refuses a symlink |Tests f, g, j, k, l, m, n pass; outside files byte-identical
984+
|B3 = E1c |Obliterate: intent record written and synced before the overwrite; refused inside a transaction (OD-3a); earlier payloads of the target scrubbed |Tests c, d, i pass
985+
|B4 = E1, E1d |Undo restores mode, owner and mtime; unreadable files are refused, not saved empty; redirection records a root-relative path; checked arithmetic |Tests a, e, h pass; an arithmetic never-panics property test
986+
|B5 |One inverse table shared by undo, redo and rollback. This fixes redo losing undo data (`rm f; undo; redo; undo` restores `f` empty) |undo, redo, undo round-trip tests for rm, chmod, cp and `ln -s`
987+
|===
988+
989+
B2 comes first inside the phase: it closes the holes that destroy data outside
990+
the sandbox.
991+
992+
*Phase D. Spec spine* (this plan's Phases 3 and 4 under OD-30): FinFS in Agda
993+
first; oracle v2 with undo, redo, transactions and obliterate, driven by a
994+
state-machine property test against the shell; the golden trace corpus; the four
995+
Lean libraries repaired or visibly quarantined; a proof manifest with grades
996+
derived from CI receipts (OD-34).
997+
998+
*Phase E. Rust contracts* (OD-31): extract `vsh-core`; Creusot/Pearlite and
999+
Verus contracts on `step` and `inverse`; Kani on FFI seams.
1000+
1001+
*Phase F. Honest surface* (one day, any time after B): regenerate the counts in
1002+
the root `CLAUDE.md`; fix the remaining contradictions in `ROADMAP.adoc`;
1003+
replace the banner line "All filesystem operations are reversible" with a
1004+
statement derived from the inverse table.
1005+
1006+
=== 14.4 C1 result: the journal model (Measured 2026-11-17)
1007+
1008+
Four modules in `proofs/agda/`, commit `13ea833`, checked by
1009+
`scripts/check-agda.sh` from a clean build with Agda 2.7.0.1 and agda-stdlib
1010+
v2.2. No postulates and no escape pragmas.
1011+
1012+
[cols="2,5",options="header"]
1013+
|===
1014+
|Module |What it proves
1015+
1016+
|`JournalFraming` |A record is a fixed-width length, the payload, then a fixed-width checksum. A record cut short at any point is rejected (`step-torn`). Whatever the decoder accepts is byte for byte a run of well-formed records at the front of the input (`decode-sound`), and re-encoding it gives a clean journal for any input (`decode-normal`). None of this needs any property of the checksum
1017+
|`JournalReplay` |Events other than a snapshot never remove or reorder history (`run-ids`). After a rollback no operation of that transaction is live (`rollback-no-live`)
1018+
|`JournalModel` |A file is durable bytes plus pending bytes. If a crash keeps the durable bytes and a prefix of the pending ones, loading yields the synced events followed by a prefix of the unsynced events (`crash-recovery`). One pending write is all-or-nothing (`write-atomic`). Compaction by all-or-nothing replacement does not change the recovered state (`compaction-safe`)
1019+
|`JournalWitnesses` |One instance of every module parameter, including an event serialisation with a proved round trip, and worked cases closed by `refl`
1020+
|===
1021+
1022+
Six mutations were each rejected by the type checker: a wrong left-over tail and
1023+
a wrong recovered state in the worked cases; no checksum test; no
1024+
canonical-header test; rollback that marks nothing; and `step-torn` without its
1025+
premise.
1026+
1027+
Limits:
1028+
1029+
* These are theorems about the model. The Rust journal does not follow it yet.
1030+
The proof ledger records that link as `open`; once C2 lands it can be at most
1031+
`tested-only`.
1032+
* The crash model is an assumption about storage: synced bytes survive, and the
1033+
unsynced part survives as a prefix. Reordered or partly written blocks, and
1034+
stale bytes in the unsynced region, are outside it.
1035+
* A checksum cannot rule out bytes that were never written as a record but
1036+
happen to match.
1037+
1038+
Design choices the model fixes for C2:
1039+
1040+
* The history is append-only. Undo and rollback mark entries; redo records a new
1041+
operation.
1042+
* Everything that must survive a restart, the open transaction included, is a
1043+
record in the one file.
1044+
* The loader reports the bytes it did not accept. The writer truncates the file
1045+
to the accepted part before appending again, and keeps the rejected bytes
1046+
aside so that nothing is destroyed silently.
1047+
* A record that does not parse is an error, never a skipped line.
1048+
* The history size cap is applied only at compaction.
1049+
1050+
=== 14.5 Decisions still open
1051+
1052+
Ratings are E (elegance and correctness) / D (dependability and security) out of
1053+
10. They are judgements, not measurements.
1054+
1055+
*Containment mechanism (decided by experiment B1).*
1056+
1057+
[cols="5,1,4",options="header"]
1058+
|===
1059+
|Option |E / D |Notes
1060+
1061+
|Capability handles: all filesystem access goes through a root directory handle (`cap-std`), and ambient `std::fs` calls outside one module are banned by a lint |9 / 8 |Makes a path outside the root unrepresentable instead of checked. New dependency
1062+
|A hand-written `openat2` / `O_NOFOLLOW` walk, as E1b describes |6 / 7 |No new dependency; more code to get wrong
1063+
|More lexical path checks |3 / 3 |This is what fails today
1064+
|===
1065+
1066+
Hard links (hole n) need a link-count check under any option.
1067+
1068+
*The secret-scanner review thread on #229* (a history pass that skips `.adoc`
1069+
files): fix it in the `standards` reusable workflow (9 / 8, at source), or set
1070+
`cancel-in-progress: false` in this one caller (6 / 8). Owner's call; the
1071+
recommendation is the first.
1072+
1073+
*Deed migration:* nine owner inputs are listed in
1074+
`archive/a2ml-v1/MIGRATION-LEDGER.adoc` on #229.
1075+
1076+
=== 14.6 Stop rules added
1077+
1078+
The stop rules of section 9 stand. Added:
1079+
1080+
* Nothing merges into `main` unless its Rust workflows have run on the head
1081+
commit. A local run is not a substitute.
1082+
* No persistence change lands unless the crash-point harness passes with an
1083+
empty `KNOWN_OPEN`.
1084+
* An on-disk format change must still load old files; otherwise stop and ask.
1085+
* A review round is fixed as one batch and one push, after a local adversarial
1086+
check.
1087+
1088+
=== 14.7 Recurring problems and the more final answer
1089+
1090+
[cols="3,3,4",options="header"]
1091+
|===
1092+
|Problem seen |Fix used so far |More final answer
1093+
1094+
|Crash-consistency findings on the journal |Point patches |Checksummed framing, the Agda recovery theorem and the crash-point harness (C1, C2, A3)
1095+
|Sandbox escapes through `cd`, symlinks and hard links |Lexical path checks |Capability handles: no ambient paths, enforced by a lint
1096+
|Redo loses undo data; rollback leaves operations live |Per-command undo capture |One inverse table shared by undo, redo and rollback (OD-25), following `JournalReplay`
1097+
|Obliterate inside a transaction |Report partial failure |Refuse now (OD-3a); later a typed "irrevocable" protocol state (OD-3b)
1098+
|Shell and proofs drift apart |Hand-written correspondence tests |A state-machine property test driving the shell against the oracle (Phase D)
1099+
|===
1100+
1101+
=== 14.8 Beyond this repo (additions to section 11)
1102+
1103+
* *Estate Actions policy:* any repository that calls the
1104+
`metadatastician/standards` reusable workflows or the Rust setup actions will
1105+
fail to start under the same allowed-actions list (Inferred).
1106+
* *standards, secret-scanner reusable:* the history pass skips `.adoc`.
1107+
* *standards / rsr-template-repo:* the workflow linter's "SPDX on line 1" rule
1108+
disagreed with the governance check's "leading comment block" rule. Fixed in
1109+
valence-shell on #229; the template should carry the same fix.
1110+
* *Hypatia:* rule CSA001 re-reports code-scanning alerts that the PR head
1111+
already fixes.
1112+
* *Deed tooling:* the converter the canon names (kyX) was not available; the
1113+
migration on #229 was done by hand from the mapping specifications.
1114+
* *januskey:* the blob store in C4 overlaps `reversible-core` (OD-6). No
1115+
dependency is added; the API frictions are to be recorded.
1116+
* *Review bots:* Codex has no credits for security review, and CodeRabbit's free
1117+
tier allows about one review an hour.
1118+
* *Journal model reuse:* `JournalFraming` is independent of this shell. Any
1119+
estate project with an append-only log could reuse it; echo-types or a shared
1120+
library would be the place if a second user appears.
1121+
1122+
=== 14.9 What was not verified
1123+
1124+
* Why the workflows fail to start, and what blocks auto-merge on #229: the
1125+
repository settings are not readable from the working session.
1126+
* Holes a, b, d, e, i, l and n on the 2026-11-17 build.
1127+
* That a state file written before the journal work loads under the journal
1128+
branch's code (no fixture test yet; it is part of C2).
1129+
* The stress suite on CI, on macOS, or under a release build.
1130+
* Anything about the Rust code following the journal model.
1131+
* The E / D ratings.

0 commit comments

Comments
 (0)