@superjackfruitlabs/treaty-ecosystem-identity 0.0.0 → 0.0.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/README.md CHANGED
@@ -35,7 +35,7 @@ repo boundary instead of a language boundary.
35
35
  | `run_join_key.json` | The run join key: *superpipeline mints the work run; AgentPod executes it; no competing run id for dispatched work.* |
36
36
  | `matrix_gate_events.json` | The two events a superpipeline approval gate crosses Matrix on: the gate the board asks, and the decision a human sends back. Pins the v1 option ids against superpipeline's `GateDecision`, and records the four fields superpipeline#34 proposed that do not exist. Since version 3 it also pins gate.v2 and decision.v2 (charter `decisions/2026-11-07-gate-v2-is-the-decision-envelope.md`): options as the gate offers them, a subject-bound gate's subject and preview, and the answer's subject binding. The hub validates them in `apps/hub/src/services/board-chat/gates.test.ts`. Since version 4 it also pins question.v2, question.answer.v2, delivery.v2 and delivery.answer.v2 (charter: the decision envelope covers questions and follow-ups): a question's options with their meaning and input, free text, the follow-up a manual delivery owes, and gate.outcome.v1, the receipt that closes a gate's or a follow-up's card. The hub validates them in `question.test.ts` and `delivery.test.ts` beside it. Since version 5 (charter: strict decisions and harness permissions bind their subject) it also pins a subject-bound question.v2 and its answer (entries with `variant: "subject-bound"`: the subject, option `scope` / `requires`, the answer's binding), and AgentPod's own `dev.agentpod.permission.v2`, `dev.agentpod.permission.answer.v2` and `dev.agentpod.permission.outcome.v1`. The hub validates them in `question-subject.test.ts` and `permission-v2.test.ts`. Since version 6 (charter: waiting cards and broker approvals reach chat) it also pins `dev.superpipeline.attention.v2` (a card waiting on a person: its wait id, reason and the resume / archive options), `dev.superpipeline.attention.answer.v2` and `dev.superpipeline.attention.outcome.v1`, and a SuperToolkit approval request as a board-less, `stk-capability/v1` subject-bound question.v2 and its answer (entries with `variant: "approval-request"`). The hub validates them in `attention.test.ts` and `approval-request.test.ts`. Since version 7 (charter: unanswered decisions remind, then escalate) it also pins `deadline { remind_at?, escalate_at? }` on gate.v2, question.v2, delivery.v2 and attention.v2 (entries with `variant: "deadline"`), a gate closed as `expired` (`gate.outcome.v1`, `variant: "expired"`), and the two notices posted in reply to a waiting card, `dev.superpipeline.decision.reminded.v1` and `dev.superpipeline.decision.escalated.v1`. The hub validates them in `decision-timeout-wire.test.ts`. Since version 8 (charter: a gate may offer a choice of variants) it also pins a variant gate (entries with `variant: "choice"`): its gate.v2 carrying `subject { variants: [{ id, label, subject }] }` with no identity of its own, each variant bounded and withheld on its own, its v1 fallback that offers no approval, the decision.v2 whose binding is the variant chosen, and the receipt naming it (`chosen_variant`). The hub validates them in `gate-variants.test.ts`. Since version 9 (charter: a gate may need more than one approver) it also pins a quorum gate (entries with `variant: "quorum"`): its gate.v2 carrying `quorum { required, from, approvals: [{ principal_id, at, variant_id? }] }` beside the options, the quorums that must not be carried, `dev.agentpod.gate.progress.v2` (the progress posted for an approval short of the quorum), and the decision.v2 with the two board refusals of a quorum approval (`QUORUM_ALREADY_APPROVED`, `APPROVAL_DECIDER_NOT_ALLOWED`) and what is said for each. The hub validates them in `gate-quorum.test.ts`. Since version 10 (charter: an approval may wait for its release time) it also pins a held gate (entries with `variant: "release"`): its gate.v2 carrying `release { hold_for_minutes?, not_before? }` and the releases that must not be carried, the held approval's `gate.outcome.v1` with `held_until`, `dev.agentpod.decision.released.v2` (released and blocked) and `dev.agentpod.decision.pulled_back.v2` posted in reply to the gate's card, `dev.superpipeline.gate.pull_back.v2` (the pull-back a person sends, and one refused without a comment) with the board's refusals of it, and the decision.v2 refusal `APPROVAL_RELEASE_AFTER_EXPIRY`, each with what is said. The hub validates them in `gate-release.test.ts`. Since version 11 (charter: a gate may be decided by checks) it also pins a gate decided by checks (entries with `variant: "checks"`): its gate.v2 carrying `checks [{ name, provider, status, url? }]` and the lists that must not be carried, `dev.agentpod.check.failed.v2` (returned, and parked replying to the open checks.waiting card) and `dev.agentpod.check.overridden.v2` with what is said for each, the reminder (standalone) and escalation of overdue checks (`decision_kind: "checks"`), `dev.agentpod.checks.waiting.v2` (the card an escalation posts, which an override references), and `dev.superpipeline.check.override.v2` (the override a person sends, and one refused without a comment) with the board's refusals of it and what is said. The hub validates them in `gate-checks.test.ts`. |
37
37
  | `card_prompt.json` | The prompt contract: what a card becomes when it is handed to a harness, assembled from the card, the previous stage's handoff, the card's references and (since `card-prompt/4`) its comment thread. Pins the **rendered text**, not only the shape. |
38
- | `token_claims.json` | The access-token claims every product verifies — **v8**, the organization plane's shape (`org`, `ent`, `jti`; `aud` a string or an array; no `tenant`). Pinned by `packages/contract/src/token-claims.ts`. AgentPod's hub keeps minting the v7 shape until its issuer is removed; that copy is frozen at `apps/hub/src/auth/testdata/token_claims.v7.json`. |
38
+ | `token_claims.json` | The access-token claims every product verifies — **v9**, the organization plane's shape (`org`, `ent`, `jti`; `aud` a string or an array; no `tenant`). Since v9 it is also the organization plane's own copy: accounts kept a separate `fixtures/token_claims.json` that had drifted, and the two were merged here, adding `superlibrary` to `ent`, the OAuth-only claims a consumer ignores, more reject cases and one valid example token per kind of caller. treaty's `packages/ecosystem-identity/test/token-claims.test.ts` checks the examples against the claims. AgentPod pins v8 in its `packages/contract/src/token-claims.ts`. AgentPod's hub keeps minting the v7 shape until its issuer is removed; that copy is frozen at `apps/hub/src/auth/testdata/token_claims.v7.json`. |
39
39
 
40
40
  All of them are plain JSON and depend on no type from any repo. That is deliberate — a corpus that
41
41
  needed AgentPod's schemas to be readable could not be checked into superpipeline.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "corpus": "ecosystem-identity/token-claims",
3
- "version": 8,
3
+ "version": 9,
4
4
  "authoredAt": "2026-10-06",
5
- "authoredFrom": "v8 (2026-10-06): the issuer moves to the organization plane (accounts/docs/superpowers/specs/2026-10-06-issuer-contract.md). Removed: tenant. Added: org, ent (issued), jti (standard), amr (conditional). aud may be a string or an array. AgentPod's hub keeps minting the v7 shape while ORG_PLANE_* is unset; that legacy shape is pinned by apps/hub/src/auth/testdata/token_claims.v7.json until the hub's issuer is removed. code and two runs: the claim shape was observed in a token issued by better-auth 1.6.26 and verified from a Cloudflare Worker (agentpod#331), and the control pair moved from reserved to issued when grants became data the issuer can read (principal_grants); `act` added 2026-08-30 when the Application Service gained the ability to assert a human it had never met, on the strength of a Matrix message and a principal_identities row; `mayDispatch` became bare `prn_…` ids matched by equality on 2026-08-30, when an agent became a principal and the two namespaced, pattern-matched forms were deleted rather than deprecated (charter decisions/2026-08-30-an-agent-is-a-principal.md §3); `email`/`email_verified` added 2026-09-20 (agentpod `apps/hub/src/auth/jwt-claims.ts`, `buildTokenPayload`'s conditional spread, and the join it reads from in `apps/hub/src/services/principals.ts`) so superpipeline can resolve or create a local user from a hub token instead of only verifying it carries a real, unnamed principal — part of the suite sign-in programme, task 1 of 2026-09-20-suite-sign-in; `scope` added 2026-10-04 as a conditional claim carrying a grant's read permissions (only `evidence:read`), so superwitness can read evidence from the hub and superpipeline as a service principal (superwitness contract C6); `runs:write` joined the scope vocabulary 2026-10-06 (superwitness app spec §3.4) for the service principal that reports superpipeline's runs to superwitness; `transcripts:read` joined it the same day (superwitness transcripts spec §3.2) for reading session content as evidence; no claim was added or renamed, so the corpus version is unchanged; `orgRole` added 2026-10-22 as a conditional claim (workspace authority spec W1): conditional and tolerant (absent or unknown reads as member), so no existing consumer can break on it and the corpus version is unchanged",
5
+ "authoredFrom": "v8 (2026-10-06): the issuer moves to the organization plane (accounts/docs/superpowers/specs/2026-10-06-issuer-contract.md). Removed: tenant. Added: org, ent (issued), jti (standard), amr (conditional). aud may be a string or an array. AgentPod's hub keeps minting the v7 shape while ORG_PLANE_* is unset; that legacy shape is pinned by apps/hub/src/auth/testdata/token_claims.v7.json until the hub's issuer is removed. code and two runs: the claim shape was observed in a token issued by better-auth 1.6.26 and verified from a Cloudflare Worker (agentpod#331), and the control pair moved from reserved to issued when grants became data the issuer can read (principal_grants); `act` added 2026-08-30 when the Application Service gained the ability to assert a human it had never met, on the strength of a Matrix message and a principal_identities row; `mayDispatch` became bare `prn_…` ids matched by equality on 2026-08-30, when an agent became a principal and the two namespaced, pattern-matched forms were deleted rather than deprecated (charter decisions/2026-08-30-an-agent-is-a-principal.md §3); `email`/`email_verified` added 2026-09-20 (agentpod `apps/hub/src/auth/jwt-claims.ts`, `buildTokenPayload`'s conditional spread, and the join it reads from in `apps/hub/src/services/principals.ts`) so superpipeline can resolve or create a local user from a hub token instead of only verifying it carries a real, unnamed principal — part of the suite sign-in programme, task 1 of 2026-09-20-suite-sign-in; `scope` added 2026-10-04 as a conditional claim carrying a grant's read permissions (only `evidence:read`), so superwitness can read evidence from the hub and superpipeline as a service principal (superwitness contract C6); `runs:write` joined the scope vocabulary 2026-10-06 (superwitness app spec §3.4) for the service principal that reports superpipeline's runs to superwitness; `transcripts:read` joined it the same day (superwitness transcripts spec §3.2) for reading session content as evidence; no claim was added or renamed, so the corpus version is unchanged; `orgRole` added 2026-10-22 as a conditional claim (workspace authority spec W1): conditional and tolerant (absent or unknown reads as member), so no existing consumer can break on it and the corpus version is unchanged; v9 (2026-11-10): the corpus moved to treaty and merged with the organization plane's own copy (accounts fixtures/token_claims.json, its v9), which had drifted from this one. From accounts: `superlibrary` in `ent` (its v9), the OAuth-only conditional claims `client_id`, `azp` and `sid` that a consumer ignores, the `removed` list, the reject cases `alg-not-eddsa`, `issuer-with-path`, `missing-ent`, `missing-jti`, `unknown-principalKind` and `lifetime-over-300`, and `examples`, one valid token per kind of caller. accounts' `missing-mayDispatch` is this corpus's `mayDispatch-absent`. Kept from this corpus and missing from accounts' copy: `orgRole`, which accounts mints (src/issuer/claims.ts)",
6
6
  "purpose": "One issuer, and every other plane verifies offline against a JWKS (charter decisions/2026-08-15-one-issuer-and-offline-verification.md). The moment a second plane reads a claim, the claim's NAME is a contract: a rename in the hub is a silent authorization failure in superpipeline, which fails in the direction that looks like the caller having no permission. This corpus is what makes that a failing test instead.",
7
7
  "howToRead": {
8
8
  "issued": "Claims the issuer MUST put in every token, and consumers may rely on. A missing one is a malformed token. NOTE the difference between a claim that is ABSENT and one that is EMPTY: absent means this issuer does not speak the control pair, empty (`[]` / `false`) means this principal is permitted nothing. Reading the first as the second would let an old issuer silently authorise everything.",
@@ -51,7 +51,8 @@
51
51
  "agentpod",
52
52
  "superpipeline",
53
53
  "supermessage",
54
- "superwitness"
54
+ "superwitness",
55
+ "superlibrary"
55
56
  ],
56
57
  "meaning": "The products enabled for org. A product not listed answers 403 { error: 'product_not_enabled', org }. A consumer ignores values it does not recognise.",
57
58
  "required": true
@@ -145,6 +146,31 @@
145
146
  {
146
147
  "case": "wildcard-mayDispatch-value",
147
148
  "why": "`*` or `prn_*` in mayDispatch. Patterns were deleted on 2026-08-30, not deprecated: a grant is now an enumeration of principal ids, matched by equality, and a wildcard string simply fails that check — it must never be read as 'every agent' or 'every agent of this shape'. `agentpod:*/hermes` reaching a root station that should never have existed is the evidence this removal answers."
149
+ },
150
+ {
151
+ "case": "alg-not-eddsa",
152
+ "why": "Signed with an algorithm other than EdDSA. Pin the algorithm; a consumer that accepts what the header names can be handed a key of the attacker's choosing."
153
+ },
154
+ {
155
+ "case": "issuer-with-path",
156
+ "why": "iss must equal the issuer exactly. A prefix match accepts tokens from any path under the issuer's host.",
157
+ "example": "https://accounts.superjackfruit.com/api/auth"
158
+ },
159
+ {
160
+ "case": "missing-ent",
161
+ "why": "A token that names no products cannot be checked for product_not_enabled. Refuse it."
162
+ },
163
+ {
164
+ "case": "missing-jti",
165
+ "why": "jti is required: without it a token cannot be told apart from a replay of another."
166
+ },
167
+ {
168
+ "case": "unknown-principalKind",
169
+ "why": "principalKind outside human, agent and service. Refuse it rather than reading it as the weakest kind."
170
+ },
171
+ {
172
+ "case": "lifetime-over-300",
173
+ "why": "exp - iat over 300 seconds. The short lifetime is the revocation story; a consumer refuses a token that outlives it."
148
174
  }
149
175
  ],
