@@ -8,7 +8,8 @@ and the `context-mode` runtime plugin.
88Context-mode requires Node.js 22.5 or newer, npm, network access during setup,
99and the native toolchain needed by ` better-sqlite3 ` (` python3 ` , ` make ` , and a
1010C/C++ compiler). A working Bun installation is used for dependencies when
11- available.
11+ available. Set ` CONTEXT_MODE_PACKAGE_MANAGER=npm ` or ` bun ` to override automatic
12+ selection during setup.
1213
1314``` sh
1415export CODEX_HOME=" $HOME /.codex-gestalt"
@@ -22,15 +23,16 @@ When setup is launched from another checkout, it automatically continues from
2223the marketplace snapshot configured in ` ~/.codex-gestalt ` .
2324
2425Marketplace installation does not run the setup script automatically. The
25- script installs both plugins, prepares the exact installed context-mode cache,
26- verifies its artifact manifest, generates the reviewer and executor profiles,
27- and removes the retired supervisor profile. It does not create, validate, or
28- rewrite ` config.toml ` . Run setup again after a marketplace upgrade.
26+ script installs both plugins, prepares a stable context-mode runtime under
27+ ` ${GESTALT_HOME:-$HOME/.gestalt} ` , verifies its artifact manifest, generates the
28+ reviewer and executor profiles, and removes the retired supervisor profile. It
29+ does not create, validate, or rewrite ` config.toml ` . Run setup again after a
30+ marketplace upgrade.
2931
3032Useful modes:
3133
3234``` sh
33- ./gestalt-setup.sh --prepare-only # prepare this source tree only
35+ ./gestalt-setup.sh --prepare-only # install only the external runtime
3436./gestalt-setup.sh --force # reinstall dependencies and rebuild
3537./gestalt-setup.sh --dry-run # print mutations without running them
3638```
@@ -110,35 +112,44 @@ registry, or writes generated files. Startup follows this path:
110112
111113``` text
112114Codex MCP start
113- -> start.mjs
115+ -> start.mjs in the replaceable Codex plugin cache
116+ -> resolve version + platform + architecture + Node ABI
114117 -> runtime-preflight.mjs (read only)
115- -> server.bundle.mjs
118+ -> ~/.gestalt/runtime/context-mode/<version>/<target>/ server.bundle.mjs
116119```
117120
118121` runtime-preflight.mjs ` verifies the package version and SHA-256 artifact
119- manifest. An incomplete cache exits with code 78,
122+ manifest, including the native ` better-sqlite3 ` binding. An incomplete external
123+ runtime exits with code 78,
120124` CONTEXT_MODE_NOT_PREPARED ` , the invalid paths, and the setup command.
121125
122126Preparation is explicit:
123127
124128``` text
125129gestalt-setup.sh
126- -> codex plugin add
127- -> prepare-runtime.mjs in the installed cache
130+ -> install-runtime.mjs
131+ -> copy source into a versioned external staging directory
128132 -> locked dependency install
129133 -> TypeScript check and bundle build
130134 -> bundle assertions
131135 -> versioned SHA-256 manifest
136+ -> atomic publication under ~/.gestalt
137+ -> codex plugin add
132138```
133139
134- The setup lock only prevents concurrent preparation from corrupting the cache;
135- MCP and hook startup do not acquire it. The manifest covers the server, CLI,
136- and hook bundles plus runtime dependency metadata.
140+ Runtime directories use the package version and
141+ ` <platform>-<architecture>-node-<modules ABI> ` as their identity. They survive
142+ Codex plugin-cache replacement and can be shared by profiles running the same
143+ Node ABI. ` GESTALT_HOME ` must be absolute when set. The setup lock prevents
144+ concurrent installers from publishing a partial runtime; MCP and hook startup
145+ are read-only and do not acquire it. Codex hooks use a cache-local launcher that
146+ loads their implementations from the same external runtime.
137147
138148` package.json ` is a private dependency and build manifest. Codex marketplace
139149installation does not use npm publication metadata or npm lifecycle scripts.
140150The repository-level setup script is the required pre-flight because Codex has
141- no marketplace install-build hook and generated bundles are not committed.
151+ no marketplace install-build hook, generated bundles are not committed, and
152+ Codex may rematerialize its plugin cache when a session starts.
142153
143154The context-mode plugin exposes only its Codex MCP and hook surfaces. Hooks use
144155Codex's auto-discovered ` hooks/hooks.json ` path, so the plugin manifest does not
@@ -159,7 +170,7 @@ Startup coverage verifies that:
159170 write path;
1601712 . an incomplete runtime fails quickly with the stable diagnostic;
1611723 . explicit preparation is concurrency-safe and produces a valid MCP
162- ` initialize ` and ` tools/list ` exchange;
173+ ` initialize ` and ` tools/list ` exchange after the plugin cache is recreated ;
1631744 . Codex hooks do not invoke preparation;
1641755 . plugin manifests, runtime artifacts, skill metadata, and skill discovery
165176 remain consistent.
0 commit comments