A run keeps the inputs its flow declared at submit

Run.declared (migration 2e7ca7d10044) snapshots the declarations on submit
and import. The run detail's Inputs panel reads them, and a run from before
falls back to the flow's current declarations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WgBfkm4rCmtd1T4vHWjEPx
This commit is contained in:
2026-10-15 10:20:29 +02:00
co-authored by Claude Opus 5.5
parent edd01ee330
commit df2620cede
10 changed files with 77 additions and 6 deletions
+10
View File
@@ -454,6 +454,14 @@ def seed_values(
return values
def declared_inputs(flow: FlowDef) -> dict[str, Any]:
"""What a flow declares it can be given, by name, with the declared values.
Kept on each run, since the flow can change after it.
"""
return {one.spec.name: one.initial for one in flow.inputs}
def collect_result(flow: FlowDef, state: StateBackend) -> dict[str, Any]:
"""What the run produced, keyed by message name without the flow prefix."""
prefix = f"{flow.name}."
@@ -925,6 +933,7 @@ class RunService:
code_digest=run_digest(flow),
params=params,
passed=named if passed is None else passed,
declared=declared_inputs(flow),
params_digest=digest_of(params, seed),
seed=seed,
group_id=group_id,
@@ -1047,6 +1056,7 @@ class RunService:
flow_version=flow.version,
params=params,
passed=passed,
declared=declared_inputs(flow),
params_digest=digest_of(params, seed),
seed=seed,
group_id=entry["group_id"],