feat: PACT v3.0 — Agent Teams integration#162
Open
michael-wojcik wants to merge 28 commits intomainfrom
Open
Conversation
Replace the subagent text-based reporting model with Agent Teams SendMessage-based communication and Task tool self-management. 10 sections: task self-management, progress reporting, blocker delivery, algedonic signals (dual-delivery HALT + direct ALERT), pre-completion self-validation, memory preservation, HANDOFF format/delivery, peer communication guidance, plan approval workflow.
Replace subagent dispatch with teammate spawning pattern. Add Team Lifecycle, Plan Approval workflow, SendMessage-based monitoring, teammate shutdown between phases, and HALT signal handling for concurrent teammates.
comPACT: Replace subagent dispatch with teammate spawning into session team. Add Plan Approval, shutdown pattern, peer-review team reuse. imPACT: Remove rePACT references, update terminology to teammate model, use SendMessage for blocker reporting.
peer-review: Spawn reviewer teammates with SendMessage-based review delivery, plan_mode_required for all reviewers, structured shutdown. plan-mode: Spawn consultant teammates in planning-only mode with SendMessage-based perspective collection and plan approval workflow.
Delete commands/rePACT.md and remove its entry from plugin.json. rePACT functionality replaced by recursive /PACT:orchestrate calls.
Replace 'Always Run Agents in Background' with Team Lifecycle (spawning, Plan Approval, shutdown). Update Agent Task Tracking for teammate self-management. Remove rePACT from command list. Update PR Review Workflow for teammate reviewers with SendMessage delivery.
Rewrite 5 protocol files for SendMessage-based communication: - algedonic.md: dual-delivery HALT, teammate signal delivery - pact-scope-contract.md: Agent Teams as sole executor - pact-scope-phases.md: teammate spawning in ATOMIZE/CONSOLIDATE - pact-agent-stall.md: teammate stall detection with SendMessage - pact-task-hierarchy.md: teammate self-managed tasks
Replace subagent/background references with teammate terminology in pact-protocols.md and pact-workflows.md extract files.
Replace subagent references with teammate communication patterns. HANDOFF/BLOCKER delivery now via SendMessage to team lead. Skill references replace duplicated format definitions.
Add team_utils.py shared module with derive_team_name, team_exists, get_team_members, and find_active_teams. Update session_init to output TeamCreate instruction, stop_audit to audit team state, and compaction_refresh to include team context in recovery messages.
Add team interaction patterns (TEAM_NAME, SEND_MESSAGE, TEAM_CREATE, TEAM_DELETE) to refresh/patterns.py. Add has_send_message(), has_team_create(), find_send_messages() to transcript_parser.py. Update workflow_detector confidence with team interaction counting. Add teammate naming conventions and tool names to constants. Update checkpoint_builder with _get_team_context(). Update validate_handoff and memory_enforce docstrings for teammate terminology.
Add test_team_utils.py with 44 tests covering all team_utils functions. Add 80+ new test cases across 9 files for Agent Teams patterns, transcript parser methods (has_send_message, has_team_create, find_send_messages), workflow detector team interactions, compaction refresh team context, and pattern fuzz tests. Fix 4 pre-existing test failures (assertion text changes in test_task_integration, environmental mock gaps in test_staleness). All 963 tests pass.
Update four SSOT sections (Task Hierarchy, Teammate Stall Detection, Scope Contract, Scoped Phases) to match their protocol extract files that were updated in earlier waves.
Update README with Agent Teams prerequisites, v3.0 features, and 7 commands (rePACT removed). Update integration test scenarios and canary checklist with teammate spawning, SendMessage handoffs, plan approval, and shutdown patterns.
Create verify-agent-teams.sh with 54 checks across 13 sections. Update 4 existing verification scripts to remove rePACT references and add Agent Teams equivalents. Bump version to 3.0.0 in both plugin.json and marketplace.json. All 176 checks pass across 5 scripts.
The correct Agent Teams API parameter is mode="plan", not plan_mode_required. Fix 12 references across 5 files: peer-review.md, comPACT.md, plan-mode.md, orchestrate.md, and SKILL.md.
Replace all rePACT references with Agent Teams equivalents across 5 protocol files and SSOT. rePACT sub-scope execution is now handled by teammate spawning via ATOMIZE phase. Update workflow family table to 4 workflows. Update verify-protocol-extracts.sh line ranges.
Add docstring to TEAMMATE_NAME_PATTERN noting it matches any JSON "name" field (M2). Add comment to _team_instruction about storage path assumption and graceful fallback (M3). Align team member overflow formatting between compaction_refresh and stop_audit (M6).
Add test_session_init.py (14 tests for _team_instruction branches), test_stop_audit.py (25 tests for audit_tasks and audit_team_state), and 15 tests in test_checkpoint_builder.py for _get_team_context and team context rendering. Fix test_multiple_teams assertion to match M6 formatting change. Total: 1017 tests passing.
Replace deprecated typing.Pattern with re.Pattern in patterns.py (F2). Remove unused TEAMMATE_NAME_CONVENTION, TEAM_TOOL_NAMES, and SEND_MESSAGE_TYPES constants (F3-F4). Add TeamDelete cleanup instruction to stop_audit.py per brainstorm Decision 11 (F6). Update related tests. 1014 tests passing.
Add create_orchestrate_with_teams_transcript() factory to helpers.py and conftest.py. Add 6 E2E tests covering full pipeline with TeamCreate, SendMessage, and Task team_name patterns: PreCompact→SessionStart flow, confidence scoring with team interactions, SendMessage parsing, TeamCreate detection, team interaction counting, and terminated workflow handling. 1020 tests passing.
…essage handoffs Address 3 gaps found during plan-vs-implementation assessment: - Add Delegate Mode (Shift+Tab) as optional recommendation in README Prerequisites - Add peer communication via SendMessage section to pact-s2-coordination.md - Add SendMessage delivery mechanism to pact-phase-transitions.md - Sync both protocol changes to pact-protocols.md SSOT - Fix stale line ranges in verify-protocol-extracts.sh
Replace ASCII downgrades introduced during Wave 2B/2C rewrites: - Tree diagrams: +--/|-- → └──/├──/│ - Em dashes: -- → — - Arrows: -> → → Aligns comPACT, peer-review, plan-mode, and imPACT with the Unicode conventions used in orchestrate.md and protocol files.
Remove SendMessage API examples, Task tool parameter lists, and platform workflow descriptions that duplicate what agents already know from their tool definitions. Keep only PACT-specific guidance (review criteria, timing conventions, message formats). Reduces context window consumption by ~158 lines across 9 files.
The v3 rewrite replaced '## On Start' with '## Task Self-Management' but the test wasn't updated alongside the change, causing a persistent test failure.
d4ebf7b to
6aab4eb
Compare
Lead assigns tasks when spawning teammates — that's the default. Self-claiming from TaskList is the exception for batch scenarios (multiple teammates sharing a pool of tasks in the same domain).
6aab4eb to
9815807
Compare
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.
Summary
Replace the subagent execution model with Agent Teams as THE execution model for all PACT workflows.
Key changes across 57 files (9 implementation waves):
Task(team_name=..., name=...)and SendMessage-based communicationVerification: 1139 total checks passing (176 verification script checks + 963 pytest)
Test plan
python -m pytest tests/ -v)testing/scenario-standard-orchestration.md)testing/scenario-scoped-orchestration.md)testing/canary-checklist.md)