ECC/tests
Gaurav Dubey 0a926b45ba
fix(install): rewrite relative skill links for injected ecc namespace (#2399)
* fix(install): rewrite relative skill links for injected ecc namespace

Skill and rule markdown is byte-copied during a claude install, but the
home/project adapters inject an `ecc/` namespace segment
(skills/<id> -> skills/ecc/<id>, rules/<x> -> rules/ecc/<x>). Source-relative
links such as `../../rules/react/hooks.md` therefore broke after install: the
extra level changed what `../..` resolved to, and the link target itself moved
under rules/ecc/.

Rewrite relative links in namespaced markdown so they resolve to the file's
actual installed location, derived from the plan's own file placements (no
hardcoded namespace literal, so the links cannot drift from where files land).
Non-namespacing adapters and links to non-installed targets are left untouched;
URLs, anchors, absolute paths, and fenced code blocks are never rewritten.

Fixes #2340

* fix(install): keep non-namespaced markdown on the byte-for-byte copy path

Address review feedback: the markdown branch in applyInstallPlan diverted every
copy-file markdown operation through read+rewrite+write, so identity-mapped
markdown (source path == install path, no namespace injected) lost byte-for-byte
content and source mode bits even though no link rewrite was needed.

Gate the rewrite on isNamespacedSource() so only files whose install path
actually changed (e.g. skills/x -> skills/ecc/x) leave the copyFileSync path;
everything else is copied verbatim as before.

* test(install): emit failure stack in the link-rewrite test runner

Address review feedback: the local test() harness logged only error.message,
so a failing assertion lost its source line and diff. Print error.stack on
stderr on failure so broken rewrite cases stay diagnosable.
2026-07-03 20:39:24 -07:00
..
ci fix(ci): unbreak main after dependabot batch (checkout SHA + lint) (#2393) 2026-06-29 18:31:59 -07:00
commands fix: accept crlf command frontmatter 2026-04-30 03:41:18 -04:00
docs release: 2.0.0 — the agent harness operating system 2026-06-09 21:40:40 -04:00
hooks fix(observer): replace hardcoded sleep 2 with PID file poll in start-observer.sh (#2356) 2026-07-03 20:38:37 -07:00
integration fix(hooks): avoid escaped quotes in plugin bootstrap 2026-05-19 05:15:42 -04:00
lib fix(install): rewrite relative skill links for injected ecc namespace (#2399) 2026-07-03 20:39:24 -07:00
scripts fix(tests): resolve 10 failing tests on Windows (#2307) 2026-06-29 15:54:49 -07:00
__init__.py Small changes 2026-04-12 12:34:45 +05:30
codex-config.test.js fix(codex): broaden context7 config checks 2026-03-29 00:26:16 -04:00
conftest.py docs: salvage focused stale PR contributions 2026-05-11 05:31:12 -04:00
opencode-config.test.js fix: namespace opencode command agents 2026-04-05 14:21:57 -07:00
opencode-plugin-hooks.test.js feat(opencode): 全面升级OpenCode集成 (#2251) 2026-06-15 14:01:34 -04:00
opencode-tools.test.js feat(opencode): 全面升级OpenCode集成 (#2251) 2026-06-15 14:01:34 -04:00
plugin-manifest.test.js fix: add plugin cache health check (#2249) 2026-06-15 14:01:25 -04:00
run-all.js feat: worktree-lifecycle service (deterministic conflict prediction + safe GC) (#2164) 2026-06-07 13:00:08 +08:00
test_astraflow_provider.py feat: add Astraflow provider support 2026-05-11 23:21:46 -04:00
test_atlas_provider.py feat: add Atlas Cloud as LLM/AI provider (#2279) 2026-06-18 16:29:11 -04:00
test_builder.py fix: docs/COMMAND-REGISTRY.json check fails on fresh Windows clone (missing .gitattributes) (#2437) 2026-07-03 20:14:55 -07:00
test_claude_provider.py docs: salvage focused stale PR contributions 2026-05-11 05:31:12 -04:00
test_executor.py Small changes 2026-04-12 12:34:45 +05:30
test_invariant_runner.py fix: sanitize subprocess call in runner.py (#2149) 2026-06-15 13:49:45 -04:00
test_provider_tools.py fix: harden openai-compatible provider responses 2026-05-18 01:04:28 -04:00
test_resolver.py feat: add Atlas Cloud as LLM/AI provider (#2279) 2026-06-18 16:29:11 -04:00
test_templates.py docs: salvage focused stale PR contributions 2026-05-11 05:31:12 -04:00
test_types.py feat: add Astraflow provider support 2026-05-11 23:21:46 -04:00