@particle-academy/fancy-conformance 0.25.0 → 0.26.0

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/README.md CHANGED
@@ -71,6 +71,7 @@ verbatim.
71
71
  | `flow/graph-runs` | 23 | Whole-graph execution: the same `WorkflowSchema` in, the same `RunResult.outputs` out |
72
72
  | `flow/run-diagnostics` | 14 | The run-time warnings for a graph that delivers nothing: an edge naming a port its source can never publish, and a route taken on a path that did not resolve. Half the rows pin when to stay silent |
73
73
  | `flow/durable-dispatch` | 14 | How a queued run hands out nodes: one at a time by default, in declaration order, with a paused gate keeping its slot; a cap and the whole frontier only when a host asks |
74
+ | `shared/subscription-lease` | 13 | A subscription that expires: when a renewal is due, when the lease has expired, and why a missed lease is a resync rather than a quiet re-create |
74
75
 
75
76
  Every case carries an `id`, a `title`, the suite version it arrived in, and —
76
77
  where it exists to catch something specific — a `notes` field saying what.
package/VERSION CHANGED
@@ -1 +1 @@
1
- 0.25.0
1
+ 0.26.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@particle-academy/fancy-conformance",
3
- "version": "0.25.0",
3
+ "version": "0.26.0",
4
4
  "description": "Shared cross-language conformance fixtures for the Fancy suite. One contract, N implementations, and a single table that every implementation asserts in its own CI — so 'parity' is a test result rather than a claim. Ships the fixture data itself, so a Rust, Go or Python runner can consume it without a JavaScript toolchain.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -37,8 +37,8 @@
37
37
  },
38
38
  "runShape": { "type": "object" },
39
39
  "reference": {
40
- "description": "Which language's behaviour the goldens were taken from. Goldens are never what a value 'obviously' is.",
41
- "enum": ["php", "node", "rust", "python", "go"]
40
+ "description": "Which language's behaviour the goldens were taken from. Goldens are never what a value 'obviously' is. 'authored' means the suite's author decided them rather than capturing them from a runtime; referenceNote must say by whom and on what evidence.",
41
+ "enum": ["php", "node", "rust", "python", "go", "authored"]
42
42
  },
43
43
  "referenceNote": { "type": "string" },
44
44
  "implementations": {
@@ -50,7 +50,8 @@
50
50
  "properties": {
51
51
  "language": { "enum": ["php", "node", "rust", "python", "go"] },
52
52
  "package": { "type": "string", "minLength": 1 },
53
- "symbol": { "type": "string" }
53
+ "symbol": { "type": "string" },
54
+ "engine": { "type": "string", "description": "For an implementation that runs inside a workflow engine: the engine package and the range it is exercised against." }
54
55
  },
55
56
  "additionalProperties": false
56
57
  }
@@ -13,7 +13,8 @@
13
13
  "implementations": [
14
14
  { "language": "php", "package": "particle-academy/fancy-flow-php", "symbol": "FancyFlow\\Laravel\\Runs\\DispatchLimit" },
15
15
  { "language": "node", "package": "@particle-academy/fancy-flow", "symbol": "selectDispatch" },
16
- { "language": "python", "package": "fancy-flow", "symbol": "fancy_flow.durable.select_dispatch" }
16
+ { "language": "python", "package": "fancy-flow", "symbol": "fancy_flow.durable.select_dispatch" },
17
+ { "language": "rust", "package": "fancy-flow", "symbol": "fancy_flow::durable::select_dispatch" }
17
18
  ]
18
19
  },
19
20
  "notes": [
@@ -24,7 +25,7 @@
24
25
  "THE BUDGET IS MEASURED AGAINST WORK ALREADY HELD, not the size of one batch. Two nodes settling at once each trigger an advance on a real queue; a per-batch cap lets each dispatch its own quota. The simulation cannot race, so 0014 and 0010 pin the held-count arithmetic directly, and each runtime's own suite pins the race.",
25
26
  "WORKERS ARE FIFO AND SETTLE ONE AT A TIME. That makes every row deterministic without pretending to model a real queue's timing. It is a model of the decision, not of the transport.",
26
27
  "SKIPS AND NOTES NEVER TAKE A SLOT (0011, 0012). The frontier settles a dead branch, everything below it, and a sticky note in the same pass, before selection.",
27
- "RUST IS NOT LISTED: fancy-flow-rs has no durable coordinator. Whether it gets one is an open decision recorded in the envelope's .ai/plans/fancy-flow-serial-dispatch.md.",
28
+ "RUST JOINED IN 0.26.0. fancy-flow-rs had no durable coordinator when this table was written; the owner ruled to build one rather than record its absence, and it passes all 14 rows against its own frontier and selection. It also runs flow/run-diagnostics through its coordinator, and matches flow/graph-runs durably and in a single process.",
28
29
  "THERE IS A DISCRIMINATION PROBE (tests/discrimination-durable-dispatch.test.ts): a faithful frontier + selection passes every row, and four mutants each fail an exact set -- a paused node not held (0008, 0010), a per-batch cap (0008, 0010, 0014), the pre-#17 default (0001, 0004, 0005, 0007, 0008, 0013) and breadth-first order (0007). Writing it is what turned the goldens from dispatch batches into a trace: the batch shape let the first two mutants through."
29
30
  ]
