feat(audit): propagate 5 avoided patterns to sensor rules + Agent 5#8378
Merged
HydraOps-T-rav merged 3 commits intomainfrom Apr 21, 2026
Merged
feat(audit): propagate 5 avoided patterns to sensor rules + Agent 5#8378HydraOps-T-rav merged 3 commits intomainfrom
HydraOps-T-rav merged 3 commits intomainfrom
Conversation
added 3 commits
April 21, 2026 16:56
… Agent 5 Follow-up to #8377. The 5 new avoided-patterns entries need matching hooks in the two automated surfaces that consume the doc. Sensor enricher (src/sensor_rules.py) — 3 new Rule entries: - private-symbol-cross-module: pyright "_name is not accessed" trigger - logger-format-typeerror: TypeError on malformed format strings - dockerfile-python-constant-drift: Dockerfile* file-changed trigger (Skipped sensor rules for the two patterns that don't map cleanly to error/file triggers: "test helper duplicating conftest" and "hardcoded path list mirroring fs state" rely on diff analysis the sensor runtime doesn't do. Those remain covered by avoided-patterns.md + Agent 5 sweep.) Audit Agent 5 (.claude/commands/hf.audit-code.md) Phase 2 — 5 new detection bullets with concrete rg heuristics: - Underscore-prefixed names imported across modules - Test helpers duplicating conftest fixtures - logger.error(value) without format string - Hardcoded path lists mirroring filesystem state - _name for unused loop variables
PR #8374 added `phase_skills: dict[str, list[str]]` to HydraFlowConfig and each factory runner now reads `self._config.phase_skills` during prompt construction. PR #8376's prompt-audit harness uses a fake config object that raises AttributeError on unknown attributes; `phase_skills` wasn't added to it, so every audit_prompts fixture that invokes a runner's prompt builder failed with `AttributeError: phase_skills` under CI's full test run (the failures didn't surface in `make quality` because that target deselects some tests). Mirror the existing `required_plugins: list[str] = []` convention — both are allowlist fields that default to empty in the audit harness.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #8377. That PR added 5 new entries to `docs/agents/avoided-patterns.md` and a planner Step 8 self-audit. Per the doc's own "Adding a new avoided pattern" section, the remaining surfaces to wire are:
This PR does both.
Changes
`src/sensor_rules.py` — 3 new `Rule` entries
Skipped for the two patterns that don't map cleanly to error/file triggers:
Those remain covered by `avoided-patterns.md` + the planner Step 8 audit + Agent 5 sweep below.
`.claude/commands/hf.audit-code.md` Phase 2 — 5 new detection bullets
Each bullet includes a concrete `rg` heuristic so the audit agent can reliably scan:
Test plan
🤖 Generated with Claude Code