@passioncode-ai/fabric-agent-adapter 0.57.0 → 0.59.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 (21) hide show
  1. package/CHANGELOG.md +106 -0
  2. package/COMMERCIAL-LICENSE.md +1 -1
  3. package/README.md +17 -6
  4. package/SECURITY.md +6 -1
  5. package/package.json +1 -1
  6. package/plugins/fabric-agent-adapter/.claude-plugin/plugin.json +1 -1
  7. package/plugins/fabric-agent-adapter/skills/adapting-projects-to-fabric/SKILL.md +18 -3
  8. package/plugins/fabric-agent-adapter/skills/adapting-projects-to-fabric/references/operator-channel-and-repository.md +4 -1
  9. package/plugins/fabric-agent-adapter/skills/adapting-projects-to-fabric/references/source-and-instance.md +179 -0
  10. package/plugins/fabric-agent-adapter/skills/adapting-projects-to-fabric/scripts/fabric_source_check.py +995 -0
  11. package/plugins/fabric-agent-adapter/skills/adapting-projects-to-fabric/scripts/fabric_source_homes.py +72 -0
  12. package/plugins/fabric-agent-adapter/skills/adapting-projects-to-fabric/scripts/fabric_source_ignore.py +185 -0
  13. package/plugins/fabric-agent-adapter/skills/building-fabric-services/SKILL.md +15 -17
  14. package/plugins/fabric-agent-adapter/skills/building-fabric-services/references/package.md +22 -0
  15. package/plugins/fabric-agent-adapter/skills/building-fabric-services/scripts/kit.json +181 -1
  16. package/plugins/fabric-agent-adapter/skills/creating-fabric-agents/SKILL.md +29 -8
  17. package/plugins/fabric-agent-adapter/skills/creating-fabric-agents/references/operator-channel-and-repository.md +4 -1
  18. package/plugins/fabric-agent-adapter/skills/creating-fabric-agents/references/source-and-instance.md +179 -0
  19. package/plugins/fabric-agent-adapter/skills/creating-fabric-agents/references/where-agents-run.md +23 -1
  20. package/plugins/fabric-agent-adapter/skills/working-with-fabric/SKILL.md +1 -1
  21. package/plugins/fabric-agent-adapter/skills/working-with-fabric/scripts/fabric_session_env.py +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,111 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.59.0 (2026-11-03)
4
+
5
+ Portable from day 0 (FAA-191, RM-36): on top of 0.58.0's source and instance, every new agent gets a data home, a
6
+ data kind and an uptime category, and a new private agent a `LICENSE` naming its copyright holder, from its first commit, and runs the transfer
7
+ audit at every release until the contract's export (CT-194) replaces it.
8
+
9
+ ### Added
10
+
11
+ - creating-fabric-agents' intake grill asks three more rows: **Does it run around the clock?** (uptime category A, a
12
+ cloud host from the first release, Heroku unless a reason names another, from the cloud Fabric-server template once
13
+ its repository exists; or B, a local service only), **Whose data does it keep?** (kind U, data of people outside the
14
+ owner's team, never in the source, a copy or its tests; or O; in doubt U) and **Who holds the copyright?**
15
+ - Step 2 gives the data a home of its own, `<agent>-data` (a folder beside the checkout or a private repository of
16
+ that name), and the README names the data kind and the uptime category; an agent someone builds for themselves gets
17
+ a `LICENSE` naming the holder (all rights reserved unless the owner gives other terms).
18
+ - Step 5: every release runs `fabric_source_check.py check` as the transfer audit, in Git mode on the checkout and
19
+ with `--every-file` on a clean copy of what Git would commit (building-fabric-services' `references/package.md`).
20
+ references/source-and-instance.md adds why never the checkout (its ignored configuration and dependency folders
21
+ `--every-file` reads too), and that a `LICENSE` whose holder is on the owner's list is named in
22
+ `.fabric-source-ignore`, since authorship travels with the source.
23
+ - references/source-and-instance.md (both skills): *The data home and its kind*; references/where-agents-run.md:
24
+ *Uptime: A or B* and a checklist line. building-fabric-services' Step 0 answers carry the same (data kind, data
25
+ home, uptime, holder, the audit per release).
26
+ - Scenario evals `portable-from-day-zero` (creating-fabric-agents) and `new-service-names-data-and-uptime`
27
+ (building-fabric-services), a trigger, and `test/test_portable_from_day_zero_prose.py` pinning the prose to them.
28
+
29
+ ### Changed
30
+
31
+ - The eval `own-agent-licence-is-the-owners-choice` expects a `LICENSE` naming the holder; still no AGPL or
32
+ commercial licence files unasked. The shared operator-channel reference and building-fabric-services say the same
33
+ for an agent built new, and that the kit files the adapter copies in keep their own licence
34
+ (`AGPL-3.0-only OR LicenseRef-PassionCode-Commercial`); adapting-projects-to-fabric leaves an existing agent's
35
+ licence as it is.
36
+ - where-agents-run.md: Heroku is the default host of an A agent unless it runs in the person's or an organization's
37
+ PassionCode cloud or is sold; an A agent's data lives in a durable store, never the host's own folder (source-and-instance.md's
38
+ data home says the same for a host that does not keep its disk), and on a host with no Fabric hub it answers only
39
+ what reaches its own origin.
40
+ - building-fabric-services' gotchas are shorter (the same rules); `test_fabric_kit` runs its by-path load with `-B`.
41
+
42
+ ### Upgrading
43
+
44
+ - Nothing to change for an existing agent: an adapted project keeps its licence, data and release checks as they
45
+ are. A new one answers the three grill rows before its first commit.
46
+
47
+ ## 0.58.0 (2026-11-03)
48
+
49
+ Portable agents, part 1 (FAA-188, RM-36): an agent keeps its source apart from its instance from its first commit, and
50
+ a local check finds instance data in a source tree without repeating it. The manifest of a source, its export and
51
+ import wait for the contract's decision on CT-194 (part 2).
52
+
53
+ ### Added
54
+
55
+ - **`fabric_source_check.py check`** (adapting-projects-to-fabric) reads the files a source would carry (what Git would
56
+ commit; every file but the dependency folders it names when Git lists none; or with `--every-file`, which reads
57
+ what `pack` carries) and reports, by path, line and kind: a path inside a person's home folder
58
+ (`home-path`: an ASCII home name in the macOS, Linux (`/home`, `/var/home`) and Windows forms (Git Bash's `/c/Users`
59
+ and WSL's `/mnt/c/Users` included), the dashed form of DEC-0105 (`C--Users-` on Windows; a name holding a space, a dash, a dot, an underscore or an apostrophe is declared with `home: <name>` to be read whole there) and the URL-encoded ones; a web route `/users/...`, a flag `--home-dir` or a CSS variable is not one), a
60
+ value shaped like a credential by the contract's detector read line by line, a long random value under a
61
+ credential's name (a whole Ed25519 signature under a JSON `"sig"`, `"signature"` or `"signatures"` member, as `sign` writes it, is public and not one; a storage URL's `sig=` is) or a private key: a PEM, OpenSSH or PGP block, or a JWK's `d` (JSON, escaped JSON or a Python dict), a URL carrying a password (8 or more characters with at least one letter and one digit) or a credential in its query (percent-encoded, JSON-escaped or nested), and a
62
+ file that is a credential by its name as `pack` refuses it, or a kit credential file (`*.token`,
63
+ `board.credential`) (`secret`), and a string from the owner's list of instance strings, kept
64
+ outside the tree in the user's configuration folder (`instance-string`, in a file, its path or a link's target). It
65
+ never prints a value it found, a line that holds one, an entry of the owner's list or the folder it checks: a file's
66
+ path is checked like its text and printed with an entry as `<line N>`, a home name as `<home>` and a segment holding a
67
+ credential-shaped value as `<secret>`. Every text file is read whole; a binary, unreadable or (in Git mode) nested-repository path is listed as not
68
+ read (check a nested repository in its own tree, then name it in the ignore file; before `pack`, check it with
69
+ `--every-file` too). It changes nothing: exit 0 with no finding and every file read, 1 with a finding, 2 when it cannot run or a file
70
+ was not read (a binary file counts unless the ignore file names it as source). `.fabric-source-ignore` and
71
+ `--exclude` leave out named files of synthetic test values (and a project `.npmrc` that holds no credential: `pack`
72
+ still refuses it, so the package is a copy without it), and the summary counts them. A line is a path from the
73
+ root, not as `.gitignore` reads one: a line with no `/` matches at the root only, a wildcard line takes only what
74
+ it matches (`*` stays in a folder, `**` crosses folders), and a line ending in `/`, or a path with no wildcard,
75
+ takes the folder; a nested repository or a submodule is left out only by a line naming its folder (`vendor/sub/`),
76
+ never by `vendor/*`, and a wildcard folder line (`vendor/*/`) takes every one it reaches, checked or not, so name
77
+ each by its path; an exception line (`!`), a line holding `\`, `//`, an unclosed `[` or a POSIX class, and a
78
+ glob it cannot read are refused. Git is run as `git ls-files` with its fsmonitor off and without the caller's `GIT_DIR` or index, taken only from PATH's
79
+ absolute folders (with PATH unset, `/bin` and `/usr/bin`; on Windows only a `git.exe`, and none with PATH unset). Under a locale whose file-system encoding is not UTF-8 it restarts itself in Python's UTF-8 mode, so names, arguments and text are read in one encoding; an owner's entry is compared composed (NFC), so it finds a name macOS stored decomposed. A neutral home (container, cloud and CI users, first names such as `alice` and accounts such as `admin`; an owner whose own home is a first name, an account or one or two letters writes `home: <name>` in the owner's list, the whole name, spaces included, which is then read in every form, while a container's, a cloud image's or a CI runner's user that only the image uses, such as `node` or `vscode`, is never declared; the owner's own machine's home is declared even when its name is an image user's (`ubuntu`, `admin`), and an image's paths under it then go through a build argument that names the user; a folder holding a typographic apostrophe is listed as a plain string with it kept and declared too with `home:` written with `'`) and
80
+ a value that says it is synthetic are not findings. Standard library only; the adapter's own tree passes it, with its
81
+ contract vectors, eight test files and its icon named in its `.fabric-source-ignore` (`test_source_check`).
82
+ `building-fabric-services/references/package.md` runs it with `--every-file` before `pack`, on a clean copy it
83
+ describes: what Git would commit and the nested trees checked on their own, each committed symbolic link replaced
84
+ by its committed target or removed and reviewed, shared source copied in and committed, dependency folders and
85
+ what `pack` refuses left out; SECURITY.md names what it reads.
86
+ - **references/source-and-instance.md** (both skills): the layout (instance values in a configuration outside the
87
+ repository with a neutral default and a committed `*.example`, records and state documents in the kit's data folder,
88
+ keys by name, fixtures on neutral ids; the supervisor label and `createdBy` name the publisher until CT-194) and the
89
+ check. It is registered as a shared reference (`test_shared_references`).
90
+ - creating-fabric-agents step 2 lays an agent out as source and instance and calls the skeleton done, once the owner has reviewed it (a floor, not a secret scanner), when the check
91
+ exits 0; step 5 runs it again. adapting-projects-to-fabric step 4c runs the check first, moves each finding out and
92
+ runs it again; a value already in Git history needs a fresh history, which stays the owner's act. Step 7's report
93
+ names a contract checkout by its commit, never a home path, and the check runs again after it. The check's ignore-line
94
+ reading is `fabric_source_ignore.py` and its reading of a declared home `fabric_source_homes.py`, both beside it, and the owner's list takes `home: <name>` for the owner's own home name.
95
+ - Trigger and scenario evals for both (`source-apart-from-instance`, `move-instance-data-out-of-an-existing-agent`);
96
+ the Windows CI job runs `test_source_check`; the release smoke checks the script is installed. README, AGENTS.md and
97
+ SKILL-CARD name it.
98
+
99
+ ### Changed
100
+
101
+ - `COMMERCIAL-LICENSE.md` is the knowledge base template as of fabric-workspace `875faae2` (line 5 now uses a comma
102
+ where it had a dash); the hash `test/validate.py` pins moved with it. The licence terms are unchanged.
103
+
104
+ ### Upgrading
105
+
106
+ - Nothing to change: the check is new and opt-in. Handing a source over (a new remote, a push, a change of
107
+ visibility) stays the owner's act each time; the check reads the tree, never Git history.
108
+
3
109
  ## 0.57.0 (2026-10-28)
4
110
 
5
111
  The contract pin moves to `3830a33` (`v0.1.0+2026-10-27.6`) from `00e050ba` (FAA-176).
@@ -2,7 +2,7 @@
2
2
 
3
3
  This repository is open source under the [GNU Affero General Public License v3.0](LICENSE)
4
4
  (`AGPL-3.0-only`). PassionCode.ai also offers it under a commercial license, for use that does not
5
- meet the AGPL's terms — for example inside a closed-source product, or as a modified hosted
5
+ meet the AGPL's terms, for example inside a closed-source product, or as a modified hosted
6
6
  service whose source is not published.
7
7
 
8
8
  To obtain a commercial license, tell us about your use at **https://passioncode.ai/business/**, or write to **commercial@passioncode.ai**.
package/README.md CHANGED
@@ -124,7 +124,10 @@ For provider bundles the adapting skill helps an agent author:
124
124
  - scaffold a version-pinned provider manifest, schemas, safe fixture, probes, and
125
125
  conformance report;
126
126
  - distinguish structural validation from live protocol negotiation, semantic
127
- admission, and project binding.
127
+ admission, and project binding;
128
+ - keep the agent's source apart from its instance data, with `scripts/fabric_source_check.py check`, which reports a
129
+ home path, a credential-shaped value or a string from the owner's list by path, line and kind and never repeats it
130
+ (FAA-188).
128
131
 
129
132
  The skill never treats generated files as admission. Fabric contract `0.1.0` does not
130
133
  yet ship the host registry/runtime needed to connect and authorize a live provider.
@@ -266,13 +269,21 @@ python3 "$SKILL_DIR/scripts/adapt_project.py" check /path/to/project \
266
269
  ```
267
270
 
268
271
  Pack, sign and verify an agent as a `fabric-package/1` folder (contract DEC-0050, DEC-0051; nothing is written without
269
- `--apply`, and the key file is the person's, never made or kept here):
272
+ `--apply`, and the key file is the person's, never made or kept here). First check the checkout, then make the clean
273
+ copy [the package reference](plugins/fabric-agent-adapter/skills/building-fabric-services/references/package.md)
274
+ describes and check that with `--every-file`, since it is what `pack` carries (a path named in `.fabric-source-ignore`
275
+ or `--exclude` is carried unread; a nested repository is checked in its own tree with `--every-file`):
270
276
 
271
277
  ```bash
272
- npx @passioncode-ai/fabric-agent-adapter pack ./example-agent # the digest, agentRef and every problem
273
- npx @passioncode-ai/fabric-agent-adapter pack ./example-agent --apply
274
- npx @passioncode-ai/fabric-agent-adapter sign ./example-agent --key ./publisher.jwk --apply
275
- npx @passioncode-ai/fabric-agent-adapter verify ./example-agent --trust ./trust.json
278
+ python3 plugins/fabric-agent-adapter/skills/adapting-projects-to-fabric/scripts/fabric_source_check.py check ./example-agent
279
+ python3 plugins/fabric-agent-adapter/skills/adapting-projects-to-fabric/scripts/fabric_source_check.py check ./example-agent-clean --every-file
280
+ ```
281
+
282
+ ```bash
283
+ npx @passioncode-ai/fabric-agent-adapter pack ./example-agent-clean # the clean copy: the digest, agentRef, every problem
284
+ npx @passioncode-ai/fabric-agent-adapter pack ./example-agent-clean --apply
285
+ npx @passioncode-ai/fabric-agent-adapter sign ./example-agent-clean --key ~/.config/example-publisher/publisher.jwk --apply # a key outside any checkout
286
+ npx @passioncode-ai/fabric-agent-adapter verify ./example-agent-clean --trust ./trust.json
276
287
  ```
277
288
 
278
289
  See [the package reference](plugins/fabric-agent-adapter/skills/building-fabric-services/references/package.md).
package/SECURITY.md CHANGED
@@ -57,4 +57,9 @@ bounded and non-publishing until explicit scoped grants exist in a project bindi
57
57
  executing it and writes only the seven documented bundle paths (`scaffold --dry-run`
58
58
  writes nothing); `check --contract` runs the contract checkout's own
59
59
  `node_modules/.bin/tsx` and installs nothing. `fabric_provider.py write` writes one
60
- entry (0600) in the providers directory.
60
+ entry (0600) in the providers directory. `fabric_source_check.py check` reads the files of a
61
+ tree (credential values included, in memory only), the owner's list from the user's
62
+ configuration folder, and runs `git ls-files` (without the caller's `GIT_DIR` or other Git
63
+ location variables) and nothing else, except that under a locale whose
64
+ file-system encoding is not UTF-8 it restarts itself once with the same interpreter in Python's
65
+ UTF-8 mode; it writes nothing and prints no value it finds.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@passioncode-ai/fabric-agent-adapter",
3
- "version": "0.57.0",
3
+ "version": "0.59.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.57.0",
6
+ "version": "0.59.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.57.0"
8
+ version: "0.59.0"
9
9
  contract-version: "0.1.0"
10
10
  contract-commit: "3830a3353923e20f826d466610e1c479f120bec0"
11
11
  ---
@@ -159,6 +159,19 @@ A provider entry only describes an MCP server: a CLI that does not speak MCP get
159
159
  announced by its `local-runner` manifest (step 3). An agent that runs as a service uses a
160
160
  descriptor instead (`building-fabric-services`).
161
161
 
162
+ ### 4c. Keep the instance out of the source
163
+
164
+ An agent's source (what its owner could hand over) and its instance (records, logs, keys, the owner's names and paths,
165
+ its configuration) are kept apart; load [the source and the instance](references/source-and-instance.md). First run
166
+ [`scripts/fabric_source_check.py`](scripts/fabric_source_check.py) `check <project-root>`, with the owner's list of
167
+ their own strings or a note that none was given (when the owner's own home name is neutral, has one or two letters,
168
+ or holds a space, `.`, `_`, `-` or `'`, the list gains `home: <name>` first, the reference's rule; a container's, a cloud image's or a CI runner's user that only the image uses, such as `node` or `vscode`, is never declared): it reports instance data by
169
+ path, line and kind, never repeating a value, and changes nothing. Then move each finding out in the source: an
170
+ instance value into the instance configuration outside the repository, read through a named variable with a neutral
171
+ default and a committed `*.example`; a key into the secret store, named only. Run the check again until it exits 0; it is a floor under the owner's review, not a secret scanner.
172
+ A value already committed stays in Git history: say so; a fresh history is the owner's act (no history rewrite, no
173
+ force-push).
174
+
162
175
  ### 5. Make probes safe and meaningful
