Lore / Engineering evidence5 September 2026

F01–F14 / Implementation & verification

Answers with
evidence attached.

The Insights fixes cover access, calculation, job recovery, displayed values, and earlier results. This report separates passing checks from unverified live behavior.

Verification has limits. Synthetic and isolated checks do not establish production correctness. Read the final-check result and unavailable checks before rollout.
Download the Markdown report
45denied action cases · zero dispatch
0.075 msmetadata read p95 · 200,000 historical rows
293.0 msbrowser ready-to-visible p95 · N=30

Date: 5 September 2026. Review state: implementation and available verification are complete.

Are all issues verified as fixed? No. F01–F14 have fixes and passing synthetic regressions. Live source/provider checks, a single browser-to-database workflow, and screen-reader checks remain unverified. The broader suite also has 21 failures reproduced on the original revision.

The final combined Python gate passed 745 tests. The full suite first returned 27,515 passed, 48 failed, 21 skipped. All 27 failures caused by changed test contracts were repaired and passed the combined gate. The remaining 21 also fail on the base revision. Strict type checks, changed-file lint, browser checks, and all three integrated reviews are complete. No full-suite green result is claimed.

What changes for users

Scope and authority

Base commit: 6ce7648afa0b69d17b765c1bb20a6fe7c3fa061f. Working branch: fix/insights-verified-correctness.

The team used the three requested gpt-6-astra agents with xhigh reasoning. Each agent had explicit file ownership. The lead owned shared contracts and integration. The same three agents challenged the integrated result. They are separate reviewers, but not different model families.

All edits remain uncommitted. No branch was pushed. No PR, issue, merge, or application deployment was created. The pre-existing review files and screenshots remain intact. Only this report is approved for public Pages publication.

Acceptance tests use synthetic rows and temporary SQLite databases. PostgreSQL 16 and Qdrant run in separate disposable localhost containers. Browser tests use the real static UI with intercepted synthetic API responses. External provider and production data paths are excluded.

Findings F01–F14

“Verified” below means the named synthetic regression passed. It does not mean production verification or proof of every possible natural-language question. Source paths in the table are relative to src/institutional_kb/; test paths are relative to the repository.

The calendar failure was disproved as a runtime defect. It was an old SQL expectation, confirmed against independent London date values. Existing leg parallelism was also retained; it was already present. Connection pooling and batching remain optimization hypotheses. No hypothesis was promoted to a production speed claim.

