Repository navigation
feat(console): live governed Query adapter and reader exchange - #396
Conversation
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://surface-console-live-207.spec.contextful.work (commit 1e204b3)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
715a6f5 to
1e204b3
Compare
There was a problem hiding this comment.
AI code review — 🛑 Request changes
Risk tier: full · 1 critical · 1 warnings · 0 suggestions
Reviewers: security
1. 🛑 Critical — Console startup now hard-fails when model configuration is absent
📍 apps/console/src/entry.ts:85-88
The default console path eagerly calls 'createLiveTurn', which throws 'ConsoleModelUnconfigured' when 'CONTEXTFUL_MODEL_ENDPOINT' or 'CONTEXTFUL_MODEL_ID' is unset. This changes the previous behavior of starting with unavailable adapters into a process startup failure, so existing deployments that do not configure the new model service will fail to release or boot at all. Defer this validation until a query is made, or preserve the unavailable-adapter fallback when the model is not configured.
2. ⚠️ Warning — Live queries forward every column to the model
The live path uses 'SELECT *' and subsequently sends the complete returned rows to the configured model endpoint. This violates data-minimization expectations because governed tables may contain sensitive columns unrelated to the question. Select only approved/needed columns (or redact policy-disallowed fields) before including rows in the model request.
Summary
context.describeandcontext.querytools, with question-directed selection of one admitted data table and a typed refusal when selection is unclear./auth/exchangefromcontextful serve; an unconfigured exchange returnsExchangeUnconfigured404 before waiting for a body.Verification
cargo test --locked --workspacepnpm testinapps/console(50 passed),pnpm typecheck,pnpm buildcargo run --locked -q -p contextful-spec -- lintcargo run --locked -q -p contextful-ci -- gate --stage test-first --base 3b0edf01Stacked on
surface/console-hosted-383. Includes the #207 turn policy core fromsurface/console-turn-207.