Cedwyn library

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.

303branches in the repository
53sections in themes.json
15,059catalogued files
353,227graph edges

The map in one table

PartWhat it isWhere
SourceOne public Git repository; main holds the shell, every section has its own branch.unclehowell/cedwyn
BuildGitHub Actions workflow build-cedwyn assembles all sections into one static site..github/workflows/build.yml
HostingCloudflare Pages serves the built branch site; a few Cloudflare Workers add live features.cedwyn.bucklerfamily.estate
DataOne SQLite catalogue built on every deploy, read in the browser./db/
Work registerHubSpot tasks, coordinated by the Hive./hive/, /online/hubspot/
DocsThis library (humans) and the Agent Academy (machines)./library/, /academy/

Repository layout

Branch or repoHoldsReaches the site
mainSection 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.
hiveThe 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/.
agentsThe machine-facing Agent Academy.Copied to /academy/ by tools/academy_pointer.py.
libraryThis library: words in content/pages.json, layout in static/, output in public/.Copied to /library/ by tools/library_pointer.py.
projectsThe Project Office, including the HubSpot mirror data.Theme branch (dir projects/public).
siteThe assembled output. Written only by the build.Served by Cloudflare Pages.
Other repos: unclehowell/BucklerFamilyFarm, unclehowell/datroApex 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

  1. Triggers. A push to main on the paths above, a section push through sections-ci, or a manual run. Concurrency group with cancel-in-progress: false: a running build always finishes; newer pushes wait as one pending run.
  2. Preflight: Python compile checks and the agent-tools, evidence-hierarchy, parcel-story and Q&A tests.
  3. Fetch the tip of every branch in themes.json, then every commit pinned in sections.lock, one at a time.
  4. 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).
  5. Rewrite links and store shared files once (tools/rewrite.py).
  6. Site root (tools/site.py): header and menu from themes.json, runtime, redirects, the agent footer, /academy/ and /library/.
  7. Self-contained pass, page journal (tools/page_journal.py), privacy scrub (tools/privacy_scrub.py).
  8. Catalogue database (tools/build_db.py) and its test.
  9. 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).
  10. Publish to branch site; reports go to main under reports/. Cloudflare Pages serves site.

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

WorkerServesSource
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-watchThe Hive dashboard, job list and job leases behind /hive/; the change monitor at watch.bucklerfamily.estate.Not in this repository (not checked).
cedwyn-apiThe human academy at /learn/ (opens on academy.bucklerfamily.estate) and its members area.Not in this repository (not checked).
cedwyn-agent-bridgeThe machine route linked from the site footer: manifest, public task metadata, submissions.workers/agent-bridge/
agent-footerAdds the collapsed agent footer at the edge to any page that lacks it.Named in tools/agent_footer.py; source not checked.
cedwyn-onlineNot checked.workers/cedwyn-online/

Site areas

Status is the answer to a cache-busted read on 5 Nov 2026 around 08:30 UTC.

AreaPathSourceStatus
Research Library/research/section/research200
Legal Wiki/wiki/wiki / section/wiki200
Evidence Catalogue/docs/docs (1,045 items in /docs/docs.json)200
Missing records register/research/missing-records/section/research200
E-book Shelf (version gate)/ebooks/ebooks; editions in data/ebooks.json200
Agent Academy/academy/agents200
Academy (people)/learn/Worker cedwyn-api200 via academy.bucklerfamily.estate
Documentary/movie/ → /documentary/cedwyn-movie200
Hive/hive/, /hive/jobs.jsonWorkers hive-proxy + ghf-watch; hive branch200 (protocol v3.23.0 on the page)
HubSpot mirror/online/hubspot/projects branch, refreshed hourly200
Disclosure Dartboard and roadmap/online/dartboard/ (roadmap at #roadmap)datro@dartboard, crawled200; /dartboard/data/roadmap.json 404
Watchtower/online/watchtower/watchtower200
FCG and first-seen register/online/fcg/; fcg.bucklerfamily.estate/first-seensection/fcg200
Garden Gallery/nft-art/nft-art200
Machine index/llms.txt, /agents.json, /areas.json, /mcp/Build (tools/academy_pointer.py, tools/nav.py)200

Core catalogue: three layers

LayerWhere it livesWhat it holds
Section sourceOne branch per sectionThe section's pages, styles, scripts and its own data files (JSON, CSV, Markdown).
Assembled siteBranch siteEvery section copied under /<id>/, links rewritten, shared files stored once in /_blob/.
Core catalogue/db/ in the assembled siteOne 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.

TableOne row perKey columns
artifactsunique file (by sha256)id, sha, kind, mime, bytes, title, year_min, year_max, has_blob
locationsplace a file appearsaid → artifacts.id, theme (section id), path, url
blobsstored file bodysha, data (raw bytes: images, PDFs, data files up to 2.5 MB each)
ftspage or text fileFTS5 index: title, body, aid, theme, path
nodes, edgesgraph node / relationpage→embeds/links→artifact, artifact→mentions→year, artifact→cites→host, artifact→in_theme→section
capturesarchived web addresskey, url, title, latest, captured
layers, layer_items, layer_refs, layer_depsreading over the evidenceitems point at artifact ids; they never copy content
section_recordsrecord from a section's own databasetheme, kind, id, seq, data (JSON)
evidence_gradesevidence recordev, grade, origin, path, note
themes, metasection / build factsection 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 in blobs. Each appearance is a row in locations.
  • 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.js with /_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 with POST /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 is hive/BOARD.json on the hive branch.
  • HubSpot mirror. An hourly job reads task metadata (no private bodies) and commits it to the projects branch; 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 in data/core/records/ format, added through an open pull request. Intelligence: the missing-records register on section/research. Existing rows are never edited in place; changes go through a pull request labelled catalogue-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.py at build and by the edge Worker for pages that lack it.
  • Version standard. docs/VERSION-STANDARD.md (1.1.0): versions are vMAJOR.MINOR.PATCH, oldest first; v0.0.1 is 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.py checks it.

Flywheels

Scheduled agent runs keep the site moving. Each feeds a fixed place:

FlywheelFeeds
Research cycles, reopen loop, parcel and intel passes/research/, missing records, parcel records
Book searchThe book findings CSV
Mail ingest, forensic journalPost Office, dartboard roadmap, forensic assessments
Hive check-in, reply drafts, backlog burndown, repo–HubSpot syncHubSpot tasks, /hive/, /online/hubspot/
Agent library cycle/academy/, /academy/work.json, /llms.txt
Version standard, daily site checksVersion gates and footers on every section
Documentary scenes/movie/
Watchtower recapture, first-seen detector/online/watchtower/, the first-seen register
Growth, social and traffic runsThe 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

  1. 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.
  2. Branch. Section work goes on section/<id> or the theme branch. A change to main goes on its own branch with one pull request labelled site-wide.
  3. Record progress on the issue: files, commits, test results, blockers. Never report a step as done before it happened.
  4. No merge, deploy or data deletion without authorisation. No force-push. Do not start or cancel build-cedwyn while another run is going.
  5. Close an issue only when every acceptance item is checked on the live site.
  6. Public wording passes tools/agent_lint.py and the editing protocol at /research/editing-protocol/.

Not checked in this pass

  • Source and cadence of the ghf-watch and cedwyn-api Workers (not in this repository).
  • Which webapp/* branches the build reads, and what cedwyn-online serves.
  • Current build length and Cloudflare Pages project settings.
  • /docs/library/ answers 404; this library lives at /library/.

Changelog

VersionDate (UTC)ChangeSource
2.2.02026-11-05Architecture 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.02026-10-31Cedwyn Snowball page and programme pointers added.library.json; commits efb8b17, 0a9c658
2.0.02026-10-24Library reframed as repo housekeeping; site procedures folded into five-part manuals.CHANGELOG.md
Agent guest book · versions 1.change.fix, from the commit history
VersionDateChangeWho

See all