@mindfoldhq/trellis 0.6.0-beta.11 → 0.6.0-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/commands/channel/context.d.ts +16 -0
  2. package/dist/commands/channel/context.d.ts.map +1 -0
  3. package/dist/commands/channel/context.js +83 -0
  4. package/dist/commands/channel/context.js.map +1 -0
  5. package/dist/commands/channel/create.d.ts +15 -8
  6. package/dist/commands/channel/create.d.ts.map +1 -1
  7. package/dist/commands/channel/create.js +26 -97
  8. package/dist/commands/channel/create.js.map +1 -1
  9. package/dist/commands/channel/index.d.ts.map +1 -1
  10. package/dist/commands/channel/index.js +195 -9
  11. package/dist/commands/channel/index.js.map +1 -1
  12. package/dist/commands/channel/kill.d.ts +1 -0
  13. package/dist/commands/channel/kill.d.ts.map +1 -1
  14. package/dist/commands/channel/kill.js +16 -13
  15. package/dist/commands/channel/kill.js.map +1 -1
  16. package/dist/commands/channel/list.d.ts +1 -0
  17. package/dist/commands/channel/list.d.ts.map +1 -1
  18. package/dist/commands/channel/list.js +27 -17
  19. package/dist/commands/channel/list.js.map +1 -1
  20. package/dist/commands/channel/messages.d.ts +3 -0
  21. package/dist/commands/channel/messages.d.ts.map +1 -1
  22. package/dist/commands/channel/messages.js +86 -58
  23. package/dist/commands/channel/messages.js.map +1 -1
  24. package/dist/commands/channel/rm.d.ts +2 -0
  25. package/dist/commands/channel/rm.d.ts.map +1 -1
  26. package/dist/commands/channel/rm.js +15 -5
  27. package/dist/commands/channel/rm.js.map +1 -1
  28. package/dist/commands/channel/run.js +1 -1
  29. package/dist/commands/channel/run.js.map +1 -1
  30. package/dist/commands/channel/send.d.ts +2 -0
  31. package/dist/commands/channel/send.d.ts.map +1 -1
  32. package/dist/commands/channel/send.js +18 -32
  33. package/dist/commands/channel/send.js.map +1 -1
  34. package/dist/commands/channel/spawn.d.ts +1 -0
  35. package/dist/commands/channel/spawn.d.ts.map +1 -1
  36. package/dist/commands/channel/spawn.js +14 -11
  37. package/dist/commands/channel/spawn.js.map +1 -1
  38. package/dist/commands/channel/store/events.d.ts +33 -14
  39. package/dist/commands/channel/store/events.d.ts.map +1 -1
  40. package/dist/commands/channel/store/events.js +56 -33
  41. package/dist/commands/channel/store/events.js.map +1 -1
  42. package/dist/commands/channel/store/filter.d.ts +3 -0
  43. package/dist/commands/channel/store/filter.d.ts.map +1 -0
  44. package/dist/commands/channel/store/filter.js +2 -0
  45. package/dist/commands/channel/store/filter.js.map +1 -0
  46. package/dist/commands/channel/store/paths.d.ts +7 -0
  47. package/dist/commands/channel/store/paths.d.ts.map +1 -1
  48. package/dist/commands/channel/store/paths.js +76 -17
  49. package/dist/commands/channel/store/paths.js.map +1 -1
  50. package/dist/commands/channel/store/schema.d.ts +27 -0
  51. package/dist/commands/channel/store/schema.d.ts.map +1 -0
  52. package/dist/commands/channel/store/schema.js +34 -0
  53. package/dist/commands/channel/store/schema.js.map +1 -0
  54. package/dist/commands/channel/store/thread-state.d.ts +5 -0
  55. package/dist/commands/channel/store/thread-state.d.ts.map +1 -0
  56. package/dist/commands/channel/store/thread-state.js +16 -0
  57. package/dist/commands/channel/store/thread-state.js.map +1 -0
  58. package/dist/commands/channel/store/watch.d.ts +4 -21
  59. package/dist/commands/channel/store/watch.d.ts.map +1 -1
  60. package/dist/commands/channel/store/watch.js +8 -54
  61. package/dist/commands/channel/store/watch.js.map +1 -1
  62. package/dist/commands/channel/supervisor.d.ts +1 -1
  63. package/dist/commands/channel/supervisor.d.ts.map +1 -1
  64. package/dist/commands/channel/supervisor.js +11 -10
  65. package/dist/commands/channel/supervisor.js.map +1 -1
  66. package/dist/commands/channel/text-body.d.ts +13 -0
  67. package/dist/commands/channel/text-body.d.ts.map +1 -0
  68. package/dist/commands/channel/text-body.js +47 -0
  69. package/dist/commands/channel/text-body.js.map +1 -0
  70. package/dist/commands/channel/threads.d.ts +39 -0
  71. package/dist/commands/channel/threads.d.ts.map +1 -0
  72. package/dist/commands/channel/threads.js +106 -0
  73. package/dist/commands/channel/threads.js.map +1 -0
  74. package/dist/commands/channel/title.d.ts +12 -0
  75. package/dist/commands/channel/title.d.ts.map +1 -0
  76. package/dist/commands/channel/title.js +24 -0
  77. package/dist/commands/channel/title.js.map +1 -0
  78. package/dist/commands/channel/wait.d.ts +3 -0
  79. package/dist/commands/channel/wait.d.ts.map +1 -1
  80. package/dist/commands/channel/wait.js +9 -8
  81. package/dist/commands/channel/wait.js.map +1 -1
  82. package/dist/migrations/manifests/0.6.0-beta.12.json +9 -0
  83. package/dist/migrations/manifests/0.6.0-beta.13.json +9 -0
  84. package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +127 -9
  85. package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +62 -0
  86. package/dist/templates/markdown/spec/guides/index.md.txt +18 -0
  87. package/dist/utils/task-json.d.ts +9 -42
  88. package/dist/utils/task-json.d.ts.map +1 -1
  89. package/dist/utils/task-json.js +8 -45
  90. package/dist/utils/task-json.js.map +1 -1
  91. package/package.json +9 -8
@@ -58,6 +58,29 @@ grep -r "keyword" .
58
58
 
59
59
  **Good**: Single source of truth, import everywhere
60
60
 
61
+ ### Pattern 4: Repeated Payload Field Extraction
62
+
63
+ **Bad**: Multiple consumers cast the same JSON/event fields locally:
64
+
65
+ ```typescript
66
+ const description = (ev as { description?: string }).description;
67
+ const context = (ev as { context?: ContextEntry[] }).context;
68
+ ```
69
+
70
+ This is duplicated contract logic even when the code is only two lines. Each
71
+ consumer now has its own definition of what a valid payload means.
72
+
73
+ **Good**: Put the decoder, type guard, or projection next to the data owner:
74
+
75
+ ```typescript
76
+ if (isThreadEvent(ev)) {
77
+ renderThreadEvent(ev);
78
+ }
79
+ ```
80
+
81
+ **Rule**: If the same untyped payload field is read in 2+ places, create a
82
+ shared type guard / normalizer / projection before adding a third reader.
83
+
61
84
  ---
62
85
 
63
86
  ## When to Abstract
@@ -82,6 +105,74 @@ When you've made similar changes to multiple files:
82
105
  2. **Search**: Run grep to find any missed
83
106
  3. **Consider**: Should this be abstracted?
84
107
 
108
+ ### Reducers Should Use Exhaustive Structure
109
+
110
+ When state is derived from action-like values (`action`, `kind`, `status`,
111
+ `phase`), prefer a reducer with one `switch` over scattered `if/else` updates.
112
+
113
+ ```typescript
114
+ // BAD - action-specific state transitions are hard to audit
115
+ if (action === "opened") { ... }
116
+ else if (action === "comment") { ... }
117
+ else if (action === "status") { ... }
118
+
119
+ // GOOD - one reducer owns the transition table
120
+ switch (event.action) {
121
+ case "opened":
122
+ ...
123
+ return;
124
+ case "comment":
125
+ ...
126
+ return;
127
+ }
128
+ ```
129
+
130
+ This matters when the event log is the source of truth. A reducer is the
131
+ documented replay model; display code and commands should not duplicate pieces
132
+ of that replay model.
133
+
134
+ ---
135
+
136
+ ## Checklist Before Commit
137
+
138
+ - [ ] Searched for existing similar code
139
+ - [ ] No copy-pasted logic that should be shared
140
+ - [ ] No repeated untyped payload field extraction outside a shared decoder
141
+ - [ ] Constants defined in one place
142
+ - [ ] Similar patterns follow same structure
143
+ - [ ] Reducer/action transitions live in one reducer or command dispatcher
144
+
145
+ ---
146
+
147
+ ## Gotcha: Python if/elif/else Exhaustive Check
148
+
149
+ **Problem**: Python's if/elif/else chains have no compile-time exhaustive check. When you add a new value to a `Literal` type (e.g., `Platform`), existing if/elif/else chains silently fall through to `else` with wrong defaults.
150
+
151
+ **Symptom**: New platform works partially — some methods return Claude defaults instead of platform-specific values. No error is raised.
152
+
153
+ **Example** (`cli_adapter.py`):
154
+ ```python
155
+ # BAD: "gemini" falls through to else, returns "claude"
156
+ @property
157
+ def cli_name(self) -> str:
158
+ if self.platform == "opencode":
159
+ return "opencode"
160
+ else:
161
+ return "claude" # gemini silently gets "claude"!
162
+
163
+ # GOOD: explicit branch for every platform
164
+ @property
165
+ def cli_name(self) -> str:
166
+ if self.platform == "opencode":
167
+ return "opencode"
168
+ elif self.platform == "gemini":
169
+ return "gemini"
170
+ else:
171
+ return "claude"
172
+ ```
173
+
174
+ **Prevention**: When adding a new value to a Python `Literal` type, search for ALL if/elif/else chains that switch on that type and add explicit branches. Don't rely on `else` being correct for new values.
175
+
85
176
  ---
86
177
 
87
178
  ## Gotcha: Asymmetric Mechanisms Producing Same Output
@@ -90,16 +181,43 @@ When you've made similar changes to multiple files:
90
181
 
91
182
  **Symptom**: Init works perfectly, but update creates files at wrong paths or misses files entirely.
92
183
 
93
- **Prevention checklist**:
94
- - [ ] When migrating directory structures, search for ALL code paths that reference the old structure
95
- - [ ] If one path is auto-derived (glob/copy) and another is manually listed, the manual one needs updating
96
- - [ ] Add a regression test that compares outputs from both mechanisms
184
+ **Prevention**:
185
+ - **Best**: Eliminate the asymmetry have the manual path call the automatic one (e.g., `collectTemplateFiles()` calls `getAllScripts()` instead of maintaining its own list)
186
+ - **If asymmetry is unavoidable**: Add a regression test that compares outputs from both mechanisms
187
+ - When migrating directory structures, search for ALL code paths that reference the old structure
188
+
189
+ **Real example**: `trellis update` had a manual `files.set()` list for 11 scripts that `getAllScripts()` already tracked. Fix: replaced the manual list with a `for..of getAllScripts()` loop. See `update.ts` refactor in v0.4.0-beta.3.
97
190
 
98
191
  ---
99
192
 
100
- ## Checklist Before Commit
193
+ ## Template File Registration (Trellis-specific)
101
194
 
102
- - [ ] Searched for existing similar code
103
- - [ ] No copy-pasted logic that should be shared
104
- - [ ] Constants defined in one place
105
- - [ ] Similar patterns follow same structure
195
+ When adding new files to `src/templates/trellis/scripts/`:
196
+
197
+ **Single registration point**: `src/templates/trellis/index.ts`
198
+
199
+ 1. Add `export const xxxScript = readTemplate("scripts/path/file.py");`
200
+ 2. Add to `getAllScripts()` Map
201
+
202
+ That's it. `commands/update.ts` uses `getAllScripts()` directly — no manual sync needed.
203
+
204
+ **Why this matters**: Without registration in `getAllScripts()`, `trellis update` won't sync the file to user projects. Bug fixes and features won't propagate.
205
+
206
+ **History**: Before v0.4.0-beta.3, `update.ts` had its own hand-maintained file list that frequently fell out of sync with `getAllScripts()`. This caused 11 Python files to be silently skipped during `trellis update`. The fix was to eliminate the duplicate list and use `getAllScripts()` as the single source of truth.
207
+
208
+ ### Quick Checklist for New Scripts
209
+
210
+ ```bash
211
+ # After adding a new .py file, verify it's in getAllScripts():
212
+ grep -l "newFileName" src/templates/trellis/index.ts # Should match
213
+ ```
214
+
215
+ ### Template Sync Convention
216
+
217
+ `.trellis/scripts/` (dogfooded) and `packages/cli/src/templates/trellis/scripts/` (template) must stay identical. After editing `.trellis/scripts/`, always sync:
218
+
219
+ ```bash
220
+ rsync -av --delete --exclude='__pycache__' .trellis/scripts/ packages/cli/src/templates/trellis/scripts/
221
+ ```
222
+
223
+ **Gotcha**: Running rsync with wrong source/destination paths can create nested garbage directories (e.g., `.trellis/scripts/packages/cli/...`). Always double-check paths before running.
@@ -71,6 +71,35 @@ For each boundary:
71
71
 
72
72
  **Good**: Each layer only knows its neighbors
73
73
 
74
+ ### Mistake 4: Every Consumer Parses The Same Payload
75
+
76
+ **Bad**: A command reads JSONL events and casts fields inline:
77
+
78
+ ```typescript
79
+ const thread = (ev as { thread?: string }).thread;
80
+ const labels = (ev as { labels?: string[] }).labels;
81
+ ```
82
+
83
+ This looks local, but it means every consumer owns a private version of the
84
+ event contract. The next field change will update one command and miss another.
85
+
86
+ **Good**: Decode once at the event boundary, then export typed projections:
87
+
88
+ ```typescript
89
+ if (!isThreadEvent(ev)) return false;
90
+ return ev.thread === filter.thread;
91
+ ```
92
+
93
+ **Rule**: For append-only logs, JSON streams, RPC payloads, or config files,
94
+ create one owner for:
95
+
96
+ - event / payload type definitions
97
+ - type guards and normalization from `unknown`
98
+ - metadata projections used by UI commands
99
+ - reducers that replay state from the source of truth
100
+
101
+ Rendering code may format fields, but it must not redefine the payload contract.
102
+
74
103
  ---
75
104
 
76
105
  ## Checklist for Cross-Layer Features
@@ -87,6 +116,10 @@ After implementation:
87
116
  - [ ] Tested with edge cases (null, empty, invalid)
88
117
  - [ ] Verified error handling at each boundary
89
118
  - [ ] Checked data survives round-trip
119
+ - [ ] Checked that consumers import shared decoders / projections instead of
120
+ casting payload fields locally
121
+ - [ ] Checked that derived state points back to the source event identifier
122
+ (`seq`, `id`, `version`) instead of inventing a second cursor
90
123
 
91
124
  ---
92
125
 
@@ -195,3 +228,32 @@ Create detailed flow docs when:
195
228
  - Multiple teams are involved
196
229
  - Data format is complex
197
230
  - Feature has caused bugs before
231
+
232
+ ---
233
+
234
+ ## Event Log / Projection Boundary
235
+
236
+ Append-only logs are cross-layer contracts. A single event travels through:
237
+
238
+ ```
239
+ CLI input → event writer → events.jsonl → reader → filter → reducer → display
240
+ ```
241
+
242
+ ### Checklist: After Adding A New Event Kind Or Field
243
+
244
+ - [ ] Add the event kind to the central event taxonomy
245
+ - [ ] Add a typed event variant or type guard at the event layer
246
+ - [ ] Add normalization helpers for array/object fields that come from
247
+ user input or JSON
248
+ - [ ] Keep `seq` / `id` assignment in the event writer only
249
+ - [ ] Make filters and reducers consume the typed event guard, not local casts
250
+ - [ ] Make display code consume reducer output or typed events, not raw JSON
251
+ - [ ] Add at least one regression that proves history replay and live filtering
252
+ use the same filter model
253
+
254
+ **Real-world example**: Thread channels added `kind: "thread"`, `description`,
255
+ `context`, labels, and `lastSeq`. The first implementation replayed thread
256
+ state correctly, but several commands still re-parsed event payload fields with
257
+ local casts. The fix was to make the core event layer own `ThreadChannelEvent`
258
+ and `isThreadEvent`, make `reduceChannelMetadata` the only channel metadata
259
+ projection, and make `reduceThreads` the only thread replay reducer.
@@ -34,6 +34,8 @@ These guides help you **ask the right questions before coding**.
34
34
  - [ ] Data format changes between layers
35
35
  - [ ] Multiple consumers need the same data
36
36
  - [ ] You're not sure where to put some logic
37
+ - [ ] You are adding an event kind, JSONL record, RPC payload, or config field
38
+ - [ ] UI / command code starts casting raw payload fields directly
37
39
 
38
40
  → Read [Cross-Layer Thinking Guide](./cross-layer-thinking-guide.md)
39
41
 
@@ -44,9 +46,25 @@ These guides help you **ask the right questions before coding**.
44
46
  - [ ] You're adding a new field to multiple places
45
47
  - [ ] **You're modifying any constant or config**
46
48
  - [ ] **You're creating a new utility/helper function** ← Search first!
49
+ - [ ] Two files read the same untyped payload field with local casts
50
+ - [ ] Multiple branches update the same derived state from `kind` / `action`
47
51
 
48
52
  → Read [Code Reuse Thinking Guide](./code-reuse-thinking-guide.md)
49
53
 
54
+ ### When Verifying AI Cross-Review Results
55
+
56
+ - [ ] Reviewer claims "user input can be malicious" → Check the actual data source (internal manifest? user config? external API?)
57
+ - [ ] Reviewer flags "missing validation" → Is the data from a trusted internal source?
58
+ - [ ] Reviewer says "behavior change" → Read the code comments — is it intentional design?
59
+ - [ ] Reviewer identifies a "bug" in test → Mentally delete the feature being tested — does the test still pass? If yes → tautological test
60
+
61
+ **Common AI reviewer false-positive patterns**:
62
+ 1. **Trust boundary confusion**: Treating internal data (bundled JSON manifests) as untrusted external input
63
+ 2. **Ignoring design comments**: Flagging intentional behavior documented in code comments as bugs
64
+ 3. **Variable misreading**: Not tracing a variable to its actual definition (e.g., Map keyed by path vs name)
65
+
66
+ **Verification rule**: Every CRITICAL/WARNING finding must be verified against the actual code before prioritizing. Budget ~35% false-positive rate for AI reviews.
67
+
50
68
  ---
51
69
 
52
70
  ## Pre-Modification Rule (CRITICAL)
@@ -1,46 +1,13 @@
1
1
  /**
2
- * Canonical task.json shape — single source of truth shared by all TS writers.
2
+ * Canonical task.json shape — single source of truth shared by all TS
3
+ * writers. The canonical types and factory now live in the
4
+ * `@mindfoldhq/trellis-core` task API; this module re-exports them under
5
+ * the legacy `TaskJson` / `emptyTaskJson` names for CLI call sites.
3
6
  *
4
- * The runtime Python writer is `.trellis/scripts/common/task_store.py` in
5
- * `cmd_create` (lines ~147-172). This TS factory mirrors that 24-field shape
6
- * so bootstrap tasks (trellis init) and migration tasks (trellis update
7
- * --migrate) produce structurally identical task.json files.
8
- *
9
- * Field names, order, and null defaults match task_store.py exactly.
10
- */
11
- export interface TaskJson {
12
- id: string;
13
- name: string;
14
- title: string;
15
- description: string;
16
- status: string;
17
- dev_type: string | null;
18
- scope: string | null;
19
- package: string | null;
20
- priority: string;
21
- creator: string;
22
- assignee: string;
23
- createdAt: string;
24
- completedAt: string | null;
25
- branch: string | null;
26
- base_branch: string | null;
27
- worktree_path: string | null;
28
- commit: string | null;
29
- pr_url: string | null;
30
- subtasks: string[];
31
- children: string[];
32
- parent: string | null;
33
- relatedFiles: string[];
34
- notes: string;
35
- meta: Record<string, unknown>;
36
- }
37
- /**
38
- * Produce a fully-populated canonical-shape TaskJson.
39
- *
40
- * All 24 fields are emitted in canonical order. `overrides` shallow-merges on
41
- * top — callers should supply the per-task values (id, name, title, assignee,
42
- * createdAt, etc.) and leave null-default fields untouched unless they have a
43
- * real value.
7
+ * New code should prefer `TrellisTaskRecord` / `emptyTaskRecord` from
8
+ * `@mindfoldhq/trellis-core/task` directly.
44
9
  */
45
- export declare function emptyTaskJson(overrides?: Partial<TaskJson>): TaskJson;
10
+ import { emptyTaskRecord, type TrellisTaskRecord } from "@mindfoldhq/trellis-core/task";
11
+ export type TaskJson = TrellisTaskRecord;
12
+ export declare const emptyTaskJson: typeof emptyTaskRecord;
46
13
  //# sourceMappingURL=task-json.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"task-json.d.ts","sourceRoot":"","sources":["../../src/utils/task-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,SAAS,GAAE,OAAO,CAAC,QAAQ,CAAM,GAAG,QAAQ,CA6BzE"}
1
+ {"version":3,"file":"task-json.d.ts","sourceRoot":"","sources":["../../src/utils/task-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,eAAe,EACf,KAAK,iBAAiB,EACvB,MAAM,+BAA+B,CAAC;AAEvC,MAAM,MAAM,QAAQ,GAAG,iBAAiB,CAAC;AAEzC,eAAO,MAAM,aAAa,wBAAkB,CAAC"}
@@ -1,49 +1,12 @@
1
1
  /**
2
- * Canonical task.json shape — single source of truth shared by all TS writers.
2
+ * Canonical task.json shape — single source of truth shared by all TS
3
+ * writers. The canonical types and factory now live in the
4
+ * `@mindfoldhq/trellis-core` task API; this module re-exports them under
5
+ * the legacy `TaskJson` / `emptyTaskJson` names for CLI call sites.
3
6
  *
4
- * The runtime Python writer is `.trellis/scripts/common/task_store.py` in
5
- * `cmd_create` (lines ~147-172). This TS factory mirrors that 24-field shape
6
- * so bootstrap tasks (trellis init) and migration tasks (trellis update
7
- * --migrate) produce structurally identical task.json files.
8
- *
9
- * Field names, order, and null defaults match task_store.py exactly.
10
- */
11
- /**
12
- * Produce a fully-populated canonical-shape TaskJson.
13
- *
14
- * All 24 fields are emitted in canonical order. `overrides` shallow-merges on
15
- * top — callers should supply the per-task values (id, name, title, assignee,
16
- * createdAt, etc.) and leave null-default fields untouched unless they have a
17
- * real value.
7
+ * New code should prefer `TrellisTaskRecord` / `emptyTaskRecord` from
8
+ * `@mindfoldhq/trellis-core/task` directly.
18
9
  */
19
- export function emptyTaskJson(overrides = {}) {
20
- const today = new Date().toISOString().split("T")[0];
21
- const base = {
22
- id: "",
23
- name: "",
24
- title: "",
25
- description: "",
26
- status: "planning",
27
- dev_type: null,
28
- scope: null,
29
- package: null,
30
- priority: "P2",
31
- creator: "",
32
- assignee: "",
33
- createdAt: today,
34
- completedAt: null,
35
- branch: null,
36
- base_branch: null,
37
- worktree_path: null,
38
- commit: null,
39
- pr_url: null,
40
- subtasks: [],
41
- children: [],
42
- parent: null,
43
- relatedFiles: [],
44
- notes: "",
45
- meta: {},
46
- };
47
- return { ...base, ...overrides };
48
- }
10
+ import { emptyTaskRecord, } from "@mindfoldhq/trellis-core/task";
11
+ export const emptyTaskJson = emptyTaskRecord;
49
12
  //# sourceMappingURL=task-json.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"task-json.js","sourceRoot":"","sources":["../../src/utils/task-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA6BH;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,YAA+B,EAAE;IAC7D,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,MAAM,IAAI,GAAa;QACrB,EAAE,EAAE,EAAE;QACN,IAAI,EAAE,EAAE;QACR,KAAK,EAAE,EAAE;QACT,WAAW,EAAE,EAAE;QACf,MAAM,EAAE,UAAU;QAClB,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,IAAI;QACX,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,KAAK;QAChB,WAAW,EAAE,IAAI;QACjB,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,IAAI;QACjB,aAAa,EAAE,IAAI;QACnB,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,IAAI;QACZ,QAAQ,EAAE,EAAE;QACZ,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,IAAI;QACZ,YAAY,EAAE,EAAE;QAChB,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,EAAE;KACT,CAAC;IACF,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,SAAS,EAAE,CAAC;AACnC,CAAC"}
1
+ {"version":3,"file":"task-json.js","sourceRoot":"","sources":["../../src/utils/task-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,eAAe,GAEhB,MAAM,+BAA+B,CAAC;AAIvC,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindfoldhq/trellis",
3
- "version": "0.6.0-beta.11",
3
+ "version": "0.6.0-beta.13",
4
4
  "description": "AI capabilities grow like ivy — Trellis provides the structure to guide them along a disciplined path",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -33,7 +33,8 @@
33
33
  "giget": "^3.1.1",
34
34
  "inquirer": "^9.3.7",
35
35
  "undici": "^6.21.0",
36
- "zod": "^4.4.2"
36
+ "zod": "^4.4.2",
37
+ "@mindfoldhq/trellis-core": "0.6.0-beta.13"
37
38
  },
38
39
  "devDependencies": {
39
40
  "@eslint/js": "^9.18.0",
@@ -77,12 +78,12 @@
77
78
  "typecheck": "tsc --noEmit",
78
79
  "lint:py": "basedpyright",
79
80
  "lint:all": "pnpm lint && pnpm lint:py",
80
- "release": "node scripts/check-manifest-continuity.js && pnpm test && git add -A -- ':!docs-site' && (git diff-index --quiet HEAD || git commit -m 'chore: pre-release updates') && pnpm version --no-git-tag-version patch && V=$(node -p \"require('./package.json').version\") && git add package.json && git commit -m \"$V\" && git tag \"v$V\" && git push origin main --tags",
81
- "release:minor": "node scripts/check-manifest-continuity.js && pnpm test && git add -A -- ':!docs-site' && (git diff-index --quiet HEAD || git commit -m 'chore: pre-release updates') && pnpm version --no-git-tag-version minor && V=$(node -p \"require('./package.json').version\") && git add package.json && git commit -m \"$V\" && git tag \"v$V\" && git push origin main --tags",
82
- "release:major": "node scripts/check-manifest-continuity.js && pnpm test && git add -A -- ':!docs-site' && (git diff-index --quiet HEAD || git commit -m 'chore: pre-release updates') && pnpm version --no-git-tag-version major && V=$(node -p \"require('./package.json').version\") && git add package.json && git commit -m \"$V\" && git tag \"v$V\" && git push origin main --tags",
83
- "release:beta": "node scripts/check-manifest-continuity.js && node scripts/check-docs-changelog.js --type beta && pnpm test && git add -A -- ':!docs-site' && (git diff-index --quiet HEAD || git commit -m 'chore: pre-release updates') && pnpm version --no-git-tag-version prerelease --preid beta && V=$(node -p \"require('./package.json').version\") && git add package.json && git commit -m \"$V\" && git tag \"v$V\" && git push origin HEAD --tags",
84
- "release:rc": "node scripts/check-manifest-continuity.js && node scripts/check-docs-changelog.js --type rc && pnpm test && git add -A -- ':!docs-site' && (git diff-index --quiet HEAD || git commit -m 'chore: pre-release updates') && pnpm version --no-git-tag-version prerelease --preid rc && V=$(node -p \"require('./package.json').version\") && git add package.json && git commit -m \"$V\" && git tag \"v$V\" && git push origin HEAD --tags",
85
- "release:promote": "node scripts/check-manifest-continuity.js && node scripts/check-docs-changelog.js --type promote && pnpm test && git add -A -- ':!docs-site' && (git diff-index --quiet HEAD || git commit -m 'chore: pre-release updates') && pnpm version --no-git-tag-version \"$(node -p \"require('./package.json').version.replace(/-.*/, '')\")\" && V=$(node -p \"require('./package.json').version\") && git add package.json && git commit -m \"$V\" && git tag \"v$V\" && git push origin main --tags",
81
+ "release": "node scripts/release.js patch",
82
+ "release:minor": "node scripts/release.js minor",
83
+ "release:major": "node scripts/release.js major",
84
+ "release:beta": "node scripts/release.js beta",
85
+ "release:rc": "node scripts/release.js rc",
86
+ "release:promote": "node scripts/release.js promote",
86
87
  "manifest": "node scripts/create-manifest.js"
87
88
  }
88
89
  }