Skip to content

hygiene: add a tokens mode; make the skill line-count CI step blocking - #601

Merged
Jammy2211 merged 1 commit into
mainfrom
claude/pyautomind-queue-management-j03m2k
Nov 7, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
claude/pyautomind-queue-management-j03m2k

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

This PR does two things for PyAutoMind draft/maintenance/organs/reduce_session_token_load.md, now that #597 and #600 are merged:

  • it adds the hygiene report line that prompt asked for;
  • it makes the skill line-count budget a blocking CI step.

What changed

  • pyauto-brain hygiene tokens (new mode, backed by agents/conductors/hygiene/_hygiene_tokens.py). It reports one finding row that combines two measurements that already exist:

    • the violations from PyAutoMind scripts/token_load.py;
    • the skills that bin/check_skill_line_counts.sh finds over 200 lines.

    The count is how many budgets are broken. A file the scan root simply lacks is listed but not counted. With no Mind checkout the row is advisory, never clean. Breaches route to /refactor. The mode also joins the default ranked scan. --detail (the human-readable mode) lists each breach.

  • .github/workflows/tests.yml: the skill line-count step loses continue-on-error, so it now fails the PR when a skill goes over budget. It checks Brain's skills only. Mind is also checked out in this CI, and a Mind skill must not turn a Brain PR red, which is the same rule the firewall step's --only follows.

  • bin/check_skill_line_counts.sh: takes an optional list of repos after the limit (... 200 PyAutoBrain). With no list it behaves as before.

  • Docs: the hygiene conductor's AGENTS.md (mode table, usage, ranking list) and skills/hygiene/hygiene.md list the new mode.

Evidence

  • python3 -m pytest -q -n auto tests: 1645 passed, 1 skipped. Two new tests:
    • the row is advisory when there is no Mind checkout;
    • a stub token_load.py reporting one breach and one absent file gives count 1, and the detail lists both.
  • On the real checkouts (Brain, Mind, Cortex, Memory): hygiene tokens reports clean, 0 budgets broken. The numbers it shows:
    • start_dev 360 and prm 338 procedure lines;
    • four organs' AGENTS.md about 8,688 tokens;
    • completion-record median 53 lines.
  • check_skill_line_counts.sh: all 40 skills within budget unscoped, 38 when scoped to Brain. Scoping to Mind with a limit of 100 correctly flags one skill.
  • install.sh --check-project-discovery: Brain, Mind and Memory OK (the Memory fix is PyAutoLabs/PyAutoMemory, linked from the Mind ledger).

Decision taken

Scoping the blocking step to Brain's own skills was my choice; the prompt didn't settle it. Without it, a Mind skill that grew past 200 lines would merge green in Mind, because Mind's CI doesn't run this check, and then turn every Brain PR red.

Not checked

  • This PR's own CI run is the first run of the now-blocking step on GitHub.
  • The Brain board's rendering of the new row was not looked at. The row has the same JSON shape as the existing ones.

Generated by Claude Code

`pyauto-brain hygiene tokens` reads the organism's token-load budgets as
a finding: PyAutoMind scripts/token_load.py violations (four-organ
AGENTS.md tokens, start_dev / prm procedure lines) plus skills whose
SKILL.md + body exceed 200 lines. A file the scan root lacks is listed,
not counted; with no Mind checkout the row is advisory, never clean.
Breaches route to /refactor. It joins the default ranked scan. This is
the hygiene report line PyAutoMind
draft/maintenance/organs/reduce_session_token_load.md asked for.

With #597 and #600 merged every skill is within 200 lines, so the
tests.yml line-count step drops `continue-on-error`. It is scoped to
Brain's own skills (check_skill_line_counts.sh now takes an optional
repo list) so a Mind skill cannot redden a Brain PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016nhQ8NoTm1hEGXkFTcNwbd
@Jammy2211
Jammy2211 merged commit 718f9a9 into main Nov 7, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the claude/pyautomind-queue-management-j03m2k branch November 7, 2026 15:44
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.

2 participants