Skip to content

Serve governed console workflows and verify protocol traces - #399

Merged
debuggingfuture merged 1 commit into
mainfrom
surface/console-combined-389
Oct 8, 2026
Merged

debuggingfuture merged 1 commit into
mainfrom
surface/console-combined-389

Conversation

@debuggingfuture

@debuggingfuture debuggingfuture commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Query operators ask cited questions, inspect bounded snapshot previews and retain learning within their credential's scope. Admin operators inspect workflows and audit records, save versioned drafts and apply them with signed attribution. Separate page grants govern reads and changes.

Behavior and assurance

  • Store ownership binds a project to a persisted store UUID. MCP discovery rejects foreign manifests; spawned clients share owner admission and refuse silent fallback after authorization refusal.
  • Hosted Cognito assertions exchange for engine credentials before answers, briefs, browsing and scoped memory. Origin checks precede protected routes. Query redacts credentials and denylisted strings of every length from prose, source labels, URLs and server-built views.
  • Draft apply compares version, nonce and verified operator under the pointer lock. Mutation commits recheck expiry, revocation and signature freshness under their locks. Refusal preserves the draft and applied head; signed attestations reject replay across listener restarts.
  • Synced claims preserve issuer-signed receipts; signing refusal claims no version. Console and registered engines share one control attestation secret and Admin trust domain. Independent domains use separate deployments and credentials; secrets remain server-side.
  • Control routes require the data plane; contextful-edge retains HTTP health and MCP credential admission.
  • Read cancellation reasserts the connection interrupt across DuckDB preparation after the absolute deadline until completion. The watcher joins before connection reuse; duration refusals and timing guards remain in force.
  • Lean differential traces compare engine transitions and retain replay cases. Evaluate and selected formal feature runs require pinned Lean and Wasm provisioning. Binary-only and empty feature selections retain their narrow toolchain cost. CI dispatches static parts plus one test-first part per changed package and inherits pooled Cargo targets.
  • Console dependency policy permits only the pinned esbuild 0.25.12 install script; unreviewed scripts remain refused. HTTP fixtures accept one bounded Content-Length frame. CI Git fixtures persist local identity and signing settings.

Boundary questions

  • Does the engine already do this? Yes: read admission, owner binding, memory scope and signed claims remain engine operations.
  • Does a surface re-implement policy from the registered view? No.
  • Does a second state model mirror the engine? Yes: the formal model and differential harness compare engine transitions.
  • Could an engine change silently disagree? No: built-binary acceptance and differential tests exercise admitted operations.

Validation

Local evidence on the head rebased onto main:

  • contextful-spec lint: 0 findings after state and extract.
  • cargo test --locked -p contextful-agent -p contextful-cli -p contextful-context -p contextful-core -p contextful-engine -p contextful-ci --all-features: agent 37, CLI 343, context 322 (4 ignored), core 464, engine 118, CI 183 passing.
  • cargo test --locked -p contextful-acceptance: 22 passing, 2 ignored.
  • apps/console: pnpm typecheck clean; pnpm test 96/96.
  • contextful-ci gate --stage test-first --base origin/main: passed in 180.4 s.

Control routes admit only an untenanted Admin grant over * (surface.apply.served-admin-grant); a tenant-scoped Admin grant answers ControlAdminGrantMissing. ControlRequestMalformed and ControlUnavailable own surface.apply.served-malformed and surface.apply.served-unavailable.

Closes #31
Closes #387
Closes #383
Closes #386

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://surface-console-combined-389.spec.contextful.work (commit dcc7979)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://f1e2b6f0.spec.contextful.work dcc7979 2026-10-08T18:39:42.969Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://2e81ec75.spec.contextful.work c9f9039 2026-10-06T17:51:53.904Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://34fecc0f.spec.contextful.work c21c816 2026-10-06T16:27:23.975Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://32e07aa8.spec.contextful.work f331c51 2026-10-06T11:19:28.816Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://c4358df5.spec.contextful.work a78ad9e 2026-10-06T10:52:16.145Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://86e4612b.spec.contextful.work 67d963a 2026-10-06T10:40:00.967Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://93104e24.spec.contextful.work 9596d97 2026-10-06T10:06:47.711Z Visit the dashboard ↗