163
176
 
164
177
  For each capability, create at least one bounded fixture that:
@@ -208,7 +221,8 @@ Update `fabric/FABRIC-CONFORMANCE.md` with dated receipts for:
208
221
  3. bounded semantic probes;
209
222
  4. project-binding readiness.
210
223
 
211
- Include commands and exit codes, immutable endpoint or artifact identities, and explicit
224
+ Include commands and exit codes (a contract checkout named by its commit or `<contract>`, never a home path; run the
225
+ source check again after), immutable endpoint or artifact identities, and explicit
212
226
  unverified surfaces. If live Fabric admission/runtime does not yet exist, the last gates
213
227
  remain `NOT_VERIFIED`; the completed deliverable is an adaptation-ready provider bundle,
214
228
  not a connected provider.
@@ -228,7 +242,8 @@ relayed, DEC-0121). An agent with neither stops nor notify events skips this ste
228
242
  repository standard (`knowledge/repository-standard.md`) from its first commit: the licence files,
229
243
  the README quick start verified with a real client, `AGENTS.md` and `CLAUDE.md`, listed in the
230
244
  shared reference above. An agent someone builds for themselves is not a PassionCode.ai repository:
231
- its licence is its owner's choice and none of those files is required of it.
245
+ its licence is its owner's choice and none of those files is required of it (an agent built new with
246
+ creating-fabric-agents carries a `LICENSE` naming its holder; an existing one keeps what it has).
232
247
 
233
248
  ## Completion format
234
249
 
@@ -63,4 +63,7 @@ the project).
63
63
  org-index `scripts/check_format.py` reports 0 findings for it before it is called done. An agent
64
64
  someone builds for themselves is not a PassionCode.ai repository: its licence is its owner's
65
65
  choice, nothing about it is published or listed by the organization, and none of these files is
66
- required of it, though the verified MCP quick start is still how anyone learns to drive it.
66
+ required of it, except that an agent built new carries a `LICENSE` naming the copyright holder (all rights reserved
67
+ unless the owner gives other terms), as does a new private agent built for a client; files the adapter copies in (the service kit, the dashboard kit) keep their own
68
+ licence, `AGPL-3.0-only OR LicenseRef-PassionCode-Commercial` ([COMMERCIAL-LICENSE.md](https://github.com/passioncode-ai/fabric-agent-adapter/blob/main/COMMERCIAL-LICENSE.md)).
69
+ The verified MCP quick start is still how anyone learns to drive it.
@@ -0,0 +1,179 @@
1
+ # The source and the instance
2
+
3
+ An agent is two things. Its **source** is what can be handed to someone else: code, skills, prompts, schemas,
4
+ examples, the source documentation. Its **instance** is what belongs to one installation: records, logs, journals,
5
+ keys, the owner's names and paths, accounts, hosts and its configuration. A new agent keeps the two apart from its
6
+ first commit, so that its owner can hand the source over later without rewriting its history. Nothing is handed over
7
+ by itself: handing over, a new remote, a push or a change of visibility stays the owner's act, each time (a personal
8
+ agent stays private until its owner says so about that act).
9
+
10
+ The format of a source manifest, export and import is the contract's to decide (CT-194). What follows does not depend
11
+ on it.
12
+
13
+ ## Contents
14
+
15
+ - [The layout](#the-layout)
16
+ - [The data home and its kind](#the-data-home-and-its-kind)
17
+ - [The check](#the-check)
18
+
19
+ ## The layout
20
+
21
+ | Where | What | In Git |
22
+ |---|---|---|
23
+ | the repository | code, skills, prompts, schemas, the source documentation, fixtures on neutral ids (`example-agent`, `/Users/example`) | yes |
24
+ | `config/<name>.example.json` (or `.env.example`, `*.example.yaml`) | every instance value the agent reads, with a neutral default: the repository address of the owner's account, folders, the owner, account ids, hosts | yes, the example only |
25
+ | the instance folder, outside the repository | the real configuration, records (a database included), logs, journals, state documents | never in the source's repository (a separate private repository of the owner's data belongs to the instance) |
26
+ | the secret store | key values; the source names each key by name only (`EXAMPLE_API_KEY`) | never |
27
+
28
+ - **The instance folder is the agent's data folder.** An agent that is not a kit service reads it through one named
29
+ variable (`<AGENT>_DATA_DIR`) that overrides its default. A service built with `building-fabric-services` takes the
30
+ kit's folders unchanged (the Directories table in its `references/lifecycle.md`, `fabric_paths.service_dirs`): on macOS `~/Library/Application Support/<id>/`,
31
+ on Linux `${XDG_DATA_HOME:-~/.local/share}/<id>/`, on Windows `%LOCALAPPDATA%\<id>\`. An agent's second context
32
+ (an organization's) is a sibling instance, `<id>.<instance>`, never a folder inside the personal one
33
+ (`references/estate-record.md` of that skill).
34
+ - **Ignore the instance in the source**: `.gitignore` names the real configuration (`config/*.json` with
35
+ `!config/*.example.json`), an instance folder an existing project still keeps inside the checkout, and what running
36
+ the agent leaves (`__pycache__/`, `*.pyc`), which the check would otherwise report as binary in Git mode.
37
+ - **State documents are instance data.** A handoff, a decision log or a backlog about this codebase is source
38
+ documentation; a record of what this installation did (runs, conversations, the owner's notes, a journal) lives in
39
+ the instance folder.
40
+ - **Keys by name.** The README's Configure section lists key names, the agent reads each from its environment or the
41
+ secret store, and no value is ever written to a file, a fixture, an argument or a commit.
42
+ - **Fixtures on neutral ids.** A test that needs a home folder, an owner or an account uses `example`, `example-agent`,
43
+ `owner@example.com` or a one-letter home, and a credential-shaped test value says it is synthetic
44
+ (`sk-test-not-a-key`) or is assembled at run time.
45
+ - **Two names stay in the source until the contract decides (CT-194).** A service's supervisor label is the agent's
46
+ own name, reverse-DNS on the publisher's domain (`com.example.example-agent`), and `AGENTS.md` names it (LC-09):
47
+ never the owner's account or name. A provider's `createdBy` names the publisher; until one is chosen it
48
+ keeps the scaffold's sentinel, and a person's name or account is never written there. The adapter moves both when the
49
+ contract decides how an instance renames them (FAA-188 part 2).
50
+
51
+ ## The data home and its kind
52
+
53
+ - **The data has a home of its own from the first commit: `<agent>-data`.** For an agent that is not a kit service it
54
+ is a folder beside the checkout, never inside it, and `<AGENT>_DATA_DIR` names it (its default is
55
+ `../<agent>-data`); a kit service keeps the kit's folders above. When the owner keeps the data in Git, it goes to a
56
+ separate private repository named `<agent>-data`, never to the source's repository. On a cloud host that does not
57
+ keep its disk across a restart (Heroku and the like, an uptime A agent's default), the data home is a durable store
58
+ the same variable names (a database, an object store, that private repository); the folder and the kit's folders
59
+ serve a machine whose disk persists. A copy of the agent starts with an empty home of its own and never connects
60
+ to the original's.
61
+ - **The README names the kind of the data.** **U**: the agent keeps data of people outside the owner's team
62
+ (messages, support requests, reviews, customers' answers); it never enters the source, a copy or its tests, and the
63
+ source holds only the schema and synthetic fixtures (its real-trace corpus and replay samples live in the data
64
+ home). **O**: it keeps none (a tool or service for other agents, the
65
+ owner's reports, runs and media); its working data still goes to the data home. When in doubt, the kind is U.
66
+ - **Every release runs the transfer audit.** `fabric_source_check.py check <project-root>` in Git mode, and
67
+ `check <clean-copy> --every-file` on a clean copy of what Git would commit (`git ls-files --cached --others
68
+ --exclude-standard`, as building-fabric-services' `references/package.md` makes it; never the checkout itself, whose ignored
69
+ configuration and dependency folders `--every-file` reads too), each exit 0, with the owner's list or its absence recorded, until the contract's export (CT-194)
70
+ replaces it.
71
+
72
+ ## The check
73
+
74
+ `fabric_source_check.py check` reads the files the source would carry (what Git would commit: tracked files and
75
+ untracked ones that are not ignored, as they are in the work tree; a staged copy that differs is not read) and reports each place where the instance shows through, by path, line and kind:
76
+
77
+ | Kind | Finds |
78
+ |---|---|
79
+ | `home-path` | an absolute path inside a person's home folder (a web route under `/home/` is reported too; a route under `/users/` is not): `/Users/<name>/`, `/home/<name>/`, `C:\Users\<name>\`, Git Bash's `/c/Users/<name>/`, WSL's `/mnt/c/Users/<name>/`, and the dashed (`-Users-<name>-`, `C--Users-<name>-`) and URL-encoded forms a tool makes of one. The name is ASCII, and in the dashed form it ends at the next dash: an owner whose home name holds a space, a dash, a dot, an underscore or an apostrophe (each a dash in the dashed form; a slashed name also ends at a space) declares it with `home: <name>` in the owner's list, which reads it whole in every form, and one whose home name is not ASCII, or holds another character, lists it as a plain string (a typographic apostrophe a keyboard typed, which the folder's name does not hold, is written as `'` in `home:`; a folder whose name holds `’` is listed as a plain string with `’` kept and declared too with `home: <name>` written with `'`, which reads the dashed forms; its URL-encoded `’` is not read; a name outside ASCII of one or two characters cannot be checked) |
80
+ | `secret` | a value shaped like a credential by the contract's detector (DEC-0044), read line by line: a provider key starting a word, a JWT, a bearer token, a long random value assigned to a credential's name (but a whole Ed25519 signature under a JSON `"sig"`, `"signature"` or `"signatures"` member, as `sign` writes it, which is public); or a private key: a PEM, OpenSSH or PGP block, or a JWK's `d` as a JSON member, escaped JSON or a Python dict; a URL with a password of 8 or more characters mixing letters and digits (a password without a digit or without a letter is not read) or a credential in its query, percent-encoded or not, JSON-escaped (`\u0026`, `\/`) or nested in another URL's parameter (two levels deep); a file that is a credential by its name, as `pack` refuses it (`.env`, `*.pem`, `*.key`, `.npmrc` and the rest), or a kit credential file (`*.token`, `board.credential`) |
81
+ | `instance-string` | a string from the owner's list, in a file, in a file's path or in a link's target |
82
+
83
+ ```bash
84
+ python3 <plugin-dir>/skills/adapting-projects-to-fabric/scripts/fabric_source_check.py check <project-root>
85
+ ```
86
+
87
+ - It **never repeats** a value it found: no value, no line holding one, no entry of the owner's list and not the
88
+ folder it checks reaches its output. A file's path is checked like its text (line `0` of a finding), and printed
89
+ with an entry of the list as `<line N>`, a home folder's name as `<home>` and each segment holding a
90
+ credential-shaped value as `<secret>` (two files can then print the same; the segments a found value runs across, an
91
+ assigned value, a bearer run or a URL, are masked too, while a key, a JWT or a JWK `d` is read up to the `/` that
92
+ cuts it, so the rest of a cut one can print in the next folder: find the file by the folder the finding names); an instance string is named by its line in the owner's list. The report can go in a commit
93
+ message, an issue or a chat. A declared home of one or two letters, once found anywhere in the tree, is masked wherever it stands in a printed
94
+ path, inside a word too (`qzone` prints `<home>one`); found nowhere, it is not masked.
95
+ - It **changes nothing.** Exit `0`: no finding and every file read; `1`: at least one finding (the step is not done);
96
+ `2`: the check could not run, or a file was not read: an unreadable file, a nested repository, or a binary file the
97
+ ignore file does not name as source (the summary counts each, and how many files were left out by name). A finding
98
+ sets `1` even when a file was not read too; the files not read are still listed, so fixing the findings can leave `2`.
99
+ - **What it reads.** A text file of any size is read whole, and the summary counts every text file read; a binary file (a NUL byte in its first 8 KiB) or one that
100
+ cannot be read is listed by its path as not read, and the summary counts it. A database or another binary of
101
+ records in the tree is instance data the check cannot read: move it to the instance folder. A binary that is source
102
+ (an icon, a font) is named in the ignore file. `--every-file` reads every file, those Git ignores included, but `.git`, `__pycache__`, `.DS_Store` and `*.pyc`
103
+ (litter `pack` refuses): run it
104
+ on a folder before `pack`, which carries them. A committed symbolic link is checked by the path it names, never followed. When the folder is
105
+ not in a Git checkout, Git lists nothing in it, or no `git` is found in PATH's absolute folders (with PATH unset, in `/bin` and `/usr/bin`; on Windows, nowhere), every file is read but `.git` and `__pycache__` (uncounted) and the dependency
106
+ folders (`node_modules`, virtual environments, caches), and the summary says Git was not used and how many dependency folders were not read.
107
+ Under a locale whose file-system encoding is not UTF-8 (ISO-8859-1, KOI8-R) the check restarts itself in Python's UTF-8
108
+ mode, so a file name, an argument and a file's text are read in one encoding; a name that is not UTF-8 is matched as its bytes.
109
+ A file's text is read as UTF-8, so an entry of the owner's list with a letter outside ASCII is found in a UTF-8 file
110
+ (composed or decomposed, as macOS may store a name), not in one saved as Latin-1 or CP1252.
111
+ In Git mode a nested repository (a submodule, a vendored checkout) is not read: check a nested repository in its own tree with
112
+ the same check (a submodule checked out first, `git submodule update --init`), then name its path in the ignore file,
113
+ with that reason on the line above. That line serves the check of the outer tree only: before `pack`, check the
114
+ nested repository with `--every-file` in its own tree too, because `pack` carries its files, ignored ones included.
115
+ - **The owner's list** holds the strings only the owner knows are theirs (their name, company, accounts, hosts), one
116
+ per line, at least three characters; a line starting with `#` is a comment, so list a channel or a hashtag without its `#`, and a `#` after a string is
117
+ part of that string. An entry matches in any case and inside any word; an invisible format character (a direction mark, a
118
+ soft hyphen, a joiner) at either end of a string is dropped, spaces between such characters too, and does not count
119
+ toward the three; one inside it is kept and counts (an emoji's joiner), so a string copied with a soft hyphen in it
120
+ matches only text that holds one. A line `home: <name>` declares the owner's home
121
+ name instead (ASCII letters, digits, `.`, `_`, `-`, `'` and spaces, starting with a letter or a digit; a name holding a
122
+ space, as a Windows profile may, is written whole, `home: Jane Doe`, and everything after the colon is the name, so
123
+ a note goes on a line of its own (`# laptop`); spaces and tabs may stand around the colon; a line
124
+ that starts with `home` and a colon and holds anything else is refused, exit 2 (an invisible format character before
125
+ the name, after it or inside `home` is dropped, one inside the name refuses the line; a NUL anywhere in the list
126
+ refuses it too); such a line is never a string
127
+ entry, so list a string like `home: page` by a part of it, `ome: page`): the check then finds that home in every form the table names (it is never neutral, even with one or two
128
+ letters), and the bare name is not looked for anywhere else, though a declared name of three or more letters and digits is
129
+ masked wherever a printed path holds it as a word, its parts joined by none or any run of a space, `.`, `_`, `-`, `+`, `'`, their
130
+ percent-encodings or an escaped apostrophe (`\'`, `\x27`, `\u0027`, `&#39;`, `&#x27;`, `&apos;`), the same separators it is found with in every form; a home that is also your name goes in the list
131
+ as a plain string too, to be found in text. It is `--instance-strings FILE`, else the file
132
+ `FABRIC_INSTANCE_STRINGS` names, else `passioncode-fabric/instance-strings.txt` in the user's configuration folder
133
+ (`$XDG_CONFIG_HOME` when it is absolute, else `~/.config`; `%APPDATA%` on Windows). A list inside the tree is refused, because it would
134
+ travel with the source. A person who already keeps private terms for org-index's `check_private.py`
135
+ (`~/.config/passioncode/private-terms.txt`) passes that file with `--instance-strings`; this check matches a term
136
+ anywhere in a word, and it does not look for e-mail addresses or account ids by their shape.
137
+ - **Leaving paths out.** `.fabric-source-ignore` at the root (globs, one per line, `#` comments) or `--exclude GLOB`
138
+ leaves out files that hold synthetic values on purpose, such as test vectors. A line is a path from the root, not a
139
+ `.gitignore` line (a leading `/` changes nothing, a line with no `/` matches at the root only, and a line holding `\`, `//`, an unclosed `[` or a class such as `[[:digit:]]` is refused, as Git reads each
140
+ otherwise): `*`, `?` and `[...]` stay inside one folder (`?` and `[...]` match one byte, as Git's do, so a letter
141
+ outside ASCII takes two or more) and `**` as a whole segment crosses
142
+ folders, so `vectors/*` takes the files in `vectors` and none in its subfolders. A line ending in `/`, or a path
143
+ with no wildcard, takes that folder and all it holds; only such a line leaves out a nested repository or a
144
+ submodule (`vendor/sub/`), never a wildcard line without the `/` (`vendor/*`). A wildcard folder line (`vendor/*/`)
145
+ takes every nested repository it reaches, checked or not, so name each one by its path. In Git mode a nested
146
+ repository is not read; `--every-file` and a folder outside Git read its files, its `.git` left out. An exception line (`!`) is refused, since what it would
147
+ bring back would go unread. Name the files, or a folder that holds
148
+ only synthetic vectors, never a whole source folder (a nested repository checked in its own tree is the one
149
+ exception), and say why on the line above. The `LICENSE` is the other: its copyright line names the holder, which is
150
+ authorship and travels with the source, so when the holder is on the owner's list the licence file is named in the ignore
151
+ file by its own path (`LICENSE`, `LICENSE.md`) with that reason (`# the copyright holder is authorship and travels with the source`); no other file of the
152
+ owner's is. A file `pack` refuses by its name cannot ship in a package: a public
153
+ certificate is renamed `*.crt`; a project `.npmrc` that holds no credential may be named in the ignore file, with
154
+ that reason, for the source check (the line then hides whatever is added to it later, so keep it credential-free),
155
+ and `pack` still refuses it, so a package is made from a copy without it (its
156
+ settings then apply only where the owner sets them: `~/.npmrc` reaches every project of the owner, and
157
+ `package.json`'s `publishConfig` carries publish-time settings such as `registry`, `tag` and `access`). A file
158
+ holding a credential moves to the instance, never into the ignore file.
159
+ - A neutral home (`example`, `user`, `runner`, a container's, a cloud machine's or a dev container's user such as `node`, `ubuntu` or `vscode`, the fixture id
160
+ `example-agent`, a
161
+ one-letter name, a placeholder; the whole set is `NEUTRAL_HOMES` in the script. An owner whose home name is in it, a
162
+ first name such as `alice` or an `admin` account, or has one or two letters, writes `home: <name>` in the owner's
163
+ list; a container's, a cloud image's or a CI runner's user that only the image uses, such as `node` or `vscode`, is never declared, since
164
+ its paths are the image's and stay in the source; the home of the owner's own machine is declared even when its
165
+ name is an image's user, as `admin` or `ubuntu` on a cloud machine the owner works on; when that name is also the
166
+ user of an image in the tree, the image's paths are reported, and they are written through a build argument that
167
+ names the user, `ARG APP_USER=ubuntu`, `USER ${APP_USER}`, `WORKDIR /home/${APP_USER}/app`, so no home path stands
168
+ in the source; `$HOME` serves only where a shell in the image expands it, a `RUN` line or a script, since a
169
+ Dockerfile's `WORKDIR` and `COPY` see only `ENV` and `ARG` values) and a value that says it is synthetic (`EXAMPLE`, `not-a-key`, `fake`, `dummy`) are
170
+ not findings.
171
+
172
+ The check finds the forms the table names, and only those: a credential in another shape (a bare token with no name
173
+ before it, a provider's key the contract's names do not cover) passes it. It is a floor under the owner's review and a
174
+ secret scanner, never a replacement for either.
175
+
176
+ The check finds the repository from the folder it checks: a Git location the caller exports (`GIT_DIR`,
177
+ `GIT_INDEX_FILE`, as a hook in a linked worktree has) is not passed to Git. The check reads the tree, not Git history. A value that was committed once is still in the history after the tree is
178
+ clean: handing such a source over needs a fresh history, which is the owner's act, never the agent's (no history
179
+ rewrite, no force-push).