@interf/compiler 0.9.4 → 0.13.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 (222) hide show
  1. package/README.md +96 -91
  2. package/TRADEMARKS.md +2 -13
  3. package/agent-skills/interf-actions/SKILL.md +97 -32
  4. package/agent-skills/interf-actions/references/cli.md +124 -71
  5. package/builtin-methods/interf-default/README.md +3 -4
  6. package/builtin-methods/interf-default/compile/stages/shape/SKILL.md +2 -2
  7. package/builtin-methods/interf-default/compile/stages/summarize/SKILL.md +2 -1
  8. package/builtin-methods/interf-default/improve/SKILL.md +1 -1
  9. package/builtin-methods/interf-default/method.json +10 -4
  10. package/builtin-methods/interf-default/method.schema.json +0 -9
  11. package/builtin-methods/interf-default/use/query/SKILL.md +5 -5
  12. package/dist/cli/commands/compile.d.ts +9 -31
  13. package/dist/cli/commands/compile.js +75 -388
  14. package/dist/cli/commands/doctor.js +1 -1
  15. package/dist/cli/commands/login.d.ts +7 -0
  16. package/dist/cli/commands/login.js +39 -0
  17. package/dist/cli/commands/logout.d.ts +2 -0
  18. package/dist/cli/commands/logout.js +16 -0
  19. package/dist/cli/commands/method.d.ts +2 -0
  20. package/dist/cli/commands/method.js +113 -0
  21. package/dist/cli/commands/prep.d.ts +2 -0
  22. package/dist/cli/commands/prep.js +134 -0
  23. package/dist/cli/commands/reset.d.ts +8 -1
  24. package/dist/cli/commands/reset.js +47 -15
  25. package/dist/cli/commands/runs.d.ts +2 -0
  26. package/dist/cli/commands/runs.js +120 -0
  27. package/dist/cli/commands/status.d.ts +6 -1
  28. package/dist/cli/commands/status.js +61 -220
  29. package/dist/cli/commands/test.d.ts +6 -15
  30. package/dist/cli/commands/test.js +63 -342
  31. package/dist/cli/commands/web.d.ts +0 -9
  32. package/dist/cli/commands/web.js +140 -367
  33. package/dist/cli/commands/wizard.d.ts +9 -0
  34. package/dist/cli/commands/wizard.js +442 -0
  35. package/dist/cli/index.d.ts +7 -6
  36. package/dist/cli/index.js +13 -10
  37. package/dist/compiler-ui/404.html +1 -1
  38. package/dist/compiler-ui/__next.__PAGE__.txt +2 -2
  39. package/dist/compiler-ui/__next._full.txt +3 -3
  40. package/dist/compiler-ui/__next._head.txt +1 -1
  41. package/dist/compiler-ui/__next._index.txt +2 -2
  42. package/dist/compiler-ui/__next._tree.txt +2 -2
  43. package/dist/compiler-ui/_next/static/chunks/045gole2ojo3g.css +3 -0
  44. package/dist/compiler-ui/_next/static/chunks/17t-lulmyawg5.js +89 -0
  45. package/dist/compiler-ui/_not-found/__next._full.txt +2 -2
  46. package/dist/compiler-ui/_not-found/__next._head.txt +1 -1
  47. package/dist/compiler-ui/_not-found/__next._index.txt +2 -2
  48. package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +1 -1
  49. package/dist/compiler-ui/_not-found/__next._not-found.txt +1 -1
  50. package/dist/compiler-ui/_not-found/__next._tree.txt +2 -2
  51. package/dist/compiler-ui/_not-found.html +1 -1
  52. package/dist/compiler-ui/_not-found.txt +2 -2
  53. package/dist/compiler-ui/index.html +1 -1
  54. package/dist/compiler-ui/index.txt +3 -3
  55. package/dist/index.d.ts +0 -23
  56. package/dist/index.js +0 -16
  57. package/dist/packages/agents/lib/shells.d.ts +1 -1
  58. package/dist/packages/agents/lib/shells.js +113 -54
  59. package/dist/packages/agents/lib/user-config.d.ts +4 -2
  60. package/dist/packages/agents/lib/user-config.js +15 -7
  61. package/dist/packages/compiler/compiled-paths.d.ts +9 -2
  62. package/dist/packages/compiler/compiled-paths.js +30 -15
  63. package/dist/packages/compiler/compiled-pipeline.js +23 -3
  64. package/dist/packages/compiler/compiled-stage-plan.js +4 -0
  65. package/dist/packages/compiler/compiled-target.d.ts +1 -1
  66. package/dist/packages/compiler/compiled-target.js +1 -1
  67. package/dist/packages/compiler/index.d.ts +1 -0
  68. package/dist/packages/compiler/index.js +1 -0
  69. package/dist/packages/compiler/lib/schema.d.ts +27 -32
  70. package/dist/packages/compiler/lib/schema.js +2 -13
  71. package/dist/packages/compiler/method-runs.d.ts +2 -3
  72. package/dist/packages/compiler/method-runs.js +2 -3
  73. package/dist/packages/compiler/reset.js +3 -1
  74. package/dist/packages/compiler/runtime-contracts.js +0 -3
  75. package/dist/packages/compiler/runtime-prompt.js +1 -1
  76. package/dist/packages/compiler/source-files.d.ts +46 -0
  77. package/dist/packages/compiler/source-files.js +149 -0
  78. package/dist/packages/compiler/state-artifacts.d.ts +3 -2
  79. package/dist/packages/compiler/state-artifacts.js +4 -3
  80. package/dist/packages/compiler/state-io.d.ts +3 -2
  81. package/dist/packages/compiler/state-io.js +11 -5
  82. package/dist/packages/compiler/state-paths.d.ts +2 -1
  83. package/dist/packages/compiler/state-paths.js +6 -3
  84. package/dist/packages/compiler/state-view.d.ts +3 -2
  85. package/dist/packages/compiler/state-view.js +18 -28
  86. package/dist/packages/compiler/state.d.ts +4 -4
  87. package/dist/packages/compiler/state.js +3 -3
  88. package/dist/packages/contracts/index.d.ts +1 -1
  89. package/dist/packages/contracts/lib/preparation-paths.d.ts +117 -0
  90. package/dist/packages/contracts/lib/preparation-paths.js +177 -0
  91. package/dist/packages/contracts/lib/schema.d.ts +85 -6
  92. package/dist/packages/contracts/lib/schema.js +46 -2
  93. package/dist/packages/execution/lib/schema.d.ts +50 -57
  94. package/dist/packages/execution/lib/schema.js +1 -2
  95. package/dist/packages/local-service/action-definitions.d.ts +246 -0
  96. package/dist/packages/local-service/action-definitions.js +1147 -0
  97. package/dist/packages/local-service/action-planner.d.ts +9 -0
  98. package/dist/packages/local-service/action-planner.js +135 -0
  99. package/dist/packages/local-service/action-values.d.ts +1 -23
  100. package/dist/packages/local-service/action-values.js +1 -31
  101. package/dist/packages/local-service/client.d.ts +76 -46
  102. package/dist/packages/local-service/client.js +184 -149
  103. package/dist/packages/local-service/connection-config.d.ts +38 -0
  104. package/dist/packages/local-service/connection-config.js +75 -0
  105. package/dist/packages/local-service/index.d.ts +14 -7
  106. package/dist/packages/local-service/index.js +8 -4
  107. package/dist/packages/local-service/instance-paths.d.ts +100 -0
  108. package/dist/packages/local-service/instance-paths.js +165 -0
  109. package/dist/packages/local-service/lib/schema.d.ts +689 -2575
  110. package/dist/packages/local-service/lib/schema.js +260 -101
  111. package/dist/packages/local-service/native-run-handlers.d.ts +23 -0
  112. package/dist/{cli/commands/compile-controller.js → packages/local-service/native-run-handlers.js} +204 -20
  113. package/dist/packages/local-service/preparation-store.d.ts +92 -0
  114. package/dist/packages/local-service/preparation-store.js +171 -0
  115. package/dist/{cli/commands/check-draft.d.ts → packages/local-service/readiness-check-draft.d.ts} +2 -2
  116. package/dist/packages/local-service/routes.d.ts +33 -11
  117. package/dist/packages/local-service/routes.js +44 -15
  118. package/dist/packages/local-service/run-observability.js +25 -27
  119. package/dist/packages/local-service/runtime-caches.d.ts +76 -0
  120. package/dist/packages/local-service/runtime-caches.js +191 -0
  121. package/dist/packages/local-service/runtime-event-applier.d.ts +12 -0
  122. package/dist/packages/local-service/runtime-event-applier.js +177 -0
  123. package/dist/packages/local-service/runtime-persistence.d.ts +47 -0
  124. package/dist/packages/local-service/runtime-persistence.js +137 -0
  125. package/dist/packages/local-service/runtime-proposal-helpers.d.ts +35 -0
  126. package/dist/packages/local-service/runtime-proposal-helpers.js +251 -0
  127. package/dist/packages/local-service/runtime-resource-builders.d.ts +52 -0
  128. package/dist/packages/local-service/runtime-resource-builders.js +149 -0
  129. package/dist/packages/local-service/runtime.d.ts +201 -44
  130. package/dist/packages/local-service/runtime.js +1062 -1106
  131. package/dist/packages/local-service/server.d.ts +15 -0
  132. package/dist/packages/local-service/server.js +651 -233
  133. package/dist/packages/local-service/service-registry.d.ts +47 -0
  134. package/dist/packages/local-service/service-registry.js +137 -0
  135. package/dist/packages/method-authoring/method-authoring.d.ts +1 -1
  136. package/dist/packages/method-authoring/method-authoring.js +2 -2
  137. package/dist/packages/method-authoring/method-improvement.js +1 -1
  138. package/dist/packages/method-package/builtin-compiled-method.d.ts +4 -5
  139. package/dist/packages/method-package/builtin-compiled-method.js +8 -14
  140. package/dist/packages/method-package/context-interface.d.ts +4 -40
  141. package/dist/packages/method-package/context-interface.js +1 -23
  142. package/dist/packages/method-package/interf-method-package.d.ts +4 -4
  143. package/dist/packages/method-package/interf-method-package.js +21 -33
  144. package/dist/packages/method-package/local-methods.d.ts +10 -6
  145. package/dist/packages/method-package/local-methods.js +57 -39
  146. package/dist/packages/method-package/method-definitions.d.ts +8 -34
  147. package/dist/packages/method-package/method-definitions.js +49 -37
  148. package/dist/packages/method-package/method-helpers.d.ts +1 -13
  149. package/dist/packages/method-package/method-helpers.js +8 -42
  150. package/dist/packages/method-package/method-review-paths.d.ts +1 -1
  151. package/dist/packages/method-package/method-review-paths.js +5 -5
  152. package/dist/packages/method-package/method-stage-runner.js +2 -2
  153. package/dist/packages/method-package/user-methods.d.ts +17 -0
  154. package/dist/packages/method-package/user-methods.js +77 -0
  155. package/dist/packages/project-model/index.d.ts +1 -1
  156. package/dist/packages/project-model/index.js +1 -1
  157. package/dist/packages/project-model/interf-detect.d.ts +8 -3
  158. package/dist/packages/project-model/interf-detect.js +34 -34
  159. package/dist/packages/project-model/interf-scaffold.d.ts +3 -3
  160. package/dist/packages/project-model/interf-scaffold.js +23 -32
  161. package/dist/packages/project-model/lib/schema.js +38 -1
  162. package/dist/packages/project-model/preparation-entries.d.ts +11 -0
  163. package/dist/packages/project-model/preparation-entries.js +49 -0
  164. package/dist/packages/project-model/source-config.d.ts +11 -10
  165. package/dist/packages/project-model/source-config.js +83 -44
  166. package/dist/packages/project-model/source-folders.d.ts +5 -5
  167. package/dist/packages/project-model/source-folders.js +14 -14
  168. package/dist/packages/shared/filesystem.d.ts +7 -0
  169. package/dist/packages/shared/filesystem.js +97 -10
  170. package/dist/packages/testing/lib/schema.d.ts +12 -13
  171. package/dist/packages/testing/lib/schema.js +4 -5
  172. package/dist/packages/testing/readiness-check-run.d.ts +7 -7
  173. package/dist/packages/testing/readiness-check-run.js +46 -51
  174. package/dist/packages/testing/test-execution.js +6 -6
  175. package/dist/packages/testing/test-paths.js +4 -3
  176. package/dist/packages/testing/test-sandbox.d.ts +0 -1
  177. package/dist/packages/testing/test-sandbox.js +14 -30
  178. package/dist/packages/testing/test-targets.d.ts +1 -1
  179. package/dist/packages/testing/test-targets.js +6 -6
  180. package/dist/packages/testing/test.d.ts +1 -1
  181. package/dist/packages/testing/test.js +1 -1
  182. package/package.json +6 -26
  183. package/LICENSE +0 -183
  184. package/dist/cli/commands/compile-controller.d.ts +0 -17
  185. package/dist/cli/commands/compiled-flow.d.ts +0 -25
  186. package/dist/cli/commands/compiled-flow.js +0 -112
  187. package/dist/cli/commands/control-path.d.ts +0 -11
  188. package/dist/cli/commands/control-path.js +0 -72
  189. package/dist/cli/commands/create-method-wizard.d.ts +0 -76
  190. package/dist/cli/commands/create-method-wizard.js +0 -465
  191. package/dist/cli/commands/create.d.ts +0 -8
  192. package/dist/cli/commands/create.js +0 -189
  193. package/dist/cli/commands/default.d.ts +0 -2
  194. package/dist/cli/commands/default.js +0 -39
  195. package/dist/cli/commands/executor-flow.d.ts +0 -29
  196. package/dist/cli/commands/executor-flow.js +0 -163
  197. package/dist/cli/commands/init.d.ts +0 -11
  198. package/dist/cli/commands/init.js +0 -784
  199. package/dist/cli/commands/list.d.ts +0 -2
  200. package/dist/cli/commands/list.js +0 -30
  201. package/dist/cli/commands/preparation-selection.d.ts +0 -6
  202. package/dist/cli/commands/preparation-selection.js +0 -11
  203. package/dist/cli/commands/source-config-wizard.d.ts +0 -52
  204. package/dist/cli/commands/source-config-wizard.js +0 -680
  205. package/dist/cli/commands/test-flow.d.ts +0 -58
  206. package/dist/cli/commands/test-flow.js +0 -231
  207. package/dist/cli/commands/verify.d.ts +0 -2
  208. package/dist/cli/commands/verify.js +0 -94
  209. package/dist/compiler-ui/_next/static/chunks/0d~8t0zm6545p.js +0 -118
  210. package/dist/compiler-ui/_next/static/chunks/0xnel.ax9a.2c.css +0 -3
  211. package/dist/packages/compiler/raw-snapshot.d.ts +0 -49
  212. package/dist/packages/compiler/raw-snapshot.js +0 -101
  213. package/dist/packages/method-package/index.d.ts +0 -11
  214. package/dist/packages/method-package/index.js +0 -11
  215. package/dist/packages/method-package/method-stage-policy.d.ts +0 -5
  216. package/dist/packages/method-package/method-stage-policy.js +0 -31
  217. package/dist/packages/project-model/project-paths.d.ts +0 -12
  218. package/dist/packages/project-model/project-paths.js +0 -33
  219. /package/dist/compiler-ui/_next/static/{j7pdoqWrl4YJrJUVnksbl → C6vVfy3aeYuIO3d2AoNvC}/_buildManifest.js +0 -0
  220. /package/dist/compiler-ui/_next/static/{j7pdoqWrl4YJrJUVnksbl → C6vVfy3aeYuIO3d2AoNvC}/_clientMiddlewareManifest.js +0 -0
  221. /package/dist/compiler-ui/_next/static/{j7pdoqWrl4YJrJUVnksbl → C6vVfy3aeYuIO3d2AoNvC}/_ssgManifest.js +0 -0
  222. /package/dist/{cli/commands/check-draft.js → packages/local-service/readiness-check-draft.js} +0 -0
package/README.md CHANGED
@@ -6,53 +6,49 @@ Interf prepares data for agent work. It runs locally, processes your files, show
6
6
 
7
7
  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.
8
8
 
9
- Interf replaces that hidden discovery with a visible Preparation: a Source Folder, a Method for processing it, readiness checks, runs, and the portable context agents use. You choose the Source Folder and Interf Workspace, define what the agent work needs, choose or draft a Method, prepare the files, check readiness, and open the portable context. Interf runs the Method locally and writes the portable context: evidence, structure, and cross-file connections for agents.
9
+ 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.
10
10
 
11
11
  ```text
12
12
  Source Folder Portable context agents read
13
13
 
14
- bristol-office-market/ interf/bristol-office-market/
14
+ bristol-office-market/ ~/.interf/preparations/bristol/portable-context/
15
15
  q4-market-report.pdf AGENTS.md
16
- lease-comps.xlsx raw/
17
- planning-notes.md q4-market-report.pdf
18
- exports/availability.csv lease-comps.xlsx
19
- planning-notes.md
20
- exports/availability.csv
21
- home.md
22
- summaries/
23
- knowledge/
16
+ lease-comps.xlsx .interf/runtime/source-snapshot.json
17
+ planning-notes.md home.md
18
+ exports/availability.csv summaries/
19
+ knowledge/
24
20
  ```
25
21
 
26
- ## What a Preparation Produces
22
+ ## What a Method Run Produces
27
23
 
28
- A Preparation produces portable context plus proof of work. The portable context is the folder agents read. The proof shows which files Interf processed, which Method stages ran, what each stage wrote, and whether required outputs exist.
24
+ 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.
29
25
 
30
- For the built-in `interf-default` Method, a prepare run looks like this:
26
+ For the built-in `interf-default` Method, a compile run looks like this:
31
27
 
32
28
  ```text
33
- Preparation: bristol-office-market
29
+ Source Files: bristol-office-market
34
30
  Method: interf-default
35
31
 
36
- prepare run
37
- read Source Folder
32
+ compile run
33
+ record source references
38
34
  summarize -> summaries/
39
35
  structure -> knowledge/
40
36
  shape -> home.md and agent entrypoints
41
37
  record proof -> processed files, stage outputs, required artifacts
42
38
 
43
39
  output
44
- portable context -> interf/bristol-office-market/
40
+ portable context -> { kind: "local-path", value: "/Users/me/.interf/preparations/bristol/portable-context" }
45
41
  ```
46
42
 
47
43
  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.
48
44
 
49
45
  ## Design Choices
50
46
 
51
- - `Preparation-scoped`: every Preparation is for one specific job agents need to do, not a generic index over your Source Folder.
47
+ - `Method-scoped`: every Method is for one specific kind of agent work over source files, not a generic index over your Source Folder.
52
48
  - `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.
53
49
  - `Local-first and private`: your files, readiness checks, and agent runs stay on your machine. No cloud, no uploads, no telemetry.
54
50
  - `Bring your own AI`: use Claude Code, Codex, or another local agent.
55
- - `File over app`: the portable context is a local folder in the Interf Workspace — no hidden store, no hidden index. Inspect it, diff it, version it.
51
+ - `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.
56
52
  - `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.
57
53
 
58
54
  ## Why Not Just Ask Your Agent?
@@ -67,58 +63,68 @@ The agent can still do the processing. Interf shows what ran, which files were p
67
63
 
68
64
  ```bash
69
65
  npm install -g @interf/compiler
70
- interf # opens the setup wizard in the current folder
66
+ interf # opens the wizard once an instance is running
71
67
  ```
72
68
 
73
69
  Requires Node.js 20+ and a local coding agent such as Claude Code or Codex. Run `interf doctor --live` if the executor is not detected.
74
70
 
75
71
  ## Quick Start
76
72
 
77
- 1. Run `interf` from the Source Folder you want to prepare, or from a parent folder that contains it.
78
- 2. Choose the Source Folder and Interf Workspace.
79
- 3. Create a Preparation by describing what the agent should do with those files.
80
- 4. Choose or draft the Method: autogenerate one with your agent, use the built-in Method, or create your own.
81
- 5. Run `interf compile` to prepare files and build portable context.
82
- 6. Review or edit the readiness checks Interf will use to decide whether the portable context is `ready` or `not ready`.
83
- 7. Run `interf test` to check readiness.
84
- 8. If agents pass more checks with portable context, point your agent at `interf/<preparation>/`.
73
+ ```bash
74
+ interf web # terminal 1: start the local engine
75
+ interf prep create bristol \ # terminal 2: name the unit of work
76
+ --source ./bristol-office-market \
77
+ --method interf-default
78
+ interf compile bristol # build portable context, returns the locator
79
+ interf test bristol # check readiness
80
+ ```
85
81
 
86
- If you want a baseline before preparing, run `interf test --target source-files`. It is optional proof, not the main path.
82
+ `interf web` starts the engine in the foreground and writes
83
+ `~/.interf/connection.json` so subsequent CLI commands can connect. Mutating
84
+ commands never auto-start an engine — if no instance is connected, every
85
+ command exits with a hint pointing at `interf web` (local) or
86
+ `interf login` (future cloud).
87
87
 
88
- `interf init` sets up the local Interf Workspace, saves `interf/interf.json`, and copies the built-in Method to `interf/methods/interf-default/`. It does not create a Preparation until you choose to add one. The Method is stored as a Method package you can inspect, edit, or fork with `interf create method`.
88
+ `interf compile` returns the artifact locator on success for a local
89
+ engine that's a `local-path` you can open with any tool. Point your agent at
90
+ that path. There's no `--out` flag, no implicit copy, no hidden store: the
91
+ instance owns the bytes and the API tells you where they are.
92
+
93
+ If you want a baseline before preparing, run `interf test bristol --target source-files`. It is optional proof, not the main path.
89
94
 
90
95
  ## Portable Context
91
96
 
92
- `interf/<preparation>/` is the local folder Interf writes from your files. 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:
97
+ 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.
98
+
99
+ 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:
93
100
 
94
101
  ```text
95
- interf/bristol-office-market/
102
+ ~/.interf/preparations/bristol/portable-context/
96
103
  AGENTS.md # agent-facing entry point and source-checking rules
97
104
  CLAUDE.md # same guidance for Claude Code
98
- raw/ # same source files copied here
99
- q4-market-report.pdf
100
- lease-comps.xlsx
101
- planning-notes.md
102
- exports/availability.csv
105
+ .interf/
106
+ runtime/
107
+ source-snapshot.json # source references captured for the latest run
108
+ stages/ # per-stage source input lists
103
109
  home.md # overview and routes for agents
104
110
  summaries/ # one note per source file
105
111
  knowledge/ # linked notes built from the files
106
112
  ```
107
113
 
108
- The source files stay the source of truth. Interf writes portable context in the Interf Workspace; it does not modify the Source Folder.
114
+ 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.
109
115
 
110
- `AGENTS.md` tells agents how to use the portable context: start from the prepared outputs, follow the prepared routes, and verify against `raw/` when exact source evidence matters.
116
+ `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.
111
117
 
112
118
  Interf also records stage-by-stage proof of work: which files were processed, what each stage produced, and whether required outputs were created.
113
119
 
114
- The portable context is self-contained it carries its own `raw/` snapshot, so the evidence the agent works from stays attached to the result. Hand it to a different agent and the folder stands on its own.
120
+ 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.
115
121
 
116
122
  ## Methods
117
123
 
118
- 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 lives at `interf/methods/interf-default/`. Fork it with `interf create method` when you need a different Method, a different output, or both.
124
+ 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>`.
119
125
 
120
126
  ```text
121
- interf/methods/interf-default/
127
+ ~/.interf/methods/interf-default/
122
128
  method.json # Method: source data, stages, and processing rules
123
129
  method.schema.json # output contract: required portable-context files and folders
124
130
  README.md # what this Method is for, for humans and agents
@@ -142,44 +148,39 @@ A Method defines the stages, output contract, proof requirements, and improvemen
142
148
 
143
149
  ## Method Improvement
144
150
 
145
- When the first prepare run still misses readiness checks, Interf edits the Method itself and compiles again. Same files, same checks, different preparation.
151
+ 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.
146
152
 
147
- Interf saves every readiness-check run under `interf/<preparation>/.interf/tests/`. You can inspect what changed and why a later prepare run did better.
153
+ 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.
148
154
 
149
155
  ## How the Pieces Fit
150
156
 
151
- `interf/interf.json` stores the Source Folder binding and saved Preparations: readiness checks, selected Method, and defaults. A prepare run processes the Source Folder and writes portable context under `interf/<preparation>/`. `interf test` checks Source Folder files and portable context against the same readiness checks.
157
+ 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.
152
158
 
153
159
  Readiness is one `ready` / `not ready` status, not a separate score. Interf builds it from evidence primitives: stage/Method acceptance criteria, proof records, file coverage, artifact validation, and readiness checks.
154
160
 
155
- `interf web` starts the local Interf service and serves Interf Compiler UI. The UI reads local-service resources: Preparations, Methods, runs, stages, proof, artifacts, readiness checks, and whether portable context is `ready` or `not ready`. It renders local compiler state; it does not own compiler, Method, or readiness semantics.
161
+ `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.
156
162
 
157
- Maintainer package boundaries live in [src/packages/README.md](./src/packages/README.md).
163
+ ## CLI Connection
158
164
 
159
- ## interf/interf.json
160
-
161
- `interf/interf.json` is the main config file for the local Interf Workspace. It lives under `interf/` with Method packages, run state, snapshots, and portable-context outputs. By default, Interf stores that workspace outside the Source Folder so source files stay clean. It prefers the parent folder when the sibling `interf/` path is available and falls back to `~/.interf/<source-folder>` when that path is already occupied. `source_folder.path` records the Source Folder before any Preparation exists. Each `preparations[]` entry describes one Preparation: the source path, the saved readiness checks, the Method that prepares the portable context, and optional defaults.
165
+ The CLI is a thin authorized client of one connected instance. It carries one piece of state — `~/.interf/connection.json`:
162
166
 
163
167
  ```text
164
168
  {
165
- "source_folder": {
166
- "path": "./bristol-office-market"
167
- },
168
- "preparations": [
169
- {
170
- "name": "bristol-office-market",
171
- "path": "./bristol-office-market",
172
- "about": "Answer Bristol office-market questions from the report, comps, notes, and exports.",
173
- "method": "interf-default",
174
- "checks": [
175
- { "question": "...", "answer": "..." }
176
- ]
177
- }
178
- ]
169
+ "url": "http://127.0.0.1:4873",
170
+ "auth_token": null
179
171
  }
180
172
  ```
181
173
 
182
- The `method` field selects the Method for that Preparation. It points to a folder id under `interf/methods/`. Set it to `interf-default` (the built-in default) or to a Method you have authored. A different Method is different processing and a different output. Same files, different portable context.
174
+ `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.
175
+
176
+ If the connection is unreachable, every mutating command exits non-zero with:
177
+
178
+ ```text
179
+ Not connected to any Interf instance.
180
+ Start one with `interf web`, or set --url / `interf login` for a remote one.
181
+ ```
182
+
183
+ There is no auto-start. There is no per-folder pointer file. One mental model: client connects to instance, or doesn't.
183
184
 
184
185
  ## Readiness Checks
185
186
 
@@ -187,9 +188,9 @@ There are two checks in the system, and they answer different questions.
187
188
 
188
189
  Method acceptance criteria check the build: did the Method produce the files, folders, artifacts, and stage outputs it promised? Interf checks those while it compiles.
189
190
 
190
- Readiness checks check the Preparation: 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.
191
+ 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.
191
192
 
192
- In the setup flow, readiness checks often look like plain question-and-answer pairs. In `interf/interf.json`, they live under `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:
193
+ 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:
193
194
 
194
195
  - one exact number from a chart, table, or filing
195
196
  - one short statement that should be true or false
@@ -206,28 +207,25 @@ A maintained readiness example in this repo uses one market report, two readines
206
207
  | Claude Code (Claude Opus 4.6, max) | `0/2` | `2/2` |
207
208
  <!-- PUBLIC_BENCHMARK_TABLE:END -->
208
209
 
209
- 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 Preparation is `ready` for this agent work.
210
+ 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.
210
211
 
211
- A maintained public test example in this repo stores them like this:
212
+ A maintained public test example uses this preparation:
212
213
 
213
214
  <!-- PUBLIC_TEST_CHECKS:START -->
214
215
  ```text
215
216
  {
216
- "preparations": [
217
+ "id": "cbre-chart-sanity",
218
+ "source": { "kind": "local-folder", "locator": "./task-files" },
219
+ "method_id": "interf-default",
220
+ "about": "Bristol historical take-up and availability chart lookup.",
221
+ "checks": [
222
+ {
223
+ "question": "What were Bristol's annual take-up values in 2018 and 2016?",
224
+ "answer": "Around half a million sq ft in 2018, roughly 0.45 to 0.6 million sq ft, and about 0.7 to 0.8 million sq ft in 2016. These are approximate chart-derived reads."
225
+ },
217
226
  {
218
- "name": "cbre-chart-sanity",
219
- "path": "./task-files",
220
- "about": "Bristol historical take-up and availability chart lookup.",
221
- "checks": [
222
- {
223
- "question": "What were Bristol's annual take-up values in 2018 and 2016?",
224
- "answer": "Around half a million sq ft in 2018, roughly 0.45 to 0.6 million sq ft, and about 0.7 to 0.8 million sq ft in 2016. These are approximate chart-derived reads."
225
- },
226
- {
227
- "question": "What were Bristol's availability values in 2018 and 2016?",
228
- "answer": "About 0.55 to 0.6 million sq ft in 2018 and about 1.2 to 1.3 million sq ft in 2016. These are approximate chart-derived reads."
229
- }
230
- ]
227
+ "question": "What were Bristol's availability values in 2018 and 2016?",
228
+ "answer": "About 0.55 to 0.6 million sq ft in 2018 and about 1.2 to 1.3 million sq ft in 2016. These are approximate chart-derived reads."
231
229
  }
232
230
  ]
233
231
  }
@@ -236,28 +234,35 @@ A maintained public test example in this repo stores them like this:
236
234
 
237
235
  ## What Interf Is Not
238
236
 
239
- - Not a second brain or memory product. One local folder per agent job; nothing global.
237
+ - Not a second brain or memory product. One preparation per agent job; nothing global.
240
238
  - Not a vector store or RAG server. The portable context is plain files.
241
- - Not a hosted data platform. Interf runs locally and `interf/` is yours.
239
+ - Not a hosted data platform. The local instance runs on your machine; your bytes never leave it.
242
240
  - Not an agent harness. Interf prepares the data; your existing agent reads the portable context.
243
241
 
244
242
  ## Useful Commands
245
243
 
246
- - `interf` or `interf init` set up the Interf Workspace or manage Preparations
247
- - `interf web` — start Interf Compiler UI and the local API for this Workspace
248
- - `interf compile` build portable context agents can use
249
- - `interf test`run readiness checks against source files and/or portable context
250
- - `interf create method`draft a reusable Method
244
+ - `interf web` run the local engine in the foreground (Compiler UI + API)
245
+ - `interf web stop` — kill the running local engine
246
+ - `interf prep ls / create / show / rm` — manage preparations
247
+ - `interf compile <prep-id>` build portable context, returns the artifact locator
248
+ - `interf test <prep-id>`run readiness checks against source files and/or portable context
249
+ - `interf method ls / install / draft / improve` — manage Method packages
250
+ - `interf runs ls / status / watch / cancel / fetch` — inspect runs
251
+ - `interf login / logout` — manage `~/.interf/connection.json` (remote backend ships in a future release)
252
+ - `interf status` — show the active connection and a preparation summary
251
253
  - `interf doctor --live` — verify the local executor
252
254
 
253
255
  ## Maintainer Docs
254
256
 
257
+ - [src/README.md](./src/README.md) - source tree index
255
258
  - [src/packages/README.md](./src/packages/README.md) - package boundaries
256
259
  - [src/cli/README.md](./src/cli/README.md) - CLI orchestration
257
260
  - [apps/compiler-ui/README.md](./apps/compiler-ui/README.md) - Interf Compiler UI
258
261
  - [apps/compiler-ui/DESIGN.md](./apps/compiler-ui/DESIGN.md) - UI design source of truth
259
262
  - [scripts/README.md](./scripts/README.md) - maintainer automation
263
+ - [AGENTS.md](./AGENTS.md) / [CLAUDE.md](./CLAUDE.md) - maintainer compass + navigation index for agent sessions
260
264
 
261
265
  Contributors: see [CONTRIBUTING.md](./CONTRIBUTING.md).
262
266
 
263
- Code: Apache 2.0. Name and branding: see [TRADEMARKS.md](./TRADEMARKS.md).
267
+ Code: proprietary (this repo is private; the package is not published).
268
+ Name and branding: see [TRADEMARKS.md](./TRADEMARKS.md).
package/TRADEMARKS.md CHANGED
@@ -2,18 +2,7 @@
2
2
 
3
3
  `Interf`, the Interf word mark, and related logos are trademarks of Interf, Inc.
4
4
 
5
- This repository's code is available under the Apache 2.0 license in [LICENSE](./LICENSE). That license does not grant trademark rights.
6
-
7
- You may:
8
-
9
- - describe this project factually as a fork or derivative of Interf
10
- - state that your project is based on Interf or integrates with Interf
11
- - reproduce the name where required by the Apache 2.0 license for attribution
12
-
13
- You may not:
14
-
15
- - present your fork, hosted service, or product as the official Interf product
16
- - use the Interf name or logos in a way that implies endorsement by Interf, Inc.
17
- - ship a confusingly similar product name, branding, or visual identity
5
+ This repository is proprietary and currently private. The Interf marks are
6
+ not licensed for public use.
18
7
 
19
8
  If you need official brand usage permission, contact Interf, Inc.
@@ -1,55 +1,119 @@
1
1
  ---
2
2
  name: interf-actions
3
- description: Use when an agent needs to operate Interf from natural language: inspect the local Interf Workspace, propose safe CLI commands, run approved Interf commands, or prepare action proposals for Interf Compiler UI.
3
+ description: Use when an agent needs to operate Interf from natural language: connect to an instance, manage preparations, compile a Method against a Source Folder, propose safe CLI commands, or write action proposals for Interf Compiler UI.
4
4
  ---
5
5
 
6
6
  # Interf Actions
7
7
 
8
- Interf prepares data for agent work. It runs locally, processes source files, shows evidence that the data is ready, and writes portable context: a local folder with verifiable outputs agents can use.
8
+ Interf prepares data for agent work. It runs locally, processes source files, shows evidence that the data is ready, and writes portable context: a local folder agents can read from.
9
9
 
10
- Use the installed CLI as the source of truth. Outside Interf Compiler UI proposal mode, inspect the current command surface when needed:
10
+ The model in 0.13 is **instance + preparation**:
11
11
 
12
- ```sh
13
- interf --help
14
- interf list
15
- interf status
16
- interf doctor
17
- ```
12
+ - **Instance** = the engine (a local `interf web` process, or a future cloud endpoint). Owns all preparation state. Same wire shape both ends.
13
+ - **Method** = reusable recipe (`method.json` + stage docs). A package, no runtime state. Lives bundled with `@interf/compiler` or installed in the user library at `~/.interf/methods/<id>/`.
14
+ - **Preparation** = a unit of work — `id + source binding + method + readiness checks + run history`. The project-level identifier the agent names. Lives inside an instance.
15
+ - **Compile run** = one execution of a Preparation. Append-only. Produces portable context.
16
+
17
+ A **Source Folder** is the agent's input — files Interf scans by reference, not by copy. The agent's executor reads them; Interf never copies.
18
+
19
+ There is **no workspace concept** in 0.13. The CLI carries one piece of state: the active connection at `~/.interf/connection.json`.
20
+
21
+ ## Connection model
18
22
 
19
- For command-specific flags, run `interf <command> --help`.
23
+ The CLI is a thin authorized client of one connected instance. Every mutating command requires a reachable connection. If `~/.interf/connection.json` is missing or unreachable, the command exits non-zero with:
20
24
 
21
- In Interf Compiler UI proposal mode, do not run CLI commands. Use `references/cli.md` instead. It is a generated snapshot of the current Interf CLI help and is checked against the built package in the repo test suite.
25
+ ```text
26
+ Not connected to any Interf instance.
27
+ Start one with `interf web`, or set --url / `interf login` for a remote one.
28
+ ```
22
29
 
23
- ## Operating Rules
30
+ There is **no auto-start**. Agents must verify a connection exists before running mutating commands. To set up a connection:
24
31
 
25
- - Use exact Preparation ids from `interf list` or `interf/interf.json`.
26
- - Prefer the selected Preparation only when it is explicit or there is one obvious Preparation.
27
- - Do not invent readiness checks, Method ids, paths, or executor names.
28
- - If the local service is running, `interf compile` and `interf test` submit visible runs to Interf Compiler UI.
32
+ ```sh
33
+ interf web # local: starts the engine in the foreground (blocks)
34
+ interf login --url <…> # remote: writes connection.json
35
+ ```
36
+
37
+ ## Agent flow
38
+
39
+ 1. **Confirm a connection** — call `interf status` or `interf prep ls`. If they return `Not connected…`, ask the user to start an instance.
40
+ 2. **List or create a preparation** —
41
+ ```sh
42
+ interf prep ls # see what exists
43
+ interf prep create <id> --source <path> --method <method-id> # create one
44
+ ```
45
+ 3. **Compile** — preparation id is positional:
46
+ ```sh
47
+ interf compile <prep-id> [--watch] [--quiet] [--idempotency-key <key>]
48
+ ```
49
+ Default is async-return: prints `run id`, the artifact `locator`, and current readiness. With `--quiet`, only the locator is printed (suitable for `$(interf compile bristol --quiet)/home.md`). With `--watch`, the CLI tails events until the run reaches a terminal state.
50
+ 4. **Inspect runs** —
51
+ ```sh
52
+ interf runs status <run-id>
53
+ interf runs watch <run-id>
54
+ interf runs ls [--prep <id>]
55
+ interf runs fetch <run-id> --to <abs-path>
56
+ interf runs cancel <run-id>
57
+ ```
58
+ 5. **Read the portable context** — for a local engine the locator is a `local-path` you can open directly with any tool. For a remote engine it is a signed `remote-url`; `interf runs fetch` localizes it.
59
+ 6. **On `not ready`**, propose method improvement:
60
+ ```sh
61
+ interf method improve <prep-id>
62
+ ```
63
+
64
+ ## Agent contract — flags every CLI run uses
65
+
66
+ | Flag | What it controls | When the agent passes it |
67
+ |---|---|---|
68
+ | `--url <url>` | Override the active connection URL for one call. | When the user has multiple instances and wants to target a specific one without rewriting `~/.interf/connection.json`. |
69
+ | `--token <token>` | Override the active bearer token for one call. | Cloud / non-loopback connections only. |
70
+ | `--watch` | Block until the run finishes and tail stages. | Only when the agent must wait inline. Default is async return-with-id. |
71
+ | `--quiet` | Print only the artifact locator on success. | Scripting (`$(interf compile bristol --quiet)`). |
72
+ | `--idempotency-key <key>` | Sent as `X-Interf-Idempotency-Key`. The instance caches the key for an hour and returns the original run id on retries instead of starting a fresh run. | Whenever the agent might retry the same compile. |
73
+ | `--to <abs-path>` | (`interf runs fetch`) Absolute destination to copy portable context into. Must be empty or non-existent unless `--overwrite` is set. | When the agent needs portable context outside the instance. |
74
+ | `--overwrite` | (`interf runs fetch`) Allow copying into a destination that already has files. | Only when the agent wants to replace existing files. |
75
+
76
+ ## Operating rules
77
+
78
+ - Use exact preparation ids and Method ids returned by the API. Do not invent ids.
79
+ - Always confirm a connection exists before running mutating commands. Agents must not call `interf web` themselves — that command blocks the foreground; running it inside an agent loop hangs the loop.
80
+ - For long-running work, use the async default and check status by id (`interf runs status <id>`). Only use `--watch` when the agent must wait inline.
81
+ - Do not call the local HTTP API directly unless Interf explicitly gives an API-integration task. Use CLI commands for normal agent work.
29
82
  - Propose the command first and wait for approval before running commands that write files, start runs, create Method packages, build portable context, or run readiness checks.
30
- - If the request names an existing Preparation and asks to prepare, build, or refresh portable context, use `interf compile --preparation <name>`. The saved Preparation and selected Method are the source of truth.
31
83
  - If the request is ambiguous, ask one concise clarification instead of guessing.
32
84
 
33
- ## Interf Compiler UI Proposal Mode
85
+ ## Reading the artifact locator
34
86
 
35
- When Interf Compiler UI asks for a proposal, do not run CLI commands. Write a single JSON object to the requested output path.
87
+ `interf compile <prep-id>` prints a short multi-line block by default. The portable-context locator looks like one of:
88
+
89
+ ```text
90
+ Portable context: /Users/me/.interf/preparations/bristol/portable-context
91
+ ```
92
+
93
+ ```text
94
+ Portable context: https://api.interf.cloud/v1/runs/run_2x4abc.../portable-context
95
+ ```
96
+
97
+ For `local-path`, use the agent's filesystem tools to read the directory. For `remote-url`, use HTTP or `interf runs fetch <run-id> --to <path>`.
98
+
99
+ ## Interf Compiler UI freeform proposal mode
100
+
101
+ When Interf Compiler UI asks for a proposal, do not run CLI commands. Write a single JSON object to the requested output path. Structured UI controls call the local service directly; this mode is only for freeform planning.
36
102
 
37
103
  Use these action types:
38
104
 
39
- - `preparation-setup`
40
105
  - `compile`
41
106
  - `test`
42
107
  - `readiness-check-draft`
43
108
  - `method-authoring`
109
+ - `method-improvement`
44
110
  - `clarification`
45
111
 
46
- Use `preparation-setup` when no Preparation is saved yet or when the user asks to initialize/add a source folder. Set `values.path` to a visible source folder path such as `./Reports`, set `preparation` or `values.name` to the Preparation id, and set `values.about` to the agent work the source folder should support. CLI equivalent: `interf init` or `interf create preparation`.
47
-
48
- Use `compile` when the user asks to prepare, build, or refresh portable context for an existing Preparation. Do not ask what "prepare" means when the Preparation exists. Set `preparation` to the selected or mentioned Preparation id. CLI equivalent: `interf compile --preparation <name>`.
112
+ Use `compile` when the user asks to prepare, build, or refresh portable context. Set `method` to the Method id and, if the request named one, `preparation` to the preparation id. CLI equivalent: `interf compile --method`.
49
113
 
50
114
  For a readiness-check proposal, set `values.mode` to:
51
115
 
52
- - `raw` for source files only
116
+ - `source-files` for source files only
53
117
  - `compiled` for portable context only
54
118
  - `both` for source files and portable context
55
119
 
@@ -57,18 +121,19 @@ Return this shape:
57
121
 
58
122
  ```json
59
123
  {
60
- "action_type": "preparation-setup",
61
- "preparation": "preparation-id",
62
- "method": "method-id if applicable",
63
- "values": {
64
- "path": "./source-folder",
65
- "about": "agent work this source folder should support"
66
- },
124
+ "action_type": "compile",
125
+ "method": "method-id",
126
+ "preparation": "prep-id",
127
+ "values": { "mode": "both if applicable" },
67
128
  "title": "short approval card title",
68
129
  "summary": "one sentence describing what will run",
69
130
  "assistant_message": "concise explanation for the user",
70
- "command_preview": "interf init # source: ./source-folder"
131
+ "command_preview": "interf compile --method method-id"
71
132
  }
72
133
  ```
73
134
 
74
135
  Use `clarification` only when the request cannot be mapped safely to one Interf action.
136
+
137
+ ## Reference
138
+
139
+ For the full CLI surface and per-command flags, see [`references/cli.md`](./references/cli.md). It is a generated snapshot of `interf <command> --help` and is checked against the built package in the repo test suite. The installed `interf` command remains the source of truth when available.