@amalgm/shell 0.1.162 → 0.1.164-main.34182640231

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/PURPOSE.md +163 -17
  2. package/README.md +74 -11
  3. package/config/releases/trust/runtime/main.root.json +84 -0
  4. package/config/releases/trust/runtime/preview.root.json +84 -0
  5. package/dist/authorization/recovery-host.d.ts +1 -0
  6. package/dist/authorization/recovery-host.js +2 -3
  7. package/dist/authorization/recovery-host.js.map +1 -1
  8. package/dist/boot.js +28 -20
  9. package/dist/boot.js.map +1 -1
  10. package/dist/cli-arguments.d.ts +8 -0
  11. package/dist/cli-arguments.js +47 -0
  12. package/dist/cli-arguments.js.map +1 -0
  13. package/dist/cli.d.ts +6 -4
  14. package/dist/cli.js +91 -73
  15. package/dist/cli.js.map +1 -1
  16. package/dist/compose.js +4 -3
  17. package/dist/compose.js.map +1 -1
  18. package/dist/content-cache-index.js +2 -2
  19. package/dist/content-cache-index.js.map +1 -1
  20. package/dist/detection/runtime.js +2 -2
  21. package/dist/detection/runtime.js.map +1 -1
  22. package/dist/development/profile.d.ts +27 -0
  23. package/dist/development/profile.js +142 -0
  24. package/dist/development/profile.js.map +1 -0
  25. package/dist/entity-apply-host.js +2 -2
  26. package/dist/entity-apply-host.js.map +1 -1
  27. package/dist/entity-apply-store.d.ts +2 -1
  28. package/dist/entity-apply-store.js +52 -37
  29. package/dist/entity-apply-store.js.map +1 -1
  30. package/dist/files-register-host.d.ts +1 -0
  31. package/dist/files-register-host.js +1 -0
  32. package/dist/files-register-host.js.map +1 -1
  33. package/dist/installation/environment.d.ts +30 -0
  34. package/dist/installation/environment.js +28 -0
  35. package/dist/installation/environment.js.map +1 -0
  36. package/dist/installation/lease.d.ts +6 -0
  37. package/dist/installation/lease.js +28 -0
  38. package/dist/installation/lease.js.map +1 -0
  39. package/dist/installation/ownership.d.ts +30 -0
  40. package/dist/installation/ownership.js +156 -0
  41. package/dist/installation/ownership.js.map +1 -0
  42. package/dist/installation/selection.d.ts +8 -0
  43. package/dist/installation/selection.js +29 -0
  44. package/dist/installation/selection.js.map +1 -0
  45. package/dist/machine-host.d.ts +27 -5
  46. package/dist/machine-host.js +244 -96
  47. package/dist/machine-host.js.map +1 -1
  48. package/dist/main.js +56 -2
  49. package/dist/main.js.map +1 -1
  50. package/dist/platform-product-host.d.ts +9 -9
  51. package/dist/platform-product-host.js +17 -17
  52. package/dist/platform-product-host.js.map +1 -1
  53. package/dist/platform-tools.d.ts +4 -3
  54. package/dist/platform-tools.js +34 -37
  55. package/dist/platform-tools.js.map +1 -1
  56. package/dist/process-lifecycle.d.ts +6 -0
  57. package/dist/process-lifecycle.js +42 -0
  58. package/dist/process-lifecycle.js.map +1 -0
  59. package/dist/pty-host.d.ts +1 -1
  60. package/dist/pty-host.js +70 -21
  61. package/dist/pty-host.js.map +1 -1
  62. package/dist/runtime-command-host.d.ts +7 -0
  63. package/dist/runtime-command-host.js +49 -13
  64. package/dist/runtime-command-host.js.map +1 -1
  65. package/dist/service/adapter.d.ts +36 -0
  66. package/dist/service/adapter.js +24 -0
  67. package/dist/service/adapter.js.map +1 -0
  68. package/dist/service/cli.d.ts +8 -0
  69. package/dist/service/cli.js +237 -0
  70. package/dist/service/cli.js.map +1 -0
  71. package/dist/service/control.d.ts +38 -0
  72. package/dist/service/control.js +68 -0
  73. package/dist/service/control.js.map +1 -0
  74. package/dist/service/index.d.ts +9 -0
  75. package/dist/service/index.js +10 -0
  76. package/dist/service/index.js.map +1 -0
  77. package/dist/service/keepalive.d.ts +18 -0
  78. package/dist/service/keepalive.js +418 -0
  79. package/dist/service/keepalive.js.map +1 -0
  80. package/dist/service/launchd.d.ts +9 -0
  81. package/dist/service/launchd.js +105 -0
  82. package/dist/service/launchd.js.map +1 -0
  83. package/dist/service/owner.d.ts +4 -0
  84. package/dist/service/owner.js +14 -0
  85. package/dist/service/owner.js.map +1 -0
  86. package/dist/service/portable.d.ts +10 -0
  87. package/dist/service/portable.js +32 -0
  88. package/dist/service/portable.js.map +1 -0
  89. package/dist/service/recovery.d.ts +27 -0
  90. package/dist/service/recovery.js +58 -0
  91. package/dist/service/recovery.js.map +1 -0
  92. package/dist/service/registration.d.ts +82 -0
  93. package/dist/service/registration.js +114 -0
  94. package/dist/service/registration.js.map +1 -0
  95. package/dist/service/systemd-unit.d.ts +7 -0
  96. package/dist/service/systemd-unit.js +43 -0
  97. package/dist/service/systemd-unit.js.map +1 -0
  98. package/dist/service/systemd.d.ts +5 -0
  99. package/dist/service/systemd.js +72 -0
  100. package/dist/service/systemd.js.map +1 -0
  101. package/dist/service/windows-action.d.ts +9 -0
  102. package/dist/service/windows-action.js +55 -0
  103. package/dist/service/windows-action.js.map +1 -0
  104. package/dist/service/windows-task.d.ts +9 -0
  105. package/dist/service/windows-task.js +46 -0
  106. package/dist/service/windows-task.js.map +1 -0
  107. package/dist/service/windows.d.ts +2 -0
  108. package/dist/service/windows.js +65 -0
  109. package/dist/service/windows.js.map +1 -0
  110. package/dist/sqlite.d.ts +4 -0
  111. package/dist/sqlite.js +16 -0
  112. package/dist/sqlite.js.map +1 -0
  113. package/dist/updates/artifacts.d.ts +40 -0
  114. package/dist/updates/artifacts.js +299 -0
  115. package/dist/updates/artifacts.js.map +1 -0
  116. package/dist/updates/bootstrap.d.ts +48 -0
  117. package/dist/updates/bootstrap.js +384 -0
  118. package/dist/updates/bootstrap.js.map +1 -0
  119. package/dist/updates/controller.d.ts +66 -0
  120. package/dist/updates/controller.js +322 -0
  121. package/dist/updates/controller.js.map +1 -0
  122. package/dist/updates/isolated-command-lifetime.d.ts +1 -0
  123. package/dist/updates/isolated-command-lifetime.js +63 -0
  124. package/dist/updates/isolated-command-lifetime.js.map +1 -0
  125. package/dist/updates/store.d.ts +41 -0
  126. package/dist/updates/store.js +80 -0
  127. package/dist/updates/store.js.map +1 -0
  128. package/dist/updates/trust.d.ts +20 -0
  129. package/dist/updates/trust.js +138 -0
  130. package/dist/updates/trust.js.map +1 -0
  131. package/dist/user-ground-host.d.ts +4 -1
  132. package/dist/user-ground-host.js +16 -3
  133. package/dist/user-ground-host.js.map +1 -1
  134. package/dist/watching/host.js +4 -2
  135. package/dist/watching/host.js.map +1 -1
  136. package/dist/workspace-add-staging.js +2 -2
  137. package/dist/workspace-add-staging.js.map +1 -1
  138. package/examinations/fixtures/machine-control-plane.js +57 -0
  139. package/examinations/fixtures/private-wire-authority.js +1065 -0
  140. package/examinations/native-service.mjs +92 -0
  141. package/examinations/network-view.mjs +202 -0
  142. package/examinations/runtime-upgrade.native-test.mjs +198 -0
  143. package/npm-shrinkwrap.json +2097 -218
  144. package/package.json +95 -14
