@interf/compiler 0.5.0 → 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.
- package/README.md +126 -188
- package/builtin-workflows/interf/README.md +22 -10
- package/builtin-workflows/interf/compile/stages/shape/SKILL.md +6 -3
- package/builtin-workflows/interf/compile/stages/structure/SKILL.md +3 -0
- package/builtin-workflows/interf/compile/stages/summarize/SKILL.md +18 -2
- package/builtin-workflows/interf/improve/SKILL.md +2 -2
- package/builtin-workflows/interf/workflow.json +18 -4
- package/builtin-workflows/interf/{compiled.schema.json → workflow.schema.json} +9 -2
- package/dist/commands/check-draft.js +3 -3
- package/dist/commands/compile-controller.js +9 -16
- package/dist/commands/compile.d.ts +19 -1
- package/dist/commands/compile.js +98 -28
- package/dist/commands/create-workflow-wizard.d.ts +20 -2
- package/dist/commands/create-workflow-wizard.js +163 -27
- package/dist/commands/create.d.ts +1 -1
- package/dist/commands/create.js +67 -60
- package/dist/commands/dataset-selection.d.ts +6 -0
- package/dist/commands/dataset-selection.js +11 -0
- package/dist/commands/default.js +3 -3
- package/dist/commands/doctor.js +8 -8
- package/dist/commands/executor-flow.d.ts +1 -1
- package/dist/commands/executor-flow.js +5 -2
- package/dist/commands/init.d.ts +5 -0
- package/dist/commands/init.js +56 -48
- package/dist/commands/list.js +6 -3
- package/dist/commands/reset.js +1 -1
- package/dist/commands/source-config-wizard.d.ts +2 -2
- package/dist/commands/source-config-wizard.js +50 -17
- package/dist/commands/test-flow.js +5 -16
- package/dist/commands/test.d.ts +0 -6
- package/dist/commands/test.js +9 -17
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/agent-args.d.ts +1 -0
- package/dist/lib/agent-args.js +10 -0
- package/dist/lib/agent-execution.js +2 -1
- package/dist/lib/agent-preflight.js +2 -1
- package/dist/lib/agent-shells.d.ts +26 -1
- package/dist/lib/agent-shells.js +214 -40
- package/dist/lib/agents.d.ts +1 -1
- package/dist/lib/agents.js +1 -1
- package/dist/lib/builtin-compiled-workflow.d.ts +38 -0
- package/dist/lib/builtin-compiled-workflow.js +94 -0
- package/dist/lib/compiled-compile.d.ts +0 -4
- package/dist/lib/compiled-compile.js +11 -30
- package/dist/lib/compiled-paths.d.ts +1 -2
- package/dist/lib/compiled-paths.js +8 -13
- package/dist/lib/compiled-raw.d.ts +2 -2
- package/dist/lib/compiled-reset.d.ts +1 -0
- package/dist/lib/compiled-reset.js +42 -14
- package/dist/lib/compiled-schema.d.ts +11 -7
- package/dist/lib/compiled-schema.js +47 -16
- package/dist/lib/discovery.d.ts +1 -1
- package/dist/lib/discovery.js +2 -2
- package/dist/lib/executors.d.ts +1 -1
- package/dist/lib/executors.js +2 -2
- package/dist/lib/interf-detect.d.ts +0 -1
- package/dist/lib/interf-detect.js +7 -18
- package/dist/lib/interf-scaffold.js +4 -11
- package/dist/lib/interf-workflow-package.d.ts +8 -3
- package/dist/lib/interf-workflow-package.js +128 -62
- package/dist/lib/interf.d.ts +1 -1
- package/dist/lib/interf.js +1 -1
- package/dist/lib/local-workflows.d.ts +4 -3
- package/dist/lib/local-workflows.js +127 -104
- package/dist/lib/project-paths.d.ts +2 -4
- package/dist/lib/project-paths.js +13 -10
- package/dist/lib/runtime-acceptance.js +15 -3
- package/dist/lib/runtime-contracts.js +3 -2
- package/dist/lib/runtime-paths.d.ts +1 -0
- package/dist/lib/runtime-paths.js +4 -1
- package/dist/lib/runtime-prompt.js +4 -4
- package/dist/lib/runtime-reconcile.js +90 -64
- package/dist/lib/runtime-runs.js +29 -102
- package/dist/lib/runtime.d.ts +1 -1
- package/dist/lib/runtime.js +1 -1
- package/dist/lib/schema.d.ts +104 -54
- package/dist/lib/schema.js +32 -116
- package/dist/lib/source-config.js +21 -22
- package/dist/lib/state-health.js +4 -2
- package/dist/lib/state-io.js +2 -110
- package/dist/lib/state-view.js +8 -8
- package/dist/lib/state.d.ts +1 -0
- package/dist/lib/state.js +7 -0
- package/dist/lib/test-execution.js +2 -2
- package/dist/lib/test-paths.js +12 -3
- package/dist/lib/test-sandbox.js +4 -17
- package/dist/lib/test-specs.js +1 -1
- package/dist/lib/validate-compiled.js +13 -8
- package/dist/lib/validate.d.ts +5 -1
- package/dist/lib/validate.js +30 -22
- package/dist/lib/workflow-authoring.d.ts +26 -0
- package/dist/lib/workflow-authoring.js +119 -0
- package/dist/lib/workflow-definitions.d.ts +14 -3
- package/dist/lib/workflow-definitions.js +21 -17
- package/dist/lib/workflow-edit-session.d.ts +16 -0
- package/dist/lib/workflow-edit-session.js +57 -0
- package/dist/lib/workflow-edit-utils.d.ts +10 -0
- package/dist/lib/workflow-edit-utils.js +39 -0
- package/dist/lib/workflow-improvement.js +30 -217
- package/dist/lib/workflow-primitives.d.ts +2 -0
- package/dist/lib/workflow-primitives.js +5 -0
- package/dist/lib/workflow-stage-policy.d.ts +5 -0
- package/dist/lib/workflow-stage-policy.js +31 -0
- package/package.json +7 -8
- package/dist/lib/compiled-layout.d.ts +0 -2
- package/dist/lib/compiled-layout.js +0 -60
- package/dist/lib/obsidian.d.ts +0 -1
- package/dist/lib/obsidian.js +0 -15
- package/dist/lib/summarize-plan.d.ts +0 -17
- package/dist/lib/summarize-plan.js +0 -124
- package/dist/lib/workflow-abi.d.ts +0 -129
- package/dist/lib/workflow-abi.js +0 -156
package/README.md
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
# Interf
|
|
1
|
+
# Interf
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Interf helps make data ready for agent work.
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
11
|
+
Interf runs local workflows that prepare and structure the files for the task before your agent uses them.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
A recent run in this repo on the CBRE chart sanity dataset produced:
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
22
|
+
Same task. Same saved checks. Same local setup.
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
## Why It Exists
|
|
25
25
|
|
|
26
|
-
|
|
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
|
-
|
|
29
|
-
```jsonc
|
|
30
|
-
{
|
|
31
|
-
"datasets": [
|
|
32
|
-
{
|
|
33
|
-
"name": "cbre-chart-sanity",
|
|
34
|
-
"path": ".",
|
|
35
|
-
"about": "Bristol historical take-up and availability chart lookup.",
|
|
36
|
-
"checks": [
|
|
37
|
-
{
|
|
38
|
-
"question": "What were Bristol's annual take-up values in 2018 and 2016?",
|
|
39
|
-
"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."
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"question": "What were Bristol's availability values in 2018 and 2016?",
|
|
43
|
-
"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."
|
|
44
|
-
}
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
]
|
|
48
|
-
}
|
|
49
|
-
```
|
|
50
|
-
<!-- PUBLIC_TEST_CHECKS:END -->
|
|
28
|
+
Interf keeps the loop honest:
|
|
51
29
|
|
|
52
|
-
|
|
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.
|
|
53
36
|
|
|
54
|
-
|
|
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.
|
|
37
|
+
## What You Get
|
|
56
38
|
|
|
57
|
-
A
|
|
39
|
+
A project using one dataset stays simple:
|
|
58
40
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
+
```
|
|
65
52
|
|
|
66
|
-
|
|
53
|
+
A compiled dataset looks like:
|
|
67
54
|
|
|
68
|
-
|
|
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.
|
|
69
69
|
|
|
70
70
|
## Quick Start
|
|
71
71
|
|
|
@@ -80,10 +80,10 @@ Install:
|
|
|
80
80
|
npm install -g @interf/compiler
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
-
Start from a
|
|
83
|
+
Start from a folder that already contains the files for the task:
|
|
84
84
|
|
|
85
85
|
```bash
|
|
86
|
-
cd ~/my-
|
|
86
|
+
cd ~/my-task-folder
|
|
87
87
|
interf
|
|
88
88
|
interf test
|
|
89
89
|
interf compile
|
|
@@ -93,41 +93,20 @@ interf test
|
|
|
93
93
|
The first run can:
|
|
94
94
|
|
|
95
95
|
- draft `interf.json`
|
|
96
|
-
-
|
|
97
|
-
-
|
|
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
|
|
98
98
|
- build the compiled dataset
|
|
99
|
-
- test the compiled dataset on the same
|
|
100
|
-
|
|
101
|
-
## What Interf Compiler Creates
|
|
102
|
-
|
|
103
|
-
After setup, the project root stays simple:
|
|
99
|
+
- let you test the compiled dataset on the same checks
|
|
104
100
|
|
|
105
|
-
|
|
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
|
|
101
|
+
If Interf cannot find your local executor setup, run:
|
|
109
102
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
- agent-readable summaries and cross-file notes
|
|
114
|
-
- `AGENTS.md`, `CLAUDE.md`, and generated local query skills
|
|
115
|
-
- workflow, test, and runtime state under `.interf/`
|
|
116
|
-
|
|
117
|
-
The compiled dataset is the folder your agent should work from.
|
|
118
|
-
|
|
119
|
-
## How It Works
|
|
120
|
-
|
|
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.
|
|
125
|
-
5. Optionally let Interf retry or improve the workflow until it passes or hits the configured limit.
|
|
103
|
+
```bash
|
|
104
|
+
interf doctor --live
|
|
105
|
+
```
|
|
126
106
|
|
|
127
|
-
Truth
|
|
107
|
+
## Truth Checks
|
|
128
108
|
|
|
129
|
-
-
|
|
130
|
-
- one expected answer
|
|
109
|
+
Truth checks are just question-and-answer pairs you already know how to verify from the files behind the task.
|
|
131
110
|
|
|
132
111
|
Good first truth checks are small and practical:
|
|
133
112
|
|
|
@@ -135,51 +114,75 @@ Good first truth checks are small and practical:
|
|
|
135
114
|
- one short statement that should be true or false
|
|
136
115
|
- one simple comparison across years, files, or sections
|
|
137
116
|
|
|
138
|
-
|
|
117
|
+
A maintained public test run in this repo uses checks like this:
|
|
139
118
|
|
|
140
|
-
|
|
141
|
-
|
|
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
|
+
}
|
|
142
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.
|
|
143
145
|
|
|
144
|
-
|
|
146
|
+
That comparison is the product record:
|
|
145
147
|
|
|
146
|
-
|
|
148
|
+
- same task
|
|
149
|
+
- same saved checks
|
|
150
|
+
- same local agent setup
|
|
151
|
+
- raw files on one side
|
|
152
|
+
- compiled dataset on the other
|
|
147
153
|
|
|
148
|
-
|
|
154
|
+
Use `interf test` on your own files instead of trusting a frozen benchmark snapshot in the docs.
|
|
149
155
|
|
|
150
|
-
|
|
156
|
+
Interf saves the latest comparison plus detailed raw and compiled runs under `interf/tests/` in the same folder.
|
|
151
157
|
|
|
152
|
-
|
|
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
|
|
159
|
-
- `interf test --keep-sandboxes` keeps every sandbox, even successful ones
|
|
158
|
+
## The Core Loop
|
|
160
159
|
|
|
161
|
-
|
|
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.
|
|
162
165
|
|
|
163
|
-
|
|
166
|
+
The project root owns dataset setup and saved truth checks. The compiled dataset carries the local runtime copy needed for repeat runs.
|
|
164
167
|
|
|
165
|
-
##
|
|
168
|
+
## Workflows
|
|
166
169
|
|
|
167
|
-
|
|
170
|
+
A workflow tells Interf how to prepare the files for this task.
|
|
168
171
|
|
|
169
|
-
|
|
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
|
+
```
|
|
170
177
|
|
|
171
|
-
|
|
172
|
-
- finance reporting
|
|
173
|
-
- board prep
|
|
174
|
-
- diligence review
|
|
178
|
+
Workflow creation supports two paths:
|
|
175
179
|
|
|
176
|
-
|
|
180
|
+
- draft a workflow from the current project with a local agent
|
|
181
|
+
- copy an existing workflow and edit stage guidance directly
|
|
177
182
|
|
|
178
|
-
|
|
179
|
-
- it gives that dataset its own compiled output under `interf/<dataset>/compiled/`
|
|
180
|
-
- it lets you test that dataset separately
|
|
183
|
+
After assignment, compile the dataset and run `interf test` on the same truth checks.
|
|
181
184
|
|
|
182
|
-
##
|
|
185
|
+
## Compile Loops
|
|
183
186
|
|
|
184
187
|
`max_attempts` is a retry budget for the same workflow variation.
|
|
185
188
|
|
|
@@ -190,7 +193,7 @@ Retries keep the target fixed:
|
|
|
190
193
|
- same truth checks
|
|
191
194
|
- same measurement
|
|
192
195
|
|
|
193
|
-
`max_loops` enables
|
|
196
|
+
`max_loops` enables self-improving workflow edits in the normal `interf compile` path.
|
|
194
197
|
|
|
195
198
|
In that loop, the thing that changes is the workflow itself.
|
|
196
199
|
|
|
@@ -198,43 +201,11 @@ Each loop can:
|
|
|
198
201
|
|
|
199
202
|
- run the current workflow variation on the dataset
|
|
200
203
|
- test it on the same truth checks
|
|
201
|
-
- inspect
|
|
202
|
-
-
|
|
203
|
-
-
|
|
204
|
-
- test the new variation on the same truth checks
|
|
205
|
-
|
|
206
|
-
- `max_attempts` retries the same workflow variation
|
|
207
|
-
- a self-improving loop creates and tests workflow variations
|
|
208
|
-
|
|
209
|
-
The workflow is the right surface for that kind of improvement because it is:
|
|
210
|
-
|
|
211
|
-
- the reusable artifact
|
|
212
|
-
- the human-reviewable method
|
|
213
|
-
- 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
|
|
214
207
|
|
|
215
|
-
Interf
|
|
216
|
-
|
|
217
|
-
Example `interf.json`:
|
|
218
|
-
|
|
219
|
-
```jsonc
|
|
220
|
-
{
|
|
221
|
-
"datasets": [
|
|
222
|
-
{
|
|
223
|
-
"name": "cbre-chart-sanity",
|
|
224
|
-
"max_attempts": 3, // retry compile + test for the same workflow until this dataset passes or hits this limit
|
|
225
|
-
"max_loops": 2, // workflow-editing loops after retries fail
|
|
226
|
-
"checks": [
|
|
227
|
-
{
|
|
228
|
-
"question": "What were Bristol's annual take-up values in 2018 and 2016?",
|
|
229
|
-
"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."
|
|
230
|
-
}
|
|
231
|
-
]
|
|
232
|
-
}
|
|
233
|
-
]
|
|
234
|
-
}
|
|
235
|
-
```
|
|
236
|
-
|
|
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.
|
|
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.
|
|
238
209
|
|
|
239
210
|
## Use It With Your Agent
|
|
240
211
|
|
|
@@ -243,54 +214,21 @@ If you already work through a local coding agent, it can run this process for yo
|
|
|
243
214
|
Paste something like this into your agent:
|
|
244
215
|
|
|
245
216
|
```text
|
|
246
|
-
Install
|
|
217
|
+
Install `@interf/compiler`, run `interf` in this folder, and use the local agent executor.
|
|
247
218
|
|
|
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
|
|
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.
|
|
249
220
|
|
|
250
221
|
Then run a files-as-is baseline if helpful, compile the dataset, and run `interf test`.
|
|
251
222
|
|
|
252
223
|
Tell me whether the compiled dataset passes the truth checks, and only recommend it if it does.
|
|
253
224
|
```
|
|
254
225
|
|
|
255
|
-
## Custom Workflows
|
|
256
|
-
|
|
257
|
-
Interf Compiler ships with a default workflow.
|
|
258
|
-
|
|
259
|
-
The built-in `interf` workflow runs three stages:
|
|
260
|
-
|
|
261
|
-
1. `summarize`
|
|
262
|
-
2. `structure`
|
|
263
|
-
3. `shape`
|
|
264
|
-
|
|
265
|
-
If you want to change how the workflow runs on your dataset, this is the part you customize:
|
|
266
|
-
|
|
267
|
-
```bash
|
|
268
|
-
interf create workflow
|
|
269
|
-
interf verify workflow --path <path>
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
Then test that workflow on the same dataset and the same truth checks.
|
|
273
|
-
|
|
274
|
-
Workflow docs live in [docs/workflow-spec.md](./docs/workflow-spec.md).
|
|
275
|
-
|
|
276
|
-
## Core Commands
|
|
277
|
-
|
|
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
|
|
281
|
-
- `interf create workflow` = create a reusable local seed workflow
|
|
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
|
|
284
|
-
- `interf doctor` = check local executor setup
|
|
285
|
-
- `interf verify <check>` = run deterministic checks on major workflow steps
|
|
286
|
-
- `interf reset <scope>` = remove generated state while keeping source files
|
|
287
|
-
|
|
288
226
|
## More Docs
|
|
289
227
|
|
|
290
|
-
- [docs/
|
|
291
|
-
- [docs/
|
|
292
|
-
- [docs/
|
|
293
|
-
- [docs/
|
|
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
|
|
294
232
|
|
|
295
233
|
Maintainers should use [CONTRIBUTING.md](./CONTRIBUTING.md) for test and release gates.
|
|
296
234
|
|
|
@@ -1,19 +1,31 @@
|
|
|
1
|
-
# Interf
|
|
1
|
+
# Interf (Built-in Workflow)
|
|
2
2
|
|
|
3
|
-
Interf
|
|
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
|
-
##
|
|
5
|
+
## Purpose
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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`.
|
|
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
|
|
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
|
|
10
|
-
-
|
|
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
|
|
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`, `
|
|
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
|
-
"
|
|
9
|
-
|
|
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
|
|
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.",
|