Repository navigation
ensemble: let the code speak — pay down comment debt across the workspace - #73
Merged
Merged
Conversation
Two files, two problems. hives.rs had a doc comment on every manifest field, ninety-nine lines of it, saying what each field meant. The field names already said it. `name`, `version`, `proto_version`, `chis`, `source`, `bind`, `nestler_id`, `bee`, `hid`, `hid_verified`, `models`, `tools`, `provides` — the reader learns the shape from the struct. What the comments added was the parts the shape cannot carry: that `source` is untrusted and must never be auto-fetched, that `chis` is the advertised list and not the per-tone `chi` discriminator, that `hid` is the dedup key with `nestler_id` as its fallback. Those moved to the module header, which is where they belong — they are contract, not field documentation. kad.rs was one 645-line file held together by five banner comments marking sections that were not actually separate. It is now seven modules: distance, bucket, table, state, wire, lookup, and the root. The banners are gone because the boundaries are real. Both keep their `//!` headers, which carry the things code cannot say: why kad is homegrown rather than libp2p-kad, what kad deliberately does not do yet, and how XOR distance orders. The kad header also now states the distance ordering and the 256 self-sentinel, which the per-function comments had repeated three times in slightly different words. kad gained one method, `KBucket::retain`, so the routing table no longer reaches into the bucket's private entries to do a forget. Same behaviour, one owner of the invariant. Tests: 122 pass in ensemble, unchanged.
The rest of the ensemble core. Same rule as the last commit: a comment earns its place only when the code cannot carry the meaning. uri.rs claimed aliases match `[A-Za-z0-9._-]+`. Nothing enforces that, anywhere. The claim is gone; what the parser actually does — classify the host by shape, known role prefix plus hex means a hid — is now in the module header where it is true. onchain.rs decoded the ABI by hand, with a ten-line comment describing the word layout and bare slice indices in the code. The layout is now named: OWNER, PUBKEY, MANIFEST_HASH, MANIFEST_URI, UPDATED_AT, and a WORD stride. The decoder reads as the contract it implements. headroom.rs had a comment that was wrong. It said NaN occupancy is treated as Cool "by falling through all branches", but every branch falls through to Refuse — a humd with a NaN ratio would have advertised itself as refusing work. `from_occupancy` now returns Cool for NaN, and a test pins it. tls.rs and tcp.rs each had their trust model and handoff shape documented twice — once in the module header, once on the item. The duplicates are gone. The two facts the code genuinely cannot state, that SNI is never checked and that the handshake signature is not chain verified, moved up into the module header. opening.rs gained a module header. Its lost-wakeup hazard was a comment inside `wait`; the ordering requirement is now stated where the whole file is read. Ensemble: 528 comment lines to 198, all of it `//!` at the top of a module. 123 tests pass. Workspace warnings unchanged at 28.
Same pass over the daemon. The bulk of what is left in these files is `//!` at the top of a module, which stays. Two renames, because the names were not saying what the code did. `Reach::declares_chi` returned whether a client should be handed a tone for a chi, not whether the client declared it — an empty declared set accepts every chi, so the old name read as the opposite of the truth. It is now `accepts_chi`. `set_chis` replaced the previous set rather than adding to it, which is what makes a re-hello that narrows scope actually narrow it; it is now `replace_chis`. conn.rs had a comment marking every step of the dispatch path. The three facts in that path that the code cannot state — the order of the checks, that a hello does not claim a sigil by itself, that a sink that panics does not stop the read loop — moved into the module header. The step markers are gone. drone.rs lost a doc on every verdict variant. What each verdict means for the host is what the dispatch loop branches on, so it went to the module header as a list, where it reads as the contract it is. The `Thrum` private accessors in conn.rs keep their rationale in the header rather than a banner comment above the impl block. humd: 425 comment lines to 332, of which 302 are module headers. 48 tests pass.
ids.rs held two unrelated identifiers behind one file: HumId, the Crockford-base32 session id, and Hid, the role-tagged pubkey hash. They are now humid.rs and hid.rs, and each carries its own `//!` header instead of a `///` block on the type. `sign_socket_hello` returned a bare 3-tuple, so the only thing saying which element was the pubkey and which the signature was a doc comment. It now returns a `SocketSignature` with named fields, and the comment is gone. The base32 codec had comments explaining where the bits go, because the shifts are unreadable otherwise. The three magic numbers are now named: TIMESTAMP_CHARS, TRAILING_PAD_BITS, PAYLOAD_OFFSET_BITS. The arithmetic reads the same and now says what it is. The `Hid` header keeps the note that the short form widens with zeros and is for logs and sigils rather than security-bearing addresses. hum-identity: 102 comment lines to 88, all module headers. 13 tests pass. Workspace warnings unchanged at 28.
lib.rs is a table of paths, and every entry had a doc comment saying what it was for. The names mostly said it already — `humd_key`, `penny`, `bees_snapshot`, `runtime_info` — so the comments are gone. The ones that did not are now in the module header as a table: which XDG root holds what, and the rule that the `*_BASENAME` constants are the single source of truth for every filename. The revocation list keeps the two facts worth knowing. It lives here rather than in humd so `humctl` can edit it without the daemon's dependency tree, and an absent or unparseable file yields an empty list rather than an error — failing closed would lock every bee out of the socket, and a daemon that admits nobody is worse than one that admits a revoked bee. config.rs lost its section banners and per-field docs. The schema story moved to the module header: serde tolerates unknown keys, so validity is enforced by the schema rather than the deserializer, and a `hives` block in hum.json is a lint finding rather than a silent no-op. hum-paths: 113 comment lines to 91. 14 tests pass.
Not chi.rs. That one is the exception, and deliberately so: codegen parses the `///` lines above each chi variant and emits them as the protocol documentation in the TypeScript, Python, and Go clients. Strip them and every bee author in every language loses the wire contract. `cargo run -p codegen -- --check` is green across all three targets, which is the check that proves the other files here are safe to touch. views.rs had 34 one-line docs naming the chi each body struct belongs to — `HelloBody` for `hello`, and so on. The struct name already says it. The one exception, `DroneLoad`, is the nested payload of a `drone` tone rather than a chi, and that is now in the module header. envelope.rs keeps the merge rule, which the code cannot state on its own: envelope fields win, so a body can never shadow `chi` or `rid`. prims.rs lost the sigil and echo descriptions to its module header. 41 tests pass. Generated clients unchanged.
codegen's own comments went, but the comments inside its raw string literals stayed: those are the Go and TypeScript client source, emitted verbatim into the generated files. The Go `// Sigil returns the ...` comments are the client's own godoc, not codegen's narration. Two notes survived because the code cannot state them. The Python emitter reorders fields so optional ones come last, because a dataclass with a defaulted field before a required one will not compile. And `angle_ty` is called with the value argument index — 1 for BTreeMap, 0 for Vec — which is now a named constant rather than a bare number. thehum's `Event` had a doc on every field. The names carry it, except for two facts that moved to the module header: `prev_hash` is the sha256 of the prior event's canonical bytes, so the log is a hash chain, and `ts_ms` is the append time that reading code must use rather than `now()`. The replay handler must be pure — no clocks, no rng, no env reads — so a rebuild lands on the same state as the original run. That went to read.rs's header. thehum: 24 + 7 tests pass. Generated clients unchanged.
The sim test files had `//!` headers that restated the scenario prose in scenarios/*.md — the same narrative in two registers, which is what the scenarios README warns against. The headers now point at the prose. The prose is the contract; the test is the witness. That also cleared a stale claim. phone_laptop_roam's header said the test was `#[ignore]`d pending reply-tone routing and would fail at the recv step. It was neither ignored nor failing — it passes. The header was describing a past that had stopped being true. `Sim::wire` is now `Sim::wire_unauthenticated`. The old name read like the general case, and the doc had to warn that `wire_signed` is what you want for a test about identity. The name now carries the warning at all 20-odd call sites. The comments that stayed are the ones explaining a race: why co_pilot sleeps after attaching its observer, why liveness polls instead of sleeping, why federation_handoff polls rather than waiting a fixed interval. Those are not narration — they are the reason the test is not flaky. 405 tests pass, up from 404. The extra one is phone_laptop_roam, which now runs.
kad_integration.rs had a 51-line module header that was a debugging
diary — it narrated the round-by-round reasoning, including the false
starts ("no, that defeats the point", "A installs a *direct* link to
C, D, E's hubs… no"). What survives is the contract: five humds in a
line, A knows only B, and the lookup must reach E.
The constraint that shapes the test is now stated once: homegrown kad
can only query peers it has a live PeerConnection to, so the test
drives the expansion explicitly. Real T4 would dial the advertised
hints through the Transport trait.
tcp_integration.rs carried a 30-line comment weighing three ways to
install the inbound endpoint under the right peer id, and settling on
the outbound-only routing path. The resolution is now one sentence:
A's outbound endpoint already knows it is talking to B, and B only
subscribes, never routes back.
All ensemble tests pass.
hum-nest's `Egg` had a doc on every field. The names carry them, with two exceptions that moved to the module header: `resume_id` is a foreign identifier hum did not mint, and `fresh` is ignored when `resume_id` is set. `Propensity` and `Suspicion` are enumerated wire semantics — the variant names alone do not say when a forager should send a full transcript versus just the new turn. Both went to the module header, where they read as the contracts they are. serve.rs keeps the comments that explain a race or a CLI quirk: why the connect log escalates to WARN only after a grace window, why `--resume` fails on the first turn, why the result event rather than stderr carries claude's failure. Those are not narration. limits.rs keeps its `// SAFETY:` comments. Those are Rust's `undocumented_unsafe_blocks` convention, not commentary. suspicion_regex.rs's constant names carry the tier, so the comments above each pattern bank went. The one note that stayed is the TS parity constraint on the greeting pattern, because the two regexes have to agree byte-for-byte. 18 hum-nest tests pass, 11 hum-mcp.
hum/src/main.rs is clap. Every doc comment on a subcommand or argument *is* the --help text, so those stay — they are the user interface, not commentary. The 25 doc comments on ordinary functions went, along with the section banners and the step markers in `hum doctor`. One fix came out of reading them. Clap joins doc lines with a space, so `hum hive --help` was printing the usage block as a single unreadable run-on paragraph. `verbatim_doc_comment` on the four subcommands that carry a usage block makes clap preserve the line breaks, so the help now reads as the list it was written as. hum-thrum's item docs went. The crate is four functions with a module header that already says what each one is. 1 hum-thrum test passes.
The last pass over the crates that were not in the ensemble blast radius: humd, hum-paths, hum-identity, hum-mcp, thehum, thrum-core, codegen, hum-nest. Most of what was left was a doc comment on a method whose name already said what the method did. Those went. What stayed is what the name cannot carry. `codegen::protocol` still names the generic-argument index for each container type, because `angle_ty(&args, 1)` reads as an off-by-one until you know the convention. The Python emitter still explains why it reorders fields. `thrum-core`'s version bump rules moved to the crate header, since that is the file a protocol change lands in. Two things are load-bearing and stayed where they were: the `// SAFETY:` comments on the `unsafe` blocks in hum-nest's limits.rs, which are Rust's `undocumented_unsafe_blocks` convention, and the doc comments on hum's clap types, which are the `--help` output. 405 tests pass. Clippy output is byte-identical to HEAD — no new lint issues, and the one collapsible-if in codegen is pre-existing on the local 1.98.1 toolchain.
`///` and `//` are now at zero across the workspace. `//!` module headers remain — that is where the prose belongs. The chi registry was the reason this was not a pure deletion. codegen parsed the `///` lines above each chi variant and emitted them as the protocol documentation in the TypeScript, Python, and Go clients, so those comments were a build input, not commentary. Removing them would have deleted the wire contract from every bee author's language. So the contract moved to where it belongs: WIRE.md. Its registry table gained a `description` column, which is the canonical one-liner the clients carry as their doc comment. codegen now reads that column instead of the Rust doc comments, and the four copies — WIRE.md, chi.rs, and the three clients — cannot drift. The generated clients are byte-identical to before this change. The only difference is where the text comes from. Two things fell out of the move: WIRE.md had already drifted. It was missing `tool-info` and `backfill`, so the spec a client author would read was two chis short of the registry. Both are now present. codegen now fails if a chi in the Rust enum has no row in WIRE.md. That is the check that would have caught the drift. `hum/src/main.rs` was clap: the doc comments were the `--help` output. They are now `about` / `help` attributes, and every help output is byte-identical to before. `hum-nest/src/limits.rs` had `// SAFETY:` comments on its unsafe blocks. The safety argument moved to the module header, which now states the invariant once: the blocks run post-fork and pre-exec, each is one async-signal-safe libc call, and nothing between the fork and the exec allocates or takes a lock. The `setpriority` call was pulled into its own `set_priority` fn so the errno dance reads as a unit. 405 tests pass. Workspace warnings unchanged at 28.
Pre-existing on main, but it is the one thing that makes `cargo clippy -p ensemble -p hum-paths --all-targets -- -D warnings` fail on a toolchain newer than CI's pin. The chain of let-conditions reads the same as the nested version. Also drops two stale stashes left over from the humd/thrumd crate fold. Their content predates the move and is superseded by what is on main.
Both had a long_about, which switches clap to the long-help layout. Their original doc comments were single paragraphs, so clap used the short form. Dropping the long_about restores it. Every help output is now byte-identical to before the paydown.
man/hum.1 has existed since PR #55 and was never installed. The installer only ran `cargo install` for the three binaries, and the release workflow is source-only, so the page was reachable by nobody. The installer now copies it into the first writable directory on the standard man path: /usr/local/share/man, then $XDG_DATA_HOME/man. The file goes in the man1 subsection, which is where `man hum` looks for a page named hum — without it, `man hum` does not find the page even though the file is there. On macOS both /usr/local/share/man and ~/.local/share/man are on the default search path; the second because ~/.local/bin is on PATH and man derives <prefix>/share/man from it. Best-effort. A man page is a nicety, and a read-only prefix must not fail the install. It runs outside the build step, so SKIP_BUILD=1 still installs it. `uninstall` removes it. While in there, the page was wrong in three ways: - penny.json was listed under ~/.local/state/hum. It lives in the runtime root, ~/.local/state/run/hum, so a reboot clears it. The tier-5 practice doc flagged this and the man page had not been updated. Fixed, and the other nine state files are now listed too. - `hum penny` was described as showing "token swaps, tool executions, etc." Nothing in the daemon calls Penny::incr, so the file is always empty. The page now says so. - ENVIRONMENT listed only HUM_BIN. HUM_THRUM_SOCK, HUM_SOCKET, HUM_TRUST_REMOTE_WORKERS, HUM_MCP_PORT and CLAUDE_CLI_PATH are all read by the code and are now documented, with the truthiness HUM_TRUST_REMOTE_WORKERS actually accepts. Also drops a `hum.schema.json (1)` cross-reference to a file that has no man page. Verified: `man hum` resolves the installed page, and every path in the FILES section is checked against hum_paths.
Brings in the release.sh that orchd and the other Rust projects use, so a bump is one command with the same shape everywhere. The file is copied from orchd and edited surgically. The VERSION file is gone. Cargo.toml's [workspace.package] version is the source of truth, which is what the canonical script reads. Two hum-specific additions to the script: EXTRA_VERSIONED_FILES now lists all 13 hive version carriers — 9 hive Cargo.tomls, 3 hive package.jsons, and the recipe's package.json. The old script updated only the 4 package.jsons, so the 9 hive Cargo.tomls and their 9 lockfiles stayed in sync by hand. They are excluded from the workspace, so each carries its own version rather than inheriting workspace.package.version, and each has its own lockfile. The lockfile step is `cargo update --workspace`, not `cargo generate-lockfile`. The latter re-resolves every dependency: a version bump turned into 2,547 lines of dependency churn. The former re-stamps only the workspace members — 52 lines for a bump, and zero when the versions are already in sync. The hive lockfiles are refreshed in a loop, since the workspace command does not reach them. The drift check works for both file formats: it greps for the quoted version, which is present in Cargo.toml and in package.json alike. The release workflow is rewired to the orchd shape. It keeps hum's source-only nature — no crates.io publish step, since hum is not published — and drops the hand-rolled note composition in favour of `--generate-notes`. The composed notes were mostly the version string, because the tags are lightweight and carry no message. Verified by dry run on a scratch clone: patch, minor and major all bump all 14 version sites, the package.json files stay valid JSON, the lockfiles pick up the new stamp, and the drift check fires when a file is left behind.
`hum --version` printed `hum 0.32.0`, and so does every other build from any commit since the v0.32.0 tag. Two builds of different code reported the same version, so there was no way to tell them apart from the binary alone. The wryme build script solves it: stamp the commit hash in alongside the version. `hum --version` now prints `hum v0.32.0@fd9a757`, and `humd --version` prints `humd v0.32.0@fd9a757 (thrum 0.7.0)`. hum and humd each get a build.rs, since the workspace is virtual and a root build.rs would not run. A build from a source tarball has no git, so the hash is dropped and the version stands alone. The version comparison is unchanged. `hum update` and humd's autoupdate still compare the bare semver against the release tag, because the stamped string would never equal a tag. They just print the stamped version now, so the log line says which build asked. hum doctor shows the stamped CLI version, and the version humd publishes in runtime.json is stamped too — that is the daemon's identity on the wire. The man page's --version entry now says what the stamp is for.
The stamp is self-evident from the output. Spelling out the format belongs in the commit message, not in the page.
It generated a report for issue #8, "oc compat completeness", by running two vitest suites, scraping the claude and opencode CLIs, and asking claude to write a compatibility matrix — then overwriting the issue body with it. Issue #8 is closed. The architecture it describes is not hum any more: the prompt says hum is a daemon and OpenCode plugin bridging Claude Code subscriptions into OpenCode, with an MCP broker and a providerExecuted flag. hum is a mesh of bees and hives now. It could not run either. Two of the three files it copies are gone, it reads a root package.json that does not exist, it expects a `hum` system user with a checkout at a path the installer no longer produces, and it writes to a reports/ directory that is not there. Nothing referenced it.
`just lint` ran `cargo clippy --workspace -- -D warnings` with no allow-list, so it failed on lints CI explicitly allows. It is now `lint` for CI's scope — the same crates and the same flags as the workflow, so if it passes, CI passes — and `lint-all` for the whole workspace. That surfaced real findings the narrower run never reached: - nested `if`s that could be let-chains, across humd, thehum, hum-nest, humctl and sim - a `&PathBuf` parameter that `hum_thrum::connect` already takes as `&Path` - two hand-written `Default` impls that should be derived - a counter in the golden-message test whose last increment was dead — `out.len()` is the same value - `content.lines().filter(..).last()`, which walks the whole file to find the last line, where `rfind` finds it from the end - a `mod tests` sitting above the code it tested - `std::iter::repeat(..).take(..)` where `"I".repeat(52)` says it better The daemon and the drone still carry dead code — 27 dead_code warnings, the same 27 as on main. Clippy was not reporting them before only because it stopped at thehum and hum-nest; the count is unchanged. `fmt` now reports rather than rewrites. The repo is not rustfmt-clean — `cargo fmt --all` would change ~380 hunks across every file, most of them unrelated. `fmt-file` formats one file. The justfile's `bees` and `clean` recipes pointed at `bees/`, which was renamed to `hives/` long ago. `bees` now walks `hives/*/` and builds the ones that have a package.json — which drops ollama-server, a Rust hive that the old list tried to build with pnpm.
adiled
added a commit
that referenced
this pull request
Oct 19, 2026
PR #75 slipped `///` doc comments into four public items in `comb.rs`, and six more were already sitting in the tree from the paydown in #73. Both went unnoticed because the script that was supposed to catch them was vacuous: it stripped comments out of the source and then searched the stripped result for comment markers, so it could never find one. It had been reporting `TOTAL COMMENTS: 0` the whole time. `tools/speech.py` is a correct scanner. It blanks string and char literals so a `//` inside a URL is not a comment, then reports every line and block comment. `just speech` runs it, `just lint` depends on it, and CI runs it in the rust job — the rule is now enforced rather than asserted. The comment that survives is `//!`, the module header, which is the one form the rule allows. Where a comment said something the code could say, the code now says it: - `comb.rs` — the four `///` blocks folded into the module header, which already explained the key scheme. - `hum-nest/src/serve.rs` — `is_tool_block` became `bridge_reports_tool_whole`. The bridge ships a tool block whole, as one `chunk:tool_executed`, so its streamed deltas and its stop event are redundant with that chunk. The name says which. - `hum-paths/src/config.rs` — a partial nest section now asserts against the default rather than a literal, so the line says the default filled in. The full-config test still pins the number. - `humd/src/drift.rs`, `humd/src/drone.rs`, `humd/src/thrumd/conn.rs` — comments that only repeated the test name or the match arm are gone. - `thehum/src/anchor.rs` — the four selector bytes are now `PLACEHOLDER_SELECTOR`, and the module header explains why it is one. The hives are exempt. Each is a separate workspace and a kind any third party may write in any language, so they answer to their own community's conventions, not ours. 369 comments live there and all of them stay.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Code is speech. This pays down the comment debt across the ensemble and
the crates that work with it, so the code carries the meaning and the
comments only say what code cannot.
///and//are now at zero.//!module headers remain — thatis where the prose belongs.
The chi contract moved to WIRE.md
The chi registry was the reason this was not a pure deletion.
codegenparsed the
///lines above each chi variant and emitted them as theprotocol documentation in the TypeScript, Python, and Go clients, so
those comments were a build input, not commentary. Removing them
would have deleted the wire contract from every bee author's language.
So the contract moved to where it belongs.
WIRE.md's registry tablegained a
descriptioncolumn — the canonical one-liner the clientscarry as their doc comment — and codegen now reads that column instead
of the Rust doc comments. The four copies cannot drift.
The generated clients are byte-identical to before.
Two things fell out of the move:
tool-infoandbackfill, so the spec a client author would read was two chisshort of the registry. Both are now present.
WIRE.md. That is the check that would have caught the drift.
The man page now ships
man/hum.1has existed since PR #55 and was never installed. Theinstaller only ran
cargo installfor the three binaries and therelease workflow is source-only, so the page was reachable by nobody.
The installer now copies it into the first writable directory on the
standard man path —
/usr/local/share/man, then$XDG_DATA_HOME/man— into theman1subsection, which is whereman humlooks for a page namedhum. Without that subsection thefile is there but
man humdoes not find it. Best-effort: a man pageis a nicety and a read-only prefix must not fail the install. It runs
outside the build step, so
SKIP_BUILD=1still installs it.While in there the page was wrong in three ways:
penny.jsonwaslisted under
~/.local/state/humwhen it lives in the runtime rootand a reboot clears it;
hum pennywas described as showing "tokenswaps, tool executions, etc." when nothing in the daemon increments
those counters; and
ENVIRONMENTlisted onlyHUM_BINwhen fivemore env vars are read by the code.
The release script, and the version stamp
release.shis now the canonical script, copied from orchd and editedsurgically. The
VERSIONfile is gone;Cargo.tomlis the source oftruth.
EXTRA_VERSIONED_FILESlists all 13 hive version carriers —the old script updated only the 4
package.jsons, so the 9 hiveCargo.tomls and their 9 lockfiles stayed in sync by hand.The lockfile step is
cargo update --workspace, notcargo generate-lockfile: the latter re-resolves every dependency andturns a version bump into 2,547 lines of churn.
hum --versionprintedhum 0.32.0, and so did every other buildfrom any commit since the v0.32.0 tag — two builds of different code
reporting the same version. wryme solves it with a build script that
stamps the commit hash in. hum and humd now do the same:
The version comparison is unchanged —
hum updatestill comparesthe bare semver against the release tag, because a stamped string
would never equal a tag.
The other two hard cases
hum/src/main.rswas clap: the doc comments were the--helpoutput. They are now
about/helpattributes, and every helpoutput is byte-identical to before.
hum-nest/src/limits.rshad// SAFETY:comments on its unsafeblocks. The safety argument moved to the module header, which now
states the invariant once: the blocks run post-fork and pre-exec, each
is one async-signal-safe libc call, and nothing between the fork and
the exec allocates or takes a lock.
What changed, by area
hives.rshad a doc on every manifestfield; the names carry it.
kad.rswas one 645-line file heldtogether by five banner comments marking sections that were not
actually separate. It is now seven modules: distance, bucket, table,
state, wire, lookup, root. The banners are gone because the
boundaries are real.
Reach::declares_chireturned "should thisclient receive this chi", which is the opposite of what the name
says: an empty declared set accepts everything. Now
accepts_chi.set_chisreplaced rather than added; nowreplace_chis.Egghad a docon every field.
PropensityandSuspicionare enumerated wiresemantics, so they moved to the module header.
ids.rsheld two unrelated identifiers behind one file; they are nowhumid.rsandhid.rs. The base32 codec's magic numbers are nownamed:
TIMESTAMP_CHARS,TRAILING_PAD_BITS,PAYLOAD_OFFSET_BITS.from
scenarios/*.md. The prose is the contract; the test is thewitness.
Three real findings
A comment that was lying.
headroom.rssaid NaN occupancy wastreated as Cool "by falling through all branches" — falling through all
branches yields Refuse. A humd with a NaN ratio would have
advertised itself as refusing work. Fixed, with a test pinning it.
A dead wire field.
hid_verifiedis written by humd, serialized intothe manifest, and read by nobody — in any language, anywhere.
A doc claiming a validation that doesn't exist.
uri.rssaidaliases match
[A-Za-z0-9._-]+. Nothing enforces it.Behavior preservation
The
kad.rssplit was verified mechanically: all 39 functions present,every body byte-identical except
forget, whose refactor(
bucket.retaininstead of reaching into a private field) issemantically equivalent.
405 tests pass, 0 failed, 0 ignored (up from 404 —
phone_laptop_roamwas documented as
#[ignore]d and failing, but it was neither, so itnow runs). Workspace warnings unchanged at 28. Clippy is clean in CI's
scope, and the pre-existing collapsible-if in
codegenis fixed.Comment count is verified with a real tokenizer that strips string
literals before counting, not a regex.