Adopt the user's development rule: one lane at a time, no test suites

CLAUDE.md gains a 'How this project is developed' section: strictly
serial Dev (Opus 5) -> QA (Sonnet 5, code quality) -> lead inspection;
commit along the way without requiring every commit to compile; the
user is the tester. docs/loop.md, docs/topo.md and TODO.md are
rewritten to a serial lane order with no test-writing items; the test
targets are removed and tools/gates.sh is lint + layering grep + build.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
lucioandClaude Fable 5.1 committed 2026-09-15 23:55:41 -07:00
1 parent 671b3dfa61
commit 87aeee6f93
15 files changed
+391 -617

No files matched your search

+1 -2
View File
@@ -28,8 +28,7 @@ One paragraph: what this lane delivers, why it exists, and which
## Status / TODO
- [ ] `<file>`: item
- [ ] `Tests/<target>/<file>`: item
- [ ] `<file>`: the Windows behaviour ported, with its citation
- [ ] `docs/protocol.md`: citations verified / marks flipped
## Work log
+4 -1
View File
@@ -63,7 +63,10 @@ works on this machine at all. Nothing in later lanes can start until
missing) backed by `MWBMac/Permissions.swift` (preflight only).
- [x] `tools/lane.sh` worktree helper; `docs/loop.md` procedure;
`docs/features/TEMPLATE.md`.
- [x] `tools/gates.sh` green: 3 XCTest cases, 0 warnings, lint clean.
- [x] `tools/gates.sh` green (lint, layering grep, build). The three
XCTest cases from the first cut were removed the same day when the
user set the no-test-suites rule; the layering check moved into
`gates.sh` as a grep.
- [ ] Not done, deliberately: no CI workflow. The lucisv Gitea runner
exists on this Mac (`verilogrustformatter/tools/RELEASING.md`), but
a CI that runs `swift test` for a project that will soon post
+10 -14
View File
@@ -20,15 +20,14 @@ point; there is no "better" cipher choice to make here.
- **PBKDF2 goes through `CCKeyDerivationPBKDF`** with
`kCCPRFHmacAlgSHA512`, 100 000 rounds, 32 bytes. Password bytes are
UTF-8 of the key string — `Rfc2898DeriveBytes.Pbkdf2(string, …)` uses
UTF-8 (documented .NET behaviour). Pinned by a Python
`hashlib.pbkdf2_hmac('sha512', …)` vector.
UTF-8 (documented .NET behaviour).
- **The magic hash truncates each UTF-16 code unit to a byte**
(`(byte)st[i]`, `Encryption.cs:184`) and hashes a fixed 32-byte
buffer; keys longer than 32 characters contribute only their first 32.
The `<< 23` overlap is reproduced with `UInt32` wrapping arithmetic in
the same order as the C# expression.
- **Salt and IV are fresh per direction and never reused**; Windows
tests pin uniqueness (`EncryptionTests.cs:59-68`) and so do ours.
- **Salt and IV are fresh per direction and never reused**
(`EncryptionTests.cs:59-68` documents the Windows expectation).
- **The sacrificial block is part of the cipher type's contract**: the
writer emits it right after the header, the reader discards the first
16 plaintext bytes. Callers never see it (topo.md handshake 2).
@@ -53,7 +52,7 @@ public struct CipherReader {
}
```
`RandomBytes` is injectable so tests can pin whole streams.
`RandomBytes` is injectable so the lead can reproduce a stream by hand when checking against a Windows capture.
### Consumed
@@ -61,15 +60,12 @@ public struct CipherReader {
## Status / TODO
- [ ] `Sources/MWBCore/MagicHash.swift` + `Tests/MWBCoreTests/MagicHashTests.swift`
with `Tests/Fixtures/magic_reference.py` (run once; vector committed).
- [ ] `Sources/MWBCore/CipherStream.swift`: key derivation, writer, reader.
- [ ] `Tests/MWBCoreTests/CipherStreamTests.swift`: PBKDF2 vector;
round-trip; byte-at-a-time reader equals all-at-once; unique
header per instance; wrong key ⇒ garbage without throwing;
descriptions omit secrets.
- [ ] Note in `docs/perf/README.md`: PBKDF2 at 100 000 rounds SHA-512
costs ~N ms per connection open (measure; it is per direction).
- [ ] `Sources/MWBCore/MagicHash.swift`: `magicNumber(for:)` per §2.1,
every step cited to `Encryption.cs:173-200`.
- [ ] `Sources/MWBCore/CipherStream.swift`: PBKDF2 key derivation,
`CipherWriter`, `CipherReader` (header, sacrificial block,
streaming CBC), cited to `Encryption.cs` and `Common.cs:1528-1558`.
- [ ] `docs/perf/README.md`: note the PBKDF2 cost per connection open.
## Work log
+6 -13
View File
@@ -19,9 +19,8 @@ crypto.
`ProcessReceivedDataEx` does, so a decoded packet's bytes 1–3 are
always 0 and re-sealing is deterministic.
- **The checksum covers bytes 2..31 only, even on 64-byte packets.** We
reproduce this, and pin it with a test that corrupts byte 40 of a
64-byte packet and asserts it is *not* detected — the encryption
layer, not the checksum, is what protects the name half.
reproduce this; the encryption layer, not the checksum, is what
protects the name half. Say so in a comment at the checksum loop.
- **Unknown type values decode as `.unknown(UInt8)`** rather than
throwing, so a newer Windows build cannot desynchronise our framing.
Size for an unknown value follows the big/small rule (`0x80` bit ⇒ 64,
@@ -66,16 +65,10 @@ same change and session codes against the README.
## Status / TODO
- [ ] `Sources/MWBCore/Packet.swift`: `PackageType` (every value in
protocol §1.2), `isBig`, `Packet` with union views.
- [ ] `Sources/MWBCore/Framing.swift`: `seal` / `open` per §1.3.
- [ ] `Tests/MWBCoreTests/PacketTests.swift`: offsets pinned per field,
big/small over all 256 values, name padding/trim, non-ASCII refused.
- [ ] `Tests/MWBCoreTests/FramingTests.swift`: hand-assembled golden
bytes for Handshake / Mouse / Keyboard / Matrix(slot 4, both
flags) / ClipboardText chunk; round-trip property test; bytes
2..31 corruption detected; byte 40 corruption *not* detected.
- [ ] `docs/protocol.md`: add any offset or rule learned; keep
`[transcribed]` marks until interop-vectors.
protocol §1.2, cited), `isBig`, `Packet` with the union views.
- [ ] `Sources/MWBCore/Framing.swift`: `seal` / `open` per §1.3, each
constant cited to `SocketStuff.cs`.
- [ ] `docs/protocol.md`: add any offset or rule learned while porting.
## Work log