Repository navigation
Conversation
commit: |
|
Review record for head CI (gate 1): passed on this head. Required checks: Check, react-doctor, and both Publish @getpie/cli preview runs. State was MERGEABLE / CLEAN. Blocker (context, not a code defect). This is the same blocker as #479's record.
Not done for this head: code review against the diff (gate 2) and independent verification (gate 3). They stop at the design gate above, so nothing here is a code-quality or test verdict. What would warrant another review: #466 (or its persistence/§10 decisions) lands on |
Requirement
Hub Phase 1, slice 2 (RFC #466, sections 6, 8, 9): the synchronous SQLite store the Hub host will use. Independent of #479.
Expected behavior
New package
@getpie/hub(./store),node:sqliteonly, no ORM. Three STRICT tables as in the RFC, ordered migrations keyed byPRAGMA user_version, integrity check on open, refuses a newer database.HubStorecovers: enrollment token mint (10 min, at most 10 unused), enroll (pins UUID, consumes token, conflict on an active UUID, re-enroll after revoke), authenticate, revoke, hold on/off, event insert/dedupe/hold/caps (1000 events, 100 MiB), pending oldest first, attempts, ack (clears payload), sweep (24 h hold TTL, 48 h dedupe window).Changes and risks
New package, one line in
architecture.md, lockfile entry. Nothing imports it yet, so no runtime effect. The package location (packages/hub) is my choice, the RFC does not name one. No host write yet (library only);host-persistence.mdis updated in the slice that introduces$HUB_HOME. Security: tokens and credentials are only ever 32-byte hashes in this layer; callers hash before calling.Verification
Tested revision
9270a43bonorigin/main.pnpm exec vitest runinpackages/hub: 12 passed, no type errors (token expiry/cap, enroll conflict and re-enroll, revoke ends held events, unknown/revoked target records nothing, dedupe after settle, hold off, inbox_full, TTL and dedupe sweep, reopen persistence, newer-database refusal).oxlint packages/hubclean (build@getpie/oxlintfirst).pnpm checkfails only intools/oxlintitself (121 errors), reproducible without any change of mine, so not from this PR.node:sqliteloads under Bun 1.4.2 (SQLite 3.51.0); the tests were not run under Bun. No CI result yet.