heyspex 0.2.5 → 0.2.7

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 (110) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/bin/hs.mjs +349 -38
  3. package/bin/spexcode.mjs +31 -0
  4. package/dev-factory/lib/dispatch-guard.mjs +75 -0
  5. package/dev-factory/lib/local-firecrawl.mjs +294 -0
  6. package/dev-factory/lib/runner-path.mjs +51 -0
  7. package/dev-factory/lib/seat-context.mjs +20 -4
  8. package/dev-factory/model-catalog.json +222 -222
  9. package/dev-factory/spexcrawl/firecrawl-cli.mjs +755 -0
  10. package/dev-factory/spexcrawl/spexcrawl-cli.mjs +734 -0
  11. package/dist/cli/hs-connect.mjs +40 -3
  12. package/dist/cli/hs-defer.mjs +3817 -3741
  13. package/dist/cli/hs-events.mjs +1296 -0
  14. package/dist/cli/hs-export-events.mjs +1252 -0
  15. package/dist/cli/hs-handoff.mjs +2576 -0
  16. package/dist/cli/hs-index-rebuild.mjs +228 -37
  17. package/dist/cli/hs-index-reconcile.mjs +231 -40
  18. package/dist/cli/hs-init.mjs +22 -3
  19. package/dist/cli/hs-install.mjs +22 -3
  20. package/dist/cli/hs-join.mjs +40 -3
  21. package/dist/cli/hs-next-launch.mjs +2777 -0
  22. package/dist/cli/hs-pin.mjs +1336 -0
  23. package/dist/cli/hs-prereq.mjs +1380 -0
  24. package/dist/cli/hs-revalidate.mjs +3257 -0
  25. package/dist/cli/hs-spawn.mjs +12403 -0
  26. package/dist/cli/hs-test.mjs +1046 -0
  27. package/dist/cli/hs-trash.mjs +362 -0
  28. package/dist/cli/hs-trust.mjs +197 -0
  29. package/dist/cli/hs-vault-pull.mjs +233 -42
  30. package/dist/cli/hs-vault-push.mjs +231 -40
  31. package/dist/cli/hs-vault.mjs +21 -7
  32. package/dist/cli/hs-workspace.mjs +19 -1
  33. package/dist/cli-templates/customer-vault/specs/entity-model.md +1728 -1728
  34. package/dist/cli-templates/customer-vault/specs/protocols/canonical-frontmatter-templates.md +464 -464
  35. package/dist/cli-templates/customer-vault/specs/protocols/destructive-action-checklist.md +122 -122
  36. package/dist/cli-templates/customer-vault/specs/protocols/memory-protocol.md +46 -46
  37. package/dist/cli-templates/customer-vault/specs/protocols/spec-hierarchy.md +530 -530
  38. package/dist/cli-templates/customer-vault/specs/protocols/spec-summary-authoring.md +83 -83
  39. package/dist/cli-templates/harness-commands/claude/hs-backfill.md +28 -28
  40. package/dist/cli-templates/harness-commands/claude/hs-capture.md +62 -62
  41. package/dist/cli-templates/harness-commands/claude/hs-defer.md +29 -29
  42. package/dist/cli-templates/harness-commands/claude/hs-ground.md +30 -30
  43. package/dist/cli-templates/harness-commands/claude/hs-next.md +29 -29
  44. package/dist/cli-templates/harness-commands/claude/hs-promote.md +70 -70
  45. package/dist/cli-templates/harness-commands/claude/hs-push.md +35 -35
  46. package/dist/cli-templates/harness-commands/claude/hs-qc.md +27 -27
  47. package/dist/cli-templates/harness-commands/claude/hs-res.md +83 -63
  48. package/dist/cli-templates/harness-commands/claude/hs-resolve.md +23 -23
  49. package/dist/cli-templates/harness-commands/claude/hs-view.md +28 -28
  50. package/dist/cli-templates/harness-commands/claude/kill-ports.md +32 -32
  51. package/dist/cli-templates/harness-commands/claude/prototype.md +91 -91
  52. package/dist/cli-templates/harness-commands/cursor/hs-backfill.md +22 -22
  53. package/dist/cli-templates/harness-commands/cursor/hs-capture.md +56 -56
  54. package/dist/cli-templates/harness-commands/cursor/hs-defer.md +23 -23
  55. package/dist/cli-templates/harness-commands/cursor/hs-ground.md +24 -24
  56. package/dist/cli-templates/harness-commands/cursor/hs-next.md +23 -23
  57. package/dist/cli-templates/harness-commands/cursor/hs-promote.md +64 -64
  58. package/dist/cli-templates/harness-commands/cursor/hs-push.md +29 -29
  59. package/dist/cli-templates/harness-commands/cursor/hs-qc.md +21 -21
  60. package/dist/cli-templates/harness-commands/cursor/hs-res.md +78 -58
  61. package/dist/cli-templates/harness-commands/cursor/hs-resolve.md +17 -17
  62. package/dist/cli-templates/harness-commands/cursor/hs-view.md +23 -23
  63. package/dist/cli-templates/harness-commands/cursor/kill-ports.md +26 -26
  64. package/dist/cli-templates/harness-commands/cursor/prototype.md +86 -86
  65. package/docs/copilot-plugin-install.md +9 -2
  66. package/docs/mcp-client-config.md +6 -0
  67. package/package.json +266 -257
  68. package/plugins/heyspex/.claude-plugin/plugin.json +1 -1
  69. package/plugins/heyspex/.cursor-plugin/plugin.json +1 -1
  70. package/plugins/heyspex/README.md +6 -0
  71. package/plugins/heyspex/bin/launch-mcp.mjs +17 -0
  72. package/plugins/heyspex/hooks/hooks.json +418 -418
  73. package/scripts/claude-hooks/_intent-classifier-semantic.mjs +2 -2
  74. package/scripts/claude-hooks/wip-checkpoint.mjs +17 -2
  75. package/scripts/claude-statusline/statusline-command.mjs +287 -27
  76. package/scripts/hs-companion.mjs +41 -3
  77. package/scripts/install-claude-code-hooks.mjs +104 -3
  78. package/scripts/install-copilot-hooks.mjs +21 -1
  79. package/scripts/install-cursor-hooks.mjs +4 -3
  80. package/scripts/lib/capture-execution-guard.mjs +221 -0
  81. package/scripts/lib/companion-install.mjs +768 -0
  82. package/scripts/lib/customer-kit.mjs +53 -3
  83. package/scripts/lib/hs-companion-settings.mjs +26 -0
  84. package/scripts/lib/hs-source-push.mjs +386 -386
  85. package/scripts/record-grounding.mjs +38 -0
  86. package/spexharness/doctrine/baseline/SPEXCODE-DOCTRINE.baseline.json +29 -29
  87. package/spexharness/src/adapters/copilot-models.mjs +179 -0
  88. package/spexharness/src/adapters/harness-detect.mjs +148 -0
  89. package/spexharness/src/gates/directive-obligation-gate.decide.mjs +132 -132
  90. package/spexharness/src/gates/vault-write-tier-guard.decide.mjs +153 -125
  91. package/spexharness/src/seat-context.mjs +10 -5
  92. package/spexharness/src/session-bootstrap.mjs +6 -3
  93. package/vendor/heyspex-mcp/cli.mjs +6 -1
  94. package/vendor/heyspex-mcp/config-seed.yaml +15 -15
  95. package/vendor/heyspex-mcp/dev-factory-overlay.mjs +142 -0
  96. package/vendor/heyspex-mcp/http-transport.mjs +1 -1
  97. package/vendor/heyspex-mcp/memory-tools.mjs +523 -523
  98. package/vendor/heyspex-mcp/on-deck-scheduler.mjs +1708 -1708
  99. package/vendor/heyspex-mcp/procedure-handlers.mjs +327 -327
  100. package/vendor/heyspex-mcp/procedure-tools.mjs +1209 -1181
  101. package/vendor/heyspex-mcp/research-tools.mjs +22 -2
  102. package/vendor/heyspex-mcp/seat-assign-cli.mjs +242 -0
  103. package/vendor/heyspex-mcp/seat-assignment-rules.mjs +96 -0
  104. package/vendor/heyspex-mcp/seat-assignments-client.mjs +265 -0
  105. package/vendor/heyspex-mcp/seat-defaults-cli.mjs +45 -0
  106. package/vendor/heyspex-mcp/seat-defaults.mjs +232 -0
  107. package/vendor/heyspex-mcp/seat-identity.mjs +171 -0
  108. package/vendor/heyspex-mcp/test-helpers.mjs +37 -23
  109. package/vendor/heyspex-mcp/vault-io.mjs +720 -720
  110. package/bin/postinstall.mjs +0 -88
@@ -1,122 +1,122 @@
1
- ---
2
- id: HS-PROTO-destructive-action-checklist
3
- name: Destructive Action Checklist (UI + API gate)
4
- type: protocol
5
- scope: agent-workflow
6
- version: 1.0
7
- status: open
8
- priority: 0
9
- owner: TODO — your name/handle
10
- created: 2026-05-22
11
- updated: 2026-08-25
12
- tags:
13
- - "protocol"
14
- - "ui"
15
- - "ux"
16
- - "data-loss"
17
- - "destructive"
18
- - "console"
19
- triggers:
20
- - destructive_action
21
- summary: |
22
- Walk before merging any code that can destroy user data: explicit danger-styled button, soft-delete to .trash/ instead of permanent deletion, and a real Undo notification with a time-limited commit. Close is not the same as destroy.
23
-
24
- ---
25
-
26
- # Destructive Action Checklist
27
-
28
- **Scope note:** this checklist covers screen actions — UI + API surfaces that can destroy
29
- user data (delete spec, archive, discard buffer). Git tree actions on a shared checkout
30
- (stash, `reset --hard`, `clean -f`, `checkout .`, `restore`, `rebase`, `push --force`,
31
- `branch -D`, `commit --amend`) are gated in protected-shared-actions-gate — don't
32
- duplicate that ground here.
33
-
34
- **Run this before merging any PR that adds, changes, or routes an action
35
- that can destroy user data** (delete spec, archive, unpin, discard buffer,
36
- hard-revert, etc.). Pinning, hiding, or marking "closed" are non-destructive
37
- and do not require this checklist.
38
-
39
- Acceptance: every box ticked, or an inline `dismissed because <reason>`
40
- note for any box that genuinely does not apply.
41
-
42
- ## Why this exists
43
-
44
- A past idea-discard data-loss incident showed that strong UX *principles*
45
- (recoverable destructive actions, reversible user actions) are not
46
- enough — they only prevent data loss if recalled and applied during
47
- implementation. This protocol turns the principles into an enforceable
48
- checklist that lives in the PR template / `npm run validate:*` and that
49
- agents must walk before claiming a destructive-action task done.
50
-
51
- ## Memory recall (before writing code)
52
-
53
- - [ ] `heyspex_recall_memories({ tags: ["destructive"] })`
54
- - [ ] `heyspex_recall_memories({ tags: ["ux", "ux-principle"] })`
55
- - [ ] Read any vault memories on destructive-action recovery and Undo.
56
-
57
- ## UI affordances
58
-
59
- - [ ] **Explicit Discard / Delete / Archive button** — labeled with the
60
- action verb, styled with `var(--danger)`, positioned away from the
61
- primary CTA.
62
- - [ ] **Close ≠ Destroy.** Backdrop click, Esc, header X, "Close", and
63
- "Cancel" all just dismiss the surface. None of them route into a
64
- confirmation flow whose primary button is destructive.
65
- - [ ] **Confirm dialog has a safe default.** The cancel/keep-editing button
66
- is default-focused, visually primary, and is not the same control
67
- that would also destroy on a second press.
68
- - [ ] **Confirm copy says what happens and where it goes.** Mentions the
69
- trash location and the Undo affordance ("recoverable from the Undo
70
- toast that follows").
71
- - [ ] **Unsaved-changes warning** when closing a dirty editor — separate
72
- flow from discard. (Not covered here.)
73
-
74
- ## API + filesystem
75
-
76
- - [ ] **Soft-delete only.** Server moves bytes to
77
- `<folder>/.trash/<iso-stamp>-<basename>.<ext>` via `fs.rename`.
78
- No `fs.unlink`, `fs.rm`, or equivalent on user data from a request
79
- handler.
80
- - [ ] **DELETE response includes restore info** — `{ trashPath,
81
- originalRelPath }` (or analogous fields) so the UI can wire Undo.
82
- - [ ] **Restore endpoint exists** — POST/PUT that validates both paths
83
- resolve inside the vault root, refuses to overwrite an existing
84
- file, and `fs.rename`s back.
85
- - [ ] **Index ignores trash.** Confirm `walkMarkdown` (or equivalent
86
- indexer) skips `.trash/` so trashed files don't reappear as ghosts.
87
-
88
- ## Undo path
89
-
90
- - [ ] **Undo toast** with a labeled action button (not just a "Deleted"
91
- confirmation), held ≥ 8 seconds.
92
- - [ ] **Undo actually calls restore endpoint** — wired end-to-end, tested
93
- manually at least once.
94
- - [ ] **Restore dispatches the same `heyspex:spec-updated` event** that
95
- external watchers listen for, so list views refresh.
96
-
97
- ## Tests / verification
98
-
99
- - [ ] Manual: open the surface, perform the destructive action, click
100
- Undo in the toast, confirm the file is back at its original path.
101
- - [ ] Manual: open the surface, click backdrop / Esc / Close / Cancel —
102
- confirm none of these prompt for or perform deletion.
103
- - [ ] Optional unit test if the project has them: assert `deleteSpec`
104
- moves to `.trash/` and `restoreSpecFromTrash` round-trips.
105
-
106
- ## After merge
107
-
108
- - [ ] Capture any new gotchas as a `memory-lesson` linked to this
109
- protocol.
110
- - [ ] If a *new* destructive surface is introduced, record it in a vault memory.
111
-
112
- ## How this gate gets enforced
113
-
114
- Today: agents must
115
- walk it before marking the spec `in_review`. The reviewer ticks each box
116
- in the spec's `.review.md`.
117
-
118
- Future automation candidates:
119
-
120
- - ESLint rule banning `fs.unlink`/`fs.rm` in `src/app/api/**`.
121
- - PR template line: "Destructive action? Walk
122
- [[destructive-action-checklist]] before requesting review."
1
+ ---
2
+ id: HS-PROTO-destructive-action-checklist
3
+ name: Destructive Action Checklist (UI + API gate)
4
+ type: protocol
5
+ scope: agent-workflow
6
+ version: 1.0
7
+ status: open
8
+ priority: 0
9
+ owner: TODO — your name/handle
10
+ created: 2026-05-22
11
+ updated: 2026-08-25
12
+ tags:
13
+ - "protocol"
14
+ - "ui"
15
+ - "ux"
16
+ - "data-loss"
17
+ - "destructive"
18
+ - "console"
19
+ triggers:
20
+ - destructive_action
21
+ summary: |
22
+ Walk before merging any code that can destroy user data: explicit danger-styled button, soft-delete to .trash/ instead of permanent deletion, and a real Undo notification with a time-limited commit. Close is not the same as destroy.
23
+
24
+ ---
25
+
26
+ # Destructive Action Checklist
27
+
28
+ **Scope note:** this checklist covers screen actions — UI + API surfaces that can destroy
29
+ user data (delete spec, archive, discard buffer). Git tree actions on a shared checkout
30
+ (stash, `reset --hard`, `clean -f`, `checkout .`, `restore`, `rebase`, `push --force`,
31
+ `branch -D`, `commit --amend`) are gated in protected-shared-actions-gate — don't
32
+ duplicate that ground here.
33
+
34
+ **Run this before merging any PR that adds, changes, or routes an action
35
+ that can destroy user data** (delete spec, archive, unpin, discard buffer,
36
+ hard-revert, etc.). Pinning, hiding, or marking "closed" are non-destructive
37
+ and do not require this checklist.
38
+
39
+ Acceptance: every box ticked, or an inline `dismissed because <reason>`
40
+ note for any box that genuinely does not apply.
41
+
42
+ ## Why this exists
43
+
44
+ A past idea-discard data-loss incident showed that strong UX *principles*
45
+ (recoverable destructive actions, reversible user actions) are not
46
+ enough — they only prevent data loss if recalled and applied during
47
+ implementation. This protocol turns the principles into an enforceable
48
+ checklist that lives in the PR template / `npm run validate:*` and that
49
+ agents must walk before claiming a destructive-action task done.
50
+
51
+ ## Memory recall (before writing code)
52
+
53
+ - [ ] `heyspex_recall_memories({ tags: ["destructive"] })`
54
+ - [ ] `heyspex_recall_memories({ tags: ["ux", "ux-principle"] })`
55
+ - [ ] Read any vault memories on destructive-action recovery and Undo.
56
+
57
+ ## UI affordances
58
+
59
+ - [ ] **Explicit Discard / Delete / Archive button** — labeled with the
60
+ action verb, styled with `var(--danger)`, positioned away from the
61
+ primary CTA.
62
+ - [ ] **Close ≠ Destroy.** Backdrop click, Esc, header X, "Close", and
63
+ "Cancel" all just dismiss the surface. None of them route into a
64
+ confirmation flow whose primary button is destructive.
65
+ - [ ] **Confirm dialog has a safe default.** The cancel/keep-editing button
66
+ is default-focused, visually primary, and is not the same control
67
+ that would also destroy on a second press.
68
+ - [ ] **Confirm copy says what happens and where it goes.** Mentions the
69
+ trash location and the Undo affordance ("recoverable from the Undo
70
+ toast that follows").
71
+ - [ ] **Unsaved-changes warning** when closing a dirty editor — separate
72
+ flow from discard. (Not covered here.)
73
+
74
+ ## API + filesystem
75
+
76
+ - [ ] **Soft-delete only.** Server moves bytes to
77
+ `<folder>/.trash/<iso-stamp>-<basename>.<ext>` via `fs.rename`.
78
+ No `fs.unlink`, `fs.rm`, or equivalent on user data from a request
79
+ handler.
80
+ - [ ] **DELETE response includes restore info** — `{ trashPath,
81
+ originalRelPath }` (or analogous fields) so the UI can wire Undo.
82
+ - [ ] **Restore endpoint exists** — POST/PUT that validates both paths
83
+ resolve inside the vault root, refuses to overwrite an existing
84
+ file, and `fs.rename`s back.
85
+ - [ ] **Index ignores trash.** Confirm `walkMarkdown` (or equivalent
86
+ indexer) skips `.trash/` so trashed files don't reappear as ghosts.
87
+
88
+ ## Undo path
89
+
90
+ - [ ] **Undo toast** with a labeled action button (not just a "Deleted"
91
+ confirmation), held ≥ 8 seconds.
92
+ - [ ] **Undo actually calls restore endpoint** — wired end-to-end, tested
93
+ manually at least once.
94
+ - [ ] **Restore dispatches the same `heyspex:spec-updated` event** that
95
+ external watchers listen for, so list views refresh.
96
+
97
+ ## Tests / verification
98
+
99
+ - [ ] Manual: open the surface, perform the destructive action, click
100
+ Undo in the toast, confirm the file is back at its original path.
101
+ - [ ] Manual: open the surface, click backdrop / Esc / Close / Cancel —
102
+ confirm none of these prompt for or perform deletion.
103
+ - [ ] Optional unit test if the project has them: assert `deleteSpec`
104
+ moves to `.trash/` and `restoreSpecFromTrash` round-trips.
105
+
106
+ ## After merge
107
+
108
+ - [ ] Capture any new gotchas as a `memory-lesson` linked to this
109
+ protocol.
110
+ - [ ] If a *new* destructive surface is introduced, record it in a vault memory.
111
+
112
+ ## How this gate gets enforced
113
+
114
+ Today: agents must
115
+ walk it before marking the spec `in_review`. The reviewer ticks each box
116
+ in the spec's `.review.md`.
117
+
118
+ Future automation candidates:
119
+
120
+ - ESLint rule banning `fs.unlink`/`fs.rm` in `src/app/api/**`.
121
+ - PR template line: "Destructive action? Walk
122
+ [[destructive-action-checklist]] before requesting review."
@@ -1,46 +1,46 @@
1
- ---
2
- id: HS-PROTO-memory-protocol
3
- name: Memory Protocol
4
- type: protocol
5
- status: open
6
- priority: 1
7
- owner: TODO — your name/handle
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
- ---
24
-
25
- # Memory Protocol
26
-
27
- HeySpex Memory layer (see memory-protocols-subsection-of-memory):
28
-
29
- | Subsection | Entity type | Folder |
30
- | --- | --- | --- |
31
- | Lessons | `memory-lesson` | `specs/memory/lessons/` |
32
- | Decisions | `memory-decision` | `specs/memory/decisions/` |
33
- | References | `memory-reference` | `specs/memory/references/` |
34
- | Protocols | `protocol` | `specs/protocols/` |
35
-
36
- Legacy bd v1 also used `goals/<scope>` — migrated to `memory-reference` where appropriate. Epics/tasks that *create* protocols are not `type: protocol`.
37
-
38
- Historical bd commands (`bd-lesson`, `bd-decision`, …) are retired; use vault files + `hs remember` / `hs prime` per HS-DOC-architecture-foundations.
39
-
40
- ## Change log
41
-
42
- | Date | Author | Change |
43
- | --- | --- | --- |
44
- | 2026-05-14 | pwher (migrator) | Migrated from bd memory `memory-protocol`. |
45
- | 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. |
46
- | 2026-05-18 | pwher (with claude) | Body updated for HeySpex four Memory subsections including protocols (memory-protocols-subsection-of-memory). |
1
+ ---
2
+ id: HS-PROTO-memory-protocol
3
+ name: Memory Protocol
4
+ type: protocol
5
+ status: open
6
+ priority: 1
7
+ owner: TODO — your name/handle
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
+ ---
24
+
25
+ # Memory Protocol
26
+
27
+ HeySpex Memory layer (see memory-protocols-subsection-of-memory):
28
+
29
+ | Subsection | Entity type | Folder |
30
+ | --- | --- | --- |
31
+ | Lessons | `memory-lesson` | `specs/memory/lessons/` |
32
+ | Decisions | `memory-decision` | `specs/memory/decisions/` |
33
+ | References | `memory-reference` | `specs/memory/references/` |
34
+ | Protocols | `protocol` | `specs/protocols/` |
35
+
36
+ Legacy bd v1 also used `goals/<scope>` — migrated to `memory-reference` where appropriate. Epics/tasks that *create* protocols are not `type: protocol`.
37
+
38
+ Historical bd commands (`bd-lesson`, `bd-decision`, …) are retired; use vault files + `hs remember` / `hs prime` per HS-DOC-architecture-foundations.
39
+
40
+ ## Change log
41
+
42
+ | Date | Author | Change |
43
+ | --- | --- | --- |
44
+ | 2026-05-14 | pwher (migrator) | Migrated from bd memory `memory-protocol`. |
45
+ | 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. |
46
+ | 2026-05-18 | pwher (with claude) | Body updated for HeySpex four Memory subsections including protocols (memory-protocols-subsection-of-memory). |