package/PURPOSE.md CHANGED
@@ -1,23 +1,137 @@
1
1
  # @amalgm/shell — Purpose
2
2
 
3
- The boot shell is the runtime rebuilt from lego bricks. It owns nothing but
4
- composition: process boot, host adapters, and the wiring that hands each
5
- published `@amalgm/*` SDK its dependencies. Every law lives in a brick; the
6
- shell only assembles.
3
+ Amalgm Shell gives a user one dependable machine runtime assembled from the
4
+ published `@amalgm/*` SDKs. An enabled installation should remain available
5
+ while its host can execute, recover without opening a UI, contain a failing
6
+ workload, and leave the machine's resources available for useful work. Shell
7
+ owns composition, process boot, and native host effects; Core and the product
8
+ SDKs own the decisions those effects execute.
9
+
10
+ ## Operating axioms
11
+
12
+ These are the required operating contract, not a statement that every current
13
+ installation satisfies it. The [operating contract](docs/operating-contract.md)
14
+ defines the terms and examinations; the [September 2026 audit](docs/operating-audit-2026-09-05.md)
15
+ records implementation gaps and historical evidence.
16
+ The [release environments plan](docs/release-environments-plan.md) records the
17
+ agreed CI/CD and update evolution; its target behavior is not yet delivered.
18
+
19
+ - **O1 — Lifetime follows installation intent.** One installation owner keeps
20
+ the enabled runtime available independently of its launching UI or terminal
21
+ whenever the host can execute and the required machine state is accessible.
22
+ - **O2 — Failure stays with its owner.** A failed workload degrades its own
23
+ capability and declared dependants without restarting its parent or unrelated
24
+ capabilities.
25
+ - **O3 — Recovery has an end.** Automatic process recovery reaches sustained
26
+ health or a durable parked state within a finite attempt budget that parent
27
+ restarts and elapsed backoff cannot replenish.
28
+ - **O4 — Health observation stays available.** Local control and liveness
29
+ perform bounded work independently of product readiness, cloud connectivity,
30
+ and workload size.
31
+ - **O5 — Each decision has one repository owner.** Core owns portable kernel
32
+ policy, each product owns its domain policy, and Shell supplies composition
33
+ and machine effects through their public contracts.
34
+ - **O6 — Resource use follows necessary work.** Every host resource has one
35
+ lifecycle owner and a declared bound, and idle operation performs no work
36
+ except explicitly budgeted health, lease, and reconciliation duties.
37
+
38
+ The detailed axioms below remain binding. Their mechanisms must serve these
39
+ operating rules; a parity-preserved behavior that violates one is a documented
40
+ gap to resolve at its owning SDK, not a reason to perpetuate the violation.
7
41
 