Finding Classification and result Implementation Evidence and limit
F01 Authorization Confirmed. Conversation and actual-source boundaries verified in focused tests. api/routers/bi_query.py::_scope_conversation_for_user, _scope_turn_for_user; services/bi_query_entrypoint.py::authorize_query_request. tests/test_insights_authorization.py: 45 denied owner, vault, and revoked-permission cases across 15 actions. Zero worker/model/enrichment dispatches and no turn hydration. The source role test is isolated PostgreSQL. Production grants are unverified.
F02 SQL source validation Confirmed. Verified on adversarial and equivalent SQL. bi/sql_source_validation.py; bi/sql_validator.py; services/bi_query_execution_service.py final dispatch checks. tests/test_insights_query_correctness.py, tests/test_sql_validator.py, tests/test_insights_query_postgres.py. Qualified sources, CTE scope, comma joins, nested queries, sets, restricted implicit columns, and schema collisions are covered. Explicit empty policies deny physical sources. Syntax-only callers use None.
F03 Merge semantics Confirmed. Verified on independent values and membership. bi/measure_semantics.py; services/bi_federated_merge.py; services/bi_federated_execution_service.py. 100+100=200; 100+101=201; repeated client attribute=5000; authoritative empty stays empty; keyless leg refuses; ratio=4/6. IDs, unknown averages, unsafe distinct aggregates, and rates without denominators do not silently sum.
F04 Displayed values Confirmed. Verified in helpers, browser, and metadata contracts. static/js/bi.js; bi/answer_record.py::column_units; models/bi_conversation.py; API column converters. tests/js/bi-answer-values.test.mjs, tests/e2e/insights-review-fixes.spec.js, tests/test_insights_answer_record.py. Exact totals at 499/500/501/600 rows. GBP 1,200 table/metric/chart/CSV/share parity. Typed 0/1 remain numeric. Incomplete results have partial labels. Unknown currency remains unknown.
F05 Semantic verification Confirmed. Implemented with explicit proof limits. bi/semantic_obligations.py; query service result contract; UI answer record and confidence drawer. Simple mandatory predicates can be satisfied or violated. Complex or unsupported proofs remain unverified. Existing domain and London guards remain. Tests cover equivalent predicates, CTEs, OR, joins, inherited scope, and no raw customer values in obligations. General natural-language intent is not certified.
F06 Jobs and follow-ups Confirmed. Verified in route, repository, worker, and browser tests. repositories/bi_turn_job.py; services/bi_job_control.py; create/append/cancel/status worker paths; UI pending-submit recovery. Twenty simultaneous initial and append retries make one execution and one terminal turn. Changed payload returns 409. Tests cover explicit parent, lost acknowledgement, reload, 181 seconds, cancellation, restart, admission, and late completion. Python cannot preempt arbitrary native code; terminal writes still lose.
F07 Earlier rows Confirmed. Verified with real injected delay. Worker stores checked rows and publishes ready before bounded optional presentation. Follow-up readiness persists in the answer record. Worker readiness: 119.394 ms with a 20-second narrator; full completion: 20,193.104 ms. Browser N=30 p95: 292.978 ms from ready availability to visible rows. Optional failure preserves rows. Required SQL work is synthetic in these readiness fixtures.
F08 Small status reads Confirmed. Measured below the threshold. Conversation metadata getters, summary listing, deltas, and selected-turn route. Metadata p95 0.075 ms on 20 × 10,000 rows. Status body is 385 bytes for both small and large fixtures. Loopback HTTP is measured separately. Worker follow-up history still hydrates its captured context.
F09 Freshness and provenance Confirmed. Metadata regression verified. bi/answer_record.py; _gold_freshness_note; persisted confidence JSON; dashboard/Compose/export records; UI receipt. Query time and source refresh time are separate. Federated sources keep independent watermarks. Missing freshness says unknown. Reload/share says saved snapshot. Export distinguishes snapshot from fresh rerun. Production source watermarks are unverified.
F10 Empty answers Confirmed. Browser verified. static/js/bi.js zero-row renderer and independent SQL drawer. Empty synthetic results keep query inspection and a recovery action at narrow widths. An empty row set does not invent a cause or imply source freshness. Execution errors and incomplete rows have separate states.
F11 Accessibility Confirmed. Browser verified within stated limits. static/js/bi.js, bi-examples.js, narrow layout CSS, generated Tailwind CSS. Hidden panels are inert. Mobile dismissal returns focus. Examples remain visible. Both themes have chart contrast, accessible names, and table alternatives. Keyboard and DOM observations passed. No screen-reader software was run.
F12 Controlled DB work Confirmed admission/deadline defects fixed. Pooling remains a hypothesis. bi/source_admission.py; existing query tracing; SQL driver cancellation; cohort cap+1; job admission. Twenty real PostgreSQL tasks across service instances peak at two open source connections. Driver cancellation stops a five-second query within 1.5 seconds. Connection benchmark N=30 per strategy. LIMIT bounds fetched members, not every scanned row; statement deadlines bound duration. Admission is per process.
F13 Entry-point parity Confirmed. Shared routing, metadata, and actual-source authorization verified in focused tests. services/bi_query_entrypoint.py; dashboard refresh; Compose; direct/cost routes; approved CT replay. Shared request preserves row limit, date anchor, interaction, permissions, and confirmation flags. Existing conversation parent/cohort orchestration remains. Snapshot and live export remain distinct. Controlled generation does not establish live model quality.
F14 Answer oracles Confirmed coverage gap. Independent checks added. New tests/test_insights_*.py, JS and browser tests; London fixture correction. Real PostgreSQL values, membership, nulls, month boundaries, spring DST skip, autumn repeated hour, and explicit UTC. The old London assertion expected UTC SQL against a London contract. The corrected expectation is backed by actual calendar values, not only a SQL substring.

Before and after evidence

Reproduction Before After
Unauthorized conversation actions New boundary suite: 27 failures. Owner checks were absent on several routes. Expanded 45-case matrix passes. No denied work dispatches.
Query correctness New suite: 11 failed, 6 passed. Equal deals returned 100; IDs summed; qualified equivalents failed. Combined 15-file suite: 462 passed. Later real-driver and concurrency gate: 36 passed.
Units and answer record Three metadata regressions failed. Units were discarded and receipts were absent. Metadata round trips pass. A separate missing federated watermark regression was reproduced and fixed.
Total and type rendering New JS value suite: 7 failed, 2 passed. Value cases pass within the 41-test JS gate.
Job idempotency and timeout Original revision: 20 keys made 20 jobs. At 181s, response=failed, stored=running; late finish=done. Atomic route and worker regressions pass. Terminal writes are conditional.
Optional UI failure An injected optional failure replaced already visible rows with an error. The same browser test passes after local failure notices preserve the result.
Dashboard orchestration Shared dependency/routing regression failed before the change. Shared path regression passes. Integrated review added actual source permission tests.
London calendar Focused baseline: 59 passed, 1 failed. Expected SQL omitted London conversion. Integrated calendar/auth/metadata suite: 87 passed. Real PostgreSQL confirms intended July/August membership and DST behavior.

