fix(provenance): derive final-output provenance instead of declaring it unvouchable - #7173
Conversation
…it unvouchable A run whose last block stored its output without provenance had its final-output envelope stamped incomplete. That is not what an absent block-state envelope means: several state writers legitimately omit one, and a subflow sentinel aggregating iteration results is the common case — a loop that ran no iterations has nothing to merge, so its aggregate carries none. The workflows hitting this in production end in a loop. The cost was not noise. An incomplete final-output envelope withholds finalOutput from the execution log, so the author of the workflow could not see their own run's output, on every view, forever — and each view re-derived the same verdict, which is the read-path re-fire now dominating the provenance stream. Derive from the run registry against the value being described, which is what the end-of-run path already did and what every other consumer of a provenance-less block state does. The two now share one derivation rather than disagreeing: a shortcut when the block state has an exact envelope, the registry otherwise. It fails closed on its own terms — a latched registry still exports incomplete — and the guard for that is pinned by its own test.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThe PR fixes final-output provenance for terminal block states that omit their own provenance envelope by deriving it from the run registry. It also consolidates end-of-run derivation behind one helper and adds regression coverage for successful derivation and permanently incomplete registries.
Confidence Score: 5/5The PR appears safe to merge with no actionable correctness or security issues identified. The changed path derives provenance only when the final block lacks an exact envelope, uses the established committed-value registry export, and continues to return incomplete provenance when the registry cannot vouch for the run.
|
| Filename | Overview |
|---|---|
| apps/sim/executor/execution/engine.ts | Centralizes final-output provenance derivation and uses the committed run registry when the terminal block state has no provenance. |
| apps/sim/executor/execution/engine.test.ts | Adds focused regression tests for successful registry derivation and fail-closed handling of an incomplete registry. |
Reviews (1): Last reviewed commit: "fix(provenance): derive final-output pro..." | Re-trigger Greptile
Summary
TraceStore — displayProjectionstream that is now ~95% of provenance log output (105 of 110 lines post-deploy). Every one of those lines isparts: ["finalOutput"], and the stock is real and growing — 30 distinct executions in under 4 hours — so this was never just a fixed backlog of bug-era rows.ExecutionEngine.setFinalOutputstamped{ complete: false }whenever the final block's state carried no provenance. But an absent block-state envelope is not a verdict — several state writers legitimately omit one, and a subflow sentinel aggregating iteration results is the common case (a loop that ran no iterations has nothing to merge, sosetBlockOutputis called without provenance). The affected production workflows end in a loop block, which is exactly this shape.finalOutput, so the workflow's author could not see their own run's output in the execution log — on every view, permanently. Each view then re-derived the same verdict, which is the read-path re-fire dominating the stream.ensureFinalOutputProvenance) already did, and what every other consumer of a provenance-less block state does (the trace-store block-output reader falls back to the run registry). The two paths now share onederiveFinalOutputProvenancerather than disagreeing: take the block state's exact envelope as a shortcut when present, derive otherwise.exportCommittedProvenanceForValuereturns an incomplete envelope when the registry itself latched, which is the genuinely unvouchable case. That guard has its own regression test.Type of Change
Testing
Two new engine tests: one pins the derivation (a final block whose state carries no provenance yields a complete envelope naming the secret actually present in the output), one pins fail-closed (a latched registry still exports incomplete). Verified the derivation test fails without the fix and passes with it. 5,071 tests green across
executor/,lib/logs/, andlib/workflows/;bun run type-checkclean; all 36 audits pass.Checklist