citenexus 0.2.0__tar.gz

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 (400) hide show
  1. citenexus-0.2.0/.claude/commands/opsx/apply.md +155 -0
  2. citenexus-0.2.0/.claude/commands/opsx/archive.md +160 -0
  3. citenexus-0.2.0/.claude/commands/opsx/explore.md +172 -0
  4. citenexus-0.2.0/.claude/commands/opsx/propose.md +107 -0
  5. citenexus-0.2.0/.claude/commands/opsx/sync.md +143 -0
  6. citenexus-0.2.0/.claude/skills/openspec-apply-change/SKILL.md +159 -0
  7. citenexus-0.2.0/.claude/skills/openspec-archive-change/SKILL.md +117 -0
  8. citenexus-0.2.0/.claude/skills/openspec-explore/SKILL.md +287 -0
  9. citenexus-0.2.0/.claude/skills/openspec-propose/SKILL.md +111 -0
  10. citenexus-0.2.0/.claude/skills/openspec-sync-specs/SKILL.md +147 -0
  11. citenexus-0.2.0/.env.example +52 -0
  12. citenexus-0.2.0/.github/workflows/ci.yml +42 -0
  13. citenexus-0.2.0/.github/workflows/release.yml +37 -0
  14. citenexus-0.2.0/.gitignore +47 -0
  15. citenexus-0.2.0/.python-version +1 -0
  16. citenexus-0.2.0/.vsync +3 -0
  17. citenexus-0.2.0/CHANGELOG.md +71 -0
  18. citenexus-0.2.0/CLAUDE.md +138 -0
  19. citenexus-0.2.0/INPROGRESS.md +224 -0
  20. citenexus-0.2.0/PKG-INFO +183 -0
  21. citenexus-0.2.0/README.md +159 -0
  22. citenexus-0.2.0/Taskfile.local.yml +91 -0
  23. citenexus-0.2.0/Taskfile.yml +81 -0
  24. citenexus-0.2.0/compose.yaml +85 -0
  25. citenexus-0.2.0/conformance/README.md +41 -0
  26. citenexus-0.2.0/conformance/cases/bm25.json +109 -0
  27. citenexus-0.2.0/conformance/cases/chunker.json +68 -0
  28. citenexus-0.2.0/conformance/cases/eu_ids.json +80 -0
  29. citenexus-0.2.0/conformance/cases/faithful.json +66 -0
  30. citenexus-0.2.0/conformance/cases/language.json +85 -0
  31. citenexus-0.2.0/conformance/cases/rrf.json +95 -0
  32. citenexus-0.2.0/conformance/cases/tokenize.json +98 -0
  33. citenexus-0.2.0/conformance/prompts.json +8 -0
  34. citenexus-0.2.0/conformance/stopwords.json +46 -0
  35. citenexus-0.2.0/core/Cargo.lock +6169 -0
  36. citenexus-0.2.0/core/Cargo.toml +50 -0
  37. citenexus-0.2.0/core/README.md +59 -0
  38. citenexus-0.2.0/core/src/detect.rs +84 -0
  39. citenexus-0.2.0/core/src/extract/csv.rs +50 -0
  40. citenexus-0.2.0/core/src/extract/html.rs +97 -0
  41. citenexus-0.2.0/core/src/extract/md.rs +106 -0
  42. citenexus-0.2.0/core/src/extract/mod.rs +59 -0
  43. citenexus-0.2.0/core/src/extract/ooxml.rs +344 -0
  44. citenexus-0.2.0/core/src/extract/pdf.rs +76 -0
  45. citenexus-0.2.0/core/src/extract/txt.rs +48 -0
  46. citenexus-0.2.0/core/src/ffi.rs +301 -0
  47. citenexus-0.2.0/core/src/lib.rs +19 -0
  48. citenexus-0.2.0/core/src/store.rs +376 -0
  49. citenexus-0.2.0/core/src/types.rs +113 -0
  50. citenexus-0.2.0/core/tests/detect_test.rs +69 -0
  51. citenexus-0.2.0/core/tests/extract_test.rs +205 -0
  52. citenexus-0.2.0/core/tests/ffi_store_test.rs +95 -0
  53. citenexus-0.2.0/core/tests/store_test.rs +158 -0
  54. citenexus-0.2.0/docs/SPEC-PORTS-v1.md +296 -0
  55. citenexus-0.2.0/docs/SPEC-v6.md +59 -0
  56. citenexus-0.2.0/docs/SPIKE-ports-libs.md +131 -0
  57. citenexus-0.2.0/docs/adr/0001-stack-and-spec-system.md +35 -0
  58. citenexus-0.2.0/docs/adr/0002-foundation-first-ordering.md +30 -0
  59. citenexus-0.2.0/docs/adr/0003-pypi-dist-name.md +50 -0
  60. citenexus-0.2.0/example/.env.example +21 -0
  61. citenexus-0.2.0/example/corpus/nda-en.txt +8 -0
  62. citenexus-0.2.0/example/corpus/policy-de.txt +5 -0
  63. citenexus-0.2.0/example/corpus/refund-fr.txt +5 -0
  64. citenexus-0.2.0/example/golden.csv +6 -0
  65. citenexus-0.2.0/example/run.py +132 -0
  66. citenexus-0.2.0/openspec/changes/archive/2026-06-26-access-prefilter/.openspec.yaml +2 -0
  67. citenexus-0.2.0/openspec/changes/archive/2026-06-26-access-prefilter/design.md +72 -0
  68. citenexus-0.2.0/openspec/changes/archive/2026-06-26-access-prefilter/proposal.md +41 -0
  69. citenexus-0.2.0/openspec/changes/archive/2026-06-26-access-prefilter/specs/access-prefilter/spec.md +74 -0
  70. citenexus-0.2.0/openspec/changes/archive/2026-06-26-access-prefilter/tasks.md +22 -0
  71. citenexus-0.2.0/openspec/changes/archive/2026-06-26-conditional-vision/.openspec.yaml +2 -0
  72. citenexus-0.2.0/openspec/changes/archive/2026-06-26-conditional-vision/proposal.md +46 -0
  73. citenexus-0.2.0/openspec/changes/archive/2026-06-26-conditional-vision/specs/conditional-vision/spec.md +73 -0
  74. citenexus-0.2.0/openspec/changes/archive/2026-06-26-conditional-vision/tasks.md +32 -0
  75. citenexus-0.2.0/openspec/changes/archive/2026-06-26-config-and-signals/.openspec.yaml +2 -0
  76. citenexus-0.2.0/openspec/changes/archive/2026-06-26-config-and-signals/design.md +52 -0
  77. citenexus-0.2.0/openspec/changes/archive/2026-06-26-config-and-signals/proposal.md +46 -0
  78. citenexus-0.2.0/openspec/changes/archive/2026-06-26-config-and-signals/specs/config-and-signals/spec.md +108 -0
  79. citenexus-0.2.0/openspec/changes/archive/2026-06-26-config-and-signals/tasks.md +27 -0
  80. citenexus-0.2.0/openspec/changes/archive/2026-06-26-core-domain-types/.openspec.yaml +2 -0
  81. citenexus-0.2.0/openspec/changes/archive/2026-06-26-core-domain-types/design.md +66 -0
  82. citenexus-0.2.0/openspec/changes/archive/2026-06-26-core-domain-types/proposal.md +46 -0
  83. citenexus-0.2.0/openspec/changes/archive/2026-06-26-core-domain-types/specs/core-domain-types/spec.md +201 -0
  84. citenexus-0.2.0/openspec/changes/archive/2026-06-26-core-domain-types/tasks.md +36 -0
  85. citenexus-0.2.0/openspec/changes/archive/2026-06-26-embedding-openai/.openspec.yaml +2 -0
  86. citenexus-0.2.0/openspec/changes/archive/2026-06-26-embedding-openai/design.md +86 -0
  87. citenexus-0.2.0/openspec/changes/archive/2026-06-26-embedding-openai/proposal.md +42 -0
  88. citenexus-0.2.0/openspec/changes/archive/2026-06-26-embedding-openai/specs/embedding-openai/spec.md +80 -0
  89. citenexus-0.2.0/openspec/changes/archive/2026-06-26-embedding-openai/tasks.md +33 -0
  90. citenexus-0.2.0/openspec/changes/archive/2026-06-26-evidence-builder/.openspec.yaml +2 -0
  91. citenexus-0.2.0/openspec/changes/archive/2026-06-26-evidence-builder/design.md +63 -0
  92. citenexus-0.2.0/openspec/changes/archive/2026-06-26-evidence-builder/proposal.md +42 -0
  93. citenexus-0.2.0/openspec/changes/archive/2026-06-26-evidence-builder/specs/evidence-builder/spec.md +68 -0
  94. citenexus-0.2.0/openspec/changes/archive/2026-06-26-evidence-builder/tasks.md +21 -0
  95. citenexus-0.2.0/openspec/changes/archive/2026-06-26-extractors/.openspec.yaml +2 -0
  96. citenexus-0.2.0/openspec/changes/archive/2026-06-26-extractors/proposal.md +56 -0
  97. citenexus-0.2.0/openspec/changes/archive/2026-06-26-extractors/specs/extractors/spec.md +181 -0
  98. citenexus-0.2.0/openspec/changes/archive/2026-06-26-extractors/tasks.md +53 -0
  99. citenexus-0.2.0/openspec/changes/archive/2026-06-26-ingest-pipeline/.openspec.yaml +2 -0
  100. citenexus-0.2.0/openspec/changes/archive/2026-06-26-ingest-pipeline/proposal.md +33 -0
  101. citenexus-0.2.0/openspec/changes/archive/2026-06-26-ingest-pipeline/specs/ingest-pipeline/spec.md +64 -0
  102. citenexus-0.2.0/openspec/changes/archive/2026-06-26-ingest-pipeline/tasks.md +16 -0
  103. citenexus-0.2.0/openspec/changes/archive/2026-06-26-language-detect/.openspec.yaml +2 -0
  104. citenexus-0.2.0/openspec/changes/archive/2026-06-26-language-detect/design.md +76 -0
  105. citenexus-0.2.0/openspec/changes/archive/2026-06-26-language-detect/proposal.md +50 -0
  106. citenexus-0.2.0/openspec/changes/archive/2026-06-26-language-detect/specs/language-detect/spec.md +132 -0
  107. citenexus-0.2.0/openspec/changes/archive/2026-06-26-language-detect/tasks.md +29 -0
  108. citenexus-0.2.0/openspec/changes/archive/2026-06-26-plugin-protocol-registry/.openspec.yaml +2 -0
  109. citenexus-0.2.0/openspec/changes/archive/2026-06-26-plugin-protocol-registry/design.md +72 -0
  110. citenexus-0.2.0/openspec/changes/archive/2026-06-26-plugin-protocol-registry/proposal.md +51 -0
  111. citenexus-0.2.0/openspec/changes/archive/2026-06-26-plugin-protocol-registry/specs/plugin-protocol-registry/spec.md +126 -0
  112. citenexus-0.2.0/openspec/changes/archive/2026-06-26-plugin-protocol-registry/tasks.md +35 -0
  113. citenexus-0.2.0/openspec/changes/archive/2026-06-26-provenance-and-rebuild/.openspec.yaml +2 -0
  114. citenexus-0.2.0/openspec/changes/archive/2026-06-26-provenance-and-rebuild/design.md +56 -0
  115. citenexus-0.2.0/openspec/changes/archive/2026-06-26-provenance-and-rebuild/proposal.md +49 -0
  116. citenexus-0.2.0/openspec/changes/archive/2026-06-26-provenance-and-rebuild/specs/provenance-and-rebuild/spec.md +105 -0
  117. citenexus-0.2.0/openspec/changes/archive/2026-06-26-provenance-and-rebuild/tasks.md +35 -0
  118. citenexus-0.2.0/openspec/changes/archive/2026-06-26-retrieve-engine/.openspec.yaml +2 -0
  119. citenexus-0.2.0/openspec/changes/archive/2026-06-26-retrieve-engine/design.md +84 -0
  120. citenexus-0.2.0/openspec/changes/archive/2026-06-26-retrieve-engine/proposal.md +54 -0
  121. citenexus-0.2.0/openspec/changes/archive/2026-06-26-retrieve-engine/specs/retrieve-engine/spec.md +125 -0
  122. citenexus-0.2.0/openspec/changes/archive/2026-06-26-retrieve-engine/tasks.md +38 -0
  123. citenexus-0.2.0/openspec/changes/archive/2026-06-26-smoke-e2e/.openspec.yaml +2 -0
  124. citenexus-0.2.0/openspec/changes/archive/2026-06-26-smoke-e2e/proposal.md +28 -0
  125. citenexus-0.2.0/openspec/changes/archive/2026-06-26-smoke-e2e/specs/smoke-e2e/spec.md +48 -0
  126. citenexus-0.2.0/openspec/changes/archive/2026-06-26-smoke-e2e/tasks.md +17 -0
  127. citenexus-0.2.0/openspec/changes/archive/2026-06-26-storage-partition-seam/.openspec.yaml +2 -0
  128. citenexus-0.2.0/openspec/changes/archive/2026-06-26-storage-partition-seam/proposal.md +33 -0
  129. citenexus-0.2.0/openspec/changes/archive/2026-06-26-storage-partition-seam/specs/storage-partition-seam/spec.md +77 -0
  130. citenexus-0.2.0/openspec/changes/archive/2026-06-26-storage-partition-seam/tasks.md +37 -0
  131. citenexus-0.2.0/openspec/changes/archive/2026-06-26-structure-index/.openspec.yaml +2 -0
  132. citenexus-0.2.0/openspec/changes/archive/2026-06-26-structure-index/design.md +68 -0
  133. citenexus-0.2.0/openspec/changes/archive/2026-06-26-structure-index/proposal.md +42 -0
  134. citenexus-0.2.0/openspec/changes/archive/2026-06-26-structure-index/specs/structure-index/spec.md +58 -0
  135. citenexus-0.2.0/openspec/changes/archive/2026-06-26-structure-index/tasks.md +21 -0
  136. citenexus-0.2.0/openspec/changes/archive/2026-06-26-telemetry-cost/.openspec.yaml +2 -0
  137. citenexus-0.2.0/openspec/changes/archive/2026-06-26-telemetry-cost/proposal.md +49 -0
  138. citenexus-0.2.0/openspec/changes/archive/2026-06-26-telemetry-cost/specs/telemetry-cost/spec.md +120 -0
  139. citenexus-0.2.0/openspec/changes/archive/2026-06-26-telemetry-cost/tasks.md +38 -0
  140. citenexus-0.2.0/openspec/changes/archive/2026-06-26-worker-queue-resume/.openspec.yaml +2 -0
  141. citenexus-0.2.0/openspec/changes/archive/2026-06-26-worker-queue-resume/proposal.md +48 -0
  142. citenexus-0.2.0/openspec/changes/archive/2026-06-26-worker-queue-resume/specs/worker-queue-resume/spec.md +116 -0
  143. citenexus-0.2.0/openspec/changes/archive/2026-06-26-worker-queue-resume/tasks.md +42 -0
  144. citenexus-0.2.0/openspec/changes/archive/2026-06-30-l5-answer-verify-evaluate/.openspec.yaml +2 -0
  145. citenexus-0.2.0/openspec/changes/archive/2026-06-30-l5-answer-verify-evaluate/proposal.md +8 -0
  146. citenexus-0.2.0/openspec/changes/archive/2026-06-30-l5-answer-verify-evaluate/tasks.md +8 -0
  147. citenexus-0.2.0/openspec/changes/archive/2026-06-30-l6-graph-wiki-stream-memory/.openspec.yaml +2 -0
  148. citenexus-0.2.0/openspec/changes/archive/2026-06-30-l6-graph-wiki-stream-memory/proposal.md +12 -0
  149. citenexus-0.2.0/openspec/changes/archive/2026-06-30-l6-graph-wiki-stream-memory/tasks.md +10 -0
  150. citenexus-0.2.0/openspec/specs/access-prefilter/spec.md +78 -0
  151. citenexus-0.2.0/openspec/specs/answer-flow-strict/spec.md +42 -0
  152. citenexus-0.2.0/openspec/specs/conditional-vision/spec.md +77 -0
  153. citenexus-0.2.0/openspec/specs/config-and-signals/spec.md +112 -0
  154. citenexus-0.2.0/openspec/specs/conversation-memory/spec.md +20 -0
  155. citenexus-0.2.0/openspec/specs/core-domain-types/spec.md +205 -0
  156. citenexus-0.2.0/openspec/specs/embedding-openai/spec.md +84 -0
  157. citenexus-0.2.0/openspec/specs/evidence-builder/spec.md +72 -0
  158. citenexus-0.2.0/openspec/specs/extractors/spec.md +185 -0
  159. citenexus-0.2.0/openspec/specs/graph-retriever/spec.md +31 -0
  160. citenexus-0.2.0/openspec/specs/ingest-pipeline/spec.md +68 -0
  161. citenexus-0.2.0/openspec/specs/language-detect/spec.md +136 -0
  162. citenexus-0.2.0/openspec/specs/plugin-protocol-registry/spec.md +130 -0
  163. citenexus-0.2.0/openspec/specs/provenance-and-rebuild/spec.md +109 -0
  164. citenexus-0.2.0/openspec/specs/retrieve-engine/spec.md +129 -0
  165. citenexus-0.2.0/openspec/specs/smoke-e2e/spec.md +52 -0
  166. citenexus-0.2.0/openspec/specs/storage-partition-seam/spec.md +81 -0
  167. citenexus-0.2.0/openspec/specs/streaming-answer/spec.md +24 -0
  168. citenexus-0.2.0/openspec/specs/structure-index/spec.md +62 -0
  169. citenexus-0.2.0/openspec/specs/telemetry-cost/spec.md +124 -0
  170. citenexus-0.2.0/openspec/specs/wiki-navigation/spec.md +30 -0
  171. citenexus-0.2.0/openspec/specs/worker-queue-resume/spec.md +120 -0
  172. citenexus-0.2.0/pyproject.toml +88 -0
  173. citenexus-0.2.0/scripts/gen_conformance.py +468 -0
  174. citenexus-0.2.0/src/citenexus/__init__.py +35 -0
  175. citenexus-0.2.0/src/citenexus/access/__init__.py +22 -0
  176. citenexus-0.2.0/src/citenexus/access/prefilter.py +60 -0
  177. citenexus-0.2.0/src/citenexus/access/scope.py +48 -0
  178. citenexus-0.2.0/src/citenexus/answer/__init__.py +23 -0
  179. citenexus-0.2.0/src/citenexus/answer/anthropic.py +104 -0
  180. citenexus-0.2.0/src/citenexus/answer/flow.py +139 -0
  181. citenexus-0.2.0/src/citenexus/answer/generator.py +111 -0
  182. citenexus-0.2.0/src/citenexus/answer/result.py +102 -0
  183. citenexus-0.2.0/src/citenexus/answer/verify.py +77 -0
  184. citenexus-0.2.0/src/citenexus/client.py +633 -0
  185. citenexus-0.2.0/src/citenexus/config/__init__.py +67 -0
  186. citenexus-0.2.0/src/citenexus/config/loader.py +105 -0
  187. citenexus-0.2.0/src/citenexus/config/schema.py +313 -0
  188. citenexus-0.2.0/src/citenexus/config/signals.py +65 -0
  189. citenexus-0.2.0/src/citenexus/config/validate.py +73 -0
  190. citenexus-0.2.0/src/citenexus/domain/__init__.py +6 -0
  191. citenexus-0.2.0/src/citenexus/domain/partition.py +47 -0
  192. citenexus-0.2.0/src/citenexus/domain/trust.py +21 -0
  193. citenexus-0.2.0/src/citenexus/embed/__init__.py +12 -0
  194. citenexus-0.2.0/src/citenexus/embed/batcher.py +32 -0
  195. citenexus-0.2.0/src/citenexus/embed/client.py +64 -0
  196. citenexus-0.2.0/src/citenexus/evaluate.py +81 -0
  197. citenexus-0.2.0/src/citenexus/evidence/__init__.py +5 -0
  198. citenexus-0.2.0/src/citenexus/evidence/builder.py +76 -0
  199. citenexus-0.2.0/src/citenexus/evidence/chunked_builder.py +85 -0
  200. citenexus-0.2.0/src/citenexus/evidence/chunker.py +116 -0
  201. citenexus-0.2.0/src/citenexus/evidence/contextualize.py +75 -0
  202. citenexus-0.2.0/src/citenexus/evidence/structure.py +116 -0
  203. citenexus-0.2.0/src/citenexus/evidence/unit.py +79 -0
  204. citenexus-0.2.0/src/citenexus/extract/__init__.py +19 -0
  205. citenexus-0.2.0/src/citenexus/extract/csv.py +56 -0
  206. citenexus-0.2.0/src/citenexus/extract/dispatch.py +96 -0
  207. citenexus-0.2.0/src/citenexus/extract/docx.py +89 -0
  208. citenexus-0.2.0/src/citenexus/extract/html.py +82 -0
  209. citenexus-0.2.0/src/citenexus/extract/md.py +83 -0
  210. citenexus-0.2.0/src/citenexus/extract/pdf.py +82 -0
  211. citenexus-0.2.0/src/citenexus/extract/plain.py +92 -0
  212. citenexus-0.2.0/src/citenexus/extract/pptx.py +65 -0
  213. citenexus-0.2.0/src/citenexus/extract/txt.py +42 -0
  214. citenexus-0.2.0/src/citenexus/extract/types.py +98 -0
  215. citenexus-0.2.0/src/citenexus/graph/__init__.py +15 -0
  216. citenexus-0.2.0/src/citenexus/graph/distill.py +168 -0
  217. citenexus-0.2.0/src/citenexus/graph/retrieve.py +67 -0
  218. citenexus-0.2.0/src/citenexus/graph/store.py +135 -0
  219. citenexus-0.2.0/src/citenexus/hooks.py +52 -0
  220. citenexus-0.2.0/src/citenexus/http.py +173 -0
  221. citenexus-0.2.0/src/citenexus/ingest/__init__.py +6 -0
  222. citenexus-0.2.0/src/citenexus/ingest/pipeline.py +298 -0
  223. citenexus-0.2.0/src/citenexus/ingest/result.py +17 -0
  224. citenexus-0.2.0/src/citenexus/ingest/web.py +102 -0
  225. citenexus-0.2.0/src/citenexus/lang/__init__.py +18 -0
  226. citenexus-0.2.0/src/citenexus/lang/detect.py +227 -0
  227. citenexus-0.2.0/src/citenexus/lang/fallback.py +59 -0
  228. citenexus-0.2.0/src/citenexus/memory/__init__.py +5 -0
  229. citenexus-0.2.0/src/citenexus/memory/store.py +84 -0
  230. citenexus-0.2.0/src/citenexus/plugins/__init__.py +33 -0
  231. citenexus-0.2.0/src/citenexus/plugins/base.py +137 -0
  232. citenexus-0.2.0/src/citenexus/plugins/registry.py +112 -0
  233. citenexus-0.2.0/src/citenexus/provenance/__init__.py +24 -0
  234. citenexus-0.2.0/src/citenexus/provenance/rebuild_planner.py +103 -0
  235. citenexus-0.2.0/src/citenexus/provenance/stamp.py +84 -0
  236. citenexus-0.2.0/src/citenexus/retrieve/__init__.py +22 -0
  237. citenexus-0.2.0/src/citenexus/retrieve/engine.py +67 -0
  238. citenexus-0.2.0/src/citenexus/retrieve/fusion.py +42 -0
  239. citenexus-0.2.0/src/citenexus/retrieve/lexical.py +57 -0
  240. citenexus-0.2.0/src/citenexus/retrieve/reformulate.py +87 -0
  241. citenexus-0.2.0/src/citenexus/retrieve/rerank.py +63 -0
  242. citenexus-0.2.0/src/citenexus/retrieve/structure.py +130 -0
  243. citenexus-0.2.0/src/citenexus/retrieve/types.py +41 -0
  244. citenexus-0.2.0/src/citenexus/retrieve/vector.py +67 -0
  245. citenexus-0.2.0/src/citenexus/smoke/__init__.py +11 -0
  246. citenexus-0.2.0/src/citenexus/smoke/pipeline.py +200 -0
  247. citenexus-0.2.0/src/citenexus/storage/__init__.py +58 -0
  248. citenexus-0.2.0/src/citenexus/storage/backend.py +144 -0
  249. citenexus-0.2.0/src/citenexus/storage/bm25.py +75 -0
  250. citenexus-0.2.0/src/citenexus/storage/lance_store.py +98 -0
  251. citenexus-0.2.0/src/citenexus/storage/location.py +75 -0
  252. citenexus-0.2.0/src/citenexus/storage/manifest.py +73 -0
  253. citenexus-0.2.0/src/citenexus/storage/paths.py +39 -0
  254. citenexus-0.2.0/src/citenexus/storage/postgres_store.py +189 -0
  255. citenexus-0.2.0/src/citenexus/storage/protocols.py +52 -0
  256. citenexus-0.2.0/src/citenexus/stream/__init__.py +5 -0
  257. citenexus-0.2.0/src/citenexus/stream/answer.py +30 -0
  258. citenexus-0.2.0/src/citenexus/telemetry/__init__.py +61 -0
  259. citenexus-0.2.0/src/citenexus/telemetry/cost.py +104 -0
  260. citenexus-0.2.0/src/citenexus/telemetry/counters.py +71 -0
  261. citenexus-0.2.0/src/citenexus/telemetry/events.py +102 -0
  262. citenexus-0.2.0/src/citenexus/telemetry/sinks.py +41 -0
  263. citenexus-0.2.0/src/citenexus/testing/__init__.py +9 -0
  264. citenexus-0.2.0/src/citenexus/testing/fakes.py +53 -0
  265. citenexus-0.2.0/src/citenexus/tools.py +152 -0
  266. citenexus-0.2.0/src/citenexus/vision/__init__.py +21 -0
  267. citenexus-0.2.0/src/citenexus/vision/client.py +127 -0
  268. citenexus-0.2.0/src/citenexus/vision/describe.py +88 -0
  269. citenexus-0.2.0/src/citenexus/vision/prefilter.py +102 -0
  270. citenexus-0.2.0/src/citenexus/vision/units.py +66 -0
  271. citenexus-0.2.0/src/citenexus/wiki/__init__.py +15 -0
  272. citenexus-0.2.0/src/citenexus/wiki/distill.py +173 -0
  273. citenexus-0.2.0/src/citenexus/wiki/retrieve.py +89 -0
  274. citenexus-0.2.0/src/citenexus/wiki/store.py +299 -0
  275. citenexus-0.2.0/src/citenexus/worker/__init__.py +30 -0
  276. citenexus-0.2.0/src/citenexus/worker/dlq.py +27 -0
  277. citenexus-0.2.0/src/citenexus/worker/executor.py +74 -0
  278. citenexus-0.2.0/src/citenexus/worker/queue.py +222 -0
  279. citenexus-0.2.0/src/citenexus/worker/resume.py +27 -0
  280. citenexus-0.2.0/src/citenexus/worker/retry.py +44 -0
  281. citenexus-0.2.0/tests/__init__.py +0 -0
  282. citenexus-0.2.0/tests/access/__init__.py +0 -0
  283. citenexus-0.2.0/tests/access/test_prefilter.py +107 -0
  284. citenexus-0.2.0/tests/access/test_scope.py +53 -0
  285. citenexus-0.2.0/tests/answer/__init__.py +0 -0
  286. citenexus-0.2.0/tests/answer/test_anthropic_generator.py +99 -0
  287. citenexus-0.2.0/tests/answer/test_generator.py +147 -0
  288. citenexus-0.2.0/tests/answer/test_result.py +126 -0
  289. citenexus-0.2.0/tests/config/__init__.py +0 -0
  290. citenexus-0.2.0/tests/config/test_loader.py +107 -0
  291. citenexus-0.2.0/tests/config/test_schema.py +90 -0
  292. citenexus-0.2.0/tests/config/test_signals.py +55 -0
  293. citenexus-0.2.0/tests/config/test_validate.py +62 -0
  294. citenexus-0.2.0/tests/core/__init__.py +0 -0
  295. citenexus-0.2.0/tests/core/test_rust_parity.py +113 -0
  296. citenexus-0.2.0/tests/core/test_rust_store_parity.py +207 -0
  297. citenexus-0.2.0/tests/domain/__init__.py +0 -0
  298. citenexus-0.2.0/tests/domain/test_partition.py +41 -0
  299. citenexus-0.2.0/tests/domain/test_trust.py +7 -0
  300. citenexus-0.2.0/tests/e2e/__init__.py +0 -0
  301. citenexus-0.2.0/tests/e2e/test_smoke.py +119 -0
  302. citenexus-0.2.0/tests/embed/__init__.py +0 -0
  303. citenexus-0.2.0/tests/embed/test_batcher.py +51 -0
  304. citenexus-0.2.0/tests/embed/test_client.py +105 -0
  305. citenexus-0.2.0/tests/evidence/__init__.py +0 -0
  306. citenexus-0.2.0/tests/evidence/test_builder.py +155 -0
  307. citenexus-0.2.0/tests/evidence/test_chunked_builder.py +80 -0
  308. citenexus-0.2.0/tests/evidence/test_chunker.py +70 -0
  309. citenexus-0.2.0/tests/evidence/test_contextualize.py +75 -0
  310. citenexus-0.2.0/tests/evidence/test_structure.py +114 -0
  311. citenexus-0.2.0/tests/evidence/test_unit.py +130 -0
  312. citenexus-0.2.0/tests/extract/__init__.py +0 -0
  313. citenexus-0.2.0/tests/extract/conftest.py +52 -0
  314. citenexus-0.2.0/tests/extract/fixtures/__init__.py +0 -0
  315. citenexus-0.2.0/tests/extract/fixtures/sample.pdf +32 -0
  316. citenexus-0.2.0/tests/extract/test_csv.py +25 -0
  317. citenexus-0.2.0/tests/extract/test_dispatch.py +64 -0
  318. citenexus-0.2.0/tests/extract/test_docx.py +34 -0
  319. citenexus-0.2.0/tests/extract/test_html.py +44 -0
  320. citenexus-0.2.0/tests/extract/test_md.py +38 -0
  321. citenexus-0.2.0/tests/extract/test_pdf.py +29 -0
  322. citenexus-0.2.0/tests/extract/test_plain.py +26 -0
  323. citenexus-0.2.0/tests/extract/test_pptx.py +22 -0
  324. citenexus-0.2.0/tests/extract/test_txt.py +27 -0
  325. citenexus-0.2.0/tests/graph/test_graph_distill.py +98 -0
  326. citenexus-0.2.0/tests/graph/test_graph_retriever.py +41 -0
  327. citenexus-0.2.0/tests/ingest/__init__.py +0 -0
  328. citenexus-0.2.0/tests/ingest/test_batch_embedding.py +98 -0
  329. citenexus-0.2.0/tests/ingest/test_pipeline.py +167 -0
  330. citenexus-0.2.0/tests/ingest/test_vision_ingest.py +84 -0
  331. citenexus-0.2.0/tests/ingest/test_web.py +84 -0
  332. citenexus-0.2.0/tests/integration/test_openrouter_smoke.py +73 -0
  333. citenexus-0.2.0/tests/lang/__init__.py +0 -0
  334. citenexus-0.2.0/tests/lang/test_detect.py +90 -0
  335. citenexus-0.2.0/tests/lang/test_fallback.py +96 -0
  336. citenexus-0.2.0/tests/memory/test_memory_client.py +37 -0
  337. citenexus-0.2.0/tests/plugins/__init__.py +0 -0
  338. citenexus-0.2.0/tests/plugins/test_base.py +105 -0
  339. citenexus-0.2.0/tests/plugins/test_registry.py +169 -0
  340. citenexus-0.2.0/tests/provenance/__init__.py +0 -0
  341. citenexus-0.2.0/tests/provenance/test_rebuild_planner.py +173 -0
  342. citenexus-0.2.0/tests/provenance/test_stamp.py +107 -0
  343. citenexus-0.2.0/tests/retrieve/__init__.py +0 -0
  344. citenexus-0.2.0/tests/retrieve/conftest.py +97 -0
  345. citenexus-0.2.0/tests/retrieve/test_dual_query.py +81 -0
  346. citenexus-0.2.0/tests/retrieve/test_engine.py +90 -0
  347. citenexus-0.2.0/tests/retrieve/test_fusion.py +68 -0
  348. citenexus-0.2.0/tests/retrieve/test_lexical.py +34 -0
  349. citenexus-0.2.0/tests/retrieve/test_lexical_native.py +76 -0
  350. citenexus-0.2.0/tests/retrieve/test_reformulate.py +84 -0
  351. citenexus-0.2.0/tests/retrieve/test_rerank.py +54 -0
  352. citenexus-0.2.0/tests/retrieve/test_structure.py +79 -0
  353. citenexus-0.2.0/tests/retrieve/test_vector.py +41 -0
  354. citenexus-0.2.0/tests/storage/__init__.py +0 -0
  355. citenexus-0.2.0/tests/storage/test_backend.py +37 -0
  356. citenexus-0.2.0/tests/storage/test_backend_pairs.py +74 -0
  357. citenexus-0.2.0/tests/storage/test_bm25_text_search.py +59 -0
  358. citenexus-0.2.0/tests/storage/test_integration_minio.py +72 -0
  359. citenexus-0.2.0/tests/storage/test_integration_postgres.py +79 -0
  360. citenexus-0.2.0/tests/storage/test_lance_store.py +43 -0
  361. citenexus-0.2.0/tests/storage/test_manifest.py +51 -0
  362. citenexus-0.2.0/tests/storage/test_paths.py +20 -0
  363. citenexus-0.2.0/tests/storage/test_postgres_store.py +131 -0
  364. citenexus-0.2.0/tests/storage/test_s3_location.py +69 -0
  365. citenexus-0.2.0/tests/stream/test_stream.py +25 -0
  366. citenexus-0.2.0/tests/telemetry/__init__.py +0 -0
  367. citenexus-0.2.0/tests/telemetry/test_cost.py +105 -0
  368. citenexus-0.2.0/tests/telemetry/test_counters.py +70 -0
  369. citenexus-0.2.0/tests/telemetry/test_events.py +65 -0
  370. citenexus-0.2.0/tests/telemetry/test_sinks.py +47 -0
  371. citenexus-0.2.0/tests/test_agent_tools.py +87 -0
  372. citenexus-0.2.0/tests/test_client_dual_query.py +75 -0
  373. citenexus-0.2.0/tests/test_client_minimal.py +92 -0
  374. citenexus-0.2.0/tests/test_client_s3_integration.py +67 -0
  375. citenexus-0.2.0/tests/test_client_telemetry.py +117 -0
  376. citenexus-0.2.0/tests/test_client_text_search.py +46 -0
  377. citenexus-0.2.0/tests/test_client_web.py +58 -0
  378. citenexus-0.2.0/tests/test_conformance_fixtures.py +48 -0
  379. citenexus-0.2.0/tests/test_endpoint.py +128 -0
  380. citenexus-0.2.0/tests/test_factory.py +344 -0
  381. citenexus-0.2.0/tests/test_hooks.py +74 -0
  382. citenexus-0.2.0/tests/test_http_client.py +30 -0
  383. citenexus-0.2.0/tests/test_package.py +7 -0
  384. citenexus-0.2.0/tests/test_public_client.py +82 -0
  385. citenexus-0.2.0/tests/vision/__init__.py +0 -0
  386. citenexus-0.2.0/tests/vision/test_describe.py +39 -0
  387. citenexus-0.2.0/tests/vision/test_prefilter.py +79 -0
  388. citenexus-0.2.0/tests/vision/test_vision_client.py +88 -0
  389. citenexus-0.2.0/tests/vision/test_vision_units.py +56 -0
  390. citenexus-0.2.0/tests/wiki/test_distill.py +109 -0
  391. citenexus-0.2.0/tests/wiki/test_store_scale.py +137 -0
  392. citenexus-0.2.0/tests/wiki/test_store_wiki.py +174 -0
  393. citenexus-0.2.0/tests/wiki/test_wiki_retriever.py +126 -0
  394. citenexus-0.2.0/tests/worker/__init__.py +0 -0
  395. citenexus-0.2.0/tests/worker/test_dlq.py +47 -0
  396. citenexus-0.2.0/tests/worker/test_executor.py +120 -0
  397. citenexus-0.2.0/tests/worker/test_queue.py +108 -0
  398. citenexus-0.2.0/tests/worker/test_resume.py +64 -0
  399. citenexus-0.2.0/tests/worker/test_retry.py +42 -0
  400. citenexus-0.2.0/uv.lock +1780 -0
