@interf/compiler 0.7.2 → 0.9.1
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.
- package/README.md +141 -99
- package/TRADEMARKS.md +1 -1
- package/agent-skills/interf-actions/SKILL.md +71 -0
- package/agent-skills/interf-actions/references/cli.md +190 -0
- package/apps/compiler-ui/.next/server/app/index.html +1 -0
- package/apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J/_buildManifest.js +11 -0
- package/apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J/_clientMiddlewareManifest.js +1 -0
- package/apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J/_ssgManifest.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/03~yq9q893hmn.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/06z~l3kwb891e.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/08g7lvje.te.u.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/08m7vf5asqlsm.js +91 -0
- package/apps/compiler-ui/.next/static/chunks/0_i-3_5l9t2qe.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/0b-ywny_j0g~0.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/0b52v41o1gixx.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/0fgt_8knmicoz.js +124 -0
- package/apps/compiler-ui/.next/static/chunks/0gpzgsv0w.q~m.js +31 -0
- package/apps/compiler-ui/.next/static/chunks/0ilwfezfvu6~-.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/0n51hrfoufc7g.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/0ti_66mx7~w2-.js +5 -0
- package/apps/compiler-ui/.next/static/chunks/0xxmf45eskdt~.css +1 -0
- package/apps/compiler-ui/.next/static/chunks/0y5z3t-z1c8ks.js.map +5 -0
- package/apps/compiler-ui/.next/static/chunks/13g~4mamjft.c.css +3 -0
- package/apps/compiler-ui/.next/static/chunks/14wtz~vq25~qq.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/turbopack-109rtik40vwh5.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/turbopack-10e~t1yzi4svj.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/turbopack-worker-0sjn--fhq~1cg.js +1 -0
- package/apps/compiler-ui/.next/static/media/GeistMono_Variable.p.17jn9btb_52pq.woff2 +0 -0
- package/apps/compiler-ui/.next/static/media/Geist_Variable-s.p.0-te~ja_gpvcf.woff2 +0 -0
- package/apps/compiler-ui/.next/static/media/worker.102zas1s52_pf.js +109 -0
- package/builtin-workflows/interf/README.md +8 -8
- package/builtin-workflows/interf/compile/stages/shape/SKILL.md +6 -6
- package/builtin-workflows/interf/compile/stages/structure/SKILL.md +1 -1
- package/builtin-workflows/interf/improve/SKILL.md +2 -2
- package/builtin-workflows/interf/use/query/SKILL.md +2 -2
- package/builtin-workflows/interf/workflow.json +9 -9
- package/builtin-workflows/interf/workflow.schema.json +2 -2
- package/dist/cli/commands/check-draft.d.ts +5 -4
- package/dist/cli/commands/check-draft.js +18 -17
- package/dist/cli/commands/compile-controller.d.ts +3 -0
- package/dist/cli/commands/compile-controller.js +53 -45
- package/dist/cli/commands/compile.js +83 -27
- package/dist/cli/commands/compiled-flow.d.ts +3 -0
- package/dist/cli/commands/compiled-flow.js +9 -7
- package/dist/cli/commands/control-path.d.ts +11 -0
- package/dist/cli/commands/control-path.js +72 -0
- package/dist/cli/commands/create-workflow-wizard.d.ts +12 -0
- package/dist/cli/commands/create-workflow-wizard.js +232 -66
- package/dist/cli/commands/create.js +70 -46
- package/dist/cli/commands/default.js +5 -3
- package/dist/cli/commands/doctor.js +5 -5
- package/dist/cli/commands/executor-flow.js +1 -1
- package/dist/cli/commands/init.js +362 -101
- package/dist/cli/commands/list.js +8 -7
- package/dist/cli/commands/preparation-selection.d.ts +6 -0
- package/dist/cli/commands/preparation-selection.js +11 -0
- package/dist/cli/commands/reset.js +3 -3
- package/dist/cli/commands/source-config-wizard.d.ts +4 -4
- package/dist/cli/commands/source-config-wizard.js +175 -200
- package/dist/cli/commands/status.js +116 -8
- package/dist/cli/commands/test-flow.d.ts +1 -1
- package/dist/cli/commands/test-flow.js +35 -33
- package/dist/cli/commands/test.d.ts +4 -0
- package/dist/cli/commands/test.js +95 -58
- package/dist/cli/commands/verify.js +7 -7
- package/dist/cli/commands/web.d.ts +11 -0
- package/dist/cli/commands/web.js +373 -0
- package/dist/cli/index.d.ts +2 -1
- package/dist/cli/index.js +3 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -1
- package/dist/packages/agents/lib/execution.js +4 -2
- package/dist/packages/agents/lib/executors.d.ts +1 -0
- package/dist/packages/agents/lib/executors.js +1 -0
- package/dist/packages/agents/lib/render.d.ts +2 -2
- package/dist/packages/agents/lib/render.js +10 -9
- package/dist/packages/agents/lib/shells.d.ts +3 -11
- package/dist/packages/agents/lib/shells.js +58 -106
- package/dist/packages/agents/lib/types.d.ts +1 -0
- package/dist/packages/compiler/compiled-paths.d.ts +4 -1
- package/dist/packages/compiler/compiled-paths.js +8 -2
- package/dist/packages/compiler/compiled-pipeline.d.ts +7 -0
- package/dist/packages/compiler/compiled-pipeline.js +15 -4
- package/dist/packages/compiler/compiled-schema.js +1 -1
- package/dist/packages/compiler/compiled-stage-plan.d.ts +2 -2
- package/dist/packages/compiler/compiled-stage-plan.js +4 -4
- package/dist/packages/compiler/compiled-stage-runner.d.ts +5 -0
- package/dist/packages/compiler/compiled-stage-runner.js +50 -2
- package/dist/packages/compiler/compiled-target.d.ts +1 -1
- package/dist/packages/compiler/compiled-target.js +2 -2
- package/dist/packages/compiler/lib/schema.d.ts +161 -1
- package/dist/packages/compiler/lib/schema.js +87 -1
- package/dist/packages/compiler/raw-snapshot.d.ts +9 -2
- package/dist/packages/compiler/runtime-acceptance.js +1 -1
- package/dist/packages/compiler/runtime-contracts.js +2 -2
- package/dist/packages/compiler/runtime-prompt.js +7 -7
- package/dist/packages/compiler/runtime-reconcile.js +3 -3
- package/dist/packages/compiler/runtime-runs.js +3 -0
- package/dist/packages/compiler/runtime-types.d.ts +1 -0
- package/dist/packages/compiler/state-health.js +1 -1
- package/dist/packages/compiler/state-view.js +2 -2
- package/dist/packages/compiler/validate-compiled.js +11 -9
- package/dist/packages/execution/adapters.d.ts +15 -0
- package/dist/packages/execution/adapters.js +1 -0
- package/dist/packages/execution/events.d.ts +8 -0
- package/dist/packages/execution/events.js +16 -0
- package/dist/packages/execution/index.d.ts +9 -0
- package/dist/packages/execution/index.js +6 -0
- package/dist/packages/execution/lib/schema.d.ts +1554 -0
- package/dist/packages/execution/lib/schema.js +319 -0
- package/dist/packages/local-service/action-values.d.ts +23 -0
- package/dist/packages/local-service/action-values.js +31 -0
- package/dist/packages/local-service/client.d.ts +119 -0
- package/dist/packages/local-service/client.js +356 -0
- package/dist/packages/local-service/index.d.ts +15 -0
- package/dist/packages/local-service/index.js +11 -0
- package/dist/packages/local-service/lib/schema.d.ts +7355 -0
- package/dist/packages/local-service/lib/schema.js +636 -0
- package/dist/packages/local-service/routes.d.ts +27 -0
- package/dist/packages/local-service/routes.js +32 -0
- package/dist/packages/local-service/runtime.d.ts +134 -0
- package/dist/packages/local-service/runtime.js +2841 -0
- package/dist/packages/local-service/server.d.ts +17 -0
- package/dist/packages/local-service/server.js +572 -0
- package/dist/packages/project-model/index.d.ts +2 -1
- package/dist/packages/project-model/index.js +1 -0
- package/dist/packages/project-model/interf-detect.d.ts +6 -2
- package/dist/packages/project-model/interf-detect.js +48 -19
- package/dist/packages/project-model/interf-scaffold.d.ts +1 -0
- package/dist/packages/project-model/interf-scaffold.js +39 -17
- package/dist/packages/project-model/interf.d.ts +2 -2
- package/dist/packages/project-model/interf.js +2 -2
- package/dist/packages/project-model/lib/schema.d.ts +80 -6
- package/dist/packages/project-model/lib/schema.js +29 -19
- package/dist/packages/project-model/project-paths.d.ts +3 -1
- package/dist/packages/project-model/project-paths.js +6 -2
- package/dist/packages/project-model/source-config.d.ts +25 -11
- package/dist/packages/project-model/source-config.js +152 -82
- package/dist/packages/project-model/source-folders.d.ts +11 -0
- package/dist/packages/project-model/source-folders.js +110 -0
- package/dist/packages/testing/test-execution.js +5 -5
- package/dist/packages/testing/test-paths.js +4 -3
- package/dist/packages/workflow-authoring/workflow-authoring.d.ts +4 -6
- package/dist/packages/workflow-authoring/workflow-authoring.js +46 -85
- package/dist/packages/workflow-authoring/workflow-edit-session.d.ts +2 -0
- package/dist/packages/workflow-authoring/workflow-edit-session.js +83 -49
- package/dist/packages/workflow-authoring/workflow-improvement.js +2 -1
- package/dist/packages/workflow-package/context-interface.js +2 -2
- package/dist/packages/workflow-package/interf-workflow-package.d.ts +6 -0
- package/dist/packages/workflow-package/interf-workflow-package.js +115 -8
- package/dist/packages/workflow-package/local-workflows.js +33 -17
- package/dist/packages/workflow-package/workflow-definitions.d.ts +5 -5
- package/dist/packages/workflow-package/workflow-definitions.js +23 -22
- package/dist/packages/workflow-package/workflow-helpers.js +10 -6
- package/dist/packages/workflow-package/workflow-review-paths.js +5 -1
- package/dist/packages/workflow-package/workflow-stage-runner.d.ts +1 -0
- package/dist/packages/workflow-package/workflow-stage-runner.js +2 -0
- package/package.json +18 -4
- package/dist/cli/commands/dataset-selection.d.ts +0 -6
- package/dist/cli/commands/dataset-selection.js +0 -11
- package/dist/lib/agent-args.d.ts +0 -1
- package/dist/lib/agent-args.js +0 -1
- package/dist/lib/agent-constants.d.ts +0 -1
- package/dist/lib/agent-constants.js +0 -1
- package/dist/lib/agent-detection.d.ts +0 -1
- package/dist/lib/agent-detection.js +0 -1
- package/dist/lib/agent-execution.d.ts +0 -1
- package/dist/lib/agent-execution.js +0 -1
- package/dist/lib/agent-logs.d.ts +0 -1
- package/dist/lib/agent-logs.js +0 -1
- package/dist/lib/agent-preflight.d.ts +0 -1
- package/dist/lib/agent-preflight.js +0 -1
- package/dist/lib/agent-render.d.ts +0 -1
- package/dist/lib/agent-render.js +0 -1
- package/dist/lib/agent-shells.d.ts +0 -1
- package/dist/lib/agent-shells.js +0 -1
- package/dist/lib/agent-status.d.ts +0 -1
- package/dist/lib/agent-status.js +0 -1
- package/dist/lib/agent-types.d.ts +0 -1
- package/dist/lib/agent-types.js +0 -1
- package/dist/lib/agents.d.ts +0 -1
- package/dist/lib/agents.js +0 -1
- package/dist/lib/builtin-compiled-workflow.d.ts +0 -1
- package/dist/lib/builtin-compiled-workflow.js +0 -1
- package/dist/lib/chart-guidance.d.ts +0 -1
- package/dist/lib/chart-guidance.js +0 -1
- package/dist/lib/compiled-compile.d.ts +0 -1
- package/dist/lib/compiled-compile.js +0 -1
- package/dist/lib/compiled-paths.d.ts +0 -1
- package/dist/lib/compiled-paths.js +0 -3
- package/dist/lib/compiled-raw.d.ts +0 -1
- package/dist/lib/compiled-raw.js +0 -3
- package/dist/lib/compiled-reset.d.ts +0 -1
- package/dist/lib/compiled-reset.js +0 -3
- package/dist/lib/compiled-schema.d.ts +0 -1
- package/dist/lib/compiled-schema.js +0 -1
- package/dist/lib/discovery.d.ts +0 -1
- package/dist/lib/discovery.js +0 -1
- package/dist/lib/execution-profile.d.ts +0 -1
- package/dist/lib/execution-profile.js +0 -1
- package/dist/lib/executors.d.ts +0 -1
- package/dist/lib/executors.js +0 -1
- package/dist/lib/filesystem.d.ts +0 -1
- package/dist/lib/filesystem.js +0 -1
- package/dist/lib/interf-bootstrap.d.ts +0 -1
- package/dist/lib/interf-bootstrap.js +0 -3
- package/dist/lib/interf-detect.d.ts +0 -1
- package/dist/lib/interf-detect.js +0 -3
- package/dist/lib/interf-scaffold.d.ts +0 -1
- package/dist/lib/interf-scaffold.js +0 -3
- package/dist/lib/interf-workflow-package.d.ts +0 -1
- package/dist/lib/interf-workflow-package.js +0 -1
- package/dist/lib/interf.d.ts +0 -1
- package/dist/lib/interf.js +0 -3
- package/dist/lib/local-workflows.d.ts +0 -1
- package/dist/lib/local-workflows.js +0 -1
- package/dist/lib/logger.d.ts +0 -1
- package/dist/lib/logger.js +0 -1
- package/dist/lib/package-root.d.ts +0 -1
- package/dist/lib/package-root.js +0 -1
- package/dist/lib/parse.d.ts +0 -1
- package/dist/lib/parse.js +0 -1
- package/dist/lib/project-paths.d.ts +0 -1
- package/dist/lib/project-paths.js +0 -3
- package/dist/lib/runtime-acceptance.d.ts +0 -1
- package/dist/lib/runtime-acceptance.js +0 -1
- package/dist/lib/runtime-contracts.d.ts +0 -1
- package/dist/lib/runtime-contracts.js +0 -1
- package/dist/lib/runtime-inventory.d.ts +0 -1
- package/dist/lib/runtime-inventory.js +0 -1
- package/dist/lib/runtime-paths.d.ts +0 -1
- package/dist/lib/runtime-paths.js +0 -1
- package/dist/lib/runtime-prompt.d.ts +0 -1
- package/dist/lib/runtime-prompt.js +0 -1
- package/dist/lib/runtime-reconcile.d.ts +0 -1
- package/dist/lib/runtime-reconcile.js +0 -1
- package/dist/lib/runtime-runs.d.ts +0 -1
- package/dist/lib/runtime-runs.js +0 -1
- package/dist/lib/runtime-types.d.ts +0 -1
- package/dist/lib/runtime-types.js +0 -1
- package/dist/lib/runtime.d.ts +0 -1
- package/dist/lib/runtime.js +0 -1
- package/dist/lib/schema.d.ts +0 -4
- package/dist/lib/schema.js +0 -6
- package/dist/lib/source-config.d.ts +0 -1
- package/dist/lib/source-config.js +0 -3
- package/dist/lib/state-artifacts.d.ts +0 -1
- package/dist/lib/state-artifacts.js +0 -1
- package/dist/lib/state-health.d.ts +0 -1
- package/dist/lib/state-health.js +0 -1
- package/dist/lib/state-io.d.ts +0 -1
- package/dist/lib/state-io.js +0 -1
- package/dist/lib/state-paths.d.ts +0 -1
- package/dist/lib/state-paths.js +0 -1
- package/dist/lib/state-view.d.ts +0 -1
- package/dist/lib/state-view.js +0 -1
- package/dist/lib/state.d.ts +0 -1
- package/dist/lib/state.js +0 -1
- package/dist/lib/test-execution.d.ts +0 -1
- package/dist/lib/test-execution.js +0 -3
- package/dist/lib/test-matrices.d.ts +0 -1
- package/dist/lib/test-matrices.js +0 -3
- package/dist/lib/test-paths.d.ts +0 -1
- package/dist/lib/test-paths.js +0 -3
- package/dist/lib/test-profile-presets.d.ts +0 -1
- package/dist/lib/test-profile-presets.js +0 -3
- package/dist/lib/test-sandbox.d.ts +0 -1
- package/dist/lib/test-sandbox.js +0 -3
- package/dist/lib/test-specs.d.ts +0 -1
- package/dist/lib/test-specs.js +0 -3
- package/dist/lib/test-targets.d.ts +0 -1
- package/dist/lib/test-targets.js +0 -3
- package/dist/lib/test-types.d.ts +0 -1
- package/dist/lib/test-types.js +0 -3
- package/dist/lib/test.d.ts +0 -1
- package/dist/lib/test.js +0 -3
- package/dist/lib/util.d.ts +0 -1
- package/dist/lib/util.js +0 -1
- package/dist/lib/validate-compiled.d.ts +0 -1
- package/dist/lib/validate-compiled.js +0 -1
- package/dist/lib/validate-helpers.d.ts +0 -1
- package/dist/lib/validate-helpers.js +0 -1
- package/dist/lib/validate.d.ts +0 -1
- package/dist/lib/validate.js +0 -1
- package/dist/lib/workflow-authoring.d.ts +0 -1
- package/dist/lib/workflow-authoring.js +0 -1
- package/dist/lib/workflow-definitions.d.ts +0 -1
- package/dist/lib/workflow-definitions.js +0 -1
- package/dist/lib/workflow-edit-session.d.ts +0 -1
- package/dist/lib/workflow-edit-session.js +0 -1
- package/dist/lib/workflow-edit-utils.d.ts +0 -1
- package/dist/lib/workflow-edit-utils.js +0 -1
- package/dist/lib/workflow-helpers.d.ts +0 -1
- package/dist/lib/workflow-helpers.js +0 -1
- package/dist/lib/workflow-improvement.d.ts +0 -1
- package/dist/lib/workflow-improvement.js +0 -1
- package/dist/lib/workflow-primitives.d.ts +0 -1
- package/dist/lib/workflow-primitives.js +0 -1
- package/dist/lib/workflow-review-paths.d.ts +0 -1
- package/dist/lib/workflow-review-paths.js +0 -1
- package/dist/lib/workflow-stage-policy.d.ts +0 -1
- package/dist/lib/workflow-stage-policy.js +0 -1
- package/dist/lib/workflow-stage-runner.d.ts +0 -1
- package/dist/lib/workflow-stage-runner.js +0 -1
- package/dist/lib/workflows.d.ts +0 -1
- package/dist/lib/workflows.js +0 -1
|
@@ -42,7 +42,7 @@ export function renderCompiledAgents(compiledPath, name, workflowId, about, opti
|
|
|
42
42
|
`# ${name}`,
|
|
43
43
|
"",
|
|
44
44
|
"This is portable context built by Interf.",
|
|
45
|
-
"
|
|
45
|
+
"This folder gives agents prepared evidence, structure, and cross-file connections so they do not have to rediscover the full picture from source files during the job.",
|
|
46
46
|
"",
|
|
47
47
|
...(about
|
|
48
48
|
? [
|
|
@@ -56,23 +56,23 @@ export function renderCompiledAgents(compiledPath, name, workflowId, about, opti
|
|
|
56
56
|
"2. Let the workflow docs and declared output zones guide retrieval instead of assuming a fixed note layout.",
|
|
57
57
|
"3. Use `raw/` when you need direct quotes, exact chart values, table lookups, or verification.",
|
|
58
58
|
"",
|
|
59
|
-
"## How this
|
|
59
|
+
"## How this portable context works",
|
|
60
60
|
"",
|
|
61
|
-
"- The
|
|
62
|
-
"- `.interf/interf.json` points to the local `raw/` snapshot via `source.path` and back to the
|
|
63
|
-
`-
|
|
61
|
+
"- The Method package defines the context interface this portable context implements on disk.",
|
|
62
|
+
"- `.interf/interf.json` points to the local `raw/` snapshot via `source.path` and back to the Interf Workspace via `source.control_path`.",
|
|
63
|
+
`- Method seed: \`${workflowOriginSelected}\`.`,
|
|
64
64
|
...(workflowLocalDraft
|
|
65
|
-
? ["- This
|
|
65
|
+
? ["- This portable context now carries a local Method draft improved from that seed. Recompiling this portable context reuses the local `.interf/method/` package."]
|
|
66
66
|
: []),
|
|
67
|
-
`- Active local
|
|
68
|
-
"- `.interf/
|
|
69
|
-
`- \`.interf/
|
|
70
|
-
"- `.interf/
|
|
71
|
-
"- `.interf/
|
|
72
|
-
"- `.interf/
|
|
67
|
+
`- Active local Method id: \`${workflowId}\`.`,
|
|
68
|
+
"- `.interf/method/` is the local editable Method package for this portable context.",
|
|
69
|
+
`- \`.interf/method/${WORKFLOW_SCHEMA_FILE}\` is the deterministic context interface for this portable context.`,
|
|
70
|
+
"- `.interf/method/improve/` is the editable source for Method-improvement loops.",
|
|
71
|
+
"- `.interf/method/use/query/` is the editable source for the generated native query shell.",
|
|
72
|
+
"- `.interf/method/compile/stages/` defines stage-specific docs that Interf projects into native execution shells for automated runs.",
|
|
73
73
|
"- Native local query skills are generated under local agent skill directories such as `.claude/skills/` and `.codex/skills/`.",
|
|
74
74
|
"- `raw/` contains the local raw snapshot used for evidence and verification.",
|
|
75
|
-
`-
|
|
75
|
+
`- Method zones are declared in \`.interf/method/${WORKFLOW_SCHEMA_FILE}\`.`,
|
|
76
76
|
...zoneLines,
|
|
77
77
|
"- `.interf/runtime/` holds runtime artifacts written by Interf.",
|
|
78
78
|
"- `.interf/tests/` mirrors the latest saved comparison and keeps detailed target runs plus preserved sandboxes.",
|
|
@@ -80,10 +80,10 @@ export function renderCompiledAgents(compiledPath, name, workflowId, about, opti
|
|
|
80
80
|
"",
|
|
81
81
|
"## Manual query rules",
|
|
82
82
|
"",
|
|
83
|
-
"- Prefer the
|
|
84
|
-
"- Use the generated native `interf-query` skill for manual querying. The editable source lives at `.interf/
|
|
85
|
-
"- Treat `.interf/` as method/runtime metadata, not answer evidence, unless explicitly asked to inspect
|
|
86
|
-
"- Use `raw/` for quotes, verification, ambiguity, or evidence the
|
|
83
|
+
"- Prefer the Method-declared context outputs before `raw/`.",
|
|
84
|
+
"- Use the generated native `interf-query` skill for manual querying. The editable source lives at `.interf/method/use/query/SKILL.md`.",
|
|
85
|
+
"- Treat `.interf/` as method/runtime metadata, not answer evidence, unless explicitly asked to inspect Method or test history.",
|
|
86
|
+
"- Use `raw/` for quotes, verification, ambiguity, or evidence the portable context does not expose well.",
|
|
87
87
|
"- If exact chart, table, or image-derived evidence matters, inspect the raw source and say whether the answer was text-derived, table-derived, or chart-derived.",
|
|
88
88
|
"",
|
|
89
89
|
"## Commands",
|
|
@@ -92,14 +92,14 @@ export function renderCompiledAgents(compiledPath, name, workflowId, about, opti
|
|
|
92
92
|
"interf compile build this portable context",
|
|
93
93
|
"interf test run checks against this portable context",
|
|
94
94
|
"interf verify stage <id> verify one workflow stage",
|
|
95
|
-
"interf verify compiled verify the full
|
|
95
|
+
"interf verify compiled verify the full portable context output",
|
|
96
96
|
"interf status show deterministic health",
|
|
97
97
|
"```",
|
|
98
98
|
"",
|
|
99
99
|
"## Rules",
|
|
100
100
|
"",
|
|
101
101
|
"- Do not modify files under `raw/`.",
|
|
102
|
-
"- Treat
|
|
102
|
+
"- Treat prepared notes as working context, not final truth.",
|
|
103
103
|
"- When confidence is low, verify against `raw/` before answering strongly.",
|
|
104
104
|
"",
|
|
105
105
|
].join("\n");
|
|
@@ -111,17 +111,17 @@ export function renderCompiledQuerySkill() {
|
|
|
111
111
|
"This file is the editable authoring source for the generated native local `interf-query` skill.",
|
|
112
112
|
"",
|
|
113
113
|
"Default loop:",
|
|
114
|
-
"1. Read
|
|
115
|
-
`2. Use the
|
|
116
|
-
"3. Use `raw/` for direct quotes, verification, exact lookups, and cases where the
|
|
114
|
+
"1. Read `.interf/method/README.md` and this file first.",
|
|
115
|
+
`2. Use the Method zones declared in \`.interf/method/${WORKFLOW_SCHEMA_FILE}\` before consulting \`raw/\`.`,
|
|
116
|
+
"3. Use `raw/` for direct quotes, verification, exact lookups, and cases where the portable context is missing the needed evidence or is ambiguous.",
|
|
117
117
|
"",
|
|
118
118
|
"Answering rule:",
|
|
119
119
|
"- do not modify files under `raw/`",
|
|
120
|
-
"- treat the
|
|
120
|
+
"- treat the Method as the portable-context contract and use its zones as the working retrieval surface",
|
|
121
121
|
"- say explicitly when an answer depends on approximation, bounded inference, or a raw-source re-check",
|
|
122
|
-
"- use `raw/` to confirm source page, metric family, provenance, or exact wording when the
|
|
123
|
-
"- do not invent navigation or note structure beyond what this
|
|
124
|
-
"- when the
|
|
122
|
+
"- use `raw/` to confirm source page, metric family, provenance, or exact wording when the portable context is missing the needed evidence or is ambiguous",
|
|
123
|
+
"- do not invent navigation or note structure beyond what this Method declares",
|
|
124
|
+
"- when the portable context is insufficient, verify in `raw/` and then answer",
|
|
125
125
|
"",
|
|
126
126
|
"You can edit this file to bias manual question-answering behavior for this portable context.",
|
|
127
127
|
"",
|
|
@@ -158,7 +158,7 @@ function renderRawTestQuerySkill() {
|
|
|
158
158
|
"name: interf-query",
|
|
159
159
|
"description: >",
|
|
160
160
|
" Native local query skill for an Interf raw test shell. Use it only",
|
|
161
|
-
" to answer
|
|
161
|
+
" to answer source-files readiness checks directly from `raw/`.",
|
|
162
162
|
"---",
|
|
163
163
|
"",
|
|
164
164
|
"# Interf Raw Test Query",
|
|
@@ -176,7 +176,7 @@ function renderRawTestQuerySkill() {
|
|
|
176
176
|
function readCompiledQuerySkillSource(compiledPath) {
|
|
177
177
|
const filePath = compiledQuerySkillSourcePath(compiledPath);
|
|
178
178
|
if (!existsSync(filePath)) {
|
|
179
|
-
throw new Error(`Missing compiled query skill source at ${filePath}. Interf compile runs the local
|
|
179
|
+
throw new Error(`Missing compiled query skill source at ${filePath}. Interf compile runs the local Method package directly, so reseed or repair this portable context instead of auto-healing query docs.`);
|
|
180
180
|
}
|
|
181
181
|
return readFileSync(filePath, "utf8").trim();
|
|
182
182
|
}
|
|
@@ -331,9 +331,9 @@ function renderStageExecutionAgents(compiledName, workflowId, stage) {
|
|
|
331
331
|
"- `inputs/<zone-id>/` = read mounts for the current stage.",
|
|
332
332
|
"- `outputs/<zone-id>/` = write mounts for the current stage.",
|
|
333
333
|
"- For file zones, `runtime/paths.json` points to the exact file path inside those mount roots.",
|
|
334
|
-
"- declared compiled zone paths are also projected at the shell root so
|
|
334
|
+
"- declared compiled zone paths are also projected at the shell root so Method-relative contract paths stay valid.",
|
|
335
335
|
"- `runtime/` = stage contract and machine-readable path map for this shell.",
|
|
336
|
-
"- `
|
|
336
|
+
"- `method/` = Method metadata, workflow schema, and docs for the current stage only.",
|
|
337
337
|
"",
|
|
338
338
|
"## Boundaries",
|
|
339
339
|
"",
|
|
@@ -381,7 +381,7 @@ function renderStageExecutionSkill(stage, stageMethodDoc) {
|
|
|
381
381
|
`- contract type: \`${stage.contractType}\``,
|
|
382
382
|
`- reads: ${stage.reads.join(", ")}`,
|
|
383
383
|
`- writes: ${stage.writes.join(", ")}`,
|
|
384
|
-
`- editable source: \`
|
|
384
|
+
`- editable source: \`method/compile/stages/${stage.skillDir}/SKILL.md\``,
|
|
385
385
|
"",
|
|
386
386
|
...(stageMethodDoc
|
|
387
387
|
? [
|
|
@@ -398,16 +398,15 @@ function renderCompiledQueryNativeSkill(querySkillContent) {
|
|
|
398
398
|
"---",
|
|
399
399
|
"name: interf-query",
|
|
400
400
|
"description: >",
|
|
401
|
-
" Native local query skill for this portable context built by Interf",
|
|
402
|
-
"
|
|
403
|
-
" and its raw fallback.",
|
|
401
|
+
" Native local query skill for this portable context built by Interf.",
|
|
402
|
+
" Use it for manual questions against the portable context and source files under raw/.",
|
|
404
403
|
"---",
|
|
405
404
|
"",
|
|
406
405
|
"# Interf Query",
|
|
407
406
|
"",
|
|
408
|
-
"This is the native local query skill for
|
|
407
|
+
"This is the native local query skill for portable context built by Interf.",
|
|
409
408
|
"Use it when reading this portable context manually.",
|
|
410
|
-
"Editable source: `.interf/
|
|
409
|
+
"Editable source: `.interf/method/use/query/SKILL.md`.",
|
|
411
410
|
"",
|
|
412
411
|
querySkillContent.trim(),
|
|
413
412
|
"",
|
|
@@ -656,7 +655,7 @@ function freezePreservedShell(rootPath, shellType) {
|
|
|
656
655
|
}
|
|
657
656
|
export function renderClaudeBootstrap(content) {
|
|
658
657
|
return [
|
|
659
|
-
"<!-- Generated
|
|
658
|
+
"<!-- Generated mirror of AGENTS.md. Interf may rewrite this file. -->",
|
|
660
659
|
"",
|
|
661
660
|
content.trimEnd(),
|
|
662
661
|
"",
|
|
@@ -667,28 +666,34 @@ function renderWorkflowAuthoringAgents(options) {
|
|
|
667
666
|
`# ${options.label} — Workflow Authoring Shell`,
|
|
668
667
|
"",
|
|
669
668
|
"This is an automated workflow-authoring shell generated by Interf.",
|
|
670
|
-
"It exists to create
|
|
669
|
+
"It exists to create one standalone workflow from the source data, desired portable-context outputs, and proof requirements in this task.",
|
|
671
670
|
"",
|
|
672
671
|
"## Start Here",
|
|
673
672
|
"",
|
|
674
673
|
"1. Read `runtime/authoring-context.json` now.",
|
|
675
674
|
`2. Read \`workflow/README.md\`, \`workflow/workflow.json\`, and \`workflow/${WORKFLOW_SCHEMA_FILE}\` now.`,
|
|
676
|
-
"3. Review `artifacts/source-dataset/raw
|
|
675
|
+
"3. Review `artifacts/source-dataset/raw/`.",
|
|
677
676
|
"4. Use the local native `interf-workflow-author` skill now.",
|
|
678
677
|
"",
|
|
679
678
|
"## Boundaries",
|
|
680
679
|
"",
|
|
681
680
|
`- New workflow id: \`${options.workflowId}\`.`,
|
|
682
|
-
|
|
681
|
+
"- Authoring mode: from scratch.",
|
|
682
|
+
...(options.referenceWorkflowId
|
|
683
|
+
? [`- Reference workflow id: \`${options.referenceWorkflowId}\` (context only, not a seed).`]
|
|
684
|
+
: []),
|
|
683
685
|
"- Edit only files under `workflow/`.",
|
|
684
|
-
"- Do not edit
|
|
686
|
+
"- Do not edit source artifacts.",
|
|
685
687
|
"- Keep the workflow valid for the current compiler API and workflow schema.",
|
|
688
|
+
"- For acceptance criteria, use `zone_counts_at_least` for numeric fixed minimums and `zone_counts_at_least_counts` only for runtime count-key strings such as `source_total`.",
|
|
686
689
|
"- Prefer direct file-reading and search tools over shell commands for routine file inspection.",
|
|
687
690
|
"- Do not use shell helpers like `cat`, `sed`, `ls`, or `find` when a native read/search tool can inspect the same files.",
|
|
688
691
|
"",
|
|
689
692
|
"## Goal",
|
|
690
693
|
"",
|
|
691
|
-
"- produce one standalone workflow tuned to the
|
|
694
|
+
"- produce one standalone workflow tuned to the source data, desired outputs, and checks in this task",
|
|
695
|
+
"- replace the neutral scaffold topology with the stage graph this work needs",
|
|
696
|
+
"- define output zones and stage proof so Interf can show whether the data is ready",
|
|
692
697
|
"- preserve deterministic stage and context-interface contracts",
|
|
693
698
|
"- stop once the workflow edits are complete",
|
|
694
699
|
"",
|
|
@@ -705,65 +710,25 @@ function renderWorkflowAuthoringSkill() {
|
|
|
705
710
|
"# Interf Workflow Authoring",
|
|
706
711
|
"",
|
|
707
712
|
"Read `runtime/authoring-context.json` first.",
|
|
708
|
-
"Then review the
|
|
713
|
+
"Then review the neutral workflow scaffold under `workflow/` and the raw snapshot under `artifacts/source-dataset/raw/`.",
|
|
709
714
|
"",
|
|
710
715
|
"Rules:",
|
|
711
716
|
"- edit only `workflow/`",
|
|
712
717
|
`- keep \`workflow.json\`, \`${WORKFLOW_SCHEMA_FILE}\`, and any changed stage docs aligned`,
|
|
713
|
-
"-
|
|
714
|
-
"-
|
|
718
|
+
"- use `zone_counts_at_least` for numeric fixed minimums; use `zone_counts_at_least_counts` only for runtime count-key strings such as `source_total`",
|
|
719
|
+
"- design the stage graph from the source data and preparation-and-evidence brief",
|
|
720
|
+
"- replace the placeholder `prepare` stage unless that exact stage is truly the final method",
|
|
721
|
+
"- keep the package standalone; do not introduce runtime inheritance or hidden source-package assumptions",
|
|
715
722
|
"- do not introduce wikilinks unless the workflow also creates the target note by exact basename or explicit relative path",
|
|
716
723
|
"- respect stage boundaries: do not make structure outputs link to notes or entrypoints first created by later stages",
|
|
717
724
|
"- prefer conservative routing changes over speculative note sprawl",
|
|
718
725
|
"- prefer direct file-reading and search tools over shell commands for routine file inspection",
|
|
719
726
|
"- do not use shell helpers like `cat`, `sed`, `ls`, or `find` when a native read/search tool can inspect the same files",
|
|
720
|
-
"- do not hardcode
|
|
721
|
-
"- do not edit
|
|
727
|
+
"- do not hardcode readiness-check answers into workflow docs",
|
|
728
|
+
"- do not edit source artifacts",
|
|
722
729
|
"",
|
|
723
730
|
].join("\n");
|
|
724
731
|
}
|
|
725
|
-
function authoringCopyIfExists(sourcePath, targetPath) {
|
|
726
|
-
if (!existsSync(sourcePath))
|
|
727
|
-
return;
|
|
728
|
-
mkdirSync(dirname(targetPath), { recursive: true });
|
|
729
|
-
cpSync(sourcePath, targetPath, {
|
|
730
|
-
recursive: true,
|
|
731
|
-
force: true,
|
|
732
|
-
errorOnExist: false,
|
|
733
|
-
preserveTimestamps: true,
|
|
734
|
-
});
|
|
735
|
-
}
|
|
736
|
-
function projectCompiledPreviewSnapshot(previewCompiledPath, shellRoot) {
|
|
737
|
-
const previewRoot = join(shellRoot, "artifacts", "preview-compiled");
|
|
738
|
-
mkdirSync(previewRoot, { recursive: true });
|
|
739
|
-
authoringCopyIfExists(join(previewCompiledPath, "AGENTS.md"), join(previewRoot, "AGENTS.md"));
|
|
740
|
-
authoringCopyIfExists(join(previewCompiledPath, "CLAUDE.md"), join(previewRoot, "CLAUDE.md"));
|
|
741
|
-
const schema = readCompiledSchemaFile(workflowPackagePathForCompiled(previewCompiledPath));
|
|
742
|
-
for (const zone of schema?.zones ?? []) {
|
|
743
|
-
if (zone.kind === "runtime" || zone.role === "input")
|
|
744
|
-
continue;
|
|
745
|
-
const absolutePath = compiledZoneAbsolutePath(previewCompiledPath, zone);
|
|
746
|
-
if (!existsSync(absolutePath))
|
|
747
|
-
continue;
|
|
748
|
-
authoringCopyIfExists(absolutePath, join(previewRoot, zone.path));
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
function projectCompiledPreviewRuntime(previewCompiledPath, shellRoot) {
|
|
752
|
-
const targetRoot = join(shellRoot, "artifacts", "preview-runtime");
|
|
753
|
-
mkdirSync(targetRoot, { recursive: true });
|
|
754
|
-
const runtimeRoot = compiledRuntimeRoot(previewCompiledPath);
|
|
755
|
-
for (const artifactName of [
|
|
756
|
-
"run.json",
|
|
757
|
-
"state.json",
|
|
758
|
-
"health.json",
|
|
759
|
-
"view-spec.json",
|
|
760
|
-
"raw-snapshot.json",
|
|
761
|
-
"execution-shells",
|
|
762
|
-
"logs",
|
|
763
|
-
]) {
|
|
764
|
-
authoringCopyIfExists(join(runtimeRoot, artifactName), join(targetRoot, artifactName));
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
732
|
function improvementWorkflowDocsPath(compiledPath) {
|
|
768
733
|
return join(workflowPackagePathForCompiled(compiledPath), "improve");
|
|
769
734
|
}
|
|
@@ -776,9 +741,10 @@ export function createWorkflowAuthoringShell(options) {
|
|
|
776
741
|
kind: "interf-workflow-authoring",
|
|
777
742
|
version: 1,
|
|
778
743
|
generated_at: new Date().toISOString(),
|
|
744
|
+
authoring_mode: "from-scratch",
|
|
779
745
|
workflow_id: options.workflowId,
|
|
780
746
|
workflow_label: options.label,
|
|
781
|
-
|
|
747
|
+
...(options.referenceWorkflowId ? { reference_workflow_id: options.referenceWorkflowId } : {}),
|
|
782
748
|
task_prompt: options.taskPrompt,
|
|
783
749
|
dataset: {
|
|
784
750
|
source_path: options.datasetPath,
|
|
@@ -790,17 +756,6 @@ export function createWorkflowAuthoringShell(options) {
|
|
|
790
756
|
})),
|
|
791
757
|
},
|
|
792
758
|
},
|
|
793
|
-
preview: options.preview
|
|
794
|
-
? {
|
|
795
|
-
prepared: true,
|
|
796
|
-
compile_ok: options.preview.compileResult.ok,
|
|
797
|
-
failed_stage: options.preview.compileResult.failedStage,
|
|
798
|
-
}
|
|
799
|
-
: {
|
|
800
|
-
prepared: false,
|
|
801
|
-
compile_ok: null,
|
|
802
|
-
failed_stage: null,
|
|
803
|
-
},
|
|
804
759
|
};
|
|
805
760
|
writeFileSync(join(shellRoot, "runtime", "authoring-context.json"), `${JSON.stringify(context, null, 2)}\n`);
|
|
806
761
|
projectRawSnapshot({
|
|
@@ -811,15 +766,11 @@ export function createWorkflowAuthoringShell(options) {
|
|
|
811
766
|
prune: true,
|
|
812
767
|
preserveTimestamps: true,
|
|
813
768
|
});
|
|
814
|
-
if (options.preview) {
|
|
815
|
-
projectCompiledPreviewSnapshot(options.preview.compiledPath, shellRoot);
|
|
816
|
-
projectCompiledPreviewRuntime(options.preview.compiledPath, shellRoot);
|
|
817
|
-
}
|
|
818
769
|
linkPath(options.workflowPath, join(shellRoot, "workflow"));
|
|
819
770
|
writeNativeAgentSurface(shellRoot, renderWorkflowAuthoringAgents({
|
|
820
771
|
workflowId: options.workflowId,
|
|
821
772
|
label: options.label,
|
|
822
|
-
|
|
773
|
+
referenceWorkflowId: options.referenceWorkflowId ?? null,
|
|
823
774
|
}), "interf-workflow-author", renderWorkflowAuthoringSkill());
|
|
824
775
|
return {
|
|
825
776
|
rootPath: shellRoot,
|
|
@@ -852,6 +803,7 @@ function renderWorkflowImprovementAgents(compiledName, workflowId, loopIndex) {
|
|
|
852
803
|
"- Do not edit checks, test specs, raw files, or generated context outputs.",
|
|
853
804
|
"- Review context outputs under `artifacts/compiled-view/` and test/runtime evidence under `artifacts/`.",
|
|
854
805
|
"- Keep the workflow valid for the current compiler API and workflow schema.",
|
|
806
|
+
"- For acceptance criteria, use `zone_counts_at_least` for numeric fixed minimums and `zone_counts_at_least_counts` only for runtime count-key strings such as `source_total`.",
|
|
855
807
|
"",
|
|
856
808
|
"## Goal",
|
|
857
809
|
"",
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare const COMPILED_INTERF_DIR = ".interf";
|
|
2
2
|
export declare const COMPILED_CONFIG_FILE = "interf.json";
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const COMPILED_METHOD_DIR = "method";
|
|
4
|
+
export declare const COMPILED_WORKFLOW_DIR = "method";
|
|
5
|
+
export declare const LEGACY_COMPILED_WORKFLOW_DIR = "workflow";
|
|
4
6
|
export declare const COMPILED_TEST_DIR = "tests";
|
|
5
7
|
export declare const COMPILED_TEST_TARGETS_DIR = "targets";
|
|
6
8
|
export declare const COMPILED_RUNTIME_DIR = "runtime";
|
|
@@ -17,6 +19,7 @@ export declare function compiledRuntimeFilePath(compiledPath: string, fileName:
|
|
|
17
19
|
export declare function compiledInterfRoot(compiledPath: string): string;
|
|
18
20
|
export declare function compiledInterfConfigPath(compiledPath: string): string;
|
|
19
21
|
export declare function workflowPackagePathForCompiled(compiledPath: string): string;
|
|
22
|
+
export declare function legacyWorkflowPackagePathForCompiled(compiledPath: string): string;
|
|
20
23
|
export declare function testRootForCompiled(compiledPath: string): string;
|
|
21
24
|
export declare function testTargetsRootForCompiled(compiledPath: string): string;
|
|
22
25
|
export declare function stageExecutionShellsRoot(compiledPath: string): string;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
2
2
|
export const COMPILED_INTERF_DIR = ".interf";
|
|
3
3
|
export const COMPILED_CONFIG_FILE = "interf.json";
|
|
4
|
-
export const
|
|
4
|
+
export const COMPILED_METHOD_DIR = "method";
|
|
5
|
+
export const COMPILED_WORKFLOW_DIR = COMPILED_METHOD_DIR;
|
|
6
|
+
export const LEGACY_COMPILED_WORKFLOW_DIR = "workflow";
|
|
5
7
|
export const COMPILED_TEST_DIR = "tests";
|
|
6
8
|
export const COMPILED_TEST_TARGETS_DIR = "targets";
|
|
7
9
|
export const COMPILED_RUNTIME_DIR = "runtime";
|
|
@@ -28,6 +30,9 @@ export function compiledInterfConfigPath(compiledPath) {
|
|
|
28
30
|
export function workflowPackagePathForCompiled(compiledPath) {
|
|
29
31
|
return join(compiledInterfRoot(compiledPath), COMPILED_WORKFLOW_DIR);
|
|
30
32
|
}
|
|
33
|
+
export function legacyWorkflowPackagePathForCompiled(compiledPath) {
|
|
34
|
+
return join(compiledInterfRoot(compiledPath), LEGACY_COMPILED_WORKFLOW_DIR);
|
|
35
|
+
}
|
|
31
36
|
export function testRootForCompiled(compiledPath) {
|
|
32
37
|
return join(compiledInterfRoot(compiledPath), COMPILED_TEST_DIR);
|
|
33
38
|
}
|
|
@@ -91,6 +96,7 @@ export function resolveSourceControlPathForCompiled(compiledPath) {
|
|
|
91
96
|
const parent = dirname(cursor);
|
|
92
97
|
if (basename(parent) === "interf" &&
|
|
93
98
|
basename(cursor) !== "tests" &&
|
|
99
|
+
basename(cursor) !== "methods" &&
|
|
94
100
|
basename(cursor) !== "workflows") {
|
|
95
101
|
return dirname(parent);
|
|
96
102
|
}
|
|
@@ -98,7 +104,7 @@ export function resolveSourceControlPathForCompiled(compiledPath) {
|
|
|
98
104
|
break;
|
|
99
105
|
cursor = parent;
|
|
100
106
|
}
|
|
101
|
-
throw new Error(`
|
|
107
|
+
throw new Error(`Compiled context is not under the canonical project layout: ${compiledPath}`);
|
|
102
108
|
}
|
|
103
109
|
export function defaultControlPathForCompiled(compiledPath) {
|
|
104
110
|
const relativePath = relative(compiledPath, resolveSourceControlPathForCompiled(compiledPath));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type WorkflowExecutor } from "../agents/lib/executors.js";
|
|
2
2
|
import { type WorkflowReporter, type WorkflowStageResult } from "../workflow-package/workflow-helpers.js";
|
|
3
3
|
import { type CompiledStageExecutionDefinition } from "./compiled-target.js";
|
|
4
|
+
import type { RunEventSink } from "../execution/events.js";
|
|
4
5
|
export interface CompiledSummarizeResult extends WorkflowStageResult {
|
|
5
6
|
skipped: boolean;
|
|
6
7
|
plan: {
|
|
@@ -23,6 +24,8 @@ export declare function runCompiledSummarize(options: {
|
|
|
23
24
|
reportStep?: boolean;
|
|
24
25
|
stageDefinition?: CompiledStageExecutionDefinition;
|
|
25
26
|
fullPass?: boolean;
|
|
27
|
+
runId?: string;
|
|
28
|
+
events?: RunEventSink;
|
|
26
29
|
}): Promise<CompiledSummarizeResult>;
|
|
27
30
|
export declare function runCompiledCompile(options: {
|
|
28
31
|
executor: WorkflowExecutor;
|
|
@@ -30,10 +33,14 @@ export declare function runCompiledCompile(options: {
|
|
|
30
33
|
reporter?: WorkflowReporter;
|
|
31
34
|
reportStep?: boolean;
|
|
32
35
|
preserveStageShells?: StageShellRetentionMode;
|
|
36
|
+
runId?: string;
|
|
37
|
+
events?: RunEventSink;
|
|
33
38
|
}): Promise<WorkflowStageResult>;
|
|
34
39
|
export declare function compileCompiled(options: {
|
|
35
40
|
executor: WorkflowExecutor;
|
|
36
41
|
compiledPath: string;
|
|
37
42
|
reporter?: WorkflowReporter;
|
|
38
43
|
preserveStageShells?: StageShellRetentionMode;
|
|
44
|
+
runId?: string;
|
|
45
|
+
events?: RunEventSink;
|
|
39
46
|
}): Promise<CompiledCompileResult>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { join } from "node:path";
|
|
2
1
|
import { refreshCompiledBootstrapGuidance, } from "../agents/lib/compiled-bootstrap.js";
|
|
3
2
|
import { validateWorkflowPackage } from "../workflow-package/local-workflows.js";
|
|
4
3
|
import { reportValidationFailure, } from "../workflow-package/workflow-helpers.js";
|
|
@@ -9,6 +8,7 @@ import { compiledExecutionStages, resolveCompiledContext, } from "./compiled-tar
|
|
|
9
8
|
import { discoverSourceFiles } from "./discovery.js";
|
|
10
9
|
import { runCompiledStage } from "./compiled-stage-runner.js";
|
|
11
10
|
import { resolveSourceInputPath } from "../project-model/interf-detect.js";
|
|
11
|
+
import { workflowPackagePathForCompiled } from "./compiled-paths.js";
|
|
12
12
|
export async function runCompiledSummarize(options) {
|
|
13
13
|
const context = resolveCompiledContext(options.compiledPath);
|
|
14
14
|
const stageDefinition = options.stageDefinition
|
|
@@ -29,6 +29,8 @@ export async function runCompiledSummarize(options) {
|
|
|
29
29
|
reporter: options.reporter,
|
|
30
30
|
reportStep: options.reportStep,
|
|
31
31
|
stageDefinition,
|
|
32
|
+
runId: options.runId,
|
|
33
|
+
events: options.events,
|
|
32
34
|
});
|
|
33
35
|
return {
|
|
34
36
|
...result,
|
|
@@ -48,13 +50,18 @@ export async function runCompiledCompile(options) {
|
|
|
48
50
|
let lastResult = { ok: true, code: 0 };
|
|
49
51
|
try {
|
|
50
52
|
const context = resolveCompiledContext(options.compiledPath);
|
|
51
|
-
|
|
53
|
+
const stages = compiledExecutionStages(context.workflowId, options.compiledPath);
|
|
54
|
+
for (const [index, stageDefinition] of stages.entries()) {
|
|
52
55
|
const result = await runCompiledStage({
|
|
53
56
|
executor: options.executor,
|
|
54
57
|
compiledPath: options.compiledPath,
|
|
55
58
|
reporter: options.reporter,
|
|
56
59
|
reportStep: options.reportStep,
|
|
57
60
|
stageDefinition,
|
|
61
|
+
runId: options.runId,
|
|
62
|
+
events: options.events,
|
|
63
|
+
stageIndex: index,
|
|
64
|
+
stageTotal: stages.length,
|
|
58
65
|
});
|
|
59
66
|
lastResult = result;
|
|
60
67
|
if (!result.ok)
|
|
@@ -82,7 +89,7 @@ export async function compileCompiled(options) {
|
|
|
82
89
|
const sourceInputPath = resolveSourceInputPath(options.compiledPath);
|
|
83
90
|
syncCompiledRawSnapshot(options.compiledPath, sourceInputPath);
|
|
84
91
|
refreshCompiledBootstrapGuidance(options.compiledPath);
|
|
85
|
-
const workflowValidation = validateWorkflowPackage(
|
|
92
|
+
const workflowValidation = validateWorkflowPackage(workflowPackagePathForCompiled(options.compiledPath));
|
|
86
93
|
if (!workflowValidation.ok) {
|
|
87
94
|
reportValidationFailure(options.reporter, workflowValidation.summary, workflowValidation.errors);
|
|
88
95
|
return {
|
|
@@ -101,13 +108,17 @@ export async function compileCompiled(options) {
|
|
|
101
108
|
}
|
|
102
109
|
const context = resolveCompiledContext(options.compiledPath);
|
|
103
110
|
const stages = compiledExecutionStages(context.workflowId, options.compiledPath);
|
|
104
|
-
for (const stageDefinition of stages) {
|
|
111
|
+
for (const [index, stageDefinition] of stages.entries()) {
|
|
105
112
|
const stageResult = await runCompiledStage({
|
|
106
113
|
executor: options.executor,
|
|
107
114
|
compiledPath: options.compiledPath,
|
|
108
115
|
reporter: options.reporter,
|
|
109
116
|
reportStep: true,
|
|
110
117
|
stageDefinition,
|
|
118
|
+
runId: options.runId,
|
|
119
|
+
events: options.events,
|
|
120
|
+
stageIndex: index,
|
|
121
|
+
stageTotal: stages.length,
|
|
111
122
|
});
|
|
112
123
|
result.stageResults[stageDefinition.id] = stageResult;
|
|
113
124
|
if (!stageResult.ok) {
|
|
@@ -18,7 +18,7 @@ export function workflowSchemaExists(rootPath) {
|
|
|
18
18
|
return existsSync(workflowSchemaFilePath(rootPath));
|
|
19
19
|
}
|
|
20
20
|
export function workflowSchemaRelativePath() {
|
|
21
|
-
return `
|
|
21
|
+
return `method/${WORKFLOW_SCHEMA_FILE}`;
|
|
22
22
|
}
|
|
23
23
|
export function listCompiledSchemaZones(schema) {
|
|
24
24
|
return [...schema.zones];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RuntimeStageContractDraft } from "./runtime.js";
|
|
2
|
-
import { type
|
|
2
|
+
import { type WorkflowStageDefinition } from "../workflow-package/workflow-definitions.js";
|
|
3
3
|
import { resolveCompiledContext, type CompiledStageExecutionDefinition } from "./compiled-target.js";
|
|
4
4
|
import type { RuntimeStageInstructions } from "./lib/schema.js";
|
|
5
5
|
export declare function resolveStageContractArtifacts(compiledPath: string, stageDefinition: Pick<WorkflowStageDefinition, "id" | "reads" | "writes">): {
|
|
@@ -7,7 +7,7 @@ export declare function resolveStageContractArtifacts(compiledPath: string, stag
|
|
|
7
7
|
writes: string[];
|
|
8
8
|
};
|
|
9
9
|
export declare function buildStageCounts(compiledPath: string, stageDefinition: WorkflowStageDefinition): Record<string, number>;
|
|
10
|
-
export declare function buildStageContract(compiledPath: string,
|
|
10
|
+
export declare function buildStageContract(compiledPath: string, stageDefinition: WorkflowStageDefinition, instructions: RuntimeStageInstructions): RuntimeStageContractDraft;
|
|
11
11
|
export declare function buildCompiledStageExecutionPlan(compiledPath: string, stageDefinition: CompiledStageExecutionDefinition): {
|
|
12
12
|
context: ReturnType<typeof resolveCompiledContext>;
|
|
13
13
|
contract: RuntimeStageContractDraft;
|
|
@@ -51,7 +51,7 @@ export function buildStageCounts(compiledPath, stageDefinition) {
|
|
|
51
51
|
...zoneCounts,
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
export function buildStageContract(compiledPath,
|
|
54
|
+
export function buildStageContract(compiledPath, stageDefinition, instructions) {
|
|
55
55
|
const config = readInterfConfig(compiledPath);
|
|
56
56
|
const stageArtifacts = resolveStageContractArtifacts(compiledPath, stageDefinition);
|
|
57
57
|
return buildRuntimeStageContract({
|
|
@@ -61,10 +61,10 @@ export function buildStageContract(compiledPath, workflowId, stageDefinition, in
|
|
|
61
61
|
counts: buildStageCounts(compiledPath, stageDefinition),
|
|
62
62
|
stageReadArtifacts: stageArtifacts.reads,
|
|
63
63
|
stageWriteArtifacts: stageArtifacts.writes,
|
|
64
|
-
workflowNotes: getActiveCompiledStagePolicyNotes(compiledPath,
|
|
64
|
+
workflowNotes: getActiveCompiledStagePolicyNotes(compiledPath, stageDefinition.id),
|
|
65
65
|
localSkillDocs: instructions.local_docs,
|
|
66
66
|
instructions,
|
|
67
|
-
acceptance: resolveActiveCompiledStageAcceptance(compiledPath,
|
|
67
|
+
acceptance: resolveActiveCompiledStageAcceptance(compiledPath, stageDefinition.id),
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
export function buildCompiledStageExecutionPlan(compiledPath, stageDefinition) {
|
|
@@ -74,6 +74,6 @@ export function buildCompiledStageExecutionPlan(compiledPath, stageDefinition) {
|
|
|
74
74
|
return {
|
|
75
75
|
context,
|
|
76
76
|
instructions,
|
|
77
|
-
contract: buildStageContract(compiledPath,
|
|
77
|
+
contract: buildStageContract(compiledPath, stageDefinition, instructions),
|
|
78
78
|
};
|
|
79
79
|
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { type WorkflowExecutor } from "../agents/lib/executors.js";
|
|
2
2
|
import { type WorkflowReporter, type WorkflowStageResult } from "../workflow-package/workflow-helpers.js";
|
|
3
3
|
import { type CompiledStageExecutionDefinition } from "./compiled-target.js";
|
|
4
|
+
import { type RunEventSink } from "../execution/events.js";
|
|
4
5
|
export declare function runCompiledStage(options: {
|
|
5
6
|
executor: WorkflowExecutor;
|
|
6
7
|
compiledPath: string;
|
|
7
8
|
reporter?: WorkflowReporter;
|
|
8
9
|
reportStep?: boolean;
|
|
9
10
|
stageDefinition: CompiledStageExecutionDefinition;
|
|
11
|
+
runId?: string;
|
|
12
|
+
events?: RunEventSink;
|
|
13
|
+
stageIndex?: number;
|
|
14
|
+
stageTotal?: number;
|
|
10
15
|
}): Promise<WorkflowStageResult>;
|