@interf/compiler 0.6.3 → 0.6.4

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 (115) hide show
  1. package/README.md +70 -64
  2. package/dist/cli/commands/check-draft.js +4 -4
  3. package/dist/cli/commands/compile-controller.js +23 -23
  4. package/dist/cli/commands/compile.js +2 -2
  5. package/dist/cli/commands/compiled-flow.js +4 -4
  6. package/dist/cli/commands/create-workflow-wizard.js +8 -8
  7. package/dist/cli/commands/create.js +5 -5
  8. package/dist/cli/commands/default.js +1 -1
  9. package/dist/cli/commands/init.js +43 -43
  10. package/dist/cli/commands/list.js +2 -2
  11. package/dist/cli/commands/reset.js +1 -1
  12. package/dist/cli/commands/source-config-wizard.d.ts +1 -1
  13. package/dist/cli/commands/source-config-wizard.js +40 -40
  14. package/dist/cli/commands/status.js +5 -5
  15. package/dist/cli/commands/test-flow.js +26 -26
  16. package/dist/cli/commands/test.js +12 -12
  17. package/dist/lib/chart-guidance.d.ts +1 -1
  18. package/dist/lib/chart-guidance.js +1 -8
  19. package/dist/lib/discovery.d.ts +1 -7
  20. package/dist/lib/discovery.js +1 -84
  21. package/dist/lib/filesystem.d.ts +1 -2
  22. package/dist/lib/filesystem.js +1 -55
  23. package/dist/lib/logger.d.ts +1 -3
  24. package/dist/lib/logger.js +1 -10
  25. package/dist/lib/parse.d.ts +1 -8
  26. package/dist/lib/parse.js +1 -145
  27. package/dist/lib/util.d.ts +1 -4
  28. package/dist/lib/util.js +1 -25
  29. package/dist/packages/agents/index.d.ts +1 -0
  30. package/dist/packages/agents/index.js +1 -0
  31. package/dist/packages/agents/lib/chart-guidance.d.ts +1 -0
  32. package/dist/packages/agents/lib/chart-guidance.js +8 -0
  33. package/dist/packages/agents/lib/compiled-bootstrap.d.ts +3 -0
  34. package/dist/packages/agents/lib/compiled-bootstrap.js +18 -0
  35. package/dist/packages/agents/lib/executors.d.ts +2 -2
  36. package/dist/packages/agents/lib/shells.d.ts +3 -1
  37. package/dist/packages/agents/lib/shells.js +22 -20
  38. package/dist/packages/agents/lib/user-config.js +1 -1
  39. package/dist/packages/compiler/compiled-compile.d.ts +4 -48
  40. package/dist/packages/compiler/compiled-compile.js +4 -256
  41. package/dist/packages/compiler/compiled-paths.d.ts +40 -0
  42. package/dist/packages/compiler/compiled-paths.js +106 -0
  43. package/dist/packages/compiler/compiled-pipeline.d.ts +39 -0
  44. package/dist/packages/compiler/compiled-pipeline.js +134 -0
  45. package/dist/packages/compiler/compiled-schema.js +2 -2
  46. package/dist/packages/compiler/compiled-stage-plan.d.ts +15 -0
  47. package/dist/packages/compiler/compiled-stage-plan.js +79 -0
  48. package/dist/packages/compiler/compiled-stage-runner.d.ts +10 -0
  49. package/dist/packages/compiler/compiled-stage-runner.js +46 -0
  50. package/dist/packages/compiler/compiled-target.d.ts +11 -0
  51. package/dist/packages/compiler/compiled-target.js +16 -0
  52. package/dist/packages/compiler/discovery.d.ts +7 -0
  53. package/dist/packages/compiler/discovery.js +80 -0
  54. package/dist/packages/compiler/lib/schema.js +2 -0
  55. package/dist/packages/compiler/raw-snapshot.d.ts +49 -0
  56. package/dist/packages/compiler/raw-snapshot.js +102 -0
  57. package/dist/packages/compiler/reset.d.ts +2 -0
  58. package/dist/packages/compiler/reset.js +72 -0
  59. package/dist/packages/compiler/runtime-acceptance.js +3 -3
  60. package/dist/packages/compiler/runtime-contracts.js +1 -1
  61. package/dist/packages/compiler/runtime-paths.js +1 -1
  62. package/dist/packages/compiler/runtime-reconcile.js +3 -3
  63. package/dist/packages/compiler/runtime-runs.js +2 -2
  64. package/dist/packages/compiler/state-health.js +3 -3
  65. package/dist/packages/compiler/state-io.js +3 -3
  66. package/dist/packages/compiler/state-paths.js +1 -1
  67. package/dist/packages/compiler/state-view.js +2 -2
  68. package/dist/packages/compiler/validate-compiled.js +3 -3
  69. package/dist/packages/compiler/validate.js +4 -4
  70. package/dist/packages/project-model/compiled-paths.d.ts +1 -40
  71. package/dist/packages/project-model/compiled-paths.js +1 -106
  72. package/dist/packages/project-model/compiled-raw.d.ts +1 -49
  73. package/dist/packages/project-model/compiled-raw.js +1 -102
  74. package/dist/packages/project-model/compiled-reset.d.ts +1 -2
  75. package/dist/packages/project-model/compiled-reset.js +1 -72
  76. package/dist/packages/project-model/interf-bootstrap.d.ts +1 -3
  77. package/dist/packages/project-model/interf-bootstrap.js +1 -18
  78. package/dist/packages/project-model/interf-detect.js +4 -4
  79. package/dist/packages/project-model/interf-scaffold.js +7 -7
  80. package/dist/packages/project-model/source-config.js +6 -5
  81. package/dist/packages/shared/file-types.d.ts +1 -0
  82. package/dist/packages/shared/file-types.js +4 -0
  83. package/dist/packages/shared/filesystem.d.ts +2 -0
  84. package/dist/packages/shared/filesystem.js +55 -0
  85. package/dist/packages/shared/index.d.ts +7 -0
  86. package/dist/packages/shared/index.js +7 -0
  87. package/dist/packages/shared/logger.d.ts +3 -0
  88. package/dist/packages/shared/logger.js +10 -0
  89. package/dist/packages/shared/naming.d.ts +1 -0
  90. package/dist/packages/shared/naming.js +8 -0
  91. package/dist/packages/shared/parse.d.ts +8 -0
  92. package/dist/packages/shared/parse.js +145 -0
  93. package/dist/packages/shared/path-guards.d.ts +2 -0
  94. package/dist/packages/shared/path-guards.js +14 -0
  95. package/dist/packages/shared/util.d.ts +3 -0
  96. package/dist/packages/shared/util.js +3 -0
  97. package/dist/packages/testing/test-execution.js +3 -3
  98. package/dist/packages/testing/test-paths.js +1 -1
  99. package/dist/packages/testing/test-sandbox.js +3 -3
  100. package/dist/packages/testing/test-specs.js +1 -1
  101. package/dist/packages/workflow-authoring/workflow-authoring.js +5 -4
  102. package/dist/packages/workflow-authoring/workflow-improvement.js +6 -5
  103. package/dist/packages/workflow-package/builtin-compiled-workflow.js +1 -1
  104. package/dist/packages/workflow-package/context-interface.d.ts +96 -0
  105. package/dist/packages/workflow-package/context-interface.js +146 -0
  106. package/dist/packages/workflow-package/index.d.ts +2 -0
  107. package/dist/packages/workflow-package/index.js +2 -0
  108. package/dist/packages/workflow-package/interf-workflow-package.js +75 -28
  109. package/dist/packages/workflow-package/local-workflows.d.ts +5 -2
  110. package/dist/packages/workflow-package/local-workflows.js +15 -13
  111. package/dist/packages/workflow-package/workflow-definitions.d.ts +11 -7
  112. package/dist/packages/workflow-package/workflow-definitions.js +10 -3
  113. package/dist/packages/workflow-package/workflow-helpers.js +4 -4
  114. package/dist/packages/workflow-package/workflow-review-paths.js +1 -1
  115. package/package.json +2 -2
