@interf/compiler 0.4.0 → 0.5.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 (160) hide show
  1. package/README.md +71 -69
  2. package/builtin-workflows/interf/README.md +6 -6
  3. package/builtin-workflows/interf/compile/stages/shape/SKILL.md +7 -7
  4. package/builtin-workflows/interf/compile/stages/structure/SKILL.md +2 -2
  5. package/builtin-workflows/interf/compile/stages/summarize/SKILL.md +1 -1
  6. package/builtin-workflows/interf/{workspace.schema.json → compiled.schema.json} +5 -5
  7. package/builtin-workflows/interf/improve/SKILL.md +3 -3
  8. package/builtin-workflows/interf/use/query/SKILL.md +2 -2
  9. package/builtin-workflows/interf/workflow.json +42 -31
  10. package/dist/commands/check-draft.d.ts +19 -0
  11. package/dist/commands/check-draft.js +110 -0
  12. package/dist/commands/compile-controller.d.ts +4 -4
  13. package/dist/commands/compile-controller.js +117 -81
  14. package/dist/commands/compile.d.ts +5 -5
  15. package/dist/commands/compile.js +61 -62
  16. package/dist/commands/compiled-flow.d.ts +23 -0
  17. package/dist/commands/compiled-flow.js +112 -0
  18. package/dist/commands/create-workflow-wizard.d.ts +3 -3
  19. package/dist/commands/create-workflow-wizard.js +11 -11
  20. package/dist/commands/create.d.ts +2 -2
  21. package/dist/commands/create.js +50 -57
  22. package/dist/commands/default.js +2 -2
  23. package/dist/commands/executor-flow.d.ts +20 -1
  24. package/dist/commands/executor-flow.js +67 -7
  25. package/dist/commands/init.js +242 -289
  26. package/dist/commands/list.js +14 -10
  27. package/dist/commands/reset.js +6 -6
  28. package/dist/commands/source-config-wizard.d.ts +12 -8
  29. package/dist/commands/source-config-wizard.js +356 -119
  30. package/dist/commands/status.js +49 -26
  31. package/dist/commands/test-flow.d.ts +23 -10
  32. package/dist/commands/test-flow.js +278 -58
  33. package/dist/commands/test.d.ts +7 -1
  34. package/dist/commands/test.js +264 -65
  35. package/dist/commands/verify.js +23 -14
  36. package/dist/index.d.ts +7 -7
  37. package/dist/index.js +4 -4
  38. package/dist/lib/agent-args.js +2 -1
  39. package/dist/lib/agent-constants.js +1 -1
  40. package/dist/lib/agent-render.js +4 -4
  41. package/dist/lib/agent-shells.d.ts +8 -8
  42. package/dist/lib/agent-shells.js +231 -142
  43. package/dist/lib/compiled-compile.d.ts +52 -0
  44. package/dist/lib/compiled-compile.js +274 -0
  45. package/dist/lib/compiled-home.d.ts +5 -0
  46. package/dist/lib/compiled-home.js +32 -0
  47. package/dist/lib/compiled-layout.d.ts +2 -0
  48. package/dist/lib/compiled-layout.js +60 -0
  49. package/dist/lib/compiled-paths.d.ts +41 -0
  50. package/dist/lib/compiled-paths.js +111 -0
  51. package/dist/lib/{workspace-raw.d.ts → compiled-raw.d.ts} +8 -7
  52. package/dist/lib/{workspace-raw.js → compiled-raw.js} +16 -14
  53. package/dist/lib/compiled-reset.d.ts +1 -0
  54. package/dist/lib/compiled-reset.js +44 -0
  55. package/dist/lib/compiled-schema.d.ts +27 -0
  56. package/dist/lib/compiled-schema.js +110 -0
  57. package/dist/lib/config.d.ts +0 -1
  58. package/dist/lib/config.js +0 -1
  59. package/dist/lib/discovery.d.ts +1 -1
  60. package/dist/lib/discovery.js +3 -3
  61. package/dist/lib/interf-bootstrap.d.ts +1 -1
  62. package/dist/lib/interf-bootstrap.js +4 -4
  63. package/dist/lib/interf-detect.d.ts +10 -10
  64. package/dist/lib/interf-detect.js +78 -56
  65. package/dist/lib/interf-scaffold.d.ts +2 -2
  66. package/dist/lib/interf-scaffold.js +90 -57
  67. package/dist/lib/interf-workflow-package.d.ts +3 -3
  68. package/dist/lib/interf-workflow-package.js +30 -30
  69. package/dist/lib/interf.d.ts +5 -5
  70. package/dist/lib/interf.js +4 -4
  71. package/dist/lib/local-workflows.d.ts +4 -4
  72. package/dist/lib/local-workflows.js +35 -70
  73. package/dist/lib/obsidian.d.ts +1 -1
  74. package/dist/lib/parse.js +92 -1
  75. package/dist/lib/project-paths.d.ts +13 -0
  76. package/dist/lib/project-paths.js +29 -0
  77. package/dist/lib/runtime-acceptance.d.ts +7 -1
  78. package/dist/lib/runtime-acceptance.js +194 -59
  79. package/dist/lib/runtime-contracts.d.ts +2 -4
  80. package/dist/lib/runtime-contracts.js +17 -161
  81. package/dist/lib/runtime-inventory.d.ts +7 -0
  82. package/dist/lib/runtime-inventory.js +29 -0
  83. package/dist/lib/runtime-paths.js +5 -5
  84. package/dist/lib/runtime-prompt.js +9 -6
  85. package/dist/lib/runtime-reconcile.d.ts +2 -3
  86. package/dist/lib/runtime-reconcile.js +92 -171
  87. package/dist/lib/runtime-runs.js +30 -39
  88. package/dist/lib/runtime-types.d.ts +10 -19
  89. package/dist/lib/runtime.d.ts +2 -2
  90. package/dist/lib/runtime.js +1 -1
  91. package/dist/lib/schema.d.ts +163 -140
  92. package/dist/lib/schema.js +163 -124
  93. package/dist/lib/source-config.d.ts +24 -20
  94. package/dist/lib/source-config.js +154 -116
  95. package/dist/lib/state-artifacts.d.ts +5 -5
  96. package/dist/lib/state-artifacts.js +8 -8
  97. package/dist/lib/state-health.d.ts +4 -4
  98. package/dist/lib/state-health.js +108 -126
  99. package/dist/lib/state-io.d.ts +8 -8
  100. package/dist/lib/state-io.js +77 -50
  101. package/dist/lib/state-paths.js +5 -5
  102. package/dist/lib/state-view.d.ts +4 -4
  103. package/dist/lib/state-view.js +52 -55
  104. package/dist/lib/state.d.ts +5 -5
  105. package/dist/lib/state.js +4 -4
  106. package/dist/lib/summarize-plan.d.ts +3 -2
  107. package/dist/lib/summarize-plan.js +18 -16
  108. package/dist/lib/test-execution.js +9 -9
  109. package/dist/lib/test-matrices.d.ts +3 -3
  110. package/dist/lib/test-matrices.js +6 -6
  111. package/dist/lib/test-paths.d.ts +4 -4
  112. package/dist/lib/test-paths.js +16 -10
  113. package/dist/lib/test-sandbox.d.ts +1 -1
  114. package/dist/lib/test-sandbox.js +38 -31
  115. package/dist/lib/test-targets.d.ts +2 -2
  116. package/dist/lib/test-targets.js +11 -11
  117. package/dist/lib/test-types.d.ts +1 -1
  118. package/dist/lib/test.d.ts +1 -1
  119. package/dist/lib/test.js +1 -1
  120. package/dist/lib/util.d.ts +2 -0
  121. package/dist/lib/util.js +14 -1
  122. package/dist/lib/validate-compiled.d.ts +27 -0
  123. package/dist/lib/validate-compiled.js +236 -0
  124. package/dist/lib/validate-helpers.d.ts +0 -8
  125. package/dist/lib/validate-helpers.js +0 -30
  126. package/dist/lib/validate.d.ts +4 -4
  127. package/dist/lib/validate.js +49 -15
  128. package/dist/lib/workflow-abi.d.ts +37 -46
  129. package/dist/lib/workflow-abi.js +51 -76
  130. package/dist/lib/workflow-definitions.d.ts +11 -11
  131. package/dist/lib/workflow-definitions.js +36 -53
  132. package/dist/lib/workflow-helpers.d.ts +2 -3
  133. package/dist/lib/workflow-helpers.js +9 -13
  134. package/dist/lib/workflow-improvement.d.ts +3 -3
  135. package/dist/lib/workflow-improvement.js +48 -48
  136. package/dist/lib/workflow-review-paths.d.ts +3 -3
  137. package/dist/lib/workflow-review-paths.js +11 -11
  138. package/dist/lib/workflow-stage-runner.d.ts +1 -1
  139. package/dist/lib/workflow-stage-runner.js +8 -8
  140. package/dist/lib/workflows.d.ts +9 -9
  141. package/dist/lib/workflows.js +15 -17
  142. package/package.json +10 -9
  143. package/dist/commands/workspace-flow.d.ts +0 -23
  144. package/dist/commands/workspace-flow.js +0 -109
  145. package/dist/lib/registry.d.ts +0 -16
  146. package/dist/lib/registry.js +0 -65
  147. package/dist/lib/validate-workspace.d.ts +0 -121
  148. package/dist/lib/validate-workspace.js +0 -407
  149. package/dist/lib/workspace-compile.d.ts +0 -54
  150. package/dist/lib/workspace-compile.js +0 -476
  151. package/dist/lib/workspace-home.d.ts +0 -5
  152. package/dist/lib/workspace-home.js +0 -32
  153. package/dist/lib/workspace-layout.d.ts +0 -2
  154. package/dist/lib/workspace-layout.js +0 -60
  155. package/dist/lib/workspace-paths.d.ts +0 -41
  156. package/dist/lib/workspace-paths.js +0 -107
  157. package/dist/lib/workspace-reset.d.ts +0 -1
  158. package/dist/lib/workspace-reset.js +0 -43
  159. package/dist/lib/workspace-schema.d.ts +0 -17
  160. package/dist/lib/workspace-schema.js +0 -74
package/README.md CHANGED
@@ -2,25 +2,22 @@
2
2
 
3
3
  Prepare local datasets for accurate agent use.
4
4
 
5
- Interf Compiler runs a local data-processing workflow over your dataset to build a compiled workspace: a file-based layer on top of your raw files that gives agents the full picture of the dataset they need to answer questions accurately.
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.
6
6
 
7
- Define truth checks to measure how accurately agents answer from your dataset.
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.
8
8
 
9
- Start with a baseline on your files as-is.
10
-
11
- Then compile the workspace and retest it on the same checks so you can measure whether it actually helps.
12
-
13
- Then run self-improving loops that revise the workflow, rebuild the workspace, and rerun the same truth checks until the workspace passes or reaches the loop limit.
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.
14
10
 
15
11
  ## Why Use It
16
12
 
17
13
  Interf Compiler is built around a few simple principles:
18
14
 
19
- - `Local`: the dataset, workflow, workspace, and test runs stay on your machine.
20
- - `File-based`: the compiled workspace is normal folders and files you can inspect, review, and version.
21
- - `Source-backed`: your raw files stay the source of truth; the compiled workspace is a layer on top, not a replacement database.
22
- - `Interoperable`: the same workspace can be used with different local agents and tools.
23
- - `Self-improving`: when truth checks fail, Interf can retry the workflow or revise it, rebuild the workspace, and rerun the same checks.
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.
24
21
 
25
22
  ## Example: Truth Checks
26
23
 
@@ -31,9 +28,10 @@ A maintained public test run in this repo uses checks like this:
31
28
  <!-- PUBLIC_TEST_CHECKS:START -->
32
29
  ```jsonc
33
30
  {
34
- "workspaces": [
31
+ "datasets": [
35
32
  {
36
33
  "name": "cbre-chart-sanity",
34
+ "path": ".",
37
35
  "about": "Bristol historical take-up and availability chart lookup.",
38
36
  "checks": [
39
37
  {
@@ -53,21 +51,21 @@ A maintained public test run in this repo uses checks like this:
53
51
 
54
52
  ## Example: `interf test`
55
53
 
56
- `interf test` compares the raw files and the compiled workspace on the same saved truth checks.
57
- The table below is synced from a real public test run in this repo.
54
+ `interf test` compares files as-is and the compiled dataset on the same saved truth checks.
55
+ 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.
58
56
 
59
- <!-- PUBLIC_TEST_TABLE:START -->
60
- | Runner | Files as-is | Compiled workspace |
57
+ A recent maintained internal run on the CBRE chart sanity dataset produced:
58
+
59
+ <!-- PUBLIC_BENCHMARK_TABLE:START -->
60
+ | Agent | Files as-is | Compiled dataset |
61
61
  | --- | --- | --- |
62
62
  | Codex (GPT-5.4, xhigh) | `2/2` | `2/2` |
63
- | Claude Code (Claude Opus 4.6 1M, max) | `0/2` | `2/2` |
64
- <!-- PUBLIC_TEST_TABLE:END -->
65
-
66
- That is the point of `interf test`: measure the same checks on both sides and keep the result honest, even when a compiled workspace helps one model more than another.
63
+ | Claude Code (Claude Opus 4.6, max) | `0/2` | `2/2` |
64
+ <!-- PUBLIC_BENCHMARK_TABLE:END -->
67
65
 
68
- Use `interf test` on your own dataset to measure files as-is versus the compiled workspace on the same checks.
66
+ Use `interf test` on your own dataset to measure files as-is versus the compiled dataset on the same checks.
69
67
 
70
- Each run saves one comparison record under `.interf/tests/runs/`. Detailed target-specific runs and preserved sandboxes stay under `.interf/tests/targets/`.
68
+ Each dataset keeps one latest comparison under `interf/<dataset>/tests/latest.json`. Target-specific runs stay under `interf/<dataset>/tests/file-as-is/runs/` and `interf/<dataset>/tests/compiled/runs/`.
71
69
 
72
70
  ## Quick Start
73
71
 
@@ -82,47 +80,48 @@ Install:
82
80
  npm install -g @interf/compiler
83
81
  ```
