Skip to content

improvement(provenance): attribute stored-envelope display reads to their execution - #7039

Merged
icecrasher321 merged 3 commits into
stagingfrom
trace-store-incomplete-refire
Aug 24, 2026
Merged

improvement(provenance): attribute stored-envelope display reads to their execution#7039
icecrasher321 merged 3 commits into
stagingfrom
trace-store-incomplete-refire

Conversation

@icecrasher321

@icecrasher321 icecrasher321 commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Kills the source-provenance-incomplete re-fire from the execution-log display paths — the one live provenance noise source left after v0.8.10 (493 lines in 34.6h post-deploy, ~10x the prior rate, none of them naming an execution).
  • Traced against the prod read replica before changing anything. Precisely what the data shows: no data drains exist (both drain tables empty — the machine-reader-via-drains hypothesis is dead), and among rows whose envelopes are SQL-visible, 1 incomplete since 08-15. Nearly all rows externalize execution_data to the large-value store, so the stored envelopes are only observable at read time — the faucet-closed conclusion therefore rests on the write-side latch signals being silent in prod since 08-21 plus the writer fix (fix(provenance): stop requiring a projection of roots no model sees #6981) being deployed, not on the SQL alone. Either way the stream is bounded re-reads of old rows through display materialization (log detail, v1 logs API, exports, public logs, child-trace hydration), not a live producer.
  • The display registries (traceStore.spanProvenance, traceStore.exactProvenance, both block-output imports) are now staged — the registry's existing concept for "filters values for one operation; the caller owns reporting with more context" — so they no longer emit a per-envelope, per-view registry summary. The staged TSDoc is generalized to cover both of its uses.
  • Each display function reports once per materialization with the execution id, workflow, workspace, and the parts that couldn't be vouched for (traceSpans / finalOutput / workflowInput / blockOutput:<id>). A block-outputs read runs both display functions, so an incomplete run envelope appears once under each site — documented and pinned by a test rather than left implicit.
  • Severity preserved: incomplete stored envelope → warn; malformed envelope → error. Projection behavior byte-identical — incomplete and malformed values still fail closed exactly as before; only the reporting moves to the boundary that knows the execution.

Type of Change

  • Improvement (observability; no behavior change)

Testing

Tests pin: one attributed warn per display function with executionId + parts and zero registry summaries; the dual-site shape on block-outputs reads; malformed at error with the value withheld; complete envelopes fully silent. 1,135 tests green across lib/logs, api/logs, api/v1/logs, api/workflows, data-drains, workflows/executor, and the registry suite. bun run type-check clean, all 33 audits pass.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…heir execution

A display materialization of an execution log imports the row's stored
provenance envelopes into throwaway registries, and each import of an
incomplete envelope re-emitted the registry's own summary — per envelope,
per view, carrying counts and a workspace but never the execution id. A
reader repeatedly materializing the same stored rows produced hundreds of
identical lines that could not say which executions to go look at, and
the volume scaled with views of a state that was fully recorded when the
run wrote it.

Verified against production before changing anything: essentially no new
incomplete envelopes are being stored since the writer fix shipped, and
no data drains exist — the stream is bounded re-reads of old rows through
the display paths, not a live producer.

The display registries are now staged — the existing concept for a
registry that filters one value for a caller that reports against the
real boundary — and each display function reports once per
materialization with the execution id, workflow, workspace, and the
parts that could not be vouched for. Severity is preserved: an
incomplete stored envelope stays at warn, a malformed one stays at
error. Projection behavior is unchanged everywhere — incomplete and
malformed envelopes still fail their values closed exactly as before;
only the reporting moves to the boundary that knows the execution.
@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 24, 2026 6:56pm

Request Review

@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR moves stored provenance fault reporting from staged registries to execution-aware display boundaries and adds coverage for malformed and undecryptable envelopes.

  • Attributes grouped provenance faults to execution, workflow, workspace, and affected display parts.
  • Preserves fail-closed projection behavior and suppresses less-contextual staged-registry summaries.
  • Adds tests for incomplete, malformed, undecryptable, complete, and block-output materialization cases.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/lib/logs/execution/trace-store.ts Centralizes stored-envelope import classification and emits grouped execution-attributed display reports.
apps/sim/lib/logs/execution/trace-store.test.ts Adds comprehensive reporting and fail-closed projection tests for stored provenance envelopes.
apps/sim/executor/utils/resolved-secret-trace-registry.ts Generalizes staged-registry documentation to cover value filtering and display materialization.

Reviews (2): Last reviewed commit: "improvement(provenance): classify every ..." | Re-trigger Greptile

Comment thread apps/sim/lib/logs/execution/trace-store.ts Outdated
Comment thread apps/sim/lib/logs/execution/trace-store.ts Outdated
@cursor

cursor Bot commented Aug 24, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Observability-only change to logging boundaries; secret projection and withhold-on-fault behavior are intentionally unchanged.

Overview
Execution log display materialization no longer emits per-envelope Resolved secret registry marked incomplete noise when re-reading stored provenance. Display-path registries are created staged, so incompleteness is still latched for projection but registry-level summaries are skipped.

Fault reporting moves to trace-store: importStoredDisplayEnvelope classifies stored envelopes (incomplete, malformed, undecryptable), and reportStoredDisplayProvenanceFaults logs once per fault kind per site with executionId, workflow/workspace ids, and affected parts (traceSpans, finalOutput, blockOutput:<id>, etc.). Warn vs error severity matches the old registry semantics.

Projection stays fail-closed — withheld values and redaction behavior are unchanged; only logging is more attributable. Tests mock the logger and pin the new messages, zero registry summaries, and dual-site reporting on block-output reads.

Reviewed by Cursor Bugbot for commit d9f727a. Configure here.

…in dual-site reporting

Review pass over the previous commit: one helper instead of three copies
of the incomplete-envelope check, the staged TSDoc generalized to cover
both of its uses, and the block-outputs entry point's two-site reporting
of one run envelope documented and pinned rather than left implicit.
…he display boundary

Review findings from the first round, both accepted: a present-but-
malformed block or run envelope was withheld with no attributed line,
and a complete envelope whose entries fail decryption latched the
staged registry with only the unattributed entry-level error.

Fault classification moves into the one import helper the display
paths share, which now returns the registry and the fault together:
absent is not a fault, unparseable is malformed, unable-to-vouch is
incomplete, and a complete envelope whose registry latched during
import — entry decryption is the only latch on that trusted path —
is undecryptable. Every consumer reports through the same table,
severity per kind, so the exact-value loop stops being the only site
that could name a malformed envelope. Withholding behavior is
unchanged at every site.
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit d9f727a. Configure here.

@icecrasher321
icecrasher321 merged commit cc61118 into staging Aug 24, 2026
30 checks passed
@icecrasher321
icecrasher321 deleted the trace-store-incomplete-refire branch August 24, 2026 18:58
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