8
42
  ## Axioms
9
43
 
10
- 1. **The shell composes; it never implements.** If the shell needs a behavior,
11
- that behavior belongs in a brick (or in `@amalgm/core` if it is kernel law).
12
- The shell may only wire adapters, pass configuration, and mount routes.
44
+ A materialized row proves local observation, not completed official delivery.
45
+ An independent later observation starts from a settled basis only after earlier
46
+ mutations are accepted, their matching Inbox records resolve, and Apply releases
47
+ their intents; finite observation flushes do not promise global delivery silence.
48
+ Apply retry reads revisit only the requested entities through indexed lookups
49
+ and the same current eligibility rule used by paged discovery; page position
50
+ cannot prevent a due entity from being reconsidered.
51
+
52
+ Managed package delivery starts from a clean, exact main or preview source
53
+ commit. The workflow occurrence supplies only its generated version and source
54
+ record; tests run against those candidate inputs before packing. Every native
55
+ gate and publication use that same tarball and integrity. A candidate tag makes
56
+ bytes available to release assembly; it never promotes an installed runtime.
57
+ Release tooling remains available inside each owner repository so a developer
58
+ or CI job never needs access to another private product repository.
59
+ Registry credentials are available only to the final protected publication job,
60
+ after every native examination proves the exact candidate bytes.
61
+
62
+ Shell owns both the internal `@amalgm/shell` package and the public `amalgm`
63
+ distribution. One tested build supplies both archives; only package identity,
64
+ version and the root lock identity differ. Each final archive passes the same
65
+ native examinations before either becomes a managed public candidate. Public
66
+ metadata records the exact internal archive it was derived from; no wrapper,
67
+ copied Engine implementation or second dependency graph supplies runtime behavior.
68
+
69
+ Consumer assembly reads dependencies from each declared package manifest and
70
+ selects only registry candidates from the same managed branch. It changes exact
71
+ pins and their locks in one reproducible composition change; the consumer's
72
+ complete checks gate merging that exact tree against its unchanged base. Reconciliation keeps one
73
+ pending change per branch, preserves human edits, and never republishes an
74
+ unchanged consumer merely because a notification or check was repeated.
75
+
76
+ 1. **The shell implements host effects; SDKs own domain decisions.** Shell
77
+ assembles published capabilities, implements their native effect ports,
78
+ passes configuration, and mounts routes. A portable product decision belongs
79
+ in its product SDK; a portable kernel decision belongs in `@amalgm/core`.
80
+ A missing SDK port is repaired in that owner before Shell consumes it.
81
+ Each SDK remains usable without Shell. Live and Chat preserve their
82
+ Core-free dependency boundaries; Shell injects their host capabilities.
83
+ One installed runtime and command do not require one operating-system
84
+ process: isolation may change the host topology without changing SDK law.
13
85
 
14
86
  Agent-task execution is one example: Agents resolves the current immutable
15
87
  revision, Chat owns its new durable conversation and turn, Automations owns
16
88
  the queued step and retry key, and Shell only connects those capabilities
17
89
  to the selected machine's model, auth, Toolbox, and workspace bindings.
18
90
 
19
- 2. **Bricks arrive through the registry.** Every `@amalgm/*` dependency is a
20
- published npm version — never a `file:` link, never a copied source tree.
91
+ The environment controller gives each signed-in user and validated binding one
92
+ OS service outside every UI bundle. It holds an OS-released lease, publishes an
93
+ authenticated control endpoint and supervises one child runtime over IPC. A
94
+ missing heartbeat or a remembered PID never transfers ownership. A child exits
95
+ when its controller disconnects; an intentional stop drains that child before
96
+ releasing ownership. Service adapters derive their names from the same binding
97
+ and never operate another environment's process.
98
+ Every control mutation carries the expected user, binding and owner generation;
99
+ the receiving controller verifies that identity before performing the mutation.
100
+ Authenticating a response after an effect cannot authorize that effect.
101
+ Layer 1 keeps one usable runtime available while the OS session can execute.
102
+ Core supplies its retry allowance, backoff and health timings; Shell records
103
+ each launch in a durable SQLite journal before spawning. Neither elapsed time,
104
+ controller replacement nor repeated service starts grants another attempt.
105
+ Only sustained ready IPC health or an explicit `service retry` resets the
106
+ allowance. Exhaustion parks the child while its controller retains ownership,
107
+ status and stop/retry control; intentional shutdown never launches a replacement.
108
+ Native registration belongs to the current OS account even when the installation
109
+ uses another data home. Windows Task Scheduler owns a hidden action in that
110
+ account's logged-in session; the action owns controller exit recovery using
111
+ Core's restart policy. Scheduler launch retries alone cannot recover a program
112
+ that started successfully and then exited.
113
+ Native service descriptions preserve literal arguments, environment values and
114
+ working directories through the owning OS parser. Each directive uses its own
115
+ grammar; unrepresentable input is refused before replacing a service description.
116
+ Native Watch opens the OS-resolved physical directory; portable or short-name
117
+ aliases cannot become a second path grammar inside a kernel handle.
118
+ Persistent SQLite handles use the OS namespace for the selected file, including
119
+ Windows extended paths; a host API's legacy path limit cannot select another file.
120
+ An active installation from before the ownership protocol must exit once before
121
+ its saved account can move to this controller; a remembered PID is neither a
122
+ stop capability nor permission to start a second writer beside it.
123
+
124
+ Every UI enters one finite setup operation. It serializes installation setup,
125
+ selects the server-approved account, and either proves adoption without changing
126
+ the runtime or acquires that account's runtime lease before enrollment. The OS
127
+ service takes over only after the enrolling foreground owner has drained.
128
+ The operating system selects the credential backend; choosing a data home never
129
+ changes it. Examinations inject their credential store explicitly.
130
+
131
+ 2. **Managed bricks arrive through the registry.** Every production/preview
132
+ `@amalgm/*` dependency is an exact published npm version. Explicit local
133
+ development profiles may select local built SDKs; an absent local component
134
+ never silently falls back to a managed package or hosted service.
21
135
  Upgrading the runtime means bumping a version, not merging code. Registry
