@interf/compiler 0.2.5 → 0.3.1

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 (276) hide show
  1. package/README.md +192 -187
  2. package/dist/bin.js +3 -3
  3. package/dist/bin.js.map +1 -1
  4. package/dist/commands/compile.d.ts +1 -0
  5. package/dist/commands/compile.d.ts.map +1 -1
  6. package/dist/commands/compile.js +45 -138
  7. package/dist/commands/compile.js.map +1 -1
  8. package/dist/commands/create-workflow-wizard.d.ts +4 -25
  9. package/dist/commands/create-workflow-wizard.d.ts.map +1 -1
  10. package/dist/commands/create-workflow-wizard.js +46 -222
  11. package/dist/commands/create-workflow-wizard.js.map +1 -1
  12. package/dist/commands/create.d.ts +2 -11
  13. package/dist/commands/create.d.ts.map +1 -1
  14. package/dist/commands/create.js +78 -477
  15. package/dist/commands/create.js.map +1 -1
  16. package/dist/commands/default.d.ts.map +1 -1
  17. package/dist/commands/default.js +27 -43
  18. package/dist/commands/default.js.map +1 -1
  19. package/dist/commands/doctor.js +2 -2
  20. package/dist/commands/doctor.js.map +1 -1
  21. package/dist/commands/executor-flow.d.ts +9 -0
  22. package/dist/commands/executor-flow.d.ts.map +1 -0
  23. package/dist/commands/executor-flow.js +55 -0
  24. package/dist/commands/executor-flow.js.map +1 -0
  25. package/dist/commands/init.d.ts +1 -0
  26. package/dist/commands/init.d.ts.map +1 -1
  27. package/dist/commands/init.js +320 -321
  28. package/dist/commands/init.js.map +1 -1
  29. package/dist/commands/list.d.ts.map +1 -1
  30. package/dist/commands/list.js +12 -22
  31. package/dist/commands/list.js.map +1 -1
  32. package/dist/commands/reset.d.ts.map +1 -1
  33. package/dist/commands/reset.js +27 -124
  34. package/dist/commands/reset.js.map +1 -1
  35. package/dist/commands/source-config-wizard.d.ts +10 -11
  36. package/dist/commands/source-config-wizard.d.ts.map +1 -1
  37. package/dist/commands/source-config-wizard.js +100 -97
  38. package/dist/commands/source-config-wizard.js.map +1 -1
  39. package/dist/commands/status.d.ts.map +1 -1
  40. package/dist/commands/status.js +60 -56
  41. package/dist/commands/status.js.map +1 -1
  42. package/dist/commands/test-flow.d.ts +21 -0
  43. package/dist/commands/test-flow.d.ts.map +1 -0
  44. package/dist/commands/test-flow.js +106 -0
  45. package/dist/commands/test-flow.js.map +1 -0
  46. package/dist/commands/test.d.ts +4 -0
  47. package/dist/commands/test.d.ts.map +1 -0
  48. package/dist/commands/test.js +131 -0
  49. package/dist/commands/test.js.map +1 -0
  50. package/dist/commands/verify.d.ts.map +1 -1
  51. package/dist/commands/verify.js +63 -98
  52. package/dist/commands/verify.js.map +1 -1
  53. package/dist/commands/workspace-flow.d.ts +21 -0
  54. package/dist/commands/workspace-flow.d.ts.map +1 -0
  55. package/dist/commands/workspace-flow.js +90 -0
  56. package/dist/commands/workspace-flow.js.map +1 -0
  57. package/dist/index.d.ts +8 -8
  58. package/dist/index.d.ts.map +1 -1
  59. package/dist/index.js +5 -7
  60. package/dist/index.js.map +1 -1
  61. package/dist/lib/agent-constants.js +1 -1
  62. package/dist/lib/agent-constants.js.map +1 -1
  63. package/dist/lib/agent-detection.js +4 -4
  64. package/dist/lib/agent-detection.js.map +1 -1
  65. package/dist/lib/agent-skills.js +6 -6
  66. package/dist/lib/agent-skills.js.map +1 -1
  67. package/dist/lib/benchmark-execution.d.ts.map +1 -1
  68. package/dist/lib/benchmark-execution.js +32 -19
  69. package/dist/lib/benchmark-execution.js.map +1 -1
  70. package/dist/lib/benchmark-sandbox.d.ts +10 -0
  71. package/dist/lib/benchmark-sandbox.d.ts.map +1 -0
  72. package/dist/lib/benchmark-sandbox.js +75 -0
  73. package/dist/lib/benchmark-sandbox.js.map +1 -0
  74. package/dist/lib/benchmark-targets.d.ts +4 -4
  75. package/dist/lib/benchmark-targets.d.ts.map +1 -1
  76. package/dist/lib/benchmark-targets.js +20 -54
  77. package/dist/lib/benchmark-targets.js.map +1 -1
  78. package/dist/lib/benchmark-types.d.ts +2 -3
  79. package/dist/lib/benchmark-types.d.ts.map +1 -1
  80. package/dist/lib/benchmark.d.ts +1 -1
  81. package/dist/lib/benchmark.d.ts.map +1 -1
  82. package/dist/lib/benchmark.js +1 -1
  83. package/dist/lib/benchmark.js.map +1 -1
  84. package/dist/lib/config.d.ts +1 -2
  85. package/dist/lib/config.d.ts.map +1 -1
  86. package/dist/lib/config.js +2 -4
  87. package/dist/lib/config.js.map +1 -1
  88. package/dist/lib/discovery.d.ts +1 -1
  89. package/dist/lib/discovery.d.ts.map +1 -1
  90. package/dist/lib/discovery.js +7 -2
  91. package/dist/lib/discovery.js.map +1 -1
  92. package/dist/lib/eval-packs.d.ts +6 -52
  93. package/dist/lib/eval-packs.d.ts.map +1 -1
  94. package/dist/lib/eval-packs.js +11 -39
  95. package/dist/lib/eval-packs.js.map +1 -1
  96. package/dist/lib/interf-bootstrap.d.ts +3 -5
  97. package/dist/lib/interf-bootstrap.d.ts.map +1 -1
  98. package/dist/lib/interf-bootstrap.js +10 -57
  99. package/dist/lib/interf-bootstrap.js.map +1 -1
  100. package/dist/lib/interf-detect.d.ts +13 -11
  101. package/dist/lib/interf-detect.d.ts.map +1 -1
  102. package/dist/lib/interf-detect.js +59 -45
  103. package/dist/lib/interf-detect.js.map +1 -1
  104. package/dist/lib/interf-scaffold.d.ts +2 -5
  105. package/dist/lib/interf-scaffold.d.ts.map +1 -1
  106. package/dist/lib/interf-scaffold.js +99 -235
  107. package/dist/lib/interf-scaffold.js.map +1 -1
  108. package/dist/lib/interf-workflow-package.d.ts +1 -2
  109. package/dist/lib/interf-workflow-package.d.ts.map +1 -1
  110. package/dist/lib/interf-workflow-package.js +99 -90
  111. package/dist/lib/interf-workflow-package.js.map +1 -1
  112. package/dist/lib/interf.d.ts +4 -5
  113. package/dist/lib/interf.d.ts.map +1 -1
  114. package/dist/lib/interf.js +3 -6
  115. package/dist/lib/interf.js.map +1 -1
  116. package/dist/lib/local-workflows.d.ts +9 -8
  117. package/dist/lib/local-workflows.d.ts.map +1 -1
  118. package/dist/lib/local-workflows.js +56 -92
  119. package/dist/lib/local-workflows.js.map +1 -1
  120. package/dist/lib/obsidian.d.ts +1 -3
  121. package/dist/lib/obsidian.d.ts.map +1 -1
  122. package/dist/lib/obsidian.js +10 -81
  123. package/dist/lib/obsidian.js.map +1 -1
  124. package/dist/lib/registry.d.ts +6 -17
  125. package/dist/lib/registry.d.ts.map +1 -1
  126. package/dist/lib/registry.js +36 -50
  127. package/dist/lib/registry.js.map +1 -1
  128. package/dist/lib/runtime-contracts.d.ts +4 -3
  129. package/dist/lib/runtime-contracts.d.ts.map +1 -1
  130. package/dist/lib/runtime-contracts.js +125 -9
  131. package/dist/lib/runtime-contracts.js.map +1 -1
  132. package/dist/lib/runtime-reconcile.d.ts +3 -5
  133. package/dist/lib/runtime-reconcile.d.ts.map +1 -1
  134. package/dist/lib/runtime-reconcile.js +70 -167
  135. package/dist/lib/runtime-reconcile.js.map +1 -1
  136. package/dist/lib/runtime-runs.d.ts.map +1 -1
  137. package/dist/lib/runtime-runs.js +61 -57
  138. package/dist/lib/runtime-runs.js.map +1 -1
  139. package/dist/lib/runtime-types.d.ts +16 -6
  140. package/dist/lib/runtime-types.d.ts.map +1 -1
  141. package/dist/lib/runtime.d.ts +2 -2
  142. package/dist/lib/runtime.d.ts.map +1 -1
  143. package/dist/lib/runtime.js +1 -1
  144. package/dist/lib/runtime.js.map +1 -1
  145. package/dist/lib/schema.d.ts +69 -311
  146. package/dist/lib/schema.d.ts.map +1 -1
  147. package/dist/lib/schema.js +49 -210
  148. package/dist/lib/schema.js.map +1 -1
  149. package/dist/lib/source-config.d.ts +8 -7
  150. package/dist/lib/source-config.d.ts.map +1 -1
  151. package/dist/lib/source-config.js +59 -63
  152. package/dist/lib/source-config.js.map +1 -1
  153. package/dist/lib/state-artifacts.d.ts +5 -11
  154. package/dist/lib/state-artifacts.d.ts.map +1 -1
  155. package/dist/lib/state-artifacts.js +8 -18
  156. package/dist/lib/state-artifacts.js.map +1 -1
  157. package/dist/lib/state-health.d.ts +4 -8
  158. package/dist/lib/state-health.d.ts.map +1 -1
  159. package/dist/lib/state-health.js +52 -233
  160. package/dist/lib/state-health.js.map +1 -1
  161. package/dist/lib/state-io.d.ts +7 -12
  162. package/dist/lib/state-io.d.ts.map +1 -1
  163. package/dist/lib/state-io.js +32 -93
  164. package/dist/lib/state-io.js.map +1 -1
  165. package/dist/lib/state-view.d.ts +4 -6
  166. package/dist/lib/state-view.d.ts.map +1 -1
  167. package/dist/lib/state-view.js +62 -101
  168. package/dist/lib/state-view.js.map +1 -1
  169. package/dist/lib/state.d.ts +5 -5
  170. package/dist/lib/state.d.ts.map +1 -1
  171. package/dist/lib/state.js +4 -4
  172. package/dist/lib/state.js.map +1 -1
  173. package/dist/lib/summarize-plan.d.ts +2 -2
  174. package/dist/lib/summarize-plan.d.ts.map +1 -1
  175. package/dist/lib/summarize-plan.js +13 -13
  176. package/dist/lib/summarize-plan.js.map +1 -1
  177. package/dist/lib/{validate-kb.d.ts → validate-workspace.d.ts} +49 -8
  178. package/dist/lib/validate-workspace.d.ts.map +1 -0
  179. package/dist/lib/validate-workspace.js +398 -0
  180. package/dist/lib/validate-workspace.js.map +1 -0
  181. package/dist/lib/validate.d.ts +5 -7
  182. package/dist/lib/validate.d.ts.map +1 -1
  183. package/dist/lib/validate.js +22 -20
  184. package/dist/lib/validate.js.map +1 -1
  185. package/dist/lib/workflow-definitions.d.ts +14 -50
  186. package/dist/lib/workflow-definitions.d.ts.map +1 -1
  187. package/dist/lib/workflow-definitions.js +100 -353
  188. package/dist/lib/workflow-definitions.js.map +1 -1
  189. package/dist/lib/workflow-helpers.d.ts +3 -4
  190. package/dist/lib/workflow-helpers.d.ts.map +1 -1
  191. package/dist/lib/workflow-helpers.js +17 -49
  192. package/dist/lib/workflow-helpers.js.map +1 -1
  193. package/dist/lib/workflow-stage-runner.d.ts +1 -2
  194. package/dist/lib/workflow-stage-runner.d.ts.map +1 -1
  195. package/dist/lib/workflow-stage-runner.js +4 -6
  196. package/dist/lib/workflow-stage-runner.js.map +1 -1
  197. package/dist/lib/workflow-starter-docs.d.ts +3 -5
  198. package/dist/lib/workflow-starter-docs.d.ts.map +1 -1
  199. package/dist/lib/workflow-starter-docs.js +2 -17
  200. package/dist/lib/workflow-starter-docs.js.map +1 -1
  201. package/dist/lib/workflows.d.ts +9 -14
  202. package/dist/lib/workflows.d.ts.map +1 -1
  203. package/dist/lib/workflows.js +15 -30
  204. package/dist/lib/workflows.js.map +1 -1
  205. package/dist/lib/workspace-compile.d.ts +51 -0
  206. package/dist/lib/workspace-compile.d.ts.map +1 -0
  207. package/dist/lib/workspace-compile.js +397 -0
  208. package/dist/lib/workspace-compile.js.map +1 -0
  209. package/package.json +9 -9
  210. package/skills/benchmark/SKILL.md +20 -27
  211. package/skills/workflow/create/SKILL.md +10 -14
  212. package/skills/workspace/shape/SKILL.md +15 -0
  213. package/skills/workspace/structure/SKILL.md +15 -0
  214. package/skills/workspace/summarize/SKILL.md +15 -0
  215. package/templates/workspace/README.md +23 -0
  216. package/templates/workspace/interfignore +2 -0
  217. package/dist/commands/benchmark.d.ts +0 -3
  218. package/dist/commands/benchmark.d.ts.map +0 -1
  219. package/dist/commands/benchmark.js +0 -374
  220. package/dist/commands/benchmark.js.map +0 -1
  221. package/dist/lib/bundled-templates.d.ts +0 -5
  222. package/dist/lib/bundled-templates.d.ts.map +0 -1
  223. package/dist/lib/bundled-templates.js +0 -23
  224. package/dist/lib/bundled-templates.js.map +0 -1
  225. package/dist/lib/interf-compile-plan.d.ts +0 -12
  226. package/dist/lib/interf-compile-plan.d.ts.map +0 -1
  227. package/dist/lib/interf-compile-plan.js +0 -143
  228. package/dist/lib/interf-compile-plan.js.map +0 -1
  229. package/dist/lib/validate-interface.d.ts +0 -79
  230. package/dist/lib/validate-interface.d.ts.map +0 -1
  231. package/dist/lib/validate-interface.js +0 -535
  232. package/dist/lib/validate-interface.js.map +0 -1
  233. package/dist/lib/validate-kb.d.ts.map +0 -1
  234. package/dist/lib/validate-kb.js +0 -252
  235. package/dist/lib/validate-kb.js.map +0 -1
  236. package/dist/lib/workflows-interface-contracts.d.ts +0 -24
  237. package/dist/lib/workflows-interface-contracts.d.ts.map +0 -1
  238. package/dist/lib/workflows-interface-contracts.js +0 -304
  239. package/dist/lib/workflows-interface-contracts.js.map +0 -1
  240. package/dist/lib/workflows-interface.d.ts +0 -72
  241. package/dist/lib/workflows-interface.d.ts.map +0 -1
  242. package/dist/lib/workflows-interface.js +0 -377
  243. package/dist/lib/workflows-interface.js.map +0 -1
  244. package/dist/lib/workflows-kb.d.ts +0 -50
  245. package/dist/lib/workflows-kb.d.ts.map +0 -1
  246. package/dist/lib/workflows-kb.js +0 -306
  247. package/dist/lib/workflows-kb.js.map +0 -1
  248. package/skills/interface/analyze/SKILL.md +0 -191
  249. package/skills/interface/compile/SKILL.md +0 -152
  250. package/skills/interface/compile/references/output-format.md +0 -48
  251. package/skills/interface/create/SKILL.md +0 -87
  252. package/skills/interface/create/references/compile-plan-format.md +0 -109
  253. package/skills/interface/create/references/workflows.md +0 -35
  254. package/skills/interface/query/SKILL.md +0 -48
  255. package/skills/interface/retrieve/SKILL.md +0 -133
  256. package/skills/knowledge-base/compile/SKILL.md +0 -196
  257. package/skills/knowledge-base/compile/references/output-format.md +0 -48
  258. package/skills/knowledge-base/compile/references/stage-claims.md +0 -60
  259. package/skills/knowledge-base/compile/references/stage-entities.md +0 -46
  260. package/skills/knowledge-base/query/SKILL.md +0 -45
  261. package/skills/knowledge-base/summarize/SKILL.md +0 -152
  262. package/templates/interface/README.md +0 -159
  263. package/templates/interface/interfaces.md +0 -102
  264. package/templates/knowledge-base/README.md +0 -137
  265. package/templates/knowledge-base/interfignore +0 -19
  266. package/templates/knowledge-base/registry.md +0 -118
  267. package/templates/workflow-package/README.md +0 -16
  268. package/templates/workflow-package/create/SKILL.md +0 -8
  269. package/templates/workflow-package/interface-query/SKILL.md +0 -29
  270. package/templates/workflow-package/interface-stage/SKILL.md +0 -13
  271. package/templates/workflow-package/knowledge-base-query/SKILL.md +0 -36
  272. package/templates/workflow-package/knowledge-base-stage/SKILL.md +0 -13
  273. package/templates/workflow-starters/interface/interf/README.md +0 -13
  274. package/templates/workflow-starters/interface/interf/create/SKILL.md +0 -15
  275. package/templates/workflow-starters/knowledge-base/interf/README.md +0 -13
  276. package/templates/workflow-starters/knowledge-base/karpathy/README.md +0 -13
