From 9794c5f29c1e633a86382a817219408ae89291c2 Mon Sep 17 00:00:00 2001 From: orbit Date: Sun, 10 May 2026 13:54:53 -0700 Subject: [PATCH] feat: parallel batch [T20260510-19] Tasks: - T20260510-19: Fix failing CI lint check and document CI completion expectations --- CLAUDE.md | 5 +++++ internal/engine/workspace_state.go | 9 --------- test/integration/unapply_test.go | 27 +++++++++++++++++---------- 3 files changed, 22 insertions(+), 19 deletions(-) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..a67a979 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,5 @@ +# Agent Instructions + +- Follow the repository's established engineering practices and keep changes scoped to the task. +- After completing work, check CI status and ensure CI checks pass before handing off. +- For local validation, prefer the same checks used by CI: `make lint`, `make test`, and `make test-integration`. diff --git a/internal/engine/workspace_state.go b/internal/engine/workspace_state.go index 08c632a..654be1f 100644 --- a/internal/engine/workspace_state.go +++ b/internal/engine/workspace_state.go @@ -57,15 +57,6 @@ func (e *Engine) workspaceStateStores() []state.StateStore { return stores } -// workspacesDirs returns workspace directory paths for scanning (both scopes). -func (e *Engine) workspacesDirs() []string { - var dirs []string - for _, source := range e.workspaceStateSources() { - dirs = append(dirs, source.dir) - } - return dirs -} - func (e *Engine) forEachWorkspaceState(fn func(workspaceID string, ws *state.WorkspaceState) error) error { seen := make(map[string]bool) diff --git a/test/integration/unapply_test.go b/test/integration/unapply_test.go index af34435..e269307 100644 --- a/test/integration/unapply_test.go +++ b/test/integration/unapply_test.go @@ -2,6 +2,7 @@ package integration import ( "context" + "errors" "os" "path/filepath" "testing" @@ -291,21 +292,27 @@ func TestUnapply_DriftDetection(t *testing.T) { Force: false, } - // Note: Current implementation doesn't return warnings for drift, - // but validation should still pass (we remove the file anyway) result, err := eng.Unapply(ctx, req) - if err != nil { - t.Fatalf("Unapply() error = %v", err) + if result != nil { + t.Fatalf("Unapply() result = %#v, want nil", result) + } + if !errors.Is(err, engine.ErrValidation) { + t.Fatalf("Unapply() error = %v, want ErrValidation", err) + } + if !errors.Is(err, engine.ErrDrift) { + t.Fatalf("Unapply() error = %v, want ErrDrift", err) } - // Verify file was still removed (drift doesn't prevent removal) - if len(result.Removed) != 1 { - t.Errorf("expected 1 path removed, got %d", len(result.Removed)) + if _, ok := fs.files[configPath]; !ok { + t.Fatal("drifted workspace file was removed") } - // Verify file was removed from filesystem - if _, ok := fs.files[configPath]; ok { - t.Error("expected file to be removed despite drift") + updated, err := stateStore.LoadWorkspace(workspaceID) + if err != nil { + t.Fatalf("failed to load workspace state: %v", err) + } + if _, ok := updated.Paths["config.json"]; !ok { + t.Fatal("workspaceState.Paths removed drifted config.json; want entry intact") } }