ghostrail 0.15.2 → 0.17.0

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 (167) hide show
  1. package/README.md +12 -9
  2. package/dist/agent/claude-code.d.ts.map +1 -1
  3. package/dist/agent/claude-code.js +4 -1
  4. package/dist/agent/claude-code.js.map +1 -1
  5. package/dist/board/page.d.ts +1 -1
  6. package/dist/board/page.d.ts.map +1 -1
  7. package/dist/board/page.js +2 -1
  8. package/dist/board/page.js.map +1 -1
  9. package/dist/board/server.d.ts +1 -1
  10. package/dist/board/server.d.ts.map +1 -1
  11. package/dist/board/server.js +7 -1
  12. package/dist/board/server.js.map +1 -1
  13. package/dist/board/stats.d.ts +1 -1
  14. package/dist/board/stats.d.ts.map +1 -1
  15. package/dist/board/stats.js +2 -1
  16. package/dist/board/stats.js.map +1 -1
  17. package/dist/claude-profile/index.d.ts +1 -1
  18. package/dist/claude-profile/index.d.ts.map +1 -1
  19. package/dist/claude-profile/index.js +1 -1
  20. package/dist/claude-profile/index.js.map +1 -1
  21. package/dist/claude-profile/setup.d.ts +7 -0
  22. package/dist/claude-profile/setup.d.ts.map +1 -1
  23. package/dist/claude-profile/setup.js +7 -0
  24. package/dist/claude-profile/setup.js.map +1 -1
  25. package/dist/cli/commands.d.ts +6 -0
  26. package/dist/cli/commands.d.ts.map +1 -1
  27. package/dist/cli/commands.js +204 -18
  28. package/dist/cli/commands.js.map +1 -1
  29. package/dist/cli.d.ts.map +1 -1
  30. package/dist/cli.js +3 -1
  31. package/dist/cli.js.map +1 -1
  32. package/dist/commands/help.d.ts.map +1 -1
  33. package/dist/commands/help.js +15 -3
  34. package/dist/commands/help.js.map +1 -1
  35. package/dist/config/load.d.ts.map +1 -1
  36. package/dist/config/load.js +18 -2
  37. package/dist/config/load.js.map +1 -1
  38. package/dist/config/schema.d.ts +8 -2
  39. package/dist/config/schema.d.ts.map +1 -1
  40. package/dist/config/schema.js.map +1 -1
  41. package/dist/dashboard/page.d.ts +7 -1
  42. package/dist/dashboard/page.d.ts.map +1 -1
  43. package/dist/dashboard/page.js +204 -39
  44. package/dist/dashboard/page.js.map +1 -1
  45. package/dist/dashboard/routes.d.ts +32 -0
  46. package/dist/dashboard/routes.d.ts.map +1 -1
  47. package/dist/dashboard/routes.js +45 -0
  48. package/dist/dashboard/routes.js.map +1 -1
  49. package/dist/dashboard/server.d.ts +35 -9
  50. package/dist/dashboard/server.d.ts.map +1 -1
  51. package/dist/dashboard/server.js +75 -11
  52. package/dist/dashboard/server.js.map +1 -1
  53. package/dist/doctor/checks.d.ts +87 -0
  54. package/dist/doctor/checks.d.ts.map +1 -0
  55. package/dist/doctor/checks.js +414 -0
  56. package/dist/doctor/checks.js.map +1 -0
  57. package/dist/doctor/index.d.ts +6 -0
  58. package/dist/doctor/index.d.ts.map +1 -0
  59. package/dist/doctor/index.js +5 -0
  60. package/dist/doctor/index.js.map +1 -0
  61. package/dist/doctor/probes.d.ts +42 -0
  62. package/dist/doctor/probes.d.ts.map +1 -0
  63. package/dist/doctor/probes.js +136 -0
  64. package/dist/doctor/probes.js.map +1 -0
  65. package/dist/doctor/report.d.ts +13 -0
  66. package/dist/doctor/report.d.ts.map +1 -0
  67. package/dist/doctor/report.js +32 -0
  68. package/dist/doctor/report.js.map +1 -0
  69. package/dist/doctor/run.d.ts +48 -0
  70. package/dist/doctor/run.d.ts.map +1 -0
  71. package/dist/doctor/run.js +109 -0
  72. package/dist/doctor/run.js.map +1 -0
  73. package/dist/doctor/types.d.ts +17 -0
  74. package/dist/doctor/types.d.ts.map +1 -0
  75. package/dist/doctor/types.js +6 -0
  76. package/dist/doctor/types.js.map +1 -0
  77. package/dist/factory/build.d.ts.map +1 -1
  78. package/dist/factory/build.js +1 -0
  79. package/dist/factory/build.js.map +1 -1
  80. package/dist/init/regions.d.ts +76 -0
  81. package/dist/init/regions.d.ts.map +1 -0
  82. package/dist/init/regions.js +247 -0
  83. package/dist/init/regions.js.map +1 -0
  84. package/dist/init/template.d.ts +7 -1
  85. package/dist/init/template.d.ts.map +1 -1
  86. package/dist/init/template.js +37 -2
  87. package/dist/init/template.js.map +1 -1
  88. package/dist/loop/budget.d.ts +11 -2
  89. package/dist/loop/budget.d.ts.map +1 -1
  90. package/dist/loop/budget.js +13 -3
  91. package/dist/loop/budget.js.map +1 -1
  92. package/dist/loop/comments.d.ts +20 -0
  93. package/dist/loop/comments.d.ts.map +1 -0
  94. package/dist/loop/comments.js +35 -0
  95. package/dist/loop/comments.js.map +1 -0
  96. package/dist/loop/engine.d.ts.map +1 -1
  97. package/dist/loop/engine.js +18 -0
  98. package/dist/loop/engine.js.map +1 -1
  99. package/dist/loop/index.d.ts +1 -0
  100. package/dist/loop/index.d.ts.map +1 -1
  101. package/dist/loop/index.js +1 -0
  102. package/dist/loop/index.js.map +1 -1
  103. package/dist/publish/gh.d.ts +8 -0
  104. package/dist/publish/gh.d.ts.map +1 -1
  105. package/dist/publish/gh.js +12 -0
  106. package/dist/publish/gh.js.map +1 -1
  107. package/dist/publish/githost.d.ts +8 -0
  108. package/dist/publish/githost.d.ts.map +1 -1
  109. package/dist/publish/githost.js.map +1 -1
  110. package/dist/publish/index.d.ts +1 -1
  111. package/dist/publish/index.d.ts.map +1 -1
  112. package/dist/publish/index.js +1 -1
  113. package/dist/publish/index.js.map +1 -1
  114. package/dist/respond/index.d.ts +3 -2
  115. package/dist/respond/index.d.ts.map +1 -1
  116. package/dist/respond/index.js +3 -2
  117. package/dist/respond/index.js.map +1 -1
  118. package/dist/respond/merge.d.ts +13 -0
  119. package/dist/respond/merge.d.ts.map +1 -0
  120. package/dist/respond/merge.js +181 -0
  121. package/dist/respond/merge.js.map +1 -0
  122. package/dist/respond/respond.d.ts +25 -5
  123. package/dist/respond/respond.d.ts.map +1 -1
  124. package/dist/respond/respond.js +57 -28
  125. package/dist/respond/respond.js.map +1 -1
  126. package/dist/respond/select.d.ts +15 -0
  127. package/dist/respond/select.d.ts.map +1 -1
  128. package/dist/respond/select.js +17 -0
  129. package/dist/respond/select.js.map +1 -1
  130. package/dist/source/dependencies.d.ts +81 -0
  131. package/dist/source/dependencies.d.ts.map +1 -0
  132. package/dist/source/dependencies.js +218 -0
  133. package/dist/source/dependencies.js.map +1 -0
  134. package/dist/source/index.d.ts +1 -0
  135. package/dist/source/index.d.ts.map +1 -1
  136. package/dist/source/index.js +1 -0
  137. package/dist/source/index.js.map +1 -1
  138. package/dist/source/linear.d.ts +17 -1
  139. package/dist/source/linear.d.ts.map +1 -1
  140. package/dist/source/linear.js +75 -9
  141. package/dist/source/linear.js.map +1 -1
  142. package/dist/store/events.d.ts +8 -0
  143. package/dist/store/events.d.ts.map +1 -1
  144. package/dist/store/events.js +10 -0
  145. package/dist/store/events.js.map +1 -1
  146. package/dist/store/file-store.d.ts +1 -1
  147. package/dist/store/file-store.d.ts.map +1 -1
  148. package/dist/store/file-store.js +7 -0
  149. package/dist/store/file-store.js.map +1 -1
  150. package/dist/store/index.d.ts +1 -1
  151. package/dist/store/index.d.ts.map +1 -1
  152. package/dist/store/index.js +1 -1
  153. package/dist/store/index.js.map +1 -1
  154. package/dist/store/port.d.ts +15 -0
  155. package/dist/store/port.d.ts.map +1 -1
  156. package/dist/store/port.js +17 -1
  157. package/dist/store/port.js.map +1 -1
  158. package/dist/triage/engine.d.ts.map +1 -1
  159. package/dist/triage/engine.js +2 -0
  160. package/dist/triage/engine.js.map +1 -1
  161. package/package.json +3 -1
  162. package/skill/ghostrail/SKILL.md +94 -43
  163. package/templates/code/prompts/resolve-issue.md +20 -4
  164. package/templates/code/prompts/respond.md +4 -0
  165. package/templates/code/prompts/triage.md +13 -0
  166. package/templates/content/prompts/draft.md +13 -0
  167. package/templates/content/prompts/respond.md +4 -0
@@ -5,7 +5,7 @@ user-invocable: true
5
5
  argument-hint: "[customize | init | update | doctor | status | run | respond | triage]"
6
6
  license: Apache-2.0
7
7
  metadata:
8
- version: 0.4.0
8
+ version: 0.7.0
9
9
  allowed-tools:
10
10
  - Read
11
11
  - Write
@@ -66,9 +66,24 @@ this tailors them to *this* repo. Never guess: read before proposing.
66
66
  - `[gate].commands` — mirroring CI exactly.
67
67
  - `[source]` — the team/project/label/assignee filters, if you can tell what
68
68
  they should be. Ask rather than invent tracker identifiers.
69
- 4. **Do not touch** `[output].auto_merge` (it must stay `false`) or invent
69
+ 4. **Managed regions are structural. Never edit inside one.** A scaffolded
70
+ prompt marks the parts ghostrail owns:
71
+
72
+ ```markdown
73
+ <!-- ghostrail:managed id="result-contract" -->
74
+ ...ghostrail's text...
75
+ <!-- /ghostrail:managed -->
76
+ ```
77
+
78
+ Rewrite anything *outside* those markers freely: that is the whole point of
79
+ customize. Inside one, change nothing, and never move, rename, reorder, or
80
+ delete a marker. Those regions are how `<GR> init --update` carries a later
81
+ template fix into this repo without touching your wording; editing one turns
82
+ a silent merge into a conflict you have to port by hand forever after. If a
83
+ managed region genuinely blocks this repo, say so rather than editing it.
84
+ 5. **Do not touch** `[output].auto_merge` (it must stay `false`) or invent
70
85
  credentials.
71
- 5. **Never run `<GR> run`, `<GR> triage`, or `<GR> respond` to check your edits.**
86
+ 6. **Never run `<GR> run`, `<GR> triage`, or `<GR> respond` to check your edits.**
72
87
  Those act on real tracker items, per the confirm-first rule under **run ·
73
88
  respond · triage** below, and that rule has no "just checking" exception:
74
89
  zero eligible items still means the command executed for real. If you want
@@ -112,18 +127,69 @@ Carry a template improvement into a repo that has customized its prompts. Run:
112
127
  <GR> init <template> --update
113
128
  ```
114
129
 
115
- It writes only files this repo never edited (proved by the baseline in
116
- `ghostrail.template.json`), and it never touches a customized file. For those it
117
- prints **signals**: what the template gained that the repo's copy lacks.
130
+ It does as much as it can prove, in three steps.
131
+
132
+ **Files this repo never edited** (proved by the baseline in
133
+ `ghostrail.template.json`) are taken whole.
134
+
135
+ **Managed regions inside a customized file are merged in place.** A region the
136
+ repo never edited is rewritten from the template, and a region the template
137
+ added is inserted. The file's editable text is never touched, and the file's own
138
+ baseline is deliberately not re-recorded, so the customization stays protected.
139
+
140
+ **Everything left over is reported**, as before: the placeholders and result
141
+ fields the template gained that the repo's copy still lacks.
118
142
 
119
143
  ```
120
144
  ghostrail/prompts/resolve-issue.md
121
- customized, and the template gained:
122
- placeholder {{description}}
123
- result field "testPlan"
145
+ customized:
146
+ updated result-contract
147
+ inserted prior-discussion
148
+ edited locally item (left alone; port it by hand)
149
+ placeholder {{description}}
124
150
  ```
125
151
 
126
- Placing those is your job, and it is not a text merge. A customized prompt can
152
+ The first two lines already happened; you do not need to do anything about them
153
+ beyond telling the user. The rest is your job, and it is not a text merge.
154
+
155
+ `edited locally` means someone edited inside a region ghostrail owns, so it was
156
+ left alone rather than overwritten. Port the template's version of that region
157
+ into the repo's copy by hand, keeping any local change that was deliberate. It
158
+ keeps being reported until the region matches the template exactly.
159
+
160
+ `unplaceable` means the template added a region and this file shares no managed
161
+ region to anchor it against.
162
+
163
+ `adopting regions: N/M` means the file has markers but no recorded baselines
164
+ yet, so nothing could be merged. See **adopting regions** below.
165
+
166
+ ### Adopting regions in a repo that predates them
167
+
168
+ A prompt scaffolded before regions existed has no markers, so `--update` says
169
+ nothing about them and behaves exactly as it always did. Getting such a repo
170
+ onto regions is a one-time guided pass, and it is incremental: you do not have
171
+ to finish it in one go.
172
+
173
+ 1. **Add the markers**, around the text in the repo's copy that already
174
+ corresponds to each region. Read the template's copy to see the region ids
175
+ and what each one covers, then wrap the repo's own equivalent text. Do not
176
+ reword anything while doing this; you are only marking boundaries.
177
+ 2. **Bring each managed region to the template's current text.** This is the
178
+ same hand port the signal report has always asked for, done once. Keep the
179
+ repo's wording *outside* the markers; inside them, the template's text wins,
180
+ because that is what ghostrail is taking ownership of.
181
+ 3. **Re-run `<GR> init <template> --update`.** Every region that now matches the
182
+ template is recorded, and the report says how many. Regions you have not
183
+ ported yet are simply reported again.
184
+
185
+ The useful part is that step 3 does not need step 2 to be complete. As soon as
186
+ *one* region matches, that file has baselines, so a region the template added
187
+ gets inserted automatically on the next run and only the regions you actually
188
+ still differ on keep asking for attention. Repeat until the file reports
189
+ `customized, nothing to take`.
190
+
191
+ Never do this by taking the template's whole file. That throws away the
192
+ customization, which is the thing the whole design exists to protect. A customized prompt can
127
193
  be a near-total rewrite that still needs the same one-line addition, so port the
128
194
  **intent**, not the template's wording:
129
195
 
@@ -139,6 +205,10 @@ be a near-total rewrite that still needs the same one-line addition, so port the
139
205
  5. Re-run `<GR> init <template> --update` and confirm it now reports
140
206
  `customized, nothing to take`.
141
207
 
208
+ Never place a signal by editing inside a managed region, and never delete a
209
+ marker to make a report go away. The markers are what make the next update a
210
+ merge instead of another hand port.
211
+
142
212
  Verify a placeholder actually renders before anyone spends a run on it:
143
213
 
144
214
  ```
@@ -164,39 +234,20 @@ Two things to tell the user plainly:
164
234
 
165
235
  ## doctor
166
236
 
167
- Diagnose a setup without changing anything. Check and report each, with the fix:
168
-
169
- - **CLI** — which form resolved, and its `<GR> version`.
170
- - **Config** — `ghostrail.toml` present, and it parses. Read it yourself first:
171
- most syntax and shape problems (bad TOML, a misnamed table, a wrong type) are
172
- visible without running anything. Only `<GR> run`, `<GR> triage`, and
173
- `<GR> respond` surface the dotted-path parse error the CLI produces, and they
174
- execute for real even with zero eligible items, so getting that message is
175
- not a free action — treat it exactly like the "run · respond · triage"
176
- section requires: state what you're about to do and get confirmation first,
177
- never run one silently "just to check parsing."
178
- - **Prompts** — every path referenced by `[agent].prompt`, `[respond].prompt`,
179
- and `[triage].prompt` exists.
180
- - **Gate** — `[gate].commands` is non-empty for a code factory, and the commands
181
- actually exist in the project's scripts.
182
- - **Credentials** — report which of `LINEAR_API_KEY`, `GH_TOKEN`/`GITHUB_TOKEN`,
183
- and `ANTHROPIC_API_KEY` **or** `CLAUDE_CODE_OAUTH_TOKEN` are set. Report only
184
- set/unset, **never print a value**. Note that `ANTHROPIC_API_KEY` wins over the
185
- OAuth token, so it must be unset to bill a Pro/Max subscription. Remember they
186
- can come from a file as well as the environment: `~/.config/ghostrail/secrets.env`
187
- and a repo's `.ghostrail.env`, which beat an exported variable of the same name.
188
- When something is missing, the fix to suggest is `ghostrail secrets-setup --write`,
189
- which scaffolds that file and opens it in the user's editor. Never offer to fill
190
- in a value yourself.
191
- - **GitHub** — `gh auth status` succeeds.
192
- - **Container backend**, if `[backend].kind = "container"` — the configured
193
- `image` exists locally (`docker images`). If not, the fix is
194
- `ghostrail image build` (add `--tag` when the config names something other
195
- than `ghostrail-factory:local`). No repo checkout is needed; the Dockerfile
196
- ships in the package. A `local-worktree` factory needs no image at all, so do
197
- not report a missing one as a problem.
198
-
199
- Finish with a short ordered list of what to fix first.
237
+ Run `<GR> doctor` and relay its output. It probes the setup itself — including a
238
+ real `claude -p` call inside the configured backend and a cheap Linear query, not
239
+ just presence checks — so describe what it actually did rather than re-deriving
240
+ checks here (that would drift from what the command does). It never prints a
241
+ credential value, only names and outcomes. Add `--quick` when the operator wants
242
+ a fast, no-network answer instead (it will say plainly which checks it skipped).
243
+ Add `--json` when the output needs to be machine-parsed (e.g. for the board).
244
+
245
+ `doctor` reports whether `ghostrail.toml` parses, so there is never a reason to
246
+ run `<GR> run`, `<GR> triage`, or `<GR> respond` just to surface a parse error;
247
+ those execute for real even with zero eligible items.
248
+
249
+ `doctor` exits non-zero when any check fails, and prints an ordered "fix first"
250
+ list; lead with that list, then offer to walk through it one item at a time.
200
251
 
201
252
  ---
202
253
 
@@ -8,6 +8,7 @@ and PRs.
8
8
 
9
9
  Match the surrounding code: its style, patterns, and test conventions.
10
10
 
11
+ <!-- ghostrail:managed id="item" -->
11
12
  ## The issue
12
13
  - ID: {{id}}
13
14
  - Title: {{title}}
@@ -16,6 +17,16 @@ Match the surrounding code: its style, patterns, and test conventions.
16
17
  ### Description
17
18
 
18
19
  {{description}}
20
+ <!-- /ghostrail:managed -->
21
+
22
+ <!-- ghostrail:managed id="prior-discussion" -->
23
+ ## Prior discussion
24
+
25
+ If `.ghostrail/comments.md` exists, read it. It holds the comment thread on
26
+ this issue, oldest first, and it can include a question a previous run of the
27
+ factory asked and a human's reply. Treat an already-answered question as
28
+ settled and act on the answer; do not ask it again.
29
+ <!-- /ghostrail:managed -->
19
30
 
20
31
  ## What to do
21
32
  1. Locate the relevant code and understand how it is structured.
@@ -23,6 +34,7 @@ Match the surrounding code: its style, patterns, and test conventions.
23
34
  3. Add or update tests (author them from the intent, not the implementation).
24
35
  4. Run the project's lint, typecheck, and unit-test commands and fix what you touched.
25
36
 
37
+ <!-- ghostrail:managed id="result-contract" -->
26
38
  ## Reporting your result (required, do this last)
27
39
  Write a JSON file at `.ghostrail/result.json` with exactly one of:
28
40
 
@@ -31,15 +43,19 @@ Write a JSON file at `.ghostrail/result.json` with exactly one of:
31
43
  - `{"status":"failed","error":"<why>"}`
32
44
  - `{"status":"noop","reason":"<why nothing needed changing>"}`
33
45
 
34
- `type` is the conventional-commit type for the change; it sets the commit and PR
35
- title. If you omit it, the factory's configured default is used.
46
+ `type` is the conventional-commit type for the change (pick the one that fits:
47
+ `feat` for a feature, `fix` for a bug, `docs`, `refactor`, ...); it sets the
48
+ commit and PR title. If you omit it, the factory's configured default is used.
49
+
50
+ `summary` and `testPlan` are rendered into the pull request body under headings
51
+ the factory supplies, so do not add headings of your own.
52
+ <!-- /ghostrail:managed -->
36
53
 
37
54
  `summary` and `testPlan` are the pull request a human reads, so write them for
38
55
  that reader rather than as a log of what you did:
39
56
 
40
57
  - **`summary`**: one or two sentences on what changed and why, then markdown
41
- bullets for the specifics. Do not write a single long paragraph, and do not
42
- add headings; the factory supplies its own.
58
+ bullets for the specifics. Do not write a single long paragraph.
43
59
  - **`testPlan`**: the steps someone runs to check this by hand. Concrete
44
60
  commands, what to look at, and what they should see. The gate has already run
45
61
  lint, typecheck, and the unit suite, so do not just repeat those: give the
@@ -5,9 +5,11 @@ of an open pull request. New human feedback has been left on the PR or its track
5
5
  issue. Address it. You may only read and write files and run shell commands in
6
6
  this workspace. Do not use git: the factory owns commits and pushes.
7
7
 
8
+ <!-- ghostrail:managed id="feedback" -->
8
9
  ## The feedback
9
10
  Read `.ghostrail/feedback.md`. It contains the new comments (author and time),
10
11
  newest work last. Treat it as the review to act on.
12
+ <!-- /ghostrail:managed -->
11
13
 
12
14
  ## What to do
13
15
  1. Read the feedback and the current state of the branch.
@@ -16,6 +18,7 @@ newest work last. Treat it as the review to act on.
16
18
  4. If a comment is a question rather than a change request, answer it in your result
17
19
  (see `blocked`) instead of guessing.
18
20
 
21
+ <!-- ghostrail:managed id="result-contract" -->
19
22
  ## Reporting your result (required, do this last)
20
23
  Write a JSON file at `.ghostrail/result.json` with exactly one of:
21
24
 
@@ -23,5 +26,6 @@ Write a JSON file at `.ghostrail/result.json` with exactly one of:
23
26
  - `{"status":"blocked","questions":"<what you need answered>"}`
24
27
  - `{"status":"failed","error":"<why>"}`
25
28
  - `{"status":"noop","reason":"<why nothing needed changing>"}`
29
+ <!-- /ghostrail:managed -->
26
30
 
27
31
  On `done` the factory commits and pushes to the PR branch and posts a summary.
@@ -5,6 +5,7 @@ NOT to fix it: it is to decide whether the issue is too large to fix in one pass
5
5
  and, if so, propose how to break it into smaller, ordered sub-issues. Do not use
6
6
  git and do not change any source files except the two output files below.
7
7
 
8
+ <!-- ghostrail:managed id="item" -->
8
9
  ## The issue
9
10
  - ID: {{id}}
10
11
  - Title: {{title}}
@@ -13,6 +14,16 @@ git and do not change any source files except the two output files below.
13
14
  ### Description
14
15
 
15
16
  {{description}}
17
+ <!-- /ghostrail:managed -->
18
+
19
+ <!-- ghostrail:managed id="prior-discussion" -->
20
+ ## Prior discussion
21
+
22
+ If `.ghostrail/comments.md` exists, read it. It holds the comment thread on
23
+ this issue, oldest first, and it can include a question a previous triage pass
24
+ asked and a human's reply. Treat an already-answered question as settled and
25
+ act on the answer; do not ask it again.
26
+ <!-- /ghostrail:managed -->
16
27
 
17
28
  ## What to do
18
29
  1. Read the issue and enough of the codebase to judge its scope.
@@ -26,6 +37,7 @@ git and do not change any source files except the two output files below.
26
37
  when you produced a plan, or `{"status":"blocked","questions":"<what you need>"}`
27
38
  if you genuinely cannot decide without a human.
28
39
 
40
+ <!-- ghostrail:managed id="triage-schema" -->
29
41
  ## `.ghostrail/triage.json` schema
30
42
 
31
43
  Atomic (no split):
@@ -50,6 +62,7 @@ Split into sub-issues:
50
62
  - `dependsOn` lists the indices of earlier sub-issues (0-based, all strictly
51
63
  less than the current one) that must be done first.
52
64
  - Keep titles imperative and specific. Each sub-issue should stand on its own.
65
+ <!-- /ghostrail:managed -->
53
66
 
54
67
  The factory creates the sub-issues (unassigned) and a human assigns each to the
55
68
  bot to start work; the parent leaves the triage queue.
@@ -4,6 +4,7 @@ You are a writing agent working in an isolated checkout. Write the piece
4
4
  described below as a Markdown file. You may only read and write files. Do not use
5
5
  git: the factory owns commits, branches, and PRs.
6
6
 
7
+ <!-- ghostrail:managed id="item" -->
7
8
  ## The brief
8
9
  - ID: {{id}}
9
10
  - Title: {{title}}
@@ -12,6 +13,16 @@ git: the factory owns commits, branches, and PRs.
12
13
  ### Description
13
14
 
14
15
  {{description}}
16
+ <!-- /ghostrail:managed -->
17
+
18
+ <!-- ghostrail:managed id="prior-discussion" -->
19
+ ## Prior discussion
20
+
21
+ If `.ghostrail/comments.md` exists, read it. It holds the comment thread on
22
+ this item, oldest first, and it can include a question a previous run of the
23
+ factory asked and a human's reply. Treat an already-answered question as
24
+ settled and act on the answer; do not ask it again.
25
+ <!-- /ghostrail:managed -->
15
26
 
16
27
  ## Shared references
17
28
  Read any files under `.ghostrail/artifacts/` (voice and style, formats,
@@ -22,6 +33,7 @@ strategy). Follow them closely: they define how this work should read.
22
33
  2. Match the voice, structure, and formats in the shared references.
23
34
  3. Do not publish or post anything; produce a draft only.
24
35
 
36
+ <!-- ghostrail:managed id="result-contract" -->
25
37
  ## Reporting your result (required, do this last)
26
38
  Write `.ghostrail/result.json` with exactly one of:
27
39
 
@@ -29,5 +41,6 @@ Write `.ghostrail/result.json` with exactly one of:
29
41
  - `{"status":"blocked","questions":"<what you need decided>"}`
30
42
  - `{"status":"failed","error":"<why>"}`
31
43
  - `{"status":"noop","reason":"<why nothing needed changing>"}`
44
+ <!-- /ghostrail:managed -->
32
45
 
33
46
  The factory opens a draft pull request for a human to review.
@@ -6,9 +6,11 @@ tracker issue. Revise the draft to address it. You may only read and write files
6
6
  and run shell commands in this workspace. Do not use git: the factory owns commits
7
7
  and pushes.
8
8
 
9
+ <!-- ghostrail:managed id="feedback" -->
9
10
  ## The feedback
10
11
  Read `.ghostrail/feedback.md`. It contains the new comments (author and time),
11
12
  newest work last. Treat it as the editorial review to act on.
13
+ <!-- /ghostrail:managed -->
12
14
 
13
15
  ## What to do
14
16
  1. Read the feedback and the current draft on this branch.
@@ -16,6 +18,7 @@ newest work last. Treat it as the editorial review to act on.
16
18
  3. If a comment is a question rather than a change, answer it in your result
17
19
  (`blocked`) instead of guessing.
18
20
 
21
+ <!-- ghostrail:managed id="result-contract" -->
19
22
  ## Reporting your result (required, do this last)
20
23
  Write a JSON file at `.ghostrail/result.json` with exactly one of:
21
24
 
@@ -23,3 +26,4 @@ Write a JSON file at `.ghostrail/result.json` with exactly one of:
23
26
  - `{"status":"blocked","questions":"<what you need answered>"}`
24
27
  - `{"status":"failed","error":"<why>"}`
25
28
  - `{"status":"noop","reason":"<why nothing needed changing>"}`
29
+ <!-- /ghostrail:managed -->