@@ -121,14 +121,54 @@ describe('#8990 — the fail-closed intent survives as a real false, and the lev
121121 expect ( evaluate ( visibleOf ( 'approval_remind' ) , approver ) ) . toBe ( false ) ;
122122 } ) ;
123123
124- it ( 'an override-only admin still gets the three core decision levers and nothing else (#3424)' , ( ) => {
124+ it ( 'an override-only admin gets the four levers the override covers, and nothing else (#3424, +recall #12716)' , ( ) => {
125+ // Re-expressed for #12716. This pin previously read "the three core decision
126+ // levers and nothing else" — true when written, and it is the shape of pin
127+ // the recall override arm was expected to turn red. It did not go red (it
128+ // never asserted anything about recall), but its TITLE became false the
129+ // moment recall joined the set, so it is restated rather than left to read
130+ // as a claim the code no longer honours.
125131 const admin = { status : 'pending' , viewer : { can_act : false , can_override : true , is_submitter : false } } ;
126132 expect ( evaluate ( visibleOf ( 'approval_approve' ) , admin ) ) . toBe ( true ) ;
127133 expect ( evaluate ( visibleOf ( 'approval_reject' ) , admin ) ) . toBe ( true ) ;
128134 expect ( evaluate ( visibleOf ( 'approval_reassign' ) , admin ) ) . toBe ( true ) ;
135+ // #12716 — the fourth lever. An override admin is a NON-SUBMITTER who now
136+ // sees Recall: the service has authorised them since #3424, and this is the
137+ // one lever that releases a stuck request without writing a decision on
138+ // someone else's behalf.
139+ expect ( evaluate ( visibleOf ( 'approval_recall' ) , admin ) ) . toBe ( true ) ;
129140 // `can_override` was never OR'd into the secondary levers, and still is not.
130141 expect ( evaluate ( visibleOf ( 'approval_send_back' ) , admin ) ) . toBe ( false ) ;
131142 expect ( evaluate ( visibleOf ( 'approval_request_info' ) , admin ) ) . toBe ( false ) ;
143+ // Nor into the remaining submitter levers — recall is the only one that
144+ // moved, and remind/resubmit stay shut for an actor who is not the submitter.
145+ expect ( evaluate ( visibleOf ( 'approval_remind' ) , admin ) ) . toBe ( false ) ;
146+ expect ( evaluate ( visibleOf ( 'approval_resubmit' ) , { ...admin , status : 'returned' } ) ) . toBe ( false ) ;
147+ } ) ;
148+
149+ it ( 'the recall override arm is pending-only in effect, because `can_override` is itself pending-scoped (#12716)' , ( ) => {
150+ // The negative direction, and the reason the arm needs no status test of its
151+ // own. `attachViewers` computes
152+ // can_override: row.status === 'pending' && isOverrideActor(...)
153+ // — ANDed — so for the SAME override actor the flag the service attaches is
154+ // true on `pending` and false on `returned`. Both rows below are viewer
155+ // blocks the service really emits: forcing `can_override: true` onto a
156+ // `returned` row would pin a state the server never produces, and would
157+ // measure CEL's grouping rather than the product's behaviour.
158+ //
159+ // That is what makes "pending-only" enforced rather than asserted in prose.
160+ // The flag's own scoping is pinned against the REAL service — an override
161+ // admin reading a genuinely `returned` request — in `approval-revise.test.ts`;
162+ // this pair is the predicate half of the same claim.
163+ const onPending = { status : 'pending' , viewer : { can_act : false , can_override : true , is_submitter : false } } ;
164+ const onReturned = { status : 'returned' , viewer : { can_act : false , can_override : false , is_submitter : false } } ;
165+ expect ( evaluate ( visibleOf ( 'approval_recall' ) , onPending ) ) . toBe ( true ) ;
166+ expect ( evaluate ( visibleOf ( 'approval_recall' ) , onReturned ) ) . toBe ( false ) ;
167+ // And the submitter's own `returned` arm is untouched by the new OR — the
168+ // revise-window withdraw stays exactly as available as it was.
169+ expect ( evaluate ( visibleOf ( 'approval_recall' ) , {
170+ status : 'returned' , viewer : { can_act : false , can_override : false , is_submitter : true } ,
171+ } ) ) . toBe ( true ) ;
132172 } ) ;
133173
134174 it ( 'the submitter still gets remind / recall on pending and resubmit / recall on returned' , ( ) => {
0 commit comments