Skip to content

docs: Add agent implementation guidelines from PR #519 lessons#524

Merged
PureWeen merged 3 commits intomainfrom
docs/improve-agent-instructions
Apr 6, 2026
Merged

docs: Add agent implementation guidelines from PR #519 lessons#524
PureWeen merged 3 commits intomainfrom
docs/improve-agent-instructions

Conversation

@PureWeen
Copy link
Copy Markdown
Owner

@PureWeen PureWeen commented Apr 6, 2026

Three new rules in Critical Conventions learned from the #519 vs #521 comparison:

  1. Explore Before Implementing — grep for existing patterns before designing
  2. No New Companion-Pair State Fields — derive state from existing data
  3. Behavioral Tests Over Structural Tests — verify actual behavior, not code existence

These would have prevented the design mistakes in #519 (fragile string matching instead of MultiAgentRole enum, new LastSynthesisCompletedAt field instead of timestamp comparison, structural grep tests instead of behavioral).

Three new rules in Critical Conventions based on mistakes made during
the orphaned worker diagnostic implementation (#519 vs #521):

1. Explore Before Implementing — grep for existing patterns before
   designing. Would have found MultiAgentRole enum instead of using
   fragile string matching.

2. No New Companion-Pair State Fields — derive state from existing
   data instead of adding new fields that must be maintained across
   N code paths. The 13-PR IsProcessing regression history proves
   this is the #1 bug source.

3. Behavioral Tests Over Structural Tests — inject real objects and
   verify outputs, not grep source for string patterns.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PureWeen
Copy link
Copy Markdown
Owner Author

PureWeen commented Apr 6, 2026

CI status: ⚠️ no checks reported on this branch.

Prior review comments:

  • ✅ FIXED — the companion-pair guidance now correctly targets AgentSessionInfo / SessionState turn-lifecycle state and clarifies that structural site-count checks are only supplementary invariant guards.

Findings

No remaining issues after re-review. All 3 reviewers agreed the earlier concern is resolved, and the new guidance is now accurate, actionable, and consistent with the repository’s existing conventions.

Test coverage

This is a docs-only PR, so there are no new runtime code paths to test.

Recommendation

✅ Approve — ready to merge.

PureWeen and others added 2 commits April 6, 2026 01:02
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PureWeen PureWeen merged commit a32011d into main Apr 6, 2026
@PureWeen PureWeen deleted the docs/improve-agent-instructions branch April 6, 2026 06:29
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.

1 participant