Skip to content

Commit e68233c

Browse files
authored
fix(ci): harden codex hook regression test (anomalyco#1028)
1 parent 656cf4c commit e68233c

3 files changed

Lines changed: 21 additions & 10 deletions

File tree

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Everything Claude Code (ECC) — Agent Instructions
22

3-
This is a **production-ready AI coding plugin** providing 30 specialized agents, 135 skills, 60 commands, and automated hook workflows for software development.
3+
This is a **production-ready AI coding plugin** providing 30 specialized agents, 136 skills, 60 commands, and automated hook workflows for software development.
44

55
**Version:** 1.9.0
66

@@ -142,7 +142,7 @@ Troubleshoot failures: check test isolation → verify mocks → fix implementat
142142

143143
```
144144
agents/ — 30 specialized subagents
145-
skills/ — 135 workflow skills and domain knowledge
145+
skills/ — 136 workflow skills and domain knowledge
146146
commands/ — 60 slash commands
147147
hooks/ — Trigger-based automations
148148
rules/ — Always-follow guidelines (common + per-language)

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ For manual install instructions see the README in the `rules/` folder. When copy
220220
/plugin list everything-claude-code@everything-claude-code
221221
```
222222

223-
**That's it!** You now have access to 30 agents, 135 skills, and 60 commands.
223+
**That's it!** You now have access to 30 agents, 136 skills, and 60 commands.
224224

225225
### Multi-model commands require additional setup
226226

@@ -1111,7 +1111,7 @@ The configuration is automatically detected from `.opencode/opencode.json`.
11111111
|---------|-------------|----------|--------|
11121112
| Agents | PASS: 30 agents | PASS: 12 agents | **Claude Code leads** |
11131113
| Commands | PASS: 60 commands | PASS: 31 commands | **Claude Code leads** |
1114-
| Skills | PASS: 135 skills | PASS: 37 skills | **Claude Code leads** |
1114+
| Skills | PASS: 136 skills | PASS: 37 skills | **Claude Code leads** |
11151115
| Hooks | PASS: 8 event types | PASS: 11 events | **OpenCode has more!** |
11161116
| Rules | PASS: 29 rules | PASS: 13 instructions | **Claude Code leads** |
11171117
| MCP Servers | PASS: 14 servers | PASS: Full | **Full parity** |

‎tests/scripts/codex-hooks.test.js‎

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const { spawnSync } = require('child_process');
1111
const repoRoot = path.join(__dirname, '..', '..');
1212
const installScript = path.join(repoRoot, 'scripts', 'codex', 'install-global-git-hooks.sh');
1313
const syncScript = path.join(repoRoot, 'scripts', 'sync-ecc-to-codex.sh');
14-
const checkScript = path.join(repoRoot, 'scripts', 'codex', 'check-codex-global-state.sh');
1514

1615
function test(name, fn) {
1716
try {
@@ -51,11 +50,15 @@ function makeHermeticCodexEnv(homeDir, codexDir, extraEnv = {}) {
5150
return {
5251
HOME: homeDir,
5352
USERPROFILE: homeDir,
53+
XDG_CONFIG_HOME: path.join(homeDir, '.config'),
54+
GIT_CONFIG_GLOBAL: path.join(homeDir, '.gitconfig'),
5455
CODEX_HOME: codexDir,
5556
AGENTS_HOME: agentsHome,
5657
ECC_GLOBAL_HOOKS_DIR: hooksDir,
5758
CLAUDE_PACKAGE_MANAGER: 'npm',
5859
CLAUDE_CODE_PACKAGE_MANAGER: 'npm',
60+
LANG: 'C.UTF-8',
61+
LC_ALL: 'C.UTF-8',
5962
...extraEnv,
6063
};
6164
}
@@ -86,10 +89,11 @@ if (
8689
else failed++;
8790

8891
if (
89-
test('sync and global sanity checks accept the legacy context7 MCP section', () => {
92+
test('sync preserves baseline config and accepts the legacy context7 MCP section', () => {
9093
const homeDir = createTempDir('codex-sync-home-');
9194
const codexDir = path.join(homeDir, '.codex');
9295
const configPath = path.join(codexDir, 'config.toml');
96+
const agentsPath = path.join(codexDir, 'AGENTS.md');
9397
const config = [
9498
'approval_policy = "on-request"',
9599
'sandbox_mode = "workspace-write"',
@@ -133,12 +137,19 @@ if (
133137

134138
const syncResult = runBash(syncScript, ['--update-mcp'], makeHermeticCodexEnv(homeDir, codexDir));
135139
assert.strictEqual(syncResult.status, 0, `${syncResult.stdout}\n${syncResult.stderr}`);
140+
141+
const syncedAgents = fs.readFileSync(agentsPath, 'utf8');
142+
assert.match(syncedAgents, /^# Everything Claude Code \(ECC\) — Agent Instructions/m);
143+
assert.match(syncedAgents, /^# Codex Supplement \(From ECC \.codex\/AGENTS\.md\)/m);
144+
136145
const syncedConfig = fs.readFileSync(configPath, 'utf8');
146+
assert.match(syncedConfig, /^multi_agent\s*=\s*true$/m);
147+
assert.match(syncedConfig, /^\[profiles\.strict\]$/m);
148+
assert.match(syncedConfig, /^\[profiles\.yolo\]$/m);
149+
assert.match(syncedConfig, /^\[mcp_servers\.github\]$/m);
150+
assert.match(syncedConfig, /^\[mcp_servers\.memory\]$/m);
151+
assert.match(syncedConfig, /^\[mcp_servers\.sequential-thinking\]$/m);
137152
assert.match(syncedConfig, /^\[mcp_servers\.context7\]$/m);
138-
139-
const checkResult = runBash(checkScript, [], makeHermeticCodexEnv(homeDir, codexDir));
140-
assert.strictEqual(checkResult.status, 0, checkResult.stderr || checkResult.stdout);
141-
assert.match(checkResult.stdout, /MCP section \[mcp_servers\.context7\] or \[mcp_servers\.context7-mcp\] exists/);
142153
} finally {
143154
cleanup(homeDir);
144155
}

0 commit comments

Comments
 (0)