@interf/compiler 0.4.1 → 0.5.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 +70 -66
- package/builtin-workflows/interf/README.md +6 -6
- package/builtin-workflows/interf/compile/stages/shape/SKILL.md +7 -7
- package/builtin-workflows/interf/compile/stages/structure/SKILL.md +2 -2
- package/builtin-workflows/interf/compile/stages/summarize/SKILL.md +1 -1
- package/builtin-workflows/interf/{workspace.schema.json → compiled.schema.json} +5 -5
- package/builtin-workflows/interf/improve/SKILL.md +3 -3
- package/builtin-workflows/interf/use/query/SKILL.md +2 -2
- package/builtin-workflows/interf/workflow.json +42 -31
- package/dist/commands/check-draft.d.ts +19 -0
- package/dist/commands/check-draft.js +110 -0
- package/dist/commands/compile-controller.d.ts +4 -4
- package/dist/commands/compile-controller.js +117 -81
- package/dist/commands/compile.d.ts +5 -5
- package/dist/commands/compile.js +61 -62
- package/dist/commands/compiled-flow.d.ts +23 -0
- package/dist/commands/compiled-flow.js +112 -0
- package/dist/commands/create-workflow-wizard.d.ts +3 -3
- package/dist/commands/create-workflow-wizard.js +11 -11
- package/dist/commands/create.d.ts +2 -2
- package/dist/commands/create.js +50 -57
- package/dist/commands/default.js +2 -2
- package/dist/commands/executor-flow.d.ts +20 -1
- package/dist/commands/executor-flow.js +67 -7
- package/dist/commands/init.js +242 -289
- package/dist/commands/list.js +14 -10
- package/dist/commands/reset.js +6 -6
- package/dist/commands/source-config-wizard.d.ts +12 -8
- package/dist/commands/source-config-wizard.js +356 -119
- package/dist/commands/status.js +49 -26
- package/dist/commands/test-flow.d.ts +23 -10
- package/dist/commands/test-flow.js +274 -65
- package/dist/commands/test.d.ts +7 -1
- package/dist/commands/test.js +264 -65
- package/dist/commands/verify.js +23 -14
- package/dist/index.d.ts +7 -7
- package/dist/index.js +4 -4
- package/dist/lib/agent-args.js +2 -1
- package/dist/lib/agent-constants.js +1 -1
- package/dist/lib/agent-render.js +4 -4
- package/dist/lib/agent-shells.d.ts +8 -8
- package/dist/lib/agent-shells.js +231 -142
- package/dist/lib/{workflow-abi.d.ts → builtin-compiled-workflow.d.ts} +37 -46
- package/dist/lib/builtin-compiled-workflow.js +153 -0
- package/dist/lib/compiled-compile.d.ts +52 -0
- package/dist/lib/compiled-compile.js +274 -0
- package/dist/lib/compiled-home.d.ts +5 -0
- package/dist/lib/compiled-home.js +32 -0
- package/dist/lib/compiled-paths.d.ts +39 -0
- package/dist/lib/compiled-paths.js +103 -0
- package/dist/lib/{workspace-raw.d.ts → compiled-raw.d.ts} +9 -8
- package/dist/lib/{workspace-raw.js → compiled-raw.js} +16 -14
- package/dist/lib/compiled-reset.d.ts +1 -0
- package/dist/lib/compiled-reset.js +44 -0
- package/dist/lib/compiled-schema.d.ts +27 -0
- package/dist/lib/compiled-schema.js +110 -0
- package/dist/lib/config.d.ts +0 -1
- package/dist/lib/config.js +0 -1
- package/dist/lib/discovery.d.ts +1 -1
- package/dist/lib/discovery.js +3 -3
- package/dist/lib/interf-bootstrap.d.ts +1 -1
- package/dist/lib/interf-bootstrap.js +4 -4
- package/dist/lib/interf-detect.d.ts +9 -10
- package/dist/lib/interf-detect.js +70 -59
- package/dist/lib/interf-scaffold.d.ts +2 -2
- package/dist/lib/interf-scaffold.js +90 -57
- package/dist/lib/interf-workflow-package.d.ts +3 -3
- package/dist/lib/interf-workflow-package.js +30 -30
- package/dist/lib/interf.d.ts +5 -5
- package/dist/lib/interf.js +4 -4
- package/dist/lib/local-workflows.d.ts +4 -4
- package/dist/lib/local-workflows.js +35 -70
- package/dist/lib/obsidian.d.ts +1 -1
- package/dist/lib/parse.js +92 -1
- package/dist/lib/project-paths.d.ts +11 -0
- package/dist/lib/project-paths.js +32 -0
- package/dist/lib/runtime-acceptance.d.ts +7 -1
- package/dist/lib/runtime-acceptance.js +194 -59
- package/dist/lib/runtime-contracts.d.ts +2 -4
- package/dist/lib/runtime-contracts.js +17 -161
- package/dist/lib/runtime-inventory.d.ts +7 -0
- package/dist/lib/runtime-inventory.js +29 -0
- package/dist/lib/runtime-paths.js +5 -5
- package/dist/lib/runtime-prompt.js +7 -6
- package/dist/lib/runtime-reconcile.d.ts +2 -3
- package/dist/lib/runtime-reconcile.js +94 -184
- package/dist/lib/runtime-runs.js +25 -119
- package/dist/lib/runtime-types.d.ts +10 -19
- package/dist/lib/runtime.d.ts +2 -2
- package/dist/lib/runtime.js +1 -1
- package/dist/lib/schema.d.ts +169 -153
- package/dist/lib/schema.js +116 -164
- package/dist/lib/source-config.d.ts +24 -20
- package/dist/lib/source-config.js +159 -122
- package/dist/lib/state-artifacts.d.ts +5 -5
- package/dist/lib/state-artifacts.js +8 -8
- package/dist/lib/state-health.d.ts +4 -4
- package/dist/lib/state-health.js +110 -126
- package/dist/lib/state-io.d.ts +8 -8
- package/dist/lib/state-io.js +21 -102
- package/dist/lib/state-paths.js +5 -5
- package/dist/lib/state-view.d.ts +4 -4
- package/dist/lib/state-view.js +52 -55
- package/dist/lib/state.d.ts +5 -5
- package/dist/lib/state.js +4 -4
- package/dist/lib/summarize-plan.d.ts +3 -2
- package/dist/lib/summarize-plan.js +19 -21
- package/dist/lib/test-execution.js +9 -9
- package/dist/lib/test-matrices.d.ts +3 -3
- package/dist/lib/test-matrices.js +6 -6
- package/dist/lib/test-paths.d.ts +4 -4
- package/dist/lib/test-paths.js +26 -11
- package/dist/lib/test-sandbox.d.ts +1 -1
- package/dist/lib/test-sandbox.js +32 -38
- package/dist/lib/test-specs.js +1 -1
- package/dist/lib/test-targets.d.ts +2 -2
- package/dist/lib/test-targets.js +11 -11
- package/dist/lib/test-types.d.ts +1 -1
- package/dist/lib/test.d.ts +1 -1
- package/dist/lib/test.js +1 -1
- package/dist/lib/util.d.ts +2 -0
- package/dist/lib/util.js +14 -1
- package/dist/lib/validate-compiled.d.ts +27 -0
- package/dist/lib/validate-compiled.js +238 -0
- package/dist/lib/validate-helpers.d.ts +0 -8
- package/dist/lib/validate-helpers.js +0 -30
- package/dist/lib/validate.d.ts +6 -4
- package/dist/lib/validate.js +76 -27
- package/dist/lib/workflow-definitions.d.ts +12 -11
- package/dist/lib/workflow-definitions.js +45 -55
- package/dist/lib/workflow-helpers.d.ts +2 -3
- package/dist/lib/workflow-helpers.js +9 -13
- package/dist/lib/workflow-improvement.d.ts +3 -3
- package/dist/lib/workflow-improvement.js +48 -48
- package/dist/lib/workflow-primitives.d.ts +2 -0
- package/dist/lib/workflow-primitives.js +5 -0
- package/dist/lib/workflow-review-paths.d.ts +3 -3
- package/dist/lib/workflow-review-paths.js +11 -11
- package/dist/lib/workflow-stage-runner.d.ts +1 -1
- package/dist/lib/workflow-stage-runner.js +8 -8
- package/dist/lib/workflows.d.ts +9 -9
- package/dist/lib/workflows.js +15 -17
- package/package.json +13 -12
- package/dist/commands/workspace-flow.d.ts +0 -23
- package/dist/commands/workspace-flow.js +0 -109
- package/dist/lib/registry.d.ts +0 -16
- package/dist/lib/registry.js +0 -65
- package/dist/lib/validate-workspace.d.ts +0 -121
- package/dist/lib/validate-workspace.js +0 -407
- package/dist/lib/workflow-abi.js +0 -181
- package/dist/lib/workspace-compile.d.ts +0 -54
- package/dist/lib/workspace-compile.js +0 -476
- package/dist/lib/workspace-home.d.ts +0 -5
- package/dist/lib/workspace-home.js +0 -32
- package/dist/lib/workspace-layout.d.ts +0 -2
- package/dist/lib/workspace-layout.js +0 -60
- package/dist/lib/workspace-paths.d.ts +0 -41
- package/dist/lib/workspace-paths.js +0 -107
- package/dist/lib/workspace-reset.d.ts +0 -1
- package/dist/lib/workspace-reset.js +0 -43
- package/dist/lib/workspace-schema.d.ts +0 -17
- package/dist/lib/workspace-schema.js +0 -74
package/README.md
CHANGED
|
@@ -2,22 +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
|
|
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 for your dataset, measure a baseline on the raw files, then compile and retest the
|
|
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
|
-
If it still fails, self-improving loops can revise the workflow, rebuild the
|
|
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.
|
|
10
10
|
|
|
11
11
|
## Why Use It
|
|
12
12
|
|
|
13
13
|
Interf Compiler is built around a few simple principles:
|
|
14
14
|
|
|
15
|
-
- `Explicit`: the compiled
|
|
16
|
-
- `Yours`: the dataset, workflow,
|
|
17
|
-
- `File over app`: the compiled
|
|
18
|
-
- `Source-backed`: your raw files stay the source of truth; the compiled
|
|
19
|
-
- `Bring your own agent`: the same
|
|
20
|
-
- `Self-improving`: when truth checks fail, Interf can retry the workflow or revise it, rebuild the
|
|
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.
|
|
21
21
|
|
|
22
22
|
## Example: Truth Checks
|
|
23
23
|
|
|
@@ -28,7 +28,7 @@ A maintained public test run in this repo uses checks like this:
|
|
|
28
28
|
<!-- PUBLIC_TEST_CHECKS:START -->
|
|
29
29
|
```jsonc
|
|
30
30
|
{
|
|
31
|
-
"
|
|
31
|
+
"datasets": [
|
|
32
32
|
{
|
|
33
33
|
"name": "cbre-chart-sanity",
|
|
34
34
|
"about": "Bristol historical take-up and availability chart lookup.",
|
|
@@ -50,21 +50,21 @@ A maintained public test run in this repo uses checks like this:
|
|
|
50
50
|
|
|
51
51
|
## Example: `interf test`
|
|
52
52
|
|
|
53
|
-
`interf test` compares
|
|
54
|
-
|
|
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.
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
A recent maintained internal run on the CBRE chart sanity dataset produced:
|
|
57
|
+
|
|
58
|
+
<!-- PUBLIC_BENCHMARK_TABLE:START -->
|
|
59
|
+
| Agent | Files as-is | Compiled dataset |
|
|
58
60
|
| --- | --- | --- |
|
|
59
61
|
| Codex (GPT-5.4, xhigh) | `2/2` | `2/2` |
|
|
60
|
-
| Claude Code (Claude Opus 4.6
|
|
61
|
-
<!--
|
|
62
|
-
|
|
63
|
-
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.
|
|
62
|
+
| Claude Code (Claude Opus 4.6, max) | `0/2` | `2/2` |
|
|
63
|
+
<!-- PUBLIC_BENCHMARK_TABLE:END -->
|
|
64
64
|
|
|
65
|
-
Use `interf test` on your own dataset to measure files as-is versus the compiled
|
|
65
|
+
Use `interf test` on your own dataset to measure files as-is versus the compiled dataset on the same checks.
|
|
66
66
|
|
|
67
|
-
Each
|
|
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/`.
|
|
68
68
|
|
|
69
69
|
## Quick Start
|
|
70
70
|
|
|
@@ -79,47 +79,48 @@ Install:
|
|
|
79
79
|
npm install -g @interf/compiler
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
Start from
|
|
82
|
+
Start from a project folder that contains one or more dataset folders:
|
|
83
83
|
|
|
84
84
|
```bash
|
|
85
|
-
cd ~/my-
|
|
85
|
+
cd ~/my-interf-project
|
|
86
86
|
interf
|
|
87
|
+
interf test
|
|
87
88
|
interf compile
|
|
88
89
|
interf test
|
|
89
90
|
```
|
|
90
91
|
|
|
91
92
|
The first run can:
|
|
92
93
|
|
|
93
|
-
-
|
|
94
|
+
- draft `interf.json`
|
|
95
|
+
- auto-create a draft set of truth checks for a dataset folder, or let you add them manually
|
|
94
96
|
- test your files as-is first on those same checks
|
|
95
|
-
- build the compiled
|
|
96
|
-
- test the compiled
|
|
97
|
+
- build the compiled dataset
|
|
98
|
+
- test the compiled dataset on the same truth checks
|
|
97
99
|
|
|
98
100
|
## What Interf Compiler Creates
|
|
99
101
|
|
|
100
|
-
After setup, the
|
|
102
|
+
After setup, the project root stays simple:
|
|
101
103
|
|
|
102
|
-
- `interf
|
|
103
|
-
- `interf
|
|
104
|
-
- `interf
|
|
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
|
|
105
108
|
|
|
106
|
-
|
|
109
|
+
A compiled dataset is a folder on top of your dataset. It includes:
|
|
107
110
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
- a workspace-local `raw/` snapshot for direct evidence and verification
|
|
111
|
+
- a local `raw/` snapshot for direct evidence and verification
|
|
111
112
|
- agent-readable summaries and cross-file notes
|
|
112
113
|
- `AGENTS.md`, `CLAUDE.md`, and generated local query skills
|
|
113
|
-
-
|
|
114
|
+
- workflow, test, and runtime state under `.interf/`
|
|
114
115
|
|
|
115
|
-
The compiled
|
|
116
|
+
The compiled dataset is the folder your agent should work from.
|
|
116
117
|
|
|
117
118
|
## How It Works
|
|
118
119
|
|
|
119
|
-
1. Save a few truth checks for
|
|
120
|
-
2. Optionally test
|
|
121
|
-
3. Build the compiled
|
|
122
|
-
4. Test the compiled
|
|
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.
|
|
123
124
|
5. Optionally let Interf retry or improve the workflow until it passes or hits the configured limit.
|
|
124
125
|
|
|
125
126
|
Truth checks are simple:
|
|
@@ -133,7 +134,7 @@ Good first truth checks are small and practical:
|
|
|
133
134
|
- one short statement that should be true or false
|
|
134
135
|
- one simple comparison across years, files, or sections
|
|
135
136
|
|
|
136
|
-
If `interf.
|
|
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:
|
|
137
138
|
|
|
138
139
|
```bash
|
|
139
140
|
interf doctor
|
|
@@ -141,38 +142,41 @@ interf doctor
|
|
|
141
142
|
|
|
142
143
|
## What `interf test` Does
|
|
143
144
|
|
|
144
|
-
By default, if a compiled
|
|
145
|
+
By default, if a compiled dataset exists, it runs both sides and saves one latest comparison under `interf/tests/<dataset>/latest.json`.
|
|
146
|
+
|
|
147
|
+
You can also select one or more detected local agents in the CLI and compare them in one table.
|
|
145
148
|
|
|
146
149
|
For live runs:
|
|
147
150
|
|
|
148
|
-
-
|
|
149
|
-
- compiled-
|
|
150
|
-
- both sides use the same saved truth checks from
|
|
151
|
-
- neither sandbox includes the
|
|
152
|
-
- detailed
|
|
153
|
-
-
|
|
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
|
|
154
158
|
- `interf test --keep-sandboxes` keeps every sandbox, even successful ones
|
|
155
159
|
|
|
156
|
-
From inside a
|
|
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.
|
|
157
161
|
|
|
158
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`.
|
|
159
163
|
|
|
160
|
-
## Advanced:
|
|
164
|
+
## Advanced: Multiple Datasets
|
|
161
165
|
|
|
162
|
-
Most
|
|
166
|
+
Most projects only need one dataset entry.
|
|
163
167
|
|
|
164
|
-
|
|
168
|
+
Add another only when you want a different dataset folder, focus, or set of truth checks, for example:
|
|
165
169
|
|
|
166
170
|
- general folder understanding
|
|
167
171
|
- finance reporting
|
|
168
172
|
- board prep
|
|
169
173
|
- diligence review
|
|
170
174
|
|
|
171
|
-
Why
|
|
175
|
+
Why add another:
|
|
172
176
|
|
|
173
177
|
- it keeps a separate set of truth checks
|
|
174
|
-
- it gives that
|
|
175
|
-
- it lets you test that
|
|
178
|
+
- it gives that dataset its own compiled output under `interf/<dataset>/`
|
|
179
|
+
- it lets you test that dataset separately
|
|
176
180
|
|
|
177
181
|
## Advanced: Compile Loops
|
|
178
182
|
|
|
@@ -209,14 +213,14 @@ The workflow is the right surface for that kind of improvement because it is:
|
|
|
209
213
|
|
|
210
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.
|
|
211
215
|
|
|
212
|
-
Example
|
|
216
|
+
Example `interf.json`:
|
|
213
217
|
|
|
214
218
|
```jsonc
|
|
215
219
|
{
|
|
216
|
-
"
|
|
220
|
+
"datasets": [
|
|
217
221
|
{
|
|
218
222
|
"name": "cbre-chart-sanity",
|
|
219
|
-
"max_attempts": 3, // retry compile + test for the same workflow until this
|
|
223
|
+
"max_attempts": 3, // retry compile + test for the same workflow until this dataset passes or hits this limit
|
|
220
224
|
"max_loops": 2, // workflow-editing loops after retries fail
|
|
221
225
|
"checks": [
|
|
222
226
|
{
|
|
@@ -229,7 +233,7 @@ Example workspace config:
|
|
|
229
233
|
}
|
|
230
234
|
```
|
|
231
235
|
|
|
232
|
-
Use the normal
|
|
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.
|
|
233
237
|
|
|
234
238
|
## Use It With Your Agent
|
|
235
239
|
|
|
@@ -240,11 +244,11 @@ Paste something like this into your agent:
|
|
|
240
244
|
```text
|
|
241
245
|
Install @interf/compiler, run `interf` in this folder, and use the local agent executor.
|
|
242
246
|
|
|
243
|
-
If `interf.
|
|
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.
|
|
244
248
|
|
|
245
|
-
Then run a
|
|
249
|
+
Then run a files-as-is baseline if helpful, compile the dataset, and run `interf test`.
|
|
246
250
|
|
|
247
|
-
Tell me whether the compiled
|
|
251
|
+
Tell me whether the compiled dataset passes the truth checks, and only recommend it if it does.
|
|
248
252
|
```
|
|
249
253
|
|
|
250
254
|
## Custom Workflows
|
|
@@ -270,12 +274,12 @@ Workflow docs live in [docs/workflow-spec.md](./docs/workflow-spec.md).
|
|
|
270
274
|
|
|
271
275
|
## Core Commands
|
|
272
276
|
|
|
273
|
-
- `interf` = open the root
|
|
274
|
-
- `interf init` = alias for the root
|
|
275
|
-
- `interf create
|
|
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
|
|
276
280
|
- `interf create workflow` = create a reusable local seed workflow
|
|
277
|
-
- `interf compile` = build a selected
|
|
278
|
-
- `interf test` = compare
|
|
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
|
|
279
283
|
- `interf doctor` = check local executor setup
|
|
280
284
|
- `interf verify <check>` = run deterministic checks on major workflow steps
|
|
281
285
|
- `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
|
|
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
|
-
- `
|
|
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. (
|
|
16
|
-
- `structure` — Build the cross-file knowledge structure from the summaries. (
|
|
17
|
-
- `shape` — Shape the final
|
|
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
|
|
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
|
|
3
|
+
Shape the final compiled dataset around the saved focus and truth checks.
|
|
4
4
|
|
|
5
|
-
Contract type: `
|
|
5
|
+
Contract type: `compiled-query-shape`
|
|
6
6
|
|
|
7
7
|
## Requirements
|
|
8
8
|
|
|
9
|
-
- Use the
|
|
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
|
|
18
|
+
- Do not copy expected answers into the compiled dataset.
|
|
19
19
|
|
|
20
20
|
## Notes
|
|
21
21
|
|
|
22
|
-
- Use the
|
|
23
|
-
- Do not copy expected answers into the final
|
|
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
|
|
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: `
|
|
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
|
|
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/`.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"kind": "
|
|
2
|
+
"kind": "compiled-schema",
|
|
3
3
|
"version": 1,
|
|
4
|
-
"target_type": "
|
|
5
|
-
"label": "Interf Compiler (Recommended)
|
|
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": "
|
|
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
|
|
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
|
|
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
|
|
12
|
-
4. Keep `workflow.json`, `
|
|
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
|
|
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
|
|
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": "
|
|
3
|
+
"type": "compiled",
|
|
4
4
|
"compiler_api": {
|
|
5
|
-
"kind": "
|
|
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
|
|
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": "
|
|
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
|
-
"
|
|
26
|
-
"
|
|
25
|
+
"stage_truthy": [
|
|
26
|
+
"finished_at"
|
|
27
27
|
],
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
28
|
+
"zone_counts_at_least_counts": {
|
|
29
|
+
"summaries": "source_total"
|
|
30
|
+
},
|
|
31
|
+
"markdown_frontmatter_valid_zones": [
|
|
32
|
+
"summaries"
|
|
31
33
|
],
|
|
32
|
-
"
|
|
33
|
-
"
|
|
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": "
|
|
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
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"inventory_complete"
|
|
58
|
+
"stage_truthy": [
|
|
59
|
+
"finished_at"
|
|
59
60
|
],
|
|
60
|
-
"
|
|
61
|
-
"
|
|
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
|
|
69
|
-
"contract_type": "
|
|
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
|
-
"
|
|
88
|
-
"
|
|
89
|
-
|
|
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
|
-
"
|
|
92
|
-
"
|
|
93
|
-
|
|
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
|
|
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
|
|
114
|
-
"Do not copy expected answers into the final
|
|
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
|
|
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
|
+
}>;
|