@interf/compiler 0.5.1 → 0.6.1

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 (93) hide show
  1. package/README.md +126 -187
  2. package/builtin-workflows/interf/README.md +22 -10
  3. package/builtin-workflows/interf/compile/stages/shape/SKILL.md +6 -3
  4. package/builtin-workflows/interf/compile/stages/structure/SKILL.md +3 -0
  5. package/builtin-workflows/interf/compile/stages/summarize/SKILL.md +18 -2
  6. package/builtin-workflows/interf/improve/SKILL.md +2 -2
  7. package/builtin-workflows/interf/workflow.json +18 -4
  8. package/builtin-workflows/interf/{compiled.schema.json → workflow.schema.json} +9 -2
  9. package/dist/commands/check-draft.js +3 -3
  10. package/dist/commands/compile-controller.js +6 -13
  11. package/dist/commands/compile.d.ts +19 -1
  12. package/dist/commands/compile.js +98 -28
  13. package/dist/commands/create-workflow-wizard.d.ts +20 -2
  14. package/dist/commands/create-workflow-wizard.js +163 -27
  15. package/dist/commands/create.d.ts +1 -1
  16. package/dist/commands/create.js +67 -60
  17. package/dist/commands/dataset-selection.d.ts +6 -0
  18. package/dist/commands/dataset-selection.js +11 -0
  19. package/dist/commands/default.js +3 -3
  20. package/dist/commands/doctor.js +8 -8
  21. package/dist/commands/executor-flow.d.ts +1 -1
  22. package/dist/commands/executor-flow.js +5 -2
  23. package/dist/commands/init.d.ts +5 -0
  24. package/dist/commands/init.js +56 -48
  25. package/dist/commands/list.js +6 -3
  26. package/dist/commands/reset.js +1 -1
  27. package/dist/commands/source-config-wizard.d.ts +2 -2
  28. package/dist/commands/source-config-wizard.js +50 -17
  29. package/dist/commands/test.d.ts +0 -6
  30. package/dist/commands/test.js +9 -17
  31. package/dist/index.d.ts +1 -1
  32. package/dist/index.js +1 -1
  33. package/dist/lib/agent-args.d.ts +1 -0
  34. package/dist/lib/agent-args.js +10 -0
  35. package/dist/lib/agent-execution.js +2 -1
  36. package/dist/lib/agent-preflight.js +2 -1
  37. package/dist/lib/agent-shells.d.ts +26 -1
  38. package/dist/lib/agent-shells.js +213 -39
  39. package/dist/lib/agents.d.ts +1 -1
  40. package/dist/lib/agents.js +1 -1
  41. package/dist/lib/builtin-compiled-workflow.d.ts +6 -97
  42. package/dist/lib/builtin-compiled-workflow.js +66 -125
  43. package/dist/lib/compiled-compile.d.ts +0 -4
  44. package/dist/lib/compiled-compile.js +9 -28
  45. package/dist/lib/compiled-paths.d.ts +1 -0
  46. package/dist/lib/compiled-paths.js +3 -0
  47. package/dist/lib/compiled-reset.d.ts +1 -0
  48. package/dist/lib/compiled-reset.js +42 -14
  49. package/dist/lib/compiled-schema.d.ts +9 -5
  50. package/dist/lib/compiled-schema.js +45 -14
  51. package/dist/lib/discovery.d.ts +1 -1
  52. package/dist/lib/discovery.js +2 -2
  53. package/dist/lib/executors.d.ts +1 -1
  54. package/dist/lib/executors.js +2 -2
  55. package/dist/lib/interf-scaffold.js +4 -11
  56. package/dist/lib/interf-workflow-package.d.ts +8 -3
  57. package/dist/lib/interf-workflow-package.js +128 -62
  58. package/dist/lib/local-workflows.d.ts +4 -3
  59. package/dist/lib/local-workflows.js +126 -103
  60. package/dist/lib/runtime-acceptance.js +15 -3
  61. package/dist/lib/runtime-contracts.js +3 -2
  62. package/dist/lib/runtime-paths.d.ts +1 -0
  63. package/dist/lib/runtime-paths.js +4 -1
  64. package/dist/lib/runtime-prompt.js +3 -1
  65. package/dist/lib/runtime-reconcile.js +88 -51
  66. package/dist/lib/runtime-runs.js +27 -15
  67. package/dist/lib/runtime.d.ts +1 -1
  68. package/dist/lib/runtime.js +1 -1
  69. package/dist/lib/schema.d.ts +71 -14
  70. package/dist/lib/schema.js +15 -12
  71. package/dist/lib/state-view.js +6 -6
  72. package/dist/lib/state.d.ts +1 -0
  73. package/dist/lib/state.js +7 -0
  74. package/dist/lib/test-execution.js +2 -2
  75. package/dist/lib/validate-compiled.js +9 -6
  76. package/dist/lib/validate.d.ts +3 -1
  77. package/dist/lib/validate.js +4 -11
  78. package/dist/lib/workflow-authoring.d.ts +26 -0
  79. package/dist/lib/workflow-authoring.js +119 -0
  80. package/dist/lib/workflow-definitions.d.ts +11 -1
  81. package/dist/lib/workflow-definitions.js +12 -15
  82. package/dist/lib/workflow-edit-session.d.ts +16 -0
  83. package/dist/lib/workflow-edit-session.js +57 -0
  84. package/dist/lib/workflow-edit-utils.d.ts +10 -0
  85. package/dist/lib/workflow-edit-utils.js +39 -0
  86. package/dist/lib/workflow-improvement.js +30 -217
  87. package/dist/lib/workflow-stage-policy.d.ts +5 -0
  88. package/dist/lib/workflow-stage-policy.js +31 -0
  89. package/package.json +4 -5
  90. package/dist/lib/obsidian.d.ts +0 -1
  91. package/dist/lib/obsidian.js +0 -15
  92. package/dist/lib/summarize-plan.d.ts +0 -17
  93. package/dist/lib/summarize-plan.js +0 -120
package/README.md CHANGED
@@ -1,70 +1,71 @@
1
- # Interf Compiler
1
+ # Interf
2
2
 
3
- Prepare local datasets for accurate agent use.
3
+ Interf helps make data ready for agent work.
4
4
 
5
- Interf Compiler runs a local data-processing workflow over your dataset to build a file-based layer on top of your raw files that gives agents the full picture they need to answer questions accurately.
5
+ Measure how well your agent can answer the questions your task depends on. If raw files are not enough, Interf can prepare a compiled dataset and test it again on the same saved checks.
6
6
 
7
- Define truth checks for your dataset, measure a baseline on the raw files, then compile and retest the compiled dataset on the same checks.
7
+ Start with checks. Give Interf the files behind a task and a few saved checks. It shows how well local agents do on the raw files first, so you can see what already works and which agent performs best.
8
8
 
9
- If it still fails, self-improving loops can revise the workflow, rebuild the compiled dataset, and rerun the same checks until it passes or reaches the loop limit.
9
+ The compiled dataset is a real folder your agent can open and work from. If the first workflow still fails, Interf can retry the same workflow variation or edit the workflow across self-improving loops within the configured budgets and test each new variation on the same saved checks.
10
10
 
11
- ## Why Use It
11
+ Interf runs local workflows that prepare and structure the files for the task before your agent uses them.
12
12
 
13
- Interf Compiler is built around a few simple principles:
13
+ A recent run in this repo on the CBRE chart sanity dataset produced:
14
14
 
15
- - `Explicit`: the compiled dataset is a real folder you can inspect, review, and version.
16
- - `Yours`: the dataset, workflow, compiled dataset, and test runs stay on your machine and in your control.
17
- - `File over app`: the compiled dataset is normal files and folders, not hidden app state.
18
- - `Source-backed`: your raw files stay the source of truth; the compiled dataset is a layer on top, not a replacement database.
19
- - `Bring your own agent`: the same compiled dataset can be used with different local agents and tools.
20
- - `Self-improving`: when truth checks fail, Interf can retry the workflow or revise it, rebuild the compiled dataset, and rerun the same checks.
15
+ <!-- PUBLIC_BENCHMARK_TABLE:START -->
16
+ | Agent | Files as-is | Compiled dataset |
17
+ | --- | --- | --- |
18
+ | Codex (GPT-5.4, xhigh) | `2/2` | `2/2` |
19
+ | Claude Code (Claude Opus 4.6, max) | `0/2` | `2/2` |
20
+ <!-- PUBLIC_BENCHMARK_TABLE:END -->
21
21
 
22
- ## Example: Truth Checks
22
+ Same task. Same saved checks. Same local setup.
23
23
 
24
- Truth checks are just question-and-answer pairs you already know how to verify from the dataset.
24
+ ## Why It Exists
25
25
 
26
- A maintained public test run in this repo uses checks like this:
26
+ Local agents do well when the working surface is already shaped for the job. Raw task data usually is not. Reports, decks, transcripts, exports, PDFs, notes, and mixed folders are all technically available, but they are not prepared in a way that makes local agent work reliable.
27
27
 
