@interf/compiler 0.18.0 → 0.21.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 (129) hide show
  1. package/README.md +87 -73
  2. package/dist/cli/commands/mcp.d.ts +0 -34
  3. package/dist/cli/commands/mcp.js +246 -45
  4. package/dist/cli/commands/method.js +261 -15
  5. package/dist/cli/commands/prep.js +61 -16
  6. package/dist/cli/commands/runs.js +103 -9
  7. package/dist/cli/commands/status.js +4 -2
  8. package/dist/cli/commands/test.d.ts +10 -0
  9. package/dist/cli/commands/{verify.js → test.js} +16 -18
  10. package/dist/cli/commands/web.js +82 -8
  11. package/dist/cli/commands/wizard.js +36 -37
  12. package/dist/cli/index.d.ts +2 -2
  13. package/dist/cli/index.js +3 -3
  14. package/dist/compiler-ui/404.html +1 -1
  15. package/dist/compiler-ui/__next.__PAGE__.txt +5 -5
  16. package/dist/compiler-ui/__next._full.txt +13 -12
  17. package/dist/compiler-ui/__next._head.txt +3 -3
  18. package/dist/compiler-ui/__next._index.txt +5 -4
  19. package/dist/compiler-ui/__next._tree.txt +4 -3
  20. package/dist/compiler-ui/_next/static/chunks/01646j7yi.w5a.css +1 -0
  21. package/dist/compiler-ui/_next/static/chunks/{0n51hrfoufc7g.js → 02f_.8.ebn556.js} +1 -1
  22. package/dist/compiler-ui/_next/static/chunks/02r7siaw-_p5w.js +1 -0
  23. package/dist/compiler-ui/_next/static/chunks/{08m7vf5asqlsm.js → 04d0ly-7xb~-j.js} +10 -10
  24. package/dist/compiler-ui/_next/static/chunks/0fhs9psnxqd8s.js +1 -0
  25. package/dist/compiler-ui/_next/static/chunks/0mssmhpbifj15.css +2 -0
  26. package/dist/compiler-ui/_next/static/chunks/0nypu~ddwxari.js +116 -0
  27. package/dist/compiler-ui/_next/static/chunks/0p3s8iyhgcww2.js +31 -0
  28. package/dist/compiler-ui/_next/static/chunks/0tjf-vu_rz8s0.css +1 -0
  29. package/dist/compiler-ui/_next/static/chunks/0u6p3fpbbfgtl.js +1 -0
  30. package/dist/compiler-ui/_next/static/chunks/0wpx5..8dnh0w.js +1 -0
  31. package/dist/compiler-ui/_next/static/chunks/0y0uj160p0ts~.js +1 -0
  32. package/dist/compiler-ui/_next/static/chunks/10t8l~_oenf.c.js +1 -0
  33. package/dist/compiler-ui/_next/static/chunks/13gz9e7z~imx1.js +5 -0
  34. package/dist/compiler-ui/_next/static/chunks/156xed-b6czaw.js +1 -0
  35. package/dist/compiler-ui/_next/static/chunks/{turbopack-0.uq1k8c0j4s..js → turbopack-02-3e_c-yz~5g.js} +1 -1
  36. package/dist/compiler-ui/_next/static/chunks/{turbopack-10e~t1yzi4svj.js → turbopack-0apv8vb-nczuy.js} +1 -1
  37. package/dist/compiler-ui/_not-found/__next._full.txt +10 -9
  38. package/dist/compiler-ui/_not-found/__next._head.txt +3 -3
  39. package/dist/compiler-ui/_not-found/__next._index.txt +5 -4
  40. package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +2 -2
  41. package/dist/compiler-ui/_not-found/__next._not-found.txt +3 -3
  42. package/dist/compiler-ui/_not-found/__next._tree.txt +3 -2
  43. package/dist/compiler-ui/_not-found.html +1 -1
  44. package/dist/compiler-ui/_not-found.txt +10 -9
  45. package/dist/compiler-ui/index.html +1 -1
  46. package/dist/compiler-ui/index.txt +13 -12
  47. package/dist/packages/contracts/lib/schema.d.ts +4 -0
  48. package/dist/packages/contracts/lib/schema.js +2 -1
  49. package/dist/packages/engine/action-definitions.d.ts +174 -13
  50. package/dist/packages/engine/action-definitions.js +125 -122
  51. package/dist/packages/engine/action-planner.js +4 -11
  52. package/dist/packages/engine/agents/lib/shells.d.ts +3 -1
  53. package/dist/packages/engine/agents/lib/shells.js +8 -4
  54. package/dist/packages/engine/agents/role-executors.js +1 -1
  55. package/dist/packages/engine/compile/compiled-paths.js +6 -6
  56. package/dist/packages/engine/connection-config.js +1 -1
  57. package/dist/packages/engine/execution/lib/schema.d.ts +10 -0
  58. package/dist/packages/engine/instance-paths.d.ts +15 -9
  59. package/dist/packages/engine/instance-paths.js +15 -9
  60. package/dist/packages/engine/lib/schema.d.ts +686 -30
  61. package/dist/packages/engine/lib/schema.js +48 -21
  62. package/dist/packages/engine/native-run-handlers.js +10 -8
  63. package/dist/packages/engine/preparation-store.d.ts +9 -13
  64. package/dist/packages/engine/preparation-store.js +12 -0
  65. package/dist/packages/engine/requested-artifacts.d.ts +5 -0
  66. package/dist/packages/engine/requested-artifacts.js +36 -0
  67. package/dist/packages/engine/routes.d.ts +1 -1
  68. package/dist/packages/engine/routes.js +1 -1
  69. package/dist/packages/engine/run-observability.js +3 -2
  70. package/dist/packages/engine/runtime-proposal-helpers.d.ts +2 -2
  71. package/dist/packages/engine/runtime-proposal-helpers.js +5 -7
  72. package/dist/packages/engine/runtime-resource-builders.d.ts +5 -0
  73. package/dist/packages/engine/runtime-resource-builders.js +13 -2
  74. package/dist/packages/engine/runtime.d.ts +3 -1
  75. package/dist/packages/engine/runtime.js +146 -21
  76. package/dist/packages/engine/server.js +104 -52
  77. package/dist/packages/engine/verify/verify-execution.js +1 -1
  78. package/dist/packages/engine/wire-schemas.d.ts +5 -1
  79. package/dist/packages/engine/wire-schemas.js +1 -1
  80. package/dist/packages/methods/authoring/method-authoring.d.ts +3 -1
  81. package/dist/packages/methods/authoring/method-authoring.js +5 -36
  82. package/dist/packages/methods/package/builtin-compiled-method.js +1 -1
  83. package/dist/packages/methods/package/local-methods.d.ts +1 -0
  84. package/dist/packages/methods/package/local-methods.js +19 -4
  85. package/dist/packages/methods/package/method-definitions.js +1 -1
  86. package/dist/packages/project/interf-detect.js +6 -6
  87. package/dist/packages/project/lib/schema.d.ts +193 -0
  88. package/dist/packages/project/lib/schema.js +46 -1
  89. package/dist/packages/project/source-config.js +4 -0
  90. package/dist/packages/project/source-folders.js +1 -1
  91. package/package.json +7 -8
  92. package/public-repo/CONTRIBUTING.md +47 -0
  93. package/public-repo/LICENSE.md +1 -0
  94. package/public-repo/README.md +325 -0
  95. package/public-repo/SECURITY.md +67 -0
  96. package/public-repo/TRADEMARKS.md +8 -0
  97. package/{builtin-methods → public-repo/methods}/interf-default/README.md +4 -0
  98. package/{builtin-methods → public-repo/methods}/interf-default/compile/stages/shape/SKILL.md +4 -8
  99. package/{builtin-methods → public-repo/methods}/interf-default/method.json +1 -1
  100. package/public-repo/methods/interf-default/use/query/SKILL.md +23 -0
  101. package/public-repo/plugins/README.md +9 -0
  102. package/public-repo/plugins/interf/.claude-plugin/plugin.json +21 -0
  103. package/public-repo/plugins/interf/.mcp.json +12 -0
  104. package/public-repo/plugins/interf/README.md +29 -0
  105. package/public-repo/plugins/interf/skills/interf/SKILL.md +477 -0
  106. package/public-repo/skills/interf/SKILL.md +477 -0
  107. package/agent-skills/interf-actions/SKILL.md +0 -185
  108. package/agent-skills/interf-actions/references/cli.md +0 -243
  109. package/builtin-methods/interf-default/use/query/SKILL.md +0 -28
  110. package/dist/cli/commands/verify.d.ts +0 -10
  111. package/dist/compiler-ui/_next/static/chunks/06yhdspx~ca5-.js +0 -5
  112. package/dist/compiler-ui/_next/static/chunks/06z~l3kwb891e.js +0 -1
  113. package/dist/compiler-ui/_next/static/chunks/08g7lvje.te.u.js +0 -1
  114. package/dist/compiler-ui/_next/static/chunks/0_c_tvh-cukjz.css +0 -3
  115. package/dist/compiler-ui/_next/static/chunks/0_i-3_5l9t2qe.js +0 -1
  116. package/dist/compiler-ui/_next/static/chunks/0b-ywny_j0g~0.js +0 -1
  117. package/dist/compiler-ui/_next/static/chunks/0b52v41o1gixx.js +0 -1
  118. package/dist/compiler-ui/_next/static/chunks/0f_geuwdesg_c.js +0 -114
  119. package/dist/compiler-ui/_next/static/chunks/0gpzgsv0w.q~m.js +0 -31
  120. package/dist/compiler-ui/_next/static/chunks/0ilwfezfvu6~-.js +0 -1
  121. package/dist/compiler-ui/_next/static/chunks/0xxmf45eskdt~.css +0 -1
  122. package/dist/compiler-ui/_next/static/chunks/14wtz~vq25~qq.js +0 -1
  123. /package/dist/compiler-ui/_next/static/{6qyE1u9m_oBUkvAhhoCmO → tYHMLL9oKds1yDoNYgkPV}/_buildManifest.js +0 -0
  124. /package/dist/compiler-ui/_next/static/{6qyE1u9m_oBUkvAhhoCmO → tYHMLL9oKds1yDoNYgkPV}/_clientMiddlewareManifest.js +0 -0
  125. /package/dist/compiler-ui/_next/static/{6qyE1u9m_oBUkvAhhoCmO → tYHMLL9oKds1yDoNYgkPV}/_ssgManifest.js +0 -0
  126. /package/{builtin-methods → public-repo/methods}/interf-default/compile/stages/structure/SKILL.md +0 -0
  127. /package/{builtin-methods → public-repo/methods}/interf-default/compile/stages/summarize/SKILL.md +0 -0
  128. /package/{builtin-methods → public-repo/methods}/interf-default/improve/SKILL.md +0 -0
  129. /package/{builtin-methods → public-repo/methods}/interf-default/method.schema.json +0 -0