22
136
  proof runs under the supported Node executable that launched the gate;
23
137
  ambient package-manager shims are not runtime evidence.
@@ -29,16 +143,43 @@ shell only assembles.
29
143
  remain in the Engine, but they never run as a fallback beside a released
30
144
  Shell service.
31
145
 
32
- 4. **One host, injected once.** Filesystem, sqlite, clock, network — the shell
33
- builds each host adapter a single time at boot and threads it down. No brick
34
- reaches for `process` or the disk on its own.
146
+ 4. **Each shared host capability has one scoped owner.** Shell constructs
147
+ shared adapters once for their installation scope and injects them instead
148
+ of letting consumers rediscover them. Product-owned resources stay behind
149
+ their SDK's public API: Apps, for example, owns its app processes and store,
150
+ and Shell never opens a second lifecycle owner for them. Portable SDK
151
+ decisions receive effects explicitly and never discover ambient process
152
+ state or disk on their own.
35
153
 
36
- 5. **Bricks never update themselves; the shell updates.** Every `@amalgm/*`
154
+ 5. **Bricks never update themselves; the shell updates.** Every direct `@amalgm/*`
37
155
  dependency is pinned to an exact version — no ranges. Publishing a brick
38
156
  changes nothing on any user machine until the shell bumps its pin and ships
39
- a new release through the existing npm dist-tag rail (one runtime label, one
40
- tag). One version number, one atomic update, one combination that was
157
+ a new release through its lane's signed runtime authority. Registry tags
158
+ locate published artifacts; fresh TUF metadata selects installed adoption.
159
+ One version number, one atomic update, one combination that was
41
160
  actually tested together — never a per-brick drift of versions in the wild.
161
+ The shrinkwrap fixes the transitive graph as well; direct pins do not
162
+ imply that every consumer resolves the same Core version. Release proof
163
+ checks those actual resolutions and their public contracts, and upgrades
164
+ affected consumers deliberately instead of forcing an untested override.
165
+
166
+ The installed runtime follows the [update axioms](src/updates/README.md).
167
+ Each public managed package declares its controller, process and state-format
168
+ contracts. The native bootstrap stays outside immutable packages and executes
169
+ Core-authored launch intents; a single SQLite commit binds update policy to the
170
+ next controller. Historical signatures identify an already installed baseline,
171
+ and current TUF metadata alone authorizes its desired successor. Every candidate
172
+ is staged with the locked package manager before the previous runtime drains;
173
+ fenced state-format receipts decide whether recovery can safely open its data.
174
+ Local profiles retain their selected sources and do not follow managed targets.
175
+
176
+ 5a. **One binding selects the whole installation.** Core's validated label,
177
+ exact source branch and local session select separate mutable roots,
178
+ credentials, databases, process owners and endpoints; production retains
179
+ `~/amalgm`, preview uses `~/amalgm-preview`, and local uses
180
+ `~/amalgm-dev/<session>`. Host effects reserve physical writable roots before
181
+ use, including aliases and enclosing paths, so a second installation cannot
182
+ become another writer of the same ground.
42
183
 
43
184
  6. **Authentication exemptions transfer authority; they do not remove it.**
44
185
  Every exempt prefix is explicit and narrow, and the mounted brick must
@@ -799,7 +940,8 @@ shell only assembles.
799
940
 
800
941
  60. **Runtime binding is proved, never inferred.** A platform adapter adopts
801
942
  an existing runtime only when Shell's published loopback address answers
802
- its authenticated health probe for the selected user and runtime label. A
943
+ its authenticated identity probe for the selected user, device, environment,
944
+ exact branch, local session, and process generation. A
803
945
  durable ready registration with no answering runtime may be resumed; an
804
946
  absent or incomplete registration requires login. A UI marker, PID, open
805
947
  port, or installed executable alone is never service readiness.
@@ -815,7 +957,11 @@ shell only assembles.
815
957
 
816
958
  62. **PTY is one authenticated Shell host capability.** The running machine
817
959
  runtime mounts the Core-owned PTY contract through Shell's native process
818
- adapter and closes every spawned process with that runtime. A UI targeting
960
+ adapter and retains every spawned terminal until native exit, including
961
+ sessions already removed from the public catalog. Runtime close seals new
962
+ terminal admission and drains all terminals concurrently: one second permits
963
+ hangup, then forced termination must prove exit within five seconds before
964
+ close succeeds. A UI targeting
819
965
  this computer connects through the published authenticated loopback
820
966
  binding; only a different computer uses the remote relay. Electron never
821
967
  creates a second PTY implementation. A session with no explicit working
package/README.md CHANGED
@@ -4,6 +4,19 @@ The Amalgm runtime, assembled from published `@amalgm/*` SDK capabilities.
4
4
  This repository owns their host composition; see [PURPOSE.md](PURPOSE.md) for
5
5
  the axioms.
6
6
 
7
+ Start with the [operating contract](docs/operating-contract.md) for always-on
8
+ operation, failure containment, repository ownership, and performance gates.
9
+ The [history and implementation audit](docs/operating-audit-2026-09-05.md)
10
+ separates those requirements from current evidence. Persistent OS supervision
11
+ and subsystem crash isolation are not yet certified for this Shell release;
12
+ `amalgm run` currently runs the composed runtime in the foreground.
13
+ The [runtime hardening plan](docs/runtime-hardening-plan.md) gives the
14
+ implementation sequence, owning repositories, and acceptance gates.
15
+ The [release environments and update plan](docs/release-environments-plan.md)
16
+ records the three CI/CD workstreams: environment bindings, deployment to all
17
+ supported surfaces, and background updates. It includes partial local development,
18
+ the public `amalgm` bootstrap target and the two in-progress engineering skills.
19
+
7
20
  The signed runtime composes Core + Files + Agents + Tools + Chat. Agents owns
8
21
  identity and immutable revision resolution; Chat alone owns durable
9
22
  conversations, turns, reconnect, and interrupt; Shell supplies the host effects
@@ -38,6 +51,9 @@ Provider credentials are never accepted through UI payloads, local credential
38
51
  resolution, or environment variables. Products use an injected broker adapter
39
52
  that creates a fresh DPoP proof for each protected request.
40
53
 
54
+ The [login and setup contract](docs/login-setup.md) records the browser/CLI
55
+ boundary and the shared credential-bearing HTTP guarantees.
56
+
41
57
  ## Run
42
58
 
43
59
  ```bash
@@ -79,20 +95,67 @@ printf '%s\n' '{"name":"Daily review"}' \
79
95
  | npx --package @amalgm/shell amalgm automations create --stdin --user person@example.com
80
96
  ```
81
97
 
82
- Requires Node ≥ 20.19 (native `require(esm)` support; all bricks are ESM).
83
-
84
- Package releases use `.github/workflows/publish-package.yml`. A reviewed clean
85
- main commit is tagged exactly `v<package version>`; the workflow verifies and
86
- publishes that exact package using the `npm-release` environment. Manual
87
- dirty-worktree publishing is not a release path. The release workflow also
88
- installs the packed Shell in a clean temporary project and runs the public
89
- authorization/Chat E2E against the exact registry versions in `package.json`.
98
+ Requires Node ≥ 24 and npm ≥ 11.19.1 < 12.
99
+
100
+ ## Keep the runtime running
101
+
102
+ `amalgm setup` enrolls the machine and starts its independent OS service.
103
+ The service belongs to the logged-in OS account and survives closing a UI
104
+ or terminal. Use `amalgm service status --user EMAIL` to inspect its controller,
105
+ runtime phase, recovery attempts and last failure. `service stop` drains it;
106
+ `service start` resumes the registered service.
107
+
108
+ The controller permits an initial launch and eight retries, with backoff capped
109
+ at 30 seconds. Attempts are committed to SQLite before launch and survive
110
+ controller replacement, logout/login and reboot. A ready runtime that answers
111
+ IPC health probes for 30 seconds earns a fresh allowance. Failed launch,
112
+ startup timeout, loss of IPC health and premature exit consume the same budget.
113
+ If it is exhausted, the runtime is parked and the controller remains available.
114
+ After correcting the failure, run `amalgm service retry --user EMAIL` to grant
115
+ another bounded allowance. Repeated start/install calls do not erase failures.
116
+ Portable mode needs an external foreground owner; it does not install an OS service.
117
+
118
+ Managed npm delivery uses `.github/workflows/publish-package.yml` after the
119
+ exact main/preview owner checks pass. The occurrence generates a unique
120
+ prerelease version and records its source SHA; it reruns the owner suite, packs
121
+ once, and installs that tarball on Linux, macOS and Windows before publication.
122
+ The `candidate-main`/`candidate-preview` tags are release-assembly inputs and
123
+ never select installed runtimes. `package.json` declares this owner's gates,
124
+ CLI probes, peer-only exports and lifecycle permissions. The standalone runner
125
+ under `scripts/release/` is intentionally copied across owners to preserve
126
+ private repository access boundaries. The final publish step uses the `NPM_TOKEN`
127
+ secret in the `npm-release` environment. Where npm trusted publishing is
128
+ configured for this repository's `publish-package.yml` and that environment,
129
+ the token can be omitted. Authentication does not replace native certification,
130
+ exact source records or artifact integrity; private source repositories do not
131
+ receive npm's public-source provenance.
132
+
133
+ This owner also derives the public `amalgm` distribution from that packed Shell.
134
+ Every implementation file and locked dependency remains identical; only the
135
+ package identity, version and root lock identity change. Public metadata names
136
+ the exact internal archive and integrity. Both archives pass all native gates
137
+ before either publishes. UI composition selects the public candidate once it is
138
+ available and checks that candidate through its ordinary setup/native gates.
139
+ The existing public registry release is still Engine; candidate construction is
140
+ not a public channel cutover. Its four legacy delivery workflows are disabled.
141
+
142
+ The release workflow also exercises the packed Shell authorization/Chat path.
90
143
  The published `npm-shrinkwrap.json` fixes the complete dependency tree, and
