Design post: Four Encodings, Three Joins (the mushaf ETL) - #224
Merged
Conversation
A backend-design post derived from the hifth repo's own ETL design doc, written for a reader who has never seen the repo. Four diagrams: the source-to-shard spine (animated), the four encodings and the three joins between them, the three tiers of gates, and the one-way boundary that lets text enter memory but only numbers reach disk. The Decisions section carries the five calls that had a cheaper alternative: numbers cross the boundary but text does not, cache-dependent measurements are probes rather than gates, a probe writes a committed pin instead, residuals are named rather than rated, and one input is checked against but never built from. Verified: outline, naming, questions, links, design-clarity, mermaid-complexity and mermaid-render all pass; MDX compiles (516 files); rendered on the dev server with all four diagrams producing clean SVGs and the use-case diagram laying out crossing-free. Zero em-dashes, zero entity dodges. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EuhvbUKjGesE3uMhjCzBGt
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.
One new
/designspost. Nothing else in the repo changes.bytesofpurpose-blog/designs/2026-08-07-mushaf-etl.mdx·kind: backend-design·slug: design-mushaf-etl·sidebar_position: 22·draft: trueWhat it is
A write-up of the data pipeline behind omars-lab/hifth, a navigation app for huffaz. The interesting problem is not that an ETL exists; it is that the same word is described four times, in four incompatible units, by four groups of people who were each solving a different problem. A printed page vendored as SVG is a few thousand anonymous outlined paths, so the whole pipeline is one job: give those paths names, and never let a name be quietly wrong.
Derived from that repo's own in-repo design doc, rewritten for a reader who has never seen it: four diagrams instead of five, no code pointers, and a Decisions section the source document does not have.
Structure
Opens on users and use cases with a
<UseCaseDiagram>(hafiz / contributor / reviewer with a printed copy), then the Scope note, then<!-- truncate -->, then a<RepoPointer>.Four diagrams: the source-to-shard spine (animated,
mermaid-animated flow-dot), the four encodings and the three joins between them, the three tiers of gates, and the one-way boundary where text may enter memory but only numbers may be written.## Key Decisionscarries five calls, each with the cheaper alternative it beat: numbers cross the boundary but text does not; cache-dependent measurements are probes rather than gates; a probe writes a committed pin instead; residuals are named rather than rated; one input is checked against and never built from.The closer is three things that are not about Arabic or SVG at all. Determinism is not correctness (a look-alike corpus was 47.8% wrong for four development cycles while every structural check passed). A pin file is how you version-control a measurement you cannot reproduce in CI. Name the residual instead of rating it, because a percentage is a budget new failures can be spent from without anyone approving the spend.
Validation
validate-post-outlinevalidate-post-namingvalidate-questionsvalidate-linksvalidate-design-clarityvalidate-mermaid-complexityvalidate-mermaid-rendermake check—/—dodgesAlso rendered on the dev server and checked in a browser: HTTP 200, 4 mermaid containers producing 4 SVGs, no syntax-error text, the use-case diagram laid out crossing-free, and the only console errors are the dev-only Cloudflare Access premium fetch. Both the spine and the gates diagram were redrawn from
LRtoTBafter the first render showed long detour edges.One note for the guidance files, not fixed here:
author-post/homes/design.md:75still recommends—for a dash inside a mermaid label, butauthor-mermaid/SKILL.mdnow flags the entity too, since it renders as an em-dash. I followedauthor-mermaidand rephrased instead.Left as
draft: trueper the designs convention, sopublish-siteun-drafts it.🤖 Generated with Claude Code
https://claude.ai/code/session_01EuhvbUKjGesE3uMhjCzBGt