package/README.md CHANGED
@@ -1,19 +1,19 @@
1
1
  # Interf
2
2
 
3
- **Prepare your data for AI agents. With proof.**
3
+ **Context compiler for agents.**
4
4
 
5
- Interf prepares data for agent work. It runs locally, processes your files, shows evidence that your data is ready, and writes portable context: a local folder with verifiable outputs agents can use.
5
+ Interf prepares data for agent work by compiling source files into verifiable Artifacts and writing portable context that agents can read, so agents work from a verified full picture instead of guessing.
6
6
 
7
7
  **Hallucinations aren't an agent problem. They're a data preparation problem.**
8
8
 
9
9
  When agents start from source files, they have to discover the full picture while they work. That discovery is hidden: you cannot see which files were processed, which evidence was used, or which connections were found.
10
10
 
11
- Interf replaces that hidden discovery with a visible Method run over your source files. You connect to a local instance, name a Preparation against your Source Folder and a Method, run compile, and read the portable context Interf returns. Interf records source references, runs the Method locally, and writes the portable context: evidence, structure, and cross-file connections for agents.
11
+ Interf replaces that hidden discovery with visible compilation. Your agent can ask for the Artifacts it needs an atlas, index, timeline, summaries, or a custom file and Interf drafts a Build Plan for you to review before compile. The draft says what should be built; the compile run proves what was actually processed. Under the hood, Interf saves that request as a Preparation, runs a Build Plan locally, records source references, and writes verifiable Artifacts agents can read. Today a Build Plan is implemented by a Method package.
12
12
 
