fix(gatorwalk-factory): a manual exit waits on a person only once the agent has no way out (swamp-club #2874) #416

Merged
seth merged 3 commits from cue/2874-gatorwalk-factory-metrics into main 2026-10-01 17:19:57 +00:00
Owner

Fixes swamp-club #2874.

Problem

The metrics counted a manual exit as a wait on a person as soon as its gates passed, even while the agent was still working. In the dogfood run on #2711, attest.complete and merge.complete counted as waits while the agent built the attestation and waited for CI. A gated revise that overlapped the plan-approval wait was summed on top of it. The summary reported 18m 57s of waits; the real time spent waiting on the person was 16m 09s.

Change

  • awaiting.ts: a manual exit with gates, all passing, waits on a person only once the agent has no way out of its own. The agent has one while some non-manual exit is:

    • ready without a pending approval;
    • waiting on a product this stage declares for the agent and has not recorded in this stage entry (artifact-exists, artifact-fresh, evidence-recorded, or a cooldown counting from one); or
    • waiting only on cooldowns that will lift.

    A gate that fails on a product already recorded leaves a decision, not agent work: a failed merge, findings, cel.

  • metrics.ts: summary.waits.timeMs is the time covered by finished waits, so exits waiting at once count once. count, open and the per-exit rows are unchanged.

  • summary.ts: the waits line now says "(overlaps counted once)".

  • DESIGN.md: the rule, the Waits metric, and a decision-log entry. driving.md: the matching driver rule.

  • The studio bundle is rebuilt.

Tests

  • awaiting_test, on a new handoffDefinition fixture shaped like attest/merge, pins these cases:
    • no wait while the agent's evidence is unrecorded;
    • complete waits beside a pending open-pr approval and after a decline;
    • no wait while merged waits only on its cooldown;
    • complete and new-pr wait after a failed merge;
    • another stage's product is no way out for the agent.
  • metrics_test and summary_test pin that overlapping waits count once, that an open wait stays out of the total, and that no complete wait appears in merge.

Verified by verify-build and verify-reviews on 73cc962 (attestation cfc3754f-4325-4b6f-b5c9-07809cdc9512).

🤖 Generated with Claude Code

Fixes swamp-club #2874. ## Problem The metrics counted a manual exit as a wait on a person as soon as its gates passed, even while the agent was still working. In the dogfood run on #2711, `attest.complete` and `merge.complete` counted as waits while the agent built the attestation and waited for CI. A gated `revise` that overlapped the plan-approval wait was summed on top of it. The summary reported 18m 57s of waits; the real time spent waiting on the person was 16m 09s. ## Change - `awaiting.ts`: a manual exit with gates, all passing, waits on a person only once the agent has no way out of its own. The agent has one while some non-manual exit is: - ready without a pending approval; - waiting on a product this stage declares for the agent and has not recorded in this stage entry (`artifact-exists`, `artifact-fresh`, `evidence-recorded`, or a cooldown counting from one); or - waiting only on cooldowns that will lift. A gate that fails on a product already recorded leaves a decision, not agent work: a failed merge, findings, `cel`. - `metrics.ts`: `summary.waits.timeMs` is the time covered by finished waits, so exits waiting at once count once. `count`, `open` and the per-exit rows are unchanged. - `summary.ts`: the waits line now says "(overlaps counted once)". - DESIGN.md: the rule, the Waits metric, and a decision-log entry. `driving.md`: the matching driver rule. - The studio bundle is rebuilt. ## Tests - `awaiting_test`, on a new `handoffDefinition` fixture shaped like attest/merge, pins these cases: - no wait while the agent's evidence is unrecorded; - `complete` waits beside a pending `open-pr` approval and after a decline; - no wait while `merged` waits only on its cooldown; - `complete` and `new-pr` wait after a failed merge; - another stage's product is no way out for the agent. - `metrics_test` and `summary_test` pin that overlapping waits count once, that an open wait stays out of the total, and that no `complete` wait appears in merge. Verified by verify-build and verify-reviews on 73cc962 (attestation cfc3754f-4325-4b6f-b5c9-07809cdc9512). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A manual exit with gates, all passing, was counted as held by a person from
the moment its gates passed, so attest.complete and merge.complete counted
as waits while the agent built the attestation and waited for CI. It is now
held only while the agent has no way out of its own: no non-manual exit is
ready without a pending approval, waits on a product the stage declares for
the agent and has not recorded in this stage entry, or waits only on a
cooldown that will lift.

The summary's wait time is now the time covered by finished waits, so two
exits waiting at once count once; each exit keeps its own row.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The cooldown case of awaitsAgentProduct checked whether its evidence was ever
recorded; evidence-recorded checks this stage entry. Both now check the entry.
Reflows the new DESIGN.md paragraph.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Merge remote-tracking branch 'origin/main' into cue/2874-gatorwalk-factory-metrics
All checks were successful
CI / Review Integrity (pull_request) Successful in 58s
CI / Validate Attestation (pull_request) Successful in 51s
73cc962fa9
# Conflicts:
#	gatorwalk-factory/DESIGN.md
#	gatorwalk-factory/extensions/models/_lib/engine/studio_assets.ts
seth merged commit 9316880899 into main 2026-10-01 17:19:57 +00:00
seth deleted branch cue/2874-gatorwalk-factory-metrics 2026-10-01 17:19:57 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
swamp-club/swamp-extensions!416
No description provided.