28
- <!-- PUBLIC_TEST_CHECKS:START -->
29
- ```jsonc
30
- {
31
- "datasets": [
32
- {
33
- "name": "cbre-chart-sanity",
34
- "about": "Bristol historical take-up and availability chart lookup.",
35
- "checks": [
36
- {
37
- "question": "What were Bristol's annual take-up values in 2018 and 2016?",
38
- "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."
39
- },
40
- {
41
- "question": "What were Bristol's availability values in 2018 and 2016?",
42
- "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."
43
- }
44
- ]
45
- }
46
- ]
47
- }
48
- ```
49
- <!-- PUBLIC_TEST_CHECKS:END -->
28
+ Interf keeps the loop honest:
50
29
 
51
- ## Example: `interf test`
30
+ - `Measure first`: test files as-is on saved truth checks before claiming improvement.
31
+ - `One output`: keep one compiled dataset your agent can use directly.
32
+ - `File-native`: the compiled dataset is a real folder you can inspect, diff, review, and version.
33
+ - `Source-backed`: raw files remain the source of truth.
34
+ - `Bring your own agent`: use Claude Code, Codex, or another local agent on the same compiled dataset.
35
+ - `Self-improving`: when truth checks fail, Interf can inspect the failed run, edit the workflow, and retest new workflow variations on the same checks. Retries keep the same workflow variation; loops change the workflow itself.
52
36
 
53
- `interf test` compares files as-is and the compiled dataset on the same saved truth checks.
54
- That is the point of `interf test`: measure the same checks on both sides and keep the result honest on your own dataset, instead of relying on a frozen benchmark snapshot in the docs.
37
+ ## What You Get
55
38
 
56
- A recent maintained internal run on the CBRE chart sanity dataset produced:
39
+ A project using one dataset stays simple:
57
40
 
58
- <!-- PUBLIC_BENCHMARK_TABLE:START -->
59
- | Agent | Files as-is | Compiled dataset |
60
- | --- | --- | --- |
61
- | Codex (GPT-5.4, xhigh) | `2/2` | `2/2` |
62
- | Claude Code (Claude Opus 4.6, max) | `0/2` | `2/2` |
63
- <!-- PUBLIC_BENCHMARK_TABLE:END -->
41
+ ```text
42
+ your-task-folder/
43
+ report.pdf
44
+ notes.md
45
+ exports/
46
+ interf.json
47
+ interf/
48
+ <dataset>/
49
+ tests/
50
+ <dataset>/
51
+ ```
64
52
 
65
- Use `interf test` on your own dataset to measure files as-is versus the compiled dataset on the same checks.
53
+ A compiled dataset looks like:
66
54
 
67
- Each dataset keeps one latest comparison under `interf/tests/<dataset>/latest.json`. Target-specific runs stay under `interf/tests/<dataset>/file-as-is/runs/` and `interf/tests/<dataset>/compiled/runs/`.
55
+ ```text
56
+ interf/<dataset>/
57
+ AGENTS.md
58
+ CLAUDE.md
59
+ raw/
60
+ <workflow-declared compiled outputs>
61
+ .interf/
62
+ interf.json
63
+ workflow/
64
+ runtime/
65
+ tests/
66
+ ```
67
+
68
+ The compiled dataset is the folder your agent should work from.
68
69
 
69
70
  ## Quick Start
70
71
 
@@ -79,10 +80,10 @@ Install:
79
80
  npm install -g @interf/compiler
80
81
  ```
81
82
 
82
- Start from a project folder that contains one or more dataset folders:
83
+ Start from a folder that already contains the files for the task:
83
84
 
84
85
  ```bash
85
- cd ~/my-interf-project
86
+ cd ~/my-task-folder
86
87
  interf
87
88
  interf test
88
89
  interf compile
@@ -92,41 +93,20 @@ interf test
92
93
  The first run can:
93
94
 
94
95
  - draft `interf.json`
95
- - auto-create a draft set of truth checks for a dataset folder, or let you add them manually
96
- - test your files as-is first on those same checks
96
+ - help you create truth checks for the task, or let you add them manually
97
+ - run a files-as-is baseline on those checks
97
98
  - build the compiled dataset
98
- - test the compiled dataset on the same truth checks
99
-
100
- ## What Interf Compiler Creates
101
-
102
- After setup, the project root stays simple:
99
+ - let you test the compiled dataset on the same checks
103
100
 
104
- - `interf.json` at the root holds your saved dataset entries and truth checks
105
- - `interf/` is created only when Interf has artifacts to save
106
- - `interf/<dataset>/` is the compiled dataset
107
- - `interf/tests/<dataset>/` is the saved comparison history for that dataset
101
+ If Interf cannot find your local executor setup, run:
108
102
 
