Display the distributed Interdependency textbook - #14
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d5ee176db9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| eleventyConfig.addFilter('dateOnly', value => value ? String(value).slice(0, 10) : 'hmmm'); | ||
| eleventyConfig.addFilter('where', (items, key, value) => (items || []).filter(item => item?.[key] === value)); | ||
| eleventyConfig.addFilter('statusClass', value => `status-${String(value || 'hmmm').toLowerCase().replace(/[^a-z0-9]+/g, '-')}`); | ||
| eleventyConfig.addFilter('markdown', value => md.render(String(value || ''))); |
There was a problem hiding this comment.
Preserve textbook math delimiters
For any fetched chapter that uses LaTeX-style math, this filter sends the text through plain markdown-it, which treats backslashes before ( and [ as Markdown escapes; for example \(\mathcal{O}\) and \[ ... \] render as (\mathcal{O}) and [ ... ]. That corrupts mathematical notation while the chapter page still presents the rendered text as exact source material, so the textbook renderer should either support math or protect those delimiters before Markdown rendering.
Useful? React with 👍 / 👎.
| const retained = previousByNumber.get(source.number); | ||
| chapters.push(retained ? { ...retained, ...source, fallback: true, retrievalError: 'offline requested; retained last-known-good chapter content' } : metadataOnly(source, 'offline requested; no retained chapter snapshot')); |
There was a problem hiding this comment.
Reuse snapshots only for the same source
When OFFLINE=1 and textbook_sources.json changes the repository, path, branch, or title for an existing chapter number, this reuses the retained snapshot by number alone and then overlays the new manifest fields onto the old content and digest. An offline build can therefore display stale text while attributing it to a different source; only reuse the retained chapter when its source identity still matches, otherwise emit the metadata-only fallback.
Useful? React with 👍 / 👎.
| if (!textbook.complete || textbook.fallback) throw new Error('production textbook refresh is incomplete or using fallback content'); | ||
| for (const chapter of textbook.chapters) { | ||
| if (!chapter.content?.trim()) throw new Error(`chapter ${chapter.number} content missing`); | ||
| if (!/^[a-f0-9]{64}$/.test(chapter.contentSha256 || '')) throw new Error(`chapter ${chapter.number} digest missing`); |
There was a problem hiding this comment.
Verify chapter digests against content
In a production validation run, this only checks that contentSha256 looks like a SHA-256 string, not that it is the digest of the chapter content being displayed. If the generated textbook JSON is restored or corrupted with changed content and a stale but well-formed digest, the build still publishes a false source identity in /build.json; recompute createHash('sha256').update(chapter.content).digest('hex') here before accepting the artifact.
Useful? React with 👍 / 👎.
Purpose
Displays chapters Zero through Seven of the distributed Interdependency textbook as one continuous public reading sequence while preserving each chapter’s owning repository, exact source identity, license boundary, and local status vocabulary.
Chapter spine
The-Interdependency/metapat:CHAPTER_ZERO.mdThe-Interdependency/ucns:docs/chapter-1.mdThe-Interdependency/edcm:docs/chapter-2.mdThe-Interdependency/skill-lib:docs/chapter-3.mdThe-Interdependency/interdependent-lib:docs/chapter-4.mdThe-Interdependency/ptcna:docs/chapter-5.mdThe-Interdependency/a0:docs/chapter-6.mdThe-Interdependency/zfae:docs/chapter-7.mdWhat changed
/chapters/as the complete textbook index/chapters/chapter-zero/through/chapters/chapter-seven/maincommit and blob during the build/build.jsonwayseer00/mainFile plan
src/_data/textbook_sources.jsonscripts/fetch-textbook.mjssrc/chapters/*Authority boundary
This website does not merge chapter authority. Each chapter remains governed by the license and status vocabulary of its source repository. Citation does not transfer theorem, proof, empirical, frontier, or canonical status across chapters.
The canonical text of The Interdependent Way remains only
wayseer00/main:canon/INTERDEPENDENT_WAY.txt. The distributed technical textbook is a separate reading object.Offline behavior
A networked production build requires all eight live source files and fails if any source is absent or falls back.
OFFLINE=1may use a retained last-known-good snapshot; a clean checkout without one renders metadata-onlyhmmmrecords rather than inventing chapter text.hmmm
The complete sequence is now displayable without centralizing ownership. Corrections still belong first in the repository that carries the affected chapter; this site follows those exact sources on the next verified build.