84
82
 
85
- Start from the folder that already contains your dataset:
83
+ Start from a project folder that contains one or more dataset folders:
86
84
 
87
85
  ```bash
88
- cd ~/my-dataset
86
+ cd ~/my-interf-project
89
87
  interf
88
+ interf test
90
89
  interf compile
91
90
  interf test
92
91
  ```
93
92
 
94
93
  The first run can:
95
94
 
96
- - save a few truth checks for the dataset
95
+ - draft `interf.json`
96
+ - auto-create a draft set of truth checks for a dataset folder, or let you add them manually
97
97
  - test your files as-is first on those same checks
98
- - build the compiled workspace
99
- - test the compiled workspace on the same truth checks
98
+ - build the compiled dataset
99
+ - test the compiled dataset on the same truth checks
100
100
 
101
101
  ## What Interf Compiler Creates
102
102
 
103
- After setup, the main persistent object is the compiled workspace:
104
-
105
- - `interf/workspaces/<name>/` with the compiled workspace
106
- - `interf/workspaces/<name>/.interf/interf.json` with the workspace-local runtime contract
107
- - `interf/workspaces/<name>/.interf/tests/runs/...` with saved raw-vs-compiled test comparisons
103
+ After setup, the project root stays simple:
108
104
 
109
- The dataset root can also keep `interf.config.json` as bootstrap/setup for workspace names, truth checks, and compile defaults.
105
+ - `interf.json` at the root holds your saved dataset entries and truth checks
106
+ - `interf/` is created only when Interf has artifacts to save
107
+ - `interf/<dataset>/compiled/` is the compiled dataset
108
+ - `interf/<dataset>/tests/` is the saved comparison history for that dataset
110
109
 
111
- A compiled workspace is a folder on top of your dataset. It includes:
110
+ A compiled dataset is a folder on top of your dataset. It includes:
112
111
 
113
- - a workspace-local `raw/` snapshot for direct evidence and verification
112
+ - a local `raw/` snapshot for direct evidence and verification
114
113
  - agent-readable summaries and cross-file notes
115
114
  - `AGENTS.md`, `CLAUDE.md`, and generated local query skills
116
- - workspace method, test, and runtime state under `.interf/`
115
+ - workflow, test, and runtime state under `.interf/`
117
116
 
118
- The compiled workspace is the folder your agent should work from.
117
+ The compiled dataset is the folder your agent should work from.
119
118
 
120
119
  ## How It Works
121
120
 
122
- 1. Save a few truth checks for the dataset.
123
- 2. Optionally test your files as-is for a baseline.
124
- 3. Build the compiled workspace.
125
- 4. Test the compiled workspace on the same truth checks.
121
+ 1. Save a few truth checks for a dataset in `interf.json`.
122
+ 2. Optionally test the files as-is for a baseline.
123
+ 3. Build the compiled dataset for that dataset.
124
+ 4. Test the compiled dataset on the same truth checks.
126
125
  5. Optionally let Interf retry or improve the workflow until it passes or hits the configured limit.
127
126
 
128
127
  Truth checks are simple:
@@ -136,7 +135,7 @@ Good first truth checks are small and practical:
136
135
  - one short statement that should be true or false
137
136
  - one simple comparison across years, files, or sections
138
137
 
139
- If `interf.config.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:
138
+ 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:
140
139
 
141
140
  ```bash
142
141
  interf doctor
@@ -144,38 +143,41 @@ interf doctor
144
143
 
145
144
  ## What `interf test` Does
146
145
 
147
- By default, if a compiled workspace exists, it runs both sides and saves one comparison under that workspace's `.interf/tests/runs/`.
146
+ By default, if a compiled dataset exists, it runs both sides and saves one latest comparison under `interf/<dataset>/tests/latest.json`.
147
+
148
+ You can also select one or more detected local agents in the CLI and compare them in one table.
148
149
 
149
150
  For live runs:
150
151
 
