Cut the modules' comments to contracts, traps and pointers #104
No reviewers
Labels
No labels
blocked
bug
decision
duplicate
enhancement
help wanted
invalid
landed?
question
ready-to-merge
stale
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/archetypes!104
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/comments-modules"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The sixteen Nix modules under
modules/lose 148 comment lines and keep every contract and trap:public-host.nix's 52-line design record is 19 lines of contract and traps pointing at the README's Public hosts section, which now carries the design reasoning;host-user-credentials.nix's 50-line head is 21, with the agenix custom-path facts compressed to one sentence pointing atnix.md; every other trap stays as the sentence that names the wrong edit and why it fails. Nothing a machine builds changes: not one non-comment line moved, and every machine's and every check's derivation path is byte-identical to master. The three shell scripts undermodules/are shipped into machines, so their comments move derivations; they are a separate PR. What proves it is the comment-only gate, the derivation-path comparison, and./check.shgreen on this branch. If it is wrong, revert the one commit; no other repository reads these files.What changed
modules/*.nix: 370 to 222.ssh-hosts.nix81 to 49,public-host.nix62 to 23,host-user-credentials.nix50 to 21,static-site.nix31 to 16,rented-kvm-guest.nix25 to 15,ai-agents.nix42 to 34, the rest by a few lines each;netrc.nix,home-shared.nixandagent-forgejo-token.nixhad none. Blocks of three or more lines: narration, provenance, history and a table of contents deleted; the rest compressed to a contract, trap or pointer; 35 ledger entries were in scope for the cold review.## Public hostsgains one paragraph naming the three things the base deliberately leaves out (boot and disk shape, agenix, the stateful-service layer) and one sentence on why the base no longer tries to be unbypassable, sopublic-host.nixpoints there instead of carrying it.hostPlatformwithoutmkDefaulttrap, which lives inrented-kvm-guest.nix, points atnix.md, which holds the rule.modules/are insidewarnEchoruntime strings and mean "earlier in this terminal", so they were left alone.writing.md(allod/memory#63).Risk
R1. Comment-only: the gate diffs the Nix parse tree (
nix-instantiate --parse, which drops comments) against master and reports zero non-comment changes, and the derivation-path witness covers every machine and every check on both data sets. The residual risk is a compressed trap that a reader no longer notices; the cold review asked that question per block and found nothing. Rollback is a straight revert.Validation
non-comment lines changed: 0 (files checked: 13); README.md is the only other file changed.nixprocess per item on master and on this branch: 4 machines, 19 checks on template data, 19 checks on the fork fixtures, plusvmFacts,libandnixosModules. All identical../check.shon this branch:All 32 steps passed (checks: 19 built).gpt-5.6-terraon codex, high effort), asked per deleted or compressed block what wrong edit it prevented and what prevents it now, with every new pointer verified against the README and the memory topic files:FINDINGS: 0, after reading all 13 changed files, the README and 35 ledger entries (the transcript shows the reads; an empty review was ruled out before it was read as approval).Refs allod/archetypes#101
Apply the writing.md "Code comments" rule across every modules/*.nix file: a comment survives only as a contract a caller relies on, the trap the obvious alternative falls into, or a pointer to where the long version lives. Narration, provenance and fix-round history go; every position word ("above", "below", "this file") is replaced by the name of the function, option, module or check it meant. Every block that was preventing a plausible wrong edit is kept in compressed form or replaced by a pointer: - public-host.nix's 52-line header keeps the contract (no enable option) and the two traps a reader walks into — folding in the boot and disk shape, and routing adminAuthorizedKeys through agenix. Its design record was already in README.md under Public hosts, which gains the deliberate exclusions and the earlier-unbypassable-version sentence. - host-user-credentials.nix's 50-line header keeps what the module reads and writes, and compresses the three agenix custom-path facts to one sentence pointing at nix.md, which holds them in full. - rented-kvm-guest.nix's hostPlatform note points at nix.md for the mkDefault shadowing rule. - ssh-hosts.nix drops the header's table of contents for three refusals that each already carry their own trap and their own throw message. Zero non-comment lines change, so no derivation path moves. Comments inside Nix indented strings are part of a derivation and are left untouched. The three modules/*.sh files are a separate commit: their comment text is inside the script a writeShellApplication builds, so editing them does move derivation paths. Refs allod/archetypes#1016149f5e21btoac2ee68162