Raw logs and detailed commands are in lead evidence, query evidence, jobs evidence, and UI evidence.

Measured performance

All figures below are measured. Errors and refusals are not counted as successful answers. p95 is a nearest-rank statistic. Results describe the named component and fixture only.

Matched workload Before p50 / p95 After p50 / p95 Samples and scope
Status HTTP, 20 turns × 10,000 rows, warm c1 393.617 / 1,117.625 ms 1.715 / 2.299 ms N=30 per variant. Real TCP loopback. Fixed synthetic authorization. Same returned job.
Status HTTP, same fixture, warm c4 2,324.828 / 3,177.752 ms 9.818 / 14.269 ms N=32 per variant. Same correctness and freshness.
Status HTTP, 1 turn × 100 rows, warm c4 13.596 / 18.495 ms 11.239 / 18.831 ms N=32. This small workload did not improve at p95.
Metadata read, large fixture Full history: 445.723 / 1,221.311 ms Metadata: 0.032 / 0.075 ms N=30. SQL trace excludes historical row JSON.
PostgreSQL query with new vs reused connection New: 11.302 / 13.885 ms Reused test connection: 0.888 / 1.146 ms N=30 each, c1. Same restricted role, query, and three synthetic deals. Production reuse is not enabled.

The large fixture's status payload is 385 bytes. Its summary is 470 bytes. Its full history is 10,258,265 bytes. A 1 × 100-row fixture has the same 385-byte status payload.

New HTTP-client runs have p95 27.468 ms on the large fixture. They include client setup and a new TCP connection. They are not cold filesystem-cache runs. Operating-system-cold and production-network latency are unmeasured.

Browser ready-to-visible observations: N=30, median 286.826 ms, p95 292.978 ms, maximum 294.719 ms. Poll interval: 250 ms. The real UI consumes intercepted ready responses while optional work stays pending. This measures polling and rendering, not SQL or provider latency.

The separate worker test injects 20 seconds of narration and measures readiness after 119.394 ms. These two measurements support earlier useful results at their respective boundaries. They are not one measured production end-to-end route.

The final instrumentation pass adds submission_ack_ms and base_persistence_ms to the existing durable job timing and turn trace. The submission span includes handler authorization, reservation, and enqueueing. It excludes ASGI parsing, serialization, timing storage, and network acknowledgement. Persistence includes serialization, transaction admission, audit, and commit. Six create/append × success/error/clarify cases verify separate spans and both writer orders. Replays retain the original sample. Error and clarification outcomes do not set first_useful_ms.

Federation now has a parent trace with its actual wall time and child source trace IDs. required_checks_ms covers source authorization, the CT SQL gate, and key/grain/membership checks. merge_ms excludes its nested check spans. Existing per-source validation and EXPLAIN remain visible in child traces. Four regressions prove distinct known-duration spans, preserved children, refusal metadata, and cancellation cleanup. The tracing/federation/merge gate passed 142 tests in 14.05 seconds.

Existing model-attempt traces remain in llm_trace; query timings retain parse, validation, EXPLAIN, admission, connection, SQL execution, and retrieval. Job timings retain queue, required-to-ready, optional work, and full completion. Required-to-ready encloses child stages. Do not sum it with its child durations.

A separate browser request observation records one synthetic submission: one conversation POST, four status polls, two selected-turn reads, and zero full-history reads. Each selected turn is 5,867 bytes of fixture JSON. Ready-to-response-complete was 238.68 ms; response-complete-to-observed-visible was 52.94 ms. Their combined 291.62 ms uses one clock. The browser's own submit-event-to-render mark was 832.5 ms. This diagnostic includes deliberately held queue/running states. N=1 is not a latency percentile. Fixture JSON sizes are not compressed wire bytes.

Hypotheses: Connection pooling, batching, cached answers, and smaller worker context may help other workloads. No full-feature speedup is claimed. No plausible-estimate figure is used as acceptance evidence.

Final checks

The sole full-suite run completed with 27,515 passed, 48 failed, 21 skipped, and 1,534 warnings in 649.13 seconds. It used eight workers with file scheduling. No full suites overlapped. The functional fixes were stable for this run. The 27 compatibility repairs changed test fixtures only. A later additive instrumentation pass and browser-fixture repair have separate final gates below. The full suite was not rerun after those additions.

The three owners repaired 27 stale test contracts across 12 files. The repairs supply scoped source authorization, real validation contexts, exact qualified grants, or the new dispatch result. Existing behavior assertions remain. Three new denial cases and behavioral host/wildcard checks strengthen coverage. After the final timing additions, the union of all 36 changed Python test files passed 745 tests, with 100 existing timestamp warnings, in 71.87 seconds. No tests in this union were skipped.

The remaining 21 failures also reproduce at base commit 6ce7648a. The first isolated baseline run returned 19 failed, 178 passed, and 4 skipped in 124.72 seconds. After making the same Node dependency available, the evaluation-harness file returned 2 failed and 22 passed in 17.33 seconds. The exact failure IDs match the broader run. See the failure comparison, full run, and final 745-test run.

Existing failure group Count Evidence and impact
C2 routing expectations 2 Existing onboarding/signups questions route to CT while old tests expect otherwise. The same mismatch exists on the base. This run does not ratify that separate domain-routing decision.
Evaluation branch contrast 2 The existing corpus produces zero expected contrast pairs. Both scorer tests fail on the base with the same errors. This gate cannot certify live clarification choices.
Span marker parser 2 Existing numbered-item parsing assertions fail on the base. These are outside the Insights fixes.
Content deck and Compose floor manifests 12 Existing template fields and floor facts differ from test expectations. All twelve fail on the base. These are outside the Insights fixes.
Benchmark and paraphrase corpus inventory 3 Existing case counts and one required paraphrase key disagree. All three fail on the base. The new independent value tests do not repair this separate corpus inventory.

These failures remain unresolved. Their reproduction shows they were not introduced by this change. It does not prove their underlying behavior is correct.

env PYTHONPATH=src LORE_DB_PATH=/tmp/lore-insights-full-suite-20260905.db \
  QDRANT_HOST=127.0.0.1 QDRANT_PORT=32784 \
  LORE_LLM_LIVE=0 LORE_BI_LIVE=0 LORE_WP_LIVE_TEST=0 LORE_CONTENT_FIXER_LIVE=0 \
  .venv/bin/python -m pytest tests/ -n 8 --dist loadfile -q \
  -m 'not live and not live_db and not live_gh and not live_gh_thisrepo and not live_gh_thisrepo_recovery and not llm_live and not compose_guide_live and not blueprint_live and not blueprint_distill_live and not content_fixer_live and not wp_live and not bi_live and not deck_pptx_live and not bi_datasources_live and not bi_tablebind_live' \
  --tb=short

INSIGHTS_TEST_PG_DSN and LORE_INSIGHTS_TEST_DSN point to the disposable PostgreSQL fixture on localhost port 32783. Credentials are supplied through the test process environment. The excluded markers require live providers, privileged external infrastructure, or external write actions. Their exclusion is intentional and recorded.

env PYTHONPATH=src .venv/bin/python -m mypy src/ --strict
# Success: no issues found in 1159 source files.

# Ruff receives all 64 changed/new Python files from the saved git inventory.
xargs .venv/bin/ruff check < docs/evidence/insights-fixes-2026-09-05/changed-python-files.txt
# All checks passed.

npm run build:css
# Passed in 4.214 seconds. Existing caniuse metadata warning remains.

./node_modules/.bin/playwright test --config=playwright.insights-fixes.config.js --reporter=line
# 23 passed in 1.2 minutes. One worker. No retries.

The final combined Python command uses the same isolated PostgreSQL DSN environment as the full run:

env PYTHONPATH=src LORE_DB_PATH=/tmp/lore-insights-final-tracing.db \
  QDRANT_HOST=127.0.0.1 QDRANT_PORT=32784 LORE_LLM_LIVE=0 LORE_BI_LIVE=0 \
  xargs .venv/bin/python -m pytest -n 8 --dist loadfile -q --tb=short \
  < docs/evidence/insights-fixes-2026-09-05/final-focused-test-files.txt
# 745 passed, 100 warnings in 71.87 seconds.

The UI evidence file records the exact four-file Node command: 41 passed. The browser fixture now obtains Chart.js 4.4.7 through a pinned URL and SHA-256 check. It verifies cached bytes and rejects a bad digest. No session-specific temporary file is required. Nine affected browser cases passed in 10.5 seconds; two cases passed from an empty cache in 4.0 seconds. The suite now contains 24 cases, with the new diagnostic covered by these focused runs. After final confidence wording and faithful snapshot fixtures changed, four affected browser cases passed in 4.3 seconds. Both JavaScript syntax checks and git diff --check pass.