package/README.md CHANGED
@@ -1,22 +1,14 @@
1
1
  # Interf
2
2
 
3
- Interf prepares task context for your agents.
3
+ Interf prepares context for your agents.
4
4
 
5
- Start with the files behind a task and a few checks. Interf tests the files as-is first, shows what already works, and builds a local context folder when the current context is not good enough.
5
+ Start with the files for the work you want to do. Tell Interf what you need, let it suggest a few questions to check later, and build portable context when the files alone are not enough.
6
6
 
7
- The result is a real folder your agent can open and work from. Interf retests it on the same checks, and self-improving loops can revise the workflow and try again until it passes or reaches the loop limit.
7
+ It writes the result as a local folder inside your project. Your agents can use that folder directly, and Interf can check it on the same questions to show whether it actually helped.
8
8
 
9
- Raw files stay the source of truth. The context folder adds task-specific structure on top of them.
9
+ Your source files stay the source of truth. Interf builds on them; it does not replace them.
10
10
 
11
- ```bash
12
- cd ~/my-project
13
- interf
14
- interf test
15
- interf compile
16
- interf test
17
- ```
18
-
19
- The context folder Interf builds is rooted at:
11
+ Interf calls that folder portable context:
20
12
 
21
13
  ```text
22
14
  interf/<dataset>/
@@ -31,45 +23,52 @@ interf/<dataset>/
31
23
  tests/
32
24
  ```
33
25
 
34
- A recent run in this repo on the CBRE chart sanity task produced:
26
+ For example, this repo tests a PDF market report with questions like:
27
+
28
+ - `What were Bristol's annual take-up values in 2018 and 2016?`
29
+ - `What were Bristol's availability values in 2018 and 2016?`
30
+
31
+ On those same questions, a recent run in this repo produced:
35
32
 
36
33
  <!-- PUBLIC_BENCHMARK_TABLE:START -->
37
- | Agent | Files as-is | Context folder |
34
+ | Agent | Source files | Portable context |
38
35
  | --- | --- | --- |
39
36
  | Codex (GPT-5.4, xhigh) | `2/2` | `2/2` |
40
37
  | Claude Code (Claude Opus 4.6, max) | `0/2` | `2/2` |
41
38
  <!-- PUBLIC_BENCHMARK_TABLE:END -->
42
39
 
43
- Those scores came from checks like:
40
+ That means:
44
41
 
45
- - `What were Bristol's annual take-up values in 2018 and 2016?`
46
- - `What were Bristol's availability values in 2018 and 2016?`
42
+ - Codex already passed on the source files.
43
+ - Claude Code failed on the source files.
44
+ - Both passed after Interf built the portable context.
47
45
 
