Repository navigation
Commit 6d611d6
feat: make automatic folding work end to end on a real corpus
The transparent session filesystem could fold, but nothing survived contact
with a real store: a single refusal anywhere in a cycle left the system unable
to make progress again, and none of it healed on its own. Folding 2,800
sessions surfaced five separate ways to get permanently stuck, each of which
silently blocked every later cycle.
Enrollment, in the order they bite:
- A staged canonical snapshot that already existed was refused even when it was
byte-identical to its source, so a migration that failed after staging could
never be retried. That stranded 237 sessions folded into the pack with their
originals still on disk — the duplicate 884 MB behind "Space saved: Zero KB".
- One failed migration returned out of the cycle, skipping reclamation, while
the pack build earlier in that same cycle had already written a new
generation. One stuck session meant the store grew every cycle and never
shrank. Reclamation now runs regardless; only deleting a user's original
waits for a clean cycle.
- Every candidate was priced against the storage budget, and each price is a
full store scan — before the batch limit was consulted, so a batch of five
still scanned the store ~2,880 more times. Planning went from 0.42s to over
200s and was killed, which is why the Host reported "0 remaining" and stopped
folding entirely.
- A pack build refused for free space left manifests pointing at unpacked
objects. The doctor reported it, the gate then blocked every candidate, and
nothing repacked: one tight disk locked the system permanently. The cycle now
repacks once before closing that gate.
- Batch size is measured rather than assumed. A cycle rebuilds the whole pack
whether it folds one session or two hundred, so the batch is sized from the
observed rebuild and per-session cost to keep that toll a quarter of the
work, with a manual override in the Auto fold pane. The Host used to write a
fixed 1 back whenever any switch was flipped, which quietly reset a tuned
batch and made every later cycle pay a full rebuild per session.
Reliability of the mount itself:
- A mount-table probe that ran out of time was reported as recovery. It proves
nothing — MNT_NOWAIT contends with unrelated volumes and with the scheduler,
and a mount that actually went away is reported by a lookup that completes.
The production store logged 12,776 of these, each surfacing as a "needs
attention" alert that healed itself within half a minute. The supervisor now
asks the backend directly and keeps its last conclusive reading.
- Status publication no longer waits on reconciliation, so a supervisor that is
merely busy stops reporting itself as gone, and the steady-state mount-table
read runs once every five intervals instead of every one.
- A status channel that stops advancing is a monitoring read gap, not an
outage: it degrades the indicator and only escalates once sustained. A
component that reports failure still alerts at ten seconds.
- Read-ahead extends its horizon only once a read advances into the adjacent
block. Unconditional look-ahead charged every lookup the price of a scan,
which once every session is pack-backed turns listing sessions into rereading
the store.
Verified against the live store: 205 sessions whose originals had been retired
read back byte-identical to the SHA-256 recorded at retirement, 666 MB in
total, every JSONL record still parseable.
Repo hygiene: drop a stale 17 MB build of codexfold committed by accident,
ignore Xcode build output, and extend the sanitisation check to docs so a
maintainer's home path cannot ship in them.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent aa68bff commit 6d611d6
79 files changed
Lines changed: 11541 additions & 601 deletions
File tree
- docs
- internal
- cli
- codex
- enroll
- fold
- fskitstatus
- mountfs
- pack
- service
- storage
- platform/darwin/fskit
- CodexFoldFSKit.xcodeproj
- Extension
- Host
- Tests
- scripts
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
11 | 17 | | |
12 | 18 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
0 commit comments