Commit Graph

28 Commits

  • Add PowerShell installer wrapper and update documentation (#532)
    * Add install.ps1 PowerShell wrapper and tests
    
    Add a Windows-native PowerShell wrapper (install.ps1) that resolves symlinks and delegates to the Node-based installer runtime. Update README with PowerShell usage examples and cross-platform npx entrypoint guidance. Point the ecc-install bin to the Node installer (scripts/install-apply.js) in package.json (and refresh package-lock), include install.ps1 in package files, and add tests: a new install-ps1.test.js and a tweak to install-sh.test.js to skip on Windows. These changes provide native Windows installer support while keeping npm-compatible cross-platform invocation.
    
    * Improve tests for Windows HOME/USERPROFILE
    
    Make tests more cross-platform by ensuring HOME and USERPROFILE are kept in sync and by normalizing test file paths for display.
    
    - tests/lib/session-adapters.test.js: set USERPROFILE when temporarily setting HOME and restore previous USERPROFILE on teardown.
    - tests/run-all.js: use a normalized displayPath (forward-slash separated) for logging and error messages so output is consistent across platforms.
    - tests/scripts/ecc.test.js & tests/scripts/session-inspect.test.js: build envOverrides from options.env and add HOME <-> USERPROFILE fallbacks so spawned child processes receive both variables when only one is provided.
    
    These changes prevent test failures and inconsistent logs on Windows where USERPROFILE is used instead of HOME.
    
    * Fix Windows paths and test flakiness
    
    Improve cross-platform behavior and test stability.
    
    - Remove unused createLegacyInstallPlan import from install-lifecycle.js.
    - Change resolveInstallConfigPath to use path.normalize(path.join(cwd, configPath)) to produce normalized relative paths.
    - Tests: add toBashPath and normalizedRelativePath helpers to normalize Windows paths for bash and comparisons.
    - Make cleanupTestDir retry rmSync on transient Windows errors (EPERM/EBUSY/ENOTEMPTY) with short backoff using sleepMs.
    - Ensure spawned test processes receive USERPROFILE and convert repo/detect paths to bash format when invoking bash.
    
    These changes reduce Windows-specific failures and flakiness in the test suite and tidy up a small unused import.
  • fix: resolve all CI test failures (19 fixes across 6 files) (#519)
    - canonical-session: fall back to JSON file recording when the loaded
      state-store module has no writer methods (factory vs instance)
    - install-executor: skip node_modules and .git dirs in listFilesRecursive
      to prevent ETIMEDOUT copying thousands of .opencode dependency files
    - ecc.js: increase maxBuffer to 10MB for spawned subcommands to prevent
      ENOBUFS on large install plan JSON output
    - install-apply.test: update Cursor and Antigravity path assertions to
      match flattened rule layout and remapped dirs (workflows, skills)
    - ecc.test: increase maxBuffer in test runner to handle large output
    - orchestrate-codex-worker.sh: guard against unreadable task file before
      cat, write failure status and handoff artifacts on early exit
  • feat: strengthen install lifecycle and target adapters (#512)
    * fix: strengthen install lifecycle adapters
    
    * fix: restore template content on uninstall
  • feat: self-improving skills loop — observe, inspect, amend, evaluate
    - Add skill health observation layer (execution logging, success/failure tracking)
    - Add skill health inspector (trace recurring failures across runs)
    - Add amendify mechanism (propose SKILL.md patches from failure evidence)
    - Add evaluation scaffolding (compare amended vs original performance)
    - Wire into session-inspect CLI: skills:health, skills:amendify, skills:evaluate
    - 1145/1145 tests passing (+3 new)
  • feat: expand session adapter registry with structured targets
    - Registry accepts { type, value } structured targets
    - Add --list-adapters and --target-type CLI flags to session-inspect
    - Export adapter type from claude-history and dmux-tmux adapters
    - 71 new session adapter tests, 34 new session-inspect tests
    - All 1142 tests passing
  • fix: address CodeRabbit review — deduplicate prompt, fix skill count
    - Swap loadHistory/appendTurn order to prevent user message appearing
      twice in the prompt (once in history, once as USER MESSAGE)
    - Calculate actual loaded skill count via fs.existsSync instead of
      counting requested skill names (banner now reflects reality)
    - Add err.stack to test harness error output for better debugging
  • feat: add NanoClaw agent REPL — persistent session-aware CLI for ECC
    Implements a barebones agent loop that delegates to `claude -p` with
    markdown-as-database session persistence and ECC skill context loading.
    Zero external dependencies, ~264 lines of pure Node.js CommonJS.
    
    - scripts/claw.js: core module (storage, context, delegation, REPL)
    - commands/claw.md: slash command definition with usage docs
    - tests/scripts/claw.test.js: 14 unit tests covering all modules
    - package.json: add claw script and files entry
    - tests/run-all.js: register claw tests in test manifest
  • test: add 3 tests for stdin 1MB overflow and analyzePhase async method (round 87)
    - post-edit-format.js: verify MAX_STDIN truncation at 1MB limit
    - post-edit-typecheck.js: verify MAX_STDIN truncation at 1MB limit
    - skill-create-output.js: test analyzePhase() returns Promise and writes output
  • fix: use nullish coalescing for confidence default + add 3 tests (round 85)
    Fix confidence=0 showing 80% instead of 0% in patterns() (|| → ??).
    Test evaluate-session.js config parse error catch, getSessionIdShort
    fallback at root CWD, and precise confidence=0 assertion.
  • test: cover setGlobal/setProject catch blocks and session-start main().catch
    - setup-package-manager: setGlobal catch when HOME is non-directory (ENOTDIR)
    - setup-package-manager: setProject catch when CWD is read-only (EACCES)
    - session-start: main().catch handler when ensureDir throws (exit 0, don't block)
    
    Total tests: 825 → 828
  • test: add --global success, bare PM name, and source label tests (Round 62)
    - setup-package-manager.test.js: --global npm writes config and exits 0
    - setup-package-manager.test.js: bare PM name sets global preference
    - setup-package-manager.test.js: --detect with env var shows source 'environment'
    
    791 tests total, all passing.
  • test: add search scope, path utility, and zero-value analysis tests (Round 54)
    - getAllSessions search matches only shortId, not title/content
    - getSessionPath returns absolute path with correct directory structure
    - analysisResults handles zero values for all data fields without crash
  • test: add setup-package-manager marker uniqueness and list completeness tests
    Round 45: verify --detect shows exactly one (current) marker and
    --list includes all four PMs with Lock file + Install entries.
  • fix: correct box() off-by-one width calculation in skill-create-output
    The box() helper produced lines that were width+1 characters instead of
    the requested width. Adjusted all three formulas (top border, middle
    content, bottom border) by -1 each. Added 4 tests verifying box width
    accuracy across instincts(), analysisResults(), and nextSteps() output.
  • fix: header subtitle width mismatch in skill-create-output; add 9 tests (Round 34)
    - Fix subtitle padding 55→59 so line 94 matches 64-char border width
    - Add 4 header width alignment tests (skill-create-output)
    - Add 3 getExecCommand non-string args tests (package-manager)
    - Add 2 detectFromPackageJson non-string type tests (package-manager)
  • fix: reject flags passed as package manager names in setup-package-manager CLI
    When --global or --project was followed by another flag (e.g., --global --project),
    the flag was treated as a package manager name. Added pmName.startsWith('-') check
    to both handlers. Added 20 tests across 4 test files covering argument validation,
    ensureDir error propagation, runCommand stderr handling, and saveAliases failure paths.
  • fix: clamp progressBar to prevent RangeError on overflow, add 10 tests
    progressBar() in skill-create-output.js could crash with RangeError when
    percent > 100 because repeat() received a negative count. Fixed by
    clamping filled to [0, width].
    
    New tests:
    - progressBar edge cases: 0%, 100%, and >100% confidence
    - Empty patterns/instincts arrays
    - post-edit-format: null tool_input, missing file_path, prettier failure
    - setup-package-manager: --detect output completeness, current marker
  • fix: box() off-by-one alignment, add 5 tests for readStdinJson and box alignment
    - skill-create-output.js: fix top border being 1 char narrower than
      middle/bottom lines (width - title - 5 → width - title - 4)
    - Add box alignment regression test verifying all lines have equal width
    - Add 4 readStdinJson tests via subprocess (valid JSON, invalid JSON,
      empty stdin, nested objects) — last untested exported utility function
    - All 338 tests passing
  • fix: remove unused imports in test files (ESLint)
    - validators.test.js: remove unused execSync (only execFileSync used)
    - skill-create-output.test.js: remove unused path module
  • fix: add word boundary to dev server hook regex, fix box() crash, add 27 tests
    - hooks.json: add \b word boundary anchors to dev server blocking regex
      to prevent false positives matching "npm run develop", "npm run devtools" etc.
    - skill-create-output.js: guard box() horizontal repeat with Math.max(0, ...)
      to prevent RangeError when title exceeds container width
    - Add 13 tests for setup-package-manager.js CLI argument parsing
    - Add 14 tests for skill-create-output.js SkillCreateOutput class
    - All 333 tests passing