summaryrefslogtreecommitdiff
path: root/integrationtests/ask_test.go
AgeCommit message (Collapse)Author
2026-04-13Release v0.33.0: ask dependency UX and start gatingPaul Buetow
Show only task alias IDs on ask info Depends lines. Block ask start until every dependency is completed. Bump version to 0.33.0. Made-with: Cursor
2026-04-11Rename task CLI binary from do back to askPaul Buetow
- Move cmd/do to cmd/ask; mage builds and installs ask; Fish completions to ask.fish - Update askcli help text, errors, executor default label, and Fish script (__ask_*) - Task alias cache subdirectory under XDG cache: hexai/ask/ - Rename integration test files and helpers; refresh README and docs - Rename plan-do-uuid-wrapper.md to plan-ask-uuid-wrapper.md Made-with: Cursor
2026-04-08Rename task CLI from ask to doPaul Buetow
- Move cmd/ask to cmd/do; mage BuildDo builds binary named do - Update askcli help text, errors, Fish completion (complete -c do, __do_*) - Task alias cache path: XDG cache hexai/do/task-aliases-v2.json - Refresh README and docs; go install path cmd/do@latest - Remove accidentally tracked cmd/ask build artifact; ignore cmd/do/do and cmd/do/ask Made-with: Cursor
2026-04-07fix: recover gracefully from corrupted alias cache instead of hard-failingPaul Buetow
When the task alias cache file contains invalid JSON (e.g. from a concurrent write race producing two concatenated JSON objects), the previous code returned a hard error that blocked all `ask` subcommands. Now loadTaskAliasCache discards the corrupt file and starts fresh, assigning new alias IDs on the next run. Validation errors (e.g. next_id reuse) still surface as errors since those indicate a logic bug. Also fix stale v1 reference in integration test aliasCachePath. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28fix: prevent integration test task leaks and fix cleanup reliabilityPaul Buetow
Two related issues with the integration test cleanup: 1. deleteTask used the test's context, which could be cancelled if the test had already timed out — causing deferred cleanup to silently fail and leak Taskwarrior tasks across runs. Fixed by using a fresh background context with a short timeout inside deleteTask. 2. No mechanism existed to clean up tasks leaked by previous runs, which could accumulate and pollute subsequent test runs. Added cleanupOrphanedIntegrationTasks() called from TestMain that bulk-deletes all project:hexai +integrationtest pending tasks using taskwarrior's "all" confirmation answer for efficiency. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27release: v0.27.2v0.27.2Paul Buetow
2026-03-27release: v0.27.1v0.27.1Paul Buetow
2026-03-27askcli: support add depends selectorsPaul Buetow
2026-03-27fix ask add alias output for 1a1731dc-1f11-42bd-be12-4c1af7f7e673Paul Buetow
2026-03-27test: cover ask info dependencies 052ad39a-6967-4628-a65c-db2a163de09bPaul Buetow
2026-03-27Add alias coverage for task b777fcc2-8f64-4250-b0ac-6038a8aa26b4Paul Buetow
2026-03-26test: cover ask subcommands bc6220a5-4fd3-4413-abce-3555230ac919Paul Buetow
2026-03-23fix: code quality improvements across lsp, askcli, appconfig, integrationtestsPaul Buetow
- lsp/handlers_completion.go: track collectFirstCompletion goroutine in inflight WaitGroup (goroutine leak fix) - lsp/transport.go: use %w instead of %v for error wrapping - askcli/command_list.go: extract handleListWithFilters shared helper; handleList/handleAll/handleReady are now single-liners - askcli/command_list.go, urgency.go, dep.go: log ParseTaskExport errors to stderr instead of returning 1 silently - appconfig/config_load.go: rename 'any' variable to 'found' to avoid shadowing the built-in identifier - llm/provider.go: add explanatory comment for package-level registry - integrationtests/ask_test.go: add //go:build integration tag; move repoRoot init from init() to TestMain with diagnostic error message Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23fix: address all HIGH-severity code quality audit findingsPaul Buetow
- lsp/server.go: track request goroutines in inflight WaitGroup to prevent use-after-close writes on shutdown - lsp/llm_client_registry.go: acquire write lock before calling build() to eliminate TOCTOU race on cache population - lsp/handlers_codeaction.go: resolveSimplifyCodeAction now uses PromptCodeActionSimplify{System,User} (was wrongly using rewrite prompts) - askcli/taskexport.go: remove exported MustParseTaskExport to prevent panic on malformed external input; move to unexported test helper - cmd/ask/main.go: print error to stderr before os.Exit - llm/{openai,ollama,openrouter}.go: add interface satisfaction assertions - integrationtests/ask_test.go: replace type assertions with errors.As for robust exec.ExitError unwrapping Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23integrationtests: complete ask coverage, fix weak assertionsPaul Buetow
- TestAnnotate: now verifies annotation text appears in ask info output - TestDenotate: now verifies annotation is absent after removal - TestMain: always rebuilds binary (not only when missing) - Add TestAddReturnsUUID: asserts output matches UUID regex, never numeric - Add TestHelp: verifies ask help exits 0 and lists all subcommands - Add TestUnknownCommand: verifies unknown subcommand exits non-zero - Remove unnecessary runAskWithStdin calls for commands that don't forward stdin to taskwarrior (start, stop, priority, tag, modify, annotate, dep add/rm); only delete actually needs stdin forwarding - Add getTaskInfoRaw helper for full info text assertions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23ask add: always emit UUID, never the numeric task IDPaul Buetow
Use rc.verbose=new-uuid so taskwarrior prints "Created task <uuid>." directly on stdout. Parse the UUID from that line instead of doing a two-step numeric-ID lookup or falling back to an export call. Removes ExtractUUIDFromOutput (which could leak numeric IDs) and fetchUUIDByNumericID (the export fallback). Integration tests now get the UUID straight from ask add output without any extra calls. Also fixes TestMain_WiresDispatcher which expected "export" first in args, but list now prepends status:pending filter. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22ask: fix CLI commands to use correct Taskwarrior argument formatsv0.25.2Paul Buetow
- handlePriority: use 'uuid:<uuid> modify priority:<level>' instead of 'priority <uuid> <level>' - handleTag: use 'uuid:<uuid> modify +/-tag' instead of 'tag <uuid> +/-tag' - handleDelete: use 'uuid:<uuid> delete' and pass stdin for confirmation - handleDenotate: use 'uuid:<uuid> denotate <pattern>' instead of 'denotate <uuid> <pattern>' - Add integration tests for all ask CLI subcommands - Update unit tests to match new command argument formats - createTask now uses task info to get UUID instead of export parsing - parseTaskInfoText fixed to split tags by ', ' instead of whitespace