30
31
  }
@@ -0,0 +1,206 @@
1
+ {
2
+ "$schema": "../../../schema/case-table.schema.json",
3
+ "suite": "shared/subscription-lease",
4
+ "cases": [
5
+ {
6
+ "id": "0001-active-well-before-renewal",
7
+ "title": "Three days into a seven-day lease with a one-day margin is active, nothing to do",
8
+ "since": "0.26.0",
9
+ "input": {
10
+ "expiresAt": "2026-09-22T00:00:00Z",
11
+ "renewBeforeSeconds": 86400,
12
+ "renewOperation": "subscription_renew",
13
+ "now": "2026-09-18T00:00:00Z"
14
+ },
15
+ "expected": {
16
+ "renewAt": "2026-09-21T00:00:00.000Z",
17
+ "state": "active",
18
+ "action": "none"
19
+ }
20
+ },
21
+ {
22
+ "id": "0002-due-at-the-boundary",
23
+ "title": "Exactly at renewAt the lease is DUE — the boundary is inclusive",
24
+ "since": "0.26.0",
25
+ "input": {
26
+ "expiresAt": "2026-09-22T00:00:00Z",
27
+ "renewBeforeSeconds": 86400,
28
+ "renewOperation": "subscription_renew",
29
+ "now": "2026-09-21T00:00:00Z"
30
+ },
31
+ "expected": {
32
+ "renewAt": "2026-09-21T00:00:00.000Z",
33
+ "state": "due",
34
+ "action": "renew"
35
+ }
36
+ },
37
+ {
38
+ "id": "0003-one-second-before-due",
39
+ "title": "One second before renewAt is still active",
40
+ "since": "0.26.0",
41
+ "input": {
42
+ "expiresAt": "2026-09-22T00:00:00Z",
43
+ "renewBeforeSeconds": 86400,
44
+ "renewOperation": "subscription_renew",
45
+ "now": "2026-09-20T23:59:59Z"
46
+ },
47
+ "expected": {
48
+ "renewAt": "2026-09-21T00:00:00.000Z",
49
+ "state": "active",
50
+ "action": "none"
51
+ }
52
+ },
53
+ {
54
+ "id": "0004-expired-at-the-boundary-beats-due",
55
+ "title": "Exactly at expiresAt the lease is EXPIRED, and expired wins over due",
56
+ "since": "0.26.0",
57
+ "input": {
58
+ "expiresAt": "2026-09-22T00:00:00Z",
59
+ "renewBeforeSeconds": 86400,
60
+ "renewOperation": "subscription_renew",
61
+ "now": "2026-09-22T00:00:00Z"
62
+ },
63
+ "expected": {
64
+ "renewAt": "2026-09-21T00:00:00.000Z",
65
+ "state": "expired",
66
+ "action": "resync"
67
+ }
68
+ },
69
+ {
70
+ "id": "0005-one-second-before-expiry-is-still-renewable",
71
+ "title": "One second before expiry the lease is due, not expired",
72
+ "since": "0.26.0",
73
+ "input": {
74
+ "expiresAt": "2026-09-22T00:00:00Z",
75
+ "renewBeforeSeconds": 86400,
76
+ "renewOperation": "subscription_renew",
77
+ "now": "2026-09-21T23:59:59Z"
78
+ },
79
+ "expected": {
80
+ "renewAt": "2026-09-21T00:00:00.000Z",
81
+ "state": "due",
82
+ "action": "renew"
83
+ }
84
+ },
85
+ {
86
+ "id": "0006-now-long-before-is-simply-active",
87
+ "title": "A now far before the lease (clock skew, or a lease issued for the future) is active — nothing clamps",
88
+ "since": "0.26.0",
89
+ "input": {
90
+ "expiresAt": "2026-09-22T00:00:00Z",
91
+ "renewBeforeSeconds": 86400,
92
+ "renewOperation": "subscription_renew",
93
+ "now": "2020-01-01T00:00:00Z"
94
+ },
95
+ "expected": {
96
+ "renewAt": "2026-09-21T00:00:00.000Z",
97
+ "state": "active",
98
+ "action": "none"
99
+ }
100
+ },
101
+ {
102
+ "id": "0007-missed-by-a-week-is-resync",
103
+ "title": "A lease nobody renewed is resync, however long ago it lapsed",
104
+ "since": "0.26.0",
105
+ "input": {
106
+ "expiresAt": "2026-09-22T00:00:00Z",
107
+ "renewBeforeSeconds": 86400,
108
+ "renewOperation": "subscription_renew",
109
+ "now": "2026-09-29T00:00:00Z"
110
+ },
111
+ "expected": {
112
+ "renewAt": "2026-09-21T00:00:00.000Z",
113
+ "state": "expired",
114
+ "action": "resync"
115
+ }
116
+ },
117
+ {
118
+ "id": "0008-offset-and-zulu-are-one-instant",
119
+ "title": "An expiry with a +02:00 offset and a Zulu now compare as instants",
120
+ "since": "0.26.0",
121
+ "input": {
122
+ "expiresAt": "2026-09-22T02:00:00+02:00",
123
+ "renewBeforeSeconds": 3600,
124
+ "renewOperation": "channel_create",
125
+ "now": "2026-09-21T23:30:00Z"
126
+ },
127
+ "expected": {
128
+ "renewAt": "2026-09-21T23:00:00.000Z",
129
+ "state": "due",
130
+ "action": "renew"
131
+ }
132
+ },
133
+ {
134
+ "id": "0009-fractional-seconds-parse",
135
+ "title": "Fractional seconds do not break the comparison",
136
+ "since": "0.26.0",
137
+ "input": {
138
+ "expiresAt": "2026-09-22T00:00:00.500Z",
139
+ "renewBeforeSeconds": 60,
140
+ "renewOperation": "subscription_renew",
141
+ "now": "2026-09-21T23:59:00.400Z"
142
+ },
143
+ "expected": {
144
+ "renewAt": "2026-09-21T23:59:00.500Z",
145
+ "state": "active",
146
+ "action": "none"
147
+ }
148
+ },
149
+ {
150
+ "id": "0010-an-epoch-is-refused-not-guessed",
151
+ "title": "A Google-shaped epoch-milliseconds expiry is refused — the connector converts, the lease never guesses units",
152
+ "since": "0.26.0",
153
+ "input": {
154
+ "expiresAt": "1789430400000",
155
+ "renewBeforeSeconds": 86400,
156
+ "renewOperation": "channel_create",
157
+ "now": "2026-09-18T00:00:00Z"
158
+ },
159
+ "expected": {
160
+ "refused": "expiresAt"
161
+ }
162
+ },
163
+ {
164
+ "id": "0011-zero-margin-is-refused",
165
+ "title": "renewBeforeSeconds of 0 is refused: due would be unreachable, and nobody would renew",
166
+ "since": "0.26.0",
167
+ "input": {
168
+ "expiresAt": "2026-09-22T00:00:00Z",
169
+ "renewBeforeSeconds": 0,
170
+ "renewOperation": "subscription_renew",
171
+ "now": "2026-09-18T00:00:00Z"
172
+ },
173
+ "expected": {
174
+ "refused": "renewBeforeSeconds"
175
+ }
176
+ },
177
+ {
178
+ "id": "0012-negative-margin-is-refused",
179
+ "title": "A negative renewBeforeSeconds is refused",
180
+ "since": "0.26.0",
181
+ "input": {
182
+ "expiresAt": "2026-09-22T00:00:00Z",
183
+ "renewBeforeSeconds": -60,
184
+ "renewOperation": "subscription_renew",
185
+ "now": "2026-09-18T00:00:00Z"
186
+ },
187
+ "expected": {
188
+ "refused": "renewBeforeSeconds"
189
+ }
190
+ },
191
+ {
192
+ "id": "0013-no-renew-operation-is-refused",
193
+ "title": "A lease with no renew operation is refused — a due lease with nothing to call is one nobody renews",
194
+ "since": "0.26.0",
195
+ "input": {
196
+ "expiresAt": "2026-09-22T00:00:00Z",
197
+ "renewBeforeSeconds": 86400,
198
+ "renewOperation": "",
199
+ "now": "2026-09-18T00:00:00Z"
200
+ },
201
+ "expected": {
202
+ "refused": "renewOperation"
203
+ }
204
+ }
205
+ ]
206
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "$schema": "../../../schema/suite-manifest.schema.json",
3
+ "suite": "shared/subscription-lease",
4
+ "title": "A subscription that EXPIRES, and when the host must act on it",
5
+ "since": "0.26.0",
6
+ "caseFormat": "table",
7
+ "cases": "cases.json",
8
+ "contract": {
9
+ "summary": "A `subscription` trigger is a webhook the provider stops delivering unless somebody renews it. The lease is the provider's expiry plus the connector's declaration of how early to renew and which operation does it, so a host runs ONE renewal scheduler for every expiring trigger instead of one per connector. `state` says where the lease is; `action` says what the host does about it.",
10
+ "functions": {
11
+ "renewAt": "renewAt(lease) -> instant (expiresAt - renewBeforeSeconds)",
12
+ "state": "state(lease, now) -> active | due | expired",
13
+ "action": "action(lease, now) -> none | renew | resync"
14
+ },
15
+ "reference": "authored",
16
+ "referenceNote": "Boundaries are decided here, not measured: `due` is INCLUSIVE at renewAt, `expired` is INCLUSIVE at expiresAt and wins over `due` (Microsoft Graph refuses to renew a subscription that has expired; a Google Calendar channel simply stops). A missed lease is `resync`, never a quiet re-create: notifications during the gap are gone, so the host must re-list (sync token or full) AND re-subscribe.",
17
+ "implementations": [
18
+ {
19
+ "language": "node",
20
+ "package": "@particle-academy/fancy-connector-core",
21
+ "symbol": "subscriptionLease / leaseRenewAt / leaseState / leaseAction from \"@particle-academy/fancy-connector-core\""
22
+ },
23
+ {
24
+ "language": "php",
25
+ "package": "particle-academy/fancy-connector-core",
26
+ "symbol": "ParticleAcademy\\Connectors\\SubscriptionLease (renewAt(), state(), action())"
27
+ }
28
+ ]
29
+ },
30
+ "notes": [
31
+ "The lease carries the provider's expiry as an RFC 3339 INSTANT. Google Calendar hands back `expiration` as an epoch in MILLISECONDS as a string, Graph hands back `expirationDateTime` as ISO 8601 — the CONNECTOR converts on the way in; the lease refuses anything that is not an instant (case 0010) rather than guessing units.",
32
+ "`renewBeforeSeconds` must be positive (cases 0011, 0012). Zero would make `due` unreachable — the moment it applies is the moment `expired` wins — which is a lease nobody ever renews, declared in a way nothing would report.",
33
+ "`renewOperation` names the operation the host calls when the lease is due. For Graph that is a renew; for Google Calendar, whose channels cannot be renewed, it is the create again (the connector stops the old channel itself). The lease does not know the difference and does not need to: it says WHEN, the connector says WHAT.",
34
+ "`expired` beats `due` at the same instant (case 0004): a lease that has just expired cannot be renewed, so the only honest action is resync.",
35
+ "Clock skew clamps nothing here, unlike isReplaySafe: a `now` before renewAt is simply `active` (case 0006), because there is no earlier attempt to have forgotten.",
36
+ "LANDED AS AUTHORED. Taken from fancy-connector-core v0.7.0 `fixtures/subscription-lease/cases.json` (weaver.agi, owner-approved lease vocabulary 2026-09-14). Rows, contract and notes are unchanged; only the split into manifest.json + cases.json and a per-row `since` were added to fit this repository's format. Core deletes its local copy and reads this suite once it pins this release, so the table lives in one place.",
37
+ "EVERY ROW EXERCISES ALL THREE FUNCTIONS, so no row names an `fn`: a row pins `renewAt`, `state` and `action` together, or pins that constructing the lease is refused and names the field. A runner returns `{refused: <field>}` for a refusal and `{renewAt, state, action}` otherwise, with `renewAt` as an RFC 3339 instant in UTC with milliseconds (`...T00:00:00.000Z`).",
38
+ "PYTHON IS NOT LISTED: fancy-connector-core has no Python port yet. It joins the `implementations` when that package exists.",
39
+ "THERE IS A DISCRIMINATION PROBE (tests/discrimination-subscription-lease.test.ts): a faithful lease passes every row, and each mutant a competent author would write -- an exclusive `due`, an exclusive `expired`, `due` winning over `expired`, a missed lease re-created instead of resynced, an epoch guessed as milliseconds, a zero margin allowed, an offset dropped, fractional seconds truncated -- fails an exact set of rows."
40
+ ]
41
+ }