@interf/compiler 0.33.0 → 0.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/README.md +122 -226
  2. package/dist/cli/commands/agents.js +1 -32
  3. package/dist/cli/commands/benchmark.d.ts +2 -3
  4. package/dist/cli/commands/benchmark.js +1 -31
  5. package/dist/cli/commands/build-plan.js +26 -50
  6. package/dist/cli/commands/build.d.ts +2 -3
  7. package/dist/cli/commands/build.js +1 -31
  8. package/dist/cli/commands/graphs.js +177 -32
  9. package/dist/cli/commands/mcp.d.ts +1 -0
  10. package/dist/cli/commands/mcp.js +223 -126
  11. package/dist/cli/commands/project.js +10 -36
  12. package/dist/cli/commands/reset.d.ts +2 -3
  13. package/dist/cli/commands/reset.js +1 -22
  14. package/dist/cli/commands/runs.js +86 -33
  15. package/dist/cli/commands/status.js +3 -24
  16. package/dist/cli/commands/traces.js +1 -29
  17. package/dist/cli/commands/wizard.js +17 -29
  18. package/dist/cli/lib/http-client.d.ts +39 -0
  19. package/dist/cli/lib/http-client.js +73 -0
  20. package/dist/packages/build-plans/authoring/brief.d.ts +25 -4
  21. package/dist/packages/build-plans/authoring/build-plan-authoring.d.ts +42 -1
  22. package/dist/packages/build-plans/authoring/build-plan-authoring.js +470 -63
  23. package/dist/packages/build-plans/authoring/build-plan-edit-session.d.ts +9 -0
  24. package/dist/packages/build-plans/authoring/build-plan-edit-session.js +27 -10
  25. package/dist/packages/build-plans/authoring/build-plan-improvement.js +62 -8
  26. package/dist/packages/build-plans/authoring/lib/build-plan-edit-utils.d.ts +1 -0
  27. package/dist/packages/build-plans/package/build-plan-definitions.d.ts +0 -1
  28. package/dist/packages/build-plans/package/build-plan-definitions.js +5 -3
  29. package/dist/packages/build-plans/package/build-plan-stage-runner.d.ts +1 -0
  30. package/dist/packages/build-plans/package/build-plan-stage-runner.js +2 -1
  31. package/dist/packages/build-plans/package/builtin-build-plan.d.ts +2 -2
  32. package/dist/packages/build-plans/package/builtin-build-plan.js +3 -3
  33. package/dist/packages/build-plans/package/context-interface.d.ts +3 -0
  34. package/dist/packages/build-plans/package/context-interface.js +5 -5
  35. package/dist/packages/build-plans/package/interf-build-plan-package.js +22 -22
  36. package/dist/packages/build-plans/package/local-build-plans.d.ts +10 -5
  37. package/dist/packages/build-plans/package/local-build-plans.js +57 -32
  38. package/dist/packages/contracts/index.d.ts +4 -3
  39. package/dist/packages/contracts/index.js +2 -1
  40. package/dist/packages/contracts/lib/context-graph-layer.d.ts +161 -0
  41. package/dist/packages/contracts/lib/context-graph-layer.js +216 -0
  42. package/dist/packages/contracts/lib/project-paths.d.ts +7 -0
  43. package/dist/packages/contracts/lib/project-paths.js +9 -0
  44. package/dist/packages/contracts/lib/project-schema.d.ts +264 -1
  45. package/dist/packages/contracts/lib/project-schema.js +38 -13
  46. package/dist/packages/contracts/lib/schema.d.ts +556 -23
  47. package/dist/packages/contracts/lib/schema.js +279 -18
  48. package/dist/packages/contracts/utils/filesystem.d.ts +1 -0
  49. package/dist/packages/contracts/utils/filesystem.js +29 -1
  50. package/dist/packages/projects/lib/schema.d.ts +6 -8
  51. package/dist/packages/projects/lib/schema.js +3 -1
  52. package/dist/packages/projects/source-config.d.ts +0 -5
  53. package/dist/packages/projects/source-config.js +9 -22
  54. package/dist/packages/runtime/actions/fields.d.ts +4 -0
  55. package/dist/packages/runtime/actions/form-builders.js +79 -31
  56. package/dist/packages/runtime/actions/form-validators.js +9 -3
  57. package/dist/packages/runtime/actions/helpers.js +3 -3
  58. package/dist/packages/runtime/actions/registry.d.ts +1 -1
  59. package/dist/packages/runtime/actions/registry.js +1 -1
  60. package/dist/packages/runtime/actions/requests.d.ts +1 -1
  61. package/dist/packages/runtime/actions/requests.js +12 -6
  62. package/dist/packages/runtime/actions/schemas.d.ts +7 -0
  63. package/dist/packages/runtime/actions/schemas.js +1 -0
  64. package/dist/packages/runtime/agent-handoff.js +8 -7
  65. package/dist/packages/runtime/agents/lib/execution-profile.d.ts +14 -0
  66. package/dist/packages/runtime/agents/lib/execution-profile.js +23 -0
  67. package/dist/packages/runtime/agents/lib/execution.js +14 -8
  68. package/dist/packages/runtime/agents/lib/executors.d.ts +1 -0
  69. package/dist/packages/runtime/agents/lib/executors.js +11 -2
  70. package/dist/packages/runtime/agents/lib/logs.d.ts +10 -0
  71. package/dist/packages/runtime/agents/lib/logs.js +32 -8
  72. package/dist/packages/runtime/agents/lib/preflight.js +4 -1
  73. package/dist/packages/runtime/agents/lib/render.d.ts +18 -0
  74. package/dist/packages/runtime/agents/lib/render.js +44 -18
  75. package/dist/packages/runtime/agents/lib/shell-templates.js +105 -63
  76. package/dist/packages/runtime/agents/lib/shells.d.ts +29 -0
  77. package/dist/packages/runtime/agents/lib/shells.js +158 -32
  78. package/dist/packages/runtime/agents/lib/source-context-scan.d.ts +10 -0
  79. package/dist/packages/runtime/agents/lib/source-context-scan.js +388 -0
  80. package/dist/packages/runtime/agents/lib/status.js +1 -14
  81. package/dist/packages/runtime/agents/lib/string-utils.d.ts +16 -0
  82. package/dist/packages/runtime/agents/lib/string-utils.js +36 -0
  83. package/dist/packages/runtime/agents/lib/types.d.ts +1 -0
  84. package/dist/packages/runtime/agents/providers/codex.js +2 -0
  85. package/dist/packages/runtime/agents/role-executors.js +2 -1
  86. package/dist/packages/runtime/auth/session-store.js +11 -3
  87. package/dist/packages/runtime/benchmark-question-draft.d.ts +3 -0
  88. package/dist/packages/runtime/benchmark-question-draft.js +57 -28
  89. package/dist/packages/runtime/build/artifact-status.d.ts +1 -1
  90. package/dist/packages/runtime/build/artifact-status.js +1 -1
  91. package/dist/packages/runtime/build/build-evidence.d.ts +2 -1
  92. package/dist/packages/runtime/build/build-evidence.js +11 -5
  93. package/dist/packages/runtime/build/build-pipeline.js +89 -5
  94. package/dist/packages/runtime/build/build-stage-plan.js +3 -1
  95. package/dist/packages/runtime/build/build-stage-runner.js +169 -32
  96. package/dist/packages/runtime/build/build-target.d.ts +3 -0
  97. package/dist/packages/runtime/build/build-target.js +25 -1
  98. package/dist/packages/runtime/build/check-evaluator.d.ts +1 -1
  99. package/dist/packages/runtime/build/check-evaluator.js +655 -4
  100. package/dist/packages/runtime/build/context-graph-paths.d.ts +13 -0
  101. package/dist/packages/runtime/build/context-graph-paths.js +27 -0
  102. package/dist/packages/runtime/build/index.d.ts +2 -2
  103. package/dist/packages/runtime/build/index.js +2 -2
  104. package/dist/packages/runtime/build/inspect-map.d.ts +10 -0
  105. package/dist/packages/runtime/build/inspect-map.js +270 -0
  106. package/dist/packages/runtime/build/lib/schema.d.ts +246 -53
  107. package/dist/packages/runtime/build/lib/schema.js +173 -15
  108. package/dist/packages/runtime/build/native-entrypoint.d.ts +2 -0
  109. package/dist/packages/runtime/build/native-entrypoint.js +286 -0
  110. package/dist/packages/runtime/build/runtime-contracts.js +9 -3
  111. package/dist/packages/runtime/build/runtime-log-paths.d.ts +3 -0
  112. package/dist/packages/runtime/build/runtime-log-paths.js +16 -0
  113. package/dist/packages/runtime/build/runtime-prompt.js +6 -4
  114. package/dist/packages/runtime/build/runtime-runs.js +63 -10
  115. package/dist/packages/runtime/build/runtime-types.d.ts +4 -1
  116. package/dist/packages/runtime/build/runtime.d.ts +3 -1
  117. package/dist/packages/runtime/build/runtime.js +3 -1
  118. package/dist/packages/runtime/build/source-files.js +11 -2
  119. package/dist/packages/runtime/build/source-inventory.d.ts +1 -0
  120. package/dist/packages/runtime/build/source-inventory.js +246 -7
  121. package/dist/packages/runtime/build/source-manifest.d.ts +11 -0
  122. package/dist/packages/runtime/build/source-manifest.js +30 -2
  123. package/dist/packages/runtime/build/stage-evidence.js +80 -11
  124. package/dist/packages/runtime/build/stage-manifest.d.ts +45 -0
  125. package/dist/packages/runtime/build/stage-manifest.js +1125 -0
  126. package/dist/packages/runtime/build/stage-reuse.js +12 -0
  127. package/dist/packages/runtime/build/stage-session.d.ts +81 -0
  128. package/dist/packages/runtime/build/stage-session.js +308 -0
  129. package/dist/packages/runtime/build/state-io.js +10 -11
  130. package/dist/packages/runtime/build/state-view.js +1 -1
  131. package/dist/packages/runtime/build/state.d.ts +1 -1
  132. package/dist/packages/runtime/build/state.js +1 -1
  133. package/dist/packages/runtime/build/summary-coverage-index.d.ts +21 -0
  134. package/dist/packages/runtime/build/summary-coverage-index.js +189 -0
  135. package/dist/packages/runtime/build/traces.js +3 -3
  136. package/dist/packages/runtime/build/validate-context-graph.d.ts +1 -1
  137. package/dist/packages/runtime/build/validate-context-graph.js +5 -5
  138. package/dist/packages/runtime/build/validate.d.ts +1 -1
  139. package/dist/packages/runtime/build/validate.js +1 -1
  140. package/dist/packages/runtime/client.d.ts +3 -3
  141. package/dist/packages/runtime/client.js +8 -13
  142. package/dist/packages/runtime/context-checks.js +13 -0
  143. package/dist/packages/runtime/context-graph-scaffold.js +2 -1
  144. package/dist/packages/runtime/context-graph-semantic-graph.d.ts +9 -0
  145. package/dist/packages/runtime/context-graph-semantic-graph.js +416 -0
  146. package/dist/packages/runtime/execution/lib/schema.d.ts +34 -31
  147. package/dist/packages/runtime/index.d.ts +2 -2
  148. package/dist/packages/runtime/index.js +1 -1
  149. package/dist/packages/runtime/native-run-handlers.d.ts +38 -0
  150. package/dist/packages/runtime/native-run-handlers.js +52 -33
  151. package/dist/packages/runtime/plan-artifact-contract.js +1 -1
  152. package/dist/packages/runtime/project-source-state.d.ts +4 -4
  153. package/dist/packages/runtime/project-source-state.js +5 -2
  154. package/dist/packages/runtime/project-store.d.ts +5 -0
  155. package/dist/packages/runtime/project-store.js +30 -3
  156. package/dist/packages/runtime/requested-artifacts.js +1 -1
  157. package/dist/packages/runtime/run-observability.js +9 -4
  158. package/dist/packages/runtime/runtime-action-proposals.js +3 -3
  159. package/dist/packages/runtime/runtime-build-plans.js +47 -3
  160. package/dist/packages/runtime/runtime-build-runs.js +9 -16
  161. package/dist/packages/runtime/runtime-caches.d.ts +26 -0
  162. package/dist/packages/runtime/runtime-caches.js +47 -0
  163. package/dist/packages/runtime/runtime-jobs.js +6 -6
  164. package/dist/packages/runtime/runtime-project-mutations.js +1 -0
  165. package/dist/packages/runtime/runtime-project-reads.d.ts +4 -1
  166. package/dist/packages/runtime/runtime-project-reads.js +229 -36
  167. package/dist/packages/runtime/runtime-proposal-helpers.js +6 -6
  168. package/dist/packages/runtime/runtime-resource-builders.d.ts +4 -2
  169. package/dist/packages/runtime/runtime-resource-builders.js +16 -14
  170. package/dist/packages/runtime/runtime-status.d.ts +14 -0
  171. package/dist/packages/runtime/runtime-status.js +15 -0
  172. package/dist/packages/runtime/runtime-verify-runs.js +6 -5
  173. package/dist/packages/runtime/runtime.d.ts +439 -22
  174. package/dist/packages/runtime/runtime.js +16 -2
  175. package/dist/packages/runtime/schemas/actions.d.ts +24 -0
  176. package/dist/packages/runtime/schemas/agents.d.ts +28 -0
  177. package/dist/packages/runtime/schemas/agents.js +33 -0
  178. package/dist/packages/runtime/schemas/build-plans.d.ts +181 -8
  179. package/dist/packages/runtime/schemas/build-plans.js +36 -2
  180. package/dist/packages/runtime/schemas/context-graphs.d.ts +1522 -0
  181. package/dist/packages/runtime/schemas/context-graphs.js +110 -0
  182. package/dist/packages/runtime/schemas/files.d.ts +7 -347
  183. package/dist/packages/runtime/schemas/files.js +1 -24
  184. package/dist/packages/runtime/schemas/index.d.ts +1 -0
  185. package/dist/packages/runtime/schemas/index.js +1 -0
  186. package/dist/packages/runtime/schemas/jobs.js +4 -0
  187. package/dist/packages/runtime/schemas/projects.d.ts +48 -21
  188. package/dist/packages/runtime/schemas/projects.js +34 -10
  189. package/dist/packages/runtime/schemas/runs.d.ts +1009 -240
  190. package/dist/packages/runtime/schemas/runs.js +17 -0
  191. package/dist/packages/runtime/service/openapi.js +1 -0
  192. package/dist/packages/runtime/service/operations.d.ts +1666 -145
  193. package/dist/packages/runtime/service/operations.js +147 -17
  194. package/dist/packages/runtime/service/routes.d.ts +11 -3
  195. package/dist/packages/runtime/service/routes.js +11 -3
  196. package/dist/packages/runtime/service/server-app-boot.js +2 -2
  197. package/dist/packages/runtime/service/server-helpers.d.ts +11 -0
  198. package/dist/packages/runtime/service/server-helpers.js +19 -0
  199. package/dist/packages/runtime/service/server-routes-action-proposals.js +4 -2
  200. package/dist/packages/runtime/service/server-routes-agents.js +19 -85
  201. package/dist/packages/runtime/service/server-routes-build-plans.js +14 -11
  202. package/dist/packages/runtime/service/server-routes-project-context.js +102 -7
  203. package/dist/packages/runtime/service/server-routes-project-jobs.js +19 -12
  204. package/dist/packages/runtime/service/server-routes-project-runs.js +5 -2
  205. package/dist/packages/runtime/service/server-routes-projects.js +6 -2
  206. package/dist/packages/runtime/service/server-routes-runs.js +11 -4
  207. package/dist/packages/runtime/verify/lib/schema.js +12 -0
  208. package/dist/packages/runtime/verify/test-file-guard.d.ts +2 -0
  209. package/dist/packages/runtime/verify/test-file-guard.js +29 -0
  210. package/dist/packages/runtime/verify/verify-execution.d.ts +7 -0
  211. package/dist/packages/runtime/verify/verify-execution.js +109 -35
  212. package/dist/packages/runtime/verify/verify-paths.d.ts +1 -0
  213. package/dist/packages/runtime/verify/verify-paths.js +4 -0
  214. package/dist/packages/runtime/verify/verify-specs.js +49 -39
  215. package/dist/packages/runtime/wire-schemas.d.ts +1 -1
  216. package/dist/packages/runtime/wire-schemas.js +1 -1
  217. package/package.json +2 -8
  218. package/public-repo/CONTRIBUTING.md +10 -3
  219. package/public-repo/README.md +122 -226
  220. package/public-repo/build-plans/interf-default/README.md +15 -12
  221. package/public-repo/build-plans/interf-default/build/stages/entrypoint/SKILL.md +74 -0
  222. package/public-repo/build-plans/interf-default/build/stages/knowledge/SKILL.md +95 -0
  223. package/public-repo/build-plans/interf-default/build/stages/summarize/SKILL.md +38 -5
  224. package/public-repo/build-plans/interf-default/build-plan.json +27 -23
  225. package/public-repo/build-plans/interf-default/build-plan.schema.json +24 -20
  226. package/public-repo/build-plans/interf-default/use/query/SKILL.md +8 -7
  227. package/public-repo/openapi/local-service.openapi.json +11637 -4213
  228. package/public-repo/skills/interf/SKILL.md +174 -134
  229. package/dist/packages/runtime/build/runtime-paths.d.ts +0 -8
  230. package/dist/packages/runtime/build/runtime-paths.js +0 -26
  231. package/dist/packages/runtime/build/state-paths.d.ts +0 -7
  232. package/dist/packages/runtime/build/state-paths.js +0 -22
  233. package/public-repo/build-plans/interf-default/build/stages/shape/SKILL.md +0 -34
  234. package/public-repo/build-plans/interf-default/build/stages/structure/SKILL.md +0 -28
@@ -7,31 +7,36 @@ import { buildPlanAuthoringSchema, buildPlanChangeSchema, createProjectSchema, p
7
7
  import { buildPlanAuthoringActionValues, buildPlanChangeActionValues, createProjectActionValues, duplicateProjectActionValues, normalizedBuildPlanActionValues, projectChangeActionValues, selectBuildPlanActionValues, } from "./requests.js";
8
8
  export function buildCreateProjectActionDefinition(context) {
9
9
  const existingNames = new Set(context.existingNames);
10
- const name = uniqueActionId(context.suggestedName, existingNames);
10
+ // Friendly default name (e.g. the dropped folder's name). Any text is fine;
11
+ // the durable Project id is slugged from it on submit.
12
+ const suggestedName = context.suggestedName?.trim() || "My project";
11
13
  return {
12
14
  id: INTERF_SERVICE_ACTIONS.createProject.id,
13
15
  title: INTERF_SERVICE_ACTIONS.createProject.title,
14
- description: "Create a Project by binding a Source. Draft or select a Build Plan after the Project exists.",
16
+ description: "Create a Project from a folder of files. Pick or draft a Build Plan after it's created.",
15
17
  submitLabel: "Create Project",
16
18
  initialValues: {
17
- name,
19
+ name: suggestedName,
18
20
  path: context.projectDataDir,
21
+ intent: context.suggestedIntent ?? "",
19
22
  },
20
23
  schema: createProjectSchema(existingNames),
21
24
  validateRequest: (values) => packageSchemaFieldErrors(ProjectSetupActionValuesSchema.safeParse(createProjectActionValues(values)), {
22
25
  name: "name",
23
26
  path: "path",
27
+ intent: "intent",
24
28
  build_plan: "build_plan",
25
29
  }),
26
30
  valuesPreview: createProjectActionValues,
27
31
  buildDraft: (values) => {
28
32
  const actionValues = createProjectActionValues(values);
29
33
  return {
30
- project: inputValue(values, "name"),
34
+ project: actionValues.name,
31
35
  values: actionValues,
32
36
  message: [
33
- `Create Project ${inputValue(values, "name")}.`,
37
+ `Create Project ${actionValues.name}.`,
34
38
  `Source: ${inputValue(values, "path")}`,
39
+ `Agent task: ${inputValue(values, "intent")}`,
35
40
  "Draft or select the Build Plan after this Project exists. Do not build yet.",
36
41
  "Use the attached typed action input as the source of truth.",
37
42
  ].filter((line) => Boolean(line)).join("\n"),
@@ -40,20 +45,29 @@ export function buildCreateProjectActionDefinition(context) {
40
45
  fields: [
41
46
  {
42
47
  name: "name",
43
- label: "Project id",
48
+ label: "Project name",
44
49
  type: "text",
45
- help: "Lowercase id for this Project. Use letters, numbers, and dashes.",
46
- context: "Saved as the durable Project id.",
47
- placeholder: name,
50
+ help: "Use any name you like.",
51
+ context: "Saved as this Project's name.",
52
+ placeholder: suggestedName,
48
53
  },
49
54
  {
50
55
  name: "path",
51
56
  label: "Source",
52
57
  type: "text",
53
- help: "Absolute path to the folder Interf reads from. Files stay where they are; Interf reads them by reference. You can link this later if you don't have a folder yet.",
58
+ help: "The folder your agent maps into a Source. Your files stay where they are.",
54
59
  context: "Saved as the Project's Source binding.",
55
60
  placeholder: context.projectDataDir || "/Users/you/Documents/your-folder",
56
61
  },
62
+ {
63
+ name: "intent",
64
+ label: "Agent task",
65
+ type: "textarea",
66
+ rows: 4,
67
+ help: "What you want your agent to prepare from these files.",
68
+ context: "Saved as the Project intent and used as the default Build Plan task.",
69
+ placeholder: "Example: Build a timeline of our team's calls and find recurring themes.",
70
+ },
57
71
  ],
58
72
  };
59
73
  }
@@ -84,7 +98,7 @@ export function buildBuildRunActionDefinition(context) {
84
98
  message: [
85
99
  `Build Context Graph for Project ${inputValue(values, "project")}.`,
86
100
  `Build Plan: ${inputValue(values, "build_plan") || "(saved selection)"}.`,
87
- "Build a Context Graph from the saved Source and requested Artifacts.",
101
+ "Build a Context Graph from the saved Source and requested outputs.",
88
102
  "Use the attached typed action input as the source of truth.",
89
103
  ].filter((line) => Boolean(line)).join("\n"),
90
104
  }),
@@ -131,6 +145,7 @@ export function buildSelectBuildPlanActionDefinition(context) {
131
145
  initialValues: {
132
146
  name: context.name,
133
147
  path: context.sourceFolderPath,
148
+ intent: context.intent,
134
149
  current_build_plan: context.currentBuildPlanId ?? "",
135
150
  build_plan: context.currentBuildPlanId ?? "",
136
151
  },
@@ -138,6 +153,7 @@ export function buildSelectBuildPlanActionDefinition(context) {
138
153
  validateRequest: (values) => packageSchemaFieldErrors(ProjectSetupActionValuesSchema.safeParse(actionValues(values)), {
139
154
  name: "name",
140
155
  path: "path",
156
+ intent: "intent",
141
157
  build_plan: "build_plan",
142
158
  }),
143
159
  valuesPreview: actionValues,
@@ -185,6 +201,16 @@ export function buildSelectBuildPlanActionDefinition(context) {
185
201
  help: "The saved local folder for this Source.",
186
202
  context: "Preserved while updating the selected Build Plan.",
187
203
  },
204
+ {
205
+ name: "intent",
206
+ label: "Agent task",
207
+ type: "textarea",
208
+ rows: 4,
209
+ readOnly: true,
210
+ advanced: true,
211
+ help: "The Project intent that Build Plan drafting uses by default.",
212
+ context: "Preserved while updating the selected Build Plan.",
213
+ },
188
214
  ],
189
215
  };
190
216
  }
@@ -193,16 +219,22 @@ export function buildCreateBuildPlanActionDefinition(context) {
193
219
  const defaultSeed = context.defaultProject ? `${context.defaultProject}-build-plan` : context.suggestedBuildPlanId;
194
220
  const buildPlanId = uniqueActionId(defaultSeed, existingBuildPlanIds);
195
221
  const label = titleFromActionId(buildPlanId);
222
+ const projectIntent = context.projectIntent?.trim() ?? "";
223
+ // In a Project the task is already set, so Intent is shown read-only under
224
+ // The one thing we actually ask is how the user wants their files prepared
225
+ // into the Context Graph. Outputs are an optional advanced refinement.
226
+ // Standalone (no Project) keeps Intent as the primary, editable field.
227
+ const inProject = Boolean(context.defaultProject);
196
228
  return {
197
229
  id: INTERF_SERVICE_ACTIONS.createBuildPlan.id,
198
230
  title: INTERF_SERVICE_ACTIONS.createBuildPlan.title,
199
- description: "Describe the Artifacts the agent needs. Interf drafts the Build Plan from this description; the Build later records what was covered.",
231
+ description: "Describe how you want Interf to prepare and structure your files into a Context Graph. Interf drafts a Build Plan from your task and this description, and shows it to you before building.",
200
232
  submitLabel: "Draft Build Plan",
201
233
  initialValues: {
202
234
  build_plan_id: "",
203
235
  label: "",
204
236
  hint: "",
205
- intent: "",
237
+ intent: projectIntent,
206
238
  requested_artifacts_description: "",
207
239
  user_prep_instructions: "",
208
240
  },
@@ -234,32 +266,36 @@ export function buildCreateBuildPlanActionDefinition(context) {
234
266
  ].join("\n"),
235
267
  }),
236
268
  fields: [
269
+ {
270
+ name: "user_prep_instructions",
271
+ label: "How should Interf prepare your files?",
272
+ type: "textarea",
273
+ rows: 4,
274
+ help: "Describe how you want your files structured and prepared into the Context Graph — the way you'd tell a colleague. This is the main thing Interf turns into a Build Plan you review before anything runs.",
275
+ context: "Primary Build Plan authoring instruction — guides how stages prepare and structure the Context Graph.",
276
+ placeholder: "Example: read each contract and lay it out one page at a time, with the parties, dates, and renewal terms pulled out and linked back to the source file.",
277
+ },
237
278
  {
238
279
  name: "intent",
239
- label: "Intent",
280
+ label: "Agent task",
240
281
  type: "textarea",
241
282
  rows: 4,
242
- help: "The agent task this Project should unlock.",
283
+ ...(inProject ? { advanced: true, readOnly: true } : {}),
284
+ help: inProject
285
+ ? "The Project task this draft builds from — set on the Project."
286
+ : "The agent task this plan should unlock.",
243
287
  context: "Used as the main Build Plan authoring instruction.",
244
288
  placeholder: "Example: Analyze every report chart, extract annual take-up by location, and produce a source data file plus markdown summary.",
245
289
  },
246
290
  {
247
291
  name: "requested_artifacts_description",
248
- label: "Requested Artifacts",
292
+ label: "Specific outputs (optional)",
249
293
  type: "textarea",
250
294
  rows: 3,
251
- help: "Files, sections, or evidence agents should receive in the Context Graph.",
252
- context: "Guides the requested Artifact shape and Build Plan stages before a Build records Source coverage.",
253
- placeholder: "Describe the files or sections agents should receive.",
254
- },
255
- {
256
- name: "user_prep_instructions",
257
- label: "Build instructions",
258
- type: "textarea",
259
- rows: 3,
260
- help: "Checks and evidence these Artifacts should satisfy.",
261
- context: "Guides Build Plan checks and evidence expectations. Artifact contract checks stay separate.",
262
- placeholder: "Describe the evidence that should make these Artifacts ready.",
295
+ advanced: true,
296
+ help: "Optional. Call out specific outputs you want, the way you'd tell a colleague. Otherwise Interf infers them from how you want your files prepared.",
297
+ context: "Guides the requested outputs, Build Plan stages, and coverage metrics.",
298
+ placeholder: "Example: a summary of each contract with the parties, dates, and renewal terms — each linked back to the original file.",
263
299
  },
264
300
  {
265
301
  name: "build_plan_id",
@@ -383,7 +419,7 @@ export function buildBuildPlanChangeActionDefinition(context) {
383
419
  advanced: true,
384
420
  help: "Short Build Plan summary to keep while modifying this Build Plan.",
385
421
  context: "Sent to the Build Plan authoring run.",
386
- placeholder: context.hint ?? "Build Plan for requested Artifacts and Context Checks.",
422
+ placeholder: context.hint ?? "Build Plan for source coverage and task knowledge.",
387
423
  },
388
424
  {
389
425
  name: "project",
@@ -439,6 +475,7 @@ export function buildProjectChangeActionDefinition(context) {
439
475
  ? {
440
476
  name: context.action === "duplicate" ? duplicateName : context.project,
441
477
  path: context.sourceFolderPath,
478
+ intent: context.intent,
442
479
  build_plan: context.buildPlanId ?? "",
443
480
  }
444
481
  : {}),
@@ -451,6 +488,7 @@ export function buildProjectChangeActionDefinition(context) {
451
488
  `Modify Project ${inputValue(values, "project")}.`,
452
489
  maybeActionValue(inputValue(values, "build_plan")) ? `Build Plan: ${inputValue(values, "build_plan")}` : null,
453
490
  `Source: ${inputValue(values, "path")}`,
491
+ `Agent task: ${inputValue(values, "intent")}`,
454
492
  "Use the attached typed Project setup input as the source of truth.",
455
493
  ].filter((line) => Boolean(line)).join("\n");
456
494
  }
@@ -459,6 +497,7 @@ export function buildProjectChangeActionDefinition(context) {
459
497
  `Duplicate Project ${inputValue(values, "project")} as ${inputValue(values, "name")}.`,
460
498
  maybeActionValue(inputValue(values, "build_plan")) ? `Build Plan: ${inputValue(values, "build_plan")}` : null,
461
499
  `Source: ${inputValue(values, "path")}`,
500
+ `Agent task: ${inputValue(values, "intent")}`,
462
501
  "Use the attached typed Project setup input as the source of truth.",
463
502
  ].filter((line) => Boolean(line)).join("\n");
464
503
  }
@@ -505,6 +544,14 @@ export function buildProjectChangeActionDefinition(context) {
505
544
  help: "The local folder for this Project's Source.",
506
545
  context: "Saved on this Project.",
507
546
  },
547
+ {
548
+ name: "intent",
549
+ label: "Agent task",
550
+ type: "textarea",
551
+ rows: 4,
552
+ help: "What this Project's Context Graph should prepare the Source for.",
553
+ context: "Saved as the durable Project intent.",
554
+ },
508
555
  {
509
556
  name: "confirmation",
510
557
  label: "Confirm removal",
@@ -529,6 +576,7 @@ export function buildProjectChangeActionDefinition(context) {
529
576
  ? (values) => packageSchemaFieldErrors(ProjectSetupActionValuesSchema.safeParse(duplicateProjectActionValues(values)), {
530
577
  name: "name",
531
578
  path: "path",
579
+ intent: "intent",
532
580
  build_plan: "build_plan",
533
581
  })
534
582
  : undefined,
@@ -539,7 +587,7 @@ export function buildProjectChangeActionDefinition(context) {
539
587
  message: messageFor(values),
540
588
  }),
541
589
  fields: fields.filter((field) => {
542
- if (field.name === "name" || field.name === "build_plan" || field.name === "path")
590
+ if (field.name === "name" || field.name === "build_plan" || field.name === "path" || field.name === "intent")
543
591
  return context.action === "modify" || context.action === "duplicate";
544
592
  if (field.name === "confirmation")
545
593
  return context.action === "remove";
@@ -609,7 +657,7 @@ export function buildBenchmarkActionDraft(options) {
609
657
  }
610
658
  return {
611
659
  project: options.project,
612
- message: `Improve ${options.project} using the latest benchmark results and Build evidence.`,
660
+ message: `Improve ${options.project} using benchmark results, Graph Manifest metrics, Stage Manifests, and supplemental diagnostics.`,
613
661
  values: {
614
662
  action_type: INTERF_SERVICE_ACTIONS.improveProject.serviceAction,
615
663
  ...(options.buildPlanId ? { build_plan: options.buildPlanId } : {}),
@@ -1,14 +1,17 @@
1
1
  import { z } from "zod";
2
2
  import { ActionValueIdPattern, actionIdField, optionalActionIdField, optionalActionText, requiredActionText, } from "./schemas.js";
3
- import { maybeActionValue } from "./helpers.js";
3
+ import { maybeActionValue, slugForActionId } from "./helpers.js";
4
4
  void ActionValueIdPattern;
5
5
  export function createProjectSchema(existingNames) {
6
6
  return z.object({
7
- name: actionIdField("Project name"),
7
+ // Any text is accepted; the durable id is slugged from it on submit
8
+ // (see createProjectActionValues). Uniqueness is checked on the slug.
9
+ name: requiredActionText("Project name"),
8
10
  path: requiredActionText("Source"),
11
+ intent: requiredActionText("Agent task"),
9
12
  build_plan: optionalActionIdField("Build Plan").optional(),
10
13
  }).strict().superRefine((values, ctx) => {
11
- if (existingNames.has(values.name)) {
14
+ if (existingNames.has(slugForActionId(values.name))) {
12
15
  ctx.addIssue({
13
16
  code: z.ZodIssueCode.custom,
14
17
  path: ["name"],
@@ -28,6 +31,7 @@ export function selectBuildPlanSchema() {
28
31
  return z.object({
29
32
  name: actionIdField("Project"),
30
33
  path: requiredActionText("Source"),
34
+ intent: requiredActionText("Agent task"),
31
35
  current_build_plan: optionalActionIdField("Current Build Plan"),
32
36
  build_plan: actionIdField("Build Plan"),
33
37
  }).strict();
@@ -94,6 +98,7 @@ export function projectChangeSchema(action, project, existingNames) {
94
98
  ...base,
95
99
  name: actionIdField("Project id"),
96
100
  path: requiredActionText("Source"),
101
+ intent: requiredActionText("Agent task"),
97
102
  build_plan: optionalActionIdField("Build Plan"),
98
103
  }).strict().superRefine((values, ctx) => {
99
104
  if (values.name !== project && existingNames.has(values.name)) {
@@ -110,6 +115,7 @@ export function projectChangeSchema(action, project, existingNames) {
110
115
  ...base,
111
116
  name: actionIdField("New Project id"),
112
117
  path: requiredActionText("Source"),
118
+ intent: requiredActionText("Agent task"),
113
119
  build_plan: optionalActionIdField("Build Plan"),
114
120
  }).strict().superRefine((values, ctx) => {
115
121
  if (existingNames.has(values.name)) {
@@ -8,8 +8,8 @@ export function buildPlanAuthoringIntentBrief(values) {
8
8
  const prepInstructions = values.user_prep_instructions?.trim();
9
9
  return [
10
10
  `Intent: ${values.intent}`,
11
- requestedArtifacts ? `Requested Artifacts:\n${requestedArtifacts}` : null,
12
- requestedArtifactsDescription ? `Requested Artifacts: ${requestedArtifactsDescription}` : null,
11
+ requestedArtifacts ? `Requested outputs:\n${requestedArtifacts}` : null,
12
+ requestedArtifactsDescription ? `Requested outputs: ${requestedArtifactsDescription}` : null,
13
13
  prepInstructions ? `Build instructions: ${prepInstructions}` : null,
14
14
  ].filter((line) => Boolean(line)).join("\n");
15
15
  }
@@ -67,7 +67,7 @@ export function buildPlanIntentFromInput(values) {
67
67
  const prepInstructions = inputValue(values, "user_prep_instructions");
68
68
  return [
69
69
  `Intent: ${intent}`,
70
- maybeActionValue(requestedArtifactsDescription) ? `Requested Artifacts: ${requestedArtifactsDescription}` : null,
70
+ maybeActionValue(requestedArtifactsDescription) ? `Requested outputs: ${requestedArtifactsDescription}` : null,
71
71
  maybeActionValue(prepInstructions) ? `Build instructions: ${prepInstructions}` : null,
72
72
  ].filter((line) => Boolean(line)).join("\n");
73
73
  }
@@ -57,7 +57,7 @@ export declare const INTERF_SERVICE_ACTIONS: {
57
57
  readonly id: "improve-project";
58
58
  readonly serviceAction: "build-plan-improvement";
59
59
  readonly title: "Improve Build Plan";
60
- readonly description: "Use benchmark results and Build evidence to refine the Build Plan this Project uses.";
60
+ readonly description: "Use benchmark results, Graph Manifest metrics, Stage Manifests, and supplemental diagnostics to refine the Build Plan this Project uses.";
61
61
  };
62
62
  };
63
63
  export type InterfServiceActionKey = keyof typeof INTERF_SERVICE_ACTIONS;
@@ -57,6 +57,6 @@ export const INTERF_SERVICE_ACTIONS = {
57
57
  id: "improve-project",
58
58
  serviceAction: "build-plan-improvement",
59
59
  title: "Improve Build Plan",
60
- description: "Use benchmark results and Build evidence to refine the Build Plan this Project uses.",
60
+ description: "Use benchmark results, Graph Manifest metrics, Stage Manifests, and supplemental diagnostics to refine the Build Plan this Project uses.",
61
61
  },
62
62
  };
@@ -8,6 +8,7 @@ export declare function selectBuildPlanActionValues(values: ActionInputValues):
8
8
  export declare function projectSetupRequestFromActionValues(input: unknown): {
9
9
  project: {
10
10
  build_plan?: string;
11
+ intent: string;
11
12
  name: string;
12
13
  path: string;
13
14
  };
@@ -26,7 +27,6 @@ export declare function buildPlanAuthoringRequestFromActionValues(input: unknown
26
27
  hint?: string;
27
28
  label: string;
28
29
  build_plan_id: string;
29
- project?: string;
30
30
  reference_build_plan_id?: string;
31
31
  requested_artifacts: RequestedArtifact[];
32
32
  source_context?: SourceContext | null;
@@ -1,6 +1,6 @@
1
1
  import { artifactRequirementsFromRequestedArtifacts, } from "../requested-artifacts.js";
2
2
  import { BuildPlanAuthoringActionValuesSchema, ProjectSetupActionValuesSchema, } from "./schemas.js";
3
- import { conciseSummary, inputValue, maybeActionValue, titleFromActionId, uniqueActionId, } from "./helpers.js";
3
+ import { conciseSummary, inputValue, maybeActionValue, slugForActionId, titleFromActionId, uniqueActionId, } from "./helpers.js";
4
4
  export function normalizedBuildPlanActionValues(values, existingBuildPlanIds, defaultSeed) {
5
5
  const explicitBuildPlanId = maybeActionValue(inputValue(values, "build_plan_id"));
6
6
  const intent = inputValue(values, "intent").trim();
@@ -10,15 +10,18 @@ export function normalizedBuildPlanActionValues(values, existingBuildPlanIds, de
10
10
  ...values,
11
11
  build_plan_id: buildPlanId,
12
12
  label: maybeActionValue(inputValue(values, "label")) ?? titleFromActionId(buildPlanId),
13
- hint: maybeActionValue(inputValue(values, "hint")) ?? conciseSummary(output ?? intent, "Build Plan for requested Artifacts and Context Checks."),
13
+ hint: maybeActionValue(inputValue(values, "hint")) ?? conciseSummary(output ?? intent, "Build Plan for requested outputs and coverage."),
14
14
  intent,
15
15
  };
16
16
  }
17
17
  export function createProjectActionValues(values) {
18
18
  const buildPlan = inputValue(values, "build_plan");
19
19
  return {
20
- name: inputValue(values, "name"),
20
+ // Users type any friendly name; the durable Project id is a safe slug
21
+ // derived from it. Slugged here so both the UI and CLI get the same id.
22
+ name: slugForActionId(inputValue(values, "name")),
21
23
  path: inputValue(values, "path"),
24
+ intent: inputValue(values, "intent"),
22
25
  build_after_setup: false,
23
26
  ...(maybeActionValue(buildPlan) ? { build_plan: buildPlan } : {}),
24
27
  };
@@ -27,6 +30,7 @@ export function selectBuildPlanActionValues(values) {
27
30
  return {
28
31
  name: inputValue(values, "name"),
29
32
  path: inputValue(values, "path"),
33
+ intent: inputValue(values, "intent"),
30
34
  build_plan: inputValue(values, "build_plan"),
31
35
  build_after_setup: false,
32
36
  setup_mode: "select-build-plan",
@@ -41,6 +45,7 @@ export function projectSetupRequestFromActionValues(input) {
41
45
  project: {
42
46
  name: values.name,
43
47
  path: values.path,
48
+ intent: values.intent,
44
49
  ...(buildPlan && buildPlan.length > 0 ? { build_plan: buildPlan } : {}),
45
50
  },
46
51
  };
@@ -56,12 +61,11 @@ export function buildPlanAuthoringRequestFromActionValues(input, context) {
56
61
  const baseBuildPlanId = values.base_build_plan_id;
57
62
  const referenceBuildPlanId = values.reference_build_plan_id;
58
63
  return {
59
- ...(context.project ? { project: context.project } : {}),
60
64
  ...(baseBuildPlanId ? { base_build_plan_id: baseBuildPlanId } : {}),
61
65
  ...(referenceBuildPlanId ? { reference_build_plan_id: referenceBuildPlanId } : {}),
62
66
  build_plan_id: buildPlanId,
63
67
  label: values.label ?? titleFromActionId(buildPlanId),
64
- ...(values.hint ? { hint: values.hint } : { hint: conciseSummary(values.requested_artifacts_description ?? values.intent, "Reusable Build Plan for building Artifacts.") }),
68
+ ...(values.hint ? { hint: values.hint } : { hint: conciseSummary(values.requested_artifacts_description ?? values.intent, "Reusable Build Plan for prepared outputs.") }),
65
69
  intent: values.intent,
66
70
  checks: values.checks ?? context.checks ?? [],
67
71
  ...(values.user_prep_instructions ? { user_prep_instructions: values.user_prep_instructions } : {}),
@@ -76,7 +80,7 @@ export function buildPlanImprovementActionValues(options) {
76
80
  reference_build_plan_id: options.buildPlanId,
77
81
  ...(maybeActionValue(options.label ?? "") ? { label: options.label } : {}),
78
82
  ...(maybeActionValue(options.hint ?? "") ? { hint: options.hint } : {}),
79
- intent: `Improve Build Plan ${options.buildPlanId} using the latest benchmark results and Build evidence for Project ${options.projectName}.`,
83
+ intent: `Improve Build Plan ${options.buildPlanId} using the latest benchmark results, Graph Manifest metrics, Stage Manifests, and supplemental graph diagnostics for Project ${options.projectName}.`,
80
84
  };
81
85
  }
82
86
  export function buildPlanAuthoringActionValues(values) {
@@ -131,6 +135,7 @@ export function duplicateProjectActionValues(values) {
131
135
  return {
132
136
  name: inputValue(values, "name"),
133
137
  path: inputValue(values, "path"),
138
+ intent: inputValue(values, "intent"),
134
139
  build_after_setup: false,
135
140
  setup_mode: "create",
136
141
  ...(maybeActionValue(buildPlan) ? { build_plan: buildPlan } : {}),
@@ -142,6 +147,7 @@ export function projectChangeActionValues(action, values) {
142
147
  return {
143
148
  name: inputValue(values, "project"),
144
149
  path: inputValue(values, "path"),
150
+ intent: inputValue(values, "intent"),
145
151
  build_after_setup: false,
146
152
  setup_mode: "select-build-plan",
147
153
  ...(maybeActionValue(buildPlan) ? { build_plan: buildPlan } : {}),
@@ -37,6 +37,9 @@ export declare const RequestedArtifactActionValueSchema: z.ZodPipe<z.ZodTransfor
37
37
  frontmatter_required_keys: "frontmatter_required_keys";
38
38
  frontmatter_nonempty_keys: "frontmatter_nonempty_keys";
39
39
  source_refs_required: "source_refs_required";
40
+ summary_backlinks_present: "summary_backlinks_present";
41
+ knowledge_web_connectivity: "knowledge_web_connectivity";
42
+ graph_notes_connected: "graph_notes_connected";
40
43
  wikilinks_valid: "wikilinks_valid";
41
44
  must_not_contain: "must_not_contain";
42
45
  must_contain: "must_contain";
@@ -64,6 +67,7 @@ export declare const SourceContextActionValueSchema: z.ZodObject<{
64
67
  export declare const ProjectSetupActionValuesSchema: z.ZodObject<{
65
68
  name: z.ZodString;
66
69
  path: z.ZodString;
70
+ intent: z.ZodString;
67
71
  build_plan: z.ZodOptional<z.ZodString>;
68
72
  build_after_setup: z.ZodOptional<z.ZodBoolean>;
69
73
  setup_mode: z.ZodOptional<z.ZodEnum<{
@@ -110,6 +114,9 @@ export declare const BuildPlanAuthoringActionValuesSchema: z.ZodObject<{
110
114
  frontmatter_required_keys: "frontmatter_required_keys";
111
115
  frontmatter_nonempty_keys: "frontmatter_nonempty_keys";
112
116
  source_refs_required: "source_refs_required";
117
+ summary_backlinks_present: "summary_backlinks_present";
118
+ knowledge_web_connectivity: "knowledge_web_connectivity";
119
+ graph_notes_connected: "graph_notes_connected";
113
120
  wikilinks_valid: "wikilinks_valid";
114
121
  must_not_contain: "must_not_contain";
115
122
  must_contain: "must_contain";
@@ -12,6 +12,7 @@ export const SourceContextActionValueSchema = SourceContextSchema;
12
12
  export const ProjectSetupActionValuesSchema = z.object({
13
13
  name: ActionValueIdSchema,
14
14
  path: z.string().trim().min(1, "Source is required."),
15
+ intent: z.string().trim().min(1, "Agent task is required."),
15
16
  build_plan: OptionalActionValueIdSchema.optional(),
16
17
  build_after_setup: z.boolean().optional(),
17
18
  setup_mode: z.enum(["create", "select-build-plan"]).optional(),
@@ -10,7 +10,7 @@ export function buildInterfMcpServers(input) {
10
10
  label: "Interf MCP",
11
11
  command: input.mcpCommand,
12
12
  args: input.mcpArgs ?? [],
13
- instructions: "Use this with Claude Desktop, Cursor, or another local MCP host while Interf.app is open.",
13
+ instructions: "Use this with Claude Desktop, Cursor, or another local MCP host while the local Interf service is running.",
14
14
  });
15
15
  }
16
16
  mcpServers.push({
@@ -47,7 +47,7 @@ export function buildInterfMcpInstructions(input) {
47
47
  "Interf MCP lets a host such as Claude Desktop or Cursor talk to Interf. Agents listed inside Interf are executors that run Build Plan stages. Do not mix these concepts.",
48
48
  "",
49
49
  "MCP setup:",
50
- "Interf MCP. Keep Interf.app open; the MCP process talks to the app-owned local service and must not start a separate Interf runtime.",
50
+ "Interf MCP. Keep the local Interf service running; the MCP process talks to that authorized service and must not start a separate Interf runtime.",
51
51
  ...(mcpConfig
52
52
  ? [
53
53
  "",
@@ -66,18 +66,19 @@ export function buildInterfMcpInstructions(input) {
66
66
  "```",
67
67
  "",
68
68
  "Rules:",
69
- "- Default flow: identify the current Source, create a fresh Project for this session unless the user explicitly names an existing Project id, propose Context Checks and requested Artifacts, draft a Build Plan after the user approves those checks and Artifacts, stop for Build Plan approval, build only after that approval, then answer from the prepared Context Graph and traces.",
70
- "- Source scope default: when Interf Desktop, MCP, or the user context provides a Source locator or file set, use the whole Source. Do not ask the user to choose individual files or a subset unless they explicitly ask to narrow scope.",
69
+ "- Default flow: identify the current Source, create a fresh Project for this session unless the user explicitly names an existing Project id, prepare a Build Plan from the Project intent and requested outputs, stop for Build Plan approval, build only after that approval, then read home.md, GraphManifest primary metrics, knowledge/summaries, and source-backed traces.",
70
+ "- Source scope default: when Interf, MCP, or the user context provides a Source locator or file set, use the whole Source. Do not ask the user to choose individual files or a subset unless they explicitly ask to narrow scope.",
71
71
  "- Do not browse existing Projects as a corpus. Reuse an existing Context Graph only when it clearly matches the same Source and task.",
72
72
  "- If no Project matches the current Source, create a new Project for this session.",
73
- "- If no usable Source locator is available, ask for one Source locator instead of answering from unrelated Projects. In the local Desktop path this may be a folder path. Do not present a file-selection menu.",
73
+ "- If no usable Source locator is available, ask for one Source locator instead of answering from unrelated Projects. In the local path this may be a folder path. Do not present a file-selection menu.",
74
74
  `- Probe only discovery resources before authorization: ${input.serviceUrl}/health, ${input.serviceUrl}/v1, ${input.serviceUrl}/v1/instance, or ${input.serviceUrl}/v1/openapi.json`,
75
75
  "- Do not scan ports.",
76
76
  "- Send `Authorization: Bearer <auth_token>` on every protected `/v1` request. `/health`, `/v1`, `/v1/instance`, and `/v1/openapi.json` are discovery routes.",
77
- "- Do not install npm or npx packages for the Desktop flow.",
78
- "- Do not use a global `interf` CLI for the Desktop MCP flow when the app-backed MCP launcher is available.",
77
+ "- Do not install npm or npx packages for an already-configured local MCP handoff.",
78
+ "- Do not use a global `interf` CLI when an app-backed MCP launcher is available.",
79
79
  "- Project creation is allowed when the user asks Interf to use a Source. Project ids are generated internally. Do not ask for existing Project ids.",
80
80
  "- Ask before drafting Build Plans or starting Build runs unless the user grants autonomy.",
81
+ "- After a Build succeeds, start from home.md. Use GraphManifest primary metrics for coverage, summaries/ for Source coverage proof, knowledge/ for drilldown, and artifacts/ only for focused task entrypoint notes.",
81
82
  "- No automatic retries: if a Build Plan draft, Build Plan improvement, Build run, or status poll reaches failed/cancelled, report what failed and ask the user before starting another run.",
82
83
  ].join("\n");
83
84
  }
@@ -11,6 +11,20 @@ type ExecutionProfileArgSource = Record<string, unknown> & {
11
11
  "timeout-ms"?: unknown;
12
12
  };
13
13
  export declare function executionProfileFromArgv(argv: ExecutionProfileArgSource): AgentExecutionProfile;
14
+ /**
15
+ * Resolve the EFFECTIVE execution profile for an agent: the per-run override
16
+ * (`executionProfile`) wins, and any field it leaves unset falls back to the
17
+ * agent's saved prefs (`~/.interf/agents.json` `agent_prefs[name]`). This is
18
+ * the single merge that used to live inline in `spawnAgent`. It is resolved
19
+ * ONCE at executor construction so the model the executor REPORTS
20
+ * (`buildRuntimeExecutorInfo`) is the exact model the executor RUNS
21
+ * (`buildAgentArgs`) — a session can no longer record `model: null` for a run
22
+ * whose model came from saved prefs (the common path).
23
+ *
24
+ * `profile` / `timeoutMs` are not pref-backed today (prefs only carry
25
+ * `model` / `effort` / `env_vars`), so they pass through unchanged.
26
+ */
27
+ export declare function resolveEffectiveAgentExecutionProfile(agent: AgentLike, executionProfile?: AgentExecutionProfile): AgentExecutionProfile;
14
28
  export declare function applyInternalAcceptanceExecutionProfileDefaults(agent: AgentLike, overrides?: AgentExecutionProfile): AgentExecutionProfile;
15
29
  export declare function hasAgentExecutionProfile(profile: AgentExecutionProfile | null | undefined): boolean;
16
30
  export declare function formatAgentExecutionProfile(profile: AgentExecutionProfile | null | undefined): string | null;
@@ -1,4 +1,5 @@
1
1
  import { getBuiltInProvider } from "../providers/index.js";
2
+ import { loadAgentPrefs } from "../registry.js";
2
3
  const INTERNAL_ACCEPTANCE_TIMEOUT_MS = 480000;
3
4
  function readAgentName(agent) {
4
5
  if (!agent)
@@ -47,6 +48,28 @@ export function executionProfileFromArgv(argv) {
47
48
  timeoutMs: normalizeOptionalTimeout(argv.timeoutMs ?? argv["timeout-ms"]),
48
49
  };
49
50
  }
51
+ /**
52
+ * Resolve the EFFECTIVE execution profile for an agent: the per-run override
53
+ * (`executionProfile`) wins, and any field it leaves unset falls back to the
54
+ * agent's saved prefs (`~/.interf/agents.json` `agent_prefs[name]`). This is
55
+ * the single merge that used to live inline in `spawnAgent`. It is resolved
56
+ * ONCE at executor construction so the model the executor REPORTS
57
+ * (`buildRuntimeExecutorInfo`) is the exact model the executor RUNS
58
+ * (`buildAgentArgs`) — a session can no longer record `model: null` for a run
59
+ * whose model came from saved prefs (the common path).
60
+ *
61
+ * `profile` / `timeoutMs` are not pref-backed today (prefs only carry
62
+ * `model` / `effort` / `env_vars`), so they pass through unchanged.
63
+ */
64
+ export function resolveEffectiveAgentExecutionProfile(agent, executionProfile = {}) {
65
+ const name = readAgentName(agent);
66
+ const prefs = name ? loadAgentPrefs()[name] : undefined;
67
+ return {
68
+ ...executionProfile,
69
+ model: executionProfile.model ?? prefs?.model ?? null,
70
+ effort: executionProfile.effort ?? prefs?.effort ?? null,
71
+ };
72
+ }
50
73
  export function applyInternalAcceptanceExecutionProfileDefaults(agent, overrides = {}) {
51
74
  const provider = getBuiltInProvider(readAgentName(agent) ?? "");
52
75
  const defaultModel = provider?.defaultModel ?? null;
@@ -3,20 +3,20 @@ import chalk from "chalk";
3
3
  import { getBuiltInProvider } from "../providers/index.js";
4
4
  import { loadAgentPrefs } from "../registry.js";
5
5
  import { buildAgentArgs, buildAgentEnv } from "./args.js";
6
- import { appendAgentEventLog, appendAgentStatusLog } from "./logs.js";
7
- import { displayAgentEvent, emitVisibleAgentText, summarizeAgentToolActivity, } from "./render.js";
6
+ import { appendAgentEventLog, appendAgentReasoningLog, appendAgentStatusLog } from "./logs.js";
7
+ import { displayAgentEvent, emitVisibleAgentText, extractAgentReasoning, summarizeAgentToolActivity, } from "./render.js";
8
8
  import { classifyTerminalVisibleStatus, extractAgentFailureStatus, hasAgentStalled, } from "./status.js";
9
9
  const STOP_SIGNAL_GRACE_MS = 1500;
10
10
  export function spawnAgent(agent, dirPath, prompt, options = {}) {
11
11
  return new Promise((resolve) => {
12
12
  const noiseFilters = getBuiltInProvider(agent.name)?.noiseFilters ?? [];
13
13
  const prefs = loadAgentPrefs()[agent.name];
14
- const mergedProfile = {
15
- ...options.executionProfile,
16
- model: options.executionProfile?.model ?? prefs?.model ?? null,
17
- effort: options.executionProfile?.effort ?? prefs?.effort ?? null,
18
- };
19
- const args = buildAgentArgs(agent, prompt, mergedProfile);
14
+ // The execution profile arrives already resolved (per-run override ∨ saved
15
+ // prefs) from `createLocalAgentExecutor`, so the CLI args built here use the
16
+ // SAME model/effort the session records via `buildRuntimeExecutorInfo` (F1).
17
+ // `prefs.env_vars` is still read below — env vars are a spawn concern, not
18
+ // part of the execution profile, so they are not pre-resolved.
19
+ const args = buildAgentArgs(agent, prompt, options.executionProfile ?? {});
20
20
  appendAgentEventLog(options.eventLogPath, {
21
21
  type: "spawn",
22
22
  command: agent.command,
@@ -184,6 +184,12 @@ export function spawnAgent(agent, dirPath, prompt, options = {}) {
184
184
  if (toolActivity) {
185
185
  lastToolActivity = toolActivity;
186
186
  }
187
+ // Tee reasoning/thinking spans the display path discards to the
188
+ // reasoning transcript. Best-effort: the writer swallows errors and
189
+ // events without reasoning yield nothing, so the run is never blocked.
190
+ for (const span of extractAgentReasoning(event)) {
191
+ appendAgentReasoningLog(options.reasoningLogPath, span);
192
+ }
187
193
  failureStatus ||= extractAgentFailureStatus(event);
188
194
  if (displayAgentEvent(event, options.statusLogPath, lastVisibleText, options.onStatus)) {
189
195
  sawVisibleEvent = true;