adr-kit 0.8.0 → 0.10.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 (82) hide show
  1. package/README.md +40 -16
  2. package/README.zh.md +35 -18
  3. package/dist/cli.d.ts.map +1 -1
  4. package/dist/cli.js +48 -18
  5. package/dist/cli.js.map +1 -1
  6. package/dist/commands/accept.d.ts +2 -2
  7. package/dist/commands/accept.d.ts.map +1 -1
  8. package/dist/commands/accept.js +2 -2
  9. package/dist/commands/accept.js.map +1 -1
  10. package/dist/commands/completion.d.ts.map +1 -1
  11. package/dist/commands/completion.js +13 -8
  12. package/dist/commands/completion.js.map +1 -1
  13. package/dist/commands/decide.d.ts +2 -2
  14. package/dist/commands/decide.d.ts.map +1 -1
  15. package/dist/commands/decide.js +2 -2
  16. package/dist/commands/decide.js.map +1 -1
  17. package/dist/commands/graph.d.ts +1 -0
  18. package/dist/commands/graph.d.ts.map +1 -1
  19. package/dist/commands/graph.js +4 -1
  20. package/dist/commands/graph.js.map +1 -1
  21. package/dist/commands/init.js +2 -2
  22. package/dist/commands/init.js.map +1 -1
  23. package/dist/commands/instructions.js +6 -6
  24. package/dist/commands/instructions.js.map +1 -1
  25. package/dist/commands/list.js +1 -1
  26. package/dist/commands/list.js.map +1 -1
  27. package/dist/commands/propose.js +2 -2
  28. package/dist/commands/propose.js.map +1 -1
  29. package/dist/commands/tree.d.ts +3 -0
  30. package/dist/commands/tree.d.ts.map +1 -0
  31. package/dist/commands/tree.js +18 -0
  32. package/dist/commands/tree.js.map +1 -0
  33. package/dist/core/adr.d.ts +19 -1
  34. package/dist/core/adr.d.ts.map +1 -1
  35. package/dist/core/adr.js +16 -1
  36. package/dist/core/adr.js.map +1 -1
  37. package/dist/core/canvas-view.d.ts +5 -0
  38. package/dist/core/canvas-view.d.ts.map +1 -0
  39. package/dist/core/canvas-view.js +121 -0
  40. package/dist/core/canvas-view.js.map +1 -0
  41. package/dist/core/deliberation-html.d.ts +4 -0
  42. package/dist/core/deliberation-html.d.ts.map +1 -0
  43. package/dist/core/deliberation-html.js +81 -0
  44. package/dist/core/deliberation-html.js.map +1 -0
  45. package/dist/core/deliberation-view.d.ts +4 -0
  46. package/dist/core/deliberation-view.d.ts.map +1 -0
  47. package/dist/core/deliberation-view.js +508 -0
  48. package/dist/core/deliberation-view.js.map +1 -0
  49. package/dist/core/deliberation.d.ts +40 -0
  50. package/dist/core/deliberation.d.ts.map +1 -0
  51. package/dist/core/deliberation.js +212 -0
  52. package/dist/core/deliberation.js.map +1 -0
  53. package/dist/core/graph-html.d.ts +8 -0
  54. package/dist/core/graph-html.d.ts.map +1 -0
  55. package/dist/core/graph-html.js +180 -0
  56. package/dist/core/graph-html.js.map +1 -0
  57. package/dist/core/graph-view.d.ts +3 -0
  58. package/dist/core/graph-view.d.ts.map +1 -0
  59. package/dist/core/graph-view.js +258 -0
  60. package/dist/core/graph-view.js.map +1 -0
  61. package/dist/core/graph.d.ts +4 -1
  62. package/dist/core/graph.d.ts.map +1 -1
  63. package/dist/core/graph.js +11 -2
  64. package/dist/core/graph.js.map +1 -1
  65. package/dist/core/repository.d.ts.map +1 -1
  66. package/dist/core/repository.js +27 -12
  67. package/dist/core/repository.js.map +1 -1
  68. package/dist/core/templates.d.ts +11 -6
  69. package/dist/core/templates.d.ts.map +1 -1
  70. package/dist/core/templates.js +14 -4
  71. package/dist/core/templates.js.map +1 -1
  72. package/dist/core/tool-integrations.d.ts.map +1 -1
  73. package/dist/core/tool-integrations.js +178 -46
  74. package/dist/core/tool-integrations.js.map +1 -1
  75. package/dist/core/validate.d.ts.map +1 -1
  76. package/dist/core/validate.js +37 -1
  77. package/dist/core/validate.js.map +1 -1
  78. package/dist/core/view-text.d.ts +14 -0
  79. package/dist/core/view-text.d.ts.map +1 -0
  80. package/dist/core/view-text.js +77 -0
  81. package/dist/core/view-text.js.map +1 -0
  82. package/package.json +3 -1
@@ -1 +1 @@
1
- {"version":3,"file":"tool-integrations.d.ts","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EAAE,CAErF"}
@@ -31,7 +31,7 @@ adrkit init [path]
31
31
  3. For a new repository, confirm the output lists \`adr/config.yaml\`, \`adr/decisions\`, and
32
32
  \`adr/.gitignore\`. Proposals are not a separate folder: they are ephemeral
33
33
  drafts in \`adr/.drafts/\`, created by \`adrkit propose\`. Durable records
34
- carry a \`decided-by\` field you declare; drafts never do.
34
+ carry \`raised-by\` and \`decided-by\` fields you declare; drafts never do.
35
35
 
36
36
  4. Add the following section to the project's agent instruction file
37
37
  (\`AGENTS.md\`; also \`CLAUDE.md\` if that is the team's entry point). Preserve
@@ -56,13 +56,20 @@ reading does not require creating an ADR. Re-read on a new or resumed task,
56
56
  or when scope or relevant files change, rather than relying on conversation
57
57
  memory.
58
58
 
59
+ A \`## Deliberation\` appendix records the design tree behind a decision. It is
60
+ reference material: read it only when that decision is in play, not on every
61
+ task.
62
+
59
63
  Record an ADR when an architectural choice will constrain future development
60
64
  and its rationale is not apparent from code alone. Record only decisions
61
65
  actually made and genuine alternatives and trade-offs; do not invent reasons
62
66
  to fill a template. Reuse an existing record for the same choice; record a
63
67
  replacement when important assumptions change. Routine implementation details,
64
68
  local fixes, and easily reversible choices need no ADR. If no important
65
- architectural decision was made, create none. \`accepted\` means a recorded
69
+ architectural decision was made, create none. When you grill a decision with
70
+ the \`adrkit-grill\` workflow, record every decision the session settles: the
71
+ session is itself the importance signal, so the bar above governs only the
72
+ direct \`decide\`/\`propose\` path. \`accepted\` means a recorded
66
73
  decision, not proof of human review. \`decided-by\` is a declaration of where the
67
74
  choice came from, not an inference: \`human\` when a person determined the
68
75
  direction — they stated it, changed a proposal into what shipped, or you are
@@ -76,10 +83,135 @@ nor verifies it.
76
83
  - Never create \`adr/\` directories by hand; use the CLI so the config and
77
84
  README stay canonical.
78
85
  - After init, read existing decisions and continue the task. Use
79
- \`adrkit decide "<title>" --decided-by human\` (\`agent\` when the choice came
80
- from your own judgment) only for an important
81
- architectural choice already made, or \`adrkit propose "<title>"\` when such a
82
- choice still needs review.`,
86
+ \`adrkit decide "<title>" --raised-by human --decided-by human\` (\`agent\` on
87
+ either axis when that is the truth) only for an important architectural choice
88
+ already made, or \`adrkit propose "<title>"\` when such a choice still needs
89
+ review.`,
90
+ },
91
+ {
92
+ name: 'adrkit-grill',
93
+ description: "Use when a decision is still being shaped and its direction is not settled, in a repository with an adr/ directory, or on any 'grill' trigger phrase; grill the user to shared understanding and record every decision the session settles. Also use when the user asks to visualize an existing ADR or grilling decision, or the whole decision set.",
94
+ body: `# ADR Kit Grill
95
+
96
+ ## Overview
97
+
98
+ Interrogate the user about a decision until nothing is left silently
99
+ assumed, then record every decision the session settled. The session feeds the
100
+ record directly: the root questions become \`## Problem\`, the rejected options
101
+ become \`## Alternatives considered\`, and who raised and who overrode feeds
102
+ \`raised-by\` and \`decided-by\`.
103
+
104
+ The interrogation method is adapted from the \`grilling\` skill in
105
+ [mattpocock/skills](https://github.com/mattpocock/skills) (MIT).
106
+
107
+ ## Visualize a decision
108
+
109
+ When the user asks to visualize a recorded ADR, a grilling result, or the whole
110
+ decision set, use these paths directly; do not start a new grilling session or
111
+ create another ADR. There are two levels, and the request picks one:
112
+
113
+ - **One decision — the decision tree.** Resolve the record with \`adrkit list\`
114
+ and \`adrkit show <N>\`, and read its \`## Deliberation\` appendix. If there is
115
+ no tree, explain that the record has no recorded deliberation to visualize;
116
+ do not invent one. Render it with \`adrkit tree <N> --html > "<path>.html"\`.
117
+ - **All decisions — the decision map.** Render the whole set with
118
+ \`adrkit graph --html > "<path>.html"\`. It groups every decision by creation
119
+ date, draws supersede and reference edges, and marks the decisions that carry
120
+ a deliberation tree. A node links to its record file; it does not expand the
121
+ tree yet.
122
+
123
+ Both renderers are built in, not agent-designed replacement pages. Choose a new
124
+ file in the user's requested location or a temporary directory; quote paths and
125
+ avoid overwriting a record or an existing file. Check the command succeeded.
126
+ Deliver a clickable link; the file is self-contained and works offline. Open a
127
+ browser only when the user explicitly asks to open it. No browser launch is part
128
+ of generation.
129
+
130
+ Generate HTML only on an explicit visualization request, never automatically at
131
+ the end of a grilling session. \`--text\`, \`--mermaid\`, and \`--dot\` remain
132
+ available when the user requests those formats. Keep Markdown as the source of
133
+ truth.
134
+
135
+ ## When to grill
136
+
137
+ Grill when a decision is still being shaped and its direction is not settled:
138
+ an architectural choice, or any other decision worth stress-testing before it
139
+ is recorded. The direct \`decide\`/\`propose\` paths keep the ADR importance bar;
140
+ a grilling session is itself the signal that its output is key, so its
141
+ decisions are not filtered again at record time.
142
+
143
+ ## Method
144
+
145
+ 1. Run \`adrkit list\` and read every decision in full with \`adrkit show <N>\`
146
+ (or read its file), even if you ran it earlier in this conversation. The
147
+ tree must not re-ask what an existing record already settles; reopening a
148
+ settled decision is a supersede, not a question.
149
+ 2. Map the decision as a design tree: every decision branches into the
150
+ decisions that hang off it.
151
+ 3. Work the tree in rounds. The frontier is every question whose
152
+ prerequisites are already settled: the questions you can ask now without
153
+ guessing at answers you have not heard. Ask the whole frontier in one
154
+ round, then wait for the user's answers before the next round. Format
155
+ each question like:
156
+
157
+ \`\`\`
158
+ ❓ **Q1 - <question title>**: <question body, with options if any>
159
+
160
+ ➡️ <your recommended answer>
161
+ \`\`\`
162
+
163
+ 4. Each round of answers reshapes the tree: settled decisions push the
164
+ frontier outward and unblock the questions that depended on them. A
165
+ question whose answer depends on another question still open in this
166
+ round belongs to a later round. As each answer settles, note which option
167
+ or question raised the next one; the record nests it under that node.
168
+ 5. Finding facts is your job, never the user's: when a question needs a fact
169
+ from the repository or the environment, look it up yourself (or dispatch
170
+ a sub-agent) instead of asking. Do not block on a running lookup; only
171
+ the questions downstream of it wait. The decisions are the user's: put
172
+ each to them and wait.
173
+ 6. The session is done when the frontier is empty: every branch visited,
174
+ nothing left silently assumed. Do not act and do not write records until
175
+ the user confirms you have reached shared understanding.
176
+
177
+ ## Recording the outcome
178
+
179
+ 1. Record every decision the session settled; there is no record-time filter.
180
+ One session often settles several decisions: usually one primary record
181
+ with the rest as branches, but split them when they can be superseded
182
+ independently. Run \`adrkit decide "<title>" --raised-by human
183
+ --decided-by human\` (or \`agent\` on either axis, per the rule below);
184
+ grilling ends in a decision, never a proposal. Then follow the decide
185
+ workflow.
186
+ 2. Fill the record from the session: \`## Problem\` from the root questions,
187
+ \`## Decision\` from the user's answers, \`## Alternatives considered\` from
188
+ the frontier options they rejected, \`## Consequences\` from the branches
189
+ their answers unlocked. Keep the design tree in an optional
190
+ \`## Deliberation\` appendix: prefix a question \`Q:\` and an option \`A:\`, tag
191
+ each node \`[settled]\`, \`[rejected]\`, or \`[open]\`, nest each follow-up
192
+ question under the option or question that raised it, mark the option you
193
+ recommended \`(recommended)\`, and give a rejected option a \` — reason\`.
194
+ \`adrkit tree <N>\` renders it (\`--mermaid\`, or \`--html\` for a file). Add 2-4
195
+ kebab-case \`tags\` to the front matter.
196
+ 3. Declare both provenance axes: \`--raised-by\` is who put the decision on the
197
+ table; \`--decided-by\` is whose judgment settled it. \`decided-by\` is \`human\`
198
+ when the user's answers determined the direction — especially where they
199
+ overrode your recommendations — and \`agent\` when they adopted every
200
+ recommendation without engaging. Put the nuance in the body: which
201
+ recommendations they changed and which they let through.
202
+ 4. Run \`adrkit validate <N>\` until it returns OK.
203
+
204
+ ## Rules
205
+
206
+ - One round at a time: never stack a question whose answer depends on a
207
+ question still open in the same round.
208
+ - Never ask the user for a fact you could look up yourself.
209
+ - Never write a record mid-session; records follow the user's confirmation
210
+ of shared understanding, and then every decision the session settled is
211
+ recorded.
212
+ - A settled decision the user reopens becomes a supersede once its
213
+ replacement is recorded and validated: use \`adrkit supersede\`, and say in
214
+ the new record's \`## Problem\` what assumption changed.`,
83
215
  },
