@moonbeam-foundation/sdk 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +17 -0
- package/README.md +378 -0
- package/bin/moonbeam.mjs +56 -0
- package/dist/acp/coverage.d.ts +36 -0
- package/dist/acp/coverage.d.ts.map +1 -0
- package/dist/acp/coverage.js +51 -0
- package/dist/acp/coverage.js.map +1 -0
- package/dist/acp/events.d.ts +201 -0
- package/dist/acp/events.d.ts.map +1 -0
- package/dist/acp/events.js +201 -0
- package/dist/acp/events.js.map +1 -0
- package/dist/acp/hex.d.ts +29 -0
- package/dist/acp/hex.d.ts.map +1 -0
- package/dist/acp/hex.js +51 -0
- package/dist/acp/hex.js.map +1 -0
- package/dist/acp/lifecycle-types.d.ts +11 -0
- package/dist/acp/lifecycle-types.d.ts.map +1 -0
- package/dist/acp/lifecycle-types.js +8 -0
- package/dist/acp/lifecycle-types.js.map +1 -0
- package/dist/acp/lifecycle.d.ts +78 -0
- package/dist/acp/lifecycle.d.ts.map +1 -0
- package/dist/acp/lifecycle.js +224 -0
- package/dist/acp/lifecycle.js.map +1 -0
- package/dist/acp/outcome.d.ts +45 -0
- package/dist/acp/outcome.d.ts.map +1 -0
- package/dist/acp/outcome.js +104 -0
- package/dist/acp/outcome.js.map +1 -0
- package/dist/acp/pipeline.d.ts +30 -0
- package/dist/acp/pipeline.d.ts.map +1 -0
- package/dist/acp/pipeline.js +25 -0
- package/dist/acp/pipeline.js.map +1 -0
- package/dist/acp/recourse.d.ts +74 -0
- package/dist/acp/recourse.d.ts.map +1 -0
- package/dist/acp/recourse.js +234 -0
- package/dist/acp/recourse.js.map +1 -0
- package/dist/acp/registry.d.ts +62 -0
- package/dist/acp/registry.d.ts.map +1 -0
- package/dist/acp/registry.js +86 -0
- package/dist/acp/registry.js.map +1 -0
- package/dist/acp/transitions.d.ts +82 -0
- package/dist/acp/transitions.d.ts.map +1 -0
- package/dist/acp/transitions.js +106 -0
- package/dist/acp/transitions.js.map +1 -0
- package/dist/actors/index.d.ts +84 -0
- package/dist/actors/index.d.ts.map +1 -0
- package/dist/actors/index.js +133 -0
- package/dist/actors/index.js.map +1 -0
- package/dist/actors/track-record.d.ts +79 -0
- package/dist/actors/track-record.d.ts.map +1 -0
- package/dist/actors/track-record.js +105 -0
- package/dist/actors/track-record.js.map +1 -0
- package/dist/adapters/acp.d.ts +48 -0
- package/dist/adapters/acp.d.ts.map +1 -0
- package/dist/adapters/acp.js +74 -0
- package/dist/adapters/acp.js.map +1 -0
- package/dist/adapters/port.d.ts +53 -0
- package/dist/adapters/port.d.ts.map +1 -0
- package/dist/adapters/port.js +2 -0
- package/dist/adapters/port.js.map +1 -0
- package/dist/adapters/stamp.d.ts +57 -0
- package/dist/adapters/stamp.d.ts.map +1 -0
- package/dist/adapters/stamp.js +114 -0
- package/dist/adapters/stamp.js.map +1 -0
- package/dist/client/index.d.ts +123 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +78 -0
- package/dist/client/index.js.map +1 -0
- package/dist/connect/attestation.d.ts +64 -0
- package/dist/connect/attestation.d.ts.map +1 -0
- package/dist/connect/attestation.js +62 -0
- package/dist/connect/attestation.js.map +1 -0
- package/dist/connect/http.d.ts +36 -0
- package/dist/connect/http.d.ts.map +1 -0
- package/dist/connect/http.js +51 -0
- package/dist/connect/http.js.map +1 -0
- package/dist/connect/logs.d.ts +53 -0
- package/dist/connect/logs.d.ts.map +1 -0
- package/dist/connect/logs.js +42 -0
- package/dist/connect/logs.js.map +1 -0
- package/dist/connect/result.d.ts +49 -0
- package/dist/connect/result.d.ts.map +1 -0
- package/dist/connect/result.js +41 -0
- package/dist/connect/result.js.map +1 -0
- package/dist/core/actors.d.ts +13 -0
- package/dist/core/actors.d.ts.map +1 -0
- package/dist/core/actors.js +57 -0
- package/dist/core/actors.js.map +1 -0
- package/dist/core/clock.d.ts +55 -0
- package/dist/core/clock.d.ts.map +1 -0
- package/dist/core/clock.js +36 -0
- package/dist/core/clock.js.map +1 -0
- package/dist/core/money.d.ts +32 -0
- package/dist/core/money.d.ts.map +1 -0
- package/dist/core/money.js +57 -0
- package/dist/core/money.js.map +1 -0
- package/dist/core/pool.d.ts +71 -0
- package/dist/core/pool.d.ts.map +1 -0
- package/dist/core/pool.js +98 -0
- package/dist/core/pool.js.map +1 -0
- package/dist/core/settle.d.ts +50 -0
- package/dist/core/settle.d.ts.map +1 -0
- package/dist/core/settle.js +175 -0
- package/dist/core/settle.js.map +1 -0
- package/dist/core/types.d.ts +109 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +6 -0
- package/dist/core/types.js.map +1 -0
- package/dist/erc8004/index.d.ts +94 -0
- package/dist/erc8004/index.d.ts.map +1 -0
- package/dist/erc8004/index.js +118 -0
- package/dist/erc8004/index.js.map +1 -0
- package/dist/erc8004/registry.generated.d.ts +17 -0
- package/dist/erc8004/registry.generated.d.ts.map +1 -0
- package/dist/erc8004/registry.generated.js +20 -0
- package/dist/erc8004/registry.generated.js.map +1 -0
- package/dist/erc8183/index.d.ts +114 -0
- package/dist/erc8183/index.d.ts.map +1 -0
- package/dist/erc8183/index.js +109 -0
- package/dist/erc8183/index.js.map +1 -0
- package/dist/index.d.ts +81 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +73 -0
- package/dist/index.js.map +1 -0
- package/dist/judge/index.d.ts +64 -0
- package/dist/judge/index.d.ts.map +1 -0
- package/dist/judge/index.js +64 -0
- package/dist/judge/index.js.map +1 -0
- package/dist/launcher/index.d.ts +109 -0
- package/dist/launcher/index.d.ts.map +1 -0
- package/dist/launcher/index.js +144 -0
- package/dist/launcher/index.js.map +1 -0
- package/dist/negotiate/index.d.ts +166 -0
- package/dist/negotiate/index.d.ts.map +1 -0
- package/dist/negotiate/index.js +150 -0
- package/dist/negotiate/index.js.map +1 -0
- package/dist/onboard/index.d.ts +533 -0
- package/dist/onboard/index.d.ts.map +1 -0
- package/dist/onboard/index.js +509 -0
- package/dist/onboard/index.js.map +1 -0
- package/dist/onboarding/index.d.ts +177 -0
- package/dist/onboarding/index.d.ts.map +1 -0
- package/dist/onboarding/index.js +390 -0
- package/dist/onboarding/index.js.map +1 -0
- package/dist/pools/index.d.ts +191 -0
- package/dist/pools/index.d.ts.map +1 -0
- package/dist/pools/index.js +244 -0
- package/dist/pools/index.js.map +1 -0
- package/docs/demo.gif +0 -0
- package/docs/demo.tape +14 -0
- package/examples/01-settle-a-covered-job.mjs +18 -0
- package/examples/02-negotiate-a-hire.mjs +21 -0
- package/examples/03-end-to-end-offline.mjs +27 -0
- package/examples/10-grade-evidence.mjs +12 -0
- package/examples/11-grade-facts.mjs +10 -0
- package/examples/12-grade-answers.mjs +8 -0
- package/examples/13-grade-verdict.mjs +10 -0
- package/examples/14-grade-record.mjs +11 -0
- package/examples/15-grade-end-the-job.mjs +11 -0
- package/examples/16-grade-verify.mjs +9 -0
- package/examples/17-grade-live.mjs +14 -0
- package/examples/20-onboard-client.mjs +8 -0
- package/examples/21-onboard-provider.mjs +9 -0
- package/examples/22-onboard-evaluator.mjs +7 -0
- package/examples/23-onboard-backer.mjs +8 -0
- package/examples/30-read-a-real-job.mjs +19 -0
- package/examples/31-read-the-ending.mjs +15 -0
- package/examples/32-read-live-from-base.mjs +33 -0
- package/examples/33-read-many-jobs.mjs +12 -0
- package/examples/40-the-article.mjs +78 -0
- package/examples/README.md +93 -0
- package/examples/data/answers.mjs +8 -0
- package/examples/data/base-grade.recorded.json +72 -0
- package/examples/data/pilot-grade.recorded.json +78 -0
- package/examples/data/pilot-hire.json +35 -0
- package/examples/data/terms.mjs +11 -0
- package/examples/data/virtuals-job-74926.json +74 -0
- package/examples/data/virtuals-job-rejected.json +74 -0
- package/package.json +124 -0
- package/skills/moonbeam-acp-decoding/SKILL.md +80 -0
- package/skills/moonbeam-actor-backer/SKILL.md +81 -0
- package/skills/moonbeam-actor-challenger/SKILL.md +62 -0
- package/skills/moonbeam-actor-client/SKILL.md +67 -0
- package/skills/moonbeam-actor-doubter/SKILL.md +55 -0
- package/skills/moonbeam-actor-evaluator/SKILL.md +67 -0
- package/skills/moonbeam-actor-provider/SKILL.md +63 -0
- package/skills/moonbeam-assurance/SKILL.md +58 -0
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { expiryOf } from '../core/clock.js';
|
|
2
|
+
import { phaseOf } from './lifecycle.js';
|
|
3
|
+
import { toOutcome } from './outcome.js';
|
|
4
|
+
const WAIT = { id: 'wait', by: 'anyone', why: 'nothing to do yet', settles: false };
|
|
5
|
+
/**
|
|
6
|
+
* Waiting is not recourse.
|
|
7
|
+
*
|
|
8
|
+
* `wait` is `by: 'anyone'`, so counting it as an action a party can take made
|
|
9
|
+
* the stranding check unfalsifiable — every role always had `wait` in `mine`,
|
|
10
|
+
* so "this party has nothing it can do" could never be true, and the liveness
|
|
11
|
+
* proof certified `noLockout` for a job whose funds were genuinely frozen.
|
|
12
|
+
*/
|
|
13
|
+
function isRealAction(action) {
|
|
14
|
+
return action.id !== 'wait';
|
|
15
|
+
}
|
|
16
|
+
/** Everything that could be done next on this job, regardless of who you are. */
|
|
17
|
+
export function availableActions(state, clock) {
|
|
18
|
+
const outcome = toOutcome(state, clock);
|
|
19
|
+
if (outcome.verdict !== null)
|
|
20
|
+
return []; // settled: nothing left to do
|
|
21
|
+
const expiry = expiryOf(state.deadline, clock);
|
|
22
|
+
const actions = [];
|
|
23
|
+
const phase = phaseOf(state, clock);
|
|
24
|
+
if (phase === 'awaitingAdjudication') {
|
|
25
|
+
actions.push({
|
|
26
|
+
id: 'adjudicate',
|
|
27
|
+
by: 'arbitrator',
|
|
28
|
+
why: 'a dispute is open and only an arbitrator can resolve it',
|
|
29
|
+
settles: true,
|
|
30
|
+
});
|
|
31
|
+
return actions;
|
|
32
|
+
}
|
|
33
|
+
// An adjudication naming somebody who is neither party leaves the escrow in
|
|
34
|
+
// a terminal state that yields no verdict. Previously every branch below fell
|
|
35
|
+
// through and the job silently became unresolvable, so the arbitrator is
|
|
36
|
+
// named as the only party who can put it right.
|
|
37
|
+
if (state.adjudicatedWinner && toOutcome(state, clock).verdict === null) {
|
|
38
|
+
actions.push({
|
|
39
|
+
id: 'adjudicate',
|
|
40
|
+
by: 'arbitrator',
|
|
41
|
+
why: 'the recorded winner is neither party, so only a corrected ruling can settle this',
|
|
42
|
+
settles: true,
|
|
43
|
+
});
|
|
44
|
+
return actions;
|
|
45
|
+
}
|
|
46
|
+
// Likewise a close reason this build does not recognise: it cannot be turned
|
|
47
|
+
// into a verdict, so say who can resolve it rather than offering nothing.
|
|
48
|
+
if (state.work === 'closed' && toOutcome(state, clock).verdict === null) {
|
|
49
|
+
actions.push({
|
|
50
|
+
id: 'adjudicate',
|
|
51
|
+
by: 'arbitrator',
|
|
52
|
+
why: 'the job closed for a reason this build cannot interpret',
|
|
53
|
+
settles: true,
|
|
54
|
+
});
|
|
55
|
+
return actions;
|
|
56
|
+
}
|
|
57
|
+
if (state.escrow === 'none') {
|
|
58
|
+
actions.push({ id: 'fund', by: 'client', why: 'the job is not funded yet', settles: false });
|
|
59
|
+
return actions;
|
|
60
|
+
}
|
|
61
|
+
if (state.escrow === 'locked') {
|
|
62
|
+
if (state.work !== 'submitted' && state.work !== 'graded') {
|
|
63
|
+
actions.push({ id: 'deliver', by: 'provider', why: 'work has not been delivered', settles: false });
|
|
64
|
+
}
|
|
65
|
+
if (state.work === 'submitted') {
|
|
66
|
+
actions.push({ id: 'grade', by: 'evaluator', why: 'a deliverable is waiting to be graded', settles: false });
|
|
67
|
+
actions.push({ id: 'release', by: 'client', why: 'the client can accept the delivery', settles: true });
|
|
68
|
+
}
|
|
69
|
+
if (expiry.state === 'expired') {
|
|
70
|
+
// The keystone: permissionless, so a silent counterparty cannot block it.
|
|
71
|
+
actions.push({
|
|
72
|
+
id: 'claimRefund',
|
|
73
|
+
by: 'anyone',
|
|
74
|
+
why: 'the deadline has passed and the refund is claimable by anyone',
|
|
75
|
+
settles: true,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
// Either party can always escalate rather than wait forever.
|
|
79
|
+
actions.push({
|
|
80
|
+
id: 'dispute',
|
|
81
|
+
by: 'client',
|
|
82
|
+
why: 'the client can escalate to arbitration',
|
|
83
|
+
settles: false,
|
|
84
|
+
});
|
|
85
|
+
actions.push({
|
|
86
|
+
id: 'dispute',
|
|
87
|
+
by: 'provider',
|
|
88
|
+
why: 'the provider can escalate rather than wait on a silent client',
|
|
89
|
+
settles: false,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
return actions.length > 0 ? actions : [WAIT];
|
|
93
|
+
}
|
|
94
|
+
/** What a given party can do, what they are waiting on, and their way out. */
|
|
95
|
+
export function recourseFor(role, state, clock) {
|
|
96
|
+
const available = availableActions(state, clock);
|
|
97
|
+
const mine = available.filter((a) => a.by === role || a.by === 'anyone');
|
|
98
|
+
// A guaranteed exit is an action that settles the job and that this party can
|
|
99
|
+
// take without anyone else's cooperation.
|
|
100
|
+
const guaranteedExit = mine.find((a) => a.settles && (a.by === 'anyone' || a.by === role));
|
|
101
|
+
// Derived from the job's phase rather than from whichever action happened to
|
|
102
|
+
// be pushed first — that made the answer an artefact of source-line order,
|
|
103
|
+
// and told uninvolved roles they were "blocked on" a party at random.
|
|
104
|
+
const blockedOn = mine.some(isRealAction) ? undefined : waitingOn(state, clock) ?? undefined;
|
|
105
|
+
return {
|
|
106
|
+
available,
|
|
107
|
+
mine,
|
|
108
|
+
...(blockedOn ? { blockedOn } : {}),
|
|
109
|
+
...(guaranteedExit ? { guaranteedExit } : {}),
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Who has capital in this job, and therefore who can be stranded.
|
|
114
|
+
*
|
|
115
|
+
* This used to be the literal `['client', 'provider']`, which meant the
|
|
116
|
+
* no-lockout proof — the protocol's headline safety claim — never looked at the
|
|
117
|
+
* evaluator, the pool, the doubter or the challenger. Each of those posts
|
|
118
|
+
* capital (bond, pool capital, doubt fee, challenge bond), so `noLockout: true`
|
|
119
|
+
* was really "neither of two parties is stranded", reported as "nobody is".
|
|
120
|
+
*
|
|
121
|
+
* Which parties are exposed is a property of the job, not a constant: a job
|
|
122
|
+
* whose evaluator has not yet graded cannot strand that evaluator, and
|
|
123
|
+
* reporting on a party that has put up nothing would invent exposure that does
|
|
124
|
+
* not exist.
|
|
125
|
+
*
|
|
126
|
+
* The list stops at the roles a `TaskState` can actually evidence. `TaskState`
|
|
127
|
+
* is folded from Virtuals ACP logs, and the assurance layer (pool, doubter,
|
|
128
|
+
* challenger) does not settle on that ledger — so this state carries no fact
|
|
129
|
+
* about whether cover was bought or a doubt position taken. Deriving those
|
|
130
|
+
* roles from it would mean guessing, and a liveness proof that guesses at who
|
|
131
|
+
* is exposed is worth less than one that says what it checked. `checked` on the
|
|
132
|
+
* report names the covered set so a caller can see the limit rather than infer
|
|
133
|
+
* a stronger claim; extending it is gated on decoding assurance-side events,
|
|
134
|
+
* not on adding names here.
|
|
135
|
+
*/
|
|
136
|
+
function partiesAtRisk(state) {
|
|
137
|
+
// The client's money and the provider's deposit are both inside a locked
|
|
138
|
+
// escrow; neither can withdraw unilaterally.
|
|
139
|
+
const parties = ['client', 'provider'];
|
|
140
|
+
// An evaluator that has graded has put its bond behind a specific verdict and
|
|
141
|
+
// is exposed until the job ends. One that has not graded has posted nothing
|
|
142
|
+
// to this job and is free to walk away.
|
|
143
|
+
if (state.work === 'graded')
|
|
144
|
+
parties.push('evaluator');
|
|
145
|
+
return parties;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Check the no-lockout property against real state.
|
|
149
|
+
*
|
|
150
|
+
* A party counts as stranded only if the job is unsettled, they can take no
|
|
151
|
+
* action, and they have no escalation path. Waiting on an arbitrator is not
|
|
152
|
+
* stranding: the dispute has already been raised and an outcome is coming.
|
|
153
|
+
*/
|
|
154
|
+
export function livenessOf(state, clock) {
|
|
155
|
+
const outcome = toOutcome(state, clock);
|
|
156
|
+
const notes = [];
|
|
157
|
+
if (outcome.verdict !== null) {
|
|
158
|
+
return {
|
|
159
|
+
noLockout: true,
|
|
160
|
+
stranded: [],
|
|
161
|
+
notes: ['job is settled; no party is waiting'],
|
|
162
|
+
checked: [],
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
// Nothing is escrowed yet, so nobody's money is exposed and nobody can be
|
|
166
|
+
// stranded. A provider waiting on a client to fund is simply not engaged: it
|
|
167
|
+
// has committed nothing and can walk away at no cost. Lockout is about funds
|
|
168
|
+
// being held hostage, not about a job that never started.
|
|
169
|
+
if (state.escrow === 'none') {
|
|
170
|
+
return {
|
|
171
|
+
noLockout: true,
|
|
172
|
+
stranded: [],
|
|
173
|
+
notes: ['nothing is escrowed yet: no party has funds exposed, so none can be held hostage'],
|
|
174
|
+
checked: [],
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
const parties = partiesAtRisk(state);
|
|
178
|
+
const stranded = [];
|
|
179
|
+
for (const role of parties) {
|
|
180
|
+
const r = recourseFor(role, state, clock);
|
|
181
|
+
// `wait` is excluded deliberately: it is the absence of an action, and
|
|
182
|
+
// counting it made this check incapable of ever reporting a stranded party.
|
|
183
|
+
const canAct = r.mine.some(isRealAction);
|
|
184
|
+
const arbitrationPending = r.available.some((a) => a.id === 'adjudicate');
|
|
185
|
+
if (!canAct && !arbitrationPending) {
|
|
186
|
+
stranded.push(role);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
const expiry = expiryOf(state.deadline, clock);
|
|
190
|
+
if (expiry.state === 'expired' && state.escrow === 'locked') {
|
|
191
|
+
notes.push('refund is claimable by anyone: a silent counterparty cannot hold the funds');
|
|
192
|
+
}
|
|
193
|
+
if (state.disputed) {
|
|
194
|
+
notes.push('dispute raised: an arbitrator must resolve it, and either party could raise it');
|
|
195
|
+
}
|
|
196
|
+
if (state.escrow === 'locked' && expiry.state === 'live') {
|
|
197
|
+
notes.push('within the deadline: both parties can still act, and either can escalate');
|
|
198
|
+
}
|
|
199
|
+
notes.push(`checked ${parties.join(', ')}`);
|
|
200
|
+
return { noLockout: stranded.length === 0, stranded, notes, checked: parties };
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Who, if anyone, currently holds the job up.
|
|
204
|
+
*
|
|
205
|
+
* Derived from the job's phase so it cannot disagree with `blockedOn`, which
|
|
206
|
+
* asks the same question. The two used to answer it with independent rules.
|
|
207
|
+
*/
|
|
208
|
+
export function waitingOn(state, clock) {
|
|
209
|
+
switch (phaseOf(state, clock)) {
|
|
210
|
+
case 'settled':
|
|
211
|
+
case 'contradictory':
|
|
212
|
+
return null;
|
|
213
|
+
case 'awaitingAdjudication':
|
|
214
|
+
return 'arbitrator';
|
|
215
|
+
case 'awaitingGrading':
|
|
216
|
+
return 'evaluator';
|
|
217
|
+
case 'awaitingDelivery':
|
|
218
|
+
return 'provider';
|
|
219
|
+
case 'notStarted':
|
|
220
|
+
case 'awaitingFunding':
|
|
221
|
+
return 'client';
|
|
222
|
+
case 'refundClaimable':
|
|
223
|
+
// Nobody is blocking: the refund is permissionless, so anyone may end it.
|
|
224
|
+
return null;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
/** Convenience for UIs: is this address a party to the job at all? */
|
|
228
|
+
export function isParty(state, address) {
|
|
229
|
+
const a = address.toLowerCase();
|
|
230
|
+
return [state.client, state.provider, state.evaluator]
|
|
231
|
+
.filter(Boolean)
|
|
232
|
+
.some((p) => p.toLowerCase() === a);
|
|
233
|
+
}
|
|
234
|
+
//# sourceMappingURL=recourse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recourse.js","sourceRoot":"","sources":["../../src/acp/recourse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAK5C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAsDzC,MAAM,IAAI,GAAW,EAAE,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AW,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5C,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AACjF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,KAAgB,EAAE,KAAY;IACtD,QAAQ,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC;QAC9B,KAAK,SAAS,CAAC;QACf,KAAK,eAAe;YAClB,OAAO,IAAI,CAAC;QACd,KAAK,sBAAsB;YACzB,OAAO,YAAY,CAAC;QACtB,KAAK,iBAAiB;YACpB,OAAO,WAAW,CAAC;QACrB,KAAK,kBAAkB;YACrB,OAAO,UAAU,CAAC;QACpB,KAAK,YAAY,CAAC;QAClB,KAAK,iBAAiB;YACpB,OAAO,QAAQ,CAAC;QAClB,KAAK,iBAAiB;YACpB,0EAA0E;YAC1E,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,OAAO,CAAC,KAAgB,EAAE,OAAgB;IACxD,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;SACnD,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAE,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ACP_TOPIC0 } from './events.js';
|
|
2
|
+
import type { Hex } from './hex.js';
|
|
3
|
+
/**
|
|
4
|
+
* The decoder's own account of what it watches.
|
|
5
|
+
*
|
|
6
|
+
* A proof layer indexing these events needs the same topic list the decoder
|
|
7
|
+
* uses, and the two drifting apart is the failure that hurts most: the indexer
|
|
8
|
+
* quietly stops capturing an event, the decoder still knows about it, and job
|
|
9
|
+
* histories develop holes that nothing reports. So rather than each side
|
|
10
|
+
* keeping a hand-written copy, the decoder publishes its watch list and the
|
|
11
|
+
* indexer reads it.
|
|
12
|
+
*
|
|
13
|
+
* Note the two systems named "ACP" have different lifecycle *shapes*, not just
|
|
14
|
+
* different addresses. Anything pairing with this must key on both.
|
|
15
|
+
*/
|
|
16
|
+
export type LedgerId = 'virtuals-acp' | 'moonbeam-acp';
|
|
17
|
+
export interface WatchedEvent {
|
|
18
|
+
/** Key in ACP_TOPIC0 / ACP_SIGNATURES. */
|
|
19
|
+
readonly name: keyof typeof ACP_TOPIC0;
|
|
20
|
+
readonly topic0: Hex;
|
|
21
|
+
readonly signature: string;
|
|
22
|
+
readonly ledger: LedgerId;
|
|
23
|
+
/** Opens a job's lifecycle. */
|
|
24
|
+
readonly opens: boolean;
|
|
25
|
+
/** Ends it — the events a proof layer must never miss. */
|
|
26
|
+
readonly terminal: boolean;
|
|
27
|
+
}
|
|
28
|
+
/** Every event this decoder recognises, with its role in the lifecycle. */
|
|
29
|
+
export declare const WATCHED_EVENTS: readonly WatchedEvent[];
|
|
30
|
+
/** Everything an indexer must subscribe to for histories to be complete. */
|
|
31
|
+
export declare function watchedTopics(ledger?: LedgerId): readonly Hex[];
|
|
32
|
+
/** The events whose loss would silently leave jobs looking unsettled. */
|
|
33
|
+
export declare function terminalTopics(ledger?: LedgerId): readonly Hex[];
|
|
34
|
+
export interface LedgerSpec {
|
|
35
|
+
readonly id: LedgerId;
|
|
36
|
+
readonly chainId: number;
|
|
37
|
+
/** Known address, where there is one. Decoding never depends on it. */
|
|
38
|
+
readonly address?: Hex;
|
|
39
|
+
readonly deployed: boolean;
|
|
40
|
+
readonly note: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Where each lifecycle actually lives.
|
|
44
|
+
*
|
|
45
|
+
* Decoding is address-agnostic by design, so these are for indexers choosing
|
|
46
|
+
* what to subscribe to — not for the decoder, which matches on topic alone and
|
|
47
|
+
* therefore survives redeployment.
|
|
48
|
+
*/
|
|
49
|
+
export declare const LEDGERS: readonly LedgerSpec[];
|
|
50
|
+
/**
|
|
51
|
+
* A description of the watch list for a proof layer to consume.
|
|
52
|
+
*
|
|
53
|
+
* Deliberately plain data: an indexer in another language should be able to
|
|
54
|
+
* read this without sharing types with the SDK, and a mismatch should be
|
|
55
|
+
* visible by diffing rather than by reasoning.
|
|
56
|
+
*/
|
|
57
|
+
export declare function watchManifest(): {
|
|
58
|
+
readonly ledgers: readonly LedgerSpec[];
|
|
59
|
+
readonly events: readonly WatchedEvent[];
|
|
60
|
+
readonly terminalTopics: readonly Hex[];
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/acp/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,UAAU,EAA+C,MAAM,aAAa,CAAC;AACtG,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEpC;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,QAAQ,GAAG,cAAc,GAAG,cAAc,CAAC;AAEvD,MAAM,WAAW,YAAY;IAC3B,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,OAAO,UAAU,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC1B,+BAA+B;IAC/B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,0DAA0D;IAC1D,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAoCD,2EAA2E;AAC3E,eAAO,MAAM,cAAc,EAAE,SAAS,YAAY,EASjD,CAAC;AAEF,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,EAAE,CAE/D;AAED,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,EAAE,CAEhE;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,QAAQ,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,EAAE,SAAS,UAAU,EAcvC,CAAC;AAEH;;;;;;GAMG;AACH,wBAAgB,aAAa,IAAI;IAC/B,QAAQ,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;IACzC,QAAQ,CAAC,cAAc,EAAE,SAAS,GAAG,EAAE,CAAC;CACzC,CAMA"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { ACP_SIGNATURES, ACP_TOPIC0, VIRTUALS_ACP_ADDRESS, VIRTUALS_ACP_CHAIN_ID } from './events.js';
|
|
2
|
+
const VIRTUALS = [
|
|
3
|
+
'jobCreated',
|
|
4
|
+
'budgetSet',
|
|
5
|
+
'jobFunded',
|
|
6
|
+
'jobSubmitted',
|
|
7
|
+
'jobCompleted',
|
|
8
|
+
'jobRejected',
|
|
9
|
+
'jobExpired',
|
|
10
|
+
'paymentReleased',
|
|
11
|
+
'jobRefunded',
|
|
12
|
+
'evaluatorFeePaid',
|
|
13
|
+
];
|
|
14
|
+
const OPENS = new Set(['jobCreated', 'taskOpened', 'locked']);
|
|
15
|
+
/**
|
|
16
|
+
* Events after which no further settlement is possible.
|
|
17
|
+
*
|
|
18
|
+
* These are the ones an indexer must capture without exception: miss an
|
|
19
|
+
* opening event and a job is invisible, which is obvious. Miss a *terminal*
|
|
20
|
+
* event and the job looks permanently unsettled, which is not.
|
|
21
|
+
*/
|
|
22
|
+
const TERMINAL = new Set([
|
|
23
|
+
'jobCompleted',
|
|
24
|
+
'jobRejected',
|
|
25
|
+
'jobExpired',
|
|
26
|
+
'paymentReleased',
|
|
27
|
+
'jobRefunded',
|
|
28
|
+
'taskClosed',
|
|
29
|
+
'released',
|
|
30
|
+
'refunded',
|
|
31
|
+
'adjudicated',
|
|
32
|
+
]);
|
|
33
|
+
/** Every event this decoder recognises, with its role in the lifecycle. */
|
|
34
|
+
export const WATCHED_EVENTS = Object.freeze(Object.keys(ACP_TOPIC0).map((name) => ({
|
|
35
|
+
name,
|
|
36
|
+
topic0: ACP_TOPIC0[name],
|
|
37
|
+
signature: ACP_SIGNATURES[name],
|
|
38
|
+
ledger: (VIRTUALS.includes(name) ? 'virtuals-acp' : 'moonbeam-acp'),
|
|
39
|
+
opens: OPENS.has(name),
|
|
40
|
+
terminal: TERMINAL.has(name),
|
|
41
|
+
})));
|
|
42
|
+
/** Everything an indexer must subscribe to for histories to be complete. */
|
|
43
|
+
export function watchedTopics(ledger) {
|
|
44
|
+
return WATCHED_EVENTS.filter((e) => !ledger || e.ledger === ledger).map((e) => e.topic0);
|
|
45
|
+
}
|
|
46
|
+
/** The events whose loss would silently leave jobs looking unsettled. */
|
|
47
|
+
export function terminalTopics(ledger) {
|
|
48
|
+
return WATCHED_EVENTS.filter((e) => e.terminal && (!ledger || e.ledger === ledger)).map((e) => e.topic0);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Where each lifecycle actually lives.
|
|
52
|
+
*
|
|
53
|
+
* Decoding is address-agnostic by design, so these are for indexers choosing
|
|
54
|
+
* what to subscribe to — not for the decoder, which matches on topic alone and
|
|
55
|
+
* therefore survives redeployment.
|
|
56
|
+
*/
|
|
57
|
+
export const LEDGERS = Object.freeze([
|
|
58
|
+
{
|
|
59
|
+
id: 'virtuals-acp',
|
|
60
|
+
chainId: VIRTUALS_ACP_CHAIN_ID,
|
|
61
|
+
address: VIRTUALS_ACP_ADDRESS,
|
|
62
|
+
deployed: true,
|
|
63
|
+
note: 'live agent-commerce traffic; an upgradeable proxy, so index by topic rather than by implementation',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: 'moonbeam-acp',
|
|
67
|
+
chainId: 84532,
|
|
68
|
+
deployed: false,
|
|
69
|
+
note: 'assurance-side escrow and task space; test networks only, no mainnet deployment',
|
|
70
|
+
},
|
|
71
|
+
]);
|
|
72
|
+
/**
|
|
73
|
+
* A description of the watch list for a proof layer to consume.
|
|
74
|
+
*
|
|
75
|
+
* Deliberately plain data: an indexer in another language should be able to
|
|
76
|
+
* read this without sharing types with the SDK, and a mismatch should be
|
|
77
|
+
* visible by diffing rather than by reasoning.
|
|
78
|
+
*/
|
|
79
|
+
export function watchManifest() {
|
|
80
|
+
return {
|
|
81
|
+
ledgers: LEDGERS,
|
|
82
|
+
events: WATCHED_EVENTS,
|
|
83
|
+
terminalTopics: terminalTopics(),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/acp/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AA+BtG,MAAM,QAAQ,GAAyC;IACrD,YAAY;IACZ,WAAW;IACX,WAAW;IACX,cAAc;IACd,cAAc;IACd,aAAa;IACb,YAAY;IACZ,iBAAiB;IACjB,aAAa;IACb,kBAAkB;CACnB,CAAC;AAEF,MAAM,KAAK,GAAwB,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,YAAY,EAAE,QA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,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAC3G,CAAC;AAWD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,OAAO,GAA0B,MAAM,CAAC,MAAM,CAAC;IAC1D;QACE,EAAE,EAAE,cAAc;QAClB,OAAO,EAAE,qBAAqB;QAC9B,OAAO,EAAE,oBAAoB;QAC7B,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,oGAAoG;KAC3G;IACD;QACE,EAAE,EAAE,cAAc;QAClB,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,iFAAiF;KACxF;CACF,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,aAAa;IAK3B,OAAO;QACL,OAAO,EAAE,OAAO;QAChB,MAAM,EAAE,cAAc;QACtB,cAAc,EAAE,cAAc,EAAE;KACjC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The transition table — the one place that says what a job may do next.
|
|
3
|
+
*
|
|
4
|
+
* Before this module existed the lifecycle was implicit: monotonic ranks in the
|
|
5
|
+
* fold said *what may follow what*, an if-branch cascade in the outcome said
|
|
6
|
+
* *which fact wins*, and a third set of branches said *who may act*. Three
|
|
7
|
+
* partial machines, none of them owning legality, and they disagreed.
|
|
8
|
+
*
|
|
9
|
+
* Ranks alone cannot express the rule that actually matters here. A lifecycle
|
|
10
|
+
* is not a line, it is a shape with several ends: an escrow can be released, or
|
|
11
|
+
* refunded, or adjudicated, and those are *mutually exclusive* rather than
|
|
12
|
+
* ordered. A total order has no way to say "these two may never both be true",
|
|
13
|
+
* so a tie between them silently degenerated into last-write-wins — and the
|
|
14
|
+
* arrival order of logs decided who got paid.
|
|
15
|
+
*
|
|
16
|
+
* So this table answers two separate questions:
|
|
17
|
+
*
|
|
18
|
+
* ranks — what may follow what (progress)
|
|
19
|
+
* terminality — what may coexist (exclusivity)
|
|
20
|
+
*
|
|
21
|
+
* Only the first was ever written down.
|
|
22
|
+
*/
|
|
23
|
+
import type { EscrowStatus, WorkStatus } from './lifecycle-types.js';
|
|
24
|
+
/**
|
|
25
|
+
* How far along the escrow is. Higher supersedes lower.
|
|
26
|
+
*
|
|
27
|
+
* The three terminals share rank 3 because none of them follows another —
|
|
28
|
+
* they are alternative endings, not stages. `conflicts()` below is what stops
|
|
29
|
+
* two of them being folded into the same job.
|
|
30
|
+
*/
|
|
31
|
+
export declare const ESCROW_RANK: Readonly<Record<EscrowStatus, number>>;
|
|
32
|
+
export declare const WORK_RANK: Readonly<Record<WorkStatus, number>>;
|
|
33
|
+
/**
|
|
34
|
+
* Escrow states from which no further escrow movement is possible.
|
|
35
|
+
*
|
|
36
|
+
* Reaching one of these is the escrow's last word. A second terminal arriving
|
|
37
|
+
* afterwards is not a later truth — it is a contradiction, and the fold must
|
|
38
|
+
* say so rather than overwrite.
|
|
39
|
+
*/
|
|
40
|
+
export declare const ESCROW_TERMINALS: ReadonlySet<EscrowStatus>;
|
|
41
|
+
/** Work states from which no further grading is possible. */
|
|
42
|
+
export declare const WORK_TERMINALS: ReadonlySet<WorkStatus>;
|
|
43
|
+
export declare function isEscrowTerminal(status: EscrowStatus): boolean;
|
|
44
|
+
export declare function isWorkTerminal(status: WorkStatus): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Do these two escrow states contradict each other?
|
|
47
|
+
*
|
|
48
|
+
* True when both are terminal and they differ — the escrow cannot have both
|
|
49
|
+
* released to the provider and refunded to the client. Anything else is either
|
|
50
|
+
* progress or a repeat.
|
|
51
|
+
*/
|
|
52
|
+
export declare function escrowConflicts(a: EscrowStatus, b: EscrowStatus): boolean;
|
|
53
|
+
export declare function workConflicts(a: WorkStatus, b: WorkStatus): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* What happens when a new status is folded onto an existing one.
|
|
56
|
+
*
|
|
57
|
+
* `advance` — the new status supersedes the old.
|
|
58
|
+
* `keep` — the old status stands (the new one is stale or a repeat).
|
|
59
|
+
* `conflict` — both are terminal and mutually exclusive; neither can be
|
|
60
|
+
* trusted, and the caller must record the contradiction rather
|
|
61
|
+
* than silently pick one.
|
|
62
|
+
*/
|
|
63
|
+
export type Resolution = 'advance' | 'keep' | 'conflict';
|
|
64
|
+
export declare function resolveEscrow(current: EscrowStatus, incoming: EscrowStatus): Resolution;
|
|
65
|
+
export declare function resolveWork(current: WorkStatus, incoming: WorkStatus): Resolution;
|
|
66
|
+
/**
|
|
67
|
+
* Grades are mutually exclusive too, and were previously plain
|
|
68
|
+
* last-write-wins with no rank at all — so a replayed approval could overturn
|
|
69
|
+
* a rejection, or the reverse, purely on arrival order.
|
|
70
|
+
*/
|
|
71
|
+
export declare function resolveGrade(current: boolean | undefined, incoming: boolean): Resolution;
|
|
72
|
+
/**
|
|
73
|
+
* Phases of a job, as one value.
|
|
74
|
+
*
|
|
75
|
+
* Three modules used to each reconstruct "where is this job" from six raw
|
|
76
|
+
* fields, with rules that had already drifted apart — "is it disputed" was
|
|
77
|
+
* asked three different ways. Deriving it once means they cannot disagree.
|
|
78
|
+
*/
|
|
79
|
+
export type Phase = 'notStarted' | 'awaitingFunding' | 'awaitingDelivery' | 'awaitingGrading' | 'awaitingAdjudication' | 'refundClaimable' | 'settled'
|
|
80
|
+
/** Two contradictory terminal facts were folded in; nothing can be concluded. */
|
|
81
|
+
| 'contradictory';
|
|
82
|
+
//# sourceMappingURL=transitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transitions.d.ts","sourceRoot":"","sources":["../../src/acp/transitions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAErE;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAO7D,CAAC;AAEH,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAQzD,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,YAAY,CAIrD,CAAC;AAEH,6DAA6D;AAC7D,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,UAAU,CAAwD,CAAC;AAE5G,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAE9D;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAE1D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,GAAG,OAAO,CAEzE;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO,CAMnE;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,CAAC;AAEzD,wBAAgB,aAAa,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,GAAG,UAAU,CAGvF;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,GAAG,UAAU,CAGjF;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,QAAQ,EAAE,OAAO,GAAG,UAAU,CAGxF;AAED;;;;;;GAMG;AACH,MAAM,MAAM,KAAK,GACb,YAAY,GACZ,iBAAiB,GACjB,kBAAkB,GAClB,iBAAiB,GACjB,sBAAsB,GACtB,iBAAiB,GACjB,SAAS;AACX,iFAAiF;GAC/E,eAAe,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The transition table — the one place that says what a job may do next.
|
|
3
|
+
*
|
|
4
|
+
* Before this module existed the lifecycle was implicit: monotonic ranks in the
|
|
5
|
+
* fold said *what may follow what*, an if-branch cascade in the outcome said
|
|
6
|
+
* *which fact wins*, and a third set of branches said *who may act*. Three
|
|
7
|
+
* partial machines, none of them owning legality, and they disagreed.
|
|
8
|
+
*
|
|
9
|
+
* Ranks alone cannot express the rule that actually matters here. A lifecycle
|
|
10
|
+
* is not a line, it is a shape with several ends: an escrow can be released, or
|
|
11
|
+
* refunded, or adjudicated, and those are *mutually exclusive* rather than
|
|
12
|
+
* ordered. A total order has no way to say "these two may never both be true",
|
|
13
|
+
* so a tie between them silently degenerated into last-write-wins — and the
|
|
14
|
+
* arrival order of logs decided who got paid.
|
|
15
|
+
*
|
|
16
|
+
* So this table answers two separate questions:
|
|
17
|
+
*
|
|
18
|
+
* ranks — what may follow what (progress)
|
|
19
|
+
* terminality — what may coexist (exclusivity)
|
|
20
|
+
*
|
|
21
|
+
* Only the first was ever written down.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* How far along the escrow is. Higher supersedes lower.
|
|
25
|
+
*
|
|
26
|
+
* The three terminals share rank 3 because none of them follows another —
|
|
27
|
+
* they are alternative endings, not stages. `conflicts()` below is what stops
|
|
28
|
+
* two of them being folded into the same job.
|
|
29
|
+
*/
|
|
30
|
+
export const ESCROW_RANK = Object.freeze({
|
|
31
|
+
none: 0,
|
|
32
|
+
locked: 1,
|
|
33
|
+
disputed: 2,
|
|
34
|
+
released: 3,
|
|
35
|
+
refunded: 3,
|
|
36
|
+
adjudicated: 3,
|
|
37
|
+
});
|
|
38
|
+
export const WORK_RANK = Object.freeze({
|
|
39
|
+
none: 0,
|
|
40
|
+
open: 1,
|
|
41
|
+
funded: 2,
|
|
42
|
+
submitted: 3,
|
|
43
|
+
graded: 4,
|
|
44
|
+
expired: 4,
|
|
45
|
+
closed: 5,
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* Escrow states from which no further escrow movement is possible.
|
|
49
|
+
*
|
|
50
|
+
* Reaching one of these is the escrow's last word. A second terminal arriving
|
|
51
|
+
* afterwards is not a later truth — it is a contradiction, and the fold must
|
|
52
|
+
* say so rather than overwrite.
|
|
53
|
+
*/
|
|
54
|
+
export const ESCROW_TERMINALS = new Set([
|
|
55
|
+
'released',
|
|
56
|
+
'refunded',
|
|
57
|
+
'adjudicated',
|
|
58
|
+
]);
|
|
59
|
+
/** Work states from which no further grading is possible. */
|
|
60
|
+
export const WORK_TERMINALS = new Set(['graded', 'expired', 'closed']);
|
|
61
|
+
export function isEscrowTerminal(status) {
|
|
62
|
+
return ESCROW_TERMINALS.has(status);
|
|
63
|
+
}
|
|
64
|
+
export function isWorkTerminal(status) {
|
|
65
|
+
return WORK_TERMINALS.has(status);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Do these two escrow states contradict each other?
|
|
69
|
+
*
|
|
70
|
+
* True when both are terminal and they differ — the escrow cannot have both
|
|
71
|
+
* released to the provider and refunded to the client. Anything else is either
|
|
72
|
+
* progress or a repeat.
|
|
73
|
+
*/
|
|
74
|
+
export function escrowConflicts(a, b) {
|
|
75
|
+
return a !== b && isEscrowTerminal(a) && isEscrowTerminal(b);
|
|
76
|
+
}
|
|
77
|
+
export function workConflicts(a, b) {
|
|
78
|
+
if (a === b)
|
|
79
|
+
return false;
|
|
80
|
+
// `closed` is a wrapper around an already-decided job rather than a rival
|
|
81
|
+
// ending, so it may follow a grade or an expiry without contradicting it.
|
|
82
|
+
if (a === 'closed' || b === 'closed')
|
|
83
|
+
return false;
|
|
84
|
+
return isWorkTerminal(a) && isWorkTerminal(b);
|
|
85
|
+
}
|
|
86
|
+
export function resolveEscrow(current, incoming) {
|
|
87
|
+
if (escrowConflicts(current, incoming))
|
|
88
|
+
return 'conflict';
|
|
89
|
+
return ESCROW_RANK[incoming] > ESCROW_RANK[current] ? 'advance' : 'keep';
|
|
90
|
+
}
|
|
91
|
+
export function resolveWork(current, incoming) {
|
|
92
|
+
if (workConflicts(current, incoming))
|
|
93
|
+
return 'conflict';
|
|
94
|
+
return WORK_RANK[incoming] > WORK_RANK[current] ? 'advance' : 'keep';
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Grades are mutually exclusive too, and were previously plain
|
|
98
|
+
* last-write-wins with no rank at all — so a replayed approval could overturn
|
|
99
|
+
* a rejection, or the reverse, purely on arrival order.
|
|
100
|
+
*/
|
|
101
|
+
export function resolveGrade(current, incoming) {
|
|
102
|
+
if (current === undefined)
|
|
103
|
+
return 'advance';
|
|
104
|
+
return current === incoming ? 'keep' : 'conflict';
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=transitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transitions.js","sourceRoot":"","sources":["../../src/acp/transitions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAA2C,MAAM,CAAC,MAAM,CAAC;IAC/E,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;IACT,QAAQ,EAAE,CAAC;IACX,QAAQ,EAAE,CAAC;IACX,QAAQ,EAAE,CAAC;IACX,WAAW,EAAE,CAAC;CACf,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,SAAS,GAAyC,MAAM,CAAC,MAAM,CAAC;IAC3E,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;IACT,SAAS,EAAE,CAAC;IACZ,MAAM,EAAE,CAAC;IACT,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC;CACV,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA8B,IAAI,GAAG,CAAe;IAC/E,UAAU;IACV,UAAU;IACV,aAAa;CACd,CAAC,CAAC;AAEH,6DAA6D;AAC7D,MAAM,CAAC,MAAM,cAAc,GAA4B,IAAI,GAAG,CAAa,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC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