pi-ui-extend 1.0.40 → 1.0.42

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 (186) hide show
  1. package/README.md +10 -2
  2. package/dist/app/app.d.ts +3 -0
  3. package/dist/app/app.js +26 -0
  4. package/dist/app/commands/command-host.d.ts +1 -0
  5. package/dist/app/commands/command-model-actions.js +6 -1
  6. package/dist/app/commands/command-registry.js +3 -3
  7. package/dist/app/commands/command-session-actions.d.ts +0 -1
  8. package/dist/app/commands/command-session-actions.js +30 -15
  9. package/dist/app/commands/reload-context-inventory.d.ts +11 -0
  10. package/dist/app/commands/reload-context-inventory.js +59 -0
  11. package/dist/app/extensions/extension-actions-controller.d.ts +1 -0
  12. package/dist/app/extensions/extension-actions-controller.js +6 -0
  13. package/dist/app/extensions/subagent-catalog-state.d.ts +9 -0
  14. package/dist/app/extensions/subagent-catalog-state.js +23 -0
  15. package/dist/app/icons.d.ts +14 -0
  16. package/dist/app/icons.js +33 -0
  17. package/dist/app/rendering/conversation-tool-renderer.js +2 -2
  18. package/dist/app/rendering/dcp-stats.d.ts +6 -1
  19. package/dist/app/rendering/dcp-stats.js +214 -46
  20. package/dist/app/rendering/editor-panels.js +17 -8
  21. package/dist/app/session/lazy-session-manager.js +12 -1
  22. package/dist/app/session/session-lifecycle-controller.d.ts +1 -0
  23. package/dist/app/session/session-lifecycle-controller.js +6 -0
  24. package/dist/app/session/tabs-controller.d.ts +3 -5
  25. package/dist/app/session/tabs-controller.js +31 -22
  26. package/dist/app/subagents/subagents-files.js +60 -1
  27. package/dist/app/subagents/subagents-model.d.ts +15 -1
  28. package/dist/app/subagents/subagents-model.js +52 -17
  29. package/dist/app/types.d.ts +7 -0
  30. package/dist/bundled-extensions/session-title/config.js +1 -1
  31. package/dist/default-pix-config.js +10 -0
  32. package/dist/markdown-format.js +27 -9
  33. package/dist/schemas/index.d.ts +1 -0
  34. package/dist/schemas/index.js +1 -0
  35. package/dist/schemas/pi-tools-suite-schema.d.ts +106 -71
  36. package/dist/schemas/pi-tools-suite-schema.js +68 -88
  37. package/dist/schemas/pix-schema.d.ts +7 -0
  38. package/dist/schemas/pix-schema.js +14 -0
  39. package/dist/schemas/tasks-schema.d.ts +18 -0
  40. package/dist/schemas/tasks-schema.js +41 -0
  41. package/docs/concurrency.md +6 -0
  42. package/docs/desktop-mvp.md +12 -1
  43. package/docs/desktop-task-manager.md +93 -82
  44. package/external/pi-tools-suite/README.md +192 -72
  45. package/external/pi-tools-suite/docs/browser-qa-subagent.md +50 -21
  46. package/external/pi-tools-suite/docs/context-gateway-p00-adr.md +216 -0
  47. package/external/pi-tools-suite/docs/context-gateway-p01n-gate-review.md +122 -0
  48. package/external/pi-tools-suite/docs/context-gateway-p01n-measurement.md +133 -0
  49. package/external/pi-tools-suite/docs/context-gateway-p01r-ra-evidence.md +111 -0
  50. package/external/pi-tools-suite/docs/context-gateway-p01r-rb-evidence.md +100 -0
  51. package/external/pi-tools-suite/docs/context-gateway-p01r-rc-evidence.md +69 -0
  52. package/external/pi-tools-suite/docs/context-gateway-p01r-rd-evidence.md +100 -0
  53. package/external/pi-tools-suite/docs/context-gateway-p01r-re-evidence.md +74 -0
  54. package/external/pi-tools-suite/docs/context-gateway-p01r-rf-evidence.md +153 -0
  55. package/external/pi-tools-suite/docs/context-gateway-p01r-rg-evidence.md +235 -0
  56. package/external/pi-tools-suite/docs/evals.md +1 -1
  57. package/external/pi-tools-suite/docs/session-recovery.md +40 -14
  58. package/external/pi-tools-suite/docs/subagent-model-pools.md +120 -0
  59. package/external/pi-tools-suite/package.json +3 -0
  60. package/external/pi-tools-suite/src/async-subagents/{private-skills → agents}/browser-qa/scripts/browser-qa-runner.mjs +82 -1
  61. package/external/pi-tools-suite/src/async-subagents/{private-skills/browser-qa/SKILL.md → agents/browser-qa.md} +261 -12
  62. package/external/pi-tools-suite/src/async-subagents/agents/frontier-review.md +23 -0
  63. package/external/pi-tools-suite/src/async-subagents/agents/implement.md +20 -0
  64. package/external/pi-tools-suite/src/async-subagents/agents/oracle.md +16 -0
  65. package/external/pi-tools-suite/src/async-subagents/agents/presets.jsonc +16 -0
  66. package/external/pi-tools-suite/src/async-subagents/agents/research.md +20 -0
  67. package/external/pi-tools-suite/src/async-subagents/agents/verify.md +18 -0
  68. package/external/pi-tools-suite/src/async-subagents/commands.ts +20 -72
  69. package/external/pi-tools-suite/src/async-subagents/core/activity.ts +33 -0
  70. package/external/pi-tools-suite/src/async-subagents/core/agent-catalog.ts +42 -0
  71. package/external/pi-tools-suite/src/async-subagents/core/agent-strategy.ts +13 -93
  72. package/external/pi-tools-suite/src/async-subagents/core/agents-dir.ts +499 -0
  73. package/external/pi-tools-suite/src/async-subagents/core/browser-qa.ts +9 -0
  74. package/external/pi-tools-suite/src/async-subagents/core/config.ts +284 -417
  75. package/external/pi-tools-suite/src/async-subagents/core/model-fallback.ts +1 -1
  76. package/external/pi-tools-suite/src/async-subagents/core/model-selection.ts +54 -0
  77. package/external/pi-tools-suite/src/async-subagents/core/prompt.ts +7 -6
  78. package/external/pi-tools-suite/src/async-subagents/core/routing.ts +65 -45
  79. package/external/pi-tools-suite/src/async-subagents/core/spawn.ts +18 -6
  80. package/external/pi-tools-suite/src/async-subagents/core/state.ts +40 -0
  81. package/external/pi-tools-suite/src/async-subagents/core/types.ts +7 -0
  82. package/external/pi-tools-suite/src/async-subagents/index.ts +77 -3
  83. package/external/pi-tools-suite/src/async-subagents/lib.ts +12 -9
  84. package/external/pi-tools-suite/src/async-subagents/tools/spawn.ts +54 -22
  85. package/external/pi-tools-suite/src/async-subagents/tools/subagents.ts +6 -4
  86. package/external/pi-tools-suite/src/async-subagents/types.ts +3 -0
  87. package/external/pi-tools-suite/src/config.ts +42 -2
  88. package/external/pi-tools-suite/src/context-gateway/accounting.ts +151 -0
  89. package/external/pi-tools-suite/src/context-gateway/config.ts +120 -0
  90. package/external/pi-tools-suite/src/context-gateway/enforcement.ts +102 -0
  91. package/external/pi-tools-suite/src/context-gateway/index.ts +214 -0
  92. package/external/pi-tools-suite/src/context-gateway/metadata-normalization.ts +88 -0
  93. package/external/pi-tools-suite/src/context-gateway/storeless-capabilities.ts +89 -0
  94. package/external/pi-tools-suite/src/context-gateway/telemetry.ts +502 -0
  95. package/external/pi-tools-suite/src/context-gateway/test-output-parser.ts +326 -0
  96. package/external/pi-tools-suite/src/context-gateway/types.ts +158 -0
  97. package/external/pi-tools-suite/src/context-inventory.ts +99 -0
  98. package/external/pi-tools-suite/src/dcp/auto-compress-budget.ts +106 -0
  99. package/external/pi-tools-suite/src/dcp/auto-compress.ts +892 -136
  100. package/external/pi-tools-suite/src/dcp/commands.ts +82 -139
  101. package/external/pi-tools-suite/src/dcp/compress-tool.ts +533 -74
  102. package/external/pi-tools-suite/src/dcp/compression-blocks.ts +488 -94
  103. package/external/pi-tools-suite/src/dcp/compression-preview.ts +122 -0
  104. package/external/pi-tools-suite/src/dcp/compression-progress.ts +70 -0
  105. package/external/pi-tools-suite/src/dcp/config.ts +86 -68
  106. package/external/pi-tools-suite/src/dcp/conversation-index.ts +421 -0
  107. package/external/pi-tools-suite/src/dcp/debug-log.ts +7 -5
  108. package/external/pi-tools-suite/src/dcp/index.ts +617 -203
  109. package/external/pi-tools-suite/src/dcp/journal.ts +566 -0
  110. package/external/pi-tools-suite/src/dcp/progress-controller.ts +244 -0
  111. package/external/pi-tools-suite/src/dcp/prompts.ts +83 -189
  112. package/external/pi-tools-suite/src/dcp/protected-continuity.ts +175 -0
  113. package/external/pi-tools-suite/src/dcp/provider-tool-results.ts +189 -0
  114. package/external/pi-tools-suite/src/dcp/pruner-candidates.ts +299 -79
  115. package/external/pi-tools-suite/src/dcp/pruner-compression-blocks.ts +173 -281
  116. package/external/pi-tools-suite/src/dcp/pruner-emergency.ts +2 -4
  117. package/external/pi-tools-suite/src/dcp/pruner-message-ids.ts +23 -15
  118. package/external/pi-tools-suite/src/dcp/pruner-metadata.ts +11 -1
  119. package/external/pi-tools-suite/src/dcp/pruner-nudge.ts +30 -82
  120. package/external/pi-tools-suite/src/dcp/pruner-tools.ts +28 -136
  121. package/external/pi-tools-suite/src/dcp/pruner.ts +18 -33
  122. package/external/pi-tools-suite/src/dcp/recovery.ts +129 -0
  123. package/external/pi-tools-suite/src/dcp/shadow-plan.ts +127 -0
  124. package/external/pi-tools-suite/src/dcp/state-transaction.ts +102 -0
  125. package/external/pi-tools-suite/src/dcp/state.ts +158 -580
  126. package/external/pi-tools-suite/src/dcp/ui.ts +1 -0
  127. package/external/pi-tools-suite/src/default-pi-tools-suite-config.ts +36 -214
  128. package/external/pi-tools-suite/src/index.ts +16 -1
  129. package/external/pi-tools-suite/src/model-tools/index.ts +76 -42
  130. package/external/pi-tools-suite/src/repo-discovery/index.ts +84 -18
  131. package/external/pi-tools-suite/src/repo-discovery/native-compact.ts +458 -0
  132. package/external/pi-tools-suite/src/resource-registry/index.ts +2290 -0
  133. package/external/pi-tools-suite/src/session-recovery/index.ts +189 -43
  134. package/external/pi-tools-suite/src/shell-command-policy.ts +219 -0
  135. package/external/pi-tools-suite/src/tool-descriptions.ts +41 -38
  136. package/external/pi-tools-suite/src/truncation-metadata-normalizer/index.ts +17 -0
  137. package/package.json +6 -3
  138. package/schemas/pi-tools-suite.json +540 -312
  139. package/schemas/pix.json +24 -0
  140. package/schemas/tasks.json +132 -0
  141. package/skills/spec-wiki/SKILL.md +55 -0
  142. package/skills/spec-wiki/evals/evals.json +132 -0
  143. package/skills/spec-wiki/evals/files/bootstrap/architecture/rfc-007.md +14 -0
  144. package/skills/spec-wiki/evals/files/bootstrap/docs/how-to-pay.md +4 -0
  145. package/skills/spec-wiki/evals/files/bootstrap/docs/overview.md +9 -0
  146. package/skills/spec-wiki/evals/files/bootstrap/requirements/payment-behavior.md +17 -0
  147. package/skills/spec-wiki/evals/files/bootstrap/src/payments.ts +12 -0
  148. package/skills/spec-wiki/evals/files/bootstrap/tests/payments.test.ts +11 -0
  149. package/skills/spec-wiki/evals/files/focused/src/session.ts +5 -0
  150. package/skills/spec-wiki/evals/files/focused/tests/session.test.ts +17 -0
  151. package/skills/spec-wiki/evals/files/maintenance/low-signal/incoming/capture.txt +2 -0
  152. package/skills/spec-wiki/evals/files/maintenance/low-signal/src/capture.ts +3 -0
  153. package/skills/spec-wiki/evals/files/maintenance/move/docs/old-job-contract.md +18 -0
  154. package/skills/spec-wiki/evals/files/maintenance/move/src/job.ts +5 -0
  155. package/skills/spec-wiki/evals/files/maintenance/new-relation/docs/session-refresh.md +24 -0
  156. package/skills/spec-wiki/evals/files/maintenance/new-relation/incoming/refresh-worker.ts +7 -0
  157. package/skills/spec-wiki/evals/files/maintenance/new-relation/src/session.ts +7 -0
  158. package/skills/spec-wiki/evals/files/maintenance/no-impact/docs/auth-contract.md +17 -0
  159. package/skills/spec-wiki/evals/files/maintenance/no-impact/incoming/telemetry-format.ts +3 -0
  160. package/skills/spec-wiki/evals/files/maintenance/no-impact/src/auth.ts +3 -0
  161. package/skills/spec-wiki/evals/files/query/docs/how-to-run-jobs.md +4 -0
  162. package/skills/spec-wiki/evals/files/query/docs/spec-overview.md +9 -0
  163. package/skills/spec-wiki/evals/files/query/features/jobs/cancellation-contract.md +15 -0
  164. package/skills/spec-wiki/evals/files/query/features/jobs/retry-spec.md +6 -0
  165. package/skills/spec-wiki/evals/maintenance_regression.py +311 -0
  166. package/skills/spec-wiki/evals/retrieval-eval.md +37 -0
  167. package/skills/spec-wiki/evals/retrieval-evals.json +37 -0
  168. package/skills/spec-wiki/evals/trigger-evals.json +94 -0
  169. package/skills/spec-wiki/references/bootstrap.md +100 -0
  170. package/skills/spec-wiki/references/focused-spec.md +117 -0
  171. package/skills/spec-wiki/references/index-schema.md +330 -0
  172. package/skills/spec-wiki/references/maintenance.md +134 -0
  173. package/skills/spec-wiki/references/query.md +74 -0
  174. package/skills/spec-wiki/scripts/spec_wiki.py +2076 -0
  175. package/docs/desktop-markdown-media.md +0 -77
  176. package/external/pi-tools-suite/docs/dcp-emergency-current-turn.md +0 -102
  177. package/external/pi-tools-suite/src/async-subagents/async-subagents.sample.jsonc +0 -270
  178. package/external/pi-tools-suite/src/async-subagents/private-skills/browser-qa/references/auth-scaffold-spec.md +0 -78
  179. package/external/pi-tools-suite/src/async-subagents/private-skills/browser-qa/references/qa-design.md +0 -223
  180. package/external/pi-tools-suite/src/dcp/state-persistence.ts +0 -195
  181. package/external/pi-tools-suite/src/skill-installer/index.ts +0 -333
  182. package/skills/spec-lite/SKILL.md +0 -140
  183. /package/external/pi-tools-suite/src/async-subagents/{private-skills/browser-qa/references → agents/browser-qa/examples}/qa-auth.example.jsonc +0 -0
  184. /package/external/pi-tools-suite/src/async-subagents/{private-skills/browser-qa/references → agents/browser-qa/examples}/qa-flow.example.jsonc +0 -0
  185. /package/external/pi-tools-suite/src/async-subagents/{private-skills → agents}/browser-qa/vendor/fflate.LICENSE +0 -0
  186. /package/external/pi-tools-suite/src/async-subagents/{private-skills → agents}/browser-qa/vendor/fflate.mjs +0 -0
package/schemas/pix.json CHANGED
@@ -308,6 +308,30 @@
308
308
  }
309
309
  },
310
310
  "description": "Voice dictation (Vosk) configuration."
311
+ },
312
+ "desktop": {
313
+ "type": "object",
314
+ "properties": {
315
+ "externalEditor": {
316
+ "type": "string",
317
+ "description": "External editor used by Pix Desktop project explorer. Known aliases include zed, code/vscode, cursor, subl/sublime, idea/intellij, and webstorm; an executable path/name is also accepted."
318
+ },
319
+ "git": {
320
+ "type": "object",
321
+ "properties": {
322
+ "reviewModelRef": {
323
+ "type": "string",
324
+ "description": "Model reference used by Pix Desktop for LLM review of Git diffs, optionally with a :thinking suffix."
325
+ },
326
+ "commitMessageModelRef": {
327
+ "type": "string",
328
+ "description": "Model reference used by Pix Desktop to generate Git commit messages, optionally with a :thinking suffix."
329
+ }
330
+ },
331
+ "description": "Pix Desktop Git/Source Control LLM preferences."
332
+ }
333
+ },
334
+ "description": "Pix Desktop-specific preferences."
311
335
  }
312
336
  },
313
337
  "$id": "https://unpkg.com/pi-ui-extend/schemas/pix.json",
@@ -0,0 +1,132 @@
1
+ {
2
+ "type": "object",
3
+ "required": [
4
+ "version",
5
+ "tasks"
6
+ ],
7
+ "properties": {
8
+ "$schema": {
9
+ "type": "string",
10
+ "description": "JSON Schema URL used by editors for validation and autocomplete."
11
+ },
12
+ "version": {
13
+ "type": "number",
14
+ "const": 1,
15
+ "description": "Task document format version."
16
+ },
17
+ "tasks": {
18
+ "type": "array",
19
+ "items": {
20
+ "type": "object",
21
+ "required": [
22
+ "id",
23
+ "title",
24
+ "type",
25
+ "status",
26
+ "priority",
27
+ "createdAt",
28
+ "updatedAt"
29
+ ],
30
+ "properties": {
31
+ "id": {
32
+ "type": "string",
33
+ "minLength": 1,
34
+ "maxLength": 128,
35
+ "description": "Stable unique task id."
36
+ },
37
+ "title": {
38
+ "type": "string",
39
+ "minLength": 1,
40
+ "maxLength": 200,
41
+ "description": "Short task title."
42
+ },
43
+ "description": {
44
+ "type": "string",
45
+ "maxLength": 10000,
46
+ "description": "Optional detailed task description."
47
+ },
48
+ "type": {
49
+ "anyOf": [
50
+ {
51
+ "type": "string",
52
+ "const": "bug"
53
+ },
54
+ {
55
+ "type": "string",
56
+ "const": "feature"
57
+ },
58
+ {
59
+ "type": "string",
60
+ "const": "improvement"
61
+ }
62
+ ]
63
+ },
64
+ "status": {
65
+ "anyOf": [
66
+ {
67
+ "type": "string",
68
+ "const": "backlog"
69
+ },
70
+ {
71
+ "type": "string",
72
+ "const": "todo"
73
+ },
74
+ {
75
+ "type": "string",
76
+ "const": "in-progress"
77
+ },
78
+ {
79
+ "type": "string",
80
+ "const": "done"
81
+ }
82
+ ]
83
+ },
84
+ "priority": {
85
+ "anyOf": [
86
+ {
87
+ "type": "string",
88
+ "const": "low"
89
+ },
90
+ {
91
+ "type": "string",
92
+ "const": "medium"
93
+ },
94
+ {
95
+ "type": "string",
96
+ "const": "high"
97
+ },
98
+ {
99
+ "type": "string",
100
+ "const": "urgent"
101
+ }
102
+ ]
103
+ },
104
+ "sessionId": {
105
+ "type": "string",
106
+ "minLength": 1,
107
+ "maxLength": 512,
108
+ "description": "Optional Pi session associated with this task."
109
+ },
110
+ "createdAt": {
111
+ "type": "string",
112
+ "format": "date-time",
113
+ "description": "RFC 3339 creation timestamp."
114
+ },
115
+ "updatedAt": {
116
+ "type": "string",
117
+ "format": "date-time",
118
+ "description": "RFC 3339 last-update timestamp."
119
+ }
120
+ },
121
+ "additionalProperties": false
122
+ },
123
+ "maxItems": 10000,
124
+ "description": "Project tasks. Task ids must be unique."
125
+ }
126
+ },
127
+ "$id": "https://unpkg.com/pi-ui-extend/schemas/tasks.json",
128
+ "$schema": "https://json-schema.org/draft-07/schema#",
129
+ "title": "Pix Project Tasks",
130
+ "description": "Project-scoped task document stored in <cwd>/.pi/tasks.jsonc.",
131
+ "additionalProperties": false
132
+ }
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: spec-wiki
3
+ description: >-
4
+ Use this skill for behavior-changing project work or behavioral specs/contracts:
5
+ write/verify as-is/change behavior from code/tests, find requirements, detect
6
+ spec-code drift/impact, or maintain a spec wiki. Skip mechanical/refactor/
7
+ debug-only changes and code-only impact with no contract/doc work. Not for
8
+ runbooks or general docs.
9
+ ---
10
+
11
+ # Spec Wiki
12
+
13
+ Primary specs are the source of truth. `.spec-wiki/` is only derived navigation
14
+ and freshness metadata. Specs may live anywhere and use any structure.
15
+
16
+ ## Router
17
+
18
+ Choose one mode. Read only the referenced file unless the task expands.
19
+
20
+ - One spec: create/update/check/verify → `references/focused-spec.md`.
21
+ - Find/answer from specs → `references/query.md`.
22
+ - First discovery/index build → `references/bootstrap.md`.
23
+ - Refresh/audit/impact/repair → `references/maintenance.md`.
24
+ - Exact CLI/state/config details → `references/index-schema.md`.
25
+
26
+ Do not bootstrap or scan the whole repository for a narrow single-spec task.
27
+ Do not load all specs when the wiki can narrow retrieval.
28
+
29
+ ## Invariants
30
+
31
+ - Never invent spec behavior; separate code/tests/docs evidence from inference.
32
+ - Distinguish current (`as-is`) from intended (`change`) behavior.
33
+ - Never treat generated indexes, overviews, catalogs, or TOCs as primary specs.
34
+ - Keep document lifecycle separate from spec type: active/proposed/historical/
35
+ superseded is not the same question as as-is/change.
36
+ - Never infer semantic correctness from hashes alone. Changed inputs require
37
+ verification, not automatic rewriting.
38
+ - After a material production-behavior change, run the post-change checkpoint in
39
+ `references/maintenance.md` before declaring the task complete.
40
+ - Do not force specs into a new layout or template.
41
+ - Do not change production code unless the user asked for implementation.
42
+
43
+ ## Bundled CLI
44
+
45
+ When wiki state is involved, use:
46
+
47
+ ```bash
48
+ python3 <SKILL_DIR>/scripts/spec_wiki.py --root <PROJECT_ROOT> <command>
49
+ ```
50
+
51
+ Commands: `discover`, `record`, `verify`, `relate`, `search`, `changes`, `impact`,
52
+ `remove`, `status`, `audit`, `affected`, `render`, `validate`.
53
+
54
+ The CLI owns deterministic discovery, relationships, hashes, state, and
55
+ rendering. The agent owns semantic classification and verification.
@@ -0,0 +1,132 @@
1
+ {
2
+ "skill_name": "spec-wiki",
3
+ "evals": [
4
+ {
5
+ "id": 1,
6
+ "prompt": "We are going to change the session refresh contract in the supplied fixture: a transient token-load failure should be retried exactly once, while a second failure must still propagate. Before implementation, inspect the fixture code and tests and write a compact change spec named session-refresh-spec.md in the run output directory. Do not modify production code and do not bootstrap a repository-wide spec wiki for this narrow task.",
7
+ "expected_output": "A focused Change spec grounded in the fixture's current code/tests, with intended retry behavior, edge cases, verification, evidence/unknowns, and no production-code or wiki-state mutation.",
8
+ "files": [
9
+ "evals/files/focused/src/session.ts",
10
+ "evals/files/focused/tests/session.test.ts"
11
+ ],
12
+ "expectations": [
13
+ "The output contains a spec explicitly identified as Change/intended behavior.",
14
+ "The spec states that current fixture behavior performs one token-load attempt with no retry.",
15
+ "The intended behavior retries a transient token-load failure exactly once and propagates a second failure.",
16
+ "The spec contains a concrete verification path covering success, retry-success, and retry-failure behavior.",
17
+ "The spec explicitly distinguishes confirmed code/test evidence from inference or unknowns instead of presenting every claim at the same confidence level.",
18
+ "The run does not modify fixture production code and does not create .spec-wiki state for this narrow task.",
19
+ "The with-skill run reads focused-spec.md and does not read bootstrap.md, maintenance.md, query.md, or index-schema.md unless the task actually expands to need them."
20
+ ]
21
+ },
22
+ {
23
+ "id": 2,
24
+ "prompt": "In the supplied fixture, answer this narrowly from the project's primary specifications: what are the cancellation semantics for background jobs, and which primary spec defines them? There is also an overview and a retry document nearby. Do not build a wiki and do not treat an overview/index summary as primary evidence. Include source paths in the answer.",
25
+ "expected_output": "A concise answer grounded in the cancellation primary spec, distinguishing it from the overview and unrelated retry spec, without creating wiki state.",
26
+ "files": [
27
+ "evals/files/query/docs/spec-overview.md",
28
+ "evals/files/query/features/jobs/cancellation-contract.md",
29
+ "evals/files/query/features/jobs/retry-spec.md",
30
+ "evals/files/query/docs/how-to-run-jobs.md"
31
+ ],
32
+ "expectations": [
33
+ "The answer identifies features/jobs/cancellation-contract.md as the primary source.",
34
+ "The answer states that cancellation is idempotent, running jobs become cancelled, and already terminal jobs remain terminal.",
35
+ "The overview is not cited as primary evidence for the behavior claim.",
36
+ "The run does not create .spec-wiki state or perform repository-wide bootstrap.",
37
+ "The with-skill run reads query.md and does not read bootstrap.md or maintenance.md unless the task actually expands to need them."
38
+ ]
39
+ },
40
+ {
41
+ "id": 3,
42
+ "prompt": "Bootstrap a Spec Wiki for the supplied standalone fixture. Its specification knowledge is intentionally scattered across different folders and formats, and docs/overview.md is only a hand-written catalog. Build the wiki under the fixture root, classify the useful documents, exclude the catalog and user guide from primary specs, and report what was indexed. Do not edit any primary source document.",
43
+ "expected_output": "A schema-v2 .spec-wiki index/state containing the payment requirements and RFC as primary spec knowledge, with lifecycle recorded, overview classified as meta-index, guide excluded from primary specs, and bootstrap entries left unverified until a separate semantic code/test review; primary sources remain unchanged.",
44
+ "files": [
45
+ "evals/files/bootstrap/requirements/payment-behavior.md",
46
+ "evals/files/bootstrap/architecture/rfc-007.md",
47
+ "evals/files/bootstrap/docs/overview.md",
48
+ "evals/files/bootstrap/docs/how-to-pay.md",
49
+ "evals/files/bootstrap/src/payments.ts",
50
+ "evals/files/bootstrap/tests/payments.test.ts"
51
+ ],
52
+ "expectations": [
53
+ "The generated wiki indexes requirements/payment-behavior.md as primary spec knowledge.",
54
+ "The generated wiki indexes architecture/rfc-007.md as primary spec knowledge despite the different directory/convention.",
55
+ "docs/overview.md is classified as meta-index or otherwise excluded from primary specs.",
56
+ "docs/how-to-pay.md is classified as guide/other or otherwise excluded from primary specs.",
57
+ "Production source and test files are treated as evidence/relationships, not as primary specification documents themselves.",
58
+ "Bootstrap classification does not create a semantic verification baseline: newly indexed primary specs are unverified rather than fresh.",
59
+ "Primary entries record lifecycle separately from as-is/change type, so current requirements and an intended RFC are not forced into the same precedence state.",
60
+ "The generated state uses schemaVersion 2 and the generated index is a compact routing projection rather than the primary source of detailed claims.",
61
+ "The generated index is derived navigation and primary source documents are not modified.",
62
+ "The with-skill run reads bootstrap.md; it reads index-schema.md only if exact CLI/state details are needed and does not read focused-spec.md/query.md/maintenance.md without a concrete need."
63
+ ]
64
+ },
65
+ {
66
+ "id": 4,
67
+ "prompt": "Maintenance scenario: initialize the supplied fixture as a Git repo and commit only docs/session-refresh.md and src/session.ts as the baseline; keep incoming/refresh-worker.ts outside that baseline. Build the minimal Spec Wiki entry for the existing active as-is session refresh contract and semantically verify it. Then move incoming/refresh-worker.ts to src/refresh-worker.ts as the only post-baseline production change. Run the required post-change maintenance checkpoint. The new worker implements the same background refresh retry contract but is not yet in the spec's tracked relations. Do not change behavioral claims unless evidence shows drift. Finish with a valid rendered wiki and report the impact/repair steps.",
68
+ "expected_output": "The maintenance workflow notices that the new worker has no known relation, semantically associates it with the existing session refresh spec despite an initially empty direct affected result for that path, repairs the durable relation, verifies the unchanged contract against both implementation surfaces, and ends fresh.",
69
+ "files": [
70
+ "evals/files/maintenance/new-relation/docs/session-refresh.md",
71
+ "evals/files/maintenance/new-relation/src/session.ts",
72
+ "evals/files/maintenance/new-relation/incoming/refresh-worker.ts"
73
+ ],
74
+ "expectations": [
75
+ "The post-change workflow runs impact or equivalent task-scoped coverage analysis and treats src/refresh-worker.ts as an uncovered changed path before relation repair.",
76
+ "The workflow performs semantic spec retrieval/inspection even though the new path has no pre-existing affected relation.",
77
+ "The final primary entry for docs/session-refresh.md tracks src/refresh-worker.ts as a durable implementation relation.",
78
+ "The behavioral retry contract is not rewritten merely because a new implementation file appeared; it remains exactly-once retry with second failure propagation.",
79
+ "After relation repair the old verification baseline is not trusted until verify is run again.",
80
+ "Final status reports the current session refresh spec fresh with no unresolved relation drift."
81
+ ]
82
+ },
83
+ {
84
+ "id": 5,
85
+ "prompt": "Maintenance scenario: initialize the supplied fixture as Git, commit docs/old-job-contract.md and src/job.ts, record that document as an active as-is primary spec, and verify it. Then perform `git mv docs/old-job-contract.md contracts/job-cancellation.md` without changing its behavior. Run Spec Wiki maintenance for the move. Preserve the contract's lifecycle/type/summary/implementation relation, and do not leave duplicate current entries.",
86
+ "expected_output": "The move is recognized as an old missing tracked source plus a new document candidate; the new path is recorded and verified before the old metadata is removed, leaving one fresh active primary spec at the new path.",
87
+ "files": [
88
+ "evals/files/maintenance/move/docs/old-job-contract.md",
89
+ "evals/files/maintenance/move/src/job.ts"
90
+ ],
91
+ "expectations": [
92
+ "Impact/change inspection recognizes the old tracked primary path as missing/moved and the new path as a document requiring classification.",
93
+ "contracts/job-cancellation.md becomes the active as-is primary entry with the src/job.ts relation preserved.",
94
+ "The new path is verified before or as part of completing the move workflow.",
95
+ "docs/old-job-contract.md metadata is removed only after the new source has been recorded.",
96
+ "Final state contains no duplicate current primary entry for the old path and validates cleanly."
97
+ ]
98
+ },
99
+ {
100
+ "id": 6,
101
+ "prompt": "Maintenance scenario: initialize Git and commit only src/capture.ts as the baseline. Keep incoming/capture.txt outside the baseline, then move it to notes/capture.txt as a new document in the current task. Run the Spec Wiki post-change maintenance checkpoint. The text file intentionally has a neutral filename, no headings, and no path hints; only its contents state the current idempotency contract. Do not discard it because of a zero/below-threshold heuristic score. Inspect implementation evidence to determine the durable relation.",
102
+ "expected_output": "The changed-document path is inspected regardless of score, semantically classified as a current primary spec, related to src/capture.ts, verified, rendered, and validated.",
103
+ "files": [
104
+ "evals/files/maintenance/low-signal/src/capture.ts",
105
+ "evals/files/maintenance/low-signal/incoming/capture.txt"
106
+ ],
107
+ "expectations": [
108
+ "The new notes/capture.txt is surfaced for classification even though its discovery score is zero or below the normal threshold.",
109
+ "The document is classified from its contents rather than its location/name and becomes an as-is active primary spec.",
110
+ "The primary entry tracks src/capture.ts and has a non-empty semantic summary/topic metadata.",
111
+ "The entry is verified only after inspecting the implementation evidence, then the wiki renders/validates cleanly."
112
+ ]
113
+ },
114
+ {
115
+ "id": 7,
116
+ "prompt": "Negative maintenance control: initialize Git and commit docs/auth-contract.md plus src/auth.ts. Record/verify the active auth spec. Then move incoming/telemetry-format.ts to src/telemetry-format.ts as the only new production file. Run the post-change checkpoint. The telemetry formatting helper is unrelated to authentication. Perform the mandatory uncovered-path semantic sweep, but do not invent a spec relation or modify the auth contract just to make coverage non-empty.",
117
+ "expected_output": "The new telemetry path is reported as uncovered, the semantic sweep explicitly concludes it does not affect the auth contract, no false relation/spec edit is introduced, and the existing auth spec remains valid/fresh.",
118
+ "files": [
119
+ "evals/files/maintenance/no-impact/docs/auth-contract.md",
120
+ "evals/files/maintenance/no-impact/src/auth.ts",
121
+ "evals/files/maintenance/no-impact/incoming/telemetry-format.ts"
122
+ ],
123
+ "expectations": [
124
+ "The workflow does not stop at an empty affected result; it semantically inspects the uncovered telemetry path.",
125
+ "No inferred relation from docs/auth-contract.md to src/telemetry-format.ts is added.",
126
+ "The auth spec's behavioral claims are not modified.",
127
+ "The final report records a semantic no-impact decision rather than pretending every changed path must belong to a spec.",
128
+ "The existing auth spec remains fresh and state validates cleanly."
129
+ ]
130
+ }
131
+ ]
132
+ }
@@ -0,0 +1,14 @@
1
+ # RFC 007 — Payment timeout contract
2
+
3
+ ## Goal
4
+
5
+ Define the intended timeout contract for payment capture.
6
+
7
+ ## Behavior
8
+
9
+ Capture requests should time out after 10 seconds and return a retryable timeout
10
+ error without claiming that the payment failed at the provider.
11
+
12
+ ## Non-goals
13
+
14
+ This document does not define provider reconciliation.
@@ -0,0 +1,4 @@
1
+ # How to run a payment test
2
+
3
+ Run the development server, open the sandbox checkout page, enter the test card,
4
+ and inspect the local logs. This page is an operator/developer guide.
@@ -0,0 +1,9 @@
1
+ # Payment docs index
2
+
3
+ This catalog links the current payment documents:
4
+
5
+ - [Requirements](../requirements/payment-behavior.md)
6
+ - [Timeout RFC](../architecture/rfc-007.md)
7
+ - [How-to](./how-to-pay.md)
8
+
9
+ Use the linked primary documents for actual behavior.
@@ -0,0 +1,17 @@
1
+ # Payment capture requirements
2
+
3
+ ## Behavior
4
+
5
+ - A capture request with the same idempotency key must not charge twice.
6
+ - A successful capture returns the existing capture result when the same key is
7
+ replayed.
8
+ - A different amount with a reused idempotency key is rejected.
9
+
10
+ ## Related files
11
+
12
+ - `src/payments.ts`
13
+ - `tests/payments.test.ts`
14
+
15
+ ## Verification
16
+
17
+ Cover first capture, exact replay, and conflicting replay.
@@ -0,0 +1,12 @@
1
+ const captures = new Map<string, { amount: number; id: string }>();
2
+
3
+ export function capture(key: string, amount: number): { amount: number; id: string } {
4
+ const existing = captures.get(key);
5
+ if (existing) {
6
+ if (existing.amount !== amount) throw new Error("idempotency conflict");
7
+ return existing;
8
+ }
9
+ const result = { amount, id: `capture-${captures.size + 1}` };
10
+ captures.set(key, result);
11
+ return result;
12
+ }
@@ -0,0 +1,11 @@
1
+ // @ts-nocheck
2
+ import assert from "node:assert/strict";
3
+ import { test } from "node:test";
4
+
5
+ import { capture } from "../src/payments.js";
6
+
7
+ test("idempotent replay returns the same capture", () => {
8
+ const first = capture("key-1", 100);
9
+ assert.deepEqual(capture("key-1", 100), first);
10
+ assert.throws(() => capture("key-1", 200), /idempotency conflict/);
11
+ });
@@ -0,0 +1,5 @@
1
+ export type TokenLoader = () => Promise<string>;
2
+
3
+ export async function refreshSession(loadToken: TokenLoader): Promise<string> {
4
+ return loadToken();
5
+ }
@@ -0,0 +1,17 @@
1
+ // @ts-nocheck
2
+ import assert from "node:assert/strict";
3
+ import { test } from "node:test";
4
+
5
+ import { refreshSession } from "../src/session.js";
6
+
7
+ test("refreshSession performs one token-load attempt", async () => {
8
+ let attempts = 0;
9
+ await assert.rejects(
10
+ refreshSession(async () => {
11
+ attempts += 1;
12
+ throw new Error("transient");
13
+ }),
14
+ /transient/,
15
+ );
16
+ assert.equal(attempts, 1);
17
+ });
@@ -0,0 +1,2 @@
1
+ Duplicate capture requests with the same idempotency key return the original result.
2
+ This rule describes current production behavior for capture requests.
@@ -0,0 +1,3 @@
1
+ export function capture(idempotencyKey: string, previous?: string): string {
2
+ return previous ?? `capture:${idempotencyKey}`;
3
+ }
@@ -0,0 +1,18 @@
1
+ # Background job cancellation contract
2
+
3
+ ## Type
4
+
5
+ As-is
6
+
7
+ ## Lifecycle
8
+
9
+ Active
10
+
11
+ ## Behavior
12
+
13
+ Cancelling a running job is idempotent. Running jobs become cancelled; already
14
+ terminal jobs remain terminal.
15
+
16
+ ## Related files
17
+
18
+ - `src/job.ts`
@@ -0,0 +1,5 @@
1
+ export type JobState = "running" | "done" | "failed" | "cancelled";
2
+
3
+ export function cancelJob(state: JobState): JobState {
4
+ return state === "running" ? "cancelled" : state;
5
+ }
@@ -0,0 +1,24 @@
1
+ # Session refresh contract
2
+
3
+ ## Type
4
+
5
+ As-is
6
+
7
+ ## Lifecycle
8
+
9
+ Active
10
+
11
+ ## Behavior
12
+
13
+ Interactive and background session refresh retry a transient token-acquisition
14
+ failure exactly once. A second token-acquisition failure propagates to the
15
+ caller. Successful acquisition is not retried.
16
+
17
+ ## Related files
18
+
19
+ - `src/session.ts`
20
+
21
+ ## Verification
22
+
23
+ - Interactive refresh covers success, retry-success, and second-failure paths.
24
+ - Every additional refresh entrypoint must preserve the same retry contract.
@@ -0,0 +1,7 @@
1
+ export async function refreshInBackground(loadToken: () => Promise<string>): Promise<string> {
2
+ try {
3
+ return await loadToken();
4
+ } catch {
5
+ return await loadToken();
6
+ }
7
+ }
@@ -0,0 +1,7 @@
1
+ export async function refreshSession(loadToken: () => Promise<string>): Promise<string> {
2
+ try {
3
+ return await loadToken();
4
+ } catch {
5
+ return await loadToken();
6
+ }
7
+ }
@@ -0,0 +1,17 @@
1
+ # Authentication contract
2
+
3
+ ## Type
4
+
5
+ As-is
6
+
7
+ ## Lifecycle
8
+
9
+ Active
10
+
11
+ ## Behavior
12
+
13
+ Authentication accepts a valid token and rejects an empty token.
14
+
15
+ ## Related files
16
+
17
+ - `src/auth.ts`
@@ -0,0 +1,3 @@
1
+ export function formatTelemetryName(name: string): string {
2
+ return name.trim().toLowerCase();
3
+ }
@@ -0,0 +1,3 @@
1
+ export function authenticate(token: string): boolean {
2
+ return token.length > 0;
3
+ }
@@ -0,0 +1,4 @@
1
+ # How to run jobs locally
2
+
3
+ Start the worker, enqueue a sample job, and tail the development log. This is a
4
+ usage guide and does not define cancellation semantics.
@@ -0,0 +1,9 @@
1
+ # Job specifications overview
2
+
3
+ The primary job behavior documents are linked below.
4
+
5
+ - [Cancellation contract](../features/jobs/cancellation-contract.md) — jobs can
6
+ be stopped safely.
7
+ - [Retry spec](../features/jobs/retry-spec.md) — retry timing and limits.
8
+
9
+ This page is a catalog, not a behavioral source of truth.
@@ -0,0 +1,15 @@
1
+ # Background job cancellation contract
2
+
3
+ ## Behavior
4
+
5
+ - Cancellation requests are idempotent.
6
+ - A running job transitions to `cancelled` when cancellation is accepted.
7
+ - Jobs already in `completed`, `failed`, or `cancelled` remain in that terminal
8
+ state when cancellation is requested again.
9
+ - Cancellation does not imply that already-committed external side effects are
10
+ rolled back.
11
+
12
+ ## Verification
13
+
14
+ Tests should cover repeated cancellation, running-to-cancelled transition, and
15
+ all terminal states.
@@ -0,0 +1,6 @@
1
+ # Background job retry behavior
2
+
3
+ ## Behavior
4
+
5
+ Failed jobs retry at most three times with exponential backoff. Cancellation is
6
+ outside this document's scope.