Commit Graph

119 Commits

Author SHA1 Message Date
typebasedio 2a606053dd docs: anti-guessing guardrails in project CLAUDE.md and seeded workspace template
Add "Repository and Package Identity" rule to both the project-level CLAUDE.md
and the seeded CLAUDE.md template (internal/seed/templates.go). Every new ctask
workspace now inherits guidance against fabricating repo URLs, module paths,
GitHub identities, or remote install commands.

Also adds local-only build/install instructions and data safety invariant
documentation to the project-level CLAUDE.md.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 16:09:29 -04:00
typebasedio 37a1c69e26 fix: active workspace delete protection now checks manifest file, not just env var
Root cause: CTASK_WORKSPACE env var only exists inside the child session spawned
by ctask resume. A separate terminal window does not inherit it, so the env-var
check was bypassed entirely. os.RemoveAll then deleted all accessible files while
the root dir was locked by the active cmd.exe process.

Fix: Add a second protection check for .ctask/manifest-start.json, which is only
present during a live session. Both checks run before any mutation (summary scan,
confirmation, or deletion). Either check triggers immediate refusal.

Tests: 4 new tests covering manifest-based protection, no-file-mutation on refusal,
env-var protection, and normal deletion of inactive workspaces.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 16:01:48 -04:00
typebasedio 75911faeeb fix: replace all non-ASCII characters with safe ASCII equivalents
Replace box-drawing characters (U+2500) in session log with ASCII dashes.
Replace em dashes (U+2014) in CLAUDE.md template with double hyphens.
Remove em dash from comment in run.go.
Add ASCII-guard tests for session log output and seed templates.
Prevents mojibake on Windows terminals that misinterpret UTF-8 as CP1252.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 10:15:02 -04:00
typebasedio f967064331 docs: add v0.2 spec
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 10:05:27 -04:00
typebasedio 69c487cf79 feat: v0.2 tests for manifest capture, diff, ignore rules, and session log
11 new tests covering manifest capture/exclusion, roundtrip, diff logic, ignore rules (task.yaml, sessions.log, .ctask/), notes updated detection, session log formatting, append-only behavior, short session detection. Fix cross-platform ignore rule for logs/sessions.log.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 10:01:31 -04:00
typebasedio f5ca85a788 feat: ctask delete command with confirmation and active workspace protection
Contents summary, confirmation prompt, --force flag, --all for archived, refuses deletion of active session workspace.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 09:59:59 -04:00
typebasedio e15a47079a feat: ctask last command to resume most recently updated workspace
Scans non-archived workspaces, finds highest updated_at, delegates to resume flow with session hooks.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 09:58:40 -04:00
typebasedio 30d3e64d7e feat: ctask doctor command with 5 health checks
Checks: workspace root, agent on PATH, status line helper, Claude settings, existing workspaces. Actionable fix guidance for each failure.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 09:57:58 -04:00
typebasedio aba4a645b1 feat: add session handoff guidance to seeded CLAUDE.md template
Advisory instructions to append a brief summary to notes.md before ending a session. Also update logs/ description from "reserved" to "automatic session snapshots".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 09:56:55 -04:00
typebasedio 10ab9efc80 feat: session lifecycle wrapper with manifest capture and session logging
Refactor new/resume/open to use session.Run() which wraps child process launch with pre/post manifest capture and append-only session logging to logs/sessions.log. Bump version to 0.2.0.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 09:56:21 -04:00
typebasedio 57f345ae2b fix: exit codes match spec (0, 1, 2, 127) and silence usage on runtime errors
Exit 2 for missing required arguments, exit 127 for agent not found. SilenceUsage on all commands to avoid dumping usage on runtime errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 18:40:50 -04:00
typebasedio 8e930c6b7a feat: status line helper scripts and setup documentation
Bash and PowerShell helpers for Claude Code statusLine. Setup docs with fallback note for non-Claude agents.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 18:35:42 -04:00
typebasedio 50e7333e84 feat: all six CLI commands (new, list, resume, open, info, archive)
Complete command implementations with all flags per spec. Shared query resolution helper.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 18:34:40 -04:00
typebasedio afd594ed6c feat: platform-specific shell and agent launch helpers
DefaultShell, ExecAgent, ExecShell with prompt prefix. Banner, container notice. Tests for all helpers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 18:32:55 -04:00
typebasedio 6740c3835e feat: query resolution and workspace listing
5-step query resolution (exact dir, exact slug, substring), archived exclusion. Listing with category filter, limit, reverse-chronological sort.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 18:32:12 -04:00
typebasedio 17789e4b9f feat: workspace creation with seed files and collision handling
Create function produces full workspace layout (task.yaml, CLAUDE.md, notes.md, context/, output/, logs/). Seed files only written if missing. Collision suffixing tested.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 18:30:59 -04:00
typebasedio 7b75cb5f3d feat: slug generation and directory collision resolution
Slugify, AutoTitle, DirName, ResolveDir with -2, -3 suffixing. Full test coverage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 18:30:06 -04:00
typebasedio 514f2d8233 feat: workspace metadata model with YAML read/write
TaskMeta struct matching task.yaml schema exactly. Tests for roundtrip, field presence, and archive state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 18:29:26 -04:00
typebasedio ab56ddfff0 feat: project init with config package and root command
Go module, cobra root command, config resolution (CTASK_ROOT, CTASK_AGENT, EnvVars) with tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 18:28:24 -04:00