2.5 KiB
Projection Operations
This repo is projected into AFFiNE manually for now.
Canonical Gitea repo:
http://100.64.0.1:30087/section0/rta-handbook.git
Projected AFFiNE path:
Agent Workspace / Section 0 / Git Projections / RTA Handbook
What A Collaborator Does
cd ~/Developer/Section0/rta-handbook
git pull --ff-only
# edit Markdown
git add .
git commit -m "Update docs"
git push
What The Projection Operator Does
The operator keeps a separate checkout so projection never depends on a collaborator's dirty working tree.
Nice wrapper:
/Users/virgil/Developer/rta/tmp/markdown-projection-gitea/collaborator-checkout/rta-handbook/scripts/project-section0-rta-handbook.sh
It pulls the projector checkout, checks it is clean, and runs the AFFiNE projection command.
Manual equivalent:
git -C /Users/virgil/Developer/rta/tmp/markdown-projection-gitea/projector-checkout/rta-handbook pull --ff-only
Then from home-lab-v7:
cd /Users/virgil/Developer/Virgil-Info/home-lab-v7
nix develop --command bash -lc 'scripts/ops/sync-obsidian-affine.rb \
--name section0-rta-handbook \
--source /Users/virgil/Developer/rta/tmp/markdown-projection-gitea/projector-checkout/rta-handbook \
--username projection-bot \
--authentik-sub rta-projection-bot \
--affine-workspace "Agent Workspace" \
--affine-workspace-id 53ea0a0b-eca7-4887-8e31-f5b2a8ab7744 \
--affine-user-id ce42f50a-5367-4466-920b-7422c4e27de0 \
--affine-namespace 'Section 0/Git Projections/RTA Handbook' \
--include "**/*.md" \
--apply'
Expected healthy result currently includes five docs:
docs: 5
mark stale: 0
mode: one-way read-only AFFiNE docs
Push-To-Projection Automation
Pushing to main can trigger sync, but it should be implemented as a small
projection worker, not as a Gitea container hook.
Preferred shape:
Gitea push webhook
-> RTA projection worker endpoint
-> pull projector checkout
-> validate clean source
-> run projection
-> emit logs/receipt
This keeps Gitea as Git infrastructure and keeps projection policy in RTA. A server-side Git hook inside the Gitea container would be harder to observe, harder to recover, and too tightly coupled to the packaged app internals.
Rule Of Thumb
If the source repo changes, pull the projector checkout and run projection.
If AFFiNE changes, treat it as a comment or sketch. Move durable edits back to Markdown before projecting again.