13
13
  ```text
14
- Source Folder Portable context agents read
14
+ Source files Portable context agents read
15
15
 
16
- bristol-office-market/ ~/.interf/preparations/bristol/portable-context/
16
+ bristol-office-market/ <portable-context-locator>/
17
17
  q4-market-report.pdf AGENTS.md
18
18
  lease-comps.xlsx .interf/runtime/source-snapshot.json
19
19
  planning-notes.md home.md
@@ -21,15 +21,16 @@ bristol-office-market/ ~/.interf/preparations/bristol/portable-cont
21
21
  knowledge/
22
22
  ```
23
23
 
24
- ## What a Method Run Produces
24
+ ## What a Compile Run Produces
25
25
 
26
- A Method run produces portable context plus proof of work. The portable context is the folder agents read. The proof shows which source files were assigned, which Method stages ran, what each stage wrote, and whether required outputs exist.
26
+ A compile run produces portable context plus proof of work. The portable context is the folder agents read. The proof shows which source files were assigned, which Build Plan stages ran, what each stage wrote, and whether required artifacts exist.
27
27
 
28
- For the built-in `interf-default` Method, a compile run looks like this:
28
+ For the built-in `interf-default` Build Plan, a compile run looks like this:
29
29
 
30
30
  ```text
31
- Source Files: bristol-office-market
32
- Method: interf-default
31
+ Source: bristol-office-market
32
+ Build Plan: interf-default
33
+ Requested Artifacts: atlas, summaries, knowledge, claims, indexes
33
34
 
34
35
  compile run
35
36
  record source references
@@ -38,28 +39,28 @@ compile run
38
39
  shape -> home.md and agent entrypoints
39
40
  record proof -> processed files, stage outputs, required artifacts
40
41
 
41
- output
42
- portable context -> { kind: "local-path", value: "/Users/me/.interf/preparations/bristol/portable-context" }
42
+ portable context
43
+ locator -> { kind: "local-path", value: "<local-path-returned-by-interf>" }
43
44
  ```
44
45
 
45
- The output is not an answer. It is a prepared local folder with routes, summaries, linked notes, source snapshots, and agent instructions. Your runtime agent reads that folder when it does the actual agent work.
46
+ The output is not an answer. It is a prepared local folder with routes, artifacts, source snapshots, and agent instructions. Your runtime agent reads that folder when it does the actual agent work.
46
47
 
47
48
  ## Design Choices
48
49
 
49
- - `Method-scoped`: every Method is for one specific kind of agent work over source files, not a generic index over your Source Folder.
50
- - `Deterministic`: Interf runs each stage, an ordered phase of a Method, and shows stage-by-stage proof of work: which files were processed, what each stage produced, and whether required outputs exist. Agents do not have to rebuild the full picture while they work.
50
+ - `Preparation-scoped`: every Preparation starts from a specific Source, requested Artifacts, and agent job, not a generic index over all your files.
51
+ - `Deterministic`: Interf runs each stage, an ordered phase of a Build Plan, and shows stage-by-stage proof of work: which files were processed, what each stage produced, and whether required outputs exist. Agents do not have to rebuild the full picture while they work.
51
52
  - `Local-first and private`: your files, readiness checks, and agent runs stay on your machine. No cloud, no uploads, no telemetry.
52
53
  - `Bring your own AI`: use Claude Code, Codex, or another local agent.
53
- - `File over app`: the portable context is a real local folder owned by the instance — no hidden store, no hidden index. Inspect it, diff it, version it.
54
+ - `File over app`: the portable context is a local folder owned by the instance — no hidden store, no hidden index. Inspect it, diff it, version it.
54
55
  - `Readiness checks you control`: every build can be checked against gates you wrote from the files. If the portable context is `not ready`, `interf test` shows the readiness evidence behind that status.
55
56
 
56
57
  ## Why Not Just Ask Your Agent?
57
58
 
58
59
  You can. Interf can use Claude Code, Codex, or another local agent while it builds the portable context.
59
60
 
60
- A one-off preprocessing prompt gives you another agent answer to trust. Interf puts that work inside a Method you can inspect: declared stages, required outputs, stage-by-stage proof of work, and readiness checks that decide whether the portable context is `ready` or `not ready`.
61
+ A one-off preprocessing prompt gives you another agent answer to trust. Interf puts that work inside a Build Plan you can inspect: requested artifacts, declared stages, stage-by-stage proof of work, and readiness checks that decide whether the portable context is `ready` or `not ready`.
61
62
 
62
- The agent can still do the processing. Interf shows what ran, which files were processed, what evidence was produced, and whether the result is ready for the agent work.
63
+ The agent can still execute the stages. Interf shows what ran, which files were processed, what artifacts and evidence were produced, and whether the result is ready for the agent work.
63
64
 
64
65
  ## Install
65
66
 
@@ -74,35 +75,39 @@ Requires Node.js 20+ and a local coding agent such as Claude Code or Codex. Run
74
75
 
75
76
  ```bash
76
77
  interf web # terminal 1: start the local engine
77
- interf prep create bristol \ # terminal 2: name the unit of work
78
+ interf prep create bristol \ # terminal 2: save the source + requested Artifacts
78
79
  --source ./bristol-office-market \
79
- --method interf-default
80
+ --about "Bristol annual take-up and availability chart lookup" \
81
+ --requested-artifacts-json '[{"title":"Guide to the report","checks":["Every page or file is listed.","Pages about Bristol and annual take-up are marked."]},{"title":"Annual take-up figures","checks":["Every figure has a source reference."]}]'
82
+ interf method draft bristol \ # draft the Build Plan for review
83
+ --task "Bristol annual take-up and availability chart lookup"
80
84
  interf compile bristol # build portable context, returns the locator
81
85
  interf test bristol # check readiness
82
86
  ```
83
87
 
84
- `interf web` starts the engine in the foreground and writes
85
- `~/.interf/connection.json` so subsequent CLI commands can connect. The
86
- interactive `interf` wizard can ask whether to start `interf web` or connect a
87
- remote engine. Mutating commands never auto-start an engine if no instance is
88
- connected, they exit with a hint pointing at `interf web` (local) or
89
- `interf login` (future cloud).
88
+ `interf web` starts the engine in the foreground and writes the active
89
+ connection record so subsequent CLI commands can connect. Agents can use
90
+ `interf web start` for an explicit managed background engine, then
91
+ `interf web stop` when their work is done. Mutating commands never implicitly
92
+ auto-start an engine — if no instance is connected, they exit with a hint
93
+ pointing at `interf web` / `interf web start` (local) or `interf login`
94
+ (future cloud).
90
95
 
91
96
  `interf compile` returns the artifact locator on success — for a local
92
97
  engine that's a `local-path` you can open with any tool. Point your agent at
93
98
  that path. There's no `--out` flag, no implicit copy, no hidden store: the
94
99
  instance owns the bytes and the API tells you where they are.
95
100
 
96
- If you want a baseline before preparing, run `interf test bristol --target source-files`. It is optional proof, not the main path.
101
+ If you want a baseline before compile, run `interf test bristol --target source-files`. It is optional proof, not the main path.
97
102
 
98
103
  ## Portable Context
99
104
 
100
- The portable context is the local folder Interf writes from your files. The instance owns its location — `~/.interf/preparations/<prep-id>/portable-context/` for a local engine, a signed remote URL for a cloud engine. The API returns a typed locator (`{ kind: "local-path" | "remote-url", value }`); your agent reads from there.
105
+ The portable context is the local folder Interf writes from your files. Do not hardcode its location. The API returns a typed locator (`{ kind: "local-path" | "remote-url", value }`); your agent reads from there.
101
106
 
102
107
  It gives agents evidence, structure, and cross-file connections for navigating the files. It is not a replacement for your files. For the built-in `interf-default`, it includes:
103
108
 
104
109
  ```text
105
- ~/.interf/preparations/bristol/portable-context/
110
+ <portable-context-locator>/
106
111
  AGENTS.md # agent-facing entry point and source-checking rules
107
112
  CLAUDE.md # same guidance for Claude Code
108
113
  .interf/
@@ -114,7 +119,7 @@ It gives agents evidence, structure, and cross-file connections for navigating t
114
119
  knowledge/ # linked notes built from the files
115
120
  ```
116
121
 
117
- The source files stay the source of truth. Interf writes portable context inside the instance's data dir; it does not modify the Source Folder.
122
+ The source files stay the source of truth. Interf writes portable context inside the instance's data dir; it does not modify the source.
118
123
 
119
124
  `AGENTS.md` tells agents how to use the portable context: start from the prepared outputs, follow the prepared routes, and use the recorded source references when exact source evidence matters.
120
125
 
@@ -122,15 +127,17 @@ Interf also records stage-by-stage proof of work: which files were processed, wh
122
127
 
123
128
  The portable context carries source references, not a mandatory copy of every source file. The source files remain where you keep them; Interf records which sources were assigned and what artifacts were produced from them.
124
129
 
125
- ## Methods
130
+ ## Build Plans and Method Packages
126
131
 
127
- A Method tells Interf how to process your files for the job agents need to do. When you create one, describe three things: what data is in the Source Folder, what the portable context should contain, and what evidence should show the portable context is `ready`. The built-in `interf-default` Method ships with `@interf/compiler`. Install your own with `interf method install <path>`; draft new ones with `interf method draft <prep-id>`.
132
+ A Build Plan tells Interf how to compile requested Artifacts from your source files for the job agents need to do. It can start as a draft inside one Preparation, based on the user's instructions, the agent goal, and the described Source. If it works, save it as a Method package and reuse it on another Source.
133
+
134
+ Today saved Build Plans are implemented as Method packages. The built-in `interf-default` Method package ships with `@interf/compiler`. Install your own with `interf method install <path>`; draft new ones with `interf method draft <prep-id>`.
128
135
 
129
136
  ```text
130
- ~/.interf/methods/interf-default/
131
- method.json # Method: source data, stages, and processing rules
137
+ <method-package>/
138
+ method.json # Build Plan: artifacts, stages, compile rules
132
139
  method.schema.json # output contract: required portable-context files and folders
133
- README.md # what this Method is for, for humans and agents
140
+ README.md # what this Build Plan is for
134
141
  compile/
135
142
  stages/
136
143
  summarize/ # stage instructions Interf runs during compile
@@ -138,20 +145,20 @@ A Method tells Interf how to process your files for the job agents need to do. W
138
145
  shape/
139
146
  use/
140
147
  query/ # how agents read the portable context
141
- improve/ # how Interf revises this Method if readiness checks still fail
148
+ improve/ # how Interf revises this plan if readiness checks still fail
142
149
  ```
143
150
 
144
- - `method.json` describes the Method: source data, stages, and how the files should be processed.
151
+ - `method.json` describes the Build Plan: source data, requested artifacts, stages, and how the files should be compiled.
145
152
  - `method.schema.json` describes the output contract: what the portable context must contain. Interf enforces it when you run `interf compile`.
146
153
  - `compile/stages/<stage>/` is where you author one folder per stage — a small, specific phase like `summarize` or `structure`. You write the instructions; Interf runs them during compile.
147
154
  - `use/query/` holds the instructions agents follow when they read the portable context for live agent work.
148
- - `improve/` holds the instructions Interf follows when the first build misses and the Method itself needs editing.
155
+ - `improve/` holds the instructions Interf follows when the first build misses and the Build Plan itself needs editing.
149
156
 
150
- A Method defines the stages, output contract, proof requirements, and improvement instructions Interf runs on your files. Technically, each Method is stored as a Method package with `method.json` and `method.schema.json`. The result is portable context your agents can read.
157
+ A Build Plan defines the stages, output contract, proof requirements, and improvement instructions Interf runs on your files. Technically, a saved/reusable Build Plan is stored as a Method package with `method.json` and `method.schema.json`. The result is portable context your agents can read.
151
158
 
152
- ## Method Improvement
159
+ ## Build Plan Improvement
153
160
 
154
- When the first compile run still misses readiness checks, Interf edits the Method itself and compiles again. Same files, same checks, improved Method and portable context. Run `interf method improve <prep-id>` to invoke that loop manually.
161
+ When the first compile run still misses readiness checks, Interf edits the Build Plan and compiles again. Same files, same checks, improved plan and portable context. Run `interf method improve <prep-id>` to invoke that loop manually.
155
162
 
156
163
  Interf saves every readiness-check run inside the preparation's portable context under `.interf/tests/`. You can inspect what changed and why a later compile run did better.
157
164
 
@@ -159,7 +166,7 @@ Interf saves every readiness-check run inside the preparation's portable context
159
166
 
160
167
  You don't need to think about roles. By default Interf uses your active agent for every stage of every compile run, the same way 0.14 did. Roles are available for advanced users who want different agents per stage; defaults are good and stable.
161
168
 
162
- Interf treats connected agents as a first-class primitive and uses a small role taxonomy internally to route stages between them. The default behavior is single-active-agent — one installed agent runs everything — but you can opt into per-role specialization without changing any Method.
169
+ Interf treats connected agents as a first-class primitive and uses a small role taxonomy internally to route stages between them. The default behavior is single-active-agent — one installed agent runs everything — but you can opt into per-role specialization without changing any Build Plan.
163
170
 
164
171
  ```text
165
172
  Connected agents Role map (per-instance)
@@ -169,16 +176,16 @@ Connected agents Role map (per-instance)
169
176
  verifier → claude-code
170
177
  general → claude-code
171
178
 
172
- A Method compile run
173
- for each stage in the Method
179
+ A Build Plan compile run
180
+ for each stage in the Build Plan
174
181
  look up the stage's role in the role map
175
182
  invoke the mapped agent on the prepared shell
176
183
  record which agent ran which stage
177
184
  ```
178
185
 
179
- Methods declare an optional `role` per stage — one of `extractor`, `summarizer`, `structurer`, `verifier`, or `general`. Custom role names are allowed; unknown roles fall through to `general`.
186
+ Build Plans declare an optional `role` per stage — one of `extractor`, `summarizer`, `structurer`, `verifier`, or `general`. Custom role names are allowed; unknown roles fall through to `general`.
180
187
 
181
- The role map lives in `~/.interf/agents.json`. On a fresh install with one agent installed, every role maps to that agent and you get the same single-active-agent behavior 0.14 had. To change which agent runs which role:
188
+ The role map lives in the instance's agent settings. On a fresh install with one agent installed, every role maps to that agent and you get the same single-active-agent behavior 0.14 had. To change which agent runs which role:
182
189
 
183
190
  ```bash
184
191
  interf agents ls
@@ -188,23 +195,23 @@ interf agents use claude-code # set the active agent
188
195
  interf agents unmap structurer # fall back to active
189
196
  ```
190
197
 
191
- Or use the **Agents** tab in Interf Compiler UI. Either surface mutates the same `~/.interf/agents.json` through the local service.
198
+ Or use the **Agents** tab in Interf Compiler UI. Either surface mutates the same instance agent settings through the local service.
192
199
 
193
- Verify runs always resolve to the `verifier` role. Method-authoring runs ask the authoring agent to propose a `role` per stage based on the prompt content; missing roles default to `general`.
200
+ Readiness-check runs always resolve to the `verifier` role. Build Plan authoring runs ask the authoring agent to propose a `role` per stage based on the prompt content; missing roles default to `general`.
194
201
 
195
202
  ## How the Pieces Fit
196
203
 
197
- The instance owns preparation state. A preparation declares a source binding (`{ kind: "local-folder", locator: <path> }`) and a method id; the instance stores its config at `~/.interf/preparations/<prep-id>/config.json` and writes portable context to `~/.interf/preparations/<prep-id>/portable-context/`. A compile run processes the selected source files and produces the artifact locator the API returns. `interf test` checks Source Folder files and portable context against the same readiness checks.
204
+ The instance owns preparation state. A preparation declares a source binding (`{ kind: "local-folder", locator: <path> }`), requested artifacts, and a selected Build Plan. The current local engine still stores the selected Build Plan as `method_id` while the schema catches up. It stores preparation state and generated bytes in the instance data directory. A compile run processes the selected source files and produces the artifact locator the API returns. `interf test` checks source files and portable context against the same readiness checks.
198
205
 
199
- Readiness is one `ready` / `not ready` status, not a separate score. Interf builds it from evidence primitives: Method Artifact checks, proof records, file coverage, artifact validation, and readiness checks.
206
+ Readiness is one `ready` / `not ready` status, not a separate score. Interf builds it from evidence primitives: Build Plan Artifact checks, proof records, file coverage, artifact validation, and readiness checks.
200
207
 
201
- `interf web` runs the local Interf instance and serves Interf Compiler UI. The UI reads local-service resources: Source Files, Methods, runs, stages, proof, artifacts, readiness checks, and whether portable context is `ready` or `not ready`. It renders local instance state; it does not own compiler, Method, or readiness semantics.
208
+ `interf web` runs the local Interf instance and serves Interf Compiler UI. The UI reads local-service resources: Source, Preparations, Build Plans, Method packages, compile runs, stages, proof, artifacts, readiness checks, and whether portable context is `ready` or `not ready`. It renders local instance state; it does not own compiler, Build Plan, Method-package, or readiness semantics.
202
209
 
203
- Everywhere Interf shows a resource — Source Folder, portable context, Method files, run artifacts — the API returns a single locator shape: `{ kind, value }`. `local-path` means the engine has filesystem access to the same host as the user; `remote-url` is a signed URL the UI opens in a browser tab; `api-served` is a relative API route the UI fetches and renders inline. Local engines today return `local-path`; the same shape carries forward unchanged when a remote instance fronts the API.
210
+ Everywhere Interf shows a resource — Source, portable context, Build Plan files, run artifacts — the API returns a single locator shape: `{ kind, value }`. `local-path` means the engine has filesystem access to the same host as the user; `remote-url` is a signed URL the UI opens in a browser tab; `api-served` is a relative API route the UI fetches and renders inline. Local engines today return `local-path`; the same shape carries forward unchanged when a remote instance fronts the API.
204
211
 
