Make the static-site checks establish what they claim #65
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!65
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/static-site-check-fixes"
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?
Makes three static-site assertions establish what they claim, and deletes three rules that could not. Replaces
allod/archetypes#64, which reached the same tree through eleven commits of back-and-forth; this branch is that tree in two commits and is byte-identical to it../check.shpasses: all 31 steps.Net effect: the content check drops from 215 lines to 55, and every rule that remains has a fixture that goes red when the rule is removed.
What is fixed
The site root reached a shell unquoted.
types.pathInStoreaccepts a store path containing a space, sositeRoot = "${site}/public files"produced a command that word-split and tried to executefiles. Module and expectation both uselib.escapeShellArgnow.That expectation was also not load-bearing, which is the more interesting half:
escapeShellArgis the identity for a clean store path and the fixture root is one, so reverting the module left the comparison green. The check now evaluates the module with a root that actually needs quoting and asserts the escaped spelling is present and the bare one is not.The closed-port assertion could not fail for the right reason.
pages.fail("ss -ltnH 'sport = :22' | grep -q .")is satisfied whensserrors on a malformed filter — grep matches nothing, the pipeline fails, and the subtest records port 22 as closed without having asked. It now assertssssucceeds and returns nothing, with a positive control on the administrative port, because an expressionsssilently ignores would also return nothing.What is deleted, and why deletion rather than repair
The title rule could not be written. Three versions, each wrong in both directions — accepting a title inside a comment or a
<textarea>, rejecting a real title containing<or preceded by<!--in an attribute. Deciding whether text is an element is a parse, not a match.The immutability rule could never fire.
siteRootis always a store path and store paths arer-xr-xr-xby construction. The only trees that tripped it were the fixtures built to trip it.The reference scan caught only root-relative links.
missing.png,./missing.pngand../gone.htmlall passed. It was the most intricate code in the file and produced two defects of its own while being fixed:xargsreporting 123 for a command that exited 1, and case-sensitive--includeglobs that silently stopped scanningPAGE.HTML.What survives is the rule whose failure is both silent and severe: a symlink escaping the site root, which Caddy resolves at request time against the host's own filesystem.
allod/memorytesting.md's deletion rule is the standard applied — drop a check when a cheaper witness pins the same property. A live site pins a missing title and a broken link the first time anyone looks; nothing but this pins the escape.Not fixed, deliberately
Item 4 of the issue asks the string-context assertion to check whose context it is. That is not achievable at evaluation time:
builtins.getContext "${drv}"names the derivation path, textually unrelated to the output path the string spells, and mapping one to the other requires building. Established by writing the stronger assertion and watching it reject the legitimate site root. The earlier suggestion oftypes.packagewas itself wrong —lib.types.package.checkaccepts a plain store-path string — and the module records both facts.Risk
R1. Deletions from a build-time check plus two assertion corrections. No machine configuration changes. Rollback is a straight revert.
Human scrutiny worth spending: whether the three deleted rules are ones you want gone. Each is defensible on its own and the reasoning is in the commit messages, but they are judgement calls rather than defects.
Closes allod/archetypes#62
Three assertions passed without checking the thing they named. The site root reached a shell unquoted. `types.pathInStore` accepts a store path containing a space, so `siteRoot = "${site}/public files"` produced a command that word-split and tried to execute `files`. Both the module and the expectation that pins it now use `lib.escapeShellArg`. That expectation was also not load-bearing: `escapeShellArg` is the identity for a clean store path, and the fixture root is one, so reverting the module left the comparison green. The check now also evaluates the module with a root that needs quoting and asserts the generated command contains the escaped spelling and not the bare one. The closed-port assertion could not fail for the right reason. `pages.fail("ss -ltnH 'sport = :22' | grep -q .")` is satisfied when `ss` errors on a malformed filter: grep matches nothing, the pipeline fails, and the subtest records port 22 as closed without having asked. It now asserts `ss` succeeds and returns nothing, plus a positive control on the administrative port, since an expression `ss` silently ignores would also return nothing. The string-context assertion is deliberately unchanged. Checking that the context names the path being served is not achievable at evaluation time: `builtins.getContext "${drv}"` names the derivation path, textually unrelated to the output path the string spells, and mapping one to the other requires building. The module records that, and records that `types.package` is not the fix — `lib.types.package.check` accepts a plain store-path string. Refs allod/archetypes#62