Files
podman/database
Kartikeya da5b2622b2 Integrate canonical architecture: two-process backend + LiveKit agent
Promote all 12 staged canonical files from docs/generated/files/ to their
live paths, creating the full PodMan architecture:

Backend:
- server.ts: HTTP service (token mint, sync-PR, outcome recording, /health, WS relay)
- agent.ts: worker joining LiveKit room, grabbing screenshare frames at ~1fps
- agent/podman.ts: orchestrator loop (vision -> collision detection -> intervention)
- env.ts: flat env var accessors replacing nested stub
- vision/gemini.ts: JPEG -> Gemini vision -> EngineerContext (real implementation)
- collision/detector.ts: fused vision+GitHub collision detection (the moat)
- github/client.ts: Octokit wrapper with caching + sync PR creation
- memory/store.ts: extended with recordObservation/recordCollision/recordIntervention/recordOutcome helpers
- memory/vectors.ts: stub for Voyage+Atlas vector recall (Loop A)
- memory/policy.ts: stub for intervention policy gate (Loop B)
- voice/live.ts: stub for Gemini Live TTS voice output

Shared:
- messages.ts: LiveKit data-channel wire protocol (DataMessage, InterventionOutcome, TeamModel, LocalGitReport)
- index.ts: re-exports messages module

Frontend:
- livekit/useScreenPublish.ts: hook for joining pod and publishing screenshare
- livekit/useInterventions.ts: hook for receiving collision cards and responding
- lib/api.ts: fetchToken + postOutcome HTTP helpers

Database:
- database/init.ts: MongoDB Atlas collections + indexes + vector search index

Infra:
- infra/.do/app.yaml: DO App Platform spec (static_site + service + worker)

Retire stubs superseded by canonical decomposition:
- backend/src/index.ts (replaced by server.ts)
- backend/src/intervention/engine.ts (logic now in agent/podman.ts)
- backend/src/livekit/token.ts (token minting now in server.ts)

Install missing dependencies: @livekit/rtc-node, sharp, mongodb, ws, @types/ws

Type error fixes:
- vision/gemini.ts: use MediaResolution.MEDIA_RESOLUTION_LOW enum value (not string literal)
- agent/podman.ts: wrap SuggestedActionKind into { kind: action } SuggestedAction object

All packages pass pnpm -r typecheck and pnpm -r build.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 14:27:14 -07:00
..

database

Continual-learning memory for PodMan: MongoDB Atlas for the team model and outcomes, Voyage embeddings for vector recall. This is what makes PodMan "more useful the more you use it" (the track requirement).

Collections

Collection Holds Notes
pods Pod docs (members, repo) one per pod
observations EngineerContext snapshots over time sampled, append-only
collisions detected Collisions for replay + precision tuning
interventions Interventions + outcome (accepted/dismissed) drives the self-tuning policy
memory_vectors Voyage embeddings of file/feature notes Atlas Vector Search index

Types live in shared/. Each engineer/file/feature note is embedded with Voyage and stored alongside its source doc for retrieval by the PodMan brain.

The continual-learning loop

  1. Observe → write observations.
  2. Store → embed notes into memory_vectors.
  3. Predict → collision detector + brain decide whether to intervene.
  4. Outcome → update the interventions doc with accepted/dismissed.
  5. Adapt → tune thresholds + ownership attribution from outcomes.

Setup

Create an Atlas cluster + a Vector Search index on memory_vectors.embedding, then set MONGODB_URI and VOYAGE_API_KEY in .env.