Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ An in-perimeter **AI inference governance and FinOps control plane** for regulat

Research artifact: can inference governance be an architecturally separable control layer — enforceably, evidentially, and at acceptable cost?

**Start here:** [Console usage guide](docs/console-quickstart.md) · [Tavily setup](docs/web-search.md)

## At a glance

![Covenant overview](docs/diagrams/covenant-overview.svg)
Expand All @@ -21,7 +23,7 @@ Editable sources: [`docs/diagrams/*.drawio`](docs/diagrams/) (open in [diagrams.
1. **Fail-closed.** No policy match → deny. Unclassified defaults to the most restrictive class. Misconfiguration → the appliance refuses to start. PII/PHI never reaches a public provider because no public route exists for those classifications.
2. **Governance is the pipeline, not a bolt-on.** Every capability — classification, policy, budgets, attribution, audit — is an ordered stage in one middleware chain. Nothing bypasses it.
3. **Everything is evidence.** Each request, allowed or denied, appends exactly one hash-chained audit entry. Altering any past entry breaks every hash after it.
4. **The perimeter is sacred.** Deployed inside the customer boundary; egress only to the approved model allow-list; no phone-home.
4. **The perimeter is sacred.** Deployed inside the customer boundary; egress only to approved model endpoints and explicitly enabled Public web search (ADR-0015); no phone-home.

## Where the detail lives

Expand Down
55 changes: 55 additions & 0 deletions docs/CONSOLE-DEMO-CLARITY-TASKS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Console usability and real hybrid demonstration — implementation brief

Owner: Claude implements heavy changes; Codex builds, exercises actual models, configures the user's selected instance on port 5210, and visually verifies. Current base 353faac (PR8 on PR7); branch feat/console-demo-clarity. Preserve prior fixes. Do not merge or touch running servers, secrets, or Ollama. No subagents. Work directly in this checkout. Do not commit until Codex confirms a checkpoint. Read CLAUDE.md scope instructions.

## Outcome
A conference attendee must understand who requested work, why it went to a given model, who pays, and what was enforced, without reading implementation notes. Real providers only in the live demo. No fake durations, invented health or inferred model competence. User chose Anthropic for Public cloud work and port 5210 as the handoff target.

## Must implement
1. Shell and responsive layout: remove misleading seed/profile name demo-local-only from primary header (environment is deployment identity, not routing mode). Show active mode and meaningful environment, with details available. Header and body share horizontal gutters/width; remove arbitrary max-width dead space. Programmatically focusing a page title must not produce the huge blue box shown on navigation, while keyboard navigation retains accessible focus. Standardize icon-button dimensions/baselines. Fix Settings form field alignment by proper rows/grid, not blanket label heights that fail on multiline help text. Verify light/dark at 1280x720, 1920x1080, and wide desktop. No content clipping to make a viewport test pass.
2. Applications: explain in plain language that an application is the calling system with an owning team, budget and allowed workloads; console runs on its behalf. Show friendly name/team, not only demo-app. Make add/manage application discoverable from composer. Single application should be identified as the only configured choice with a management link, not a misleading unexplained dropdown. Existing profile/application editor should permit creation, grants, team and console testing with validation. Do not bypass authorization. If adding display-name schema fields use backward-compatible defaults and round-trip tests.
3. Workloads and demo examples: replace cryptic A/B/C presets with named, meaningful examples including (a) public research with web sources, (b) public writing through Anthropic, (c) internal coding through qwen2.5-coder:7b, (d) internal research through stronger local Qwen, (e) synthetic sensitive-data refusal for a cloud-only route, (f) cache hit repeat, and (g) budget refusal. Each card explains expected route, payer/team, and observation; fill all relevant fields coherently (application, profile, workflow/use-case, search, prompt). Do not run automatically. Resolve available configuration, show exact missing prerequisites and a link when unavailable, never silently downgrade. Avoid claiming cache behavior if cache is disabled. Do not replace existing operator config with seeds automatically. Supply an explicit preview/apply demo setup action or documented versioned setup, retaining prior entries.
4. Task routing is policy-driven: current installed IDs on localhost11434 are qwen2.5-coder:7b, qwen3.8:27b-mlx, qwen38-64k:latest. Codex will configure selected real routes. Use granted workload/profile selectors for coding/research; do not pretend keyword routing/quality scoring exists. Public writing -> approved Anthropic model, internal coding -> coder7b, internal research -> qwen3.8:27b-mlx. Ensure matching is unambiguous (classification + profile), with no broad earlier rule shadowing explicit workload rules. Detect/report ambiguous rules if required; no unreviewed cloud fallback for Internal/sensitive. Expose chosen policy, eligible target/fallback and why, before/after run. Preserve user prompt.
5. Search usability: composer readiness tied to current server config/app/profile. Off/Auto/Required must not offer a seemingly working setup when impossible. Give ONE specific actionable cause (disabled -> Settings anchor; no credential -> exact server setup; profile denied -> switch allowed profile only by explicit user action; Local-only -> policy mode). Display the specific runtime reason instead of generic laundry list. Don't auto-upgrade classification or silently turn off Required. Refresh on config apply/reconnect/navigation, preventing stale UI drafts overwriting search settings. Deep links target relevant settings section. Distinguish setup problem, missing city, policy refusal, provider failure. Runtime remains authoritative and fail-closed.
6. Explain trace honestly: millisecond rounding currently produces 0 ms. Use <1 ms for positive sub-ms values; unknown stays unknown, actual zero must not be fabricated. Distinguish identity/cost-owner assignment BEFORE provider invocation from final usage accounting/settlement AFTER execution. Refused requests still have app/team/workload and audit evidence, even if no charge. Rename existing Attribution stage to descriptive 'Record usage' or 'Finalize cost' if it only records post-provider usage. Ensure failure/search charges are finalized through outer audit/settlement as actual backend does. Never show 'attribution skipped' implying anonymous/unaccounted refusals. Include app, team, workload, policy, config version and cost basis in results and requests. Show cache outcome (miss/bypass/hit), not a bare Passed.
7. Animation: meaningful live running stage pulse and transitions from real trace events, reduced-motion support. For instantly completed stages, explicit 'Replay trace' / presentation replay with adjustable pedagogical pacing, clearly labelled replay; keep real recorded durations and final outcome, no synthetic timer delays in actual request execution. Replay never invokes provider, changes records or reruns requests. Cancellation/new run/navigation must cancel old replay and not mix traces. Animation is required, not just CSS on an unseen transient state.
8. Cloud/model setup: existing provider editing must clearly support Anthropic with server credential availability, exact configured models/prices, connection test, and applying a Public route. Add stronger local model from catalog without replacing coder model. No fake health from catalog availability. No invented pricing; unavailable key/price blocks execution with concrete instructions.
9. Demo guide: concise walkthrough that teaches app -> workload/classification -> route -> evidence/cost. Show local coding, stronger local research, real Anthropic Public writing, Tavily search, and one predictable refusal plus its resolution. Distinguish configured capability from tested behavior.

## Checkpoints and verification
First inspect code and implement a coherent UI/configuration checkpoint, then report files and any architectural questions. Continue remaining scope unless Codex asks to pause. Write focused tests for readiness reasons, form/config round-trip, workload routing, preset prerequisites and attribution on refusal/failed search/cache, trace duration/replay logic. No new dependencies unless necessary. Do not claim runs; Codex runs .NET and browser. Do not weaken assertions to pass. If you cannot run tool calls, continue code and report precise blockers.

Acceptance: One actual 5210 instance after deliberate restart; matching build/config version visible. Real Anthropic call requires user credential (Codex handles privately). All screenshot defects rechecked visually, not just zero horizontal overflow. No generic product-readiness claim from unit test count alone.

## Verification discoveries (Codex)
- Port 5210 is currently not listening; persisted state exists at /tmp/covenant-v2-demo-local-only (active config v2). Codex will relaunch THIS state after final publish, not hand off a different port.
- Actual qwen3.8:27b-mlx responds, but consumes output budget on reasoning first: max_tokens=180 left a truncated visible answer. Research example needs a practical limit (e.g. 1024–2048), clear finish_reason=length handling, and no invented claim that the token limit covers only visible text. Do not expose internal reasoning as explanation/evidence. Codex tests full larger-model pipeline.


## Executed checkpoint review (Codex, while native Claude window locked)
Release snapshot built with 0 warnings/errors. Full suite: 914 pass, one failure in AddApplication roundtrip: applications[3].max_output_tokens must be >=1. Codex fixed AddApplication to explicitly set MaxOutputTokens=1024, matching Host default. Preserve this fix. Evidence_names_the_policy test passed.
Remaining review: WorkspaceConfig concurrently fetches config and search status; mismatched versions must not retain stale Ready indefinitely. Error status must not present old Ready. Refresh budget facts after completed requests as well. Runtime5210 is v4 with engineering-assistant/internal-coding -> coder7b and research-assistant/internal-research -> Qwen27B, actual requests passed with correct team/workflow tags. public-research route/profile and communications-assistant/public-writing also registered; actual Anthropic credential still pending. Preserve runtime entries.

## Browser review of checkpoint (17:21 UTC)

- BLOCKER: Examples defaults open and renders seven full documentation cards inside the narrow composer. At 1280×720 the first card alone fills the visible request pane; the prompt is buried several screens down. Replace with a compact example selector/list of titles + readiness; expand ONLY the selected example's explanation, preferably a short summary with optional details. Choosing an example should bring the populated prompt into view. Default composer must show its prompt immediately. Keep Run visible. This is the exact excessive scrolling complaint we must solve, not add to.
- Application/profile values truncate at 1280×720 (communications-ass... / Public writing baseline...). Use friendly display names and put baseline/team in the helper text instead of stuffing the select. Ensure selected value remains understandable.
- Missing whitespace before Profile permissions link in search readiness note.
- docs/demo-guide.md section2 says same application/team as coding, but actual configured apps are engineering-assistant/team engineering and research-assistant/team research. Derive words from the selected example or explain these different owners accurately.
- Settings inputs are horizontally aligned in the tested checkpoint at 1920 and 1280. Preserve that fix.
- Codex has already fixed ProfileEditing.AddApplication MaxOutputTokens=1024; checkpoint full suite passes915. Evidence_names_the_policy passed. Pending latest changes need another build.
- WorkspaceConfig.LoadAllAsync currently preserves stale WebSearch on error and can combine configuration vN with readiness vN-1. Clear readiness on failure/version mismatch; composer must not show stale Ready. Refresh budget states after requests. Guard disconnect/reconnect against completion of an old session's load.

### Real Tavily run on 5210/v4
The UI public-research example completed: 3 retrieved sources, 10.30s, 1156 input/299 output tokens, $0.008 tool charge, team research. But the .NET release query returned two irrelevant sources and a weak third-party release page; the answer asserted dubious release/support facts. Search integration works; answer quality is NOT validated. Improve the demonstration query to a bounded authoritative-source task (e.g. site:learn.microsoft.com or official dotnet release notes), and make clear sources are retrieved rather than independently verified. Don't present this particular run as proof of accurate current knowledge. Current overall Cost says 'estimated provider charge' although the only charge is Tavily; ensure summary distinguishes tool cost from inference cost.

### Executed checkpoint3 validation fix
The new Routing_a_workload_is_additive_unambiguous_and_passes_host_validation test failed: new PolicyDto serialized retry:null, overriding the Host default and failing required-value validation. Codex added explicit RetrySettingsDto (1 attempt,120000ms,empty retry list) in WorkloadRouteSetup. All21 DemoTraceAndSetupTests pass with this correction in the isolated build. Preserve the fix. Full updated suite still requires rerun.

## Runtime acceptance, October17, configuration v5/v6
- Anthropic Models API accepted saved key; Claude Sonnet5.5 was listed. Public writing real request req_764cfb82ecd849b3a8a8456f4de48634:39input/101output, $0.001088, communications-assistant/team communications. Prices2/10USD per million from official model overview. Secret remains outside Git.
- Sensitive explicit cloud pin req_5c0ac36b25b7466b8f5258e12f147849:403 at policy, no attempts, no charge, owner retained. Synthetic invalid marker only.
- Exact-cache pair req_e635a1a90ad04c16b699300cfc69cf04 / req_c8743ab02eff4089b0708429dcb468a1:first1providerattempt,$0.000462; second0attempts,$0,owner retained.
- Isolated budget-demo app under v6,cap$0.0001: req_5b5c1d82dac6477a84ea22c211e0cfff refused atbudget with0attempts,$0,team demo-controls retained. Normal application caps unchanged.
- Browser request drawer verified real Anthropic model, input/output usage, reserved/settled costs and policy. Trace replay visibly advances recorded steps under Replay banner.
- Checkpoint4 suite:942passing. Default-application follow-up still under implementation; final build/visual review pending.
Loading
Loading