wiki-fabric 0.3.1__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 (199) hide show
  1. wiki_fabric-0.3.1/LICENSE +21 -0
  2. wiki_fabric-0.3.1/PKG-INFO +108 -0
  3. wiki_fabric-0.3.1/README.md +79 -0
  4. wiki_fabric-0.3.1/pyproject.toml +61 -0
  5. wiki_fabric-0.3.1/setup.cfg +4 -0
  6. wiki_fabric-0.3.1/src/wiki_fabric/__init__.py +39 -0
  7. wiki_fabric-0.3.1/src/wiki_fabric/__main__.py +4 -0
  8. wiki_fabric-0.3.1/src/wiki_fabric/_harness/AGENTS.md +152 -0
  9. wiki_fabric-0.3.1/src/wiki_fabric/_harness/evaluations/behavior/PARTITION.md +31 -0
  10. wiki_fabric-0.3.1/src/wiki_fabric/_harness/evaluations/behavior/be1-avoid-anti-pattern.yaml +64 -0
  11. wiki_fabric-0.3.1/src/wiki_fabric/_harness/evaluations/behavior/be2-project-over-global.yaml +48 -0
  12. wiki_fabric-0.3.1/src/wiki_fabric/_harness/evaluations/behavior/be3-stale-demoted.yaml +54 -0
  13. wiki_fabric-0.3.1/src/wiki_fabric/_harness/evaluations/behavior/be4-escalate-gap.yaml +54 -0
  14. wiki_fabric-0.3.1/src/wiki_fabric/_harness/evaluations/behavior/be5-receipt-proves-delivery.yaml +47 -0
  15. wiki_fabric-0.3.1/src/wiki_fabric/_harness/evaluations/behavior/be6-commitment-triggered.yaml +40 -0
  16. wiki_fabric-0.3.1/src/wiki_fabric/_harness/evaluations/expected/claims.yaml +31 -0
  17. wiki_fabric-0.3.1/src/wiki_fabric/_harness/evaluations/expected/concept-links.yaml +24 -0
  18. wiki_fabric-0.3.1/src/wiki_fabric/_harness/evaluations/expected/contradictions.yaml +21 -0
  19. wiki_fabric-0.3.1/src/wiki_fabric/_harness/evaluations/fixtures/source-a.md +31 -0
  20. wiki_fabric-0.3.1/src/wiki_fabric/_harness/evaluations/fixtures/source-b.md +12 -0
  21. wiki_fabric-0.3.1/src/wiki_fabric/_harness/evaluations/fixtures/source-c.md +26 -0
  22. wiki_fabric-0.3.1/src/wiki_fabric/_harness/evaluations/questions.yaml +31 -0
  23. wiki_fabric-0.3.1/src/wiki_fabric/_harness/evaluations/rubric.md +49 -0
  24. wiki_fabric-0.3.1/src/wiki_fabric/_harness/fabric.yaml.example +144 -0
  25. wiki_fabric-0.3.1/src/wiki_fabric/_harness/global/computations/ac-fabric-profile-lint.md +24 -0
  26. wiki_fabric-0.3.1/src/wiki_fabric/_harness/global/computations/ac-golden-corpus-eval.md +32 -0
  27. wiki_fabric-0.3.1/src/wiki_fabric/_harness/global/computations/ac-locator-verification.md +29 -0
  28. wiki_fabric-0.3.1/src/wiki_fabric/_harness/index.md +30 -0
  29. wiki_fabric-0.3.1/src/wiki_fabric/_harness/okf-base.yaml +109 -0
  30. wiki_fabric-0.3.1/src/wiki_fabric/_harness/references/attesters/check-golden-eval.py +43 -0
  31. wiki_fabric-0.3.1/src/wiki_fabric/_harness/references/attesters/check-zero-errors.py +17 -0
  32. wiki_fabric-0.3.1/src/wiki_fabric/_harness/references/skills/run-golden-eval.md +15 -0
  33. wiki_fabric-0.3.1/src/wiki_fabric/_harness/references/skills/run-profile-lint.md +11 -0
  34. wiki_fabric-0.3.1/src/wiki_fabric/_harness/schemas/frontmatter.md +273 -0
  35. wiki_fabric-0.3.1/src/wiki_fabric/_harness/schemas/ontology.md +46 -0
  36. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/apply_changeset.py +318 -0
  37. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/bootstrap-project.py +827 -0
  38. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/build-entity-index.py +371 -0
  39. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/capture-chat.py +632 -0
  40. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/capture-git.py +370 -0
  41. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/capture.py +262 -0
  42. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/configure.py +309 -0
  43. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/context.py +665 -0
  44. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/doctor.py +197 -0
  45. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/ensure-local-model.py +70 -0
  46. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/export-wiki.py +295 -0
  47. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/freshness-job.py +164 -0
  48. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/gate.py +350 -0
  49. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/harvest-questions.py +160 -0
  50. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/ingest.py +593 -0
  51. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/lint.py +987 -0
  52. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/log-experience.py +264 -0
  53. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/mine-chats.py +284 -0
  54. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/mine-promotions.py +896 -0
  55. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/obsidian_status.py +51 -0
  56. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/okf_export.py +238 -0
  57. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/okf_import.py +227 -0
  58. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/promote-domains.py +129 -0
  59. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/promote-patterns.py +126 -0
  60. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/promote-questions.py +136 -0
  61. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/promote.py +322 -0
  62. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/propose-domains.py +317 -0
  63. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/publish-wiki.py +132 -0
  64. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/query.py +816 -0
  65. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/rebuild-index.py +316 -0
  66. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/repos-migrate.py +141 -0
  67. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/review.py +414 -0
  68. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/sync.py +854 -0
  69. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/synthesize.py +465 -0
  70. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/thread.py +186 -0
  71. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/utility.py +203 -0
  72. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/vault-refresh.py +135 -0
  73. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/verify-effects.py +158 -0
  74. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/cmd/wiki_generate.py +316 -0
  75. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/demo.sh +220 -0
  76. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/eval/eval-behavior.py +384 -0
  77. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/eval/eval-pr-replay.py +308 -0
  78. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/eval/eval-real-repo.py +285 -0
  79. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/eval/eval-stability.py +375 -0
  80. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/eval/eval.py +228 -0
  81. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/harness/always_on.py +136 -0
  82. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/harness/graphify-bridge.py +402 -0
  83. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/harness/graphify_langpack_gdscript.py +26 -0
  84. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/harness/harnesses.py +381 -0
  85. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/harness/hooks.py +484 -0
  86. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/harness/skill.py +82 -0
  87. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/lib/contracts.py +51 -0
  88. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/lib/embed_index.py +106 -0
  89. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/lib/eval_core.py +92 -0
  90. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/lib/extract_backends.py +516 -0
  91. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/lib/fabric_config.py +1050 -0
  92. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/lib/judgment.py +602 -0
  93. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/lib/local_llm.py +209 -0
  94. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/lib/obsidian_bridge.py +255 -0
  95. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/lib/paths.py +155 -0
  96. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/lib/render_template.py +38 -0
  97. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/lib/systemone.py +244 -0
  98. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/lib/thread_signals.py +129 -0
  99. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/lib/wf_common.py +303 -0
  100. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/pkg/_smoke_import_shape.py +20 -0
  101. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/pkg/prep-package.py +60 -0
  102. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/pkg/wheel-smoke.sh +130 -0
  103. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/smoke-test.sh +191 -0
  104. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/sync_lib/__init__.py +10 -0
  105. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/sync_lib/policy.py +103 -0
  106. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/sync_lib/pr.py +165 -0
  107. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/wiki-fabric.sh +1330 -0
  108. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/wiki_lib/__init__.py +12 -0
  109. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/wiki_lib/deepdives.py +299 -0
  110. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/wiki_lib/diagrams.py +71 -0
  111. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/wiki_lib/edges.py +184 -0
  112. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/wiki_lib/generators.py +760 -0
  113. wiki_fabric-0.3.1/src/wiki_fabric/_harness/scripts/wiki_lib/tombstones.py +117 -0
  114. wiki_fabric-0.3.1/src/wiki_fabric/_harness/system/always-on/wiki-fabric-block.md +21 -0
  115. wiki_fabric-0.3.1/src/wiki_fabric/_harness/system/corpus/freshness-workflow.yml +72 -0
  116. wiki_fabric-0.3.1/src/wiki_fabric/_harness/system/corpus/lint-workflow.yml +66 -0
  117. wiki_fabric-0.3.1/src/wiki_fabric/_harness/system/hooks/checkout-body.py +3 -0
  118. wiki_fabric-0.3.1/src/wiki_fabric/_harness/system/hooks/commit-body.py +65 -0
  119. wiki_fabric-0.3.1/src/wiki_fabric/_harness/system/hooks/merge-body.py +65 -0
  120. wiki_fabric-0.3.1/src/wiki_fabric/_harness/system/opencode/plugins/wiki-fabric.js +30 -0
  121. wiki_fabric-0.3.1/src/wiki_fabric/_harness/system/policy-profiles/default-coding-agent.yaml +12 -0
  122. wiki_fabric-0.3.1/src/wiki_fabric/_harness/system/skills/ingest/SKILL.md +179 -0
  123. wiki_fabric-0.3.1/src/wiki_fabric/_harness/system/skills/promote/SKILL.md +135 -0
  124. wiki_fabric-0.3.1/src/wiki_fabric/_harness/templates/concept.md +52 -0
  125. wiki_fabric-0.3.1/src/wiki_fabric/_harness/templates/decision.md +61 -0
  126. wiki_fabric-0.3.1/src/wiki_fabric/_harness/templates/examples/claim-example-cache-invalidation.md +24 -0
  127. wiki_fabric-0.3.1/src/wiki_fabric/_harness/templates/examples/claim-example-systemone-fusion.md +45 -0
  128. wiki_fabric-0.3.1/src/wiki_fabric/_harness/templates/examples/experience-event-example-freshness.md +33 -0
  129. wiki_fabric-0.3.1/src/wiki_fabric/_harness/templates/examples/experience-event-example.md +23 -0
  130. wiki_fabric-0.3.1/src/wiki_fabric/_harness/templates/examples/pattern-example-freshness.md +57 -0
  131. wiki_fabric-0.3.1/src/wiki_fabric/_harness/templates/experience-event.md +59 -0
  132. wiki_fabric-0.3.1/src/wiki_fabric/_harness/templates/experiment-with-baseline.md +111 -0
  133. wiki_fabric-0.3.1/src/wiki_fabric/_harness/templates/pattern.md +92 -0
  134. wiki_fabric-0.3.1/src/wiki_fabric/_harness/templates/skill.md +48 -0
  135. wiki_fabric-0.3.1/src/wiki_fabric/cli.py +21 -0
  136. wiki_fabric-0.3.1/src/wiki_fabric/dispatch.py +799 -0
  137. wiki_fabric-0.3.1/src/wiki_fabric/mcp_server.py +307 -0
  138. wiki_fabric-0.3.1/src/wiki_fabric/skeleton.py +133 -0
  139. wiki_fabric-0.3.1/src/wiki_fabric.egg-info/PKG-INFO +108 -0
  140. wiki_fabric-0.3.1/src/wiki_fabric.egg-info/SOURCES.txt +197 -0
  141. wiki_fabric-0.3.1/src/wiki_fabric.egg-info/dependency_links.txt +1 -0
  142. wiki_fabric-0.3.1/src/wiki_fabric.egg-info/entry_points.txt +3 -0
  143. wiki_fabric-0.3.1/src/wiki_fabric.egg-info/requires.txt +23 -0
  144. wiki_fabric-0.3.1/src/wiki_fabric.egg-info/top_level.txt +1 -0
  145. wiki_fabric-0.3.1/tests/test_bootstrap_project.py +52 -0
  146. wiki_fabric-0.3.1/tests/test_capture_formats.py +125 -0
  147. wiki_fabric-0.3.1/tests/test_capture_git.py +163 -0
  148. wiki_fabric-0.3.1/tests/test_claim_statement.py +131 -0
  149. wiki_fabric-0.3.1/tests/test_code_navigation.py +142 -0
  150. wiki_fabric-0.3.1/tests/test_config_template.py +125 -0
  151. wiki_fabric-0.3.1/tests/test_context.py +942 -0
  152. wiki_fabric-0.3.1/tests/test_deepdives.py +100 -0
  153. wiki_fabric-0.3.1/tests/test_demo.py +56 -0
  154. wiki_fabric-0.3.1/tests/test_discovery.py +316 -0
  155. wiki_fabric-0.3.1/tests/test_dispatch.py +125 -0
  156. wiki_fabric-0.3.1/tests/test_doctor.py +63 -0
  157. wiki_fabric-0.3.1/tests/test_eval_behavior.py +80 -0
  158. wiki_fabric-0.3.1/tests/test_eval_stability.py +56 -0
  159. wiki_fabric-0.3.1/tests/test_freshness_job.py +138 -0
  160. wiki_fabric-0.3.1/tests/test_gate_notify.py +111 -0
  161. wiki_fabric-0.3.1/tests/test_harness_manifests.py +61 -0
  162. wiki_fabric-0.3.1/tests/test_harnesses.py +196 -0
  163. wiki_fabric-0.3.1/tests/test_hooks.py +249 -0
  164. wiki_fabric-0.3.1/tests/test_integrations.py +187 -0
  165. wiki_fabric-0.3.1/tests/test_judgment.py +268 -0
  166. wiki_fabric-0.3.1/tests/test_judgment_refinement.py +459 -0
  167. wiki_fabric-0.3.1/tests/test_lint_ingest.py +449 -0
  168. wiki_fabric-0.3.1/tests/test_living_wiki_s1.py +117 -0
  169. wiki_fabric-0.3.1/tests/test_local_model.py +396 -0
  170. wiki_fabric-0.3.1/tests/test_mcp_server.py +150 -0
  171. wiki_fabric-0.3.1/tests/test_mine_inbox.py +115 -0
  172. wiki_fabric-0.3.1/tests/test_mine_main.py +120 -0
  173. wiki_fabric-0.3.1/tests/test_mining_threads.py +169 -0
  174. wiki_fabric-0.3.1/tests/test_obsidian_bridge.py +232 -0
  175. wiki_fabric-0.3.1/tests/test_okf.py +280 -0
  176. wiki_fabric-0.3.1/tests/test_okf_export.py +114 -0
  177. wiki_fabric-0.3.1/tests/test_okf_import.py +82 -0
  178. wiki_fabric-0.3.1/tests/test_p1_contract.py +219 -0
  179. wiki_fabric-0.3.1/tests/test_paths_resolution.py +187 -0
  180. wiki_fabric-0.3.1/tests/test_policy_profile.py +64 -0
  181. wiki_fabric-0.3.1/tests/test_promotion_gate.py +81 -0
  182. wiki_fabric-0.3.1/tests/test_proposed_types.py +43 -0
  183. wiki_fabric-0.3.1/tests/test_query_graphify.py +138 -0
  184. wiki_fabric-0.3.1/tests/test_questions.py +182 -0
  185. wiki_fabric-0.3.1/tests/test_receipts_loop.py +123 -0
  186. wiki_fabric-0.3.1/tests/test_review.py +278 -0
  187. wiki_fabric-0.3.1/tests/test_secrets_env.py +49 -0
  188. wiki_fabric-0.3.1/tests/test_slow_regions.py +222 -0
  189. wiki_fabric-0.3.1/tests/test_sync.py +312 -0
  190. wiki_fabric-0.3.1/tests/test_systemone.py +159 -0
  191. wiki_fabric-0.3.1/tests/test_thread_index.py +178 -0
  192. wiki_fabric-0.3.1/tests/test_thread_retrieval.py +167 -0
  193. wiki_fabric-0.3.1/tests/test_tombstones.py +119 -0
  194. wiki_fabric-0.3.1/tests/test_tuning.py +46 -0
  195. wiki_fabric-0.3.1/tests/test_utility.py +104 -0
  196. wiki_fabric-0.3.1/tests/test_verify_effects.py +91 -0
  197. wiki_fabric-0.3.1/tests/test_wave3_consolidation.py +120 -0
  198. wiki_fabric-0.3.1/tests/test_wf_common.py +228 -0
  199. wiki_fabric-0.3.1/tests/test_wiki_generate.py +169 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 wiki-fabric contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,108 @@
