Skip to content

fix(flow): bind an API step to the complete definition of the steps it replaces - #1372

Merged
abrichr merged 5 commits into
mainfrom
fix/api-step-replaced-steps-digest
Oct 20, 2026
Merged

abrichr merged 5 commits into
mainfrom
fix/api-step-replaced-steps-digest

Conversation

@abrichr

@abrichr abrichr commented Oct 19, 2026

Copy link
Copy Markdown
Member

Sixth of six fixes from an external review of #1269. Stacked on #1371 (then #1370, #1369, #1368).

Bug

folded_checks_digest hashed only the folded steps' on-screen checks (expect). Changing what a replaced step does left the admitted API step running in its place. That covers its action, its typed value or parameter, its target or identity evidence, a guard, and the save step itself.

Fix

The digest now covers the complete definition (model_dump) of every replaced step, the save included, minus only the save's own API binding, which carries the digest. Any change keeps the API step on the GUI. The reason reads "the steps the API step replaces changed after it was proposed ... (openadapt-flow api propose)", and the step stays off until it is proposed and admitted again.

Bindings proposed before this PR need proposing again. Their digest no longer matches, so they fail closed onto the GUI. The field keeps its name (folded_checks_digest) so no bundle schema changes; its description in ir.py and API_TIER.md are updated.

Tests

tests/test_api_step_replaced_steps_digest.py (new, 9 tests): the admitted steps still run as the API step, and each of these changes keeps them on the GUI:

  • a folded step's action, key, typed text or parameter, target or identity, or guard;
  • the save's key or risk.

8 of the 9 fail on main; the unchanged case passes on both. 89 pass with the other API-tier and review-fix suites.

🤖 Generated with Claude Code

abrichr and others added 2 commits October 19, 2026 14:23
…t replaces

Review of #1269: folded_checks_digest hashed only the folded steps' on-screen
checks, so changing what a replaced step does (its action, value, parameter,
target or identity, a guard, the save itself) left the admitted API step
running in its place.

The digest now covers every replaced step's complete definition, the save
included, minus only the save's own API binding. Any change keeps the API
step on the GUI with the reason until it is proposed and admitted again.
Bindings proposed before this need proposing again (they fail closed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
abrichr and others added 3 commits October 19, 2026 18:26
…ed-step digest

After merging main (#1361): the run authorization's admitted_api_step
compared folded_checks_digest over the steps before the save, while #1372
now digests every replaced step including the save. It uses the same range
as the replayer and the proposal. Tests that edit the save re-propose its
digest first, as openadapt-flow api propose does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@abrichr

abrichr commented Oct 19, 2026

Copy link
Copy Markdown
Member Author

Included in batch #1383, which runs CI once for several reviewed PRs. This PR is marked merged when #1383 merges. Please don't push here unless asked; a new commit leaves it out of the batch.

abrichr added a commit that referenced this pull request Oct 20, 2026
batch: API-step fixes, compatibility matrix and local-edit classification (#1370 #1371 #1372 #1364 #1374 #1366)
Base automatically changed from fix/api-step-native-validation to main October 20, 2026 00:24
@abrichr
abrichr merged commit e0a28a7 into main Oct 20, 2026
29 of 35 checks passed
@abrichr
abrichr deleted the fix/api-step-replaced-steps-digest branch October 20, 2026 00:24
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