Commit Graph
5 Commits
Author SHA1 Message Date
affaan-m de5119dcb6 fix(locale): reject missing canonical agent declarations
Preserve contributor history while applying the exact reviewed current-main repair.

Source-PR: https://github.com/affaan-m/ECC/pull/2879
Source-Parent: cc9914ce77
Review-Manifest-SHA256: d561b12170431bc2f5ec9baa80548a656fca9e55b4bb6b11bd756be4e6cab199
2026-09-28 05:11:01 -04:00
Nguyen Thanh Dat 787154775e test(locale-agents): set process.exitCode so the summary always flushes
Review feedback on #2879. stdout is async when it is a pipe, which is exactly
how tests/run-all.js runs these files, and process.exit() does not wait for
pending writes — so exiting that way can drop the Passed:/Failed: lines the
aggregator totals, defeating the point of printing them. The sibling
tests/ci/ito-*-skill.test.js files already use process.exitCode.

Still exits 1 on drift and 0 when clean.
2026-08-25 18:35:26 +07:00
Nguyen Thanh Dat 5f79c39687 test(locale-agents): derive the file lists instead of accumulating them
Review feedback on #2879, citing rules/common/coding-style.md ("Immutability
(CRITICAL): ALWAYS create new objects, NEVER mutate existing ones"). Build one
list of locale entries, then derive the matched and orphaned sets from it with
filter/map, and build the canonical Map the same way.

Behaviour is unchanged and both mutations still fail: reintroducing the drift in
one locale file gives `Passed: 4, Failed: 3`, an orphan gives `Passed: 6,
Failed: 1`, both exit 1.
2026-08-25 18:34:12 +07:00
Nguyen Thanh Dat 4f18d1eb87 test(locale-agents): fail on a locale doc whose agent no longer exists
Review feedback on #2879: a locale file with no counterpart in `agents/` was
skipped, so every other case here silently passed over it. Retiring an agent
would leave its seven translations behind with nothing to compare against and
nothing to report it.

Collect those files while building the list and assert the collection is empty.
Zero today across 199 locale docs, so this changes no current result; planting
one orphan takes the file to `Passed: 6, Failed: 1` and exit 1.
2026-08-25 18:04:38 +07:00
Nguyen Thanh Dat 3afd97b4aa fix(docs): stop translated agent docs from contradicting the shipped agent
`scripts/ci/validate-agents.js` reads only `agents/`, so the translated copies
under `docs/<locale>/agents/` were never validated against the agent they
describe — and drifted.

Two kinds of drift, both machine-checkable and both wrong in the same
direction (the translations were made from an older revision and never
re-synced):

- **Model tier, 39 files.** Every one names a costlier tier than ships:
  haiku -> sonnet, sonnet -> opus. `security-reviewer` reads `opus` in ja-JP
  and zh-TW; it ships `sonnet`.
- **Tool set, 15 files.** `security-reviewer` and `database-reviewer` list
  `Write` and `Edit` in **all seven locales** — both agents ship read-only
  (`Read, Grep, Glob, Bash`). `seo-specialist` in zh-CN adds a `Bash` the
  canonical agent does not have. Documenting a reviewer as able to write is
  the kind of inaccuracy someone auditing what these agents can touch would
  act on.

Sync `model` and the `tools` set to canonical, preserving each locale's
existing list style so the diff is only the values that were wrong. The
`["a", "b"]` vs `a, b` formatting difference is left alone: it is consistent
per locale and carries no meaning.

Add `tests/ci/locale-agent-frontmatter.test.js` so this cannot drift back.
`tools` is compared as a set, not a string, so the style difference stays
legal; prose is not compared at all. The last case pins the specific failure:
a canonical read-only agent may never be documented with Write or Edit.

`.kiro/agents/` is deliberately excluded — it uses a different schema
(`allowedTools: [read, shell]`, no `model`), not a translation of this one.
2026-08-25 17:39:43 +07:00