@rljson/fs-agent 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.tests.md CHANGED
@@ -8,22 +8,22 @@ found in the LICENSE file in the root of this package.
8
8
 
9
9
  # The test suite, as a document
10
10
 
11
- **70 files, 923 scenarios, 100 % coverage on statements, branches, functions and
12
- lines.** 922 must pass; one is committed inverted, and §2.11 says which and why.
11
+ **67 files, 771 scenarios, 100 % coverage on statements, branches, functions and
12
+ lines.** 770 must pass; one is committed inverted, and §2.11 says which and why.
13
13
  One command runs all of it:
14
14
 
15
15
  ```bash
16
16
  pnpm test # vitest --coverage --no-file-parallelism, then eslint
17
17
  ```
18
18
 
19
- `--no-file-parallelism` is not a preference. **Thirty-seven of these files**
19
+ `--no-file-parallelism` is not a preference. **Thirty-four of these files**
20
20
  drive a real `Server`, a real socket pair or the mesh harness — with real
21
21
  watchers and real timers; run in parallel they fight over the cores and invent
22
22
  failures. Four different tests once failed
23
23
  across four CI runs of the same commit, each passing on re-run — not four bugs,
24
24
  one scheduler.
25
25
 
26
- This document says what the suite actually proves, because the number 923 does
26
+ This document says what the suite actually proves, because the number 771 does
27
27
  not. It is organised by the question answered rather than by file; the file
28
28
  index is at the end.
29
29
 
@@ -33,9 +33,9 @@ index is at the end.
33
33
 
34
34
  | tier | what it is | files |
35
35
  | --- | --- | --- |
36
- | **mesh** | a real `Server`, real sockets (`createSocketPair`), real watchers, real files on disk, two to four nodes, with cuts, heals, mutes, deafenings and stopped processes | 11 |
36
+ | **mesh** | a real `Server`, real sockets (`createSocketPair`), real watchers, real files on disk, two to four nodes, with cuts, heals, mutes, deafenings and stopped processes | 12 |
37
37
  | **client–server** | two or three clients and a real hub, each suite run **twice** — once over `SocketMock`, once over a real socket.io server configured at production's 50 MB limit | 6 |
38
- | **unit / decision** | one agent, or a pure function with no filesystem and no clock | 52 |
38
+ | **unit / decision** | one agent, or a pure function with no filesystem and no clock | 55 |
39
39
 
40
40
  A decision-tier test proves a RULE. It does not prove the rule is ever
41
41
  reached, and the difference has cost this package real defects: every decision
@@ -73,58 +73,51 @@ measured in the field rather than an invented case.
73
73
 
74
74
  ### 2.2 That a deletion travels — the hardest thing here
75
75
 
76
- Deletion is where this package has lost data, and it carries the most tests
77
- per line of code anywhere in it.
76
+ Deletion is where this package has lost data, and it carries the most tests per
77
+ line of code anywhere in it.
78
78
 
79
79
  The architecture is the claim: **an absence is not a deletion.** A tree lacks a
80
- path because the sender removed it or because the sender never had it, and a
81
- content hash cannot tell the two apart. Every attempt to infer it failed — a
82
- rule asking "could the sender have seen my state?", a flag for whether the
83
- transport carried ancestry, a guard for files not yet announced, and a set of a
84
- thousand remembered past states. Four reverts, 155 files of measured drift
85
- across four machines, and a file deleted from 3 642 that was back moments
86
- later. So a removal is **stated** in the edit chain by the node that performed
87
- it, and that statement is the only authority.
80
+ path because its author removed it or because its author never had it, and a
81
+ content hash cannot tell the two apart. Every attempt to infer it failed. So a
82
+ deletion is applied for one reason only — the head that lacks the file
83
+ **descends from this node's own** — and an absence anywhere else reaches the
84
+ folder only through a three-way merge against the common ancestor.
88
85
 
89
86
  What holds it up:
90
87
 