109
- A compiled dataset is a folder on top of your dataset. It includes:
110
-
111
- - a local `raw/` snapshot for direct evidence and verification
112
- - agent-readable summaries and cross-file notes
113
- - `AGENTS.md`, `CLAUDE.md`, and generated local query skills
114
- - workflow, test, and runtime state under `.interf/`
115
-
116
- The compiled dataset is the folder your agent should work from.
117
-
118
- ## How It Works
119
-
120
- 1. Save a few truth checks for a dataset in `interf.json`.
121
- 2. Optionally test the files as-is for a baseline.
122
- 3. Build the compiled dataset for that dataset.
123
- 4. Test the compiled dataset on the same truth checks.
124
- 5. Optionally let Interf retry or improve the workflow until it passes or hits the configured limit.
103
+ ```bash
104
+ interf doctor --live
105
+ ```
125
106
 
126
- Truth checks are simple:
107
+ ## Truth Checks
127
108
 
128
- - one question
129
- - one expected answer
109
+ Truth checks are just question-and-answer pairs you already know how to verify from the files behind the task.
130
110
 
131
111
  Good first truth checks are small and practical:
132
112
 
@@ -134,51 +114,75 @@ Good first truth checks are small and practical:
134
114
  - one short statement that should be true or false
135
115
  - one simple comparison across years, files, or sections
136
116
 
137
- If `interf.json` is missing, `interf` or `interf init` can draft it with you before the first compile. If the compiler cannot find your local agent or compile setup, run:
117
+ A maintained public test run in this repo uses checks like this:
138
118
 
