@inventarch/distribution 3.0.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -5
- package/SPEC.md +6 -6
- package/assets/host-launcher.mjs +1 -1
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +4 -5
- package/dist/command.js.map +1 -1
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +3 -4
- package/dist/files.js.map +1 -1
- package/dist/guard-registration.d.ts +4 -4
- package/dist/guard-registration.d.ts.map +1 -1
- package/dist/guard-registration.js +23 -20
- package/dist/guard-registration.js.map +1 -1
- package/dist/host-home.d.ts +12 -6
- package/dist/host-home.d.ts.map +1 -1
- package/dist/host-home.js +17 -8
- package/dist/host-home.js.map +1 -1
- package/dist/host-observe.d.ts +5 -5
- package/dist/host-observe.js +2 -2
- package/dist/host.d.ts +1 -1
- package/dist/host.js +1 -1
- package/dist/hosts.d.ts +1 -1
- package/dist/hosts.js +1 -1
- package/dist/implementations.d.ts +23 -25
- package/dist/implementations.d.ts.map +1 -1
- package/dist/implementations.js +24 -25
- package/dist/implementations.js.map +1 -1
- package/dist/install.js +1 -1
- package/dist/install.js.map +1 -1
- package/dist/inventory.js +1 -1
- package/dist/inventory.js.map +1 -1
- package/dist/lifecycle-registration.d.ts +2 -2
- package/dist/lifecycle-registration.js +3 -3
- package/dist/lifecycle-registration.js.map +1 -1
- package/dist/native-command.js +1 -1
- package/dist/native-command.js.map +1 -1
- package/dist/plugin-home.js +1 -1
- package/dist/projection.d.ts +6 -6
- package/dist/projection.js +19 -19
- package/dist/projection.js.map +1 -1
- package/dist/registry-build.js +1 -1
- package/dist/registry-build.js.map +1 -1
- package/dist/services.d.ts +22 -23
- package/dist/services.d.ts.map +1 -1
- package/dist/services.js +13 -14
- package/dist/services.js.map +1 -1
- package/dist/snapshot.js +1 -1
- package/dist/snapshot.js.map +1 -1
- package/dist/updates.d.ts +1 -1
- package/dist/updates.d.ts.map +1 -1
- package/dist/updates.js +1 -1
- package/dist/updates.js.map +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -1,13 +1,80 @@
|
|
|
1
1
|
# @inventarch/distribution
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@inventarch/distribution) [](https://github.com/inventarch/ia/actions/workflows/platform-quality.yml) [](LICENSE) [](package.json)
|
|
4
|
+
|
|
5
|
+
> The distribution engine behind the `ia` CLI. It packs digest-named archives, installs them and registry kits into `.ia/distributions/`, adopts pinned source-only workspaces, restores and recovers installations, and registers Claude Code and Codex hosts. It also ships `ia-distribution`, a lower-level JSON interface to the same mechanisms.
|
|
6
|
+
|
|
7
|
+
## ⚡ Quick start
|
|
8
|
+
|
|
9
|
+
Most projects use this package through [`@inventarch/cli`](../cli/README.md), which depends on it. `ia install`, `adopt`, `update`, `remove` and `host` preview first and write only with `--apply`; `ia restore` needs `--apply` and has no preview yet:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
ia install inventarch/language --offline # preview from the local cache; writes nothing
|
|
13
|
+
ia restore --offline --apply --yes # reinstall the locked generation from its pinned archives
|
|
14
|
+
ia recover --root . # finish or roll back an interrupted installation
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The install preview compares the resolved set with the lock, lists the paths it would write (`.ia/distributions/store/…`, `.ia/distributions/generations/…`, `.ia/distributions.lock.json` and `.ia/distributions/active.json`) and states that authored sources under `.ia/src` are not touched.
|
|
18
|
+
|
|
19
|
+
To call the engine directly, install the package and pass an absolute root. Each command prints one JSON line:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
npm install --global @inventarch/distribution
|
|
23
|
+
ia-distribution validate --root "$PWD"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
`validate` reports `status`, the revision, the findings and the `bindings`, `checks` and `evidence` results. A relative `--root` is refused with `IA-DIST-INPUT-INVALID`.
|
|
27
|
+
|
|
28
|
+
## 🧭 What it does
|
|
29
|
+
|
|
30
|
+
| Area | Through `ia` | What the engine does |
|
|
31
|
+
| --- | --- | --- |
|
|
32
|
+
| Packing | `pack` | Builds a `<sha256>.ia.tgz` archive from a release descriptor that names a `@distribution`, with its pinned dependency closure. A descriptor that names none is refused. |
|
|
33
|
+
| Installation | `install`, `update`, `remove` | Resolves requests from a registry, a catalog file or the local cache, verifies archive integrity and native admission, and installs in one transaction that writes `.ia/distributions/` and the lock. |
|
|
34
|
+
| Kits | `install <id>` | Installs an id whose release index is empty as a kit: its members become ordinary distribution requests, and the lock pins them and their archives, so restore needs no kit metadata. |
|
|
35
|
+
| Source-only adoption | `adopt`, `init --adopt` | Pins a registry workspace's source files at `.ia/open/<binding-id>/<revision>`, records an `open` binding in `.ia/workspace.json` and adds `<tree>/.ia/src @open` to the authored `@workspace`'s `composition.sources`, where its records enter at band 50. |
|
|
36
|
+
| Restore | `restore` | Reinstalls the locked generation from its pinned archives, from a registry, a catalog or `--offline` from the cache. |
|
|
37
|
+
| Recovery | `recover [installation\|host\|guard\|lifecycle]` | Finishes or rolls back an interrupted installation, host registration, hook-group registration or lifecycle context-hook registration from its journal. |
|
|
38
|
+
| Host registration | `host`, `project` | Plans and applies the position packet and generated files at fixed Claude Code and Codex paths, one `PreToolUse` group per authored `@hook` in `.claude/settings.local.json` with its ownership state, and the installed-implementation catalog join `ia validate` binds against. Other hosts refuse with `IA-DIST-HOST-UNSUPPORTED`. |
|
|
39
|
+
| Registries | `--registry <url\|dir>` | Reads release, kit and workspace indexes from a credential-free HTTPS base or a local directory, with bounded reads and no redirects. |
|
|
40
|
+
|
|
41
|
+
The `ia-distribution` binary groups the same mechanisms, as `ia-distribution --help` lists them:
|
|
42
|
+
|
|
43
|
+
| Group | Commands |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| Workspace | `validate`, `format`, `render`, `project`, `explain`, `recover-projection`, `remove-projection` |
|
|
46
|
+
| Archives and installs | `pack`, `inspect`, `cache`, `list`, `doctor`, `plan install\|update\|remove\|rollback`, `apply`, `restore`, `recover`, `gc` |
|
|
47
|
+
| Hosts | `plan host\|host-remove\|lifecycle\|lifecycle-remove`, `recover-host`, `recover-guard`, `recover-lifecycle` |
|
|
48
|
+
| Registries and updates | `registry add\|withdraw`, `refresh-updates` |
|
|
49
|
+
|
|
50
|
+
A `plan` command returns reviewable data, saved with `--out`; `apply` rechecks every input and writes only install state. Recovery refusals and `ia doctor` remedies name `ia recover`, not `ia-distribution`, which installing the CLI does not put on your `PATH`. The library subpaths (`./pack`, `./install`, `./registry`, `./projection`, `./guard-registration`, `./implementations`, `./services` and the rest in `package.json`) expose the same mechanisms with TypeScript declarations.
|
|
51
|
+
|
|
52
|
+
## ⚖️ What it does not do
|
|
53
|
+
|
|
54
|
+
- **No publication.** `ia pack` writes a local archive (by default under `.ia/work/dist`), and installing or adopting publishes no release. Host activation and public publication are separate operations.
|
|
55
|
+
- **No code execution.** Reading the installed-implementation catalog never imports, loads or runs a handler, and [system-package verification](references/system-package.md) never imports package code or grants authority.
|
|
56
|
+
- **No authority from kits or adoption.** Kits confer no implementation catalog, registry override, credential or host permission. Adoption refuses source with `mandate`, `agent-profile`, `execution-binding`, `hook`, `capability` or `check` records, and copies no executable, host configuration, registry mapping or credential; author those records locally.
|
|
57
|
+
- **No automatic adoption crash recovery.** After a crash during `ia adopt --apply`, inspect the `@workspace` sources and the binding in `.ia/workspace.json` before removing a stale `.ia/adoption.lock`.
|
|
58
|
+
- **No proof a host is running.** A registration is written files; `ia doctor` reports it as written, not observed answering. Codex agents and hooks are unsupported.
|
|
59
|
+
- **No CLI upgrade.** Restore and recovery reinstate state; they never upgrade the running CLI, and no fallback rewrites a lock or lowers an archive's engine range.
|
|
4
60
|
|
|
5
61
|
## Distribution engine compatibility
|
|
6
62
|
|
|
7
|
-
The distribution engine
|
|
63
|
+
The distribution engine has its own version, separate from the npm package and native archive versions. The 2.x CLI reads engine 0.1.0. IA 3.0 uses engine 0.1.1, which verifies pinned release-control sources outside system folders.
|
|
64
|
+
|
|
65
|
+
- **Old locks.** IA 3.0 reads an exact 0.1.0 lock without rewriting its pins when the selected archives support the new engine. That is forward compatibility only.
|
|
66
|
+
- **What migrates a workspace.** An applied `ia init`, and every applied `ia install` or `ia update`, including one that changes nothing, writes an engine 0.1.1 lock, which the 2.x CLI refuses to read. `ia remove` keeps the existing engine marker, though its host refresh can still write newer host state.
|
|
67
|
+
- **Refusals.** An incompatible lock is not corruption. IA 3.0 names the required and current engine: `IA-DB-SOURCE-UNAVAILABLE` with reason `engine-incompatible` for an installed lock or archive, and `IA-DIST-CONFLICT` for an installation plan. An older CLI may report a generic engine refusal.
|
|
68
|
+
- **Strict archives.** Never lower an archive's engine range, edit a lock's engine marker or delete a lock to silence a refusal.
|
|
69
|
+
|
|
70
|
+
Before upgrading, back up the authored source and the distribution and host state, including the lock and the exact cached archives, and note the CLI version that opens it. Validate the upgraded workspace with a compatible CLI. If its activation is missing, run that CLI's `ia restore` with the exact pinned archives.
|
|
8
71
|
|
|
9
|
-
|
|
72
|
+
To return to 2.x, use the newer CLI first: finish pending recovery (`ia recover guard --root .`, and `ia host <host> --apply` for pending projection evidence), then remove its host registrations (`ia host claude --remove --apply --yes`, and `ia host codex --remove --apply --yes` where registered). Restore the complete pre-upgrade backup and use the matching old CLI with the exact archive pins. Keep the upgraded workspace separately for later reconciliation. There is no in-place downgrade.
|
|
10
73
|
|
|
11
|
-
|
|
74
|
+
## 📚 Learn more
|
|
12
75
|
|
|
13
|
-
|
|
76
|
+
- [Package contract](SPEC.md) · [language summary](LANGUAGE.md)
|
|
77
|
+
- [Registry collections and source adoption](references/registry-collections.md) · [installed system-package verification](references/system-package.md)
|
|
78
|
+
- [Distribution registry](../../docs/specs/registry/README.md) and [host registration](../../docs/specs/host-registration/README.md) specifications
|
|
79
|
+
- [Root README](../../README.md) · [architecture reference](../../docs/reference/architecture/README.md) · [CLI guide](../cli/README.md)
|
|
80
|
+
- [`@inventarch/steward-hook`](../steward-hook/README.md), the edit guard whose hook groups this package registers
|
package/SPEC.md
CHANGED
|
@@ -8,20 +8,20 @@ The [installed system-package API](references/system-package.md) verifies explic
|
|
|
8
8
|
|
|
9
9
|
Root release controls separate publication selection from vocabulary ownership. They do not create dependencies on every system named by other release controls. Per-system packages explicitly depend on workspace-system for their release declaration and generated installation workspace vocabulary. Workspace-system therefore keeps its agent/compliance foundation closure; generated teaching guides retain their actual schema dependencies. Native and npm versions remain independently selected.
|
|
10
10
|
|
|
11
|
-
Packing (2026-10-09
|
|
11
|
+
Packing (since 2026-10-09) refuses a release descriptor that names no `distribution`, which the database's descriptor decoder admits for a workspace that releases nothing, as `IA-DIST-CLOSURE-INVALID` as soon as it decodes the descriptor, after it verifies the snapshot's sources and before it admits them, computes the release closure or writes anything; a descriptor that names one packs as before.
|
|
12
12
|
|
|
13
|
-
The host projection mechanism (`./projection`; 2026-10-09
|
|
13
|
+
The host projection mechanism (`./projection`; 2026-10-09) plans and applies the files a caller renders, each carrying the marker the caller passes, at the exact `PROJECTION_PATHS` of each host: `.claude/rules/ia-workspace.md` and `.claude/skills/ia-authoring/SKILL.md` for Claude, `AGENTS.md` and `.agents/skills/ia-authoring/SKILL.md` for Codex, and the generated files `GENERATED_PATHS` names: `.claude/agents/<name>.md` and `.claude/skills/<name>/SKILL.md` for Claude, `.agents/skills/<name>/SKILL.md` for Codex, each a lower-case portable name (`projectionOwnable` is the union). A generated file carries the packet marker and is a planned write owned through the same state; an owned one no render writes any more is removed when it still carries an owned marker (an agent through the legacy path below, which deletes only a marked, unedited file; a listed skill without the marker is the user's, kept as `foreign` and dropped from the state), and the skill folder that removal empties is removed too, never recursively; a generated skill is refused (IA-DIST-LOCAL-MODIFICATION) where its folder already holds files and the state owns nothing in it, located at that folder and naming it as `skillFolder`, so the caller names the files to move, a user's own unmarked SKILL.md there included, so the refusal converges in one hop; the packet's own `ia-authoring` skill keeps the file rule; an unmarked or hand-edited file at a generated path is refused, never overwritten or removed; a generated agent is refused (IA-DIST-PATH-UNSAFE) where `.claude/agents` is a link. A generated agent at the path of an owned 1.x steward file replaces it as one update: the legacy pass skips every path an artifact writes, so no plan holds an update and a remove for one path. Besides the caller's marker, the two 1.x markers (`<!-- Generated by tools/projections/generate.ts; edit the cited native records. -->` and `<!-- Generated by ia host; edit the cited native records. -->`) are owned, so a file a 1.x renderer wrote is replaced in place rather than refused. The ownership state format `ia.host-projection-state.v1` is unchanged, and a Claude state may still list `.claude/agents/<name>.md`, for removal only: the planner plans `remove` for each listed one that carries an owned marker and is unedited (a listed one already gone only leaves the state), refuses a listed marked one edited by hand as it refuses any owned file, and lists every other agent file, a listed unmarked one and any the state does not list, marked or not, as `foreign`, which no apply writes or deletes. The final state lists only the files rendered. `observeProjection` reports no drift for a listed steward file that is gone or unmarked. The CLI's `applyHostProjection` is the one caller that applies these plans; the steward-guard registration it retires first is `./guard-registration`'s removal, with the safety checks below.
|
|
14
14
|
|
|
15
|
-
The installed-implementation catalog (`./implementations
|
|
15
|
+
The installed-implementation catalog (`./implementations`) is the `implementations.json` file, format `ia.installed-implementations.v1`, that the host payload builder generates and inventories; the builder finds each first-party implementation package only in the repository's own `node_modules` and imports its declaration module at build time to read the declaration, which no host app ever imports. Its value's shape is `@inventarch/db/distribution`'s (`checkInstalledImplementations`), which binders read too: an `evaluators` section that is an `ia-evaluator-catalog/1.0` value with no installed entries (the built-ins are implicit), and an `operations` section listing each first-party installed operation implementation `available` (descriptor version, operation identity, handler, input and output validator ids, the payload path of its shipped handler module, that module's SHA-256 and the installed packages of its closure), `unavailable` or `revoked`, each with a reason. `readInstalledImplementations(directory, release, verify?)` first verifies the whole payload as `verifyHostCache` does (which now also returns the verified inventory) and requires it to verify as `release`, a release.json that does not hash to it refusing before it is parsed: a file anywhere in the payload directory that the inventory does not list (nothing outside that directory is verified), a link, a missing file or changed bytes refuse with that verification's code, so nothing is ever read, let alone available, from a payload that fails verification. The catalog is the file that verified inventory lists, read again against its pin; an available operation whose handler module or closure package manifest the inventory does not list is `unavailable`, and one whose handler digest disagrees with the inventory is `IA-DIST-INTEGRITY-MISMATCH`. What binds an implementation is its handler module's digest together with the verified inventory, which pins every other byte of its closure; the composition descriptor's own `implementationDigest`, which hashes the installed package trees of the process that imports it, is a producer-side pin the catalog does not record, and a bundled host's counterpart is the payload release digest a join records. A v1 payload, or a v2 payload whose inventory lists no catalog, reads as `unavailable`, not as damage. It never imports, loads or runs a handler. `joinHost(root, host, consumerRevision)` records, under the host lock and after a pending-journal check made under it, the host's row in `.ia/distributions/hosts/joins.json` (format `ia.host-joins.v1`: consumer, implementation `installed-implementations`, payload version, catalog digest, payload release, consumer revision), derived from the committed `<host>-workspace.json` registration and the catalog of the payload it names; with no registration or no catalog it drops that row instead. `leaveHost` drops a row; unreadable receipts refuse, located at the file, rather than being replaced.
|
|
16
16
|
|
|
17
|
-
Execution bindings
|
|
17
|
+
Execution bindings: a catalog row may also be `revoked`, with a reason, which binders report as an error. `joinedCatalog(root, trust)` finds the catalog a workspace's host joined, as `trust` (`HostTrust`: the validating installation's IA home and the payload release it pins) allows. Only `<home>/hosts/<release>` is ever opened: a join counts only when it and its host's registration name that release and the registration names that payload directory, so a registration of another release, or of a payload anywhere else (another IA home, inside the workspace, a network path), is `unavailable` with the repair `ia host <host> --apply` and nothing it names is opened. That payload is read once; a payload that fails verification with changed or unlisted files, a link, exceeded limits or a release.json that does not hash to the pin (parseable or not) is `damaged`, whichever trusted join names it, since every trusted join names the same payload; otherwise the first trusted join in consumer order that carries the payload's catalog digest is the source. With no receipt, no trust (null) or no trusted join that holds, the catalog is `unavailable` with the reasons. `installationTrust()` is the trust of the distribution module's own installation: the payload it runs from, `<home>/hosts/<release>/runtime/node_modules/@inventarch/distribution`, or null outside one. `WorkspaceSession.bindings(trust)` joins every admitted `@execution-binding` with it (`@inventarch/workspace-runtime/bind`) and returns the catalog source and one result per binding; `ia-distribution validate` passes `installationTrust()`, adds that result as `bindings` and exits 1 when a binding is revoked. It reads only.
|
|
18
18
|
|
|
19
|
-
Check binding and evidence
|
|
19
|
+
Check binding and evidence: `openWorkspaceSession({root, checks})` passes db `OpenOptions.checks`; every other caller keeps strict admission. A session never reads evidence, so what a validation admits, binds and reports is the authored view's alone, and `validation()` reports `revision`, the one every other reader reports, and `authoredRevision`. `WorkspaceSession.checks(trust)` binds every admitted `@check` with db `bindChecks`, a catalog evaluator against the same catalog `bindings(trust)` reads (`joinedCatalog`, read once per session and trust), and returns the catalog source (null when every check names a built-in evaluator, and then no catalog is read) with one result per check; `validation()`, `bindings()` and `checks()` read only. `recordValidation(session, checks)` is the validate request and the one writer of evidence: it records the session's bound checks that passed or failed through db `evidenceText` and `writeEvidence` at the session's authored revision, reading the current file only for the times an unchanged observation keeps; nothing when the vocabulary has no `@observation` word, and nothing recorded or pruned when admission is refused. Only writing this revision's file can refuse: a directory or file the process cannot write as IA-DIST-EVIDENCE-UNWRITABLE, located at `.ia/work/evidence`, and a link or misplaced entry as db IA-DB-PATH-UNSAFE; pruning other revisions' files is best effort and keeps what was modified after the session opened. `ia-distribution validate` opens a structural session, adds `checks` and `evidence` to its result, and exits 1 when a binding or a check is revoked. Two trust roots: `ia validate` trusts the payload its bundled pin names in the IA home, while `ia-distribution validate` trusts only the payload it runs from (`installationTrust`); run from a package install or a checkout, outside any payload, it trusts no join, so its catalog is unavailable and no catalog check or execution binding binds where `ia validate` may bind them.
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
PR #30 upgrade safety: `assertRetirableGuard` inspects both Claude settings locations and refuses unmatched IA guard groups before a caller deletes steward files, preserving unrelated settings. Guard removal accepts a recorded old-root group only in the fixed released shape and only when the current group matches the recorded bytes; registration and execution retain strict current-root validation. A linked legacy agents directory is foreign and never traversed; listed paths beneath it are left untouched. `legacyProjectionActions` exposes removal/foreign actions independently of active files that an install refresh will render after activation.
|
|
23
23
|
|
|
24
|
-
Hook groups (`./guard-registration`; 2026-10-11
|
|
24
|
+
Hook groups (`./guard-registration`; 2026-10-11): `planHookRegistration(root, {cache, hooks} | {remove})`, `planHooksFor(root, expected, hooks)` and `applyHookRegistration(plan, checkpoint?)` plan and apply exactly one PreToolUse group in `.claude/settings.local.json` per hook row `{identity, tools, paths}`: the matcher is `Write|Edit|MultiEdit` whatever the row's tools (which are validated and reported, and which the guard applies to the hook's paths from the record), so the guard's managed-state protection decides every edit tool, and the one handler runs the launcher's guard mode as `guard --root <root> --hook <identity>`, in the derivation the retired steward guard's group used (direct on win32, `/bin/sh` with `FAIL_CLOSED` elsewhere, timeout 10). Nothing authored but the identity, a canonical `system/kind/facet/name` of at most 512 characters, and the tools reaches a group. Rows are held to the bounds hook generation applies (workspace-runtime `HOOK_LIMIT`, `HOOK_SELECTION_LIMIT` and `registrableSelection`: at most 64 hooks, each with one to 64 selections of at most 512 characters), so a hook beyond them is reported by generation, never refused here. The groups are owned by exact match against `.ia/distributions/hosts/claude-hooks-<id>.json` (`ia.hook-registration-state.v1`), which also records each hook's registered `paths`, the selection the guard refuses when the hook's record can no longer be read: a plan replaces an owned group whose derivation changed in place, appends a new one, removes one no longer requested, and keeps every other group, key and byte, so a re-plan of the same rows writes nothing and removing the last hook restores the settings byte for byte, except that a container the groups emptied which existed before is written as `[]` or `{}` whatever whitespace it held (a file the first registration created goes again, and containers it created are pruned). It refuses an owned group changed or duplicated by hand, an unmanaged group identical to one it would write, `disableAllHooks` when it would create or update a group (a plan that only keeps or removes owned groups proceeds), a consumer root inside the cache, and a malformed or repeated row; an owned group the user deleted only loses its ownership when its hook is no longer requested. Publication holds the host lock and uses the guard's journal, `guard-pending.json` with format `ia.hook-registration-pending.v1`, which every host write already waits on and `recoverGuardRegistration` (`recover-guard`) finishes or rolls back. `assertRetirableGuard` and the retired guard's removal recognize only a guard group that names no `--hook`, so hook groups never block the projection apply's retirement of the steward guard's registration. `readHookRegistration(root)` reads the hook ownership state, `observeHookRegistration(root)` reports each owned group `missing`, `modified` (changed or duplicated) or `foreign` (a guard group naming `--hook` for this root that no state owns), read-only, and `hookGroupDigest(group)` is the SHA-256 a receipt lists for a group, and `hooksDisabledBy(root)` names the settings file whose `disableAllHooks: true` turns hooks off, read as registration reads it. The CLI's projection writer registers and removes the groups (apps/cli SPEC, the generated set).
|
|
25
25
|
|
|
26
26
|
Registry collection kinds, source-only workspace adoption, kit installation, budgets and rollback are specified in [registry collections](references/registry-collections.md).
|
|
27
27
|
|
package/assets/host-launcher.mjs
CHANGED
|
@@ -7,7 +7,7 @@ const root = resolve(dirname(fileURLToPath(import.meta.url)), '..'),
|
|
|
7
7
|
pin = '__INVENTORY_DIGEST__';
|
|
8
8
|
const hash = (bytes) => createHash('sha256').update(bytes).digest('hex');
|
|
9
9
|
// `child` is `parent` or under it on disk, compared by device and inode from its deepest existing ancestor up, so another
|
|
10
|
-
// spelling a case- or normalization-folding volume opens as the same directory is inside too (#315).
|
|
10
|
+
// spelling a case- or normalization-folding volume opens as the same directory is inside too (crowncodes/ia#315).
|
|
11
11
|
const within = (parent, child) => {
|
|
12
12
|
const target = statSync(parent, { bigint: true });
|
|
13
13
|
let entry = child;
|
package/dist/command.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,IAAI,w9BAgBhB,CAAC;AAwBF,wBAAgB,GAAG,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,IAAI,w9BAgBhB,CAAC;AAwBF,wBAAgB,GAAG,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAuKlF"}
|
package/dist/command.js
CHANGED
|
@@ -78,11 +78,10 @@ export function run(argv) {
|
|
|
78
78
|
return { exitCode: 0, result: removeProjection(need('out'), need('id')) };
|
|
79
79
|
if (command === 'validate') {
|
|
80
80
|
// The validate request `ia validate --json` makes too, through the same services: the finding set of a structural
|
|
81
|
-
// admission (inert declarations included), the execution bindings
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
// so it fails the run as a refusal does.
|
|
81
|
+
// admission (inert declarations included), the execution bindings and check bindings it reports, and the evidence
|
|
82
|
+
// it records (`recordValidation`, the only writer of evidence), from a session that reads no evidence. Both bind
|
|
83
|
+
// through this module's own installation (`installationTrust`). A revoked binding or check is an error, so it
|
|
84
|
+
// fails the run as a refusal does.
|
|
86
85
|
const validating = openWorkspaceSession({ root, checks: 'structural' });
|
|
87
86
|
try {
|
|
88
87
|
const trust = installationTrust(), validation = validating.validation(), bindings = validating.bindings(trust), checks = validating.checks(trust), evidence = recordValidation(validating, checks);
|
package/dist/command.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC/F,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,EAAE,iBAAiB,EAAE,MAAM,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AAI,SAAQ,GAAG,IAAI,CAc1F;AACD,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAUtD;AACD,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASvF"}
|
package/dist/files.js
CHANGED
|
@@ -164,10 +164,9 @@ export function replace(root, path, content, mode = 0o600) {
|
|
|
164
164
|
}
|
|
165
165
|
/**
|
|
166
166
|
* A complete, fsynced temporary sibling of `target` holding `content`, which `replace` renames and `createFile` links
|
|
167
|
-
* into place. A step that fails removes it again, so a failed write leaves no temporary file
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
* cannot close.
|
|
167
|
+
* into place. A step that fails removes it again, so a failed write leaves no temporary file. Neither publisher locks
|
|
168
|
+
* the target: a writer that saves it between a caller's last read and the rename is replaced, which a caller narrows
|
|
169
|
+
* by reading the file through an opened handle just before (as `ia author` does) but cannot close.
|
|
171
170
|
*/
|
|
172
171
|
function drafted(target, content, mode) {
|
|
173
172
|
const temp = `${target}.${randomUUID()}.tmp`, fd = openSync(temp, 'wx', mode);
|
package/dist/files.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.js","sourceRoot":"","sources":["../src/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EACL,SAAS,EACT,UAAU,EACV,UAAU,EACV,SAAS,EACT,QAAQ,EACR,SAAS,EACT,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,MAAM,EACN,UAAU,EACV,aAAa,GACd,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EAAE,eAAe,EAA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AK,CAAC;IACd,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAChC,CAAC;AACH,CAAC;AACD,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3B,IAAI,KAAc,CAAC;IACnB,IAAI,CAAC;QACH,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC,eAAe,EAAE,wBAAwB,CAAC,CAAC;IACzD,CAAC;IACD,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI;QAAE,IAAI,CAAC,eAAe,EAAE,gDAAgD,CAAC,CAAC;IAClG,OAAO,KAAK,CAAC;AACf,CAAC;AACD,MAAM,UAAU,MAAM,CAAC,KAAc,EAAE,IAAuB;IAC5D,IACE,KAAK,KAAK,IAAI;QACd,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACpB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC;QAElE,IAAI,CAAC,eAAe,EAAE,kCAAkC,CAAC,CAAC;IAC5D,OAAO,KAAgC,CAAC;AAC1C,CAAC"}
|
|
@@ -57,7 +57,7 @@ export declare function planGuardFor(rootInput: string, expected: HostCacheTarge
|
|
|
57
57
|
/**
|
|
58
58
|
* The settings file whose `disableAllHooks: true` turns Claude Code's hooks off for this workspace, as registration
|
|
59
59
|
* reads it (`.claude/settings.local.json` first, then `.claude/settings.json` when the local file does not set it), or
|
|
60
|
-
* null when hooks are on or a file cannot be read, which the plan itself then refuses
|
|
60
|
+
* null when hooks are on or a file cannot be read, which the plan itself then refuses.
|
|
61
61
|
*/
|
|
62
62
|
export declare function hooksDisabledBy(rootInput: string): string | null;
|
|
63
63
|
export declare function applyGuardRegistration(input: unknown, checkpoint?: (stage: string) => void): {
|
|
@@ -75,7 +75,7 @@ export interface HookRow {
|
|
|
75
75
|
readonly tools: readonly HookTool[];
|
|
76
76
|
/**
|
|
77
77
|
* The hook's path selections as registered. The guard decides from the record; it reads these only when the record can
|
|
78
|
-
* no longer be read, to refuse no more than the last registered selection
|
|
78
|
+
* no longer be read, to refuse no more than the last registered selection.
|
|
79
79
|
*/
|
|
80
80
|
readonly paths: readonly string[];
|
|
81
81
|
}
|
|
@@ -126,7 +126,7 @@ export interface HookPlan {
|
|
|
126
126
|
/**
|
|
127
127
|
* The group a `@hook` registers: the guard runs with this root and that identity for every edit tool (`Write|Edit|MultiEdit`,
|
|
128
128
|
* as the retired steward guard's group did), so the managed-state protection decides every edit; the hook's own tools
|
|
129
|
-
* apply only to its paths, which the guard reads from the record
|
|
129
|
+
* apply only to its paths, which the guard reads from the record.
|
|
130
130
|
*/
|
|
131
131
|
export declare function hookGroup(launcher: string, root: string, hook: HookRow, platform?: NodeJS.Platform): Group;
|
|
132
132
|
/**
|
|
@@ -181,7 +181,7 @@ export declare function recoverGuardRegistration(rootInput: string): {
|
|
|
181
181
|
* and any failure to run the guard at all exits 2, naming the remedy on stderr, which Claude Code shows with the block.
|
|
182
182
|
* Claude Code lets a tool call through when a hook command cannot start or fails any other way, and blocks only on exit 2 or
|
|
183
183
|
* a deny (code.claude.com/docs/en/hooks); the guard's own decisions exit 0 and pass through unchanged. win32 has no
|
|
184
|
-
* `/bin/sh` and keeps the direct form, which still fails open (#323).
|
|
184
|
+
* `/bin/sh` and keeps the direct form, which still fails open (crowncodes/ia#323).
|
|
185
185
|
*/
|
|
186
186
|
export declare const FAIL_CLOSED = "\"$0\" \"$@\" || { echo \"IA steward guard could not run: run ia doctor, then ia host claude --apply\" >&2; exit 2; }";
|
|
187
187
|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CAAC,EAAE,OAAO,CAAA;CAAE,EAChE,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAC3C,OAAO,CAGT"}
|
|
@@ -113,7 +113,10 @@ function guardInvocation(value) {
|
|
|
113
113
|
}
|
|
114
114
|
return undefined;
|
|
115
115
|
}
|
|
116
|
-
/**
|
|
116
|
+
/**
|
|
117
|
+
* Whether a group is the retired steward guard's: it runs the guard and names no `@hook`. The projection apply retires
|
|
118
|
+
* exactly these.
|
|
119
|
+
*/
|
|
117
120
|
const referencesGuard = (value) => guardInvocation(value) === null;
|
|
118
121
|
/** Refuse an unowned guard before retiring the agents it depends on. Never alter unrelated hooks. */
|
|
119
122
|
export function assertRetirableGuard(root) {
|
|
@@ -153,7 +156,7 @@ export function planGuardFor(rootInput, expected) {
|
|
|
153
156
|
/**
|
|
154
157
|
* The settings file whose `disableAllHooks: true` turns Claude Code's hooks off for this workspace, as registration
|
|
155
158
|
* reads it (`.claude/settings.local.json` first, then `.claude/settings.json` when the local file does not set it), or
|
|
156
|
-
* null when hooks are on or a file cannot be read, which the plan itself then refuses
|
|
159
|
+
* null when hooks are on or a file cannot be read, which the plan itself then refuses.
|
|
157
160
|
*/
|
|
158
161
|
export function hooksDisabledBy(rootInput) {
|
|
159
162
|
const root = workspace(rootInput);
|
|
@@ -172,9 +175,9 @@ export function hooksDisabledBy(rootInput) {
|
|
|
172
175
|
}
|
|
173
176
|
/**
|
|
174
177
|
* The preamble the retired steward guard's plan (removal, and the 1.x registration its fixtures still make) and the hook
|
|
175
|
-
* groups' plan share
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
+
* groups' plan share: a Claude-compatible cache outside the root, the settings and the ownership state read once, a
|
|
179
|
+
* removal refused when nothing is owned, hooks explicitly disabled refused when the plan would register a group, and a
|
|
180
|
+
* bounded PreToolUse array.
|
|
178
181
|
*/
|
|
179
182
|
function readSettings(root, cache, removeId, what, stateOf, validate, writing) {
|
|
180
183
|
if (cache && cache.host !== null && cache.host !== 'claude')
|
|
@@ -203,7 +206,7 @@ function readSettings(root, cache, removeId, what, stateOf, validate, writing) {
|
|
|
203
206
|
return { id, before, prior, rows, projectText, disabled };
|
|
204
207
|
}
|
|
205
208
|
/**
|
|
206
|
-
* The journaled publication both registrations share
|
|
209
|
+
* The journaled publication both registrations share, under the host lock the caller holds: the journal first
|
|
207
210
|
* (`guard-pending.json`, which every host write waits on), the settings, then the ownership state (the commit), then
|
|
208
211
|
* the journal cleared; a concurrent change of either file, the project settings or the cache refuses.
|
|
209
212
|
*/
|
|
@@ -288,18 +291,18 @@ export function applyGuardRegistration(input, checkpoint = () => { }) {
|
|
|
288
291
|
}
|
|
289
292
|
}
|
|
290
293
|
/*
|
|
291
|
-
* Hook groups
|
|
292
|
-
*
|
|
293
|
-
*
|
|
294
|
-
*
|
|
295
|
-
*
|
|
296
|
-
*
|
|
297
|
-
*
|
|
298
|
-
*
|
|
294
|
+
* Hook groups. Each authored `@hook` becomes exactly one PreToolUse group in `.claude/settings.local.json`, which runs
|
|
295
|
+
* the launcher's guard mode for that hook, `guard --root <root> --hook <identity>`, through the derivation the retired
|
|
296
|
+
* steward guard's group used. A JSON entry cannot carry a marker line, so the groups are owned as that group was: by
|
|
297
|
+
* exact match against the group an ownership state records (`claude-hooks-<id>.json`, beside the guard's state),
|
|
298
|
+
* published under the host lock through the same journal (`guard-pending.json`, which every host write already waits
|
|
299
|
+
* on) and recovered by the same `recover-guard`. Every other group, key and byte of the file is kept. `@hook` gains no
|
|
300
|
+
* field: the record's `hook.paths` decide what the guard selects when it runs, and only its identity and tools reach
|
|
301
|
+
* the registration.
|
|
299
302
|
*/
|
|
300
303
|
/** The edit tools a hook group can match, in matcher order. */
|
|
301
304
|
export const HOOK_TOOLS = ['Write', 'Edit', 'MultiEdit'];
|
|
302
|
-
// The bounds hook generation applies, so a hook beyond them is reported there, never refused here
|
|
305
|
+
// The bounds hook generation applies, so a hook beyond them is reported there, never refused here.
|
|
303
306
|
const MAX_HOOKS = HOOK_LIMIT;
|
|
304
307
|
/** The ownership state of a registration's hook groups. */
|
|
305
308
|
export const hookStatePath = (id) => `${area}/claude-hooks-${identity(id)}.json`;
|
|
@@ -348,7 +351,7 @@ function hookRows(value) {
|
|
|
348
351
|
/**
|
|
349
352
|
* The group a `@hook` registers: the guard runs with this root and that identity for every edit tool (`Write|Edit|MultiEdit`,
|
|
350
353
|
* as the retired steward guard's group did), so the managed-state protection decides every edit; the hook's own tools
|
|
351
|
-
* apply only to its paths, which the guard reads from the record
|
|
354
|
+
* apply only to its paths, which the guard reads from the record.
|
|
352
355
|
*/
|
|
353
356
|
export function hookGroup(launcher, root, hook, platform = process.platform) {
|
|
354
357
|
hookTools(hook.tools);
|
|
@@ -450,7 +453,7 @@ export function planHooksFor(rootInput, expected, hooks) {
|
|
|
450
453
|
}
|
|
451
454
|
function planHooksWith(root, cache, desired, removeId) {
|
|
452
455
|
// With hooks turned off, a plan that only keeps or removes owned groups proceeds; one that would write a group refuses
|
|
453
|
-
// below
|
|
456
|
+
// below.
|
|
454
457
|
const { id, before, prior, rows, projectText, disabled } = readSettings(root, cache, removeId, 'Hook', hookStatePath, (content, owner, removal) => savedHooks(content, root, owner, removal), false);
|
|
455
458
|
const wanted = new Map(desired.map((row) => [row.identity, hookGroup(cache.launcher, root, row)])), selections = new Map(desired.map((row) => [row.identity, row.paths]));
|
|
456
459
|
// Each owned group is found by exact match, exactly once. One the user already deleted, so that no group names its
|
|
@@ -459,8 +462,8 @@ function planHooksWith(root, cache, desired, removeId) {
|
|
|
459
462
|
const owned = (prior?.groups ?? []).map(({ hook, group, paths }) => {
|
|
460
463
|
const at = rows.flatMap((row, index) => (json(row) === json(group) ? [index] : []));
|
|
461
464
|
const named = rows.some((row) => guardInvocation(row) === hook), gone = at.length === 0 && !named;
|
|
462
|
-
//
|
|
463
|
-
//
|
|
465
|
+
// Each refusal names the way out. A group deleted by hand is restored only through the removal, which drops its
|
|
466
|
+
// ownership, and a new registration.
|
|
464
467
|
if (gone && wanted.has(hook))
|
|
465
468
|
fail('LOCAL-MODIFICATION', `Owned hook group for ${hook} was deleted by hand; remove the registration ("ia host claude --remove --apply") and register it again`);
|
|
466
469
|
if (!gone && at.length !== 1)
|
|
@@ -635,7 +638,7 @@ export function recoverGuardRegistration(rootInput) {
|
|
|
635
638
|
* and any failure to run the guard at all exits 2, naming the remedy on stderr, which Claude Code shows with the block.
|
|
636
639
|
* Claude Code lets a tool call through when a hook command cannot start or fails any other way, and blocks only on exit 2 or
|
|
637
640
|
* a deny (code.claude.com/docs/en/hooks); the guard's own decisions exit 0 and pass through unchanged. win32 has no
|
|
638
|
-
* `/bin/sh` and keeps the direct form, which still fails open (#323).
|
|
641
|
+
* `/bin/sh` and keeps the direct form, which still fails open (crowncodes/ia#323).
|
|
639
642
|
*/
|
|
640
643
|
export const FAIL_CLOSED = '"$0" "$@" || { echo "IA steward guard could not run: run ia doctor, then ia host claude --apply" >&2; exit 2; }';
|
|
641
644
|
/**
|