# Gift Graph Technical Specification
> The shape of Gift Graph as it runs, from v0.1 as Replit Agent built it on 2026-10-01 through [[Gift Graph Product Log|{version}]], published [[Gift Graph Product Log|{released}]] at giftgraph.aleksandar.app. The canonical spec is `docs/spec.md` in the repo. The idea dates to 2026-02-15 ([[Project - Gift Graph/Build & Iterate/Technical Decisions#TDR-000: Explore the Idea Before Building It|TDR-000]]). The concept and the full design space live in [[Concept - Gift Graph - Consent-Gated Context Between Agents]]; the reasons behind each choice live in [[Project - Gift Graph/Build & Iterate/Technical Decisions|Technical Decisions]].
![[gift-graph-architecture-v01.png]]
*The v0.1 map · each outlined group marks a separate trust boundary · the landing page is its own web artifact, and a shared proxy routes `/mcp` and `/health` to the API*
**Trust:** The server receives and stores each Idea as written, its Secret, its Hint, and its labels, unshared Ideas included. Owners trust its API and database with those details. A person who hears receives the Hint or the Secret by the depth on their connection, the Idea's Hint only cap, and any share, and nothing of an Idea that is unshared or tagged to a person. The database holds a keyed hash of each verified sign-in email and no address.
**The idea:** Two people's agents share gift-relevant preferences through a shared MCP server. Each person controls what their agent may whisper and how much the other side hears. The receiving agent learns only what it was given, which is enough to choose a good gift.
**Parties:** An owner, whose preferences are shared. A requester, whose agent asks for gift ideas. The Gift Graph server between the two agents.
## Runtime
| Layer | v0.1 |
| --- | --- |
| Server | TypeScript on Node, official MCP SDK, running in the app's Replit container |
| Transport | One `/mcp` endpoint speaking MCP over Streamable HTTP; a fresh transport per request, session IDs disabled |
| Storage | Replit PostgreSQL; all durable state lives here |
| Identity | `Authorization: Bearer <token>` on every request; the server maps the token to a seeded user and takes identity only from that match |
| Secrets | `ALEKS_BEARER_TOKEN` and the second user's token in Replit Secrets, read at runtime |
| Deployment | Autoscale, build `npm run build`, run `npm start`, North America, 2 vCPU and 4 GiB |
| Health | `GET /health` returns `{"status":"ok"}`; `GET /` names the endpoint, the health check, and bearer auth |
## Data model
| Table | Holds |
| --- | --- |
| `users` | The two seeded people |
| `connections` | requester, owner, status (pending · approved · revoked), default disclosure tier |
| `drops` | owner, requester (v0.1 scopes a drop to one connection), verbatim text, owner-written category text, owner-written vibe text, tier, surprise-safe flag, timestamp |
## Levels
| Depth | A person who hears at it receives |
| --- | --- |
| Secret | The Secret as written ("wants a license for Söhne"), or the Hint where an Idea has no Secret |
| Hint | A line on the feeling, the origin, and the occasion, with up to two labels from sixty-four kinds ("typefaces") |
An Idea carries a Hint and, when there is a thing, a Secret. The depth sits on the connection alone, and Pause is the nothing ([[Project - Gift Graph/Build & Iterate/Technical Decisions#TDR-057 The Owner Never Picks a Level for an Idea|TDR-057]]). Hint only keeps an Idea's Secret from everyone, and a one-off share moves one person above or below their depth, stored only while it differs from the rule ([[Project - Gift Graph/Build & Iterate/Technical Decisions#TDR-063 A One-Off Lives Only While It Means Something|TDR-063]]). No one hears an unshared Idea or an Idea tagged to a person ([[Project - Gift Graph/Build & Iterate/Technical Decisions#TDR-064 A Tagged Idea Is Heard by No One|TDR-064]]). The server checks the hint line against the secret for its distinctive words and for numbers before anyone hears it, and a widening previews and waits for the owner's yes. The four tiers of v0.1, verbatim, category, vibe, and silent, mapped onto three levels on 2026-10-03, with category and vibe becoming the hint ([[Project - Gift Graph/Build & Iterate/Technical Decisions#TDR-021|Technical Decisions > TDR-021]]), and Silent left the connection on 2026-10-18.
## Tools
| Group | Tool | Who calls it | What it does |
| --- | --- | --- | --- |
| Ideas | `whisper` | owner | Saves an Idea, a Hint and, when there is a thing, a Secret, after a preview; `for` tags it to a person, and `shares` names who hears it otherwise |
| Ideas | `list_secrets` · `update_secret` · `hush_secret` | owner | Reviews and edits Ideas, unshares them, and shares them again; `list_secrets` says what each person hears and why |
| Shares | `share_secret` · `unshare_secret` · `ask_to_hear` | owner; the hearer asks | One Idea for one person, and asking to hear one behind its Hint |
| Hearing | `hear` | requester | Returns everything the person may hear from one owner, ranked by an optional question, with the birthday at their depth |
| Connections | `request_connection` | requester | Asks to hear an owner, by account ID or by email |
| Connections | `approve_connection` · `set_level` · `connection` with decline, pause, resume, or remove | owner; either side removes | The connection lifecycle |
| Connections | `list_connections` | either | Shows where each connection stands |
| Invites | `invite` with create, list, revoke, or accept | owner, then the invitee | Single-use links at a depth, each naming its person |
| Guidance | `help` | any | The flows and the consent rules, with five prompts, `whisper-a-gift-idea`, `invite-someone`, `what-do-i-hear`, `whats-coming-up`, and `whats-waiting` |
The seven tools of v0.1 were `request_connection`, `approve_connection`, `revoke_connection`, `set_default_tier`, `list_connections`, `drop`, and `pull`, renamed on 2026-10-07 ([[Project - Gift Graph/Build & Iterate/Technical Decisions#TDR-035|Technical Decisions > TDR-035]]). The invite and connection verbs folded into two tools on 2026-10-10, fifteen tools in all ([[Project - Gift Graph/Build & Iterate/Technical Decisions#TDR-049 The First Grouping of the Tools|TDR-049]]). The tool names keep `secret` until the rename a release from now.
## The privacy filter
The server checks for an approved connection before anything else. One function projects each secret to what this person may hear, and ranking reads only that projection, which means a question naming a hidden word surfaces nothing hidden. Silent and hushed secrets stay in the database on a read. A removed or paused connection returns an empty list at once.
## Tests
85 API tests, 26 web tests, and 21 routing tests on 2026-10-07, run against isolated schemas on a local Docker Postgres, and since 2026-10-14 a parity test that keeps a fresh database and a migrated one the same. A judge drives real agents through twenty scenarios, S1 to S7 and the parity set P1 to P13, and scores the transcripts ([[Project - Gift Graph/Build & Iterate/Validation Log|Validation Log]]), and a daily synthetic check lists the published server's tools. The four promises of the brief hold among them: one user cannot act as the other, a Silent secret returns nothing, a removed connection returns nothing at once, and hearing before approval fails.
## Deferred from v0.1
The anti-inference batcher (48-hour delay, three-secret minimum, jitter), PSI-based tombstones for hushing and purchases, notifications, enterprise SSO, and embeddings stay deferred. The owner review screen, registration, OAuth for MCP clients, and ranked hearing have shipped since. Each open item is prioritized in [[Project - Gift Graph/Build & Iterate/Feature Backlog|Feature Backlog]].
## Owner controls · v0.2, as built then
| Area | What v0.2 does |
| --- | --- |
| Dashboard | `/owner`. The owner signs in with the existing credential, which the app exchanges for a six-hour HTTP-only session and clears from the input. Sign out removes the server session. The public landing page stays public. |
| Sharing | A new owner-wide preference explicitly chooses all approved connections as its audience and a ceiling. Effective disclosure is the more restrictive of the ceiling and the connection limit. The owner writes every visible lower-tier text. The dashboard shows originals, disclosures, audiences, connection limits, and withdrawal state. |
| Confirmation | A tier increase returns a five-minute preview, and an explicit second owner call applies it. Edits and legacy conversion also require confirmation; audience expansion uses a separate approval. Any change to owner state invalidates outstanding previews. Decreases apply immediately. Approval and reapproval cannot bypass widening checks. |
| Transition | Existing requester-scoped drops keep their single audience and snapshot disclosure. Missing lower-tier text is flagged. The owner completes the text and confirms conversion before ceiling rules apply, and conversion preserves the audience. A separate approval enables sharing with all approved connections, future approvals included. |
| Withdrawal | A withdrawn preference stays out of every future pull, reapproval included. The original stays with its owner. There is no restore, no pull history, and no activity indicator. Information already received cannot be retracted. |
| Migration | `schema.sql` stays for fresh setup; `pnpm --filter @workspace/api-server migrate:dev` adds owner controls without deleting or merging records. Startup runs readiness checks only. Tests create isolated schemas with synthetic data and remove them afterward. |
| Production | v0.2 does not publish or change production on its own. `docs/production-v02.md` holds the separate owner-reviewed application process. |
| Review gates | Milestone review gates with an audit trail sit in `package.json` and `replit.md`, and read-only synthetic checks exercise the MCP surface without writing. A second model reviews each milestone against the approved requirements; tests stay the ground truth ([[Project - Gift Graph/Build & Iterate/Technical Decisions#TDR-016\|Technical Decisions > TDR-016]]). |
| Owner tools | `list_drops`, `update_drop`, and `withdraw_drop`, callable only by the owner's own credential, beside the seven agent tools. |
## Development preview · 2026-10-02
In the preview and not yet in production.
| Area | What the preview does |
| --- | --- |
| Accounts | Each account has an ID (`gg_…`). The dashboard shows it, the endpoint, the transport, and the header line, and issues the account's MCP token on request ([[Project - Gift Graph/Build & Iterate/Technical Decisions#TDR-017\|Technical Decisions > TDR-017]]). |
| Demo | `/demo`, two synthetic people, Theo and Mira, three whispers with editable tiers, four prompts, a reset. Touches no account ([[Project - Gift Graph/Build & Iterate/Technical Decisions#TDR-018\|Technical Decisions > TDR-018]]). |
| Vocabulary | The page says whispers. Tier labels read word for word, the kind of thing, a hint, kept quiet. The tool schema keeps verbatim, category, vibe, silent. Open, pending Probe 1. |
| Layout | Compact layouts as a standing rule, checked at 1280x800, 1440x900, and 390x844 ([[Project - Gift Graph/Build & Iterate/Technical Decisions#TDR-020\|Technical Decisions > TDR-020]]). |
## Since v0.2
| Release | What it added |
| --- | --- |
| v0.3 and v0.4 · 2026-10-03 | Three levels with labels, ranked hearing, the connection lifecycle, invites, and a server that migrates itself at start |
| v0.5 · 2026-10-05 | Vocabulary version 2, the web app from the design handoff, and Secret as the noun |
| v0.6 · 2026-10-05 | OAuth with Gift Graph as its own authorization server, Your agents, Hush and the Silent drawer, a new link for a lost one, and the agent's guidance in `next` |
| v0.6.1 · with v0.6.2 | The nudge to connect, API keys for apps like Muse, the account line at connect, one direction per connection card, and the page for agents |
| v0.6.2 · 2026-10-07 | The seeded identities retired, one vocabulary in plain technical English, `help` and three prompts, requests by email, removal closing named links, Teal ember, and two indexes from the audit |
| v0.6.3 · 2026-10-08 | One account per person across domains (migration 012), and about half the database round trips behind every agent message |
| v0.6.4 · with v0.7 | Your account at `/account`, a sealed shipping address in Beta (migration 013), Your secrets as home, asking by email on the web, and Codex as one row |
| v0.7 · 2026-10-10 | A secret for one person and asking to hear one (migration 014), with `share_secret`, `unshare_secret`, and `ask_to_hear` |
| v0.7.1 · 2026-10-16 | The founder connection, one way; giftgraph.aleksandar.app as the one domain; a fresh and a migrated database made the same (migration 015); a birthday on the account with no year (migration 016), on `hear` and the connection card; the preview an agent shows, written by the server as `show`; the name people see, set on the account page; and the skill folder, with the manifests held |
| v0.7.2 · 2026-10-18 | An Idea as a Hint with an optional Secret (migration 017), Silent off the connection, the notice on every result, `for` for an Idea about a person, time on an Idea and `hears` on `list_secrets` (migration 018), a fourth prompt, the request as the owner's yes, and the home on one page |
| v0.7.3 · with v0.7.4 | Ideas and Connections on pages of their own under folder tabs, one choice control, a one-off at save, a name on every link, Unshare, the four nouns capitalised, one share control, one-offs kept only while they differ from the rule, the light theme, and the secret's own switch |
| v0.7.4 · 2026-10-19 | Hearing on a friend's card, a twin spark for an Idea, Capture an Idea from a line heard, the agent telling a wish from a gift with a name check and `whats-waiting`, `only` retired for `shares`, and the demo rebuilt |
| v0.7.5 · 2026-11-22 | The whisper sheet on a phone's keyboard, For Me or For Someone Else, an MCP server that keeps no session and answers in fewer trips to the database, pages that load when opened, a `components/ui` of nine files, and two betas off in production, themes on migration 019 and Heard |
## The site
![[gift-graph-site-v074-home.png|560]]
*The public home on 2026-10-19 · the light theme, an example Idea with its Secret and its Hint, and Connect an agent*
![[gift-graph-site-v074-demo.png|560]]
*The demo on 2026-10-19 · Theo asks, the agent carries Mira's Hints, and Mira's Ideas sit as tiles*
## Clients
Any MCP client over Streamable HTTP, at `https://giftgraph.aleksandar.app/mcp`. The Replit domain keeps serving the agents signed in there until it retires, and each reconnects once at the new address then. A client that supports sign-in adds the URL and signs in through the consent page; Claude Code does it with `claude mcp add --transport http gift-graph <url>`. An app that asks for an API key, like Muse, takes a token of its own from Your agents. Each person's agent holds only its own credential. The setup guide lives in `docs/mcp-client.md` in the repo.