mirror of
https://github.com/Jeuners/ECC.git
synced 2026-09-09 15:02:30 +02:00
feat(codex): add ECC navigation guide (#2525)
* feat(codex): add ECC navigation guide * fix(codex): ship navigation guide references --------- Co-authored-by: Haley Chen <2022hachen@gmail.com>
This commit is contained in:
parent
b6fe5a71e1
commit
a3130f9ebf
8 changed files with 314 additions and 1 deletions
80
tests/docs/codex-navigation-map.test.js
Normal file
80
tests/docs/codex-navigation-map.test.js
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
'use strict';
|
||||
|
||||
const assert = require('assert');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const repoRoot = path.resolve(__dirname, '..', '..');
|
||||
const guidePath = 'docs/CODEX-NAVIGATION-GUIDE.md';
|
||||
|
||||
let passed = 0;
|
||||
let failed = 0;
|
||||
|
||||
function test(name, fn) {
|
||||
try {
|
||||
fn();
|
||||
console.log(` ✓ ${name}`);
|
||||
passed++;
|
||||
} catch (error) {
|
||||
console.log(` ✗ ${name}`);
|
||||
console.log(` Error: ${error.message}`);
|
||||
failed++;
|
||||
}
|
||||
}
|
||||
|
||||
function read(relativePath) {
|
||||
return fs.readFileSync(path.join(repoRoot, relativePath), 'utf8');
|
||||
}
|
||||
|
||||
console.log('\n=== Testing Codex ECC navigation map docs ===\n');
|
||||
|
||||
test('Codex navigation map exists and identifies canonical surfaces', () => {
|
||||
const source = read(guidePath);
|
||||
|
||||
for (const required of [
|
||||
'AGENTS.md',
|
||||
'.codex/AGENTS.md',
|
||||
'.codex/config.toml',
|
||||
'.codex/agents/',
|
||||
'.agents/skills/',
|
||||
'docs/COMMAND-AGENT-MAP.md',
|
||||
'commands/',
|
||||
'skills/',
|
||||
'agents/',
|
||||
'rules/',
|
||||
'hooks/',
|
||||
'scripts/',
|
||||
'manifests/'
|
||||
]) {
|
||||
assert.ok(source.includes(required), `Missing canonical surface ${required}`);
|
||||
}
|
||||
});
|
||||
|
||||
test('Codex navigation map documents PR diff packet workflow', () => {
|
||||
const source = read(guidePath);
|
||||
|
||||
for (const required of [
|
||||
'PR Diff Packet',
|
||||
'git diff origin/main...HEAD --stat',
|
||||
'git diff origin/main...HEAD --name-only',
|
||||
'git log origin/main..HEAD --oneline --reverse',
|
||||
'/pr',
|
||||
'/review-pr',
|
||||
'.github/PULL_REQUEST_TEMPLATE.md',
|
||||
'Testing Done',
|
||||
'Risk and review lanes'
|
||||
]) {
|
||||
assert.ok(source.includes(required), `Missing PR workflow marker ${required}`);
|
||||
}
|
||||
});
|
||||
|
||||
test('README and Codex supplement link to the navigation map', () => {
|
||||
const readme = read('README.md');
|
||||
const codexAgents = read('.codex/AGENTS.md');
|
||||
|
||||
assert.ok(readme.includes(guidePath), 'README.md must link the Codex navigation map');
|
||||
assert.ok(codexAgents.includes(guidePath), '.codex/AGENTS.md must link the Codex navigation map');
|
||||
});
|
||||
|
||||
console.log(`\nResults: Passed: ${passed}, Failed: ${failed}`);
|
||||
process.exit(failed > 0 ? 1 : 0);
|
||||
|
|
@ -70,6 +70,7 @@ function buildExpectedPublishPaths(repoRoot) {
|
|||
"scripts/session-inspect.js",
|
||||
"scripts/uninstall.js",
|
||||
"scripts/gemini-adapt-agents.js",
|
||||
"scripts/sync-ecc-to-codex.sh",
|
||||
"scripts/codex/check-plugin-cache.js",
|
||||
"scripts/codex/merge-codex-config.js",
|
||||
"scripts/codex/merge-mcp-config.js",
|
||||
|
|
@ -80,9 +81,14 @@ function buildExpectedPublishPaths(repoRoot) {
|
|||
"install.ps1",
|
||||
"schemas",
|
||||
"agent.yaml",
|
||||
".github/PULL_REQUEST_TEMPLATE.md",
|
||||
"COMMANDS-QUICK-REF.md",
|
||||
"CONTRIBUTING.md",
|
||||
"VERSION",
|
||||
"assets/ecc-icon.svg",
|
||||
"assets/hero.png",
|
||||
"docs/CODEX-NAVIGATION-GUIDE.md",
|
||||
"docs/COMMAND-AGENT-MAP.md",
|
||||
"assets/images/sponsors",
|
||||
]
|
||||
const exclusionPaths = [
|
||||
|
|
@ -144,14 +150,20 @@ function main() {
|
|||
"scripts/release-video-suite.js",
|
||||
"scripts/work-items.js",
|
||||
"scripts/platform-audit.js",
|
||||
"scripts/sync-ecc-to-codex.sh",
|
||||
"scripts/codex/check-plugin-cache.js",
|
||||
".gemini/GEMINI.md",
|
||||
".qwen/QWEN.md",
|
||||
".claude-plugin/plugin.json",
|
||||
".github/PULL_REQUEST_TEMPLATE.md",
|
||||
".codex-plugin/plugin.json",
|
||||
"COMMANDS-QUICK-REF.md",
|
||||
"CONTRIBUTING.md",
|
||||
"plugins/ecc/.codex-plugin/plugin.json",
|
||||
"assets/ecc-icon.svg",
|
||||
"assets/hero.png",
|
||||
"docs/CODEX-NAVIGATION-GUIDE.md",
|
||||
"docs/COMMAND-AGENT-MAP.md",
|
||||
"schemas/install-state.schema.json",
|
||||
"skills/backend-patterns/SKILL.md",
|
||||
]) {
|
||||
|
|
|
|||
|
|
@ -69,11 +69,32 @@ function runTests() {
|
|||
|
||||
if (test('filesystem-changing calls use argv-form run_or_echo invocations', () => {
|
||||
assert.ok(source.includes('run_or_echo mkdir -p "$BACKUP_DIR"'), 'mkdir should use argv form');
|
||||
assert.ok(source.includes('run_or_echo mkdir -p "$(dirname "$CODEX_NAV_GUIDE_DEST")"'), 'Codex guide destination directory should use argv form');
|
||||
assert.ok(source.includes('run_or_echo cp "$CODEX_NAV_GUIDE_SRC" "$CODEX_NAV_GUIDE_DEST"'), 'Codex guide copy should use argv form');
|
||||
assert.ok(source.includes('run_or_echo cp "$CODEX_COMMAND_AGENT_MAP_SRC" "$CODEX_COMMAND_AGENT_MAP_DEST"'), 'Command-agent map copy should use argv form');
|
||||
assert.ok(source.includes('run_or_echo cp "$CODEX_COMMANDS_QUICK_REF_SRC" "$CODEX_COMMANDS_QUICK_REF_DEST"'), 'Commands quick reference copy should use argv form');
|
||||
assert.ok(source.includes('run_or_echo cp "$CODEX_CONTRIBUTING_SRC" "$CODEX_CONTRIBUTING_DEST"'), 'Contributing guide copy should use argv form');
|
||||
assert.ok(source.includes('run_or_echo mkdir -p "$(dirname "$CODEX_PR_TEMPLATE_DEST")"'), 'PR template destination directory should use argv form');
|
||||
assert.ok(source.includes('run_or_echo cp "$CODEX_PR_TEMPLATE_SRC" "$CODEX_PR_TEMPLATE_DEST"'), 'PR template copy should use argv form');
|
||||
// Skills sync rm/cp calls were removed — Codex reads from ~/.agents/skills/ natively
|
||||
assert.ok(!source.includes('run_or_echo rm -rf "$dest"'), 'skill sync rm should be removed');
|
||||
assert.ok(!source.includes('run_or_echo cp -R "$skill_dir" "$dest"'), 'skill sync cp should be removed');
|
||||
})) passed++; else failed++;
|
||||
|
||||
if (test('sync script carries the Codex navigation guide referenced by AGENTS', () => {
|
||||
assert.ok(source.includes('CODEX_NAV_GUIDE_SRC="$REPO_ROOT/docs/CODEX-NAVIGATION-GUIDE.md"'), 'Expected source path for Codex navigation guide');
|
||||
assert.ok(source.includes('CODEX_NAV_GUIDE_DEST="$CODEX_HOME/docs/CODEX-NAVIGATION-GUIDE.md"'), 'Expected destination path for Codex navigation guide');
|
||||
assert.ok(source.includes('require_path "$CODEX_NAV_GUIDE_SRC" "ECC Codex navigation guide"'), 'Expected sync preflight for Codex navigation guide');
|
||||
for (const required of [
|
||||
'CODEX_COMMAND_AGENT_MAP_SRC="$REPO_ROOT/docs/COMMAND-AGENT-MAP.md"',
|
||||
'CODEX_COMMANDS_QUICK_REF_SRC="$REPO_ROOT/COMMANDS-QUICK-REF.md"',
|
||||
'CODEX_CONTRIBUTING_SRC="$REPO_ROOT/CONTRIBUTING.md"',
|
||||
'CODEX_PR_TEMPLATE_SRC="$REPO_ROOT/.github/PULL_REQUEST_TEMPLATE.md"'
|
||||
]) {
|
||||
assert.ok(source.includes(required), `Expected synced reference source ${required}`);
|
||||
}
|
||||
})) passed++; else failed++;
|
||||
|
||||
if (test('sync script avoids GNU-only grep -P parsing', () => {
|
||||
assert.ok(!source.includes('grep -oP'), 'sync-ecc-to-codex.sh should remain portable across BSD and GNU environments');
|
||||
})) passed++; else failed++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue