Files
bare-operating-system/packages/bare-os-seeder/kernel/lib/boot/01-invoke-ctx-hooks.js
T
Raven Scott 8bde745191 feat: complete 20-track kernel roadmap (P2P ops, POSIX, HRPC, CI, docs)
- Add optional Holepunch clone lag gate (holepunch-freshness-gate.json,
  verify-holepunch-clone-freshness.mjs) and wire into pretest/docs.
- Extend stock ctx.bareOsHrpcRequest with disk.os replication routes;
  bump hrpc_allowlist_sketch proc to schema 2 with stockRoutes list.
- Security posture: blindRelayAudit; hyper_multisig_trust_pointer schema 2
  + vault multisig continuity env; login/unlock audit hook.
- Syscalls schema 9 alignment (JSON schema, compatibility matrix, conformance
  matrix clock_gettime); boot budget telemetry schema 2 in metrics_live.
- Coreutils hostname -s/--short man/options; rebuild kernel bins/man.
- POSIX + P2P dashboard section in docs/README; handbook/DOCUMENTATION/
  release-checklist/OTA/KERNEL_CONTRACT/PEAR-RUN and related reference updates.
- verify-boot-policy-extension-signer-pins: scan kernel init fragments.

Note: vendor drift section removed from kernel/lib/bare/README.md (intentional).
2026-04-05 14:17:20 -04:00

36 lines
1.2 KiB
JavaScript

/**
* Boot preamble: cooperative lock FSM constants + `invokeCtxBootHooks`.
* This file is the **only** source for these symbols; `kernel/init.js` is generated by
* `node scripts/bundle-kernel-init.mjs` (concat `lib/boot/*.js`, `lib/init/fragments/*.js`, then `lib/init/init-main.js`).
* CI: `scripts/verify-init-bundle-recipe.mjs` / `verify-kernel-seeder-parity.mjs`.
*/
/** Boot transaction journal row state (resume / audit / rollback FSM). */
const BARE_OS_BOOT_TXN_STATE = Object.freeze({
STAGE_STARTED: 'stage_started',
STAGE_COMMITTED: 'stage_committed',
STAGE_ROLLBACK: 'stage_rollback',
STAGE_SKIPPED: 'stage_skipped'
})
/**
* @param {Record<string, unknown>} ctx
* @param {Record<string, unknown>} ev
*/
async function invokeCtxBootHooks(ctx, ev) {
const label = String(
ev.phase !== undefined && ev.phase !== null
? ev.phase
: ev.step !== undefined && ev.step !== null
? ev.step
: ''
)
const merged = { ...ev, phase: label, step: label }
if (typeof ctx.bareOsInvokeBootStepHooks === 'function') {
await ctx.bareOsInvokeBootStepHooks(merged)
return
}
if (typeof ctx.bareOsInvokeBootPhaseHooks === 'function') {
await ctx.bareOsInvokeBootPhaseHooks(merged)
}
}