Skip to content

fix: show patrol scan progress diagnostics#4247

Open
Bella-Giraffety wants to merge 2 commits into
gastownhall:mainfrom
Bella-Giraffety:polecat/refuge/gt-pr-sheriff-4236-clean
Open

fix: show patrol scan progress diagnostics#4247
Bella-Giraffety wants to merge 2 commits into
gastownhall:mainfrom
Bella-Giraffety:polecat/refuge/gt-pr-sheriff-4236-clean

Conversation

@Bella-Giraffety

Copy link
Copy Markdown
Collaborator

Clean replacement for #4236, which is conflicting and carries stale unrelated fork history. Supersedes #4217/#4236 while preserving original contributor credit for adamziel's patrol scan diagnostics fix.

Scope:

  • Based on current gastownhall/gastown:main
  • Includes only the patrol scan diagnostics payload and deterministic test hardening
  • Changed files: internal/cmd/patrol_scan.go, internal/cmd/patrol_scan_test.go
  • Excludes the unrelated 85-commit / 157-file history visible on fix: show patrol scan progress diagnostics #4236

PR Sheriff validation:

  • 15/15 research legs: no-merge fix: show patrol scan progress diagnostics #4236 as-is; branch is contaminated/dirty; intended two-file diagnostics fix is sound and policy-allowed
  • 5/5 pre-implementation reviews: approved clean upstream-based replacement branch, no force-push to the existing head
  • 5/5 post-implementation reviews: approved final clean branch, two-commit/two-file diff, stderr diagnostics, JSON stdout preserved, deterministic tests

Validation run:

  • git diff --check upstream/main...HEAD passed
  • go test ./internal/cmd -run 'Test(PatrolScan|RunPatrolScanPhase|CountActiveWorkZombies)' -count=1 -v passed
  • go test -race ./internal/cmd -run '^TestRunPatrolScanPhase' -count=20 -v passed
  • make build passed

Known unrelated gate context:

  • go test ./internal/cmd -count=1 failed in existing unrelated areas outside this two-file diff (agents, convoy, install tests). Focused patrol scan tests and build passed.

Final recommendation:

@Bella-Giraffety Bella-Giraffety added kind/bug Broken behavior priority/p2 Medium — real problem, workaround exists status/review-approved Automated review approved labels Jun 12, 2026
@github-actions github-actions Bot added status/needs-triage Inbox — we haven't looked at it yet and removed status/needs-triage Inbox — we haven't looked at it yet labels Jun 12, 2026
@codecov-commenter

Copy link
Copy Markdown

❌ 12 Tests Failed:

Tests completed Failed Passed Skipped
10676 12 10664 52
View the full list of 12 ❄️ flaky test(s)
github.com/steveyegge/gastown/internal/cmd::TestEnsureBeadsConfigYAML_CreatesWhenMissing

Flake rate in main: 100.00% (Passed 0 times, Failed 16 times)

Stack Traces | 0s run time
=== RUN   TestEnsureBeadsConfigYAML_CreatesWhenMissing
    install_test.go:98: config.yaml = "prefix: hq\nissue-prefix: hq\ndolt.idle-timeout: \"0\"\nexport.auto: \"false\"\n", want "prefix: hq\nissue-prefix: hq\ndolt.idle-timeout: \"0\"\n"
--- FAIL: TestEnsureBeadsConfigYAML_CreatesWhenMissing (0.00s)
github.com/steveyegge/gastown/internal/cmd::TestFilterAndSortSessions_SortOrder

Flake rate in main: 86.36% (Passed 3 times, Failed 19 times)

Stack Traces | 0s run time
=== RUN   TestFilterAndSortSessions_SortOrder
    agents_test.go:323: filterAndSortSessions returned 7 agents, want 8
--- FAIL: TestFilterAndSortSessions_SortOrder (0.00s)
github.com/steveyegge/gastown/internal/cmd::TestGetTrackedIssues_FallsBackToShowTrackedDependencies

Flake rate in main: 100.00% (Passed 0 times, Failed 16 times)

Stack Traces | 0s run time
=== RUN   TestGetTrackedIssues_FallsBackToShowTrackedDependencies
    convoy_external_tracking_test.go:98: getTrackedIssues: querying tracked issues for hq-cv-ext: bd dep: unexpected bd args: dep list hq-cv-ext --direction=down --type=tracks --json
--- FAIL: TestGetTrackedIssues_FallsBackToShowTrackedDependencies (0.00s)
github.com/steveyegge/gastown/internal/cmd::TestGuessSessionFromWorkerDir

Flake rate in main: 86.36% (Passed 3 times, Failed 19 times)

Stack Traces | 0s run time
=== RUN   TestGuessSessionFromWorkerDir
--- FAIL: TestGuessSessionFromWorkerDir (0.00s)
github.com/steveyegge/gastown/internal/cmd::TestGuessSessionFromWorkerDir/different_rig

Flake rate in main: 86.36% (Passed 3 times, Failed 19 times)

Stack Traces | 0s run time
=== RUN   TestGuessSessionFromWorkerDir/different_rig
    agents_test.go:626: guessSessionFromWorkerDir(".../myrig/crew/alpha", "/town") = "gt-crew-alpha", want "mr-crew-alpha"
--- FAIL: TestGuessSessionFromWorkerDir/different_rig (0.00s)
github.com/steveyegge/gastown/internal/cmd::TestJSONOutput_ErrorsReturnNonZeroExit

Flake rate in main: 86.36% (Passed 3 times, Failed 19 times)

Stack Traces | 0.01s run time
=== RUN   TestJSONOutput_ErrorsReturnNonZeroExit
    convoy_stage_test.go:2519: error output should still be valid JSON: unexpected end of JSON input
        raw:
--- FAIL: TestJSONOutput_ErrorsReturnNonZeroExit (0.01s)
github.com/steveyegge/gastown/internal/cmd::TestJSONOutput_NoHumanReadableText

Flake rate in main: 86.36% (Passed 3 times, Failed 19 times)

Stack Traces | 0.01s run time
=== RUN   TestJSONOutput_NoHumanReadableText
    convoy_stage_test.go:2463: stdout is not valid JSON: unexpected end of JSON input
        raw:
--- FAIL: TestJSONOutput_NoHumanReadableText (0.01s)
github.com/steveyegge/gastown/internal/cmd::TestRunConvoyList_UsesTownRootAndStripsBeadsDir

Flake rate in main: 100.00% (Passed 0 times, Failed 16 times)

Stack Traces | 0.01s run time
=== RUN   TestRunConvoyList_UsesTownRootAndStripsBeadsDir
⚠ Warning: skipping convoy hq-cv-town: querying tracked issues for hq-cv-town: bd dep: unexpected bd args: dep list hq-cv-town --direction=down --type=tracks --json
    convoy_bd_routing_test.go:156: expected convoy JSON output, got:
        []
--- FAIL: TestRunConvoyList_UsesTownRootAndStripsBeadsDir (0.01s)
github.com/steveyegge/gastown/internal/cmd::TestRunConvoyStatus_UsesTownRootAndStripsBeadsDir

Flake rate in main: 100.00% (Passed 0 times, Failed 16 times)

Stack Traces | 0s run time
=== RUN   TestRunConvoyStatus_UsesTownRootAndStripsBeadsDir
    convoy_bd_routing_test.go:211: runConvoyStatus: getting tracked issues for hq-cv-status: querying tracked issues for hq-cv-status: bd dep: unexpected bd args: dep list hq-cv-status --direction=down --type=tracks --json
--- FAIL: TestRunConvoyStatus_UsesTownRootAndStripsBeadsDir (0.00s)
github.com/steveyegge/gastown/internal/polecat::TestManagerAgentLifecycleUsesTownBeadsDir

Flake rate in main: 100.00% (Passed 0 times, Failed 16 times)