91
- - `fs-collect-removals.spec.ts` (31) — the walk that finds what was removed,
92
- including netting re-adds against removals in order, concluding **nothing**
93
- from a walk that cannot complete, and stopping at a bound rather than
94
- reading a whole history.
95
- - `fs-plan-removals.spec.ts` (19) — which stated removals may be applied, with
96
- two floors rather than one.
97
- - `fs-agent-tombstone-log.spec.ts` (9) — what a restart remembers it deleted.
98
- A restart that forgets is how a deletion is undone by the first peer that
99
- never heard about it.
100
- - `fs-agent-mass-delete-guard.spec.ts` (15) — refusing a deletion that looks
101
- like a loss, *and* allowing a large one that is still a minority, *and*
102
- reporting what it refused so the numbers can be judged.
103
- - At mesh tier: A2 (a delete made while partitioned stays deleted), T2 (a
104
- delete survives a merge with a peer that still holds the file), T4 (a delete
105
- made while cut off is not resurrected on rejoin — a coin flip through four
106
- work packages, now 8 of 8), F1 (removing a **directory** propagates, not just
107
- its files), F7 (100 deletions out of 400 complete everywhere), I7 (a peer's
108
- deletion does not remove a file re-created since), and J9 (a deletion made
109
- while the agent was **down** still propagates).
88
+ - `fs-relate.spec.ts` — how two heads stand, including that a descent found is
89
+ proof even where another part of the history cannot be read, and that a walk
90
+ out of budget answers `fork`, never `behind`.
91
+ - `fs-send.spec.ts` and `fs-agent-mass-delete-guard.spec.ts` — the guards: a
92
+ sender does not author a mass disappearance its watcher did not see, and a
93
+ receiver keeps what an apply would lose.
94
+ - `fs-collect-removals.spec.ts` — the net delta a join uses to tell a stale
95
+ copy from new work, netting re-adds against removals in order.
96
+ - At mesh tier: T2 (a delete survives a merge with a peer that still holds the
97
+ file), T4 (a delete made while cut off is not resurrected on rejoin), F1
98
+ (removing a **directory** propagates), F7 (100 deletions out of 400 complete
99
+ everywhere), **F11** (deletions from alternating nodes, one with a clock 20 s
100
+ fast, all arrive and none returns), I7 (a peer's deletion does not remove a
101
+ file re-created since), J9 (a deletion made while the agent was **down**
102
+ propagates), and the wiped-and-reverted file (a machine that lost its folder
103
+ does not empty the fleet, and is refilled).
110
104
 
111
105
  ### 2.3 That two people editing one file lose nothing
112
106
 
113
- `fs-conflict-resolver.spec.ts` (41) and `fs-manifest.spec.ts` (36) carry the
114
- decisions; `fs-conflict-integration.spec.ts` and `conflict-sync.spec.ts` carry
115
- them end to end. The guarantee is that one version wins **deterministically on
116
- every node**, the loser survives as a renamed conflict copy, and the conflict
117
- is reported rather than silently settled.
107
+ `fs-merge.spec.ts` carries the conflict table on maps; `fs-conflict-rules.spec.ts`
108
+ carries it on disks — one test per row, C1–C6, on two real nodes and a stamping
109
+ hub, each forcing its order instead of racing for it, plus *C3 with no stamp*:
110
+ nothing is decided, nothing is lost, the wait is told, and two nodes do not
111
+ answer each other's announcements in a loop.
118
112
 
119
- The winner is chosen on the edit's own `timeId`, authored where the change was
120
- made — not on which advertisement arrived last and not on the greater content
121
- hash, both of which this package has shipped and both of which produced a
122
- different answer per machine.
113
+ The guarantee: both versions survive, the one that reached the fleet later keeps
114
+ the name — by the hub's stamp, never a clock — every node reaches the same
115
+ verdict, and the conflict is reported. `fs-stamps.spec.ts` holds how a version's
116
+ stamp is derived, including a walk that stops at a row it cannot read yet.
123
117
 
124
118
  At mesh tier: F5 (four nodes editing one file end on one version), F10 (two
125
119
  nodes keep both versions **and say so**), T3 (both changes kept from a shared
126
- ancestor), and `simultaneous-edit.spec.ts` (five rounds of three nodes
127
- contesting one file).
120
+ ancestor), and `simultaneous-edit.spec.ts` (three nodes contesting one file).
128
121
 