205
212
  ## CLI Connection
206
213
 
207
- The CLI is a thin authorized client of one connected instance. It carries one piece of state — `~/.interf/connection.json`:
214
+ The CLI is a thin authorized client of one connected instance. It carries one active connection record:
208
215
 
209
216
  ```text
210
217
  {
@@ -213,24 +220,24 @@ The CLI is a thin authorized client of one connected instance. It carries one pi
213
220
  }
214
221
  ```
215
222
 
216
- `interf web` writes that record on startup. `interf login --url <remote>` writes a remote one (the cloud backend ships in a future release; the wire shape and config layer ship now). `interf logout` clears it.
223
+ `interf web` and `interf web start` write that record on startup. `interf login --url <remote>` writes a remote one (the cloud backend ships in a future release; the wire shape and config layer ship now). `interf logout` clears it.
217
224
 
218
225
  If the connection is unreachable, every mutating command exits non-zero with:
219
226
 
220
227
  ```text
221
228
  Not connected to any Interf instance.
222
- Start one with `interf web`, or set --url / `interf login` for a remote one.
229
+ Start one with `interf web` or `interf web start`, or set --url / `interf login` for a remote one.
223
230
  ```
224
231
 
225
- There is no auto-start. There is no per-folder pointer file. One mental model: client connects to instance, or doesn't.
232
+ There is no implicit auto-start. There is no per-folder pointer file. One mental model: client connects to instance, explicitly starts one, or doesn't.
226
233
 
227
234
  ## Readiness Checks
228
235
 
229
236
  There are two checks in the system, and they answer different questions.
230
237
 
231
- Method Artifact checks check the build: did the Method produce the files, folders, Artifacts, and stage outputs it promised? Interf checks those while it compiles.
238
+ Build Plan Artifact checks check the build: did the plan produce the files, folders, Artifacts, and stage outputs it promised? Interf checks those while it compiles.
232
239
 
233
- Readiness checks check the Method output: is this portable context good enough for the specific agent work? They are the confidence layer on top of the portable context, not the product output.
240
+ Readiness checks check the portable context: is this Preparation good enough for the specific agent work? They are the confidence layer on top of the portable context, not the product output.
234
241
 
235
242
  In the setup flow, readiness checks often look like plain question-and-answer pairs. On the API, they live under each preparation's `checks[]`. They help define whether the portable context is `ready` or `not ready`. A check should be a small, verifiable fact or condition you already know from the files:
236
243
 
@@ -238,7 +245,7 @@ In the setup flow, readiness checks often look like plain question-and-answer pa
238
245
  - one short statement that should be true or false
239
246
  - one comparison across years, files, or sections
240
247
 
241
- Interf proposes an initial set from the files and the description of the job agents need to do. You confirm, edit, or replace them. `interf test` runs those checks through the configured local agent against Source Folder files, portable context, or both. The portable context itself does not answer; the agent answers while using it.
248
+ Interf proposes an initial set from the files and the description of the job agents need to do. You confirm, edit, or replace them. `interf test` runs those checks through the configured local agent against source files, portable context, or both. The portable context itself does not answer; the agent answers while using it.
242
249
 
243
250
  A maintained readiness example in this repo uses one market report, two readiness checks, and two agents:
244
251
 
@@ -249,7 +256,7 @@ A maintained readiness example in this repo uses one market report, two readines
249
256
  | Claude Code (Claude Opus 4.6, max) | `0/2` | `2/2` |
250
257
  <!-- PUBLIC_BENCHMARK_TABLE:END -->
251
258
 
252
- Codex passed from the Source Folder files; Claude Code only passed when working from Interf's portable context. Both numbers come from the same readiness-check pass. That is evidence about whether this Method output is `ready` for this agent work.
259
+ Codex passed from the source files; Claude Code only passed when working from Interf's portable context. Both numbers come from the same readiness-check pass. That is evidence about whether this portable context is `ready` for this agent work.
253
260
 
254
261
  A maintained public test example uses this preparation:
255
262
 
@@ -260,6 +267,16 @@ A maintained public test example uses this preparation:
260
267
  "source": { "kind": "local-folder", "locator": "./task-files" },
261
268
  "method_id": "interf-default",
262
269
  "about": "Bristol historical take-up and availability chart lookup.",
270
+ "requested_artifacts": [
271
+ {
272
+ "title": "Guide to the report",
273
+ "checks": ["Every page is listed.", "Pages about Bristol charts are marked."]
274
+ },
275
+ {
276
+ "title": "Annual take-up and availability figures",
277
+ "checks": ["Every figure has a page reference.", "Approximate chart-derived reads are labelled."]
278
+ }
279
+ ],
263
280
  "checks": [
264
281
  {
265
282
  "question": "What were Bristol's annual take-up values in 2018 and 2016?",
@@ -279,31 +296,28 @@ A maintained public test example uses this preparation:
279
296
  - Not a second brain or memory product. One preparation per agent job; nothing global.
280
297
  - Not a vector store or RAG server. The portable context is plain files.
281
298
  - Not a hosted data platform. The local instance runs on your machine; your bytes never leave it.
282
- - Not an agent harness. Interf prepares the data; your existing agent reads the portable context.
299
+ - Not an agent harness. Interf compiles the context; your existing agent reads the portable context.
283
300
 
284
301
  ## Useful Commands
285
302
 
286
303
  - `interf web` — run the local engine in the foreground (Compiler UI + API)
304
+ - `interf web start` — start a managed background local engine for agent sessions
287
305
  - `interf web stop` — kill the running local engine
288
306
  - `interf prep ls / create / show / rm` — manage preparations
289
307
  - `interf compile <prep-id>` — build portable context, returns the artifact locator
290
308
  - `interf test <prep-id>` — run readiness checks against source files and/or portable context
291
- - `interf method ls / install / draft / improve` — manage Method packages
309
+ - `interf method ls / show / install / draft / improve` — manage Build Plans / Method packages
292
310
  - `interf agents ls / use / register / unregister / map / unmap` — manage connected agents and the role map
293
- - `interf runs ls / status / watch / cancel / fetch` — inspect runs
294
- - `interf login / logout` — manage `~/.interf/connection.json` (remote backend ships in a future release)
311
+ - `interf runs ls / status / cancel / fetch` — inspect runs
312
+ - `interf login / logout` — manage the active connection record (remote backend ships in a future release)
295
313
  - `interf status` — show the active connection and a preparation summary
296
- - `interf doctor --live` — verify the local executor
314
+ - `interf doctor --live` — check the local executor
297
315
 
298
- ## Maintainer Docs
316
+ ## Public Assets
299
317
 
300
- - [src/README.md](./src/README.md) - source tree index
301
- - [src/packages/README.md](./src/packages/README.md) - package boundaries
302
- - [src/cli/README.md](./src/cli/README.md) - CLI orchestration
303
- - [apps/compiler-ui/README.md](./apps/compiler-ui/README.md) - Interf Compiler UI
304
- - [apps/compiler-ui/DESIGN.md](./apps/compiler-ui/DESIGN.md) - UI design source of truth
305
- - [scripts/README.md](./scripts/README.md) - maintainer automation
306
- - [AGENTS.md](./AGENTS.md) / [CLAUDE.md](./CLAUDE.md) - maintainer compass + navigation index for agent sessions
318
+ - [skills/interf](./skills/interf/) bundled agent Skill for Interf.
319
+ - [plugins/interf](./plugins/interf/) local MCP host bundle for agents that support local MCP servers.
320
+ - [methods/interf-default](./methods/interf-default/) default Method package that ships with `@interf/compiler`.
307
321
 
308
322
  Contributors: see [CONTRIBUTING.md](./CONTRIBUTING.md).
309
323
 
@@ -1,37 +1,3 @@
1
- /**
2
- * `interf mcp` — Model Context Protocol server.
3
- *
4
- * Wraps the local-service HTTP API as a typed agent surface so coding
5
- * agents can interact with Interf the same way they call other MCP tools
6
- * (instead of shelling out to the CLI).
7
- *
8
- * interf mcp # stdio transport (default)
9
- * interf mcp --transport=http --port=4889 # advanced: HTTP transport
10
- *
11
- * The server reads `~/.interf/connection.json` (the same file every other
12
- * client uses) and exits non-zero with the connect-or-error hint if no
13
- * instance is reachable. Tools call straight through to the API; the
14
- * server itself holds no state. The transport options are intentionally
15
- * minimal — agents speaking MCP today are stdio-first.
16
- *
17
- * Tool list mirrors the API verbatim:
18
- * prep_list GET /v1/preparations
19
- * prep_create POST /v1/preparations
20
- * prep_show GET /v1/preparations/{id}
21
- * prep_set_method PATCH /v1/preparations/{id}
22
- * prep_remove DELETE /v1/preparations/{id}
23
- * prep_compile POST /v1/preparations/{id}/compile-runs
24
- * prep_verify POST /v1/preparations/{id}/verify-runs
25
- * method_list GET /v1/methods
26
- * method_install POST /v1/methods (preparation-scoped via `prep_id`)
27
- * method_draft POST /v1/preparations/{id}/method-authoring-runs
28
- * method_improve POST /v1/preparations/{id}/method-improvement-runs
29
- * runs_status GET /v1/runs/{run-id}
30
- * runs_watch GET /v1/runs/{run-id}/events (snapshot, not SSE)
31
- * runs_cancel POST /v1/runs/{run-id}/cancel
32
- * runs_fetch GET /v1/runs/{run-id}/artifacts
33
- * instance_status GET /v1/instance
34
- */
35
1
  import type { CommandModule } from "yargs";
36
2
  interface McpArgs {
37
3
  transport?: "stdio" | "http";