@passioncode-ai/passioncode 0.1.42 → 0.1.43

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.43 - 2026-10-12
4
+
5
+ ### Changed
6
+
7
+ - **Fabric Agent Adapter is pinned at `v0.19.0`** (it was `v0.18.0`). Fabric Agent Adapter 0.19.0 (FAA-13): both service kits keep settings backups of what the operator decided — outside the data directory, byte-identical between the kits, restored only into a fresh database and never over a row — list every spending limit a service applies in its usage report, and send the service token in the header the descriptor declares.
8
+
3
9
  ## 0.1.42 - 2026-10-12
4
10
 
5
11
  ### Changed
package/family.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "name": "fabric-agent-adapter",
9
9
  "displayName": "Fabric Agent Adapter",
10
10
  "repo": "passioncode-ai/fabric-agent-adapter",
11
- "ref": "v0.18.0",
11
+ "ref": "v0.19.0",
12
12
  "kind": "plugin",
13
13
  "path": "plugins/fabric-agent-adapter",
14
14
  "legacyPluginIds": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@passioncode-ai/passioncode",
3
- "version": "0.1.42",
3
+ "version": "0.1.43",
4
4
  "description": "The PassionCode.ai agent skill set \u2014 Fabric Agent Adapter, Observatory Log and the organisation's working rules \u2014 for Claude Code and every other agent on the machine, updated as one set.",
5
5
  "bin": {
6
6
  "passioncode": "bin/passioncode.js"
@@ -11,7 +11,7 @@
11
11
  "name": "fabric-agent-adapter",
12
12
  "displayName": "Fabric Agent Adapter",
13
13
  "source": "./plugins/fabric-agent-adapter",
14
- "version": "0.18.0",
14
+ "version": "0.19.0",
15
15
  "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.",
16
16
  "author": {
17
17
  "name": "PassionCode.ai",
@@ -35,7 +35,7 @@
35
35
  "name": "passioncode",
36
36
  "displayName": "PassionCode.ai",
37
37
  "source": "./plugins/passioncode",
38
- "version": "0.1.42",
38
+ "version": "0.1.43",
39
39
  "description": "The organisation's working rules for every contributor's agent (working-in-passioncode), and a once-a-day check that keeps the PassionCode.ai set current.",
40
40
  "author": {
41
41
  "name": "PassionCode.ai",
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "family": "passioncode",
3
- "version": "0.1.42",
3
+ "version": "0.1.43",
4
4
  "release": true,
5
5
  "members": [
6
6
  {
7
7
  "name": "fabric-agent-adapter",
8
8
  "displayName": "Fabric Agent Adapter",
9
9
  "repo": "passioncode-ai/fabric-agent-adapter",
10
- "ref": "v0.18.0",
11
- "commit": "10a8d65bb28c3eb6d0bf2d839b53efb340e42f9d",
12
- "version": "0.18.0",
10
+ "ref": "v0.19.0",
11
+ "commit": "71e230ea8b2f4bc8692c01b72e6b0310e165080d",
12
+ "version": "0.19.0",
13
13
  "via": "clone of https://***@github.com/passioncode-ai/fabric-agent-adapter.git",
14
14
  "skills": [
15
15
  "adapting-projects-to-fabric",
@@ -22,7 +22,7 @@
22
22
  "legacyMarketplaces": [
23
23
  "fabric-agent-adapter"
24
24
  ],
25
- "contentHash": "sha256:bf6c40c50d4c5c4ca165191ae0ce0c5edfcb7744729b8384fd75c5b921331b05",
25
+ "contentHash": "sha256:32a736b99e38a61e48316eaa240702bc0051c327e9a3fd8f455025853a851d2c",
26
26
  "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.",
27
27
  "author": {
28
28
  "name": "PassionCode.ai",
@@ -61,16 +61,16 @@
61
61
  "name": "passioncode",
62
62
  "displayName": "PassionCode.ai",
63
63
  "repo": "passioncode-ai/passioncode",
64
- "ref": "v0.1.42",
64
+ "ref": "v0.1.43",
65
65
  "commit": null,
66
- "version": "0.1.42",
66
+ "version": "0.1.43",
67
67
  "via": "this repository",
68
68
  "skills": [
69
69
  "working-in-passioncode"
70
70
  ],
71
71
  "legacyPluginIds": [],
72
72
  "legacyMarketplaces": [],
73
- "contentHash": "sha256:44d408186f1bbeec38fd7d033b0141ee9b581cdc4dc9dc64a96938df288c15e9",
73
+ "contentHash": "sha256:9c3906e6e474edcd4ee277da795ab5f7c65049c634b4865e18cf40b531e4c1e0",
74
74
  "description": "The organisation's working rules for every contributor's agent (working-in-passioncode), and a once-a-day check that keeps the PassionCode.ai set current.",
75
75
  "author": {
76
76
  "name": "PassionCode.ai",
@@ -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.",
6
- "version": "0.18.0",
6
+ "version": "0.19.0",
7
7
  "author": {
8
8
  "name": "PassionCode.ai",
9
9
  "url": "https://passioncode.ai/"
@@ -5,7 +5,7 @@ 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.18.0"
8
+ version: "0.19.0"
9
9
  contract-version: "0.1.0"
10
10
  contract-commit: "0cacd08b0e95b6abf131eae1206b60792138bc3c"
11
11
  ---
@@ -16,7 +16,7 @@ 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.18.0"
19
+ version: "0.19.0"
20
20
  contract-version: "0.1.0"
21
21
  extension: "fabric-service/0.1"
22
22
  extension-commit: "0cacd08b0e95b6abf131eae1206b60792138bc3c"
@@ -228,8 +228,12 @@ log, retention and notification policy.
228
228
 
229
229
  An agent that calls paid models reports **what it spent**: one receipt per call from the
230
230
  provider's own usage numbers, served behind the token at `surfaces.usage` as the DEC-0021 usage
231
- report. An unknown cost is null, never 0. Read [the usage reference](references/usage.md)
232
- before wiring it.
231
+ report. An unknown cost is null, never 0. It lists **every** spending limit the service applies
232
+ in `budgets`, enforced or not. Read [the usage reference](references/usage.md) before wiring it.
233
+
234
+ A service whose store holds what the operator decided keeps **settings backups** outside its data
235
+ directory, restores only on a fresh database and never overwrites. Read
236
+ [the settings backups reference](references/settings-backups.md).
233
237
 
234
238
  ## Step 6 — verify
235
239
 
@@ -11,6 +11,15 @@
11
11
 
12
12
  The feed is a view: never copy rows into a second store that can drift from the first.
13
13
 
14
+ ## Reading a feed (FAC-SEM-036)
15
+
16
+ A client of `GET /fabric/v1/events` — or of any token-protected route — sends the token in the
17
+ header the descriptor's `auth.header` names, in the form `auth.scheme` names: the raw token for
18
+ `none`, `Bearer <token>` for `Bearer`. Never assume `Authorization: Bearer`: a client that did
19
+ was refused on every poll and silently dropped every notify event. `token_header(auth, token)` /
20
+ `tokenHeader(auth, token)` gives the one header; the token never travels in another header or
21
+ in the URL.
22
+
14
23
  ## Writing an event
15
24
 
16
25
  - `kind`: dotted, stable, past tense or state (`job.failed`, `job.awaiting_choice`,
@@ -88,6 +88,7 @@ remove; the back-off only stops the loop from costing the machine.
88
88
  | logs | `~/Library/Logs/<id>/` | `${XDG_STATE_HOME:-~/.local/state}/<id>/logs/` | `%LOCALAPPDATA%\<id>\Logs\` |
89
89
  | cache (deletable any time) | `~/Library/Caches/<id>/` | `${XDG_CACHE_HOME:-~/.cache}/<id>/` | `%LOCALAPPDATA%\<id>\Cache\` |
90
90
  | code | `~/.local/share/<id>/releases/…` | same | under `%LOCALAPPDATA%` too, never a network share |
91
+ | settings backups ([DEC-0025](settings-backups.md)) | `~/Library/Application Support/PassionCode/settings-backups/<id>/<instance>/` | `${XDG_CONFIG_HOME:-~/.config}/PassionCode/settings-backups/…` | `%APPDATA%\PassionCode\settings-backups\…` |
91
92
 
92
93
  A repository that versions the data itself (a registry, a plan) may hold the data; the
93
94
  service's own code checkout and its releases may not. Directories 0700, secret files 0600. A store carries a schema version and the service
@@ -0,0 +1,67 @@
1
+ # Settings backups — what the operator decided survives the data directory (DEC-0025)
2
+
3
+ Fabric Agent Contract DEC-0025, `docs/specification/service.md` → *Settings backup*, schema
4
+ `schemas/settings-backup.schema.json`, rule `FAC-SEM-035`. A service whose store holds what the operator
5
+ decided — which projects it serves, how each is bound, which secret slot each binding uses, their overrides —
6
+ SHOULD keep settings backups, so a lost, purged or wrongly migrated data directory costs the operator nothing.
7
+
8
+ ## Where
9
+
10
+ `<root>/settings-backups/<id>/<instance>/settings-<UTC %Y%m%dT%H%M%S%fZ>.json`, outside the data directory:
11
+
12
+ | System | `<root>` (`settings_backup_root` / `settingsBackupRoot`) |
13
+ |---|---|
14
+ | macOS | `~/Library/Application Support/PassionCode` |
15
+ | Windows | `%APPDATA%\PassionCode` |
16
+ | Linux | `$XDG_CONFIG_HOME/PassionCode`, default `~/.config/PassionCode` |
17
+
18
+ `settings_backup_dir(id, instance)` / `settingsBackupDir(id, instance)` names the folder. Directories are 0700
19
+ (on Windows a protected ACL), files 0600, writes atomic.
20
+
21
+ ## Take a snapshot
22
+
23
+ ```python
24
+ dirs = fs.settings_backup_dir(ID, INSTANCE)
25
+ if fs.backup_due(dirs): # none yet, or the newest is older than 24 hours
26
+ doc = fs.make_settings_backup(service_id=ID, instance=INSTANCE, version=VERSION, schema=SCHEMA_VERSION,
27
+ tables=allow_listed_tables(db), reason="start") # or daily, uninstall, manual
28
+ fs.write_settings_backup(doc, dirs) # None when unchanged; keeps the 14 newest
29
+ ```
30
+
31
+ ```js
32
+ const dir = k.settingsBackupDir(ID, INSTANCE);
33
+ if (k.backupDue(dir)) k.writeSettingsBackup(k.makeSettingsBackup({ id: ID, instance: INSTANCE, version, schema, tables, reason: 'daily' }), dir);
34
+ ```
35
+
36
+ - **Tables on an allow-list**, each `{"columns": [...], "rows": [[...], ...]}` of JSON scalars. A fraction is its
37
+ decimal string (`"0.25"`), binary data is never stored, and an integer stays within ±(2^53 − 1).
38
+ - **Secrets by name only.** `make_settings_backup` refuses a table that can only hold connections, tokens,
39
+ secrets, credentials, passwords, login codes or sessions, and a column whose name says it holds a credential
40
+ value (`access_token`, `client_secret`); `secret_name` and `token_slot` pass. The names cannot see values, so
41
+ back up what is on the allow-list, never everything except a deny-list.
42
+ - **When:** at start when `backup_due`, then daily; on uninstall a last one, read-only (open the store without
43
+ migrating or writing). An unchanged snapshot is not rewritten; a temporary file an interrupted write left is
44
+ removed first. A fresh, empty database writes none: it would hide the good snapshot before it is restored.
45
+ - Both kits write byte-identical files (`test/fabric-service-backups.test.mjs`, last case).
46
+
47
+ ## Read and restore
48
+
49
+ `read_settings_backup` / `readSettingsBackup` refuses a file whose checksum, counts or row widths disagree with
50
+ its tables, that carries a value with no canonical form, or whose `format` it does not know, naming why
51
+ (`FAC-SEM-035`). The checksum is SHA-256 of the settings canonical form of `tables`
52
+ (`settings_canonical_json` / `settingsCanonicalJson`: Python's `json.dumps(sort_keys=True,
53
+ ensure_ascii=False)`).
54
+
55
+ Restore **adds and never overwrites**:
56
+
57
+ ```python
58
+ path, doc, skipped = fs.newest_intact_backup(dirs) # the newest intact snapshot with content; damaged ones named
59
+ plan = fs.restore_plan(doc, {"projects": {"columns": [...], "key": ["id"], "required": ["id", "name"],
60
+ "existing": existing_keys("projects")}})
61
+ # plan["tables"]["projects"]: insert, present, droppedColumns, defaultedColumns, missingRequired, refused
62
+ ```
63
+
64
+ - **Automatic restore** only on a *fresh* database — no domain records **and** the service has never started —
65
+ so a restart never undoes a deletion. Insert `plan[...]["insert"]` and add every row the database refuses to
66
+ `refused` with its key and reason.
67
+ - **Manual restore** shows the plan first; applying it is the operator's act, never an agent's.
@@ -50,6 +50,29 @@ left out.
50
50
  **Budget.** Pass `budget` only if the service **enforces** that limit itself. The report states
51
51
  it, and the host only shows it.
52
52
 
53
+ **Every limit (DEC-0027).** Pass `budgets` to list every spending limit the service applies,
54
+ enforced or not, so the spend view shows all of them — the operator asked for that on 2026-10-07:
55
+
56
+ ```python
57
+ ledger.report(service_id=ID, budget={"period": "month", "limitUsd": 100}, budgets=[
58
+ {"id": "machine.monthly", "scope": "machine", "kind": "monthly", "period": "month", "limitUsd": 100, "enforced": True},
59
+ {"id": "project.demo.daily", "scope": "project", "subject": "demo", "kind": "daily", "windowSeconds": 86400,
60
+ "limitUsd": 5, "spentUsd": 0.31, "enforced": True},
61
+ {"id": "job.cap", "scope": "job", "kind": "per_job", "limitUsd": 2, "enforced": True},
62
+ ])
63
+ ```
64
+
65
+ - A machine limit with a `period` and no `spentUsd` is counted by the kit from the receipts, the
66
+ way `budget` is, so `budget` and its twin in `budgets` never disagree. A per-order limit
67
+ (`per_job`, `approval`) gets `spentUsd: null`. Every other limit states its own spend.
68
+ - `scope` is `machine`, `project`, `pool` or `job`; a `project` or `pool` limit names its
69
+ `subject`. A limit has at most one window — `period`, `windowSeconds` or `since` — and it agrees
70
+ with the kind (`daily`: the day or 86400 s; `monthly`: the month or 28–31 days; `velocity`: a
71
+ rolling window). `tripped: true` (work stopped by it now) needs `enforced: true`. An unknown
72
+ kind is shown generically, never refused.
73
+ - The kits refuse a report that breaks these (`usage_limit_problems` / `usageLimitProblems`,
74
+ `FAC-SEM-031`). A breach is not refused: the report shows it, and the host shows it first.
75
+
53
76
  Call `ledger.prune()` at start (or daily) to keep the file at the reported window (LC-12).
54
77
 
55
78
  `JsonlUsageLedger` appends 0600 JSON lines. A line torn by a killed writer is skipped, and the
@@ -162,10 +162,9 @@ class Probe:
162
162
  conn.close()
163
163
 
164
164
  def auth_headers(self) -> Dict[str, str]:
165
- auth = self.d.get("auth", {})
166
- header = auth.get("header", "Authorization")
167
- value = self.token or ""
168
- return {header: ("Bearer " + value) if auth.get("scheme", "Bearer") == "Bearer" else value}
165
+ # The header and form the descriptor declares, never an assumed `Authorization: Bearer` (FAC-SEM-036).
166
+ name, value = fs.token_header(self.d.get("auth"), self.token or "")
167
+ return {name: value}
169
168
 
170
169
  # descriptor ------------------------------------------------------------
171
170
  def descriptor_rules(self) -> None: