@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
@@ -2,7 +2,7 @@ import { existsSync, mkdirSync, readdirSync, writeFileSync, } from "node:fs";
2
2
  import { basename, extname, join } from "node:path";
3
3
  import { readJsonFileWithSchema } from "../../contracts/utils/parse.js";
4
4
  import { TestSpecSchema } from "./lib/schema.js";
5
- import { TEST_SPEC_EXTENSIONS, assertTestId, assertWritableTestSpecPath, testSpecFilePath, testSpecTypePath, normalizeTestId, } from "./verify-paths.js";
5
+ import { TEST_SPEC_EXTENSIONS, assertTestId, assertSafeRelativeTestFile, assertWritableTestSpecPath, testSpecFilePath, testSpecTypePath, normalizeTestId, } from "./verify-paths.js";
6
6
  function readTestSpecFile(filePath) {
7
7
  const extension = extname(filePath).toLowerCase();
8
8
  if (!TEST_SPEC_EXTENSIONS.has(extension))
@@ -71,44 +71,54 @@ export function writeTestSpec(sourcePath, spec, options = {}) {
71
71
  ...(spec.description && spec.description.trim().length > 0
72
72
  ? { description: spec.description.trim() }
73
73
  : {}),
74
- cases: spec.cases.map((testCase) => ({
75
- id: normalizeTestId(testCase.id),
76
- question: testCase.question.trim(),
77
- ...(testCase.file && testCase.file.trim().length > 0
78
- ? { file: testCase.file.trim() }
79
- : {}),
80
- ...(testCase.answer && testCase.answer.trim().length > 0
81
- ? { answer: testCase.answer.trim() }
82
- : {}),
83
- ...(testCase.strictness && testCase.strictness.trim().length > 0
84
- ? { strictness: testCase.strictness.trim() }
85
- : {}),
86
- ...(testCase.expect
87
- ? {
88
- expect: {
89
- ...(testCase.expect.must_include && testCase.expect.must_include.length > 0
90
- ? { must_include: testCase.expect.must_include.map((value) => value.trim()).filter(Boolean) }
91
- : {}),
92
- ...(testCase.expect.must_include_one_of && testCase.expect.must_include_one_of.length > 0
93
- ? {
94
- must_include_one_of: testCase.expect.must_include_one_of
95
- .map((group) => group.map((value) => value.trim()).filter(Boolean))
96
- .filter((group) => group.length > 0),
97
- }
98
- : {}),
99
- ...(testCase.expect.must_not_include && testCase.expect.must_not_include.length > 0
100
- ? { must_not_include: testCase.expect.must_not_include.map((value) => value.trim()).filter(Boolean) }
101
- : {}),
102
- ...(typeof testCase.expect.min_words === "number"
103
- ? { min_words: testCase.expect.min_words }
104
- : {}),
105
- ...(typeof testCase.expect.max_words === "number"
106
- ? { max_words: testCase.expect.max_words }
107
- : {}),
108
- },
109
- }
110
- : {}),
111
- })),
74
+ cases: spec.cases.map((testCase) => {
75
+ // H3: trim then safelist the relative path before persisting. A malicious
76
+ // `../../../etc/passwd` spec must be rejected here, not stored verbatim and
77
+ // later fed to path.join. This is the same guard the schema enforces (H2),
78
+ // applied at the write boundary so the spec is never written with an
79
+ // escaping file value.
80
+ const file = testCase.file?.trim();
81
+ if (file)
82
+ assertSafeRelativeTestFile(file);
83
+ return {
84
+ id: normalizeTestId(testCase.id),
85
+ question: testCase.question.trim(),
86
+ ...(file && file.length > 0
87
+ ? { file }
88
+ : {}),
89
+ ...(testCase.answer && testCase.answer.trim().length > 0
90
+ ? { answer: testCase.answer.trim() }
91
+ : {}),
92
+ ...(testCase.strictness && testCase.strictness.trim().length > 0
93
+ ? { strictness: testCase.strictness.trim() }
94
+ : {}),
95
+ ...(testCase.expect
96
+ ? {
97
+ expect: {
98
+ ...(testCase.expect.must_include && testCase.expect.must_include.length > 0
99
+ ? { must_include: testCase.expect.must_include.map((value) => value.trim()).filter(Boolean) }
100
+ : {}),
101
+ ...(testCase.expect.must_include_one_of && testCase.expect.must_include_one_of.length > 0
102
+ ? {
103
+ must_include_one_of: testCase.expect.must_include_one_of
104
+ .map((group) => group.map((value) => value.trim()).filter(Boolean))
105
+ .filter((group) => group.length > 0),
106
+ }
107
+ : {}),
108
+ ...(testCase.expect.must_not_include && testCase.expect.must_not_include.length > 0
109
+ ? { must_not_include: testCase.expect.must_not_include.map((value) => value.trim()).filter(Boolean) }
110
+ : {}),
111
+ ...(typeof testCase.expect.min_words === "number"
112
+ ? { min_words: testCase.expect.min_words }
113
+ : {}),
114
+ ...(typeof testCase.expect.max_words === "number"
115
+ ? { max_words: testCase.expect.max_words }
116
+ : {}),
117
+ },
118
+ }
119
+ : {}),
120
+ };
121
+ }),
112
122
  };
113
123
  const parsed = TestSpecSchema.parse(normalizedSpec);
114
124
  writeFileSync(filePath, `${JSON.stringify(serializeTestSpec(parsed), null, 2)}\n`);
@@ -4,7 +4,7 @@
4
4
  * can render an actionable error rather than a stack trace.
5
5
  *
6
6
  * `issues` is typed as `unknown[]` so the class works across both
7
- * `zod` dependency trees in the monorepo (root + `src/apps/interf-desktop/renderer`).
7
+ * `zod` dependency trees in the monorepo.
8
8
  * Callers cast or render structurally as needed.
9
9
  */
10
10
  export declare class WireShapeError extends Error {
@@ -4,7 +4,7 @@
4
4
  * can render an actionable error rather than a stack trace.
5
5
  *
6
6
  * `issues` is typed as `unknown[]` so the class works across both
7
- * `zod` dependency trees in the monorepo (root + `src/apps/interf-desktop/renderer`).
7
+ * `zod` dependency trees in the monorepo.
8
8
  * Callers cast or render structurally as needed.
9
9
  */
10
10
  export class WireShapeError extends Error {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interf/compiler",
3
- "version": "0.33.0",
3
+ "version": "0.50.0",
4
4
  "description": "Interf prepares data for agents by building Context Graphs from files.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -45,13 +45,7 @@
45
45
  },
46
46
  "files": [
47
47
  "dist",
48
- "public-repo",
49
- "!dist/cli/commands/desktop.d.ts",
50
- "!dist/cli/commands/desktop.js",
51
- "!dist/desktop",
52
- "!dist/desktop/**",
53
- "!dist/desktop-renderer",
54
- "!dist/desktop-renderer/**"
48
+ "public-repo"
55
49
  ],
56
50
  "publishConfig": {
57
51
  "access": "public"
@@ -7,6 +7,10 @@ Only files under `public-repo` are intended for this public surface. Do not add
7
7
  source paths outside `public-repo`, maintainer docs, or repo-specific operating
8
8
  instructions here.
9
9
 
10
+ The marketing website is maintained separately in `interf-labs/interf-website`.
11
+ Do not add landing-page code, website assets, or website operating notes to this
12
+ public SDK/package surface.
13
+
10
14
  ## What To Change Here
11
15
 
12
16
  - Public product docs: the public README, `SECURITY.md`, and `TRADEMARKS.md`.
@@ -17,11 +21,14 @@ instructions here.
17
21
 
18
22
  Build Plans are inspectable folders. Keep them standalone:
19
23
 
20
- - `build-plan.json` is the current technical filename for the Build Plan stages and Artifact outputs.
21
- - `build-plan.schema.json` is the current technical filename for the output contract.
24
+ - `build-plan.json` is the current technical filename for Build Plan stages,
25
+ requested outputs, coverage requirements, and graph entrypoints.
26
+ - `build-plan.schema.json` is the current technical filename for the Build Plan
27
+ package contract.
22
28
  - `build/stages/<stage>/SKILL.md` contains stage instructions.
23
29
  - `use/query/SKILL.md` tells agents how to read the Context Graph.
24
- - `improve/SKILL.md` tells Interf how to revise the Build Plan when checks fail.
30
+ - `improve/SKILL.md` tells Interf how to revise the Build Plan when coverage,
31
+ Stage Manifest validation, or graph output requirements fail.
25
32
 
26
33
  For the shipped default Build Plan, edit `build-plans/interf-default/`.
27
34
 
@@ -1,268 +1,164 @@
1
1
  # Interf
2
2
 
3
- **Interf prepares data for agents.**
3
+ **Interf prepares data for agent tasks.**
4
4
 
5
- This npm package ships the `interf` CLI and local Interf runtime for building
6
- task-specific Context Graphs from files.
5
+ Interf structures your files into a task-specific graph your agent can navigate.
6
+ Your agent starts from prepared context built for the task, instead of a partial
7
+ read of whatever files it happened to open.
7
8
 
8
- Agents miss things in files. When agents answer from a folder, they first have
9
- to discover what is in it, decide what matters, extract evidence, and connect
10
- facts across files. That file-to-context step is hidden, inconsistent, and hard
11
- to inspect.
9
+ > This npm package is the `interf` CLI and local runtime. A Mac app (Interf
10
+ > Desktop) is coming soon.
12
11
 
13
- Interf separates that step. It makes users' agents build a Context Graph from
14
- their files. It has source coverage summaries, task-aware knowledge, artifact
15
- handoffs, and links back to sources. Your agent uses the prepared map instead
16
- of rediscovering the files during the task.
17
-
18
- ```text
19
- Source files Context Graph agents use
20
-
21
- bristol-office-market/ <context-graph>/
22
- q4-market-report.pdf AGENTS.md
23
- lease-comps.xlsx home.md
24
- planning-notes.md summaries/
25
- exports/availability.csv knowledge/
26
- artifacts/
27
- traces/
28
- ```
29
-
30
- ## What a Build Produces
31
-
32
- A Build produces a Context Graph. The Context Graph is source-backed context
33
- built from files so agents can use prepared context instead of partial file
34
- reads.
35
-
36
- For a local Build, the Context Graph is an inspectable folder:
37
-
38
- ```text
39
- <context-graph>/
40
- AGENTS.md # agent guidance
41
- home.md # overview and routes
42
- artifacts/ # task-specific agent handoffs
43
- summaries/ # source coverage proof
44
- knowledge/ # navigation and drilldown
45
- traces/ # links back to sources
46
- ```
47
-
48
- The output is not an answer. It is a prepared map over the Source: artifact
49
- handoffs, summaries, knowledge notes, and links back to sources. The Source
50
- remains the ground truth. Agents start from `artifacts/`, use `summaries/` for
51
- coverage proof and `knowledge/` for drilldown, then follow source links when
52
- exact wording, table values, chart reads, or provenance-sensitive claims matter.
53
-
54
- ## Design Choices
55
-
56
- - `Project-scoped`: every Project starts from a specific Source and selected
57
- Build Plan, not a generic index over every file.
58
- - `Inspectable`: Interf records what was built, which requested Artifacts exist,
59
- and where source-backed traces live.
60
- - `Local-first`: local Builds keep Source files on your machine and read-only.
61
- - `Bring your own agent`: use Claude Code, Codex, or another registered
62
- command-line agent.
63
- - `File over hidden index`: local Builds expose the Context Graph as a folder
64
- agents can inspect.
65
- - `Context Checks you control`: every Build can be checked against
66
- plain-English conditions such as "Every page is covered" or "Every figure
67
- cites a source page."
68
-
69
- ## Why Not Just Ask Your Agent?
70
-
71
- You can. Interf can use Claude Code, Codex, or another registered local agent
72
- while it builds the Context Graph.
73
-
74
- A one-off preprocessing prompt gives you another answer to trust. Interf puts
75
- the preparation step inside a Build Plan you can inspect: requested Artifacts,
76
- declared stages, Build evidence, Context Checks, and traces.
77
-
78
- The agent can still execute the stages. Interf shows what was covered, what was
79
- produced, and whether the Context Graph is ready for the task.
80
-
81
- ## Install
12
+ ## Quick start
82
13
 
83
14
  ```bash
84
15
  npm install -g @interf/compiler
85
- interf # opens the wizard
16
+ interf # the interactive wizard walks you through your first build
86
17
  ```
87
18
 
88
- Requires Node.js 20+ and a local agent CLI such as Claude Code, Codex, or
89
- another registered command-line agent. Run `interf doctor --live` if the
90
- executor is not detected.
19
+ Requires Node 20+ and a local agent CLI (Claude Code, Codex, or another). Check
20
+ it with `interf doctor --live`.
91
21
 
92
- ## Quick Start
22
+ Or run it command by command:
93
23
 
94
24
  ```bash
95
- # terminal 1: start the local Interf runtime
96
- interf runtime
97
-
98
- # terminal 2: create a Project from a local Source
99
- interf project create bristol --source ./bristol-office-market
25
+ interf runtime # start the local runtime
26
+ interf project create bristol \ # bind a folder + the agent's task
27
+ --source ./bristol-office-market \
28
+ --intent "Bristol annual take-up and availability"
29
+ interf plan draft bristol # draft a Build Plan, then review it
30
+ interf plan select bristol <build-plan-id> # pick the reviewed plan
31
+ interf build bristol # build the graph
32
+ ```
100
33
 
101
- # draft the Build Plan for review
102
- interf plan draft bristol \
103
- --intent "Bristol annual take-up and availability chart lookup" \
104
- --artifacts "Guide to the report; annual take-up figures with source references" \
105
- --ready-when "Every page is listed and every figure has a source reference."
34
+ `interf build` returns the graph path: a folder your agent opens and continues
35
+ from. No `--out` flag, no copy of your Source. Mutating commands never auto-start
36
+ the runtime; they exit with a hint if nothing is connected.
106
37
 
107
- # select the reviewed Build Plan
108
- interf plan select bristol <build-plan-id>
38
+ ## What you get
109
39
 
110
- # build the Context Graph
111
- interf build bristol
40
+ A folder your agent navigates instead of grepping raw files. Interf calls it a
41
+ **Context Graph**:
112
42
 
113
- # optional: benchmark/evaluate answers from the Source baseline, Context Graph, or both
114
- interf benchmark bristol
43
+ ```text
44
+ <graph>/
45
+ home.md # start here. routes into the three layers below
46
+ summaries/ # one folder per source file. every file read and summarized
47
+ knowledge/ # the connected web: linked notes, claims, entities, source refs
48
+ artifacts/ # task handoffs that reference summaries and knowledge
49
+ traces/ # provenance: every claim links back to source
50
+ AGENTS.md # how agents use the graph (plus CLAUDE.md for Claude Code)
115
51
  ```
116
52
 
117
- `interf runtime` starts the local runtime in the foreground and writes the
118
- active connection record so subsequent CLI commands can connect. Agents can use
119
- `interf runtime start` for an explicit managed background runtime, then
120
- `interf runtime stop` when their task is done.
53
+ `summaries/`, `knowledge/`, and `artifacts/` are the three fixed layers, plus
54
+ `home.md`. What goes inside `knowledge/` (claims, entities, timelines, tables) is
55
+ up to the Build Plan, so any task shapes its own web. Your Source stays read-only
56
+ and the ground truth. Agents follow source links when exact wording, table
57
+ values, or chart reads matter.
121
58
 
122
- Mutating commands never implicitly auto-start a runtime. If no instance is
123
- connected, they exit with a hint pointing at `interf runtime`,
124
- `interf runtime start`, or `interf login`.
59
+ ## Why Interf is different
125
60
 
126
- `interf build` returns the Context Graph locator on success. For local Builds,
127
- that locator points to a folder agents can inspect and continue from. There is
128
- no `--out` flag and no implicit copy of your Source folder.
61
+ Most tools prepare your files one way for every question: chunks in a vector
62
+ store, or a single knowledge graph that maps everything the same way (RAG
63
+ indexes, Obsidian-style graphs, code-graph tools). Interf is `task-specific`. You
64
+ tell it what the agent needs to do, and it builds a graph tailored to that task:
65
+ the right summaries, connections, and entrypoints for *this* work, not a one-size
66
+ index of all your files.
129
67
 
130
- ## Context Graph
68
+ And the graph is `provable`:
131
69
 
132
- The Context Graph is the output Interf builds from your files for agents. It is
133
- a knowledge map over the Source, not a replacement for the Source.
70
+ - `Coverage`: every Source file was read and summarized.
71
+ - `Traceability`: every claim links back to a Source, and every note connects to
72
+ the web. No orphans, no islands.
134
73
 
135
- It gives agents structure and source-backed routes for navigating files. For
136
- the built-in `interf-default`, it includes:
74
+ It is `provider-agnostic` by design: the same prepared context works across
75
+ Claude, Codex, GPT, and whatever you switch to next, because the graph is a
76
+ portable folder you own, never trapped in one vendor's session. Your own agents
77
+ do the work, your files never leave your machine, and the output is files you can
78
+ read, diff, commit, and reuse.
137
79
 
138
- ```text
139
- <context-graph>/
140
- AGENTS.md # agent-facing guidance and source-checking rules
141
- CLAUDE.md # same guidance for Claude Code
142
- home.md # graph index
143
- artifacts/ # task-specific handoffs for agents
144
- summaries/ # one source-named folder per source file
145
- knowledge/ # linked notes built from summaries and source refs
146
- traces/ # source provenance for claims and checks
147
- ```
80
+ ## Design principles
148
81
 
149
- The source files stay the source of truth. Interf writes generated state inside
150
- the instance data directory and does not modify the Source.
82
+ - `Not a replacement for your agent harness`: just a task-specific graph to navigate.
83
+ - `Your files stay yours`: local, read-only, never sent to Interf's servers.
84
+ - `Runs with your agents`: your CLIs, your subscriptions, in a replayable shell.
85
+ - `File over app`: the graph is inspectable files, not a hidden index.
86
+ - `Connected, not orphaned`: every note links to others and back to sources.
87
+ - `Coverage-first`: exact file, summary, knowledge, and output counts.
88
+ - `Project-scoped`: one Source, one agent task, one Build Plan.
151
89
 
152
- `AGENTS.md` tells agents how to use the Context Graph: start from the prepared
153
- outputs, follow the prepared routes, and use the recorded source references
154
- when exact source evidence matters.
90
+ ## Readiness is provable
155
91
 
156
- ## Build Plans
92
+ Every Build reports exact coverage metrics (files processed, source units
93
+ summarized, knowledge reviewed and used, graph outputs, entrypoints) behind a
94
+ single `ready` / `not ready` verdict backed by two deterministic guarantees:
157
95
 
158
- A Build Plan tells Interf how to build requested Artifacts from your Source for
159
- the agent task. It also states the Context Checks the user can review before the
160
- Build.
96
+ - **Coverage**: every Source file was read and summarized. This is file-level. It
97
+ does not claim every fact was caught, only that no file went unread.
98
+ - **Traceability**: every claim links back to a Source, every summary is linked,
99
+ and every knowledge note connects to the web. No orphans, no islands.
161
100
 
162
- The built-in `interf-default` Build Plan ships with `interf`. Save your own
163
- local Build Plan with `interf plan save <path>`; draft new ones with
164
- `interf plan draft <project-id>`.
101
+ If a file is unread, a claim is unlinked, or a note is an island, the graph is
102
+ `not ready` and the gap is named.
165
103
 
166
- ```text
167
- <build-plan-folder>/
168
- build-plan.json # Build Plan definition: artifacts, stages, build rules
169
- build-plan.schema.json # output contract: required Context Graph files/folders
170
- README.md # what this Build Plan is for
171
- build/
172
- stages/
173
- summarize/ # stage instructions Interf runs during the Build
174
- structure/
175
- shape/
176
- use/
177
- query/ # how agents read the Context Graph
178
- improve/ # how Interf revises the plan if checks still fail
179
- ```
104
+ `interf benchmark` is a separate, optional check that scores answer accuracy
105
+ against the Source baseline, the graph, or both. It is a fallible double-check,
106
+ never a readiness gate.
180
107
 
181
- - `build-plan.json` is the technical filename for the Build Plan definition:
182
- requested Artifacts, stages, and how the files should be built.
183
- - `build-plan.schema.json` describes the output contract: what the Context Graph
184
- must contain.
185
- - `build/stages/<stage>/` is where you author one folder per stage.
186
- - `use/query/` holds the instructions agents follow when they read the Context
187
- Graph for the task.
188
- - `improve/` holds the instructions Interf follows when the first Build misses
189
- and the Build Plan itself needs editing.
108
+ ## Build Plans
190
109
 
191
- ## Build Plan Improvement
110
+ A Build Plan is the reviewed recipe for how Interf builds the graph from your
111
+ Source for the task: requested outputs, stage instructions, expected inputs, and
112
+ the entrypoints you review before building. `interf-default` ships built in.
113
+ Draft your own with `interf plan draft <project-id>`, or save one with
114
+ `interf plan save <path>`.
192
115
 
193
- When the first Build is `not ready`, Interf can edit the Build Plan and build
194
- again. Same Source, same checks, improved Build Plan and Context Graph.
116
+ When a Build comes back `not ready`, Interf can revise the plan and build again
117
+ (same Source, same intent, better plan), recorded as a Run:
195
118
 
196
119
  ```bash
197
120
  interf plan improve <project-id>
198
121
  ```
199
122
 
200
- Interf records Build Plan improvement as a Run with the revised Build Plan,
201
- Build evidence, and resulting Context Graph.
202
-
203
- ## Context Checks And Benchmarks
204
-
205
- Context Checks are plain-English promises the user reviews before a Build.
206
- Requested Artifacts back those checks.
207
-
208
- Examples:
123
+ A Build Plan is a folder you can read and version:
209
124
 
210
- - every file in scope was processed
211
- - required pages or slides were inventoried
212
- - required outputs exist
213
- - every figure cites a source page
214
- - the Source has not changed since the Build
215
-
216
- Benchmarks are different. A benchmark asks saved questions and measures answer
217
- accuracy against an agent source-access baseline, the Context Graph, or both.
218
-
219
- ```bash
220
- interf benchmark bristol
221
- interf benchmark bristol --target source-files
222
- interf benchmark bristol --target context-graph
125
+ ```text
126
+ <build-plan>/
127
+ build-plan.json # outputs, stages, and build rules
128
+ build-plan.schema.json # the output contract: what the graph must contain
129
+ build/stages/<stage>/ # the instructions Interf runs for each stage
130
+ use/query/ # how agents read the graph for the task
131
+ improve/ # how Interf revises the plan when checks still fail
223
132
  ```
224
133
 
225
- `interf benchmark` is optional evaluation. It is not the main readiness surface.
226
-
227
- ## What Interf Is Not
228
-
229
- - Not a second brain or memory product. One Project starts from one Source and
230
- agent task.
231
- - Not a vector store or hosted RAG server. The Context Graph is structured
232
- source-backed context agents can inspect.
233
- - Not a hosted data platform by default. Local Builds run on your machine.
234
- - Not a generic agent task orchestrator. Interf prepares files into Context
235
- Graphs for agents.
236
-
237
- ## Useful Commands
238
-
239
- - `interf` / `interf init` - open the interactive wizard.
240
- - `interf runtime` - run the local Interf runtime in the foreground.
241
- - `interf runtime start` - start a managed background local runtime.
242
- - `interf runtime stop` - stop the running local runtime.
243
- - `interf project ls / create / show / rm` - manage Projects.
244
- - `interf plan list / show / save / draft / select / improve` - manage Build
245
- Plans.
246
- - `interf build <project-id>` - Build the Context Graph for a Project.
247
- - `interf graphs ls --project <id>` / `show <graph-id> --project <id>` - inspect
248
- Context Graphs.
249
- - `interf traces ls --project <id>` / `show <trace-kind> --project <id>` -
250
- inspect Context Graph traces.
251
- - `interf runs ls --project <id>` / `status <run-id>` - inspect Runs.
252
- - `interf benchmark <project-id>` - run an optional benchmark/evaluation pass.
253
- - `interf agents ls / use / register / unregister / map / unmap` - configure
254
- local agents and role mapping.
255
- - `interf login / logout` - connect the CLI to another Interf instance.
256
- - `interf status` - show the active connection and Project summary.
257
- - `interf doctor --live` - check the local executor before a Build.
258
-
259
- ## Public Assets
260
-
261
- - [skills/interf](./skills/interf/) - bundled agent Skill for Interf.
262
- - [build-plans/interf-default](./build-plans/interf-default/) - default Build
263
- Plan that ships with `interf`.
264
-
265
- Contributors: see [CONTRIBUTING.md](./CONTRIBUTING.md).
266
-
267
- License: see [LICENSE.md](./LICENSE.md). © 2026 Interf Inc. All rights reserved.
268
- Name and branding: see [TRADEMARKS.md](./TRADEMARKS.md).
134
+ ## Commands
135
+
136
+ | Command | What it does |
137
+ |---|---|
138
+ | `interf` / `interf init` | Open the interactive wizard |
139
+ | `interf runtime` / `start` / `stop` | Run, background, or stop the local runtime |
140
+ | `interf project create / ls / show / rm` | Manage Projects |
141
+ | `interf plan draft / select / improve / save / list / show` | Manage Build Plans |
142
+ | `interf build <id>` | Build the graph for a Project |
143
+ | `interf graphs ls / show --project <id>` | Inspect built graphs |
144
+ | `interf traces ls / show --project <id>` | Inspect source provenance |
145
+ | `interf runs ls / status --project <id>` | Inspect Runs |
146
+ | `interf benchmark <id>` | Optional accuracy check |
147
+ | `interf agents ls / use / register / map` | Configure local execution agents |
148
+ | `interf status` | Connection and Project summary |
149
+ | `interf doctor --live` | Check your agent before a Build |
150
+
151
+ ## What Interf is not
152
+
153
+ - Not a second brain or memory product: one Project, one Source, one task.
154
+ - Not a vector store or hosted RAG server: the graph is inspectable, source-backed files.
155
+ - Not a hosted data platform: local Builds run on your machine.
156
+ - Not a general knowledge graph or notes app: each graph is built for one agent task, not a single index of everything.
157
+
158
+ ## More
159
+
160
+ - [skills/interf](./skills/interf/): the bundled agent Skill.
161
+ - [build-plans/interf-default](./build-plans/interf-default/): the default Build Plan.
162
+ - [CONTRIBUTING.md](./CONTRIBUTING.md) · [LICENSE.md](./LICENSE.md) · [TRADEMARKS.md](./TRADEMARKS.md)
163
+
164
+ © 2026 Interf Inc. All rights reserved.
@@ -2,37 +2,40 @@
2
2
 
3
3
  Built-in Build Plan that builds a three-layer Context Graph from source files:
4
4
  summaries for coverage, knowledge for task-aware graph structure, and
5
- artifacts for downstream agent handoff with links back to sources.
5
+ home.md/artifacts for downstream agent entrypoints with links back to sources.
6
6
 
7
7
  ## Purpose
8
8
 
9
9
  - General Build Plan implementation for preparing data for agents from source files.
10
- - Build mixed source files into source coverage summaries, task-aware knowledge, Artifact handoffs, and links back to sources the downstream agent can use without rediscovering the Source.
10
+ - Build mixed source files into source coverage summaries, task-aware knowledge, entrypoints, and links back to sources the downstream agent can use without rediscovering the Source.
11
11
 
12
- ## Artifacts
12
+ ## Requested Outputs
13
13
 
14
14
  - `summaries` — source coverage directory at `summaries`
15
15
  - `knowledge` — task-aware graph directory at `knowledge`; current default is
16
16
  flat `knowledge/*.md`, not required `knowledge/entities/`,
17
17
  `knowledge/claims/`, or `knowledge/indexes/` folders
18
- - `artifacts` — task-specific agent handoff directory at `artifacts`
18
+ - `artifacts` — task-specific entrypoint note directory at `artifacts`
19
19
  - `home` — Context Graph index file at `home.md`
20
20
 
21
21
  ## Stages
22
22
 
23
23
  Each stage is a folder with a `SKILL.md` file. Interf creates the stage shell,
24
- attaches source references and runtime context, runs the agent against that
25
- plain-text Skill, and records evidence of what the stage wrote.
24
+ attaches source references and runtime context, runs the stage through the
25
+ runtime contract, and records evidence of what the stage wrote. Flexible stages
26
+ use the connected agent; `build-entrypoint` is assembled by the local service
27
+ from reviewed knowledge and summary resources so `home.md` is deterministic.
26
28
 
27
29
  - `summarize` — Turn source files into source-named coverage folders with source metadata. (build-file-evidence; reads: none; writes: summaries)
28
- - `structure` — Build the task-aware Context Graph structure from summaries, including entities, claims, topics, indexes, and links back to sources. (build-knowledge-structure; reads: summaries; writes: knowledge)
29
- - `shape` — Shape task-specific Artifact handoffs and the final Context Graph around the saved task focus and Context Checks. (build-query-shape; reads: summaries, knowledge; writes: knowledge, artifacts, home)
30
+ - `knowledge` — Build the task-aware Context Graph knowledge layer from summaries, including entities, claims, topics, indexes, and links back to sources. (build-knowledge; reads: summaries; writes: knowledge)
31
+ - `entrypoint` — Assemble home.md as the primary agent entrypoint plus task-specific entrypoint notes around the saved Project intent and coverage. (build-entrypoint; reads: summaries, knowledge; writes: knowledge, artifacts, home)
30
32
 
31
33
  ## Why `home.md` exists here
32
34
 
33
- This built-in Build Plan creates `home.md` as the Context Graph index.
34
- Downstream agents should start from `artifacts/` for task handoffs and use
35
- `home.md` only to navigate the graph. That is behavior of the `interf-default`
36
- Build Plan implementation, not a local-service invariant.
35
+ This built-in Build Plan creates `home.md` as the primary Context Graph
36
+ entrypoint. Downstream agents should start from `home.md`, then follow links
37
+ into `knowledge/`, `summaries/`, `artifacts/`, and source refs. That is
38
+ behavior of the `interf-default` Build Plan implementation, not a local-service
39
+ invariant.
37
40
 
38
41
  This package is the built-in seed for `interf-default`.