@@ -0,0 +1,155 @@
1
+ ---
2
+ name: "OPSX: Apply"
3
+ description: Implement tasks from an OpenSpec change (Experimental)
4
+ category: Workflow
5
+ tags: [workflow, artifacts, experimental]
6
+ ---
7
+
8
+ Implement tasks from an OpenSpec change.
9
+
10
+ **Input**: Optionally specify a change name (e.g., `/opsx:apply add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
11
+
12
+ **Steps**
13
+
14
+ 1. **Select the change**
15
+
16
+ If a name is provided, use it. Otherwise:
17
+ - Infer from conversation context if the user mentioned a change
18
+ - Auto-select if only one active change exists
19
+ - If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select
20
+
21
+ Always announce: "Using change: <name>" and how to override (e.g., `/opsx:apply <other>`).
22
+
23
+ 2. **Check status to understand the schema**
24
+ ```bash
25
+ openspec status --change "<name>" --json
26
+ ```
27
+ Parse the JSON to understand:
28
+ - `schemaName`: The workflow being used (e.g., "spec-driven")
29
+ - `planningHome`, `changeRoot`, and `actionContext`: planning scope and edit constraints
30
+ - Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
31
+
32
+ 3. **Get apply instructions**
33
+
34
+ ```bash
35
+ openspec instructions apply --change "<name>" --json
36
+ ```
37
+
38
+ This returns:
39
+ - `contextFiles`: artifact ID -> array of concrete file paths (varies by schema)
40
+ - Progress (total, complete, remaining)
41
+ - Task list with status
42
+ - Dynamic instruction based on current state
43
+
44
+ **Handle states:**
45
+ - If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx:continue`
46
+ - If `state: "all_done"`: congratulate, suggest archive
47
+ - Otherwise: proceed to implementation
48
+
49
+ **Workspace guard:** If status JSON reports `actionContext.mode: "workspace-planning"` and `allowedEditRoots` is empty, explain that full workspace apply is not supported in this slice. Treat linked repos and folders as read-only context, ask the user to select an affected area through an explicit implementation workflow, and STOP before editing files.
50
+
51
+ 4. **Read context files**
52
+
53
+ Read every file path listed under `contextFiles` from the apply instructions output.
54
+ The files depend on the schema being used:
55
+ - **spec-driven**: proposal, specs, design, tasks
56
+ - Other schemas: follow the contextFiles from CLI output
57
+
58
+ 5. **Show current progress**
59
+
60
+ Display:
61
+ - Schema being used
62
+ - Progress: "N/M tasks complete"
63
+ - Remaining tasks overview
64
+ - Dynamic instruction from CLI
65
+
66
+ 6. **Implement tasks (loop until done or blocked)**
67
+
68
+ For each pending task:
69
+ - Show which task is being worked on
70
+ - Make the code changes required
71
+ - Keep changes minimal and focused
72
+ - Mark task complete in the tasks file: `- [ ]` → `- [x]`
73
+ - Continue to next task
74
+
75
+ **Pause if:**
76
+ - Task is unclear → ask for clarification
77
+ - Implementation reveals a design issue → suggest updating artifacts
78
+ - Error or blocker encountered → report and wait for guidance
79
+ - User interrupts
80
+
81
+ 7. **On completion or pause, show status**
82
+
83
+ Display:
84
+ - Tasks completed this session
85
+ - Overall progress: "N/M tasks complete"
86
+ - If all done: suggest archive
87
+ - If paused: explain why and wait for guidance
88
+
89
+ **Output During Implementation**
90
+
91
+ ```
92
+ ## Implementing: <change-name> (schema: <schema-name>)
93
+
94
+ Working on task 3/7: <task description>
95
+ [...implementation happening...]
96
+ ✓ Task complete
97
+
98
+ Working on task 4/7: <task description>
99
+ [...implementation happening...]
100
+ ✓ Task complete
101
+ ```
102
+
103
+ **Output On Completion**
104
+
105
+ ```
106
+ ## Implementation Complete
107
+
108
+ **Change:** <change-name>
109
+ **Schema:** <schema-name>
110
+ **Progress:** 7/7 tasks complete ✓
111
+
112
+ ### Completed This Session
113
+ - [x] Task 1
114
+ - [x] Task 2
115
+ ...
116
+
117
+ All tasks complete! You can archive this change with `/opsx:archive`.
118
+ ```
119
+
120
+ **Output On Pause (Issue Encountered)**
121
+
122
+ ```
123
+ ## Implementation Paused
124
+
125
+ **Change:** <change-name>
126
+ **Schema:** <schema-name>
127
+ **Progress:** 4/7 tasks complete
128
+
129
+ ### Issue Encountered
130
+ <description of the issue>
131
+
132
+ **Options:**
133
+ 1. <option 1>
134
+ 2. <option 2>
135
+ 3. Other approach
136
+
137
+ What would you like to do?
138
+ ```
139
+
140
+ **Guardrails**
141
+ - Keep going through tasks until done or blocked
142
+ - Always read context files before starting (from the apply instructions output)
143
+ - If task is ambiguous, pause and ask before implementing
144
+ - If implementation reveals issues, pause and suggest artifact updates
145
+ - Keep code changes minimal and scoped to each task
146
+ - Update task checkbox immediately after completing each task
147
+ - Pause on errors, blockers, or unclear requirements - don't guess
148
+ - Use contextFiles from CLI output, don't assume specific file names
149
+
150
+ **Fluid Workflow Integration**
151
+
152
+ This skill supports the "actions on a change" model:
153
+
154
+ - **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
155
+ - **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
@@ -0,0 +1,160 @@
1
+ ---
2
+ name: "OPSX: Archive"
3
+ description: Archive a completed change in the experimental workflow
4
+ category: Workflow
5
+ tags: [workflow, archive, experimental]
6
+ ---
7
+
8
+ Archive a completed change in the experimental workflow.
9
+
10
+ **Input**: Optionally specify a change name after `/opsx:archive` (e.g., `/opsx:archive add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
11
+
12
+ **Steps**
13
+
14
+ 1. **If no change name provided, prompt for selection**
15
+
16
+ Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
17
+
18
+ Show only active changes (not already archived).
19
+ Include the schema used for each change if available.
20
+
21
+ **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
22
+
23
+ 2. **Check artifact completion status**
24
+
25
+ Run `openspec status --change "<name>" --json` to check artifact completion.
26
+
27
+ Parse the JSON to understand:
28
+ - `schemaName`: The workflow being used
29
+ - `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context
30
+ - `artifacts`: List of artifacts with their status (`done` or other)
31
+
32
+ If status reports `actionContext.mode: "workspace-planning"`, explain that workspace archive is not supported in this slice and STOP. Do not move workspace changes into repo-local archives or edit linked repos.
33
+
34
+ **If any artifacts are not `done`:**
35
+ - Display warning listing incomplete artifacts
36
+ - Prompt user for confirmation to continue
37
+ - Proceed if user confirms
38
+
39
+ 3. **Check task completion status**
40
+
41
+ Read the tasks file (typically `tasks.md`) to check for incomplete tasks.
42
+
43
+ Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).
44
+
45
+ **If incomplete tasks found:**
46
+ - Display warning showing count of incomplete tasks
47
+ - Prompt user for confirmation to continue
48
+ - Proceed if user confirms
49
+
50
+ **If no tasks file exists:** Proceed without task-related warning.
51
+
52
+ 4. **Assess delta spec sync state**
53
+
54
+ Use `artifactPaths.specs.existingOutputPaths` from status JSON to check for delta specs. If none exist, proceed without sync prompt.
55
+
56
+ **If delta specs exist:**
57
+ - Compare each delta spec with its corresponding main spec at `openspec/specs/<capability>/spec.md`
58
+ - Determine what changes would be applied (adds, modifications, removals, renames)
59
+ - Show a combined summary before prompting
60
+
61
+ **Prompt options:**
62
+ - If changes needed: "Sync now (recommended)", "Archive without syncing"
63
+ - If already synced: "Archive now", "Sync anyway", "Cancel"
64
+
65
+ If user chooses sync, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke openspec-sync-specs for change '<name>'. Delta spec analysis: <include the analyzed delta spec summary>"). Proceed to archive regardless of choice.
66
+
67
+ 5. **Perform the archive**
68
+
69
+ Create an `archive` directory under `planningHome.changesDir` if it doesn't exist:
70
+ ```bash
71
+ mkdir -p "<planningHome.changesDir>/archive"
72
+ ```
73
+
74
+ Generate target name using current date: `YYYY-MM-DD-<change-name>`
75
+
76
+ **Check if target already exists:**
77
+ - If yes: Fail with error, suggest renaming existing archive or using different date
78
+ - If no: Move `changeRoot` to the archive directory
79
+
80
+ ```bash
81
+ mv "<changeRoot>" "<planningHome.changesDir>/archive/YYYY-MM-DD-<name>"
82
+ ```
83
+
84
+ 6. **Display summary**
85
+
86
+ Show archive completion summary including:
87
+ - Change name
88
+ - Schema that was used
89
+ - Archive location
90
+ - Spec sync status (synced / sync skipped / no delta specs)
91
+ - Note about any warnings (incomplete artifacts/tasks)
92
+
93
+ **Output On Success**
94
+
95
+ ```
96
+ ## Archive Complete
97
+
98
+ **Change:** <change-name>
99
+ **Schema:** <schema-name>
100
+ **Archived to:** the archive path derived from `planningHome.changesDir`/YYYY-MM-DD-<name>/
101
+ **Specs:** ✓ Synced to main specs
102
+
103
+ All artifacts complete. All tasks complete.
104
+ ```
105
+
106
+ **Output On Success (No Delta Specs)**
107
+
108
+ ```
109
+ ## Archive Complete
110
+
111
+ **Change:** <change-name>
112
+ **Schema:** <schema-name>
113
+ **Archived to:** the archive path derived from `planningHome.changesDir`/YYYY-MM-DD-<name>/
114
+ **Specs:** No delta specs
115
+
116
+ All artifacts complete. All tasks complete.
117
+ ```
118
+
119
+ **Output On Success With Warnings**
120
+
121
+ ```
122
+ ## Archive Complete (with warnings)
123
+
124
+ **Change:** <change-name>
125
+ **Schema:** <schema-name>
126
+ **Archived to:** the archive path derived from `planningHome.changesDir`/YYYY-MM-DD-<name>/
127
+ **Specs:** Sync skipped (user chose to skip)
128
+
129
+ **Warnings:**
130
+ - Archived with 2 incomplete artifacts
131
+ - Archived with 3 incomplete tasks
132
+ - Delta spec sync was skipped (user chose to skip)
133
+
134
+ Review the archive if this was not intentional.
135
+ ```
136
+
137
+ **Output On Error (Archive Exists)**
138
+
139
+ ```
140
+ ## Archive Failed
141
+
142
+ **Change:** <change-name>
143
+ **Target:** the archive path derived from `planningHome.changesDir`/YYYY-MM-DD-<name>/
144
+
145
+ Target archive directory already exists.
146
+
147
+ **Options:**
148
+ 1. Rename the existing archive
149
+ 2. Delete the existing archive if it's a duplicate
150
+ 3. Wait until a different date to archive
151
+ ```
152
+
153
+ **Guardrails**
154
+ - Always prompt for change selection if not provided
155
+ - Use artifact graph (openspec status --json) for completion checking
156
+ - Don't block archive on warnings - just inform and confirm
157
+ - Preserve .openspec.yaml when moving to archive (it moves with the directory)
158
+ - Show clear summary of what happened
159
+ - If sync is requested, use the Skill tool to invoke `openspec-sync-specs` (agent-driven)
160
+ - If delta specs exist, always run the sync assessment and show the combined summary before prompting
@@ -0,0 +1,172 @@
1
+ ---
2
+ name: "OPSX: Explore"
3
+ description: "Enter explore mode - think through ideas, investigate problems, clarify requirements"
4
+ category: Workflow
5
+ tags: [workflow, explore, experimental, thinking]
6
+ ---
7
+
8
+ Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
9
+
10
+ **IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and investigate the codebase, but you must NEVER write code or implement features. If the user asks you to implement something, remind them to exit explore mode first and create a change proposal. You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing.
11
+
12
+ **This is a stance, not a workflow.** There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore.
13
+
14
+ **Input**: The argument after `/opsx:explore` is whatever the user wants to think about. Could be:
15
+ - A vague idea: "real-time collaboration"
16
+ - A specific problem: "the auth system is getting unwieldy"
17
+ - A change name: "add-dark-mode" (to explore in context of that change)
18
+ - A comparison: "postgres vs sqlite for this"
19
+ - Nothing (just enter explore mode)
20
+
21
+ ---
22
+
23
+ ## The Stance
24
+
25
+ - **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
26
+ - **Open threads, not interrogations** - Surface multiple interesting directions and let the user follow what resonates. Don't funnel them through a single path of questions.
27
+ - **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
28
+ - **Adaptive** - Follow interesting threads, pivot when new information emerges
29
+ - **Patient** - Don't rush to conclusions, let the shape of the problem emerge
30
+ - **Grounded** - Explore the actual codebase when relevant, don't just theorize
31
+
32
+ ---
33
+
34
+ ## What You Might Do
35
+
36
+ Depending on what the user brings, you might:
37
+
38
+ **Explore the problem space**
39
+ - Ask clarifying questions that emerge from what they said
40
+ - Challenge assumptions
41
+ - Reframe the problem
42
+ - Find analogies
43
+
44
+ **Investigate the codebase**
45
+ - Map existing architecture relevant to the discussion
46
+ - Find integration points
47
+ - Identify patterns already in use
48
+ - Surface hidden complexity
49
+
50
+ **Compare options**
51
+ - Brainstorm multiple approaches
52
+ - Build comparison tables
53
+ - Sketch tradeoffs
54
+ - Recommend a path (if asked)
55
+
56
+ **Visualize**
57
+ ```
58
+ ┌─────────────────────────────────────────┐
59
+ │ Use ASCII diagrams liberally │
60
+ ├─────────────────────────────────────────┤
61
+ │ │
62
+ │ ┌────────┐ ┌────────┐ │
63
+ │ │ State │────────▶│ State │ │
64
+ │ │ A │ │ B │ │
65
+ │ └────────┘ └────────┘ │
66
+ │ │
67
+ │ System diagrams, state machines, │
68
+ │ data flows, architecture sketches, │
69
+ │ dependency graphs, comparison tables │
70
+ │ │
71
+ └─────────────────────────────────────────┘
72
+ ```
73
+
74
+ **Surface risks and unknowns**
75
+ - Identify what could go wrong
76
+ - Find gaps in understanding
77
+ - Suggest spikes or investigations
78
+
79
+ ---
80
+
81
+ ## OpenSpec Awareness
82
+
83
+ You have full context of the OpenSpec system. Use it naturally, don't force it.
84
+
85
+ ### Check for context
86
+
87
+ At the start, quickly check what exists:
88
+ ```bash
89
+ openspec list --json
90
+ ```
91
+
92
+ This tells you:
93
+ - If there are active changes
94
+ - Their names, schemas, and status
95
+ - What the user might be working on
96
+
97
+ If the user mentioned a specific change name, read its artifacts for context.
98
+
99
+ ### When no change exists
100
+
101
+ Think freely. When insights crystallize, you might offer:
102
+
103
+ - "This feels solid enough to start a change. Want me to create a proposal?"
104
+ - Or keep exploring - no pressure to formalize
105
+
106
+ ### When a change exists
107
+
108
+ If the user mentions a change or you detect one is relevant:
109
+
110
+ 1. **Resolve and read existing artifacts for context**
111
+ - Run `openspec status --change "<name>" --json`.
112
+ - Use `changeRoot`, `artifactPaths`, and `actionContext` from the status JSON.
113
+ - Read existing files from `artifactPaths.<artifact>.existingOutputPaths`.
114
+
115
+ 2. **Reference them naturally in conversation**
116
+ - "Your design mentions using Redis, but we just realized SQLite fits better..."
117
+ - "The proposal scopes this to premium users, but we're now thinking everyone..."
118
+
119
+ 3. **Offer to capture when decisions are made**
120
+
121
+ | Insight Type | Where to Capture |
122
+ |----------------------------|--------------------------------|
123
+ | New requirement discovered | `specs/<capability>/spec.md` |
124
+ | Requirement changed | `specs/<capability>/spec.md` |
125
+ | Design decision made | `design.md` |
126
+ | Scope changed | `proposal.md` |
127
+ | New work identified | `tasks.md` |
128
+ | Assumption invalidated | Relevant artifact |
129
+
130
+ Example offers:
131
+ - "That's a design decision. Capture it in design.md?"
132
+ - "This is a new requirement. Add it to specs?"
133
+ - "This changes scope. Update the proposal?"
134
+
135
+ 4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
136
+
137
+ ---
138
+
139
+ ## What You Don't Have To Do
140
+
141
+ - Follow a script
142
+ - Ask the same questions every time
143
+ - Produce a specific artifact
144
+ - Reach a conclusion
145
+ - Stay on topic if a tangent is valuable
146
+ - Be brief (this is thinking time)
147
+
148
+ ---
149
+
150
+ ## Ending Discovery
151
+
152
+ There's no required ending. Discovery might:
153
+
154
+ - **Flow into a proposal**: "Ready to start? I can create a change proposal."
155
+ - **Result in artifact updates**: "Updated design.md with these decisions"
156
+ - **Just provide clarity**: User has what they need, moves on
157
+ - **Continue later**: "We can pick this up anytime"
158
+
159
+ When things crystallize, you might offer a summary - but it's optional. Sometimes the thinking IS the value.
160
+
161
+ ---
162
+
163
+ ## Guardrails
164
+
165
+ - **Don't implement** - Never write code or implement features. Creating OpenSpec artifacts is fine, writing application code is not.
166
+ - **Don't fake understanding** - If something is unclear, dig deeper
167
+ - **Don't rush** - Discovery is thinking time, not task time
168
+ - **Don't force structure** - Let patterns emerge naturally
169
+ - **Don't auto-capture** - Offer to save insights, don't just do it
170
+ - **Do visualize** - A good diagram is worth many paragraphs
171
+ - **Do explore the codebase** - Ground discussions in reality
172
+ - **Do question assumptions** - Including the user's and your own
@@ -0,0 +1,107 @@
1
+ ---
2
+ name: "OPSX: Propose"
3
+ description: Propose a new change - create it and generate all artifacts in one step
4
+ category: Workflow
5
+ tags: [workflow, artifacts, experimental]
6
+ ---
7
+
8
+ Propose a new change - create the change and generate all artifacts in one step.
9
+
10
+ I'll create a change with artifacts:
11
+ - proposal.md (what & why)
12
+ - design.md (how)
13
+ - tasks.md (implementation steps)
14
+
15
+ When ready to implement, run /opsx:apply
16
+
17
+ ---
18
+
19
+ **Input**: The argument after `/opsx:propose` is the change name (kebab-case), OR a description of what the user wants to build.
20
+
21
+ **Steps**
22
+
23
+ 1. **If no input provided, ask what they want to build**
24
+
25
+ Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
26
+ > "What change do you want to work on? Describe what you want to build or fix."
27
+
28
+ From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
29
+
30
+ **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
31
+
32
+ 2. **Create the change directory**
33
+ ```bash
34
+ openspec new change "<name>"
35
+ ```
36
+ This creates a scaffolded change in the planning home resolved by the CLI with `.openspec.yaml`.
37
+
38
+ 3. **Get the artifact build order**
39
+ ```bash
40
+ openspec status --change "<name>" --json
41
+ ```
42
+ Parse the JSON to get:
43
+ - `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
44
+ - `artifacts`: list of all artifacts with their status and dependencies
45
+ - `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context. Use these instead of assuming repo-local paths.
46
+
47
+ 4. **Create artifacts in sequence until apply-ready**
48
+
49
+ Use the **TodoWrite tool** to track progress through the artifacts.
50
+
51
+ Loop through artifacts in dependency order (artifacts with no pending dependencies first):
52
+
53
+ a. **For each artifact that is `ready` (dependencies satisfied)**:
54
+ - Get instructions:
55
+ ```bash
56
+ openspec instructions <artifact-id> --change "<name>" --json
57
+ ```
58
+ - The instructions JSON includes:
59
+ - `context`: Project background (constraints for you - do NOT include in output)
60
+ - `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
61
+ - `template`: The structure to use for your output file
62
+ - `instruction`: Schema-specific guidance for this artifact type
63
+ - `resolvedOutputPath`: Resolved path or pattern to write the artifact
64
+ - `dependencies`: Completed artifacts to read for context
65
+ - Read any completed dependency files for context
66
+ - Create the artifact file using `template` as the structure and write it to `resolvedOutputPath`
67
+ - Apply `context` and `rules` as constraints - but do NOT copy them into the file
68
+ - Show brief progress: "Created <artifact-id>"
69
+
70
+ b. **Continue until all `applyRequires` artifacts are complete**
71
+ - After creating each artifact, re-run `openspec status --change "<name>" --json`
72
+ - Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array
73
+ - Stop when all `applyRequires` artifacts are done
74
+
75
+ c. **If an artifact requires user input** (unclear context):
76
+ - Use **AskUserQuestion tool** to clarify
77
+ - Then continue with creation
78
+
79
+ 5. **Show final status**
80
+ ```bash
81
+ openspec status --change "<name>"
82
+ ```
83
+
84
+ **Output**
85
+
86
+ After completing all artifacts, summarize:
87
+ - Change name and location
88
+ - List of artifacts created with brief descriptions
89
+ - What's ready: "All artifacts created! Ready for implementation."
90
+ - Prompt: "Run `/opsx:apply` to start implementing."
91
+
92
+ **Artifact Creation Guidelines**
93
+
94
+ - Follow the `instruction` field from `openspec instructions` for each artifact type
95
+ - The schema defines what each artifact should contain - follow it
96
+ - Read dependency artifacts for context before creating new ones
97
+ - Use `template` as the structure for your output file - fill in its sections
98
+ - **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
99
+ - Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
100
+ - These guide what you write, but should never appear in the output
101
+
102
+ **Guardrails**
103
+ - Create ALL artifacts needed for implementation (as defined by schema's `apply.requires`)
104
+ - Always read dependency artifacts before creating a new one
105
+ - If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
106
+ - If a change with that name already exists, ask if user wants to continue it or create a new one
107
+ - Verify each artifact file exists after writing before proceeding to next