host: Phase 3 — relations READ cut-over (get-children/get-parents), 121/121
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 20s

Migrate the two internal relations read queries onto lib/relations: GET
/internal/data/get-children + /get-parents dispatch to relations/children
and relations/parents. Bridge the Quart (type,id) node key to a graph atom
symbol "type:id" with relation-type as the edge kind; optional child/parent
-type params filter by "type:" prefix. Golden tests pin each endpoint to
subsystem-call + envelope. Ledger entries flipped to :migrated (off-Quart
coverage 27% -> 45%).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-19 17:24:37 +00:00
parent ef7de817bb
commit 11aba081f4
6 changed files with 219 additions and 16 deletions

View File

@@ -36,9 +36,10 @@ host — no `ocaml-on-sx` dependency.
## Status (rolling)
`bash lib/host/conformance.sh`**107/107** (6 suites: handler, middleware, sxtp,
router, feed, ledger). Phases 1 & 2 DONE; Phase 3 (strangler ledger) underway —
ledger module landed; `relations` cut-over next.
`bash lib/host/conformance.sh`**121/121** (7 suites: handler, middleware, sxtp,
router, feed, relations, ledger). Phases 1 & 2 DONE; Phase 3 (strangler ledger)
underway — ledger module + `relations` READ cut-over landed (45% off Quart);
relations writes + golden harness next.
## Ground rules
@@ -115,8 +116,13 @@ lib/host/sxtp.sx subsystem APIs (feed/search/commerce/…
the live state: feed reads+writes migrated, `/health` native, the
internal-only `relations`/`likes` data+action endpoints proxied.
- [ ] golden-response harness vs the live Quart responses
- [ ] cut over a whole domain (`relations` — it has a real SX subsystem
`lib/relations`; `likes` has none so it stays proxied) as proof
- [~] cut over a whole domain (`relations`) as proof — READ side DONE
(`lib/host/relations.sx`): `GET /internal/data/get-children` + `/get-parents`
dispatch to `lib/relations` (`relations/children`/`parents`). Node model:
graph atom = symbol `"type:id"`, edge = relation-type; optional child/parent
`-type` param filters by `"type:"` prefix. Golden tests pin each endpoint to
`subsystem-call + envelope`. Ledger entries flipped to `:migrated`. WRITE side
(`relate`/`unrelate` actions, behind auth+ACL like POST /feed) next.
## Phase 4 — Dream framework layer (gated)
- [ ] gate: `ocaml-on-sx` Phases 15 + minimal stdlib green
@@ -175,6 +181,21 @@ lib/host/sxtp.sx subsystem APIs (feed/search/commerce/…
to). NEXT: migrate the `relations` read endpoints onto host handlers (flip their
ledger status to `:migrated`) with golden tests.
- **Phase 3 — relations READ cut-over (DONE, 121/121).** `lib/host/relations.sx`
+ a 13-test golden suite; ledger flipped (off-Quart coverage 27% → 45%). The two
internal read queries (`get-children`, `get-parents`) now dispatch to the
`lib/relations` Datalog graph. Bridge: the Quart `(type, id)` node key maps to a
graph atom `(string->symbol "type:id")` with relation-type as the edge kind;
optional `child-type`/`parent-type` params filter the result list by `"type:"`
prefix (verified live: composite-string nodes round-trip through
`relations/relate``relations/children`). Golden discipline: `relations` is
internal-only (no public Quart route — confirmed via `svc_routes`), so the golden
is a **pinned fixture** (a known graph loaded in-test, asserted as
`subsystem-call + envelope`) rather than a live Quart capture. Reads are
unguarded for now — the signed-internal-auth gate is a separate middleware layer,
same as the feed reads. NEXT: relations WRITE actions (`relate`/`unrelate`)
behind the auth+ACL pipeline (mirroring POST /feed).
## Blockers
- **Live wiring to the native OCaml HTTP server** (Phase 3/4): the prod server in