Dock Protocol Openai

SPEC_DOCK_PROTOCOL_OPENAI.md · 2026-04-20

SPEC_DOCK_PROTOCOL_OPENAI.md

CGNT-1 Specification — Dock Protocol — OpenAI (ChatGPT)

Status: SPECIFIED

Version: v1.0

Author: VELA (Thread #13)

Conceived by: NOUS (α.13)

Date: 2026-04-20


PURPOSE

When a user docks ChatGPT into OBI OS, this is exactly what happens — technically, experientially, and in terms of LATTICE onboarding. Each AI provider has quirks. OpenAI's quirks are documented here so the docking flow is seamless.


PREREQUISITES


DOCKING FLOW — STEP BY STEP

Step 1 — API Key Entry

User provides their OpenAI API key. Bridge validates it immediately with a lightweight API call (models list endpoint).

Key stored locally at ~/.obi/keys/openai.json. Encrypted at rest. Never transmitted to 42sisters.ai.


Step 2 — Model Selection

Bridge queries OpenAI API for available models. Displays: "Which model do you want to dock?"

Options presented based on what their key has access to:

Default: gpt-4o. User selects. Stored in dock config. Changeable anytime.


Step 3 — LATTICE Onboarding

Bridge opens a LATTICE training channel with the selected model. The onboarding is an automated conversation between OBI OS and ChatGPT — the user watches but doesn't need to participate.

Onboarding script teaches ~50 public LATTICE symbols (L1 level):

Takes 5-10 minutes. Uses ~2000-3000 tokens from user's OpenAI account.

Onboarding ends with certification test: 5 translation challenges. Score determines LATTICE level.


Step 4 — History Import (optional)

Bridge offers: "Want to import your ChatGPT conversation history? This lets the Bridge learn your preferences and projects."

If yes:

  1. User goes to Settings → Data Controls → Export Data on chat.openai.com
  2. Downloads ZIP. Drags into Bridge Workbench.
  3. LEARNX processes conversations.json — extracts topics, preferences, vocabulary patterns, project context
  4. Builds cross-provider user profile stored locally. Never uploaded.

If no: skip. The Bridge works without history. The user can import later anytime.


Step 5 — Dock Confirmation

ChatGPT icon appears in the Dock carousel with:

Bridge announces in the Ring: "ChatGPT (gpt-4o) has joined the Bridge. L1 LATTICE certified. Ready."

User can now interact with ChatGPT through the Ring alongside any other docked AIs.


OPENAI-SPECIFIC QUIRKS

Rate Limits

OpenAI enforces TPM (tokens per minute) and RPM (requests per minute) limits per tier. The Bridge tracks usage and throttles gracefully.

If limit approached: "ChatGPT is cooling down (rate limit). Other docked AIs can handle queries meanwhile."

This is a feature of multi-AI — when one AI hits limits, others pick up the slack.

Streaming

OpenAI API supports streaming responses. Bridge should use streaming for Ring display — the user sees ChatGPT's response appear word by word, same as in ChatGPT's own interface.

Function Calling

OpenAI supports function calling / tool use. Bridge can expose ROUTX modules as OpenAI functions — ChatGPT can call GLOSS, NEXUS, etc. directly through the OpenAI function calling API. This is advanced integration (Phase 3+).

System Prompt

Bridge injects a LATTICE context preamble into ChatGPT's system prompt. This is how LATTICE knowledge persists across conversations. The preamble includes the L1 symbol set and grammar rules. ~500 tokens. Added to every API call.

Context Window

gpt-4o has 128K context. The Bridge manages context by keeping LATTICE preamble + recent Ring history + Workbench context within limits. When approaching limit: summarize older Ring messages and compress.

Cost Transparency

Bridge shows estimated cost per query based on token count × OpenAI pricing. User always knows what they're spending. "That query cost ~$0.003." No surprises.


EXPORT FORMATS (conversations.json)

OpenAI's data export is a ZIP containing conversations.json. Structure: array of conversation objects, each with: title, create_time, mapping (message tree).

LEARNX parser extracts:

This data builds the cross-provider routing intelligence: "This user asks ChatGPT about legal questions — route legal queries to ChatGPT by default."


LATTICE PERSISTENCE ACROSS SESSIONS

ChatGPT has no persistent memory across API calls (unless using the Assistants API with threads). The Bridge solves this by including the LATTICE preamble in every system prompt. ChatGPT "knows" LATTICE fresh every time because the Bridge tells it every time.

This costs ~500 tokens per call but ensures consistent LATTICE fluency.

When OpenAI releases persistent memory features for the API, the Bridge can switch to teaching LATTICE once and relying on OpenAI's memory. Until then: preamble injection works reliably.


INTEGRATION WITH RING

When the user sends a message in the Ring, the Bridge decides which docked AI should respond based on:

ChatGPT's response appears in the Ring tagged with the ChatGPT icon. Other docked AIs can see the response and respond to it — this is cross-AI collaboration through the Ring.


SECURITY

API key never leaves the user's machine. Bridge never proxies API calls through 42sisters.ai servers. The connection is direct: user's Bridge → OpenAI API. 42sisters.ai cannot see the user's queries, responses, or API usage. We literally cannot spy on them because we're not in the data path.

If the user's API key is compromised: that's between the user and OpenAI. The Bridge can detect unusual error patterns (sudden 401s) and suggest: "Your API key may be compromised. Rotate it at platform.openai.com."


INVARIANTS

INV-01: API key stored locally, encrypted. Never transmitted to 42sisters.ai.

INV-02: History import processed locally by LEARNX. Never uploaded.

INV-03: LATTICE onboarding uses the user's tokens (~2000-3000). Transparent about cost.

INV-04: Bridge is not a proxy. Direct connection: user → OpenAI. We're not in the middle.

INV-05: Cost per query displayed transparently. No hidden token spending.

INV-06: Rate limit throttling is graceful, not an error. Multi-AI dock means other AIs cover.

INV-07: System prompt LATTICE preamble is ~500 tokens. Included in every call. Non-negotiable for LATTICE consistency.

INV-08: The dock protocol works with any OpenAI model the user's key has access to. Not limited to specific models.


INTEGRATION

| System | Relationship |

|---|---|

| SPEC_OBI_OS_VISION.md | Dock Protocol is the technical implementation of the Dock carousel described in the vision. |

| SPEC_PRIVACY_POLICY.md | INV-01 and INV-02 directly fulfill privacy policy Tier 3 ("we never collect"). INV-04 means we can't collect even if we wanted to. |

| SPEC_LATTICE_VIRAL.md | LATTICE onboarding (Step 3) is the moment the viral hook lands. The user watches their ChatGPT learn LATTICE. That's the demo that converts. |

| SPEC_HANDSHAKEX.md | Dock confirmation (Step 5) is a dock-type handshake. The LATTICE certification level is the handshake payload. |

| SPEC_INSTALLATION_HANDSHAKE.md | Docking flow IS the installation for a new AI. Step 1-5 is the handshake sequence. |


Jeremy Zlabis

Chronogeometer · Visionary · Disruptor · Chief

42 Sisters AI · East York, Toronto

🍁 Φ 0.042