@interf/compiler 0.2.4 → 0.3.0

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 (240) hide show
  1. package/README.md +194 -148
  2. package/dist/commands/benchmark.d.ts.map +1 -1
  3. package/dist/commands/benchmark.js +60 -351
  4. package/dist/commands/benchmark.js.map +1 -1
  5. package/dist/commands/compile.d.ts.map +1 -1
  6. package/dist/commands/compile.js +43 -110
  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 +29 -214
  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 +72 -455
  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 +16 -28
  18. package/dist/commands/default.js.map +1 -1
  19. package/dist/commands/init.d.ts.map +1 -1
  20. package/dist/commands/init.js +71 -337
  21. package/dist/commands/init.js.map +1 -1
  22. package/dist/commands/list.d.ts.map +1 -1
  23. package/dist/commands/list.js +12 -22
  24. package/dist/commands/list.js.map +1 -1
  25. package/dist/commands/reset.d.ts.map +1 -1
  26. package/dist/commands/reset.js +27 -124
  27. package/dist/commands/reset.js.map +1 -1
  28. package/dist/commands/source-config-wizard.d.ts +13 -6
  29. package/dist/commands/source-config-wizard.d.ts.map +1 -1
  30. package/dist/commands/source-config-wizard.js +93 -59
  31. package/dist/commands/source-config-wizard.js.map +1 -1
  32. package/dist/commands/status.d.ts.map +1 -1
  33. package/dist/commands/status.js +60 -56
  34. package/dist/commands/status.js.map +1 -1
  35. package/dist/commands/verify.d.ts.map +1 -1
  36. package/dist/commands/verify.js +59 -98
  37. package/dist/commands/verify.js.map +1 -1
  38. package/dist/index.d.ts +7 -7
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +4 -6
  41. package/dist/index.js.map +1 -1
  42. package/dist/lib/agent-constants.js +1 -1
  43. package/dist/lib/agent-constants.js.map +1 -1
  44. package/dist/lib/benchmark-execution.d.ts.map +1 -1
  45. package/dist/lib/benchmark-execution.js +7 -16
  46. package/dist/lib/benchmark-execution.js.map +1 -1
  47. package/dist/lib/benchmark-targets.d.ts +3 -4
  48. package/dist/lib/benchmark-targets.d.ts.map +1 -1
  49. package/dist/lib/benchmark-targets.js +9 -55
  50. package/dist/lib/benchmark-targets.js.map +1 -1
  51. package/dist/lib/benchmark-types.d.ts +2 -3
  52. package/dist/lib/benchmark-types.d.ts.map +1 -1
  53. package/dist/lib/benchmark.d.ts +1 -1
  54. package/dist/lib/benchmark.d.ts.map +1 -1
  55. package/dist/lib/benchmark.js +1 -1
  56. package/dist/lib/benchmark.js.map +1 -1
  57. package/dist/lib/config.d.ts +1 -2
  58. package/dist/lib/config.d.ts.map +1 -1
  59. package/dist/lib/config.js +2 -4
  60. package/dist/lib/config.js.map +1 -1
  61. package/dist/lib/discovery.d.ts +1 -1
  62. package/dist/lib/discovery.d.ts.map +1 -1
  63. package/dist/lib/discovery.js +7 -2
  64. package/dist/lib/discovery.js.map +1 -1
  65. package/dist/lib/eval-packs.d.ts +6 -52
  66. package/dist/lib/eval-packs.d.ts.map +1 -1
  67. package/dist/lib/eval-packs.js +11 -39
  68. package/dist/lib/eval-packs.js.map +1 -1
  69. package/dist/lib/interf-bootstrap.d.ts +3 -5
  70. package/dist/lib/interf-bootstrap.d.ts.map +1 -1
  71. package/dist/lib/interf-bootstrap.js +10 -57
  72. package/dist/lib/interf-bootstrap.js.map +1 -1
  73. package/dist/lib/interf-detect.d.ts +13 -11
  74. package/dist/lib/interf-detect.d.ts.map +1 -1
  75. package/dist/lib/interf-detect.js +59 -45
  76. package/dist/lib/interf-detect.js.map +1 -1
  77. package/dist/lib/interf-scaffold.d.ts +2 -5
  78. package/dist/lib/interf-scaffold.d.ts.map +1 -1
  79. package/dist/lib/interf-scaffold.js +98 -235
  80. package/dist/lib/interf-scaffold.js.map +1 -1
  81. package/dist/lib/interf-workflow-package.d.ts +1 -2
  82. package/dist/lib/interf-workflow-package.d.ts.map +1 -1
  83. package/dist/lib/interf-workflow-package.js +94 -90
  84. package/dist/lib/interf-workflow-package.js.map +1 -1
  85. package/dist/lib/interf.d.ts +4 -5
  86. package/dist/lib/interf.d.ts.map +1 -1
  87. package/dist/lib/interf.js +3 -6
  88. package/dist/lib/interf.js.map +1 -1
  89. package/dist/lib/local-workflows.d.ts +9 -8
  90. package/dist/lib/local-workflows.d.ts.map +1 -1
  91. package/dist/lib/local-workflows.js +42 -94
  92. package/dist/lib/local-workflows.js.map +1 -1
  93. package/dist/lib/obsidian.d.ts +1 -5
  94. package/dist/lib/obsidian.d.ts.map +1 -1
  95. package/dist/lib/obsidian.js +11 -165
  96. package/dist/lib/obsidian.js.map +1 -1
  97. package/dist/lib/registry.d.ts +6 -17
  98. package/dist/lib/registry.d.ts.map +1 -1
  99. package/dist/lib/registry.js +36 -50
  100. package/dist/lib/registry.js.map +1 -1
  101. package/dist/lib/runtime-contracts.d.ts +2 -3
  102. package/dist/lib/runtime-contracts.d.ts.map +1 -1
  103. package/dist/lib/runtime-contracts.js +10 -9
  104. package/dist/lib/runtime-contracts.js.map +1 -1
  105. package/dist/lib/runtime-reconcile.d.ts +2 -5
  106. package/dist/lib/runtime-reconcile.d.ts.map +1 -1
  107. package/dist/lib/runtime-reconcile.js +23 -176
  108. package/dist/lib/runtime-reconcile.js.map +1 -1
  109. package/dist/lib/runtime-runs.d.ts.map +1 -1
  110. package/dist/lib/runtime-runs.js +52 -57
  111. package/dist/lib/runtime-runs.js.map +1 -1
  112. package/dist/lib/runtime-types.d.ts +5 -6
  113. package/dist/lib/runtime-types.d.ts.map +1 -1
  114. package/dist/lib/runtime.d.ts +2 -2
  115. package/dist/lib/runtime.d.ts.map +1 -1
  116. package/dist/lib/runtime.js +1 -1
  117. package/dist/lib/runtime.js.map +1 -1
  118. package/dist/lib/schema.d.ts +53 -312
  119. package/dist/lib/schema.d.ts.map +1 -1
  120. package/dist/lib/schema.js +39 -206
  121. package/dist/lib/schema.js.map +1 -1
  122. package/dist/lib/source-config.d.ts +7 -7
  123. package/dist/lib/source-config.d.ts.map +1 -1
  124. package/dist/lib/source-config.js +55 -62
  125. package/dist/lib/source-config.js.map +1 -1
  126. package/dist/lib/state-artifacts.d.ts +5 -11
  127. package/dist/lib/state-artifacts.d.ts.map +1 -1
  128. package/dist/lib/state-artifacts.js +8 -18
  129. package/dist/lib/state-artifacts.js.map +1 -1
  130. package/dist/lib/state-health.d.ts +4 -8
  131. package/dist/lib/state-health.d.ts.map +1 -1
  132. package/dist/lib/state-health.js +27 -223
  133. package/dist/lib/state-health.js.map +1 -1
  134. package/dist/lib/state-io.d.ts +7 -12
  135. package/dist/lib/state-io.d.ts.map +1 -1
  136. package/dist/lib/state-io.js +26 -93
  137. package/dist/lib/state-io.js.map +1 -1
  138. package/dist/lib/state-view.d.ts +4 -6
  139. package/dist/lib/state-view.d.ts.map +1 -1
  140. package/dist/lib/state-view.js +62 -101
  141. package/dist/lib/state-view.js.map +1 -1
  142. package/dist/lib/state.d.ts +5 -5
  143. package/dist/lib/state.d.ts.map +1 -1
  144. package/dist/lib/state.js +4 -4
  145. package/dist/lib/state.js.map +1 -1
  146. package/dist/lib/summarize-plan.d.ts +2 -2
  147. package/dist/lib/summarize-plan.d.ts.map +1 -1
  148. package/dist/lib/summarize-plan.js +13 -13
  149. package/dist/lib/summarize-plan.js.map +1 -1
  150. package/dist/lib/{validate-kb.d.ts → validate-workspace.d.ts} +8 -8
  151. package/dist/lib/validate-workspace.d.ts.map +1 -0
  152. package/dist/lib/{validate-kb.js → validate-workspace.js} +44 -46
  153. package/dist/lib/validate-workspace.js.map +1 -0
  154. package/dist/lib/validate.d.ts +5 -7
  155. package/dist/lib/validate.d.ts.map +1 -1
  156. package/dist/lib/validate.js +6 -19
  157. package/dist/lib/validate.js.map +1 -1
  158. package/dist/lib/workflow-definitions.d.ts +14 -50
  159. package/dist/lib/workflow-definitions.d.ts.map +1 -1
  160. package/dist/lib/workflow-definitions.js +74 -349
  161. package/dist/lib/workflow-definitions.js.map +1 -1
  162. package/dist/lib/workflow-helpers.d.ts +3 -4
  163. package/dist/lib/workflow-helpers.d.ts.map +1 -1
  164. package/dist/lib/workflow-helpers.js +15 -49
  165. package/dist/lib/workflow-helpers.js.map +1 -1
  166. package/dist/lib/workflow-stage-runner.d.ts +1 -2
  167. package/dist/lib/workflow-stage-runner.d.ts.map +1 -1
  168. package/dist/lib/workflow-stage-runner.js +4 -6
  169. package/dist/lib/workflow-stage-runner.js.map +1 -1
  170. package/dist/lib/workflow-starter-docs.d.ts +3 -5
  171. package/dist/lib/workflow-starter-docs.d.ts.map +1 -1
  172. package/dist/lib/workflow-starter-docs.js +2 -17
  173. package/dist/lib/workflow-starter-docs.js.map +1 -1
  174. package/dist/lib/workflows.d.ts +9 -14
  175. package/dist/lib/workflows.d.ts.map +1 -1
  176. package/dist/lib/workflows.js +13 -30
  177. package/dist/lib/workflows.js.map +1 -1
  178. package/dist/lib/workspace-compile.d.ts +50 -0
  179. package/dist/lib/workspace-compile.d.ts.map +1 -0
  180. package/dist/lib/{workflows-kb.js → workspace-compile.js} +81 -89
  181. package/dist/lib/workspace-compile.js.map +1 -0
  182. package/package.json +9 -9
  183. package/skills/benchmark/SKILL.md +16 -24
  184. package/skills/workflow/create/SKILL.md +7 -14
  185. package/templates/workspace/README.md +23 -0
  186. package/templates/workspace/interfignore +2 -0
  187. package/dist/lib/bundled-templates.d.ts +0 -5
  188. package/dist/lib/bundled-templates.d.ts.map +0 -1
  189. package/dist/lib/bundled-templates.js +0 -23
  190. package/dist/lib/bundled-templates.js.map +0 -1
  191. package/dist/lib/interf-compile-plan.d.ts +0 -12
  192. package/dist/lib/interf-compile-plan.d.ts.map +0 -1
  193. package/dist/lib/interf-compile-plan.js +0 -143
  194. package/dist/lib/interf-compile-plan.js.map +0 -1
  195. package/dist/lib/validate-interface.d.ts +0 -79
  196. package/dist/lib/validate-interface.d.ts.map +0 -1
  197. package/dist/lib/validate-interface.js +0 -535
  198. package/dist/lib/validate-interface.js.map +0 -1
  199. package/dist/lib/validate-kb.d.ts.map +0 -1
  200. package/dist/lib/validate-kb.js.map +0 -1
  201. package/dist/lib/workflows-interface-contracts.d.ts +0 -24
  202. package/dist/lib/workflows-interface-contracts.d.ts.map +0 -1
  203. package/dist/lib/workflows-interface-contracts.js +0 -304
  204. package/dist/lib/workflows-interface-contracts.js.map +0 -1
  205. package/dist/lib/workflows-interface.d.ts +0 -72
  206. package/dist/lib/workflows-interface.d.ts.map +0 -1
  207. package/dist/lib/workflows-interface.js +0 -377
  208. package/dist/lib/workflows-interface.js.map +0 -1
  209. package/dist/lib/workflows-kb.d.ts +0 -50
  210. package/dist/lib/workflows-kb.d.ts.map +0 -1
  211. package/dist/lib/workflows-kb.js.map +0 -1
  212. package/skills/interface/analyze/SKILL.md +0 -191
  213. package/skills/interface/compile/SKILL.md +0 -152
  214. package/skills/interface/compile/references/output-format.md +0 -48
  215. package/skills/interface/create/SKILL.md +0 -87
  216. package/skills/interface/create/references/compile-plan-format.md +0 -109
  217. package/skills/interface/create/references/workflows.md +0 -35
  218. package/skills/interface/query/SKILL.md +0 -48
  219. package/skills/interface/retrieve/SKILL.md +0 -133
  220. package/skills/knowledge-base/compile/SKILL.md +0 -196
  221. package/skills/knowledge-base/compile/references/output-format.md +0 -48
  222. package/skills/knowledge-base/compile/references/stage-claims.md +0 -60
  223. package/skills/knowledge-base/compile/references/stage-entities.md +0 -46
  224. package/skills/knowledge-base/query/SKILL.md +0 -45
  225. package/skills/knowledge-base/summarize/SKILL.md +0 -152
  226. package/templates/interface/README.md +0 -159
  227. package/templates/interface/interfaces.md +0 -102
  228. package/templates/knowledge-base/README.md +0 -137
  229. package/templates/knowledge-base/interfignore +0 -19
  230. package/templates/knowledge-base/registry.md +0 -118
  231. package/templates/workflow-package/README.md +0 -16
  232. package/templates/workflow-package/create/SKILL.md +0 -8
  233. package/templates/workflow-package/interface-query/SKILL.md +0 -29
  234. package/templates/workflow-package/interface-stage/SKILL.md +0 -13
  235. package/templates/workflow-package/knowledge-base-query/SKILL.md +0 -36
  236. package/templates/workflow-package/knowledge-base-stage/SKILL.md +0 -13
  237. package/templates/workflow-starters/interface/interf/README.md +0 -13
  238. package/templates/workflow-starters/interface/interf/create/SKILL.md +0 -15
  239. package/templates/workflow-starters/knowledge-base/interf/README.md +0 -13
  240. package/templates/workflow-starters/knowledge-base/karpathy/README.md +0 -13
@@ -1,48 +0,0 @@
1
- ---
2
- {
3
- "name": "interface/query",
4
- "description": "Manual-use skill for answering questions from inside an interface. Navigates AGENTS.md, home.md, local knowledge/briefs/summaries, parent knowledge-base summaries, backlinks, and raw sources only when reachable. Use when a user opens an agent inside an interface and asks questions against it."
5
- }
6
- ---
7
-
8
- # Interface Query
9
-
10
- Use this skill in manual agent sessions inside a compiled interface.
11
-
12
- Start with:
13
- - `AGENTS.md`
14
- - `home.md`
15
- - local `knowledge/`
16
- - `briefs/`
17
- - local `summaries/`
18
-
19
- Default loop:
20
- - answer from local interface outputs first
21
- - follow wikilinks and backlinks outward before treating one note as complete
22
- - climb to parent knowledge-base summaries in `../../summaries/` when you need stronger evidence
23
- - use raw source files only when needed for verification, direct quotes, ambiguity, or missing context
24
- - if the user asks for exact chart or table values from a named report, use local outputs only to locate the source and relevant pages, then go straight to the raw PDF and a concrete local extraction path
25
- - when a caller asks for a trace, audit log, or `artifacts_consulted` list, record local `workflow/use/query/SKILL.md` after you inspect it
26
- - when you climb to the parent knowledge-base query loop, record `../../workflow/use/query/SKILL.md` after you inspect it
27
-
28
- Raw-source gate:
29
- - inspect `../../.interf/source-access.json`
30
- - actually open and inspect at least one `suggested_checks` path before claiming raw-file verification; a plain existence check is not enough
31
- - when a caller asks for a trace, audit log, or `artifacts_consulted` list, record `../../.interf/source-access.json` after you inspect it
32
- - if the path is not reachable or permission is not granted, say the answer is based on interface and parent knowledge-base artifacts only
33
- - when the question depends on exact figures, direct quotes, chart values, table values, or image-derived evidence, raw inspection is required before answering confidently
34
-
35
- PDF / chart rule:
36
- - if the parent 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
37
- - if local outputs and parent 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
38
- - opening the PDF with `Read` is not enough for an exact-value chart question; you must take a machine-readable extraction path before answering
39
- - if the first local extraction method misses the number, continue down another local recovery path instead of settling early for a visual estimate
40
- - 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
41
- - if the chart does not expose exact numbers as text, say that clearly instead of pretending the interface already captured them
42
- - if you can only estimate from the chart after exhausting the local extraction path, label the answer `approximate` and keep the precision gap explicit
43
-
44
- When confidence is low:
45
- - expand outward through linked briefs, claims, entities, and parent summaries
46
- - do not stop at the first local note if linked evidence exists above it
47
-
48
- This skill is for manual question-answering behavior. It does not change retrieve, analyze, or compile runtime contracts.
@@ -1,133 +0,0 @@
1
- ---
2
- {
3
- "name": "interface/retrieve",
4
- "description": "Interface retrieval contract. Identifies relevant files from the connected knowledge base. Scans knowledge-base summaries metadata, applies filters from compile-plan.md, computes delta since last compile. Use when asked to retrieve from the knowledge base, find relevant files, or run a retrieval stage inside interface compile."
5
- }
6
- ---
7
-
8
- # Interface Compile — Retrieve
9
-
10
- Read `interf.json` (must have `type: interface`) and `compile-plan.md` for filter criteria.
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 plan: `compile-plan.md`
17
- - local instruction docs: the files listed by `.interf/stage-contract.json`
18
-
19
- When this skill is embedded into a generated interface, 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.
20
-
21
- This skill identifies which files in the knowledge base are relevant to this interface and which are new since last compile.
22
-
23
- Retrieve is coverage-gated. The goal is not to guess a relevant set quickly. The goal is to prove that the routing layer scanned the full summary set, reviewed the candidate abstracts, and persisted both selected and rejected files before analysis begins.
24
- The runtime in `compile-plan.md` is an initial hypothesis. Retrieve may discover missing entities, categories, or relationship clusters that should shape later interface refinement.
25
-
26
- Important proof semantics:
27
- - `proof.scanned` is the full summary set scanned at the frontmatter-routing layer
28
- - `proof.reviewed` is the narrower candidate set whose abstracts were reviewed
29
- - `proof.retrieved` plus `proof.excluded` should partition the scanned summary set
30
-
31
- The knowledge base is located at `knowledge_base.path` from `interf.json` (typically `../..`). Knowledge-base summaries are at `{knowledge_base.path}/summaries/`.
32
- If a coding agent is sandboxed to its current working tree, prefer launching it from the source folder or another root that can reach both the knowledge base and the source folder.
33
- If `../../.interf/source-access.json` exists, use it as the quick check for whether raw paths are actually reachable from this session before assuming raw fallback will work.
34
- If local docs are listed by the stage contract, read them before retrieving. They may `extend` or `override` the bundled workflow instructions for this stage, but they do not bypass coverage proof or the stage contract.
35
-
36
- Harness role:
37
- - This skill is an internal harness step normally invoked by `interf compile` from inside an interface.
38
- - For standard operation, prefer the CLI or another higher-level tool over calling this skill directly.
39
-
40
- ## Runtime contract
41
-
42
- When invoked by the CLI, honor any explicit execution instructions in the prompt. In particular:
43
- - if `.interf/stage-contract.json` exists, treat it as the authoritative stage contract for this run
44
- - if the prompt gives an expected summary-set size, use it as the source of truth for progress reporting
45
- - if the prompt requires `.interf/relevant.json`, write it
46
- - only emit user-facing lines that start with `STATUS:`, `DONE:`, `BLOCKED:`, or `ERROR:`
47
- - when updating `.interf/relevant.json` or `.interf/coverage.json`, read the current file first and then rewrite the full JSON document; do not depend on anchored patch edits against stale runtime files
48
- - the CLI reconciles `.interf/state.json` and refreshes `.interf/health.json` after validation; do not treat those files as stage-owned write targets for retrieve
49
- - once the selected set is final, write the proof artifacts immediately, emit the `DONE:` line, and stop; do not reopen manual query docs or raw files after selection is settled
50
-
51
- ## Steps
52
-
53
- ```
54
- Retrieve:
55
- - [ ] 1. Read config and plan
56
- - [ ] 2. Scan knowledge-base frontmatter
57
- - [ ] 3. Review candidate abstracts
58
- - [ ] 4. Expand through links if needed
59
- - [ ] 5. Compute delta
60
- - [ ] 6. Write retrieval proof
61
- ```
62
-
63
- ### 1. Read config and plan
64
-
65
- - `interf.json` → `knowledge_base.path` to locate the knowledge base
66
- - `compile-plan.md` → this stage's section: categories, priority evidence tiers, truth modes, key entities, date range
67
- - if the plan depends on exact figures from PDFs, charts, or tables, keep that modality requirement visible during retrieval
68
- - `../../.interf/source-access.json` → sample raw paths and suggested access checks when raw fallback is needed
69
- - local instruction docs listed by the stage contract
70
-
71
- Resolve `knowledge_base.path` from config and verify the knowledge base exists (has `summaries/`).
72
-
73
- ### 2. Scan knowledge-base frontmatter
74
-
75
- Read all files in `{knowledge_base.path}/summaries/` frontmatter (fast — no full file reads):
76
- - source
77
- - source_kind
78
- - evidence tier / truth mode / state
79
- - abstract
80
-
81
- Build a summary-set map: total files, source-kind distribution, evidence distribution.
82
-
83
- ### 3. Review candidate abstracts
84
-
85
- From compile-plan.md filter criteria, identify a candidate set. Then read the abstract block for every candidate file before final selection.
86
- If the use case depends on exact numeric comparisons from charts or tables, do not exclude a candidate just because the summary abstract is coarse. Keep files whose key evidence may still live in raw visuals.
87
-
88
- ### 4. Expand through links if needed
89
-
90
- If candidate abstracts point to adjacent summaries that may materially change the answer, follow those links, review their abstracts, and repeat until the retrieved set is coverage-complete for the interface question.
91
- Track emergent clusters that suggest the initial interface runtime is missing concepts, relationships, or taxonomy branches.
92
- When chart-heavy PDFs or report pages are likely to hold the decisive evidence, preserve that signal for later stages instead of routing the interface toward prose-only summaries.
93
- If exact numbers will require a local extraction path against the raw PDF, carry that requirement forward explicitly instead of assuming the analysis stage can infer it from a coarse abstract.
94
-
95
- ### 5. Compute delta
96
-
97
- - If the current workspace already makes the delta obvious, keep `delta_files` limited to the newly relevant or newly changed files.
98
- - If the prior compile boundary is not obvious from the current workspace, use the conservative fallback: set `delta_files` equal to the selected relevant set for this run.
99
-
100
- ### 6. Write retrieval proof
101
-
102
- Write the full retrieved set to `.interf/relevant.json` in the current runtime shape. At minimum include:
103
- - `generated_at`
104
- - `knowledge_base_summary_count` derived from the current knowledge-base summary total
105
- - `relevant_files` with the actual knowledge-base-relative summary paths selected in this run
106
- - `delta_files` with the actual knowledge-base-relative summary paths that are new or changed for this run
107
-
108
- Do not paste placeholder filenames, canned totals, or copied sample counters into the runtime artifact.
109
- If `.interf/relevant.json` does not exist yet, create it in one complete write rather than trying to patch a missing file.
110
-
111
- Write retrieval proof to `.interf/coverage.json` in the current verifier shape. Include:
112
- - top-level `generated_at`
113
- - top-level counts derived from this run: `knowledge_base_summary_total`, `frontmatter_scanned`, `candidates_after_frontmatter`, `abstracts_reviewed`, `expansion_passes`, `relevant_selected`, `rejected`, `coverage_complete`
114
- - `proof.scanned` for the full scanned summary set
115
- - `proof.reviewed` for the candidate abstracts actually reviewed
116
- - `proof.retrieved` for the selected relevant set
117
- - `proof.excluded` for the excluded set
118
-
119
- `proof.retrieved` plus `proof.excluded` must partition the scanned set for this run.
120
-
121
- If `.interf/coverage.json` already exists, read it and then rewrite the complete JSON document. Do not patch old counters or timestamps line-by-line.
122
- If the retrieve stage reveals clear runtime gaps, preserve that signal for later stages via `.interf/analysis.json` or the next stage handoff rather than silently discarding it.
123
-
124
- Report to user with status-style lines:
125
- ```
126
- STATUS: loaded retrieve plan N summary files.
127
- STATUS: scanned N/N
128
- STATUS: reviewed M abstracts, P expansion passes
129
- STATUS: selected R relevant, X rejected, D delta
130
- DONE: retrieve complete
131
- ```
132
-
133
- When the retrieval proof and relevant set are written, emit the required `DONE:` line and stop. The CLI reconciles `.interf/state.json` and refreshes `.interf/health.json` after validation. Do not keep exploring once retrieval closure is recorded.
@@ -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.