feat(workflow): derive affordances from the enforcing guards #38
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/support!38
Loading…
Reference in a new issue
No description provided.
Delete branch "workflow-affordances"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
works.iterative.workflowgainsAffordances— per-state command affordances derived from the sameGuardobjects (and gate policy) thatWorkflowInterpreter.decideenforces, so what a UI/agent is told is possible cannot drift from what the engine accepts (the ADR 0011 §4 invariant, lifted from its first consumer).Affordance(command, available, description, reason)+Affordances.compute(defn, auth)(ctx).decidestructurally: samestateOf, same table order,AuthEnforcement.Skiprewrites auth leaves viaGuard.stripAuth/Enforceevaluates intact, sameGuardFailurecollapse.applicableWhen-failing rows contribute nothing (matchingUnhandled);requiresPayloadis not evaluated (needs a concrete command); label-level dedupe, available-wins, first-seen order.collectFirst,firstDataMessage,firstAuthLabel) move fromWorkflowInterpreterinto theGuardFailurecompanion asprivate[workflow];decidedelegates — observable behavior unchanged (all 32 interpreter tests untouched).Why
The first kernel consumer (procedures' actionable aspect) had to hand-copy the interpreter's private collapse to compute affordances — duplicated kernel-internal logic that would silently drift. With the second consumer (delegation aspect) landing, the derivation moves to its natural home, next to the interpreter it must match. The
authparameter keeps role-enforcing consumers (MEDECA) honest: affordances computed under the same policydecideruns with.Tests
AffordancesSpec(5 pins): per-state label sets; reason parity asserted againstdecide's actualRejection.Invalidmessage; dedupe; Skip-vs-Enforce auth;applicableWhenabsence ==Unhandled.workflow.jvm.test63/63,workflow.js.test63/63, whole-repo__.compilegreen.After merge: release as v0.1.19 → v0.1.20 (procedures consumes
Affordancesin its delegation-1 slice).🤖 Generated with Claude Code