@@ -1,196 +0,0 @@
1
- ---
2
- {
3
- "name": "knowledge-base/compile",
4
- "description": "Compile the cross-file knowledge layer from summaries in a knowledge base. Discovers entities, claims, relationships, and navigation outputs. Builds knowledge/ and home.md layers. Use when asked to compile a knowledge base, build graph, update knowledge, or connect the dots."
5
- }
6
- ---
7
-
8
- # Compile Knowledge Base
9
-
10
- Read `interf.json` for the config. Must have `type: knowledge-base`.
11
-
12
- Local runtime reference:
13
- - active stage contract: `.interf/stage-contract.json`
14
- - active run ledger: `.interf/run.json`
15
- - local config: `interf.json`
16
- - local instruction docs: the files listed by `.interf/stage-contract.json`
17
-
18
- When this skill is embedded into a generated knowledge base, do not try to open SDK repo docs or source files outside the current workspace. The local contract and local docs are the source of truth for this run.
19
-
20
- This skill builds the cross-file intelligence layer from existing summaries. This is the knowledge-layer contract for a knowledge base. For per-file evidence generation, use the bundled file-evidence stage first.
21
- If local docs are listed by the stage contract, read them before compiling. They may `extend` or `override` the bundled workflow instructions for this stage, but they do not bypass the stage contract.
22
-
23
- Harness role:
24
- - This skill is an internal harness step normally invoked by `interf compile`.
25
- - For standard operation, prefer the CLI or another higher-level tool over calling this skill directly.
26
-
27
- ## CLI status contract
28
-
29
- When this skill is launched by the Interf CLI, do not narrate intent or planning. Only emit user-visible updates that begin with `STATUS:`, `DONE:`, `BLOCKED:`, or `ERROR:`.
30
-
31
- If `.interf/stage-contract.json` exists, treat it as the authoritative stage contract for this run. It defines required artifacts, counts, and execution notes. Follow it instead of improvising a different workflow.
32
-
33
- Use this sequence:
34
- - `STATUS: loaded compile plan N summary files`
35
- - `STATUS: inventoried summaries N/N` after the inventory pass is complete
36
- - `STATUS: read summary files X/N` after each deep-read batch or every 25 files, whichever comes first
37
- - `STATUS: wrote compile outputs` after `knowledge/` and `home.md` are updated
38
- - `DONE: compile complete N/N` when the required outputs are on disk
39
-
40
- If you are blocked or hit an unrecoverable issue, emit `BLOCKED:` or `ERROR:` once with the concrete reason.
41
- Keep scratch commands single-purpose and non-destructive. Do not start by deleting old outputs with `rm`, wildcard cleanup, `;`, or `&&` chains.
42
-
43
- ## Prerequisites check
44
-
45
- Read the stage contract, inventory, and summaries.
46
-
47
- - If `summaries/` is missing or empty: "File-evidence stage not ready yet." Stop.
48
- - Otherwise: proceed.
49
-
50
- ## Execution bias
51
-
52
- This stage builds a reusable substrate, not a full task-specific intelligence layer.
53
-
54
- - for small knowledge bases, prefer the smallest useful retrieval surface over graph sprawl
55
- - for a single report or small folder, do not invent dozens of entities or claims just because the source is rich
56
- - create only the entities, claims, and indexes that materially help later interface retrieval
57
- - if `.interf/stage-contract.json` says `summary_total <= 3`, treat the run as a tiny compile: read every summary overview, write the smallest truthful substrate, and stop
58
- - for a tiny compile, do not spend time designing an elaborate ontology or widening into raw-source exploration
59
- - a tiny compile is successful when it leaves a grounded home page plus a compact retrieval surface in `knowledge/` that later interfaces can build on
60
- - stop once the stable substrate exists; do not keep expanding the ontology out of curiosity
61
-
62
- ## Execution checklist
63
-
64
- ```
65
- Knowledge-base compile:
66
- - [ ] 1. Read interf.json
67
- - [ ] 2. Scan ALL summary frontmatter and write .interf/inventory.json
68
- - [ ] 3. Read the summary overviews needed for a minimal compile
69
- - [ ] 4. Write canonical entities, claims, indexes, and home.md
70
- - [ ] 5. Validate
71
- ```
72
-
73
- ### 1. Read interf.json + local stage docs
74
-
75
- Read `interf.json` for knowledge-base identity and paths. Read `.interf/stage-contract.json` for the active stage contract. Then read any local docs listed by the contract. The summaries in `summaries/` have this structure:
76
-
77
- - **Frontmatter fields**: source, source_kind, evidence_tier, truth_mode, state, abstract
78
- - **Sections**: overview, key claims, references when needed
79
-
80
- This is what you're working with. Every summary has:
81
- - `source` → the exact source file path
82
- - `source_kind`, `evidence_tier`, `truth_mode`, `state` → use these to weight evidence and avoid flattening weak material into strong claims
83
- - `abstract` → quick routing summary for inventory and interface retrieve
84
- - `overview` / `key claims` → source-grounded detail for deeper reads
85
-
86
- The compile job is to turn these file-level evidence objects into a retrieval-ready knowledge base. Use the active stage contract plus any local docs listed by it for entity discovery rules, claim derivation logic, and quality requirements.
87
- Prefer source-domain entities over document-shell entities. A report PDF is evidence, not the main ontology. If a market report summary names covered markets, segments, publishers, or themes, compile those as the primary retrieval surface instead of centering the document title alone.
88
-
89
- ### 2. Scan summaries and create inventory
90
-
91
- Scan ALL summaries/ frontmatter once. This step is deterministic and must complete before synthesis.
92
-
93
- Write `.interf/inventory.json`:
94
-
95
- Write a full inventory ledger in the current runtime shape. At minimum:
96
- - `total` must equal the actual `summaries/` file count for this run
97
- - every summary must have a corresponding inventory entry
98
- - prefer the current `entries[]` runtime shape over legacy `files[]`
99
- - for current `entries[]` inventory entries, include at least `source`, `summary`, `frontmatter_scanned: true`, and the overview-read proof the validators use (`abstract`, `abstract_read: true`, or an equivalent current-state field)
100
- - per-summary entries should preserve the fields the runtime and validators use, such as file path, source path, source metadata, and whether frontmatter or deeper reads were completed
101
- - for legacy `files[]` inventory entries, use `frontmatter_scanned: true` after the frontmatter pass and `abstract_read: true` after the summary overview read
102
- - do not invent alternate flag names for those validator-facing fields
103
- - if you include `summary_map`, derive it from the current inventory instead of copying sample aggregates from docs
104
-
105
- Verify: `total` in inventory MUST equal the actual summaries/ file count. If not, stop.
106
-
107
- Then read the summary overviews needed for synthesis:
108
-
109
- - if `N <= 25`, read every summary overview
110
- - if `N > 25`, read all high-signal summaries plus enough additional summaries to build a stable substrate
111
- - if `N <= 3`, move directly from those overview reads into the smallest honest compile outputs; do not turn a tiny knowledge base into an open-ended graph-design pass
112
-
113
- Do not turn this into an open-ended archival pass. The compile stage should finish in one run for normal small knowledge bases.
114
-
115
- ### 3. Canonicalize entities, threads, and aliases
116
-
117
- **Prerequisite:** inventory.json must cover all summaries, and the overview reads above must be complete for the working set.
118
-
119
- Use the inventory summary_map plus deep-read evidence to identify canonical entities and recurring threads. Create canonical notes in knowledge/entities/ for recurring actors:
120
- - people, companies, products, concepts, projects, and durable threads
121
- - for reports, datasets, and decks, create entities for the covered domain objects when the summary makes them explicit (for example markets, publishers, regions, products, or benchmark topics)
122
- - Resolve aliases to one canonical note
123
- - Include: summary, evidence links, related entities, first/last seen
124
- - Prefer explicit wikilinks to related summaries, entities, and claims so future agents can climb outward through backlinks instead of rereading from scratch
125
- - For a single report or other small KB, prefer a compact set of 2-6 high-signal entities over exhaustive decomposition.
126
-
127
- ### 4. Extract cross-file claims and relationships
128
-
129
- **Prerequisite:** Same as entities.
130
-
131
- Use inventory data plus deep reads to identify patterns across files. Create notes in knowledge/claims/ for cross-file observations:
132
- - Must have 2+ supporting sources unless explicitly marked unresolved or exploratory
133
- - Use prose-as-title: filename IS the claim
134
- - Include: the claim, why it matters, evidence links, and a clear sense of evidence strength
135
- - Link claims back to the supporting summaries and related entities so navigation can move claim -> evidence -> source trail cleanly
136
- - For a single report or small KB, 1-4 strong claims are enough when they capture the main retrieval surface.
137
-
138
- ### 5. Build retrieval indexes and navigation
139
-
140
- Create aggregate navigation in knowledge/indexes/:
141
- - Keep a stable core set first: Companies.md, Markets.md, Themes.md
142
- - Add extra indexes only when the source base clearly supports them and they do not replace the stable core set
143
- - For a single report or dataset, prefer report-shaped indexes over generic People/Projects/Timeline scaffolding
144
- - Link to canonical entities, high-signal summaries, and major claims
145
- - Make the result useful for interface creation and retrieve, not just for human browsing
146
- - Treat backlinks as part of the retrieval surface: notes should make it obvious how to move from a high-level concept to the supporting summaries and back again
147
- - If the KB is very small, keep the indexes short and direct instead of expanding them into standalone essays.
148
- - For a tiny compile, it is enough for the stable core indexes to be short landing notes that route later interface stages toward the real evidence.
149
-
150
- Update `home.md` every compile run so it becomes the knowledge-base landing layer for agents.
151
- Include the source count, the high-signal scope of the knowledge base, and links to the stable core indexes.
152
-
153
- ### 6. Runtime reconciliation
154
-
155
- The CLI reconciles `.interf/state.json`, refreshes `.interf/health.json`, and refreshes `.interf/view-spec.json` after stage validation so viewers keep a stable knowledge-base-level presentation contract.
156
- Rewrite outputs directly instead of clearing `knowledge/` or `.interf/` first. If a stale artifact truly must go away, remove only that explicit path after the replacement files are already written.
157
-
158
- ### 7. Validate
159
-
160
- - [ ] All output files exist and are non-empty
161
- - [ ] Entity notes have evidence links
162
- - [ ] Claims preserve evidence strength and do not overstate exploratory material
163
- - [ ] No wikilinks to nonexistent files
164
- - [ ] home.md is current
165
- - [ ] The result is compact enough that an interface stage can reuse it without re-reading a bloated local graph
166
-
167
- ## Graph quality rules
168
-
169
- - Canonicalize aliases to one entity note
170
- - Remove stale duplicates
171
- - Repair broken wikilinks
172
- - Prefer explicit wikilinks over vague prose
173
- - Use properties for machine filtering, tags for Obsidian surfacing
174
- - Prefer a small stable graph over speculative expansion
175
-
176
- After compile, prefer running:
177
-
178
- ```bash
179
- interf verify compile --json
180
- ```
181
-
182
- If it fails, fix inventory/state/output consistency before treating the knowledge base as ready for interface creation or retrieval.
183
-
184
- Report:
185
- ```
186
- Step 2/2 complete — Knowledge-base compile
187
- Entities: <entity_count>, Claims: <claim_count>
188
- home.md updated.
189
- ```
190
-
191
- When the required outputs and inventory are written, emit the required `DONE:` line and stop. Do not keep browsing or auditing after the compile contract is satisfied.
192
-
193
- ## What this skill does NOT do
194
-
195
- - Does not generate per-file summaries (use `knowledge-base/summarize`)
196
- - Does not work on interfaces (use `interface/retrieve` to start interface compile)
@@ -1,48 +0,0 @@
1
- # Output Format Guide
2
-
3
- All outputs are plain markdown. They work standalone for any agent and render well in Obsidian. Obsidian is supported but not required.
4
-
5
- ## Properties (JSON frontmatter)
6
-
7
- Use Obsidian-compatible properties for filtering:
8
-
9
- ```md
10
- ---
11
- {
12
- "entity_type": "person",
13
- "status": "active",
14
- "confidence": "high",
15
- "tags": ["type/entity", "entity/person"]
16
- }
17
- ---
18
- ```
19
-
20
- Properties = machine filtering. Tags = human browsing.
21
-
22
- ## Wikilinks
23
-
24
- Use `[[wikilinks]]` for all internal references. Never raw file paths.
25
-
26
- ## Wiki-link-as-prose
27
-
28
- Links read as sentences:
29
- > This note is where [[readiness assessment language first appears in the knowledge base]]
30
-
31
- ## home.md
32
-
33
- Entry point. Links to key sections, current counts, last compile date. Update every compile.
34
-
35
- ## .base files
36
-
37
- Optional Obsidian-specific JSON files for filterable table/card views. The knowledge base works without them.
38
-
39
- ## Graph optimization
40
-
41
- - Wikilinks consistently (every link = edge)
42
- - One canonical note per entity (no duplicates)
43
- - Home.md and indexes as high-connectivity hubs
44
- - Tags for color-coding in graph view
45
-
46
- ## Independence
47
-
48
- Everything works without Obsidian. Wikilinks are `[[plain text]]`. Properties use JSON frontmatter. Tags are strings. Any agent can read the files directly.
@@ -1,60 +0,0 @@
1
- # Stage: Extract Claims
2
-
3
- Create notes in knowledge/claims/ for cross-file observations backed by evidence.
4
-
5
- ## Process
6
-
7
- 1. Read summaries/ overviews looking for patterns that appear across 2+ files
8
- 2. Group related observations into claims
9
- 3. For each claim: create a note with evidence links
10
-
11
- ## What qualifies as a claim
12
-
13
- - A pattern observed in 2+ sources
14
- - A decision or pivot with supporting evidence
15
- - A risk identified from multiple signals
16
- - A relationship between entities backed by evidence
17
- - A metric or milestone confirmed by locked/confirmed sources
18
-
19
- Do NOT create claims from single observations unless marked as unresolved/hypothesis.
20
-
21
- ## Claim note format
22
-
23
- Use prose-as-title: the filename IS the claim.
24
-
25
- Example filename: `{subject} acts as {relationship} for {entity}.md`
26
-
27
- ```markdown
28
- ---
29
- {
30
- "claim_type": "pattern | decision | risk | milestone | relationship | metric",
31
- "status": "active | historical | unresolved",
32
- "evidence_count": "N",
33
- "confidence": "high | medium | low",
34
- "tags": ["type/claim", "claim/{claim_type}"]
35
- }
36
- ---
37
-
38
- ## Claim
39
-
40
- {The observation in one tight paragraph.}
41
-
42
- ## Why it matters
43
-
44
- {Why this matters for future querying and decision-making.}
45
-
46
- ## Evidence
47
-
48
- - [[{summary title}]]: {one-line evidence}
49
- - [[{summary title}]]: {one-line evidence}
50
-
51
- ## Related
52
-
53
- - [[{related entity or claim}]]
54
- ```
55
-
56
- ## Confidence levels
57
-
58
- - **high**: 3+ locked/confirmed sources agree
59
- - **medium**: 2+ sources, at least one confirmed
60
- - **low**: 2+ draft sources, or sources partially conflict
@@ -1,46 +0,0 @@
1
- # Stage: Discover Entities
2
-
3
- Create canonical notes in knowledge/entities/ for recurring actors in the knowledge base.
4
-
5
- ## Process
6
-
7
- 1. Scan all summaries/ abstracts and frontmatter → build frequency map of recurring actors
8
- 2. Scan overviews for company names, product names, concepts
9
- 3. For each actor appearing 3+ times:
10
- - Create a canonical entity note
11
- - Resolve aliases (e.g., "{Short name}" and "{Full name}" -> one note)
12
- - Link to all supporting summaries/ files via wikilinks
13
-
14
- ## Entity note format
15
-
16
- ```markdown
17
- ---
18
- {
19
- "entity_type": "person | company | product | concept",
20
- "status": "active | historical",
21
- "first_seen": "YYYY-MM-DD",
22
- "last_seen": "YYYY-MM-DD",
23
- "evidence_count": "N",
24
- "tags": ["type/entity", "entity/{entity_type}"]
25
- }
26
- ---
27
-
28
- ## Summary
29
-
30
- {Who/what this is and why it matters. 2-3 sentences.}
31
-
32
- ## Evidence
33
-
34
- - [[{summary title}]]: {one-line context}
35
-
36
- ## Related
37
-
38
- - [[{related entity or claim}]]
39
- ```
40
-
41
- ## Alias resolution
42
-
43
- When multiple names refer to the same actor:
44
- - Pick the most complete name as canonical (e.g., "{Full Name}" not "{Nickname}")
45
- - Mention aliases in the summary
46
- - All evidence links point to the one canonical note
@@ -1,45 +0,0 @@
1
- ---
2
- {
3
- "name": "knowledge-base/query",
4
- "description": "Manual-use skill for answering questions from inside a compiled knowledge base. Navigates AGENTS.md, home.md, knowledge/, summaries/, backlinks, and raw sources only when reachable. Use when a user opens an agent inside a knowledge base and asks questions against it."
5
- }
6
- ---
7
-
8
- # Knowledge Base Query
9
-
10
- Use this skill in manual agent sessions inside a compiled knowledge base.
11
-
12
- Start with:
13
- - `AGENTS.md`
14
- - `home.md`
15
- - `knowledge/`
16
- - `summaries/`
17
-
18
- Default loop:
19
- - use `knowledge/` indexes, entities, and claims first
20
- - follow wikilinks and backlinks outward before treating one note as complete
21
- - use `summaries/` for deeper evidence
22
- - use raw source files only when needed for verification, direct quotes, ambiguity, or missing context
23
- - when a caller asks for a trace, audit log, or `artifacts_consulted` list, record `workflow/use/query/SKILL.md` after you inspect it
24
-
25
- Raw-source gate:
26
- - inspect `.interf/source-access.json`
27
- - actually open and inspect at least one `suggested_checks` path before claiming raw-file verification; a plain existence check is not enough
28
- - when a caller asks for a trace, audit log, or `artifacts_consulted` list, record `.interf/source-access.json` after you inspect it
29
- - if the path is not reachable or permission is not granted, say the answer is based on compiled knowledge-base artifacts only
30
- - when the question depends on exact figures, direct quotes, chart values, table values, or image-derived evidence, raw inspection is required before answering confidently
31
-
32
- PDF / chart rule:
33
- - if the source is a PDF, deck, or report and the needed evidence may live in charts, tables, or figures, do not assume the default text layer or existing notes captured everything
34
- - if summaries do not preserve the needed numeric detail, inspect the raw source and say whether the value was text-derived, table-derived, or chart-derived
35
- - opening the PDF with `Read` is not enough for an exact-value chart question; take a machine-readable extraction path before answering
36
- - if the first local extraction method misses the number, attempt another local recovery path before settling for a visual estimate
37
- - if the default local extraction path still cannot reach the value, switch methods before stopping early; a temporary scratch helper outside the workspace is allowed when needed
38
- - if the chart does not expose exact numbers as text, say that clearly instead of pretending the compiled notes were sufficient
39
- - if you can only estimate from the chart, label the answer `approximate` and keep the precision gap explicit
40
-
41
- When confidence is low:
42
- - expand outward through linked claims, entities, indexes, and summaries
43
- - do not over-read a single summary title as final truth
44
-
45
- This skill is for manual question-answering behavior. It does not change summarize or compile runtime contracts.
@@ -1,152 +0,0 @@
1
- ---
2
- {
3
- "name": "knowledge-base/summarize",
4
- "description": "Generate summaries for unprocessed source files in a knowledge base. Reads interf.json for format rules. Creates one summaries/ file per source file with abstract, overview, metadata, and wikilinks. Use when asked to summarize, process files, generate summaries, or after adding new files to a knowledge base."
5
- }
6
- ---
7
-
8
- # Summarize Source Files into Summaries
9
-
10
- Read `interf.json`, `.interf/stage-contract.json`, and `.interf/run.json` first.
11
-
12
- Use only local workspace files for this run:
13
- - `interf.json`
14
- - `.interf/stage-contract.json`
15
- - `.interf/summarize-targets.json` when present
16
- - `.interf/source-access.json` when raw-file access needs a quick check
17
- - local instruction docs explicitly listed by `.interf/stage-contract.json`
18
-
19
- Do not open SDK repo docs or source files outside the current workspace. The local contract and local docs are the source of truth.
20
-
21
- Harness role:
22
- - This skill is normally invoked as one of the file-evidence stages inside `interf compile`.
23
- - When launched by the CLI, follow the stage contract exactly and keep user-visible output to `STATUS:`, `DONE:`, `BLOCKED:`, or `ERROR:` lines only.
24
-
25
- ## Required sequence
26
-
27
- 1. Read `interf.json` and confirm `type: knowledge-base`.
28
- 2. Read `.interf/stage-contract.json` and treat it as authoritative.
29
- 3. Read `.interf/summarize-targets.json` when present and treat `targets[]` as the source of truth for which files to summarize.
30
- If a target includes `output`, write the summary to that exact relative path.
31
- 4. Read any local docs listed by the stage contract.
32
- 5. Create one summary file in `summaries/` for each target source file.
33
- 6. Write `.interf/inventory.json`.
34
- 7. Emit `DONE:` and stop.
35
-
36
- If the CLI provided a summarize plan, do not re-audit the whole knowledge base before writing summaries.
37
-
38
- ## Status contract
39
-
40
- When launched by the Interf CLI:
41
- - emit exactly one startup line: `STATUS: loaded summarize plan N files`
42
- - emit `STATUS: batch committed` only after summary files and inventory were actually written
43
- - emit `DONE: summarize complete N/N` when the required writes are complete
44
- - do not emit per-file progress
45
-
46
- ## Execution bias
47
-
48
- This stage is a light per-file evidence pass, not a mini research project.
49
-
50
- - process only the files listed in `.interf/summarize-targets.json`
51
- - for a single large PDF, deck, or report, do one lightweight evidence pass and then stop
52
- - for a single large PDF, deck, or report, do at most one routing pass across the document plus one focused follow-up read that covers no more than 3 routed pages or sections
53
- - capture the file's scope, headline facts that are directly exposed, and whether important evidence also lives in charts or tables
54
- - if the document repeats the same template across many pages or entities, sample only enough pages to describe that repeated structure and preserve routing for later interfaces
55
- - do not chase every page, every market, every appendix, or every historical chart in this stage
56
- - leave narrow task-specific extraction to interface workflows
57
- - once you can state the document scope, the exposed headline metrics, and where deeper chart/table evidence lives, write the summary immediately
58
- - once the summary file and inventory are written, stop immediately
59
- - keep bulk PDF/OCR extraction output out of the run log. Save scratch output to temp files and inspect only the routed slices you need for the summary.
60
- - keep scratch extraction commands single-purpose and non-destructive. Do not use `rm`, wildcard cleanup, `;`, or `&&` chains during summarize.
61
- - if a shell pattern is blocked, do not retry the same chained command with minor edits. Switch to a simpler local read path and keep moving.
62
- - if you have already checked whether the summary file exists and it does not, the next step is to write it rather than doing another exploratory read
63
- - do not precreate `.interf/inventory.json` with `touch`; write the final JSON document directly
64
- - when updating `.interf/inventory.json`, rewrite the full JSON document in one whole-file write instead of appending or patching partial lines
65
- - do not use `apply_patch` or line-matched diffs on `.interf/inventory.json`; replace the file in one complete write
66
- - when you are ready to write, prefer a direct whole-file shell write such as `cat > path <<'EOF' ... EOF` for summary markdown and the inventory artifact
67
- - whole-file shell writes for stage artifacts are allowed and preferred here; do not stall deciding between patch-based editing and direct writes
68
-
69
- ## Summary output format
70
-
71
- Create one markdown file per source file under `summaries/`.
72
- Every summary filename must end in `.md`, even when the source file is `.txt`, `.pdf`, or another format.
73
- If the source file already ends in `.md`, keep a single `.md` suffix instead of appending another one.
74
- When `.interf/summarize-targets.json` provides `targets[].output`, use that exact path instead of inferring a filename.
75
-
76
- Each summary must include JSON frontmatter with:
77
- - `source`
78
- - `source_kind`
79
- - `evidence_tier`
80
- - `truth_mode`
81
- - `state`
82
- - `abstract`
83
-
84
- Use JSON frontmatter wrapped in `---` markers. Do not use YAML `key: value` frontmatter.
85
-
86
- Example:
87
-
88
- ```markdown
89
- ---
90
- {
91
- "source": "go-to-market-notes.txt",
92
- "source_kind": "note",
93
- "evidence_tier": "primary",
94
- "truth_mode": "proposed",
95
- "state": "draft",
96
- "abstract": "Short source-grounded description."
97
- }
98
- ---
99
- ```
100
-
101
- Each summary must include these sections:
102
- - `## Overview`
103
- - `## Key Takeaways`
104
-
105
- `## References` is optional.
106
-
107
- Keep summaries source-grounded:
108
- - do not overstate certainty
109
- - keep titles descriptive and conservative
110
- - preserve evidence tiers and truth modes
111
- - keep links sparse and obvious
112
- - for PDFs, decks, and reports, capture material table/chart/figure evidence when it affects the source's meaning
113
- - preserve the main headline metrics for the top-level sections or market groups when they are present in extractable text
114
- - preserve easy headline values from prose or clearly exposed tables when they are central to the source
115
- - for market reports and dashboards, preserve the main peer groups that are trivial to recover from prose or headline tables, but do not turn summarize into a full market-by-market extraction pass
116
- - if important evidence appears to live in charts or other visuals, say that clearly in the summary and preserve enough routing detail for a later interface or manual query step
117
- - do not turn the knowledge-base summarize stage into an exhaustive visual extraction pass across the whole report
118
- - if exact chart numbers are not directly recoverable from the same page with light local extraction, say so explicitly in the summary instead of flattening the evidence into vague prose
119
- - when useful, note whether important evidence came from prose, tables, or charts so later interface stages know when raw visual inspection may still be needed
120
- - distinguish `chart present and relevant` from `exact chart values not yet extracted`
121
-
122
- This is a per-file evidence stage only. Cross-file synthesis belongs to `knowledge-base/compile`.
123
-
124
- ## Inventory output
125
-
126
- Write `.interf/inventory.json` so every source file is accounted for.
127
-
128
- Minimum shape:
129
- - prefer the current runtime shape: top-level `entries` plus `total`
130
- - `total` equal to the actual current source-file count
131
- - one `entries[]` object per source file
132
- - each entry should preserve at least `source`, `summary`, and a conservative summarize `status` or `state`
133
- - per-file routing must let the runtime and validators see which raw file maps to which summary
134
-
135
- Do not copy canned totals or filenames into the runtime inventory.
136
- Do not invent new top-level inventory keys when `entries` already fits the run.
137
-
138
- The CLI reconciles `.interf/state.json` and refreshes `.interf/health.json` after stage validation.
139
- For a one-file summarize run, the finish sequence is strict: write the summary file, rewrite `.interf/inventory.json`, emit `STATUS: batch committed`, emit the standard summarize `DONE:` line using the current run counts, and stop.
140
-
141
- ## Guardrails
142
-
143
- - Do not modify source files.
144
- - Do not emit `STATUS: batch committed` before files exist on disk.
145
- - Do not create placeholder JSON files with `touch` before writing the final documents.
146
- - Do not append a second JSON object to `.interf/inventory.json`. Rewrite the whole file once.
147
- - Do not use `apply_patch` or line-matched diffs to edit `.interf/inventory.json`.
148
- - Use a single whole-file write for each required artifact as soon as the summary text is ready.
149
- - If you check whether a required summary or inventory artifact exists and it is missing, create it next instead of doing another exploratory read.
150
- - Do not keep mining the source after a usable conservative summary already exists.
151
- - Do not keep browsing after the required writes are complete.
152
- - If a required path is missing or unreadable, emit one `BLOCKED:` or `ERROR:` line with the concrete reason and stop.