@hivemagnus/magnus-agent 1.1.7 → 1.1.10

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/NOTICE ADDED
@@ -0,0 +1,5 @@
1
+ Magnus includes a context-only adoption bundle containing Emberfold 0.1.0.
2
+ Emberfold is licensed under Apache-2.0.
3
+ Source: https://github.com/ChefTaco/emberfold
4
+ Its LICENSE and NOTICE are retained in the bundle and installed with the engine.
5
+ The bundle also contains Zod 4.6.7 under the MIT license, retained with Zod.
package/README.md CHANGED
@@ -263,6 +263,11 @@ its name, for example `MAGNUS_AGENT_ARDENT_PACKAGES=@hivemagnus/ardent,@legacy-s
263
263
  Older sidecars with the `{name, version, sha256}` shape are accepted unchanged.
264
264
  Profile channel maps accept any channel key that matches `[a-z][a-z0-9_-]{0,31}`.
265
265
 
266
+ For adopting Emberfold without replacing the existing runtime, see
267
+ [context-only Ardent adoption](../../docs/ARDENT_CONTEXT_ADOPTION.md). The release
268
+ bundles the exact context adapter and engine; managed staging verifies continuity
269
+ in isolated data before activation exercises an actual old-runtime rollback.
270
+
266
271
  ## Development
267
272
 
268
273
  ```bash
package/dist/agent.js CHANGED
@@ -7,6 +7,7 @@ import { controlApiFetch } from './tls.js';
7
7
  import { startSpan, formatTraceparent } from './collectors/otel-collector.js';
8
8
  import { collectHermesState } from './executors/hermes-manager.js';
9
9
  import { existsSync } from 'node:fs';
10
+ import { heartbeatDrift } from './upgrade/preflight.js';
10
11
  import { confirmTrial, controlApiUnreachable, recordTrialAlive, selfUpgradeStatus, trialOf } from './upgrade/self-upgrade.js';
11
12
  import { commandLedger } from './executors/command-executor.js';
12
13
  const HEARTBEAT_INTERVAL_MS = 30_000; // 30s
@@ -77,8 +78,11 @@ async function collectHealthWithDeadline() {
77
78
  }
78
79
  /** Self-upgrade status for the heartbeat, with the sticky local enrollment marker. */
79
80
  async function heartbeatSelfUpgrade() {
80
- const enrollment = await commandLedger.managedEnrollment().catch(() => null);
81
- return { ...selfUpgradeStatus(AGENT_VERSION), managedEnrollment: enrollment ? { nodeId: enrollment.nodeId, nodeFqdn: enrollment.nodeFqdn } : null };
81
+ const marker = await commandLedger.enrollmentMarker();
82
+ if (marker.error)
83
+ logger.warn(`Local enrollment marker could not be read: ${marker.error}`);
84
+ return { ...selfUpgradeStatus(AGENT_VERSION), ...heartbeatDrift(commandLedger),
85
+ managedEnrollment: marker.marker ? { nodeId: marker.marker.nodeId, nodeFqdn: marker.marker.nodeFqdn } : null, managedEnrollmentState: marker.state };
82
86
  }
83
87
  /** Stop the heartbeat loop. */
84
88
  export function stopHeartbeatLoop() {