Skip to content

Mirrored source work stays out of shared diagnostics - #798

Merged
zlareb1 merged 9 commits into
mainfrom
feat/mirror-private-diagnostics
Nov 17, 2026
Merged

zlareb1 merged 9 commits into
mainfrom
feat/mirror-private-diagnostics

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Related: #791

Changelog category (leave one):

  • Not for changelog

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

None. Public operations still refuse mirrored sources.

Why

Mirrored source work can expose document details and work figures through shared diagnostics even when document reads enforce permissions. The source turn needs a private diagnostic boundary before lease acquisition, listing and retirement discovery.

The boundary suppresses shared logs, spans, metrics and request work figures. Private model spend is written directly under the stored mirror, while ordinary accounting resumes after the turn.

Scope and risk

  • Enter the boundary before mirrored sync and retirement discovery. Carry a monotonic pass mark through worker summaries, status and failure accounting so leaving a context cannot expose the completed work.
  • Keep private failures and spend separate from later ordinary worker history. Public summaries retain constant failure codes and no duration, count or cost figures.
  • Suppress application SQL capture, request work bags, client instrumentation, manual spans, provider health contributions and embedding-cache identity during private work. Keep deployment-native database logging settings unchanged.
  • Keep database query, error, mutation, text, profile and trace logs within the privileged database operator boundary. The native regression retains a positive ordinary capture and checks denial through scoped SQL and analyst accounts.
  • The extractor drains child stderr without retaining it, disables request access logs and returns a constant code for unexpected request faults. Cancellation still drains the owned child before releasing its slot.
  • Put connection acquisition inside both new native fixtures' existing cleanup boundaries, including partial connection failure.

Compatibility, rollout and rollback

  • Wire: no operation or field changes. No setting, migration or backfill.
  • Deploy the extractor protection wherever document extraction is served. Public mirrored creation remains disabled until the remaining read and session protections land.
  • N-1 retains ordinary source behavior. Mixed fleets cannot promise private diagnostics for work served by an older process; complete the documented fleet upgrade before mirrored creation.
  • Before removing the protection, stop mirrored writers, settle sent inserts and publication work, and run the documented mirror sweep over content and telemetry. Removing a source online retains its accounting. Native database logs remain an operator responsibility.

Tests

  • Eleven directly related existing unit cases pass without skips. They cover private spans, database summaries, cancellation restoration, isolated billing, application SQL capture, retirement discovery, later ordinary failure accounting and extractor access-log configuration.
  • Ruff formatting and lint pass for the 34 changed Python files; the three documentation files pass the pinned formatter. git diff --check passes. No new broad local or native test result is claimed.
  • The integration regressions retain private billing, ordinary application capture, deployment-native logging and scoped log-denial assertions under the required CI environments.
  • The first CI unit shard found a missing rationale for the fixed private-accounting cleanup bound. The adjacent comment now explains it; executable behavior and the gate are unchanged. All required final-head CI checks pass, including full units, coverage, native integration, both storage authorities, schema, analyzer and mixed-version coverage.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated: agents wrote most of the change; checked against diagnostic ownership, cancellation, ordinary accounting and the document sources threat model.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • Required format, lint, type, full unit and integration checks pass in PR CI.
  • No generated operation or settings contract changes.
  • No migration is added or edited.
  • No plugin or frontend behavior changes.
  • Architecture and extractor docs describe deployment and rollback requirements.
  • Repository text has no dates, people, host names, internal namespaces, ticket or decision numbers.
  • Commits are signed off.

Disable request access logs, discard child stderr, and contain unexpected handler faults behind the coded error response while preserving startup diagnostics and cancellation.

Signed-off-by: zlareb1 <[email protected]>
Suppress private instrumentation and log records, isolate billing from ordinary pass accounting, and retain only codes in pass diagnostics. Keep retry control separate from ordinary failure history.

Signed-off-by: zlareb1 <[email protected]>
Acquire each client inside its existing cleanup boundary so a failed connection probe still disconnects it.

Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 merged commit b7fb535 into main Nov 17, 2026
48 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