@interf/compiler 0.1.8 → 0.1.9
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.
- package/README.md +140 -885
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,471 +2,129 @@
|
|
|
2
2
|
|
|
3
3
|
The open-source knowledge compiler.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Interf is a filesystem-first system for building, testing, and comparing agent-ready knowledge structures.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- compile any folder into a knowledge base
|
|
8
|
+
- create focused interfaces for specific tasks
|
|
9
|
+
- run evals and benchmarks on your own files
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
The deeper differentiator is benchmarkability:
|
|
12
|
-
- build multiple knowledge bases over the same folder
|
|
13
|
-
- compare workflows like `interf` vs `karpathy`
|
|
14
|
-
- compare interfaces for the same business task
|
|
15
|
-
- inspect proofs, outputs, and cost locally instead of trusting marketing claims
|
|
16
|
-
|
|
17
|
-
A useful mental model is: **Karpathy-style LLM knowledge bases plus autoresearch-style eval loops**. Interf gives you the local filesystem contract, proofs, and workflow runtime to create the knowledge base, operate interfaces on top of it, and compare methods over time.
|
|
18
|
-
|
|
19
|
-
Another useful framing:
|
|
20
|
-
|
|
21
|
-
- knowledge base = compiled shared context layer
|
|
22
|
-
- interface = task-specific knowledge surface for agents
|
|
23
|
-
- evals + benchmarks = the trust loop that tells you whether the method actually works
|
|
24
|
-
|
|
25
|
-
Architecture docs:
|
|
26
|
-
- [`docs/architecture.md`](./docs/architecture.md) — fastest way to understand the whole SDK
|
|
27
|
-
- [`docs/workflow-spec.md`](./docs/workflow-spec.md) — workflow package, compile pipeline, and stage-contract spec
|
|
28
|
-
- [`docs/runtime-contract.md`](./docs/runtime-contract.md) — exact runtime artifact contract
|
|
29
|
-
|
|
30
|
-
Doc roles:
|
|
31
|
-
- `README.md` = public human entrypoint
|
|
32
|
-
- `AGENTS.md` = maintainer and coding-agent operating guide for this repo
|
|
33
|
-
- `CLAUDE.md` = generated mirror of `AGENTS.md` for Claude Code
|
|
34
|
-
- `docs/` = deeper public technical references
|
|
11
|
+
Most LLM knowledge-base repos optimize for a demo. Interf optimizes for proof. It keeps your files on disk, compiles a visible folder an agent can actually use, and makes workflows compete on your evals instead of on marketing claims.
|
|
35
12
|
|
|
36
13
|
## Why Interf
|
|
37
14
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
- visible instructions: the compiled KB or interface folder tells the agent what to read and how to work
|
|
41
|
-
- visible proof of work: stages leave runtime state, artifacts, and coverage proof on disk
|
|
42
|
-
- visible comparison: benchmarks run on your folder so you can compare workflows and interfaces instead of trusting a claim
|
|
43
|
-
|
|
44
|
-
That is the product wedge:
|
|
45
|
-
|
|
46
|
-
- force the agent to read the right layer before it answers
|
|
47
|
-
- force the workflow to leave evidence of what happened
|
|
48
|
-
- force the method to compete on your evals
|
|
49
|
-
|
|
50
|
-
## How Interf works
|
|
51
|
-
|
|
52
|
-
1. Attach a source folder.
|
|
53
|
-
2. Compile a knowledge base over that folder.
|
|
54
|
-
3. Create one or more task-specific interfaces on top.
|
|
55
|
-
4. Run evals and benchmarks to see which workflow or interface actually performs.
|
|
56
|
-
|
|
57
|
-
## Core idea
|
|
58
|
-
|
|
59
|
-
- **Source folder**: your real files, unchanged
|
|
60
|
-
- **Knowledge base**: the living compiled layer at `./interf/{name}/`
|
|
61
|
-
- **Interface**: `./interf/{name}/interfaces/{interface-name}/`, a focused workspace on top of that knowledge base for a specific job, perspective, or workflow
|
|
62
|
-
|
|
63
|
-
The source folder is not copied into a separate managed store. It is attached in place.
|
|
64
|
-
One source folder can host multiple named knowledge bases under `./interf/` when you want to compare workflows over the same folder.
|
|
65
|
-
|
|
66
|
-
## Top 3 OSS Promises
|
|
67
|
-
|
|
68
|
-
1. Compile any folder into a structured knowledge base
|
|
69
|
-
2. Create focused interfaces for specific tasks on top of it
|
|
70
|
-
3. Define evals, run benchmarks, and pick the best workflow
|
|
71
|
-
|
|
72
|
-
That matters because Interf is designed to let you test methodology, not just store files:
|
|
73
|
-
- compare `interf` vs `karpathy` on the same folder
|
|
74
|
-
- compare multiple interfaces for the same task
|
|
75
|
-
- inspect proofs, costs, and outputs locally instead of trusting claims
|
|
76
|
-
|
|
77
|
-
This is the OSS shape of the project:
|
|
78
|
-
- local workflow engine
|
|
79
|
-
- stage-contract runtime
|
|
80
|
-
- benchmarkable filesystem contract
|
|
81
|
-
|
|
82
|
-
What Interf is really selling is not "AI knowledge" as a vibe. It is the ability to:
|
|
83
|
-
|
|
84
|
-
- compile your own folder into a structured knowledge base
|
|
85
|
-
- create task-specific interfaces on top of it
|
|
86
|
-
- define in plain English what an agent should do, then enforce that it actually happened
|
|
87
|
-
- force agents to leave proof-of-work instead of hand-waving
|
|
88
|
-
- benchmark workflows and interfaces on the same data until you find what actually performs
|
|
89
|
-
|
|
90
|
-
Simple public framing:
|
|
91
|
-
|
|
92
|
-
- source files stay in place
|
|
93
|
-
- `interf compile` compiles them into a knowledge base
|
|
94
|
-
- interfaces give you focused workspaces on top
|
|
95
|
-
- evals define what good looks like
|
|
96
|
-
- benchmarks run those evals across compiled knowledge bases or interfaces
|
|
97
|
-
|
|
98
|
-
## Design choices
|
|
99
|
-
|
|
100
|
-
- filesystem-first: the product surface is the generated folder, not a hidden service
|
|
101
|
-
- workflow packages, not magic prompts: `workflow.json` plus local docs define the method in a readable way
|
|
102
|
-
- contract-checked stages: Interf checks workspace state against the generated stage contract instead of trusting the agent summary
|
|
103
|
-
- benchmark-first: the goal is not to prove Interf is always best; the goal is to make methods explicit and comparable on your task
|
|
104
|
-
|
|
105
|
-
Manual-agent rule:
|
|
106
|
-
- open the relevant knowledge-base or interface workspace first; that is the agent entrypoint
|
|
107
|
-
- `AGENTS.md` owns the manual access checklist: what layer to check first and which higher-level artifacts must be reachable
|
|
108
|
-
- `workflow/use/query/SKILL.md` owns the exact manual query and raw-preflight procedure for that workspace
|
|
109
|
-
- use `.interf/source-access.json` to verify that raw paths are actually reachable before depending on them
|
|
110
|
-
- on the first substantive manual question, run the raw-access preflight immediately
|
|
111
|
-
- if a permission prompt is needed, ask for it immediately instead of silently staying on summaries
|
|
112
|
-
- after the preflight, start the answer with exactly `Raw access: confirmed` or `Raw access: unavailable`
|
|
113
|
-
- if sandboxing blocks raw fallback, relaunch with the source folder granted too
|
|
114
|
-
- use local `workflow/` docs to refine retrieval/output behavior without changing the engine contract
|
|
115
|
-
|
|
116
|
-
## Architecture At A Glance
|
|
117
|
-
|
|
118
|
-
Think of Interf as three visible layers:
|
|
119
|
-
|
|
120
|
-
```text
|
|
121
|
-
source-folder/ control plane, real files
|
|
122
|
-
...your files...
|
|
123
|
-
interf/
|
|
124
|
-
workflows/ reusable local workflow definitions
|
|
125
|
-
benchmarks/ reusable local benchmark specs and saved runs
|
|
126
|
-
{knowledge-base-name}/ primary local knowledge layer
|
|
127
|
-
summaries/ per-file evidence objects
|
|
128
|
-
knowledge/ cross-file knowledge layer
|
|
129
|
-
workflow/ knowledge-base method package
|
|
130
|
-
interfaces/
|
|
131
|
-
{name}/ focused workspace for one job
|
|
132
|
-
knowledge/ interface-local entities/claims
|
|
133
|
-
briefs/ hero outputs
|
|
134
|
-
summaries/ interface-local summaries
|
|
135
|
-
workflow/ interface method package
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
Recommended touchpoints:
|
|
139
|
-
|
|
140
|
-
- **manage from the source folder**
|
|
141
|
-
- **browse the knowledge base** from `./interf/{name}/`
|
|
142
|
-
- **enter an interface** when you want one job-specific layer directly
|
|
143
|
-
|
|
144
|
-
## What You See In The IDE
|
|
145
|
-
|
|
146
|
-
When a user or coding agent opens an Interf knowledge base or interface, the important files should already explain the system:
|
|
147
|
-
|
|
148
|
-
- `interf.json` = what this workspace is and which workflow it uses
|
|
149
|
-
- `AGENTS.md` = the bootstrap/router for how to navigate the workspace, which workflow docs to read, and which commands matter
|
|
150
|
-
- `workflow/` = the editable local method package for this workspace
|
|
151
|
-
- `.interf/state.json` = mutable working state
|
|
152
|
-
- `.interf/health.json` = computed health and status
|
|
153
|
-
- `.interf/stage-contract.json` = the exact contract for the active stage
|
|
154
|
-
- the source folder itself usually has no generated `AGENTS.md` or `CLAUDE.md`; the KB/interface workspace is the agent entrypoint
|
|
155
|
-
|
|
156
|
-
That is the intended developer experience:
|
|
157
|
-
|
|
158
|
-
- read the markdown
|
|
159
|
-
- edit the JSON and workflow docs
|
|
160
|
-
- let Interf verify whether the stage actually completed
|
|
161
|
-
- for interfaces, start with local `workflow/use/query/`, then reuse the parent KB `workflow/use/query/` loop before raw source fallback
|
|
162
|
-
- the compiled KB/interface workspace itself is the agent-facing product surface
|
|
163
|
-
|
|
164
|
-
Two ownership rules matter:
|
|
165
|
-
|
|
166
|
-
- `workflow/`, `interf.json`, and local workflow files are user-editable
|
|
167
|
-
- `.interf/run.json` and `.interf/view-spec.json` are CLI-owned runtime artifacts
|
|
168
|
-
|
|
169
|
-
So the system should feel visible and editable without becoming ambiguous about which files are the actual referee surface.
|
|
170
|
-
|
|
171
|
-
## Instruction Hierarchy
|
|
172
|
-
|
|
173
|
-
Interf works best when the instruction layers are clear:
|
|
174
|
-
|
|
175
|
-
- `AGENTS.md` = workspace bootstrap and router
|
|
176
|
-
- `workflow/use/query/SKILL.md` = manual query loop for this workspace
|
|
177
|
-
- `workflow/compile/stages/<stage>/SKILL.md` = stage-specific compile behavior
|
|
178
|
-
- `.interf/stage-contract.json` = the current automated stage contract
|
|
179
|
-
|
|
180
|
-
For interfaces, manual query should work like this:
|
|
181
|
-
|
|
182
|
-
1. local interface query guidance
|
|
183
|
-
2. local interface artifacts
|
|
184
|
-
3. parent KB query guidance
|
|
185
|
-
4. parent KB artifacts
|
|
186
|
-
5. raw source only when needed and actually reachable
|
|
187
|
-
|
|
188
|
-
That keeps the interface layer focused instead of re-implementing parent knowledge-base policy in parallel.
|
|
189
|
-
|
|
190
|
-
Ownership rule:
|
|
191
|
-
- `AGENTS.md` = router plus first-question access checklist
|
|
192
|
-
- local `workflow/use/query/SKILL.md` = exact manual query loop for this workspace
|
|
193
|
-
- parent KB `workflow/use/query/SKILL.md` = canonical KB-wide retrieval and raw-fallback policy for interfaces
|
|
194
|
-
- compile-stage retrieval skills and `.interf/stage-contract.json` = automated stage execution, not the primary manual chat surface
|
|
195
|
-
|
|
196
|
-
These local `SKILL.md` files are workspace instruction docs. Interf routes agents to them through `AGENTS.md` and stage contracts; it does not require globally installed slash skills for the workspace method itself.
|
|
197
|
-
|
|
198
|
-
## Workflow Map
|
|
199
|
-
|
|
200
|
-
Workflows own the stage graph.
|
|
201
|
-
|
|
202
|
-
Use this terminology:
|
|
203
|
-
|
|
204
|
-
- **workflow** = the reusable method package
|
|
205
|
-
- **compile pipeline** = the ordered stage sequence inside that workflow
|
|
206
|
-
- **stage contract** = the generated acceptance boundary for the currently active stage
|
|
207
|
-
|
|
208
|
-
Built-in knowledge-base workflows currently use:
|
|
209
|
-
|
|
210
|
-
1. `summarize`
|
|
211
|
-
2. `compile`
|
|
212
|
-
|
|
213
|
-
Built-in interface workflows currently use:
|
|
214
|
-
|
|
215
|
-
1. `retrieve`
|
|
216
|
-
2. `analyze`
|
|
217
|
-
3. `compile`
|
|
218
|
-
|
|
219
|
-
Reusable local workflows can rename or split those stages. The engine still enforces the same contract kinds underneath:
|
|
15
|
+
Interf is built around three ideas:
|
|
220
16
|
|
|
221
|
-
-
|
|
222
|
-
-
|
|
17
|
+
- the product surface is the compiled folder, not a hidden service
|
|
18
|
+
- the workflow should leave proof of work on disk
|
|
19
|
+
- the method should be benchmarkable on your task
|
|
223
20
|
|
|
224
|
-
|
|
21
|
+
That gives you a simple loop:
|
|
225
22
|
|
|
226
|
-
|
|
23
|
+
1. point Interf at a folder
|
|
24
|
+
2. compile a knowledge base
|
|
25
|
+
3. create an interface for a job
|
|
26
|
+
4. run evals and benchmarks to see what actually works
|
|
227
27
|
|
|
228
|
-
|
|
229
|
-
- each stage still maps to a known contract kind
|
|
230
|
-
- each stage may also declare additional declarative acceptance checks in `workflow.json`
|
|
231
|
-
- the generated stage contract carries the current counts, required reads, required writes, and policies for that run
|
|
232
|
-
- the CLI checks current workspace state and artifacts against that contract instead of trusting the agent's own summary
|
|
28
|
+
## Core concepts
|
|
233
29
|
|
|
234
|
-
|
|
30
|
+
- **Source folder**: your real files stay where they are
|
|
31
|
+
- **Knowledge base**: `interf/{name}/`, the shared compiled layer over that folder
|
|
32
|
+
- **Interface**: `interf/{name}/interfaces/{interface-name}/`, a focused workspace on top of one knowledge base
|
|
33
|
+
- **Workflow**: the reusable method package that defines the compile pipeline
|
|
34
|
+
- **Benchmark**: running evals across compiled knowledge bases or interfaces on the same folder
|
|
235
35
|
|
|
236
|
-
|
|
36
|
+
One source folder can host multiple knowledge bases under `interf/` when you want to compare workflows like `interf` vs `karpathy` on the same data.
|
|
237
37
|
|
|
238
|
-
|
|
239
|
-
- vectorless or structure-aware retrieval ideas
|
|
240
|
-
- migrated external knowledge pipelines
|
|
38
|
+
## Interf primitives
|
|
241
39
|
|
|
242
|
-
|
|
40
|
+
Interf gives you a few strong primitives instead of a giant abstraction layer:
|
|
243
41
|
|
|
244
|
-
|
|
42
|
+
- **workflow package**: `workflow.json` plus local `workflow/` docs define the method
|
|
43
|
+
- **stage contract**: `.interf/stage-contract.json` says what must be true for the active stage
|
|
44
|
+
- **declarative acceptance**: workflows can declare extra acceptance rules in `workflow.json`
|
|
45
|
+
- **runtime state**: `.interf/` files record what happened
|
|
46
|
+
- **CLI enforcement**: the CLI checks workspace state and artifacts against the stage contract instead of trusting the agent's summary
|
|
47
|
+
- **benchmark specs**: file-based evals let you compare workflows and interfaces on the same folder
|
|
245
48
|
|
|
246
|
-
|
|
247
|
-
- `interf compile` = the static command; the selected workflow defines the staged method underneath
|
|
248
|
-
- `knowledge/` + `home.md` = the compiled knowledge base surface
|
|
249
|
-
- interfaces = focused workspaces on top
|
|
49
|
+
That is the core product promise:
|
|
250
50
|
|
|
251
|
-
|
|
51
|
+
- define what the agent should do in plain English
|
|
52
|
+
- give the agent local workspace docs and staged contracts
|
|
53
|
+
- validate the resulting state deterministically
|
|
252
54
|
|
|
253
|
-
|
|
254
|
-
- `workflow` = the user-facing methodology you select in the wizard
|
|
255
|
-
- reusable local workflows live under `source-folder/interf/workflows/`
|
|
256
|
-
- each reusable local workflow is defined in a readable `workflow.json` plus starter docs under `workflow/`
|
|
257
|
-
- executor = the agent/runtime that implements the active stage
|
|
258
|
-
- `compile-plan.md` = the interface's current working plan for one job
|
|
259
|
-
- local `workflow/` = the stage and query implementation you can customize
|
|
260
|
-
- `.interf/stage-contract.json` = the generated per-run contract for the active stage
|
|
55
|
+
The exact runtime and workflow schemas live in:
|
|
261
56
|
|
|
262
|
-
|
|
263
|
-
-
|
|
264
|
-
-
|
|
265
|
-
- required writes
|
|
266
|
-
- runtime schema
|
|
267
|
-
- verifier surface
|
|
268
|
-
- state transitions
|
|
57
|
+
- [`src/lib/schema.ts`](./src/lib/schema.ts)
|
|
58
|
+
- [`src/lib/local-workflows.ts`](./src/lib/local-workflows.ts)
|
|
59
|
+
- [`src/lib/workflow-definitions.ts`](./src/lib/workflow-definitions.ts)
|
|
269
60
|
|
|
270
|
-
|
|
61
|
+
Interf uses TypeScript plus Zod for schema validation and contract checking in the CLI.
|
|
271
62
|
|
|
272
|
-
|
|
273
|
-
- `AGENTS.md` = the navigation/bootstrap layer
|
|
274
|
-
- `.interf/stage-contract.json` = the active deterministic contract
|
|
275
|
-
- `interf verify ...` = the self-check surface for agents and tests
|
|
63
|
+
## What the agent sees
|
|
276
64
|
|
|
277
|
-
|
|
278
|
-
- a workflow seeds starter local workflow docs and determines how `interf compile` is interpreted
|
|
279
|
-
- if you want different stage behavior or domain bias, use a workflow and local `workflow/`
|
|
280
|
-
- if you want a different stage graph, proof model, or required artifacts, that is effectively a new workflow
|
|
65
|
+
The compiled folder is the agent-facing product surface.
|
|
281
66
|
|
|
282
|
-
|
|
283
|
-
- knowledge base: `interf`, `karpathy`
|
|
284
|
-
- interface:
|
|
285
|
-
- `briefing` = operator brief for what is true now, what changed, and what matters next
|
|
286
|
-
- `research` = exploratory view for themes, contradictions, and open questions
|
|
287
|
-
- `audit` = verification view for gaps, inconsistencies, and missing evidence
|
|
67
|
+
Important files in a KB or interface:
|
|
288
68
|
|
|
289
|
-
|
|
290
|
-
-
|
|
291
|
-
-
|
|
292
|
-
-
|
|
293
|
-
-
|
|
69
|
+
- `interf.json` = what this workspace is
|
|
70
|
+
- `AGENTS.md` = where to start and how to navigate
|
|
71
|
+
- `workflow/` = the editable local method package
|
|
72
|
+
- `.interf/stage-contract.json` = the active automated contract
|
|
73
|
+
- `.interf/source-access.json` = quick raw-file reachability check
|
|
74
|
+
- `.interf/state.json` and `.interf/health.json` = runtime state and health
|
|
294
75
|
|
|
295
|
-
|
|
296
|
-
- `.interf/run.json` = current or last run
|
|
297
|
-
- `.interf/logs/` = per-run prompt files, status timelines, and raw agent event streams
|
|
298
|
-
- `interf verify ...` = deterministic referee
|
|
299
|
-
- `docs/workflow-spec.md` = canonical workflow/package/pipeline explanation
|
|
300
|
-
- `src/lib/schema.ts` = canonical runtime schema source of truth
|
|
301
|
-
- `src/lib/workflow-definitions.ts` = canonical public workflow registry
|
|
76
|
+
Manual query/use works like this:
|
|
302
77
|
|
|
303
|
-
|
|
78
|
+
- open the KB or interface folder
|
|
79
|
+
- read `AGENTS.md`
|
|
80
|
+
- follow `workflow/use/query/SKILL.md`
|
|
81
|
+
- for interfaces, use local interface artifacts first, then the parent KB loop, then raw files if needed
|
|
304
82
|
|
|
305
|
-
|
|
306
|
-
Keep high-level navigation and operating guidance in `AGENTS.md`. `CLAUDE.md` is a generated mirror so Claude Code sees the same instructions automatically.
|
|
307
|
-
|
|
308
|
-
If you want to reuse the same methodology across multiple knowledge bases or interfaces in one source folder, create a reusable local workflow under `interf/workflows/` instead of copying the same `workflow/` edits around by hand.
|
|
309
|
-
|
|
310
|
-
Knowledge base:
|
|
311
|
-
|
|
312
|
-
- manual use: `workflow/use/query/SKILL.md`
|
|
313
|
-
- create-time setup: `workflow/create/SKILL.md`
|
|
314
|
-
- compile stages: `workflow/compile/stages/<stage>/SKILL.md`
|
|
315
|
-
- KB-attached interface templates: `workflow/interfaces/<interface-workflow-id>/`
|
|
316
|
-
|
|
317
|
-
Interface:
|
|
318
|
-
|
|
319
|
-
- manual use: `workflow/use/query/SKILL.md`
|
|
320
|
-
This is the interface-local query layer. When local interface artifacts are insufficient, it should defer to the parent KB query guidance at `../../workflow/use/query/SKILL.md` before any raw fallback.
|
|
321
|
-
- create-time setup: `workflow/create/SKILL.md`
|
|
322
|
-
- compile stages: `workflow/compile/stages/<stage>/SKILL.md`
|
|
323
|
-
|
|
324
|
-
Each local doc can declare:
|
|
325
|
-
|
|
326
|
-
```md
|
|
327
|
-
---
|
|
328
|
-
{
|
|
329
|
-
"mode": "extend"
|
|
330
|
-
}
|
|
331
|
-
---
|
|
332
|
-
```
|
|
333
|
-
|
|
334
|
-
or:
|
|
335
|
-
|
|
336
|
-
```md
|
|
337
|
-
---
|
|
338
|
-
{
|
|
339
|
-
"mode": "override"
|
|
340
|
-
}
|
|
341
|
-
---
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
Meaning:
|
|
345
|
-
|
|
346
|
-
- `extend` = keep Interf's built-in stage method and add local rules
|
|
347
|
-
- `override` = replace Interf's built-in stage instructions for that stage
|
|
348
|
-
|
|
349
|
-
In both modes, Interf still enforces the same runtime schema, state flow, and verifier surface.
|
|
350
|
-
|
|
351
|
-
Workflows can also seed starter local workflow docs in `workflow/` so the customization path is visible from day one. Edit them freely; they are scaffold defaults, not protocol.
|
|
83
|
+
Interf does not require globally installed slash skills for workspace behavior. Local `workflow/.../SKILL.md` files are workspace instruction docs routed by `AGENTS.md` and stage contracts.
|
|
352
84
|
|
|
353
85
|
## Quick start
|
|
354
86
|
|
|
355
|
-
|
|
356
|
-
npm install -g @interf/compiler
|
|
357
|
-
|
|
358
|
-
# or install from source while contributing:
|
|
359
|
-
git clone https://github.com/interf-labs/interf.git
|
|
360
|
-
cd interf && npm install
|
|
361
|
-
npm install -g .
|
|
362
|
-
|
|
363
|
-
interf init
|
|
364
|
-
|
|
365
|
-
mkdir -p ~/my-notes
|
|
366
|
-
# put files into ~/my-notes however you want
|
|
367
|
-
|
|
368
|
-
cd ~/my-notes
|
|
369
|
-
interf create knowledge-base
|
|
370
|
-
interf compile
|
|
371
|
-
|
|
372
|
-
cd interf/my-notes
|
|
373
|
-
# open in Obsidian here
|
|
374
|
-
# for manual coding-agent sessions, stay at ~/my-notes and point the agent at ./interf/my-notes
|
|
375
|
-
```
|
|
376
|
-
|
|
377
|
-
Create an interface later:
|
|
87
|
+
Install the published package:
|
|
378
88
|
|
|
379
89
|
```bash
|
|
380
|
-
|
|
381
|
-
interf create interface
|
|
382
|
-
interf compile
|
|
90
|
+
npm install -g @interf/compiler
|
|
383
91
|
```
|
|
384
92
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
## User flow
|
|
388
|
-
|
|
389
|
-
### 1. Set up Interf globally
|
|
93
|
+
Or install from source while contributing:
|
|
390
94
|
|
|
391
95
|
```bash
|
|
392
|
-
|
|
96
|
+
npm install
|
|
97
|
+
npm run build
|
|
98
|
+
npm install -g .
|
|
393
99
|
```
|
|
394
100
|
|
|
395
|
-
|
|
396
|
-
If you run it inside a normal folder, the wizard can also attach that folder as a knowledge base and immediately compile it.
|
|
397
|
-
|
|
398
|
-
### 2. Attach Interf to any folder as a knowledge base
|
|
101
|
+
Initialize Interf in any folder:
|
|
399
102
|
|
|
400
103
|
```bash
|
|
401
104
|
cd ~/my-notes
|
|
402
|
-
interf
|
|
403
|
-
```
|
|
404
|
-
|
|
405
|
-
The wizard records:
|
|
406
|
-
|
|
407
|
-
- the selected knowledge-base workflow in `interf.json`
|
|
408
|
-
- any starter local workflow docs seeded by that workflow
|
|
409
|
-
|
|
410
|
-
Interf creates:
|
|
411
|
-
|
|
412
|
-
```text
|
|
413
|
-
my-notes/
|
|
414
|
-
...your files...
|
|
415
|
-
interf/
|
|
416
|
-
my-notes/
|
|
417
|
-
```
|
|
418
|
-
|
|
419
|
-
Recommended touchpoint:
|
|
420
|
-
|
|
421
|
-
- manage from the source folder
|
|
422
|
-
- browse from `./interf/{name}/`
|
|
423
|
-
- drop into an interface folder only when you want its local outputs directly
|
|
424
|
-
|
|
425
|
-
### 3. Compile the knowledge base
|
|
426
|
-
|
|
427
|
-
```bash
|
|
428
|
-
interf compile
|
|
105
|
+
interf init
|
|
429
106
|
```
|
|
430
107
|
|
|
431
|
-
|
|
108
|
+
That flow can:
|
|
432
109
|
|
|
433
|
-
|
|
434
|
-
|
|
110
|
+
- choose an executor like Claude Code or Codex
|
|
111
|
+
- optionally install global helper skills
|
|
112
|
+
- attach the current folder as a knowledge base
|
|
113
|
+
- compile the knowledge base immediately
|
|
435
114
|
|
|
436
|
-
|
|
115
|
+
Then you can:
|
|
437
116
|
|
|
438
117
|
```bash
|
|
439
|
-
cd ~/my-notes
|
|
440
118
|
interf create interface
|
|
119
|
+
interf compile
|
|
120
|
+
interf benchmark
|
|
441
121
|
```
|
|
442
122
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
```text
|
|
446
|
-
my-notes/
|
|
447
|
-
interf/
|
|
448
|
-
my-notes/
|
|
449
|
-
interfaces/
|
|
450
|
-
weekly-briefing/
|
|
451
|
-
research-synthesis/
|
|
452
|
-
gap-audit/
|
|
453
|
-
```
|
|
454
|
-
|
|
455
|
-
Each interface has its own `interf.json`, `AGENTS.md`, `CLAUDE.md`, `compile-plan.md`, `home.md`, runtime state, local workflow package, and local outputs.
|
|
456
|
-
|
|
457
|
-
Recommended flow:
|
|
458
|
-
|
|
459
|
-
- create interfaces from the source folder
|
|
460
|
-
- let the wizard compile them immediately when possible
|
|
461
|
-
- browse them from the parent knowledge-base vault or by opening `interfaces/{name}/home.md`
|
|
462
|
-
|
|
463
|
-
## Directory layout
|
|
464
|
-
|
|
465
|
-
### Knowledge base
|
|
123
|
+
## Example layout
|
|
466
124
|
|
|
467
125
|
```text
|
|
468
126
|
source-folder/
|
|
469
|
-
...
|
|
127
|
+
...your files...
|
|
470
128
|
interf/
|
|
471
129
|
workflows/
|
|
472
130
|
benchmarks/
|
|
@@ -475,534 +133,131 @@ source-folder/
|
|
|
475
133
|
AGENTS.md
|
|
476
134
|
CLAUDE.md
|
|
477
135
|
home.md
|
|
478
|
-
.interfignore
|
|
479
|
-
.gitignore
|
|
480
|
-
.interf/
|
|
481
|
-
state.json
|
|
482
|
-
health.json
|
|
483
|
-
view-spec.json
|
|
484
|
-
source-access.json
|
|
485
|
-
run.json
|
|
486
|
-
run-history.jsonl
|
|
487
|
-
stage-contract.json
|
|
488
|
-
summarize-targets.json
|
|
489
|
-
inventory.json
|
|
490
136
|
workflow/
|
|
491
|
-
|
|
492
|
-
README.md
|
|
493
|
-
create/
|
|
494
|
-
SKILL.md
|
|
495
|
-
compile/
|
|
496
|
-
stages/
|
|
497
|
-
{workflow-stage-1}/
|
|
498
|
-
{workflow-stage-2}/
|
|
499
|
-
use/
|
|
500
|
-
query/
|
|
501
|
-
SKILL.md
|
|
502
|
-
interfaces/
|
|
503
|
-
{interface-workflow-id}/
|
|
137
|
+
.interf/
|
|
504
138
|
summaries/
|
|
505
139
|
knowledge/
|
|
506
|
-
entities/
|
|
507
|
-
claims/
|
|
508
|
-
indexes/
|
|
509
|
-
interfaces/
|
|
510
|
-
{name}/
|
|
511
|
-
```
|
|
512
|
-
|
|
513
|
-
### Interface (engine type: `interface`)
|
|
514
|
-
|
|
515
|
-
```text
|
|
516
|
-
source-folder/
|
|
517
|
-
interf/
|
|
518
|
-
{knowledge-base-name}/
|
|
519
140
|
interfaces/
|
|
520
|
-
{name}/
|
|
141
|
+
{interface-name}/
|
|
521
142
|
interf.json
|
|
522
143
|
compile-plan.md
|
|
523
144
|
AGENTS.md
|
|
524
145
|
CLAUDE.md
|
|
525
146
|
home.md
|
|
526
|
-
.gitignore
|
|
527
|
-
.interf/
|
|
528
|
-
state.json
|
|
529
|
-
health.json
|
|
530
|
-
view-spec.json
|
|
531
|
-
run.json
|
|
532
|
-
run-history.jsonl
|
|
533
|
-
stage-contract.json
|
|
534
|
-
relevant.json
|
|
535
|
-
coverage.json
|
|
536
|
-
analysis.json
|
|
537
147
|
workflow/
|
|
538
|
-
|
|
539
|
-
README.md
|
|
540
|
-
create/
|
|
541
|
-
SKILL.md
|
|
542
|
-
compile/
|
|
543
|
-
stages/
|
|
544
|
-
{workflow-stage-1}/
|
|
545
|
-
{workflow-stage-2}/
|
|
546
|
-
{workflow-stage-3}/
|
|
547
|
-
use/
|
|
548
|
-
query/
|
|
549
|
-
SKILL.md
|
|
148
|
+
.interf/
|
|
550
149
|
knowledge/
|
|
551
|
-
entities/
|
|
552
|
-
claims/
|
|
553
150
|
briefs/
|
|
554
151
|
summaries/
|
|
555
152
|
```
|
|
556
153
|
|
|
557
|
-
##
|
|
154
|
+
## Commands
|
|
558
155
|
|
|
559
|
-
|
|
156
|
+
- `interf init` = global setup first; if run inside a normal folder, it can also attach and compile a knowledge base there
|
|
157
|
+
- `interf create` = chooser when type is omitted
|
|
158
|
+
- `interf create knowledge-base` = attach current folder
|
|
159
|
+
- `interf create interface` = create an interface for the current folder's knowledge base
|
|
160
|
+
- `interf create workflow` = create a reusable workflow package
|
|
161
|
+
- `interf compile` = compile the current knowledge base or interface
|
|
162
|
+
- `interf benchmark` = compare compiled knowledge bases or interfaces with file-based evals
|
|
163
|
+
- `interf doctor` = preflight local executor setup before a real compile
|
|
164
|
+
- `interf status` = show deterministic health
|
|
165
|
+
- `interf verify <check>` = internal deterministic referee for major workflow steps
|
|
166
|
+
- `interf reset <scope>` = reset generated state while keeping source files
|
|
560
167
|
|
|
561
|
-
|
|
168
|
+
## Workflows
|
|
562
169
|
|
|
563
|
-
|
|
564
|
-
{
|
|
565
|
-
"type": "knowledge-base",
|
|
566
|
-
"name": "my-notes",
|
|
567
|
-
"workflow": "interf",
|
|
568
|
-
"source": {
|
|
569
|
-
"path": "../.."
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
```
|
|
573
|
-
|
|
574
|
-
### Interface `interf.json`
|
|
575
|
-
|
|
576
|
-
```json
|
|
577
|
-
{
|
|
578
|
-
"type": "interface",
|
|
579
|
-
"name": "weekly-briefing",
|
|
580
|
-
"workflow": "briefing",
|
|
581
|
-
"knowledge_base": {
|
|
582
|
-
"path": "../.."
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
```
|
|
586
|
-
|
|
587
|
-
- Knowledge-base config points to the source folder with `source.path`
|
|
588
|
-
- Interface config points to the main knowledge base with `knowledge_base.path`
|
|
589
|
-
- `workflow` records the selected methodology
|
|
590
|
-
- Processing logic stays out of config
|
|
591
|
-
- Interface-specific planning lives in `compile-plan.md`
|
|
592
|
-
- Local stage and query implementation lives in `workflow/`
|
|
593
|
-
- `AGENTS.md` is the source of truth for agent bootstrap instructions
|
|
594
|
-
- `CLAUDE.md` is a generated mirror of `AGENTS.md` so Claude Code gets the same knowledge-base instructions automatically
|
|
595
|
-
- `.interf/source-access.json` is the quick-check surface for raw-file accessibility in manual agent sessions
|
|
596
|
-
- `workflow/` holds repo-local instruction docs for create, compile stages, and manual use
|
|
597
|
-
- local `workflow/.../SKILL.md` files are workspace docs, not required global slash skills
|
|
598
|
-
- generated `AGENTS.md` / `CLAUDE.md` live in knowledge bases and interfaces, not the source root
|
|
599
|
-
- local docs can declare `mode: extend` or `mode: override` in JSON frontmatter
|
|
600
|
-
- Interf still guarantees the runtime schema, required writes, verifiers, and state flow even when stage logic is overridden
|
|
601
|
-
|
|
602
|
-
## Instruction + Enforcement Model
|
|
603
|
-
|
|
604
|
-
Interf separates:
|
|
605
|
-
|
|
606
|
-
- **workflow** — the methodology that defines what `interf compile` means for this knowledge base or interface
|
|
607
|
-
- **stage contract** — the generated per-run file with fixed inputs, outputs, required proofs, and state expectations
|
|
608
|
-
- **instructions** — flexible markdown docs that tell an executor how to satisfy that contract
|
|
609
|
-
- **enforcement** — deterministic checks that decide whether the stage actually complied
|
|
610
|
-
- **executor** — Claude Code, Codex, API-backed runner, or your own managed process
|
|
611
|
-
|
|
612
|
-
That means:
|
|
170
|
+
A workflow is a package, not just a prompt.
|
|
613
171
|
|
|
614
|
-
|
|
615
|
-
- auth belongs to the executor
|
|
616
|
-
- local stage logic is customizable in files
|
|
617
|
-
- Interf enforces compliance at runtime by checking workspace state and required artifacts against the stage contract
|
|
172
|
+
It has two layers:
|
|
618
173
|
|
|
619
|
-
|
|
174
|
+
- machine layer: `workflow.json`
|
|
175
|
+
- human/agent layer: `workflow/` docs
|
|
620
176
|
|
|
621
|
-
|
|
622
|
-
- query docs under `workflow/use/query/` tell the agent how to use the compiled KB or interface
|
|
623
|
-
- stage docs under `workflow/compile/stages/` tell the agent how to perform a specific stage
|
|
624
|
-
- the CLI writes `.interf/stage-contract.json` so the executor knows exactly what must be read, written, proved, and left on disk for the current run
|
|
625
|
-
- `.interf/state.json`, `.interf/health.json`, and required stage files show what the agent scanned, selected, analyzed, and wrote
|
|
626
|
-
- deterministic checks decide pass/fail from that runtime state instead of trusting the agent's own summary of its work
|
|
627
|
-
|
|
628
|
-
That is the proof-of-work story. Interf is not just prompts. It is prompts plus contracts plus enforcement plus persisted traces.
|
|
629
|
-
|
|
630
|
-
Workflow doc modes:
|
|
631
|
-
|
|
632
|
-
- `mode: extend` — add local stage rules on top of bundled Interf instructions
|
|
633
|
-
- `mode: override` — replace bundled stage instructions for that stage
|
|
634
|
-
|
|
635
|
-
In both modes, Interf still requires the same artifact schema and flow.
|
|
636
|
-
|
|
637
|
-
## CLI commands
|
|
638
|
-
|
|
639
|
-
Human-facing workflow:
|
|
177
|
+
Typical reusable workflow package:
|
|
640
178
|
|
|
641
179
|
```text
|
|
642
|
-
interf
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
180
|
+
interf/workflows/knowledge-base/<workflow-id>/
|
|
181
|
+
workflow.json
|
|
182
|
+
README.md
|
|
183
|
+
create/
|
|
184
|
+
SKILL.md
|
|
185
|
+
compile/
|
|
186
|
+
stages/
|
|
187
|
+
<stage-id>/
|
|
188
|
+
SKILL.md
|
|
189
|
+
use/
|
|
190
|
+
query/
|
|
191
|
+
SKILL.md
|
|
651
192
|
```
|
|
652
193
|
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
- `interf init` handles global setup first; if you run it inside a normal folder, the wizard can also attach and compile a knowledge base there
|
|
656
|
-
- `interf create` opens a chooser when you do not pass a type
|
|
657
|
-
- `interf create knowledge-base` attaches the current folder as a knowledge base, then lets you choose an existing workflow or create a new reusable local workflow
|
|
658
|
-
- `interf create interface` creates a focused interface for the current folder's knowledge base, then lets you choose an existing workflow or create a new reusable local workflow
|
|
659
|
-
- `interf compile` is the primary public verb, auto-detects knowledge base vs interface, and now runs executor preflight automatically before work starts
|
|
660
|
-
- `interf benchmark` compares already-compiled knowledge bases or interfaces using a file-based benchmark spec under `interf/benchmarks/`
|
|
661
|
-
- `interf doctor` checks local executor setup; `--live` exercises the actual configured agent directly when you want to inspect it yourself
|
|
662
|
-
- `interf status` is deterministic and read-only
|
|
663
|
-
- manual query/use is part of the compiled workspace protocol: open the KB/interface folder, read `AGENTS.md`, then follow `workflow/use/query/SKILL.md`
|
|
664
|
-
|
|
665
|
-
## Evals And Benchmarks
|
|
666
|
-
|
|
667
|
-
`interf benchmark` assumes the selected knowledge bases or interfaces are already compiled.
|
|
668
|
-
|
|
669
|
-
V1 intentionally stays simple:
|
|
670
|
-
|
|
671
|
-
- eval files are human-owned files on disk
|
|
672
|
-
- cases describe what must be true in plain English
|
|
673
|
-
- Interf checks deterministic file outputs instead of using an LLM judge by default
|
|
674
|
-
- if a target is not compiled, it should not be benchmark-eligible
|
|
675
|
-
|
|
676
|
-
The benchmark input is a small local file under:
|
|
677
|
-
|
|
678
|
-
- `interf/benchmarks/knowledge-base/*.json`
|
|
679
|
-
- `interf/benchmarks/interface/*.json`
|
|
680
|
-
|
|
681
|
-
Interf writes benchmark run artifacts under:
|
|
682
|
-
|
|
683
|
-
- `interf/benchmarks/runs/knowledge-base/*.json`
|
|
684
|
-
- `interf/benchmarks/runs/interface/*.json`
|
|
685
|
-
|
|
686
|
-
Minimal example:
|
|
687
|
-
|
|
688
|
-
```json
|
|
689
|
-
{
|
|
690
|
-
"type": "knowledge-base",
|
|
691
|
-
"name": "Home Quality",
|
|
692
|
-
"description": "Check that home.md surfaces the main themes clearly.",
|
|
693
|
-
"cases": [
|
|
694
|
-
{
|
|
695
|
-
"id": "home-overview",
|
|
696
|
-
"question": "Does home.md explain the main themes and next steps?",
|
|
697
|
-
"file": "home.md",
|
|
698
|
-
"expect": {
|
|
699
|
-
"must_include": ["main themes", "next steps"],
|
|
700
|
-
"must_not_include": ["TODO"],
|
|
701
|
-
"min_words": 80
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
]
|
|
705
|
-
}
|
|
706
|
-
```
|
|
707
|
-
|
|
708
|
-
Why this format:
|
|
709
|
-
|
|
710
|
-
- the `question` stays plain English and easy to edit
|
|
711
|
-
- the checks stay deterministic and local
|
|
712
|
-
- the same file works for knowledge-base or interface comparisons
|
|
713
|
-
- users can understand and modify it without learning a custom benchmark DSL
|
|
714
|
-
|
|
715
|
-
Product split:
|
|
194
|
+
Interf keeps the public command surface stable while letting workflows vary the internal stage pipeline. The engine still owns contract kinds, required artifacts, and state flow.
|
|
716
195
|
|
|
717
|
-
|
|
718
|
-
- `benchmark` = running those evals across compiled knowledge bases or interfaces
|
|
196
|
+
## Benchmarks and evals
|
|
719
197
|
|
|
720
|
-
|
|
198
|
+
Interf is benchmark-first.
|
|
721
199
|
|
|
722
|
-
|
|
200
|
+
You can:
|
|
723
201
|
|
|
724
|
-
-
|
|
725
|
-
-
|
|
726
|
-
-
|
|
727
|
-
|
|
728
|
-
Future versions can add query-based evals, but the default should stay file-first and understandable.
|
|
202
|
+
- build multiple knowledge bases over the same folder
|
|
203
|
+
- compare workflows on the same source set
|
|
204
|
+
- compare interfaces for the same business task
|
|
205
|
+
- inspect proofs, outputs, and costs locally
|
|
729
206
|
|
|
730
|
-
|
|
207
|
+
Reusable benchmark specs and saved runs live under:
|
|
731
208
|
|
|
732
209
|
```text
|
|
733
|
-
|
|
210
|
+
source-folder/
|
|
211
|
+
interf/
|
|
212
|
+
benchmarks/
|
|
213
|
+
knowledge-base/*.json
|
|
214
|
+
interface/*.json
|
|
215
|
+
runs/
|
|
734
216
|
```
|
|
735
217
|
|
|
736
|
-
|
|
737
|
-
- it exists so agents can call stable deterministic validators via the CLI instead of writing custom verification code
|
|
738
|
-
|
|
739
|
-
## How compile works
|
|
740
|
-
|
|
741
|
-
### Knowledge-base compile
|
|
742
|
-
|
|
743
|
-
`interf compile` in a knowledge base runs the selected workflow's stage graph.
|
|
744
|
-
|
|
745
|
-
Built-in workflows currently use:
|
|
746
|
-
|
|
747
|
-
1. `knowledge-base/summarize`
|
|
748
|
-
- bundled file-evidence contract
|
|
749
|
-
- discovers source files from `source.path`
|
|
750
|
-
- compares them to `summaries/`
|
|
751
|
-
- writes or updates one summary per source file
|
|
752
|
-
2. `knowledge-base/compile`
|
|
753
|
-
- bundled knowledge-layer contract
|
|
754
|
-
- scans all files in `summaries/`
|
|
755
|
-
- turns those summaries into the local LLM wiki layer
|
|
756
|
-
- builds `knowledge/` with summaries, backlinks, concepts, and linked articles
|
|
757
|
-
- updates `home.md`
|
|
758
|
-
|
|
759
|
-
Custom workflows can split or rename those stages, but they still have to satisfy the file-evidence then knowledge-layer pipeline.
|
|
218
|
+
This is the trust loop: don't trust a repo because it says its knowledge base is better. Run the benchmark on your folder.
|
|
760
219
|
|
|
761
|
-
|
|
220
|
+
## Builder and maintainer docs
|
|
762
221
|
|
|
763
|
-
|
|
222
|
+
Read in this order:
|
|
764
223
|
|
|
765
|
-
|
|
224
|
+
1. [`docs/workflow-spec.md`](./docs/workflow-spec.md)
|
|
225
|
+
2. [`docs/runtime-contract.md`](./docs/runtime-contract.md)
|
|
226
|
+
3. [`docs/architecture.md`](./docs/architecture.md)
|
|
227
|
+
4. [`src/lib/local-workflows.ts`](./src/lib/local-workflows.ts)
|
|
228
|
+
5. [`src/lib/schema.ts`](./src/lib/schema.ts)
|
|
229
|
+
6. [`src/lib/workflow-definitions.ts`](./src/lib/workflow-definitions.ts)
|
|
766
230
|
|
|
767
|
-
|
|
768
|
-
- bundled retrieval contract
|
|
769
|
-
- scans all knowledge-base `summaries/` frontmatter
|
|
770
|
-
- reviews candidate abstracts and expands through links when needed
|
|
771
|
-
- selects the relevant set with proof of coverage
|
|
772
|
-
- saves `.interf/relevant.json`
|
|
773
|
-
- saves `.interf/coverage.json`
|
|
774
|
-
2. `interface/analyze`
|
|
775
|
-
- bundled analysis contract
|
|
776
|
-
- analyzes the relevant set
|
|
777
|
-
- extracts interface-local entities and claims
|
|
778
|
-
- writes temporary analysis artifacts
|
|
779
|
-
3. `interface/compile`
|
|
780
|
-
- bundled output contract
|
|
781
|
-
- writes local `knowledge/`, `briefs/`, `summaries/`, and `home.md`
|
|
231
|
+
## Maintainer test loop
|
|
782
232
|
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
Each stage is resumable via durable runtime artifacts:
|
|
786
|
-
- `.interf/state.json` for long-lived summary state
|
|
787
|
-
- `.interf/run.json` for the active or most recent deterministic stage run
|
|
788
|
-
- `.interf/stage-contract.json` for the machine-readable contract the current stage must follow
|
|
789
|
-
- `.interf/run-history.jsonl` for prior completed runs
|
|
790
|
-
- `.interf/logs/` for prompt, status, and raw agent traces from automated runs
|
|
791
|
-
|
|
792
|
-
## Status and runtime files
|
|
793
|
-
|
|
794
|
-
Runtime state lives under `.interf/` and is gitignored.
|
|
795
|
-
|
|
796
|
-
Important files:
|
|
797
|
-
|
|
798
|
-
- `.interf/state.json`: stage completion, timestamps, counts
|
|
799
|
-
- `.interf/health.json`: computed health and trust surface
|
|
800
|
-
- `.interf/view-spec.json`: viewer-neutral card and graph contract
|
|
801
|
-
- `.interf/run.json`: current or last stage run, with stage, executor, timestamps, counts, and status
|
|
802
|
-
- `.interf/stage-contract.json`: machine-readable stage contract for the active run
|
|
803
|
-
- `.interf/run-history.jsonl`: append-only history of completed or failed runs
|
|
804
|
-
- `.interf/logs/`: one prompt file, one status timeline, and one raw event stream per automated run for later analysis
|
|
805
|
-
- `.interf/relevant.json`: retrieved set for interfaces
|
|
806
|
-
- `.interf/coverage.json`: retrieval proof for interfaces
|
|
807
|
-
- `.interf/analysis.json`: temporary interface analysis handoff
|
|
808
|
-
|
|
809
|
-
`interf status` computes health from filesystem facts plus runtime state. It does not require a live executor run.
|
|
810
|
-
|
|
811
|
-
Ownership rule:
|
|
812
|
-
|
|
813
|
-
- agents may read `.interf/run.json` and `.interf/view-spec.json`
|
|
814
|
-
- the CLI owns writing and normalizing them
|
|
815
|
-
- local workflow docs should update `state.json` and required stage artifacts, not rewrite the run ledger or viewer contract
|
|
816
|
-
|
|
817
|
-
For the exact schema:
|
|
818
|
-
|
|
819
|
-
- human-readable contract: [docs/runtime-contract.md](/Users/gedossman/Documents/interf/interf-brain-sdk/docs/runtime-contract.md)
|
|
820
|
-
- TypeScript source of truth: [src/lib/schema.ts](/Users/gedossman/Documents/interf/interf-brain-sdk/src/lib/schema.ts)
|
|
821
|
-
|
|
822
|
-
## Validation and testing
|
|
823
|
-
|
|
824
|
-
For repo-level regression coverage:
|
|
233
|
+
Full validation:
|
|
825
234
|
|
|
826
235
|
```bash
|
|
827
236
|
npm test
|
|
828
|
-
```
|
|
829
|
-
|
|
830
|
-
For a real local acceptance run against your configured coding agent:
|
|
831
|
-
|
|
832
|
-
```bash
|
|
833
237
|
npm run test:acceptance-live
|
|
834
|
-
```
|
|
835
|
-
|
|
836
|
-
That live acceptance runner:
|
|
837
|
-
|
|
838
|
-
- creates a temp source folder with a small real fixture
|
|
839
|
-
- creates one `interf` knowledge base on it
|
|
840
|
-
- asserts the KB scaffold files exist exactly where Interf says they should
|
|
841
|
-
- compiles it with the real configured local executor
|
|
842
|
-
- asserts KB outputs, proofs, run ledgers, and logs exist after compile
|
|
843
|
-
- creates and compiles one briefing interface on top
|
|
844
|
-
- asserts interface scaffold files, retrieve proof, outputs, run ledgers, and logs exist
|
|
845
|
-
- runs a manual KB query exercise from the compiled folder and saves trace files under `.interf/query-acceptance/`
|
|
846
|
-
- runs a manual interface query exercise that must go local interface -> parent KB -> raw source and saves the resulting traces and status logs
|
|
847
|
-
- prints the temp folder path so you can inspect real outputs
|
|
848
|
-
|
|
849
|
-
For the heavier workflow-comparison path:
|
|
850
|
-
|
|
851
|
-
```bash
|
|
852
238
|
npm run test:acceptance-compare
|
|
853
239
|
```
|
|
854
240
|
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
For the heavier scenario matrix:
|
|
858
|
-
|
|
859
|
-
```bash
|
|
860
|
-
npm run test:acceptance-matrix
|
|
861
|
-
```
|
|
862
|
-
|
|
863
|
-
That matrix mode:
|
|
864
|
-
|
|
865
|
-
- creates two KBs on the same source folder: `interf` and `karpathy`
|
|
866
|
-
- compiles both KBs and validates their scaffolds, outputs, proofs, and logs
|
|
867
|
-
- creates multiple interface workflows on top of each KB: `briefing`, `research`, `audit`
|
|
868
|
-
- compiles all of them with the real executor
|
|
869
|
-
- runs file-based benchmarks across the compiled KBs and interfaces
|
|
870
|
-
- keeps the temp folder so you can inspect the exact artifact tree and `.interf/logs/`
|
|
871
|
-
|
|
872
|
-
Current limitation:
|
|
873
|
-
|
|
874
|
-
- benchmark/eval runs still score compiled outputs on disk
|
|
875
|
-
- query/use traversal is now covered by the live acceptance runner, but not yet by the file-based benchmark runner
|
|
876
|
-
- if we want query-mode evals next, that should be a separate harness layer, not hidden inside the current file-based benchmark runner
|
|
877
|
-
|
|
878
|
-
Add `--cleanup` if you want a successful run removed afterward:
|
|
879
|
-
|
|
880
|
-
```bash
|
|
881
|
-
node scripts/acceptance-live.mjs --cleanup
|
|
882
|
-
```
|
|
883
|
-
|
|
884
|
-
For internal executor/model checks without changing your saved default agent:
|
|
885
|
-
|
|
886
|
-
```bash
|
|
887
|
-
node scripts/acceptance-live.mjs --agent codex --model gpt-5-codex
|
|
888
|
-
node scripts/acceptance-live.mjs --agent claude-code --effort low
|
|
889
|
-
```
|
|
890
|
-
|
|
891
|
-
For fast targeted reruns against a cached real fixture:
|
|
241
|
+
Cached quick loop:
|
|
892
242
|
|
|
893
243
|
```bash
|
|
894
244
|
npm run test:acceptance-cache:refresh
|
|
895
|
-
```
|
|
896
|
-
|
|
897
|
-
That refresh command reruns the real quick acceptance flow and saves the latest compiled source folder at `.interf-test-cache/latest-quick/`.
|
|
898
|
-
|
|
899
|
-
After that, use the targeted quick checks:
|
|
900
|
-
|
|
901
|
-
```bash
|
|
902
245
|
npm run test:acceptance-quick:create-interface
|
|
903
246
|
npm run test:acceptance-quick:query-interface
|
|
904
247
|
```
|
|
905
248
|
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
- `create-interface` = start from a precompiled KB and rerun the real interface-create stage logic without rebuilding the KB first
|
|
909
|
-
- `query-interface` = rerun the manual interface query chain (`local interface -> parent KB -> raw`)
|
|
910
|
-
|
|
911
|
-
Recommended dev loop:
|
|
249
|
+
The cached quick fixture lives under `.interf-test-cache/latest-quick/`.
|
|
912
250
|
|
|
913
|
-
|
|
914
|
-
2. After a meaningful runtime or scaffolding change, refresh the cached fixture with `npm run test:acceptance-cache:refresh`.
|
|
915
|
-
3. After bigger changes, rerun the full live acceptance and compare/matrix flows.
|
|
916
|
-
|
|
917
|
-
For agent/test harness work, use `interf status` plus `interf verify <check> --json` as needed. The exact built-in check names are implementation details of the current referee layer.
|
|
918
|
-
|
|
919
|
-
Recommended human workflow:
|
|
920
|
-
|
|
921
|
-
1. `interf create interface`
|
|
922
|
-
2. `interf compile`
|
|
923
|
-
3. inspect `home.md` and `interf status`
|
|
924
|
-
4. only then continue to higher-level QA of the interface outputs
|
|
925
|
-
|
|
926
|
-
Recommended agent/testing workflow:
|
|
927
|
-
|
|
928
|
-
1. `interf create interface`
|
|
929
|
-
2. `interf verify interface-plan --json`
|
|
930
|
-
3. `interf compile`
|
|
931
|
-
4. `interf verify retrieve --json`
|
|
932
|
-
5. inspect `home.md`, `.interf/health.json`, `.interf/relevant.json`, and `.interf/coverage.json`
|
|
933
|
-
|
|
934
|
-
## Obsidian
|
|
935
|
-
|
|
936
|
-
Obsidian is optional.
|
|
937
|
-
|
|
938
|
-
If you enable viewer defaults during `interf init`, Interf:
|
|
939
|
-
|
|
940
|
-
- writes minimal `.obsidian/graph.json` defaults
|
|
941
|
-
- attempts to register the knowledge base with Obsidian
|
|
942
|
-
|
|
943
|
-
It does **not** rely on Obsidian for runtime logic, and it no longer auto-opens vaults via URI. If the running Obsidian app does not show a newly created knowledge base immediately, restart Obsidian or add the folder once through `Manage vaults`.
|
|
944
|
-
|
|
945
|
-
Important: Obsidian labels vaults by the registered folder name. With the named knowledge-base contract, the registered folder is `interf/{name}/`, so Obsidian will usually show that knowledge-base name directly.
|
|
946
|
-
|
|
947
|
-
Open this folder in Obsidian:
|
|
948
|
-
|
|
949
|
-
- knowledge base: `source-folder/interf/{name}`
|
|
950
|
-
|
|
951
|
-
Do **not** rely on standalone interface vaults by default. Interfaces live inside the knowledge base and need access to parent `summaries/` and source links. Browse them from the knowledge-base vault at `interfaces/{name}/`.
|
|
952
|
-
|
|
953
|
-
For sandboxed coding agents, the executor should grant access to both the source folder and the knowledge-base tree. Launching an agent from the knowledge-base directory alone can hide raw files referenced through `source.path`.
|
|
954
|
-
|
|
955
|
-
For manual agent sessions, the default entrypoint is the relevant knowledge-base or interface workspace. If raw-file fallback is blocked, relaunch with the source folder granted too.
|
|
956
|
-
|
|
957
|
-
Touchpoints:
|
|
958
|
-
|
|
959
|
-
- source folder = CLI control plane and raw-access parent when needed
|
|
960
|
-
- knowledge-base root = default semantic/manual session root with Interf bootstrap docs
|
|
961
|
-
- interface root = focused manual session root for one use case
|
|
962
|
-
- `./interf/` = namespace container, not the main session root
|
|
963
|
-
|
|
964
|
-
In the retrieval proof:
|
|
965
|
-
|
|
966
|
-
- `proof.scanned` is the full set of knowledge-base summaries scanned at the frontmatter-routing layer
|
|
967
|
-
- `proof.reviewed` is the smaller set of candidate summaries whose abstracts were actually reviewed before selection
|
|
968
|
-
- `proof.retrieved` and `proof.excluded` must partition that scanned summary set before analyze begins
|
|
969
|
-
|
|
970
|
-
## Naming and retrieval
|
|
971
|
-
|
|
972
|
-
Interf uses:
|
|
973
|
-
|
|
974
|
-
- **prose-as-title**: filenames are readable claims, not slugs
|
|
975
|
-
- **wiki-link-as-prose**: links read as sentences
|
|
976
|
-
- **progressive disclosure**: title → frontmatter → abstract → overview → source file
|
|
977
|
-
|
|
978
|
-
Agents should start in `home.md`, move into `knowledge/`, then fall back to `summaries/`, and only open source files when needed.
|
|
979
|
-
|
|
980
|
-
## Bring files in
|
|
981
|
-
|
|
982
|
-
Primary model:
|
|
983
|
-
|
|
984
|
-
- put files directly into the source folder
|
|
985
|
-
- run `interf compile`
|
|
986
|
-
|
|
987
|
-
Interf treats the folder itself as the source of truth. Bring files in however you want:
|
|
988
|
-
- save/export them directly into the folder
|
|
989
|
-
- clip articles into markdown
|
|
990
|
-
- download related images locally when they matter for context
|
|
991
|
-
|
|
992
|
-
For web content, markdown clips plus local images work especially well because the resulting knowledge base stays easy for agents to navigate and cite.
|
|
251
|
+
## Design choices
|
|
993
252
|
|
|
994
|
-
|
|
253
|
+
- filesystem-first, not service-first
|
|
254
|
+
- workflow packages over hidden orchestration
|
|
255
|
+
- contract-checked stages instead of prompt-only trust
|
|
256
|
+
- benchmarkability as a core product feature
|
|
257
|
+
- local control: your files stay on disk and run in your environment
|
|
995
258
|
|
|
996
|
-
|
|
997
|
-
- Source folder stays untouched by compile
|
|
998
|
-
- One visible `interf/{name}/` knowledge base per source folder
|
|
999
|
-
- No duplicated raw store by default
|
|
1000
|
-
- Any coding agent
|
|
1001
|
-
- Obsidian is a viewer, not a dependency
|
|
1002
|
-
- Registry is convenience only; local `interf.json` files are the durable source of truth
|
|
259
|
+
Interf is not trying to win by hiding complexity. It is trying to make the method visible, enforceable, and comparable.
|
|
1003
260
|
|
|
1004
261
|
## License
|
|
1005
262
|
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
The `Interf` name and related branding are reserved by Interf, Inc. See [TRADEMARKS.md](./TRADEMARKS.md).
|
|
263
|
+
Code is licensed under Apache 2.0. The `Interf` name and branding are reserved; see [`TRADEMARKS.md`](./TRADEMARKS.md).
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interf/compiler",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.9",
|
|
4
|
+
"description": "Filesystem-first knowledge compiler for agent-ready knowledge bases and interfaces.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"interf": "dist/bin.js"
|