129
122
  ### 2.4 That a document never goes backwards
130
123
 
@@ -134,8 +127,13 @@ converged deletion does not come back*, *every node ends on the last save*,
134
127
  *every announcement carries a chain head*, and — under random churn and
135
128
  partitions across three seeds — *a disagreement is never silent*.
136
129
 
137
- These are the expensive ones, and they are the tests that caught a defect no
138
- example-based test could: a receiver catching up recorded itself as the author of
130
+ These are the expensive ones, and they are the tests that caught defects no
131
+ example-based test could. One was the scanner's: Node rounds an mtime to the
132
+ nearest millisecond, so a file the agent applied in the second half of the
133
+ millisecond the next scan started in read as one still being written, and the
134
+ receiver announced the version before it. `fs-scanner.spec.ts` now pins it — a
135
+ rewrite the agent noted reads as written, an un-noted one as the version before.
136
+ Another: a receiver catching up recorded itself as the author of
139
137
  a file it had never edited, 28 seconds after the real edit, and the whole fleet
140
138
  settled one version behind the last save about one run in three.
141
139
 
@@ -149,7 +147,7 @@ loss. The third had never been gated at all, because the test read the fleet's
149
147
  convergence verdict and used only its snapshot.
150
148
 
151
149
  All three are now asserted: the same files, the same bytes, and — if that ever
152
- fails — that some node's `diverged` or `differingPaths` said so. The silence
150
+ fails — that some node's `diverged` said so. The silence
153
151
  check is kept beside the equality check rather than instead of it, because a
154
152
  disagreement nobody noticed is a different defect from one every node is
155
153
  announcing, and a failure should say which. The seed fixes the write sequence
@@ -177,56 +175,112 @@ is renamed aside into `.fsagent-recovered/`, which the scanner ignores.
177
175
 
178
176
  ### 2.6 That a lost message heals itself
179
177
 
180
- `heals-after-forced-divergence.spec.ts` (8 scenarios × 2 transports) drops
178
+ `heals-after-forced-divergence.spec.ts` (scenarios × 2 hub signals) drops
181
179
  messages on purpose: a new file whose push the hub never received, a deletion
182
180
  whose push it never received, a deletion a peer never received, a peer deletion
183
181
  that must **not** be undone, every node healing when the hub received nothing
