Skip to content

the kernel speaks in code — no comments, and now it is checked - #76

Merged
adiled merged 1 commit into
mainfrom
fix/speech-zero-comments
Oct 19, 2026
Merged

adiled merged 1 commit into
mainfrom
fix/speech-zero-comments

Conversation

@adiled

@adiled adiled commented Oct 19, 2026

Copy link
Copy Markdown
Owner

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.

The verifier could not fail

code = strip_comments_and_strings(src)   # strips comments out
for ln in code.split("\n"):
    if st.startswith("///") or st.startswith("//"):
        total += 1                        # ...then searches for them

It stripped the comments and then searched the stripped result for comment markers. It had been reporting TOTAL COMMENTS: 0 the whole time — for a codebase that had comments in it.

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.

$ python3 tools/speech.py
the kernel speaks in code — no comments

It is now enforced rather than asserted: just speech runs it, just lint depends on it, and CI runs it in the rust job.

The only comment form that survives is //!, the module header — the one the rule allows.

Where a comment said something, the code says it now

file before after
humd/src/comb.rs four /// blocks folded into the module header, which already explained the key scheme
hum-nest/src/serve.rs is_tool_block + a comment explaining the suppression bridge_reports_tool_whole — the bridge ships a tool block whole, as one chunk:tool_executed, so its streamed deltas and stop event are redundant with that chunk
hum-paths/src/config.rs assert_eq!(..., 300_000); // default fills asserts against the default, so the line says the default filled in. The full-config test still pins the number
humd/src/drift.rs d.mark(...); // ignored the test name already said it
humd/src/drone.rs Drone::new(); // NoopClassifier the test name already said it
humd/src/thrumd/conn.rs Ok(None) => break; // EOF the arm already said it
thehum/src/anchor.rs &[0x4e, 0x71, 0xd9, 0x2d]); // placeholder selector PLACEHOLDER_SELECTOR, with the module header explaining why it is one

The hives are exempt

Each hive 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.

Tests

413 pass, 0 failed.

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.
@adiled
adiled merged commit 9b5b390 into main Oct 19, 2026
8 checks passed
@adiled
adiled deleted the fix/speech-zero-comments branch October 19, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant