bootstrap: brandkit-seam — the pure brandkit package + golden corpus #27
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Depends on
Reference
Matou/idss#27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
Wayfinder map: #7 — the engineering foundation (PROCESS.md Phase 2½, emitted as DAG root slices).
What to build
The pure
brandkitGo package — the single authority behind which the brand kit (DDR 0007) reaches every surface (the seam contract indocs/seams/theming.md, deciding for ADR 0035 status tokens and ADR 0038's kanidm boundary). Three coordinated pieces, one authority:brand-kit.schema.json(the canonical kit shape the operator's edits validate against), thebrandkitpackage itself (the only place any theming computation lives — preset expansion, derived tokens, contrast-safe picks, per-surface projection, coverage), and the compiled static artifacts render-time consumers load as a file and never re-derive. TypeScript never computes a token.Compileis THE seam operation and must be pure and deterministic — no I/O, no clock, so equalKits produce byte-identicalArtifactsand re-application is idempotent; it errors only on an invalid Kit or a Surface bug, never on an unrenderable token (that is aCoverageoutcome). ASurfaceis one theming target with a closedCapabilitytoken set; adding a surface is implementing that contract and nothing else moves.Validateis called before persisting and returns contrast shortfalls as Diagnostics (warnings), never blocking founding on a colour choice. CoverageReportmakes DDR 0007's accepted uneven fidelity inspectable.Notes: the golden
(Kit → Artifacts, Report)corpus is part of this slice — the deterministic-compile fixtures thedesign-verifyseam tests hang off — together with the ADR 0038 boundary encoded as a test:idp-login's capability is{brand.name, logo.mono}and admits nocolor.*token, structurally unreachable rather than filtered by convention. The two thin transports (the helper's stdio preview, the control plane'sPOST /brand/compile-preview) land with their consuming feature slices, not here — this slice is the pure package plus its corpus.Acceptance criteria
brand-kit.schema.json,Validate,Compile, theSurfacecontract,Registry, and the coverageReportall exist as specified.Kits, whenCompileruns, then it produces byte-identicalArtifactswith no I/O or clock (idempotent, an unchanged kit never churns a surface), erroring only on an invalid Kit or a Surface bug.(Kit → Artifacts, Report)fixtures pass.idp-login's capability admits{brand.name, logo.mono}and nocolor.*token — reading outside the narrowedDictViewfails.Validateruns, then the shortfall is a Diagnostic (warning), never an error that blocks founding.Blocked by
Task manifest
Done — shipped in commit
b56b6eb(sandcastle: bootstrap:brandkit-seam #27).The pure
brandkitGo package lives atinternal/brandkit/, built test-first at the manifest's seam (brandkit seam tests (Go)— the golden(Kit → Artifacts, Report)corpus + the ADR 0038 boundary test).Acceptance criteria — all met:
brand-kit.schema.json(embedded viago:embed),Validate,Compile, theSurface/Capability/DictViewcontract,Registry, and the coverageReport(kit.go,token.go,validate.go,compile.go,surface.go).Compileis pure/no-I/O/no-clock (package imports onlyembed/errors/fmt/math/sort/strings); two equalKits produce byte-identicalArtifacts(TestCompile_DeterministicByteIdentical), erroring only on an invalid Kit or a Surface bug (TestCompile_RejectsInvalidKit,TestCompile_ErrorsOnSurfaceBug), never on an unrenderable token (TestCompile_UnrenderableTokenIsCoverageNotError).internal/brandkit/testdata/golden/*.snapshot, four fixtures (explicit palette, preset expansion, per-service extras, contrast shortfall) driven byTestCompile_GoldenCorpus(regen:go test ./internal/brandkit -update).idp-login's capability is exactly{brand.name, logo.mono}, admits nocolor.*, and reading a colour from its narrowedDictViewfails withErrOutsideCapability(TestIdpLoginBoundary); proven end-to-end that the compiled kanidm fragment never contains the accent (TestCompile_IdpLoginArtifactHasNoColour).Validatereturns it as a warning, never a blocking error, and such a kit still compiles (TestValidate_ContrastShortfallIsWarningNotError).Six v1 surfaces registered (portal, dashboard, operator-app, idp-login, svc:nextcloud, svc:mattermost); the four-way coverage
Reportmakes DDR 0007's uneven fidelity inspectable (Mattermost's single accent honestlyDowngraded).Verified:
go build/vet ./...,go test ./internal/brandkit(all green),golangci-lint runclean.Out of scope (deferred to their consuming feature slices, per the manifest): the helper stdio preview + control-plane
POST /brand/compile-previewtransports, the Settings/founding kit-edit UIs, and any parallel TS re-implementation.STATUS.mdanddocs/slices/bootstrap.yaml(brandkit-seam→status: done) updated in the same commit.