151
- - raw tests execute from a sanitized raw-only shell built from `raw/`
152
- - compiled-workspace tests execute from a copied workspace sandbox with embedded sanitized `raw/`
153
- - both sides use the same saved truth checks from that workspace's `.interf/interf.json`
154
- - neither sandbox includes the dataset control plane
155
- - detailed raw/workspace target runs are kept under `.interf/tests/targets/runs/`
156
- - failed test sandboxes are kept automatically under `.interf/tests/targets/sandboxes/`
152
+ - files-as-is tests execute from a sanitized raw-only shell built from the selected dataset folder
153
+ - compiled-dataset tests execute from a copied compiled sandbox with embedded sanitized `raw/`
154
+ - both sides use the same saved truth checks from `interf.json`
155
+ - neither sandbox includes the project control plane
156
+ - detailed dataset-visible runs are kept under `interf/<dataset>/tests/file-as-is/runs/` and `interf/<dataset>/tests/compiled/runs/`
157
+ - local detailed target runs and preserved sandboxes stay under `.interf/tests/targets/`
158
+ - failed test sandboxes are kept automatically
157
159
  - `interf test --keep-sandboxes` keeps every sandbox, even successful ones
158
160
 
159
- From inside a workspace, `interf test` uses that workspace's `.interf/interf.json` directly. From the dataset root, `interf.config.json` only bootstraps workspace selection before the workspace-local runtime contract takes over.
161
+ 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
162
 
161
163
  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`.
162
164
 
163
- ## Advanced: Separate Workspaces
165
+ ## Advanced: Multiple Datasets
164
166
 
165
- Most folders only need one workspace.
167
+ Most projects only need one dataset entry.
166
168
 
167
- Create another only when you want a different compiled setup with different checks, for example:
169
+ Add another only when you want a different dataset folder, focus, or set of truth checks, for example:
168
170
 
169
171
  - general folder understanding
170
172
  - finance reporting
171
173
  - board prep
172
174
  - diligence review
173
175
 
174
- Why create another one:
176
+ Why add another:
175
177
 
176
178
  - it keeps a separate set of truth checks
177
- - it gives that job its own compiled output under `interf/workspaces/<name>/`
178
- - it lets you test that job separately
179
+ - it gives that dataset its own compiled output under `interf/<dataset>/compiled/`
180
+ - it lets you test that dataset separately
179
181
 
180
182
  ## Advanced: Compile Loops
181
183
 
@@ -212,14 +214,14 @@ The workflow is the right surface for that kind of improvement because it is:
212
214
 
213
215
  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.
214
216
 
215
- Example workspace config:
217
+ Example `interf.json`:
216
218
 
217
219
  ```jsonc
