Repository navigation
declare behaviour failure patterns once and generate their catalog (P196) - #1736
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BehaviourPattern members name their signature in state, the existing checks that enforce them (a StandingRule member, or a verb or tool refusal located from source so the catalog never imports the commander verbs, which open the installed bus), and where each was learned. docs/agents/behaviour-catalog.md is BehaviourPattern.catalog(); the family test fails when they differ. Src-Budget: 220 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…robes Src-Budget: 260 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Src-Budget: 260 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
….ProblemOrder Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every commander module bound CONFIG, ME, COMMS and path strings at import, so importing commander/order.py read commander.json and opened the installed bus. CommanderConfig.installed() already owns the installed facts; it now also owns the bus (comms), the activity log, the forks directory and the default review catch, and every use reads it when the verb runs. The module globals, the order/capacity import cycle and the test reloads that rebound them are deleted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tests that read script.CONFIG, script.COMMS or judge.CONFIG read the installed config; tests that replaced a module's CONFIG write the changed config the way install does. strike takes who caught the miss explicitly, and tool_watch now passes the struck task, which P194's signature change had left as the reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
commander/order.py imports without opening the bus, so a refusal check holds the function or class itself. The module and qualname strings, the ast re-parse and the exists() probe it needed are deleted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each of the Codex postmortem's ten failures is a PostmortemFailure member with its number and title; a pattern cites an instance, and the catalog lists the declared members instead of range(1, 11). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r incarnation Functions that read the installed config more than once bind it at their top. The commander's incarnation, read through the registry at 15 sites, is a CommanderConfig property. Lines the longer reads pushed past 100 columns are wrapped, so the commander files carry the base's lint count. The budget covers the catalog module (300 lines) and the commander package's net 59. Src-Budget: 359 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…atalog # Conflicts: # src/agent_comms/commander/order.py
Seed patterns 1 (report instead of state, P198), 4 (wrong measure, P197), 15 (commander overloaded, P199), 16 (dead provider, P200) and 18 (unowned work, P201) are members with their seed ID as a SeedCatalog source. Each holds a PendingCheck naming the open problem whose change adds its check, so those changes join an existing member. Src-Budget: 419 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remove the catalog's commander verb imports and cite the existing check owners directly. Derive postmortem coverage without a names roster. Keep the five seed declarations and distinguish their missing enforcement, including the two closed unmerged implementations. Verify regeneration without commander configuration and reject hand-edited output.
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.
Outcome
Each behaviour-failure pattern is one
BehaviourPatternsubclass. Its signature, existing check objects and source citations live on that class.DeclaredFamily/AutoRegisterMetaowns membership; class objects identify patterns, and document headings derive from their declarations. There is no pattern-name roster, identity switch or second registry.docs/agents/behaviour-catalog.mdis generated; the equality check rejects any hand edit.There are 14 pattern declarations: nine existing-check patterns and the five seeded declarations from
1e6e032b2. Adding a pattern is one class and regeneration.What remained, and what changed
a0ef47d8c, then011084fc5, then5cdac561d(main advanced during work); no rebase or force-push. Pushed head:52c6fd36e6a6e0432479cbe852fb9469617a41bc.src/agent_comms/commander/{config,judge,order,rules,send_guard,tool_watch}.py,tests/test_commander_problem_orders.py,tests/test_commander_run_rules.py. Preserved main's current owners throughout the commander family and its tests. The PR now changes only the catalog module, generated document and catalog tests. No commander configuration/lifecycle migration remains in this PR; that work has a separate owner in P701: commander commands use explicit root-bound context #1912.PlainText,StorageStrikeTodo.repeats,Todo.struck_on_order,TodoStore.apply,VoidStrikeTodo.apply,OrderCheck.parse, and the printed-count members.NoIntegerPrintednow comes from its actual owner,child_process.not enforced here, rather than claiming those changes landed. Completing those independent implementations is not claimed by P196.Ownership/source evidence
Before: catalog imports
commander.order; references wrapper functions; import-time commander configuration changes spill across 16 commander/test files. Postmortem coverage materializes a dictionary of lists of pattern-name strings.After:
BehaviourPatternownssection()andcatalog(), each leaf owns its facts, the existing declared-family mechanism supplies membership, and coverage walks class references directly. Onlytests/test_behaviour_catalog.pyimports the catalog module; the module's__main__is the generation entrypoint.Used the existing refactor-audit
Package/ParsedModuletooling under Python 3.14 for the source census: 383 production modules, 477 test modules, 34 tool modules; no parse omissions. Inspected declarations, imports, field writes, decisions and consumers; all 14 pattern classes declare their own signature/checks/sources. Also parsed all nine installedmetaclass_registrymodules and readAutoRegisterMeta.__new__plus Core's_FamilyMeta/DeclaredFamilyregistration path. Dynamic import binding is not established by this syntax query; this catalog uses direct imports and class references. The initial NRA import lackedtree_sitterin Core's environment, and NRA's own Python 3.12 could not parse Core's syntax; those attempts are not presented as completed scans. The Python 3.14 refactor-audit census had zero omissions. Applicable catalog precedents: MEMB-1, MEMB-4 and AGENT-2.Reproduce owner/consumer search:
Requested new-case proof
Added only this temporary sixth seeded declaration (there were already nine non-seeded patterns):
Ran the actual generation entrypoint:
PYTHONPATH=src /home/ts/code/projects/agent-comms/.venv/bin/python -X faulthandler \ -m agent_comms.behaviour_patterns > docs/agents/behaviour-catalog.mdExact catalog diff (no registry, consumer or other declaration edit):
The seeded-class count became 6. Removed the throwaway class, regenerated and verified both source and generated document exactly matched the pre-experiment versions.
Requested drift proof
Changed only the generated document's first line by hand. Ran:
PYTHONPATH=src timeout 300 /home/ts/code/projects/agent-comms/.venv/bin/python \ -X faulthandler -m pytest -o addopts='' \ --basetemp=/home/ts/.cache/agent-scratch/pi-catalog/drift-test \ tests/test_behaviour_catalog.py::test_behaviour_catalog_members_name_existing_checks_and_generate_the_file -qActual failure, exit 1:
Regenerated afterward; no deliberate drift remains.
Final verification
The warning is the environment's missing pytest-timeout plugin (
Unknown config option: timeout); the requested outertimeout 300and Python faulthandler were used. No suite-delta claim is used as proof.The real generator also ran in a fresh process with an empty HOME, outside the checkout, using this branch's source and the existing interpreter. It produced the exact catalog and created no commander configuration or bus. No runtime installation, saved-session modification, provider call or merge of this PR was performed.
Resource checker:
/home/ts/bin/agent-resource-checkis absent here; used the repository'stools/agent_resource_check.py --assert-headroom. Warnings only (3.3 GiB RAM available, 3.9 GiB /tmp free); tests were serial, bounded and reused installed dependencies. Disposable test output owned by pi-catalog was under/home/ts/.cache/agent-scratch/pi-catalog; removed after completion. Source and PR handoff stayed in/home/ts/wt/pi-catalog--P1.Assumed: