The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
fix: port safe ci cleanup from backlog
Affaan Mustafa8f6369711317
diff --git a/WORKING-CONTEXT.md b/WORKING-CONTEXT.mdindex 5eba48873..d6e0689e7 100644--- a/WORKING-CONTEXT.md+++ b/WORKING-CONTEXT.md@@ -62,6 +62,7 @@ Public ECC plugin repo for agents, skills, commands, hooks, rules, install surfa- `#1110` install-time Claude hook root resolution- `#1106` portable Codex Context7 key extraction- `#1107` Codex baseline merge and sample agent-role sync+ - `#1119` stale CI/lint cleanup that still contained safe low-risk fixes- Port or rebuild inside ECC after full audit:- `#894` Jira integration- `#814` + `#808` rebuild as a single consolidated notifications lane for Opencode and cross-harness surfaces@@ -104,3 +105,4 @@ Keep this file detailed for only the current sprint, blockers, and next actions.- 2026-04-01: Replaced the GNU-only `grep -P` parser in `scripts/sync-ecc-to-codex.sh` with a portable Node parser for Context7 key extraction. Added source-level regression coverage so BSD/macOS syncs do not drift back to non-portable parsing.- 2026-04-01: Targeted regression suite after the direct ports is green: `tests/scripts/install-apply.test.js`, `tests/scripts/sync-ecc-to-codex.test.js`, and `tests/scripts/codex-hooks.test.js`.- 2026-04-01: Ported the useful core of `#1107` directly into `main` as an add-only Codex baseline merge. `scripts/sync-ecc-to-codex.sh` now fills missing non-MCP defaults from `.codex/config.toml`, syncs sample agent role files into `~/.codex/agents`, and preserves user config instead of replacing it. Added regression coverage for sparse configs and implicit parent tables.+- 2026-04-01: Ported the safe low-risk cleanup from `#1119` directly into `main` instead of keeping an obsolete CI PR open. This included `.mjs` eslint handling, stricter null checks, Windows home-dir coverage in bash-log tests, and longer Trae shell-test timeouts.diff --git a/eslint.config.js b/eslint.config.jsindex e49068695..acb4b672e 100644--- a/eslint.config.js+++ b/eslint.config.js@@ -24,5 +24,11 @@ module.exports = ['no-undef': 'error','eqeqeq': 'warn'}+ },+ {+ files: ['**/*.mjs'],+ languageOptions: {+ sourceType: 'module'+ }}];diff --git a/scripts/hooks/pre-bash-commit-quality.js b/scripts/hooks/pre-bash-commit-quality.jsindex a601317d2..b554bff19 100644--- a/scripts/hooks/pre-bash-commit-quality.js+++ b/scripts/hooks/pre-bash-commit-quality.js@@ -67,7 +67,7 @@ function findFileIssues(filePath) {try {const content = getStagedFileContent(filePath);- if (content == null) {+ if (content === null || content === undefined) {return issues;}const lines = content.split('\n');diff --git a/scripts/lib/skill-improvement/observations.js b/scripts/lib/skill-improvement/observations.jsindex 6c37e5ae2..1544c4b9f 100644--- a/scripts/lib/skill-improvement/observations.js+++ b/scripts/lib/skill-improvement/observations.js@@ -37,8 +37,8 @@ function createSkillObservation(input) {? input.skill.path.trim(): null;const success = Boolean(input.success);- const error = input.error == null ? null : String(input.error);- const feedback = input.feedback == null ? null : String(input.feedback);+ const error = input.error === null || input.error === undefined ? null : String(input.error);+ const feedback = input.feedback === null || input.feedback === undefined ? null : String(input.feedback);const variant = typeof input.variant === 'string' && input.variant.trim().length > 0? input.variant.trim(): 'baseline';diff --git a/skills/ck/commands/list.mjs b/skills/ck/commands/list.mjsindex c4cd04e2d..2acba26af 100644--- a/skills/ck/commands/list.mjs+++ b/skills/ck/commands/list.mjs@@ -8,8 +8,7 @@* exit 0: success exit 1: no projects*/-import { readProjects, loadContext, today, CONTEXTS_DIR } from './shared.mjs';-import { renderListTable } from './shared.mjs';+import { readProjects, loadContext, today, renderListTable } from './shared.mjs';const cwd = process.env.PWD || process.cwd();const projects = readProjects();diff --git a/skills/ck/commands/migrate.mjs b/skills/ck/commands/migrate.mjsindex d4966fa83..eaa3fbd91 100644--- a/skills/ck/commands/migrate.mjs+++ b/skills/ck/commands/migrate.mjs@@ -11,7 +11,7 @@* exit 0: success exit 1: error*/-import { readFileSync, writeFileSync, existsSync, renameSync } from 'fs';+import { readFileSync, existsSync, renameSync } from 'fs';import { resolve } from 'path';import { readProjects, writeProjects, saveContext, today, shortId, CONTEXTS_DIR } from './shared.mjs';@@ -112,7 +112,11 @@ for (const [projectPath, info] of Object.entries(projects)) {const contextMd = existsSync(contextMdPath) ? readFileSync(contextMdPath, 'utf8') : '';let meta = {};if (existsSync(metaPath)) {- try { meta = JSON.parse(readFileSync(metaPath, 'utf8')); } catch {}+ try {+ meta = JSON.parse(readFileSync(metaPath, 'utf8'));+ } catch (e) {+ console.warn(` ! ${contextDir}: invalid meta.json, continuing with defaults (${e.message})`);+ }}// Extract fields from CONTEXT.mddiff --git a/skills/ck/commands/save.mjs b/skills/ck/commands/save.mjsindex 0d25029c4..f4cb692ff 100644--- a/skills/ck/commands/save.mjs+++ b/skills/ck/commands/save.mjs@@ -20,8 +20,8 @@ import { readFileSync, mkdirSync, writeFileSync } from 'fs';import { resolve } from 'path';import {readProjects, writeProjects, loadContext, saveContext,- today, shortId, gitSummary, nativeMemoryDir, encodeProjectPath,- CONTEXTS_DIR, CURRENT_SESSION,+ today, shortId, gitSummary, nativeMemoryDir,+ CURRENT_SESSION,} from './shared.mjs';const isInit = process.argv.includes('--init');diff --git a/skills/ck/commands/shared.mjs b/skills/ck/commands/shared.mjsindex 49a363633..f826f4c1f 100644--- a/skills/ck/commands/shared.mjs+++ b/skills/ck/commands/shared.mjs@@ -5,8 +5,8 @@* No external dependencies. Node.js stdlib only.*/-import { readFileSync, writeFileSync, existsSync, mkdirSync, readdirSync } from 'fs';-import { resolve, basename } from 'path';+import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs';+import { resolve } from 'path';import { homedir } from 'os';import { spawnSync } from 'child_process';import { randomBytes } from 'crypto';@@ -270,7 +270,7 @@ export function renderContextMd(ctx) {}/** Render the bordered briefing box used by /ck:resume */-export function renderBriefingBox(ctx, meta = {}) {+export function renderBriefingBox(ctx, _meta = {}) {const latest = ctx.sessions?.[ctx.sessions.length - 1] || {};const W = 57;const pad = (str, w) => {@@ -344,7 +344,7 @@ export function renderInfoBlock(ctx) {}/** Render ASCII list table used by /ck:list */-export function renderListTable(entries, cwd, todayStr) {+export function renderListTable(entries, cwd, _todayStr) {// entries: [{name, contextDir, path, context, lastUpdated}]// Sorted alphabetically by contextDir before callingconst rows = entries.map((e, i) => {diff --git a/tests/lib/changed-files-store.test.js b/tests/lib/changed-files-store.test.jsindex 85dd62510..8e1ed4975 100644--- a/tests/lib/changed-files-store.test.js+++ b/tests/lib/changed-files-store.test.js@@ -24,7 +24,7 @@ async function runTests() {let storetry {store = await import(pathToFileURL(storePath).href)- } catch (err) {+ } catch (_err) {console.log('\n[warn] Skipping: build .opencode first (cd .opencode && npm run build)\n')process.exit(0)}diff --git a/tests/scripts/post-bash-command-log.test.js b/tests/scripts/post-bash-command-log.test.jsindex 6ba72583e..aa7802d83 100644--- a/tests/scripts/post-bash-command-log.test.js+++ b/tests/scripts/post-bash-command-log.test.js@@ -26,6 +26,7 @@ function runHook(mode, payload, homeDir) {env: {...process.env,HOME: homeDir,+ USERPROFILE: homeDir,},});}diff --git a/tests/scripts/trae-install.test.js b/tests/scripts/trae-install.test.jsindex 8328e81b1..d7c2c6b56 100644--- a/tests/scripts/trae-install.test.js+++ b/tests/scripts/trae-install.test.js@@ -29,7 +29,7 @@ function runInstall(options = {}) {},encoding: 'utf8',stdio: ['pipe', 'pipe', 'pipe'],- timeout: 20000,+ timeout: 60000,});}@@ -43,7 +43,7 @@ function runUninstall(options = {}) {encoding: 'utf8',input: options.input || 'y\n',stdio: ['pipe', 'pipe', 'pipe'],- timeout: 20000,+ timeout: 60000,});}