48
- Same task. Same checks. Same local setup.
46
+ Same work. Same questions. Same local setup.
49
47
 
50
48
  ## How It Works
51
49
 
52
- 1. Start with a task and the files relevant to it.
53
- 2. Save a few checks that tell Interf what "ready" means for that task.
54
- 3. Run a workflow that prepares a source-backed context folder for the task.
55
- 4. Test the result on the same checks and keep it only if it helped.
50
+ 1. Start with the files for the work.
51
+ 2. Tell Interf what you need from them.
52
+ 3. Let Interf recommend a few questions to check accuracy later, or edit them yourself.
53
+ 4. Build the portable context for that work.
54
+ 5. Run `interf test` on the same questions and keep the result only if it helped.
56
55
 
57
- The raw baseline is still important. It shows what already works on the files as-is and which local agent performs best before you spend time improving anything.
56
+ Checking the source files first is still important. It shows what already works and which local agent performs best before you spend time improving anything.
58
57
 
59
58
  ## Why It Exists
60
59
 
61
- Local agents can open raw files and still reason badly over them. Reports, decks, transcripts, exports, PDFs, notes, and mixed folders may all be present, but they are often missing the structure a real task needs.
60
+ Local agents can open raw files and still reason badly over them. Reports, decks, transcripts, exports, PDFs, notes, and mixed folders may all be present, but they are often missing the structure a real piece of work needs.
62
61
 
63
- Interf takes the files behind a task, prepares them into a local context folder your agents can use, and then proves whether the result helped.
62
+ Interf takes the files for the work, builds a local folder your agents can use, and then checks whether it actually helped.
64
63
 
65
- Interf keeps the loop honest:
64
+ Interf is built around a few simple rules:
66
65
 
67
- - `Value first`: prepare the data for a specific task, not just dump files into another app.
68
- - `Proof-backed`: test raw files and the prepared result on the same checks.
69
- - `One folder`: the context folder is a real folder you can inspect, diff, review, and version.
70
- - `Source-backed`: raw files remain the source of truth.
71
- - `Bring your own agent`: use the context folder manually from other local agents too. Automated Interf runs currently support Claude Code and Codex.
72
- - `Self-improving`: when 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.
66
+ - Start from the files you already have.
67
+ - Check the source files and the portable context on the same questions.
68
+ - Keep the result in a local folder you can inspect, diff, review, and version.
69
+ - Keep raw files as the source of truth.
70
+ - Use the portable context manually from Claude Code, Codex, or another local agent. Automated Interf runs currently support Claude Code and Codex.
71
+ - If the first pass is not good enough, let Interf revise the workflow and try again. Retries keep the same workflow variation; loops change the workflow itself.
73
72
 
74
73
  ## What You Get
75
74
 
@@ -88,7 +87,7 @@ your-project/
88
87
  <dataset>/
89
88
  ```
90
89
 
91
- The context folder is the folder your agents should work from after Interf prepares the data for the task.
90
+ After Interf runs, point your agents at the portable context first. Go back to the source files whenever you need to verify something.
92
91
 
93
92
  ## Quick Start
94
93
 
@@ -103,17 +102,18 @@ Install:
103
102
  npm install -g @interf/compiler
104
103
  ```
105
104
 
106
- Start from a project folder that contains one or more source folders for the task.
105
+ Start from a project folder that contains one or more source folders for the work.
107
106
 
108
107
  The first run can:
109
108
 
110
109
  - draft `interf.json`
111
- - let you choose the source folder for the task
110
+ - let you choose the source folder for the work
112
111
  - default the dataset id from that folder name, then let you change it
113
- - help you create checks for the task, or let you add them manually
114
- - run a files-as-is baseline on those checks so you can see what already works
115
- - build the context folder that stores the compiled context
116
- - let you test the context folder on the same checks
112
+ - ask what work you need help with
113
+ - recommend questions to check accuracy later, or let you add them manually
114
+ - run a source-files baseline on those questions so you can see what already works
115
+ - build the portable context for that work
116
+ - let you check the portable context on the same questions
117
117
 
118
118
  If Interf cannot find your local executor setup, run:
119
119
 
@@ -121,19 +121,23 @@ If Interf cannot find your local executor setup, run:
121
121
  interf doctor --live
122
122
  ```
123
123
 
124
- ## Checks
124
+ ## Questions
125
125
 
126
- Checks are the questions and expected answers Interf uses to prove whether the prepared result is good enough for this task.
126
+ Interf uses simple question-and-answer checks to see whether the portable context is good enough for this work.
127
127
 
128
- They are just question-and-answer pairs you already know how to verify from the files behind the task.
128
+ Each saved check stores a question and the expected answer. In `interf.json`, those definitions live under the technical field `checks[]`.
129
129
 
130
- Good first checks are small and practical:
130
+ They are just question-and-answer pairs you can verify from the files you selected for the work.
131
+
132
+ You do not need to write them from scratch before you know the data well. Interf can recommend a starting set from the files and the work description, then you can confirm, edit, or replace them. Their job is simple: check accuracy before you trust the portable context.
133
+
134
+ Good first questions are small and practical:
131
135
 
132
136
  - one exact number from a chart, table, or filing
133
137
  - one short statement that should be true or false
134
138
  - one simple comparison across years, files, or sections
135
139
 
136
- A maintained public test run in this repo uses checks like this:
140
+ A maintained public test example in this repo stores them like this:
137
141
 
138
142
  <!-- PUBLIC_TEST_CHECKS:START -->
139
143
  ```jsonc
@@ -161,33 +165,35 @@ A maintained public test run in this repo uses checks like this:
161
165
 
162
166
  ## What `interf test` Proves
163
167
 
164
- `interf test` compares files as-is and the context folder on the same checks.
168
+ `interf test` compares the source files and the portable context on the same questions.
165
169
 
166
- That comparison is the product record:
170
+ That comparison is the proof:
167
171
 
168
- - same task
169
- - same checks
172
+ - same work
173
+ - same questions
170
174
  - same local agent setup
171
- - raw files on one side
172
- - compiled context on the other
175
+ - source files on one side
176
+ - portable context on the other
173
177
 
174
178
  Use `interf test` on your own files instead of trusting a frozen benchmark snapshot in the docs.
175
179
 
176
- Interf saves the latest comparison plus detailed raw-side and context-folder runs under `interf/tests/` in the same folder.
180
+ Interf saves the latest comparison plus the underlying source-files and portable-context runs under `interf/tests/` in the same project.
177
181
 
178
182
  ## The Core Loop
179
183
 
180
- 1. Save a few checks for the task in `interf.json`.
181
- 2. Optionally run `interf test` to see how the raw files do first.
182
- 3. Run `interf compile` to prepare the data into a context folder.
183
- 4. Run `interf test` again on the same checks.
184
+ 1. Save a few questions for the work in `interf.json`.
185
+ 2. Optionally run `interf test` to see how the source files do first.
186
+ 3. Run `interf compile` to build the portable context your agent can use.
187
+ 4. Run `interf test` again on the same questions.
184
188
  5. If loops are enabled, let Interf retry the same workflow variation or edit the workflow and test the new variation.
185
189
 
186
- The project root stores the source-folder setup and checks. The context folder carries the local compiled context needed for repeat runs.
190
+ The project root stores the source-folder setup and saved questions. Technically, that portable context is the compiled context used for repeat runs.
187
191
 
188
192
  ## Workflows
189
193
 
190
- A workflow tells Interf how to prepare and structure the files for a task before your agent uses them.
194
+ A workflow tells Interf how to prepare and structure the files for a kind of work before your agent uses them.
195
+
196
+ Technically, a workflow package defines the context interface: the zones, paths, and stage ownership of the compiled context Interf will build for that work.
191
197
 
192
198
  Interf ships with a built-in `interf` workflow for the common case. If you need a different method, create one locally:
193
199
 
@@ -200,7 +206,7 @@ Workflow creation supports two paths:
200
206
  - draft a workflow from the current project with a local agent
201
207
  - copy an existing workflow and edit stage guidance directly
202
208
 
203
- After assignment, build the context folder with `interf compile` and run `interf test` on the same checks.
209
+ After assignment, build the portable context with `interf compile` and run `interf test` on the same questions.
204
210
 
205
211
  ## Compile Loops
206
212
 
@@ -210,7 +216,7 @@ Retries keep the target fixed:
210
216
 
211
217
  - same configured dataset
212
218
  - same workflow variation
213
- - same checks
219
+ - same questions
214
220
  - same measurement
215
221
 
216
222
  `max_loops` enables self-improving workflow edits in the normal `interf compile` path.
@@ -220,7 +226,7 @@ In that loop, the thing that changes is the workflow itself.
220
226
  Each loop can:
221
227
 
222
228
  - run the current workflow variation on the same configured dataset
223
- - test it on the same checks
229
+ - test it on the same questions
224
230
  - inspect failed traces, preserved stage shells, and test artifacts
225
231
  - edit the workflow
226
232
  - build and test the next workflow variation
@@ -236,11 +242,11 @@ Paste something like this into your agent:
236
242
  ```text
237
243
  Install `@interf/compiler`, run `interf` in this folder, and use the local agent executor.
238
244
 
239
- If `interf.json` is missing, draft one dataset entry for this task with a few checks this agent should be able to answer from the selected files and add the expected answers for me to confirm.
245
+ If `interf.json` is missing, draft one dataset entry for this work. Ask what I need from the selected files, recommend a few questions to check accuracy from those files, and add the expected answers for me to confirm. Store those checks under `checks[]`.
240
246
 
241
- Then run a files-as-is baseline if helpful, compile the context folder to prepare the data for that task, and run `interf test`.
247
+ Then run a source-files baseline if helpful, build the portable context for that work, and run `interf test`.
242
248
 
243
- Tell me whether the context folder passes the checks, and only recommend it if it does.
249
+ Tell me whether the portable context passes those questions, and only recommend it if it does.
244
250
  ```
245
251
 
246
252
  ## More Docs
@@ -11,12 +11,12 @@ export function buildTruthCheckDraftPrompt(options) {
11
11
  const normalizedAbout = options.about?.trim();
12
12
  const taskLines = normalizedAbout
13
13
  ? [
14
- `Primary task: ${normalizedAbout}`,
15
- "Draft checks that directly measure whether a local agent can answer the key questions from the data behind that task.",
14
+ `Primary work: ${normalizedAbout}`,
15
+ "Draft checks that directly measure whether a local agent can answer the key questions from the data behind that work.",
16
16
  "Prefer checks that would make a human confident the dataset is useful for that exact job.",
17
17
  ]
18
18
  : [
19
- "No primary task was provided.",
19
+ "No primary work was provided.",
20
20
  "Prefer broad, representative checks that reflect the most useful questions a human would verify from this source folder.",
21
21
  ];
22
22
  return [
@@ -43,7 +43,7 @@ export function buildTruthCheckDraftPrompt(options) {
43
43
  "- Avoid unstable superlatives unless the source itself clearly states the ranking in one place.",
44
44
  "- Avoid checks where the expected answer depends on scanning many pages for a hidden exception or a larger outlier.",
45
45
  "- Avoid vague essay questions, open-ended opinions, or anything requiring outside knowledge.",
46
- "- Avoid duplicate checks that test the same fact in slightly different words.",
46
+ "- Avoid duplicate checks that cover the same fact in slightly different words.",
47
47
  "",
48
48
  "Output rules:",
49
49
  "- JSON only in the output file.",
@@ -3,11 +3,11 @@ import { tmpdir } from "node:os";
3
3
  import { dirname, join } from "node:path";
4
4
  import chalk from "chalk";
5
5
  import { readInterfConfig } from "../../packages/project-model/interf.js";
6
- import { clearCompiledRuntimeDerivedArtifacts, resetCompiledGeneratedState, } from "../../packages/project-model/compiled-reset.js";
6
+ import { clearCompiledRuntimeDerivedArtifacts, resetCompiledGeneratedState, } from "../../packages/compiler/reset.js";
7
7
  import { formatActiveCompiledWorkflowStageStep, resolveRequiredCompiledWorkflowFromConfig, } from "../../packages/workflow-package/workflow-definitions.js";
8
8
  import { loadCompiledDatasetConfig, resolveDatasetCompileMaxAttempts, resolveDatasetCompileMaxLoops, } from "../../packages/project-model/source-config.js";
9
9
  import { runWorkflowImprovementLoop } from "../../packages/workflow-authoring/workflow-improvement.js";
10
- import { stageExecutionShellsRoot, workflowPackagePathForCompiled, } from "../../packages/project-model/compiled-paths.js";
10
+ import { stageExecutionShellsRoot, workflowPackagePathForCompiled, } from "../../packages/compiler/compiled-paths.js";
11
11
  import { readCompiledSchemaFile } from "../../packages/compiler/compiled-schema.js";
12
12
  import { initializeCompiledRuntimeState } from "../../packages/compiler/state.js";
13
13
  import { compileCompiledWithReporter } from "./compiled-flow.js";
@@ -78,16 +78,16 @@ async function runWorkflowVariation(options) {
78
78
  const resetTarget = attempt > 1
79
79
  ? `attempt ${attempt}/${options.maxAttempts}`
80
80
  : options.variationLabel;
81
- console.log(chalk.dim(` Resetting generated compiled-context state before ${resetTarget}...`));
81
+ console.log(chalk.dim(` Resetting generated portable-context state before ${resetTarget}...`));
82
82
  resetCompiledGeneratedState(options.compiledPath, "compile");
83
83
  }
84
84
  const result = await compileCompiledWithReporter(options.executor, options.compiledPath, {
85
85
  heading: options.maxAttempts > 1
86
- ? `Building compiled context (${options.variationLabel}, attempt ${attempt}/${options.maxAttempts})...`
87
- : `Building compiled context (${options.variationLabel})...`,
86
+ ? `Building portable context (${options.variationLabel}, attempt ${attempt}/${options.maxAttempts})...`
87
+ : `Building portable context (${options.variationLabel})...`,
88
88
  successMessage: options.maxAttempts > 1
89
- ? `Compiled context ready for ${options.variationLabel}, attempt ${attempt}.`
90
- : `Compiled context ready for ${options.variationLabel}.`,
89
+ ? `Portable context ready for ${options.variationLabel}, attempt ${attempt}.`
90
+ : `Portable context ready for ${options.variationLabel}.`,
91
91
  preserveStageShells: options.preserveStageShells,
92
92
  });
93
93
  if (!result.ok) {
@@ -123,7 +123,7 @@ async function runWorkflowVariation(options) {
123
123
  bestOutcome,
124
124
  bestSnapshotPath,
125
125
  bestAttempt,
126
- fatalError: "Could not run the saved compiled-context check after compile.",
126
+ fatalError: "Could not run the saved portable-context comparison after compile.",
127
127
  };
128
128
  }
129
129
  console.log();
@@ -181,11 +181,11 @@ function summarizeWorkflowVariation(options) {
181
181
  const passedQuestions = options.result.bestOutcome?.result.passedCases ?? 0;
182
182
  const totalQuestions = options.result.bestOutcome?.result.totalCases ?? options.defaultTotalQuestions;
183
183
  const summary = options.result.passed
184
- ? `Passed ${passedQuestions}/${totalQuestions} checks.`
184
+ ? `Passed ${passedQuestions}/${totalQuestions} questions.`
185
185
  : options.result.bestOutcome
186
- ? `Best result: ${passedQuestions}/${totalQuestions} checks passed.`
186
+ ? `Best result: ${passedQuestions}/${totalQuestions} questions passed.`
187
187
  : options.result.failedStage
188
- ? `Compile failed at stage ${options.result.failedStage} before any test result.`
188
+ ? `Compile failed at stage ${options.result.failedStage} before any saved comparison result.`
189
189
  : "Workflow variation did not produce a passing result.";
190
190
  return {
191
191
  variation: options.variation,
@@ -213,16 +213,16 @@ function printStageShellReviewHint(compiledPath, preserveStageShells, result) {
213
213
  }
214
214
  }
215
215
  function printPostCompileNextStep(options) {
216
- console.log(chalk.dim(` Context folder: ${options.compiledPath}`));
216
+ console.log(chalk.dim(` Portable context: ${options.compiledPath}`));
217
217
  if (options.checks === 0) {
218
- console.log(chalk.dim(" Next: run `interf` to add checks, then `interf test`."));
218
+ console.log(chalk.dim(" Next: run `interf` to add questions, then `interf test`."));
219
219
  return;
220
220
  }
221
221
  if (options.testedDuringCompile) {
222
- console.log(chalk.dim(" Next: inspect the compiled context, or run `interf test` if you also want a raw-versus-compiled-context comparison."));
222
+ console.log(chalk.dim(" Next: inspect the portable context, or run `interf test` if you also want a source-files-versus-portable-context comparison."));
223
223
  return;
224
224
  }
225
- console.log(chalk.dim(" Next: run `interf test` to compare the raw files and the compiled context."));
225
+ console.log(chalk.dim(" Next: run `interf test` to compare the source files and the portable context."));
226
226
  }
227
227
  function formatVariationQuestionSummary(summary) {
228
228
  return `${summary.passed_questions}/${summary.total_questions}`;
@@ -233,7 +233,7 @@ function printWorkflowVariationSummary(summaries) {
233
233
  console.log();
234
234
  console.log(chalk.bold(" Workflow variation summary"));
235
235
  console.log();
236
- console.log(" | Variation | Kind | Checks | Result |");
236
+ console.log(" | Variation | Kind | Questions | Result |");
237
237
  console.log(" | --- | --- | --- | --- |");
238
238
  for (const summary of summaries) {
239
239
  console.log(` | ${summary.variation} | ${summary.kind} | \`${formatVariationQuestionSummary(summary)}\` | ${summary.passed ? "pass" : "fail"} |`);
@@ -245,7 +245,7 @@ function printCompiledLocalWorkflowOwnership(compiledPath, bestVariation) {
245
245
  console.log();
246
246
  console.log(chalk.dim(` Best workflow variation now lives in: ${workflowPackagePathForCompiled(compiledPath)}`));
247
247
  console.log(chalk.dim(" The project-level workflow selection was not changed automatically."));
248
- console.log(chalk.dim(" Recompiling this existing compiled context reuses that local workflow draft."));
248
+ console.log(chalk.dim(" Recompiling this existing portable context reuses that local workflow draft."));
249
249
  }
250
250
  export async function runConfiguredCompiledCompile(options) {
251
251
  const preserveStageShells = options.preserveStageShells ?? "on-failure";
@@ -255,12 +255,12 @@ export async function runConfiguredCompiledCompile(options) {
255
255
  const loopEnabled = maxAttempts != null;
256
256
  const checks = options.compiledConfig?.checks ?? [];
257
257
  if (loopEnabled && checks.length === 0) {
258
- console.log(chalk.yellow(" Retry and self-improving modes need checks. Building once without those loops."));
258
+ console.log(chalk.yellow(" Retry and self-improving modes need saved questions. Building once without those loops."));
259
259
  }
260
260
  else if (loopEnabled) {
261
261
  if (maxAttempts > 1) {
262
262
  console.log(chalk.dim(` Retry mode: up to ${maxAttempts} compile attempts.`));
263
- console.log(chalk.dim(" Interf will rerun the same workflow variation, test the compiled context, and stop early if it passes."));
263
+ console.log(chalk.dim(" Interf will rerun the same workflow variation, check the portable context, and stop early if it passes."));
264
264
  }
265
265
  else {
266
266
  console.log(chalk.dim(" Compile mode: 1 attempt per workflow variation."));
@@ -414,20 +414,20 @@ export async function runConfiguredCompiledCompile(options) {
414
414
  if (bestSnapshotPath && bestVariation > 0) {
415
415
  restoreCompiledBestState(bestSnapshotPath, options.compiledPath);
416
416
  console.log();
417
- console.log(chalk.dim(` Restored the best-performing compiled context from variation ${bestVariation}, attempt ${bestAttempt}.`));
417
+ console.log(chalk.dim(` Restored the best-performing portable context from variation ${bestVariation}, attempt ${bestAttempt}.`));
418
418
  }
419
419
  process.exitCode = 1;
420
420
  console.log();
421
421
  printWorkflowVariationSummary(previousVariations);
422
422
  printCompiledLocalWorkflowOwnership(options.compiledPath, bestVariation);
423
423
  if (maxLoops != null) {
424
- console.log(chalk.red(` Compiled context did not pass after ${maxAttempts} attempt${maxAttempts === 1 ? "" : "s"} per variation and ${maxLoops} workflow-improvement loop${maxLoops === 1 ? "" : "s"}.`));
424
+ console.log(chalk.red(` Context folder did not pass after ${maxAttempts} attempt${maxAttempts === 1 ? "" : "s"} per variation and ${maxLoops} workflow-improvement loop${maxLoops === 1 ? "" : "s"}.`));
425
425
  }
426
426
  else {
427
- console.log(chalk.red(` Compiled context did not pass within ${maxAttempts} attempt${maxAttempts === 1 ? "" : "s"}.`));
427
+ console.log(chalk.red(` Context folder did not pass within ${maxAttempts} attempt${maxAttempts === 1 ? "" : "s"}.`));
428
428
  }
429
429
  if (bestOutcome) {
430
- console.log(chalk.dim(` Best attempt check pass rate: ${questionPassRate(bestOutcome)}%.`));
430
+ console.log(chalk.dim(` Best attempt test pass rate: ${questionPassRate(bestOutcome)}%.`));
431
431
  }
432
432
  printStageShellReviewHint(options.compiledPath, preserveStageShells, "failure");
433
433
  return false;
@@ -11,10 +11,10 @@ import { runConfiguredCompiledCompile } from "./compile-controller.js";
11
11
  export { runConfiguredCompiledCompile } from "./compile-controller.js";
12
12
  export const compileCommand = {
13
13
  command: "compile",
14
- describe: "Build a compiled context and optionally run retry or self-improving compile loops",
14
+ describe: "Build portable context and optionally run retry or self-improving compile loops",
15
15
  builder: (yargs) => addExecutionProfileOptions(yargs).option("max-attempts", {
16
16
  type: "number",
17
- describe: "Retry compile + check for the same workflow until the dataset passes or reaches this total attempt limit",
17
+ describe: "Retry compile and test the same workflow until the dataset passes or reaches this total attempt limit",
18
18
  }).option("max-loops", {
19
19
  type: "number",
20
20
  describe: "After retries fail, let Interf edit the workflow and test new workflow variations for this dataset up to this loop limit",
@@ -11,8 +11,8 @@ function formatSavedDatasetHint(entry) {
11
11
  if (config.about)
12
12
  return `${config.path} · ${config.about} · ${workflowHint}`;
13
13
  if (checkCount === 0)
14
- return `${config.path} · No checks yet · ${workflowHint}`;
15
- return `${config.path} · ${checkCount} check${checkCount === 1 ? "" : "s"} · ${workflowHint}`;
14
+ return `${config.path} · No questions yet · ${workflowHint}`;
15
+ return `${config.path} · ${checkCount} question${checkCount === 1 ? "" : "s"} · ${workflowHint}`;
16
16
  }
17
17
  export function listSavedCompiledEntries(sourcePath) {
18
18
  const builtEntries = new Map();
@@ -82,7 +82,7 @@ export function ensureCompiledFromConfig(sourcePath, datasetConfig) {
82
82
  }
83
83
  export async function compileCompiledWithReporter(executor, compiledPath, options = {}) {
84
84
  console.log();
85
- console.log(chalk.bold(` ${options.heading ?? "Building compiled context..."}`));
85
+ console.log(chalk.bold(` ${options.heading ?? "Building portable context..."}`));
86
86
  const profileLabel = formatWorkflowExecutionProfile(executor.executionProfile);
87
87
  if (profileLabel) {
88
88
  console.log(chalk.dim(` Execution profile: ${profileLabel}`));
@@ -102,6 +102,6 @@ export async function compileCompiledWithReporter(executor, compiledPath, option
102
102
  return result;
103
103
  }
104
104
  console.log();
105
- console.log(chalk.green(` ✓ ${options.successMessage ?? "Compiled context ready."}`));
105
+ console.log(chalk.green(` ✓ ${options.successMessage ?? "Portable context ready."}`));
106
106
  return result;
107
107
  }
@@ -7,7 +7,7 @@ import { isWorkflowId, } from "../../packages/workflow-package/local-workflows.j
7
7
  import { resolveOrConfigureLocalExecutor } from "./executor-flow.js";
8
8
  import { runWorkflowAuthoringDraft } from "../../packages/workflow-authoring/workflow-authoring.js";
9
9
  import { listSourceDatasetConfigs, loadSourceFolderConfig, resolveSourceDatasetPath, } from "../../packages/project-model/source-config.js";
10
- import { slugify } from "../../lib/util.js";
10
+ import { slugify } from "../../packages/shared/naming.js";
11
11
  import { DEFAULT_DATASET_PATH_PLACEHOLDER, listDatasetFolderChoices, normalizeDatasetPathForConfig, } from "./source-config-wizard.js";
12
12
  export const clackWorkflowPrompts = {
13
13
  intro: p.intro,
@@ -31,7 +31,7 @@ function findMatchingDatasetConfig(sourcePath, datasetPath) {
31
31
  function describeSavedDataset(dataset) {
32
32
  return dataset.about
33
33
  ? `${dataset.path} · ${dataset.about}`
34
- : `${dataset.path} · ${dataset.checks.length} check${dataset.checks.length === 1 ? "" : "s"}`;
34
+ : `${dataset.path} · ${dataset.checks.length} test${dataset.checks.length === 1 ? "" : "s"}`;
35
35
  }
36
36
  async function promptWorkflowDatasetFolder(sourcePath, prompts) {
37
37
  const folderChoices = listDatasetFolderChoices(sourcePath);
@@ -136,7 +136,7 @@ export async function createCompiledWorkflowWizard(sourcePath, prompts = clackWo
136
136
  {
137
137
  value: "draft",
138
138
  label: "Draft a workflow from this source folder (Recommended)",
139
- hint: "Seed a workflow, build a preview, then let a local agent draft a reusable method for this task",
139
+ hint: "Seed a workflow, build a preview, then let a local agent draft a reusable method for this kind of work",
140
140
  },
141
141
  {
142
142
  value: "manual",
@@ -214,9 +214,9 @@ export async function createCompiledWorkflowWizard(sourcePath, prompts = clackWo
214
214
  matchedDataset = matchedDataset ?? findMatchingDatasetConfig(sourcePath, datasetPath);
215
215
  }
216
216
  const taskPrompt = await prompts.text({
217
- message: "What task should this workflow help with?",
218
- placeholder: "Example: chart reads, board-prep questions, or latest planned launch status",
219
- validate: (value) => (value.trim().length === 0 ? "Task focus is required" : undefined),
217
+ message: "What kind of work should this workflow help with?",
218
+ placeholder: "Example: chart reads, board prep, or latest planned launch status",
219
+ validate: (value) => (value.trim().length === 0 ? "Work focus is required" : undefined),
220
220
  });
221
221
  if (prompts.isCancel(taskPrompt))
222
222
  return taskPrompt;
@@ -224,7 +224,7 @@ export async function createCompiledWorkflowWizard(sourcePath, prompts = clackWo
224
224
  prompts.log.info(`Shaping this workflow from setup "${matchedDataset.name}".`);
225
225
  }
226
226
  if (matchedDataset?.checks.length) {
227
- prompts.log.info(`Using ${matchedDataset.checks.length} check${matchedDataset.checks.length === 1 ? "" : "s"} from setup "${matchedDataset.name}" as authoring context.`);
227
+ prompts.log.info(`Using ${matchedDataset.checks.length} saved question${matchedDataset.checks.length === 1 ? "" : "s"} from setup "${matchedDataset.name}" as authoring context.`);
228
228
  }
229
229
  const resolveExecutor = options.resolveExecutor ?? resolveOrConfigureLocalExecutor;
230
230
  const runDraft = options.runDraft ?? runWorkflowAuthoringDraft;
@@ -259,7 +259,7 @@ export async function createCompiledWorkflowWizard(sourcePath, prompts = clackWo
259
259
  }
260
260
  process.exitCode = 1;
261
261
  (prompts.log.error ?? prompts.log.info)(result.status === "no-change"
262
- ? `${result.summary} Draft mode only succeeds when it produces a task-specific package change.`
262
+ ? `${result.summary} Draft mode only succeeds when it produces a work-specific package change.`
263
263
  : result.summary);
264
264
  prompts.log.info(`Workflow shell kept at: ${result.shellPath}`);
265
265
  return null;
@@ -61,7 +61,7 @@ async function maybeAssignWorkflowToDataset(sourcePath, workflowId) {
61
61
  options: datasets.map((dataset) => ({
62
62
  value: dataset.name,
63
63
  label: dataset.name,
64
- hint: `${dataset.path} · ${dataset.about ?? `${dataset.checks.length} check${dataset.checks.length === 1 ? "" : "s"}`}`,
64
+ hint: `${dataset.path} · ${dataset.about ?? `${dataset.checks.length} question${dataset.checks.length === 1 ? "" : "s"}`}`,
65
65
  })),
66
66
  });
67
67
  if (p.isCancel(selected))
@@ -83,7 +83,7 @@ async function maybeAssignWorkflowToDataset(sourcePath, workflowId) {
83
83
  }
84
84
  p.log.info(`Assigned workflow "${workflowId}" to dataset "${targetDataset.name}".`);
85
85
  if (builtCompiledPath) {
86
- p.log.info("The active local copy for that compiled context lives under `.interf/workflow/`.");
86
+ p.log.info("The active local workflow copy for that portable context lives under `.interf/workflow/`.");
87
87
  }
88
88
  p.log.info("Next: run `interf compile`, then `interf test`.");
89
89
  }
@@ -132,14 +132,14 @@ export async function createCompiledWizard(options = {}) {
132
132
  const detected = detectInterf(cwd);
133
133
  if (detected) {
134
134
  process.exitCode = 1;
135
- p.log.error("You are already inside a compiled context.");
135
+ p.log.error("You are already inside portable context.");
136
136
  return;
137
137
  }
138
138
  const savedDatasets = listSourceDatasetConfigs(loadSourceFolderConfig(cwd));
139
139
  if (savedDatasets.length > 0) {
140
- p.log.info(`This project already has ${savedDatasets.length} saved setup${savedDatasets.length === 1 ? "" : "s"} in interf.json. Add another only when you need a separate folder, focus, or check set.`);
140
+ p.log.info(`This project already has ${savedDatasets.length} saved setup${savedDatasets.length === 1 ? "" : "s"} in interf.json. Add another only when you need a separate folder, focus, or question set.`);
141
141
  }
142
- p.log.info("Interf works one source-folder setup at a time. Start with the task, the relevant files, and a few checks, then build a context folder when you want to prepare that task context for your agents.");
142
+ p.log.info("Interf works one source-folder setup at a time. Start with the work, the relevant files, and a few questions, then build portable context when you want to prepare context your agents can work from.");
143
143
  const existingConfig = loadSourceFolderConfig(cwd);
144
144
  const draft = await promptSingleCompiledConfig({
145
145
  projectPath: cwd,
@@ -5,7 +5,7 @@ function printStaticLanding() {
5
5
  const config = userConfig.loadUserConfig();
6
6
  console.log();
7
7
  console.log(chalk.bold(" Interf"));
8
- console.log(chalk.dim(" Prepare task context for your agents from the files behind a task, then test it and use self-improving loops until the checks pass."));
8
+ console.log(chalk.dim(" Prepare context for your agents from the files you already have, then run `interf test` and use self-improving loops until more questions pass."));
9
9
  console.log();
10
10
  if (config) {
11
11
  console.log(chalk.dim(` Agent: ${config.agent}`));