You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a0b0f03
Browse filesBrowse the repository at this point in the historyBrowse files
fix(agent-question): the first accepted decision stands when two devices decide one card - RFC-0014 step 5 drive
In lockstep with the Python pack: a decision's write applies when the row is still open or the engine accepted it,
in the memory inbox and SQL_DECIDED alike; the losing device gets the row as it stands. Vectors version 2 byte for
byte, SHA re-pinned; the ask-person README's audit claim narrowed to a refused call's note.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: test/vectors/agent-question-vectors.json
+154-2Lines changed: 154 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
{
2
2
"contract": "agent-question",
3
-
"version": 1,
4
-
"description": "The agent-question app's shared vectors (RFC-0014, build plan step 3): the pure half of extensions/agent-question, run by mercury-python and mercury-nodejs against the same file. row_cases pin the row a message event becomes (every field a replay carries; the upsert key of a wait; an advice has none) or the exact 400 that refuses the event. outcome_cases pin the state a decision's outcome leaves: the engine accepted it (answered), nothing was waiting (expired), a refusal or an endpoint that did not answer (open). click_cases pin the request the automated click sends - the link's own base plus /ask/reply, the ticket, the decisions and the person as decided_by. transition_cases pin the reference inbox on a scripted sequence - takes, a decision, a seen, an expiry sweep, two replays - as the rows each step leaves and the final rows, ids and change sequence included: a wait upserts on (graph_id, correlation_id, turn), an advice appends, every write bumps the sequence a replay reads from. No HTTP is exchanged by these cases; the routes are tested by each pack in-process.",
3
+
"version": 2,
4
+
"description": "The agent-question app's shared vectors (RFC-0014, build plan step 3): the pure half of extensions/agent-question, run by mercury-python and mercury-nodejs against the same file. row_cases pin the row a message event becomes (every field a replay carries; the upsert key of a wait; an advice has none) or the exact 400 that refuses the event. outcome_cases pin the state a decision's outcome leaves: the engine accepted it (answered), nothing was waiting (expired), a refusal or an endpoint that did not answer (open). click_cases pin the request the automated click sends - the link's own base plus /ask/reply, the ticket, the decisions and the person as decided_by. transition_cases pin the reference inbox on a scripted sequence - takes, a decision, a seen, an expiry sweep, two replays - as the rows each step leaves and the final rows, ids and change sequence included: a wait upserts on (graph_id, correlation_id, turn), an advice appends, every write bumps the sequence a replay reads from. Version 2 (the live drive of step 5) adds the rule of two devices on one card: a decision's write applies when the row is still open or when the engine accepted the decision (answered), so an acceptance always wins the row and a nothing-waiting that lands after one never overwrites it - the losing device gets the row as it stands. No HTTP is exchanged by these cases; the routes are tested by each pack in-process.",
5
5
"row_cases": [
6
6
{
7
7
"name": "an approval",
@@ -1042,6 +1042,158 @@
1042
1042
"outcome": null
1043
1043
}
1044
1044
]
1045
+
},
1046
+
{
1047
+
"name": "two devices on one card - the first accepted decision stands",
1048
+
"steps": [
1049
+
{
1050
+
"op": "take",
1051
+
"event": {
1052
+
"kind": "approval",
1053
+
"graph_id": "order-assistant",
1054
+
"description": "Customer-support assistant: a refund waits for a supervisor",
1055
+
"correlation_id": "order-1004-case",
1056
+
"turn": 2,
1057
+
"node": "assist",
1058
+
"summary": "A refund waits for the supervisor's decision",
1059
+
"calls": [
1060
+
{
1061
+
"id": "toolu_01A",
1062
+
"name": "issue_refund",
1063
+
"route": "demo.refund.issue",
1064
+
"wait": true,
1065
+
"input": {
1066
+
"order_id": "ORD-1004",
1067
+
"amount": 240.0,
1068
+
"reason": "Shipment lost in transit"
1069
+
}
1070
+
}
1071
+
],
1072
+
"ttl": "2d",
1073
+
"requested_at": "2026-11-19T10:00:00.000Z",
1074
+
"expires_at": "2026-11-21T10:00:00.000Z",
1075
+
"ticket": "v1.two.mac",
1076
+
"link": "https://ask.example.test/ask/v1.two.mac"
1077
+
},
1078
+
"now": "2026-11-19T10:00:00.200Z"
1079
+
},
1080
+
{
1081
+
"op": "decided",
1082
+
"id": 1,
1083
+
"decisions": [
1084
+
{
1085
+
"id": "toolu_01A",
1086
+
"approved": true,
1087
+
"note": "from device-2"
1088
+
}
1089
+
],
1090
+
"who": "device-2",
1091
+
"status": 410,
1092
+
"body": {
1093
+
"type": "nothing-waiting",
1094
+
"run": "fresh"
1095
+
},
1096
+
"now": "2026-11-19T10:00:01.000Z",
1097
+
"note": "two devices clicked at once; the engine took the other one's decision, so this one got nothing-waiting, and it lands first: the open row turns expired for a moment"
1098
+
},
1099
+
{
1100
+
"op": "decided",
1101
+
"id": 1,
1102
+
"decisions": [
1103
+
{
1104
+
"id": "toolu_01A",
1105
+
"approved": true,
1106
+
"note": "from device-1"
1107
+
}
1108
+
],
1109
+
"who": "device-1",
1110
+
"status": 200,
1111
+
"body": {
1112
+
"type": "answer",
1113
+
"turn": 3
1114
+
},
1115
+
"now": "2026-11-19T10:00:02.000Z",
1116
+
"note": "the accepted decision always wins the row"
1117
+
},
1118
+
{
1119
+
"op": "decided",
1120
+
"id": 1,
1121
+
"decisions": [
1122
+
{
1123
+
"id": "toolu_01A",
1124
+
"approved": false
1125
+
}
1126
+
],
1127
+
"who": "device-3",
1128
+
"status": 410,
1129
+
"body": {
1130
+
"type": "nothing-waiting",
1131
+
"run": "fresh"
1132
+
},
1133
+
"now": "2026-11-19T10:00:03.000Z",
1134
+
"note": "a nothing-waiting after the acceptance changes nothing: the row stands as device-1 left it and the sequence does not move"
0 commit comments