@interf/compiler 0.18.0 → 0.21.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 (129) hide show
  1. package/README.md +87 -73
  2. package/dist/cli/commands/mcp.d.ts +0 -34
  3. package/dist/cli/commands/mcp.js +246 -45
  4. package/dist/cli/commands/method.js +261 -15
  5. package/dist/cli/commands/prep.js +61 -16
  6. package/dist/cli/commands/runs.js +103 -9
  7. package/dist/cli/commands/status.js +4 -2
  8. package/dist/cli/commands/test.d.ts +10 -0
  9. package/dist/cli/commands/{verify.js → test.js} +16 -18
  10. package/dist/cli/commands/web.js +82 -8
  11. package/dist/cli/commands/wizard.js +36 -37
  12. package/dist/cli/index.d.ts +2 -2
  13. package/dist/cli/index.js +3 -3
  14. package/dist/compiler-ui/404.html +1 -1
  15. package/dist/compiler-ui/__next.__PAGE__.txt +5 -5
  16. package/dist/compiler-ui/__next._full.txt +13 -12
  17. package/dist/compiler-ui/__next._head.txt +3 -3
  18. package/dist/compiler-ui/__next._index.txt +5 -4
  19. package/dist/compiler-ui/__next._tree.txt +4 -3
  20. package/dist/compiler-ui/_next/static/chunks/01646j7yi.w5a.css +1 -0
  21. package/dist/compiler-ui/_next/static/chunks/{0n51hrfoufc7g.js → 02f_.8.ebn556.js} +1 -1
  22. package/dist/compiler-ui/_next/static/chunks/02r7siaw-_p5w.js +1 -0
  23. package/dist/compiler-ui/_next/static/chunks/{08m7vf5asqlsm.js → 04d0ly-7xb~-j.js} +10 -10
  24. package/dist/compiler-ui/_next/static/chunks/0fhs9psnxqd8s.js +1 -0
  25. package/dist/compiler-ui/_next/static/chunks/0mssmhpbifj15.css +2 -0
  26. package/dist/compiler-ui/_next/static/chunks/0nypu~ddwxari.js +116 -0
  27. package/dist/compiler-ui/_next/static/chunks/0p3s8iyhgcww2.js +31 -0
  28. package/dist/compiler-ui/_next/static/chunks/0tjf-vu_rz8s0.css +1 -0
  29. package/dist/compiler-ui/_next/static/chunks/0u6p3fpbbfgtl.js +1 -0
  30. package/dist/compiler-ui/_next/static/chunks/0wpx5..8dnh0w.js +1 -0
  31. package/dist/compiler-ui/_next/static/chunks/0y0uj160p0ts~.js +1 -0
  32. package/dist/compiler-ui/_next/static/chunks/10t8l~_oenf.c.js +1 -0
  33. package/dist/compiler-ui/_next/static/chunks/13gz9e7z~imx1.js +5 -0
  34. package/dist/compiler-ui/_next/static/chunks/156xed-b6czaw.js +1 -0
  35. package/dist/compiler-ui/_next/static/chunks/{turbopack-0.uq1k8c0j4s..js → turbopack-02-3e_c-yz~5g.js} +1 -1
  36. package/dist/compiler-ui/_next/static/chunks/{turbopack-10e~t1yzi4svj.js → turbopack-0apv8vb-nczuy.js} +1 -1
  37. package/dist/compiler-ui/_not-found/__next._full.txt +10 -9
  38. package/dist/compiler-ui/_not-found/__next._head.txt +3 -3
  39. package/dist/compiler-ui/_not-found/__next._index.txt +5 -4
  40. package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +2 -2
  41. package/dist/compiler-ui/_not-found/__next._not-found.txt +3 -3
  42. package/dist/compiler-ui/_not-found/__next._tree.txt +3 -2
  43. package/dist/compiler-ui/_not-found.html +1 -1
  44. package/dist/compiler-ui/_not-found.txt +10 -9
  45. package/dist/compiler-ui/index.html +1 -1
  46. package/dist/compiler-ui/index.txt +13 -12
  47. package/dist/packages/contracts/lib/schema.d.ts +4 -0
  48. package/dist/packages/contracts/lib/schema.js +2 -1
  49. package/dist/packages/engine/action-definitions.d.ts +174 -13
  50. package/dist/packages/engine/action-definitions.js +125 -122
  51. package/dist/packages/engine/action-planner.js +4 -11
  52. package/dist/packages/engine/agents/lib/shells.d.ts +3 -1
  53. package/dist/packages/engine/agents/lib/shells.js +8 -4
  54. package/dist/packages/engine/agents/role-executors.js +1 -1
  55. package/dist/packages/engine/compile/compiled-paths.js +6 -6
  56. package/dist/packages/engine/connection-config.js +1 -1
  57. package/dist/packages/engine/execution/lib/schema.d.ts +10 -0
  58. package/dist/packages/engine/instance-paths.d.ts +15 -9
  59. package/dist/packages/engine/instance-paths.js +15 -9
  60. package/dist/packages/engine/lib/schema.d.ts +686 -30
  61. package/dist/packages/engine/lib/schema.js +48 -21
  62. package/dist/packages/engine/native-run-handlers.js +10 -8
  63. package/dist/packages/engine/preparation-store.d.ts +9 -13
  64. package/dist/packages/engine/preparation-store.js +12 -0
  65. package/dist/packages/engine/requested-artifacts.d.ts +5 -0
  66. package/dist/packages/engine/requested-artifacts.js +36 -0
  67. package/dist/packages/engine/routes.d.ts +1 -1
  68. package/dist/packages/engine/routes.js +1 -1
  69. package/dist/packages/engine/run-observability.js +3 -2
  70. package/dist/packages/engine/runtime-proposal-helpers.d.ts +2 -2
  71. package/dist/packages/engine/runtime-proposal-helpers.js +5 -7
  72. package/dist/packages/engine/runtime-resource-builders.d.ts +5 -0
  73. package/dist/packages/engine/runtime-resource-builders.js +13 -2
  74. package/dist/packages/engine/runtime.d.ts +3 -1
  75. package/dist/packages/engine/runtime.js +146 -21
  76. package/dist/packages/engine/server.js +104 -52
  77. package/dist/packages/engine/verify/verify-execution.js +1 -1
  78. package/dist/packages/engine/wire-schemas.d.ts +5 -1
  79. package/dist/packages/engine/wire-schemas.js +1 -1
  80. package/dist/packages/methods/authoring/method-authoring.d.ts +3 -1
  81. package/dist/packages/methods/authoring/method-authoring.js +5 -36
  82. package/dist/packages/methods/package/builtin-compiled-method.js +1 -1
  83. package/dist/packages/methods/package/local-methods.d.ts +1 -0
  84. package/dist/packages/methods/package/local-methods.js +19 -4
  85. package/dist/packages/methods/package/method-definitions.js +1 -1
  86. package/dist/packages/project/interf-detect.js +6 -6
  87. package/dist/packages/project/lib/schema.d.ts +193 -0
  88. package/dist/packages/project/lib/schema.js +46 -1
  89. package/dist/packages/project/source-config.js +4 -0
  90. package/dist/packages/project/source-folders.js +1 -1
  91. package/package.json +7 -8
  92. package/public-repo/CONTRIBUTING.md +47 -0
  93. package/public-repo/LICENSE.md +1 -0
  94. package/public-repo/README.md +325 -0
  95. package/public-repo/SECURITY.md +67 -0
  96. package/public-repo/TRADEMARKS.md +8 -0
  97. package/{builtin-methods → public-repo/methods}/interf-default/README.md +4 -0
  98. package/{builtin-methods → public-repo/methods}/interf-default/compile/stages/shape/SKILL.md +4 -8
  99. package/{builtin-methods → public-repo/methods}/interf-default/method.json +1 -1
  100. package/public-repo/methods/interf-default/use/query/SKILL.md +23 -0
  101. package/public-repo/plugins/README.md +9 -0
  102. package/public-repo/plugins/interf/.claude-plugin/plugin.json +21 -0
  103. package/public-repo/plugins/interf/.mcp.json +12 -0
  104. package/public-repo/plugins/interf/README.md +29 -0
  105. package/public-repo/plugins/interf/skills/interf/SKILL.md +477 -0
  106. package/public-repo/skills/interf/SKILL.md +477 -0
  107. package/agent-skills/interf-actions/SKILL.md +0 -185
  108. package/agent-skills/interf-actions/references/cli.md +0 -243
  109. package/builtin-methods/interf-default/use/query/SKILL.md +0 -28
  110. package/dist/cli/commands/verify.d.ts +0 -10
  111. package/dist/compiler-ui/_next/static/chunks/06yhdspx~ca5-.js +0 -5
  112. package/dist/compiler-ui/_next/static/chunks/06z~l3kwb891e.js +0 -1
  113. package/dist/compiler-ui/_next/static/chunks/08g7lvje.te.u.js +0 -1
  114. package/dist/compiler-ui/_next/static/chunks/0_c_tvh-cukjz.css +0 -3
  115. package/dist/compiler-ui/_next/static/chunks/0_i-3_5l9t2qe.js +0 -1
  116. package/dist/compiler-ui/_next/static/chunks/0b-ywny_j0g~0.js +0 -1
  117. package/dist/compiler-ui/_next/static/chunks/0b52v41o1gixx.js +0 -1
  118. package/dist/compiler-ui/_next/static/chunks/0f_geuwdesg_c.js +0 -114
  119. package/dist/compiler-ui/_next/static/chunks/0gpzgsv0w.q~m.js +0 -31
  120. package/dist/compiler-ui/_next/static/chunks/0ilwfezfvu6~-.js +0 -1
  121. package/dist/compiler-ui/_next/static/chunks/0xxmf45eskdt~.css +0 -1
  122. package/dist/compiler-ui/_next/static/chunks/14wtz~vq25~qq.js +0 -1
  123. /package/dist/compiler-ui/_next/static/{6qyE1u9m_oBUkvAhhoCmO → tYHMLL9oKds1yDoNYgkPV}/_buildManifest.js +0 -0
  124. /package/dist/compiler-ui/_next/static/{6qyE1u9m_oBUkvAhhoCmO → tYHMLL9oKds1yDoNYgkPV}/_clientMiddlewareManifest.js +0 -0
  125. /package/dist/compiler-ui/_next/static/{6qyE1u9m_oBUkvAhhoCmO → tYHMLL9oKds1yDoNYgkPV}/_ssgManifest.js +0 -0
  126. /package/{builtin-methods → public-repo/methods}/interf-default/compile/stages/structure/SKILL.md +0 -0
  127. /package/{builtin-methods → public-repo/methods}/interf-default/compile/stages/summarize/SKILL.md +0 -0
  128. /package/{builtin-methods → public-repo/methods}/interf-default/improve/SKILL.md +0 -0
  129. /package/{builtin-methods → public-repo/methods}/interf-default/method.schema.json +0 -0
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { ArtifactRefSchema, CompileRunSchema, CompileRunStatusSchema, InterfRunEventSchema, ProofRecordSchema, RunObservabilitySchema, } from "../execution/lib/schema.js";
3
- import { SourcePreparationConfigSchema, SourceReadinessCheckSchema, } from "../../project/lib/schema.js";
3
+ import { RequestedArtifactSchema, SourcePreparationConfigSchema, SourceProfileSchema, SourceReadinessCheckSchema, } from "../../project/lib/schema.js";
4
4
  import { ArtifactSchema, ArtifactIdSchema, ArtifactPathShapeSchema, ArtifactStatusSchema, CheckSchema, LocatorSchema, PreparationNameSchema, ReadinessSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, MethodIdSchema, TestTargetTypeSchema, } from "../../contracts/lib/schema.js";
5
5
  import { ReadinessCheckRunSchema, } from "../verify/lib/schema.js";
6
6
  const JsonObjectSchema = z.record(z.string(), z.unknown());
@@ -51,12 +51,14 @@ export const PreparationCreateRequestSchema = z.object({
51
51
  id: PreparationNameSchema,
52
52
  source: SourceBindingSchema,
53
53
  /**
54
- * Method binding. Optional — a preparation can be created with no
55
- * method bound, then have one selected (or drafted) later before the
56
- * first compile. Null/missing means "method not chosen yet".
54
+ * Selected Build Plan / Method package id. Optional — a Preparation
55
+ * can be created with requested Artifacts first, then have a Build Plan
56
+ * selected or drafted later before the first compile.
57
57
  */
58
58
  method_id: MethodIdSchema.nullable().optional(),
59
59
  about: z.string().min(1).optional(),
60
+ requested_artifacts: z.array(RequestedArtifactSchema).default([]),
61
+ source_profile: SourceProfileSchema.optional(),
60
62
  checks: z.array(SourceReadinessCheckSchema).default([]),
61
63
  max_attempts: SourceCompiledMaxAttemptsSchema.optional(),
62
64
  max_loops: SourceCompiledMaxLoopsSchema.optional(),
@@ -66,11 +68,13 @@ export const PreparationUpdateRequestSchema = z.object({
66
68
  method_id: MethodIdSchema.nullable().optional(),
67
69
  about: z.string().nullable().optional(),
68
70
  /**
69
- * Replace the full quality-check list. Use the empty array to clear
71
+ * Replace the full readiness-check list. Use the empty array to clear
70
72
  * every check. Each item is a `SourceReadinessCheck`
71
73
  * (`{ question, answer?, strictness?, expect? }`).
72
74
  */
73
75
  checks: z.array(SourceReadinessCheckSchema).optional(),
76
+ requested_artifacts: z.array(RequestedArtifactSchema).optional(),
77
+ source_profile: SourceProfileSchema.nullable().optional(),
74
78
  }).strict();
75
79
  /** Body of `POST /v1/methods` — install a Method package by path. */
76
80
  export const MethodInstallRequestSchema = z.object({
@@ -94,6 +98,8 @@ export const PreparationWireShapeSchema = z.object({
94
98
  config_path: z.string().min(1),
95
99
  portable_context: ArtifactLocatorSchema,
96
100
  checks: z.array(SourceReadinessCheckSchema).default([]),
101
+ requested_artifacts: z.array(RequestedArtifactSchema).default([]),
102
+ source_profile: SourceProfileSchema.nullable().optional(),
97
103
  }).strict();
98
104
  /**
99
105
  * The local service must only ever bind to a loopback interface. Any other
@@ -199,6 +205,8 @@ export const PreparationResourceSchema = z.object({
199
205
  source_path: z.string().min(1),
200
206
  method_id: MethodIdSchema.nullable(),
201
207
  checks: z.array(SourceReadinessCheckSchema).default([]),
208
+ requested_artifacts: z.array(RequestedArtifactSchema).default([]),
209
+ source_profile: SourceProfileSchema.nullable().optional(),
202
210
  portable_context: PortableContextMappingSchema,
203
211
  portable_context_path: z.string().min(1).nullable(),
204
212
  readiness: ReadinessSchema,
@@ -217,6 +225,17 @@ export const MethodResourceSchema = z.object({
217
225
  path: z.string().min(1),
218
226
  label: z.string().min(1).optional(),
219
227
  hint: z.string().min(1).optional(),
228
+ purpose: z.object({
229
+ label: z.string().min(1),
230
+ task_hint: z.string().min(1),
231
+ }).strict().optional(),
232
+ inputs: z.array(z.object({
233
+ id: ArtifactIdSchema,
234
+ label: z.string().min(1),
235
+ description: z.string().min(1),
236
+ required: z.boolean().default(false),
237
+ examples: z.array(z.string().min(1)).optional(),
238
+ }).strict()).default([]),
220
239
  source_kind: z.enum(["builtin", "local"]).default("local"),
221
240
  built_in: z.boolean().default(false),
222
241
  active_for_preparations: z.array(PreparationNameSchema).default([]),
@@ -339,7 +358,7 @@ export const PreparationSetupResultSchema = z.object({
339
358
  version: z.literal(1),
340
359
  operation: z.enum(["create", "select-method"]),
341
360
  preparation: PreparationNameSchema,
342
- method: MethodIdSchema,
361
+ method: MethodIdSchema.nullable(),
343
362
  source_folder_path: z.string().min(1),
344
363
  config_path: z.string().min(1),
345
364
  portable_context_path: z.string().min(1),
@@ -433,6 +452,8 @@ export const MethodAuthoringCreateRequestSchema = z.object({
433
452
  hint: z.string().min(1),
434
453
  task_prompt: z.string().min(1),
435
454
  checks: z.array(SourceReadinessCheckSchema).default([]),
455
+ requested_artifacts: z.array(RequestedArtifactSchema).default([]),
456
+ source_profile: SourceProfileSchema.nullable().optional(),
436
457
  artifact_requirements: z.array(MethodAuthoringArtifactRequirementSchema).default([]),
437
458
  }).strict();
438
459
  export const MethodAuthoringResultSchema = z.object({
@@ -478,7 +499,7 @@ export const VerifyRunStatusSchema = RunStatusSchema;
478
499
  * judges against the raw source folder for a baseline that reveals
479
500
  * how much value the Method actually adds. The 0.15 cleanup made
480
501
  * verify compiled-only on the wire because the source-files branch
481
- * had been retired in 0.13.1; 0.17 restores it because the QA tab and
502
+ * had been retired in 0.13.1; 0.17 restores it because the readiness-check UI and
482
503
  * `verify/README.md` have always claimed the option exists, and the
483
504
  * sandbox + spec builders for source-files have remained in tree
484
505
  * since 0.13.
@@ -649,30 +670,36 @@ export const LocalServiceDiscoverySchema = z.object({
649
670
  kind: z.literal("interf-local-service-discovery"),
650
671
  version: z.literal(1),
651
672
  resources: z.object({
673
+ instance: z.string().min(1),
652
674
  preparations: z.string().min(1),
653
675
  methods: z.string().min(1),
654
676
  runs: z.string().min(1),
655
- readiness: z.string().min(1),
656
- portable_contexts: z.string().min(1),
657
- source_files: z.string().min(1),
658
- workspace_files: z.string().min(1),
659
677
  action_proposals: z.string().min(1),
660
- preparation_setups: z.string().min(1),
661
- preparation_changes: z.string().min(1),
662
- method_changes: z.string().min(1),
663
- workspace_bootstraps: z.string().min(1).optional(),
664
- readiness_check_drafts: z.string().min(1),
665
- method_authoring_runs: z.string().min(1),
666
- method_improvement_runs: z.string().min(1),
667
- compile_runs: z.string().min(1),
668
- verify_runs: z.string().min(1),
669
- reset: z.string().min(1),
670
678
  executor: z.string().min(1),
679
+ open_path: z.string().min(1),
671
680
  /**
672
681
  * 0.15 — connected agents primitive. Optional during the 0.14 →
673
682
  * 0.15 rollout so older clients don't fail discovery validation.
674
683
  */
675
684
  agents: z.string().min(1).optional(),
685
+ /**
686
+ * Older discovery fields. Resource access is now preparation-scoped,
687
+ * but accepting these keys keeps stale clients from failing parse.
688
+ */
689
+ readiness: z.string().min(1).optional(),
690
+ portable_contexts: z.string().min(1).optional(),
691
+ source_files: z.string().min(1).optional(),
692
+ workspace_files: z.string().min(1).optional(),
693
+ preparation_setups: z.string().min(1).optional(),
694
+ preparation_changes: z.string().min(1).optional(),
695
+ method_changes: z.string().min(1).optional(),
696
+ workspace_bootstraps: z.string().min(1).optional(),
697
+ readiness_check_drafts: z.string().min(1).optional(),
698
+ method_authoring_runs: z.string().min(1).optional(),
699
+ method_improvement_runs: z.string().min(1).optional(),
700
+ compile_runs: z.string().min(1).optional(),
701
+ verify_runs: z.string().min(1).optional(),
702
+ reset: z.string().min(1).optional(),
676
703
  workspaces: z.string().min(1).optional(),
677
704
  status: z.string().min(1).optional(),
678
705
  }).strict(),
@@ -182,7 +182,7 @@ async function runMethodVariation(options) {
182
182
  bestOutcome,
183
183
  bestSnapshotPath,
184
184
  bestAttempt,
185
- fatalError: "Could not run saved readiness checks against the Portable Context after prepare.",
185
+ fatalError: "Could not run saved readiness checks against the Portable Context after compile.",
186
186
  };
187
187
  }
188
188
  console.log();
@@ -244,7 +244,7 @@ function summarizeMethodVariation(options) {
244
244
  : options.result.bestOutcome
245
245
  ? `Best result: ${passedChecks}/${totalChecks} readiness checks passed.`
246
246
  : options.result.failedStage
247
- ? `Prepare failed at stage ${options.result.failedStage} before any saved readiness result.`
247
+ ? `Compile failed at stage ${options.result.failedStage} before any saved readiness result.`
248
248
  : "Method variation did not produce a passing result.";
249
249
  return {
250
250
  variation: options.variation,
@@ -274,14 +274,14 @@ function printStageShellReviewHint(compiledPath, preserveStageShells, result) {
274
274
  function printPostCompileNextStep(options) {
275
275
  console.log(chalk.dim(` Portable Context: ${options.compiledPath}`));
276
276
  if (options.checks === 0) {
277
- console.log(chalk.dim(" Next: run `interf` to add readiness checks, then `interf verify`."));
277
+ console.log(chalk.dim(" Next: run `interf` to add readiness checks, then `interf test`."));
278
278
  return;
279
279
  }
280
280
  if (options.testedDuringCompile) {
281
- console.log(chalk.dim(" Next: inspect the Portable Context agents will use, or run `interf verify` if you also want readiness evidence for source files and Portable Context."));
281
+ console.log(chalk.dim(" Next: inspect the Portable Context agents will use, or run `interf test` if you also want readiness evidence for source files and Portable Context."));
282
282
  return;
283
283
  }
284
- console.log(chalk.dim(" Next: run `interf verify` to collect readiness evidence for source files and Portable Context."));
284
+ console.log(chalk.dim(" Next: run `interf test` to collect readiness evidence for source files and Portable Context."));
285
285
  }
286
286
  function formatVariationReadinessSummary(summary) {
287
287
  return `${summary.passed_questions}/${summary.total_questions}`;
@@ -322,11 +322,11 @@ export async function runConfiguredCompiledCompile(options) {
322
322
  console.log(chalk.dim(" Interf will rerun the same Method variation, check the Portable Context agents can use, and stop early if it passes."));
323
323
  }
324
324
  else {
325
- console.log(chalk.dim(" Compilation mode: 1 attempt per Method variation."));
325
+ console.log(chalk.dim(" Compile mode: 1 attempt per Method variation."));
326
326
  }
327
327
  if (maxLoops != null) {
328
- console.log(chalk.dim(` Self-improving loops: up to ${maxLoops} Method edits after retries fail.`));
329
- console.log(chalk.dim(" Interf will review failed runs, edit the Method, and test new Method variations."));
328
+ console.log(chalk.dim(` Method improvement: up to ${maxLoops} Method edits after retries fail.`));
329
+ console.log(chalk.dim(" Interf will review failed runs, edit the Build Plan, and test new Method variations."));
330
330
  }
331
331
  }
332
332
  if (!loopEnabled || checks.length === 0) {
@@ -660,6 +660,8 @@ export function createNativeLocalServiceRunHandlers(options = {}) {
660
660
  hint: request.hint,
661
661
  taskPrompt: request.task_prompt,
662
662
  checks: request.checks,
663
+ requestedArtifacts: request.requested_artifacts,
664
+ sourceProfile: request.source_profile ?? null,
663
665
  artifactRequirements: request.artifact_requirements,
664
666
  executor,
665
667
  onStatus: (line) => context.emit({
@@ -19,7 +19,7 @@
19
19
  *
20
20
  * Public callers reach this through the preparation-keyed HTTP routes.
21
21
  */
22
- import type { SourcePreparationConfig } from "../project/lib/schema.js";
22
+ import type { RequestedArtifact, SourcePreparationConfig, SourceProfile, SourceReadinessCheck } from "../project/lib/schema.js";
23
23
  import type { LocalServiceRuntime } from "./runtime.js";
24
24
  export interface PreparationCreateInput {
25
25
  id: string;
@@ -30,24 +30,18 @@ export interface PreparationCreateInput {
30
30
  /** Method binding. Null/undefined means "not bound yet" — bind later via update. */
31
31
  method_id?: string | null;
32
32
  about?: string;
33
- checks?: Array<{
34
- question: string;
35
- answer?: string;
36
- strictness?: string;
37
- expect?: string;
38
- }>;
33
+ requested_artifacts?: RequestedArtifact[];
34
+ source_profile?: SourceProfile;
35
+ checks?: SourceReadinessCheck[];
39
36
  max_attempts?: number;
40
37
  max_loops?: number;
41
38
  }
42
39
  export interface PreparationUpdateInput {
43
40
  method_id?: string | null;
44
41
  about?: string | null;
45
- checks?: Array<{
46
- question: string;
47
- answer?: string;
48
- strictness?: string;
49
- expect?: string;
50
- }>;
42
+ requested_artifacts?: RequestedArtifact[];
43
+ source_profile?: SourceProfile | null;
44
+ checks?: SourceReadinessCheck[];
51
45
  }
52
46
  export interface StoredPreparation {
53
47
  id: string;
@@ -107,4 +101,6 @@ export declare function preparationWireShape(stored: StoredPreparation): {
107
101
  value: string;
108
102
  };
109
103
  checks: SourcePreparationConfig["checks"];
104
+ requested_artifacts: SourcePreparationConfig["requested_artifacts"];
105
+ source_profile: SourcePreparationConfig["source_profile"] | null;
110
106
  };
@@ -106,6 +106,8 @@ export function createStoredPreparation(runtime, input) {
106
106
  ...(check.strictness ? { strictness: check.strictness } : {}),
107
107
  ...(check.expect ? { expect: check.expect } : {}),
108
108
  })),
109
+ ...(input.requested_artifacts ? { requested_artifacts: input.requested_artifacts } : {}),
110
+ ...(input.source_profile ? { source_profile: input.source_profile } : {}),
109
111
  ...(input.about ? { about: input.about } : {}),
110
112
  ...(input.max_attempts ? { max_attempts: input.max_attempts } : {}),
111
113
  ...(input.max_loops ? { max_loops: input.max_loops } : {}),
@@ -162,6 +164,14 @@ export function updateStoredPreparation(prepId, patch) {
162
164
  ...(check.expect ? { expect: check.expect } : {}),
163
165
  })) }
164
166
  : {}),
167
+ ...(patch.requested_artifacts !== undefined
168
+ ? { requested_artifacts: patch.requested_artifacts }
169
+ : {}),
170
+ ...(patch.source_profile === null
171
+ ? { source_profile: undefined }
172
+ : patch.source_profile !== undefined
173
+ ? { source_profile: patch.source_profile }
174
+ : {}),
165
175
  };
166
176
  const aboutPatch = patch.about === undefined ? stored.about : patch.about;
167
177
  const preparationWithAbout = aboutPatch
@@ -198,5 +208,7 @@ export function preparationWireShape(stored) {
198
208
  config_path: stored.configPath,
199
209
  portable_context: { kind: "local-path", value: stored.portableContextPath },
200
210
  checks: stored.config.checks ?? [],
211
+ requested_artifacts: stored.config.requested_artifacts ?? [],
212
+ source_profile: stored.config.source_profile ?? null,
201
213
  };
202
214
  }
@@ -0,0 +1,5 @@
1
+ import type { RequestedArtifact } from "../project/lib/schema.js";
2
+ import type { MethodAuthoringArtifactRequirement } from "./lib/schema.js";
3
+ export declare function requestedArtifactCheckLabel(check: RequestedArtifact["checks"][number]): string;
4
+ export declare function formatRequestedArtifactsForPrompt(artifacts: RequestedArtifact[]): string;
5
+ export declare function artifactRequirementsFromRequestedArtifacts(artifacts: RequestedArtifact[]): MethodAuthoringArtifactRequirement[];
@@ -0,0 +1,36 @@
1
+ import { ArtifactIdSchema } from "../contracts/lib/schema.js";
2
+ export function requestedArtifactCheckLabel(check) {
3
+ return typeof check === "string" ? check : check.label;
4
+ }
5
+ export function formatRequestedArtifactsForPrompt(artifacts) {
6
+ if (artifacts.length === 0)
7
+ return "";
8
+ return artifacts.map((artifact, index) => {
9
+ const lines = [
10
+ `${index + 1}. ${artifact.title}`,
11
+ artifact.purpose ?? artifact.description ?? null,
12
+ artifact.checks.length > 0
13
+ ? `Checks:\n${artifact.checks.map((check) => `- ${requestedArtifactCheckLabel(check)}`).join("\n")}`
14
+ : null,
15
+ ].filter((line) => Boolean(line));
16
+ return lines.join("\n");
17
+ }).join("\n\n");
18
+ }
19
+ export function artifactRequirementsFromRequestedArtifacts(artifacts) {
20
+ return artifacts.flatMap((artifact) => {
21
+ if (!artifact.id || !artifact.output?.shape)
22
+ return [];
23
+ const id = ArtifactIdSchema.safeParse(artifact.id);
24
+ if (!id.success)
25
+ return [];
26
+ return [{
27
+ id: id.data,
28
+ ...(artifact.description ?? artifact.purpose
29
+ ? { description: artifact.description ?? artifact.purpose }
30
+ : {}),
31
+ shape: artifact.output.shape,
32
+ checks: artifact.output.checks ?? [],
33
+ ...(artifact.output.stage_hint ? { stage_hint: artifact.output.stage_hint } : {}),
34
+ }];
35
+ });
36
+ }
@@ -49,7 +49,7 @@ export declare const PREPARATION_SUBRESOURCES: {
49
49
  */
50
50
  readonly artifacts: "artifacts";
51
51
  };
52
- /** Method-scoped sub-resources (relative to /v1/methods/<id>/). */
52
+ /** Method Activity sub-resources (relative to /v1/methods/<id>/). */
53
53
  export declare const METHOD_SUBRESOURCES: {
54
54
  readonly runs: "runs";
55
55
  /**
@@ -50,7 +50,7 @@ export const PREPARATION_SUBRESOURCES = {
50
50
  */
51
51
  artifacts: "artifacts",
52
52
  };
53
- /** Method-scoped sub-resources (relative to /v1/methods/<id>/). */
53
+ /** Method Activity sub-resources (relative to /v1/methods/<id>/). */
54
54
  export const METHOD_SUBRESOURCES = {
55
55
  runs: "runs",
56
56
  /**
@@ -222,7 +222,7 @@ export function compileRunToObservability(run) {
222
222
  { label: "Method", value: run.method },
223
223
  { label: "Executor", value: executor?.display_name ?? run.backend },
224
224
  { label: "Stages", value: `${run.stages.filter((stage) => stage.status === "succeeded").length}/${run.stages.length}` },
225
- { label: "Proof", value: `${proof.filter((check) => check.ok).length}/${proof.length}` },
225
+ { label: "Stage proof", value: `${proof.filter((check) => check.ok).length}/${proof.length}` },
226
226
  { label: "Artifacts", value: String(artifacts.length) },
227
227
  ],
228
228
  artifacts,
@@ -529,7 +529,8 @@ export function jobRunToObservability(job) {
529
529
  events.push(traceEvent(job.run_id, "run_cancelled", completedAt, eventIndex++));
530
530
  }
531
531
  const outputPath = job.output_path ?? (typeof job.result?.path === "string" ? job.result.path : null);
532
- const artifacts = uniqueArtifacts(outputPath ? [{ path: outputPath, role: "output" }] : []);
532
+ const outputIsArtifact = job.job_type !== "method-authoring" && job.job_type !== "method-improvement";
533
+ const artifacts = uniqueArtifacts(outputIsArtifact && outputPath ? [{ path: outputPath, role: "output" }] : []);
533
534
  return RunObservabilityResourceSchema.parse({
534
535
  kind: "interf-run-observability",
535
536
  version: 1,
@@ -1,6 +1,6 @@
1
1
  import { type SourcePreparationConfig } from "../project/lib/schema.js";
2
2
  import { type ActionProposalPlanActionType, type ActionProposalResource } from "./lib/schema.js";
3
- export declare const ACTION_PLANNER_CLARIFICATION_MESSAGE = "I can help with this Interf Workspace. Ask a question about Interf, or ask me to create a Preparation, prepare, check readiness, improve, or draft a Method and I will prepare an approval proposal.";
3
+ export declare const ACTION_PLANNER_CLARIFICATION_MESSAGE = "I can help with this Interf instance. Ask a question about Interf, or ask me to create a Preparation, prepare, check readiness, improve, or draft a Build Plan and I will prepare an approval proposal.";
4
4
  export type LocalTestMode = "source-files" | "compiled" | "both";
5
5
  export declare function createActionProposalId(): string;
6
6
  export declare function sanitizeActionProposalPlan(value: unknown): unknown;
@@ -19,7 +19,7 @@ export declare function directServiceEndpointForAction(actionType: ActionProposa
19
19
  export declare function numberValue(values: Record<string, unknown> | undefined, key: string): number | null;
20
20
  export declare function testModeFromValues(values: Record<string, unknown> | undefined): LocalTestMode | null;
21
21
  export declare function testModeValue(values: Record<string, unknown> | undefined, defaultMode?: LocalTestMode): LocalTestMode;
22
- export declare function testModeCliTarget(mode: LocalTestMode): "source-files" | "portable-context" | "both";
22
+ export declare function testModeCliTarget(mode: LocalTestMode): "source-files" | "compiled";
23
23
  export declare function methodIdForProposal(message: string, values: Record<string, unknown> | undefined): string;
24
24
  export declare function actionValueMethodTaskPrompt(values: Record<string, unknown> | undefined): string | null;
25
25
  export declare function normalizeMethodAuthoringText(value: string): string;
@@ -14,7 +14,7 @@ import { DEFAULT_METHOD_ID, methodIdForSourcePreparationConfig, } from "../proje
14
14
  import { createCompiledTestTarget, } from "./verify/verify-targets.js";
15
15
  import { methodAuthoringTaskPrompt, MethodAuthoringActionValuesSchema, } from "./action-values.js";
16
16
  import { ActionProposalPlanActionTypeSchema, } from "./lib/schema.js";
17
- export const ACTION_PLANNER_CLARIFICATION_MESSAGE = "I can help with this Interf Workspace. Ask a question about Interf, or ask me to create a Preparation, prepare, check readiness, improve, or draft a Method and I will prepare an approval proposal.";
17
+ export const ACTION_PLANNER_CLARIFICATION_MESSAGE = "I can help with this Interf instance. Ask a question about Interf, or ask me to create a Preparation, prepare, check readiness, improve, or draft a Build Plan and I will prepare an approval proposal.";
18
18
  export function createActionProposalId() {
19
19
  return `action_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`;
20
20
  }
@@ -112,15 +112,13 @@ export function testModeFromValues(values) {
112
112
  return "compiled";
113
113
  return value === "source-files" || value === "compiled" || value === "both" ? value : null;
114
114
  }
115
- export function testModeValue(values, defaultMode = "both") {
115
+ export function testModeValue(values, defaultMode = "compiled") {
116
116
  return testModeFromValues(values) ?? defaultMode;
117
117
  }
118
118
  export function testModeCliTarget(mode) {
119
119
  if (mode === "source-files")
120
120
  return "source-files";
121
- if (mode === "compiled")
122
- return "portable-context";
123
- return "both";
121
+ return "compiled";
124
122
  }
125
123
  export function methodIdForProposal(message, values) {
126
124
  const explicit = stringValue(values, "method_id") ??
@@ -210,13 +208,13 @@ export function actionCommandPreview(actionType, preparationName, methodId, valu
210
208
  if (actionType === "compile") {
211
209
  const methodSuffix = methodId ? ` # Method: ${methodId}` : "";
212
210
  return preparationName
213
- ? `interf compile --preparation ${preparationName}${methodSuffix}`
211
+ ? `interf compile ${preparationName}${methodSuffix}`
214
212
  : `interf compile${methodSuffix}`;
215
213
  }
216
214
  if (actionType === "test") {
217
215
  const mode = testModeCliTarget(testModeValue(values));
218
216
  return preparationName
219
- ? `interf test --preparation ${preparationName} --target ${mode}`
217
+ ? `interf test ${preparationName} --target ${mode}`
220
218
  : `interf test --target ${mode}`;
221
219
  }
222
220
  if (actionType === "readiness-check-draft") {
@@ -44,6 +44,11 @@ export declare function buildMethodResource(resource: {
44
44
  path: string;
45
45
  label?: string;
46
46
  hint?: string;
47
+ purpose?: {
48
+ label: string;
49
+ taskHint: string;
50
+ };
51
+ inputs?: MethodResource["inputs"];
47
52
  source_kind: "builtin" | "local";
48
53
  built_in: boolean;
49
54
  active_for_preparations: string[];
@@ -85,7 +85,7 @@ export function readinessSummaryForStatus(status) {
85
85
  if (status === "ready")
86
86
  return "Ready for agent work.";
87
87
  if (status === "not-ready")
88
- return "Readiness checks did not pass.";
88
+ return "Artifact or readiness checks did not pass.";
89
89
  if (status === "stale")
90
90
  return "Readiness checks are stale for the current saved checks.";
91
91
  if (status === "checking")
@@ -97,7 +97,7 @@ export function readinessSummaryForStatus(status) {
97
97
  if (status === "not-built")
98
98
  return "Portable context has not been built yet.";
99
99
  if (status === "not-configured")
100
- return "No readiness checks are configured.";
100
+ return "No checks are configured.";
101
101
  return "Latest preparation failed.";
102
102
  }
103
103
  export function readinessStateToPreparationReadiness(readiness) {
@@ -115,6 +115,8 @@ export function buildPreparationResource(rootPath, preparation, readiness, lates
115
115
  source_path: resolveSourcePreparationPath(rootPath, preparation),
116
116
  method_id: methodId,
117
117
  checks: preparation.checks,
118
+ requested_artifacts: preparation.requested_artifacts ?? [],
119
+ source_profile: preparation.source_profile ?? null,
118
120
  portable_context: {
119
121
  preparation: preparation.name,
120
122
  path: readiness.portable_context_path,
@@ -141,6 +143,15 @@ export function buildMethodResource(resource) {
141
143
  path: resource.path,
142
144
  ...(resource.label ? { label: resource.label } : {}),
143
145
  ...(resource.hint ? { hint: resource.hint } : {}),
146
+ ...(resource.purpose
147
+ ? {
148
+ purpose: {
149
+ label: resource.purpose.label,
150
+ task_hint: resource.purpose.taskHint,
151
+ },
152
+ }
153
+ : {}),
154
+ inputs: resource.inputs ?? [],
144
155
  source_kind: resource.source_kind,
145
156
  built_in: resource.built_in,
146
157
  active_for_preparations: resource.active_for_preparations,
@@ -275,7 +275,7 @@ export declare class LocalServiceRuntime {
275
275
  listRunObservability(prepDataDir: string): RunObservabilityResource[];
276
276
  getRunObservability(prepDataDir: string, runId: string): RunObservabilityResource | null;
277
277
  /**
278
- * Method-scoped runs: every method-authoring or method-improvement job
278
+ * Method Activity runs: every method-authoring or method-improvement job
279
279
  * whose `method` matches `methodId`. Surfaced through
280
280
  * `GET /v1/methods/<id>/runs` so Method Detail can show the full audit
281
281
  * trail of authoring + improvement work for a Method.
@@ -354,7 +354,9 @@ export declare class LocalServiceRuntime {
354
354
  private resolvePreparationConfig;
355
355
  private ensureCompiledForRun;
356
356
  private readCompileRun;
357
+ private hydrateCompileRunFromRuntime;
357
358
  private finalizeInterruptedCompileRuns;
359
+ private finalizeInterruptedJobRuns;
358
360
  /**
359
361
  * 0.17 — emit per-Artifact billing events when a compile run reaches
360
362
  * a terminal state. STUB FORM: writes a JSONL file alongside the run