Commitbff3fd14Recorded3 Aug 2026Repositorydocket

Order the assertions so each reds for its own reason, and tighten three captures

Message

Sabotage-testing the review fixes found a third assertion that could only ever fire behind an earlier one. Re-adding the /repos/ link inline breaks the contiguous prose literal the sentence check pins, so the sentence check fired first and reported "the note does not say where commits live" -- true, useless, and pointing at the wrong file. The guard that explains the reachability cost now runs before it.

Three assertions in this branch turned out to be unreachable behind an earlier one, and none was visible by reading. The rule that falls out: in an assertion block the check that EXPLAINS THE CONSEQUENCE runs before the check that merely NOTICES THE CHANGE, because a broad "the text is not what I expected" swallows every specific check behind it and the swallowed one is always the one whose message would have helped.

Also: - grep -o | head -1 in a value capture can SIGPIPE its producer under pipefail once a feed exceeds a pipe buffer. sed -n 1p reads to EOF. - every origin capture asserts a SINGLE root commit. With more than one the value carries an embedded newline and grep -F then matches any line of the feed rather than the date. The implementation handles multiple roots; the assertion was the weaker half. - feed-origin is module state and the ingress can render twice in one process, so it is cleared per render rather than left for the next.

Changed
 src/docket/render.sgl           |  5 +++++
 test/integration/test-render.sh | 23 ++++++++++++++++++++---
 2 files changed, 25 insertions(+), 3 deletions(-)
