Skip to content

Comments

docs(plan): Context Architecture Optimization via Protocol Partitioning (#64)#71

Open
michael-wojcik wants to merge 2 commits intomainfrom
feature/context-architecture-protocol-partitioning-plan
Open

docs(plan): Context Architecture Optimization via Protocol Partitioning (#64)#71
michael-wojcik wants to merge 2 commits intomainfrom
feature/context-architecture-protocol-partitioning-plan

Conversation

@michael-wojcik
Copy link
Collaborator

Summary

This PR adds the implementation plan for optimizing PACT framework context loading through protocol partitioning. The plan addresses issue #64.

Key Changes

  • Add comprehensive implementation plan (context-architecture-protocols-plan.md)
  • Include superseded skills-based plan for historical reference

Plan Overview

Goal: Reduce context loading overhead by partitioning the monolithic pact-protocols.md (1,086 lines) into 8 focused protocol files, and compressing CLAUDE.md from 306 to ~100-110 lines.

Approach:

  1. Protocol Partitioning: Split protocols by concern (delegation, S4-checkpoints, variety-management, etc.)
  2. Targeted @-references: Commands load only the specific protocols they need
  3. CLAUDE.md Compression: Keep mission, policy, and phase principles; move operational details to protocols

Expected Impact:

  • ~51% reduction in typical orchestration context load
  • ~67% reduction in CLAUDE.md size
  • Deterministic, controlled loading aligned with PACT's structured workflow

Plan Status

The plan incorporates feedback from peer review addressing:

  • Complete content accounting (all 1,086 lines mapped to destinations)
  • Cross-reference inventory (7 internal refs identified for updating)
  • Rollback strategy with explicit triggers and procedures
  • Content preservation verification methodology
  • Regression baseline capture requirements

Status: PENDING APPROVAL

Test plan

  • Review plan completeness and accuracy
  • Verify content accounting covers all protocol sections
  • Confirm cross-reference inventory is complete
  • Validate rollback strategy is actionable

🤖 Generated with Claude Code

Add comprehensive implementation plan for protocol partitioning approach
to optimize PACT framework context loading.

Key elements:
- Partition pact-protocols.md (1,086 lines) into 8 focused protocol files
- Compress CLAUDE.md from 306 to ~100-110 lines
- Update commands to @-reference only specific protocols needed
- Expected ~51% reduction in typical orchestration context load

Includes superseded skills-based plan for historical reference.
Plan addresses peer review feedback incorporating:
- Complete content accounting (all sections mapped to destinations)
- Cross-reference inventory (7 internal refs to update)
- Rollback strategy with explicit triggers
- Content preservation verification methodology
- Regression baseline capture requirements

Status: PENDING APPROVAL

Relates to #64
Address critical finding from second peer review:
- All 7 agent files reference @pact-protocols.md for Cross-Agent
  Coordination and S1 Autonomy rules (21 refs across 7 files)
- pact-preparer.md also references S4 Environment Model

Updates:
- Add Agent Files Cross-Reference Inventory (8 refs to update)
- Add all 7 agent files to Components Affected and Files to Modify
- Add Phase 5 (Update Agent Files) to Phase Sequence
- Add commit 14 (refactor agents) to Implementation Sequence
- Update acceptance criteria with agent file verification
- Update scope: 8 new files + 12 modified (was 5)
- Update time estimate: 6-7 hours (was 5-6)

Also fixes:
- Research citation: Clarify CLAUDE.md size as working assumption
- Line count: 1,086 → 1,085 (actual file count)
- Agent Files Audit section: Reflect actual finding (21 refs found)

Grand total cross-references requiring updates: 15 (7 internal + 8 agent)
michael-wojcik added a commit that referenced this pull request Jan 15, 2026
Alternative to the comprehensive 8-file partitioning approach in PR #71.
This moderate plan proposes extracting just 2 targeted files:

- pact-agent-protocols.md (~100 lines): S1 Autonomy, Self-Coordination,
  Phase Handoffs for all 7 agents
- pact-variety.md (~80 lines): Variety Management for orchestrate.md
  and plan-mode.md

Expected outcomes:
- ~90% context reduction for agents (1,085 → ~100 lines)
- ~93% context reduction for plan-mode (1,085 → ~80 lines)
- Only +2 files vs +8 in comprehensive approach
- 2-3 hours implementation vs 6-7 hours

Created via /PACT:plan-mode with specialist consultation from
pact-preparer, pact-architect, and pact-test-engineer.

Related to #64
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