The HTML report also passed desktop/mobile browser QA. All images and local links load. The workload selector correctly shows the small concurrent p95 regression. There is no page-wide horizontal overflow or JavaScript error.

Review findings and resolutions

The three requested reviewers inspected the combined working tree, including new files. The review uses correctness, authorization, API, testing, lifecycle, migration, accessibility, and measurement lenses. Simplification checks cover reuse, quality, and efficiency. The lead validates concrete findings before applying fixes.

Confirmed integration findings include approved CT request settings lost at dispatch, actual-source permission gaps in alternate entry points, ambiguous browser submit recovery, cancellation propagation across API processes, and follow-up readiness after reload. Each has a passing focused regression. The final 745-test gate includes the Python changes. The review receipt records all three reviewers and the independent validation batch. Four formal findings were validated and fixed. Additional review-driven corrections are listed below.

Review correction Proof and result
Configured identity policy bypass Raw trusted lookups now authorize their target, validate source/columns, mask, and revalidate before loading credentials or executing. Source matrix: 13 failures before, then 13 passes. Masked/restricted/empty-allowlist regressions: 3 failures before. Combined auxiliary/driver gate: 67 passes.
Masking missed qualified and derived outputs Before: 10 failed, 1 passed. Scope masking now follows direct CTE/alias lineage and PostgreSQL identifier case rules. Unsupported sensitive expressions refuse. Real PostgreSQL verifies redacted values, nulls, original ORDER BY selection, and original GROUP BY membership. Later case/quoted-identity suite: 176 passes.
Quoted source identity collisions Stored metadata preserves uppercase names, embedded dots, and quotes. Tests reject a different physical source that has a similar printed name.
Cross-source cohort fallback Results carry their actual executed connection. Materialization uses only that source. Missing identity or a failed read keeps follow-up context unavailable. It never tries a different database to make the query succeed.
Approved CT settings lost The shared adapter forwards date anchor, row cap, permissions, interaction, and confirmation flags. A focused contract test asserts each field.
Source-slot leak after trace completion Recording a later span cannot index deleted active timers. Slot cleanup also covers tracing errors. Both regressions pass.
Legacy migrated request retry Old keys with no fingerprint return a scoped 409. The server cannot safely infer the old full payload. Other conversations keep independent request keys.
Admission time lost The outer source wait is attached to the completed leg trace. A held-source regression passes.

Migration and rollout

Refresh-source permission now applies to every auxiliary lookup. An unavailable or unapproved refresh-status table leaves freshness unknown. This must be checked in rollout configuration.

Apply migrations/bic_035_durable_turn_jobs.sql through the normal migration runner. It adds durable request identity and job lifecycle metadata. It keeps legacy jobs, including duplicate old request keys. A retry of a matching old key returns 409, because the old full payload cannot be safely reconstructed; use the saved answer or an intentional new request. Additional answer metadata uses existing JSON columns.

Stop or drain old workers before migration. Back up the metadata database. Start updated workers only after the migration succeeds. A legacy active job without a process identity is reconciled as an orphan. A new live sibling is preserved. A remote-host owner remains until its deadline.

The migration regression verifies old duplicate rows, injected DDL failure rollback, and old-code compatibility rollback. migrations/rollback/bic_035_durable_turn_jobs.sql retains answers and maps statuses to the old domain. Stop workers before rollback. Reverting the app restores its old behavioral limits.

Sessions pin search_path=public and read-only transactions. Qualify operator SQL for other schemas. Empty ordinary allowlists deny physical queries. The server-pinned CT source map is the explicit no-policy exception. Unsupported merge grain or cohort shapes refuse instead of silently broadening the answer.

No rollout was performed. A future authorized rollout must check live membership revocation, source grants, tunnels, watermarks, provider timeouts, and worker restart behavior. Watch denied dispatch count, queued/running age, terminal-state reversals, optional failure rate, and first-useful/full-completion spans. A denied dispatch or terminal reversal is a rollback trigger.

Unavailable checks and impact

The 21 existing broader-suite failures above also remain open. They limit repository-wide assurance. They were reproduced independently, and their assertions were not removed or relaxed.

These limits are not passed checks. No application rollout was performed.

Status reads, under matched loads

Before
After

Linear scale within the selected workload. The permission fixture is synthetic. These are status reads, not full answers. The small concurrent workload does not improve at p95.

Observed in the browser

The real UI renders synthetic API responses. Open an image for its full size.