@passioncode-ai/fabric-agent-adapter 0.22.0 → 0.24.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.
Files changed (23) hide show
  1. package/CHANGELOG.md +98 -0
  2. package/README.md +1 -1
  3. package/package.json +1 -1
  4. package/plugins/fabric-agent-adapter/.claude-plugin/plugin.json +1 -1
  5. package/plugins/fabric-agent-adapter/skills/adapting-projects-to-fabric/SKILL.md +3 -3
  6. package/plugins/fabric-agent-adapter/skills/adapting-projects-to-fabric/scripts/adapt_project.py +2 -2
  7. package/plugins/fabric-agent-adapter/skills/building-fabric-services/SKILL.md +7 -4
  8. package/plugins/fabric-agent-adapter/skills/building-fabric-services/references/dashboard-kit.md +7 -4
  9. package/plugins/fabric-agent-adapter/skills/building-fabric-services/references/delegation.md +10 -7
  10. package/plugins/fabric-agent-adapter/skills/building-fabric-services/references/estate-record.md +32 -15
  11. package/plugins/fabric-agent-adapter/skills/building-fabric-services/references/lifecycle.md +64 -14
  12. package/plugins/fabric-agent-adapter/skills/building-fabric-services/references/protocol.md +9 -5
  13. package/plugins/fabric-agent-adapter/skills/building-fabric-services/scripts/check_service.py +24 -4
  14. package/plugins/fabric-agent-adapter/skills/building-fabric-services/scripts/fabric-delegation.mjs +35 -20
  15. package/plugins/fabric-agent-adapter/skills/building-fabric-services/scripts/fabric-estate.mjs +77 -9
  16. package/plugins/fabric-agent-adapter/skills/building-fabric-services/scripts/fabric-service.mjs +317 -45
  17. package/plugins/fabric-agent-adapter/skills/building-fabric-services/scripts/fabric_delegation.py +53 -19
  18. package/plugins/fabric-agent-adapter/skills/building-fabric-services/scripts/fabric_estate.py +107 -16
  19. package/plugins/fabric-agent-adapter/skills/building-fabric-services/scripts/fabric_service.py +472 -62
  20. package/plugins/fabric-agent-adapter/skills/building-fabric-services/scripts/sample_service.py +10 -3
  21. package/plugins/fabric-agent-adapter/skills/creating-fabric-agents/SKILL.md +3 -3
  22. package/plugins/fabric-agent-adapter/skills/working-with-fabric/SKILL.md +1 -1
  23. package/plugins/fabric-agent-adapter/skills/working-with-fabric/scripts/fabric_session.py +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,103 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.24.0 - 2026-10-13
4
+
5
+ An app's own descriptor (contract DEC-0069) and the descriptor for listings (DEC-0061) in both kits (FAA-34). The contract
6
+ pin does not move: both decisions are at `fe55fc6`.
7
+
8
+ ### Added
9
+
10
+ - **`lifecycle.manager` `node` and `person`.** `node`: Project Observatory's node supervises the service as its child,
11
+ with no supervisor file, so `label`, `plist`, `unit` and `task` are refused beside it. `person`: an app a person
12
+ installs and starts — `lifecycle.app` is required, `origin` is optional (its live origin is in the app's own liveness
13
+ file), and `installedBy` is `{by: "person", role, tool}`. `write_descriptor` / `writeDescriptor` claim no port for
14
+ it, and `check_service.py` reads it as installed, never running: `descriptor.app-installed`, no port claim, and the
15
+ well-known document `NOT_RUN`.
16
+ - **`installedBy` by role, `runner` and `peer`.**
17
+ - `installedBy` is a string or `{by, role?, tool}`.
18
+ - `runner` is `{kind?, credentialKind}`, a kind and never a credential.
19
+ - `peer` is `{endpoint, custody, residency, maxDataClass}`. An offer needs `runner` and never a subscription.
20
+ - FAC-SEM-085 refuses a peer on a reserved name. FAC-SEM-086 refuses a value shaped like a credential in `runner` or
21
+ `installedBy`, naming its place.
22
+ - **Ports held to the contract's vectors:** `peer_refusal` / `peerRefusal` (`service-peer.json`),
23
+ `app_descriptor_action` / `appDescriptorAction` and `app_descriptor_stale` / `appDescriptorStale`
24
+ (`app-descriptor.json`).
25
+ - **`fabric_button_presence` / `fabricButtonPresence`** answer whether Fabric's button may show. The answer is
26
+ `present` only while Fabric's own descriptor (`fabric.default.json`) is registered and, for an app's descriptor,
27
+ its app is still installed. A server sets `data-fabric="absent"` otherwise.
28
+ - **Usage:** `make_usage_receipt` / `makeUsageReceipt` accept `route: "platform-metered"`. A configuration's route
29
+ stays `subscription` or `key`.
30
+
31
+ ### Changed
32
+
33
+ - `register_remote` / `registerRemote` and the sample's `register` write `installedBy` in its object form
34
+ (`{by: "person", role: "operator", tool}`). `register_remote` / `registerRemote` also take `runner` and `peer`.
35
+
36
+ ### Fixed
37
+
38
+ - `check_service.py` reported two descriptors without an origin as claiming the same port.
39
+ - `write_descriptor` / `writeDescriptor` failed on a descriptor without one.
40
+
41
+ ### Evidence
42
+
43
+ - Every service-descriptor fixture of the contract at `fe55fc6` is held through both validators: 10 valid accepted;
44
+ every invalid one refused except the six local-channel negatives (DEC-0075, not a kit surface), a set the tests pin.
45
+ - The FAC-SEM-085/086 semantic fixtures answer at the contract's places.
46
+ - 32 planted defects, all caught.
47
+ - The scenario eval `app-descriptor-and-listing` was written before the prose.
48
+
49
+ ## 0.23.0 - 2026-10-13
50
+
51
+ The contract pin moves from `b291bf0` (DEC-0055) to contract `main` `fe55fc6`, and both kits follow every rule in that
52
+ range that touches what they already do (FAA-32; the contract's hand-over of 2026-10-12, its CT-18 row). `b291bf0`
53
+ joins the supported revisions. What the range adds beyond that is its own row: FAA-33…37.
54
+
55
+ ### Changed
56
+
57
+ - **The supervisor marker comes as an argument too** (DEC-0057, CT-01, P4-01): `supervisor_marker` /
58
+ `supervisorMarker` read `FABRIC_SERVICE_SUPERVISOR=<manager>` and `--fabric-supervisor <manager>` /
59
+ `--fabric-supervisor=<manager>` (after the executable, before `--`; a bare flag consumes no `--…` token), with `node`
60
+ among the managers. Markers that disagree — the two forms, the argument twice, a bare or empty argument beside the
61
+ variable — exit 75 at once, before the lock, naming both. `supervised()` and `supervised_by_launchd()` take the
62
+ marker; `hold_single_instance` / `holdSingleInstance` take `env` and `argv`. A holder whose pid cannot be read is
63
+ named unknown (`FAC-SEM-078`).
64
+ - **Writers:** `task_xml` / `taskXml` write `--fabric-supervisor task-scheduler` in the task's `Arguments`, before any
65
+ `--` (a task's action carries no environment, so a Task Scheduler copy now waits like one under launchd);
66
+ `systemd_unit` / `systemdUnit` set the variable unconditionally; every writer refuses a marker in the program
67
+ arguments. `add_supervisor_argument(parser)` lets a service's argparse accept the flag; the sample service uses it.
68
+ - **DL-HUBKEY** (DEC-0060): `hub_key_certified` / `hubKeyCertified(record, kid, x, at, applied, extra)` answer the
69
+ contract's verdict — `{certified, machine, revision}` or `{certified: false, fault, detail}` — instead of a boolean.
70
+ A revision outside its window, unreadable, lower than the applied one or forking it is the trust source's fault
71
+ (`issuer-unavailable`: `estate-outside-window`, `estate-unreadable`, `estate-rolled-back`, `estate-forked`); a `kid`
72
+ on two machines, a missing `x` and a numeric `kid` never certify; revocation refs compare exactly. The verifiers
73
+ take `estate_applied` / `estateApplied` and `estate_revocations` / `estateRevocations`; in the Node kit only an
74
+ absent `estate` skips the check (`null` is an unreadable source). Every verifier refuses a clock that is not a number
75
+ of seconds `unknown-state` `no-clock` before row 1.
76
+ - **The estate record** (DEC-0063, DEC-0066): `verify_estate_record` / `verifyEstateRecord` admit `issuedAt` up to 60 s
77
+ ahead (`CLOCK_SKEW_SECONDS`); the signing passkey must be under a `sign.<domain>` RP (`wrong-rp`) and its origins
78
+ within it (`wrong-origin`); the record's rules add `FAC-SEM-092`.
79
+ - **The Windows token-file reader** (DEC-0057, `FAC-SEM-079`): `windows_token_acl_problem` /
80
+ `windowsTokenAclProblem` decide over the file's flags, owner and ACEs `{type, sid, mask}`: an object or callback ACE
81
+ is refused, an allow with an empty mask and every deny grant nothing, SIDs compare case-insensitively, anything
82
+ unreadable is refused. The Python kit reads the ACEs from SDDL (`acl_from_sddl`), the Node kit through .NET's raw
83
+ descriptor with the mask read unsigned. `windows_acl` / `windowsAcl` now answer ACEs; `token_acl_problem` /
84
+ `tokenAclProblem` are replaced by `token_file_problem` / `tokenFileProblem`.
85
+ - **The descriptor** (DEC-0057 item 5): `label` and `plist` are refused beside `systemd` and `task-scheduler`; a
86
+ `localPath` starting `//` or `/\` is a share and refused.
87
+
88
+ ### Evidence
89
+
90
+ - Vendored from the contract at `fe55fc6` and re-answered by its own functions (`test/fixtures/contract/vendor_vectors.mjs`):
91
+ `hub-key-vectors.json` (51 cases, 14 verifier answers; the hub seeds dropped), `supervisor-vectors.json` (22 marker
92
+ cases, 11 `FAC-SEM-078` records), `windows-token-vectors.json` (30 cases), `descriptor-negatives.json` (DEC-0057's
93
+ seven); `estate-vectors.json` regenerated (49 verify cases). Both kits answer every case as the contract does.
94
+ - The kits' own starts against a held lock — by hand, the node, a task, an unknown holder, three conflicts — are
95
+ recorded and read by a port of `lockOutcomeRules` that itself reads the contract's 11 records as it does.
96
+ - The sample service, started with `--fabric-supervisor=node`, serves a well-known document, usage report and events
97
+ page valid under the `fe55fc6` schemas; the descriptors the kit writes under every manager are valid too.
98
+ - 34 planted defects, all caught.
99
+ - The `--fabric-supervisor` scenario eval (`supervised-by-argument`) was written before the prose.
100
+
3
101
  ## 0.22.0 - 2026-10-12
4
102
 
5
103
  `working-with-fabric`, the fourth skill, the plugin's session hooks, and coding agents as participants of Fabric's
package/README.md CHANGED
@@ -235,7 +235,7 @@ Scaffolding is non-destructive by default. It writes only the paths declared in
235
235
  The default pin for new bundles is [`fabric-contract.lock.json`](fabric-contract.lock.json):
236
236
 
237
237
  - version: `0.1.0`
238
- - commit: `b291bf09e0a9f9fd3c16cf540832cd021203b7d1`
238
+ - commit: `fe55fc67cba1a9e34a736da7d148d4fe2a8fbfa0`
239
239
 
240
240
  Every other mention of the default contract revision — this section, the skills' metadata, the
241
241
  skill card, `adapt_project.py` — must equal it; `python3 test/validate.py` fails a tree
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@passioncode-ai/fabric-agent-adapter",
3
- "version": "0.22.0",
3
+ "version": "0.24.0",
4
4
  "description": "Create Fabric-compatible agents, run them as always-alive local services with dashboards (fabric-service/0.1), and adapt existing projects to the Fabric Agent Contract. This package is the installer CLI.",
5
5
  "scripts": {
6
6
  "test": "python3 test/validate.py && python3 -m unittest discover -s test -q && node --test 'test/*.test.mjs'"
@@ -3,7 +3,7 @@
3
3
  "name": "fabric-agent-adapter",
4
4
  "displayName": "Fabric Agent Adapter",
5
5
  "description": "Create new Fabric-compatible agents, build them as always-alive local services with dashboards (fabric-service/0.1), and adapt existing projects to the Fabric Agent Contract through evidence-backed MCP, A2A, or local-runner provider bundles; and teach a coding agent to work in a project through Fabric (fabric-mcp, fabric_whoami, claim and release), with Claude Code session hooks.",
6
- "version": "0.22.0",
6
+ "version": "0.24.0",
7
7
  "author": {
8
8
  "name": "PassionCode.ai",
9
9
  "url": "https://passioncode.ai/"
@@ -5,9 +5,9 @@ license: AGPL-3.0-only OR LicenseRef-PassionCode-Commercial
5
5
  compatibility: Requires filesystem access and Python 3.9+. Exact schema checks additionally need git, Node.js, pnpm, and the pinned fabric-agent-contract checkout (a public repository). Works without those tools in an explicitly degraded structural-check mode.
6
6
  metadata:
7
7
  author: PassionCode.ai
8
- version: "0.22.0"
8
+ version: "0.24.0"
9
9
  contract-version: "0.1.0"
10
- contract-commit: "b291bf09e0a9f9fd3c16cf540832cd021203b7d1"
10
+ contract-commit: "fe55fc67cba1a9e34a736da7d148d4fe2a8fbfa0"
11
11
  ---
12
12
 
13
13
  # Adapting projects to Fabric
@@ -70,7 +70,7 @@ Use exactly:
70
70
 
71
71
  - contract version `0.1.0`;
72
72
  - repository `https://github.com/passioncode-ai/fabric-agent-contract`;
73
- - commit `b291bf09e0a9f9fd3c16cf540832cd021203b7d1`.
73
+ - commit `fe55fc67cba1a9e34a736da7d148d4fe2a8fbfa0`.
74
74
 
75
75
  This is the default for new bundles. When checking an issued legacy bundle, preserve its
76
76
  explicit supported lock and use that exact clean checkout. Never silently upgrade or
@@ -21,10 +21,10 @@ import fabric_secrets as _secrets # noqa: E402 - the contract's credential dete
21
21
 
22
22
  CONTRACT_VERSION = "0.1.0"
23
23
  CONTRACT_REPOSITORY = "https://github.com/passioncode-ai/fabric-agent-contract"
24
- CONTRACT_COMMIT = "b291bf09e0a9f9fd3c16cf540832cd021203b7d1"
24
+ CONTRACT_COMMIT = "fe55fc67cba1a9e34a736da7d148d4fe2a8fbfa0"
25
25
  # #region supported-contract-revisions — docs: README.md#contract-pin
26
26
  # Only this declaration may name a legacy revision in live files.
27
- SUPPORTED_CONTRACT_COMMITS = (CONTRACT_COMMIT, "0cacd08b0e95b6abf131eae1206b60792138bc3c", "2eb91c00e852d9c31d804310d38fad91589fcbac", "8e49fbd5fbbf230e32c1969cd24ac3c22422f0a5", "a83bec6b47776af688402c18efec507143061f68", "52da526d7cc1e063d74c5b520dbc03d0ace15246", "78b2da018d2c4bd9ac1bde1dc3b7f1a110a175f5", "623bf61358c339cb10297807b3f024b5d9f1f327", "23f9fda4c05f8a3852246ee98d4f2adf74ed0875", "9091d3d6606b0c4b5591a38c3674356a01fd7f55", "df55c8c54a23251342a7ee57ba95642b7eb39e61", "2ce392291c6668598d12cd38327e24696b5ca15c")
27
+ SUPPORTED_CONTRACT_COMMITS = (CONTRACT_COMMIT, "b291bf09e0a9f9fd3c16cf540832cd021203b7d1", "0cacd08b0e95b6abf131eae1206b60792138bc3c", "2eb91c00e852d9c31d804310d38fad91589fcbac", "8e49fbd5fbbf230e32c1969cd24ac3c22422f0a5", "a83bec6b47776af688402c18efec507143061f68", "52da526d7cc1e063d74c5b520dbc03d0ace15246", "78b2da018d2c4bd9ac1bde1dc3b7f1a110a175f5", "623bf61358c339cb10297807b3f024b5d9f1f327", "23f9fda4c05f8a3852246ee98d4f2adf74ed0875", "9091d3d6606b0c4b5591a38c3674356a01fd7f55", "df55c8c54a23251342a7ee57ba95642b7eb39e61", "2ce392291c6668598d12cd38327e24696b5ca15c")
28
28
  # #endregion supported-contract-revisions
29
29
  INTEROP_KEY = "https://fabric.passioncode.ai/agent-contract/extensions/interop/0.1"
30
30
  MCP_REVISION = "2026-07-28"
@@ -16,10 +16,10 @@ license: AGPL-3.0-only OR LicenseRef-PassionCode-Commercial
16
16
  compatibility: Python 3.9+ or Node.js 20+ for the kits; the probe needs Python 3.9+. launchd steps are macOS-only; Linux services install a systemd user unit and Windows ones a per-user Scheduled Task with the kits' writers. Dashboard handoff optionally uses Fabric Dashboards MCP link/host_status/open; without it, report unresolved host capability. The contract checkout is optional.
17
17
  metadata:
18
18
  author: PassionCode.ai
19
- version: "0.22.0"
19
+ version: "0.24.0"
20
20
  contract-version: "0.1.0"
21
21
  extension: "fabric-service/0.1"
22
- extension-commit: "b291bf09e0a9f9fd3c16cf540832cd021203b7d1"
22
+ extension-commit: "fe55fc67cba1a9e34a736da7d148d4fe2a8fbfa0"
23
23
  ---
24
24
 
25
25
  # Building Fabric services
@@ -323,8 +323,11 @@ this estate needs.
323
323
 
324
324
  ## When something is missing
325
325
 
326
- - **Not macOS / no launchd:** declare `lifecycle.manager: "none"`; hosts show the
327
- service read-only. Keep every other rule.
326
+ - **Not macOS / no launchd:** the kits write a systemd user unit (Linux) or a per-user Scheduled Task (Windows); with
327
+ no supervisor at all declare `lifecycle.manager: "none"`, and hosts show the service read-only. Keep every other rule.
328
+ - **A desktop app with no supervisor** (DEC-0069): its descriptor says `manager: "person"` with `lifecycle.app`, no
329
+ origin, `installedBy {by: "person", role, tool}`; its live origin is in its own liveness file
330
+ (the lifecycle reference, *An app's own descriptor and the node*).
328
331
  - **No Python:** use the Node kit; run the probe from any machine that has Python and
329
332
  can reach the port, or mark the probe `NOT_RUN` with the reason.
330
333
  - **Neither kit fits the framework:** implement the four routes and the lock by hand
@@ -100,10 +100,13 @@ service. Load it after the stylesheet, with ids only:
100
100
  — or one shaped like a credential — means no button, never a bad link. A press opens a view in Fabric and starts
101
101
  nothing (FB-8).
102
102
  - **The host (FB-6):** when the host's `fabric_button` cookie says `owner=host`, the page hides its own button.
103
- - **Fabric absent (FB-5):** when the cookie says `fabric=absent`, or `data-fabric="absent"` (a local service whose
104
- server checked for Fabric's hub document), or when the page is still visible and focused 1.5 s after a link was
105
- followed, the menu says "Fabric is not installed — get it at passioncode.ai/fabric". Nothing downloads, nothing
106
- retries.
103
+ - **Fabric absent (FB-5):** when the cookie says `fabric=absent`, or `data-fabric="absent"`, or when the page is still
104
+ visible and focused 1.5 s after a link was followed, the menu says "Fabric is not installed — get it at
105
+ passioncode.ai/fabric". Nothing downloads, nothing retries. A local service's server decides `data-fabric` with
106
+ `fabric_button_presence()` / `fabricButtonPresence()`: `present` while Fabric's own descriptor
107
+ (`services/fabric.default.json`, Fabric ADR-0139) is registered and, for an app's descriptor (`manager: "person"`,
108
+ DEC-0069), its app is still installed; `absent` otherwise. A press only follows a link, so the button never reads
109
+ Fabric's liveness file; a caller that sends Fabric anything reads that file and checks the process first.
107
110
 
108
111
  `window.FabricButton` exposes `buildFabricLink`, `parseFabricLink` and `parseButtonCookie` for a page that needs
109
112
  them. The button is optional: a page without the script has no button.
@@ -95,16 +95,19 @@ itself (`isSmallOrderKey`), because Node before 26 lets OpenSSL accept a signatu
95
95
 
96
96
  ## Keys the estate record certifies
97
97
 
98
- A verifier that also reads the estate's record (DEC-0055, [the estate record reference](estate-record.md)) trusts a
99
- `kid` only while a current revision certifies it for a machine and does not revoke it (DL-14). Pass the current
100
- verified revision as `estate=` / `{ estate }`, as a value or as a function returning it, to `delegation_gate`,
98
+ A verifier that also reads the estate's record (DEC-0055, DEC-0060, [the estate record reference](estate-record.md))
99
+ trusts a `kid` only while the revision it reads certifies it (DL-14, row 4a, right after the signature). Pass the
100
+ current verified revision as `estate=` / `{ estate }`, as a value or as a function returning it, with
101
+ `estate_applied` / `estateApplied` and `estate_revocations` / `estateRevocations`, to `delegation_gate`,
101
102
  `verify_delegation` or `verify_approval`.
102
- - An uncertified `kid` is refused `unauthenticated` (`approval-invalid` for an approval), with detail
103
+ - An uncertified `kid` is the token's fault: `unauthenticated` (`approval-invalid` for an approval), detail
103
104
  `kid-not-certified`.
104
- - An unreadable record is refused `issuer-unavailable`, with detail `estate-unreadable`.
105
+ - A revision that cannot be read, is outside its window, is lower than the applied one or forks it is the trust
106
+ source's fault: `issuer-unavailable`, detail `estate-unreadable`, `estate-outside-window`, `estate-rolled-back` or
107
+ `estate-forked`.
105
108
  - Without `estate`, nothing changes.
106
- - Pass only a revision `verify_estate_record` accepted, and the highest one the machine has applied. The rule trusts
107
- what it is given, so an unverified or older revision would certify a key the current one revoked.
109
+ - Every verifier refuses a clock that is not a number of seconds `unknown-state` `no-clock` before row 1: a NaN clock
110
+ would make every time row false and pass an expired token.
108
111
 
109
112
  ## What the kit does not do
110
113
 
@@ -43,12 +43,16 @@ It checks, in the order of the ER table:
43
43
  parent, and no revocation dropped.
44
44
  5. **The signer.** The signing passkey must be among the trusted ones and not revoked by the parent. A revision may
45
45
  revoke its own signer: that is rotation.
46
- 6. **The assertion.**
46
+ 6. **The assertion.** The passkey is a signing credential (DEC-0063): an RP ID that is not a dedicated signing RP,
47
+ `sign.<domain>` in lower case, is `wrong-rp` before the assertion is read, and an origin outside the RP ID is not
48
+ pinned, so a ceremony that ran there is `wrong-origin`.
47
49
  - Client data: type, challenge, origin, no cross-origin use.
48
50
  - The RP ID hash, and the user-presence and user-verification flags.
49
51
  - The signature: ES256 or EdDSA, under a key validated first (a valid P-256 point; an Ed25519 key of full order).
50
- 7. **The window.** At most 30 days.
51
- 8. **The record's own rules.** A violation is `rule-violation` with its `codes`.
52
+ 7. **The window.** At most 30 days. A revision may be issued up to 60 s ahead of the verifier's clock (DEC-0066,
53
+ `CLOCK_SKEW_SECONDS`); earlier than that it is `not-yet-valid`.
54
+ 8. **The record's own rules.** A violation is `rule-violation` with its `codes`, `FAC-SEM-072…076` and `FAC-SEM-092`
55
+ (each passkey the record lists is a signing credential, its origins within its RP ID).
52
56
 
53
57
  Dates are strict RFC 3339: a `T`, an offset, and a day that exists. `:60` and a space are refused. Passkey JWK `x`
54
58
  and `y` must be canonical base64url. The Python kit verifies ES256 in pure Python (P-256, strict DER), and the Node
@@ -56,22 +60,35 @@ kit through `node:crypto`.
56
60
 
57
61
  ## Trusting a delegation key
58
62
 
59
- A delegation verifier that reads the estate record trusts a token's `kid` only while a current revision certifies it
60
- for a machine and does not revoke it (DL-14, contract CT-20). Give the gate the current verified revision, or a
61
- function that returns it:
63
+ A delegation verifier that reads the estate record trusts a token's `kid` only while the revision it reads certifies
64
+ it (DL-14, contract DEC-0060): exactly one machine's `hubKey` has that `kid` and the published key's `x`, the clock is
65
+ inside the revision's window (from 60 s before `issuedAt`, DEC-0066, to `validUntil`), and neither the revision nor the
66
+ revocation delta's entries applied since it revoke `hub-key <kid>` or `machine <id>`. It is checked right after the
67
+ signature (DL-13 row 4a). Give the gate the current verified revision, or a function that returns it, the highest
68
+ revision the machine applied, and the delta's revocations:
62
69
 
63
70
  ```python
64
- gate = fd.delegation_gate(audience=..., jwks=keys, issuer=..., effects=..., estate=lambda: current)
71
+ gate = fd.delegation_gate(audience=..., jwks=keys, issuer=..., effects=..., estate=lambda: current,
72
+ estate_applied={"revision": applied_number, "digest": applied_digest},
73
+ estate_revocations=lambda: delta_entries)
65
74
  ```
66
75
 
67
- - A `kid` the record does not certify is refused like an unknown key: `unauthenticated` (for an approval,
68
- `approval-invalid`) with detail `kid-not-certified`. The same holds when the record names another key under that
69
- kid, revokes it, or is outside its window.
70
- - A record that cannot be read certifies nothing: `issuer-unavailable` with detail `estate-unreadable`.
71
- - **What you pass in.** Pass only a revision that `verify_estate_record` accepted, and the highest revision the
72
- machine has applied. The rule trusts the record it is given. A record nobody verified, or an older revision still
73
- inside its window, would certify a key the current revision revoked (a rollback).
74
- - `hub_key_certified(record, kid, x, at)` / `hubKeyCertified(...)` answers the question on its own.
76
+ - **The token's fault** — no such certification, another key under that `kid`, a `kid` on two machines, a revoked hub
77
+ key or machine — is `unauthenticated` (for an approval, `approval-invalid`) with detail `kid-not-certified`.
78
+ - **The trust source's fault** is `issuer-unavailable`: `estate-unreadable` (a source that throws or answers nothing
79
+ readable, a revision without a number or digest, a window of zero or over 30 days, dates read strictly, `machines` or
80
+ `revocations` not arrays), `estate-outside-window`, `estate-rolled-back` (lower than the applied revision) and
81
+ `estate-forked` (the applied number with another digest). A caller cannot cure these by minting again.
82
+ - An unreadable clock — not a finite number of seconds a `Date` can hold — is refused `unknown-state` `no-clock`
83
+ before row 1, in every verifier.
84
+ - Only an absent `estate` skips the check. In the Node kit `null` is an unreadable source; in Python, where `None` is
85
+ the absent value, pass a function returning `None` for a source that has nothing.
86
+ - **What you pass in.** Pass only a revision that `verify_estate_record` accepted and whose number is not lower than
87
+ the highest the machine applied; a higher one only when you verified its chain from the applied revision.
88
+ - `hub_key_certified(record, kid, x, at, applied, extra_revocations)` /
89
+ `hubKeyCertified(record, kid, x, at, applied, {extraRevocations})` answers the question on its own:
90
+ `{certified: true, machine, revision}` or `{certified: false, fault, detail}`. Both kits are held to the contract's
91
+ `fixtures/vectors/hub-key.json` (`test/fixtures/contract/hub-key-vectors.json`).
75
92
 
76
93
  ## Checking a record you produce
77
94
 
@@ -73,12 +73,52 @@ operator's real jobs.
73
73
  ## One copy under a supervisor
74
74
 
75
75
  Started by hand, a copy that finds `service.lock` held prints one sentence naming the
76
- holder and exits 75 at once. Under launchd that exit is a respawn every `ThrottleInterval`
77
- (10 s), forever, and under systemd one every `RestartSec`. So a copy whose plist or unit
78
- carries `FABRIC_SERVICE_SUPERVISOR=launchd` (or `systemd`) backs off in-process — 0.5 s doubling to 30 s, 300 s in all — takes over if the holder leaves,
79
- and exits 75 only when the wait runs out: a few starts an hour instead of 360. It touches
80
- nothing while it waits. Two installs sharing one data directory are still the defect to
81
- remove; the back-off only stops the loop from costing the machine.
76
+ holder (or saying the holder is unknown, when its pid cannot be read) and exits 75 at once.
77
+ Under launchd that exit is a respawn every `ThrottleInterval` (10 s), forever, and under
78
+ systemd one every `RestartSec`. So a copy its supervisor started, and that says so with the
79
+ **supervisor marker**, backs off in-process — 0.5 s doubling to 30 s, 300 s in all — takes over
80
+ if the holder leaves, and exits 75 only when the wait runs out: a few starts an hour instead of
81
+ 360. It touches nothing while it waits. Two installs sharing one data directory are still the
82
+ defect to remove; the back-off only stops the loop from costing the machine.
83
+
84
+ The marker (contract DEC-0057, CT-01) is the variable `FABRIC_SERVICE_SUPERVISOR=<manager>` or
85
+ the argument `--fabric-supervisor <manager>` (also `--fabric-supervisor=<manager>`), after the
86
+ executable and before any `--`; `<manager>` is `launchd`, `systemd`, `task-scheduler` or `node`
87
+ (Project Observatory's node, which supervises the services it starts). The writer of the
88
+ supervisor file writes it: `launchd_plist` and `systemd_unit` / `systemdUnit` set the variable,
89
+ always; `task_xml` / `taskXml` put the argument in the task's `Arguments`, because a task's action
90
+ carries no environment. Each writer refuses a marker already in the program arguments. A copy
91
+ never infers supervision from its parent process.
92
+
93
+ - `supervisor_marker(env, argv)` / `supervisorMarker({env, argv})` reads both forms and answers
94
+ `supervised` (with the manager), `manual` or `conflict`. Only an empty variable counts as no
95
+ marker; a bare `--fabric-supervisor` (followed by nothing, by `--` or by another `--…` flag,
96
+ none of which it consumes) names no manager.
97
+ - Markers that disagree — the variable and the argument with different values, the argument
98
+ twice, or a bare or empty argument beside the variable — exit 75 at once, before the lock and
99
+ whether or not it is held, naming both markers.
100
+ - A service's own argument parser accepts the flag in both spellings and ignores it: in Python,
101
+ `add_supervisor_argument(parser)` (argparse otherwise exits 2 on an unknown flag); the sample
102
+ service adds it to the parser and to each command.
103
+ - The kits are held to the contract's `fixtures/vectors/service-supervisor.json`, and their
104
+ starts against a held lock are recorded and read as `FAC-SEM-078` reads them
105
+ (`test/*supervisors*`).
106
+
107
+ ## An app's own descriptor and the node
108
+
109
+ **An app** a person installs and starts has no supervisor (contract DEC-0069). Its descriptor says
110
+ `"lifecycle": {"manager": "person", "app": "<the installed bundle or executable>"}`, `installedBy {by: "person", role,
111
+ tool}` and no `origin`: it says the app is installed, never that it runs. The installer writes it; where there is none
112
+ (a macOS app dragged into Applications), the app writes it on a start when `app_descriptor_action` /
113
+ `appDescriptorAction` answers `write` — no descriptor yet, another version in `installedBy.tool`, or another path than
114
+ `lifecycle.app` — and never from an App Translocation path. Its live origin and process id go in its own liveness file,
115
+ rewritten on every start and removed on quit; a caller that sends anything reads that file and checks the process.
116
+ `write_descriptor` claims no port for it, and a reader that finds `lifecycle.app` gone treats the descriptor as stale.
117
+
118
+ **The node** (DEC-0061): `"lifecycle": {"manager": "node"}` is a local service Project Observatory's node installed and
119
+ supervises as its child. There is no supervisor file, so `label`, `plist`, `unit` and `task` are refused beside it; the
120
+ node starts the child with the supervisor marker (`--fabric-supervisor node` or the variable) and owns Install, Off,
121
+ Code, Uninstall and state.
82
122
 
83
123
  ## Directories
84
124
 
@@ -151,7 +191,7 @@ control character (a line break would end a unit line early).
151
191
  **Linux — a systemd user unit.** `systemd_unit(unit, argv, working_directory=…)` /
152
192
  `systemdUnit(unit, argv, {workingDirectory})` writes `Restart=always`, `RestartSec=10`,
153
193
  `TimeoutStopSec` above the drain (15 s default), `KillMode=mixed`, `WantedBy=default.target`
154
- and `FABRIC_SERVICE_SUPERVISOR=systemd`, quoting every argument (`%` → `%%`, `$` → `$$`).
194
+ and `FABRIC_SERVICE_SUPERVISOR=systemd` (always, whatever the caller passed), quoting every argument (`%` → `%%`, `$` → `$$`).
155
195
  `WorkingDirectory=` is written unquoted: systemd reads it as the rest of the line, so quotes would
156
196
  become part of the path and the unit would be refused (`systemd-analyze verify` checks it in CI). The
157
197
  descriptor says `"lifecycle": {"manager": "systemd", "unit": "<id>.<instance>.service"}`.
@@ -179,9 +219,12 @@ CI job has the real `schtasks` create, read back and delete such a task. The des
179
219
  | stop, keep off | `schtasks /End /TN <task>`, then `schtasks /Change /TN <task> /DISABLE` |
180
220
  | uninstall | `task_uninstall` / `taskUninstall`: `/End`, then `/Delete /F` |
181
221
 
182
- A task cannot set an environment variable, so a copy Task Scheduler restarts does not back off
183
- in-process; `IgnoreNew` keeps the scheduler from starting a second copy, and a hand-started copy
184
- holding the lock makes the scheduled one exit 75 once a minute until it leaves.
222
+ A task cannot set an environment variable, so `task_xml` / `taskXml` write the marker as an
223
+ argument, `--fabric-supervisor task-scheduler`, before any `--`: a copy the Task Scheduler starts
224
+ backs off in-process like one under launchd or systemd. `IgnoreNew` keeps the scheduler from
225
+ starting a second copy. Measured (FAA-38, [report](https://github.com/passioncode-ai/fabric-agent-adapter/blob/main/docs/reports/2026-10-13-faa-38-windows-exit75/README.md)):
226
+ `RestartOnFailure` does not restart a task whose action exits 75, so that wait is the only recovery there; a copy
227
+ that still exits 75 stays down until the next logon.
185
228
 
186
229
  **One copy on each system.** The Python kit takes `flock` (Linux) or a locked byte
187
230
  (Windows); the Node kit cannot, so it holds a name instead — an abstract unix socket on Linux,
@@ -192,7 +235,14 @@ holds the same name beside its file lock, so the two kits exclude each other eve
192
235
 
193
236
  **Token files on Windows.** The privacy of `service.token` is its ACL (service.md *Windows
194
237
  token files*): the kits write a protected list — the user, SYSTEM and Administrators, set before the
195
- token's bytes go in, any entry already there dropped — and refuse
196
- on read a link, a file outside the profile, another owner, or any other granted SID, naming the
197
- SID. The Node kit reads the list with Windows PowerShell 5.1 (.NET, no modules) and writes it
198
- with `icacls`; the path goes through the environment, never a command line.
238
+ token's bytes go in, any entry already there dropped. On read, `windows_token_acl_problem` /
239
+ `windowsTokenAclProblem` decide over what was read — the file's flags, its owner SID and each ACE
240
+ as `{type, sid, mask}` (DEC-0057, `FAC-SEM-079`, held to the contract's
241
+ `fixtures/vectors/windows-token.json`): a reparse point, a directory, a real path outside the
242
+ profile, another owner, an allow ACE with a non-zero mask for any other SID, an ACE of another type
243
+ than allow or deny (an object or callback ACE), or anything unreadable is refused, naming the SID;
244
+ deny ACEs and an allow with an empty mask grant nothing; SIDs compare case-insensitively. The Python
245
+ kit reads the ACEs from the file's SDDL (`acl_from_sddl`); the Node kit reads them with Windows
246
+ PowerShell 5.1 (.NET's raw descriptor, no modules), converting .NET's signed mask to the unsigned
247
+ one, and writes the list with `icacls`; the path goes through the environment, never a command line.
248
+ An inherit-only ACE applies to children, not to the file, and is not read.
@@ -1,11 +1,13 @@
1
1
  # fabric-service/0.1 — wire reference
2
2
 
3
- Pinned to `fabric-agent-contract` commit `b291bf09e0a9f9fd3c16cf540832cd021203b7d1`
3
+ Pinned to `fabric-agent-contract` commit `fe55fc67cba1a9e34a736da7d148d4fe2a8fbfa0`
4
4
  (`docs/specification/service.md`, DEC-0015; the usage report DEC-0021; Windows and Linux supervision
5
5
  DEC-0032 and DEC-0033; the operator channel DEC-0034 and DEC-0035; the embedded dashboard DEC-0036;
6
6
  delegation and the operator session's lifetime DEC-0039; the meter's call window DEC-0041; session handoff DEC-0042;
7
7
  canonical forms DEC-0043; `degraded[].setup` and `run.mcp.stdio.scope` DEC-0044; delegation sealed and trust tiers
8
- DEC-0045; runner and model profiles DEC-0046). The contract's schemas are normative;
8
+ DEC-0045; runner and model profiles DEC-0046; the estate record DEC-0055; one copy under any supervisor and its marker,
9
+ the Windows token-file reader DEC-0057; the hub key the estate certifies DEC-0060; signing credentials DEC-0063; the
10
+ estate record's 60 s skew DEC-0066). The contract's schemas are normative;
9
11
  this page is the working summary. Extension key:
10
12
  `https://fabric.passioncode.ai/agent-contract/extensions/service/0.1`.
11
13
 
@@ -29,13 +31,15 @@ File `<id>.<instance>.json`, mode 0600 (on Windows a protected ACL), atomic.
29
31
  | `protocol` | `"fabric-service/0.1"` |
30
32
  | `id`, `instance` | `^[a-z][a-z0-9-]{1,62}$`, `^[a-z][a-z0-9-]{0,31}$` (default `default`); the pair is unique per machine |
31
33
  | `name`, `summary` | ≤ 80 and ≤ 200 characters |
32
- | `origin` | `http://127.0.0.1:<port>`; the port is a machine-wide claim |
34
+ | `origin` | `http://127.0.0.1:<port>`; the port is a machine-wide claim. Optional for an app's descriptor only (`manager: "person"`, DEC-0069): its live origin and process id are in the app's own liveness file, and a descriptor without an origin claims no port (`FAC-SEM-010`) |
33
35
  | `auth` | `tokenFile` (0600; on Windows a protected ACL — owner and every granting entry the current user, SYSTEM or Administrators: service.md *Windows token files*, DEC-0032, DEC-0033); `header` default `Authorization` with `scheme` `Bearer`; any other header carries the raw token with `scheme: "none"` |
34
- | `lifecycle` | `manager` `launchd` (then `label` and `plist`), `systemd` (then `unit`, a `systemctl --user` unit), `task-scheduler` (then `task`, a per-user Scheduled Task) or `none`; `unit` and `task` are refused beside any other manager (DEC-0032). Both kits and the probe accept all four; both kits write the unit and the task (`systemd_unit`, `task_xml` / `systemdUnit`, `taskXml`) |
36
+ | `lifecycle` | `manager` `launchd` (then `label` and `plist`), `systemd` (then `unit`, a `systemctl --user` unit), `task-scheduler` (then `task`, a per-user Scheduled Task), `node` (Project Observatory's node supervises it as its child, with no supervisor file, DEC-0061), `person` (an app a person installs and starts, then `app`, the installed app, DEC-0069) or `none`; `unit` and `task` are refused beside any other manager (DEC-0032), `label` and `plist` beside any but `launchd` (DEC-0057), `app` beside any but `person`. Both kits and the probe accept all six; both kits write the unit and the task (`systemd_unit`, `task_xml` / `systemdUnit`, `taskXml`). An app's descriptor says it is installed, never that it runs: the probe checks `app` is still there (`descriptor.app-installed`) and reads no well-known document; a reader that finds the app gone treats the descriptor as stale (`app_descriptor_stale` / `appDescriptorStale`), and an app that writes its own descriptor rewrites it only when `app_descriptor_action` / `appDescriptorAction` says `write` |
35
37
  | `paths` | `data` (required), `logs[]`, optional `config`, `cache` |
36
38
  | `commands` | only `doctor` and `update`, argument arrays whose first item is an absolute or `~/` path (Windows: also `C:\…`, `C:/…` or `~\…`, never a network share — DEC-0032) |
37
39
  | `source.repository`, `fabricManifest` | optional |
38
- | `installedAt`, `installedBy` | when and by which installer version |
40
+ | `installedAt`, `installedBy` | when, and who installed it: the installer and its version as a string, or `{by, role?, tool}` (DEC-0061) — `by` `person` (with `role` `operator` or `administrator`), `node` or `organization`; `role` for a person only; `tool` the installer and its version. It names a role, never a person. An app's descriptor uses the object form with `by: "person"`. `register_remote` / `registerRemote` and the sample write the object form |
41
+ | `runner` | optional `{kind?, credentialKind}` (DEC-0061): `credentialKind` `subscription`, `key`, `platform-metered` or `none` — a kind, never a credential (`FAC-SEM-086` refuses a credential-shaped value here or in `installedBy`); a subscription names its vendor's runner (`claude-code`, `kimi-code`, `codex`) |
42
+ | `peer` | optional `{endpoint, custody, residency, maxDataClass}` (DEC-0061): the service is offered to others. `endpoint` `https://<dns-name>[:<port>][/<path>]`, never a reserved name (`FAC-SEM-085`); `custody` `organization-managed` or `personal`; `residency` 1–32 ISO 3166-1 alpha-2 codes, `EU` admitted, user-assigned codes refused; `maxDataClass` `public` < `internal` < `confidential` < `restricted`. An offer needs `runner` and never runs on a subscription. A host sends a request from anyone but the operator only when `peer_refusal` / `peerRefusal` answers null (`FAC-SEM-088`); usage rows may take `route: "platform-metered"` |
39
43
 
40
44
  ## Well-known document — `GET /.well-known/fabric-service`
41
45
 
@@ -172,8 +172,11 @@ class Probe:
172
172
  self.add("descriptor.valid", "FAIL" if problems else "PASS", "; ".join(problems) or str(self.path))
173
173
  if fs.WINDOWS:
174
174
  # DEC-0032: on Windows the file's ACL is its privacy.
175
- owner, granting = fs.windows_acl(self.path)
176
- problem = fs.token_acl_problem(self.path, owner, granting, fs.windows_user_sid())
175
+ owner, aces = fs.windows_acl(self.path)
176
+ info = os.lstat(self.path)
177
+ problem = fs.windows_token_acl_problem({"isRegularFile": stat.S_ISREG(info.st_mode), "isReparsePoint": stat.S_ISLNK(info.st_mode),
178
+ "realPathInProfile": True, "ownerSid": owner, "aces": aces}, fs.windows_user_sid())
179
+ problem = problem and problem["message"]
177
180
  self.add("descriptor.private", "FAIL" if problem else "PASS", problem or "owner-only ACL")
178
181
  else:
179
182
  mode = stat.S_IMODE(os.stat(self.path).st_mode)
@@ -186,10 +189,23 @@ class Probe:
186
189
  continue
187
190
  if key == me:
188
191
  clashes.append("%s declared again in %s" % (me, path.name))
189
- elif not self.remote and fs.placement_of(other) != "remote" and other.get("origin") == self.d.get("origin"):
192
+ # DEC-0069: a descriptor without an origin (an app's) claims no port, so two of them never clash.
193
+ elif (not self.remote and "origin" in self.d and fs.placement_of(other) != "remote"
194
+ and other.get("origin") == self.d.get("origin")):
190
195
  clashes.append("port %d also claimed by %s" % (self.port, key))
191
- unique = "a remote origin claims no port here" if self.remote else "port %d is unique" % self.port
196
+ if self.remote:
197
+ unique = "a remote origin claims no port here"
198
+ elif "origin" not in self.d:
199
+ unique = "an app's descriptor names no origin, so it claims no port (FAC-SEM-010)"
200
+ else:
201
+ unique = "port %d is unique" % self.port
192
202
  self.add("descriptor.port-claim", "FAIL" if clashes else "PASS", "; ".join(clashes) or unique)
203
+ if (self.d.get("lifecycle") or {}).get("manager") == "person":
204
+ # DEC-0069: installed, never running — a reader checks the app is still there; liveness is the app's own file.
205
+ present = fs.app_present(self.d)
206
+ self.add("descriptor.app-installed", "PASS" if present else "FAIL",
207
+ "%s is installed" % self.d["lifecycle"].get("app") if present
208
+ else "%s is gone: a reader treats this descriptor as stale" % self.d["lifecycle"].get("app"))
193
209
 
194
210
  # well-known ----------------------------------------------------------------
195
211
  def well_known_rules(self) -> None:
@@ -759,6 +775,10 @@ class Probe:
759
775
 
760
776
  def run(self) -> List[Result]:
761
777
  self.descriptor_rules()
778
+ if "origin" not in self.d and not self.remote:
779
+ self.add("well-known.answers", "NOT_RUN",
780
+ "an app's descriptor says it is installed, never that it runs; its live origin is in its own liveness file (DEC-0069)")
781
+ return self.results
762
782
  if not self.port:
763
783
  return self.results
764
784
  self.well_known_rules()