139
- ```bash
140
- interf doctor
119
+ <!-- PUBLIC_TEST_CHECKS:START -->
120
+ ```jsonc
121
+ {
122
+ "datasets": [
123
+ {
124
+ "name": "cbre-chart-sanity",
125
+ "about": "Bristol historical take-up and availability chart lookup.",
126
+ "checks": [
127
+ {
128
+ "question": "What were Bristol's annual take-up values in 2018 and 2016?",
129
+ "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."
130
+ },
131
+ {
132
+ "question": "What were Bristol's availability values in 2018 and 2016?",
133
+ "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."
134
+ }
135
+ ]
136
+ }
137
+ ]
138
+ }
141
139
  ```
140
+ <!-- PUBLIC_TEST_CHECKS:END -->
141
+
142
+ ## What `interf test` Proves
143
+
144
+ `interf test` compares files as-is and the compiled dataset on the same saved truth checks.
142
145
 
143
- ## What `interf test` Does
146
+ That comparison is the product record:
144
147
 
145
- By default, if a compiled dataset exists, it runs both sides and saves one latest comparison under `interf/tests/<dataset>/latest.json`.
148
+ - same task
149
+ - same saved checks
150
+ - same local agent setup
151
+ - raw files on one side
152
+ - compiled dataset on the other
146
153
 
147
- You can also select one or more detected local agents in the CLI and compare them in one table.
154
+ Use `interf test` on your own files instead of trusting a frozen benchmark snapshot in the docs.
148
155
 
149
- For live runs:
156
+ Interf saves the latest comparison plus detailed raw and compiled runs under `interf/tests/` in the same folder.
150
157
 
151
- - files-as-is tests execute from a sanitized raw-only shell built from the selected dataset folder
152
- - compiled-dataset tests execute from a copied compiled sandbox with embedded sanitized `raw/`
153
- - both sides use the same saved truth checks from `interf.json`
154
- - neither sandbox includes the project control plane
155
- - detailed dataset-visible runs are kept under `interf/tests/<dataset>/file-as-is/runs/` and `interf/tests/<dataset>/compiled/runs/`
156
- - local detailed target runs and preserved sandboxes stay under `.interf/tests/targets/`
157
- - failed test sandboxes are kept automatically
158
- - `interf test --keep-sandboxes` keeps every sandbox, even successful ones
158
+ ## The Core Loop
159
159
 
160
- From inside a compiled dataset, `interf test` uses that dataset's `.interf/interf.json` directly. From the project root, `interf.json` bootstraps dataset selection and the same saved truth checks are mirrored into the compiled dataset runtime contract.
160
+ 1. Save a few truth checks for the task in `interf.json`.
161
+ 2. Optionally run `interf test` to measure files as-is first.
162
+ 3. Run `interf compile` to build the compiled dataset.
163
+ 4. Run `interf test` again on the same saved checks.
164
+ 5. If loops are enabled, let Interf retry the same workflow variation or edit the workflow and test the new variation.
161
165
 
162
- Maintainers can use the internal repeated-test matrix runner in [docs/test-matrix.md](./docs/test-matrix.md) for controlled workflow or model comparisons. Normal users should stay on `interf test`.
166
+ The project root owns dataset setup and saved truth checks. The compiled dataset carries the local runtime copy needed for repeat runs.
163
167
 
164
- ## Advanced: Multiple Datasets
168
+ ## Workflows
165
169
 
166
- Most projects only need one dataset entry.
170
+ A workflow tells Interf how to prepare the files for this task.
167
171
 
168
- Add another only when you want a different dataset folder, focus, or set of truth checks, for example:
172
+ Interf ships with a built-in `interf` workflow for the common case. If you need a different method, create one locally:
173
+
174
+ ```bash
175
+ interf create workflow
176
+ ```
169
177
 
170
- - general folder understanding
171
- - finance reporting
172
- - board prep
173
- - diligence review
178
+ Workflow creation supports two paths:
174
179
 
175
- Why add another:
180
+ - draft a workflow from the current project with a local agent
181
+ - copy an existing workflow and edit stage guidance directly
176
182
 
177
- - it keeps a separate set of truth checks
178
- - it gives that dataset its own compiled output under `interf/<dataset>/`
179
- - it lets you test that dataset separately
183
+ After assignment, compile the dataset and run `interf test` on the same truth checks.
180
184
 
181
- ## Advanced: Compile Loops
185
+ ## Compile Loops
182
186
 
183
187
  `max_attempts` is a retry budget for the same workflow variation.
184
188
 
@@ -189,7 +193,7 @@ Retries keep the target fixed:
189
193
  - same truth checks
190
194
  - same measurement
191
195
 
192
- `max_loops` enables the self-improving workflow loop in the normal `interf compile` path.
196
+ `max_loops` enables self-improving workflow edits in the normal `interf compile` path.
193
197
 
194
198
  In that loop, the thing that changes is the workflow itself.
195
199
 
@@ -197,43 +201,11 @@ Each loop can:
197
201
 
198
202
  - run the current workflow variation on the dataset
199
203
  - test it on the same truth checks
200
- - inspect the failed traces, preserved stage shells, and test artifacts
201
- - review the workflow and stage docs
202
- - create a new workflow variation for that dataset
203
- - test the new variation on the same truth checks
204
-
205
- - `max_attempts` retries the same workflow variation
206
- - a self-improving loop creates and tests workflow variations
207
-
208
- The workflow is the right surface for that kind of improvement because it is:
209
-
210
- - the reusable artifact
211
- - the human-reviewable method
212
- - the thing a future workflow-editing agent should inspect and change
204
+ - inspect failed traces, preserved stage shells, and test artifacts
205
+ - edit the workflow
206
+ - build and test the next workflow variation
213
207
 
214
- Interf Compiler preserves the workflow-improvement shell, the workflow-before / workflow-after snapshots, the failed stage shells, and the saved test runs from each loop so you can inspect exactly what the loop reviewed and changed.
215
-
216
- Example `interf.json`:
217
-
218
- ```jsonc
219
- {
220
- "datasets": [
221
- {
222
- "name": "cbre-chart-sanity",
223
- "max_attempts": 3, // retry compile + test for the same workflow until this dataset passes or hits this limit
224
- "max_loops": 2, // workflow-editing loops after retries fail
225
- "checks": [
226
- {
227
- "question": "What were Bristol's annual take-up values in 2018 and 2016?",
228
- "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."
229
- }
230
- ]
231
- }
232
- ]
233
- }
234
- ```
235
-
236
- Use the normal retry and loop controls first. Maintainers can use the internal repeated-test runner when they want controlled comparisons across workflows, compile profiles, or models.
208
+ Interf preserves workflow-improvement shells, workflow-before / workflow-after snapshots, failed stage shells, and saved test runs from each loop so you can inspect exactly what changed.
237
209
 
238
210
  ## Use It With Your Agent
239
211
 
@@ -242,54 +214,21 @@ If you already work through a local coding agent, it can run this process for yo
242
214
  Paste something like this into your agent:
243
215
 
244
216
  ```text
245
- Install @interf/compiler, run `interf` in this folder, and use the local agent executor.
217
+ Install `@interf/compiler`, run `interf` in this folder, and use the local agent executor.
246
218
 
247
- If `interf.json` is missing, draft one dataset entry with a few truth checks this agent should be able to answer from the selected dataset and add the expected answers for me to confirm.
219
+ If `interf.json` is missing, draft one dataset entry for this task with a few truth checks this agent should be able to answer from the selected files and add the expected answers for me to confirm.
248
220
 
249
221
  Then run a files-as-is baseline if helpful, compile the dataset, and run `interf test`.
250
222
 
251
223
  Tell me whether the compiled dataset passes the truth checks, and only recommend it if it does.
252
224
  ```
253
225
 
254
- ## Custom Workflows
255
-
256
- Interf Compiler ships with a default workflow.
257
-
258
- The built-in `interf` workflow runs three stages:
259
-
260
- 1. `summarize`
261
- 2. `structure`
262
- 3. `shape`
263
-
264
- If you want to change how the workflow runs on your dataset, this is the part you customize:
265
-
266
- ```bash
267
- interf create workflow
268
- interf verify workflow --path <path>
269
- ```
270
-
271
- Then test that workflow on the same dataset and the same truth checks.
272
-
273
- Workflow docs live in [docs/workflow-spec.md](./docs/workflow-spec.md).
274
-
275
- ## Core Commands
276
-
277
- - `interf` = open the project-root wizard
278
- - `interf init` = alias for the project-root wizard
279
- - `interf create dataset` = add another dataset entry when you need one
280
- - `interf create workflow` = create a reusable local seed workflow
281
- - `interf compile` = build a selected compiled dataset for the current project
282
- - `interf test` = compare files as-is and a compiled dataset on saved truth checks
283
- - `interf doctor` = check local executor setup
284
- - `interf verify <check>` = run deterministic checks on major workflow steps
285
- - `interf reset <scope>` = remove generated state while keeping source files
286
-
287
226
  ## More Docs
288
227
 
289
- - [docs/workflow-spec.md](./docs/workflow-spec.md) for custom workflows
290
- - [docs/runtime-contract.md](./docs/runtime-contract.md) for the exact on-disk contract
291
- - [docs/architecture.md](./docs/architecture.md) for the deeper system model
292
- - [docs/test-matrix.md](./docs/test-matrix.md) for the internal repeated-test matrix runner used in maintainer model/workflow comparisons
228
+ - [docs/architecture.md](./docs/architecture.md) for the short system map
229
+ - [docs/interf-primitives.md](./docs/interf-primitives.md) for runtime and workflow concepts
230
+ - [docs/workflow-spec.md](./docs/workflow-spec.md) for the workflow model
231
+ - [docs/runtime-contract.md](./docs/runtime-contract.md) for the runtime execution ABI
293
232
 
294
233
  Maintainers should use [CONTRIBUTING.md](./CONTRIBUTING.md) for test and release gates.
295
234
 
@@ -1,19 +1,31 @@
1
- # Interf Compiler (Recommended)
1
+ # Interf (Built-in Workflow)
2
2
 
3
- Interf Compiler's default methodology: summarize source-grounded evidence, structure the cross-file layer, then shape the final compiled dataset around its focus and saved truth checks.
3
+ Interf's built-in workflow: summarize source-grounded evidence, structure the cross-file layer, then shape the final compiled dataset around its task focus and saved truth checks.
4
4
 
5
- ## Package
5
+ ## Purpose
6
6
 
7
- - `workflow.json` = stage graph, compiler API target, and compile contract mapping
8
- - `compiled.schema.json` = deterministic compiled-dataset output shape
9
- - `improve/`, `compile/stages/`, and `use/query/` = human-readable authoring docs
10
- - Portable workflow packages are standalone: explicit stages, schema, and docs live together in this folder
11
- - Interf Compiler projects native agent shells from these docs for query use, stage execution, and workflow-improvement loops
7
+ - General agent-ready dataset preparation
8
+ - Prepare mixed raw files into evidence-backed summaries, cross-file structure, and a usable entrypoint for agents answering the questions this task depends on.
9
+
10
+ ## Zones
11
+
12
+ - `raw` — input directory at `raw`
13
+ - `summaries` — working directory at `summaries`
14
+ - `knowledge-entities` — output directory at `knowledge/entities`
15
+ - `knowledge-claims` — output directory at `knowledge/claims`
16
+ - `knowledge-indexes` — output directory at `knowledge/indexes`
17
+ - `home` — output file at `home.md` used as the primary entrypoint for this workflow
18
+ - `runtime` — runtime zone at `.interf/runtime`
12
19
 
13
20
  ## Stages
14
21
 
15
22
  - `summarize` — Turn source files into per-file summaries. (compiled-file-evidence; reads: raw, runtime; writes: summaries)
16
23
  - `structure` — Build the cross-file knowledge structure from the summaries. (compiled-knowledge-structure; reads: summaries, runtime; writes: knowledge-entities, knowledge-claims, knowledge-indexes)
17
- - `shape` — Shape the final compiled dataset around the saved focus and truth checks. (compiled-query-shape; reads: raw, summaries, knowledge-entities, knowledge-claims, knowledge-indexes, runtime; writes: knowledge-indexes, home)
24
+ - `shape` — Shape the final compiled dataset around the saved task focus and truth checks. (compiled-query-shape; reads: raw, summaries, knowledge-entities, knowledge-claims, knowledge-indexes, runtime; writes: knowledge-indexes, home)
25
+
26
+ ## Why `home.md` exists here
27
+
28
+ This built-in workflow creates `home.md` as the main agent entrypoint for the compiled dataset.
29
+ That is behavior of the `interf` workflow, not a compiler-wide rule.
18
30
 
19
- This package is the built-in seed for `interf`. Interf Compiler copies or materializes it into `.interf/workflow/` and runs that local package directly.
31
+ This package is the built-in seed for `interf`.
@@ -1,13 +1,16 @@
1
1
  # Shape
2
2
 
3
- Shape the final compiled dataset around the saved focus and truth checks.
3
+ Shape the final compiled dataset around the saved task focus and truth checks.
4
4
 
5
5
  Contract type: `compiled-query-shape`
6
6
 
7
7
  ## Requirements
8
8
 
9
- - Use the compiled focus plus saved truth-check question text to shape `home.md` and retrieval routes.
9
+ - Use the compiled task focus plus saved truth-check question text to shape `home.md` and retrieval routes.
10
10
  - Rewrite `home.md` into a real entrypoint note. Do not leave the scaffold `Not yet compiled.` placeholder in place.
11
+ - When you add wikilinks, target real compiled notes by exact basename or explicit relative path.
12
+ - If you introduce a new note name in `home.md` or another shaped output, the same stage must also create that note file.
13
+ - Prefer direct file-reading and search tools over shell commands for routine file inspection.
11
14
  - When a chart-derived value is approximate, use a bounded range instead of a pseudo-exact number.
12
15
  - Match the granularity of the visible axis labels or bands. Do not invent finer precision than the chart supports.
13
16
  - Keep the answer inside the visible tick band unless the chart supports a tighter bound.
@@ -19,7 +22,7 @@ Contract type: `compiled-query-shape`
19
22
 
20
23
  ## Notes
21
24
 
22
- - Use the dataset focus and saved truth checks to bias the final compiled dataset toward the job it should be especially good at.
25
+ - Use the saved task focus and truth checks to bias the final compiled dataset toward the job it should be especially good at.
23
26
  - Do not copy expected answers into the final compiled dataset just because the checks imply them.
24
27
  - Prefer the saved summary evidence and structured notes when they already preserve the bounded chart/table reads plus provenance you need.
25
28
  - Reopen `raw/` during shaping only when the compiled layer is missing the needed value, the metric family is ambiguous, or the earlier bounded read is clearly inconsistent.
@@ -8,6 +8,8 @@ Contract type: `compiled-knowledge-structure`
8
8
 
9
9
  - Treat the knowledge layer as retrieval structure, not final truth.
10
10
  - Prefer durable entity, claim, and index notes over one giant catch-all file.
11
+ - Keep structure-stage links stage-local: prefer linking only to summaries or knowledge notes that are already meaningful by the end of this stage. Avoid relying on `home.md` or other shape-stage routes as the main navigation surface.
12
+ - Prefer direct file-reading and search tools over shell commands for routine file inspection.
11
13
 
12
14
  ## Notes
13
15
 
@@ -15,4 +17,5 @@ Contract type: `compiled-knowledge-structure`
15
17
  - Use taxonomy and ontology only as means to improve retrieval, navigation, and evidence tracking.
16
18
  - For small datasets, prefer a minimal stable substrate over exhaustive graph sprawl.
17
19
  - When you add wikilinks, target real compiled notes by exact basename or explicit relative path. Do not invent title-style links unless that exact title is also a declared note label or alias.
20
+ - Do not add wikilinks in structure outputs to files that the shape stage creates later. If a route belongs in `home.md` or a later shaped note, leave plain text now and let the later stage add the link.
18
21
  - For summary references, prefer explicit links like `[[summaries/<file-stem>]]` or plain code paths. For knowledge notes, prefer the final filename stem under `knowledge/`.
@@ -6,8 +6,24 @@ Contract type: `compiled-file-evidence`
6
6
 
7
7
  ## Requirements
8
8
 
9
- - Each summary must use JSON frontmatter and include `source`, `source_kind`, `evidence_tier`, `truth_mode`, `state`, and a non-empty `abstract`.
10
- - Include a clear abstract block in the body so a human can skim the summary quickly.
9
+ - Each summary must start with literal JSON frontmatter between `---` lines, not a fenced code block.
10
+ - Required opening shape:
11
+ - `---`
12
+ - `{`
13
+ - ` "source": "raw/example.md",`
14
+ - ` "source_kind": "markdown",`
15
+ - ` "evidence_tier": "primary",`
16
+ - ` "truth_mode": "source-grounded",`
17
+ - ` "state": "complete"`
18
+ - `}`
19
+ - `---`
20
+ - Do not wrap that JSON in triple backticks or emit ```json anywhere in the summary file.
21
+ - Prefer direct file-reading and search tools over shell commands for routine file inspection.
22
+ - Include a clear abstract either in frontmatter or under a markdown `## Abstract` heading so a human can skim the summary quickly.
23
+ - Valid abstract forms for deterministic validation are:
24
+ - frontmatter key `"abstract"` with a real sentence, or
25
+ - a markdown heading `## Abstract` followed by at least one sentence
26
+ - A bare `Abstract` label without markdown heading syntax does not count.
11
27
  - Do not skip the abstract just because the overview section is present.
