chore: add retoor header to all devplacepy source files and update style agent header rule

The diff adds the mandatory `retoor <retoor@molodetz.nl>` header comment to every `.py` file under `devplacepy/` (including `__init__.py` and `routers/__init__.py`), and updates the `StyleAgent` in `agents/style.py` to instruct agents to only add the header on created or already-edited files rather than sweeping the entire repo. The `agents/base.py` operating protocol is also revised to reorder and clarify tool discipline rules.
This commit is contained in:
2026-06-11 23:58:46 +00:00
parent fd64a6f1a7
commit 7fc9b0f715
127 changed files with 267 additions and 25 deletions
+4 -3
View File
@@ -32,9 +32,10 @@ ABSOLUTE EXCLUSION (NON-NEGOTIABLE): The `agents/` directory is the maintenance
OPERATING PROTOCOL
1. PLAN FIRST. Your VERY FIRST tool call MUST be plan() with goal, steps, success_criteria, and confidence.
2. INVESTIGATE BEFORE CONCLUDING. Use grep, glob_files, list_dir, find_symbol, read_file, read_lines, and retrieve to gather evidence. Never assume a violation; confirm it against the source.
3. ONE report_finding PER ISSUE. Every confirmed issue MUST be recorded with report_finding(dimension, severity, message, file, line, rule). Do not describe issues only in prose.
4. SHARD WIDE. The codebase is large. Work through the scope units below one at a time. You MAY call delegate(task) to investigate an independent unit in a fresh context and fold its result back in.
5. STAY IN YOUR LANE. Only this dimension. Record an unrelated problem at most as a single info finding.
3. TOOL DISCIPLINE. Use the structured grep tool for pattern detection; do NOT shell out with run_command to scan, lint, or loop over files (run_command is for verify only). For a grep-able check (a character, a name, a header line) grep; do not read a whole file, and never read a large file (over ~400 lines) just to look for a pattern - grep it or read_lines the relevant range. Never repeat a grep or re-read a file you already read this run.
4. ONE report_finding PER ISSUE. Every confirmed issue MUST be recorded with report_finding(dimension, severity, message, file, line, rule). Do not describe issues only in prose.
5. SHARD WIDE. The codebase is large. Work through the scope units below one at a time. You MAY call delegate(task) to investigate an independent unit in a fresh context and fold its result back in.
6. STAY IN YOUR LANE. Only this dimension. Record an unrelated problem at most as a single info finding. Respect "refactor only what you touch": do NOT mass-rewrite pre-existing files for a cosmetic rule they never followed; that is noise, not maintenance.
{mode_rules}
+6 -3
View File
@@ -22,8 +22,11 @@ class StyleAgent(MaintenanceAgent):
"- pathlib instead of the os module for paths.\n"
"- A fixed-key dict that should be a dataclass.\n"
"- No version pinning anywhere (pyproject, requirements, or inline).\n"
"- The mandatory `retoor <retoor@molodetz.nl>` header as the first line, in the correct comment style, except "
"where a shebang must lead.\n"
"- The mandatory `retoor <retoor@molodetz.nl>` header on files you CREATE or are otherwise already editing. "
"Do NOT sweep the whole repo adding headers: many pre-existing application files were authored without one, "
"and mass-inserting headers into dozens of untouched files is exactly the noise the 'refactor only what you "
"touch' rule forbids. If files lack the header, record at most ONE info finding stating the count, and never "
"auto-edit a file solely to add a header.\n"
"- No magic numbers; named constants instead. No warnings.\n\n"
"FIX: rename the symbol to an intent-revealing name, strip the stray comment or docstring, replace the em-dash, "
"add the type annotation, convert os.path to pathlib, convert the dict to a dataclass, remove the version pin, add "
@@ -34,7 +37,7 @@ class StyleAgent(MaintenanceAgent):
def scope_units(self) -> list[tuple[str, str]]:
return [
("forbidden-names", "devplacepy/**/*.py forbidden naming prefixes/suffixes"),
("headers", "every source file starts with the retoor header in the right comment style"),
("headers", "retoor header on created/edited files only; one info finding for pre-existing files that lack it, never a mass sweep"),
("em-dash", "no em-dash character or its HTML entities in any touched file"),
("typing", "Python function signatures and variables fully typed"),
("pathlib", "pathlib over the os module; no magic numbers; no version pinning"),