184
- at all, and a node that misses every forward while another keeps writing. It
185
- keeps the original failure as its own case too.
186
-
187
- `fs-anti-entropy.spec.ts` (36) and `fs-anti-entropy-level1.spec.ts` (10) carry
188
- the decision. Level 1 is **enumerations, not examples** — "for every pair of
189
- views" — because the defect class here is two situations that need opposite
190
- actions arriving as the same value. That matters concretely: a release passed
191
- every example test in the suite, fixed the case it was written for, and then
192
- flipped a production folder between two states about twenty times in ninety
193
- seconds. Ninety seconds of a production folder rewriting itself was an
194
- expensive way to learn something a loop over a three-element set says before
195
- the commit.
182
+ at all, and a node that misses every forward while another keeps writing.
183
+
184
+ There is no separate repair mechanism to test: the hub says its head again on
185
+ the beacon or the bootstrap, and `receive` is the repair. `fs-receive.spec.ts`
186
+ holds that decision — one case per relation — and
187
+ `fs-agent-anti-entropy.spec.ts` the wiring: what the agent hears, what it
188
+ reports, that a head nobody can read is said once per pair, and that a stopped
189
+ receive side stops reporting.
190
+
191
+ ### 2.6b That a host application is told what happened
192
+
193
+ `fs-signals.spec.ts` (41) tests the sink with no filesystem at all, which is
194
+ what lets it assert the awkward parts directly: the cap dropping the oldest, the
195
+ per-kind counters surviving that drop, a listener that throws not costing the
196
+ next one its notification, and a persisted log coming back from a shape nobody
197
+ validated on the way out.
198
+
199
+ That last part is most of the file, deliberately. A signal log is read from a
200
+ folder that users, backup tools and other builds of this agent all write into,
201
+ so it will be truncated, half-written and occasionally produced by a newer
202
+ version. Every branch of that tolerance has a case: not an object, `null`, a
203
+ `signals` that is not an array, an entry missing each required field in turn, a
204
+ total that is not a finite number, and a good entry either side of a bad one.
205
+ Two of those encode decisions rather than defences — an unknown `kind` is
206
+ **kept**, because it is still a true record of something that happened, and
207
+ restoring does **not** fire subscribers, because replaying history through the
208
+ callback would make every restart look like a fresh folder-wide conflict.
209
+
210
+ `fs-agent-signals.spec.ts` (19) is the other half: one case per place in the
211
+ agent that does something to a user's folder, asserting the **fields** rather
212
+ than that something was emitted. A signal with the right kind and the wrong
213
+ `action` is worse than no signal, because it gets filtered into silence.
214
+
215
+ The sink also derives each signal's `id`, and the same ids again from a log
216
+ written before ids existed; two signals saying the same thing in one
217
+ millisecond stay two. A join's `copies` keep only the paths the signal names.
218
+
219
+ The mass-delete guard tests and the mesh harness's `mesh.conflicts` collector
220
+ read the signal channel too: there is no other surface left to assert.
221
+
222
+ ### 2.6c That a host can show the history, and go back
223
+
224
+ `fs-history.spec.ts` (22) walks chains written by hand, because the orders that
225
+ matter are the ones a running fleet produces rarely: both sides of a fork that
226
+ reached the fleet in one announcement, a stamp that disagrees with the graph, a
227
+ merge below a merge. Each states the whole order it expects, and one rule
228
+ outranks every key: an entry is never listed above one made on top of it.
229
+ Pages are asserted to continue exactly where the last stopped, across a fork
230
+ too, and the read-only reader is asserted to leave the store byte for byte as
231
+ it found it.
232
+
233
+ `fs-agent-history.spec.ts` (12) is the same on a running mesh. A pull and a
234
+ merge are in the history, in one order on both nodes. And `restoreRevision`
235
+ makes a folder exactly a revision, as an edit the other node follows. Its
236
+ guards each have a case:
237
+
238
+ - a file saved a moment before is recorded first rather than pruned. This is
239
+ the case that found the settle rule hiding a brand-new file from the restore;
240
+ - a file still being written makes the restore `busy`, not lossy;
241
+ - the agent's own log and the set-aside copies survive the prune;
242
+ - a revision that would empty the folder is refused before anything is
243
+ written.
196
244
 
197
245
  ### 2.7 That a node claims only what it changed
198
246
 
199
247
  The standing design rule: one identical chain on every client, an edit exists
200
- only where the change was made, a receiver adopts and never authors, and no
201
- edit without predecessors.
202
-
203
- `fs-agent-authorship.spec.ts`, `fs-agent-no-laundering.spec.ts` (6, *a node
204
- does not re-advertise what it adopted*), `fs-agent-own-echo.spec.ts`,
205
- `fs-agent-self-parent.spec.ts`, `fs-agent-inbound-verdict.spec.ts` (7),
206
- `fs-agent-stale-reconnect.spec.ts` (13) and
207
- `fs-agent-send-retires-left-state.spec.ts` hold the edges, with
208
- `fs-edit-chain.spec.ts` (20), `fs-classify.spec.ts` (11) and
209
- `fs-chain-crosses-the-wire.spec.ts` under them.
248
+ only where the change was made, a receiver adopts and never authors.
249
+
250
+ `fs-agent-authorship.spec.ts` (a received file, a stated deletion, a real edit
251
+ after both, and an absence only a lagging scan reports), `fs-agent-no-laundering.spec.ts` (a node does not re-advertise
252
+ what it adopted; a partial apply stays quiet; authoring never reads a pass that
253
+ began before its own write — the F9 revert, pinned deterministically — and
254
+ reads the watcher's last pass otherwise, so a stalled copy is not looked at
255
+ again), `fs-agent-own-echo.spec.ts`,
256
+ `fs-agent-self-parent.spec.ts` and `fs-agent-stale-reconnect.spec.ts` hold the
257
+ edges, with `fs-edit-chain.spec.ts` and `fs-chain-crosses-the-wire.spec.ts`
258
+ under them.
259
+
260
+ The receiving half: an apply writes over nothing it has not read.
261
+ `fs-agent-receive-degradation.spec.ts` lands a save between a receive's scan and
262
+ its apply — once under an apply, once under a merge. The apply stops, the save
263
+ becomes this node's work, and the head is merged; a scan that cannot catch up
264
+ stops receiving again after `RECEIVE_AGAIN_MAX` tries, and the next time the
265
+ head is said tries again.
210
266
 
211
267
  Also here: `fs-ref-vs-content.spec.ts` — identical content written at different
212
- times gives **one** ref. mtime is deliberately not part of content identity,
213
- because it does not survive a restore byte for byte and on Windows regularly
214
- does not, and while it was in the identity the same bytes gave a different ref
215
- per machine and a node's deletions were refused by everybody.
268
+ times gives **one** ref and one content map. mtime is deliberately not part of
269
+ content identity: while it was, the same bytes gave a different ref per machine.
216
270
 
217
271
  ### 2.8 That a hostile or broken filesystem breaks only itself
218
272
 
219
273
  | suite | what it survives |
220
274
  | --- | --- |
221
- | `fs-agent-locked-file.spec.ts` (7) | a file another process holds open — the rest of the restore lands, every locked file is named, a non-lock write failure still aborts, and the half-applied state is **not** advertised to peers |
275
+ | `fs-agent-locked-file.spec.ts` (8) | a file another process holds open — the rest of the restore lands, every locked file is named, a non-lock write failure still aborts, and the half-applied state is **not** advertised to peers |
222
276
  | `fs-impossible-filename.spec.ts` (4) | a path the filesystem refuses — a 300-character path, `CON.txt`. Each blocks only itself |
223
277
  | `fs-filenames.spec.ts` (5) | a German filename round-tripping byte for byte, two Unicode spellings of one name not destroying each other, a case-only rename |
224
- | `fs-hostile-tree.spec.ts` (4) | a tree from a peer is not trusted with paths — no escaping the sync root |
278
+ | `fs-hostile-tree.spec.ts` (7) | a tree from a peer is not trusted with paths — no escaping the sync root |
225
279
  | `fs-filetype-changes.spec.ts` (6) | a path that changes what it IS: file → directory, directory → file, symlinks |
226
280
  | `fs-scanner-vanish.spec.ts` (12) | an entry deleted between `readdir` and `stat` |
227
281
  | `fs-disk-full.spec.ts` (3) | ENOSPC — a clean abort with a message, not a silent standstill |
228
282
  | `fs-slow-copy.spec.ts` (3) | a file still being written: never hashed half-done, and one unsettled file does not stop the folder |
229
- | `fs-clock-skew.spec.ts` (3) | a machine whose clock is wrong — a file is visible whatever its timestamp says |
283
+ | `fs-clock-skew.spec.ts` (6) | a machine whose clock is wrong — a file is visible whatever its timestamp says |
230
284
  | `fs-agent-blob-stream.spec.ts` (3) | a file larger than one socket message, and a transfer that breaks off mid-file |
231
285
 
232
286
  ### 2.9 That coming back does not cost what you missed
@@ -248,9 +302,6 @@ about the test changes.
248
302
 
249
303
  ### 2.10 That the wire format is what it claims to be
250
304
 
251
- `fs-bucket-sync.spec.ts` (29) pins the format itself — message bodies are JSON
252
- because a POSIX filename may contain any byte but `/` and NUL.
253
-
254
305
  There is no mixed-version test, because there is only one format — every node
255
306
  announces a chain head, and the fleet is upgraded together.
256
307
 
@@ -355,21 +406,22 @@ Open items are in
355
406
  ## 5. File index
356
407
 
357
408
  Counts are what `pnpm test` reports per file, so suites that generate cases in a
358
- loop are counted as they run. They sum to the 923 above.
409
+ loop are counted as they run. They sum to the 771 above.
359
410
 
360
411
  ### Mesh tier
361
412
 
362
413
  | file | n | what it covers |
363
414
  | --- | --- | --- |
