Core

Core

The machinery that runs Forge — connector, registry, secrets vault, logging.

Core

Core is machinery, not content. It is the one plug between projects and Forge. It holds no components, docs or templates. Projects talk to Core; Core talks to the Forge repo. Clients have no access.

A local Worker lives in apps/core (D1 + mock GitHub). Nothing is deployed. See Run Core locally. Defaults vs open questions: Local v1 defaults chosen. Remaining product decisions: Open questions.

Pieces

  • Connector — the plug. A project presents a small project token. Core checks it, then uses its own stored GitHub credential to read from or publish to the Forge repo. The project never sees that GitHub credential. State: local Worker + @ziteox/core-client (mock GitHub).
  • Registry — which projects exist, their tokens (hash / last4 / prefix only), and path-scoped grants. Issues, rotates and revokes tokens via the admin portal. State: local D1 tables.
  • Secrets vault — sealed secrets for Core itself (for example the GitHub App private key), encrypted at rest with Core’s own key. Never returns plaintext to callers. Separate from project env vars. State: local envelope seal/resolve.
  • Logging — minimal, append-only audit of Core operations. No secret values. State: local insert-only audit_events.
  • Cache — optional read cache for hot paths. Later; not in the first slice.

Env vars boundary

Env vars stay in the admin portal, not in Forge. Core’s secrets vault is for Core’s own upstream secrets. It is not an env store for projects.

Admin portal and Ziteox Account

Staff manage Forge tokens at admin.ziteox.com (portal app ziteox-admin). There is no separate Core login. The admin portal vouches for management actions with a short-lived signed assertion. Core trusts that assertion; it does not read Supabase sessions.

Ziteox Account (auth.ziteox.com) is who the staff member is. It is separate from Core’s project-token permissions. Core never treats an Account session as a project credential.

Milestones (M0–M6)

Proposed rollout from the connector & registry design. All local only until Laki says otherwise.

IDDeliverable
M0Architecture doc accepted (or revised) by Laki
M1Local D1 schema (mirrors forge_core): projects, tokens, grants, vault, audit — in repo
M2Worker skeleton: health, assertion verify, whoami with hashed tokens — in repo
M3Mock GitHub read files + tree (App stub; real App later) — in repo
M4Publish → branch + PR (mock); scope checks — in repo
M5Admin portal pages: issue / rotate / revoke via assertions — not started (local admin client + e2e only)
M6MCP thin wrapper; rate limits; security gates sign-off