A library write that fails after a partial change is recorded as refused before any change #23
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Found while syncing the flight plan editor (#5).
What happens. The tester's tool convention is that a write
error()s before it changes anything. But several multi-step tools alsoerror()when CMO refuses a later step after earlier steps took:areas.create_reference_points: "CMO refused point N" after points 1..N-1 were made;missions.edit_flight_plan: "CMO refused edit N … the edits before it were made".RuntimePort._library_writemaps every unanswered Lua (anerror()) to{'ok': False, 'submitted': False}. The coordinator then records the action asrejected/game_precondition_rejected, with the text "CMO-side preconditions rejected the operation before a setter was invoked". It releases the reservations and runs no read-back.Effect. A partial game effect is reported as no effect. The ledger, the General and the evidence importer all believe nothing changed, and the units are free for new orders while the half-applied change stands.
Reproduce (synthetic). In the made-up game, make
ScenEdit_AddReferencePointfail on the second point of a three-pointareas.create_reference_points. The action isrejectedwith the "before a setter was invoked" text, but point 1 exists.Possible fixes.
refused_at, a note andexpectfor what was asked) instead oferror(), so the read-back decides. This needs changes in the tester's tools.error()whose text says earlier steps were made (or anyerror()from a multi-step tool) becomesoutcome_unknown, keeping the reservations and asking for reconciliation (a read-back) instead ofrejected.Option 1 keeps the read-back as the judge; option 2 is a safe stopgap.