fabro/lib
Bryan Helmkamp ddcf86bcfb
fix(workflow): materialize only prompt values the selected fidelity renders
Prompt-value demotion previously demoted every prior outcome value and
visible context value wholesale, before the preamble builders decided
what the selected fidelity renders. That materialized blobs and sandbox
files no generated prompt referenced — e.g. a compact prompt created a
blob for a prior LLM response even though compact stage details never
include response.<node_id>.

Make the materialization set fidelity-aware:

- preamble::rendered_value_selection computes, per fidelity, exactly
  which context keys and (stage, key) outcome values the builders
  render, sharing the recency-window logic with the builders.
- demote_large_values_for_prompt takes a PromptValueSelection and
  demotes only the values it names.
- The lifecycle unions the node's selection with each parallel branch's
  effective fidelity selection, and skips demotion when the union is
  empty.

Durable context and node outcomes are unchanged: response.<node_id>
stays the exact model response and output.<node_id> the validated
structured value. A drift-guard test asserts, at every fidelity, that
each demoted path is referenced by the built preamble and no unselected
large value leaks inline.

Closes #800

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011bs8C1fjVCu8a8qDvFskYV
2026-08-25 07:54:14 -04:00
..
apps Merge pull request #783 from fabro-sh/codex/sqlite-blob-startup-activation 2026-08-24 16:32:59 -04:00
components fix(workflow): materialize only prompt values the selected fidelity renders 2026-08-25 07:54:14 -04:00
foundation Merge pull request #783 from fabro-sh/codex/sqlite-blob-startup-activation 2026-08-24 16:32:59 -04:00
packages/fabro-api-client Preserve run creation error context 2026-08-24 12:22:38 -04:00