state-hub/tests
tegwick fdfd4365cd feat(token-tracking): three-tier token recording on task done
Token events are now always created when update_task_status is called
with status="done", using the best available data:

  Tier 1 (best): exact tokens_in + tokens_out passed by agent
  Tier 2:        workplan_tokens_in + workplan_tokens_out prorated
                 across workstream task count (note="workplan")
  Tier 3 (fallback): heuristic 1000 in / 500 out (note="heuristic")

Non-done status changes never create a token event.
MCP tool updated with workplan_tokens_in/out params and tiered docs.
Ralph-workplan skill files updated with the three-tier guidance.
184 tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 18:28:18 +02:00
..
__init__.py feat(state-hub): integrate llm-connect as dependency (S3.1) 2026-02-27 08:32:17 +01:00
conftest.py feat(tests): pytest-asyncio test suite — 119 tests across 3 modules 2026-03-18 12:00:06 +01:00
test_capability_requests.py feat(capability-requests): add routing_note, PATCH endpoint, word-boundary fix, and ops-bridge tunnel targets 2026-03-20 03:47:54 +01:00
test_consistency_check.py feat(consistency): fix-consistency-remote works without REPO for all repos 2026-03-26 14:38:30 +01:00
test_ingest_sbom.py feat(sbom): CUST-WP-0013 — expand SBOM infra to terraform, ansible, and tool manifests 2026-03-12 04:40:26 +01:00
test_llm_connect_integration.py feat(state-hub): integrate llm-connect as dependency (S3.1) 2026-02-27 08:32:17 +01:00
test_mcp_smoke.py feat(tests): pytest-asyncio test suite — 119 tests across 3 modules 2026-03-18 12:00:06 +01:00
test_routers_core.py feat(tests): pytest-asyncio test suite — 119 tests across 3 modules 2026-03-18 12:00:06 +01:00
test_routers_td_ep_contrib.py feat(tests): pytest-asyncio test suite — 119 tests across 3 modules 2026-03-18 12:00:06 +01:00
test_token_events.py feat(token-tracking): record AI token consumption per task (CUST-WP-0029) 2026-03-29 17:46:46 +02:00
test_token_passthrough.py feat(token-tracking): three-tier token recording on task done 2026-03-29 18:28:18 +02:00