fix(scripts): treat an omitted agent model as harness-specific in the parity check

`normalizeAgent` rewrote the first `model:` frontmatter line when one was
present, so an agent that pins a model in one toolchain and omits it in another
normalized to different text and looked like body drift.

The bug is latent here rather than firing: every agent whose `.claude` copy
omits `model:` currently has a `.cursor` copy that omits it too. Pinning a
Cursor-only model on any of them turns the gate red for a non-reason —
reproduced by adding `model: composer-2.5-fast` to
`.cursor/agents/code-quality.md`, which fails before this change and passes
after it. The same defect was failing on seedit's master, where those Cursor
copies do pin a model.

Strip the frontmatter `model:` line instead of rewriting it. Scoping the strip
to the leading frontmatter block keeps a body line that begins with "model:"
comparable, so it is still reported as drift. Verified that injected body drift
is still caught.
This commit is contained in:
Tommaso Casaburi
2026-08-02 17:54:16 +02:00
parent 9caee7f831
commit 20f8bd902c
+10 -2
View File
@@ -62,9 +62,17 @@ function normalize(content) {
return out;
}
// Agents additionally differ by harness-specific model frontmatter.
// Agents additionally differ by harness-specific model frontmatter. Whether a
// model is pinned at all is harness-specific too: judgment-tier `.claude`
// agents omit `model:` so they inherit the session model, while their `.cursor`
// copies pin a Cursor-only model. Drop the line entirely rather than rewriting
// it, so a pinned model and an omitted one still compare equal. Only the
// leading frontmatter block is touched, so a body line beginning with "model:"
// is left alone.
function normalizeAgent(content) {
return normalize(content).replace(/^model:.*$/m, 'model: <toolchain-specific>');
return normalize(content).replace(/^---\n[\s\S]*?\n---\n/, (frontmatter) =>
frontmatter.replace(/^model:.*\n/m, ''),
);
}
function listFilesRecursive(dir) {