12
28
 
13
29
  ## Notes
@@ -2,14 +2,14 @@
2
2
 
3
3
  Workflow: interf
4
4
 
5
- This file is the editable authoring source for Interf Compiler's generated native workflow-improver shell.
5
+ This file is the editable authoring source for Interf's generated native workflow-improver shell.
6
6
  The improver edits this local package directly.
7
7
 
8
8
  Default loop:
9
9
  1. Read the loop context first.
10
10
  2. Review preserved stage shells, runtime logs, and saved test runs from failed attempts.
11
11
  3. Edit only the local workflow package for this compiled dataset to create a better workflow variation for this dataset.
12
- 4. Keep `workflow.json`, `compiled.schema.json`, and any changed stage docs aligned.
12
+ 4. Keep `workflow.json`, `workflow.schema.json`, and any changed stage docs aligned.
13
13
 
14
14
  Guardrails:
15
15
  - do not edit truth checks, test specs, or raw dataset files
@@ -5,8 +5,12 @@
5
5
  "kind": "compiled",
6
6
  "version": 1
7
7
  },
8
- "label": "Interf Compiler (Recommended)",
9
- "hint": "Interf Compiler's default methodology: summarize source-grounded evidence, structure the cross-file layer, then shape the final compiled dataset around its focus and saved truth checks.",
8
+ "purpose": {
9
+ "label": "General agent-ready dataset preparation",
10
+ "task_hint": "Prepare mixed raw files into evidence-backed summaries, cross-file structure, and a usable entrypoint for agents answering the questions this task depends on."
11
+ },
12
+ "label": "Interf (Built-in)",
13
+ "hint": "Interf's built-in workflow: summarize source-grounded evidence, structure the cross-file layer, then shape the final compiled dataset around its task focus and saved truth checks.",
10
14
  "stages": [
11
15
  {
12
16
  "id": "summarize",
@@ -31,6 +35,15 @@
31
35
  "markdown_frontmatter_valid_zones": [
32
36
  "summaries"
33
37
  ],
38
+ "frontmatter_required_keys_in_zones": {
39
+ "summaries": [
40
+ "source",
41
+ "source_kind",
42
+ "evidence_tier",
43
+ "truth_mode",
44
+ "state"
45
+ ]
46
+ },
34
47
  "markdown_abstract_valid_zones": [
35
48
  "summaries"
36
49
  ]
@@ -69,7 +82,7 @@
69
82
  {
70
83
  "id": "shape",
71
84
  "label": "Shape",
72
- "description": "Shape the final compiled dataset around the saved focus and truth checks.",
85
+ "description": "Shape the final compiled dataset around the saved task focus and truth checks.",
73
86
  "contract_type": "compiled-query-shape",
74
87
  "skill_dir": "shape",
75
88
  "reads": [
@@ -118,10 +131,11 @@
118
131
  "Use taxonomy and ontology only as means to improve retrieval, navigation, and evidence tracking.",
119
132
  "For small datasets, prefer a minimal stable substrate over exhaustive graph sprawl.",
120
133
  "When you add wikilinks, target real compiled notes by exact basename or explicit relative path. Do not invent title-style links unless that exact title is also a declared note label or alias.",
134
+ "Do not add wikilinks in structure outputs to files that the shape stage creates later. If a route belongs in `home.md` or a later shaped note, leave plain text now and let the later stage add the link.",
121
135
  "For summary references, prefer explicit links like `[[summaries/<file-stem>]]` or plain code paths. For knowledge notes, prefer the final filename stem under `knowledge/`."
122
136
  ],
123
137
  "shape": [
124
- "Use the dataset focus and saved truth checks to bias the final compiled dataset toward the job it should be especially good at.",
138
+ "Use the saved task focus and truth checks to bias the final compiled dataset toward the job it should be especially good at.",
125
139
  "Do not copy expected answers into the final compiled dataset just because the checks imply them.",
126
140
  "If a saved truth check depends on chart-derived or table-derived values, verify the needed evidence in `raw/` while shaping and write focused notes that preserve bounded values plus provenance.",
127
141
  "Prefer better routing, prioritization, and focused navigation over speculative synthesis.",