e1b3c64e
feat: service — wiring, space lifecycle, read paths, push validation, reconciler
Phase 1 of the implementation plan: the orchestration layer's read, validate and repair halves. The write plane (propose/merge) is Phase 3 and is absent. - Config/New assemble a Service from the shared config.ini, reporting every missing key in one message; TokenStore adapts db/ to authn.TokenStore, mapping db.ErrNotFound onto authn.ErrUnknownToken so an unknown credential is a 401 rather than a 503. - CreateSpace writes the repository first and the row second, removing the repository again if the insert fails; a crash between the two leaves content that is merely unlisted rather than a phantom space. - ReadDocument/ListDocuments/Policy/ResolveRev resolve the approved head or a pinned revision through one code path. - ValidatePush checks the refs rule first and unconditionally, then frontmatter and document-id uniqueness, which --push-option=skip-validation waives. The rejection is a structured, terminal-shaped message naming the document. - PlanRepairs is the repair table as a pure, table-tested function; Reconcile gathers the facts and applies them, listing stale-index spaces for Phase 2. Two departures from the design's repair table, both to stop the reconciler destroying live state, documented at their definitions: an open row with no branch is left alone inside a grace window (every propose passes through that state), and a branch still sitting on its recorded base is never treated as merged (its tip is trivially an ancestor of the approved head).
Eugene Blikh <bigbes@gmail.com> — 2026-07-22 11:07:36 UTC
Commit e1b3c64edf59eed1ee27a2a66c9983d23ad22a25 —
view raw patch
Parent(s):
2b11f1ae
| File | Status | + | − |
|---|---|---|---|
service/doc.go
|
A | +44 | |
service/fixture_test.go
|
A | +378 | |
service/integration_test.go
|
A | +313 | |
service/push.go
|
A | +440 | |
service/push_test.go
|
A | +349 | |
service/read.go
|
A | +177 | |
service/read_test.go
|
A | +213 | |
service/reconcile.go
|
A | +570 | |
service/reconcile_test.go
|
A | +295 | |
service/service.go
|
A | +247 | |
service/service_test.go
|
A | +184 | |
service/space.go
|
A | +150 | |
service/space_test.go
|
A | +107 | |
service/token.go
|
A | +75 |