Skip to content

develop and fix-ci prompts: never modify linter (ruff, pyright, etc.) configuration without explicit request #89

Description

@monkut

Problem

The develop and fix-ci action prompts do not explicitly forbid modifying linter or type-checker configuration. When the agent encounters linter errors, type-checker complaints, or rule violations, it can be tempted to "fix" them by relaxing or disabling rules in pyproject.toml, .ruff.toml, pyrightconfig.json, .pre-commit-config.yaml, etc., rather than fixing the code.

This silently weakens the project's quality gates and is hard to spot in review.

Expected behaviour

Both DEVELOP_AGENT_PROMPT and FIXCI_AGENT_PROMPT must contain an explicit constraint:

Do not modify linter, formatter, or type-checker configuration (e.g. pyproject.toml [tool.ruff] / [tool.pyright] sections, .ruff.toml, pyrightconfig.json, .pre-commit-config.yaml, ESLint/Prettier configs) to silence errors. Always fix the code, not the config. The only exception is when the originating issue explicitly requests a configuration change.

The constraint should also forbid # noqa, # type: ignore, # pyright: ignore, and similar inline suppression comments unless the issue explicitly asks for them or there is a documented external blocker (e.g. a known third-party-stub bug).

Actual behaviour

Currently DEVELOP_AGENT_PROMPT (askcc/definitions.py:186-285) and FIXCI_AGENT_PROMPT (askcc/definitions.py:542-596) say:

  • develop: "Conform to the project's existing style, structure, and conventions" and "Make focused, minimal changes — do not refactor unrelated code"
  • fix-ci: "Apply minimal, targeted fixes — do not refactor unrelated code" and "For lint errors: run `uv run ruff format .` and `uv run ruff check --fix .`"

Neither prompt explicitly rules out relaxing config or sprinkling suppression comments, leaving the door open for the agent to take that shortcut.

Suggested fix

Add a new constraint section to both prompts. Example wording:

Configuration boundaries (do not cross unless the issue explicitly requests it):
- Do NOT modify linter, formatter, or type-checker config files
  (pyproject.toml [tool.ruff]/[tool.pyright]/[tool.mypy] sections, .ruff.toml,
  pyrightconfig.json, mypy.ini, .pre-commit-config.yaml, ESLint/Prettier configs)
  to silence errors. Fix the code, not the config.
- Do NOT add `# noqa`, `# type: ignore`, `# pyright: ignore`, `eslint-disable`,
  or similar inline suppression comments. Fix the underlying issue.
- The only exceptions are when the originating issue explicitly requests a
  configuration or rule change, or when a known third-party bug requires
  documented suppression — in which case add a comment explaining why.

For develop, place it next to the existing "Anti-rationalization" / "Security checklist" sections.
For fix-ci, place it just before "Fixing Failures" so it gates the entire fix loop.

Acceptance Criteria

  • DEVELOP_AGENT_PROMPT (in askcc/definitions.py) contains a Configuration boundaries section that explicitly forbids modifying linter/formatter/type-checker config files to silence errors
  • FIXCI_AGENT_PROMPT (in askcc/definitions.py) contains the same Configuration boundaries section, placed before the ## Fixing Failures heading
  • Both prompts list the specific config files/sections covered: pyproject.toml [tool.ruff]/[tool.pyright]/[tool.mypy], .ruff.toml, pyrightconfig.json, mypy.ini, .pre-commit-config.yaml, ESLint/Prettier configs
  • Both prompts forbid inline suppression comments: # noqa, # type: ignore, # pyright: ignore, eslint-disable
  • Both prompts document the narrow exceptions: (a) issue explicitly requests a config/rule change, or (b) documented third-party bug requires suppression with explanatory comment
  • tests/test_askcc.py contains a new TestConfigBoundaryConstraints test class (or equivalent) with assertions that the constraint strings exist in both prompts
  • FIXCI_AGENT_PROMPT is added to the imports in tests/test_askcc.py
  • uv run pytest passes (all existing + new tests green)
  • uv run ruff check passes with no issues
  • uv run pyright passes with 0 errors

