Canonical writer sync
Bare repo plus post-receive hook
Decisions 0003 and 0005 define the sync posture: one accepted writer path, one generated site, and a deployment step that does not invent a second source of truth.
Flow
- Operator pushes to the bare canonical repository.
- The post-receive hook checks out the accepted branch into a worktree.
- The hook runs validators: frontmatter lint, link check, index generation, and site build.
- The static output is promoted only if validation passes.
| Decision 0003 | Establish canonical-writer sync instead of competing writable copies. |
|---|---|
| Decision 0005 | Use post-receive generation to keep the published reference derived from accepted source. |
| Failure mode | If validation fails, reject promotion and leave the previous static site intact. |
Hook sketch
#!/usr/bin/env sh
set -eu
GIT_WORK_TREE=/srv/davai/worktree git checkout -f main
cd /srv/davai/worktree
python3 tools/lint_frontmatter.py
python3 tools/check_links.py
python3 tools/build_index.py
python3 build_site.py
rsync -a --delete systembydave/ /srv/www/systembydave/
Sync guardrails