[Publisher] Fix whitepaper CI: build script derived by deleting a hardcoded line range - #3
Merged
Merged
Conversation
…ng a hardcoded line range
Today's content corrections could not publish. build_whitepaper.yml built its CI
scripts with `sed '6,29d' make-md.sh`, a range chosen to delete the git sync
block. The 2026-08-27 coverage guard added 17 lines above that block, so the cut
landed mid-block: it removed the LOCAL= assignment and kept the
`[ $LOCAL = $REMOTE ]` test. Unquoted and empty, that test is a bash syntax
error; both branches fell through and the build aborted claiming the branch had
diverged, which it had not. Run 33064599023, "make-md-ci.sh: line 9/11: [: =:
unary operator expected" -- reproduced here byte-for-byte at both line numbers
before anything was changed.
The three scripts now honour CI themselves. That contract was already documented
in .github/workflows/README.md ("CI=true bash make-md.sh") and implemented by no
script; the sed derivation stood in for it. The workflow now calls the real
scripts and no line-number coupling remains. Comparisons are quoted so an empty
variable reports itself instead of raising a unary-operator error. The dropped
`s/--toc-depth=3/--toc-depth=2/` substitution was already inert: make-pdf.sh has
read --toc-depth=2 at source for some time.
Also restores the executable bit on preprocess-{proposals,sections}.sh, mode
100644 in git while both make-*.sh call them as ./preprocess-*.sh. All six
invocations have failed "Permission denied" in every CI run, green ones
included -- an error printed, its exit status ignored, the build reporting
success. It is currently a no-op: 0 matching "### " headers across the 50 files
its own find selects, against 68 "## " as a positive control. So this re-arms a
safety net rather than changing any output.
Verified in an isolated worktree using the runner's own invocation. CI=true
skips the sync and all three builds exit 0; CI unset still syncs; the cwd
coverage guard still exits 1 from the repo root and creates no stray build/.
The rebuilt monolith carries today's corrections and differs from the committed
one by 21 lines -- the correction and nothing else. Artifacts are left for CI to
rebuild and deploy rather than committed here, so there is one producer.
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.
What broke
The whitepaper build has been failing since this morning, so the 2026-08-27 content
corrections in
dark_matter.mdare in source but in none of the published surfaces.build_whitepaper.ymlderived its CI build scripts by deleting a hardcoded line range:That range was chosen to remove the git-sync block. The coverage guard added to
make-md.shearlier today (itself a good fix, ported from web4) pushed the block downby 17 lines, so the cut landed inside it — deleting the
LOCAL=assignment whilekeeping the test that reads it:
Both branches fell through to
else, which reports a diverged branch and exits 1.Run
33064599023:make-md-ci.sh: line 9: [: =: unary operator expected(and line 11). Reproduced herebyte-for-byte, at both line numbers, before anything was changed.
The failure mode is worth naming: a hardcoded line range is an undeclared coupling
between a workflow and a script. Editing the script is what breaks it, and nothing
in the script says so.
The fix
The three build scripts now honour
CIthemselves and the workflow calls themdirectly.
.github/workflows/README.mdalready documented this contract(
CI=true bash make-md.sh, "CI-safe (skips git pull operations)") — no script hadever implemented it, and the
sedstood in for it.CI: trueis already set atworkflow level, so nothing new is introduced.
Comparisons are now quoted, so an empty variable reports itself rather than raising a
unary-operator error. The dropped
s/--toc-depth=3/--toc-depth=2/substitution wasalready inert —
make-pdf.shhas read--toc-depth=2at source for some time.Second, unrelated defect found while testing
preprocess-proposals.shandpreprocess-sections.share mode100644in git, whileall three
make-*.shcall them as./preprocess-*.sh. All six invocations have beenfailing
Permission deniedin every CI run — including green ones (see the 08-26success, run
32960497165). An error printed, its exit status ignored, the buildreporting success.
Restoring the exec bit is currently a no-op, and that is measured rather than
assumed: 0 matching
###headers across the 50 files the preprocessor's ownfindselects, against 68##headers as a positive control — so the instrumentworks and the zero is real. Sources are already in the demoted form that
515f6cc6(2025-08-22) converted them to. This re-arms the safety net for the next
###headersomebody writes; it does not change current output.
Worth flagging for a maintainer: these preprocessors rewrite section sources in
place. That is by design, and the deploy step is scoped (
git add docs/ whitepaper/build/) so a runner's mutations never reachmain— but it is the reasonthis was checked carefully rather than just chmod'd.
Verification — the runner's own invocation, in an isolated worktree
CI=true(as the runner runs it)make-md.sh,make-pdf.sh,make-web-clean.shall exit 0; 0Permission deniedCIunsetCI=truebuild/git statusonwhitepaper/sections/after a full build: empty — confirming there-enabled preprocessing mutates nothing.
The rebuilt monolith carries today's corrections (
CORRECTED 2026-08-27×4,factor 5.6 spread×2,0.045 and 0.065×3) and differs from the committed artifactby 21 lines — the correction and nothing else.
Artifacts are deliberately not committed here: CI is the authoritative builder in
this repo and deploys on merge, so landing this closes the propagation gap through the
normal path with one producer rather than two.
Note on the diff
build_whitepaper.ymlis a pure-CRLF file (192/192 at HEAD). The first attempt wroteit back as LF and turned a 20-line change into a 367-line whole-file reformat; it was
redone preserving line endings. The diff here is only the edit.