Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .pnpm-store/store/v11/index.db
Binary file not shown.
4 changes: 2 additions & 2 deletions core/codegen.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func emitInterface(t reflect.Type, name string) string {
optional = true
}
}
nullable := f.Type.Kind() == reflect.Ptr
nullable := f.Type.Kind() == reflect.Pointer
tsTypeStr := tsType(f.Type)

marker := ": "
Expand Down Expand Up @@ -199,7 +199,7 @@ func emitInterface(t reflect.Type, name string) string {
// - interface{} -> unknown
func tsType(t reflect.Type) string {
switch t.Kind() {
case reflect.Ptr:
case reflect.Pointer:
return tsType(t.Elem())
case reflect.Bool:
return "boolean"
Expand Down
4 changes: 2 additions & 2 deletions internal/adapter/dolt/supervisor/supervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ type Supervisor struct {
// "ready then went sideways → restarting" lane.
starting atomic.Bool

done chan struct{} // closed when the supervisor permanently fails
done chan struct{} // closed when the supervisor permanently fails
doneErr atomic.Pointer[error]

cancel context.CancelFunc // cancels the supervisor goroutines
Expand Down Expand Up @@ -563,7 +563,7 @@ func pickFreePort(host string) (int, error) {
if err != nil {
return 0, err
}
defer l.Close()
defer func() { _ = l.Close() }()
addr, ok := l.Addr().(*net.TCPAddr)
if !ok {
return 0, fmt.Errorf("unexpected listener addr type %T", l.Addr())
Expand Down
3 changes: 2 additions & 1 deletion internal/adapter/dolt/supervisor/unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package supervisor

import (
"bufio"
"context"
"io"
"log/slog"
"os/exec"
Expand Down Expand Up @@ -45,7 +46,7 @@ func pipeToSlog(r io.ReadCloser, log *slog.Logger, level slog.Level, source stri
buf := make([]byte, 0, 64*1024)
scanner.Buffer(buf, 1024*1024)
for scanner.Scan() {
log.Log(nil, level, "dolt subprocess output",
log.Log(context.Background(), level, "dolt subprocess output",
"source", source, "line", scanner.Text())
}
}
4 changes: 2 additions & 2 deletions internal/adapter/firecracker/firecracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ type VM struct {
// applier during Start. Empty when egress enforcement was not
// configured (no provider attached) or when the fallback path
// ran. Stop reads it to drive teardownEgressRules.
egressTable string
egressTable string //nolint:unused // referenced only by firecracker_linux.go
}

// validate enforces the minimal Spec contract shared by every backend.
Expand Down Expand Up @@ -228,7 +228,7 @@ func mergeSecrets(vaultSecrets, explicit map[string]string) map[string]string {
// errAlreadyStopped is returned by the internal stop path when a VM
// has already been torn down. Promoted to a no-op nil return at the
// public Supervisor.Stop boundary so callers can stop idempotently.
var errAlreadyStopped = errors.New("firecracker: vm already stopped")
var errAlreadyStopped = errors.New("firecracker: vm already stopped") //nolint:unused // referenced only by firecracker_linux.go

// newVMID generates a per-VM identifier of the shape
// "ws-<workspace>-<8hex>". Uses crypto/rand so concurrent VMs from
Expand Down
1 change: 0 additions & 1 deletion internal/adapter/firecracker/firecracker_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,4 +404,3 @@ func generateMAC(id string) string {
return fmt.Sprintf("02:%02x:%02x:%02x:%02x:%02x",
h[0], h[1], h[2], h[3], h[4])
}

4 changes: 2 additions & 2 deletions internal/auth/oauth/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ func (o *OAuth) CallbackHandler() http.HandlerFunc {
return func(w http.ResponseWriter, _ *http.Request) {
w.Header().Set("Content-Type", "application/json")
_ = json.NewEncoder(w).Encode(map[string]any{
"status": "ok",
"flow": "device",
"status": "ok",
"flow": "device",
"client_id": o.ClientID(),
})
}
Expand Down
4 changes: 2 additions & 2 deletions internal/auth/oauth/oauth_github.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ func matchesTeam(teams []ghTeam, allowed []string) bool {
// broader tenant-config refactor; this in-memory store mirrors the
// SQLStore + MemStore split tenant.Store uses today.
type OrgGateStore struct {
mu sync.RWMutex
gates map[string]OrgGate
mu sync.RWMutex
gates map[string]OrgGate
}

// NewOrgGateStore returns an empty in-memory store.
Expand Down
16 changes: 8 additions & 8 deletions internal/cli/admin_backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ func newAdminCmd() *cobra.Command {
}

type backupFlags struct {
out string
dataDir string
auditLog string
version string
out string
dataDir string
auditLog string
version string
skipDoltDump bool
}

Expand Down Expand Up @@ -105,10 +105,10 @@ with 'gemba admin restore --from <path>'.`,
}

type restoreFlags struct {
from string
dataDir string
from string
dataDir string
auditLog string
force bool
force bool
}

func newAdminRestoreCmd() *cobra.Command {
Expand Down Expand Up @@ -234,7 +234,7 @@ func runAdminRestore(out io.Writer, flags restoreFlags) error {
if err != nil {
return fmt.Errorf("gzip reader: %w", err)
}
defer gz.Close()
defer func() { _ = gz.Close() }()
tr := tar.NewReader(gz)

auditOut := flags.auditLog
Expand Down
9 changes: 4 additions & 5 deletions internal/cli/admin_backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,10 @@ func TestAdminBackup_RequiresFlags(t *testing.T) {
if err := runAdminBackup(&buf, backupFlags{dataDir: t.TempDir()}); err == nil {
t.Fatalf("expected error for missing --out")
}
if err := runAdminBackup(&buf, backupFlags{out: filepath.Join(t.TempDir(), "x.tgz")}); err == nil {
// This may not surface here because the cobra layer validates;
// runAdminBackup itself attempts to read data-dir which is "".
// Either way, the absence of a tar.gz is the failure mode.
}
// Missing data-dir: runAdminBackup itself may not surface this (cobra
// validates at a higher layer); the absence of a tar.gz is the actual
// failure mode. Call it for coverage; ignore the result.
_ = runAdminBackup(&buf, backupFlags{out: filepath.Join(t.TempDir(), "x.tgz")})
}

// TestAdminRestore_RejectsTampered verifies that a backup whose
Expand Down
3 changes: 1 addition & 2 deletions internal/cli/bead_crud.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import (
"github.com/spf13/cobra"

"github.com/GembaCore/gemba-core/core"
gembaclient "github.com/GembaCore/gemba-core/internal/client"
"github.com/GembaCore/gemba-core/internal/cli/serverconfig"
gembaclient "github.com/GembaCore/gemba-core/internal/client"
)

// clientFactory is the seam tests use to inject a pre-baked typed
Expand Down Expand Up @@ -477,4 +477,3 @@ Server-side this targets POST /api/work-items/{id}/notes, which is a
cmd.Flags().StringVar(&note, "note", "", "note text (alternative to positional)")
return cmd
}

5 changes: 2 additions & 3 deletions internal/cli/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import (
"golang.org/x/term"

"github.com/GembaCore/gemba-core/internal/auth/credstore"
gembaclient "github.com/GembaCore/gemba-core/internal/client"
"github.com/GembaCore/gemba-core/internal/cli/serverconfig"
gembaclient "github.com/GembaCore/gemba-core/internal/client"
)

// whoamiResponse mirrors internal/server/whoami.go's wire shape.
Expand Down Expand Up @@ -253,7 +253,7 @@ func promptForTokenMasked(out io.Writer) (string, error) {
return "", fmt.Errorf("open /dev/tty: %w (use --token or --token-stdin)", err)
}
defer tty.Close()
fmt.Fprint(out, "Enter personal access token: ")
_, _ = fmt.Fprint(out, "Enter personal access token: ")
b, err := term.ReadPassword(int(tty.Fd()))
fmt.Fprintln(out)
if err != nil {
Expand Down Expand Up @@ -399,4 +399,3 @@ func printNotLoggedIn(out io.Writer, asJSON bool, server string) error {
fmt.Fprintln(out, "not logged in")
return nil
}

4 changes: 2 additions & 2 deletions internal/cli/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ going, up to --max-retries times.`,
if !follow {
return errors.New(
"transcript replay not yet implemented (server " +
"lacks GET /api/runs/{id}/transcript). Use -f " +
"to attach to the live stream instead.")
"lacks GET /api/runs/{id}/transcript); use -f " +
"to attach to the live stream instead")
}
return runLogsFollow(cmd, args[0])
},
Expand Down
3 changes: 2 additions & 1 deletion internal/cli/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ func runRunCmd(cmd *cobra.Command, beadID string) error {
"detached. resume with: gemba logs -f %s\n", runID)
// Cobra eats os.Exit-equivalent codes; the parent process gets
// 130 by exiting directly. This is the SIGINT convention.
os.Exit(exitCodeDetached)
stop()
os.Exit(exitCodeDetached) //nolint:gocritic // intentional: SIGINT exit convention after manual stop()
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/run_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (

"github.com/spf13/cobra"

gembaclient "github.com/GembaCore/gemba-core/internal/client"
"github.com/GembaCore/gemba-core/internal/cli/serverconfig"
gembaclient "github.com/GembaCore/gemba-core/internal/client"
)

// runClientFactory builds a typed client bound to server. Tests
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ import (
"github.com/GembaCore/gemba-core/internal/persona"
"github.com/GembaCore/gemba-core/internal/personas/onboarder"
"github.com/GembaCore/gemba-core/internal/server"
"github.com/GembaCore/gemba-core/internal/tenant"
"github.com/GembaCore/gemba-core/internal/server/metrics"
"github.com/GembaCore/gemba-core/internal/shader"
"github.com/GembaCore/gemba-core/internal/shader/gastown"
"github.com/GembaCore/gemba-core/internal/skills/bootstrap_review"
"github.com/GembaCore/gemba-core/internal/skills/epic_order"
"github.com/GembaCore/gemba-core/internal/skills/escalation_handoff"
"github.com/GembaCore/gemba-core/internal/tenant"
"github.com/GembaCore/gemba-core/internal/transport/api"
"github.com/GembaCore/gemba-core/internal/walk"
walksources "github.com/GembaCore/gemba-core/internal/walk/sources"
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/serve_embedded_dolt.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func bootstrapEmbeddedDoltSchema(ctx context.Context, sup *supervisor.Supervisor
if err != nil {
return fmt.Errorf("embedded dolt: mkdtemp for bd init: %w", err)
}
defer os.RemoveAll(tmpDir)
defer func() { _ = os.RemoveAll(tmpDir) }()

bdCtx, cancel := context.WithTimeout(ctx, 60*time.Second)
defer cancel()
Expand Down
17 changes: 9 additions & 8 deletions internal/cli/spec.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// gemba spec — ASDD interception layer command tree.
//
// Subcommands:
// spec new <slug> Scaffold a new spec directory (and optionally Kit files).
// spec init Seed ASDD project artifacts (constitution, hooks, CLAUDE.md).
// spec hook PreToolUse hook handlers (Write/Edit/NotebookEdit, Bash).
// spec preflight Refuse /implement when tasks.md still exists.
// spec reconcile Stub — to be implemented by the analyzer (gm-v0sp.21).
//
// spec new <slug> Scaffold a new spec directory (and optionally Kit files).
// spec init Seed ASDD project artifacts (constitution, hooks, CLAUDE.md).
// spec hook PreToolUse hook handlers (Write/Edit/NotebookEdit, Bash).
// spec preflight Refuse /implement when tasks.md still exists.
// spec reconcile Stub — to be implemented by the analyzer (gm-v0sp.21).
package cli

import (
Expand Down Expand Up @@ -127,9 +128,9 @@ func newSpecInitCmd() *cobra.Command {
return err
}
opts := scaffold.Options{
WriteHooks: asdd,
WriteConstitution: asdd,
UpdateClaudeMD: asdd || updateClaudeMD,
WriteHooks: asdd,
WriteConstitution: asdd,
UpdateClaudeMD: asdd || updateClaudeMD,
WriteSlashCommands: asdd,
}
r, err := scaffold.Apply(root, opts)
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/spec_analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func renderProposal(w io.Writer, p *analyzer.Proposal) {
fmt.Fprintf(tw, "%s\t%s\t%s\t%s\t%s\n",
b.LocalRef, b.Kind, dashIfEmpty(b.Parent), dashIfEmpty(b.Priority), b.Title)
}
tw.Flush()
_ = tw.Flush()
}

func dashIfEmpty(s string) string {
Expand Down
12 changes: 6 additions & 6 deletions internal/cli/spec_diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ import (
// newSpecDiffCmd wires `gemba spec diff <spec.md>`.
//
// It is a pure planner — no bd mutations, no disk writes. The CLI:
// 1. parses spec.md,
// 2. loads the sibling .spec.lock.json (if any),
// 3. calls reconcile.Diff with either the real bd lister or a test stub
// (--bd-stub <path-to-json>),
// 4. emits either a human table or JSON.
// 1. parses spec.md,
// 2. loads the sibling .spec.lock.json (if any),
// 3. calls reconcile.Diff with either the real bd lister or a test stub
// (--bd-stub <path-to-json>),
// 4. emits either a human table or JSON.
func newSpecDiffCmd() *cobra.Command {
var jsonOut bool
var label string
Expand Down Expand Up @@ -146,7 +146,7 @@ func renderPlanTable(cmd *cobra.Command, plan *reconcile.Plan) error {
emit(plan.Creates)
emit(plan.Updates)
emit(plan.Orphans)
tw.Flush()
_ = tw.Flush()
fmt.Fprintf(out, "summary: %d create, %d update, %d orphan\n",
len(plan.Creates), len(plan.Updates), len(plan.Orphans))
return nil
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/spec_lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func newSpecLintCmd() *cobra.Command {
}
fmt.Fprintf(tw, "%s\t%s\t%s\t%s\n", sev, f.Rule, f.Anchor, f.Message)
}
tw.Flush()
_ = tw.Flush()
}
}
if strict {
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/spec_promote.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func newSpecPromoteCmd() *cobra.Command {
return nil
}

fmt.Fprint(cmd.OutOrStdout(), diff)
_, _ = fmt.Fprint(cmd.OutOrStdout(), diff)
return nil
},
}
Expand Down
9 changes: 5 additions & 4 deletions internal/cli/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ func fetchStatus(ctx context.Context, c *gembaclient.Client, srv string) (status
if err != nil {
// Some adaptors won't recognize "open" as a status; that's
// fine — fall back to ready+in_progress as the floor.
openItems = append(ready, inflight...)
openItems = make([]core.WorkItem, 0, len(ready)+len(inflight))
openItems = append(openItems, ready...)
openItems = append(openItems, inflight...)
}
closedToday := 0
if closed, err := c.ListWorkItemsByStatus(ctx, "closed"); err == nil {
Expand Down Expand Up @@ -352,7 +354,7 @@ func renderAdHoc(w io.Writer, p statusPayload) {
fmt.Fprintf(tw, " ○\t%s\t%s\t%s\n",
string(wi.ID), priorityBadge(wi.Priority), wi.Title)
}
tw.Flush()
_ = tw.Flush()
}
fmt.Fprintln(w)

Expand Down Expand Up @@ -382,7 +384,7 @@ func renderAdHoc(w io.Writer, p statusPayload) {
fmt.Fprintf(tw, " ◐\t%s\t%s\t%s%s\n",
string(wi.ID), priorityBadge(wi.Priority), wi.Title, suffix)
}
tw.Flush()
_ = tw.Flush()
}
fmt.Fprintln(w)

Expand Down Expand Up @@ -438,4 +440,3 @@ func humanDuration(d time.Duration) string {
return fmt.Sprintf("%dd", int(d.Hours()/24))
}
}

1 change: 0 additions & 1 deletion internal/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,4 +283,3 @@ func indexOf(s, sub string) int {
}
return -1
}

1 change: 1 addition & 0 deletions internal/client/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func (c *Client) WorkspaceStatus(ctx context.Context, wsid string) (*WorkspaceSt
if err != nil {
return nil, err
}
defer resp.Body.Close()
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
return nil, mapErr(resp, raw)
}
Expand Down
Loading
Loading