Skip to content
Architecture

Architecture

Internal design documents covering the architecture, key decisions, and internals of labelsync. For how to drive the tool, see Usage.

These pages describe what has been built. The forward-looking plan — goals, prior art, the reconciliation algorithm, milestones, and open questions — lives in design.md. As each subsystem lands, its behaviour moves from the design plan into this section.

PageCovers
OverviewPackage structure, CLI command tree, the reconciliation data flow
Error HandlingSentinel errors, the %w wrapping rule, and the error_kind JSON contract
Output & Exit Codesoutput.Writer, pretty vs NDJSON, TTY detection, the slog boundary, exit codes
VersioningThe linker-injected Version, and what each build produces
Colour PaletteThe deterministic HSL candidate grid, its legibility bounds, and determinism
ConfigurationConfig file resolution, YAML parsing, and the normalisation rules
PlannerThe Action / Plan vocabulary and its JSON contract
AuthenticationThe four-step token resolution chain, and why tokens are redacted at the type
GitHub ClientThe go-github wrapper, the per-repository error taxonomy, and the 5xx retry
Rate LimitingThe write bucket, header tracking, backoff, and the --max-wait ceiling
ApplyExecuting a plan in append mode, partial runs, and the startup budget check
DistributionThe release pipeline, the three install channels, and the Homebrew cask
Library DecisionsEvery direct dependency, what it is for, and what it was chosen over
Demo RecordingThe VHS tape behind the GIF, and how to re-record it

Pages are added here as the subsystems they document are implemented.