fix(observability): merge-gate on deploy, full token input, Plane Done, artifact links #20
Reference in New Issue
Block a user
Delete Branch "fix/observability-and-merge-gate"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Four observability fixes + closing the second door of BUG 8 (one branch, one PR).
1. CRIT — BUG 8 second door (src/webhooks/gitea.py)
Merge webhook no longer sets done when current_stage==deploy (silent return); done at deploy is decided ONLY by check_deploy_status via advance_stage. Other stages keep merge->done.
2. CRIT — full token input (src/usage.py + src/db.py)
Parse & persist cache_creation_input_tokens (new idempotent agent_runs.cache_creation_tokens column). usage_comment shows FULL input = input + cache_read + cache_creation with cached breakdown (e.g. 8.5M in (8.4M cached) / 45.8k out). task_usage_summary sums all three components + total_cached. cost_usd untouched.
3. Plane terminal Done (src/stage_engine.py + src/plane_sync.py)
On deploy->done success (check_deploy_status SUCCESS) the Plane issue is forced to terminal Done (PLANE_STATES[done], mapping unchanged) so it no longer sticks on In Progress.
4. Artifact links for every agent (src/usage.py + src/agents/launcher.py)
reviewer->12-review.md, tester->13-test-report.md, deployer->14-deploy-log.md, architect->ADR, developer->PR+branch, via gitea_public_url. analyst unchanged.
Tests
17 new tests added (parsing/record/comment/summary/artifact-links/merge-gate/Plane-Done). pytest: 244 passed / 9 failed (the 9 are the off-limits HMAC/401 group; the 10th in that group only fails in isolation).