Dependencies

None identified. The change is contained to askcc/definitions.py (prompt strings) and tests/test_askcc.py (new assertions). No external API, schema, or runtime behaviour changes.

Implementation Plan

  1. Add Configuration boundaries block to DEVELOP_AGENT_PROMPT (askcc/definitions.py:186-285)

    • Insert the new block between the existing Security checklist section (ends ~line 260) and the PR description section (starts ~line 262).
    • Use the wording from the "Suggested fix" code block above. Keep the heading exactly Configuration boundaries (do not cross unless the issue explicitly requests it): so tests can assert on it.
  2. Add the same Configuration boundaries block to FIXCI_AGENT_PROMPT (askcc/definitions.py:542-596)

    • Insert the new block between the ## Identifying CI Failures section (ends after Categorize the failures at ~line 575) and the ## Fixing Failures heading (~line 576), as a top-level ## Configuration boundaries Markdown section so it gates the entire fix loop.
    • Use identical wording to the develop prompt for consistency, adjusting only the heading style to match the ## Section Markdown format used elsewhere in FIXCI_AGENT_PROMPT.
  3. Add unit tests in tests/test_askcc.py

    • Add FIXCI_AGENT_PROMPT to the from askcc.definitions import (...) block at tests/test_askcc.py:13-20.
    • Add a new test class TestConfigBoundaryConstraints (placed after TestReviewprPromptMergeGuard near line 282) with at minimum the following test methods:
      • test_develop_prompt_includes_config_boundaries_heading — asserts Configuration boundaries substring is present in DEVELOP_AGENT_PROMPT.
      • test_develop_prompt_forbids_modifying_linter_config — asserts pyproject.toml, [tool.ruff], [tool.pyright], .pre-commit-config.yaml mentions and the phrase Fix the code, not the config. appear in DEVELOP_AGENT_PROMPT.
      • test_develop_prompt_forbids_inline_suppression_comments — asserts # noqa, # type: ignore, # pyright: ignore, eslint-disable all appear in DEVELOP_AGENT_PROMPT.
      • test_develop_prompt_documents_exceptions — asserts the wording about "issue explicitly requests" and "third-party bug" exception appears in DEVELOP_AGENT_PROMPT.
      • Mirror the four assertions above for FIXCI_AGENT_PROMPT.
  4. Verification gate (run from worktree root):

    • uv run pytest — expect all tests to pass, including the new TestConfigBoundaryConstraints class.
    • uv run ruff check — expect no issues.
    • uv run pyright — expect 0 errors.
    • Record results in the PR description under a ## Verification section per the develop prompt's existing requirement.
  5. Open PR

    • Branch name: feature/89-config-boundary-prompts (or similar).
    • PR title: :bug: Forbid linter/type-checker config relaxation in develop and fix-ci prompts (closes #89)
    • Body: standard Summary / Verification / Key Flows sections. The change is prompt-string-only, so a Key Flows mermaid diagram can be skipped per the develop prompt guidance for trivial changes.

Risks or open questions

  • Wording fidelity: The exact constraint text needs to match between both prompts and the tests. Recommend extracting the block into a module-level constant (e.g. CONFIG_BOUNDARIES_CONSTRAINT) and concatenating it into both prompts so the two stay in sync. This is a small refactor but reduces drift risk.
  • Heading style mismatch: DEVELOP_AGENT_PROMPT uses prose-style section headers (Anti-rationalization — do not take these shortcuts:), while FIXCI_AGENT_PROMPT uses Markdown ## Section headings. The plan above accounts for this, but the shared-constant approach (above) needs a small heading-prefix adjustment per prompt.
  • No behavioural change at runtime: Only prompt strings sent to downstream Claude agents change. There is no migration, no API change, no settings change.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions