@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
@@ -80,15 +80,216 @@ export declare const ContextGraphLocatorSchema: z.ZodObject<{
80
80
  value: z.ZodString;
81
81
  }, z.core.$strict>;
82
82
  export type ContextGraphLocator = z.infer<typeof ContextGraphLocatorSchema>;
83
+ export declare const ContextGraphArtifactHandoffSchema: z.ZodObject<{
84
+ artifact_id: z.ZodOptional<z.ZodString>;
85
+ label: z.ZodString;
86
+ locator: z.ZodObject<{
87
+ kind: z.ZodEnum<{
88
+ "local-path": "local-path";
89
+ "remote-url": "remote-url";
90
+ "api-served": "api-served";
91
+ }>;
92
+ value: z.ZodString;
93
+ }, z.core.$strict>;
94
+ path: z.ZodOptional<z.ZodString>;
95
+ artifact_kind: z.ZodOptional<z.ZodEnum<{
96
+ file: "file";
97
+ directory: "directory";
98
+ }>>;
99
+ role: z.ZodDefault<z.ZodEnum<{
100
+ entrypoint: "entrypoint";
101
+ artifact: "artifact";
102
+ guidance: "guidance";
103
+ "source-index": "source-index";
104
+ }>>;
105
+ summary: z.ZodOptional<z.ZodString>;
106
+ }, z.core.$strict>;
107
+ export type ContextGraphArtifactHandoff = z.infer<typeof ContextGraphArtifactHandoffSchema>;
108
+ export declare const ContextGraphPortableHandoffSchema: z.ZodObject<{
109
+ locator: z.ZodObject<{
110
+ kind: z.ZodEnum<{
111
+ "local-path": "local-path";
112
+ "remote-url": "remote-url";
113
+ "api-served": "api-served";
114
+ }>;
115
+ value: z.ZodString;
116
+ }, z.core.$strict>;
117
+ instructions: z.ZodOptional<z.ZodString>;
118
+ }, z.core.$strict>;
119
+ export type ContextGraphPortableHandoff = z.infer<typeof ContextGraphPortableHandoffSchema>;
120
+ export declare const ContextGraphHandoffSchema: z.ZodObject<{
121
+ kind: z.ZodLiteral<"interf-context-graph-handoff">;
122
+ version: z.ZodLiteral<1>;
123
+ entrypoint: z.ZodObject<{
124
+ artifact_id: z.ZodOptional<z.ZodString>;
125
+ label: z.ZodString;
126
+ locator: z.ZodObject<{
127
+ kind: z.ZodEnum<{
128
+ "local-path": "local-path";
129
+ "remote-url": "remote-url";
130
+ "api-served": "api-served";
131
+ }>;
132
+ value: z.ZodString;
133
+ }, z.core.$strict>;
134
+ path: z.ZodOptional<z.ZodString>;
135
+ artifact_kind: z.ZodOptional<z.ZodEnum<{
136
+ file: "file";
137
+ directory: "directory";
138
+ }>>;
139
+ role: z.ZodDefault<z.ZodEnum<{
140
+ entrypoint: "entrypoint";
141
+ artifact: "artifact";
142
+ guidance: "guidance";
143
+ "source-index": "source-index";
144
+ }>>;
145
+ summary: z.ZodOptional<z.ZodString>;
146
+ }, z.core.$strict>;
147
+ artifacts: z.ZodDefault<z.ZodArray<z.ZodObject<{
148
+ artifact_id: z.ZodOptional<z.ZodString>;
149
+ label: z.ZodString;
150
+ locator: z.ZodObject<{
151
+ kind: z.ZodEnum<{
152
+ "local-path": "local-path";
153
+ "remote-url": "remote-url";
154
+ "api-served": "api-served";
155
+ }>;
156
+ value: z.ZodString;
157
+ }, z.core.$strict>;
158
+ path: z.ZodOptional<z.ZodString>;
159
+ artifact_kind: z.ZodOptional<z.ZodEnum<{
160
+ file: "file";
161
+ directory: "directory";
162
+ }>>;
163
+ role: z.ZodDefault<z.ZodEnum<{
164
+ entrypoint: "entrypoint";
165
+ artifact: "artifact";
166
+ guidance: "guidance";
167
+ "source-index": "source-index";
168
+ }>>;
169
+ summary: z.ZodOptional<z.ZodString>;
170
+ }, z.core.$strict>>>;
171
+ portable: z.ZodOptional<z.ZodObject<{
172
+ locator: z.ZodObject<{
173
+ kind: z.ZodEnum<{
174
+ "local-path": "local-path";
175
+ "remote-url": "remote-url";
176
+ "api-served": "api-served";
177
+ }>;
178
+ value: z.ZodString;
179
+ }, z.core.$strict>;
180
+ instructions: z.ZodOptional<z.ZodString>;
181
+ }, z.core.$strict>>;
182
+ }, z.core.$strict>;
183
+ export type ContextGraphHandoff = z.infer<typeof ContextGraphHandoffSchema>;
83
184
  export declare const ContextGraphSchema: z.ZodObject<{
84
185
  kind: z.ZodLiteral<"interf-context-graph">;
85
186
  version: z.ZodLiteral<1>;
86
187
  graph_id: z.ZodString;
87
188
  project_id: z.ZodString;
189
+ intent: z.ZodOptional<z.ZodString>;
88
190
  build_run_id: z.ZodString;
89
191
  source_state_id: z.ZodString;
192
+ source_manifest_id: z.ZodOptional<z.ZodString>;
90
193
  created_at: z.ZodString;
91
194
  ready: z.ZodBoolean;
195
+ readiness: z.ZodOptional<z.ZodObject<{
196
+ kind: z.ZodLiteral<"interf-readiness-state">;
197
+ version: z.ZodLiteral<1>;
198
+ generated_at: z.ZodString;
199
+ project: z.ZodString;
200
+ status: z.ZodEnum<{
201
+ ready: "ready";
202
+ "not-ready": "not-ready";
203
+ failed: "failed";
204
+ "not-configured": "not-configured";
205
+ "not-built": "not-built";
206
+ building: "building";
207
+ built: "built";
208
+ checking: "checking";
209
+ stale: "stale";
210
+ }>;
211
+ ready: z.ZodBoolean;
212
+ summary: z.ZodString;
213
+ context_graph_path: z.ZodNullable<z.ZodString>;
214
+ latest_build_run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
215
+ latest_benchmark_run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
216
+ build: z.ZodNullable<z.ZodObject<{
217
+ gate: z.ZodEnum<{
218
+ "context-graph": "context-graph";
219
+ "project-config": "project-config";
220
+ "build-run": "build-run";
221
+ "artifact-diagnostics": "artifact-diagnostics";
222
+ "context-checks": "context-checks";
223
+ benchmarks: "benchmarks";
224
+ "benchmarks-current": "benchmarks-current";
225
+ }>;
226
+ ok: z.ZodBoolean;
227
+ status: z.ZodOptional<z.ZodEnum<{
228
+ ready: "ready";
229
+ "not-ready": "not-ready";
230
+ failed: "failed";
231
+ "not-configured": "not-configured";
232
+ "not-built": "not-built";
233
+ building: "building";
234
+ built: "built";
235
+ checking: "checking";
236
+ stale: "stale";
237
+ }>>;
238
+ summary: z.ZodString;
239
+ detail: z.ZodOptional<z.ZodString>;
240
+ run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
241
+ artifact_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
242
+ }, z.core.$strict>>;
243
+ check_results: z.ZodObject<{
244
+ configured: z.ZodNumber;
245
+ fingerprint: z.ZodNullable<z.ZodString>;
246
+ source_files: z.ZodNullable<z.ZodObject<{
247
+ passed: z.ZodNumber;
248
+ total: z.ZodNumber;
249
+ pass_rate: z.ZodNullable<z.ZodNumber>;
250
+ checks_fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
251
+ stale: z.ZodDefault<z.ZodBoolean>;
252
+ run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
253
+ run_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
254
+ }, z.core.$strict>>;
255
+ context_graph: z.ZodNullable<z.ZodObject<{
256
+ passed: z.ZodNumber;
257
+ total: z.ZodNumber;
258
+ pass_rate: z.ZodNullable<z.ZodNumber>;
259
+ checks_fingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
260
+ stale: z.ZodDefault<z.ZodBoolean>;
261
+ run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
262
+ run_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
263
+ }, z.core.$strict>>;
264
+ }, z.core.$strict>;
265
+ checks: z.ZodDefault<z.ZodArray<z.ZodObject<{
266
+ gate: z.ZodEnum<{
267
+ "context-graph": "context-graph";
268
+ "project-config": "project-config";
269
+ "build-run": "build-run";
270
+ "artifact-diagnostics": "artifact-diagnostics";
271
+ "context-checks": "context-checks";
272
+ benchmarks: "benchmarks";
273
+ "benchmarks-current": "benchmarks-current";
274
+ }>;
275
+ ok: z.ZodBoolean;
276
+ status: z.ZodOptional<z.ZodEnum<{
277
+ ready: "ready";
278
+ "not-ready": "not-ready";
279
+ failed: "failed";
280
+ "not-configured": "not-configured";
281
+ "not-built": "not-built";
282
+ building: "building";
283
+ built: "built";
284
+ checking: "checking";
285
+ stale: "stale";
286
+ }>>;
287
+ summary: z.ZodString;
288
+ detail: z.ZodOptional<z.ZodString>;
289
+ run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
290
+ artifact_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
291
+ }, z.core.$strict>>>;
292
+ }, z.core.$strict>>;
92
293
  locator: z.ZodObject<{
93
294
  kind: z.ZodEnum<{
94
295
  "local-path": "local-path";
@@ -97,12 +298,71 @@ export declare const ContextGraphSchema: z.ZodObject<{
97
298
  }>;
98
299
  value: z.ZodString;
99
300
  }, z.core.$strict>;
301
+ entrypoint_artifact: z.ZodOptional<z.ZodObject<{
302
+ artifact_id: z.ZodOptional<z.ZodString>;
303
+ label: z.ZodString;
304
+ locator: z.ZodObject<{
305
+ kind: z.ZodEnum<{
306
+ "local-path": "local-path";
307
+ "remote-url": "remote-url";
308
+ "api-served": "api-served";
309
+ }>;
310
+ value: z.ZodString;
311
+ }, z.core.$strict>;
312
+ path: z.ZodOptional<z.ZodString>;
313
+ artifact_kind: z.ZodOptional<z.ZodEnum<{
314
+ file: "file";
315
+ directory: "directory";
316
+ }>>;
317
+ role: z.ZodDefault<z.ZodEnum<{
318
+ entrypoint: "entrypoint";
319
+ artifact: "artifact";
320
+ guidance: "guidance";
321
+ "source-index": "source-index";
322
+ }>>;
323
+ summary: z.ZodOptional<z.ZodString>;
324
+ }, z.core.$strict>>;
325
+ artifact_handoffs: z.ZodDefault<z.ZodArray<z.ZodObject<{
326
+ artifact_id: z.ZodOptional<z.ZodString>;
327
+ label: z.ZodString;
328
+ locator: z.ZodObject<{
329
+ kind: z.ZodEnum<{
330
+ "local-path": "local-path";
331
+ "remote-url": "remote-url";
332
+ "api-served": "api-served";
333
+ }>;
334
+ value: z.ZodString;
335
+ }, z.core.$strict>;
336
+ path: z.ZodOptional<z.ZodString>;
337
+ artifact_kind: z.ZodOptional<z.ZodEnum<{
338
+ file: "file";
339
+ directory: "directory";
340
+ }>>;
341
+ role: z.ZodDefault<z.ZodEnum<{
342
+ entrypoint: "entrypoint";
343
+ artifact: "artifact";
344
+ guidance: "guidance";
345
+ "source-index": "source-index";
346
+ }>>;
347
+ summary: z.ZodOptional<z.ZodString>;
348
+ }, z.core.$strict>>>;
349
+ portable_handoff: z.ZodOptional<z.ZodObject<{
350
+ locator: z.ZodObject<{
351
+ kind: z.ZodEnum<{
352
+ "local-path": "local-path";
353
+ "remote-url": "remote-url";
354
+ "api-served": "api-served";
355
+ }>;
356
+ value: z.ZodString;
357
+ }, z.core.$strict>;
358
+ instructions: z.ZodOptional<z.ZodString>;
359
+ }, z.core.$strict>>;
100
360
  artifacts: z.ZodDefault<z.ZodArray<z.ZodObject<{
101
361
  artifact_id: z.ZodString;
102
362
  status: z.ZodEnum<{
363
+ ready: "ready";
103
364
  failed: "failed";
104
365
  skipped: "skipped";
105
- ready: "ready";
106
366
  not_ready: "not_ready";
107
367
  }>;
108
368
  built_by_stages: z.ZodDefault<z.ZodArray<z.ZodString>>;
@@ -119,6 +379,9 @@ export declare const ContextGraphSchema: z.ZodObject<{
119
379
  frontmatter_required_keys: "frontmatter_required_keys";
120
380
  frontmatter_nonempty_keys: "frontmatter_nonempty_keys";
121
381
  source_refs_required: "source_refs_required";
382
+ summary_backlinks_present: "summary_backlinks_present";
383
+ knowledge_web_connectivity: "knowledge_web_connectivity";
384
+ graph_notes_connected: "graph_notes_connected";
122
385
  wikilinks_valid: "wikilinks_valid";
123
386
  must_not_contain: "must_not_contain";
124
387
  must_contain: "must_contain";
@@ -1,23 +1,23 @@
1
1
  import { z } from "zod";
2
- import { ArtifactStatusSchema, InterfIdPattern, isInterfRelativePath, } from "./schema.js";
2
+ import { ArtifactIdSchema, ArtifactStatusSchema, InterfIdPattern, LocatorSchema, ProjectIdPattern, ProjectIdSchema, ProjectIntentSchema, ReadinessSchema, isInterfRelativePath, } from "./schema.js";
3
3
  // ───────────────────────────────────────────────────────────────────────────
4
4
  // Project — the durable Source binding and selected Build Plan container.
5
5
  //
6
- // A Project binds a Source (folder), execution agents, Project activity,
7
- // and one selected Build Plan. The Build Plan owns intent, requested
8
- // Artifacts, checks, Build instructions, and optional source context.
6
+ // A Project binds a Source (folder), Project intent, execution agents, Project
7
+ // activity, and one selected Build Plan. The Build Plan is the recipe for
8
+ // preparing a Context Graph for that Project intent.
9
9
  // Each Build produces one Context Graph.
10
10
  //
11
11
  // Project identity = `path + machine_id` (same folder on different machines
12
12
  // is a different Project). The `id` here is the user-facing handle, derived
13
13
  // from the source folder basename + locator hash at create time.
14
14
  // ───────────────────────────────────────────────────────────────────────────
15
- export const ProjectNamePattern = /^[a-z0-9][a-z0-9-]*$/;
16
- const RESERVED_PROJECT_NAMES = new Set(["tests", "build-plans"]);
17
- export const ProjectNameSchema = z
18
- .string()
19
- .regex(ProjectNamePattern, "Project names must use lowercase letters, numbers, and dashes only.")
20
- .refine((value) => !RESERVED_PROJECT_NAMES.has(value), "Project name is reserved.");
15
+ // A Project's user-facing handle and its internal id share one identity rule:
16
+ // same regex, same reserved set, same messages. Both names alias the single
17
+ // source in `schema.ts` (`ProjectIdPattern` / `ProjectIdSchema`) so the rule is
18
+ // defined once. The aliases preserve the `projectSchema.*` namespace surface.
19
+ export const ProjectNamePattern = ProjectIdPattern;
20
+ export const ProjectNameSchema = ProjectIdSchema;
21
21
  /**
22
22
  * Drift verdict for a Project's source binding.
23
23
  *
@@ -89,20 +89,45 @@ export const TracesSchema = z.object({
89
89
  // The Context Graph wraps the per-build output and surfaces artifacts
90
90
  // + traces as first-class fields.
91
91
  // ───────────────────────────────────────────────────────────────────────────
92
- export const ContextGraphLocatorSchema = z.object({
93
- kind: z.enum(["local-path", "remote-url", "api-served"]),
94
- value: z.string().min(1),
92
+ export const ContextGraphLocatorSchema = LocatorSchema;
93
+ export const ContextGraphArtifactHandoffSchema = z.object({
94
+ artifact_id: ArtifactIdSchema.optional(),
95
+ label: z.string().min(1),
96
+ locator: LocatorSchema,
97
+ path: z.string().min(1).refine(isInterfRelativePath, {
98
+ message: "Context Graph handoff paths must stay inside the Context Graph root.",
99
+ }).optional(),
100
+ artifact_kind: z.enum(["file", "directory"]).optional(),
101
+ role: z.enum(["entrypoint", "artifact", "guidance", "source-index"]).default("artifact"),
102
+ summary: z.string().min(1).optional(),
103
+ }).strict();
104
+ export const ContextGraphPortableHandoffSchema = z.object({
105
+ locator: LocatorSchema,
106
+ instructions: z.string().min(1).optional(),
107
+ }).strict();
108
+ export const ContextGraphHandoffSchema = z.object({
109
+ kind: z.literal("interf-context-graph-handoff"),
110
+ version: z.literal(1),
111
+ entrypoint: ContextGraphArtifactHandoffSchema,
112
+ artifacts: z.array(ContextGraphArtifactHandoffSchema).default([]),
113
+ portable: ContextGraphPortableHandoffSchema.optional(),
95
114
  }).strict();
96
115
  export const ContextGraphSchema = z.object({
97
116
  kind: z.literal("interf-context-graph"),
98
117
  version: z.literal(1),
99
118
  graph_id: z.string().min(1),
100
119
  project_id: z.string().min(1),
120
+ intent: ProjectIntentSchema.optional(),
101
121
  build_run_id: z.string().min(1),
102
122
  source_state_id: z.string().min(1),
123
+ source_manifest_id: z.string().min(1).optional(),
103
124
  created_at: z.string().min(1),
104
125
  ready: z.boolean(),
126
+ readiness: ReadinessSchema.optional(),
105
127
  locator: ContextGraphLocatorSchema,
128
+ entrypoint_artifact: ContextGraphArtifactHandoffSchema.optional(),
129
+ artifact_handoffs: z.array(ContextGraphArtifactHandoffSchema).default([]),
130
+ portable_handoff: ContextGraphPortableHandoffSchema.optional(),
106
131
  artifacts: z.array(ArtifactStatusSchema).default([]),
107
132
  traces: TracesSchema,
108
133
  }).strict();