364
415
  | `mesh/fs-mesh.spec.ts` | 6 | T1–T7, the scenarios the sync has to survive |
365
- | `mesh/fs-mesh-field-defects.spec.ts` | 10 | F1–F10, field defects reduced in process |
366
- | `mesh/fs-mesh-matrix.spec.ts` | 9 | the scenario matrix at mesh tier (L7, L8, I7, I10, J4+J5, J9 ×2) |
416
+ | `mesh/fs-mesh-field-defects.spec.ts` | 11 | F1–F11, field defects reduced in process |
417
+ | `mesh/fs-mesh-matrix.spec.ts` | 9 | the scenario matrix at mesh tier (L7, L8, I7, I7b, I10, J4+J5, J6, J9 ×2) |
367
418
  | `mesh/fs-mesh-invariants.spec.ts` | 7 | invariants over the route, not the destination |
368
419
  | `mesh/fs-mesh-wiped-and-reverted.spec.ts` | 6 | a node comes back empty, or holding an older copy |
369
- | `mesh/fs-mesh-additive.spec.ts` | 3 | additive reconciliation (A1–A3) |
370
420
  | `mesh/fs-mesh-catchup-cost.spec.ts` | 2 | coming back does not cost what you missed |
421
+ | `fs-conflict-rules.spec.ts` | 8 | the conflict table C1–C6 on disks, and C3 before a stamp is known |
422
+ | `fs-agent-history.spec.ts` | 12 | the history a host shows — a pull, a merge, one order — and going back to a revision exactly |
371
423
  | `fs-editor-patterns.spec.ts` | 6 | how real programs save |
372
- | `fs-chain-crosses-the-wire.spec.ts` | 4 | the chain crosses the wire |
424
+ | `fs-chain-crosses-the-wire.spec.ts` | 3 | the chain crosses the wire |
373
425
  | `field-repro.spec.ts` | 3 | reported failures, reproduced verbatim |
374
426
 
375
427
  ### Client–server tier
@@ -379,7 +431,7 @@ loop are counted as they run. They sum to the 923 above.
379
431
  | `client-server/socket-mock.spec.ts` | 35 | the shared suite (`shared-sync-tests.ts`) over `SocketMock` |
380
432
  | `client-server/socket-io.spec.ts` | 35 | the same shared suite over a real socket.io server at production's 50 MB limit |
381
433
  | `client-server/advanced-sync.spec.ts` | 15 | three clients, catch-up, teardown and restart, 10 MB, 100 files, rapid overwrites |
382
- | `client-server/heals-after-forced-divergence.spec.ts` | 15 | deliberately dropped messages |
434
+ | `client-server/heals-after-forced-divergence.spec.ts` | 14 | deliberately dropped messages |
383
435
  | `client-server/conflict-sync.spec.ts` | 2 | a real offline divergent edit, both versions preserved |
384
436
  | `client-server/simultaneous-edit.spec.ts` | 4 | five rounds of three nodes contesting one file |
385
437
 
@@ -387,57 +439,53 @@ loop are counted as they run. They sum to the 923 above.
387
439
 
388
440
  | file | n | what it covers |
389
441
  | --- | --- | --- |
390
- | `fs-agent.spec.ts` | 90 | the agent's surface |
391
- | `fs-scanner.spec.ts` | 56 | scanning, watching, the scan cache |
392
- | `fs-conflict-resolver.spec.ts` | 41 | tip ordering, winners, three-way merge, copy naming |
393
- | `fs-anti-entropy.spec.ts` | 38 | the repair decision, by example |
394
- | `fs-manifest.spec.ts` | 46 | buckets, digests, reconciliation plans |
395
- | `fs-agent-degradation.spec.ts` | 89 | what the agent does when a dependency fails, and the shapes no scenario reaches |
396
- | `fs-collect-removals.spec.ts` | 31 | the removal walk |
397
- | `fs-bucket-sync.spec.ts` | 29 | the wire format |
398
- | `fs-ignore.spec.ts` | 28 | glob ignore patterns, and every legacy prefix |
399
- | `fs-blob-adapter.spec.ts` | 26 | file ↔ blob |
400
- | `fs-edit-chain.spec.ts` | 20 | the chain |
401
- | `fs-plan-removals.spec.ts` | 23 | which removals may be applied |
402
- | `fs-agent-mass-delete-guard.spec.ts` | 16 | refusing a deletion that looks like a loss, and reporting it |
403
- | `fs-agent-concurrent-write.spec.ts` | 9 | two writes of one path must not blend — 200 rounds per assertion |
404
- | `fs-agent-stale-reconnect.spec.ts` | 17 | a peer reconnecting with a stale tree |
405
- | `fs-scanner-vanish.spec.ts` | 12 | an entry that vanishes mid-scan |
406
- | `fs-classify.spec.ts` | 11 | behind / ahead / fork / incomplete |
407
- | `fs-anti-entropy-level1.spec.ts` | 12 | the same decision, **enumerated** |
408
- | `fs-agent-tombstone-log.spec.ts` | 14 | what a restart remembers it deleted |
442
+ | `fs-agent.spec.ts` | 81 | the agent's surface |
443
+ | `fs-scanner.spec.ts` | 62 | scanning, watching, the scan cache, the agent's own writes |
444
+ | `fs-agent-degradation.spec.ts` | 15 | what the agent does when a dependency fails, and the shapes no scenario reaches |
445
+ | `fs-agent-receive-degradation.spec.ts` | 16 | receiving when a part of it fails — a tree it cannot read, a stamp or state it cannot file, a folder that moves under the apply, a join |
446
+ | `fs-receive.spec.ts` | 11 | what a node does with a head that arrived |
447
+ | `fs-relate.spec.ts` | 11 | same / behind / ahead / fork / incomplete |
448
+ | `fs-merge.spec.ts` | 22 | `merge3` — the conflict table by example — and copy naming |
449
+ | `fs-stamps.spec.ts` | 11 | where each version reached the fleet, derived from payloads |
450
+ | `fs-send.spec.ts` | 9 | the sender answers for its edits (`planAuthoring`) |
451
+ | `fs-collect-removals.spec.ts` | 26 | the removal walk, and `lastEditOf` |
452
+ | `fs-edit-chain.spec.ts` | 16 | the chain |
409
453
  | `fs-plan-join.spec.ts` | 9 | joining, decided before anything is written |
454
+ | `fs-agent-mass-delete-guard.spec.ts` | 14 | refusing a deletion that looks like a loss — before anything is written — and reporting it; a prune never touches what the scanner ignores |
455
+ | `fs-agent-anti-entropy.spec.ts` | 7 | receiving what the hub says |
456
+ | `fs-agent-stale-reconnect.spec.ts` | 14 | a peer reconnecting with a stale tree |
457
+ | `fs-agent-no-laundering.spec.ts` | 8 | a node does not re-advertise what it adopted |
458
+ | `fs-agent-authorship.spec.ts` | 4 | a node claims only what it changed |
459
+ | `fs-divergence-is-content.spec.ts` | 2 | a divergence is a difference in CONTENT |
460
+ | `fs-ref-vs-content.spec.ts` | 6 | ref identity vs content identity |
461
+ | `fs-agent-concurrent-write.spec.ts` | 12 | two writes of one path must not blend — 200 rounds per assertion — and the synchronous writer the bookkeeping uses |
410
462
  | `fs-agent-incremental-restore.spec.ts` | 8 | a restore writes only what changed |
411
463
  | `fs-agent-locked-file.spec.ts` | 8 | a file held open by another process |
412
- | `fs-agent-inbound-verdict.spec.ts` | 7 | is an inbound ref news to this agent |
413
- | `fs-agent-anti-entropy.spec.ts` | 7 | the anti-entropy wiring |
414
- | `fs-ref-vs-content.spec.ts` | 6 | ref identity vs content identity |
415
- | `fs-filetype-changes.spec.ts` | 6 | a path changes what it is |
416
- | `fs-agent-no-laundering.spec.ts` | 6 | a node does not re-advertise what it adopted |
464
+ | `fs-agent-blob-stream.spec.ts` | 3 | a restore streams the blob |
465
+ | `fs-agent-signals.spec.ts` | 19 | one case per thing the agent signals, asserting the fields |
466
+ | `fs-signals.spec.ts` | 41 | the signal sink: the cap, the counters, ids, and a log read from a hostile folder |
467
+ | `fs-history.spec.ts` | 22 | the history walk: its order on hand-written chains, pages, cursors, and the read-only reader |
468
+ | `fs-ignore.spec.ts` | 28 | glob ignore patterns, and every legacy prefix |
469
+ | `fs-blob-adapter.spec.ts` | 26 | file ↔ blob |
417
470
  | `fs-db-adapter.spec.ts` | 6 | storing a tree with its predecessors |
