|
1 | 1 | # Tasks — Context CLI |
2 | 2 |
|
3 | | -## In Progress |
| 3 | +# Tasks |
4 | 4 |
|
5 | | -## Phase 1 |
| 5 | +### Phase 1: Parser |
6 | 6 |
|
7 | | -- [ ] Verify all Markdown files by "actually reading them"; take notes for |
8 | | - follow-up actions. |
9 | | -- [ ] All go code should have godoc and testing. |
10 | | -- [ ] GitHub CI linter is giving errors that need fixing. |
11 | | -- [ ] Manual code review. take notes. |
12 | | -- [ ] Add tests per file. |
13 | | -- [ ] validate everything in the docs with a skeptical eye. |
14 | | -- [ ] consider the case where `ctx` is not called from within AI prompt: |
15 | | - - does the command still make sense? |
16 | | - - does it create the expected output? |
17 | | -- [ ] Cut the first release. |
| 7 | +- [ ] T1.1.1: Define data structures in `internal/recall/parser/types.go` |
| 8 | + - `SessionMessage`, `Session`, `ContentBlock` interface |
| 9 | + - `TextBlock`, `ThinkingBlock`, `ToolUseBlock`, `ToolResultBlock` |
| 10 | + - `TokenUsage` struct |
| 11 | + - Must match `specs/recall/v0.1.0/01-session-schema.md` |
| 12 | + |
| 13 | +- [ ] T1.1.2: Implement line parser in `internal/recall/parser/parser.go` |
| 14 | + - `ParseLine(line []byte) (*SessionMessage, error)` |
| 15 | + - Handle malformed JSON (return error, don't panic) |
| 16 | + - Handle missing optional fields with defaults |
| 17 | + |
| 18 | +- [ ] T1.1.3: Implement session grouper |
| 19 | + - `ParseFile(path string) (map[string]*Session, error)` |
| 20 | + - Stream lines, don't load entire file into memory |
| 21 | + - Sort messages by timestamp within each session |
| 22 | + - Calculate: TurnCount, TotalTokensIn, TotalTokensOut, Duration |
| 23 | + |
| 24 | +- [ ] T1.1.4: Implement directory scanner |
| 25 | + - `ScanDirectory(path string) ([]*Session, error)` |
| 26 | + - Recurse into subdirectories |
| 27 | + - Skip non-JSONL files |
| 28 | + - Aggregate sessions across files |
| 29 | + |
| 30 | +### Phase 2: Renderer |
| 31 | + |
| 32 | +- [ ] T1.2.1: Set up template system in `internal/recall/renderer/` |
| 33 | + - Use `//go:embed` for templates |
| 34 | + - Create `templates/layout.html` with dark mode CSS |
| 35 | + - Create `templates/index.html` |
| 36 | + - Create `templates/session.html` |
| 37 | + |
| 38 | +- [ ] T1.2.2: Implement markdown renderer |
| 39 | + - Add goldmark + chroma dependencies |
| 40 | + - `RenderMarkdown(text string) template.HTML` |
| 41 | + - Enable GFM extensions |
| 42 | + - Syntax highlighting with monokai theme |
| 43 | + |
| 44 | +- [ ] T1.2.3: Implement session renderer |
| 45 | + - `RenderSession(session *Session) (*RenderedSession, error)` |
| 46 | + - Wrap thinking blocks in `<details>` (collapsed by default) |
| 47 | + - Format tool calls with syntax-highlighted input/output |
18 | 48 |
|
| 49 | +- [ ] T1.2.4: Implement index renderer |
| 50 | + - `RenderIndex(sessions []*Session, filters Filters) (*RenderedIndex, error)` |
| 51 | + - Sort by date (newest first) |
| 52 | + - Include preview (first 100 chars of first user message) |
| 53 | + - Show aggregate stats |
19 | 54 |
|
20 | | -## Next Up |
| 55 | +### Phase 3: Server |
21 | 56 |
|
22 | | -- [ ] Enforce test coverage targets in CI/Makefile #priority:medium #area:quality |
23 | | - - internal/cli: 60% (currently 62.8%) |
24 | | - - internal/context: 80% (currently 86.8%) |
25 | | - - internal/drift: 80% (currently 88.0%) |
26 | | - - internal/claude: 80% (currently 87.5%) |
27 | | - - internal/templates: 80% (currently 88.9%) |
| 57 | +- [ ] T1.3.1: Set up HTTP server in `internal/recall/server/` |
| 58 | + - Standard library `net/http` |
| 59 | + - Graceful shutdown on SIGINT/SIGTERM |
| 60 | + - Embed static assets with `//go:embed` |
28 | 61 |
|
29 | | -## Completed (Recent) |
| 62 | +- [ ] T1.3.2: Implement index route |
| 63 | + - `GET /` — render index page |
| 64 | + - `GET /?project=X` — filter by project |
| 65 | + - `GET /?after=DATE&before=DATE` — filter by date |
| 66 | + - `GET /?q=QUERY` — search sessions |
30 | 67 |
|
31 | | -## Blocked |
| 68 | +- [ ] T1.3.3: Implement session detail route |
| 69 | + - `GET /session/:id` — render session detail |
| 70 | + - 404 if not found |
| 71 | + - Include back link to index |
32 | 72 |
|
33 | | -## Reference |
| 73 | +- [ ] T1.3.4: Implement API routes |
| 74 | + - `GET /api/sessions` — JSON session list |
| 75 | + - `GET /api/session/:id` — JSON session detail |
34 | 76 |
|
35 | | -**Specs** (in `specs/` directory): |
36 | | -- `core-architecture.md` — Overall design philosophy |
37 | | -- `go-cli-implementation.md` — Go project structure and patterns |
38 | | -- `cli.md` — All CLI commands and their behavior |
39 | | -- `context-file-formats.md` — File format specifications |
40 | | -- `context-loader.md` — Loading and parsing logic |
41 | | -- `context-updater.md` — Update command handling |
| 77 | +### Phase 4: Search |
42 | 78 |
|
43 | | -**Task Status Labels**: |
44 | | -- `[ ]` — pending |
45 | | -- `[x]` — completed |
46 | | -- `[-]` — skipped (with reason) |
47 | | -- `#in-progress` — currently being worked on (add inline, don't move task) |
| 79 | +- [ ] T1.4.1: Implement search index in `internal/recall/search/` |
| 80 | + - Inverted index: term → sessionIds |
| 81 | + - `Build(sessions []*Session)` |
| 82 | + - Tokenize: lowercase, split whitespace, remove punctuation |
| 83 | + |
| 84 | +- [ ] T1.4.2: Implement search query |
| 85 | + - `Search(query string, limit int) []string` |
| 86 | + - AND semantics (all terms must match) |
| 87 | + - Sort by term frequency score |
| 88 | + |
| 89 | +### Phase 5: CLI |
| 90 | + |
| 91 | +- [ ] T1.5.1: Add recall subcommand |
| 92 | + - Create `cmd/ctx/recall.go` |
| 93 | + - `ctx recall serve <path>` — start server |
| 94 | + - `--port` flag (default: 8080) |
| 95 | + - `--open` flag to open browser |
| 96 | + |
| 97 | +- [ ] T1.5.2: Add help and validation |
| 98 | + - Validate path exists and has JSONL files |
| 99 | + - Print URL when server starts |
| 100 | + - Print stats (sessions loaded, time taken) |
| 101 | + |
| 102 | +## Backlog |
| 103 | + |
| 104 | +- [x] Rename vars in the config package. |
| 105 | +- [x] Why is agent runbook lowest in reading priority order? |
| 106 | + - follow-up: is it enforced? |
| 107 | +- [x] Create a list of what CLI options (if any) are not implemented yet. |
| 108 | +- [ ] Verify all Markdown files by "actually reading them"; take notes for |
| 109 | + follow-up actions. |
| 110 | +- [x] All go code should have godoc and testing. |
| 111 | +- [ ] GitHub CI linter is giving errors that need fixing. |
| 112 | +- [x] Manual code review. take notes. |
| 113 | +- [x] Add tests per file. |
| 114 | +- [ ] validate everything in the docs with a skeptical eye. |
| 115 | +- [x] consider the case where `ctx` is not called from within AI prompt: |
| 116 | + - does the command still make sense? |
| 117 | + - does it create the expected output? |
| 118 | +- [ ] Cut the first release. |
| 119 | + - Versioning strategy. |
| 120 | + - Always have a `latest` tag pointing to the latest release. |
| 121 | + - Or, maybe just use the `latest` tag at all times? |
| 122 | +- [ ] have a proper email for security vulnerability reports. |
| 123 | +- [ ] compare versions of recent change and the last AI-assisted version and |
| 124 | + ask AI what we have learned about this. |
| 125 | +- [ ] CREATE SHORTS and VODS |
| 126 | +- [ ] Trace the entire git history and sessions, create an extensive document |
| 127 | + of what we did and how it progressed, and then create a blog post about it. |
48 | 128 |
|
49 | | -**Archives**: See `.context/archive/` for completed tasks from previous phases. |
|
0 commit comments