heyspex 0.1.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 (104) hide show
  1. package/README.md +157 -0
  2. package/bin/hs.mjs +1028 -0
  3. package/bin/postinstall.mjs +88 -0
  4. package/dev-factory/lib/fleet-readiness.mjs +274 -0
  5. package/dev-factory/lib/fleet-state.mjs +250 -0
  6. package/dev-factory/lib/sufficiency-score.mjs +441 -0
  7. package/dist/cli/hs-check.mjs +747 -0
  8. package/dist/cli/hs-claim.mjs +541 -0
  9. package/dist/cli/hs-connect.mjs +3436 -0
  10. package/dist/cli/hs-defer.mjs +8455 -0
  11. package/dist/cli/hs-env.mjs +36845 -0
  12. package/dist/cli/hs-init.mjs +1145 -0
  13. package/dist/cli/hs-install.mjs +1390 -0
  14. package/dist/cli/hs-join.mjs +38553 -0
  15. package/dist/cli/hs-vault-pull.mjs +7782 -0
  16. package/dist/cli/hs-vault.mjs +4166 -0
  17. package/dist/cli/hs-workspace.mjs +2898 -0
  18. package/dist/cli-templates/customer-vault/specs/entity-model.md +1735 -0
  19. package/dist/cli-templates/customer-vault/specs/protocols/canonical-frontmatter-templates.md +531 -0
  20. package/dist/cli-templates/customer-vault/specs/protocols/memory-protocol.md +48 -0
  21. package/dist/cli-templates/customer-vault/specs/protocols/spec-hierarchy.md +548 -0
  22. package/docs/mcp-client-config.md +200 -0
  23. package/package.json +124 -0
  24. package/scripts/check-mcp-freshness.mjs +379 -0
  25. package/scripts/dev-server-status.mjs +722 -0
  26. package/scripts/gateway-skills-lib.mjs +421 -0
  27. package/scripts/lib/console-url-resolver.mjs +152 -0
  28. package/scripts/lib/dev-mode.mjs +369 -0
  29. package/scripts/lib/hs-link.mjs +154 -0
  30. package/scripts/lib/hs-source-commit.mjs +207 -0
  31. package/scripts/lib/hs-source-log.mjs +366 -0
  32. package/scripts/lib/hs-source-preflight.mjs +402 -0
  33. package/scripts/lib/hs-source-push.mjs +307 -0
  34. package/scripts/lib/hs-source-secret-scan.mjs +263 -0
  35. package/scripts/lib/standalone-doctor.mjs +89 -0
  36. package/scripts/vault-id-lib.mjs +173 -0
  37. package/vendor/heyspex-mcp/alignment-gate.mjs +1347 -0
  38. package/vendor/heyspex-mcp/blocker-resolver.mjs +891 -0
  39. package/vendor/heyspex-mcp/breakdown-ladder.mjs +309 -0
  40. package/vendor/heyspex-mcp/breakdown-source.mjs +236 -0
  41. package/vendor/heyspex-mcp/breakdown-writer.mjs +524 -0
  42. package/vendor/heyspex-mcp/brief-observability.mjs +67 -0
  43. package/vendor/heyspex-mcp/canvas-inbox.mjs +130 -0
  44. package/vendor/heyspex-mcp/capture-active-rehydrate.mjs +76 -0
  45. package/vendor/heyspex-mcp/capture-buffer-patches.mjs +147 -0
  46. package/vendor/heyspex-mcp/capture-channel.mjs +577 -0
  47. package/vendor/heyspex-mcp/capture-console-client.mjs +290 -0
  48. package/vendor/heyspex-mcp/capture-focus.mjs +1366 -0
  49. package/vendor/heyspex-mcp/capture-kind-suggest.mjs +121 -0
  50. package/vendor/heyspex-mcp/capture-outbox.mjs +239 -0
  51. package/vendor/heyspex-mcp/capture-stage-gate.mjs +160 -0
  52. package/vendor/heyspex-mcp/cli.mjs +15754 -0
  53. package/vendor/heyspex-mcp/config-settings.mjs +419 -0
  54. package/vendor/heyspex-mcp/console-fetch.mjs +342 -0
  55. package/vendor/heyspex-mcp/defer-spec.mjs +527 -0
  56. package/vendor/heyspex-mcp/deferred-reclaim.mjs +284 -0
  57. package/vendor/heyspex-mcp/design-tools.mjs +449 -0
  58. package/vendor/heyspex-mcp/dev-factory-bridge.mjs +66 -0
  59. package/vendor/heyspex-mcp/diagnose-skeleton.mjs +114 -0
  60. package/vendor/heyspex-mcp/fleet-queue-tools.mjs +241 -0
  61. package/vendor/heyspex-mcp/hooks-engine.mjs +399 -0
  62. package/vendor/heyspex-mcp/login-handoff.mjs +438 -0
  63. package/vendor/heyspex-mcp/mcp-subprocess.mjs +136 -0
  64. package/vendor/heyspex-mcp/mvp-mode.mjs +101 -0
  65. package/vendor/heyspex-mcp/next-resolution.mjs +240 -0
  66. package/vendor/heyspex-mcp/next-review.mjs +548 -0
  67. package/vendor/heyspex-mcp/peer-presence.mjs +430 -0
  68. package/vendor/heyspex-mcp/plan-ground-conflicts.mjs +321 -0
  69. package/vendor/heyspex-mcp/plan-ground.mjs +2001 -0
  70. package/vendor/heyspex-mcp/plan-ingest.mjs +476 -0
  71. package/vendor/heyspex-mcp/plan-push.mjs +1826 -0
  72. package/vendor/heyspex-mcp/plan-review.mjs +1419 -0
  73. package/vendor/heyspex-mcp/preflight-gate.mjs +0 -0
  74. package/vendor/heyspex-mcp/procedure-tools.mjs +970 -0
  75. package/vendor/heyspex-mcp/promote-capture.mjs +1280 -0
  76. package/vendor/heyspex-mcp/promote-diagnose.mjs +187 -0
  77. package/vendor/heyspex-mcp/promote-research-to-diagnose.mjs +338 -0
  78. package/vendor/heyspex-mcp/promote-research.mjs +1553 -0
  79. package/vendor/heyspex-mcp/promotion-helpers.mjs +280 -0
  80. package/vendor/heyspex-mcp/read-path.mjs +138 -0
  81. package/vendor/heyspex-mcp/recipe-tools.mjs +258 -0
  82. package/vendor/heyspex-mcp/regen-tasks.mjs +326 -0
  83. package/vendor/heyspex-mcp/register-spec.mjs +417 -0
  84. package/vendor/heyspex-mcp/research-focus.mjs +476 -0
  85. package/vendor/heyspex-mcp/research-tools.mjs +109 -0
  86. package/vendor/heyspex-mcp/research-type-suggest.mjs +112 -0
  87. package/vendor/heyspex-mcp/resolution-focus.mjs +45 -0
  88. package/vendor/heyspex-mcp/review-focus.mjs +55 -0
  89. package/vendor/heyspex-mcp/review-rollup.mjs +47 -0
  90. package/vendor/heyspex-mcp/run-front.mjs +60 -0
  91. package/vendor/heyspex-mcp/scheduler.mjs +813 -0
  92. package/vendor/heyspex-mcp/seat-identity.mjs +281 -0
  93. package/vendor/heyspex-mcp/settings-tools.mjs +119 -0
  94. package/vendor/heyspex-mcp/spec-id-lib.mjs +790 -0
  95. package/vendor/heyspex-mcp/split-research.mjs +832 -0
  96. package/vendor/heyspex-mcp/submit-for-review.mjs +190 -0
  97. package/vendor/heyspex-mcp/summary-contract.mjs +162 -0
  98. package/vendor/heyspex-mcp/test-helpers.mjs +43 -0
  99. package/vendor/heyspex-mcp/validate-linkage.mjs +574 -0
  100. package/vendor/heyspex-mcp/vault-resolve.mjs +297 -0
  101. package/vendor/heyspex-mcp/vault-settings.mjs +87 -0
  102. package/vendor/heyspex-mcp/verify-reproduction.mjs +314 -0
  103. package/vendor/heyspex-mcp/why-now.mjs +64 -0
  104. package/vendor/heyspex-mcp/yaml-scalar.mjs +34 -0
@@ -0,0 +1,531 @@
1
+ ---
2
+ id: HS-PROTO-canonical-frontmatter-templates
3
+ name: Canonical frontmatter templates per entity kind
4
+ type: protocol
5
+ status: open
6
+ priority: 1
7
+ scope: vault
8
+ owner: pwher
9
+ assisted_by:
10
+ - Claude Code
11
+ created: "2026-06-13"
12
+ updated: "2026-06-13"
13
+ tags:
14
+ - protocol
15
+ - spec-filing
16
+ - canonical-templates
17
+ - agent-experience
18
+ - frontmatter
19
+ triggers:
20
+ - file_milestone
21
+ - file_epic
22
+ - file_task
23
+ related:
24
+ - "HS-PROTO-spec-hierarchy"
25
+ - "[[entity-model]]"
26
+ - "HS-YXBD-1EM0-EPIC-canonical-spec-filing-surface-templates"
27
+ - "HS-OFUB-CVOB-EPIC-saas-customer-vault-onboarding"
28
+ templates:
29
+ milestone:
30
+ folder: milestones/
31
+ id_format: "HS-MIL-<4+ random alphanumeric>"
32
+ parent_kinds: []
33
+ required_fields: [id, name, summary, type, status, owner, created, updated, epics, target_date]
34
+ optional_fields: [informed_by, tags, related, what_matters, blast_radius]
35
+ schema_source: "specs/entity-model.md §milestone (lines 497–519)"
36
+ frontmatter:
37
+ id: "{{ID}}"
38
+ name: "{{NAME}}"
39
+ summary: ""
40
+ type: milestone
41
+ status: open
42
+ owner: "{{OWNER}}"
43
+ created: "{{TODAY}}"
44
+ updated: "{{TODAY}}"
45
+ epics: []
46
+ target_date: ""
47
+ tags:
48
+ - milestone
49
+ body_skeleton: |
50
+ # {{NAME}}
51
+
52
+ ## Intended outcome
53
+
54
+ <!-- Re-derive from the source research's intended outcome — do NOT copy it (HS-K4D4-2I29-RES-outcome-cascade-through-a-requirements-h). -->
55
+ **Outcome at the milestone altitude (required):** What outcome does this milestone deliver?
56
+
57
+ **Moves (↑ link, required):** Which research/parent outcome does it move — and by what **mechanism of contribution**? (Name the mechanism; don't echo the parent's words.)
58
+
59
+ ## Why this is a milestone, not loose epics
60
+
61
+ ## Acceptance gate
62
+
63
+ ## Suggested landing order
64
+
65
+ ## Out of scope
66
+
67
+ ## Expected Breakage & Consequences
68
+
69
+ <!-- Cross-epic seams at milestone altitude — author at plan ingest ([[spec-hierarchy]] §Expected Breakage). Auto-embedded after H1 by createSpec when omitted; listed here for template parity. -->
70
+ epic:
71
+ folder: epics/
72
+ id_format: "HS-EPIC-<4+ random alphanumeric>"
73
+ parent_kinds: [milestone]
74
+ required_fields:
75
+ [id, name, summary, type, status, owner, created, updated, kind, effort, milestone, pillar]
76
+ optional_fields:
77
+ [
78
+ research,
79
+ planning_flow,
80
+ secondary_pillars,
81
+ depends_on,
82
+ children,
83
+ related,
84
+ tags,
85
+ requires_user_testing,
86
+ derived_from,
87
+ alignment_rationale,
88
+ affects_paths,
89
+ blast_radius,
90
+ ]
91
+ schema_source: "specs/entity-model.md §epic (lines 455–494; shares the §task base at 392–453)"
92
+ frontmatter:
93
+ id: "{{ID}}"
94
+ name: "{{NAME}}"
95
+ summary: ""
96
+ type: epic
97
+ status: open
98
+ kind: feature
99
+ effort: 3
100
+ owner: "{{OWNER}}"
101
+ created: "{{TODAY}}"
102
+ updated: "{{TODAY}}"
103
+ milestone: "{{PARENT_ID}}"
104
+ children: []
105
+ tags: []
106
+ body_skeleton: |
107
+ # {{NAME}}
108
+
109
+ ## Intended outcome
110
+
111
+ <!-- Re-derive from the parent milestone's intended outcome — do NOT copy it (HS-K4D4-2I29-RES-outcome-cascade-through-a-requirements-h). -->
112
+ **User-visible outcome of this epic (required):** What changes for the user when this epic ships?
113
+
114
+ **Moves (↑ link, required):** Which milestone outcome does it move — and by what **mechanism of contribution**?
115
+
116
+ ## Expected Breakage & Consequences
117
+
118
+ ## Why this epic exists
119
+
120
+ <!-- Substantive priority rationale (HS-XMSD). Plain language, no scores. -->
121
+ **Problem right now (required):** One sentence — what specific problem does this solve, and why is now (not next cycle) the right time?
122
+
123
+ **What this unlocks (required if `kind: infra` or `foundation`):** What future work becomes possible after this ships that isn't possible today?
124
+
125
+ **Skip cost (write before pinning this as on-deck):** If we skip this cycle, we lose: …
126
+
127
+ **Confidence note (optional):** Flag any part of the rationale above where your confidence is low.
128
+
129
+ ## Tasks
130
+
131
+ ## Acceptance gate — epic close
132
+
133
+ ## Change log
134
+ task:
135
+ folder: tasks/
136
+ id_format: "HS-TASK-<4+ random alphanumeric>"
137
+ parent_kinds: [epic, task]
138
+ required_fields: [id, name, summary, type, status, owner, created, updated, kind, effort]
139
+ optional_fields:
140
+ [
141
+ parent,
142
+ depends_on,
143
+ blocks,
144
+ related,
145
+ children,
146
+ tags,
147
+ requires_user_testing,
148
+ assignee,
149
+ affects_paths,
150
+ target,
151
+ test,
152
+ suggested_model,
153
+ suggested_machine,
154
+ recommended_num_ctx,
155
+ estimated_context_tokens,
156
+ context_files,
157
+ fit_assessment,
158
+ ]
159
+ schema_source: "specs/entity-model.md §task (lines 392–453)"
160
+ frontmatter:
161
+ id: "{{ID}}"
162
+ name: "{{NAME}}"
163
+ summary: ""
164
+ type: task
165
+ status: open
166
+ kind: feature
167
+ effort: 3
168
+ owner: "{{OWNER}}"
169
+ created: "{{TODAY}}"
170
+ updated: "{{TODAY}}"
171
+ parent: "{{PARENT_ID}}"
172
+ tags:
173
+ - near-term
174
+ body_skeleton: |
175
+ # {{NAME}}
176
+
177
+ ## Intended outcome
178
+
179
+ <!-- Re-derive from the parent epic's intended outcome — do NOT copy it (HS-K4D4-2I29-RES-outcome-cascade-through-a-requirements-h). -->
180
+ **Observable condition this task produces (required):** What can you monitor and control once this task is done? Express it as a checkable condition — this directly seeds the Acceptance criteria below.
181
+
182
+ **Moves (↑ link, required):** Which epic outcome does it move?
183
+
184
+ ## Expected Breakage & Consequences
185
+
186
+ ## Scope
187
+
188
+ ## Acceptance criteria
189
+
190
+ <!-- Each criterion is a monitorable + controllable condition derived from the Intended outcome above, traceable ↑ to the epic outcome. -->
191
+
192
+ ## Builder brief
193
+
194
+ <!-- Fleet dispatch hints for dev-factory (optional until breakdown files the task). Consult builder-fleet-capability-reference. -->
195
+ - **Target:** `{{TARGET_OR_TBD}}`
196
+ - **Context files:** `path/to/dep.ts`
197
+ - **Estimated context:** ~0 tokens
198
+ - **recommended_num_ctx:** 65536
199
+ - **suggested_model:** `qwen3-coder:30b`
200
+ - **suggested_machine:** `specops-gpu0`
201
+ - **fit_assessment:** safe
202
+
203
+ ## References
204
+ research:
205
+ folder: research/
206
+ id_format: "HS-RES-<NNN> (zero-padded numeric, server auto-increments)"
207
+ parent_kinds: []
208
+ required_fields: [id, name, type, status, owner, created, updated]
209
+ optional_fields:
210
+ [
211
+ enhances,
212
+ sources_captures,
213
+ spawned_epics,
214
+ enhances_epics,
215
+ split_into,
216
+ split_from,
217
+ planning_flow,
218
+ bound_epic,
219
+ tags,
220
+ related,
221
+ ]
222
+ schema_source: "specs/entity-model.md §research (lines 761–793)"
223
+ frontmatter:
224
+ id: "{{ID}}"
225
+ name: "{{NAME}}"
226
+ type: research
227
+ status: open
228
+ owner: "{{OWNER}}"
229
+ created: "{{TODAY}}"
230
+ updated: "{{TODAY}}"
231
+ tags:
232
+ - research
233
+ body_skeleton: |
234
+ # {{NAME}}
235
+
236
+ ## Executive Summary
237
+
238
+ ## Conclusion & intended outcome
239
+
240
+ <!-- The root outcome that milestones/epics/tasks spawned from this research refine (translate, don't copy) (HS-K4D4-2I29-RES-outcome-cascade-through-a-requirements-h). -->
241
+ **Conclusion (one line):** Acting on this research, what is the conclusion?
242
+
243
+ **What acting on this achieves:** What changes for the user or system if we act on it?
244
+
245
+ ## Findings
246
+
247
+ ## Sources
248
+ memory-lesson:
249
+ folder: memory/lessons/
250
+ id_format: "HS-LES-<slug>"
251
+ parent_kinds: []
252
+ required_fields: [id, name, type, status, owner, created, updated, topic, observed]
253
+ optional_fields: [related, evidence, tags]
254
+ schema_source: "specs/entity-model.md §memory-lesson (lines 604–615)"
255
+ frontmatter:
256
+ id: "{{ID}}"
257
+ name: "{{NAME}}"
258
+ type: memory-lesson
259
+ status: open
260
+ owner: "{{OWNER}}"
261
+ created: "{{TODAY}}"
262
+ updated: "{{TODAY}}"
263
+ topic: "{{SLUG}}"
264
+ observed: "{{TODAY}}"
265
+ body_skeleton: |
266
+ # {{NAME}}
267
+
268
+ ## Problem
269
+
270
+ ## Fix
271
+ memory-decision:
272
+ folder: memory/decisions/
273
+ id_format: "HS-DEC-<slug>"
274
+ parent_kinds: []
275
+ required_fields: [id, name, type, status, owner, created, updated, topic, decided, deciders]
276
+ optional_fields: [supersedes, evidence, related, tags]
277
+ schema_source: "specs/entity-model.md §memory-decision (lines 617–629)"
278
+ frontmatter:
279
+ id: "{{ID}}"
280
+ name: "{{NAME}}"
281
+ type: memory-decision
282
+ status: open
283
+ owner: "{{OWNER}}"
284
+ created: "{{TODAY}}"
285
+ updated: "{{TODAY}}"
286
+ topic: "{{SLUG}}"
287
+ decided: "{{TODAY}}"
288
+ deciders:
289
+ - "{{OWNER}}"
290
+ body_skeleton: |
291
+ # {{NAME}}
292
+
293
+ ## Decision
294
+
295
+ ## Rationale
296
+ memory-reference:
297
+ folder: memory/references/
298
+ id_format: "HS-REF-<slug>"
299
+ parent_kinds: []
300
+ required_fields: [id, name, type, status, owner, created, updated, topic]
301
+ optional_fields: [url, evidence, related, tags]
302
+ schema_source: "specs/entity-model.md §memory-reference (lines 631–641)"
303
+ frontmatter:
304
+ id: "{{ID}}"
305
+ name: "{{NAME}}"
306
+ type: memory-reference
307
+ status: open
308
+ owner: "{{OWNER}}"
309
+ created: "{{TODAY}}"
310
+ updated: "{{TODAY}}"
311
+ topic: "{{SLUG}}"
312
+ body_skeleton: |
313
+ # {{NAME}}
314
+
315
+ Brief context for why this reference matters.
316
+ memory-ui-pattern:
317
+ folder: memory/ui-patterns/
318
+ id_format: "HS-UIP-<slug>"
319
+ parent_kinds: []
320
+ required_fields: [id, name, type, status, owner, created, updated, topic, documented]
321
+ optional_fields: [related, evidence, tags]
322
+ schema_source: "specs/entity-model.md §memory-ui-pattern (lines 643–653)"
323
+ frontmatter:
324
+ id: "{{ID}}"
325
+ name: "{{NAME}}"
326
+ type: memory-ui-pattern
327
+ status: open
328
+ owner: "{{OWNER}}"
329
+ created: "{{TODAY}}"
330
+ updated: "{{TODAY}}"
331
+ topic: "{{SLUG}}"
332
+ documented: "{{TODAY}}"
333
+ body_skeleton: |
334
+ # {{NAME}}
335
+
336
+ ## Pattern
337
+
338
+ ## When to apply
339
+
340
+ ## Rules
341
+
342
+ ## Implementation
343
+ review:
344
+ folder: reviews/
345
+ id_format: "HS-REV-<parent-suffix> (suffix = parent id segment [2]; slug rides only in the filename)"
346
+ parent_kinds: [task, epic, milestone]
347
+ required_fields: [id, name, type, status, owner, created, updated, parent]
348
+ optional_fields: [reviews, deliberation_record]
349
+ schema_source: "specs/entity-model.md §review (lines 679–705)"
350
+ frontmatter:
351
+ id: "{{ID}}"
352
+ name: "{{NAME}}"
353
+ type: review
354
+ status: open
355
+ owner: "{{OWNER}}"
356
+ created: "{{TODAY}}"
357
+ updated: "{{TODAY}}"
358
+ parent: "{{PARENT_ID}}"
359
+ reviews: "{{PARENT_ID}}"
360
+ body_skeleton: |
361
+ # Review — {{NAME}}
362
+
363
+ ## Acceptance verification
364
+
365
+ ## Reviewer notes
366
+
367
+ ## Memory candidates
368
+
369
+ | Candidate | Type | Conflict check | Score | Accept? |
370
+ |---|---|---|---|---|
371
+
372
+ ## Decision: close or reopen
373
+ agent:
374
+ folder: agents/
375
+ id_format: "HS-AGENT-<4+ random alphanumeric>"
376
+ parent_kinds: []
377
+ required_fields: [id, name, type, status, owner, created, updated, role]
378
+ optional_fields:
379
+ [
380
+ description,
381
+ goal,
382
+ model,
383
+ allowed_tools,
384
+ disallowed_tools,
385
+ procedures,
386
+ handoffs,
387
+ guardrails,
388
+ lane,
389
+ isolation,
390
+ color,
391
+ owned_paths,
392
+ source_attribution,
393
+ related,
394
+ tags,
395
+ ]
396
+ schema_source: "specs/entity-model.md §agent"
397
+ frontmatter:
398
+ id: "{{ID}}"
399
+ name: "{{NAME}}"
400
+ type: agent
401
+ status: open
402
+ owner: "{{OWNER}}"
403
+ role: "{{NAME}}"
404
+ created: "{{TODAY}}"
405
+ updated: "{{TODAY}}"
406
+ owned_paths: []
407
+ tags:
408
+ - agent
409
+ body_skeleton: |
410
+ # {{NAME}}
411
+
412
+ > Persona / instructions for this agent identity. This body compiles to the system-prompt of `.claude/agents/<name>.md` and `.cursor/agents/<name>.md` ([[entity-model]] §agent). The vault spec is the SSOT; the generated host files are derived.
413
+
414
+ You are {{NAME}}. <describe the role, what it optimizes for, and how it works.>
415
+
416
+ ## Responsibilities
417
+
418
+ ## Workflow conventions
419
+
420
+ ## Guardrails
421
+ pillar:
422
+ folder: pillars/
423
+ id_format: "HS-PILR-<slug> (slug-only; owner-curated canonical pillars share id == basename)"
424
+ parent_kinds: []
425
+ required_fields: [id, name, type, status, owner, created, updated, canonical, secondary_pillars]
426
+ optional_fields: [library_tier, version, last_edited_at, related, tags]
427
+ schema_source: "specs/entity-model.md §pillar"
428
+ frontmatter:
429
+ id: "{{ID}}"
430
+ name: "{{NAME}}"
431
+ type: pillar
432
+ status: perpetual
433
+ owner: "{{OWNER}}"
434
+ created: "{{TODAY}}"
435
+ updated: "{{TODAY}}"
436
+ canonical: true
437
+ secondary_pillars: []
438
+ tags:
439
+ - pillar
440
+ body_skeleton: |
441
+ # {{NAME}}
442
+
443
+ > Perpetual structural theme — never closes. Epics name this pillar as their home for accumulated learning ([[entity-model]] §pillar).
444
+
445
+ ## What this pillar is
446
+
447
+ ## Why it's perpetual
448
+
449
+ ## Through-line across milestones
450
+ summary: |
451
+ Canonical copy-paste frontmatter templates for every vault entity kind (milestone, epic, task, review) with required fields, optional fields, and body skeletons; the source of truth for heyspex_file_spec and POST /api/specs.
452
+ ---
453
+
454
+ # Canonical frontmatter templates per entity kind
455
+
456
+ This protocol is the single source of truth for the frontmatter shape of every new spec. The executable data lives in the **frontmatter** `templates:` map above — one entry per kind, each carrying `folder`, `id_format`, `parent_kinds`, `required_fields`, `optional_fields`, a `schema_source` citation, a ready-to-stamp `frontmatter` template, and a `body_skeleton`. The procedure-catalog builder (`scripts/build-procedure-catalog.mjs`) parses protocol frontmatter, so the catalog picks the templates up with no builder change, and `heyspex_get_procedure({ name: 'canonical-frontmatter-templates' })` returns the whole file (frontmatter + this body) to a calling agent.
457
+
458
+ **Never compose frontmatter from a sibling example.** That is the exact anti-pattern this protocol exists to retire (user-memory `feedback_consult_procedures_dont_pattern_match`). Call `heyspex_file_spec` (or `POST /api/specs`); the server allocates the id and stamps the template. These templates are also the SSOT HS-OFUB-CVOB-EPIC-saas-customer-vault-onboarding scaffolds customer workspaces from.
459
+
460
+ ## Placeholders
461
+
462
+ The `frontmatter`/`body_skeleton` templates use these tokens, all server-substituted at filing time:
463
+
464
+ - `{{ID}}` — server-allocated id (`allocateRandomVaultId()` for task/epic/milestone, numeric increment for research, slug-derived for memory kinds, parent-suffix for review). **Never client-supplied.**
465
+ - `{{NAME}}` — the human-readable title.
466
+ - `{{OWNER}}` — canonical owner (`pwher`).
467
+ - `{{TODAY}}` — filing date / timestamp (`YYYY-MM-DD`).
468
+ - `{{PARENT_ID}}` — the parent's id, for the `milestone:`/`parent:` wikilink.
469
+ - `{{SLUG}}` — the title slug (memory `topic:` default).
470
+
471
+ ## Per-kind reference
472
+
473
+ The authoritative schema for every field below is **[[entity-model]] §Frontmatter schemas** — each entry's `schema_source` names the exact section + line range. The notes here cover the recovery path and parent-kind constraints; they do not restate the schema.
474
+
475
+ ### `milestone` — `specs/entity-model.md` §milestone (lines 497–519)
476
+
477
+ The top of the hierarchy: `parent_kinds: []` — a milestone has no parent (sub-milestones are out of scope; split horizontally). No scalar `kind`/`effort`/`priority` — milestone ordering is the deterministic scheduler's output, never a stored scalar. `epics:` is the mirror of each child epic's `milestone:` pointer (write both sides). Required body sections: rationale, acceptance gate, landing order, out-of-scope.
478
+
479
+ ### `epic` — `specs/entity-model.md` §epic (lines 455–494)
480
+
481
+ `parent_kinds: [milestone]` — an epic belongs to exactly one milestone via `milestone:` (the reverse of the milestone's `epics:` array). The `milestone:` requirement is in a **validator grace window until 2026-06-26**, after which a missing parent escalates from warning to error (HS-V5UA-T5PX-TASK-required-milestone-parent-on-epic-validator-and-grace-window). **`pillar:` is required and HARD-BLOCKED at filing** (owner decision 2026-06-18): every epic must name the perpetual Pillar that is its home for accumulated learning, and `POST /api/specs` / `heyspex_file_spec` refuse a `type: epic` with no resolvable `HS-PILR` theme (400 `pillar_required`, which lists existing pillars and how to author a net-new one). When no existing pillar fits, author one first via `heyspex_file_spec({ type: "pillar", name })`. Full rules: pillar-assignment-protocol. The ~226 legacy pillar-less epics are surfaced as a non-blocking Resolution backfill queue (`EPIC_MISSING_PILLAR`, grace until 2026-07-31). `research:` and `planning_flow:` are required for new epics by [[entity-model]] §epic but are filed during the milestone grace window per FRZE precedent — listed `optional_fields` here until the grace closes (HS-YXBD-1EM0-EPIC-canonical-spec-filing-surface-templates §Scope cuts). Shares the §task base schema; `type: epic` is the discriminator.
482
+
483
+ ### `task` — `specs/entity-model.md` §task (lines 392–453)
484
+
485
+ `parent_kinds: [epic, task]`. A **child task** is NOT a separate type — it is `type: task` whose `parent:` points at another task instead of an epic (same shape, different parent kind). `parent:` is optional at the schema level (the generic new-spec form and Epic Studio file parentless specs), but when present the server validates the parent kind and back-links the child into the parent's `children:` array at filing time (bidirectional linkage — see HS-3J4S-U13O-TASK-extend-post-api-specs-to-all-kinds-with).
486
+
487
+ ### `research` — `specs/entity-model.md` §research (lines 761–793)
488
+
489
+ **Evergreen** (research-is-evergreen): `status: open` is the resting state for the doc's whole life — there are no `in_review`/`closed` transitions; lineage is recorded through relational fields, never a status flip. Not hierarchical (`parent_kinds: []`): a research doc `enhances:` a single milestone (bidirectional with that milestone's `informed_by:`), it is not a child in a `children:` array. Numeric id (`HS-RES-<NNN>`), server-incremented. Required body sections: Executive Summary + Sources (research-capture-protocol).
490
+
491
+ ### `memory-lesson` — `specs/entity-model.md` §memory-lesson (lines 604–615)
492
+
493
+ `parent_kinds: []` — memory specs link via `related:` wikilinks, not hierarchy. Slug-derived id (`HS-LES-<slug>`). Required: `topic` + `observed`. Body sections: `## Problem`, `## Fix`. Full capture rules: [[memory-protocol]].
494
+
495
+ ### `memory-decision` — `specs/entity-model.md` §memory-decision (lines 617–629)
496
+
497
+ Slug id (`HS-DEC-<slug>`). Required: `topic` + `decided` + `deciders`. Body: `## Decision`, `## Rationale`. A `memory-decision` is the day-to-day choice that doesn't warrant a full ADR but should still persist.
498
+
499
+ ### `memory-reference` — `specs/entity-model.md` §memory-reference (lines 631–641)
500
+
501
+ Slug id (`HS-REF-<slug>`). Required: `topic`. Body is the brief context for why the reference matters; `url:` is optional.
502
+
503
+ ### `memory-ui-pattern` — `specs/entity-model.md` §memory-ui-pattern (lines 643–653)
504
+
505
+ Slug id (`HS-UIP-<slug>`). Required: `topic` + `documented`. Reusable console interaction/visual patterns. Body sections: `## Pattern`, `## When to apply`, `## Rules`, `## Implementation`. Distinct from `memory-ux-principle` (cross-brand rules).
506
+
507
+ ### `review` — `specs/entity-model.md` §review (lines 679–705)
508
+
509
+ `parent_kinds: [task, epic, milestone]`; `parent:` is **required** (a review with no subject is meaningless). The id is the bare `HS-REV-<parent-suffix>` — the suffix is segment `[2]` of the parent id (`HS-U13O-TASK` → `HS-U13O-REV`, `HS-0028-EPIC` → `HS-0028-REV`); the slug rides only in the filename. `reviews:` mirrors `parent:` (legacy alias for back-compat reads). A review has **no** `children:`/parent-array back-link — it cross-links to its subject via `parent:`/`reviews:` plus a `## Review` section the parent spec must carry. Four required body sections: `## Acceptance verification`, `## Reviewer notes`, `## Memory candidates` (scored table with a Conflict-check column), `## Decision: close or reopen`.
510
+
511
+ ### `pillar` — `specs/entity-model.md` §pillar
512
+
513
+ `parent_kinds: []` — a Pillar is a perpetual structural theme, not a child in any hierarchy; epics point UP at it via their required `pillar:` field. **`status: perpetual`** always (it never closes) and **`canonical:` is required** (`true` for owner-curated library pillars). Slug-only id (`HS-PILR-<slug>`, so id == basename and `[[HS-PILR-<slug>]]` resolves without a suffix). `secondary_pillars:` is always present (usually `[]`). Authoring a net-new pillar as a subject naturally arises during development is a **first-class, encouraged act** — file one with `heyspex_file_spec({ type: "pillar", name })` (or `POST /api/specs`), then point the epic's `pillar:` at it. The owner may also author a pillar standalone at any time. Full rules: pillar-assignment-protocol.
514
+
515
+ ## Out of scope
516
+
517
+ - **Captures (`type: capture`).** Session-based — driven by `heyspex_active_capture` / `heyspex_update_capture` with `content_buffer` patching, focus pinning, and multi-message accumulation, none of which a single template stamp can represent. `POST /api/specs` rejects `type: capture` with a 400 pointing at the capture flow (user-memory `feedback_capture_workflow_for_captures`).
518
+ - **L1 / ADR / planning-flow / branch-brief / business-\* kinds.** Filed through their own dedicated flows; their schemas live in [[entity-model]] but are not part of the universal filing surface this protocol backs. (Pillars are now part of this surface — see the `pillar` template above.)
519
+
520
+ ## Drift gate
521
+
522
+ Adding or removing a kind here changes the file, so `npm run build:procedure-catalog` must be re-run and the regenerated `specs/protocols/.catalog.json` committed; `npm run validate:procedure-catalog` is the CI drift gate. The inline `BODY_SKELETONS` in `spex-console/src/lib/vault.ts` (the server's create-time skeleton injection for `review`, the four memory kinds, `diagnose`, and `pillar`) must stay in lockstep with the `body_skeleton` entries above.
523
+
524
+ ## Change log
525
+
526
+ | Date | Author | Change |
527
+ | ---------- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
528
+ | 2026-06-13 | pwher (with Claude Opus 4.8) | Filed as the canonical, fetchable home for per-kind frontmatter templates. |
529
+ | 2026-06-21 | Claude Code · claude-sonnet-4-6 (with pwher) | Moved `summary` from `optional_fields` into `required_fields` and added `summary: ''` to the frontmatter stamp for milestone, epic, and task. Root cause: the stamp for these three kinds did not include a `summary:` placeholder, so agents and automated flows (e.g. promote-research) that stamp from the template produced specs with no summary field and no visible prompt to fill one in. Matching the spec-summary-authoring policy that summary is an authoring step of filing, not an optional afterthought. |
530
+ | 2026-06-23 | Cursor · session `local` | Added `agent` template with `owned_paths:`; `affects_paths` on epic/task optional_fields. Per HS-ZMAQ-M15C-TASK-declare-owned-path-globs-on-agent-identi. |
531
+ | 2026-06-25 | Claude Opus 4.8 [1m] · session `local` (with pwher) | Added the **intended-outcome cascade** section to the `body_skeleton` of research (`## Conclusion & intended outcome`), milestone, epic, and task (`## Intended outcome`). Each level **re-derives** the parent's outcome (translate, don't copy) and names its **mechanism of contribution** + an explicit ↑ link; the task-level outcome is expressed as monitorable+controllable conditions that seed `## Acceptance criteria`. Grounded in HS-K4D4-2I29-RES-outcome-cascade-through-a-requirements-h (GORE/KAOS HOW-down/WHY-up refinement + OKR translation-not-cascade). Companion edits: `research-capture-protocol`, `spec-hierarchy`, `plan-ingest-agent-workflow`, and the `promote-capture.mjs` / `promote-research.mjs` / task materializers. Owner-directed. Re-run `npm run build:procedure-catalog`. |
@@ -0,0 +1,48 @@
1
+ ---
2
+ id: HS-PROTO-memory-protocol
3
+ name: Memory Protocol
4
+ type: protocol
5
+ status: open
6
+ priority: 1
7
+ owner: pwher
8
+ created: "2026-05-14T22:47:28-05:00"
9
+ updated: "2026-05-18T19:49:25-05:00"
10
+ scope: vault
11
+ legacy_bd_key: memory-protocol
12
+ tags:
13
+ - bd-migrated
14
+ - memory
15
+ - lessons
16
+ - decisions
17
+ - references
18
+ triggers:
19
+ - memory_creation
20
+ - close_session
21
+ summary: |
22
+ Defines the four vault memory subsections (lessons, decisions, references, ui-patterns) and their folder layout. Authoritative rule on when to capture institutional knowledge and how to link it back to the specs it bears on.
23
+ related:
24
+ - "HS-T4P3-7VZH-RES-governing-an-unmanaged-891-file-memory"
25
+ ---
26
+
27
+ # Memory Protocol
28
+
29
+ HeySpex Memory layer (see memory-protocols-subsection-of-memory):
30
+
31
+ | Subsection | Entity type | Folder |
32
+ | ---------- | ------------------ | -------------------------- |
33
+ | Lessons | `memory-lesson` | `specs/memory/lessons/` |
34
+ | Decisions | `memory-decision` | `specs/memory/decisions/` |
35
+ | References | `memory-reference` | `specs/memory/references/` |
36
+ | Protocols | `protocol` | `specs/protocols/` |
37
+
38
+ Legacy bd v1 also used `goals/<scope>` — migrated to `memory-reference` where appropriate. Epics/tasks that _create_ protocols are not `type: protocol`.
39
+
40
+ Historical bd commands (`bd-lesson`, `bd-decision`, …) are retired; use vault files + `hs remember` / `hs prime` per HS-DOC-architecture-foundations.
41
+
42
+ ## Change log
43
+
44
+ | Date | Author | Change |
45
+ | ---------- | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
46
+ | 2026-05-14 | pwher (migrator) | Migrated from bd memory `memory-protocol`. |
47
+ | 2026-05-14 | pwher (with claude opus 4.7) | Backfilled true date (2026-05-10) for created from `.beads/issues.jsonl` git history; previously the migration-date placeholder. |
48
+ | 2026-05-18 | pwher (with claude) | Body updated for HeySpex four Memory subsections including protocols (memory-protocols-subsection-of-memory). |