218
220
  {
219
- "workspaces": [
221
+ "datasets": [
220
222
  {
221
223
  "name": "cbre-chart-sanity",
222
- "max_attempts": 3, // retry compile + test for the same workflow until this workspace passes or hits this limit
224
+ "max_attempts": 3, // retry compile + test for the same workflow until this dataset passes or hits this limit
223
225
  "max_loops": 2, // workflow-editing loops after retries fail
224
226
  "checks": [
225
227
  {
@@ -232,7 +234,7 @@ Example workspace config:
232
234
  }
233
235
  ```
234
236
 
235
- Use the normal workspace retry and loop controls first. Maintainers can use the internal repeated-test runner when they want controlled comparisons across workflows, compile profiles, or models.
237
+ 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.
236
238
 
237
239
  ## Use It With Your Agent
238
240
 
@@ -243,11 +245,11 @@ Paste something like this into your agent:
243
245
  ```text
244
246
  Install @interf/compiler, run `interf` in this folder, and use the local agent executor.
245
247
 
246
- If `interf.config.json` is missing, draft one workspace with a few truth checks this agent should be able to answer from this dataset and add the expected answers for me to confirm.
248
+ 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.
247
249
 
248
- Then run a raw baseline if helpful, compile the workspace, and run `interf test`.
250
+ Then run a files-as-is baseline if helpful, compile the dataset, and run `interf test`.
249
251
 
250
- Tell me whether the compiled workspace passes the truth checks, and only recommend it if it does.
252
+ Tell me whether the compiled dataset passes the truth checks, and only recommend it if it does.
251
253
  ```
252
254
 
253
255
  ## Custom Workflows
@@ -273,12 +275,12 @@ Workflow docs live in [docs/workflow-spec.md](./docs/workflow-spec.md).
273
275
 
274
276
  ## Core Commands
275
277
 
276
- - `interf` = open the root-folder wizard
277
- - `interf init` = alias for the root-folder wizard
278
- - `interf create workspace` = create another compiled workspace when you need one
278
+ - `interf` = open the project-root wizard
279
+ - `interf init` = alias for the project-root wizard
280
+ - `interf create dataset` = add another dataset entry when you need one
279
281
  - `interf create workflow` = create a reusable local seed workflow
280
- - `interf compile` = build a selected workspace for the current folder
281
- - `interf test` = compare the raw files and a compiled workspace on saved truth checks
282
+ - `interf compile` = build a selected compiled dataset for the current project
283
+ - `interf test` = compare files as-is and a compiled dataset on saved truth checks
282
284
  - `interf doctor` = check local executor setup
283
285
  - `interf verify <check>` = run deterministic checks on major workflow steps
284
286
  - `interf reset <scope>` = remove generated state while keeping source files
@@ -1,19 +1,19 @@
1
1
  # Interf Compiler (Recommended)
2
2
 
3
- Interf Compiler's default methodology: summarize source-grounded evidence, structure the cross-file layer, then shape the final workspace around its focus and saved truth checks.
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.
4
4
 
5
5
  ## Package
6
6
 
7
7
  - `workflow.json` = stage graph, compiler API target, and compile contract mapping
8
- - `workspace.schema.json` = deterministic workspace output shape
8
+ - `compiled.schema.json` = deterministic compiled-dataset output shape
9
9
  - `improve/`, `compile/stages/`, and `use/query/` = human-readable authoring docs
10
10
  - Portable workflow packages are standalone: explicit stages, schema, and docs live together in this folder
11
11
  - Interf Compiler projects native agent shells from these docs for query use, stage execution, and workflow-improvement loops
12
12
 
13
13
  ## Stages
14
14
 
15
- - `summarize` — Turn source files into per-file summaries. (workspace-file-evidence; reads: raw, runtime; writes: summaries)
16
- - `structure` — Build the cross-file knowledge structure from the summaries. (workspace-knowledge-structure; reads: summaries, runtime; writes: knowledge-entities, knowledge-claims, knowledge-indexes)
17
- - `shape` — Shape the final workspace around the saved focus and truth checks. (workspace-query-shape; reads: raw, summaries, knowledge-entities, knowledge-claims, knowledge-indexes, runtime; writes: knowledge-indexes, home)
15
+ - `summarize` — Turn source files into per-file summaries. (compiled-file-evidence; reads: raw, runtime; writes: summaries)
16
+ - `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)
18
18
 
19
- This package is the built-in seed for `interf`. Interf Compiler copies or materializes it into `.interf/workflow/` and runs that workspace-local package directly.
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.
@@ -1,12 +1,12 @@
1
1
  # Shape
2
2
 
3
- Shape the final workspace around the saved focus and truth checks.
3
+ Shape the final compiled dataset around the saved focus and truth checks.
4
4
 
5
- Contract type: `workspace-query-shape`
5
+ Contract type: `compiled-query-shape`
6
6
 
7
7
  ## Requirements
8
8
 
9
- - Use the workspace focus plus saved truth-check question text to shape `home.md` and retrieval routes.
9
+ - Use the compiled 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
11
  - When a chart-derived value is approximate, use a bounded range instead of a pseudo-exact number.
12
12
  - Match the granularity of the visible axis labels or bands. Do not invent finer precision than the chart supports.
@@ -15,14 +15,14 @@ Contract type: `workspace-query-shape`
15
15
  - If a mark touches or nearly touches a labeled gridline, anchor the answer at that gridline or the immediately adjacent half-band.
16
16
  - Do not widen a chart-derived range across multiple visible bands unless the chart genuinely supports that uncertainty.
17
17
  - When you settle on a bounded chart read, keep that same band consistent across `home.md`, focused indexes, and claim/entity notes for that metric and year.
18
- - Do not copy expected answers into the workspace.
18
+ - Do not copy expected answers into the compiled dataset.
19
19
 
20
20
  ## Notes
21
21
 
22
- - Use the workspace focus and saved truth checks to bias the final workspace toward the job it should be especially good at.
23
- - Do not copy expected answers into the final workspace just because the checks imply them.
22
+ - Use the dataset focus and saved truth checks to bias the final compiled dataset toward the job it should be especially good at.
23
+ - Do not copy expected answers into the final compiled dataset just because the checks imply them.
24
24
  - Prefer the saved summary evidence and structured notes when they already preserve the bounded chart/table reads plus provenance you need.
25
25
  - 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.
26
26
  - If a saved truth check depends on chart-derived or table-derived values, carry the final bounded reads forward into focused notes with provenance instead of repeatedly recomputing them from raw.
27
27
  - Prefer better routing, prioritization, and focused navigation over speculative synthesis.
28
- - Any wikilinks you add to `home.md` or indexes must resolve to real workspace note basenames or explicit relative paths.
28
+ - Any wikilinks you add to `home.md` or indexes must resolve to real compiled note basenames or explicit relative paths.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Build the cross-file knowledge structure from the summaries.
4
4
 
5
- Contract type: `workspace-knowledge-structure`
5
+ Contract type: `compiled-knowledge-structure`
6
6
 
7
7
  ## Requirements
8
8
 
@@ -14,5 +14,5 @@ Contract type: `workspace-knowledge-structure`
14
14
  - Bias structure toward canonical entities, claims, timelines, and stable indexes.
15
15
  - Use taxonomy and ontology only as means to improve retrieval, navigation, and evidence tracking.
16
16
  - For small datasets, prefer a minimal stable substrate over exhaustive graph sprawl.
17
- - When you add wikilinks, target real workspace 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.
17
+ - 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.
18
18
  - For summary references, prefer explicit links like `[[summaries/<file-stem>]]` or plain code paths. For knowledge notes, prefer the final filename stem under `knowledge/`.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Turn source files into per-file summaries.
4
4
 
5
- Contract type: `workspace-file-evidence`
5
+ Contract type: `compiled-file-evidence`
6
6
 
7
7
  ## Requirements
8
8
 
@@ -1,8 +1,8 @@
1
1
  {
2
- "kind": "workspace-schema",
2
+ "kind": "compiled-schema",
3
3
  "version": 1,
4
- "target_type": "workspace",
5
- "label": "Interf Compiler (Recommended) workspace schema",
4
+ "target_type": "compiled",
5
+ "label": "Interf Compiler (Recommended) compiled dataset schema",
6
6
  "zones": [
7
7
  {
8
8
  "id": "raw",
@@ -10,7 +10,7 @@
10
10
  "kind": "directory",
11
11
  "required": true,
12
12
  "owned_by": [],
13
- "description": "Workspace-local raw snapshot copied from the dataset for direct evidence and verification."
13
+ "description": "Dataset-local raw snapshot copied from the dataset for direct evidence and verification."
14
14
  },
15
15
  {
16
16
  "id": "summaries",
@@ -61,7 +61,7 @@
61
61
  "owned_by": [
62
62
  "shape"
63
63
  ],
64
- "description": "Primary entrypoint note for agents using the compiled workspace."
64
+ "description": "Primary entrypoint note for agents using the compiled dataset."
65
65
  },
66
66
  {
67
67
  "id": "runtime",
@@ -3,13 +3,13 @@
3
3
  Workflow: interf
4
4
 
5
5
  This file is the editable authoring source for Interf Compiler's generated native workflow-improver shell.
6
- The improver edits this workspace-local package directly.
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
- 3. Edit only the local workflow package for this workspace to create a better workflow variation for this dataset.
12
- 4. Keep `workflow.json`, `workspace.schema.json`, and any changed stage docs aligned.
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.
13
13
 
14
14
  Guardrails:
15
15
  - do not edit truth checks, test specs, or raw dataset files
@@ -22,7 +22,7 @@ Answering rule:
22
22
  - use an upper-half or lower-half band only when the mark clearly sits there.
23
23
  - if a mark touches or nearly touches a labeled gridline, anchor the answer at that gridline or the immediately adjacent half-band.
24
24
  - do not widen a chart-derived range across multiple visible bands unless the chart genuinely supports that uncertainty.
25
- - if multiple compiled notes mention the same chart read, keep the answer consistent with the most focused workspace note rather than synthesizing a new midpoint or shifted band
25
+ - if multiple compiled notes mention the same chart read, keep the answer consistent with the most focused compiled note rather than synthesizing a new midpoint or shifted band
26
26
  - when the compiled layer is insufficient, verify in `raw/` and then answer
27
27
 
28
- You can edit this file to bias manual question-answering behavior for this workspace.
28
+ You can edit this file to bias manual question-answering behavior for this compiled dataset.
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "id": "interf",
3
- "type": "workspace",
3
+ "type": "compiled",
4
4
  "compiler_api": {
5
- "kind": "workspace",
5
+ "kind": "compiled",
6
6
  "version": 1
7
7
  },
8
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 workspace around its focus and saved truth checks.",
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.",
10
10
  "stages": [
11
11
  {
12
12
  "id": "summarize",
13
13
  "label": "Summarize",
14
14
  "description": "Turn source files into per-file summaries.",
15
- "contract_type": "workspace-file-evidence",
15
+ "contract_type": "compiled-file-evidence",
16
16
  "skill_dir": "summarize",
17
17
  "reads": [
18
18
  "raw",
@@ -22,23 +22,25 @@
22
22
  "summaries"
23
23
  ],
24
24
  "acceptance": {
25
- "artifacts_exist": [
26
- ".interf/runtime/inventory.json"
25
+ "stage_truthy": [
26
+ "finished_at"
27
27
  ],
28
- "state_truthy": [
29
- "last_summarize",
30
- "inventory_complete"
28
+ "zone_counts_at_least_counts": {
29
+ "summaries": "source_total"
30
+ },
31
+ "markdown_frontmatter_valid_zones": [
32
+ "summaries"
31
33
  ],
32
- "state_at_least_counts": {
33
- "summarized": "expected_summary_total"
34
- }
34
+ "markdown_abstract_valid_zones": [
35
+ "summaries"
36
+ ]
35
37
  }
36
38
  },
37
39
  {
38
40
  "id": "structure",
39
41
  "label": "Structure",
40
42
  "description": "Build the cross-file knowledge structure from the summaries.",
41
- "contract_type": "workspace-knowledge-structure",
43
+ "contract_type": "compiled-knowledge-structure",
42
44
  "skill_dir": "structure",
43
45
  "reads": [
44
46
  "summaries",
@@ -53,20 +55,22 @@
53
55
  "artifacts_exist": [
54
56
  "knowledge/indexes"
55
57
  ],
56
- "state_truthy": [
57
- "last_structure",
58
- "inventory_complete"
58
+ "stage_truthy": [
59
+ "finished_at"
59
60
  ],
60
- "state_at_least_counts": {
61
- "structured": "summary_total"
62
- }
61
+ "wikilinks_valid_in_zones": [
62
+ "summaries",
63
+ "knowledge-entities",
64
+ "knowledge-claims",
65
+ "knowledge-indexes"
66
+ ]
63
67
  }
64
68
  },
65
69
  {
66
70
  "id": "shape",
67
71
  "label": "Shape",
68
- "description": "Shape the final workspace around the saved focus and truth checks.",
69
- "contract_type": "workspace-query-shape",
72
+ "description": "Shape the final compiled dataset around the saved focus and truth checks.",
73
+ "contract_type": "compiled-query-shape",
70
74
  "skill_dir": "shape",
71
75
  "reads": [
72
76
  "raw",
@@ -84,13 +88,20 @@
84
88
  "artifacts_exist": [
85
89
  "home.md"
86
90
  ],
87
- "state_truthy": [
88
- "last_shape",
89
- "inventory_complete"
91
+ "stage_truthy": [
92
+ "finished_at"
93
+ ],
94
+ "wikilinks_valid_in_zones": [
95
+ "summaries",
96
+ "knowledge-entities",
97
+ "knowledge-claims",
98
+ "knowledge-indexes",
99
+ "home"
90
100
  ],
91
- "state_at_least_counts": {
92
- "shaped": "summary_total",
93
- "compiled": "summary_total"
101
+ "artifacts_must_not_contain": {
102
+ "home.md": [
103
+ "Not yet compiled."
104
+ ]
94
105
  }
95
106
  }
96
107
  }
@@ -106,15 +117,15 @@
106
117
  "Bias structure toward canonical entities, claims, timelines, and stable indexes.",
107
118
  "Use taxonomy and ontology only as means to improve retrieval, navigation, and evidence tracking.",
108
119
  "For small datasets, prefer a minimal stable substrate over exhaustive graph sprawl.",
109
- "When you add wikilinks, target real workspace 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.",
120
+ "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.",
110
121
  "For summary references, prefer explicit links like `[[summaries/<file-stem>]]` or plain code paths. For knowledge notes, prefer the final filename stem under `knowledge/`."
111
122
  ],
112
123
  "shape": [
113
- "Use the workspace focus and saved truth checks to bias the final workspace toward the job it should be especially good at.",
114
- "Do not copy expected answers into the final workspace just because the checks imply them.",
124
+ "Use the dataset focus and saved truth checks to bias the final compiled dataset toward the job it should be especially good at.",
125
+ "Do not copy expected answers into the final compiled dataset just because the checks imply them.",
115
126
  "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.",
116
127
  "Prefer better routing, prioritization, and focused navigation over speculative synthesis.",
117
- "Any wikilinks you add to `home.md` or indexes must resolve to real workspace note basenames or explicit relative paths."
128
+ "Any wikilinks you add to `home.md` or indexes must resolve to real compiled note basenames or explicit relative paths."
118
129
  ]
119
130
  }
120
131
  }
@@ -0,0 +1,19 @@
1
+ import type { WorkflowExecutor } from "../lib/executors.js";
2
+ import type { SourceTruthCheck } from "../lib/schema.js";
3
+ export declare function buildTruthCheckDraftPrompt(options: {
4
+ datasetName: string;
5
+ datasetPath: string;
6
+ about?: string;
7
+ outputPath: string;
8
+ targetCount: number;
9
+ }): string;
10
+ export declare function draftTruthChecks(options: {
11
+ datasetName: string;
12
+ datasetPath: string;
13
+ about?: string;
14
+ executor: WorkflowExecutor;
15
+ targetCount?: number;
16
+ }): Promise<{
17
+ checks: SourceTruthCheck[] | null;
18
+ error?: string;
19
+ }>;