@debuggingfuture debuggingfuture changed the title console: integrate live Query and Admin draft control console: govern live Query and attested Admin control Oct 6, 2026
@debuggingfuture
debuggingfuture changed the base branch from surface/console-hosted-383 to surface/console-answer-208 October 6, 2026 11:19
@debuggingfuture debuggingfuture changed the title console: govern live Query and attested Admin control Serve governed console workflows and verify protocol traces Oct 6, 2026
@debuggingfuture
debuggingfuture changed the base branch from surface/console-answer-208 to main October 6, 2026 18:17
@debuggingfuture
debuggingfuture marked this pull request as ready for review October 6, 2026 18:20
@debuggingfuture
debuggingfuture marked this pull request as draft October 6, 2026 18:20

@flaredispatch-fractalboxdev flaredispatch-fractalboxdev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI code review — 💬 Comment

Risk tier: full · 0 critical · 3 warnings · 0 suggestions

Reviewers: security 0 · performance 3 · code-quality ⚠️ · documentation ⚠️ · release-management ⚠️ · compliance 1 · agents-md ⚠️

1. ⚠️ Warning — Memory recall performs serial remote calls per subject

📍 apps/console/src/answer_live.ts:111-124

Each turn first fetches up to 100 subjects, then performs one 'memory.recall' request per selected subject in a sequential loop. Even with the current cap of three subjects, this adds multiple round trips to every answer and makes latency scale with subject discovery. Batch the recall query if supported, or issue the bounded recalls concurrently with 'Promise.all' and an explicit concurrency limit.

2. ⚠️ Warning — Browse discovery fans out up to 64 describe requests

📍 apps/console/src/browse.ts:68-76

'discover' calls 'listed', which already performs two remote calls, then starts one additional 'context.describe' call per admitted table via 'Promise.all'. A listing with 64 tables therefore produces up to 66 requests in a single user operation and an unbounded burst against the backend. Reuse descriptions from the listing or batch/cache them, and cap concurrency if per-table calls are unavoidable.

3. ⚠️ Warning — Sensitive question and answer are sent unredacted to the model endpoint

📍 apps/console/src/answer_live.ts:65-70

The distillation request forwards the raw question and answer to 'CONTEXTFUL_MODEL_ENDPOINT' before applying the configured denylist. Answers can contain operator/store data, so this creates an external disclosure path that bypasses the console's redaction controls. Redact or otherwise policy-filter both fields before transmission, or ensure this endpoint is an explicitly approved data processor with the required controls.

📋 View full logs & reviewed diff ↗

@debuggingfuture
debuggingfuture marked this pull request as ready for review October 6, 2026 18:59
@debuggingfuture
debuggingfuture marked this pull request as draft October 6, 2026 19:09
@debuggingfuture
debuggingfuture added this pull request to stack #425 October 8, 2026 14:21
@debuggingfuture
debuggingfuture removed this pull request from stack #425 October 8, 2026 15:41
@debuggingfuture
debuggingfuture changed the base branch from main to surface/console-browse-384 October 8, 2026 15:41
@debuggingfuture
debuggingfuture added this pull request to stack #427 October 8, 2026 15:41
@debuggingfuture
debuggingfuture marked this pull request as ready for review October 8, 2026 15:41

@flaredispatch-fractalboxdev flaredispatch-fractalboxdev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI code review — 🛑 Request changes

Risk tier: full · 1 critical · 2 warnings · 1 suggestions

Reviewers: security ⚠️ · performance 2 · code-quality ⚠️ · documentation ⚠️ · release-management 1 · compliance 1 · agents-md ⚠️

1. ⚠️ Warning — Learning writes block the answer response

📍 apps/console/src/answer_live.ts:126-151

After the live answer is generated, 'learnAfterAnswer' awaits a model distillation request and up to three sequential memory writes before 'turn' returns. This adds multiple network round trips directly to every evidence-bearing query's latency; schedule learning asynchronously or otherwise decouple it from the response path.

2. 💡 Suggestion — Memory recall performs multiple serial remote calls per turn

📍 apps/console/src/answer_live.ts:83-110

Each turn with a session performs 'context.describe', a subject discovery query, and then up to three sequential 'memory.recall' calls. These calls are repeated for every question and the recall loop is not parallelized; batch the recall or issue independent subject recalls concurrently to avoid avoidable latency.

3. 🛑 Critical — Dynamic test-first package checks are not required by the proposed ruleset

📍 .github/rulesets/contextful-gate.proposed.json:21

The ruleset requires only 'flare-dispatch/check:test-first.validate', while the adjacent release-gate documentation says test-first also emits one 'flare-dispatch/check:test-first.package' check per changed package. Those package-specific checks are absent from the required-status list, so a pull request can satisfy the ruleset without running or passing the package test-first checks. Add a mechanism to require the dynamic contexts or change the gate so the required static check represents their result.

4. ⚠️ Warning — Distillation sends unredacted conversation data to the model endpoint

📍 apps/console/src/answer_live.ts:65-72

The distillation request forwards the raw question and full answer to CONTEXTFUL_MODEL_ENDPOINT before applying the configured denylist. This can transmit sensitive identifiers or policy-protected content to an external model and creates an additional copy outside the console's redaction boundary. Redact both fields before this request, or use an explicitly approved privacy-preserving distillation path.

📋 View full logs & reviewed diff ↗

@debuggingfuture
debuggingfuture marked this pull request as draft October 8, 2026 15:45
Base automatically changed from surface/console-browse-384 to main October 8, 2026 17:37
Admin edit saves a validated, version-bound store draft; apply rechecks the
owner and claims that draft under an operator attestation whose nonce persists
across restarts. Control routes admit only an untenanted Admin grant over `*`
and answer `ControlAdminGrantMissing`, `ControlRequestMalformed` and
`ControlUnavailable` under their own clauses. Read cancellation reasserts the
interrupt past the deadline, and evaluate and formal feature runs provision
pinned Lean and Wasm.
@debuggingfuture
debuggingfuture force-pushed the surface/console-combined-389 branch from 6d8a772 to dcc7979 Compare October 8, 2026 18:39
@debuggingfuture
debuggingfuture marked this pull request as ready for review October 8, 2026 18:39
@debuggingfuture
debuggingfuture merged commit ec7a0fb into main Oct 8, 2026
4 of 6 checks passed

@flaredispatch-fractalboxdev flaredispatch-fractalboxdev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI code review — 💬 Comment

Risk tier: full · 0 critical · 2 warnings · 1 suggestions

Reviewers: security 1 · performance 2 · code-quality ⚠️ · documentation ⚠️ · release-management ⚠️ · compliance ⚠️ · agents-md 0

1. ⚠️ Warning — Admin store listing may disclose backend configuration

📍 apps/console/src/index.ts:348

The '/admin/api/stores' endpoint serializes 'adapters.stores' directly. In the hosted setup this is populated from 'registry.entries', which also supplies backend control endpoints and may contain connection/authuration fields. Return only an explicit public '{id,label}' projection; otherwise any authenticated admin can receive internal store URLs and any sensitive configuration retained on the registry entries.

2. ⚠️ Warning — Install and build the console during every integration test run

📍 crates/acceptance/tests/integration/m12.rs:85-89

The test now runs 'pnpm install --frozen-lockfile' and 'pnpm build' for each invocation of 'm12_console'. This adds substantial dependency installation and compilation overhead (and network/filesystem contention) to the acceptance suite. Build the console once in test setup/CI and reuse the artifact, or make this an explicit packaging test.

3. 💡 Suggestion — Control requests load revocation state twice

📍 crates/contextful-agent/src/http.rs:404-418

'control_request' calls 'admitted', which already loads the revocation state and constructs the admission, then loads revocation again inside its callback before invoking the handler. This doubles revocation-store work for every control request. Reuse the 'Admission' passed to the callback for the admin-grant boundary check, or otherwise pass the already-loaded state through.

📋 View full logs & reviewed diff ↗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant