@inventarch/distribution 3.1.0 → 3.2.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.
- package/LANGUAGE.md +2 -2
- package/README.md +72 -5
- package/SPEC.md +16 -6
- package/assets/host-launcher.mjs +130 -22
- package/dist/bounded-fetch.d.ts +7 -1
- package/dist/bounded-fetch.d.ts.map +1 -1
- package/dist/bounded-fetch.js +31 -2
- package/dist/bounded-fetch.js.map +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/decisions.d.ts +3 -3
- package/dist/decisions.d.ts.map +1 -1
- package/dist/decisions.js +4 -4
- package/dist/decisions.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 +5 -5
- package/dist/guard-registration.d.ts.map +1 -1
- package/dist/guard-registration.js +26 -23
- 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.d.ts.map +1 -1
- package/dist/host-observe.js +6 -5
- package/dist/host-observe.js.map +1 -1
- package/dist/host.d.ts +2 -2
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +3 -3
- package/dist/host.js.map +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.d.ts.map +1 -1
- package/dist/inventory.js +92 -9
- package/dist/inventory.js.map +1 -1
- package/dist/lifecycle-registration.d.ts +2 -2
- package/dist/lifecycle-registration.js +4 -4
- 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 +7 -7
- package/dist/projection.d.ts.map +1 -1
- package/dist/projection.js +21 -21
- package/dist/projection.js.map +1 -1
- package/dist/registry-admission.d.ts +1 -1
- package/dist/registry-admission.d.ts.map +1 -1
- package/dist/registry-admission.js +2 -2
- package/dist/registry-admission.js.map +1 -1
- package/dist/registry-build.js +1 -1
- package/dist/registry-build.js.map +1 -1
- package/dist/registry-resolve.js +1 -1
- package/dist/registry-source.d.ts +1 -1
- package/dist/registry-source.d.ts.map +1 -1
- package/dist/services.d.ts +26 -27
- 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/system-package.d.ts.map +1 -1
- package/dist/system-package.js +68 -6
- package/dist/system-package.js.map +1 -1
- package/dist/updates.d.ts +5 -5
- package/dist/updates.d.ts.map +1 -1
- package/dist/updates.js +5 -5
- package/dist/updates.js.map +1 -1
- package/package.json +7 -7
package/LANGUAGE.md
CHANGED
|
@@ -22,7 +22,7 @@ Spec source locators do not load documents. Resource capture and disclosure requ
|
|
|
22
22
|
| @convention | governance-system | Declares a convention in the shared governance shape. |
|
|
23
23
|
| @decision | work-system | Represents a choice that is needed or has been made: the question, options and decider, and once made, the choice and rationale. |
|
|
24
24
|
| @dimension | taxonomy | Defines a supported record dimension used by conditions and lookup. |
|
|
25
|
-
| @distribution | workspace-system | Declares root records from which a distributable closure is selected. |
|
|
25
|
+
| @distribution | workspace-system | Declares root records from which a distributable closure is selected, and optionally the host plugin product it describes. |
|
|
26
26
|
| @execution-binding | agent-composition-system | Connects a native target to a host-installed entry or operation descriptor. |
|
|
27
27
|
| @harness | agent-composition-system | Composes profiles and execution bindings in a workspace under a host contract. |
|
|
28
28
|
| @hook | hook-authoring-system | Represents a host event, tool/path selection and guard message. Registration and executing a guard require a host adapter. |
|
|
@@ -40,7 +40,7 @@ Spec source locators do not load documents. Resource capture and disclosure requ
|
|
|
40
40
|
| @placement | taxonomy | Defines source authority and reach metadata. |
|
|
41
41
|
| @plan | work-system | Represents an arrangement of milestones toward an intent; it heads the work hierarchy and has no parent. Plans do not nest. |
|
|
42
42
|
| @playbook | governance-system | Represents a procedure as phase/primitive cells. Cell delivery is generic; the authored method belongs to its author. |
|
|
43
|
-
| @predicate | taxonomy | Defines a directed relationship and its
|
|
43
|
+
| @predicate | taxonomy | Defines a directed relationship, its inverse spelling and its present phrase. |
|
|
44
44
|
| @primitive | taxonomy | Defines a cognitive primitive coordinate; a cell is selected using its phase and primitive. |
|
|
45
45
|
| @principle | governance-system | Declares a governing rationale in the shared governance shape. |
|
|
46
46
|
| @run | session-system | Represents a governed run identity, declared phase, status and owner. Declaration does not start execution. |
|
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
|
@@ -4,27 +4,37 @@ Public language mechanism. The [language reference](LANGUAGE.md) defines vocabul
|
|
|
4
4
|
|
|
5
5
|
The [installed system-package API](references/system-package.md) verifies explicit per-system native ownership and exact selected dependencies without executing package code.
|
|
6
6
|
|
|
7
|
+
Verified reads (2026-10-16): the host launcher's cache walk (`assets/host-launcher.mjs`, which every launcher mode runs first), `installedDistributionDigest` (`./inventory`) and `verifySystemPackage` judge each file by the descriptor they read it through. Each opens a file before it is judged, never through a final link where the platform refuses one at the open and never waiting on a FIFO; its type, its size and, for the launcher, its link count come from that descriptor; the read stops one byte past that size; and afterwards its name must still hold that file. On Windows the open has neither guard, so a link swapped in after the listing is opened and read, and that last check refuses it. The runtime inventory and the package reader refuse a file of more than 2147483647 bytes, the most `readFileSync` reads, before reading it, the inventory with its one message and the package reader as `System package input exceeds 2147483647 bytes: <path>`; the launcher reads only a pinned file within its 256 MiB budget.
|
|
8
|
+
|
|
9
|
+
The launcher judges every entry not listed as a regular file by its lstat, as it judged every entry before, since Windows lists every reparse point as a link: a link or a special file refuses before anything is opened, a directory is walked, and an entry its lstat calls a file or a directory, such as a cloud placeholder or a deduplicated file, is judged as that. It refuses a link (`Plugin cache links are unsupported`), a special file or a file with a second link, the files it skips included (`Plugin cache file is aliased`), and an unpinned, resized, over-budget or changed file (`Plugin cache payload differs: <path>`). An entry its listed name no longer reaches, removed once it was listed or listed under a name that is not UTF-8, which Node decodes lossily on Linux, is never admitted: a pinned one is missing (`Plugin cache payload is missing`), and any other, a directory or a file the walk would skip included, refuses as `Plugin cache payload differs: <path>`. Of the failures that keep a file from opening, only that of a pinned file the walk may not read (EACCES, EPERM) prints the system's error; any other leaves the file to be judged by its name, and a pinned file that still failed to open refuses as `Plugin cache payload differs: <path>`. An entry it can list but not lstat, in a directory it can list but not enter, fails with the system's error, as before.
|
|
10
|
+
|
|
11
|
+
The runtime inventory judges every entry but a runtime file listed as a regular file by its lstat, as it judged every entry before, with the same consequences for a link, a special file, a directory and a reparse point. It admits hard links, and refuses a link, a special file, an entry its listed name no longer reaches, a file that changes while it is read and any open that fails, an unreadable file included, with its one message. An entry it can list but not lstat, in a directory it can list but not enter, fails with the system's error, as before, but for a runtime file, which it opens and so refuses with its one message.
|
|
12
|
+
|
|
13
|
+
The package reader (`verifySystemPackage`) refuses a link on the way by name before it opens the input. It admits store hard links; an input that is or becomes a link refuses as `System package input is aliased: <path>`, one that is no regular file as `System package input is not a regular file: <path>`, one whose name stops holding the file read or that changes while it is read as `System package input changed while it was read: <path>`, and a missing or unreadable input fails with the system's error, as before.
|
|
14
|
+
|
|
7
15
|
`packSnapshotSet` additionally accepts one root-authored release control at `.ia/src/releases/<distribution-name>.ia` per release. That file contains exactly the selected public `@distribution`, its meaning and its unconditional `@system` roots. The archive retains those exact source bytes and pins them; verification refuses extra records, relationships, nested declarations or roots differing from the manifest. Release roots still belong to native system folders, and whole selected systems remain the payload ownership unit. The installed generation loads the pinned control as an adopted root instance so direct distribution references continue to resolve. `packSnapshot` retains its existing native-folder declaration requirement.
|
|
8
16
|
|
|
9
17
|
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
18
|
|
|
11
|
-
Packing (2026-10-09
|
|
19
|
+
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
20
|
|
|
13
|
-
The host projection mechanism (`./projection`; 2026-10-09
|
|
21
|
+
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
22
|
|
|
15
|
-
The installed-implementation catalog (`./implementations
|
|
23
|
+
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
24
|
|
|
17
|
-
Execution bindings
|
|
25
|
+
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
26
|
|
|
19
|
-
Check binding and evidence
|
|
27
|
+
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
28
|
|
|
21
29
|
|
|
22
30
|
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
31
|
|
|
24
|
-
Hook groups (`./guard-registration`; 2026-10-11
|
|
32
|
+
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
33
|
|
|
26
34
|
Registry collection kinds, source-only workspace adoption, kit installation, budgets and rollback are specified in [registry collections](references/registry-collections.md).
|
|
27
35
|
|
|
36
|
+
Transport (`./internal/bounded-fetch`; 2026-10-16): `fetchBounded` is the one GET behind registry documents and remote archives, under the bounds of the [registry spec](../../docs/specs/registry/README.md) §5.1 and §6.4: redirects refused, a 30-second timeout joined to the caller's signal, declared and streamed bytes bounded. Whatever its caller checked, it parses the URL with `new URL` and refuses only a URL that does not parse, whose scheme is not `https:` or that has a username or password. That refusal comes before any request, as `IA-DIST-INPUT-INVALID` with the message `<label> <url> is not a credential-free HTTPS URL`. It then requests the canonical form `new URL` writes. A query or a fragment passes, and a legitimate non-canonical HTTPS spelling, such as an uppercase host (`https://Registry.test/ia-registry.json`), an explicit `:443`, a percent-encoded host character, an IPv4 number form, a dot segment or an empty userinfo, is canonicalized and still accepted; fetch makes the request it made before this check, when it was handed that spelling itself, so a direct caller passing an HTTPS URL sees no break. Before this check, an `http:` URL was requested in clear text and a `data:` or `blob:` URL was read in process; a URL with any other scheme, such as `file:`, `ftp:` or `wss:`, got a `TypeError` from fetch, reported as `IA-DIST-ARTIFACT-UNAVAILABLE` with the message `<label> <url> failed: …`, as a credentialed or malformed URL did. All of them now refuse as `IA-DIST-INPUT-INVALID`, so both the code and the message change. Refusing another scheme is a defensive patch, not a contract change: the supported contract already excluded it. The [registry spec](../../docs/specs/registry/README.md) says "A registry base is a credential-free HTTPS URL or a local directory" (§3) and "HTTPS bases must carry no credentials, query or fragment, and other URL schemes refuse" (§4), and the archive check admits only HTTPS artifact URLs. Messages name the URL as the caller spelled it. Every URL built on a base that `parseRegistryBase` returns, and every URL the archive check admits, is already canonical and is requested unchanged. To migrate, a direct caller, or one that builds its own `RegistryBase`, can keep passing HTTPS URLs, in any spelling, or call `parseRegistryBase` to get the canonical form up front; a direct caller passing an `http:`, `data:` or `blob:` URL moves to an HTTPS URL or, for a registry, a local directory base. This is URL-shape hygiene, not host authorization: it does not keep a request from internal or loopback hosts, and it does not prevent DNS rebinding or other server-side request forgery.
|
|
37
|
+
|
|
28
38
|
An installation plan whose lock requires an unsupported distribution engine refuses with `IA-DIST-CONFLICT`, naming its required range and the current installer engine. Installed reads distinguish `engine-incompatible` from corrupt state through the database error reason. Neither restore nor recovery upgrades the running implementation; no fallback rewrites a lock or lowers an archive engine range. The compatibility and rollback procedure is documented in [README.md](README.md).
|
|
29
39
|
|
|
30
40
|
Explicit hook removal checks both Claude settings files before making changes. `assertRemovableHooks` refuses an IA hook group without matching ownership, including after the ownership file is lost or a workspace is moved, at the settings file that contains it. Its `unownedHook` detail identifies that group for manual recovery. It never adopts or deletes an unowned group; other settings and owned state remain intact. The ordinary modified/duplicate owned-group checks still apply. An explicit removal cannot report success while such a group remains active.
|
package/assets/host-launcher.mjs
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
// Packaged artifact entrypoint. Its inventory pin is inserted by release assembly.
|
|
2
2
|
import { createHash } from 'node:crypto';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
closeSync,
|
|
5
|
+
constants,
|
|
6
|
+
fstatSync,
|
|
7
|
+
lstatSync,
|
|
8
|
+
openSync,
|
|
9
|
+
readFileSync,
|
|
10
|
+
readSync,
|
|
11
|
+
readdirSync,
|
|
12
|
+
realpathSync,
|
|
13
|
+
statSync,
|
|
14
|
+
} from 'node:fs';
|
|
4
15
|
import { dirname, isAbsolute, join, relative, resolve } from 'node:path';
|
|
5
16
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
6
17
|
const root = resolve(dirname(fileURLToPath(import.meta.url)), '..'),
|
|
7
18
|
pin = '__INVENTORY_DIGEST__';
|
|
8
19
|
const hash = (bytes) => createHash('sha256').update(bytes).digest('hex');
|
|
9
20
|
// `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
|
|
21
|
+
// spelling a case- or normalization-folding volume opens as the same directory is inside too.
|
|
11
22
|
const within = (parent, child) => {
|
|
12
23
|
const target = statSync(parent, { bigint: true });
|
|
13
24
|
let entry = child;
|
|
@@ -40,29 +51,126 @@ try {
|
|
|
40
51
|
let count = 0,
|
|
41
52
|
total = 0,
|
|
42
53
|
entries = 0;
|
|
54
|
+
// The launcher's own files, and unpinned platform files, which the walk never reads.
|
|
55
|
+
const skipped = (rel, name, file) =>
|
|
56
|
+
rel === 'inventory.json' ||
|
|
57
|
+
rel === 'scripts/ia.mjs' ||
|
|
58
|
+
rel === 'release.json' ||
|
|
59
|
+
(!file && (name === '.DS_Store' || name.startsWith('._')));
|
|
60
|
+
// What the walk does with a file, from its stat (bigint): a link, a special file or a second link refuses; a skipped
|
|
61
|
+
// file is skipped (false); an unpinned, resized or over-budget file refuses; any other file is read and hashed (true).
|
|
62
|
+
const judge = (stat, rel, name, file) => {
|
|
63
|
+
if (stat.isSymbolicLink()) throw Error('Plugin cache links are unsupported');
|
|
64
|
+
if (!stat.isFile() || stat.nlink !== 1n) throw Error('Plugin cache file is aliased');
|
|
65
|
+
if (skipped(rel, name, file)) return false;
|
|
66
|
+
if (
|
|
67
|
+
!file ||
|
|
68
|
+
!Number.isSafeInteger(file.bytes) ||
|
|
69
|
+
stat.size !== BigInt(file.bytes) ||
|
|
70
|
+
(total += file.bytes) > 256 * 1024 * 1024
|
|
71
|
+
)
|
|
72
|
+
throw Error('Plugin cache payload differs: ' + rel);
|
|
73
|
+
return true;
|
|
74
|
+
};
|
|
75
|
+
// An entry its listed name no longer reaches: removed since its directory was read, or listed under a name that is not
|
|
76
|
+
// UTF-8, which Node decodes lossily on Linux. It is never admitted: a pinned one is left uncounted, so it is missing
|
|
77
|
+
// (false), and any other, one the walk would skip included, is no file the inventory pins.
|
|
78
|
+
const gone = (rel, file) => {
|
|
79
|
+
if (file) return false;
|
|
80
|
+
throw Error('Plugin cache payload differs: ' + rel);
|
|
81
|
+
};
|
|
82
|
+
// The lstat (bigint) of `path`, or undefined once its name reaches nothing. Every directory on the way was listed as
|
|
83
|
+
// one, so a loop on the way (ELOOP) is a link swapped in since.
|
|
84
|
+
const named = (path) => {
|
|
85
|
+
try {
|
|
86
|
+
return lstatSync(path, { bigint: true });
|
|
87
|
+
} catch (error) {
|
|
88
|
+
if (error.code === 'ENOENT' || error.code === 'ENOTDIR') return undefined;
|
|
89
|
+
if (error.code === 'ELOOP') throw Error('Plugin cache links are unsupported');
|
|
90
|
+
throw error;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
// Whether the file entry at `rel` is pinned and verified. It is opened before it is judged, so the file judged is the
|
|
94
|
+
// file hashed (CodeQL js/file-system-race): never through a link where the platform refuses one at the open, never
|
|
95
|
+
// waiting on a FIFO, read through that descriptor at most one byte past its pinned size, and still the file at `rel`
|
|
96
|
+
// afterwards, which on Windows, without either open flag, is the one check of a link swapped in after the listing.
|
|
97
|
+
const verified = (rel, name, file) => {
|
|
98
|
+
const full = join(root, rel);
|
|
99
|
+
let fd;
|
|
100
|
+
try {
|
|
101
|
+
fd = openSync(full, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0));
|
|
102
|
+
} catch (error) {
|
|
103
|
+
// Of the failures that keep a file from opening, only that of a pinned file the walk may not read (EACCES, EPERM)
|
|
104
|
+
// prints its system error, as before. A name that reaches nothing is gone, and a link the open refused (ELOOP;
|
|
105
|
+
// EMLINK on FreeBSD) is refused as one. Anything else whose open fails, a socket among them, is judged by its
|
|
106
|
+
// name, as before the walk opened files; a pinned file that some other failure kept from opening, one swapped back
|
|
107
|
+
// after the open or one the system would not open, cannot be verified and refuses as a payload that differs.
|
|
108
|
+
if (error.code === 'ENOENT' || error.code === 'ENOTDIR') return gone(rel, file);
|
|
109
|
+
if (error.code === 'ELOOP' || error.code === 'EMLINK') throw Error('Plugin cache links are unsupported');
|
|
110
|
+
const stat = named(full);
|
|
111
|
+
if (!stat) return gone(rel, file);
|
|
112
|
+
if (!judge(stat, rel, name, file)) return false;
|
|
113
|
+
if (error.code === 'EACCES' || error.code === 'EPERM') throw error;
|
|
114
|
+
throw Error('Plugin cache payload differs: ' + rel);
|
|
115
|
+
}
|
|
116
|
+
try {
|
|
117
|
+
const opened = fstatSync(fd, { bigint: true });
|
|
118
|
+
if (!judge(opened, rel, name, file)) return false;
|
|
119
|
+
const bytes = Buffer.alloc(file.bytes + 1);
|
|
120
|
+
let length = 0;
|
|
121
|
+
while (length < bytes.length) {
|
|
122
|
+
const read = readSync(fd, bytes, length, bytes.length - length, null);
|
|
123
|
+
if (!read) break;
|
|
124
|
+
length += read;
|
|
125
|
+
}
|
|
126
|
+
const after = fstatSync(fd, { bigint: true }),
|
|
127
|
+
stat = named(full);
|
|
128
|
+
if (!stat) return gone(rel, file);
|
|
129
|
+
if (stat.isSymbolicLink()) throw Error('Plugin cache links are unsupported');
|
|
130
|
+
if (!stat.isFile() || stat.nlink !== 1n) throw Error('Plugin cache file is aliased');
|
|
131
|
+
if (
|
|
132
|
+
stat.dev !== opened.dev ||
|
|
133
|
+
stat.ino !== opened.ino ||
|
|
134
|
+
after.size !== opened.size ||
|
|
135
|
+
after.mtimeNs !== opened.mtimeNs ||
|
|
136
|
+
after.ctimeNs !== opened.ctimeNs ||
|
|
137
|
+
length !== file.bytes ||
|
|
138
|
+
hash(bytes.subarray(0, length)) !== file.sha256
|
|
139
|
+
)
|
|
140
|
+
throw Error('Plugin cache payload differs: ' + rel);
|
|
141
|
+
return true;
|
|
142
|
+
} finally {
|
|
143
|
+
closeSync(fd);
|
|
144
|
+
}
|
|
145
|
+
};
|
|
43
146
|
const visit = (path = '', depth = 0) => {
|
|
44
147
|
if (depth > 32) throw Error('Plugin cache directory depth exceeds 32');
|
|
45
|
-
|
|
148
|
+
let listed;
|
|
149
|
+
try {
|
|
150
|
+
listed = readdirSync(join(root, path), { withFileTypes: true });
|
|
151
|
+
} catch (error) {
|
|
152
|
+
// A directory its listed name no longer reaches is no part of the payload. It and every directory on its way were
|
|
153
|
+
// listed as directories (the root resolved), so one that loops (ELOOP) is a link swapped in since.
|
|
154
|
+
if (path && (error.code === 'ENOENT' || error.code === 'ENOTDIR'))
|
|
155
|
+
throw Error('Plugin cache payload differs: ' + path);
|
|
156
|
+
if (error.code === 'ELOOP') throw Error('Plugin cache links are unsupported');
|
|
157
|
+
throw error;
|
|
158
|
+
}
|
|
159
|
+
for (const entry of listed) {
|
|
46
160
|
if (++entries > 20000) throw Error('Plugin cache filesystem inventory exceeds its bound');
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
(total += stat.size) > 256 * 1024 * 1024 ||
|
|
61
|
-
hash(readFileSync(full)) !== file.sha256
|
|
62
|
-
)
|
|
63
|
-
throw Error('Plugin cache payload differs: ' + rel);
|
|
64
|
-
count++;
|
|
65
|
-
}
|
|
161
|
+
const name = entry.name,
|
|
162
|
+
rel = path ? path + '/' + name : name,
|
|
163
|
+
file = expected.get(rel);
|
|
164
|
+
// A file the listing reports is judged by the descriptor it is read through. Any other entry is judged by its lstat,
|
|
165
|
+
// as the walk judged every entry before it opened files: Windows lists every reparse point as a link, so only a real
|
|
166
|
+
// link refuses as one, a placeholder or deduplicated entry is judged by the type its lstat gives, and an entry in a
|
|
167
|
+
// directory the walk can list but not enter fails with the lstat's error, as before.
|
|
168
|
+
const kind = entry.isFile() ? entry : named(join(root, rel));
|
|
169
|
+
if (!kind) gone(rel, file);
|
|
170
|
+
else if (kind.isSymbolicLink()) throw Error('Plugin cache links are unsupported');
|
|
171
|
+
else if (kind.isDirectory()) visit(rel, depth + 1);
|
|
172
|
+
else if (!kind.isFile()) throw Error('Plugin cache file is aliased');
|
|
173
|
+
else if (verified(rel, name, file)) count++;
|
|
66
174
|
}
|
|
67
175
|
};
|
|
68
176
|
visit();
|
package/dist/bounded-fetch.d.ts
CHANGED
|
@@ -12,6 +12,12 @@ export interface BoundedFetch {
|
|
|
12
12
|
readonly optional?: boolean;
|
|
13
13
|
readonly signal?: AbortSignal | undefined;
|
|
14
14
|
}
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* A 30 s timeout joined to the caller's signal, redirects refused, declared and streamed bytes bounded (spec §5.1, §6.4),
|
|
17
|
+
* and, whatever the caller checked, a request only for a URL that `new URL` parses as `https:` without a username or
|
|
18
|
+
* password, sent in the canonical form `new URL` writes; any other URL refuses as INPUT-INVALID, naming the URL after
|
|
19
|
+
* `label`. Messages name the URL as the caller spelled it. This is URL hygiene, not host authorization: it does not
|
|
20
|
+
* keep a request from internal, loopback or rebinding hosts.
|
|
21
|
+
*/
|
|
16
22
|
export declare function fetchBounded(request: BoundedFetch): Promise<Buffer | null>;
|
|
17
23
|
//# sourceMappingURL=bounded-fetch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bounded-fetch.d.ts","sourceRoot":"","sources":["../src/bounded-fetch.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,MAAM,CAAC;IAC7C,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CAC3C;AACD
|
|
1
|
+
{"version":3,"file":"bounded-fetch.d.ts","sourceRoot":"","sources":["../src/bounded-fetch.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,MAAM,CAAC;IAC7C,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CAC3C;AACD;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAehF"}
|
package/dist/bounded-fetch.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { DistributionError, fail } from './files.js';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* A 30 s timeout joined to the caller's signal, redirects refused, declared and streamed bytes bounded (spec §5.1, §6.4),
|
|
4
|
+
* and, whatever the caller checked, a request only for a URL that `new URL` parses as `https:` without a username or
|
|
5
|
+
* password, sent in the canonical form `new URL` writes; any other URL refuses as INPUT-INVALID, naming the URL after
|
|
6
|
+
* `label`. Messages name the URL as the caller spelled it. This is URL hygiene, not host authorization: it does not
|
|
7
|
+
* keep a request from internal, loopback or rebinding hosts.
|
|
8
|
+
*/
|
|
3
9
|
export async function fetchBounded(request) {
|
|
4
10
|
const { url, signal } = request;
|
|
5
11
|
// §6.4: a network failure, the 30 s timeout included, names the URL; only the caller's own abort stays an abort.
|
|
@@ -16,8 +22,31 @@ export async function fetchBounded(request) {
|
|
|
16
22
|
}
|
|
17
23
|
async function transfer(request) {
|
|
18
24
|
const { url, limit, label, oversize, optional = false, signal } = request;
|
|
25
|
+
const refuse = () => fail('INPUT-INVALID', `${label} ${url} is not a credential-free HTTPS URL`);
|
|
26
|
+
// The policy: `url` parses as a WHATWG URL with the `https:` scheme and no username or password. Nothing else
|
|
27
|
+
// refuses: a query or fragment passes, and a spelling that `new URL` rewrites (case, `:443`, a percent-encoded host
|
|
28
|
+
// character, an IPv4 number form, a dot segment) is requested in the canonical form it writes, which is the request
|
|
29
|
+
// fetch built when handed the spelling itself. A malformed or credentialed URL never got a request: fetch rejects it.
|
|
30
|
+
let parsed;
|
|
31
|
+
try {
|
|
32
|
+
parsed = new URL(url);
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return refuse();
|
|
36
|
+
}
|
|
37
|
+
if (parsed.protocol !== 'https:' || parsed.username || parsed.password)
|
|
38
|
+
return refuse();
|
|
39
|
+
const href = parsed.href;
|
|
40
|
+
// `new URL` writes such a URL as `https://` and printable ASCII only: the host is lowercase ASCII (punycode for a
|
|
41
|
+
// non-ASCII name), and a control, space or non-ASCII character elsewhere is percent-encoded or, for a tab or newline,
|
|
42
|
+
// stripped. The test below therefore refuses nothing the checks above admit. It is the guard CodeQL reads
|
|
43
|
+
// (js/file-access-to-http): an anchored pattern listing every printable ASCII character, tested on the very string
|
|
44
|
+
// fetch receives, with a `return` that ends the refusing branch. Keep the literal inline, keep the `return`, and
|
|
45
|
+
// pass `href`, not `url`, to fetch.
|
|
46
|
+
if (!/^https:\/\/[a-zA-Z0-9!"#$%&'()*+,.\/:;<=>?@\[\\\]^_`{|}~-]+$/.test(href))
|
|
47
|
+
return refuse();
|
|
19
48
|
const timeout = AbortSignal.timeout(30_000), combined = signal === undefined ? timeout : AbortSignal.any([timeout, signal]);
|
|
20
|
-
const response = await fetch(
|
|
49
|
+
const response = await fetch(href, { redirect: 'error', signal: combined });
|
|
21
50
|
if (!response.ok || (!response.body && !optional)) {
|
|
22
51
|
await response.body?.cancel();
|
|
23
52
|
if (optional && response.status === 404)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bounded-fetch.js","sourceRoot":"","sources":["../src/bounded-fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAgBrD
|
|
1
|
+
{"version":3,"file":"bounded-fetch.js","sourceRoot":"","sources":["../src/bounded-fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,YAA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AAS,CAAC;QACT,QAAQ,CAAC,mBAAmB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC9C,IAAI,CAAC;YACH,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QAC1C,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,WAAW,EAAE,CAAC;QACvB,CAAC;IACH,CAAC;IACD,QAAQ,CAAC,cAAc,EAAE,CAAC;IAC1B,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC"}
|
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,sBAAsB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAE3G,MAAM,CAAC,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;CAgBnB,CAAC;AACF,SAAS,WAAW,CAAC,IAAuB;IAC1C,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC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,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,WAAW,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;IACrH,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC;AACH,CAAC"}
|
package/dist/decisions.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Host plugin distribution spec §
|
|
1
|
+
/** Host plugin distribution spec §7.2: answers to "initialize this repository?", kept in the IA home, never in the repository. */
|
|
2
2
|
export declare const DECISIONS = "state/decisions.json";
|
|
3
3
|
export type DeclineKind = 'today' | 'forever';
|
|
4
4
|
export interface Decision {
|
|
@@ -8,13 +8,13 @@ export interface Decision {
|
|
|
8
8
|
readonly host: string;
|
|
9
9
|
readonly path: string;
|
|
10
10
|
}
|
|
11
|
-
/**
|
|
11
|
+
/** The git top level when inside a work tree, else the directory; its real path, case-folded on Windows. */
|
|
12
12
|
export declare function repositoryKey(directory: string, platform?: string): {
|
|
13
13
|
readonly key: string;
|
|
14
14
|
readonly path: string;
|
|
15
15
|
};
|
|
16
16
|
export declare const nextLocalMidnight: (at: Date) => Date;
|
|
17
|
-
/** §9
|
|
17
|
+
/** §9: an unreadable or malformed file reads as empty and says so. `reason` is the filesystem error's `code`, `'parse'` for JSON that does not parse, or `'schema'` for a wrong/missing schema or a row that fails `shaped`. */
|
|
18
18
|
export declare function readDecisions(home: string): {
|
|
19
19
|
readonly repositories: Readonly<Record<string, Decision>>;
|
|
20
20
|
readonly invalid: boolean;
|
package/dist/decisions.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decisions.d.ts","sourceRoot":"","sources":["../src/decisions.ts"],"names":[],"mappings":"AAKA,
|
|
1
|
+
{"version":3,"file":"decisions.d.ts","sourceRoot":"","sources":["../src/decisions.ts"],"names":[],"mappings":"AAKA,kIAAkI;AAClI,eAAO,MAAM,SAAS,yBAAyB,CAAC;AA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