150
176
  "conditional": [
@@ -207,6 +233,151 @@
207
233
  "meaning": "A human's role in `org`, read from the membership at mint time. Absent for agents and services.",
208
234
  "whyItExists": "Workspace authority (agentpod docs/superpowers/specs/2026-10-22-workspace-authority-design.md W1): a product decides what a workspace's owner or admin may do without keeping its own copy of the role.",
209
235
  "consumerObligation": "Treat an absent or unrecognised value as `member`, and never refuse a token for carrying one. A demotion takes effect at the next mint (access tokens live 300 s)."
236
+ },
237
+ {
238
+ "claim": "client_id",
239
+ "type": "string",
240
+ "required": false,
241
+ "when": "OAuth tokens",
242
+ "meaning": "Set by the OAuth provider on OAuth access tokens. A consumer ignores it."
243
+ },
244
+ {
245
+ "claim": "azp",
246
+ "type": "string",
247
+ "required": false,
248
+ "when": "OAuth tokens",
249
+ "meaning": "Set by the OAuth provider on OAuth access tokens. A consumer ignores it."
250
+ },
251
+ {
252
+ "claim": "sid",
253
+ "type": "string",
254
+ "required": false,
255
+ "when": "OAuth tokens",
256
+ "meaning": "Set by the OAuth provider on OAuth access tokens. A consumer ignores it."
257
+ }
258
+ ],
259
+ "removed": [
260
+ {
261
+ "claim": "tenant",
262
+ "since": 8,
263
+ "replacement": "org"
264
+ }
265
+ ],
266
+ "examples": {
267
+ "oauth-human": {
268
+ "iss": "https://accounts.superjackfruit.com",
269
+ "sub": "prn_0123456789abcdef0123",
270
+ "aud": [
271
+ "https://app.superpipeline.dev",
272
+ "https://accounts.superjackfruit.com/api/auth/oauth2/userinfo"
273
+ ],
274
+ "iat": 1791300000,
275
+ "exp": 1791300300,
276
+ "jti": "Qs1",
277
+ "principalKind": "human",
278
+ "org": "org_00000000000000000000",
279
+ "ent": [
280
+ "agentpod",
281
+ "superpipeline"
282
+ ],
283
+ "mayDispatch": [],
284
+ "mayGrantReach": false,
285
+ "email": "a@example.test",
286
+ "email_verified": true,
287
+ "scope": "openid offline_access",
288
+ "client_id": "superpipeline-web",
289
+ "azp": "superpipeline-web",
290
+ "sid": "s1"
291
+ },
292
+ "device-human": {
293
+ "iss": "https://accounts.superjackfruit.com",
294
+ "sub": "prn_0123456789abcdef0123",
295
+ "aud": "https://hub.agentpod.dev",
296
+ "iat": 1791300000,
297
+ "exp": 1791300300,
298
+ "jti": "Qs2",
299
+ "principalKind": "human",
300
+ "org": "org_00000000000000000000",
301
+ "ent": [
302
+ "agentpod"
303
+ ],
304
+ "mayDispatch": [
305
+ "prn_aaaaaaaaaaaaaaaaaaaa"
306
+ ],
307
+ "mayGrantReach": true,
308
+ "email": "a@example.test",
309
+ "email_verified": true,
310
+ "amr": [
311
+ "device"
312
+ ]
313
+ },
314
+ "service": {
315
+ "iss": "https://accounts.superjackfruit.com",
316
+ "sub": "prn_bbbbbbbbbbbbbbbbbbbb",
317
+ "aud": "https://app.superpipeline.dev",
318
+ "iat": 1791300000,
319
+ "exp": 1791300300,
320
+ "jti": "Qs3",
321
+ "principalKind": "service",
322
+ "org": "org_00000000000000000000",
323
+ "ent": [
324
+ "superpipeline"
325
+ ],
326
+ "mayDispatch": [],
327
+ "mayGrantReach": false,
328
+ "scope": "evidence:read",
329
+ "amr": [
330
+ "service"
331
+ ]
332
+ },
333
+ "agent": {
334
+ "iss": "https://accounts.superjackfruit.com",
335
+ "sub": "prn_aaaaaaaaaaaaaaaaaaaa",
336
+ "aud": [
337
+ "https://app.superpipeline.dev",
338
+ "https://hub.agentpod.dev"
339
+ ],
340
+ "iat": 1791300000,
341
+ "exp": 1791300300,
342
+ "jti": "Qs4",
343
+ "principalKind": "agent",
344
+ "org": "org_00000000000000000000",
345
+ "ent": [
346
+ "agentpod",
347
+ "superpipeline"
348
+ ],
349
+ "mayDispatch": [],
350
+ "mayGrantReach": false,
351
+ "act": {
352
+ "sub": "prn_bbbbbbbbbbbbbbbbbbbb"
353
+ },
354
+ "amr": [
355
+ "exchange"
356
+ ]
357
+ },
358
+ "assertion-human": {
359
+ "iss": "https://accounts.superjackfruit.com",
360
+ "sub": "prn_0123456789abcdef0123",
361
+ "aud": "https://app.superpipeline.dev",
362
+ "iat": 1791300000,
363
+ "exp": 1791300120,
364
+ "jti": "Qs5",
365
+ "principalKind": "human",
366
+ "org": "org_00000000000000000000",
367
+ "ent": [
368
+ "agentpod",
369
+ "superpipeline"
370
+ ],
371
+ "mayDispatch": [],
372
+ "mayGrantReach": false,
373
+ "email": "a@example.test",
374
+ "email_verified": true,
375
+ "act": {
376
+ "sub": "prn_bbbbbbbbbbbbbbbbbbbb"
377
+ },
378
+ "amr": [
379
+ "assertion"
380
+ ]
210
381
  }
211
- ]
382
+ }
212
383
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superjackfruitlabs/treaty-ecosystem-identity",
3
- "version": "0.0.0",
3
+ "version": "0.0.2",
4
4
  "description": "The identity fixture corpus Super Jackfruit Labs products check their ids, tokens, prompts and chat events against.",
5
5
  "license": "MIT",
6
6
  "type": "module",