@amalgm/core 0.4.7 → 0.4.8-main.34168902443

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/PURPOSE.md CHANGED
@@ -39,6 +39,16 @@ that composes an exact Core release with the other product releases.
39
39
 
40
40
  ## Axioms
41
41
 
42
+ Managed package delivery starts from a clean, exact main or preview source
43
+ commit. The workflow occurrence supplies only its generated version and source
44
+ record; tests run against those candidate inputs before packing. Every native
45
+ gate and publication use that same tarball and integrity. A candidate tag makes
46
+ bytes available to release assembly; it never promotes an installed runtime.
47
+ Release tooling remains available inside each owner repository so a developer
48
+ or CI job never needs access to another private product repository.
49
+ Registry credentials are available only to the final protected publication job,
50
+ after every native examination proves the exact candidate bytes.
51
+
42
52
  1. **Core is the floor, not the building.** Nothing product-shaped lives
43
53
  here — no chat, no documents, no automations, no tools. A feature that
44
54
  could be an app is a bug in core.
@@ -168,6 +178,26 @@ that composes an exact Core release with the other product releases.
168
178
  Standalone product defaults preserve main's state base and put other
169
179
  bindings in distinct namespaces; composed hosts supply their isolated
170
180
  installation root explicitly. Product overrides remain host-owned paths.
181
+ 28. **Managed adoption has one durable decision owner.** A verified, compatible
182
+ recipe advances the installation's monotonic desired release; events and npm
183
+ tags cannot select software, and local bindings never adopt managed releases.
184
+ 29. **An update effect follows its durable intent.** Each effect has a stable
185
+ transaction/phase token; the host persists the next state before executing it,
186
+ and process death resumes that intent without resetting failure evidence.
187
+ 30. **Replacement requires fencing, including recovery.** Staging cannot claim
188
+ live work, a new writer starts only after the previous generation is fenced,
189
+ and rollback requires compatibility with the state actually left on disk.
190
+
191
+ ## Managed update purpose
192
+
193
+ Keep managed installations current without interrupting durable work or requiring
194
+ routine user action. Core admits already cryptographically verified recipes and
195
+ decides staging, handover and recovery; Shell supplies TUF, immutable artifacts,
196
+ durable storage, authenticated generation fencing and product health evidence.
197
+ An incompatible or broken candidate leaves the healthy release available or
198
+ parks the affected update unit with a durable reason. The new managed contracts
199
+ are additive; historical global-npm updater exports are compatibility evidence,
200
+ not the policy for managed installations.
171
201
 
172
202
  ## Environment bindings
173
203
 
package/README.md CHANGED
@@ -9,7 +9,10 @@ the knife table mapping the Engine monolith onto its owning repositories).
9
9
 
10
10
  The evolving product contract for the top-level command, modular service
11
11
  installation, and mandatory managed updates is
12
- [docs/amalgm-cli.md](docs/amalgm-cli.md).
12
+ [docs/amalgm-cli.md](docs/amalgm-cli.md). Portable managed recipe admission,
13
+ durable handover and recovery are documented in
14
+ [docs/managed-updates.md](docs/managed-updates.md). These new APIs are source
15
+ candidates and are not yet consumed by the published Shell.
13
16
 
