Orchestrata Ultimate › Plans › kimi-delegation-plan

Kimi delegation plan — SPEC-018 Fireflies backend completion slice

Source: plans/kimi-delegation-plan.md at 8a2cb42ad · last changed 2026-07-27 · first committed 2026-07-12 · 155 lines.

Prose pending.

Plan text

Kimi delegation plan — SPEC-018 Fireflies backend completion slice

Delegation brief for the IRC fleet agent kimi (Moonshot, localhost:6667 #agents). Kimi reads THIS FILE from its worktree — it is self-contained: everything needed to produce compliant work is in here. Kimi WRITES FILES ONLY; review, gates, tests, and commits happen from the main checkout (worktrees have no .venv). Author of record for all commits is Mohamed.

0. Logistics (fixed — do not improvise)

1. Context — what this slice is

Repo: orchestrata-ultimate (single package, Python 3.14 free-threaded). SPEC-018 (Fireflies meeting intelligence) has a working backend core: a real GraphQL client (src/orchestrata_ultimate/integrations/fireflies_client.py), a KG sync engine (src/orchestrata_ultimate/integrations/fireflies_sync.py), and 4 gateway RPCs (src/orchestrata_ultimate/gateway/handlers/fireflies.py: fireflies.transcripts/.transcript/.search/.summary, registered in src/orchestrata_ultimate/gateway/rpc.py ~line 387). The 2026-07-12 audit (plans/spec-implementation-gaps.md §3, SPEC-018) found the missing pieces this slice closes: no test_connection, no fireflies.health RPC, no fireflies.sync RPC, and sync_recent() has zero production callers.

Spec oracle: specs/018-fireflies-integration/spec.md + its checklists/requirements.md. When this plan and the spec disagree, the spec wins — say so on IRC instead of silently following either.

2. Work packages (do in order; announce each separately)

WP1 — FirefliesClient.test_connection() + fireflies.health RPC

  1. integrations/fireflies_client.py: add async def test_connection(self) -> dict[str, Any] — cheapest possible GraphQL probe (the user { user_id email } query, same _request plumbing as the other methods). Returns {"ok": True, "user": {...}} on success; on ANY failure returns {"ok": False, "error": "<message>"} — never raises (mirror how the sibling methods degrade; read get_transcript's error shape first).
  2. gateway/handlers/fireflies.py: add async def handle_health(self, connection_id, params) calling test_connection(), response shape consistent with the 4 existing handlers.
  3. gateway/rpc.py: register "fireflies.health": fireflies.handle_health in the method registry next to the existing fireflies rows.

WP2 — fireflies.sync RPC (first production caller of sync_recent)

  1. gateway/handlers/fireflies.py: async def handle_sync(self, connection_id, params) — constructs/uses FirefliesSync (integrations/fireflies_sync.py:65 sync_recent(limit)), limit from params (default 20, validate int 1..100, reject otherwise with an error response, not an exception). Returns sync_recent's result dict.
  2. Register "fireflies.sync" in rpc.py.
  3. Read sync_recent first: whatever infra it needs (Neo4j) must be handled the way the handler's siblings handle unavailable infra — degrade with an error payload, never crash the RPC dispatcher.

WP3 — fireflies_test_connection MCP tool

session/fireflies_tools.py (FirefliesMCPTools): add a fireflies_test_connection tool method delegating to WP1's test_connection(), following the file's existing tool-method pattern exactly (naming, schema, return shape, docstring style).

Every WP also ships tests — see §4.

3. Code standards (gate-enforced; violations = FAIL)

4. Test standards (the hard rules of this repo)

5. Documentation requirements

6. Definition of done (per package)

  1. Files written in the worktree, on-brief, spec-consistent.
  2. Tests written per §4 covering happy + error paths (aim ≥90% coverage of the lines you add).
  3. claude: WP<N> ready — files: <paths> — reqs: <REQ ids> announced.
  4. Claude's gate run comes back PASS. FAIL responses include exact output; fix in the worktree and re-announce.
  5. Claude commits from the main checkout (Mohamed authorship, no AI attribution — never add Co-Authored-By of any kind).

7. Questions protocol

Ask early, ask specific (claude: WP2 — should sync limit >100 clamp or error? — the answer here is: error, per §2). Unanswered design forks = STOP on that package and move to the next; never guess policy.