Skip to content

Add no-invalid-agent-fields and enum-return-needs-as-const lint rules - #257

Merged
pelikhan merged 2 commits into
mainfrom
copilot/rig-tasks-daily-evaluation-2026-07-28-again
Jul 28, 2026
Merged

Add no-invalid-agent-fields and enum-return-needs-as-const lint rules#257
pelikhan merged 2 commits into
mainfrom
copilot/rig-tasks-daily-evaluation-2026-07-28-again

Conversation

Copilot AI commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Two friction points identified in the daily rig evaluation: misspelled agent() spec keys are silently dropped at runtime, and bare string literal returns in defineTool handlers widen to string, causing type errors at the schema comparison site rather than the return site.

New rules

rig/no-invalid-agent-fields

Flags unknown keys on the agent({...}) spec object. TypeScript's excess property checking doesn't reliably catch these.

// Flagged — silently ignored at runtime
agent({ instructions2: p`Review the diff.` })

// Valid fields: name, instructions, input, output, model,
//               maxTurns, addons, agents, systemMessage, tools
agent({ instructions: p`Review the diff.` })

Available in both the tokenizer-based standalone linter (lint.js) and the ESLint plugin. No autofix.

rig/enum-return-needs-as-const

Flags bare string literal returns inside handler: bodies that lack as const.

// Flagged — TypeScript widens "stable" to string
handler: ({ risk }) => { return "stable"; }

// Fixed (autofix available)
handler: ({ risk }) => { return "stable" as const; }

ESLint-plugin only — the tokenizer cannot track scope to limit checks to handler: bodies.

Documentation

  • references/linting.md: added rule docs with examples for both rules
  • SKILL.md: addons: repair()addons: [repair()] for consistency with the array form; added composition invariants for valid agent fields and the as const requirement

… rules

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Daily rig evaluation for July 28, 2026 Add no-invalid-agent-fields and enum-return-needs-as-const lint rules Jul 28, 2026
Copilot AI requested a review from pelikhan July 28, 2026 16:31
@pelikhan
pelikhan marked this pull request as ready for review July 28, 2026 19:33
@pelikhan
pelikhan merged commit 4a97295 into main Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[rig-tasks] Daily rig evaluation — 2026-07-28 — 10/10 passed

2 participants