Stack Traces | 0.01s run time
=== RUN   TestManagerAgentLifecycleUsesTownBeadsDir
    manager_test.go:2178: manager create did not use town BEADS_DIR; log:
        env=.../TestManagerAgentLifecycleUsesTownBeadsDir441881267/001/.beads args=init --prefix gt --server
        env=.../TestManagerAgentLifecycleUsesTownBeadsDir441881267/001/.beads args=config set issue_prefix gt
        env=.../TestManagerAgentLifecycleUsesTownBeadsDir441881267/001/.beads args=migrate --yes
        env=.../TestManagerAgentLifecycleUsesTownBeadsDir441881267/001/.beads args=config set types.custom agent,role,rig,convoy,slot,queue,event,message,molecule,gate,merge-request
        env=.../TestManagerAgentLifecycleUsesTownBeadsDir441881267/001/.beads args=config get types.custom
        env=.../TestManagerAgentLifecycleUsesTownBeadsDir441881267/001/.beads args=--allow-stale version
        env=.../TestManagerAgentLifecycleUsesTownBeadsDir441881267/001/.beads args=create --json --id=gt-gastown-polecat-rust --title=gt-gastown-polecat-rust --description=gt-gastown-polecat-rust
        
        role_type: polecat
        rig: gastown
        agent_state: spawning
        hook_bead: null
        cleanup_status: null
        active_mr: null
        notification_level: null --type=task --labels=gt:agent --force
        env=.../TestManagerAgentLifecycleUsesTownBeadsDir441881267/001/.beads args=show gt-gastown-polecat-rust --json
        env=.../TestManagerAgentLifecycleUsesTownBeadsDir441881267/001/.beads args=update gt-gastown-polecat-rust --description=gt-gastown-polecat-rust
        
        role_type: polecat
        rig: gastown
        agent_state: nuked
        hook_bead: null
        cleanup_status: null
        active_mr: null
        notification_level: null
--- FAIL: TestManagerAgentLifecycleUsesTownBeadsDir (0.01s)
github.com/steveyegge/gastown/internal/refinery::TestEngineerClearAgentActiveMRUsesTownBeadsDir

Flake rate in main: 100.00% (Passed 0 times, Failed 16 times)

Stack Traces | 0.01s run time
=== RUN   TestEngineerClearAgentActiveMRUsesTownBeadsDir
    engineer_test.go:127: refinery active_mr cleanup did not use town BEADS_DIR; log:
        env=.../TestEngineerClearAgentActiveMRUsesTownBeadsDir1577558398/001/.beads args=--allow-stale version
        env=.../TestEngineerClearAgentActiveMRUsesTownBeadsDir1577558398/001/.beads args=show gt-gastown-polecat-rust --json
        env=.../TestEngineerClearAgentActiveMRUsesTownBeadsDir1577558398/001/.beads args=update gt-gastown-polecat-rust --description=gt-gastown-polecat-rust
        
        role_type: polecat
        rig: gastown
        agent_state: idle
        hook_bead: null
        cleanup_status: null
        active_mr: null
        notification_level: null
--- FAIL: TestEngineerClearAgentActiveMRUsesTownBeadsDir (0.01s)
github.com/steveyegge/gastown/internal/rig::TestInitBeadsWritesConfigOnFailure

Flake rate in main: 100.00% (Passed 0 times, Failed 16 times)

Stack Traces | 0.01s run time
=== RUN   TestInitBeadsWritesConfigOnFailure
    manager_test.go:682: config.yaml = "prefix: gt\nissue-prefix: gt\ndolt.idle-timeout: \"0\"\nexport.auto: \"false\"\n", want "prefix: gt\nissue-prefix: gt\ndolt.idle-timeout: \"0\"\n"
--- FAIL: TestInitBeadsWritesConfigOnFailure (0.01s)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@Bella-Giraffety

Copy link
Copy Markdown
Collaborator Author

CI follow-up for this clean replacement PR:

Local focused validation passed:

  • git diff --check upstream/main...HEAD
  • go test ./internal/cmd -run 'Test(PatrolScan|RunPatrolScanPhase|CountActiveWorkZombies)' -count=1 -v
  • go test -race ./internal/cmd -run '^TestRunPatrolScanPhase' -count=20 -v
  • make build

GitHub CI is red, but the failures are outside this PR's two-file diff:

  • Lint: existing issues in internal/doltserver/doltserver.go, internal/cmd/capacity_dispatch.go, internal/cmd/statusline.go, and internal/git/git.go
  • Test/Integration: existing failures in agents, convoy, install, polecat, refinery, and rig tests
  • Windows Smoke Test passed

No CI failure references internal/cmd/patrol_scan.go or internal/cmd/patrol_scan_test.go. Per the PR Sheriff scope contract, I am not broadening this patrol diagnostics PR to fix unrelated baseline gates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Broken behavior priority/p2 Medium — real problem, workaround exists status/review-approved Automated review approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants