fix(observability): merge-gate on deploy, full token input, Plane Done, artifact links #20

Merged
admin merged 1 commits from fix/observability-and-merge-gate into main 2026-06-04 11:21:50 +03:00
Owner

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.

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).

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).
admin added 1 commit 2026-06-04 11:18:23 +03:00
1. BUG 8 (second door): merge webhook no longer fake-completes a task at the
   deploy stage; done is gated by the deployer verdict (check_deploy_status).
   Other stages keep merge->done.
2. Token accounting: parse+persist cache_creation_input_tokens (new
   idempotent agent_runs column). usage_comment / task_summary now show the
   FULL input (input + cache_read + cache_creation) with a cached breakdown.
   cost_usd untouched.
3. deploy->done success now forces the Plane issue to terminal Done state.
4. All agents (architect/developer/reviewer/tester/deployer) attach artifact
   links to their finish comment via gitea_public_url.

Tests added for each fix; pytest 244 passed / 9 failed (off-limits HMAC group).
admin merged commit 2801983d7b into main 2026-06-04 11:21:50 +03:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/orchestrator#20