1
+ Metadata-Version: 2.4
2
+ Name: wiki-fabric
3
+ Version: 0.3.1
4
+ Summary: Evidence-first knowledge base that compounds across projects — one fabric, many project namespaces
5
+ License-Expression: MIT
6
+ Project-URL: Homepage, https://hybridindie.github.io/wiki-fabric/
7
+ Project-URL: Repository, https://github.com/hybridindie/wiki-fabric
8
+ Project-URL: Issues, https://github.com/hybridindie/wiki-fabric/issues
9
+ Keywords: wiki,knowledge-base,agents,claude,opencode,evidence,provenance,okf,mcp
10
+ Requires-Python: >=3.11
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: pyyaml>=6.0
14
+ Requires-Dist: openai>=1.40
15
+ Requires-Dist: anthropic>=0.40
16
+ Provides-Extra: mcp
17
+ Requires-Dist: mcp<3,>=2; extra == "mcp"
18
+ Provides-Extra: embeddings
19
+ Requires-Dist: numpy; extra == "embeddings"
20
+ Requires-Dist: sentence-transformers; extra == "embeddings"
21
+ Provides-Extra: local
22
+ Requires-Dist: huggingface_hub>=0.24; extra == "local"
23
+ Requires-Dist: llama-cpp-python>=0.3; (sys_platform == "darwin" or sys_platform == "linux") and extra == "local"
24
+ Requires-Dist: mlx-lm>=0.19; (sys_platform == "darwin" and platform_machine == "arm64") and extra == "local"
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest>=8.0; extra == "dev"
27
+ Requires-Dist: mcp<3,>=2; extra == "dev"
28
+ Dynamic: license-file
29
+
30
+ # Wiki Fabric
31
+
32
+ [![CI](https://github.com/hybridindie/wiki-fabric/actions/workflows/ci.yml/badge.svg)](https://github.com/hybridindie/wiki-fabric/actions/workflows/ci.yml)
33
+ [![Docs](https://img.shields.io/badge/docs-wiki--fabric.site-blue)](https://hybridindie.github.io/wiki-fabric/)
34
+
35
+ > **Git-native, testable knowledge governance for AI coding agents.**
36
+ > Project memory that is scoped by precedence, traceable to evidence, enforced by CI — and *provably delivered* before an agent writes code.
37
+
38
+ **Positioning in one line:** Wiki Fabric treats repository knowledge as operational infrastructure for agents — a governed context layer, not a note vault. Where generic "LLM wiki" projects stop at self-maintaining Markdown, Wiki Fabric adds the three things that make knowledge *trustworthy at task time*: scope with precedence, provenance with staleness gates, and behavior evaluations that measure whether the knowledge changed the agent's decision. It is one substrate of agent memory — the durable, Git-governed one — not the whole capability: the agent's context window and working state remain the harness's to manage. And it is **local-first, cloud-optional**: the daily loop runs on-device with zero tokens; LLM stages route per-repo, per-stage (privacy tiering) when you want them.
39
+
40
+ > [!WARNING]
41
+ > **Early alpha — expect breaking changes.** The core loop works end-to-end
42
+ > (capture → ingest → query → promote, verified on real projects), and the tool
43
+ > now packages cleanly (`uv tool install wiki-fabric`, pure-python dispatch,
44
+ > Windows-first-class). But schemas still move without migration scripts,
45
+ > claim-extraction quality varies by model, and the corpus CI/freshness job is
46
+ > still manual. Useful today if you want to shape the direction — not yet
47
+ > load-bearing team infrastructure.
48
+
49
+ ## Quick start
50
+
51
+ ```bash
52
+ # See the value in 5 seconds (no install):
53
+ bash scripts/demo.sh
54
+
55
+ # Install (packaged, atomic):
56
+ uv tool install wiki-fabric # the wf CLI
57
+ uv tool install wiki-fabric --with mcp # + the wf-mcp MCP server
58
+
59
+ # Teammate: pulls the team corpus automatically when the remote carries one
60
+ # (--vault <path> pins where the vault shell lives):
61
+ curl -fsSL https://raw.githubusercontent.com/hybridindie/wiki-fabric/main/scripts/wiki-fabric.sh | bash -s -- --corpus git@github.com:your-org/wiki-fabric-corpus.git
62
+
63
+ wf status # fabric health
64
+ wf bootstrap /path/to/my-project # connect a project (--extract local for privacy)
65
+ wf capture my-project # pull docs from upstream repos → evidence/raw/
66
+ wf ingest evidence/raw/my-project/docs/readme.md --extract-claims
67
+ wf query "Why does my code batch writes?"
68
+ wf context --task "Add token rotation to the OAuth service"
69
+ wf log --project my-project --problem "..." --intervention "..." --outcomes "..."
70
+
71
+ # The agent harness POV (always-on block arrives at session start):
72
+ wf context --task "..." --write-receipt # step 1: scoped manifest + receipt (0 tokens)
73
+ wf query "..." # step 2: evidence with line locators (0 tokens)
74
+ # step 3: the agent writes code
75
+ wf log --project my-project --receipt <receipt-id> ... # step 4: outcome ↔ delivery
76
+ wf gate # step 5: surface anything awaiting a human
77
+
78
+ # Make it a team system (gh CLI creates + publishes the corpus repo):
79
+ wf sync setup
80
+ # Upstream moves while machines sleep → the scheduled freshness cycle:
81
+ wf freshness --dry-run # capture-git + mechanical re-verify (0 tokens)
82
+ ```
83
+
84
+ The daily loop — connect → capture → ingest → validate → context → work → mine/review — compounding at step 7 into step 5's context for the next project. Full walkthrough, flags, and requirements: **[Getting Started](https://hybridindie.github.io/wiki-fabric/getting-started.html)**.
85
+
86
+ ## What it is
87
+
88
+ Two trees: the **harness** (tooling, this repo) and the **fabric** (your knowledge — gitignored, lives in the corpus/vault; teammates pull it at install — see [Teams](docs/site/teams.md)). The harness ships: the knowledge format (claims with locators, patterns, decisions, commitments), the deterministic context compiler (`wf context` — every inclusion/exclusion carries a reason, persisted receipts), contract enforcement (lint + CI gate), behavior evaluations, and the self-building domain vocabulary. Optional integrations: graphify (call-graph staleness + code navigation), obsidian (two-way vault: human wiki edits flow back as evidence), judgment tier (local decision models — ollama serves the System One wire, Tev/Nimble — for eval gates, retrieval fusion rerank, and review triage), embeddings (semantic re-rank, off by default), team sync (solo direct-push or PR-gated distribution). The fabric also serves its core surface as **MCP tools** (`wf-mcp`) for any MCP client. See [Architecture](docs/site/architecture.md) for the pipeline and [Core Workflows](docs/site/core-workflows.md) for the loop with scenarios.
89
+
90
+ ## Documentation
91
+
92
+ Full docs at **[hybridindie.github.io/wiki-fabric](https://hybridindie.github.io/wiki-fabric/)** — with search.
93
+
94
+ | Start here | Then |
95
+ |-----|----------|
96
+ | [Getting Started](docs/site/getting-started.md) · [Why not just a wiki or RAG?](docs/site/why.md) | [Architecture](docs/site/architecture.md) · [Core Workflows](docs/site/core-workflows.md) · [Task Context](docs/site/context.md) |
97
+ | [Configuration](docs/site/configuration.md) · [CLI Reference](docs/site/cli.md) | [Model policy & evals](docs/site/evals.md) · [Governance](docs/site/governance.md) · [Team Sync](docs/site/sync.md) |
98
+ | [OKF v0.2](docs/site/okf.md) · [Machine-Readable Contract](docs/site/machine-contract.md) | [Integrations](docs/site/integrations.md) · [Troubleshooting](docs/site/troubleshooting.md) |
99
+
100
+ ## Status
101
+
102
+ - **Works today:** capture → ingest → query → promote loop (claims carry provenance edges from chats/PRs); deterministic context compiler + lineage/provenance lines at task time; persisted context receipts + delivery/outcome linkage; locator re-verification (rewrite/repair/restore/contest); chat-mined gated pattern candidates; harvested open-questions loop; prospective-memory commitments; judgment tier (G4-J + mining refinement + ingest effect verification + opt-in context re-rank); git-hooks automation incl. merge-time capture; team sync with teammate corpus pull + PR mode; Obsidian two-way vault; MCP server; OKF v0.2 export/import; writer/bookkeeper wiki generation + static-site publish + utility write-back.
103
+ - **Next:** judgment-informed context re-rank (opt-in `wf context --judge-borderline`; core stays 0-token), scheduled upstream-freshness CI, embeddings re-ranking (shipped, off by default — value conditions in Integrations), multi-harness skill packs.
104
+ - **Contributing:** see [CONTRIBUTING.md](CONTRIBUTING.md). The fabric self-documents — if something isn't clear, that's a bug in the fabric; issues welcome.
105
+
106
+ ## License
107
+
108
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,79 @@
1
+ # Wiki Fabric
2
+
3
+ [![CI](https://github.com/hybridindie/wiki-fabric/actions/workflows/ci.yml/badge.svg)](https://github.com/hybridindie/wiki-fabric/actions/workflows/ci.yml)
4
+ [![Docs](https://img.shields.io/badge/docs-wiki--fabric.site-blue)](https://hybridindie.github.io/wiki-fabric/)
5
+
6
+ > **Git-native, testable knowledge governance for AI coding agents.**
7
+ > Project memory that is scoped by precedence, traceable to evidence, enforced by CI — and *provably delivered* before an agent writes code.
8
+
9
+ **Positioning in one line:** Wiki Fabric treats repository knowledge as operational infrastructure for agents — a governed context layer, not a note vault. Where generic "LLM wiki" projects stop at self-maintaining Markdown, Wiki Fabric adds the three things that make knowledge *trustworthy at task time*: scope with precedence, provenance with staleness gates, and behavior evaluations that measure whether the knowledge changed the agent's decision. It is one substrate of agent memory — the durable, Git-governed one — not the whole capability: the agent's context window and working state remain the harness's to manage. And it is **local-first, cloud-optional**: the daily loop runs on-device with zero tokens; LLM stages route per-repo, per-stage (privacy tiering) when you want them.
10
+
11
+ > [!WARNING]
12
+ > **Early alpha — expect breaking changes.** The core loop works end-to-end
13
+ > (capture → ingest → query → promote, verified on real projects), and the tool
14
+ > now packages cleanly (`uv tool install wiki-fabric`, pure-python dispatch,
15
+ > Windows-first-class). But schemas still move without migration scripts,
16
+ > claim-extraction quality varies by model, and the corpus CI/freshness job is
17
+ > still manual. Useful today if you want to shape the direction — not yet
18
+ > load-bearing team infrastructure.
19
+
20
+ ## Quick start
21
+
22
+ ```bash
23
+ # See the value in 5 seconds (no install):
24
+ bash scripts/demo.sh
25
+
26
+ # Install (packaged, atomic):
27
+ uv tool install wiki-fabric # the wf CLI
28
+ uv tool install wiki-fabric --with mcp # + the wf-mcp MCP server
29
+
30
+ # Teammate: pulls the team corpus automatically when the remote carries one
31
+ # (--vault <path> pins where the vault shell lives):
32
+ curl -fsSL https://raw.githubusercontent.com/hybridindie/wiki-fabric/main/scripts/wiki-fabric.sh | bash -s -- --corpus git@github.com:your-org/wiki-fabric-corpus.git
33
+
34
+ wf status # fabric health
35
+ wf bootstrap /path/to/my-project # connect a project (--extract local for privacy)
36
+ wf capture my-project # pull docs from upstream repos → evidence/raw/
37
+ wf ingest evidence/raw/my-project/docs/readme.md --extract-claims
38
+ wf query "Why does my code batch writes?"
39
+ wf context --task "Add token rotation to the OAuth service"
40
+ wf log --project my-project --problem "..." --intervention "..." --outcomes "..."
41
+
42
+ # The agent harness POV (always-on block arrives at session start):
43
+ wf context --task "..." --write-receipt # step 1: scoped manifest + receipt (0 tokens)
44
+ wf query "..." # step 2: evidence with line locators (0 tokens)
45
+ # step 3: the agent writes code
46
+ wf log --project my-project --receipt <receipt-id> ... # step 4: outcome ↔ delivery
47
+ wf gate # step 5: surface anything awaiting a human
48
+
49
+ # Make it a team system (gh CLI creates + publishes the corpus repo):
50
+ wf sync setup
51
+ # Upstream moves while machines sleep → the scheduled freshness cycle:
52
+ wf freshness --dry-run # capture-git + mechanical re-verify (0 tokens)
53
+ ```
54
+
55
+ The daily loop — connect → capture → ingest → validate → context → work → mine/review — compounding at step 7 into step 5's context for the next project. Full walkthrough, flags, and requirements: **[Getting Started](https://hybridindie.github.io/wiki-fabric/getting-started.html)**.
56
+
57
+ ## What it is
58
+
59
+ Two trees: the **harness** (tooling, this repo) and the **fabric** (your knowledge — gitignored, lives in the corpus/vault; teammates pull it at install — see [Teams](docs/site/teams.md)). The harness ships: the knowledge format (claims with locators, patterns, decisions, commitments), the deterministic context compiler (`wf context` — every inclusion/exclusion carries a reason, persisted receipts), contract enforcement (lint + CI gate), behavior evaluations, and the self-building domain vocabulary. Optional integrations: graphify (call-graph staleness + code navigation), obsidian (two-way vault: human wiki edits flow back as evidence), judgment tier (local decision models — ollama serves the System One wire, Tev/Nimble — for eval gates, retrieval fusion rerank, and review triage), embeddings (semantic re-rank, off by default), team sync (solo direct-push or PR-gated distribution). The fabric also serves its core surface as **MCP tools** (`wf-mcp`) for any MCP client. See [Architecture](docs/site/architecture.md) for the pipeline and [Core Workflows](docs/site/core-workflows.md) for the loop with scenarios.
60
+
61
+ ## Documentation
62
+
63
+ Full docs at **[hybridindie.github.io/wiki-fabric](https://hybridindie.github.io/wiki-fabric/)** — with search.
64
+
65
+ | Start here | Then |
66
+ |-----|----------|
67
+ | [Getting Started](docs/site/getting-started.md) · [Why not just a wiki or RAG?](docs/site/why.md) | [Architecture](docs/site/architecture.md) · [Core Workflows](docs/site/core-workflows.md) · [Task Context](docs/site/context.md) |
68
+ | [Configuration](docs/site/configuration.md) · [CLI Reference](docs/site/cli.md) | [Model policy & evals](docs/site/evals.md) · [Governance](docs/site/governance.md) · [Team Sync](docs/site/sync.md) |
69
+ | [OKF v0.2](docs/site/okf.md) · [Machine-Readable Contract](docs/site/machine-contract.md) | [Integrations](docs/site/integrations.md) · [Troubleshooting](docs/site/troubleshooting.md) |
70
+
71
+ ## Status
72
+
73
+ - **Works today:** capture → ingest → query → promote loop (claims carry provenance edges from chats/PRs); deterministic context compiler + lineage/provenance lines at task time; persisted context receipts + delivery/outcome linkage; locator re-verification (rewrite/repair/restore/contest); chat-mined gated pattern candidates; harvested open-questions loop; prospective-memory commitments; judgment tier (G4-J + mining refinement + ingest effect verification + opt-in context re-rank); git-hooks automation incl. merge-time capture; team sync with teammate corpus pull + PR mode; Obsidian two-way vault; MCP server; OKF v0.2 export/import; writer/bookkeeper wiki generation + static-site publish + utility write-back.
74
+ - **Next:** judgment-informed context re-rank (opt-in `wf context --judge-borderline`; core stays 0-token), scheduled upstream-freshness CI, embeddings re-ranking (shipped, off by default — value conditions in Integrations), multi-harness skill packs.
75
+ - **Contributing:** see [CONTRIBUTING.md](CONTRIBUTING.md). The fabric self-documents — if something isn't clear, that's a bug in the fabric; issues welcome.
76
+
77
+ ## License
78
+
79
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,61 @@
1
+ [build-system]
2
+ requires = ["setuptools>=75"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "wiki-fabric"
7
+ version = "0.3.1"
8
+ description = "Evidence-first knowledge base that compounds across projects — one fabric, many project namespaces"
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ keywords = ["wiki", "knowledge-base", "agents", "claude", "opencode", "evidence", "provenance", "okf", "mcp"]
14
+
15
+ dependencies = [
16
+ "pyyaml>=6.0",
17
+ "openai>=1.40",
18
+ "anthropic>=0.40",
19
+ ]
20
+
21
+ [project.scripts]
22
+ # Phase 2 (#118): pure-python dispatch — verbs map to shipped scripts.
23
+ wf = "wiki_fabric.cli:main"
24
+ # #117: the fabric's core surface as MCP tools (the `mcp` extra)
25
+ wf-mcp = "wiki_fabric.mcp_server:main"
26
+
27
+ [project.urls]
28
+ Homepage = "https://hybridindie.github.io/wiki-fabric/"
29
+ Repository = "https://github.com/hybridindie/wiki-fabric"
30
+ Issues = "https://github.com/hybridindie/wiki-fabric/issues"
31
+
32
+ [project.optional-dependencies]
33
+ # #117: the MCP server extra (same shape as graphify's mcp extra).
34
+ mcp = ["mcp>=2,<3"]
35
+ embeddings = ["numpy", "sentence-transformers"]
36
+ # On-device compiler routes (llm.local_model): HF download + backends.
37
+ # llama-cpp-python (GGUF) is universal — the recommended testing backend;
38
+ # mlx-lm is Apple-Silicon-only (faster on M-series when installed).
39
+ local = [
40
+ "huggingface_hub>=0.24",
41
+ "llama-cpp-python>=0.3; sys_platform == 'darwin' or sys_platform == 'linux'",
42
+ "mlx-lm>=0.19; sys_platform == 'darwin' and platform_machine == 'arm64'",
43
+ ]
44
+ dev = ["pytest>=8.0", "mcp>=2,<3"]
45
+
46
+ [tool.setuptools.packages.find]
47
+ where = ["src"]
48
+
49
+ [tool.setuptools.package-data]
50
+ # The harness tree IS the product: ship it as data (phase-1 keeps the bash
51
+ # orchestrator as the behavior source; scripts are run, not imported).
52
+ wiki_fabric = ["_harness/**/*"]
53
+
54
+ [tool.pytest.ini_options]
55
+ testpaths = ["tests"]
56
+ markers = [
57
+ "live: runs real on-device models (GGUF/MLX) — slow; deselect with -m 'not live'",
58
+ ]
59
+
60
+ [tool.uv]
61
+ package = true
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,39 @@
1
+ """wiki-fabric — evidence-first knowledge base that compounds across projects.
2
+
3
+ Phase 2 (#118): the dispatcher is pure python (no bash dependency) — every
4
+ verb maps to the shipped script it always ran, executed with the right
5
+ interpreter. The harness tree ships as package data; install/update are
6
+ owned by uv (no script-copy, no CLI/harness drift). Windows-first-class.
7
+ """
8
+ from pathlib import Path
9
+
10
+ try:
11
+ from importlib.metadata import version as _version
12
+ __version__ = version("wiki-fabric")
13
+ except Exception: # dev checkout without install — keep in sync with pyproject
14
+ __version__ = "0.3.1"
15
+
16
+ # Packaged-install detection (phase 2): the _harness tree beside this package
17
+ # means wf runs from a uv tool install — update/status key off WF_PACKAGED.
18
+ import os as _os
19
+ _here = Path(__file__).resolve().parent
20
+ if (_here / "_harness" / "scripts").exists():
21
+ _os.environ.setdefault("WF_PACKAGED", "1")
22
+
23
+
24
+ def package_root() -> Path:
25
+ """Root of the shipped harness tree (scripts/, system/, templates/...).
26
+
27
+ In an editable/checkout install this is the repo root; in a wheel install
28
+ the harness tree is packaged data under wiki_fabric/_harness/."""
29
+ here = Path(__file__).resolve().parent
30
+ harness = here / "_harness"
31
+ if (harness / "scripts" / "wiki-fabric.sh").exists():
32
+ return harness
33
+ # editable/dev install: the repo root is two levels up
34
+ return here.parent.parent
35
+
36
+
37
+ def runner_script() -> Path:
38
+ """The bash orchestrator shipped inside the package."""
39
+ return package_root() / "scripts" / "wiki-fabric.sh"
@@ -0,0 +1,4 @@
1
+ from .cli import run
2
+
3
+ if __name__ == "__main__":
4
+ run()
@@ -0,0 +1,152 @@
1
+ ---
2
+ title: AGENTS.md
3
+ type: index
4
+ ---
5
+
6
+ # Wiki Fabric — Agent Instructions
7
+
8
+ Wiki Fabric is a git-native knowledge base that compounds across projects. It is a
9
+ **conformant OKF v0.2 bundle**: markdown + YAML frontmatter, readable by any
10
+ agent without special tooling. Projects connect as namespaces; a global fabric
11
+ lives outside them (typically a sibling `wiki-fabric/` directory) and is the
12
+ persistent memory layer.
13
+
14
+ ## Non-Negotiable Rules
15
+
16
+ 1. **Every claim traces to evidence.** Each claim has `source_refs` with
17
+ `source` + `locator` + `quote`. No evidence, no citation by a concept or
18
+ pattern.
19
+ 2. **Never re-ingest an unchanged source.** Check sha256 first
20
+ (`wf ingest --changed <slug>` only ingests drift).
21
+ 3. **Lint 0 errors before every commit.** `wf lint` (full profile) and
22
+ `wf lint --okf` (OKF §11 floor) must both pass.
23
+ 4. **Extraction is spending; retrieval is free.** Deterministic walkers
24
+ (query, context, lint) cost 0 tokens. The LLM is only invoked for
25
+ extraction and synthesis.
26
+ 5. **Human gate before canonical writes.** Stage in `evidence/`, present the
27
+ change-set manifest, ask before merging into canonical pages.
28
+ 6. **Raw is immutable.** Never edit `evidence/raw/` in place; re-capture.
29
+ 7. **Actor convention**: `agent/<owner>/<model>`, `human:<id>`,
30
+ `process:<id>`. Lint rejects malformed actors.
31
+ 8. **No secrets in content.** `fabric.yaml` is gitignored; never commit
32
+ API keys, tokens, or credentials.
33
+
34
+ ## Before you start
35
+
36
+ - **Check for a dirty tree first.** `git status --porcelain` must be empty (or
37
+ intentionally staged) before branching/committing — a large uncommitted
38
+ restructure is easy to clobber. Surface dirtiness to the user, don't `git
39
+ clean`/`checkout` over it.
40
+ - **Confirm the CLI is current.** `wf status` reports `CLI: STALE` when the
41
+ installed `wf` differs from the harness. Until synced (`wf update`), run the
42
+ harness script directly: `bash scripts/wiki-fabric.sh <cmd> ...`.
43
+ - **Session start:** run `wf gate` — surfaces pending human decisions (claims,
44
+ promotion dossiers, domain proposals). See the always-on block.
45
+
46
+ ## Common Tasks
47
+
48
+ | Task | Command | LLM cost | Notes |
49
+ |------|---------|----------|-------|
50
+ | Compile task context | `wf context --task "<task>"` | **0** | Deterministic manifest: claims, patterns, decisions, skills. Add `--write-receipt` to persist an auditable delivery record (receipt-v1) |
51
+ | Answer a question | `wf query "<question>"` | **0** | Evidence-backed answer with locators |
52
+ | Capture upstream docs | `wf capture <slug>` | 0 | Copies from source repos → `evidence/raw/` |
53
+ | Ingest a source | `wf ingest <path> [--extract-claims]` | 1 call | Source record + summary + claims |
54
+ | Detect drift | `graphify-bridge.py --diff` | 0 | Only when graphify integration is enabled |
55
+ | Upstream freshness | `wf freshness [--dry-run]` | 0 | #84: capture-git (sha256-gated) + mechanical re-verify per connected repo; scheduled on the corpus CI (scaffolded by `wf sync init/setup`; opt-in var `WIKI_FABRIC_FRESHNESS=1`) |
56
+ | Verify a computation | `references/attesters/*.py` | **0** | Deterministic receipt checks (no LLM) |
57
+ | Export portable bundle | `wf okf export` | **0** | Deterministic, okflint-conformant output |
58
+ | Route extraction/synthesis | `repos.<slug>.extract` / `.synthesize` / `.dossier` | — | Per-repo, per-stage: `"cloud"` (default) or `"local"` (on-device — MLX on Apple Silicon, GGUF elsewhere; model = `llm.local_model`) — privacy + quality tiering |
59
+ | Ensure local model | `wf models ensure [--yes]` | 0 | Check `llm.local_model` is cached; offer human-gated download (`--check` for scripts) |
60
+ | Import external bundle | `wf okf import <bundle>` | 0 or 1/doc | Trust recorded, not inherited |
61
+ | Log an experience | `wf log --project <slug>` | 0 | Feeds cross-project mining |
62
+ | Record a deferred obligation | `projects/<slug>/commitments/*.md` | 0 | `type: commitment` — resurfaces in `wf context` when its `trigger` matches the task; contract in `schemas/frontmatter.md` |
63
+ | Health check | `wf lint` | **0** | 0-error gate before commit |
64
+
65
+ ## When NOT to use the LLM
66
+
67
+ - **Never call the LLM to search the fabric** — `query.py` and `context.py`
68
+ retrieve via lexical + graph expansion (0 tokens). The System One fusion
69
+ rerank (`systemone_rank`) is the one ranking signal on top of lexical
70
+ order — a *local* decision model (ollama `/v1/systemone`, egress-free,
71
+ latency-budgeted 2s, silent fall-back to lexical when disabled/down).
72
+ Judgment-tier gated (`integrations.judgment.enabled`); a decision model
73
+ is a judge, never a content writer.
74
+ - **Never call the LLM to cluster claims** — `mine-promotions.py` uses
75
+ keyword-based Jaccard clustering; the LLM only writes the dossier.
76
+ - **Never call the LLM to check code symbols** — `build-entity-index.py`
77
+ uses AST parsing.
78
+ - **Never call the LLM to check conformance** — `lint --okf` and
79
+ `okflint` are deterministic.
80
+
81
+ ## Anti-Loop Rules
82
+
83
+ 1. **Ingest once** — matching sha256 = skip.
84
+ 2. **Query before ingest** — check the catalog for an existing record.
85
+ 3. **Lint before commit** — `wf lint` must return 0 errors.
86
+ 4. **Ask before canonical edits** — stage in `evidence/` first, present
87
+ the manifest + diff for review.
88
+ 5. **One operation per commit** — don't batch ingest + promote + synthesize.
89
+ 6. **Compiler model policy** — claim extraction, synthesis, and promotion
90
+ mining run on `llm.compiler_model`. Model swaps require a recorded
91
+ compiler eval (G4). `promote`/`mine` refuse without it.
92
+ 7. **Import shared modules, don't re-implement** — `fabric_config.py`
93
+ (config/routing/actors), `extract_backends.py` (claim extraction),
94
+ `wf_common.py` (frontmatter/norm/slugify), `eval_core.py` (scoring
95
+ primitives), `local_llm.py` (on-device generation). A local copy of one of
96
+ these helpers is a bug waiting to drift; lint/tests guard the import shape.
97
+
98
+ ## Where Things Live
99
+
100
+ Two trees: the **harness** (shipped here) and the **fabric** (gitignored user
101
+ content; fresh clones carry `.gitkeep`ed skeletons of the content dirs).
102
+
103
+ - **Content (fabric)**: `evidence/` (sources, summaries, claims), `patterns/`,
104
+ `skills/`, `concepts/`, `domains/`, `projects/` — these paths are the OKF
105
+ bundle layout and are load-bearing (scope model, lint, okflint)
106
+ - **Registry (fabric+harness)**: `registry/catalog.json` (auto-generated),
107
+ `registry/log.md` (append-only timeline, OKF §9 shape)
108
+ - **Schemas**: `schemas/frontmatter.md` (per-type contracts),
109
+ `schemas/ontology.md` (domain taxonomy)
110
+ - **Evaluations**: `evaluations/` (golden corpus, behavior fixtures)
111
+ - **Attested computations**: `global/computations/` (contracts)
112
+ - **Attesters + executor skills**: `references/attesters/`, `references/skills/`
113
+ - **Agent-facing assets**: `system/skills/` (ingest, promote — loaded via
114
+ `wf skill <name>` on any harness), `system/always-on/`,
115
+ `system/opencode/plugins/`
116
+ - **Templates + examples**: `templates/` (page scaffolds), `templates/examples/`
117
+ - **Project overlay**: `.wiki-overlay.md` in each connected project root
118
+ (per-project config — routing, identity; discovered by the fabric)
119
+ - **Git hooks (required per project)**: `wf hook install` — post-commit
120
+ captures doc drift (sha256-gated), post-merge re-syncs; the freshness
121
+ guarantee depends on them
122
+ - **Shared modules**: `scripts/lib/fabric_config.py`, `scripts/lib/extract_backends.py`,
123
+ `scripts/lib/local_llm.py`, `scripts/lib/wf_common.py`, `scripts/lib/eval_core.py`
124
+ plus `judgment.py` (judgment tier) and `embed_index.py` (embedding index) — a local copy of one of these helpers is a bug waiting to drift; lint/tests guard the import shape.
125
+
126
+ ## Tests
127
+
128
+ - `python3 -m pytest tests/ -q` — full suite.
129
+ - Tests marked `live` run real on-device models (GGUF/MLX); skip on slow
130
+ machines with `pytest -m "not live"`. They self-skip when the model isn't
131
+ cached or the platform lacks the backend.
132
+
133
+ See `README.md` for the full architecture, OKF conformance details, and
134
+ the promotion pipeline narrative.
135
+
136
+ ## wiki-fabric (opencode)
137
+ ## wiki-fabric
138
+
139
+ This project is connected to a knowledge fabric (`.wiki-overlay.md` declares the namespace; the fabric lives at `~/.local/share/wiki-fabric/` by default — `WIKI_FABRIC_DIR` overrides).
140
+
141
+ Rules:
142
+ - Before starting a task, run `wf context --task "<task>" --write-receipt` (0 tokens) — it compiles a scoped manifest of relevant claims, patterns, and decisions (project > domain > global precedence) with exclusion reasons. The `--write-receipt` flag persists a delivery record (the manifest + provenance, still on stdout) so outcomes can later be reviewed against what was known: receipts are the default delivery record, zero extra cost.
143
+ - For codebase/architecture questions, run `wf query "<question>"` (0 tokens) before grepping — evidence-backed answers with locators.
144
+ - Health before commit: `wf lint` (0-error gate). Status: `wf status`. Before mutating the repo, confirm it is clean: `git status --porcelain` should be empty — if it lists many uncommitted changes (a dirty restructure), surface that to the user rather than branching/committing over it. If `wf status` reports a STALE installed CLI, run the harness script directly (`bash scripts/wiki-fabric.sh ...`) or `wf update` before relying on `wf` subcommands.
145
+ - After solving a non-trivial problem, log it: `wf log --project <slug> --receipt <receipt-id>` (the receipt id is in the `wf context --write-receipt` stderr output) — receipt ↔ outcome linkage is the delivery/outcome evidence plane mining uses.
146
+ - Never re-ingest a source whose sha256 is already recorded — the CLI skips it and tells you.
147
+ - Promotion is human-gated: `wf` proposes dossiers, only you promote.
148
+ - At session start, run `wf gate` — it aggregates every pending human decision (overdue/stale claims, promotion dossiers awaiting review, newly-proposed domains, open questions awaiting triage) into one report; `wf gate --deliveries` surfaces recent context receipts for delivery-vs-outcome review. Surface whichever are actionable to the user before proceeding. Resolve with: `wf review --auto-reverify`, `wf promote --promote <dossier>`, `wf promote-domains --apply <dossier>`, `wf promote-questions --apply <id>`. If the git hook ran, it already persisted these to `registry/pending-gate.md` — read that instead of running commands (0 tokens).
149
+ - **Procedures on demand:** run `wf skill <name>` before these workflows — `ingest`, `promote` (`wf skill --list` shows the current set). Read the procedure before running the workflow the first time in a session.
150
+
151
+ CLI: `wf help` | When graphify is also installed: graphify owns code-symbol/call-graph questions; wiki-fabric owns evidence-backed knowledge (`wf query` — claims with doc locators). Prefer `wf context` for task scoping. They complement — neither replaces the other.
152
+ <!-- /wiki-fabric:opencode -->
@@ -0,0 +1,31 @@
1
+ ---
2
+ type: eval-fixture
3
+ id: behavior-gate-partition
4
+ title: "Behavior fixture partition (living-wiki S2 / SkillOpt S2)"
5
+ description: "Seed-fixed split of behavior fixtures into a working set (development) and a held-out gate set (promote-only) — candidates cannot fit the gate they are gated on."
6
+ created: 2026-09-28
7
+ ---
8
+
9
+ # Behavior fixture partition
10
+
11
+ The gate contract (#139 / SkillOpt-epic S2): `promote.py` runs the **held-out
12
+ gate set** against the candidate's merge; the candidate must not lower
13
+ Knowledge Utility on that set. Fixtures below are partitioned with a fixed
14
+ seed (`partition_seed: 42`); the gate set is touched ONLY by promote — new
15
+ fixture development happens in the working set, so a candidate (and the
16
+ author writing it) cannot fit the gate it is gated on.
17
+
18
+ | Set | Fixtures | Use |
19
+ |---|---|---|
20
+ | **held-out gate** | `be2`, `be4`, `be5` | promote.py pre-merge gate only |
21
+ | **working set** | `be1`, `be3`, `be6` | fixture development, CI (eval-behavior default run) |
22
+
23
+ Rules:
24
+ - Moving a fixture between sets is a contract change: edit this file + justify
25
+ in the change-set (the seed makes it auditable, not casual).
26
+ - `eval-behavior.py --gate` runs ONLY the held-out set (used by promote.py).
27
+ - Utility baseline: the gate compares the merge-candidate corpus against the
28
+ pre-merge corpus on the held-out set; **strictly-positive** for `standard`
29
+ promotion, ties accepted-but-flagged for `recommended`, per the gate matrix
30
+ (skills: strictly-better, ties rejected; anti-patterns: no utility gate —
31
+ counterexamples + human review only; concepts/domains: lint + human only).
@@ -0,0 +1,64 @@
1
+ ---
2
+ type: eval-fixture
3
+ title: "Behavior: agent avoids the banned shared token cache"
4
+ eval_id: be1-avoid-anti-pattern
5
+ task: "Add token refresh to the auth service"
6
+ scope_layers: [global, project]
7
+ seeds:
8
+ - path: patterns/pattern-token-rotation.md
9
+ type: pattern
10
+ status: recommended
11
+ maturity: 2
12
+ body: |
13
+ # Pattern: Rotate tokens on refresh
14
+
15
+ When a refresh flow issues new tokens, the previous token must be rotated
16
+ (mark old + issue new), never extended. Reuse of a rotated token is an
17
+ auth-failure signal: revoke the token family.
18
+ - path: anti-patterns/anti-pattern-shared-token-cache.md
19
+ type: anti-pattern
20
+ status: recommended
21
+ maturity: 2
22
+ body: |
23
+ # Anti-pattern: Shared token cache
24
+
25
+ Caching tokens in a shared store (redis, DB) and serving any instance's
26
+ request with any cached token caused cross-session token bleed in 2
27
+ independent projects. Token caches must be per-session and invalidated
28
+ on rotation. Misleading fix: "just add TTL" — TTL does not prevent
29
+ cross-session reuse.
30
+ - path: projects/auth-service/decisions/decision-rotation.md
31
+ type: decision
32
+ status: accepted
33
+ body: |
34
+ The auth service chose rotating refresh tokens over server-side session
35
+ extension. Session-extension proposals should be redirected.
36
+ manifest_expectations:
37
+ must_include_stems: [anti-pattern-shared-token-cache, pattern-token-rotation, decision-rotation]
38
+ must_exclude_stems: []
39
+ probe:
40
+ question: "How should token refresh be implemented for the auth service?"
41
+ # With the manifest, a compliant answer implements rotation + per-session
42
+ # storage and does NOT propose a shared cache or session extension.
43
+ must_not_contain:
44
+ - "shared cache"
45
+ - "shared token cache"
46
+ - "redis"
47
+ - "extend the session"
48
+ - "session extension"
49
+ must_contain:
50
+ - "rotat"
51
+ - "per-session"
52
+ zero_llm_check:
53
+ # Manifest-level proof (no LLM): knowledge that changes behavior is delivered
54
+ banned_terms_in_prompt: ["shared token cache", "DO NOT", "per-session"]
55
+ binding_decision_in_prompt: true
56
+ pattern_in_prompt: true
57
+ ---
58
+
59
+ # BE1 — avoid registered anti-pattern
60
+
61
+ The agent receives the context manifest for a token-refresh task. A compliant
62
+ implementation must not introduce the banned shared cache and must implement
63
+ rotation with per-session storage. Tests whether fabric knowledge prevents a
64
+ known failure mode.
@@ -0,0 +1,48 @@
1
+ ---
2
+ type: eval-fixture
3
+ title: "Behavior: agent honors project constraint over general preference"
4
+ eval_id: be2-project-over-global
5
+ task: "Persist auth sessions for the auth service"
6
+ scope_layers: [global, project]
7
+ seeds:
8
+ - path: projects/auth-service/decisions/decision-rotation.md
9
+ type: decision
10
+ status: accepted
11
+ body: |
12
+ The auth service chose rotating refresh tokens over server-side session
13
+ extension. Rationale: stateless horizontal scaling. Session-extension
14
+ proposals should be redirected.
15
+ - path: patterns/pattern-session-store.md
16
+ type: pattern
17
+ status: recommended
18
+ maturity: 2
19
+ body: |
20
+ # Pattern: Server-side session store
21
+
22
+ For stateful services, a server-side session store with sticky routing
23
+ is a reasonable default. Requires horizontal-scaling review.
24
+ manifest_expectations:
25
+ # The project decision must win: it is P1 and explicitly redirects
26
+ # session-extension proposals. The generic pattern is still delivered
27
+ # (it is valid elsewhere) but the manifest's precedence section resolves
28
+ # the conflict.
29
+ must_include_stems: [decision-rotation]
30
+ must_exclude_stems: []
31
+ probe:
32
+ question: "Should we add server-side session storage to persist auth sessions?"
33
+ must_not_contain:
34
+ - "let's add a session store"
35
+ - "recommend session extension"
36
+ must_contain:
37
+ - "rotating refresh tokens"
38
+ zero_llm_check:
39
+ banned_terms_in_prompt: []
40
+ binding_decision_in_prompt: true
41
+ pattern_in_prompt: true
42
+ ---
43
+
44
+ # BE2 — precedence: project constraint beats general preference
45
+
46
+ The general pattern (session store) matches the task text, but the project
47
+ decision explicitly rejects it for this service. A compliant agent defers to
48
+ the binding decision and says so.