Skip to content

Session proof refusals report elapsed phases and deadline expiry - #892

Merged
zlareb1 merged 1 commit into
mainfrom
diag/session-proof-timing
Nov 18, 2026
Merged

zlareb1 merged 1 commit into
mainfrom
diag/session-proof-timing

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Related: #876

Changelog category

  • Improvement

Changelog entry

Session-protection proof refusals report elapsed phases and whether their outer security deadline expired.

Why

A timeout warning names the last proof phase but cannot show how much time earlier phases used or whether the outer deadline expired. A successful latch read followed by a slow channel close can also retain the latch label. These ambiguities prevent a timeout from identifying the work that consumed its budget.

Scope and risk

The existing safe warning adds total elapsed milliseconds, current-phase milliseconds, cumulative completion times for fixed proof phases and the actual outer timer's expiry flag. Normal channel close has its own fixed stage. Both absence and positive-state proofs use the same diagnostic helper.

The warning retains only fixed phase names, numeric durations, the expiry boolean, exception class and integer database code. It adds no query text, identifiers, credentials, response content or exception messages. Diagnostic failures cannot replace the existing privacy refusal. Connection setup remains one aggregate phase; these observations do not identify a transport or backend cause by themselves.

Compatibility, rollout and rollback

  • Wire and operator steps: none. Public errors and all security predicates remain unchanged.
  • The five-second proof deadline, own-key cleanup bound, channel capacity, statements and cancellation behavior retain their existing paths.
  • No setting, schema, dependency or stored data changes. Rollback removes the diagnostic fields and close labels.

Tests

  • Four diagnostic controls first produced three failures and one passing logger-failure control. The failures identified missing timing/expiry fields and a successful close labeled as a latch read.
  • With the same regression tests, all 37 directly related fake latch checks pass. They retain backend/nonce validation, cleanup, cancellation, positive-state and query-tag controls.
  • Scoped mypy passes for the changed server module; Ruff lint and formatting pass for both changed files. Source comparison confirms the proof decision flow and all six SQL constants are unchanged.
  • All required PR checks pass, including unit, integration, both Postgres authority versions, mixed-version and quickstart jobs. No live provider or deployment acceptance is claimed.
python -m pytest -q -o addopts= tests/unit/test_mirror_latch.py
python -m mypy server/knowledge/store/mirror_latch.py

AI assistance in the code

  • AI-generated: an agent wrote the change. The diagnostic evidence, source diff and focused regressions were checked separately; independent review is required before merge.
  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • Required formatting, lint, type, unit and integration gates pass in PR CI.
  • No migration, generated artifact, plugin or frontend change is required.
  • Repository text contains no deployment details.
  • Commits are signed off.

Record fixed phase timings and distinguish normal channel close from latch reads. Keep proof deadlines, cleanup and fail-closed decisions unchanged.

Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 merged commit 7ba5267 into main Nov 18, 2026
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant