Compare commits

...

3 Commits

Author SHA1 Message Date
c3ed6c0a26 fix(deps): update nix-doom-emacs-unstraightened to fix live-usb flake check
Updates nix-doom-emacs-unstraightened from Jan 25 to Jan 31 release,
which fixes the stale doom-intermediates.drv reference that was causing
nixosConfigurations.live-usb to fail flake check.

Closes: x-0cf

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 15:48:34 -08:00
mayor
53fa89b2e9 Merge branch 'polecat/rust/hq-0h1p9m@ml2ugjq1': fix gastown statusline patch
All checks were successful
CI / check (push) Successful in 5m19s
Regenerated patch with correct hunk headers against locked rev 177094a2.
Root cause was malformed patch format, not a flake.lock issue.

Closes: hq-0h1p9m, x-bwld
2026-01-31 14:01:06 -08:00
3acf9d2796 fix(gastown): regenerate statusline optimization patch with correct line numbers
The patch file had malformed hunk headers with incorrect line numbers
and counts, causing it to fail to apply against the locked gastown rev
(177094a2). This was NOT a flake.lock issue - gastown source was properly
locked.

Changes:
- Regenerated patch from scratch against locked gastown revision
- Re-enabled the patch in default.nix (was commented out with TODO)
- Updated comment to accurately describe the optimization

The optimization skips expensive beads queries for detached tmux sessions
and caches status line output with a 10-second TTL, reducing Dolt CPU
usage from ~70% to ~20%.

Closes: hq-0h1p9m

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 13:59:11 -08:00
3 changed files with 19 additions and 19 deletions

12
flake.lock generated
View File

@@ -47,11 +47,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1769329593, "lastModified": 1769848312,
"narHash": "sha256-u5PSA+8TUYF/13ziBcnoE67nkDwpjAdecKh3srcJJm0=", "narHash": "sha256-ggBocPd1L4l5MFNV0Fw9aSGZZO4aGzCfgh4e6hQ77RE=",
"owner": "nix-community", "owner": "nix-community",
"repo": "emacs-overlay", "repo": "emacs-overlay",
"rev": "776dc33d735af583a14cc56b406ea658398964a7", "rev": "be0b4f4f28f69be61e9174807250e3235ee11d50",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -206,11 +206,11 @@
"systems": "systems_2" "systems": "systems_2"
}, },
"locked": { "locked": {
"lastModified": 1769330679, "lastModified": 1769849328,
"narHash": "sha256-X7rw5ouiAYKmbbKLtkEc/Kqcg6DxKgOtgaftzuchy/M=", "narHash": "sha256-BjH1Ge6O8ObN6Z97un2U87pl4POO99Q8RSsgIuTZq8Q=",
"owner": "marienz", "owner": "marienz",
"repo": "nix-doom-emacs-unstraightened", "repo": "nix-doom-emacs-unstraightened",
"rev": "0c2d527055f448c8856129c6d063535e06aeff4d", "rev": "fc1d7190c49558cdc6af20d7657075943a500a93",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -55,9 +55,9 @@ let
./gastown-fix-town-root-detection.patch ./gastown-fix-town-root-detection.patch
# Fix copyDir to handle symlinks (broken symlinks cause "no such file" errors) # Fix copyDir to handle symlinks (broken symlinks cause "no such file" errors)
./gastown-fix-copydir-symlinks.patch ./gastown-fix-copydir-symlinks.patch
# TODO: Statusline optimization patch needs regenerating against current gastown source # Statusline optimization: skip expensive beads queries for detached sessions
# Reduces Dolt CPU from ~70% to ~20% by avoiding beads queries for sessions nobody is watching # Reduces Dolt CPU from ~70% to ~20% by caching and early-exit
# ./gastown-statusline-optimization.patch ./gastown-statusline-optimization.patch
]; ];
meta = with lib; { meta = with lib; {

View File

@@ -1,8 +1,8 @@
diff --git a/internal/cmd/statusline.go b/internal/cmd/statusline.go diff --git a/internal/cmd/statusline.go b/internal/cmd/statusline.go
index 2edf1be8..00253eea 100644
--- a/internal/cmd/statusline.go --- a/internal/cmd/statusline.go
+++ b/internal/cmd/statusline.go +++ b/internal/cmd/statusline.go
@@ -6,6 +6,7 @@ import ( @@ -6,6 +6,7 @@ import (
"os"
"path/filepath" "path/filepath"
"sort" "sort"
"strings" "strings"
@@ -10,10 +10,10 @@ diff --git a/internal/cmd/statusline.go b/internal/cmd/statusline.go
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/steveyegge/gastown/internal/beads" "github.com/steveyegge/gastown/internal/beads"
@@ -15,6 +16,43 @@ import ( @@ -14,6 +15,37 @@ import (
"github.com/steveyegge/gastown/internal/tmux"
"github.com/steveyegge/gastown/internal/workspace" "github.com/steveyegge/gastown/internal/workspace"
) )
+// statusLineCacheTTL is how long cached status output remains valid. +// statusLineCacheTTL is how long cached status output remains valid.
+const statusLineCacheTTL = 10 * time.Second +const statusLineCacheTTL = 10 * time.Second
+ +
@@ -45,10 +45,10 @@ diff --git a/internal/cmd/statusline.go b/internal/cmd/statusline.go
+ _ = os.WriteFile(path, []byte(status), 0644) + _ = os.WriteFile(path, []byte(status), 0644)
+} +}
+ +
var ( var (
statusLineSession string statusLineSession string
) @@ -34,6 +66,19 @@ func init() {
@@ -32,6 +70,20 @@ func init() {
func runStatusLine(cmd *cobra.Command, args []string) error { func runStatusLine(cmd *cobra.Command, args []string) error {
t := tmux.NewTmux() t := tmux.NewTmux()
@@ -68,7 +68,7 @@ diff --git a/internal/cmd/statusline.go b/internal/cmd/statusline.go
// Get session environment // Get session environment
var rigName, polecat, crew, issue, role string var rigName, polecat, crew, issue, role string
@@ -149,7 +201,12 @@ func runWorkerStatusLine(t *tmux.Tmux, session, rigName, polecat, crew, issue st @@ -150,7 +195,11 @@ func runWorkerStatusLine(t *tmux.Tmux, session, rigName, polecat, crew, issue st
// Output // Output
if len(parts) > 0 { if len(parts) > 0 {
@@ -81,7 +81,7 @@ diff --git a/internal/cmd/statusline.go b/internal/cmd/statusline.go
} }
return nil return nil
@@ -389,7 +446,12 @@ func runMayorStatusLine(t *tmux.Tmux) error { @@ -389,7 +438,11 @@ func runMayorStatusLine(t *tmux.Tmux) error {
} }
} }
@@ -94,7 +94,7 @@ diff --git a/internal/cmd/statusline.go b/internal/cmd/statusline.go
return nil return nil
} }
@@ -458,7 +520,12 @@ func runDeaconStatusLine(t *tmux.Tmux) error { @@ -458,7 +511,11 @@ func runDeaconStatusLine(t *tmux.Tmux) error {
} }
} }
@@ -107,7 +107,7 @@ diff --git a/internal/cmd/statusline.go b/internal/cmd/statusline.go
return nil return nil
} }
@@ -526,7 +593,12 @@ func runWitnessStatusLine(t *tmux.Tmux, rigName string) error { @@ -526,7 +583,11 @@ func runWitnessStatusLine(t *tmux.Tmux, rigName string) error {
} }
} }
@@ -120,7 +120,7 @@ diff --git a/internal/cmd/statusline.go b/internal/cmd/statusline.go
return nil return nil
} }
@@ -617,7 +689,12 @@ func runRefineryStatusLine(t *tmux.Tmux, rigName string) error { @@ -617,7 +678,11 @@ func runRefineryStatusLine(t *tmux.Tmux, rigName string) error {
} }
} }