pi-ui-extend 1.0.42 → 1.0.45

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 (233) hide show
  1. package/README.md +41 -12
  2. package/dist/app/app.d.ts +10 -0
  3. package/dist/app/app.js +132 -8
  4. package/dist/app/cli/install.js +2 -2
  5. package/dist/app/commands/command-controller.d.ts +4 -0
  6. package/dist/app/commands/command-controller.js +11 -0
  7. package/dist/app/commands/command-git-actions.d.ts +25 -0
  8. package/dist/app/commands/command-git-actions.js +381 -0
  9. package/dist/app/commands/command-host.d.ts +3 -0
  10. package/dist/app/commands/command-host.js +5 -2
  11. package/dist/app/commands/command-model-actions.d.ts +1 -0
  12. package/dist/app/commands/command-model-actions.js +51 -34
  13. package/dist/app/commands/command-navigation-actions.d.ts +1 -0
  14. package/dist/app/commands/command-navigation-actions.js +16 -3
  15. package/dist/app/commands/command-registry.d.ts +2 -0
  16. package/dist/app/commands/command-registry.js +14 -0
  17. package/dist/app/commands/reload-context-inventory.js +12 -1
  18. package/dist/app/input/autocomplete-controller.js +61 -34
  19. package/dist/app/input/input-action-controller.d.ts +2 -0
  20. package/dist/app/input/input-action-controller.js +8 -1
  21. package/dist/app/input/input-controller.d.ts +2 -1
  22. package/dist/app/input/input-controller.js +7 -2
  23. package/dist/app/input/prompt-enhancer-controller.js +53 -35
  24. package/dist/app/input/voice-controller.d.ts +41 -45
  25. package/dist/app/input/voice-controller.js +351 -419
  26. package/dist/app/model/model-usage-controller.js +17 -7
  27. package/dist/app/model/model-usage-status.d.ts +4 -1
  28. package/dist/app/model/model-usage-status.js +270 -46
  29. package/dist/app/popup/menu-items-controller.d.ts +13 -3
  30. package/dist/app/popup/menu-items-controller.js +37 -21
  31. package/dist/app/popup/popup-action-controller.d.ts +12 -2
  32. package/dist/app/popup/popup-action-controller.js +77 -24
  33. package/dist/app/popup/popup-menu-controller.d.ts +36 -14
  34. package/dist/app/popup/popup-menu-controller.js +239 -69
  35. package/dist/app/rendering/dcp-stats.d.ts +9 -4
  36. package/dist/app/rendering/dcp-stats.js +40 -425
  37. package/dist/app/rendering/popup-menu-renderer.d.ts +3 -5
  38. package/dist/app/rendering/popup-menu-renderer.js +42 -37
  39. package/dist/app/rendering/render-controller.js +23 -2
  40. package/dist/app/rendering/status-line-renderer.d.ts +5 -0
  41. package/dist/app/rendering/status-line-renderer.js +41 -5
  42. package/dist/app/rendering/tab-line-renderer.js +26 -20
  43. package/dist/app/runtime.d.ts +12 -1
  44. package/dist/app/runtime.js +120 -12
  45. package/dist/app/screen/mouse-controller.d.ts +2 -0
  46. package/dist/app/screen/mouse-controller.js +17 -7
  47. package/dist/app/screen/status-controller.d.ts +4 -0
  48. package/dist/app/screen/status-controller.js +5 -0
  49. package/dist/app/session/lazy-session-manager.js +34 -0
  50. package/dist/app/session/session-event-controller.d.ts +1 -0
  51. package/dist/app/session/session-event-controller.js +10 -1
  52. package/dist/app/session/session-history.d.ts +1 -0
  53. package/dist/app/session/session-history.js +12 -1
  54. package/dist/app/session/session-lifecycle-controller.d.ts +6 -1
  55. package/dist/app/session/session-lifecycle-controller.js +10 -1
  56. package/dist/app/session/tabs-controller.d.ts +25 -1
  57. package/dist/app/session/tabs-controller.js +442 -153
  58. package/dist/app/subagents/subagents-widget-controller.d.ts +1 -0
  59. package/dist/app/subagents/subagents-widget-controller.js +6 -0
  60. package/dist/app/types.d.ts +11 -1
  61. package/dist/app/workspace/workspace-actions-controller.js +10 -2
  62. package/dist/app/workspace/workspace-undo.d.ts +1 -0
  63. package/dist/app/workspace/workspace-undo.js +1 -0
  64. package/dist/bundled-extensions/question/index.js +9 -1
  65. package/dist/bundled-extensions/question/remote.d.ts +4 -0
  66. package/dist/bundled-extensions/question/remote.js +33 -0
  67. package/dist/bundled-extensions/telegram-connector/bot.d.ts +43 -0
  68. package/dist/bundled-extensions/telegram-connector/bot.js +166 -0
  69. package/dist/bundled-extensions/telegram-connector/config.d.ts +8 -0
  70. package/dist/bundled-extensions/telegram-connector/config.js +87 -0
  71. package/dist/bundled-extensions/telegram-connector/coordinator.d.ts +66 -0
  72. package/dist/bundled-extensions/telegram-connector/coordinator.js +413 -0
  73. package/dist/bundled-extensions/telegram-connector/index.d.ts +3 -0
  74. package/dist/bundled-extensions/telegram-connector/index.js +195 -0
  75. package/dist/bundled-extensions/terminal-bell/index.d.ts +0 -8
  76. package/dist/bundled-extensions/terminal-bell/index.js +0 -76
  77. package/dist/bundled-extensions/workspace-undo/index.d.ts +26 -0
  78. package/dist/bundled-extensions/workspace-undo/index.js +191 -0
  79. package/dist/config.d.ts +21 -2
  80. package/dist/config.js +159 -32
  81. package/dist/default-pix-config.js +20 -10
  82. package/dist/schemas/pi-tools-suite-schema.d.ts +8 -4
  83. package/dist/schemas/pi-tools-suite-schema.js +11 -5
  84. package/dist/schemas/pix-schema.d.ts +12 -2
  85. package/dist/schemas/pix-schema.js +37 -9
  86. package/dist/schemas/tasks-schema.js +1 -1
  87. package/docs/concurrency.md +3 -1
  88. package/docs/desktop-mvp.md +10 -5
  89. package/docs/desktop-task-manager.md +81 -28
  90. package/docs/release.md +30 -6
  91. package/external/pi-tools-suite/README.md +165 -39
  92. package/external/pi-tools-suite/docs/session-recovery.md +7 -0
  93. package/external/pi-tools-suite/docs/subagent-model-pools.md +12 -5
  94. package/external/pi-tools-suite/docs/ui-qa-subagent.md +440 -0
  95. package/external/pi-tools-suite/package.json +6 -1
  96. package/external/pi-tools-suite/src/antigravity-auth/auth-store.ts +2 -1
  97. package/external/pi-tools-suite/src/antigravity-auth/constants.ts +9 -3
  98. package/external/pi-tools-suite/src/antigravity-auth/headers.ts +41 -3
  99. package/external/pi-tools-suite/src/antigravity-auth/models.ts +94 -21
  100. package/external/pi-tools-suite/src/antigravity-auth/oauth.ts +5 -17
  101. package/external/pi-tools-suite/src/antigravity-auth/payload.ts +72 -7
  102. package/external/pi-tools-suite/src/antigravity-auth/stream.ts +13 -1
  103. package/external/pi-tools-suite/src/async-subagents/agents/implement.md +1 -1
  104. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/backends/browser.mjs +346 -0
  105. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/backends/desktop.mjs +1038 -0
  106. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/backends/tui.mjs +759 -0
  107. package/external/pi-tools-suite/src/async-subagents/agents/{browser-qa → ui-qa/browser}/scripts/browser-qa-runner.mjs +32 -23
  108. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/drivers/chrome-devtools/chrome-devtools-provider.mjs +895 -0
  109. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/drivers/linux/linux-atspi.py +494 -0
  110. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/drivers/macos/macos-accessibility.swift +1085 -0
  111. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/drivers/native-terminal/bridge-client.mjs +50 -0
  112. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/drivers/native-terminal/native-terminal-host.mjs +501 -0
  113. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/drivers/windows/windows-uia.ps1 +454 -0
  114. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/browser-auth.md +114 -0
  115. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/browser-chrome-devtools.md +91 -0
  116. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/browser-playwright.md +145 -0
  117. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/browser.md +82 -0
  118. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/desktop-linux.md +26 -0
  119. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/desktop-macos.md +29 -0
  120. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/desktop-windows.md +23 -0
  121. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/desktop.md +54 -0
  122. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/tui-native-terminal.md +59 -0
  123. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/tui-pty.md +37 -0
  124. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/tui.md +60 -0
  125. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/scripts/ui-qa-runner.mjs +535 -0
  126. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa.md +75 -0
  127. package/external/pi-tools-suite/src/async-subagents/commands.ts +1 -1
  128. package/external/pi-tools-suite/src/async-subagents/core/agent-strategy.ts +1 -1
  129. package/external/pi-tools-suite/src/async-subagents/core/agents-dir.ts +0 -2
  130. package/external/pi-tools-suite/src/async-subagents/core/browser-qa.ts +16 -2
  131. package/external/pi-tools-suite/src/async-subagents/core/config.ts +40 -17
  132. package/external/pi-tools-suite/src/async-subagents/core/model-selection.ts +2 -1
  133. package/external/pi-tools-suite/src/async-subagents/core/registry.ts +158 -33
  134. package/external/pi-tools-suite/src/async-subagents/core/routing.ts +7 -4
  135. package/external/pi-tools-suite/src/async-subagents/core/spawn.ts +34 -24
  136. package/external/pi-tools-suite/src/async-subagents/core/ultrawork-auto.ts +51 -45
  137. package/external/pi-tools-suite/src/async-subagents/lib.ts +9 -1
  138. package/external/pi-tools-suite/src/async-subagents/tools/spawn.ts +0 -1
  139. package/external/pi-tools-suite/src/async-subagents/tools/subagents.ts +2 -2
  140. package/external/pi-tools-suite/src/coding-discipline/index.ts +90 -59
  141. package/external/pi-tools-suite/src/config.ts +14 -0
  142. package/external/pi-tools-suite/src/context-gateway/accounting-log.ts +282 -0
  143. package/external/pi-tools-suite/src/context-gateway/config.ts +66 -1
  144. package/external/pi-tools-suite/src/context-gateway/efficiency.ts +414 -0
  145. package/external/pi-tools-suite/src/context-gateway/enforcement.ts +123 -3
  146. package/external/pi-tools-suite/src/context-gateway/index.ts +137 -4
  147. package/external/pi-tools-suite/src/context-gateway/storeless-capabilities.ts +5 -5
  148. package/external/pi-tools-suite/src/context-gateway/telemetry.ts +2 -2
  149. package/external/pi-tools-suite/src/context-gateway/types.ts +8 -1
  150. package/external/pi-tools-suite/src/dcp/auto-compress-budget.ts +39 -4
  151. package/external/pi-tools-suite/src/dcp/auto-compress.ts +41 -14
  152. package/external/pi-tools-suite/src/dcp/commands.ts +14 -156
  153. package/external/pi-tools-suite/src/dcp/compress-tool.ts +8 -2
  154. package/external/pi-tools-suite/src/dcp/compression-progress.ts +22 -0
  155. package/external/pi-tools-suite/src/dcp/config.ts +58 -4
  156. package/external/pi-tools-suite/src/dcp/conversation-index.ts +36 -9
  157. package/external/pi-tools-suite/src/dcp/diagnostics.ts +41 -0
  158. package/external/pi-tools-suite/src/dcp/fresh-tool-results.ts +38 -0
  159. package/external/pi-tools-suite/src/dcp/index.ts +338 -66
  160. package/external/pi-tools-suite/src/dcp/journal.ts +126 -4
  161. package/external/pi-tools-suite/src/dcp/progress-controller.ts +2 -1
  162. package/external/pi-tools-suite/src/dcp/pruner-candidates.ts +92 -2
  163. package/external/pi-tools-suite/src/dcp/pruner-nudge.ts +36 -33
  164. package/external/pi-tools-suite/src/dcp/pruner.ts +1 -0
  165. package/external/pi-tools-suite/src/dcp/routine-pressure.ts +86 -0
  166. package/external/pi-tools-suite/src/dcp/state.ts +9 -0
  167. package/external/pi-tools-suite/src/dcp/statistics.d.ts +8 -0
  168. package/external/pi-tools-suite/src/dcp/statistics.js +156 -0
  169. package/external/pi-tools-suite/src/default-pi-tools-suite-config.ts +68 -16
  170. package/external/pi-tools-suite/src/lib/project.ts +36 -1
  171. package/external/pi-tools-suite/src/model-tools/index.ts +10 -7
  172. package/external/pi-tools-suite/src/repo-discovery/index.ts +304 -4
  173. package/external/pi-tools-suite/src/resource-registry/index.ts +282 -21
  174. package/external/pi-tools-suite/src/session-recovery/index.ts +17 -0
  175. package/external/pi-tools-suite/src/todo/index.ts +21 -0
  176. package/external/pi-tools-suite/src/todo/todo.ts +19 -1
  177. package/external/pi-tools-suite/src/tool-descriptions.ts +44 -15
  178. package/package.json +7 -8
  179. package/schemas/pi-tools-suite.json +44 -12
  180. package/schemas/pix.json +109 -15
  181. package/schemas/tasks.json +1 -2
  182. package/skills/simplify/SKILL.md +33 -5
  183. package/external/pi-tools-suite/docs/browser-qa-subagent.md +0 -196
  184. package/external/pi-tools-suite/src/async-subagents/agents/browser-qa.md +0 -598
  185. package/skills/playwright-cli/SKILL.md +0 -420
  186. package/skills/playwright-cli/references/element-attributes.md +0 -23
  187. package/skills/playwright-cli/references/playwright-tests.md +0 -50
  188. package/skills/playwright-cli/references/request-mocking.md +0 -87
  189. package/skills/playwright-cli/references/running-code.md +0 -241
  190. package/skills/playwright-cli/references/session-management.md +0 -273
  191. package/skills/playwright-cli/references/spec-driven-testing.md +0 -311
  192. package/skills/playwright-cli/references/storage-state.md +0 -290
  193. package/skills/playwright-cli/references/test-generation.md +0 -142
  194. package/skills/playwright-cli/references/tracing.md +0 -154
  195. package/skills/playwright-cli/references/video-recording.md +0 -147
  196. package/skills/spec-wiki/SKILL.md +0 -55
  197. package/skills/spec-wiki/evals/evals.json +0 -132
  198. package/skills/spec-wiki/evals/files/bootstrap/architecture/rfc-007.md +0 -14
  199. package/skills/spec-wiki/evals/files/bootstrap/docs/how-to-pay.md +0 -4
  200. package/skills/spec-wiki/evals/files/bootstrap/docs/overview.md +0 -9
  201. package/skills/spec-wiki/evals/files/bootstrap/requirements/payment-behavior.md +0 -17
  202. package/skills/spec-wiki/evals/files/bootstrap/src/payments.ts +0 -12
  203. package/skills/spec-wiki/evals/files/bootstrap/tests/payments.test.ts +0 -11
  204. package/skills/spec-wiki/evals/files/focused/src/session.ts +0 -5
  205. package/skills/spec-wiki/evals/files/focused/tests/session.test.ts +0 -17
  206. package/skills/spec-wiki/evals/files/maintenance/low-signal/incoming/capture.txt +0 -2
  207. package/skills/spec-wiki/evals/files/maintenance/low-signal/src/capture.ts +0 -3
  208. package/skills/spec-wiki/evals/files/maintenance/move/docs/old-job-contract.md +0 -18
  209. package/skills/spec-wiki/evals/files/maintenance/move/src/job.ts +0 -5
  210. package/skills/spec-wiki/evals/files/maintenance/new-relation/docs/session-refresh.md +0 -24
  211. package/skills/spec-wiki/evals/files/maintenance/new-relation/incoming/refresh-worker.ts +0 -7
  212. package/skills/spec-wiki/evals/files/maintenance/new-relation/src/session.ts +0 -7
  213. package/skills/spec-wiki/evals/files/maintenance/no-impact/docs/auth-contract.md +0 -17
  214. package/skills/spec-wiki/evals/files/maintenance/no-impact/incoming/telemetry-format.ts +0 -3
  215. package/skills/spec-wiki/evals/files/maintenance/no-impact/src/auth.ts +0 -3
  216. package/skills/spec-wiki/evals/files/query/docs/how-to-run-jobs.md +0 -4
  217. package/skills/spec-wiki/evals/files/query/docs/spec-overview.md +0 -9
  218. package/skills/spec-wiki/evals/files/query/features/jobs/cancellation-contract.md +0 -15
  219. package/skills/spec-wiki/evals/files/query/features/jobs/retry-spec.md +0 -6
  220. package/skills/spec-wiki/evals/maintenance_regression.py +0 -311
  221. package/skills/spec-wiki/evals/retrieval-eval.md +0 -37
  222. package/skills/spec-wiki/evals/retrieval-evals.json +0 -37
  223. package/skills/spec-wiki/evals/trigger-evals.json +0 -94
  224. package/skills/spec-wiki/references/bootstrap.md +0 -100
  225. package/skills/spec-wiki/references/focused-spec.md +0 -117
  226. package/skills/spec-wiki/references/index-schema.md +0 -330
  227. package/skills/spec-wiki/references/maintenance.md +0 -134
  228. package/skills/spec-wiki/references/query.md +0 -74
  229. package/skills/spec-wiki/scripts/spec_wiki.py +0 -2076
  230. /package/external/pi-tools-suite/src/async-subagents/agents/{browser-qa → ui-qa/browser}/examples/qa-auth.example.jsonc +0 -0
  231. /package/external/pi-tools-suite/src/async-subagents/agents/{browser-qa → ui-qa/browser}/examples/qa-flow.example.jsonc +0 -0
  232. /package/external/pi-tools-suite/src/async-subagents/agents/{browser-qa → ui-qa/browser}/vendor/fflate.LICENSE +0 -0
  233. /package/external/pi-tools-suite/src/async-subagents/agents/{browser-qa → ui-qa/browser}/vendor/fflate.mjs +0 -0
@@ -1,94 +0,0 @@
1
- [
2
- {
3
- "query": "Before we touch src/auth/session.ts, write a compact spec for the new refresh-token rotation behavior. It changes persistence and the public login flow, and I want the expected behavior and verification path clear before implementation.",
4
- "should_trigger": true
5
- },
6
- {
7
- "query": "We have a pile of design docs under docs/, architecture/, and feature folders with no central specs directory. Find which ones are actual behavioral specs and build a small LLM-friendly project spec index without treating existing overview pages as source-of-truth.",
8
- "should_trigger": true
9
- },
10
- {
11
- "query": "src/jobs/runner.ts changed yesterday. Can you tell me which project specs may now be stale and check whether the documented cancellation/retry behavior still matches code and tests?",
12
- "should_trigger": true
13
- },
14
- {
15
- "query": "Which of our specs defines desktop session restore behavior? Please answer from the primary spec rather than scanning every markdown file, and warn me if the relevant spec looks stale.",
16
- "should_trigger": true
17
- },
18
- {
19
- "query": "The bug fix changes an externally visible CLI exit-code contract. Update the existing spec to describe the intended behavior, edge cases and compatibility, but don't implement the code yet.",
20
- "should_trigger": true
21
- },
22
- {
23
- "query": "Document the current as-is behavior of our webhook retry loop from code and tests. I'm especially worried the README is stale, so separate confirmed behavior from inference and unknowns.",
24
- "should_trigger": true
25
- },
26
- {
27
- "query": "We renamed several contract docs and moved implementation files. Refresh the project's spec knowledge base, repair missing paths, and show me which specs still need semantic review.",
28
- "should_trigger": true
29
- },
30
- {
31
- "query": "What do the project requirements say about idempotency for payment capture? There are multiple RFCs and an overview; find the primary spec and answer with its source path.",
32
- "should_trigger": true
33
- },
34
- {
35
- "query": "I'm about to change the on-disk cache schema. Check if we already have a spec for that behavior; if not, create a lightweight change spec before touching implementation.",
36
- "should_trigger": true
37
- },
38
- {
39
- "query": "Inventory the behavioral contracts in this unfamiliar repo and tell me which ones are affected by the changes in src/api and src/storage. Specs may be scattered and inconsistently named.",
40
- "should_trigger": true
41
- },
42
- {
43
- "query": "Implement background session refresh so a transient token-load failure is retried exactly once and a second failure still propagates. Add the code and tests and verify the change is complete.",
44
- "should_trigger": true
45
- },
46
- {
47
- "query": "I added a new src/auth/refresh-policy.ts implementation surface for an existing login behavior. Finish the change and make sure any project contracts or knowledge that should track the new file stay current.",
48
- "should_trigger": true
49
- },
50
- {
51
- "query": "Refactor src/utils/string.ts to use a helper function. This is a mechanical cleanup with no externally visible behavior change; just update the code and tests.",
52
- "should_trigger": false
53
- },
54
- {
55
- "query": "Write an ADR comparing Postgres and SQLite for a future analytics service. I want design tradeoffs and a decision record, not a behavior contract or spec audit.",
56
- "should_trigger": false
57
- },
58
- {
59
- "query": "Rewrite docs/getting-started.md so new users understand how to log in and run the CLI. Keep it friendly and add examples.",
60
- "should_trigger": false
61
- },
62
- {
63
- "query": "Search all markdown files for the exact string `refresh_token` and show me the matching lines. Don't interpret or update any documentation.",
64
- "should_trigger": false
65
- },
66
- {
67
- "query": "Trace callers of createSession and tell me what code modules would be affected by changing its return type. I only need code impact analysis, not documentation work.",
68
- "should_trigger": false
69
- },
70
- {
71
- "query": "Generate API reference pages from our OpenAPI JSON and publish them under docs/generated/. The schema is already authoritative; don't create or review project specs.",
72
- "should_trigger": false
73
- },
74
- {
75
- "query": "Summarize architecture/rfc-019.md for me in five bullets. I only want a summary of this one file, not a spec validation or project knowledge index.",
76
- "should_trigger": false
77
- },
78
- {
79
- "query": "Fix the typo in the error message in src/ui/toast.ts and adjust the snapshot. No contract or compatibility behavior changes.",
80
- "should_trigger": false
81
- },
82
- {
83
- "query": "Create a migration runbook for operators moving production from Redis 6 to Redis 7, including rollback commands and monitoring checks.",
84
- "should_trigger": false
85
- },
86
- {
87
- "query": "Compare these two external W3C specifications and explain the differences in browser behavior. This isn't about specs stored in our project.",
88
- "should_trigger": false
89
- },
90
- {
91
- "query": "Add a debug-only telemetry label to an internal helper and update its unit test. It must not change any user-visible behavior, persistence, API, retry, or compatibility contract.",
92
- "should_trigger": false
93
- }
94
- ]
@@ -1,100 +0,0 @@
1
- # Bootstrap the Spec Wiki
2
-
3
- Use for repository-wide discovery when no useful `.spec-wiki/state.json` exists,
4
- or when the user explicitly asks to inventory scattered specifications.
5
-
6
- The repository may have no `specs/` directory, no frontmatter, inconsistent
7
- formats, and multiple documentation roots.
8
-
9
- ## Workflow
10
-
11
- 1. Run `discover --limit 40`.
12
- 2. Read only the high-signal shortlist.
13
- 3. Semantically classify each candidate:
14
- - `spec` — primary normative/descriptive specification;
15
- - `spec-like` — useful spec knowledge with mixed/ambiguous purpose;
16
- - `meta-index` — overview, inventory, catalog, TOC, generated index;
17
- - `design-only` — design/decision material without enough behavioral contract;
18
- - `guide` — tutorial/runbook/usage documentation;
19
- - `other` — not useful spec knowledge.
20
- Treat files under eval/fixture/example/testdata trees, skill resources, and
21
- agent-role definition directories as examples/runtime configuration by
22
- default, not project primary specs, unless repository evidence explicitly
23
- says that document itself is normative project behavior.
24
-
25
- Location is not a reason to downgrade a document. A document outside a
26
- `specs/` directory that explicitly declares its behavioral Type/Lifecycle
27
- and defines testable behavior/contracts/invariants should normally be
28
- `spec`. Reserve `spec-like` for genuinely mixed-purpose or ambiguous
29
- documents, not for clear subsystem contracts living under `docs/`.
30
- 4. `record` every reviewed classification. For `spec`/`spec-like`, provide a
31
- concise summary, type, lifecycle, confidence, and a few retrieval topics.
32
- Classification/indexing is **not** semantic verification: bootstrap entries
33
- normally remain `unverified` until a focused code/test review occurs.
34
- 5. After recording a batch, rerun `discover --limit 40` from offset 0; unchanged
35
- reviewed documents drop from the default shortlist.
36
- 6. Continue until useful candidates are exhausted or coverage becomes too broad.
37
- Report incomplete coverage rather than reading hundreds of weak candidates.
38
- 7. Run `render` and `validate`.
39
-
40
- Do not call `verify` merely because a document was read during discovery. Call
41
- it only after checking the document's behavioral claims against the relevant
42
- implementation/tests (or other authoritative evidence for a proposed contract).
43
-
44
- ## What counts as a primary spec
45
-
46
- A primary spec describes current or intended behavior, requirements, contracts,
47
- invariants, externally observable semantics, acceptance criteria, compatibility
48
- rules, or similarly testable expectations.
49
-
50
- Classification is semantic. Filename, folder, headings, and links are signals,
51
- not requirements.
52
-
53
- ## Lifecycle
54
-
55
- Classify primary documents separately from their as-is/change type:
56
-
57
- - `active` — current authoritative contract;
58
- - `proposed` — intended contract not yet established as current behavior;
59
- - `historical` — useful milestone/history, not current precedence;
60
- - `superseded` — replaced by a newer primary spec; add `--superseded-by`;
61
- - `unknown` — lifecycle cannot be established safely.
62
-
63
- Useful default reasoning:
64
-
65
- - an as-is/current-behavior contract is normally `active` unless clearly
66
- historical;
67
- - a change document whose behavior is already implemented and still governs the
68
- system is normally `active`;
69
- - an intended/not-yet-implemented change is `proposed`;
70
- - milestone documents whose former non-goals/features were later superseded are
71
- `historical` unless a newer document explicitly replaces their whole contract;
72
- - use `superseded` only when a specific replacement exists and record that edge.
73
-
74
- The CLI requires explicit `--type` and `--lifecycle` on the first primary-spec
75
- record so omission cannot silently become precedence metadata.
76
-
77
- Use `--supersedes` / `--superseded-by` for known precedence instead of leaving
78
- overlapping documents as coequal active specs.
79
-
80
- ## Meta/index exclusion
81
-
82
- Do not index derived inventories as primary specs. They are useful only to find
83
- primary documents missed by heuristics. This avoids recursive knowledge such as:
84
-
85
- `spec -> old index summary -> new wiki summary`.
86
-
87
- ## Relationships
88
-
89
- The CLI extracts resolvable source links/paths as `explicit` relationships. Add
90
- `--code` or `--related-spec` only for relationships actually established from
91
- repository evidence; these are recorded as `inferred`.
92
-
93
- The resolver tries the source directory, nearest package/project roots, and the
94
- repository root. Review `unresolvedReferences` after bootstrap: they are path-like
95
- hints that could not be resolved deterministically and may need an inferred
96
- relation or a source-doc fix.
97
-
98
- Use project-relative path identity, never numeric prefixes as unique IDs.
99
-
100
- For exact command/config/state details, read `index-schema.md`.
@@ -1,117 +0,0 @@
1
- # Focused spec work
2
-
3
- Use this workflow for creating, updating, or checking one primary spec. Keep the
4
- scope narrow; repository-wide indexing is optional unless it helps retrieval.
5
-
6
- ## Core rules
7
-
8
- - Do not change production code unless implementation was requested.
9
- - Do not invent behavior. Mark ambiguity as inferred or unknown.
10
- - Prefer compact specs over exhaustive design documents.
11
- - Read only relevant code, tests, schemas, migrations, entrypoints, docs, and
12
- existing specs.
13
- - Follow the project's existing documentation convention when one exists.
14
- - Describe current behavior as `as-is`; intended behavior as `change`.
15
-
16
- ## When a spec is useful
17
-
18
- Prefer a focused spec for changes involving security/auth/privacy, data or
19
- persistence, public APIs/CLI/UI/events, integrations, destructive operations,
20
- async/concurrency/retries, cross-cutting architecture, non-trivial user-visible
21
- edge cases, unclear bug-fix contracts, or suspected spec-code drift.
22
-
23
- Do not force a spec for formatting-only edits, mechanical renames, or obvious
24
- local changes without broader behavioral impact.
25
-
26
- ## As-is / drift workflow
27
-
28
- 1. Identify the narrow behavior or contract.
29
- 2. If a Spec Wiki already exists, use it only to locate related primary specs.
30
- 3. Inspect the relevant code, tests, docs, schemas, migrations, and entrypoints.
31
- 4. Separate claims as:
32
- - confirmed by code;
33
- - confirmed by tests;
34
- - confirmed by docs;
35
- - inferred;
36
- - unknown.
37
- 5. Write/update a compact as-is spec.
38
- 6. Report detected drift separately from confirmed behavior.
39
- 7. If the project uses Spec Wiki, `record` the spec/relations, then run `verify`
40
- only after the code/test semantic check is complete, and `render`.
41
-
42
- ## Change workflow
43
-
44
- 1. Define goal, scope, and non-goals.
45
- 2. State intended behavior.
46
- 3. Capture affected contracts and invariants.
47
- 4. Add relevant edge cases, compatibility, migration, and risks.
48
- 5. Define verification.
49
- 6. Implement only when requested.
50
- 7. After implementation, verify the spec against code/tests.
51
- 8. For a material production-behavior change, run the post-change checkpoint in
52
- `maintenance.md` using the paths changed by this task. This is required even
53
- when the spec you started from appears sufficient: newly introduced files may
54
- reveal previously unknown spec relationships.
55
- 9. If the project uses Spec Wiki, refresh metadata with `record`, repair durable
56
- relation changes with `relate`, then establish the verified baseline with
57
- `verify` only after implementation/test verification and the impact sweep.
58
-
59
- If the task creates a new primary spec, record it immediately. If it moves a
60
- primary spec, record/verify the new path before removing the old metadata entry.
61
-
62
- ## Default template
63
-
64
- Use only when the repository has no stronger convention. Remove irrelevant
65
- sections.
66
-
67
- ```markdown
68
- # Spec: <name>
69
-
70
- ## Type
71
- As-is | Change
72
-
73
- ## Goal
74
- ...
75
-
76
- ## Scope
77
- ...
78
-
79
- ## Non-goals
80
- ...
81
-
82
- ## Behavior
83
- ...
84
-
85
- ## Contracts
86
- Inputs, outputs, APIs, CLI, UI, events, files, schemas.
87
-
88
- ## Invariants
89
- ...
90
-
91
- ## Edge cases
92
- ...
93
-
94
- ## Side effects
95
- ...
96
-
97
- ## Related files
98
- ...
99
-
100
- ## Verification
101
- ...
102
-
103
- ## Risks / unknowns
104
- ...
105
-
106
- ## Evidence
107
- - Confirmed by code:
108
- - Confirmed by tests:
109
- - Confirmed by docs:
110
- - Inferred:
111
- - Unknown:
112
- ```
113
-
114
- ## Report back
115
-
116
- Summarize the spec path, as-is/change mode, strongest evidence, important
117
- unknowns/drift, and whether production code was changed.
@@ -1,330 +0,0 @@
1
- # Spec Wiki state and CLI reference
2
-
3
- <!-- markdownlint-disable MD013 -->
4
-
5
- This reference describes the deterministic storage layer. Primary specification
6
- documents remain the source of truth.
7
-
8
- ## Files
9
-
10
- ```text
11
- .spec-wiki/index.md # compact generated routing index
12
- .spec-wiki/state.json # semantic metadata + structural/verification baselines
13
- .spec-wiki/config.jsonc # optional discovery overrides
14
- ```
15
-
16
- ## State schema v2
17
-
18
- Conceptual primary entry:
19
-
20
- ```json
21
- {
22
- "path": "docs/auth.md",
23
- "title": "Authentication contract",
24
- "classification": "spec",
25
- "type": "as-is",
26
- "lifecycle": "active",
27
- "confidence": "high",
28
- "summary": "Authentication session lifecycle and refresh invariants.",
29
- "topics": ["auth", "sessions"],
30
- "relations": {
31
- "code": [
32
- {"path": "src/auth/session.ts", "source": "explicit"}
33
- ],
34
- "specs": [
35
- {"path": "docs/oauth.md", "source": "inferred", "kind": "related"}
36
- ]
37
- },
38
- "unresolvedReferences": [],
39
- "indexed": {
40
- "at": "2026-09-09T00:00:00Z",
41
- "sourceHash": "sha256:..."
42
- },
43
- "verified": {
44
- "at": "2026-09-09T00:05:00Z",
45
- "sourceHash": "sha256:...",
46
- "relationsHash": "sha256:...",
47
- "codeHashes": {
48
- "src/auth/session.ts": "sha256:..."
49
- }
50
- }
51
- }
52
- ```
53
-
54
- State keys and all stored paths are normalized project-relative POSIX paths.
55
-
56
- ### Classification
57
-
58
- - `spec` — primary behavioral/normative specification.
59
- - `spec-like` — primary-ish knowledge with mixed/ambiguous purpose.
60
- - `meta-index` — inventory, overview, catalog, TOC, generated index.
61
- - `design-only` — design/decision material without enough behavioral contract.
62
- - `guide` — tutorial, runbook, usage/operational documentation.
63
- - `other` — not useful specification knowledge.
64
-
65
- Only `spec`/`spec-like` are primary specs. `design-only` may be searched as
66
- secondary context with `search --include-secondary`.
67
-
68
- ### Type
69
-
70
- - `as-is` — describes current behavior.
71
- - `change` — intended/changed behavior.
72
- - `mixed` — intentionally contains both.
73
- - `unknown` — not safely determined.
74
-
75
- ### Lifecycle
76
-
77
- Lifecycle is separate from Type:
78
-
79
- - `active` — current authoritative contract.
80
- - `proposed` — intended contract that is not yet current.
81
- - `historical` — useful milestone/history, not current precedence.
82
- - `superseded` — replaced by a newer primary document.
83
- - `unknown` — precedence cannot be established safely.
84
-
85
- For known replacement relationships use:
86
-
87
- - `kind: related`
88
- - `kind: supersedes`
89
- - `kind: superseded-by`
90
-
91
- ### Indexed vs verified
92
-
93
- `indexed` is refreshed by `record`. It means the document was classified and
94
- summarized at that exact source hash.
95
-
96
- `verified` is written only by `verify`. It means the agent has semantically
97
- checked the spec against its relevant implementation/tests/evidence and accepted
98
- the current tracked-input baseline. The baseline also fingerprints the current
99
- code/spec relation map. Adding or removing a relation therefore invalidates
100
- freshness until semantic review and `verify` establish a new baseline.
101
-
102
- Therefore a clean bootstrap produces `unverified` primary specs, not `fresh`.
103
-
104
- ## Freshness statuses
105
-
106
- - `fresh` — source and tracked code inputs match an explicit verified baseline.
107
- - `unverified` — indexed but no semantic-verification baseline exists.
108
- - `spec-changed` — source differs from indexed/verified baseline.
109
- - `inputs-changed` — one or more tracked implementation inputs differ/missing.
110
- - `spec+inputs-changed` — both source and implementation inputs changed.
111
- - `missing-source` — primary source disappeared/moved.
112
-
113
- Hash status is structural evidence only; `inputs-changed` requests semantic
114
- review and must not rewrite behavior automatically.
115
-
116
- ## Relationship discovery
117
-
118
- Explicit path/link resolution tries, in order:
119
-
120
- 1. the source document directory;
121
- 2. ancestor package roots containing markers such as `package.json`,
122
- `pyproject.toml`, `Cargo.toml`, `go.mod`, or `Package.swift`;
123
- 3. repository root.
124
-
125
- This lets a doc under `external/package/docs/` resolve `src/foo.ts` against the
126
- package root. Simple `{a,b}` path groups are expanded.
127
-
128
- If the document explicitly says that paths/references below are relative to a
129
- backticked existing project directory (for example `external/tool-suite/`), that
130
- directory is also used as a resolution base. This covers root-level specs that
131
- document one nested package using package-relative paths.
132
-
133
- Path-like tokens that still cannot resolve are stored in
134
- `unresolvedReferences`. They are diagnostic hints, not silently discarded.
135
-
136
- ## Optional config.jsonc
137
-
138
- ```jsonc
139
- {
140
- "includeExtensions": [".md", ".mdx", ".rst", ".adoc", ".txt"],
141
- "include": ["docs/**", "architecture/**", "features/**"],
142
- "exclude": ["legacy/**", "generated-docs/**"],
143
- "forceSpecs": ["protocol/*.txt"],
144
- "ignoreSpecs": ["docs/spec-template.md"],
145
- "minCandidateScore": 3,
146
- "maxFileBytes": 524288
147
- }
148
- ```
149
-
150
- The scanner excludes its own state plus common dependency/build/cache dirs.
151
- When Git is available it uses tracked + unignored untracked files; hashing also
152
- works without Git.
153
-
154
- ## CLI
155
-
156
- Global options:
157
-
158
- ```text
159
- --root PATH project root; defaults to Git root, then cwd
160
- --state-dir PATH alternate wiki directory; relative paths are root-relative
161
- --config PATH alternate config.jsonc/json path
162
- ```
163
-
164
- ### discover
165
-
166
- ```bash
167
- spec_wiki.py --root . discover --limit 40
168
- spec_wiki.py --root . discover --all --json
169
- spec_wiki.py --root . discover --all-unclassified --limit 40
170
- ```
171
-
172
- Produces a heuristic shortlist. `roleHint` is not a semantic classification.
173
- After recording a page, rerun from offset 0 because the shortlist shrinks.
174
- `--all-unclassified` is a bounded periodic coverage audit: it bypasses candidate
175
- score for unclassified document-like files while still excluding known
176
- fixture/skill-resource noise unless forced by config.
177
-
178
- ### record
179
-
180
- ```bash
181
- spec_wiki.py --root . record \
182
- --path docs/auth.md \
183
- --classification spec \
184
- --type as-is \
185
- --lifecycle active \
186
- --confidence high \
187
- --summary "Authentication lifecycle and refresh invariants." \
188
- --topic auth --topic sessions \
189
- --code src/auth/session.ts \
190
- --related-spec docs/oauth.md
191
- ```
192
-
193
- `record` updates classification, summary, topics, relationships, unresolved
194
- references, and the `indexed` source hash. It **does not verify** the entry.
195
- The first `spec`/`spec-like` record requires explicit `--type` and
196
- `--lifecycle` (use `unknown` only after semantic inspection cannot decide).
197
-
198
- Additional spec relationship flags are repeatable:
199
-
200
- ```text
201
- --supersedes PATH
202
- --superseded-by PATH
203
- ```
204
-
205
- `--clear-code` and `--clear-related-specs` remove previously inferred relations;
206
- explicit source links are re-extracted each time.
207
-
208
- ### verify
209
-
210
- ```bash
211
- spec_wiki.py --root . verify --path docs/auth.md
212
- ```
213
-
214
- Run only after semantic review. It hashes the current source and every tracked
215
- code/test input plus the current relation map and establishes the new verified
216
- baseline. Missing tracked inputs fail rather than being silently accepted.
217
-
218
- ### relate
219
-
220
- Use `relate` to repair inferred relations without resupplying the full semantic
221
- record:
222
-
223
- ```bash
224
- spec_wiki.py --root . relate --path docs/auth.md --add-code src/auth/refresh.ts
225
- spec_wiki.py --root . relate --path docs/auth.md --remove-code src/auth/legacy.ts
226
- ```
227
-
228
- It also supports add/remove variants for related specs, `supersedes`, and
229
- `superseded-by`. Explicit relations extracted from the primary source are not
230
- removed by this command; correct the source document instead. A real relation
231
- change makes the previous verified baseline non-fresh through `relationsHash`.
232
-
233
- ### search
234
-
235
- ```bash
236
- spec_wiki.py --root . search "session cancellation retry" --limit 8
237
- spec_wiki.py --root . search "как восстановить историю" \
238
- --also "session recovery raw history after compaction" \
239
- --also "session recovery tools" --json
240
- spec_wiki.py --root . search "context gateway" --include-secondary --json
241
- ```
242
-
243
- Searches state metadata directly: title, topics, summary, spec path, known code
244
- relations, related-spec relations, and supersession edges. Exact spec/relation
245
- paths have strong weight. Relation token scoring uses concrete leaf names rather
246
- than generic directory segments.
247
-
248
- `--also` is repeatable. The CLI scores each formulation independently, then
249
- merges them deterministically. The intended caller is the current LLM: preserve
250
- the original request and, for natural-language intents, add 2–3 genuinely
251
- different English formulations (canonical contract nouns/synonyms plus implied
252
- failure/invariant vocabulary) without making another model call. Exact paths and
253
- symbols usually need no expansion.
254
-
255
- JSON output includes `confidence`, `catalogFallbackRecommended`,
256
- `semanticRerankRecommended`, coverage metrics, and per-query match evidence.
257
- These are routing hints, not semantic proof. The agent still reranks candidates
258
- from compact metadata. If fallback is recommended, results are empty, or the
259
- candidate set plainly misses part of the intent, inspect the compact generated
260
- `index.md` before deciding no relevant spec exists.
261
-
262
- Active specs rank above proposed/historical/superseded ones. This is the normal
263
- retrieval path; reading the entire generated index is a semantic fallback.
264
-
265
- ### status / audit
266
-
267
- ```bash
268
- spec_wiki.py --root . status
269
- spec_wiki.py --root . audit --json
270
- ```
271
-
272
- Reports current/proposed primary count, fresh/unverified/review counts,
273
- unresolved reference count, missing sources, and new/changed candidates.
274
- `needs review` counts structural drift/missing sources; cleanly indexed but never
275
- verified specs are reported separately as `unverified`.
276
-
277
- ### affected
278
-
279
- ```bash
280
- spec_wiki.py --root . affected src/auth/session.ts src/storage
281
- ```
282
-
283
- Returns current/proposed primary specs whose source or tracked code relations
284
- overlap supplied paths. Historical/superseded specs are skipped.
285
-
286
- ### changes / impact
287
-
288
- ```bash
289
- spec_wiki.py --root . changes --json
290
- spec_wiki.py --root . impact src/auth/session.ts src/auth/refresh.ts --json
291
- spec_wiki.py --root . impact --base HEAD --json
292
- ```
293
-
294
- `changes` reports Git worktree changes, untracked files, and renames while
295
- excluding Spec Wiki's own state directory.
296
-
297
- `impact` is the deterministic post-change maintenance primitive. Explicit paths
298
- keep it scoped to the current task; with no paths it uses Git changes against
299
- `--base`. It returns known affected specs, uncovered changed paths, every changed
300
- document-like file (even score-0), missing/moved tracked specs, and a
301
- `semanticSweepRequired` flag. Uncovered paths are search seeds for LLM semantic
302
- impact review, not proof that a spec is missing.
303
-
304
- ### render
305
-
306
- ```bash
307
- spec_wiki.py --root . render
308
- ```
309
-
310
- Generates a compact one-line-per-spec routing index. Historical/superseded specs
311
- and secondary design references are separate sections. Full summaries remain in
312
- state and are retrieved through `search`.
313
-
314
- ### remove
315
-
316
- ```bash
317
- spec_wiki.py --root . remove --path docs/old-contract.md
318
- ```
319
-
320
- Removes metadata only. For a move, record the new path before removing the old.
321
-
322
- ### validate
323
-
324
- ```bash
325
- spec_wiki.py --root . validate
326
- ```
327
-
328
- Checks schema/path/hash/relationship safety. Stale/unverified current specs,
329
- unresolved path hints, and active as-is specs without implementation relations
330
- are warnings rather than malformed-state errors.