418
- | `fs-agent-conflict-log.spec.ts` | 5 | recording a resolved conflict |
419
- | `fs-conflict-integration.spec.ts` | 6 | conflict resolution end to end |
420
- | `fs-filenames.spec.ts` | 5 | unicode and case |
421
- | `fs-level2-surfaces.spec.ts` | 5 | the model must be able to EXPRESS it |
422
471
  | `blob-io.spec.ts` | 5 | storing a file as a blob |
423
- | `fs-agent-ancestry-warning.spec.ts` | 4 | a transport with no ancestry must say so |
424
- | `fs-divergence-is-content.spec.ts` | 4 | a divergence is a difference in CONTENT |
472
+ | `fs-scanner-vanish.spec.ts` | 12 | an entry that vanishes mid-scan |
473
+ | `fs-scanner-scan-coalescing.spec.ts` | 4 | a burst collapses into at most two passes |
425
474
  | `fs-hostile-tree.spec.ts` | 7 | a peer's tree is not trusted with paths |
426
475
  | `fs-impossible-filename.spec.ts` | 4 | a path the filesystem refuses |
427
- | `fs-scanner-scan-coalescing.spec.ts` | 4 | a burst collapses into at most two passes |
428
- | `fs-agent-silent-joiner.spec.ts` | 4 | an agent with nothing to say does not speak |
429
- | `fs-stage-timings.spec.ts` | 4 | per-stage timings |
430
- | `fs-agent-authorship.spec.ts` | 3 | a node claims only what it changed |
431
- | `fs-agent-blob-stream.spec.ts` | 3 | a restore streams the blob |
476
+ | `fs-filetype-changes.spec.ts` | 6 | a path changes what it is |
477
+ | `fs-filenames.spec.ts` | 5 | unicode and case |
432
478
  | `fs-clock-skew.spec.ts` | 6 | a file is visible whatever its timestamp says |
479
+ | `fs-slow-copy.spec.ts` | 3 | a file being written is not distributed half-done |
433
480
  | `fs-disk-full.spec.ts` | 3 | a full disk |
434
481
  | `fs-scale.spec.ts` | 3 | scale and endurance |
435
- | `fs-slow-copy.spec.ts` | 3 | a file being written is not distributed half-done |
436
- | `fs-agent-announced-heads.spec.ts` | 2 | parked announcement heads, and their cap |
437
- | `fs-agent-rescan-commits.spec.ts` | 2 | a change found only by the safety rescan |
482
+ | `fs-agent-silent-joiner.spec.ts` | 4 | an agent with nothing to say does not speak |
483
+ | `fs-stage-timings.spec.ts` | 4 | per-stage timings |
484
+ | `fs-agent-rescan-commits.spec.ts` | 1 | a change found only by the safety rescan |
438
485
  | `fs-agent-self-parent.spec.ts` | 2 | a push that parents itself |
439
486
  | `fs-rename-folder.spec.ts` | 2 | renaming a folder |
440
487
  | `fs-agent-own-echo.spec.ts` | 1 | its own advertisement echoed back |
441
- | `fs-agent-send-retires-left-state.spec.ts` | 1 | leaving a state retires it |
442
488
  | `example.spec.ts` | 1 | the README example, against a golden |
443
489
  | `setup/goldens.spec.ts` | 1 | the golden mechanism itself |
490
+ | `dna/dna.spec.ts` | 1 | the files the rljson DNA generates are as it ships them |
491
+ | `fs_agent_version.test.ts` | 1 | the version file gg writes agrees with `package.json` |