Skip to content

Commit 9dd2dd7

Browse files
committed
fix: #2 problem with codex installation
1 parent 79a06dd commit 9dd2dd7

80 files changed

Lines changed: 431 additions & 199 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/plugins/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"name": "archcore",
99
"source": {
1010
"source": "local",
11-
"path": "./"
11+
"path": "./plugins/archcore"
1212
},
1313
"policy": {
1414
"installation": "INSTALLED_BY_DEFAULT",

.archcore/.sync-state.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3086,6 +3086,26 @@
30863086
"source": "plugin/architect-voice-default.adr.md",
30873087
"target": "plugin/precision-over-coverage.adr.md",
30883088
"type": "extends"
3089+
},
3090+
{
3091+
"source": "plugin/subdirectory-plugin-layout.adr.md",
3092+
"target": "plugin/multi-host-plugin-architecture.adr.md",
3093+
"type": "extends"
3094+
},
3095+
{
3096+
"source": "plugin/subdirectory-plugin-layout.adr.md",
3097+
"target": "plugin/codex-path-resolution.adr.md",
3098+
"type": "related"
3099+
},
3100+
{
3101+
"source": "plugin/subdirectory-plugin-layout.adr.md",
3102+
"target": "plugin/component-registry.doc.md",
3103+
"type": "related"
3104+
},
3105+
{
3106+
"source": "plugin/subdirectory-plugin-layout.adr.md",
3107+
"target": "plugin/cli-integration-tests.rule.md",
3108+
"type": "related"
30893109
}
30903110
]
30913111
}

.archcore/plugin/codex-host-support.prd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Users of OpenAI Codex CLI need the same Archcore surfaces Claude Code users get:
3434

3535
**F1 — Plugin Manifest.** Create `.codex-plugin/plugin.json` with `name`, `version`, `description` synchronized to `.claude-plugin/plugin.json` and `.cursor-plugin/plugin.json`. Component pointers (Codex relative paths, `./...`): `skills`, `hooks`, `mcpServers`. `interface{}` block for marketplace UI metadata.
3636

