[rig-eslint] Add repair-no-args ESLint rule#131
Conversation
Generators repeatedly write repair({ maxTurns: 3 }) which is not accepted
by the API — repair() takes no arguments and maxTurns belongs on the agent
spec. The rule detects this pattern and strips the arguments.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
| } | ||
| } | ||
|
|
||
| for (let index = 0; index <= tokens.length - 3; index += 1) { |
There was a problem hiding this comment.
@copilot keep lint.js generic and move rule specific code in the rule file
There was a problem hiding this comment.
Updated in a8c197a. skills/rig/eslint/lint.js is now generic and delegates rule-specific token scanning/fix edits to the rule files (no-object-literal-record.js and repair-no-args.js).
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅ |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd and /codebase-design — one minor suggestion, otherwise approving.
📋 Key Themes & Highlights
Key Themes
- Problem shape inconsistency:
no-object-literal-recordproblems lack akindfield whilerepair-no-argsproblems setkind: "repair-no-args". Future rules and callers need a consistent discriminant to filter by rule — suggest addingkind: "no-object-literal-record"to match the new convention.
Positive Highlights
- ✅ Clean refactor of
lint.js— per-rulescanTokensdelegation is a great seam for adding future rules - ✅ Well-structured test suite: valid, invalid, idempotency, and ESLint-alignment tests are all present
- ✅
.method-call guard (tokens[index-1]?.value === ".") correctly excludesfoo.repair()from flagging - ✅ Autofix is semantics-preserving —
repair()is provably zero-argument
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 42.5 AIC · ⌖ 4.21 AIC · ⊞ 6.3K
Comment /matt to run again
| message: "Wrap object-valued record fields with s.object(...).", | ||
| edits: [ | ||
| { start: object.start, text: "s.object(" }, | ||
| { start: tokens[closingIndex].end, text: ")" }, |
There was a problem hiding this comment.
[/codebase-design] no-object-literal-record problems lack a kind field while repair-no-args problems include kind: "repair-no-args". This asymmetry means callers have no consistent way to filter problems by rule.
💡 Suggested fix
Add kind to the problem shape in no-object-literal-record.js:
problems.push({
kind: "no-object-literal-record",
start: object.start,
end: tokens[closingIndex].end,
message: "Wrap object-valued record fields with s.object(...).",
edits: [...],
});Tests can then filter symmetrically, just like the new repair-no-args tests do.
Recurring mistake
Rig code generators repeatedly write
repair({ maxTurns: 3 }), passing arguments torepair()which accepts none. ThemaxTurnsoption belongs on the agent spec, not on the addon call.This pattern was identified explicitly as a lint rule candidate in run 30151480947 and confirmed in runs 30145047695 and 30150181357 of the
Daily Rig Task Generatorworkflow.Evidence
Run 30151480947 (2026-07-25):
Run 30145047695 (2026-07-25):
Run 30150181357 (2026-07-25):
Generated code in 3 tasks used
addons: repair()(correct), but the evaluation log notes themaxTurnsconfusion pattern aroundrepair()configuration.Why the autofix is safe
repair()is a zero-argument function. Any arguments passed to it are silently incorrect — TypeScript will also flag this at typecheck time. Stripping the arguments to producerepair()is always semantics-preserving: the only correct form isrepair()with no arguments.Code examples
Invalid:
Fixed:
Four integration points
skills/rig/eslint/rules/repair-no-args.js— new ESLint rule moduleskills/rig/eslint/index.js— exports the new rule as"repair-no-args"skills/rig/eslint/lint.js— dependency-free tokenizer-based detection and autofix added tolintSource/fixSourcesrc/eslint-rules.test.js— invalid, fixed, valid, edge-case, idempotency, and ESLint-rule-alignment coverageValidation