84
216
  {
85
217
  name: 'adrkit-propose',
@@ -121,22 +253,20 @@ adrkit propose "<title>"
121
253
  4. Add 2-4 kebab-case \`tags\` to the front matter (for example \`frontend\`,
122
254
  \`execution-layer\`) so the decision graph can group by theme.
123
255
  5. Promote the completed draft with
124
- \`adrkit accept "<title>" --decided-by human\` (\`agent\` when the choice came
125
- from your own judgment); the CLI validates it
126
- before promoting. Declare \`human\` when a person determined the direction
127
- (they stated it, changed your proposal into what shipped, or you are
128
- recording one they made earlier), \`agent\` when it came from your own
129
- judgment. A person who merely lets a proposal through without engaging with
130
- the choice leaves the source with you: that is \`agent\`, and the body is
131
- where you say they approved it.
256
+ \`adrkit accept "<title>" --raised-by human --decided-by human\` (\`agent\` on
257
+ either axis when that is the truth); the CLI validates it before promoting.
258
+ \`raised-by\` is who put the draft on the table, \`decided-by\` whose judgment
259
+ settled it. A person who merely lets a proposal through without engaging
260
+ with the choice leaves \`decided-by\` with you: that is \`agent\`, and the body
261
+ is where you say they approved it.
132
262
 
133
263
  ## Rules
134
264
 
135
265
  - Do not skip \`## Alternatives considered\`. A proposal without alternatives
136
266
  is invalid by design.
137
- - Keep the front matter exactly \`status: proposed\`. Never write
138
- \`decided-by\`: a draft has no decision to attribute, so the value belongs to
139
- \`adrkit accept\`, which requires you to declare it. A value written here is
267
+ - Keep the front matter exactly \`status: proposed\`. Never write \`raised-by\` or
268
+ \`decided-by\`: a draft has no decision to attribute, so the values belong to
269
+ \`adrkit accept\`, which requires you to declare them. A value written here is
140
270
  rejected while the draft exists and dropped when it is promoted.`,
141
271
  },
