| @@ -4,7 +4,7 @@ |
| 4 | 4 | |
| 5 | 5 | **Goal:** A snippet a user owns, shares by URL, and edits in place: one or more named text files, a description, and a visibility. Closes #195. |
| 6 | 6 | |
| 7 | | **Architecture:** Two new tables (migration 0053) hold snippets and their files; content sits in SQLite as a BLOB. Eight `snippet` control commands in `internal/control/snippet.go` are the only write path; the CLI, the JSON API and the web forms dispatch into them. Read rules live in `internal/policy/snippets.go`. The web renders under `/{owner}/-/snippets`, the pattern `/{owner}/-/labels` set. |
| 7 | **Architecture:** Two new tables (migration 0054) hold snippets and their files; content sits in SQLite as a BLOB. Eight `snippet` control commands in `internal/control/snippet.go` are the only write path; the CLI, the JSON API and the web forms dispatch into them. Read rules live in `internal/policy/snippets.go`. The web renders under `/{owner}/-/snippets`, the pattern `/{owner}/-/labels` set. |
| 8 | 8 | |
| 9 | 9 | **Tech Stack:** Go, SQLite via modernc (hand-written SQL, no ORM), Go `html/template`, chroma through the existing `highlight`, the control registry in `internal/control`, the e2e harness in `e2e/`. |
| 10 | 10 | |
| @@ -33,11 +33,11 @@ Names used across tasks, fixed here so the tasks agree: |
| 33 | 33 | |
| 34 | 34 | --- |
| 35 | 35 | |
| 36 | | ### Task 1: Migration 0053 and the store |
| 36 | ### Task 1: Migration 0054 and the store |
| 37 | 37 | |
| 38 | 38 | **Files:** |
| 39 | | - Create: `internal/store/migrations/0053_snippets.up.sql` |
| 40 | | - Create: `internal/store/migrations/0053_snippets.down.sql` |
| 39 | - Create: `internal/store/migrations/0054_snippets.up.sql` |
| 40 | - Create: `internal/store/migrations/0054_snippets.down.sql` |
| 41 | 41 | - Create: `internal/store/snippets.go` |
| 42 | 42 | - Test: `internal/store/snippets_test.go` |
| 43 | 43 | |
| @@ -193,7 +193,7 @@ Expected: compile error, `s.CreateSnippet undefined`. |
| 193 | 193 | |
| 194 | 194 | - [ ] **Step 3: Write the migration** |
| 195 | 195 | |
| 196 | | `internal/store/migrations/0053_snippets.up.sql`: |
| 196 | `internal/store/migrations/0054_snippets.up.sql`: |
| 197 | 197 | |
| 198 | 198 | ```sql |
| 199 | 199 | -- Snippets: named text files a user owns and shares by URL, outside any |
| @@ -218,7 +218,7 @@ CREATE TABLE snippet_files ( |
| 218 | 218 | ); |
| 219 | 219 | ``` |
| 220 | 220 | |
| 221 | | `internal/store/migrations/0053_snippets.down.sql`: |
| 221 | `internal/store/migrations/0054_snippets.down.sql`: |
| 222 | 222 | |
| 223 | 223 | ```sql |
| 224 | 224 | DROP TABLE snippet_files; |
| @@ -463,8 +463,8 @@ Expected: PASS, including `TestMigrateUpDown` (the down file drops both tables) |
| 463 | 463 | - [ ] **Step 6: Commit** |
| 464 | 464 | |
| 465 | 465 | ```bash |
| 466 | | git add internal/store/migrations/0053_snippets.up.sql internal/store/migrations/0053_snippets.down.sql internal/store/snippets.go internal/store/snippets_test.go |
| 467 | | git commit -m "store: snippets and snippet_files (migration 0053) |
| 466 | git add internal/store/migrations/0054_snippets.up.sql internal/store/migrations/0054_snippets.down.sql internal/store/snippets.go internal/store/snippets_test.go |
| 467 | git commit -m "store: snippets and snippet_files (migration 0054) |
| 468 | 468 | |
| 469 | 469 | Ref #195" |
| 470 | 470 | ``` |
| @@ -1857,7 +1857,7 @@ Before `* v1.19.0 — 2026-09-11` add: |
| 1857 | 1857 | Snippets (#195): named text files a user owns outside any repository, |
| 1858 | 1858 | shared by URL and edited in place. |
| 1859 | 1859 | |
| 1860 | | - Migration 0053: =snippets= and =snippet_files=. |
| 1860 | - Migration 0054: =snippets= and =snippet_files=. |
| 1861 | 1861 | - =snippet create|show|list|edit|delete= and =snippet file |
| 1862 | 1862 | set|get|remove=. Files are UTF-8 under =limits.max_snippet_bytes= |
| 1863 | 1863 | (1MB), at most 64 per snippet; a snippet keeps at least one. |
| @@ -1890,7 +1890,7 @@ gitbay mr create --source snippets --target main --title "Snippets (#195)" --fil |
| 1890 | 1890 | Named text files a user owns outside any repository, shared by URL and |
| 1891 | 1891 | edited in place. Spec: docs/specs/2026-09-11-snippets-design.md. |
| 1892 | 1892 | |
| 1893 | | Migration 0053. Commands snippet create|show|list|edit|delete and |
| 1893 | Migration 0054. Commands snippet create|show|list|edit|delete and |
| 1894 | 1894 | snippet file set|get|remove; web under /{owner}/-/snippets with forms |
| 1895 | 1895 | dispatching the same commands. New limit max_snippet_bytes (1MB). |
| 1896 | 1896 | |