@interf/compiler 0.1.8

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 (145) hide show
  1. package/LICENSE +183 -0
  2. package/README.md +1008 -0
  3. package/TRADEMARKS.md +19 -0
  4. package/dist/bin.d.ts +3 -0
  5. package/dist/bin.d.ts.map +1 -0
  6. package/dist/bin.js +30 -0
  7. package/dist/bin.js.map +1 -0
  8. package/dist/commands/benchmark.d.ts +3 -0
  9. package/dist/commands/benchmark.d.ts.map +1 -0
  10. package/dist/commands/benchmark.js +400 -0
  11. package/dist/commands/benchmark.js.map +1 -0
  12. package/dist/commands/compile.d.ts +3 -0
  13. package/dist/commands/compile.d.ts.map +1 -0
  14. package/dist/commands/compile.js +139 -0
  15. package/dist/commands/compile.js.map +1 -0
  16. package/dist/commands/create.d.ts +49 -0
  17. package/dist/commands/create.d.ts.map +1 -0
  18. package/dist/commands/create.js +813 -0
  19. package/dist/commands/create.js.map +1 -0
  20. package/dist/commands/default.d.ts +3 -0
  21. package/dist/commands/default.d.ts.map +1 -0
  22. package/dist/commands/default.js +52 -0
  23. package/dist/commands/default.js.map +1 -0
  24. package/dist/commands/doctor.d.ts +3 -0
  25. package/dist/commands/doctor.d.ts.map +1 -0
  26. package/dist/commands/doctor.js +146 -0
  27. package/dist/commands/doctor.js.map +1 -0
  28. package/dist/commands/init.d.ts +3 -0
  29. package/dist/commands/init.d.ts.map +1 -0
  30. package/dist/commands/init.js +235 -0
  31. package/dist/commands/init.js.map +1 -0
  32. package/dist/commands/list.d.ts +3 -0
  33. package/dist/commands/list.d.ts.map +1 -0
  34. package/dist/commands/list.js +32 -0
  35. package/dist/commands/list.js.map +1 -0
  36. package/dist/commands/reset.d.ts +3 -0
  37. package/dist/commands/reset.d.ts.map +1 -0
  38. package/dist/commands/reset.js +136 -0
  39. package/dist/commands/reset.js.map +1 -0
  40. package/dist/commands/status.d.ts +3 -0
  41. package/dist/commands/status.d.ts.map +1 -0
  42. package/dist/commands/status.js +67 -0
  43. package/dist/commands/status.js.map +1 -0
  44. package/dist/commands/verify.d.ts +3 -0
  45. package/dist/commands/verify.d.ts.map +1 -0
  46. package/dist/commands/verify.js +112 -0
  47. package/dist/commands/verify.js.map +1 -0
  48. package/dist/index.d.ts +30 -0
  49. package/dist/index.d.ts.map +1 -0
  50. package/dist/index.js +18 -0
  51. package/dist/index.js.map +1 -0
  52. package/dist/lib/agents.d.ts +59 -0
  53. package/dist/lib/agents.d.ts.map +1 -0
  54. package/dist/lib/agents.js +760 -0
  55. package/dist/lib/agents.js.map +1 -0
  56. package/dist/lib/benchmark.d.ts +30 -0
  57. package/dist/lib/benchmark.d.ts.map +1 -0
  58. package/dist/lib/benchmark.js +325 -0
  59. package/dist/lib/benchmark.js.map +1 -0
  60. package/dist/lib/config.d.ts +6 -0
  61. package/dist/lib/config.d.ts.map +1 -0
  62. package/dist/lib/config.js +15 -0
  63. package/dist/lib/config.js.map +1 -0
  64. package/dist/lib/discovery.d.ts +8 -0
  65. package/dist/lib/discovery.d.ts.map +1 -0
  66. package/dist/lib/discovery.js +80 -0
  67. package/dist/lib/discovery.js.map +1 -0
  68. package/dist/lib/executors.d.ts +33 -0
  69. package/dist/lib/executors.d.ts.map +1 -0
  70. package/dist/lib/executors.js +44 -0
  71. package/dist/lib/executors.js.map +1 -0
  72. package/dist/lib/filesystem.d.ts +4 -0
  73. package/dist/lib/filesystem.d.ts.map +1 -0
  74. package/dist/lib/filesystem.js +61 -0
  75. package/dist/lib/filesystem.js.map +1 -0
  76. package/dist/lib/interf.d.ts +37 -0
  77. package/dist/lib/interf.d.ts.map +1 -0
  78. package/dist/lib/interf.js +1104 -0
  79. package/dist/lib/interf.js.map +1 -0
  80. package/dist/lib/local-workflows.d.ts +35 -0
  81. package/dist/lib/local-workflows.d.ts.map +1 -0
  82. package/dist/lib/local-workflows.js +149 -0
  83. package/dist/lib/local-workflows.js.map +1 -0
  84. package/dist/lib/parse.d.ts +9 -0
  85. package/dist/lib/parse.d.ts.map +1 -0
  86. package/dist/lib/parse.js +51 -0
  87. package/dist/lib/parse.js.map +1 -0
  88. package/dist/lib/registry.d.ts +28 -0
  89. package/dist/lib/registry.d.ts.map +1 -0
  90. package/dist/lib/registry.js +80 -0
  91. package/dist/lib/registry.js.map +1 -0
  92. package/dist/lib/runtime.d.ts +59 -0
  93. package/dist/lib/runtime.d.ts.map +1 -0
  94. package/dist/lib/runtime.js +615 -0
  95. package/dist/lib/runtime.js.map +1 -0
  96. package/dist/lib/schema.d.ts +705 -0
  97. package/dist/lib/schema.d.ts.map +1 -0
  98. package/dist/lib/schema.js +443 -0
  99. package/dist/lib/schema.js.map +1 -0
  100. package/dist/lib/state.d.ts +49 -0
  101. package/dist/lib/state.d.ts.map +1 -0
  102. package/dist/lib/state.js +633 -0
  103. package/dist/lib/state.js.map +1 -0
  104. package/dist/lib/summarize-plan.d.ts +16 -0
  105. package/dist/lib/summarize-plan.d.ts.map +1 -0
  106. package/dist/lib/summarize-plan.js +112 -0
  107. package/dist/lib/summarize-plan.js.map +1 -0
  108. package/dist/lib/user-config.d.ts +6 -0
  109. package/dist/lib/user-config.d.ts.map +1 -0
  110. package/dist/lib/user-config.js +16 -0
  111. package/dist/lib/user-config.js.map +1 -0
  112. package/dist/lib/validate.d.ts +149 -0
  113. package/dist/lib/validate.d.ts.map +1 -0
  114. package/dist/lib/validate.js +838 -0
  115. package/dist/lib/validate.js.map +1 -0
  116. package/dist/lib/workflow-definitions.d.ts +79 -0
  117. package/dist/lib/workflow-definitions.d.ts.map +1 -0
  118. package/dist/lib/workflow-definitions.js +565 -0
  119. package/dist/lib/workflow-definitions.js.map +1 -0
  120. package/dist/lib/workflows.d.ts +125 -0
  121. package/dist/lib/workflows.d.ts.map +1 -0
  122. package/dist/lib/workflows.js +1107 -0
  123. package/dist/lib/workflows.js.map +1 -0
  124. package/package.json +73 -0
  125. package/skills/benchmark/SKILL.md +129 -0
  126. package/skills/interface/analyze/SKILL.md +140 -0
  127. package/skills/interface/compile/SKILL.md +153 -0
  128. package/skills/interface/compile/references/output-format.md +48 -0
  129. package/skills/interface/create/SKILL.md +264 -0
  130. package/skills/interface/create/references/compile-plan-format.md +109 -0
  131. package/skills/interface/create/references/workflows.md +50 -0
  132. package/skills/interface/query/SKILL.md +34 -0
  133. package/skills/interface/retrieve/SKILL.md +166 -0
  134. package/skills/knowledge-base/compile/SKILL.md +220 -0
  135. package/skills/knowledge-base/compile/references/output-format.md +48 -0
  136. package/skills/knowledge-base/compile/references/stage-claims.md +60 -0
  137. package/skills/knowledge-base/compile/references/stage-entities.md +46 -0
  138. package/skills/knowledge-base/query/SKILL.md +33 -0
  139. package/skills/knowledge-base/summarize/SKILL.md +122 -0
  140. package/skills/workflow/create/SKILL.md +126 -0
  141. package/templates/interface/README.md +158 -0
  142. package/templates/interface/interfaces.md +99 -0
  143. package/templates/knowledge-base/README.md +138 -0
  144. package/templates/knowledge-base/interfignore +19 -0
  145. package/templates/knowledge-base/registry.md +118 -0
@@ -0,0 +1,158 @@
1
+ # Interf Interface
2
+
3
+ Focused local context shells on top of your knowledge base. Any coding agent can navigate them.
4
+
5
+ ## Architecture
6
+
7
+ ```text
8
+ source-folder/
9
+ interf/
10
+ {knowledge-base-name}/ knowledge base
11
+ interfaces/
12
+ {name}/ interface
13
+ interf.json type: interface, workflow, knowledge_base.path
14
+ compile-plan.md interface execution plan
15
+ AGENTS.md bootstrap
16
+ CLAUDE.md Claude Code bootstrap mirror
17
+ workflow/ local workflow package
18
+ home.md entry point
19
+ .gitignore
20
+ .interf/ hidden runtime state
21
+ knowledge/ local entities/claims/indexes
22
+ briefs/ hero documents
23
+ summaries/ periodic summaries
24
+ ```
25
+
26
+ Interfaces are usually created by `interf create interface` from the source folder for a knowledge base. The source folder is the human control plane. The interface is the generated workspace for one job.
27
+
28
+ Contract model:
29
+ - `type` = engine object kind in config/schema (`interface`)
30
+ - `workflow` = user-facing methodology selection
31
+ - `.interf/stage-contract.json` = generated per-run contract for the active stage
32
+ - executor = the agent/runtime that implements the active stage
33
+
34
+ ## Compile flow
35
+
36
+ ```text
37
+ interf compile:
38
+ Step 1/3: interface/retrieve scan all summary frontmatter, prove coverage, compute delta
39
+ Step 2/3: interface/analyze batch analysis, extract, refine runtime from evidence
40
+ Step 3/3: interface/compile create local context shell, validate
41
+ ```
42
+
43
+ State bridges between steps. If step 2 fails, the next run resumes from step 2.
44
+
45
+ ## Workflows
46
+
47
+ Shipped interface workflows:
48
+ - `briefing`
49
+ - `research`
50
+ - `audit`
51
+
52
+ The selected workflow is written to `interf.json` and can seed starter local `workflow/` docs.
53
+ Create new reusable workflows from the wizard when you want a named local variation.
54
+
55
+ ## Bundled stage skills
56
+
57
+ | Skill | Step | What |
58
+ |---|---|---|
59
+ | `interface/create` | — | Create interface, draft the initial runtime hypothesis |
60
+ | `interface/retrieve` | 1/3 | Scan the full knowledge-base summary set, persist retrieval proof, compute delta |
61
+ | `interface/analyze` | 2/3 | Batch analysis, subagents, extract entities/claims |
62
+ | `interface/compile` | 3/3 | Build local outputs, validate, clean up |
63
+
64
+ ## interf.json
65
+
66
+ Minimal. Source of truth for type and knowledge-base reference.
67
+
68
+ ```json
69
+ {
70
+ "type": "interface",
71
+ "name": "weekly-briefing",
72
+ "workflow": "briefing",
73
+ "knowledge_base": {
74
+ "path": "../.."
75
+ }
76
+ }
77
+ ```
78
+
79
+ `knowledge_base.path` points to the parent knowledge base. All filter criteria, extraction goals, and output specs live in `compile-plan.md`.
80
+ `workflow` records the selected methodology. Interf generates per-run stage contracts from it for this interface.
81
+
82
+ If you want different retrieval, ontology, or output bias, use a workflow and local `workflow/`.
83
+ If you want a different stage graph, proof model, or required artifacts, that is effectively a new workflow.
84
+
85
+ `AGENTS.md` is the source of truth. `CLAUDE.md` is a generated mirror so Claude Code picks up the same interface instructions automatically.
86
+
87
+ `workflow/` is where you can edit interface-local instruction docs:
88
+ - `workflow/README.md`
89
+ - `workflow/create/SKILL.md`
90
+ - `workflow/use/query/SKILL.md`
91
+ - `workflow/compile/stages/retrieve/SKILL.md`
92
+ - `workflow/compile/stages/analyze/SKILL.md`
93
+ - `workflow/compile/stages/compile/SKILL.md`
94
+
95
+ Simplest pattern:
96
+ - edit `workflow/compile/stages/retrieve/SKILL.md` to change retrieval logic
97
+ - edit `workflow/compile/stages/analyze/SKILL.md` to change ontology/extraction logic
98
+ - edit `workflow/compile/stages/compile/SKILL.md` to change output/navigation logic
99
+ - edit `workflow/use/query/SKILL.md` to change the manual interface query loop
100
+
101
+ Workflow seeds may already place starter docs in these folders. Treat them as editable local guidance, not as locked system files.
102
+ Use `AGENTS.md` for navigation, command usage, and the manual access checklist. Use `workflow/` for query behavior and stage behavior.
103
+
104
+ These are the local instruction layer for the interface. Add JSON frontmatter with `mode: extend` or `mode: override` when you want to declare whether a doc should add to or replace the bundled stage instructions for that stage.
105
+
106
+ Interf still enforces the same coverage proof, artifact schema, and state flow either way.
107
+ If you need a different stage chain, artifact contract, or verifier flow, create a new workflow in the SDK instead of encoding that in local skill docs.
108
+
109
+ If your coding agent is sandboxed to the current directory tree, launch it from the source folder so the source root, knowledge base, and this interface all stay reachable.
110
+ Use `../../.interf/source-access.json` to verify that raw files are actually reachable before you depend on raw fallback in a manual agent session. `suggested_checks` are canonical absolute file paths so they remain valid from inside the interface folder.
111
+
112
+ If Obsidian viewer defaults are enabled during `interf init`, newly created interfaces get minimal `.obsidian/graph.json` defaults. They are not registered as standalone vaults by default; browse them from the parent knowledge-base vault so knowledge-base summaries and source links remain navigable.
113
+
114
+ ## Runtime files
115
+
116
+ Interfaces maintain runtime artifacts under `.interf/`:
117
+ - `state.json` — mutable runtime state
118
+ - `health.json` — computed compile status and key metrics
119
+ - `view-spec.json` — presentation contract for cards, graph scope, and navigation
120
+ - `run.json` — current or last deterministic stage run
121
+ - `stage-contract.json` — machine-readable contract for the active stage
122
+ - `run-history.jsonl` — append-only history of completed runs
123
+ - `relevant.json` — selected files for this interface
124
+ - `coverage.json` — retrieval proof for this run
125
+
126
+ `interf status` for an interface is read-only and deterministic. It checks config, knowledge-base path resolution, broken wikilinks, and retrieval coverage.
127
+ `interf verify interface-plan --json` is the deterministic referee for the scaffold and `compile-plan.md`.
128
+ `interf verify retrieve --json` is the deterministic referee for interface retrieval proof before analyze/build.
129
+
130
+ See `docs/runtime-contract.md` for the human-readable contract and `src/lib/schema.ts` for the exact runtime schemas.
131
+
132
+ ## compile-plan.md
133
+
134
+ Generated by `interface/create`. Defines:
135
+ - Stage 1: filter criteria
136
+ - Stage 2: extraction goals and allowed runtime refinements
137
+ - Stage 3: output specs for the local context shell
138
+
139
+ This is the initial interface definition. Compile can refine it when the evidence clearly demands better local structure.
140
+
141
+ ## Key principles
142
+
143
+ **Local outputs only.** The parent knowledge base is read-only. The interface builds its own `knowledge/` and output folders.
144
+
145
+ **No auto-cascade.** Knowledge-base compile and interface compile are separate commands.
146
+
147
+ **Delta compile.** On subsequent runs, only changed files are processed.
148
+
149
+ **Coverage-gated retrieval.** Retrieval is complete only when the system can prove the full summary set was scanned at the routing layer, candidate abstracts were reviewed, and selected plus rejected sets were persisted.
150
+
151
+ **Local context shell.** The interface is not just a report folder. It should become the easiest place for an agent to enter, navigate, and understand the relevant slice of the knowledge base.
152
+
153
+ ## Reset
154
+
155
+ ```text
156
+ interf reset compile remove knowledge/ + briefs/ + summaries/, keep config
157
+ interf reset all remove all generated content, preserve config files
158
+ ```
@@ -0,0 +1,99 @@
1
+ # Interface Workflows
2
+
3
+ Pre-designed interface workflows. Each defines a use case, guiding questions, filter criteria, output inventory, and benchmark queries for validation.
4
+
5
+ When `interf create interface` builds an interface, it starts from one of these workflows and adapts it to the selected knowledge-base data.
6
+
7
+ Benchmark queries exist today as validation prompts and expected behaviors. The automated benchmark runner and score logging loop are planned, not yet implemented in the engine.
8
+
9
+ ---
10
+
11
+ ## briefing
12
+
13
+ Current-state briefing. Best when you want the latest truth, recent changes, and immediate next steps.
14
+
15
+ **Questions this interface answers:**
16
+ - What is true right now?
17
+ - What changed recently?
18
+ - What should I focus on next?
19
+ - Which decisions or risks are active?
20
+
21
+ **Filter:** categories include current-state docs, changelogs, plans, updates, decisions
22
+
23
+ **Outputs:**
24
+ - Current-State.md — current truth with citations
25
+ - Changes.md — recent changes and trend lines
26
+ - Next-Steps.md — action-oriented follow-through
27
+
28
+ **Summaries:** weekly, monthly, or milestone-based
29
+
30
+ **Benchmark queries:**
31
+ - "What is true right now?" — should prefer current, confirmed signals over stale material
32
+ - "What changed recently?" — should compare recent vs prior, not show random old notes
33
+ - "What should happen next?" — should surface evidence-linked actions, not generic advice
34
+
35
+ ---
36
+
37
+ ## research
38
+
39
+ Research synthesis. Best when you want themes, contradictions, evidence strength, and open questions from a dense knowledge base.
40
+
41
+ **Questions this interface answers:**
42
+ - What are the dominant themes?
43
+ - Which claims are well-supported?
44
+ - Where do sources disagree?
45
+ - What questions still need more evidence?
46
+
47
+ **Filter:** categories include primary sources, papers, notes, experiments, datasets, repos
48
+
49
+ **Outputs:**
50
+ - Themes.md — recurring themes with evidence
51
+ - Contradictions.md — disagreements, caveats, counterevidence
52
+ - Open-Questions.md — unresolved questions and next reads
53
+
54
+ **Summaries:** by topic cluster or period
55
+
56
+ **Benchmark queries:**
57
+ - "What are the strongest themes?" — should show themes with citations, not loose impressions
58
+ - "Where do sources disagree?" — should show both sides and the evidence basis
59
+ - "What should I read next?" — should turn gaps into concrete next-source suggestions
60
+
61
+ ---
62
+
63
+ ## audit
64
+
65
+ Audit and gap-finding. Best when you want to improve knowledge-base quality, spot stale areas, and surface missing or contradictory evidence.
66
+
67
+ **Questions this interface answers:**
68
+ - What is missing or weakly covered?
69
+ - Which facts or claims look inconsistent?
70
+ - Which outputs need verification or refresh?
71
+ - What should be added to the knowledge base next?
72
+
73
+ **Filter:** categories include canonical records, requirements, policies, status docs, recent changes
74
+
75
+ **Outputs:**
76
+ - Gaps.md — missing areas and thin coverage
77
+ - Contradictions.md — inconsistent facts or claims
78
+ - Follow-Ups.md — concrete verification or ingestion work
79
+
80
+ **Benchmark queries:**
81
+ - "What is missing?" — should identify concrete gaps, not generic advice
82
+ - "What looks inconsistent?" — should cite the conflicting evidence explicitly
83
+ - "What should we verify next?" — should turn issues into concrete follow-up work
84
+
85
+ ---
86
+
87
+ ## Self-improving loop (planned runner)
88
+
89
+ Every interface workflow includes benchmark queries. The intended validation cycle is:
90
+
91
+ 1. Build the interface from its config
92
+ 2. Run benchmark queries against the vault
93
+ 3. Score: did each query return expected behavior?
94
+ 4. If score is below threshold:
95
+ - Analyze failures
96
+ - Adjust the interface plan and ontology in `compile-plan.md`
97
+ - Re-compile
98
+ - Re-benchmark
99
+ 5. Log scores per model per interface for comparison
@@ -0,0 +1,138 @@
1
+ # Interf Knowledge Base
2
+
3
+ Your local knowledge base for agents. Attach to any folder, then let Interf compile source files into summaries plus a cross-file knowledge layer.
4
+
5
+ ## Architecture
6
+
7
+ ```text
8
+ source-folder/ user's files (untouched)
9
+ └── interf/
10
+ └── {knowledge-base-name}/ knowledge base
11
+ ├── interf.json type: knowledge-base, workflow, name, source.path
12
+ ├── AGENTS.md bootstrap
13
+ ├── CLAUDE.md Claude Code bootstrap mirror
14
+ ├── workflow/ local workflow package
15
+ ├── home.md entry point
16
+ ├── .interfignore source exclusion patterns
17
+ ├── .gitignore
18
+ ├── .interf/ hidden runtime state
19
+ │ ├── state.json
20
+ │ ├── health.json
21
+ │ ├── source-access.json
22
+ │ └── view-spec.json
23
+ ├── summaries/ per-file evidence objects
24
+ ├── knowledge/
25
+ │ ├── entities/
26
+ │ ├── claims/
27
+ │ └── indexes/
28
+ └── interfaces/
29
+ └── {name}/ focused workspaces for specific jobs
30
+ ```
31
+
32
+ Knowledge bases are created by `interf create knowledge-base` from the source folder. The source folder is the human control plane. The knowledge base is the generated workspace. One source folder can host multiple named knowledge bases under `interf/` when you want to compare workflows over the same folder.
33
+
34
+ Contract model:
35
+ - `type` = engine object kind in config/schema (`knowledge-base`)
36
+ - `workflow` = user-facing methodology selection
37
+ - `.interf/stage-contract.json` = generated per-run contract for the active stage
38
+ - executor = the agent/runtime that implements the active stage
39
+
40
+ ## Processing flow
41
+
42
+ ```text
43
+ cd source-folder
44
+ interf create knowledge-base → creates ./interf/<knowledge-base-name>/
45
+ interf compile:
46
+ Step 1/2: summarize source files into evidence objects → summaries/
47
+ Step 2/2: compile cross-file knowledge + retrieval → knowledge/ + home.md
48
+ ```
49
+
50
+ ## Workflows
51
+
52
+ Shipped knowledge-base workflows:
53
+ - `interf`
54
+ - `karpathy`
55
+
56
+ Create new reusable workflows from the wizard when you want a named local variation.
57
+
58
+ The selected workflow is written to `interf.json` and can seed starter local `workflow/` docs.
59
+
60
+ ## Bundled stage skills
61
+
62
+ | Skill | Step | What |
63
+ |---|---|---|
64
+ | `knowledge-base/summarize` | 1/2 | Generate source-grounded evidence objects for unprocessed source files |
65
+ | `knowledge-base/compile` | 2/2 | Build the cross-file knowledge layer and retrieval structures |
66
+
67
+ ## interf.json
68
+
69
+ Minimal config. Points to the source folder:
70
+
71
+ ```json
72
+ {
73
+ "type": "knowledge-base",
74
+ "name": "my-notes",
75
+ "workflow": "interf",
76
+ "source": {
77
+ "path": "../.."
78
+ }
79
+ }
80
+ ```
81
+
82
+ `workflow` records the selected methodology. Interf generates per-run stage contracts from it for this knowledge base.
83
+
84
+ If you want different stage behavior or domain bias, use a workflow and local `workflow/`.
85
+ If you want a different stage graph, proof model, or required artifacts, that is effectively a new workflow.
86
+
87
+ `AGENTS.md` is the source of truth. `CLAUDE.md` is a generated mirror so Claude Code picks up the same knowledge-base instructions automatically.
88
+
89
+ `workflow/` is where you can edit knowledge-base-local instruction docs:
90
+ - `workflow/README.md`
91
+ - `workflow/create/SKILL.md`
92
+ - `workflow/use/query/SKILL.md`
93
+ - `workflow/compile/stages/summarize/SKILL.md`
94
+ - `workflow/compile/stages/compile/SKILL.md`
95
+
96
+ Simplest pattern:
97
+ - edit `workflow/compile/stages/summarize/SKILL.md` to change summarize logic
98
+ - edit `workflow/compile/stages/compile/SKILL.md` to change knowledge-base compile logic
99
+ - edit `workflow/use/query/SKILL.md` to change the manual query loop
100
+
101
+ Workflow seeds may already place starter docs in these folders. Treat them as editable local guidance, not as locked system files.
102
+ Use `AGENTS.md` for navigation, command usage, and the manual access checklist. Use `workflow/` for query behavior and stage behavior.
103
+
104
+ These are the local instruction layer for the knowledge base. Add JSON frontmatter with `mode: extend` or `mode: override` when you want to declare whether a doc should add to or replace the bundled stage instructions for that stage.
105
+
106
+ Interf still enforces the same proof contract, artifact schema, and state flow either way.
107
+ If you need a different stage chain, artifact contract, or verifier flow, create a new workflow in the SDK instead of encoding that in local skill docs.
108
+
109
+ If your coding agent is sandboxed to the current directory tree, launch it from the source folder so both raw files and this knowledge base stay reachable.
110
+ Use `.interf/source-access.json` to verify that raw files are actually reachable before you depend on raw fallback in a manual agent session. `suggested_checks` are canonical absolute file paths so they still work from nested interface folders.
111
+
112
+ ## Status
113
+
114
+ Knowledge bases maintain runtime artifacts under `.interf/`:
115
+ - `state.json` — mutable runtime state
116
+ - `health.json` — computed trust surface for summarize/compile status
117
+ - `source-access.json` — raw-file access quick check for manual sessions
118
+ - `run.json` — current or last deterministic stage run
119
+ - `stage-contract.json` — machine-readable contract for the active stage
120
+ - `run-history.jsonl` — append-only history of completed runs
121
+ - `view-spec.json` — viewer-neutral layout contract
122
+
123
+ `interf status` is read-only and deterministic. It runs source discovery, checks config, summary frontmatter, abstract minimums, and broken wikilinks.
124
+ Use `interf verify summarize --json` after summary generation and `interf verify compile --json` after knowledge-base compilation for explicit pass/fail checks when testing the workflow or driving it from an agent.
125
+
126
+ See `docs/runtime-contract.md` for the human-readable contract and `src/lib/schema.ts` for the exact runtime schemas.
127
+
128
+ ## Scan accountability
129
+
130
+ `knowledge-base/compile` writes an inventory of all `summaries/` files before scanning. The scanned count must equal the inventory count. If it does not, the skill stops and reports the gap.
131
+
132
+ ## Reset
133
+
134
+ ```text
135
+ interf reset compile remove knowledge/, keep summaries/
136
+ interf reset summarize remove summaries/
137
+ interf reset all remove all generated content, preserve source files
138
+ ```
@@ -0,0 +1,19 @@
1
+ # Files and directories to exclude from interf source discovery.
2
+ # Same syntax as .gitignore.
3
+
4
+ # Build artifacts
5
+ dist/
6
+ build/
7
+ out/
8
+
9
+ # Logs and temp files
10
+ *.log
11
+ *.tmp
12
+
13
+ # Environment and secrets
14
+ .env
15
+ .env.*
16
+
17
+ # OS files
18
+ .DS_Store
19
+ Thumbs.db
@@ -0,0 +1,118 @@
1
+ # Interf Registry
2
+
3
+ The registry at `~/.interf/registry.json` tracks all knowledge bases and interfaces on this machine. The CLI and skills read it to list knowledge bases, show status, and navigate between them.
4
+
5
+ ## Format
6
+
7
+ ```json
8
+ {
9
+ "version": 5,
10
+ "knowledgeBases": [
11
+ {
12
+ "name": "research",
13
+ "path": "/path/to/research",
14
+ "workflow": "interf",
15
+ "created": "2026-03-30T14:00:00Z"
16
+ },
17
+ {
18
+ "name": "ops",
19
+ "path": "/path/to/ops",
20
+ "workflow": "karpathy",
21
+ "created": "2026-03-30T15:00:00Z"
22
+ }
23
+ ],
24
+ "interfaces": [
25
+ {
26
+ "name": "weekly-briefing",
27
+ "path": "/path/to/weekly-briefing",
28
+ "knowledgeBase": "ops",
29
+ "knowledgeBasePath": "/path/to/ops",
30
+ "workflow": "briefing",
31
+ "created": "2026-03-30T16:00:00Z"
32
+ },
33
+ {
34
+ "name": "gap-audit",
35
+ "path": "/path/to/gap-audit",
36
+ "knowledgeBase": "research",
37
+ "knowledgeBasePath": "/path/to/research",
38
+ "workflow": "audit",
39
+ "created": "2026-03-30T16:30:00Z"
40
+ }
41
+ ]
42
+ }
43
+ ```
44
+
45
+ ## Fields
46
+
47
+ **Knowledge-base entry:**
48
+ - `name` — short identifier
49
+ - `path` — absolute path to knowledge-base root
50
+ - `workflow` — selected methodology
51
+ - `created` — ISO timestamp
52
+
53
+ **Interface entry:**
54
+ - `name` — short identifier
55
+ - `path` — absolute path to interface root
56
+ - `knowledgeBase` — name of the connected knowledge base
57
+ - `knowledgeBasePath` — absolute path to the connected knowledge base
58
+ - `workflow` — selected methodology
59
+ - `created` — ISO timestamp
60
+
61
+ ## When it's updated
62
+
63
+ | Action | Registry change |
64
+ |---|---|
65
+ | `interf create knowledge-base` | Adds a knowledge-base entry |
66
+ | `interf create interface` | Adds an interface entry |
67
+ | `interf compile` | Does NOT update registry |
68
+ | manual cleanup / future remove command | Removes entry (does not delete files) |
69
+
70
+ The registry stores static info only: names, paths, connections. It never stores processing status.
71
+
72
+ ## How status is computed (live, not stored)
73
+
74
+ Processing status is always computed on demand from the filesystem:
75
+
76
+ ```
77
+ For each knowledge base:
78
+ source_count = discover source files from source.path
79
+ summary_count = count files in {path}/summaries/
80
+ pending = source_count - summary_count
81
+ status = pending > 0 ? "pending" : "compiled"
82
+
83
+ For each interface:
84
+ state = read {path}/.interf/state.json
85
+ knowledge_base_summary = count files in {knowledgeBasePath}/summaries/
86
+ stale = knowledge_base_summary > state.knowledge_base_summary_count_at_last_compile
87
+ status = stale ? "stale" : "compiled"
88
+ ```
89
+
90
+ This avoids cached status going stale. Always compute fresh.
91
+
92
+ ## CLI output
93
+
94
+ ```
95
+ $ interf list
96
+
97
+ Knowledge Bases
98
+ ─────────────────────────────────
99
+ research 1,240 files compiled
100
+ ops 892 files 3 pending
101
+
102
+ Interfaces
103
+ ─────────────────────────────────
104
+ weekly-briefing → ops compiled
105
+ gap-audit → research stale (12 new)
106
+ ```
107
+
108
+ ## Creation
109
+
110
+ `interf create knowledge-base` or `interf create interface` creates `~/.interf/` and `registry.json` if they don't exist yet. The initial registry:
111
+
112
+ ```json
113
+ {
114
+ "version": 5,
115
+ "knowledgeBases": [],
116
+ "interfaces": []
117
+ }
118
+ ```