37-
**F2 — Marketplace Listing.** Create `.agents/plugins/marketplace.json` with the Codex marketplace schema. Entry uses `INSTALLED_BY_DEFAULT` and points the `archcore` plugin at the repo root. Do not create legacy `.codex-plugin/marketplace.json`.
37+
**F2 — Marketplace Listing.** Create `.agents/plugins/marketplace.json` (at the repo root) with the Codex marketplace schema. Entry uses `INSTALLED_BY_DEFAULT` and points the `archcore` plugin `source.path` at the `./plugins/archcore` subdirectory — Codex does not discover a plugin whose manifest sits at the marketplace root (see `subdirectory-plugin-layout.adr` and issue #2). Do not create legacy `.codex-plugin/marketplace.json`.
3838

3939
**F2a — Slash Commands.** Create root-level Codex command wrappers under `commands/*.md` for every user-facing Archcore workflow. Wrappers are host-adapter shims: `description:` frontmatter plus a one-line delegate instruction pointing at `skills/<name>/SKILL.md`. No workflow logic.
4040

.archcore/plugin/codex-local-plugin-testing.guide.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ tags:
1212

1313
- Codex CLI with plugin support. Check `codex --version`; if the plugin browser or local marketplaces behave differently from this guide, update Codex before debugging plugin packaging.
1414
- A clean Archcore plugin checkout with `jq`, `bats-core`, and optional `shellcheck` available. Initialize test submodules with `git submodule update --init` if bats helpers are missing.
15-
- The Codex package surfaces must exist and be valid: `.codex-plugin/plugin.json`, `.agents/plugins/marketplace.json`, `.codex.mcp.json`, `hooks/codex.hooks.json`, and `skills/*/SKILL.md`.
15+
- The Codex package surfaces must exist and be valid. The marketplace catalog stays at the **repo root** (`.agents/plugins/marketplace.json`); the plugin itself lives under **`plugins/archcore/`** (`plugins/archcore/.codex-plugin/plugin.json`, `plugins/archcore/.codex.mcp.json`, `plugins/archcore/hooks/codex.hooks.json`, and `plugins/archcore/skills/*/SKILL.md`). The catalog points `source.path` at `./plugins/archcore` — see `subdirectory-plugin-layout.adr` and issue #2.
1616
- **Archcore CLI installed globally on PATH** via the official installer at https://docs.archcore.ai/cli/install/`curl -fsSL https://archcore.ai/install.sh | bash` (macOS/Linux/WSL) or `irm https://archcore.ai/install.ps1 | iex` (Windows PowerShell). Verify with `archcore --version`. The plugin no longer bundles a launcher; if the CLI is missing, MCP startup fails at session start.
1717
- Official OpenAI Codex plugin docs are the authority for marketplace behavior:
1818
- CLI plugin directory: start `codex`, run `/plugins`, then browse by marketplace tab and install from the plugin details screen.
@@ -37,22 +37,22 @@ tags:
3737
make test-codex-smoke
3838
```
3939

40-
These tests use an isolated temporary `HOME` and verify that `codex plugin marketplace add "$PLUGIN_ROOT"` accepts the repo marketplace. They also simulate an installed plugin cache to check skill loading and plugin-managed MCP registration. This is a fast regression check, not a replacement for an actual `/plugins` install.
40+
These tests use an isolated temporary `HOME` and run the real discovery cycle: `codex plugin marketplace add "$REPO_ROOT"` accepts the repo marketplace (the catalog lives at the repo root and points `source.path` at `./plugins/archcore`), `codex plugin list` discovers `archcore@archcore-plugins` from that subdirectory, and `codex plugin add archcore@archcore-plugins` succeeds (the issue #2 regression). They also simulate an installed plugin cache to check skill loading and plugin-managed MCP registration. This is a fast regression check, not a replacement for an actual `/plugins` install.
4141

4242
3. Inspect the Codex package contract directly when a smoke test fails.
4343

4444
```bash
45-
jq . .codex-plugin/plugin.json
45+
jq . plugins/archcore/.codex-plugin/plugin.json
4646
jq . .agents/plugins/marketplace.json
47-
jq . .codex.mcp.json
48-
jq . hooks/codex.hooks.json
47+
jq . plugins/archcore/.codex.mcp.json
48+
jq . plugins/archcore/hooks/codex.hooks.json
4949
```
5050

5151
Confirm these invariants:
52-
- `.codex-plugin/plugin.json` points to `"./skills/"`, `"./hooks/codex.hooks.json"`, and `"./.codex.mcp.json"`.
53-
- `.agents/plugins/marketplace.json` has one `archcore` entry, `source.source = "local"`, `source.path = "./"`, `policy.installation`, `policy.authentication`, and `category`.
54-
- `.codex.mcp.json` uses the Codex-documented direct server map: top-level `archcore.command = "archcore"` and `archcore.args = ["mcp"]` — nothing else. No `mcpServers` wrapper, no `cwd: "."`, no `env_vars: ["ARCHCORE_CWD"]`. With the launcher removed, Codex resolves `archcore` from PATH directly; the user's CLI install is the single source.
55-
- `hooks/codex.hooks.json` uses `${PLUGIN_ROOT}/bin/...` commands (Codex's canonical, host-neutral env var). Do NOT use `${CLAUDE_PLUGIN_ROOT}` (Codex provides it only as a backward-compat alias for old Claude plugins) or `./bin/...` (would resolve against the user's project CWD).
52+
- `plugins/archcore/.codex-plugin/plugin.json` points to `"./skills/"`, `"./hooks/codex.hooks.json"`, and `"./.codex.mcp.json"` (paths are plugin-root-relative, i.e. relative to `plugins/archcore/`).
53+
- `.agents/plugins/marketplace.json` (at the repo root) has one `archcore` entry, `source.source = "local"`, `source.path = "./plugins/archcore"` (a dedicated subdirectory — Codex does NOT discover a plugin whose manifest sits at the marketplace root, even if `.codex-plugin/plugin.json` physically exists there; see issue #2 and `subdirectory-plugin-layout.adr`), `policy.installation`, `policy.authentication`, and `category`.
54+
- `plugins/archcore/.codex.mcp.json` uses the Codex-documented direct server map: top-level `archcore.command = "archcore"` and `archcore.args = ["mcp"]` — nothing else. No `mcpServers` wrapper, no `cwd: "."`, no `env_vars: ["ARCHCORE_CWD"]`. With the launcher removed, Codex resolves `archcore` from PATH directly; the user's CLI install is the single source.
55+
- `plugins/archcore/hooks/codex.hooks.json` uses `${PLUGIN_ROOT}/bin/...` commands (Codex's canonical, host-neutral env var). Do NOT use `${CLAUDE_PLUGIN_ROOT}` (Codex provides it only as a backward-compat alias for old Claude plugins) or `./bin/...` (would resolve against the user's project CWD).
5656

5757
4. Register this checkout as a local repo marketplace.
5858

@@ -77,7 +77,7 @@ tags:
7777
"name": "archcore",
7878
"source": {
7979
"source": "local",
80-
"path": "./Documents/archcore/plugin"
80+
"path": "./Documents/archcore/plugin/plugins/archcore"
8181
},
8282
"policy": {
8383
"installation": "AVAILABLE",
@@ -89,7 +89,7 @@ tags:
8989
}
9090
```
9191

92-
Adjust `source.path` for the checkout path being tested. For a personal marketplace, keep it `./`-prefixed and relative to the home-directory marketplace root when possible.
92+
Adjust `source.path` for the checkout path being tested. For a personal marketplace, keep it `./`-prefixed and relative to the home-directory marketplace root when possible, and make it point at the `plugins/archcore` subdirectory (which holds `.codex-plugin/plugin.json`), never the repo root — Codex will silently skip a plugin whose `source.path` resolves to the marketplace root (issue #2).
9393

9494
6. Install the plugin through the Codex CLI plugin browser.
9595

@@ -107,7 +107,7 @@ tags:
107107
find ~/.codex/plugins/cache -maxdepth 5 -type d -path '*archcore*' -print
108108
```
109109

110-
Expected result: `~/.codex/config.toml` contains an enabled `archcore@<marketplace>` entry, and the cache contains a copied plugin bundle with `.codex-plugin/plugin.json`, `commands/`, `skills/`, `.codex.mcp.json`, `hooks/`, and `bin/`. Note that `bin/` only contains hook scripts and `lib/normalize-stdin.sh` — no `archcore`/`archcore.cmd`/`archcore.ps1` launcher.
110+
Expected result: `~/.codex/config.toml` contains an enabled `archcore@<marketplace>` entry, and the cache contains a copied plugin bundle. Codex copies the resolved `source.path` directory (the `plugins/archcore/` subtree), so the cache root holds `.codex-plugin/plugin.json`, `commands/`, `skills/`, `.codex.mcp.json`, `hooks/`, and `bin/` directly. Note that `bin/` only contains hook scripts and `lib/normalize-stdin.sh` — no `archcore`/`archcore.cmd`/`archcore.ps1` launcher.
111111

112112
8. Verify MCP registration from a neutral directory.
113113

@@ -158,21 +158,21 @@ tags:
158158
- `~/.codex/plugins/cache/<marketplace>/archcore/<version>/` contains the plugin bundle.
159159
- `codex mcp list --json` includes an enabled `archcore` server with `command: "archcore"`, `args: ["mcp"]`. From a directory outside the plugin source repo, calling `mcp__archcore__list_documents` returns docs from THAT directory's `.archcore/`.
160160
- A new Codex thread can discover Archcore slash commands via `/archcore:` and Archcore skills via `@`, without manual `codex mcp add`.
161-
- Optional hook verification: with `codex features enable plugin_hooks`, `hooks/codex.hooks.json` should load `SessionStart`, `PreToolUse`, and `PostToolUse` guardrails. Keep this as a runtime smoke test because the `plugin_hooks` feature is `under development, false` by default in Codex 0.130.0.
161+
- Optional hook verification: with `codex features enable plugin_hooks`, `plugins/archcore/hooks/codex.hooks.json` should load `SessionStart`, `PreToolUse`, and `PostToolUse` guardrails. Keep this as a runtime smoke test because the `plugin_hooks` feature is `under development, false` by default in Codex 0.130.0.
162162

163163
## Common Issues
164164

165165
### Marketplace added but plugin is not visible
166166

167-
Close the current Codex TUI and start a new session. The plugin browser groups entries by marketplace and stale sessions may not show newly added marketplace files. Also clear the plugin search box and switch away from `OpenAI Curated` to the local marketplace tab.
167+
First, confirm the catalog's `source.path` resolves to the `plugins/archcore` subdirectory, not the repo root — a root `source.path` (`./`) is the issue #2 failure mode and Codex silently omits the plugin from `/plugins`. Then close the current Codex TUI and start a new session. The plugin browser groups entries by marketplace and stale sessions may not show newly added marketplace files. Also clear the plugin search box and switch away from `OpenAI Curated` to the local marketplace tab.
168168

169169
### `codex plugin marketplace add` succeeded, but plugin is not installed
170170

171171
Marketplace registration exposes a catalog; installation is a separate `/plugins` action. Open the plugin details and select `Install plugin`. After installation, start a new thread before testing skill invocation.
172172

173173
### Local personal marketplace does not show `Archcore Local`
174174

175-
Validate `~/.agents/plugins/marketplace.json` with `jq`. Confirm `source.path` starts with `./`, points to a directory that contains `.codex-plugin/plugin.json`, and has `policy.installation`, `policy.authentication`, and `category`. Codex skips an unresolvable plugin entry instead of failing the whole marketplace.
175+
Validate `~/.agents/plugins/marketplace.json` with `jq`. Confirm `source.path` starts with `./`, points to the `plugins/archcore` subdirectory that contains `.codex-plugin/plugin.json` (never the repo root — see issue #2), and has `policy.installation`, `policy.authentication`, and `category`. Codex skips an unresolvable plugin entry instead of failing the whole marketplace.
176176

177177
### Plugin appears under Available but not Installed
178178

@@ -204,7 +204,7 @@ Codex installs a copy into `~/.codex/plugins/cache/...`. Restart Codex after sou
204204

205205
### Hook guardrails do not fire
206206

207-
The plugin can package `hooks/codex.hooks.json`, but live hook execution depends on Codex's `plugin_hooks` feature flag. Run `codex features enable plugin_hooks` and retest with a fresh session. If the feature is unavailable in your Codex version (it's `under development, false` by default in Codex 0.130.0), upgrade Codex or treat plugin hooks as best-effort until it stabilizes.
207+
The plugin can package `plugins/archcore/hooks/codex.hooks.json`, but live hook execution depends on Codex's `plugin_hooks` feature flag. Run `codex features enable plugin_hooks` and retest with a fresh session. If the feature is unavailable in your Codex version (it's `under development, false` by default in Codex 0.130.0), upgrade Codex or treat plugin hooks as best-effort until it stabilizes.
208208

209209
### `codex debug prompt-input` fails with session permission errors
210210

@@ -215,6 +215,7 @@ Treat this as a local Codex session-file permission or sandbox problem, not nece
215215
- OpenAI Codex Plugins overview: https://developers.openai.com/codex/plugins
216216
- OpenAI Build plugins guide: https://developers.openai.com/codex/plugins/build
217217
- Archcore CLI install docs: https://docs.archcore.ai/cli/install/
218+
- Subdirectory plugin layout (issue #2 fix): `.archcore/plugin/subdirectory-plugin-layout.adr.md`
218219
- Codex MCP and Hooks Path Resolution ADR: `.archcore/plugin/codex-path-resolution.adr.md` (canonical reference for `cwd` rebase and env_vars passthrough — historical context now that the launcher is gone)
219220
- Codex MCP CWD idea (rejected/historical): `.archcore/plugin/codex-mcp-cwd-rebase-to-user-project.idea.md`
220221
- Upstream issue tracking `${PLUGIN_ROOT}` MCP substitution: https://github.com/openai/codex/issues/19582

0 commit comments

Comments
 (0)