Repository navigation
develop and fix-ci prompts: never modify linter (ruff, pyright, etc.) configuration without explicit request #89
Copy link
Copy link
Closed
Labels
action:reviewIssue is ready for reviewIssue is ready for reviewenhancementNew feature or requestNew feature or request
Description
Activity
added on Apr 27, 2026
action:planIssue is ready for planningIssue is ready for planning
enhancementNew feature or requestNew feature or request
Plan summary
Updated the issue description with finalized Acceptance Criteria, Dependencies, and Implementation Plan sections, and assigned the issue.
What changed in the description
- Acceptance Criteria — promoted from the original draft (
## Acceptance criteria) into a finalized## Acceptance Criteriachecklist. Expanded from 6 → 10 verifiable items, naming the test class, the new import intests/test_askcc.py, and the three verification commands (uv run pytest,uv run ruff check,uv run pyright). - Dependencies — new
## Dependenciessection. None identified; the change is contained toaskcc/definitions.pyprompt strings andtests/test_askcc.pyassertions, with no runtime/API/schema impact. - Implementation Plan — new
## Implementation Plansection with five steps: insert theConfiguration boundariesblock intoDEVELOP_AGENT_PROMPT(between the existing Security checklist and PR description sections inaskcc/definitions.py:186-285), insert the same block intoFIXCI_AGENT_PROMPT(before## Fixing Failuresinaskcc/definitions.py:542-596) with## SectionMarkdown style to match its surrounding format, add aTestConfigBoundaryConstraintstest class plus aFIXCI_AGENT_PROMPTimport intests/test_askcc.py, run the three verification commands, and open the PR.
Risks / open questions
- Drift risk between the two prompts. The constraint text must stay identical in both prompts and in the test assertions. Recommend extracting the block into a module-level constant (e.g.
CONFIG_BOUNDARIES_CONSTRAINT) and concatenating it into both prompts. Flagged in the issue's "Risks or open questions" section — happy to take guidance either way; default is to use the shared constant. - Heading style mismatch.
DEVELOP_AGENT_PROMPTuses prose section headers (Anti-rationalization — do not take these shortcuts:) whileFIXCI_AGENT_PROMPTuses Markdown## Sectionheadings. The plan accommodates both; the shared-constant approach above needs a small per-prompt heading prefix. - No behavioural runtime change. Only the prompt strings sent to downstream Claude agents are modified — no migration, settings change, or public API change.
Ready for /develop once the drift-mitigation question is decided (or proceed with the shared-constant default).
:tokens-used: model: N/A, input: 25, output: 9145
added on Apr 27, 2026
action:developIssue is ready for developmentIssue is ready for development
and removed action:planIssue is ready for planningIssue is ready for planning
Implementation summary
PR #91 implements the Configuration boundaries constraint described in this issue.
Changes
-
askcc/definitions.py:- Added a shared
CONFIG_BOUNDARIES_BODYconstant containing the bullet-list constraint text (forbids modifyingpyproject.toml [tool.ruff]/[tool.pyright]/[tool.mypy],.ruff.toml,pyrightconfig.json,mypy.ini,.pre-commit-config.yaml, ESLint/Prettier configs, and adding# noqa/# type: ignore/# pyright: ignore/eslint-disablecomments — plus the documented narrow exceptions). - Composed the body into
DEVELOP_CONFIG_BOUNDARIES(prose-style heading matching the rest ofDEVELOP_AGENT_PROMPT) andFIXCI_CONFIG_BOUNDARIES(Markdown##heading matchingFIXCI_AGENT_PROMPT's style). - Inserted
DEVELOP_CONFIG_BOUNDARIESbetween the existingSecurity checklistandPR descriptionsections inDEVELOP_AGENT_PROMPT. - Inserted
FIXCI_CONFIG_BOUNDARIESbetween## Identifying CI Failuresand## Fixing FailuresinFIXCI_AGENT_PROMPTso it gates the entire fix loop.
- Added a shared
-
tests/test_askcc.py:- Imported
FIXCI_AGENT_PROMPT. - Added
TestConfigBoundaryConstraintsclass with 9 assertions covering: theConfiguration boundariesheading, the specific config files listed, the forbidden inline suppression comments, the documented exceptions, and the placement of the boundaries block before## Fixing Failuresin the fix-ci prompt.
- Imported
Drift mitigation
Followed the "shared constant" recommendation from the plan — both prompts derive from the same CONFIG_BOUNDARIES_BODY string, so the wording cannot drift.
Verification
uv run pytest— 195 passed (9 new tests inTestConfigBoundaryConstraints)uv run ruff check— All checks passeduv run pyright— 0 errors, 0 warnings
:tokens-used: model: N/A, input: 52, output: 20454
added on Apr 27, 2026
action:reviewIssue is ready for reviewIssue is ready for review
and removed action:developIssue is ready for developmentIssue is ready for development
added a commit that references this issue on Apr 27, 2026
Metadata
Metadata
Assignees
Labels
action:reviewIssue is ready for reviewIssue is ready for reviewenhancementNew feature or requestNew feature or request
Problem
The
developandfix-ciaction 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 inpyproject.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_PROMPTandFIXCI_AGENT_PROMPTmust contain an explicit constraint: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) andFIXCI_AGENT_PROMPT(askcc/definitions.py:542-596) say: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:
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(inaskcc/definitions.py) contains aConfiguration boundariessection that explicitly forbids modifying linter/formatter/type-checker config files to silence errorsFIXCI_AGENT_PROMPT(inaskcc/definitions.py) contains the sameConfiguration boundariessection, placed before the## Fixing Failuresheadingpyproject.toml [tool.ruff]/[tool.pyright]/[tool.mypy],.ruff.toml,pyrightconfig.json,mypy.ini,.pre-commit-config.yaml, ESLint/Prettier configs# noqa,# type: ignore,# pyright: ignore,eslint-disabletests/test_askcc.pycontains a newTestConfigBoundaryConstraintstest class (or equivalent) with assertions that the constraint strings exist in both promptsFIXCI_AGENT_PROMPTis added to the imports intests/test_askcc.pyuv run pytestpasses (all existing + new tests green)uv run ruff checkpasses with no issuesuv run pyrightpasses with 0 errorsDependencies
None identified. The change is contained to
askcc/definitions.py(prompt strings) andtests/test_askcc.py(new assertions). No external API, schema, or runtime behaviour changes.Implementation Plan
Add
Configuration boundariesblock toDEVELOP_AGENT_PROMPT(askcc/definitions.py:186-285)Security checklistsection (ends ~line 260) and thePR descriptionsection (starts ~line 262).Configuration boundaries (do not cross unless the issue explicitly requests it):so tests can assert on it.Add the same
Configuration boundariesblock toFIXCI_AGENT_PROMPT(askcc/definitions.py:542-596)## Identifying CI Failuressection (ends afterCategorize the failuresat ~line 575) and the## Fixing Failuresheading (~line 576), as a top-level## Configuration boundariesMarkdown section so it gates the entire fix loop.## SectionMarkdown format used elsewhere inFIXCI_AGENT_PROMPT.Add unit tests in
tests/test_askcc.pyFIXCI_AGENT_PROMPTto thefrom askcc.definitions import (...)block attests/test_askcc.py:13-20.TestConfigBoundaryConstraints(placed afterTestReviewprPromptMergeGuardnear line 282) with at minimum the following test methods:test_develop_prompt_includes_config_boundaries_heading— assertsConfiguration boundariessubstring is present inDEVELOP_AGENT_PROMPT.test_develop_prompt_forbids_modifying_linter_config— assertspyproject.toml,[tool.ruff],[tool.pyright],.pre-commit-config.yamlmentions and the phraseFix the code, not the config.appear inDEVELOP_AGENT_PROMPT.test_develop_prompt_forbids_inline_suppression_comments— asserts# noqa,# type: ignore,# pyright: ignore,eslint-disableall appear inDEVELOP_AGENT_PROMPT.test_develop_prompt_documents_exceptions— asserts the wording about "issue explicitly requests" and "third-party bug" exception appears inDEVELOP_AGENT_PROMPT.FIXCI_AGENT_PROMPT.Verification gate (run from worktree root):
uv run pytest— expect all tests to pass, including the newTestConfigBoundaryConstraintsclass.uv run ruff check— expect no issues.uv run pyright— expect 0 errors.## Verificationsection per the develop prompt's existing requirement.Open PR
feature/89-config-boundary-prompts(or similar).:bug: Forbid linter/type-checker config relaxation in develop and fix-ci prompts (closes #89)Risks or open questions
CONFIG_BOUNDARIES_CONSTRAINT) and concatenating it into both prompts so the two stay in sync. This is a small refactor but reduces drift risk.DEVELOP_AGENT_PROMPTuses prose-style section headers (Anti-rationalization — do not take these shortcuts:), whileFIXCI_AGENT_PROMPTuses Markdown## Sectionheadings. The plan above accounts for this, but the shared-constant approach (above) needs a small heading-prefix adjustment per prompt.