14
17
  ```
15
18
  src/identity/ labels, layout grammar, ids, auth records
@@ -32,7 +35,17 @@ Rules of the house: zero runtime dependencies; nothing in `src/` imports
32
35
  Shell is the production host and exact-version composer; tests are exams —
33
36
  each states a law, and a mutant must be convicted by at least one.
34
37
 
35
- Package releases use `.github/workflows/publish-package.yml`. A reviewed main
36
- commit is tagged exactly `v<package version>`; trusted npm publishing stages
37
- that package, and a maintainer approves the staged artifact with 2FA. Manual
38
- dirty-worktree publishing is not a release path.
38
+ Managed npm delivery uses `.github/workflows/publish-package.yml` after the
39
+ exact main/preview owner checks pass. The occurrence generates a unique
40
+ prerelease version and records its source SHA; it reruns the owner suite, packs
41
+ once, and installs that tarball on Linux, macOS and Windows before publication.
42
+ The `candidate-main`/`candidate-preview` tags are release-assembly inputs and
43
+ never select installed runtimes. `package.json` declares this owner's gates,
44
+ CLI probes, peer-only exports and lifecycle permissions. The standalone runner
45
+ under `scripts/release/` is intentionally copied across owners to preserve
46
+ private repository access boundaries. The final publish step uses the `NPM_TOKEN`
47
+ secret in the `npm-release` environment. Where npm trusted publishing is
48
+ configured for this repository's `publish-package.yml` and that environment,
49
+ the token can be omitted. Authentication does not replace native certification,
50
+ exact source records or artifact integrity; private source repositories do not
51
+ receive npm's public-source provenance.
@@ -6,8 +6,9 @@
6
6
  * kernel's supervision contracts as pure decision logic — health contracts
7
7
  * (probe side and push side), restart/degrade policy, updater laws, host
8
8
  * launcher registration, and process identification. Hosts supply every
9
- * effect (axiom 6); every threshold, vocabulary, and error string is
10
- * byte-exact with the shipped engine (axiom 8).
9
+ * effect (axiom 6). Historical compatibility contracts remain byte-exact
10
+ * with the Engine evidence (axiom 8); managed update contracts derive from
11
+ * the installation ownership, durable intent and fencing axioms.
11
12
  */
12
13
  export { HEALTHZ_STATUS_CODE, CHILD_HEALTH_POLICY, CHAT_SERVER_HEALTH_POLICY, CHILD_RESTART_POLICY, ChildSupervisionMachine, buildRuntimeHealthzBody, healthPolicyForService, readyDeadlineMs, validateHealthBody, type ChildExitDecision, type ChildHealthPolicy, type ChildRestartPolicy, type ChildStatus, type HealthBodyVerdict, type HealthProbeDecision, type RuntimeHealthzBody, } from './health.js';
13
14
  export { APP_HEALTH_POLICY, APP_ID_BODY_KEYS, APP_ID_REQUIRED_ERROR, APP_ID_REQUIRED_STATUS, APP_NOT_FOUND_ERROR, APP_NOT_FOUND_STATUS, HEARTBEAT_INTERVAL_BODY_KEYS, acceptsHealthSignals, appIdFromBody, clampIntervalMs, healthSignalRejection, heartbeatIntervalFromBody, heartbeatRecovery, snapshotEntry, sweepAppHealth, unresponsiveAfterMs, type AppHealthEntry, type AppHealthRecord, type AppHealthSnapshot, type AppHealthStatus, type AppRecoveryDecision, type AppSweepTransition, } from './app-health.js';
@@ -15,4 +16,6 @@ export { APP_RESTART_POLICY, appExitDecision, explicitStartReset, recentCrashes,
15
16
  export { AUTO_UPDATE_ENV_OVERRIDES, AUTO_UPDATE_POLICY, AUTO_UPDATE_STATUSES, NOT_SERVICE_MANAGED_REASON, NPM_UPDATE_CACHE_DIRNAME, UPDATE_TARGET_MISMATCH, autoUpdateIdleBlockedReason, autoUpdateSupported, comparePrerelease, compareVersions, distTagCheckFailedMessage, envDisablesAutoUpdate, envFlag, globalPrefixForPackageRoot, installFailedMessage, noVersionMessage, npmEnv, npmFailureDetail, npmInstallArgs, npmInstallTag, numberFromEnvValue, parseSemver, resolveAutoUpdateTimings, restartSuppressedDetail, shouldAutoUpdate, updateTargetMismatchError, type AutoUpdateStatus, type RuntimeIdleStatus, type Semver, type UpdateTargetMismatchError, } from './update.js';
16
17
  export { PS_LINE_PATTERN, RUNTIME_HEALTH_PATH, RUNTIME_INSTANCE_ARG_PATTERN, SUPERVISOR_COMMAND_SUFFIX, buildLaunchdPlist, buildSystemdUnit, buildWindowsStartupScript, commandLooksLikeAnySupervisor, commandLooksLikeRuntimeService, commandLooksLikeSupervisor, commandRuntimeInstanceId, decideOwnership, deferToExistingInstall, envMatchesAmalgmDir, launchdPlistPath, lockOwnedByAnother, normalizeMode, parsePort, parsePsLine, pathLooksLikeDesktopBundle, plistEscape, releaseAllowed, runtimeInstanceArg, runtimeLaunchServices, runtimePortsFromState, runtimePortsState, runtimeServiceMarkers, runtimeServiceSuffixes, serviceLabel, serviceLabelScope, serviceStateCanOwnRuntime, shellQuote, shippedRuntimeServices, stateMatchesRequest, systemdQuote, systemdUnavailableOutput, systemdUnitPath, vbsString, windowsStartupScriptPath, type OwnershipDecision, type ProcessIdentity, type RuntimeOwnerRecord, type RuntimeStatePorts, type ServiceDeclaration, type ServiceMode, type ServiceState, } from './service-registration.js';
17
18
  export * from './installation-plan.js';
19
+ export * from './managed-release.js';
20
+ export * from './managed-update.js';
18
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/supervision/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAClB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,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B,EACtB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,WAAW,EACX,0BAA0B,EAC1B,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,YAAY,EACZ,iBAAiB,EACjB,yBAAyB,EACzB,UAAU,EACV,sBAAsB,EACtB,mBAAmB,EACnB,YAAY,EACZ,wBAAwB,EACxB,eAAe,EACf,SAAS,EACT,wBAAwB,EACxB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,YAAY,GAClB,MAAM,2BAA2B,CAAC;AAEnC,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/supervision/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAClB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,4BAA4B,EAC5B,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,qBAAqB,EACrB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,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EACf,SAAS,EACT,wBAAwB,EACxB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,YAAY,GAClB,MAAM,2BAA2B,CAAC;AAEnC,cAAc,wBAAwB,CAAC;AAEvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC"}
@@ -6,8 +6,9 @@
6
6
  * kernel's supervision contracts as pure decision logic — health contracts
7
7
  * (probe side and push side), restart/degrade policy, updater laws, host
8
8
  * launcher registration, and process identification. Hosts supply every
9
- * effect (axiom 6); every threshold, vocabulary, and error string is
10
- * byte-exact with the shipped engine (axiom 8).
9
+ * effect (axiom 6). Historical compatibility contracts remain byte-exact
10
+ * with the Engine evidence (axiom 8); managed update contracts derive from
11
+ * the installation ownership, durable intent and fencing axioms.
11
12
  */
12
13
  export { HEALTHZ_STATUS_CODE, CHILD_HEALTH_POLICY, CHAT_SERVER_HEALTH_POLICY, CHILD_RESTART_POLICY, ChildSupervisionMachine, buildRuntimeHealthzBody, healthPolicyForService, readyDeadlineMs, validateHealthBody, } from './health.js';
13
14
  export { APP_HEALTH_POLICY, APP_ID_BODY_KEYS, APP_ID_REQUIRED_ERROR, APP_ID_REQUIRED_STATUS, APP_NOT_FOUND_ERROR, APP_NOT_FOUND_STATUS, HEARTBEAT_INTERVAL_BODY_KEYS, acceptsHealthSignals, appIdFromBody, clampIntervalMs, healthSignalRejection, heartbeatIntervalFromBody, heartbeatRecovery, snapshotEntry, sweepAppHealth, unresponsiveAfterMs, } from './app-health.js';
@@ -15,4 +16,6 @@ export { APP_RESTART_POLICY, appExitDecision, explicitStartReset, recentCrashes,
15
16
  export { AUTO_UPDATE_ENV_OVERRIDES, AUTO_UPDATE_POLICY, AUTO_UPDATE_STATUSES, NOT_SERVICE_MANAGED_REASON, NPM_UPDATE_CACHE_DIRNAME, UPDATE_TARGET_MISMATCH, autoUpdateIdleBlockedReason, autoUpdateSupported, comparePrerelease, compareVersions, distTagCheckFailedMessage, envDisablesAutoUpdate, envFlag, globalPrefixForPackageRoot, installFailedMessage, noVersionMessage, npmEnv, npmFailureDetail, npmInstallArgs, npmInstallTag, numberFromEnvValue, parseSemver, resolveAutoUpdateTimings, restartSuppressedDetail, shouldAutoUpdate, updateTargetMismatchError, } from './update.js';
16
17
  export { PS_LINE_PATTERN, RUNTIME_HEALTH_PATH, RUNTIME_INSTANCE_ARG_PATTERN, SUPERVISOR_COMMAND_SUFFIX, buildLaunchdPlist, buildSystemdUnit, buildWindowsStartupScript, commandLooksLikeAnySupervisor, commandLooksLikeRuntimeService, commandLooksLikeSupervisor, commandRuntimeInstanceId, decideOwnership, deferToExistingInstall, envMatchesAmalgmDir, launchdPlistPath, lockOwnedByAnother, normalizeMode, parsePort, parsePsLine, pathLooksLikeDesktopBundle, plistEscape, releaseAllowed, runtimeInstanceArg, runtimeLaunchServices, runtimePortsFromState, runtimePortsState, runtimeServiceMarkers, runtimeServiceSuffixes, serviceLabel, serviceLabelScope, serviceStateCanOwnRuntime, shellQuote, shippedRuntimeServices, stateMatchesRequest, systemdQuote, systemdUnavailableOutput, systemdUnitPath, vbsString, windowsStartupScriptPath, } from './service-registration.js';
17
18
  export * from './installation-plan.js';
19
+ export * from './managed-release.js';
20
+ export * from './managed-update.js';
18
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/supervision/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,eAAe,EACf,kBAAkB,GAQnB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,E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,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/supervision/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,eAAe,EACf,kBAAkB,GAQnB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,4BAA4B,EAC5B,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,qBAAqB,EACrB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,mBAAmB,GAOpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,cAAc,GAKf,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,EACtB,2BAA2B,EAC3B,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,yBAAyB,EACzB,qBAAqB,EACrB,OAAO,EACP,0BAA0B,EAC1B,oBAAoB,EACpB,gBAAgB,EAChB,MAAM,EACN,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,wBAAwB,EACxB,uBAAuB,EACvB,gBAAgB,EAChB,yBAAyB,GAK1B,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,4BAA4B,EAC5B,yBAAyB,EACzB,iBAAiB,EACjB,gBAAgB,EAChB,yBAAyB,EACzB,6BAA6B,EAC7B,8BAA8B,EAC9B,0BAA0B,EAC1B,wBAAwB,EACxB,eAAe,EACf,sBAAsB,EACtB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,WAAW,EACX,0BAA0B,EAC1B,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,YAAY,EACZ,iBAAiB,EACjB,yBAAyB,EACzB,UAAU,EACV,sBAAsB,EACtB,mBAAmB,EACnB,YAAY,EACZ,wBAAwB,EACxB,eAAe,EACf,SAAS,EACT,wBAAwB,GAQzB,MAAM,2BAA2B,CAAC;AAEnC,cAAc,wBAAwB,CAAC;AAEvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,75 @@
1
+ import { type RuntimeBinding } from '../identity/runtime-binding.js';
2
+ export interface ManagedArtifact {
3
+ readonly name: string;
4
+ readonly version: string;
5
+ readonly sha512: string;
6
+ readonly lockSha512: string;
7
+ readonly source: {
8
+ readonly repository: string;
9
+ readonly branch: string;
10
+ readonly commit: string;
11
+ };
12
+ }
13
+ export interface ManagedStore {
14
+ readonly id: string;
15
+ readonly reads: {
16
+ readonly min: number;
17
+ readonly max: number;
18
+ };
19
+ readonly writes: number;
20
+ }
21
+ /** One independently replaceable process boundary. Embedded libraries are bound
22
+ * by the artifact and its exact shrinkwrap, never replaced inside a live process. */
23
+ export interface ManagedUnit {
24
+ readonly id: string;
25
+ readonly artifact: ManagedArtifact;
26
+ readonly protocol: number;
27
+ readonly dependencies: readonly {
28
+ readonly id: string;
29
+ readonly protocol: number;
30
+ }[];
31
+ readonly stores: readonly ManagedStore[];
32
+ }
33
+ export interface ManagedRuntimeTarget {
34
+ readonly schema: 1;
35
+ readonly kind: 'runtime';
36
+ readonly lane: 'main' | 'preview';
37
+ readonly id: string;
38
+ readonly sequence: number;
39
+ readonly release: {
40
+ readonly schema: 1;
41
+ readonly controllerProtocol: number;
42
+ readonly nodeMajor: number;
43
+ readonly platforms: readonly string[];
44
+ readonly units: readonly ManagedUnit[];
45
+ };
46
+ }
47
+ export interface ManagedHost {
48
+ readonly controllerProtocol: number;
49
+ readonly nodeMajor: number;
50
+ readonly platform: string;
51
+ }
52
+ export interface AcceptedRuntimeRelease {
53
+ readonly target: ManagedRuntimeTarget;
54
+ /** SHA-256 of the exact target bytes verified by the host's TUF client. */
55
+ readonly digest: string;
56
+ }
57
+ export declare const MANAGED_PLATFORMS: readonly ["darwin-arm64", "darwin-x64", "linux-x64", "win32-x64"];
58
+ export declare function runtimeTargetDigest(value: unknown): string;
59
+ /** Structural admission only. Cryptography and freshness are exclusively the
60
+ * host's TUF client's responsibility, before bytes reach this function. */
61
+ export declare function parseManagedRuntimeTarget(value: unknown): ManagedRuntimeTarget;
62
+ export declare function assertManagedCompatibility(target: ManagedRuntimeTarget, binding: RuntimeBinding, host: ManagedHost): void;
63
+ /** Replay and metadata renewal converge; a signed sequence can never rebind its
64
+ * exact bytes. Expiry is checked during TUF refresh, not by trusting recipe dates. */
65
+ export declare function admitManagedRuntimeRelease(value: unknown, digest: string, binding: RuntimeBinding, host: ManagedHost, previous?: AcceptedRuntimeRelease | null): AcceptedRuntimeRelease;
66
+ /** Execution order derives only from the declared process dependency graph. */
67
+ export declare function managedUnitOrder(target: ManagedRuntimeTarget): readonly string[];
68
+ export declare function changedManagedUnits(previous: ManagedRuntimeTarget, next: ManagedRuntimeTarget): readonly string[];
69
+ /** Evidence comes from the fenced store, not the candidate's advertised schema.
70
+ * Every store the recovery unit will open must have a compatible observed schema. */
71
+ export declare function managedRecoveryCompatible(recovery: ManagedRuntimeTarget, affected: readonly string[], observed: Readonly<Record<string, number>>): boolean;
72
+ /** Zero is explicit evidence of an absent store. Only a newly introduced store
73
+ * may be created; missing evidence or disappearance of a prior store fails. */
74
+ export declare function managedActivationCompatible(previous: ManagedRuntimeTarget, candidate: ManagedRuntimeTarget, affected: readonly string[], observed: Readonly<Record<string, number>>): boolean;
75
+ //# sourceMappingURL=managed-release.d.ts.map
@@ -0,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AsB,GAAG,IAAW,GAAG,sBAAsB,CAUxE;AACD,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,oBAAoB,GAAG,SAAS,MAAM,EAAE,CAUhF;AACD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,oBAAoB,EAAE,IAAI,EAAE,oBAAoB,GAAG,SAAS,MAAM,EAAE,CAIjH;AACD;qFACqF;AACrF,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,oBAAoB,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,EACnG,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,OAAO,CAKrD;AAED;+EAC+E;AAC/E,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,oBAAoB,EAAE,SAAS,EAAE,oBAAoB,EACzG,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,OAAO,CAOlF"}
@@ -0,0 +1,168 @@
1
+ import { resolveRuntimeBinding } from '../identity/runtime-binding.js';
2
+ export const MANAGED_PLATFORMS = ['darwin-arm64', 'darwin-x64', 'linux-x64', 'win32-x64'];
3
+ function requireValue(condition, reason) {
4
+ if (!condition)
5
+ throw new Error(`Invalid managed release: ${reason}.`);
6
+ }
7
+ function record(value, keys, label) {
8
+ requireValue(value && typeof value === 'object' && !Array.isArray(value), `${label} must be an object`);
9
+ const result = value;
10
+ requireValue(Object.keys(result).sort().join(',') === [...keys].sort().join(','), `${label} fields differ from schema 1`);
11
+ return result;
12
+ }
13
+ function string(value, pattern, label) {
14
+ requireValue(typeof value === 'string' && value.length <= 512 && pattern.test(value), label);
15
+ return value;
16
+ }
17
+ function integer(value, label) {
18
+ requireValue(typeof value === 'number' && Number.isSafeInteger(value) && value > 0 && value < Number.MAX_SAFE_INTEGER, label);
19
+ return value;
20
+ }
21
+ function list(value, label, maximum = 128) {
22
+ requireValue(Array.isArray(value) && value.length <= maximum, label);
23
+ return value;
24
+ }
25
+ const idPattern = /^[a-z][a-z0-9-]{0,63}$/;
26
+ const compareIds = (a, b) => a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
27
+ const versionPattern = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-(?:0|[1-9]\d*|\d*[A-Za-z-][A-Za-z0-9-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][A-Za-z0-9-]*))*)?$/;
28
+ export function runtimeTargetDigest(value) {
29
+ return string(value, /^[a-f0-9]{64}$/, 'target digest must be SHA-256');
30
+ }
31
+ function parseArtifact(value, lane) {
32
+ const a = record(value, ['name', 'version', 'sha512', 'lockSha512', 'source'], 'artifact');
33
+ const name = string(a.name, /^(?:amalgm|@amalgm\/[a-z][a-z0-9-]{0,63})$/, 'artifact package name');
34
+ const source = record(a.source, ['repository', 'branch', 'commit'], 'artifact source');
35
+ const owner = name === 'amalgm' ? 'shell' : name.slice('@amalgm/'.length);
36
+ requireValue(source.repository === `amalgm-inc/amalgm-${owner}` && source.branch === lane, 'artifact source owner or branch differs');
37
+ return { name, version: string(a.version, versionPattern, 'exact package version'),
38
+ sha512: string(a.sha512, /^[a-f0-9]{128}$/, 'artifact SHA-512'),
39
+ lockSha512: string(a.lockSha512, /^[a-f0-9]{128}$/, 'shrinkwrap SHA-512'),
40
+ source: { repository: source.repository, branch: lane, commit: string(source.commit, /^[a-f0-9]{40}$/, 'source commit') } };
41
+ }
42
+ /** Structural admission only. Cryptography and freshness are exclusively the
43
+ * host's TUF client's responsibility, before bytes reach this function. */
44
+ export function parseManagedRuntimeTarget(value) {
45
+ const t = record(value, ['schema', 'kind', 'lane', 'id', 'sequence', 'release'], 'target');
46
+ requireValue(t.schema === 1 && t.kind === 'runtime' && (t.lane === 'main' || t.lane === 'preview'), 'target scope');
47
+ const r = record(t.release, ['schema', 'controllerProtocol', 'nodeMajor', 'platforms', 'units'], 'recipe');
48
+ requireValue(r.schema === 1, 'recipe schema');
49
+ const platforms = list(r.platforms, 'platforms', MANAGED_PLATFORMS.length).map(p => {
50
+ requireValue(typeof p === 'string' && MANAGED_PLATFORMS.includes(p), 'supported platform');
51
+ return p;
52
+ });
53
+ requireValue(platforms.length > 0 && new Set(platforms).size === platforms.length, 'unique nonempty platforms');
54
+ const unitIds = new Set();
55
+ const storeIds = new Set();
56
+ const packageIds = new Set();
57
+ const units = list(r.units, 'units').map(value => {
58
+ const u = record(value, ['id', 'artifact', 'protocol', 'dependencies', 'stores'], 'unit');
59
+ const id = string(u.id, idPattern, 'unit id');
60
+ requireValue(!unitIds.has(id), 'duplicate unit');
61
+ unitIds.add(id);
62
+ const artifact = parseArtifact(u.artifact, t.lane);
63
+ requireValue(!packageIds.has(artifact.name), 'a package has one process unit');
64
+ packageIds.add(artifact.name);
65
+ const deps = new Set();
66
+ const dependencies = list(u.dependencies, 'dependencies').map(value => {
67
+ const d = record(value, ['id', 'protocol'], 'dependency');
68
+ const id = string(d.id, idPattern, 'dependency id');
69
+ requireValue(!deps.has(id), 'duplicate dependency');
70
+ deps.add(id);
71
+ return { id, protocol: integer(d.protocol, 'dependency protocol') };
72
+ });
73
+ const stores = list(u.stores, 'stores').map(value => {
74
+ const s = record(value, ['id', 'reads', 'writes'], 'store');
75
+ const id = string(s.id, idPattern, 'store id');
76
+ requireValue(!storeIds.has(id), 'a writable store has one unit owner');
77
+ storeIds.add(id);
78
+ const range = record(s.reads, ['min', 'max'], 'store read range');
79
+ const reads = { min: integer(range.min, 'minimum store schema'), max: integer(range.max, 'maximum store schema') };
80
+ const writes = integer(s.writes, 'written store schema');
81
+ requireValue(reads.min <= writes && writes <= reads.max, 'a unit must read the schema it writes');
82
+ return { id, reads, writes };
83
+ });
84
+ return { id, artifact, protocol: integer(u.protocol, 'unit protocol'),
85
+ dependencies: dependencies.sort(compareIds), stores: stores.sort(compareIds) };
86
+ });
87
+ requireValue(units.some(u => u.id === 'shell' && u.artifact.name === 'amalgm'), 'public Shell unit is required');
88
+ const byId = new Map(units.map(u => [u.id, u]));
89
+ const visiting = new Set();
90
+ const visited = new Set();
91
+ const visit = (unit) => {
92
+ requireValue(!visiting.has(unit.id), 'unit dependency cycle');
93
+ if (visited.has(unit.id))
94
+ return;
95
+ visiting.add(unit.id);
96
+ for (const dependency of unit.dependencies) {
97
+ const provider = byId.get(dependency.id);
98
+ requireValue(provider?.protocol === dependency.protocol, 'missing or incompatible unit dependency');
99
+ visit(provider);
100
+ }
101
+ visiting.delete(unit.id);
102
+ visited.add(unit.id);
103
+ };
104
+ for (const unit of units)
105
+ visit(unit);
106
+ return { schema: 1, kind: 'runtime', lane: t.lane,
107
+ id: string(t.id, /^[A-Za-z0-9][A-Za-z0-9._-]{0,199}$/, 'promotion id'), sequence: integer(t.sequence, 'promotion sequence'),
108
+ release: { schema: 1, controllerProtocol: integer(r.controllerProtocol, 'controller protocol'), nodeMajor: integer(r.nodeMajor, 'Node major'),
109
+ platforms: platforms.sort(), units: units.sort(compareIds) } };
110
+ }
111
+ export function assertManagedCompatibility(target, binding, host) {
112
+ const resolved = resolveRuntimeBinding(binding);
113
+ requireValue(resolved.runtimeLabel !== 'local' && target.lane === resolved.runtimeLabel, 'managed binding differs');
114
+ requireValue(target.release.controllerProtocol === host.controllerProtocol && target.release.nodeMajor === host.nodeMajor
115
+ && target.release.platforms.includes(host.platform), 'host compatibility differs');
116
+ }
117
+ /** Replay and metadata renewal converge; a signed sequence can never rebind its
118
+ * exact bytes. Expiry is checked during TUF refresh, not by trusting recipe dates. */
119
+ export function admitManagedRuntimeRelease(value, digest, binding, host, previous = null) {
120
+ const target = parseManagedRuntimeTarget(value);
121
+ assertManagedCompatibility(target, binding, host);
122
+ runtimeTargetDigest(digest);
123
+ if (previous) {
124
+ requireValue(target.sequence >= previous.target.sequence, 'promotion sequence rolled back');
125
+ requireValue(target.sequence !== previous.target.sequence || digest === previous.digest, 'promotion sequence rebound');
126
+ requireValue(target.id !== previous.target.id || digest === previous.digest, 'promotion identity rebound');
127
+ }
128
+ return { target, digest };
129
+ }
130
+ /** Execution order derives only from the declared process dependency graph. */
131
+ export function managedUnitOrder(target) {
132
+ const units = new Map(target.release.units.map(u => [u.id, u]));
133
+ const ordered = new Set();
134
+ const visit = (id) => {
135
+ if (ordered.has(id))
136
+ return;
137
+ for (const d of units.get(id).dependencies)
138
+ visit(d.id);
139
+ ordered.add(id);
140
+ };
141
+ for (const u of target.release.units)
142
+ visit(u.id);
143
+ return [...ordered];
144
+ }
145
+ export function changedManagedUnits(previous, next) {
146
+ const before = new Map(previous.release.units.map(u => [u.id, u]));
147
+ const after = new Map(next.release.units.map(u => [u.id, u]));
148
+ return [...new Set([...before.keys(), ...after.keys()])].filter(id => JSON.stringify(before.get(id)) !== JSON.stringify(after.get(id)));
149
+ }
150
+ /** Evidence comes from the fenced store, not the candidate's advertised schema.
151
+ * Every store the recovery unit will open must have a compatible observed schema. */
152
+ export function managedRecoveryCompatible(recovery, affected, observed) {
153
+ return recovery.release.units.filter(u => affected.includes(u.id)).every(u => u.stores.every(s => {
154
+ const schema = observed[s.id];
155
+ return Number.isSafeInteger(schema) && schema >= s.reads.min && schema <= s.reads.max;
156
+ }));
157
+ }
158
+ /** Zero is explicit evidence of an absent store. Only a newly introduced store
159
+ * may be created; missing evidence or disappearance of a prior store fails. */
160
+ export function managedActivationCompatible(previous, candidate, affected, observed) {
161
+ const existing = new Set(previous.release.units.flatMap(u => u.stores.map(s => s.id)));
162
+ return candidate.release.units.filter(u => affected.includes(u.id)).every(u => u.stores.every(s => {
163
+ const schema = observed[s.id];
164
+ return (schema === 0 && !existing.has(s.id))
165
+ || (Number.isSafeInteger(schema) && schema >= s.reads.min && schema <= s.reads.max);
166
+ }));
167
+ }
168
+ //# sourceMappingURL=managed-release.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"managed-release.js","sourceRoot":"","sources":["../../src/supervision/managed-release.ts"],"names":[],"mappings":"AAAA,OAA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AAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;QAChG,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC9B,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;eACvC,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,MAAO,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,MAAO,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC1F,CAAC,CAAC,CAAC,CAAC;AACN,CAAC"}
@@ -0,0 +1,95 @@
1
+ import { type RuntimeBinding } from '../identity/runtime-binding.js';
2
+ import { type AcceptedRuntimeRelease, type ManagedHost } from './managed-release.js';
3
+ export declare const MANAGED_UPDATE_POLICY: Readonly<{
4
+ probationMs: 60000;
5
+ probeIntervalMs: 2000;
6
+ maximumDeferralMs: 60000;
7
+ maximumProbeGapMs: 10000;
8
+ retryInitialMs: 1000;
9
+ retryMaximumMs: 60000;
10
+ }>;
11
+ export type ManagedUpdatePhase = 'stage' | 'drain' | 'fence' | 'start' | 'probe' | 'recovery-fence' | 'recovery-start' | 'recovery-probe' | 'parked';
12
+ export interface ManagedUpdateTransaction {
13
+ readonly candidate: AcceptedRuntimeRelease;
14
+ readonly previous: AcceptedRuntimeRelease;
15
+ readonly affected: readonly string[];
16
+ readonly phase: ManagedUpdatePhase;
17
+ readonly epoch: number;
18
+ readonly previousEpoch: number;
19
+ readonly recoveryEpoch: number | null;
20
+ readonly step: number;
21
+ readonly attempt: number;
22
+ readonly notBefore: number;
23
+ readonly deadline: number | null;
24
+ readonly lastHealthyAt: number | null;
25
+ /** Artifact slots that may still contain a live writer. A successful cohort
26
+ * fence clears them; beginning a start records its slot before the effect. */
27
+ readonly unfenced: readonly string[];
28
+ readonly reason: string | null;
29
+ }
30
+ export interface ManagedUpdateState {
31
+ readonly schema: 1;
32
+ readonly binding: RuntimeBinding;
33
+ readonly host: ManagedHost;
34
+ readonly epoch: number;
35
+ readonly activeEpoch: number;
36
+ readonly activeHealthy: boolean;
37
+ readonly active: AcceptedRuntimeRelease;
38
+ readonly desired: AcceptedRuntimeRelease;
39
+ readonly transaction: ManagedUpdateTransaction | null;
40
+ readonly quarantine: {
41
+ readonly digest: string;
42
+ readonly sequence: number;
43
+ readonly reason: string;
44
+ } | null;
45
+ }
46
+ export interface ManagedUpdateEffect {
47
+ readonly token: string;
48
+ readonly transaction: ManagedUpdateTransaction;
49
+ }
50
+ export type ManagedUpdateResult = {
51
+ readonly type: 'staged';
52
+ } | {
53
+ readonly type: 'drained';
54
+ } | {
55
+ readonly type: 'fenced';
56
+ readonly epoch: number;
57
+ readonly schemas: Readonly<Record<string, number>>;
58
+ } | {
59
+ readonly type: 'started';
60
+ readonly epoch: number;
61
+ } | {
62
+ readonly type: 'healthy';
63
+ readonly epoch: number;
64
+ } | {
65
+ readonly type: 'retry';
66
+ readonly reason: string;
67
+ } | {
68
+ readonly type: 'deferred';
69
+ readonly reason: string;
70
+ readonly until: number;
71
+ } | {
72
+ readonly type: 'failed';
73
+ readonly reason: string;
74
+ };
75
+ export declare function createManagedUpdateState(binding: RuntimeBinding, host: ManagedHost, active: AcceptedRuntimeRelease, activeEpoch: number): ManagedUpdateState;
76
+ /** Discovery can run during staging. An admitted target cannot rewrite an
77
+ * in-flight transaction; it remains desired and follows that transaction. */
78
+ export declare function desireManagedRuntimeRelease(state: ManagedUpdateState, value: unknown, digest: string): ManagedUpdateState;
79
+ /** Persist this returned state before obtaining/executing its effect. Staging
80
+ * starts while the active generation continues accepting work. */
81
+ export declare function beginManagedUpdate(state: ManagedUpdateState, now: number): ManagedUpdateState;
82
+ /** The same persisted intent produces the same token after process death.
83
+ * Every effect must be idempotent under this token AND generation-bound. */
84
+ export declare function managedUpdateEffect(state: ManagedUpdateState, now: number): ManagedUpdateEffect | null;
85
+ /** Result evidence is supplied by the external host after completing the exact
86
+ * effect. Stale/duplicate results cannot advance a later phase. */
87
+ export declare function completeManagedUpdateEffect(state: ManagedUpdateState, effectToken: string, result: ManagedUpdateResult, now: number): ManagedUpdateState;
88
+ /** Cache retention derives from durable state. Hosts may collect only artifacts
89
+ * outside this set; desired, active and both recovery sides remain pinned. */
90
+ export declare function retainedManagedReleaseDigests(state: ManagedUpdateState): readonly string[];
91
+ /** Disk is an external boundary. Hosts parse JSON, then use this admission
92
+ * before issuing any effect; an invalid record never silently starts afresh.
93
+ * Restoring accepted bytes does not authorize discovery without a TUF refresh. */
94
+ export declare function restoreManagedUpdateState(value: unknown, binding: RuntimeBinding, host: ManagedHost): ManagedUpdateState;
95
+ //# sourceMappingURL=managed-update.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"managed-update.d.ts","sourceRoot":"","sources":["../../src/supervision/managed-update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAC5F,OAAO,EAEL,KAAK,sBAAsB,EAAE,KAAK,WAAW,EAC9C,MAAM,sBAAsB,CAAC;AAE9B,eAAO,MAAM,qBAAqB;;;;;;;EAIhC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAC5E,gBAAgB,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,QAAQ,CAAC;AACtE,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,SAAS,EAAE,sBAAsB,CAAC;IAC3C,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,CAAC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,SAAS,MA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,GAAG,kBAAkB,CAGzH;AACD;kEACkE;AAClE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,GAAG,kBAAkB,CAY7F;AAED;4EAC4E;AAC5E,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,GAAG,mBAAmB,GAAG,IAAI,CAKtG;AAoBD;mEACmE;AACnE,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,EACxF,MAAM,EAAE,mBAAmB,EAAE,GAAG,EAAE,MAAM,GAAG,kBAAkB,CAuD9D;AACD;8EAC8E;AAC9E,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,kBAAkB,GAAG,SAAS,MAAM,EAAE,CAG1F;AAED;;kFAEkF;AAClF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,WAAW,GAAG,kBAAkB,CAsExH"}
@@ -0,0 +1,226 @@
1
+ import { resolveRuntimeBinding } from '../identity/runtime-binding.js';
2
+ import { admitManagedRuntimeRelease, changedManagedUnits, managedActivationCompatible, managedRecoveryCompatible, runtimeTargetDigest, } from './managed-release.js';
3
+ export const MANAGED_UPDATE_POLICY = Object.freeze({
4
+ probationMs: 60_000, probeIntervalMs: 2_000, maximumDeferralMs: 60_000,
5
+ maximumProbeGapMs: 10_000,
6
+ retryInitialMs: 1_000, retryMaximumMs: 60_000,
7
+ });
8
+ function insist(condition, reason) {
9
+ if (!condition)
10
+ throw new Error(`Invalid managed update: ${reason}.`);
11
+ }
12
+ function time(value) { insist(Number.isSafeInteger(value) && value >= 0 && value < Number.MAX_SAFE_INTEGER - 86_400_000, 'clock'); }
13
+ function increment(value) {
14
+ insist(Number.isSafeInteger(value) && value >= 0 && value < Number.MAX_SAFE_INTEGER - 1, 'counter exhausted');
15
+ return value + 1;
16
+ }
17
+ function reason(value) {
18
+ insist(typeof value === 'string' && value.trim().length > 0 && value.length <= 1_024 && !/[\x00-\x08\x0b\x0c\x0e-\x1f]/.test(value), 'bounded public reason');
19
+ return value;
20
+ }
21
+ export function createManagedUpdateState(binding, host, active, activeEpoch) {
22
+ insist(Number.isSafeInteger(activeEpoch) && activeEpoch > 0 && activeEpoch < Number.MAX_SAFE_INTEGER - 1, 'active generation');
23
+ const accepted = admitManagedRuntimeRelease(active.target, active.digest, binding, host);
24
+ return { schema: 1, binding: resolveRuntimeBinding(binding), host: { ...host }, epoch: activeEpoch, activeEpoch, activeHealthy: true,
25
+ active: accepted, desired: accepted, transaction: null, quarantine: null };
26
+ }
27
+ /** Discovery can run during staging. An admitted target cannot rewrite an
28
+ * in-flight transaction; it remains desired and follows that transaction. */
29
+ export function desireManagedRuntimeRelease(state, value, digest) {
30
+ const desired = admitManagedRuntimeRelease(value, digest, state.binding, state.host, state.desired);
31
+ return desired.digest === state.desired.digest ? state : { ...state, desired };
32
+ }
33
+ /** Persist this returned state before obtaining/executing its effect. Staging
34
+ * starts while the active generation continues accepting work. */
35
+ export function beginManagedUpdate(state, now) {
36
+ time(now);
37
+ const parked = state.transaction?.phase === 'parked' ? state.transaction : null;
38
+ if ((state.transaction && !parked) || (state.desired.digest === state.active.digest && state.activeHealthy)
39
+ || state.quarantine?.digest === state.desired.digest || parked?.candidate.digest === state.desired.digest)
40
+ return state;
41
+ const affected = [...new Set([...changedManagedUnits(state.active.target, state.desired.target), ...(parked?.affected ?? [])])];
42
+ if (affected.length === 0)
43
+ return { ...state, active: state.desired };
44
+ const epoch = increment(state.epoch);
45
+ return { ...state, epoch, transaction: { candidate: state.desired, previous: state.active,
46
+ previousEpoch: state.epoch, affected, epoch, recoveryEpoch: null,
47
+ phase: 'stage', step: 1, attempt: 0, notBefore: now, deadline: null, lastHealthyAt: null,
48
+ unfenced: parked?.unfenced ?? [state.active.digest], reason: null } };
49
+ }
50
+ function token(t) { return `${t.epoch}:${t.step}:${t.phase}`; }
51
+ /** The same persisted intent produces the same token after process death.
52
+ * Every effect must be idempotent under this token AND generation-bound. */
53
+ export function managedUpdateEffect(state, now) {
54
+ time(now);
55
+ const t = state.transaction;
56
+ if (!t || t.phase === 'parked' || t.notBefore > now)
57
+ return null;
58
+ return { token: token(t), transaction: t };
59
+ }
60
+ function advance(state, phase, now, patch = {}) {
61
+ const t = state.transaction;
62
+ return { ...state, transaction: { ...t, phase, step: increment(t.step), attempt: 0, notBefore: now, deadline: null, lastHealthyAt: null, ...patch } };
63
+ }
64
+ function quarantine(state, message) {
65
+ const t = state.transaction;
66
+ return { ...state, quarantine: { digest: t.candidate.digest, sequence: t.candidate.target.sequence, reason: reason(message) } };
67
+ }
68
+ function fail(state, message, now) {
69
+ const t = state.transaction;
70
+ const failed = quarantine(state, message);
71
+ if (t.phase === 'stage')
72
+ return state.activeHealthy ? { ...failed, transaction: null } : advance(failed, 'parked', now, { reason: message });
73
+ // Even a failed start may have opened stores. Recovery always fences the
74
+ // candidate epoch and examines actual disk schemas before restarting anything.
75
+ if (t.phase.startsWith('recovery-'))
76
+ return advance(failed, 'parked', now, { reason: message });
77
+ const recoveryEpoch = increment(state.epoch);
78
+ return advance({ ...failed, epoch: recoveryEpoch, activeHealthy: false }, 'recovery-fence', now, { recoveryEpoch, reason: message });
79
+ }
80
+ /** Result evidence is supplied by the external host after completing the exact
81
+ * effect. Stale/duplicate results cannot advance a later phase. */
82
+ export function completeManagedUpdateEffect(state, effectToken, result, now) {
83
+ time(now);
84
+ const t = state.transaction;
85
+ if (!t || token(t) !== effectToken || t.phase === 'parked')
86
+ return state;
87
+ insist(now >= t.notBefore, 'effect completed before its scheduled time');
88
+ if (result.type === 'failed')
89
+ return fail(state, reason(result.reason), now);
90
+ if (result.type === 'retry') {
91
+ // Only staging is freely repeatable. Uncertain writer/fence outcomes enter
92
+ // recovery; calling a timeout a retry cannot create an extra writer.
93
+ insist(t.phase === 'stage', 'only staging may report transient retry');
94
+ const attempt = increment(t.attempt);
95
+ const wait = Math.min(MANAGED_UPDATE_POLICY.retryMaximumMs, MANAGED_UPDATE_POLICY.retryInitialMs * 2 ** Math.min(attempt - 1, 16));
96
+ return advance(state, 'stage', now, { attempt, notBefore: now + wait, reason: reason(result.reason) });
97
+ }
98
+ if (result.type === 'deferred') {
99
+ insist(t.phase === 'drain' && Number.isSafeInteger(result.until) && result.until > now
100
+ && result.until <= now + MANAGED_UPDATE_POLICY.maximumDeferralMs, 'bounded safe-point deferral');
101
+ return advance(state, 'drain', now, { notBefore: result.until, reason: reason(result.reason) });
102
+ }
103
+ switch (t.phase) {
104
+ case 'stage':
105
+ insist(result.type === 'staged', 'staging must prove verified bytes and isolated preflight');
106
+ return advance(state, 'drain', now, { reason: null });
107
+ case 'drain':
108
+ insist(result.type === 'drained', 'products must yield admission and checkpoint');
109
+ return advance({ ...state, activeHealthy: false }, 'fence', now, { reason: null });
110
+ case 'fence':
111
+ insist(result.type === 'fenced' && result.epoch === t.previousEpoch, 'previous generation fencing evidence');
112
+ if (!managedActivationCompatible(t.previous.target, t.candidate.target, t.affected, result.schemas))
113
+ return fail(state, 'Candidate cannot read the fenced store schemas', now);
114
+ return advance(state, 'start', now, { unfenced: [t.candidate.digest] });
115
+ case 'start':
116
+ insist(result.type === 'started' && result.epoch === t.epoch, 'candidate generation start evidence');
117
+ return advance(state, 'probe', now, { deadline: now + MANAGED_UPDATE_POLICY.probationMs, lastHealthyAt: now });
118
+ case 'recovery-fence':
119
+ // The host fences the whole affected cohort, including both old and
120
+ // candidate capabilities; candidate start may never have completed.
121
+ insist(result.type === 'fenced' && result.epoch === t.epoch, 'candidate generation fencing evidence');
122
+ if (!managedRecoveryCompatible(t.previous.target, t.affected, result.schemas)) {
123
+ return advance(state, 'parked', now, { reason: 'Recovery cannot read the fenced store schemas', unfenced: [] });
124
+ }
125
+ return advance(state, 'recovery-start', now, { unfenced: [t.previous.digest] });
126
+ case 'recovery-start':
127
+ insist(result.type === 'started' && result.epoch === t.recoveryEpoch, 'recovery generation start evidence');
128
+ return advance(state, 'recovery-probe', now, { deadline: now + MANAGED_UPDATE_POLICY.probationMs, lastHealthyAt: now });
129
+ case 'probe':
130
+ case 'recovery-probe': {
131
+ const epoch = t.phase === 'probe' ? t.epoch : t.recoveryEpoch;
132
+ insist(result.type === 'healthy' && result.epoch === epoch && t.deadline !== null && t.lastHealthyAt !== null, 'generation-bound probation evidence');
133
+ // A reboot or missed observation is no evidence of healthy elapsed time.
134
+ // Start a new observation window while preserving attempts/quarantine.
135
+ const deadline = now - t.lastHealthyAt > MANAGED_UPDATE_POLICY.maximumProbeGapMs ? now + MANAGED_UPDATE_POLICY.probationMs : t.deadline;
136
+ if (now < deadline)
137
+ return advance(state, t.phase, now, { deadline, lastHealthyAt: now, notBefore: Math.min(deadline, now + MANAGED_UPDATE_POLICY.probeIntervalMs) });
138
+ return { ...state, active: t.phase === 'probe' ? t.candidate : t.previous, activeEpoch: epoch, activeHealthy: true, transaction: null };
139
+ }
140
+ }
141
+ }
142
+ /** Cache retention derives from durable state. Hosts may collect only artifacts
143
+ * outside this set; desired, active and both recovery sides remain pinned. */
144
+ export function retainedManagedReleaseDigests(state) {
145
+ return [...new Set([state.active.digest, state.desired.digest,
146
+ ...(state.transaction ? [state.transaction.previous.digest, state.transaction.candidate.digest, ...state.transaction.unfenced] : [])])];
147
+ }
148
+ /** Disk is an external boundary. Hosts parse JSON, then use this admission
149
+ * before issuing any effect; an invalid record never silently starts afresh.
150
+ * Restoring accepted bytes does not authorize discovery without a TUF refresh. */
151
+ export function restoreManagedUpdateState(value, binding, host) {
152
+ const object = (value, keys) => {
153
+ insist(value && typeof value === 'object' && !Array.isArray(value), 'durable object');
154
+ const record = value;
155
+ insist(Object.keys(record).sort().join(',') === [...keys].sort().join(','), 'durable schema fields');
156
+ return record;
157
+ };
158
+ const count = (value, minimum = 1) => {
159
+ insist(typeof value === 'number' && Number.isSafeInteger(value) && value >= minimum && value < Number.MAX_SAFE_INTEGER - 1, 'durable counter');
160
+ return value;
161
+ };
162
+ const clock = (value) => { const result = count(value, 0); time(result); return result; };
163
+ const accepted = (value) => {
164
+ const r = object(value, ['target', 'digest']);
165
+ return admitManagedRuntimeRelease(r.target, runtimeTargetDigest(r.digest), binding, host);
166
+ };
167
+ const s = object(value, ['schema', 'binding', 'host', 'epoch', 'activeEpoch', 'activeHealthy', 'active', 'desired', 'transaction', 'quarantine']);
168
+ const expectedBinding = resolveRuntimeBinding(binding);
169
+ const storedBinding = object(s.binding, ['runtimeLabel', 'branch']);
170
+ const storedHost = object(s.host, ['controllerProtocol', 'nodeMajor', 'platform']);
171
+ insist(s.schema === 1 && storedBinding.runtimeLabel === expectedBinding.runtimeLabel && storedBinding.branch === expectedBinding.branch
172
+ && storedHost.controllerProtocol === host.controllerProtocol && storedHost.nodeMajor === host.nodeMajor && storedHost.platform === host.platform, 'durable binding or host differs');
173
+ const active = accepted(s.active);
174
+ const desired = accepted(s.desired);
175
+ admitManagedRuntimeRelease(desired.target, desired.digest, binding, host, active);
176
+ const epoch = count(s.epoch);
177
+ const activeEpoch = count(s.activeEpoch);
178
+ insist(activeEpoch <= epoch && typeof s.activeHealthy === 'boolean', 'durable active ownership');
179
+ let quarantineRecord = null;
180
+ if (s.quarantine !== null) {
181
+ const q = object(s.quarantine, ['digest', 'sequence', 'reason']);
182
+ const sequence = count(q.sequence);
183
+ insist(sequence <= desired.target.sequence, 'quarantine exceeds desired release');
184
+ const digest = runtimeTargetDigest(q.digest);
185
+ insist(sequence !== desired.target.sequence || digest === desired.digest, 'quarantine sequence rebound');
186
+ quarantineRecord = { sequence, digest, reason: reason(q.reason) };
187
+ }
188
+ let transaction = null;
189
+ if (s.transaction !== null) {
190
+ const t = object(s.transaction, ['candidate', 'previous', 'affected', 'phase', 'epoch', 'previousEpoch', 'recoveryEpoch', 'step', 'attempt',
191
+ 'notBefore', 'deadline', 'lastHealthyAt', 'unfenced', 'reason']);
192
+ const previous = accepted(t.previous);
193
+ const candidate = accepted(t.candidate);
194
+ insist(previous.digest === active.digest, 'transaction recovery release differs from active');
195
+ admitManagedRuntimeRelease(candidate.target, candidate.digest, binding, host, previous);
196
+ admitManagedRuntimeRelease(desired.target, desired.digest, binding, host, candidate);
197
+ const transactionEpoch = count(t.epoch);
198
+ const previousEpoch = count(t.previousEpoch);
199
+ const recoveryEpoch = t.recoveryEpoch === null ? null : count(t.recoveryEpoch);
200
+ insist(activeEpoch <= previousEpoch && previousEpoch < transactionEpoch && transactionEpoch <= epoch
201
+ && (recoveryEpoch === null ? epoch === transactionEpoch : recoveryEpoch === transactionEpoch + 1 && epoch === recoveryEpoch), 'transaction generation order');
202
+ const phase = t.phase;
203
+ insist(['stage', 'drain', 'fence', 'start', 'probe', 'recovery-fence', 'recovery-start', 'recovery-probe', 'parked'].includes(phase), 'durable phase');
204
+ insist(!phase.startsWith('recovery-') || recoveryEpoch !== null, 'recovery epoch missing');
205
+ insist(!(phase === 'fence' || phase === 'start' || phase === 'probe' || phase.startsWith('recovery-') || phase === 'parked') || !s.activeHealthy, 'uncertain generation cannot be healthy');
206
+ const deadline = t.deadline === null ? null : clock(t.deadline);
207
+ const lastHealthyAt = t.lastHealthyAt === null ? null : clock(t.lastHealthyAt);
208
+ const probing = phase === 'probe' || phase === 'recovery-probe';
209
+ insist(probing ? deadline !== null && lastHealthyAt !== null && lastHealthyAt <= deadline : deadline === null && lastHealthyAt === null, 'durable probation evidence');
210
+ insist(Array.isArray(t.affected) && t.affected.length > 0 && t.affected.length <= 256
211
+ && t.affected.every(id => typeof id === 'string' && /^[a-z][a-z0-9-]{0,63}$/.test(id))
212
+ && new Set(t.affected).size === t.affected.length, 'durable affected units');
213
+ insist(changedManagedUnits(previous.target, candidate.target).every(id => t.affected.includes(id)), 'changed unit omitted from handover');
214
+ insist(Array.isArray(t.unfenced) && t.unfenced.length <= 2 && new Set(t.unfenced).size === t.unfenced.length, 'durable live slots');
215
+ const unfenced = t.unfenced.map(runtimeTargetDigest);
216
+ insist(!['start', 'probe'].includes(phase) || unfenced.includes(candidate.digest), 'candidate slot must be retained before start');
217
+ insist(!['recovery-start', 'recovery-probe'].includes(phase) || unfenced.includes(previous.digest), 'recovery slot must be retained before start');
218
+ transaction = { candidate, previous, affected: [...t.affected], phase, epoch: transactionEpoch, previousEpoch, recoveryEpoch,
219
+ step: count(t.step), attempt: count(t.attempt, 0), notBefore: clock(t.notBefore), deadline, lastHealthyAt, unfenced,
220
+ reason: t.reason === null ? null : reason(t.reason) };
221
+ }
222
+ insist(transaction !== null || s.activeHealthy, 'an unhealthy installation needs a recovery intent');
223
+ return { schema: 1, binding: expectedBinding, host: { ...host }, epoch, activeEpoch, activeHealthy: s.activeHealthy,
224
+ active, desired, quarantine: quarantineRecord, transaction };
225
+ }
226
+ //# sourceMappingURL=managed-update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"managed-update.js","sourceRoot":"","sources":["../../src/supervision/managed-update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAuB,MAAM,gCAAgC,CAAC;AAC5F,OAAO,EACL,0BAA0B,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,mBAAmB,GAE7H,MAAM,sBAAsB,CAAC;AAE9B,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC;IACjD,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM;IACtE,iBAAiB,EAAE,MAAM;IACzB,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM;CAC9C,CAAC,CAAC;AA8CH,SAAS,MAAM,CAAC,SAAkB,EAAE,MAAc;IAChD,IAAI,CAAC,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,MAAM,GAAG,CAAC,CAAC;AACxE,CAAC;AACD,SAAS,IAAI,CAAC,KAAa,IAAU,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,MAA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jE,CAAC"}
@@ -1,13 +1,15 @@
1
1
  /**
2
- * Updater laws — version comparison, npm install shape, and the
2
+ * Historical updater compatibility — version comparison, npm install shape, and the
3
3
  * auto-update manager's state vocabulary.
4
4
  *
5
5
  * The host runs npm, reads disks, and restarts processes; this module owns
6
- * every decision and every contract string (axiom 8): the semver rules the
6
+ * the historical decisions and contract strings (axiom 8): the semver rules the
7
7
  * updater lives by, the exact npm argv and environment, the error messages
8
- * surfaces match on, and the idle-gating reasons the UI displays.
8
+ * surfaces match on, and the idle-gating reasons legacy callers display.
9
+ * Managed installations use managed-release.ts and managed-update.ts; their
10
+ * policy has no global-npm replacement or environment-variable opt-out.
9
11
  *
10
- * Engine sources (production until cutover, axiom 9):
12
+ * Historical Engine sources (not a managed runtime fallback, axiom 9):
11
13
  * `packages/amalgm/lib/updater.js` and `packages/amalgm/lib/supervisor.js`
12
14
  * (auto-update manager), with the label→tag rule imported from
13
15
  * `identity/labels.ts` — one definition (axiom 2).
@@ -1 +1 @@
1
- {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/supervision/update.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAUlD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAsBrE;AAED,2EAA2E;AAC3E,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAOrE;AAED;;;;;GAKG;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AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAE1D;AAED,kEAAkE;AAClE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClD,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACrD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACjD;AAED;;;GAGG;AACH,eAAO,MAAM,0BAA0B,mCAAmC,CAAC;AAE3E;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAelF"}
@@ -1,13 +1,15 @@
1
1
  /**
2
- * Updater laws — version comparison, npm install shape, and the
2
+ * Historical updater compatibility — version comparison, npm install shape, and the
3
3
  * auto-update manager's state vocabulary.
4
4
  *
5
5
  * The host runs npm, reads disks, and restarts processes; this module owns
6
- * every decision and every contract string (axiom 8): the semver rules the
6
+ * the historical decisions and contract strings (axiom 8): the semver rules the
7
7
  * updater lives by, the exact npm argv and environment, the error messages
8
- * surfaces match on, and the idle-gating reasons the UI displays.
8
+ * surfaces match on, and the idle-gating reasons legacy callers display.
9
+ * Managed installations use managed-release.ts and managed-update.ts; their
10
+ * policy has no global-npm replacement or environment-variable opt-out.
9
11
  *
10
- * Engine sources (production until cutover, axiom 9):
12
+ * Historical Engine sources (not a managed runtime fallback, axiom 9):
11
13
  * `packages/amalgm/lib/updater.js` and `packages/amalgm/lib/supervisor.js`
12
14
  * (auto-update manager), with the label→tag rule imported from
13
15
  * `identity/labels.ts` — one definition (axiom 2).
@@ -1 +1 @@
1
- {"version":3,"file":"update.js","sour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aAAa,CAAC,OAAO,CAChD;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,KAAyB;IAC/C,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;AACvF,CAAC;AAWD;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,gCAAgC,CAAC;AAE3E;;;;;;;;;GASG;AACH,MAAM,UAAU,2BAA2B,CAAC,IAAuB;IACjE,IAAI,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAC3B,IAAI,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC,MAAM,CAAC;IAEpC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAC9E,IAAI,cAAc,GAAG,CAAC,EAAE,CAAC;QACvB,OAAO,iBAAiB,cAAc,eAAe,cAAc,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IACzF,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC/C,IAAI,SAAS,GAAG,CAAC,EAAE,CAAC;QAClB,OAAO,WAAW,SAAS,6BAA6B,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IACvF,CAAC;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,126 @@
1
+ # Managed runtime release and update contracts
2
+
3
+ ## Purpose and scope
4
+
5
+ Keep main and preview current without routine user action, preserve durable work,
6
+ and make recovery predictable after a process death or reboot. Core supplies the
7
+ portable admission and decision rules. Shell's external installation owner must
8
+ supply actual TUF verification, native storage, process effects and product
9
+ examinations. These APIs are source candidates; no published Core release or
10
+ installed Shell currently consumes them.
11
+
12
+ `src/supervision/managed-release.ts` owns recipe admission and compatibility.
13
+ `src/supervision/managed-update.ts` owns the durable update transaction. The
14
+ historical `update.ts` exports remain additive compatibility APIs; their npm-tag,
15
+ global-install and environment opt-out behavior does not govern managed updates.
16
+
17
+ ## Recipe laws
18
+
19
+ - The host first verifies `current.json` with the lane's standard TUF repository.
20
+ Core receives those exact bytes and their SHA-256. Parsing is not signature or
21
+ freshness verification, and a boolean claiming verification is not a trust root.
22
+ - A schema-1 runtime target names its lane, immutable sequence, controller
23
+ protocol, Node major, native platforms and dependency graph of process units.
24
+ Unknown schema fields fail admission. Protocol evolution uses an explicit new
25
+ schema or controller protocol, rather than interpreting unknown instructions.
26
+ - A process unit names one exact Amalgm archive, archive SHA-512, shrinkwrap
27
+ SHA-512 and owner/branch/commit. The public Shell unit uses `amalgm` from
28
+ `amalgm-inc/amalgm-shell`. The shrinkwrap binds its embedded package graph;
29
+ embedded SDK changes rebuild that process unit instead of mutating a running
30
+ import. The host checks the actual archive, shrinkwrap and source descriptors.
31
+ - Dependency protocols must match exactly and the graph must be acyclic. Each
32
+ declared writable store has one process-unit owner, a readable schema range
33
+ and a written schema within that range. Store identifiers are host-owned
34
+ resource bindings, never paths supplied by the release server.
35
+ - A signed sequence cannot rebind different bytes. Metadata renewal reuses the
36
+ same target. Local bindings and incompatible hosts fail before update effects.
37
+ Managed operation has no environment-variable opt-out.
38
+
39
+ The archive's signed recipe and native examination must agree with the unit's
40
+ actual executable, embedded graph and state contracts. Core's structural
41
+ admission cannot prove a product truthfully declared its migrations. A semantic
42
+ storage change that an old product cannot recover must advance the existing
43
+ store's schema; placing state in another file does not make rollback compatible.
44
+
45
+ ## Durable host protocol
46
+
47
+ The host holds one OS-backed installation-owner lease throughout reconciliation.
48
+ It restores state with `restoreManagedUpdateState`, refuses corrupt records, and
49
+ atomically persists and fsyncs every new state before executing its effect.
50
+ Accepted target history, active/desired records, quarantine, generation counters,
51
+ phase, retry time, probation evidence and potentially live artifact slots all
52
+ survive restart. A missing record is initial installation, not permission to
53
+ forget a failed transaction. The host must distinguish missing from corrupt.
54
+
55
+ 1. `desireManagedRuntimeRelease` admits a freshly TUF-verified target. An event
56
+ merely triggers that refresh. Subscribe before reading current on startup,
57
+ wake and reconnection. A newer target remains desired while an immutable
58
+ transaction completes; it cannot rewrite that transaction's candidate.
59
+ 2. `beginManagedUpdate` persists staging intent for changed process units. All
60
+ other units retain their running generations. The host downloads exact bytes,
61
+ checks archive and shrinkwrap integrity, materializes an immutable slot and
62
+ runs isolated preflight without user credentials, writable state or work claims.
63
+ 3. `managedUpdateEffect` returns a stable transaction/step/phase token. The host
64
+ makes each effect idempotent under that token. Replaying a start adopts the
65
+ same authenticated generation; it cannot spawn a second process. Persisted
66
+ state precedes effects, including process starts whose receipts could be lost.
67
+ 4. The affected products stop admission and checkpoint. A non-resumable operation
68
+ may defer with a bounded public reason and next check within 60 seconds. The
69
+ healthy release continues running during staging and safe-point waiting.
70
+ 5. Fencing confirms every affected writer at or below the named epoch has lost
71
+ its capability, then observes store schemas under that exclusive ownership.
72
+ A remembered PID, attempted signal or expired timeout is not fencing proof.
73
+ Stop dependants before providers and start providers before dependants, using
74
+ the recipe's dependency order. Removed units stay stopped.
75
+ 6. Only after fencing may the host start the new epoch and let it open declared
76
+ state or claim work. A new store requires explicit zero/absent evidence; an
77
+ existing store cannot silently disappear. The host returns generation-bound
78
+ health evidence throughout a 60-second observation window. A long observation
79
+ gap starts a new window; elapsed controller downtime is not healthy evidence.
80
+ 7. Successful probation commits the candidate as active. A newer desired target
81
+ then reconciles automatically. Cache collection retains active, desired,
82
+ transaction/recovery and possibly live slots until fencing proves them unused.
83
+
84
+ Safe-point wait and service interruption are separate measurements. The portable
85
+ policy supplies durations but does not certify throughput, exactly-once external
86
+ effects, native process lifetime or the host's fsync/rename behavior.
87
+
88
+ ## Failure and recovery
89
+
90
+ Transient staging failures retry with durable exponential delay capped at one
91
+ minute while the active release remains healthy. A deterministic preflight
92
+ failure quarantines that target. A writer or fence operation with an uncertain
93
+ outcome enters recovery; the host cannot relabel it a transient retry.
94
+
95
+ Recovery first fences the entire affected cohort, including old and candidate
96
+ epochs, then checks the store schemas actually present. If the previous release
97
+ can read them, recovery starts it under a fresh epoch and runs probation. If it
98
+ cannot, or recovery itself fails, the affected update remains parked with its
99
+ reason and possibly live slots retained. No unsafe rollback or restart loop is
100
+ inferred from a version number. Unrelated units retain their generations.
101
+
102
+ A newer verified release can recover a parked cohort automatically. Its fence
103
+ covers every previous attempted epoch, and its recipe must read the observed
104
+ state before starting. Failure evidence and uncertain artifact slots survive
105
+ that attempt, even if its staging fails. A new release is an explicit authority
106
+ decision; rebooting cannot retry the quarantined target.
107
+
108
+ All host error reasons must pass the existing diagnostic redaction boundary
109
+ before becoming public update state. These contracts never supply credentials,
110
+ filesystem paths, shell strings or process stop capabilities to a release target.
111
+
112
+ ## Examinations and remaining integration
113
+
114
+ `tests/supervision/managed-update.test.js` generates graph sizes and permutations,
115
+ checks both lanes and all declared host platforms, rejects cross-lane/replay and
116
+ malformed recipes, and models every handover/recovery phase through durable
117
+ restart. It examines missing or migrated stores, safe-point deferral, staging
118
+ backoff, interrupted probation, parked roll-forward, stale receipts and retained
119
+ possibly live slots. An independent writer model replays effects across both
120
+ sides of persistence and checks unchanged process units retain their generations.
121
+
122
+ This is portable policy proof. The production host must still use the public
123
+ Core API from an actually published, gated release and prove real TUF client,
124
+ artifact staging, native launcher, authenticated fencing, product checkpoints,
125
+ store inspection and packaged old-to-new activation on every supported OS.
126
+ Local packed consumer proof does not replace that native release gate.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amalgm/core",
3
- "version": "0.4.7",
3
+ "version": "0.4.8-main.34168902443",
4
4
  "description": "The Amalgm kernel SDK — identity, transport, supervision, and host capability contracts behind host-injected adapters.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -64,7 +64,8 @@
64
64
  "files": [
65
65
  "dist",
66
66
  "PURPOSE.md",
67
- "docs/authorization.md"
67
+ "docs/authorization.md",
68
+ "docs/managed-updates.md"
68
69
  ],
69
70
  "engines": {
70
71
  "node": ">=18"
@@ -75,9 +76,30 @@
75
76
  "prepack": "npm run build",
76
77
  "test": "npm run build && node --test",
77
78
  "examine:machine-setup": "npm run build && node --test tests/supervision/installation-plan.test.js tests/machine-setup/examination.test.js",
78
- "examine:user-ground": "npm run build && npm --prefix ../amalgm-live run build && node --test examinations/user-ground/login.examination.mjs"
79
+ "examine:user-ground": "npm run build && npm --prefix ../amalgm-live run build && node --test examinations/user-ground/login.examination.mjs",
80
+ "release:admit": "node scripts/release/package.mjs admit",
81
+ "release:prepare": "node scripts/release/package.mjs prepare",
82
+ "release:examine": "node scripts/release/package.mjs examine",
83
+ "release:publish": "node scripts/release/package.mjs publish",
84
+ "test:release": "node --test scripts/release/*.test.mjs"
79
85
  },
80
86
  "devDependencies": {
81
87
  "typescript": "^5.7.3"
88
+ },
89
+ "amalgmRelease": {
90
+ "schema": 1,
91
+ "workflow": "verify.yml",
92
+ "jobs": [
93
+ "verify"
94
+ ],
95
+ "verify": "test",
96
+ "cli": []
97
+ },
98
+ "gitHead": "80005a0eacf6d3814e4c41d917be00594afbeba4",
99
+ "amalgmSource": {
100
+ "repository": "amalgm-inc/amalgm-core",
101
+ "branch": "main",
102
+ "commit": "80005a0eacf6d3814e4c41d917be00594afbeba4",
103
+ "occurrence": "34168902443"
82
104
  }
83
105
  }