Skip to content

feat(team-creator v2): SUB-4 budget projection + drift detection (closes VastVale)#30

Merged
projectious merged 1 commit into
mainfrom
feat/sub-4-budget
May 10, 2026
Merged

feat(team-creator v2): SUB-4 budget projection + drift detection (closes VastVale)#30
projectious merged 1 commit into
mainfrom
feat/sub-4-budget

Conversation

@projectious
Copy link
Copy Markdown
Contributor

Wave 4 SUB-4 of VastVale (gh#20). Final sub-WorkItem; closes the epic. Built on SUB-1 + SUB-2 + SUB-3 (all already merged).

Highlights

  • inputs_snapshot.budget_projection block on chartering DEC (no schema bump - uses additionalProperties: true)
  • pk-team-create Step 7.5: live model-recommender.get_pricing per slot at charter time, snapshots unit_cost_usd into the projection
  • Consultant slots use engagement_window ∩ Scope window for per-slot cost windows (hook from SUB-3)
  • New query_budget_drift MCP tool + pk-team-review Step 5c with BUDGET DRIFT report section
  • 9 new tests, 97/97 team-manager tests pass on both trees

Test plan

  • Restart MCP servers; charter a fresh team and verify the resulting DEC has a budget_projection block with the expected slot_projections
  • Run pk-team-review against the chartered Scope; verify drift status (no_projection_on_file when fresh; warning/info when actuals exist)
  • Verify --budget-drift-threshold and --projection-method flags work
  • diff -r --exclude=pycache src/context/skills/processkit/ context/skills/processkit/ clean

Open follow-up (not in this PR)

  • Actuals currently use snapshotted unit_cost_usd (volume-only drift). Both volume + price drift is achievable today via the actual_slot_costs injection parameter when the caller pre-computes — cross-server team-manager → model-recommender call was avoided to keep scope tight.

🤖 Generated with Claude Code

Wave 4 SUB-4 (BACK-SwiftReef, gh#20). Final VastVale sub-WorkItem.
Closes the epic.

- inputs_snapshot.budget_projection block per design (currency,
  window, projected_total, projection_method, slot_projections[]
  with role/seniority/model_profile/expected_invocations_per_week/
  avg_tokens_per_invocation/unit_cost_usd/projected_total_usd,
  drift_threshold_pct=20, notes). Added effective_window per slot
  for consultant-slot traceability (only deviation from design).
- pk-team-create Step 7.5 (between entity write and DEC write):
  iterates RoleSlots, calls model-recommender.get_pricing per slot,
  computes per-slot and total projection, persists into DEC. New
  CLI flags: --budget-drift-threshold (default 20),
  --projection-method (default heuristic).
- New helpers in team_creator_lib.py: intersect_windows,
  compute_slot_projection, build_budget_projection,
  compute_budget_drift. Pure functions (testable without MCP state).
- team-manager: new query_budget_drift MCP tool. Scans Decision files
  for most-recent chartering DEC with budget_projection; sums actual
  costs from event-log; computes drift_pct; returns finding shape.
  Over-spend = warning; under-spend = info; no projection = skip.
- pk-team-review Step 5c calls query_budget_drift. New BUDGET DRIFT
  report section + SUMMARY line. New CLI flags: --budget-scope,
  --budget-drift-threshold.
- Consultant slots (type=consultant on filled_by TeamMember) use the
  engagement_window intersected with Scope window for the per-slot
  cost window. Hook from SUB-3.
- 9 new tests; 97/97 team-manager tests pass on both trees.

Open follow-up:
- Actuals use snapshotted unit_cost_usd (volume-only drift). Live
  get_pricing for both volume + price drift is achievable today via
  the actual_slot_costs injection parameter when the caller
  pre-computes — cross-server team-manager -> model-recommender call
  was avoided to keep scope tight.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

2 participants