91
144
  that examination rejects any installed direct dependency that differs from it.
92
145
 
93
- Every push to `main` and every pull request runs the complete suite plus the
94
- isolated real-kernel Watch examination on GitHub-hosted Linux, macOS, and
95
- Windows machines. This certifies the same create, change, rename, move, delete,
146
+ Every main/preview push and pull request requests the package and binding gate
147
+ followed by native OS service and Watch examinations on Linux, macOS and
148
+ Windows. Passing those native jobs certifies the same create, change, rename, move, delete,
96
149
  `.git` appearance/disappearance, and root-address mutations on every supported
97
150
  watcher backend. Production Fly/R2 examinations remain separate: CI proves the
98
151
  platform adapter, while the deployed examination proves the real cloud path.
152
+
153
+ Managed dependency reconciliation reads this owner’s declared manifests and
154
+ updates exact same-branch registry candidates in one pending composition PR per
155
+ branch. The scoped release App triggers ordinary CI. Every declared gate must
156
+ pass for the exact merge tree; an atomic expected-base update prevents merging
157
+ with untested concurrent source. Human additions or amendments are preserved.
158
+ The half-hour CI reconciliation recovers missed dispatch hints. Assembly runs
159
+ no dependency code or lifecycle hooks, and repeated owner checks do not publish
160
+ another candidate for unchanged source. Release App credentials remain an
161
+ external prerequisite; no paid branch-protection or auto-merge feature is needed.
@@ -0,0 +1,84 @@
1
+ {
2
+ "signatures": [
3
+ {
4
+ "keyid": "171e413c9b42c3103c93f1cddf3c64092c15d7e93ef0a7bbb57a2c6596536d2d",
5
+ "sig": "f6b50faf8da046a8f65f50f235d32feb3e4bc3297cd277814eea45c956638e193178115bfa2e92facfea82c996508aed77afecdda5df17f74f64ae2997f21a04"
6
+ },
7
+ {
8
+ "keyid": "72178b873f31dcef2f34b0ee925d6c9e896af029054fe7bc5c15ae25b0b133bf",
9
+ "sig": "9b1910b53cc2f1416b60d1b56c48d714f59fdc378c18adca8a499632b0a2820fdd5480db7a0dc570b02726721a034fe6e1339be418015420045bbd75b8836f00"
10
+ }
11
+ ],
12
+ "signed": {
13
+ "_type": "root",
14
+ "spec_version": "1.0.31",
15
+ "version": 1,
16
+ "expires": "2029-09-07T00:00:00.000Z",
17
+ "keys": {
18
+ "171e413c9b42c3103c93f1cddf3c64092c15d7e93ef0a7bbb57a2c6596536d2d": {
19
+ "keytype": "ed25519",
20
+ "scheme": "ed25519",
21
+ "keyval": {
22
+ "public": "7059e89c6cfbf2171374223b1ecfc0f121c45a4799d62affe7c339222aea39db"
23
+ }
24
+ },
25
+ "72178b873f31dcef2f34b0ee925d6c9e896af029054fe7bc5c15ae25b0b133bf": {
26
+ "keytype": "ed25519",
27
+ "scheme": "ed25519",
28
+ "keyval": {
29
+ "public": "d5bae5d40548e18b4f66227757e5baf125a9456743d01ec7a0681659138b8d19"
30
+ }
31
+ },
32
+ "a13b9e0ad5de56cc0a1e2def2efa859a651508f380db4acba4655da22ca0e52b": {
33
+ "keytype": "ed25519",
34
+ "scheme": "ed25519",
35
+ "keyval": {
36
+ "public": "439afda8af0c5390bfc7b5ee9f08ec3f2b294bb5d0f1520d4167436f10ba1288"
37
+ }
38
+ },
39
+ "713ba13ba2d7b72d4b5f14c1301ff461d2cc03f8ff7a72e33846f07e4b7a3553": {
40
+ "keytype": "ed25519",
41
+ "scheme": "ed25519",
42
+ "keyval": {
43
+ "public": "c623740f0056e87a0c6810794b072f36cbb9cb11e570998aaf4c6aaa49c8e15f"
44
+ }
45
+ },
46
+ "8c0b42851a3e1019291a7bd0fec457858fe4cbf56b7b4a0dd52fedc58594da11": {
47
+ "keytype": "ed25519",
48
+ "scheme": "ed25519",
49
+ "keyval": {
50
+ "public": "7740ed7fd9f9bc6a4258c28efb52799db2975346057fb1c73a1d67cc2ac8a294"
51
+ }
52
+ }
53
+ },
54
+ "roles": {
55
+ "root": {
56
+ "keyids": [
57
+ "171e413c9b42c3103c93f1cddf3c64092c15d7e93ef0a7bbb57a2c6596536d2d",
58
+ "72178b873f31dcef2f34b0ee925d6c9e896af029054fe7bc5c15ae25b0b133bf"
59
+ ],
60
+ "threshold": 2
61
+ },
62
+ "targets": {
63
+ "keyids": [
64
+ "a13b9e0ad5de56cc0a1e2def2efa859a651508f380db4acba4655da22ca0e52b"
65
+ ],
66
+ "threshold": 1
67
+ },
68
+ "snapshot": {
69
+ "keyids": [
70
+ "713ba13ba2d7b72d4b5f14c1301ff461d2cc03f8ff7a72e33846f07e4b7a3553"
71
+ ],
72
+ "threshold": 1
73
+ },
74
+ "timestamp": {
75
+ "keyids": [
76
+ "8c0b42851a3e1019291a7bd0fec457858fe4cbf56b7b4a0dd52fedc58594da11"
77
+ ],
78
+ "threshold": 1
79
+ }
80
+ },
81
+ "consistent_snapshot": true,
82
+ "amalgm": "runtime/main"
83
+ }
84
+ }
@@ -0,0 +1,84 @@
1
+ {
2
+ "signatures": [
3
+ {
4
+ "keyid": "3e33f991a33d9a91d1a9bfdf407735fb5d80375d0c87af8d319f56d91374fddd",
5
+ "sig": "e9b48e63dab00d9846c7f629a4abca37765d205efaefd42a9f466da2f2286de3463b016e8f3d28e943ef09494f89f031ca13b294fada668826645e1b038a6c0d"
6
+ },
7
+ {
8
+ "keyid": "b1a1297f592cfcdb8dbaccd5a2df635418fb4a65b596946e4867b88354de3194",
9
+ "sig": "2b9fef03fe69bcc7a35c7c010a0adc81af6fe5957a7fed645c4afe0ff13890ca48a36829dbd3cb834f59d38753ae00495d549a7faf50c9ee5aadbf199aab0608"
10
+ }
11
+ ],
12
+ "signed": {
13
+ "_type": "root",
14
+ "spec_version": "1.0.31",
15
+ "version": 1,
16
+ "expires": "2029-09-07T00:00:00.000Z",
17
+ "keys": {
18
+ "3e33f991a33d9a91d1a9bfdf407735fb5d80375d0c87af8d319f56d91374fddd": {
19
+ "keytype": "ed25519",
20
+ "scheme": "ed25519",
21
+ "keyval": {
22
+ "public": "8fb6e481577692290e7fd27c30d5d3177f2ee707ef6c81ed9436f0bed3cd54b8"
23
+ }
24
+ },
25
+ "b1a1297f592cfcdb8dbaccd5a2df635418fb4a65b596946e4867b88354de3194": {
26
+ "keytype": "ed25519",
27
+ "scheme": "ed25519",
28
+ "keyval": {
29
+ "public": "8e3ef46a72b35cd7c0d674fc052e83133db9c2cb192f24ad0cf00f4de895f07d"
30
+ }
31
+ },
32
+ "fe66a65c8d70727048f8b79943fedb13b7399f4602a9f79a1e337de14f1dc21a": {
33
+ "keytype": "ed25519",
34
+ "scheme": "ed25519",
35
+ "keyval": {
36
+ "public": "59b1f7ab5afe85ca3a4e0dc84665c5a3dc2fbe913e3d0d75b509cb73a7a35cf6"
37
+ }
38
+ },
39
+ "3c80486cd109baf420901279044a229c1dee7fe3dd01532957da2313b8c233c9": {
40
+ "keytype": "ed25519",
41
+ "scheme": "ed25519",
42
+ "keyval": {
43
+ "public": "8402fb8346333a67479f64a619960806a79443442bb13be909d6f51ec139ad8c"
44
+ }
45
+ },
46
+ "d5b8910b0a6d4cfbce090d080fceb13a3606bef6506512269d8103e5e421dc01": {
47
+ "keytype": "ed25519",
48
+ "scheme": "ed25519",
49
+ "keyval": {
50
+ "public": "62b7bdb2bc6b105a7b469ccb8240f24d7d775ef55d98b1908dbf3395b43e5aa2"
51
+ }
52
+ }
53
+ },
54
+ "roles": {
55
+ "root": {
56
+ "keyids": [
57
+ "3e33f991a33d9a91d1a9bfdf407735fb5d80375d0c87af8d319f56d91374fddd",
58
+ "b1a1297f592cfcdb8dbaccd5a2df635418fb4a65b596946e4867b88354de3194"
59
+ ],
60
+ "threshold": 2
61
+ },
62
+ "targets": {
63
+ "keyids": [
64
+ "fe66a65c8d70727048f8b79943fedb13b7399f4602a9f79a1e337de14f1dc21a"
65
+ ],
66
+ "threshold": 1
67
+ },
68
+ "snapshot": {
69
+ "keyids": [
70
+ "3c80486cd109baf420901279044a229c1dee7fe3dd01532957da2313b8c233c9"
71
+ ],
72
+ "threshold": 1
73
+ },
74
+ "timestamp": {
75
+ "keyids": [
76
+ "d5b8910b0a6d4cfbce090d080fceb13a3606bef6506512269d8103e5e421dc01"
77
+ ],
78
+ "threshold": 1
79
+ }
80
+ },
81
+ "consistent_snapshot": true,
82
+ "amalgm": "runtime/preview"
83
+ }
84
+ }
@@ -12,6 +12,7 @@ export declare function recoverMachineAuthorization(options: Readonly<{
12
12
  runtimeVersion: string;
13
13
  runtimeLabel: string;
14
14
  branch: string;
15
+ localSession?: string;
15
16
  fallbackName: string;
16
17
  fallbackPlatform: string;
17
18
  stateDir: string;
@@ -1,4 +1,4 @@
1
- import { authFromRecord, mergeRecordAuth, publicComputerRecord, } from "@amalgm/core/identity";
1
+ import { authFromRecord, mergeRecordAuth, publicComputerRecord, resolveRuntimeBinding, runtimeBindingRecord, } from "@amalgm/core/identity";
2
2
  import { deviceKeyFromStored, installationDeviceKeyStores, promoteInstallationDeviceKeyRecovery, stageInstallationDeviceKeyRecovery, } from "./index.js";
3
3
  import { requestAuthorizationKeyRecovery } from "./recovery-client.js";
4
4
  export async function recoverMachineAuthorization(options) {
@@ -55,8 +55,7 @@ function recoveryBody(options, record, deviceId, key) {
55
55
  name: text(record.name) || options.fallbackName,
56
56
  platform: text(record.platform) || options.fallbackPlatform,
57
57
  app_version: options.runtimeVersion,
58
- runtime_label: options.runtimeLabel,
59
- branch: options.branch,
58
+ ...runtimeBindingRecord(resolveRuntimeBinding(options)),
60
59
  purpose: "authorization_key_recovery",
61
60
  authorization_key_thumbprint: key,
62
61
  };
@@ -1 +1 @@
1
- {"version":3,"file":"recovery-host.js","sourceRoot":"","sources":["../../src/authorization/recovery-host.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,eAAe,EACf,oBAAoB,GAErB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,mBAAmB,EACnB,2BAA2B,EAC3B,oCAAoC,EACpC,kCAAkC,GACnC,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,+BAA+B,EAAE,MAAM,sBAAsB,CAAC;AAWvE,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,OAmBhD;IACA,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;IAC/F,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACxC,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACpC,MAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC,4BAA4B,CAAC,CAAC;IACnE,IAAI,CAAC,QAAQ,IAAI,CAAC,UAAU,IAAI,CAAC,MAAM;QAAE,MAAM,aAAa,CAAC,4CAA4C,CAAC,CAAC;IAC3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,IACE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,QAAQ,CAAC,QAAQ;WAC3C,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,QAAQ,CAAC,UAAU;WAClD,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,MAAM;WAC1C,IAAI,CAAC,QAAQ,CAAC,4BAA4B,CAAC,KAAK,QAAQ,CAAC,GAAG;WAC5D,CAAC,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC;WACnC,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC;QAC/B,MAAM,aAAa,CAAC,0CAA0C,CAAC,CAAC;AACpE,CAAC;AAED,SAAS,MAAM,CACb,MAAgD,EAChD,QAAgB,EAChB,UAAkB,EAClB,aAAqB;IAErB,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC,CAAC;AACxE,CAAC;AAED,SAAS,aAAa,CAAC,IAAY;IACjC,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,IAAI,CAAC,KAAc;IAC1B,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AACvD,CAAC"}
package/dist/boot.js CHANGED
@@ -253,26 +253,34 @@ export async function bootShell(config = {}) {
253
253
  workspace,
254
254
  pty: pty.manager,
255
255
  async close() {
256
- pty.close();
257
- externalProxy.close();
258
- const gatewayClosed = new Promise((resolve) => gateway.close(() => resolve()));
259
- gateway.closeAllConnections();
260
- await Promise.all([
261
- gatewayClosed,
262
- agentsRest.close(),
263
- appsHttp.close(),
264
- browserHttp.close(),
265
- toolsHttp.close(),
266
- ]);
267
- await chat.close();
268
- await automationsMcp?.close();
269
- agentsService.close();
270
- await apps.apps.close();
271
- stopToolDeploymentEvents();
272
- tools.toolbox.close();
273
- await Promise.all(browserService.listSessions()
274
- .map((session) => browserService.closeSession(session.id)));
275
- closeOptionalDatabase(browserService.productOptions.registry);
256
+ const terminalsClosed = Promise.allSettled([pty.close()]);
257
+ try {
258
+ externalProxy.close();
259
+ const gatewayClosed = new Promise((resolve) => gateway.close(() => resolve()));
260
+ gateway.closeAllConnections();
261
+ await Promise.all([
262
+ gatewayClosed,
263
+ agentsRest.close(),
264
+ appsHttp.close(),
265
+ browserHttp.close(),
266
+ toolsHttp.close(),
267
+ ]);
268
+ await chat.close();
269
+ await automationsMcp?.close();
270
+ agentsService.close();
271
+ await apps.apps.close();
272
+ stopToolDeploymentEvents();
273
+ tools.toolbox.close();
274
+ await Promise.all(browserService.listSessions()
275
+ .map((session) => browserService.closeSession(session.id)));
276
+ closeOptionalDatabase(browserService.productOptions.registry);
277
+ }
278
+ finally {
279
+ await terminalsClosed;
280
+ }
281
+ const [terminal] = await terminalsClosed;
282
+ if (terminal.status === "rejected")
283
+ throw terminal.reason;
276
284
  },
277
285
  };
278
286
  }