142
272
  {
@@ -169,7 +299,7 @@ an ADR for every task or invent alternatives and reasons to fill a template.
169
299
  2. Run:
170
300
 
171
301
  \`\`\`bash
172
- adrkit decide "<title>" --decided-by human # or agent, per the rule below
302
+ adrkit decide "<title>" --raised-by human --decided-by human # or agent on either axis
173
303
  \`\`\`
174
304
 
175
305
  3. Edit the created file and fill \`## Problem\`, \`## Decision\`,
@@ -180,21 +310,22 @@ adrkit decide "<title>" --decided-by human # or agent, per the rule below
180
310
 
181
311
  ## Rules
182
312
 
183
- - \`decided-by\` declares where the choice came from: \`human\` when a person
184
- determined the direction — they stated it, changed your proposal into what
185
- shipped, or made it earlier and you are only recording it now; \`agent\` when
186
- it came from your own judgment, including when a person let your choice
187
- through without engaging with it. It records the source of the choice, not
188
- who ran the command: recording a person's decision makes it \`human\`, not
189
- \`agent\`. The CLI neither infers nor verifies it, so put the nuance (who
190
- proposed, who redirected or approved) in the body.
313
+ - \`raised-by\` and \`decided-by\` declare the decision's provenance:
314
+ \`raised-by\` is who put it on the table, \`decided-by\` whose judgment settled
315
+ it. For \`decided-by\`, \`human\` means a person determined the direction — they
316
+ stated it, changed your proposal into what shipped, or made it earlier and
317
+ you are only recording it now; \`agent\` means it came from your own judgment,
318
+ including when a person let your choice through without engaging with it. The
319
+ fields record the source of the choice, not who ran the command: recording a
320
+ person's decision makes it \`human\`, not \`agent\`. The CLI neither infers nor
321
+ verifies either, so put the nuance (who redirected or approved) in the body.
191
322
  - Accepted decisions must not contain \`## Proposal\`, \`## Acceptance
192
323
  criteria\`, or \`## Risks\` sections.
193
- - Never edit the \`decided-by\` value afterwards. A wrong value is a false
194
- provenance claim no later check can detect. A record missing the field is
195
- not a blank to fill on a hunch: write the value only when you know where the
196
- choice came from — your own judgment, or the person who directed it — and ask
197
- the person when you do not.
324
+ - Never edit the \`raised-by\` or \`decided-by\` value afterwards. A wrong value
325
+ is a false provenance claim no later check can detect. A record missing the
326
+ fields is not a blank to fill on a hunch: write them only when you know where
327
+ the choice came from — your own judgment, or the person who directed it — and
328
+ ask the person when you do not.
198
329
  - \`accepted\` means a recorded decision, not proof of human review.
199
330
  - \`adrkit accept\` is the better path when a proposal already exists.`,
200
331
  },
@@ -219,10 +350,10 @@ adrkit validate [name] [--all]
219
350
  ## Rules
220
351
 
221
352
  - Treat any non-OK output as a blocker for \`adrkit accept\`.
222
- - A \`front matter must include "decided-by"\` issue on a record that lacks the
223
- field is not yours to repair on a hunch: the value comes from whoever knows
224
- where that choice came from — your own judgment, or the person who directed
225
- it — so ask when you do not.
353
+ - A \`front matter must include "raised-by"\` or \`"decided-by"\` issue on a
354
+ record that lacks the field is not yours to repair on a hunch: the value
355
+ comes from whoever knows where that choice came from — your own judgment, or
356
+ the person who directed it — so ask when you do not.
226
357
  - \`adrkit validate\` checks durable decisions only; a draft in \`adr/.drafts/\`
227
358
  is validated by \`adrkit accept\` right before it is promoted.`,
228
359
  },
@@ -245,20 +376,21 @@ the next \`N\` number, rewrites \`## Proposal\` to \`## Decision\`, folds
245
376
  2. Run:
246
377
 
247
378
  \`\`\`bash
248
- adrkit accept "<name>" --decided-by human # or agent, per the rule below
379
+ adrkit accept "<name>" --raised-by human --decided-by human # or agent on either axis
249
380
  \`\`\`
250
381
 
251
382
  3. Confirm the output names the new \`adr/decisions/N-*.md\` file.
252
383
 
253
384
  ## Rules
254
385
 
255
- - Declare \`decided-by\` when you promote: \`human\` when a person determined the
256
- direction (they stated it, changed this draft into what shipped, or you are
257
- recording one they made earlier), \`agent\` when it came from your own
258
- judgment, including when a person only let the draft through. Promotion is
259
- the last moment the value can be set; the CLI records what you declare
260
- without inferring or checking it. If the person redirected or approved your
261
- proposal, say so in the body.
386
+ - Declare \`raised-by\` and \`decided-by\` when you promote: \`raised-by\` is who
387
+ put the draft on the table, \`decided-by\` whose judgment settled it. For
388
+ \`decided-by\`, \`human\` means a person determined the direction (they stated
389
+ it, changed this draft into what shipped, or you are recording one they made
390
+ earlier), \`agent\` means it came from your own judgment, including when a
391
+ person only let the draft through. Promotion is the last moment either value
392
+ can be set; the CLI records what you declare without inferring or checking
393
+ it. If the person redirected or approved your proposal, say so in the body.
262
394
  - Never accept an invalid draft; the command refuses.
263
395
  - Re-run \`adrkit show "<name>"\` immediately before accepting, even if you
264
396
  reviewed it earlier in this conversation; the repo may have changed since.
@@ -321,9 +453,9 @@ adrkit supersede "<old name or number>" --by "<new name or number>"
321
453
  still exists and is not itself superseded, even if you checked earlier in
322
454
  this conversation.
323
455
  - Never hand-edit a superseded record afterwards; it is history, including
324
- its \`decided-by\` value, which the command preserves rather than replacing
325
- with whoever retired it. Superseding changes the record's status, not who
326
- made the decision.
456
+ its \`raised-by\` and \`decided-by\` values, which the command preserves rather
457
+ than replacing with whoever retired it. Superseding changes the record's
458
+ status, not who raised or decided it.
327
459
  - Mention what it supersedes in the new decision's \`## Problem\` section so
328
460
  the causal link survives in prose.`,
329
461
  },
@@ -1 +1 @@
1
- {"version":3,"file":"tool-integrations.js","sourceRoot":"","sources":["../../src/core/tool-integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/F,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAuBpD,MAAM,WAAW,GAA0C;IACzD,MAAM,EAAE,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,EAAE,gBAAgB,EAAE;IAClE,MAAM,EAAE,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,EAAE,gBAAgB,EAAE;CACnE,CAAC;AAQF,mEAAmE;AACnE,gDAAgD;AAChD,MAAM,CAAC,MAAM,SAAS,GAAe;IACnC;QACE,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,gGAAgG;QAC7G,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAqEmB;KAC1B;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,8FAA8F;QAC3G,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mEAqDyD;KAChE;IACD;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,6LAA6L;QAC1M,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uEAsD6D;KACpE;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,sHAAsH;QACnI,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;iEAuBuD;KAC9D;IACD;QACE,IAAI,EAAE,eAAe;QACrB,WAA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nB,eAAe,EAAE,CAWnB;AAgCD,wBAAgB,YAAY,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,CAI9D"}
@@ -136,6 +136,9 @@ export function validateRecord(root, record) {
136
136
  * repairs it: an agent inventing who made a past decision is the fabricated
137
137
  * provenance this field exists to prevent.
138
138
  */
139
+ if (record.raisedBy === undefined) {
140
+ issues.push({ path, message: 'front matter must include "raised-by"' });
141
+ }
139
142
  if (record.decidedBy === undefined) {
140
143
  issues.push({ path, message: 'front matter must include "decided-by"' });
141
144
  }
@@ -180,6 +183,9 @@ export function validateDraft(root, draft) {
180
183
  // A draft has not taken effect, so it has no decision to attribute. The key
181
184
  // is rejected rather than ignored: promotion rebuilds the front matter from
182
185
  // the canonical fields, so a value written here would silently vanish.
186
+ if (draft.raisedBy !== undefined) {
187
+ issues.push({ path, message: '"raised-by" is declared at promotion and must not appear on a draft' });
188
+ }
183
189
  if (draft.decidedBy !== undefined) {
184
190
  issues.push({ path, message: '"decided-by" is declared at promotion and must not appear on a draft' });
185
191
  }
@@ -243,6 +249,7 @@ export function validateRepository(root) {
243
249
  }
244
250
  for (const record of records) {
245
251
  issues.push(...supersedeReferenceIssues(root, record, decisionRecords));
252
+ issues.push(...danglingReferenceIssues(relative(root, record.path), record, decisionRecords));
246
253
  }
247
254
  return issues;
248
255
  }
@@ -279,7 +286,36 @@ export function validateRecordReferences(root, record, records) {
279
286
  decisions.set(candidate.number, candidate);
280
287
  }
281
288
  }
282
- return supersedeReferenceIssues(root, record, decisions);
289
+ return [
290
+ ...supersedeReferenceIssues(root, record, decisions),
291
+ ...danglingReferenceIssues(relative(root, record.path), record, decisions),
292
+ ];
293
+ }
294
+ /**
295
+ * A record body may name other decisions. `adrkit graph` mines those
296
+ * references but silently drops the ones that resolve to nothing, so this
297
+ * reports a reference to a decision number that does not exist. The record's
298
+ * own number is not a reference, and the title line is not scanned because it
299
+ * is not a section.
300
+ */
301
+ function danglingReferenceIssues(path, record, decisions) {
302
+ // The same prose vocabulary `adrkit graph` mines: `ADR-12`, `ADR 4`, `ADR12`.
303
+ const pattern = /ADR-?\s*([1-9]\d*)/g;
304
+ const numbers = new Set();
305
+ for (const section of record.sections) {
306
+ const text = `${section.heading}\n${section.body}`;
307
+ let match;
308
+ while ((match = pattern.exec(text)) !== null) {
309
+ numbers.add(Number(match[1]));
310
+ }
311
+ }
312
+ const issues = [];
313
+ for (const number of [...numbers].sort((a, b) => a - b)) {
314
+ if (number === record.number || decisions.has(number))
315
+ continue;
316
+ issues.push({ path, message: `body references decision ${number}, which does not exist` });
317
+ }
318
+ return issues;
283
319
  }
284
320
  export function formatIssues(issues) {
285
321
  if (issues.length === 0)
@@ -1 +1 @@
1
- {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/core/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,qBAAqB,GAGtB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAO9C,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,yBAAyB,EAAE,cAAc,CAAC,CAAC;AAC7F,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,OAAO,CAAC,CAAC;AAE7G,MAAM,WAAW,GAAG,4BAA4B,CAAC;AAEjD,SAAS,mBAAmB,CAAC,IAAY,EAAE,KAAa,EAAE,GAAW;IACnE,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IAC5C,OAAO,IAAI,CAAC,WAAW,EA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,MAAM,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QACxD,IAAI,MAAM,KAAK,MAAM,CAAC,MAAM,IAAI,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC;YAAE,SAAS;QAChE,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,4BAA4B,MAAM,wBAAwB,EAAE,CAAC,CAAC;IAC7F,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,MAAyB;IACpD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACrC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IACzE,OAAO,SAAS,MAAM,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AAC/F,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Text helpers shared by the rendered views: the SVG decision map, the card
3
+ * tree, and Mermaid labels. One implementation keeps escaping and wrapping
4
+ * identical wherever record text reaches a view.
5
+ */
6
+ /** Escape text for insertion into HTML or SVG character data. */
7
+ export declare function escapeHtml(text: string): string;
8
+ /**
9
+ * Wrap text to roughly `maxWidth` columns on word boundaries. A run with no
10
+ * break opportunity — Chinese text, a long URL — is split by width instead of
11
+ * overflowing the view. Returns at least one line.
12
+ */
13
+ export declare function wrapText(text: string, maxWidth: number): string[];
14
+ //# sourceMappingURL=view-text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view-text.d.ts","sourceRoot":"","sources":["../../src/core/view-text.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,iEAAiE;AACjE,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAO/C;AAiCD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAuBjE"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Text helpers shared by the rendered views: the SVG decision map, the card
3
+ * tree, and Mermaid labels. One implementation keeps escaping and wrapping
4
+ * identical wherever record text reaches a view.
5
+ */
6
+ /** Escape text for insertion into HTML or SVG character data. */
7
+ export function escapeHtml(text) {
8
+ return text
9
+ .replace(/&/g, '&amp;')
10
+ .replace(/</g, '&lt;')
11
+ .replace(/>/g, '&gt;')
12
+ .replace(/"/g, '&quot;')
13
+ .replace(/'/g, '&#39;');
14
+ }
15
+ /**
16
+ * East Asian wide and fullwidth ranges. They occupy two columns, so counting
17
+ * code points alone would let a Chinese or Japanese title overflow a card that
18
+ * holds thirty Latin characters.
19
+ */
20
+ const WIDE = /[\u1100-\u115f\u2e80-\u303f\u3040-\u33ff\u3400-\u4dbf\u4e00-\u9fff\ua000-\ua4cf\uac00-\ud7a3\uf900-\ufaff\ufe30-\ufe4f\uff00-\uff60\uffe0-\uffe6]/;
21
+ function displayWidth(text) {
22
+ let width = 0;
23
+ for (const char of text)
24
+ width += WIDE.test(char) ? 2 : 1;
25
+ return width;
26
+ }
27
+ function splitByWidth(word, maxWidth) {
28
+ const pieces = [];
29
+ let piece = '';
30
+ let width = 0;
31
+ for (const char of word) {
32
+ const charWidth = WIDE.test(char) ? 2 : 1;
33
+ if (piece.length > 0 && width + charWidth > maxWidth) {
34
+ pieces.push(piece);
35
+ piece = '';
36
+ width = 0;
37
+ }
38
+ piece += char;
39
+ width += charWidth;
40
+ }
41
+ if (piece.length > 0)
42
+ pieces.push(piece);
43
+ return pieces;
44
+ }
45
+ /**
46
+ * Wrap text to roughly `maxWidth` columns on word boundaries. A run with no
47
+ * break opportunity — Chinese text, a long URL — is split by width instead of
48
+ * overflowing the view. Returns at least one line.
49
+ */
50
+ export function wrapText(text, maxWidth) {
51
+ const lines = [];
52
+ let current = '';
53
+ const flush = () => {
54
+ if (current.length > 0) {
55
+ lines.push(current);
56
+ current = '';
57
+ }
58
+ };
59
+ for (const word of text.split(/\s+/).filter((candidate) => candidate.length > 0)) {
60
+ if (displayWidth(word) > maxWidth) {
61
+ flush();
62
+ lines.push(...splitByWidth(word, maxWidth));
63
+ continue;
64
+ }
65
+ if (current === '')
66
+ current = word;
67
+ else if (displayWidth(current) + 1 + displayWidth(word) > maxWidth) {
68
+ flush();
69
+ current = word;
70
+ }
71
+ else
72
+ current = current + ' ' + word;
73
+ }
74
+ flush();
75
+ return lines.length > 0 ? lines : [''];
76
+ }
77
+ //# sourceMappingURL=view-text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view-text.js","sourceRoot":"","sources":["../../src/core/view-text.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,iEAAiE;AACjE,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,IAAI;SACR,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;SACvB,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5B,CAAC;AAED;;;;GAIG;AACH,MAAM,IAAI,GAAG,mJAAmJ,CAAC;AAEjK,SAAS,YAAY,CAAC,IAAY;IAChC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,IAAI,IAAI,IAAI;QAAE,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAA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,CAAC,CAAC,EAAE,CAAC;QACjF,IAAI,YAAY,CAAC,IAAI,CAAC,GAAG,QAAQ,EAAE,CAAC;YAClC,KAAK,EAAE,CAAC;YACR,KAAK,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;YAC5C,SAAS;QACX,CAAC;QACD,IAAI,OAAO,KAAK,EAAE;YAAE,OAAO,GAAG,IAAI,CAAC;aAC9B,IAAI,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,GAAG,QAAQ,EAAE,CAAC;YACnE,KAAK,EAAE,CAAC;YACR,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;;YAAM,OAAO,GAAG,OAAO,GAAG,GAAG,GAAG,IAAI,CAAC;IACxC,CAAC;IACD,KAAK,EAAE,CAAC;IACR,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACzC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adr-kit",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "description": "Architecture Decision Records (ADRs) for AI coding assistants.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -31,6 +31,8 @@
31
31
  "test": "vitest run",
32
32
  "test:watch": "vitest",
33
33
  "test:coverage": "vitest run --coverage",
34
+ "check:upstream": "node tools/check-grilling-upstream.mjs",
35
+ "grilling:diff": "node tools/check-grilling-upstream.mjs --diff",
34
36
  "changeset": "changeset",
35
37
  "release": "changeset publish",
36
38
  "prepublishOnly": "npm run build"