Files
ECC/tests/scripts
zakyirsyaad 93e6475420 fix(qwen): publish the adapter, handle CRLF, reject unknown flags
Three review findings, all verified before fixing.

1. Publish surface (blocking). package.json `files` lists
   scripts/gemini-adapt-agents.js but not this script, so the npm tarball
   omitted it and ecc-universal users hit MODULE_NOT_FOUND. Added to `files`
   and to the allowlist in tests/scripts/npm-publish-surface.test.js, which now
   passes 2/2.

2. CRLF agents were silently skipped. The frontmatter regex matched LF only, so
   a Windows-saved agent was reported as 'already compatible' while still
   carrying tools: Read, Bash and color: teal -- a success message with no
   adaptation. Normalize to LF, adapt, then restore the original ending style.
   Reproduced before and after: the same CRLF fixture went from 'Updated 0' with
   Read/teal intact to 'Updated 1' with read_file/cyan and CRLF preserved.

3. Unknown flags were discarded. Because the script rewrites files in place,
   `--dry-run` rewrote every installed agent and exited 0. parseArgs now throws
   on any unrecognized option before a directory is selected.

Tests: 12/12 (added CRLF preservation and no-mutation-on-unknown-flag),
gemini-adapt-agents 4/4 unaffected, npm-publish-surface 2/2. Re-run against all
68 canonical definitions: 68 updated, second run 0 updated, no Claude-shaped
frontmatter remaining, no spurious CRLF introduced.

Note: findings 2 and 3 apply equally to scripts/gemini-adapt-agents.js, which
has the same LF-only regex and the same flag filter. Left unchanged here to keep
this PR scoped to the Qwen adapter; worth a follow-up.
2026-10-09 13:46:34 +07:00
..