mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 21:41:09 +02:00
Plugs plaintext-safe Mission context into the Planner prompt per tick. Before this, `resolvedInputs: []` was always passed — the LLM only saw the mission's concept + objective. Now goals (the only plaintext category of linked inputs today) resolve and land in the prompt. Privacy constraint is explicit and documented: tables in the webapp's encryption registry (notes, kontext, journal, dreams, …) arrive at `sync_changes.data` as ciphertext — the master key lives in mana-auth KEK-wrapped and never reaches this service. Resolvers for encrypted modules therefore don't exist server-side; missions referencing them should use the foreground runner which decrypts client-side. - `db/resolvers/types.ts` — ServerInputResolver contract - `db/resolvers/record-replay.ts` — single-record LWW replay (tighter WHERE than `missions-projection.ts`, used by all resolvers) - `db/resolvers/goals.ts` — reads `companionGoals` via replayRecord, mirrors the webapp's default goalsResolver output shape - `db/resolvers/index.ts` — registry with `registerServerResolver` / `unregisterServerResolver` / `resolveServerInputs`. Seeds `goals`. Drift-tolerant: missions pointing at unregistered modules silently skip those inputs. - `cron/tick.ts` — wires `resolveServerInputs(sql, m.inputs, m.userId)` into the planner input; updates the outdated "stubbed" comment 5 Bun tests over the registry (handled + unhandled + thrown + mixed cases + seeded default). Future: expand to plaintext tables if/when more land (habits without free-text, dashboard configs, tags), or introduce a decrypt-via-auth sidecar if users opt into server-side access to encrypted content. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| CLAUDE.md | ||
| Dockerfile | ||
| package.json | ||
| tsconfig.json | ||