Diff
src/docket/render.sglmodified
@@ -3139,6 +3139,11 @@
3139
;; state `project-feed?` exists to make impossible, reached by the
3140
;; error path instead of the success path. `emit` writes immediately,
3141
;; so the only place a refusal costs nothing is before the first one.
+3142
;;
+3143
;; Cleared first: this is module state, and the ingress renders more
+3144
;; than once per process. A render that writes no feeds must not leave
+3145
;; the previous record's date sitting here for the next one to find.
+3146
(set! feed-origin "")
3147
(when project-feed?
3148
(let ((origin (record-origin record)))
3149
(when (string-empty? origin)
test/integration/test-render.shmodified
@@ -1645,8 +1645,6 @@ grep -Fq 'Releases and digests are in the ' "$tmp/site-feed/sigil/index.html" ||
1645
exit 1; }
1646
# The reader is still told where the older commits ARE -- deleting the sentence
1647
# would leave the window hiding content with no pointer.
1648
grep -Fq '; each repository has its own feed of commits' "$dorm" || {
1649
echo 'FAIL: the note does not say where commits live' >&2; exit 1; }
1648
# "each repository" is deliberately NOT linked -- pointing it at /sigil/repos/
1649
# gives a one-repo project page a direct link to its repo list and makes
1650
# test-reachability's long-chain walk vacuous at exactly the shape it exists
@@ -1658,10 +1656,20 @@ grep -Fq '; each repository has its own feed of commits' "$dorm" || {
1656
# defect it names. Measured on this fixture: the dormant project page contains
1657
# zero occurrences of href="/sigil/repos/" today, so this is not a claim about
1658
# anchor wording, it is a claim about the route existing at all.
+1659
#
+1660
# FIRST, BEFORE THE SENTENCE CHECK BELOW, and that order is load-bearing.
+1661
# Sabotage-tested with the link added inline: the sentence check fired instead,
+1662
# because an anchor inside the prose breaks the contiguous literal it pins. So
+1663
# the reachability consequence -- the thing a reader needs to be told -- was
+1664
# reported as "the note does not say where commits live", which explains
+1665
# nothing and invites fixing the wrong file. An assertion whose red is always
+1666
# somebody else's red has never been proved by anything.
1667
if grep -Fq 'href="/sigil/repos/"' "$dorm"; then
1668
echo 'FAIL: the project page gained a direct /repos/ link; that voids the one-repo reachability walk' >&2
1669
grep -o '.\{0,60\}href="/sigil/repos/"' "$dorm" >&2
1670
exit 1; fi
+1671
grep -Fq '; each repository has its own feed of commits' "$dorm" || {
+1672
echo 'FAIL: the note does not say where commits live' >&2; exit 1; }
1673
1674
# ---- AN EMPTY PROJECT FEED IS WRITTEN, AND HONESTLY DATED -----------------
1675
#
@@ -1691,6 +1699,11 @@ if grep -Fq '<entry>' "$tmp/site-dormant/sigil/feed.xml"; then
1699
origin=$(git -C "$tmp/emptyrec" log --max-parents=0 --format=%aI)
1700
[[ -n $origin ]] || {
1701
echo 'FAIL: no record origin to compare against, so the date check is vacuous' >&2; exit 1; }
+1702
# ONE root, or the grep below carries an embedded newline and -F then matches
+1703
# any line of the feed rather than the date.
+1704
[[ $(printf '%s' "$origin" | wc -l) -eq 0 ]] || {
+1705
echo 'FAIL: emptyrec has more than one root commit; the date grep would match anything' >&2
+1706
exit 1; }
1707
grep -Fq "<updated>$origin</updated>" "$tmp/site-dormant/sigil/feed.xml" || {
1708
echo "FAIL: the empty feed is not dated from the record's creation ($origin)" >&2
1709
grep -o '<updated>[^<]*</updated>' "$tmp/site-dormant/sigil/feed.xml" | head -1 >&2; exit 1; }
@@ -1742,7 +1755,7 @@ done
1755
# (site-feed/sigil/feed.xml's existence is already asserted further up, at the
1756
# Atom feeds block -- not repeated here, because an assertion that can only
1757
# fire after another has already fired has never been proved by anything.)
1745
feed_updated=$(grep -o '<updated>[^<]*</updated>' "$tmp/site-feed/sigil/feed.xml" | head -1)
+1758
feed_updated=$(grep -o '<updated>[^<]*</updated>' "$tmp/site-feed/sigil/feed.xml" | sed -n 1p)
1759
feed_newest=$(grep -o '<updated>[^<]*</updated>' "$tmp/site-feed/sigil/feed.xml" | sed -n 2p)
1760
[[ -n $feed_newest ]] || {
1761
echo 'FAIL: the populated feed has no entries, so this comparison is vacuous' >&2; exit 1; }
@@ -1753,6 +1766,8 @@ feed_newest=$(grep -o '<updated>[^<]*</updated>' "$tmp/site-feed/sigil/feed.xml"
1766
# equality above could hold while every feed on the site said the same thing.
1767
record_origin=$(git -C "$tmp/record" log --max-parents=0 --format=%aI)
1768
[[ -n $record_origin ]] || { echo 'FAIL: no record origin for the busy record' >&2; exit 1; }
+1769
[[ $(printf '%s' "$record_origin" | wc -l) -eq 0 ]] || {
+1770
echo 'FAIL: the busy record has more than one root commit' >&2; exit 1; }
1771
[[ $feed_updated != "<updated>$record_origin</updated>" ]] || {
1772
echo 'FAIL: a populated feed took the origin date instead of its newest entry' >&2; exit 1; }
1773
@@ -1932,6 +1947,8 @@ grep -Fq 'No activity recorded yet.' "$tmp/site-blank/sigil/index.html" || {
1947
[[ -f "$tmp/site-blank/sigil/repos/blank/feed.xml" ]] || {
1948
echo 'FAIL: a repository with no commits got no feed' >&2; exit 1; }
1949
blank_origin=$(git -C "$tmp/emptyrec" log --max-parents=0 --format=%aI)
+1950
[[ -n $blank_origin && $(printf '%s' "$blank_origin" | wc -l) -eq 0 ]] || {
+1951
echo 'FAIL: no single root commit to date the commitless repo against' >&2; exit 1; }
1952
grep -Fq "<updated>$blank_origin</updated>" "$tmp/site-blank/sigil/repos/blank/feed.xml" || {
1953
echo "FAIL: a commitless repo's feed is not dated from the record's inception ($blank_origin)" >&2
1954
grep -o '<updated>[^<]*</updated>' "$tmp/site-blank/sigil/repos/blank/feed.xml" >&2; exit 1; }