Skip to content

feat: bump MinDoltVersion to 1.83.1 for nil pointer fixes#2483

Closed
DreadPirateRobertz wants to merge 25 commits intogastownhall:mainfrom
DreadPirateRobertz:main
Closed

feat: bump MinDoltVersion to 1.83.1 for nil pointer fixes#2483
DreadPirateRobertz wants to merge 25 commits intogastownhall:mainfrom
DreadPirateRobertz:main

Conversation

@DreadPirateRobertz
Copy link
Copy Markdown
Contributor

Summary

Context

Dolt v1.83.1 includes a fix for nil pointer panics in workspace table Update/Delete methods when StatementBegin encounters errors (e.g., table not found in staging root). This resolves potential crashes in gastown's beads integration.

Closes gt-x23u / GH #1778

Test plan

  • go test ./internal/deps/ passes
  • go build ./... passes
  • No remaining references to 1.82.4

🤖 Generated with Claude Code

DreadPirateRobertz and others added 17 commits March 6, 2026 19:31
Add compactor_dog_test.go with tests for:
- compactorDogInterval (default, custom, invalid fallback)
- compactorDogThreshold (default, custom, zero fallback)
- compactorDogMode (default flatten, surgical, unknown fallback)
- compactorDogKeepRecent (default, custom, zero fallback)
- IsPatrolEnabled for compactor_dog (nil, empty, enabled, disabled)
- isConcurrentWriteError (rebase, concurrency, graph, unrelated)

Every other daemon dog had tests; compactor_dog was the gap.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add `gt wl rep [handle]` command that computes reputation scores from
stamps. Algorithm weights valence dimensions (quality, reliability,
creativity) by confidence (0-1) and severity (root=3x, branch=2x,
leaf=1x), producing per-dimension and composite scores on a 0-5 scale.

Includes skill tag aggregation, completion count, and JSON output mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
isIssueBlocked() used stale dependency metadata snapshots from the hq
store for cross-rig blockers. A blocker closed in another rig could
still appear "open" in the hq store's JOIN, causing the convoy feeder
to skip ready issues and stall convoys.

Apply the same cross-rig refresh pattern used by getConvoyTrackedIssues:
refresh blocker statuses via GetIssuesByIDs + fetchCrossRigBeadStatus
fallback. Also add close_reason to fetchCrossRigBeadStatus JSON parsing
so merge-blocks dependencies properly detect merge confirmation
across rigs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The start_command field was removed from all role config TOML files.
These changes were pre-existing in the worktree.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The daemon previously detected polecat crashes (dead session + work on hook)
but only notified the witness via mail. Now it directly auto-restarts
crashed polecats using `gt session restart --force`, with the existing
RestartTracker providing exponential backoff and crash-loop prevention.

Changes:
- checkPolecatHealth: calls restartCrashedPolecat instead of only notifying witness
- restartCrashedPolecat: new method that checks backoff/crash-loop state, shells out
  to `gt session restart <rig>/<polecat> --force`, records restart in tracker
- checkPolecatHeartbeatHealth: new method that warns on stale heartbeats for alive
  sessions and resets backoff on fresh heartbeats
- PolecatHealth patrol config: allows disabling via daemon.json polecat_health toggle
- Crash loops still notify witness as fallback for manual intervention

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add claim timeout mechanism to prevent stale claims on the wanted board.
When a rig claims work but doesn't complete it within a configurable
timeout (default 72h), the claim can be released back to open status.

Changes:
- Add claimed_at TIMESTAMP column to wanted table schema
- Set claimed_at=NOW() when claiming items (server + local clone paths)
- Add gt wl sweep command with --timeout and --dry-run flags
- Auto-sweep expired claims during gt wl sync
- Add QueryExpiredClaims and ReleaseExpiredClaims to WLCommonsStore
- Update fake stores and add comprehensive tests
- Document sweep command and claim timeout in WASTELAND.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the simple "Would do X" dry-run output with a structured
validation report showing all pre-flight checks and planned operations.

The --dry-run flag now renders two sections:

Validation — a checklist of all checks that passed/warned:
  - bead exists, bead status, title valid
  - target resolved, formula exists, cross-rig guard
  - respawn count (new dry-run-only check)
  - stale molecules detection

Plan — ordered list of operations that would be performed:
  - formula cook/wisp/bond, convoy creation
  - bead hook, args storage, merge strategy
  - pane nudge target

Applied consistently across all dispatch paths:
  - Single sling (runSling)
  - Batch sling (runBatchSling)
  - Scheduler schedule/dispatch (scheduleBead, runBatchSchedule)
  - Convoy schedule/sling (both paths)
  - Epic schedule/sling (both paths)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds `gt witness log <rig>` subcommand that aggregates and searches
rig-scoped logs from the town log and live tmux pane captures.

Supports filtering by polecat name, time range, event type, and
text search via --grep. JSON output available with --json.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Agents get confused by nested git repos in the town directory structure,
running git commands in the wrong directory (e.g., town root HQ repo
instead of their worktree). This causes false divergence alerts, wrong
repo operations, and wasted escalation cycles.

Changes:
- Add outputGitRepoContext() to dynamically detect multiple .git
  directories in the agent's path hierarchy and output a clear warning
  with labeled repo purposes
- Add "Nested Git Repos" documentation sections to polecat, crew, and
  mayor role templates explaining the directory-to-repo mapping
- Add isGitDir() helper for .git detection (handles both directories
  and worktree .git files)
- Add tests for isGitDir and outputGitRepoContext

Closes GH#716.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When Claude Code sessions hit usage limits (Pro/Max plans), they stall at
the rate limit prompt. The daemon now detects these stuck sessions, parses
the reset time, and automatically recovers by killing and restarting them
after the limit resets.

Flow:
1. Daemon heartbeat scans tmux panes for rate limit patterns
2. Extracts reset time from messages like "resets 5pm (America/Los_Angeles)"
3. Persists state to mayor/.runtime/rate-limit-state.json
4. On subsequent heartbeats, waits until reset time passes
5. Kills all stuck sessions; daemon's normal patrols restart everything

Polecats get restarted via `gt session restart` (preserves work-on-hook).
Infrastructure sessions (deacon, witness, refinery) are killed directly
and the daemon's existing ensure*Running patrols handle restart.

Configurable via daemon.json: patrols.rate_limit_recovery.enabled
Defaults to enabled. Uses existing quota.ParseResetTime for time parsing.

Closes gastownhall#1066

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two root causes of empty context in crew sessions after auto-handoff:

1. collectHandoffState() relied on external commands (exec.Command for
   gt hook, gt mail inbox, bd ready, bd list) that fail during PreCompact
   hook execution when PATH or environment is incomplete. Replaced with
   Go library calls (beads.List, mail.ListUnread) that are deterministic
   and don't depend on external command availability.

2. runPrimeCompactResume() never showed the handoff mail body to the
   successor session. Mail check inject only displays message summaries
   (ID + subject), not bodies. Added injectHandoffContext() that finds
   the handoff mail and displays its full body, giving the successor
   the detailed state (git status, hooked work, inbox, in-progress beads)
   collected by the predecessor.

GH gastownhall#1996

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gt unsling and gt done were not clearing the hook_bead field in the
agent bead's description. This field is written at spawn time by
FormatAgentDescription and read as a fallback by the daemon's crash
detection (getAgentHookBead) and the manager's loadFromBeads. Without
clearing it, those readers see stale hook_bead values after unsling,
misidentifying agent state.

Changes:
- Add HookBead field to AgentFieldUpdates for atomic description updates
- Add ClearAgentHookBead convenience method on Beads
- Call ClearAgentHookBead in unsling before updating hooked bead status
- Call ClearAgentHookBead in done before setting agent_state=idle

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the single-sling target is a rig, delegate to executeSling() instead
of the duplicated inline 12-step flow. This unifies all three dispatch
paths (single-sling, batch sling, queue dispatch) through a single
function for rig targets.

Non-rig targets (dogs, mayor, crew, self-sling, nudge) continue using
the inline path since executeSling only handles rig-targeted dispatch.
Dry-run also falls through to inline since executeSling doesn't support it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a new "headless" role type for spawning worker agents without git
worktree overhead. Headless workers get a plain directory instead of a
git worktree, suitable for research, communications, and audit tasks.

Key changes:
- New headless.toml role definition with needs_worktree = false
- NeedsWorktree *bool field on RoleSessionConfig (nil defaults to true)
- Headless session naming: {prefix}-hl-{name}
- Headless spawn path in polecat manager (os.MkdirAll, no worktree)
- gt done headless path: skip git ops, close issue directly
- --headless flag on gt sling
- Identity parsing for hl- prefix in session names

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Dolt v1.83.1 includes dolthub/dolt#10590 which fixes nil pointer panics
in workspace table Update/Delete methods when StatementBegin encounters
errors. Updates MinDoltVersion constant, Dockerfile, and all docs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added the status/needs-triage Inbox — we haven't looked at it yet label Mar 7, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 7, 2026

❌ 3 Tests Failed:

Tests completed Failed Passed Skipped
8460 3 8457 38
View the top 3 failed test(s) by shortest run time
github.com/steveyegge/gastown/internal/cmd::TestVerifyBeadExistsAllowStale
Stack Traces | 0s run time
=== RUN   TestVerifyBeadExistsAllowStale
    sling_test.go:935: verifyBeadExists("jv-v599") failed: bead 'jv-v599' not found (bd show failed)
        Expected --allow-stale to skip sync check
--- FAIL: TestVerifyBeadExistsAllowStale (0.00s)
github.com/steveyegge/gastown/internal/daemon::TestCheckPolecatHealth_FreshHeartbeatResetsBackoff
Stack Traces | 0s run time
=== RUN   TestCheckPolecatHealth_FreshHeartbeatResetsBackoff
    polecat_health_test.go:429: expected backoff to be reset after fresh heartbeat, but agent is still in backoff
--- FAIL: TestCheckPolecatHealth_FreshHeartbeatResetsBackoff (0.00s)
github.com/steveyegge/gastown/internal/cmd::TestSlingSetsDoltAutoCommitOff
Stack Traces | 0.01s run time
=== RUN   TestSlingSetsDoltAutoCommitOff
🎯 Slinging gt-test456 to mayor/...
✓ Work attached to hook (status=hooked)
○ Self-sling: work hooked, will process on next turn
    sling_test.go:1613: bd command missing BD_DOLT_AUTO_COMMIT=off: ENV:BD_DOLT_AUTO_COMMIT=on|update gt-test456 --status=hooked --assignee=mayor/
--- FAIL: TestSlingSetsDoltAutoCommitOff (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.

DreadPirateRobertz and others added 8 commits March 7, 2026 10:26
Polecat branches (polecat/*) are now always cleaned up after merge,
regardless of the DeleteMergedBranches config setting. The config
now only controls non-polecat feature branches.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previously, updateAgentStateOnDone() closed the hooked work bead at
gt done time even when an MR was created for the Refinery merge queue.
This allowed bd ready to see dependents as unblocked before the
dependency code was actually merged to main.

Now, when an MR is successfully submitted (mrID != "" && !mrFailed),
the work bead is left open. The Refinery closes the source issue after
merge (engineer.go), which is when dependents should become unblocked.

For non-MR paths (headless, direct merge, zero-commit), the bead is
already closed earlier in runDone, so the terminal-status check in
updateAgentStateOnDone prevents a double-close attempt.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add `gt reload` command that hot-reloads config.json and env vars
without restarting agent sessions. Useful for live tuning.

What it does:
- Validates town settings, patrol config, and rigs config
- Signals daemon via SIGHUP to reload patrol config, env vars,
  prefix registry, and restart tracker
- Updates tmux global environment variables for running sessions
- Supports --dry-run flag for validation-only mode

Daemon changes:
- Add SIGHUP handler for full config reload
- New reloadConfig() method reloads patrol config, env vars,
  prefix registry, and restart tracker from disk
- Platform-specific signal support (Unix SIGHUP, Windows no-op)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implement Phase 1 of model-aware molecules (design doc: model-aware-molecules.md):

- internal/models/database.go: Static model capability database with benchmark
  scores for Anthropic, OpenAI, DeepSeek, Google, and local ollama models.
  Supports OpenRouter pricing cache (24h TTL), ~/.gt/models.toml overrides,
  and automatic ollama model discovery via /api/tags.

- internal/models/router.go: SelectModel() heuristic routing that scores
  candidates by subscription status (+40), local availability (+35),
  MMLU/SWE benchmarks, and cost savings. Supports exact model selection,
  provider filtering, quality thresholds, cost ceilings, and capability
  requirements. No LLM calls — pure heuristics.

- internal/models/usage.go: Local usage tracking to ~/.gt/usage.jsonl with
  RecordUsage(), LoadUsage(), MonthlyStats(), and EstimateCost(). Writes
  always (unless GT_TRACK_USAGE=false); OTel is additive.

- internal/formula/types.go: Add model routing constraint fields to Step
  struct (model, provider, access_type, min_mmlu, min_swe, requires,
  max_cost). All optional — existing formulas work unchanged.

- internal/formula/parser.go: Validate new constraint fields — mutual
  exclusivity of model/provider, valid access types and capabilities,
  score ranges 0-100, non-negative costs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add notifyMayorMerged to the Refinery Engineer, called from
HandleMRInfoSuccess after post-merge cleanup. Uses gt nudge
(not mail) following communication hygiene guidelines, giving
the mayor real-time visibility into merge queue throughput.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@DreadPirateRobertz
Copy link
Copy Markdown
Contributor Author

Closing — this was incorrectly opened from the fork's main branch. The commit is already on the feature branch.

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

Labels

status/needs-triage Inbox — we haven't looked at it yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants