[COORD-001] Implement context estimator #154

Closed
opened 2026-01-31 21:06:19 +00:00 by jason.woltje · 0 comments
Owner

Objective

Implement a formula-based context estimator that predicts token usage for issues before assignment.

Implementation Details

Build the context estimation algorithm from Part 1 of the comprehensive architecture.

The formula estimates context by summing:

  • Files context: files_to_modify x 7000 tokens per file
  • Implementation complexity: low=10K, medium=20K, high=30K tokens
  • Test requirements: low=5K, medium=10K, high=15K tokens
  • Documentation: none=0, light=2K, medium=3K, heavy=5K tokens
  • Safety buffer: base x 1.3 (30% buffer for iteration/debugging)

Validation requirement: Test against 10 historical issues and measure accuracy.

Context Estimate

  • Files to modify: 2 (new files: issue_estimator.py, models.py updates)
  • Implementation complexity: medium (20,000 tokens)
  • Test requirements: medium (10,000 tokens)
  • Documentation: light (2,000 tokens)
  • Total estimated: 46,800 tokens
  • Recommended agent: glm

Difficulty

medium

Acceptance Criteria

  • Context estimation formula implemented
  • Validation suite tests against 10 historical issues
  • Estimation accuracy within ±20% of actual usage
  • Formula includes all components: files, implementation, tests, docs, buffer
  • Unit tests for estimator (85% coverage minimum)

Testing Requirements

  • Unit tests for each component of the estimation formula
  • Integration tests validating against historical issue data
  • Edge case tests (zero files, high complexity, etc.)
  • Coverage: 85% minimum
## Objective Implement a formula-based context estimator that predicts token usage for issues before assignment. ## Implementation Details Build the context estimation algorithm from Part 1 of the comprehensive architecture. The formula estimates context by summing: - Files context: files_to_modify x 7000 tokens per file - Implementation complexity: low=10K, medium=20K, high=30K tokens - Test requirements: low=5K, medium=10K, high=15K tokens - Documentation: none=0, light=2K, medium=3K, heavy=5K tokens - Safety buffer: base x 1.3 (30% buffer for iteration/debugging) Validation requirement: Test against 10 historical issues and measure accuracy. ## Context Estimate - Files to modify: 2 (new files: issue_estimator.py, models.py updates) - Implementation complexity: medium (20,000 tokens) - Test requirements: medium (10,000 tokens) - Documentation: light (2,000 tokens) - Total estimated: 46,800 tokens - Recommended agent: glm ## Difficulty medium ## Acceptance Criteria - Context estimation formula implemented - Validation suite tests against 10 historical issues - Estimation accuracy within ±20% of actual usage - Formula includes all components: files, implementation, tests, docs, buffer - Unit tests for estimator (85% coverage minimum) ## Testing Requirements - Unit tests for each component of the estimation formula - Integration tests validating against historical issue data - Edge case tests (zero files, high complexity, etc.) - Coverage: 85% minimum
jason.woltje added the apiapip0phase-1 labels 2026-01-31 21:06:19 +00:00
jason.woltje added this to the M4.1-Coordinator (0.0.4) milestone 2026-01-31 21:10:04 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaic/stack#154