@inventarch/distribution 3.5.1 → 3.7.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/SPEC.md +5 -3
- package/dist/adoption.js +2 -2
- package/dist/adoption.js.map +1 -1
- package/dist/authoring-assets.d.ts.map +1 -1
- package/dist/authoring-assets.js +3 -2
- package/dist/authoring-assets.js.map +1 -1
- package/dist/bootstrap.d.ts +15 -2
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +55 -12
- package/dist/bootstrap.js.map +1 -1
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +2 -2
- package/dist/command.js.map +1 -1
- package/dist/home-lock.d.ts +67 -0
- package/dist/home-lock.d.ts.map +1 -0
- package/dist/home-lock.js +281 -0
- package/dist/home-lock.js.map +1 -0
- package/dist/install.d.ts +17 -0
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +67 -2
- package/dist/install.js.map +1 -1
- package/dist/installation-core.d.ts.map +1 -1
- package/dist/installation-core.js +2 -1
- package/dist/installation-core.js.map +1 -1
- package/dist/kit-collections.d.ts +182 -0
- package/dist/kit-collections.d.ts.map +1 -0
- package/dist/kit-collections.js +457 -0
- package/dist/kit-collections.js.map +1 -0
- package/dist/kit-inventory.d.ts +36 -0
- package/dist/kit-inventory.d.ts.map +1 -0
- package/dist/kit-inventory.js +69 -0
- package/dist/kit-inventory.js.map +1 -0
- package/dist/native-command.d.ts +1 -1
- package/dist/native-command.d.ts.map +1 -1
- package/dist/native-command.js +45 -16
- package/dist/native-command.js.map +1 -1
- package/dist/registry-resolve.d.ts +32 -0
- package/dist/registry-resolve.d.ts.map +1 -1
- package/dist/registry-resolve.js +113 -5
- package/dist/registry-resolve.js.map +1 -1
- package/dist/registry.d.ts +1 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +1 -1
- package/dist/registry.js.map +1 -1
- package/dist/services.d.ts +6 -1
- package/dist/services.d.ts.map +1 -1
- package/dist/services.js +1 -0
- package/dist/services.js.map +1 -1
- package/dist/updates.d.ts +76 -4
- package/dist/updates.d.ts.map +1 -1
- package/dist/updates.js +185 -20
- package/dist/updates.js.map +1 -1
- package/package.json +31 -7
- package/references/registry-collections.md +12 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inventarch/distribution",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"ia-distribution": "./dist/cli.js"
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
"node": ">=22.22.0 <23"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@inventarch/db": "3.
|
|
24
|
-
"@inventarch/graph": "3.
|
|
25
|
-
"@inventarch/language": "3.
|
|
26
|
-
"@inventarch/authoring-system": "3.
|
|
27
|
-
"@inventarch/workspace-runtime": "3.
|
|
23
|
+
"@inventarch/db": "3.7.0",
|
|
24
|
+
"@inventarch/graph": "3.7.0",
|
|
25
|
+
"@inventarch/language": "3.7.0",
|
|
26
|
+
"@inventarch/authoring-system": "3.7.0",
|
|
27
|
+
"@inventarch/workspace-runtime": "3.7.0",
|
|
28
28
|
"smol-toml": "1.9.0",
|
|
29
29
|
"jsonc-parser": "3.3.1",
|
|
30
|
-
"@inventarch/steward-hook": "3.
|
|
30
|
+
"@inventarch/steward-hook": "3.7.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/node": "^22.19.0",
|
|
@@ -139,6 +139,18 @@
|
|
|
139
139
|
"types": "./dist/updates.d.ts",
|
|
140
140
|
"default": "./dist/updates.js"
|
|
141
141
|
},
|
|
142
|
+
"./kit-collections": {
|
|
143
|
+
"types": "./dist/kit-collections.d.ts",
|
|
144
|
+
"default": "./dist/kit-collections.js"
|
|
145
|
+
},
|
|
146
|
+
"./kit-inventory": {
|
|
147
|
+
"types": "./dist/kit-inventory.d.ts",
|
|
148
|
+
"default": "./dist/kit-inventory.js"
|
|
149
|
+
},
|
|
150
|
+
"./home-lock": {
|
|
151
|
+
"types": "./dist/home-lock.d.ts",
|
|
152
|
+
"default": "./dist/home-lock.js"
|
|
153
|
+
},
|
|
142
154
|
"./services": {
|
|
143
155
|
"types": "./dist/services.d.ts",
|
|
144
156
|
"default": "./dist/services.js"
|
|
@@ -191,6 +203,10 @@
|
|
|
191
203
|
"types": "./dist/guard-registration.d.ts",
|
|
192
204
|
"default": "./dist/guard-registration.js"
|
|
193
205
|
},
|
|
206
|
+
"./internal/home-lock": {
|
|
207
|
+
"types": "./dist/home-lock.d.ts",
|
|
208
|
+
"default": "./dist/home-lock.js"
|
|
209
|
+
},
|
|
194
210
|
"./internal/host-home": {
|
|
195
211
|
"types": "./dist/host-home.d.ts",
|
|
196
212
|
"default": "./dist/host-home.js"
|
|
@@ -235,6 +251,14 @@
|
|
|
235
251
|
"types": "./dist/json-edit.d.ts",
|
|
236
252
|
"default": "./dist/json-edit.js"
|
|
237
253
|
},
|
|
254
|
+
"./internal/kit-collections": {
|
|
255
|
+
"types": "./dist/kit-collections.d.ts",
|
|
256
|
+
"default": "./dist/kit-collections.js"
|
|
257
|
+
},
|
|
258
|
+
"./internal/kit-inventory": {
|
|
259
|
+
"types": "./dist/kit-inventory.d.ts",
|
|
260
|
+
"default": "./dist/kit-inventory.js"
|
|
261
|
+
},
|
|
238
262
|
"./internal/lifecycle-registration": {
|
|
239
263
|
"types": "./dist/lifecycle-registration.d.ts",
|
|
240
264
|
"default": "./dist/lifecycle-registration.js"
|
|
@@ -4,6 +4,18 @@ The public `./registry` interface supports `index(id)` and `index('release', id)
|
|
|
4
4
|
|
|
5
5
|
`ia.registry-kit.v1` contains `id` and `releases`; each release contains `version`, `withdrawn`, and `distributions` with ordinary `{id, range}` requests. `ia install <id>[@range]` treats an explicitly named id as a kit only when its release index is empty. Its members pass the existing resolution, archive integrity, native admission, install transaction and registered packet refresh. The lock pins the resulting distribution requests and exact archive closure, so restore stays offline-capable without kit metadata. Removing or updating a kit is performed on those explicit distribution requests; kits confer no implementation catalog, registry override, credential or host permission.
|
|
6
6
|
|
|
7
|
+
## Collection record
|
|
8
|
+
|
|
9
|
+
The lock is not changed to remember which collection an install expanded: a new lock key or entry kind would make every older CLI refuse the repository. Instead `.ia/kit-collections.json` (`./kit-collections`), committed beside the lock, keeps each collection's identity: `{"format": "ia-kit-collections-1", "lock": <sha256 of the lock bytes it describes>, "collections": [{id, version, registry, members: [{id, version, archive}]}], "unknown": [{id, members: [<member id>]}], "named": [<request id>]}`; `named`, written only when not empty, lists the lock requests the user named directly that a recorded collection also lists (see below). `registry` is the HTTPS URL or directory the kit index was read from. Every collection and member id is a distribution id (`provider/name`, the lock's rule); a record holding any other id is unreadable, so an id such as `--root=/other` never reaches a fix doctor offers. Rows and members are sorted by id. A kit release that lists another kit expands it in turn, and the row of the collection the command named records the members that expansion reached in its place; a kit reached that way gets no row of its own. A row is built by joining each member id of the expanded kit release to the resolved plan lock's `packages` row of that id, for its exact version and archive; a member the lock lacks refuses with `IA-DIST-INSTALL-COLLECTION-MISMATCH` before `pending.json` is written, so the lock, the record and the activation stay as they were (the preview, which runs the same merge to name the record in its "Would write", refuses the same way). A record left with no collection and no unknown entry is removed rather than written empty.
|
|
10
|
+
|
|
11
|
+
Every apply (`install`, `update`, `remove`, `restore`) merges the record inside its installation lock: it starts from the record that describes the lock before the operation (from none when it describes another), drops the rows of each collection the operation expanded, keeps every other row only while all its members are the new lock's exact pins (a row with any member removed, re-pinned or re-archived is removed whole, so its other members can never make it intact again), and adds the expanded rows, among them each holder an install recorded again at its shared member's new pin (see below). An unknown entry stays until its collection is installed again or none of its members is left in the lock. A restore of an unchanged lock writes nothing. A record file that cannot be decoded (not JSON, a member id that is not a package id, another format) is never treated as none: the apply refuses with `IA-DIST-COLLECTIONS-UNREADABLE` before it writes any store, generation, lock or record file (through `ia`, after the plan, which may already have filled the archive cache or written `--plan-out`), naming the file and its reason, since the merge would replace it and lose its collection rows (the installed packages stay; with no lock yet, as in the install `ia init` makes, the refusal says instead that nothing installed is at stake). The same holds for a record in a format this ia does not know, such as one a newer ia wrote: every apply refuses it, `ia init` included, and the file is left exactly as it was. The remedy is to restore the file from version control or a backup, to move it aside if its collections may be forgotten, or, for an unknown format, to upgrade ia, and run the command again.
|
|
12
|
+
|
|
13
|
+
While an apply changes the record, a journal in the local install state, `.ia/distributions/kit-collections.journal.json` (`{formatVersion: 1, beforeActive, afterActive, before, after}`: the exact activation pointer bytes before and after, and the record's bytes before and after, `null` for none), binds the change to the activation it belongs to. The write order is: `pending.json`; the journal (checkpoint `collections-journal`); the record (`collections`); the lock; the activation pointer; the journal removed (`collections-journal-removed`); `pending.json` removed. `ia recover installation` writes the record as `after` when the activation committed and as `before` when it rolls back, then removes the journal, before it removes `pending.json`. The activation pointer carries no transaction nonce, because its decoder refuses any extra key and older readers would refuse the workspace's `active.json`.
|
|
14
|
+
|
|
15
|
+
Which record counts, read only and failing closed: with a journal and `pending.json`, an operation was interrupted, so no collection identity is reported ("installation interrupted; run ia recover"). With a journal and no `pending.json` (a recovery that did not read the journal), its `after` counts while `active.json` is exactly `afterActive`, its `before` while exactly `beforeActive`, and otherwise the collections both sides agree on byte for byte, every other one unknown with the member ids either side recorded; the next apply settles the record that way and removes the journal. With no journal, the record file counts. The chosen record counts only when its `lock` is the sha256 of the current lock bytes, and inside it a collection is intact only while every member is the lock's exact pin; otherwise its members are inventoried as plain releases and the source is reported unknown, never guessed. A reader takes the record and the lock between two probes of `pending.json`, the journal, the activation pointer, the lock and the record, by content and by file identity (inode, modification time and size, so a file put back with identical bytes still counts as a change; where no inode is reported, the time, size and content stand alone); when another process changed any of them in between, it reads once more, and when they change again it reports every collection the record or journal names as unknown. One residual case is accepted: when an older CLI rolls back a staged collection upgrade whose lock is byte-identical and then restores the unchanged lock, it recreates `afterActive` exactly, and the upgraded version is reported although it never committed; the pins and archives are the same either way, and the next install or update of the collection corrects the version. A second residual is accepted too: on a volume that reports no inode and whose timestamps do not move between a reader's two probes, a rollback that restores identical bytes between them goes unseen, so that one read may report the staged version. It changes nothing on disk, and the next read reports what holds.
|
|
16
|
+
|
|
17
|
+
Re-installing a collection replaces the member requests its earlier expansion left (both sides' members for an unknown one): they leave the requests before the new release's members are added, so a member whose range changed is not a conflict, and a member the new release no longer lists stays locked only while something depends on it. A member request the same command names itself, that another collection expanded in the same command introduced, or that another installed collection still lists (unless the same command expands that collection too), is kept, so it conflicts as any other direct request does: two collections upgraded together never overwrite each other's member constraints, and re-installing one collection never drops a member another installed collection lists, nor that collection's row. Equal ranges agree at once. When the new release lists such a member (or one another collection expanded in the same command) with another range, the two are resolved together: the install needs a release both accept, not withdrawn and admitted by the engine, or a usable cached pin both accept, and the request becomes the range accepting exactly what both accept (`commonRange` in `@inventarch/db/distribution`). When `semver.subset` finds one range inside the other and the narrower admits no prerelease, the narrower one is written as it was spelled, so `^1.2.0` and `^1.4.0` leave `^1.4.0`; otherwise the request is their conjunction of sorted comparators (`^1.2.5` and `~1.2.3` leave `<1.3.0-0 <2.0.0-0 >=1.2.3 >=1.2.5`), the same in either order. Selection then runs against that range, so the lock's pin is one every holder accepts, and a pin already inside it stays. Re-expanding either collection finds its own range holding the request and changes nothing. No release both accept, ranges that do not intersect, a prerelease the narrower of two nested ranges admits, or one in either range otherwise (a range cannot say "this prerelease for one side only", and `semver.subset` can wrongly find a range admitting one inside another), or a conjunction past the 256-character range limit, refuses with `IA-DIST-CONFLICT`, naming that member, each collection that still lists it and the range it left, and its next command installs the collection together with them (`ia install <collection> <other>`), which re-expands both and succeeds only when one release satisfies every range their releases list. A request the user named, rather than a collection, keeps comparing as a string, in that command and every later one: any other range conflicts with it, and re-installing a collection that lists it keeps it. The lock cannot say who asked for a request, so the record's `named` keeps each such request a recorded collection lists, whether the user named it before or after a collection listed it; an install also counts as named any lock request no recorded collection lists. A record an older CLI rewrites loses `named`, and a lost record leaves every request compared as a string. When the member's pin moves, each holder's row is recorded again at the new pin with its own version and registry, since the holder accepts it, instead of being dropped as re-pinned. The request is the only place a holder's range is kept, so it can stay narrower than any holder now lists: the range an earlier release left stands until no other installed collection holds the member, and a release inside what the holder lists can refuse against it. Installing the collections together, as the refusal's next command does, re-expands them and clears it. `./kit-inventory`'s `installedUnits(root)` lists what `ia install` and `ia update` can move: each lock `package` entry, each intact collection, and each remaining direct request, with that source.
|
|
18
|
+
|
|
7
19
|
`ia.registry-workspace.v1` contains `id` and `releases`; each release contains `version`, `withdrawn`, `revision`, and `files` with `{path, text}`. It is source data, with at most 1,000 files, 1 MiB per file and 3 MiB of combined text. Native paths must be under `.ia/src`, outside its floor; documentation is explicit portable `.md` or `.txt` paths outside hidden roots. The revision is SHA-256 of the stable serialization of the sorted native `{path,text}` rows. The source parser checks every native file and refuses authority-producing `mandate`, `agent-profile`, `execution-binding`, `hook`, `capability`, and `check` records, including nested records. Author and review those records locally. No executable, host configuration, registry mapping, implementation catalog or remote credential is copied or loaded.
|
|
8
20
|
|
|
9
21
|
`ia adopt <id>[@range] --registry <base>` previews by default. `--apply --yes` writes `.ia/open/.gitattributes` with `* -text -filter -ident -working-tree-encoding` unless a regular file is already there, which keeps checkouts from converting pinned bytes unless a higher-precedence git attribute says otherwise, pins a source tree at `.ia/open/<binding-id>/<revision>`, records a version-1 `.ia/workspace.json` `open` binding, and adds `<tree>/.ia/src @open` to the sole authored workspace's `composition.sources`. These records enter at band 50, below installed/adopted band 90 and authored band 100. Binding IDs are deterministic hashes of the provider-qualified id; identities, edges and native bytes are unchanged. Existing local `adopted` bindings keep their version-1 behavior. The planner checks candidate admission and any existing destination entries before writes. Native paths excluded by physical source discovery (`dist`, `node_modules`, `.git`, and the floor) are refused. Apply verifies exact destination file membership and bytes, then checks the physical native revision before publishing the declaration or binding; unlisted owner data is preserved and causes refusal. Apply holds an exclusive adoption lock, rechecks the inputs, writes immutable mount files, then updates the declaration and binding. A manifest-write failure restores the declaration when it still holds this operation's bytes. After a process crash, inspect the declaration and binding before removing the stale `.ia/adoption.lock`; no automatic crash recovery is claimed. Unreferenced immutable files may remain after interruption; the published source set does not include them. Capture and registered packet refresh follow publication; their failure explicitly reports that adoption already applied and prints one adoption retry pinned to the selected version, preserving the root and explicit registry. After repairing the reported failure, that retry completes capture and registered projections. A repeated application of the same pin is safe; a different revision requires explicit removal of the old binding first.
|