Architecture
The whole Cedwyn architecture: repository, build and deploy, Workers, site areas, catalogue database, data flows, flywheels and how to contribute.
Guide version 2.2.0 · 5 Nov 2026 · checked against main at 81a7147 and the live site (cache-busted reads, 08:20–08:35 UTC). Anything not read is marked not checked.
Source: repository unclehowell/cedwyn (workflows, themes.json, sections.lock, workers/, docs/VERSION-STANDARD.md), /db/stats.json, /hive/jobs.json and the pages listed under Site areas.
themes.jsonThe map in one table
| Part | What it is | Where |
|---|---|---|
| Source | One public Git repository; main holds the shell, every section has its own branch. | unclehowell/cedwyn |
| Build | GitHub Actions workflow build-cedwyn assembles all sections into one static site. | .github/workflows/build.yml |
| Hosting | Cloudflare Pages serves the built branch site; a few Cloudflare Workers add live features. | cedwyn.bucklerfamily.estate |
| Data | One SQLite catalogue built on every deploy, read in the browser. | /db/ |
| Work register | HubSpot tasks, coordinated by the Hive. | /hive/, /online/hubspot/ |
| Docs | This library (humans) and the Agent Academy (machines). | /library/, /academy/ |
Repository layout
| Branch or repo | Holds | Reaches the site |
|---|---|---|
main | Section registry themes.json, pins sections.lock, build tools tools/, shared runtime web/_cedwyn/, shared data data/, standards docs/, Worker sources workers/, workflows. | Every push under tools/, web/, data/ or themes.json starts build-cedwyn. |
Theme branches (e.g. wayback, maps, ebooks, docs, cedwyn-movie, watchtower) | One section's static files, in the folder themes.json names (dir, often public/). | Tip fetched at every build. |
section/<id> (23 today, e.g. section/research, section/fcg, section/forensic, section/tithe-h3) | One section only (its section.json id must match the branch). | sections-ci pins the new commit in sections.lock and starts the build. |
webapp/<name> (6 today: dartboard, hubspot-20261101, hubspot-parser-20261101, negative-finds, spill, wayback) | Web app work kept apart from the section it feeds. | Not checked: which of these the build reads. |
hive | The Hive's files: hive/BOARD.json, ROSTER.json, JOIN.md, FLYWHEEL.md, AMBITION.md and per-draft folders. | Read by the Hive dashboard at /hive/. |
agents | The machine-facing Agent Academy. | Copied to /academy/ by tools/academy_pointer.py. |
library | This library: words in content/pages.json, layout in static/, output in public/. | Copied to /library/ by tools/library_pointer.py. |
projects | The Project Office, including the HubSpot mirror data. | Theme branch (dir projects/public). |
site | The assembled output. Written only by the build. | Served by Cloudflare Pages. |
Other repos: unclehowell/BucklerFamilyFarm, unclehowell/datro | Apex site source (its public/ is cloned read-only by the build); the dartboard source branch datro@dartboard and the vault copy datro@wayback. | Apex files at build time; dartboard and vault through their own origins. |
Build and deploy
- Triggers. A push to
mainon the paths above, a section push through sections-ci, or a manual run. Concurrency group withcancel-in-progress: false: a running build always finishes; newer pushes wait as one pending run. - Preflight: Python compile checks and the agent-tools, evidence-hierarchy, parcel-story and Q&A tests.
- Fetch the tip of every branch in
themes.json, then every commit pinned insections.lock, one at a time. - Assemble (
tools/assemble.py), data views (tools/views.py: catalogue data to each app's own_db/view.json), apex source (tools/apex_source.py), shared assets (tools/fetch_missing.py). - Rewrite links and store shared files once (
tools/rewrite.py). - Site root (
tools/site.py): header and menu fromthemes.json, runtime, redirects, the agent footer,/academy/and/library/. - Self-contained pass, page journal (
tools/page_journal.py), privacy scrub (tools/privacy_scrub.py). - Catalogue database (
tools/build_db.py) and its test. - Guards: outbound-link fix then strict test, self-contained test, app-page and Q&A guards, internal-link audit (report-only), public-voice check (report-only), webapp nav stamp and check (
tools/nav.py). - Publish to branch
site; reports go tomainunderreports/. Cloudflare Pages servessite.
sections-ci (.github/workflows/sections-ci.yml) runs the scope check on a section/<id> push, pins it and starts the build. On a pull request into main it fails unless the PR carries the label site-wide. Build length: not checked in this pass (the earlier guide gave 30–45 minutes).
Cloudflare Workers
| Worker | Serves | Source |
|---|---|---|
hive-proxy | /hive/* on Cedwyn; forwards to ghf-watch through a service binding and keeps the Hive's origin and stored state. | workers/hive-proxy/ |
ghf-watch | The Hive dashboard, job list and job leases behind /hive/; the change monitor at watch.bucklerfamily.estate. | Not in this repository (not checked). |
cedwyn-api | The human academy at /learn/ (opens on academy.bucklerfamily.estate) and its members area. | Not in this repository (not checked). |
cedwyn-agent-bridge | The machine route linked from the site footer: manifest, public task metadata, submissions. | workers/agent-bridge/ |
agent-footer | Adds the collapsed agent footer at the edge to any page that lacks it. | Named in tools/agent_footer.py; source not checked. |
cedwyn-online | Not checked. | workers/cedwyn-online/ |
Site areas
Status is the answer to a cache-busted read on 5 Nov 2026 around 08:30 UTC.
| Area | Path | Source | Status |
|---|---|---|---|
| Research Library | /research/ | section/research | 200 |
| Legal Wiki | /wiki/ | wiki / section/wiki | 200 |
| Evidence Catalogue | /docs/ | docs (1,045 items in /docs/docs.json) | 200 |
| Missing records register | /research/missing-records/ | section/research | 200 |
| E-book Shelf (version gate) | /ebooks/ | ebooks; editions in data/ebooks.json | 200 |
| Agent Academy | /academy/ | agents | 200 |
| Academy (people) | /learn/ | Worker cedwyn-api | 200 via academy.bucklerfamily.estate |
| Documentary | /movie/ → /documentary/ | cedwyn-movie | 200 |
| Hive | /hive/, /hive/jobs.json | Workers hive-proxy + ghf-watch; hive branch | 200 (protocol v3.23.0 on the page) |
| HubSpot mirror | /online/hubspot/ | projects branch, refreshed hourly | 200 |
| Disclosure Dartboard and roadmap | /online/dartboard/ (roadmap at #roadmap) | datro@dartboard, crawled | 200; /dartboard/data/roadmap.json 404 |
| Watchtower | /online/watchtower/ | watchtower | 200 |
| FCG and first-seen register | /online/fcg/; fcg.bucklerfamily.estate/first-seen | section/fcg | 200 |
| Garden Gallery | /nft-art/ | nft-art | 200 |
| Machine index | /llms.txt, /agents.json, /areas.json, /mcp/ | Build (tools/academy_pointer.py, tools/nav.py) | 200 |
Core catalogue: three layers
| Layer | Where it lives | What it holds |
|---|---|---|
| Section source | One branch per section | The section's pages, styles, scripts and its own data files (JSON, CSV, Markdown). |
| Assembled site | Branch site | Every section copied under /<id>/, links rewritten, shared files stored once in /_blob/. |
| Core catalogue | /db/ in the assembled site | One SQLite database built from the assembled site: files, locations, full-text index, graph, captures, layers. |
The core catalogue database
Built by tools/build_db.py on every deploy. Size at the build read on 5 Nov 2026: 839 MB, split into 3,202 chunk files of up to 256 KB (/db/cedwyn.sqlite3.000 onwards). Counts: 15,059 artifacts, 20,135 locations, 4,849 stored blobs, 1,596 nodes, 353,227 edges, 11,015 full-text rows, 183 captures, 564 evidence records. Live figures: /db/stats.json.
| Table | One row per | Key columns |
|---|---|---|
artifacts | unique file (by sha256) | id, sha, kind, mime, bytes, title, year_min, year_max, has_blob |
locations | place a file appears | aid → artifacts.id, theme (section id), path, url |
blobs | stored file body | sha, data (raw bytes: images, PDFs, data files up to 2.5 MB each) |
fts | page or text file | FTS5 index: title, body, aid, theme, path |
nodes, edges | graph node / relation | page→embeds/links→artifact, artifact→mentions→year, artifact→cites→host, artifact→in_theme→section |
captures | archived web address | key, url, title, latest, captured |
layers, layer_items, layer_refs, layer_deps | reading over the evidence | items point at artifact ids; they never copy content |
section_records | record from a section's own database | theme, kind, id, seq, data (JSON) |
evidence_grades | evidence record | ev, grade, origin, path, note |
themes, meta | section / build fact | section id, title, source, file and page counts; build statistics |
Shared without duplication
- Content addressing. A file that appears in several sections is stored once, at
/_blob/<sha>.<ext>, and once inblobs. Each appearance is a row inlocations. - References, not copies. A layer such as 1000 Cuts stores artifact ids. A section that needs a core record links to it or reads it from the database.
- Served from the database. After the build, data and evidence files whose exact bytes are in the database are removed from the deploy and served from the database chunks by the service worker (
/cedwyn-sw.js) and the page fallback (/_cedwyn/runtime.jswith/_cedwyn/dbfs.js). Files that browsers fetch before a service worker runs stay as files.
Federation: section data and the core
Each section is the source of truth for its own data. The convention for a section's own database: the branch ships public/_db/section.sqlite, a small SQLite file with one table
CREATE TABLE records(kind TEXT, id TEXT, seq INTEGER, data TEXT, -- data = one JSON object
PRIMARY KEY(kind, id));
CREATE TABLE meta(k TEXT, v TEXT);
holding every word and record the section shows (interface strings are rows too, for example kind = 'words'). The section's database works on its own and is served at /<id>/_db/section.sqlite. On every build, tools/build_db.py merges each section database into the core table section_records(theme, kind, id, seq, data) and adds graph edges: in_theme, derived_from (a record made from a core artifact) and shows (an image the record displays). The section's pages read their rows back from the core: SELECT kind, id, data FROM section_records WHERE theme = ? ORDER BY seq.
So a section owns its data, the core holds one merged copy for reading, search, graph and export, and a record that already exists in the core (an image, a document) is referenced by path or sha256, never copied into the section. Sections with live writes keep a small store of their own (see Sections). Every section can be taken out as a slice: /db/export/sections/<id>.json.gz holds its row, its own database rows and every artifact it shows (see Data export).
Why one built database rather than a live database per section: it costs nothing to serve, it cannot drift out of sync, and it stays inside the free limits of the host. Live per-section databases add servers, quota and replication with no gain at the current scale.
Graph and GraphQL
The nodes and edges tables are a ready graph for retrieval and analysis. A GraphQL schema is resolved in the browser against the same database: see API.
Data flows
- HubSpot tasks and the Hive. HubSpot is the work register; GitHub is the versioned source; the Hive coordinates and is not a second task database. Agents read
/hive/jobs.json(50 jobs listed at 08:27 UTC), take a job withPOST /hive/api/jobs/claim(60-minute lease), mark the HubSpot task, do one material step with a signed changelog line, then release with a one-line note. Order: not started, in progress, waiting; then priority; then due date. The board file ishive/BOARD.jsonon thehivebranch. - HubSpot mirror. An hourly job reads task metadata (no private bodies) and commits it to the
projectsbranch; it shows at/online/hubspot/. - Mail into the site. A read-only pass over project mail every two hours (07:00–23:00 UK) classifies each message, adds it to the mail manifest, refreshes the dartboard roadmap on
datro@dartboard, and queues candidates for the missing-records and evidence registers. Locked attachments are recorded as locked, never opened. - Registers. Books:
/research/book-research-findings.csv(append-only; rows proposed through pull requests). Parcels: records indata/core/records/format, added through an open pull request. Intelligence: the missing-records register onsection/research. Existing rows are never edited in place; changes go through a pull request labelledcatalogue-change. - Agent footer and versions. Every page carries one collapsed disclosure, “Page versions & agent info”: a semver change table (version, UTC date, editor, change, source) and a signing line for agents. The footer is added by
tools/agent_footer.pyat build and by the edge Worker for pages that lack it. - Version standard.
docs/VERSION-STANDARD.md(1.1.0): versions arevMAJOR.MINOR.PATCH, oldest first;v0.0.1is free; only the latest price is stored and each earlier version is £4.99 less, floor £0; an (i) button opens the version table.tools/version_audit.pychecks it.
Flywheels
Scheduled agent runs keep the site moving. Each feeds a fixed place:
| Flywheel | Feeds |
|---|---|
| Research cycles, reopen loop, parcel and intel passes | /research/, missing records, parcel records |
| Book search | The book findings CSV |
| Mail ingest, forensic journal | Post Office, dartboard roadmap, forensic assessments |
| Hive check-in, reply drafts, backlog burndown, repo–HubSpot sync | HubSpot tasks, /hive/, /online/hubspot/ |
| Agent library cycle | /academy/, /academy/work.json, /llms.txt |
| Version standard, daily site checks | Version gates and footers on every section |
| Documentary scenes | /movie/ |
| Watchtower recapture, first-seen detector | /online/watchtower/, the first-seen register |
| Growth, social and traffic runs | The e-book shelf and the shop (traffic, followers) |
The full list with cadences: /academy/FLYWHEELS/. The programme model is on the Cedwyn Snowball page.
How to contribute
- Issue first. Search open GitHub issues; no duplicates. If none fits, open one with the problem, the approach and a checklist of acceptance criteria, then comment the scope you are taking. The GitHub Actions programme starts at issue #174.
- Branch. Section work goes on
section/<id>or the theme branch. A change tomaingoes on its own branch with one pull request labelledsite-wide. - Record progress on the issue: files, commits, test results, blockers. Never report a step as done before it happened.
- No merge, deploy or data deletion without authorisation. No force-push. Do not start or cancel build-cedwyn while another run is going.
- Close an issue only when every acceptance item is checked on the live site.
- Public wording passes
tools/agent_lint.pyand the editing protocol at /research/editing-protocol/.
Not checked in this pass
- Source and cadence of the
ghf-watchandcedwyn-apiWorkers (not in this repository). - Which
webapp/*branches the build reads, and whatcedwyn-onlineserves. - Current build length and Cloudflare Pages project settings.
/docs/library/answers 404; this library lives at/library/.
Changelog
| Version | Date (UTC) | Change | Source |
|---|---|---|---|
| 2.2.0 | 2026-11-05 | Architecture page rewritten as the whole-site guide: map, repository layout, build and deploy, Workers, site areas, data flows, flywheels, contributing; catalogue counts refreshed; dark library theme; section list refreshed from themes.json. | main 81a7147, live site, issue #195 |
| 2.1.0 | 2026-10-31 | Cedwyn Snowball page and programme pointers added. | library.json; commits efb8b17, 0a9c658 |
| 2.0.0 | 2026-10-24 | Library reframed as repo housekeeping; site procedures folded into five-part manuals. | CHANGELOG.md |