@interf/compiler 0.9.1 → 0.9.4
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 +9 -9
- package/agent-skills/interf-actions/SKILL.md +3 -0
- package/agent-skills/interf-actions/references/cli.md +13 -13
- package/{builtin-workflows/interf → builtin-methods/interf-default}/README.md +2 -2
- package/builtin-methods/interf-default/improve/SKILL.md +18 -0
- package/{builtin-workflows/interf/workflow.json → builtin-methods/interf-default/method.json} +4 -4
- package/{builtin-workflows/interf/workflow.schema.json → builtin-methods/interf-default/method.schema.json} +2 -2
- package/dist/cli/commands/check-draft.d.ts +6 -6
- package/dist/cli/commands/check-draft.js +5 -5
- package/dist/cli/commands/compile-controller.d.ts +7 -7
- package/dist/cli/commands/compile-controller.js +35 -38
- package/dist/cli/commands/compile.d.ts +3 -3
- package/dist/cli/commands/compile.js +23 -21
- package/dist/cli/commands/compiled-flow.d.ts +11 -11
- package/dist/cli/commands/compiled-flow.js +33 -30
- package/dist/cli/commands/create-method-wizard.d.ts +76 -0
- package/dist/cli/commands/{create-workflow-wizard.js → create-method-wizard.js} +153 -163
- package/dist/cli/commands/create.d.ts +3 -3
- package/dist/cli/commands/create.js +44 -45
- package/dist/cli/commands/default.js +1 -1
- package/dist/cli/commands/executor-flow.d.ts +6 -6
- package/dist/cli/commands/executor-flow.js +1 -1
- package/dist/cli/commands/init.d.ts +2 -2
- package/dist/cli/commands/init.js +139 -118
- package/dist/cli/commands/list.js +11 -10
- package/dist/cli/commands/preparation-selection.d.ts +3 -3
- package/dist/cli/commands/source-config-wizard.d.ts +9 -9
- package/dist/cli/commands/source-config-wizard.js +43 -43
- package/dist/cli/commands/status.js +36 -9
- package/dist/cli/commands/test-flow.d.ts +15 -15
- package/dist/cli/commands/test-flow.js +29 -219
- package/dist/cli/commands/test.d.ts +2 -2
- package/dist/cli/commands/test.js +50 -51
- package/dist/cli/commands/verify.js +7 -7
- package/dist/cli/commands/web.js +41 -28
- package/dist/compiler-ui/404.html +1 -0
- package/dist/compiler-ui/__next.__PAGE__.txt +10 -0
- package/dist/compiler-ui/__next._full.txt +20 -0
- package/dist/compiler-ui/__next._head.txt +5 -0
- package/dist/compiler-ui/__next._index.txt +5 -0
- package/dist/compiler-ui/__next._tree.txt +5 -0
- package/dist/compiler-ui/_next/static/chunks/06yhdspx~ca5-.js +5 -0
- package/{apps/compiler-ui/.next/static/chunks/0fgt_8knmicoz.js → dist/compiler-ui/_next/static/chunks/0d~8t0zm6545p.js} +15 -21
- package/dist/compiler-ui/_next/static/chunks/0xnel.ax9a.2c.css +3 -0
- package/{apps/compiler-ui/.next/static/chunks/turbopack-109rtik40vwh5.js → dist/compiler-ui/_next/static/chunks/turbopack-0.uq1k8c0j4s..js} +1 -1
- package/dist/compiler-ui/_not-found/__next._full.txt +15 -0
- package/dist/compiler-ui/_not-found/__next._head.txt +5 -0
- package/dist/compiler-ui/_not-found/__next._index.txt +5 -0
- package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +5 -0
- package/dist/compiler-ui/_not-found/__next._not-found.txt +5 -0
- package/dist/compiler-ui/_not-found/__next._tree.txt +2 -0
- package/dist/compiler-ui/_not-found.html +1 -0
- package/dist/compiler-ui/_not-found.txt +15 -0
- package/{apps/compiler-ui/.next/server/app → dist/compiler-ui}/index.html +1 -1
- package/dist/compiler-ui/index.txt +20 -0
- package/dist/index.d.ts +8 -6
- package/dist/index.js +5 -3
- package/dist/packages/agents/index.d.ts +1 -1
- package/dist/packages/agents/lib/args.d.ts +2 -2
- package/dist/packages/agents/lib/compiled-bootstrap.js +7 -6
- package/dist/packages/agents/lib/execution-profile.d.ts +5 -5
- package/dist/packages/agents/lib/execution-profile.js +7 -6
- package/dist/packages/agents/lib/executors.d.ts +13 -13
- package/dist/packages/agents/lib/preflight.d.ts +1 -0
- package/dist/packages/agents/lib/preflight.js +32 -9
- package/dist/packages/agents/lib/shells.d.ts +25 -24
- package/dist/packages/agents/lib/shells.js +161 -154
- package/dist/packages/agents/lib/types.d.ts +2 -2
- package/dist/packages/compiler/artifact-counts.d.ts +1 -0
- package/dist/packages/compiler/artifact-counts.js +30 -0
- package/dist/packages/compiler/compiled-paths.d.ts +4 -7
- package/dist/packages/compiler/compiled-paths.js +9 -15
- package/dist/packages/compiler/compiled-pipeline.d.ts +11 -12
- package/dist/packages/compiler/compiled-pipeline.js +22 -22
- package/dist/packages/compiler/compiled-schema.d.ts +20 -20
- package/dist/packages/compiler/compiled-schema.js +29 -29
- package/dist/packages/compiler/compiled-stage-plan.d.ts +4 -4
- package/dist/packages/compiler/compiled-stage-plan.js +8 -8
- package/dist/packages/compiler/compiled-stage-runner.d.ts +5 -5
- package/dist/packages/compiler/compiled-stage-runner.js +7 -7
- package/dist/packages/compiler/compiled-target.d.ts +5 -5
- package/dist/packages/compiler/compiled-target.js +5 -5
- package/dist/packages/compiler/index.d.ts +3 -3
- package/dist/packages/compiler/index.js +2 -2
- package/dist/packages/compiler/lib/schema.d.ts +62 -247
- package/dist/packages/compiler/lib/schema.js +56 -174
- package/dist/packages/compiler/{workflows.d.ts → method-runs.d.ts} +4 -4
- package/dist/packages/compiler/{workflows.js → method-runs.js} +4 -3
- package/dist/packages/compiler/raw-snapshot.d.ts +0 -7
- package/dist/packages/compiler/raw-snapshot.js +0 -1
- package/dist/packages/compiler/reset.js +3 -3
- package/dist/packages/compiler/runtime-acceptance.js +9 -16
- package/dist/packages/compiler/runtime-contracts.js +9 -9
- package/dist/packages/compiler/runtime-prompt.js +4 -4
- package/dist/packages/compiler/runtime-reconcile.d.ts +2 -2
- package/dist/packages/compiler/runtime-reconcile.js +3 -3
- package/dist/packages/compiler/runtime-runs.js +9 -9
- package/dist/packages/compiler/runtime-types.d.ts +8 -7
- package/dist/packages/compiler/state-health.js +26 -35
- package/dist/packages/compiler/state-view.js +6 -6
- package/dist/packages/compiler/validate-compiled.d.ts +5 -5
- package/dist/packages/compiler/validate-compiled.js +56 -64
- package/dist/packages/compiler/validate.d.ts +2 -2
- package/dist/packages/compiler/validate.js +22 -14
- package/dist/packages/contracts/index.d.ts +2 -0
- package/dist/packages/contracts/index.js +1 -0
- package/dist/packages/contracts/lib/schema.d.ts +205 -0
- package/dist/packages/contracts/lib/schema.js +101 -0
- package/dist/packages/execution/index.d.ts +2 -2
- package/dist/packages/execution/index.js +1 -1
- package/dist/packages/execution/lib/schema.d.ts +80 -83
- package/dist/packages/execution/lib/schema.js +25 -48
- package/dist/packages/local-service/action-values.d.ts +1 -1
- package/dist/packages/local-service/action-values.js +1 -1
- package/dist/packages/local-service/client.d.ts +4 -4
- package/dist/packages/local-service/client.js +4 -4
- package/dist/packages/local-service/index.d.ts +3 -3
- package/dist/packages/local-service/index.js +2 -2
- package/dist/packages/local-service/lib/schema.d.ts +540 -974
- package/dist/packages/local-service/lib/schema.js +44 -160
- package/dist/packages/local-service/run-observability.d.ts +6 -0
- package/dist/packages/local-service/run-observability.js +592 -0
- package/dist/packages/local-service/runtime.d.ts +19 -23
- package/dist/packages/local-service/runtime.js +349 -913
- package/dist/packages/local-service/server.d.ts +1 -0
- package/dist/packages/local-service/server.js +25 -20
- package/dist/packages/method-authoring/index.d.ts +4 -0
- package/dist/packages/method-authoring/index.js +4 -0
- package/dist/packages/{workflow-authoring/lib/workflow-edit-utils.d.ts → method-authoring/lib/method-edit-utils.d.ts} +3 -3
- package/dist/packages/method-authoring/method-authoring.d.ts +24 -0
- package/dist/packages/method-authoring/method-authoring.js +116 -0
- package/dist/packages/method-authoring/method-edit-session.d.ts +18 -0
- package/dist/packages/method-authoring/method-edit-session.js +125 -0
- package/dist/packages/method-authoring/method-improvement.d.ts +23 -0
- package/dist/packages/{workflow-authoring/workflow-improvement.js → method-authoring/method-improvement.js} +63 -63
- package/dist/packages/{workflow-package/builtin-compiled-workflow.d.ts → method-package/builtin-compiled-method.d.ts} +1 -1
- package/dist/packages/{workflow-package/builtin-compiled-workflow.js → method-package/builtin-compiled-method.js} +17 -17
- package/dist/packages/{workflow-package → method-package}/context-interface.d.ts +12 -12
- package/dist/packages/{workflow-package → method-package}/context-interface.js +19 -19
- package/dist/packages/method-package/index.d.ts +11 -0
- package/dist/packages/method-package/index.js +11 -0
- package/dist/packages/method-package/interf-method-package.d.ts +31 -0
- package/dist/packages/{workflow-package/interf-workflow-package.js → method-package/interf-method-package.js} +145 -145
- package/dist/packages/{workflow-package → method-package}/lib/package-root.js +1 -1
- package/dist/packages/method-package/local-methods.d.ts +64 -0
- package/dist/packages/method-package/local-methods.js +466 -0
- package/dist/packages/method-package/method-definitions.d.ts +83 -0
- package/dist/packages/method-package/method-definitions.js +205 -0
- package/dist/packages/{workflow-package/workflow-helpers.d.ts → method-package/method-helpers.d.ts} +10 -10
- package/dist/packages/{workflow-package/workflow-helpers.js → method-package/method-helpers.js} +22 -26
- package/dist/packages/method-package/method-review-paths.d.ts +10 -0
- package/dist/packages/{workflow-package/workflow-review-paths.js → method-package/method-review-paths.js} +4 -4
- package/dist/packages/{workflow-package/workflow-stage-runner.d.ts → method-package/method-stage-runner.d.ts} +12 -11
- package/dist/packages/{workflow-package/workflow-stage-runner.js → method-package/method-stage-runner.js} +6 -6
- package/dist/packages/methods/index.d.ts +2 -0
- package/dist/packages/methods/index.js +2 -0
- package/dist/packages/methods/method-resolution.d.ts +6 -0
- package/dist/packages/methods/method-resolution.js +7 -0
- package/dist/packages/project-model/index.d.ts +1 -4
- package/dist/packages/project-model/index.js +0 -3
- package/dist/packages/project-model/interf-detect.d.ts +1 -5
- package/dist/packages/project-model/interf-detect.js +7 -18
- package/dist/packages/project-model/interf-scaffold.d.ts +2 -2
- package/dist/packages/project-model/interf-scaffold.js +38 -39
- package/dist/packages/project-model/interf.d.ts +1 -2
- package/dist/packages/project-model/interf.js +1 -2
- package/dist/packages/project-model/lib/schema.d.ts +2 -66
- package/dist/packages/project-model/lib/schema.js +5 -23
- package/dist/packages/project-model/project-paths.d.ts +9 -10
- package/dist/packages/project-model/project-paths.js +14 -17
- package/dist/packages/project-model/source-config.d.ts +11 -18
- package/dist/packages/project-model/source-config.js +42 -60
- package/dist/packages/project-model/source-folders.d.ts +4 -4
- package/dist/packages/project-model/source-folders.js +10 -10
- package/dist/packages/testing/index.d.ts +2 -2
- package/dist/packages/testing/index.js +1 -1
- package/dist/packages/testing/lib/schema.d.ts +11 -11
- package/dist/packages/testing/lib/schema.js +8 -9
- package/dist/packages/testing/readiness-check-run.d.ts +67 -0
- package/dist/packages/testing/readiness-check-run.js +258 -0
- package/dist/packages/testing/test-execution.d.ts +3 -3
- package/dist/packages/testing/test-execution.js +5 -5
- package/dist/packages/testing/test-paths.js +6 -6
- package/dist/packages/testing/test-profile-presets.js +2 -2
- package/dist/packages/testing/test-sandbox.js +10 -11
- package/dist/packages/testing/test-targets.d.ts +1 -1
- package/dist/packages/testing/test-targets.js +8 -7
- package/dist/packages/testing/test-types.d.ts +1 -1
- package/package.json +16 -33
- package/apps/compiler-ui/.next/static/chunks/0ti_66mx7~w2-.js +0 -5
- package/apps/compiler-ui/.next/static/chunks/13g~4mamjft.c.css +0 -3
- package/builtin-workflows/interf/improve/SKILL.md +0 -18
- package/dist/cli/commands/create-workflow-wizard.d.ts +0 -76
- package/dist/packages/project-model/compiled-paths.d.ts +0 -1
- package/dist/packages/project-model/compiled-paths.js +0 -1
- package/dist/packages/project-model/compiled-raw.d.ts +0 -1
- package/dist/packages/project-model/compiled-raw.js +0 -1
- package/dist/packages/project-model/compiled-reset.d.ts +0 -1
- package/dist/packages/project-model/compiled-reset.js +0 -1
- package/dist/packages/shared/index.d.ts +0 -7
- package/dist/packages/shared/index.js +0 -7
- package/dist/packages/shared/util.d.ts +0 -3
- package/dist/packages/shared/util.js +0 -3
- package/dist/packages/testing/test-matrices.d.ts +0 -90
- package/dist/packages/testing/test-matrices.js +0 -96
- package/dist/packages/workflow-authoring/index.d.ts +0 -4
- package/dist/packages/workflow-authoring/index.js +0 -4
- package/dist/packages/workflow-authoring/workflow-authoring.d.ts +0 -24
- package/dist/packages/workflow-authoring/workflow-authoring.js +0 -82
- package/dist/packages/workflow-authoring/workflow-edit-session.d.ts +0 -18
- package/dist/packages/workflow-authoring/workflow-edit-session.js +0 -91
- package/dist/packages/workflow-authoring/workflow-improvement.d.ts +0 -23
- package/dist/packages/workflow-package/index.d.ts +0 -11
- package/dist/packages/workflow-package/index.js +0 -11
- package/dist/packages/workflow-package/interf-workflow-package.d.ts +0 -31
- package/dist/packages/workflow-package/local-workflows.d.ts +0 -64
- package/dist/packages/workflow-package/local-workflows.js +0 -457
- package/dist/packages/workflow-package/workflow-definitions.d.ts +0 -82
- package/dist/packages/workflow-package/workflow-definitions.js +0 -211
- package/dist/packages/workflow-package/workflow-review-paths.d.ts +0 -10
- /package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/shape/SKILL.md +0 -0
- /package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/structure/SKILL.md +0 -0
- /package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/summarize/SKILL.md +0 -0
- /package/{builtin-workflows/interf → builtin-methods/interf-default}/use/query/SKILL.md +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/03~yq9q893hmn.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/06z~l3kwb891e.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/08g7lvje.te.u.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/08m7vf5asqlsm.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0_i-3_5l9t2qe.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0b-ywny_j0g~0.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0b52v41o1gixx.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0gpzgsv0w.q~m.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0ilwfezfvu6~-.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0n51hrfoufc7g.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0xxmf45eskdt~.css +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0y5z3t-z1c8ks.js.map +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/14wtz~vq25~qq.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/turbopack-10e~t1yzi4svj.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/turbopack-worker-0sjn--fhq~1cg.js +0 -0
- /package/{apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J → dist/compiler-ui/_next/static/j7pdoqWrl4YJrJUVnksbl}/_buildManifest.js +0 -0
- /package/{apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J → dist/compiler-ui/_next/static/j7pdoqWrl4YJrJUVnksbl}/_clientMiddlewareManifest.js +0 -0
- /package/{apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J → dist/compiler-ui/_next/static/j7pdoqWrl4YJrJUVnksbl}/_ssgManifest.js +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/media/GeistMono_Variable.p.17jn9btb_52pq.woff2 +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/media/Geist_Variable-s.p.0-te~ja_gpvcf.woff2 +0 -0
- /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/media/worker.102zas1s52_pf.js +0 -0
- /package/dist/packages/compiler/{workflow-primitives.d.ts → method-primitives.d.ts} +0 -0
- /package/dist/packages/compiler/{workflow-primitives.js → method-primitives.js} +0 -0
- /package/dist/packages/{workflow-authoring/lib/workflow-edit-utils.js → method-authoring/lib/method-edit-utils.js} +0 -0
- /package/dist/packages/{workflow-package → method-package}/lib/package-root.d.ts +0 -0
- /package/dist/packages/{workflow-package/workflow-stage-policy.d.ts → method-package/method-stage-policy.d.ts} +0 -0
- /package/dist/packages/{workflow-package/workflow-stage-policy.js → method-package/method-stage-policy.js} +0 -0
|
@@ -3,12 +3,12 @@ import { tmpdir } from "node:os";
|
|
|
3
3
|
import { basename, dirname, join, relative } from "node:path";
|
|
4
4
|
import { CHART_APPROXIMATION_NOTES } from "./chart-guidance.js";
|
|
5
5
|
import { projectRawSnapshot } from "../../compiler/raw-snapshot.js";
|
|
6
|
-
import {
|
|
7
|
-
import { CONTEXT_INTERFACE_FILE as
|
|
8
|
-
import { stageExecutionShellsRoot,
|
|
6
|
+
import { METHOD_PACKAGE_DIR } from "../../project-model/interf-detect.js";
|
|
7
|
+
import { CONTEXT_INTERFACE_FILE as METHOD_SCHEMA_FILE, contextInterfaceZoneAbsolutePath as compiledZoneAbsolutePath, readContextInterface as readCompiledSchemaFile, resolveContextInterfacePath as resolveMethodSchemaPath, } from "../../method-package/context-interface.js";
|
|
8
|
+
import { stageExecutionShellsRoot, methodImprovementLoopRoot, methodPackagePathForCompiled, compiledInterfConfigPath, compiledRuntimeRoot, } from "../../compiler/compiled-paths.js";
|
|
9
9
|
import { ensureCompiledZoneTargets } from "../../compiler/compiled-schema.js";
|
|
10
10
|
import { listFilesRecursive } from "../../shared/filesystem.js";
|
|
11
|
-
import {
|
|
11
|
+
import { resolveMethodImprovementReviewSourcePaths } from "../../method-package/method-review-paths.js";
|
|
12
12
|
const LOCAL_SKILL_ROOTS = [
|
|
13
13
|
".claude/skills",
|
|
14
14
|
".codex/skills",
|
|
@@ -24,19 +24,19 @@ export function writeNativeAgentSurface(rootPath, agentsContent, skillName, skil
|
|
|
24
24
|
return changed;
|
|
25
25
|
}
|
|
26
26
|
function compiledQuerySkillSourcePath(compiledPath) {
|
|
27
|
-
return join(
|
|
27
|
+
return join(methodPackagePathForCompiled(compiledPath), "use", "query", "SKILL.md");
|
|
28
28
|
}
|
|
29
29
|
function compiledZoneSummaryLines(compiledPath) {
|
|
30
|
-
const schema = readCompiledSchemaFile(
|
|
30
|
+
const schema = readCompiledSchemaFile(methodPackagePathForCompiled(compiledPath));
|
|
31
31
|
if (!schema)
|
|
32
|
-
return ["- No
|
|
32
|
+
return ["- No Method schema is available yet."];
|
|
33
33
|
return schema.zones
|
|
34
34
|
.filter((zone) => zone.kind !== "runtime")
|
|
35
35
|
.map((zone) => `- \`${zone.id}\` -> \`${zone.path}\` (${zone.role} ${zone.kind})`);
|
|
36
36
|
}
|
|
37
|
-
export function renderCompiledAgents(compiledPath, name,
|
|
38
|
-
const
|
|
39
|
-
const
|
|
37
|
+
export function renderCompiledAgents(compiledPath, name, methodId, about, options = {}) {
|
|
38
|
+
const methodOriginSelected = options.methodOriginSelected ?? methodId;
|
|
39
|
+
const methodLocalDraft = options.methodLocalDraft === true;
|
|
40
40
|
const zoneLines = compiledZoneSummaryLines(compiledPath);
|
|
41
41
|
return [
|
|
42
42
|
`# ${name}`,
|
|
@@ -53,29 +53,29 @@ export function renderCompiledAgents(compiledPath, name, workflowId, about, opti
|
|
|
53
53
|
"## How to use this portable context",
|
|
54
54
|
"",
|
|
55
55
|
"1. Use the local native `interf-query` skill that Interf generated for this portable context.",
|
|
56
|
-
"2. Let the
|
|
56
|
+
"2. Let the Method 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
59
|
"## How this portable context works",
|
|
60
60
|
"",
|
|
61
61
|
"- The Method package defines the context interface this portable context implements on disk.",
|
|
62
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: \`${
|
|
64
|
-
...(
|
|
63
|
+
`- Method seed: \`${methodOriginSelected}\`.`,
|
|
64
|
+
...(methodLocalDraft
|
|
65
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 Method id: \`${
|
|
67
|
+
`- Active local Method id: \`${methodId}\`.`,
|
|
68
68
|
"- `.interf/method/` is the local editable Method package for this portable context.",
|
|
69
|
-
`- \`.interf/method/${
|
|
69
|
+
`- \`.interf/method/${METHOD_SCHEMA_FILE}\` is the deterministic context interface for this portable context.`,
|
|
70
70
|
"- `.interf/method/improve/` is the editable source for Method-improvement loops.",
|
|
71
71
|
"- `.interf/method/use/query/` is the editable source for the generated native query shell.",
|
|
72
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
|
-
`- Method zones are declared in \`.interf/method/${
|
|
75
|
+
`- Method zones are declared in \`.interf/method/${METHOD_SCHEMA_FILE}\`.`,
|
|
76
76
|
...zoneLines,
|
|
77
77
|
"- `.interf/runtime/` holds runtime artifacts written by Interf.",
|
|
78
|
-
"- `.interf/tests/` mirrors the latest saved
|
|
78
|
+
"- `.interf/tests/` mirrors the latest saved readiness-check run and keeps detailed target runs plus preserved sandboxes.",
|
|
79
79
|
"- `.interf/tests/targets/` holds detailed raw and compiled target runs plus preserved test sandboxes.",
|
|
80
80
|
"",
|
|
81
81
|
"## Manual query rules",
|
|
@@ -91,8 +91,8 @@ export function renderCompiledAgents(compiledPath, name, workflowId, about, opti
|
|
|
91
91
|
"```",
|
|
92
92
|
"interf compile build this portable context",
|
|
93
93
|
"interf test run checks against this portable context",
|
|
94
|
-
"interf verify stage <id> verify one
|
|
95
|
-
"interf verify
|
|
94
|
+
"interf verify stage <id> verify one Method stage",
|
|
95
|
+
"interf verify portable-context verify the full portable context output",
|
|
96
96
|
"interf status show deterministic health",
|
|
97
97
|
"```",
|
|
98
98
|
"",
|
|
@@ -112,7 +112,7 @@ export function renderCompiledQuerySkill() {
|
|
|
112
112
|
"",
|
|
113
113
|
"Default loop:",
|
|
114
114
|
"1. Read `.interf/method/README.md` and this file first.",
|
|
115
|
-
`2. Use the Method zones declared in \`.interf/method/${
|
|
115
|
+
`2. Use the Method zones declared in \`.interf/method/${METHOD_SCHEMA_FILE}\` before consulting \`raw/\`.`,
|
|
116
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:",
|
|
@@ -133,7 +133,7 @@ function renderRawTestAgents() {
|
|
|
133
133
|
"# Raw Test Shell",
|
|
134
134
|
"",
|
|
135
135
|
"This is an isolated raw-files test shell generated by Interf.",
|
|
136
|
-
"There is no
|
|
136
|
+
"There is no portable context in this shell.",
|
|
137
137
|
"",
|
|
138
138
|
"## How to use this shell",
|
|
139
139
|
"",
|
|
@@ -144,7 +144,7 @@ function renderRawTestAgents() {
|
|
|
144
144
|
"## Rules",
|
|
145
145
|
"",
|
|
146
146
|
"- Answer only from the files under `raw/`.",
|
|
147
|
-
"- There is no
|
|
147
|
+
"- There is no portable context here, so do not assume any portable-context output zones exist.",
|
|
148
148
|
"- Do not treat hidden runtime files or test artifacts as evidence.",
|
|
149
149
|
...chartNotes,
|
|
150
150
|
"- Write the requested answer and trace files, then stop.",
|
|
@@ -169,7 +169,7 @@ function renderRawTestQuerySkill() {
|
|
|
169
169
|
"1. Read `raw/` directly.",
|
|
170
170
|
"2. Verify exact claims against the raw files before answering strongly.",
|
|
171
171
|
...chartNotes,
|
|
172
|
-
"8. Do not rely on
|
|
172
|
+
"8. Do not rely on portable-context artifacts because they do not exist in this shell.",
|
|
173
173
|
"",
|
|
174
174
|
].join("\n");
|
|
175
175
|
}
|
|
@@ -180,8 +180,8 @@ function readCompiledQuerySkillSource(compiledPath) {
|
|
|
180
180
|
}
|
|
181
181
|
return readFileSync(filePath, "utf8").trim();
|
|
182
182
|
}
|
|
183
|
-
function
|
|
184
|
-
return join(shellRoot,
|
|
183
|
+
function stageShellMethodRoot(shellRoot) {
|
|
184
|
+
return join(shellRoot, METHOD_PACKAGE_DIR);
|
|
185
185
|
}
|
|
186
186
|
function shellInputZonePath(shellRoot, zoneId) {
|
|
187
187
|
return join(shellRoot, "inputs", zoneId);
|
|
@@ -230,10 +230,10 @@ function linkRelativePath(targetPath, linkPathname) {
|
|
|
230
230
|
symlinkSync(relative(dirname(linkPathname), targetPath), linkPathname);
|
|
231
231
|
}
|
|
232
232
|
function loadCompiledSchema(compiledPath) {
|
|
233
|
-
const
|
|
234
|
-
const schema = readCompiledSchemaFile(
|
|
233
|
+
const methodRoot = methodPackagePathForCompiled(compiledPath);
|
|
234
|
+
const schema = readCompiledSchemaFile(methodRoot);
|
|
235
235
|
if (!schema) {
|
|
236
|
-
throw new Error(`Missing
|
|
236
|
+
throw new Error(`Missing Method schema at ${join(methodRoot, METHOD_SCHEMA_FILE)}`);
|
|
237
237
|
}
|
|
238
238
|
return schema;
|
|
239
239
|
}
|
|
@@ -243,7 +243,7 @@ function zoneMap(schema) {
|
|
|
243
243
|
function zoneOrThrow(zones, zoneId) {
|
|
244
244
|
const zone = zones.get(zoneId);
|
|
245
245
|
if (!zone) {
|
|
246
|
-
throw new Error(`Missing
|
|
246
|
+
throw new Error(`Missing Method schema zone "${zoneId}" for stage shell projection.`);
|
|
247
247
|
}
|
|
248
248
|
return zone;
|
|
249
249
|
}
|
|
@@ -298,21 +298,21 @@ function ensureShellLocalProjection(sourcePath, targetPath, zone) {
|
|
|
298
298
|
}
|
|
299
299
|
function ensureCompiledExecutionSurface(compiledPath) {
|
|
300
300
|
mkdirSync(compiledRuntimeRoot(compiledPath), { recursive: true });
|
|
301
|
-
mkdirSync(
|
|
301
|
+
mkdirSync(methodPackagePathForCompiled(compiledPath), { recursive: true });
|
|
302
302
|
const schema = loadCompiledSchema(compiledPath);
|
|
303
303
|
ensureCompiledZoneTargets(compiledPath, schema);
|
|
304
304
|
return schema;
|
|
305
305
|
}
|
|
306
306
|
function readStageMethodDoc(compiledPath, stage) {
|
|
307
|
-
const path = join(
|
|
307
|
+
const path = join(methodPackagePathForCompiled(compiledPath), "compile", "stages", stage.skillDir, "SKILL.md");
|
|
308
308
|
if (!existsSync(path))
|
|
309
309
|
return null;
|
|
310
310
|
return readFileSync(path, "utf8").trim();
|
|
311
311
|
}
|
|
312
|
-
function
|
|
313
|
-
return join(
|
|
312
|
+
function stageMethodDocsPath(compiledPath, stage) {
|
|
313
|
+
return join(methodPackagePathForCompiled(compiledPath), "compile", "stages", stage.skillDir);
|
|
314
314
|
}
|
|
315
|
-
function renderStageExecutionAgents(compiledName,
|
|
315
|
+
function renderStageExecutionAgents(compiledName, methodId, stage) {
|
|
316
316
|
return [
|
|
317
317
|
`# ${compiledName} — ${stage.label} Execution Shell`,
|
|
318
318
|
"",
|
|
@@ -333,14 +333,14 @@ function renderStageExecutionAgents(compiledName, workflowId, stage) {
|
|
|
333
333
|
"- For file zones, `runtime/paths.json` points to the exact file path inside those mount roots.",
|
|
334
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
|
-
"- `method/` = Method metadata,
|
|
336
|
+
"- `method/` = Method metadata, `method.schema.json`, and docs for the current stage only.",
|
|
337
337
|
"",
|
|
338
338
|
"## Boundaries",
|
|
339
339
|
"",
|
|
340
|
-
`-
|
|
340
|
+
`- Method: \`${methodId}\`.`,
|
|
341
341
|
`- Contract type: \`${stage.contractType}\`.`,
|
|
342
|
-
"- This shell has its own AGENTS/CLAUDE/native skills. It does not inherit the
|
|
343
|
-
"- The
|
|
342
|
+
"- This shell has its own AGENTS/CLAUDE/native skills. It does not inherit the portable-context query shell.",
|
|
343
|
+
"- The portable context root itself is not linked into this shell.",
|
|
344
344
|
"- Do not switch into query mode or act like a user-facing assistant.",
|
|
345
345
|
"- Do not modify files under `inputs/` unless the same zone is also mounted under `outputs/`.",
|
|
346
346
|
"",
|
|
@@ -412,25 +412,25 @@ function renderCompiledQueryNativeSkill(querySkillContent) {
|
|
|
412
412
|
"",
|
|
413
413
|
].join("\n");
|
|
414
414
|
}
|
|
415
|
-
function
|
|
416
|
-
const
|
|
417
|
-
mkdirSync(join(
|
|
418
|
-
const
|
|
419
|
-
const
|
|
420
|
-
if (existsSync(
|
|
421
|
-
linkPath(
|
|
415
|
+
function projectMethodMetadata(compiledPath, shellRoot, stage) {
|
|
416
|
+
const shellMethodRoot = stageShellMethodRoot(shellRoot);
|
|
417
|
+
mkdirSync(join(shellMethodRoot, "compile", "stages"), { recursive: true });
|
|
418
|
+
const compiledMethodRoot = methodPackagePathForCompiled(compiledPath);
|
|
419
|
+
const methodJsonPath = join(compiledMethodRoot, "method.json");
|
|
420
|
+
if (existsSync(methodJsonPath)) {
|
|
421
|
+
linkPath(methodJsonPath, join(shellMethodRoot, "method.json"));
|
|
422
422
|
}
|
|
423
|
-
const compiledSchemaPath =
|
|
423
|
+
const compiledSchemaPath = resolveMethodSchemaPath(compiledMethodRoot);
|
|
424
424
|
if (compiledSchemaPath) {
|
|
425
|
-
linkPath(compiledSchemaPath, join(
|
|
425
|
+
linkPath(compiledSchemaPath, join(shellMethodRoot, METHOD_SCHEMA_FILE));
|
|
426
426
|
}
|
|
427
|
-
const readmePath = join(
|
|
427
|
+
const readmePath = join(compiledMethodRoot, "README.md");
|
|
428
428
|
if (existsSync(readmePath)) {
|
|
429
|
-
linkPath(readmePath, join(
|
|
429
|
+
linkPath(readmePath, join(shellMethodRoot, "README.md"));
|
|
430
430
|
}
|
|
431
|
-
const stageDocsPath =
|
|
431
|
+
const stageDocsPath = stageMethodDocsPath(compiledPath, stage);
|
|
432
432
|
if (existsSync(stageDocsPath)) {
|
|
433
|
-
linkPath(stageDocsPath, join(
|
|
433
|
+
linkPath(stageDocsPath, join(shellMethodRoot, "compile", "stages", stage.skillDir));
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
function projectCompiledSchemaZones(compiledPath, shellRoot, schema, zoneIds, materializedZoneIds) {
|
|
@@ -481,11 +481,11 @@ function projectStageZoneMountAliases(shellRoot, stage, schema) {
|
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
|
-
function writeExecutionShellPathsFile(shellRoot,
|
|
484
|
+
function writeExecutionShellPathsFile(shellRoot, methodId, stage, mounts) {
|
|
485
485
|
const paths = {
|
|
486
486
|
kind: "interf-execution-shell",
|
|
487
487
|
version: 1,
|
|
488
|
-
|
|
488
|
+
method: methodId,
|
|
489
489
|
stage: stage.id,
|
|
490
490
|
reads: mounts.reads,
|
|
491
491
|
writes: mounts.writes,
|
|
@@ -661,93 +661,97 @@ export function renderClaudeBootstrap(content) {
|
|
|
661
661
|
"",
|
|
662
662
|
].join("\n");
|
|
663
663
|
}
|
|
664
|
-
function
|
|
664
|
+
function renderMethodAuthoringAgents(options) {
|
|
665
665
|
return [
|
|
666
|
-
`# ${options.label} —
|
|
666
|
+
`# ${options.label} — Method Authoring Shell`,
|
|
667
667
|
"",
|
|
668
|
-
"This is an automated
|
|
669
|
-
"It exists to create one standalone
|
|
668
|
+
"This is an automated Method-authoring shell generated by Interf.",
|
|
669
|
+
"It exists to create one standalone Method package from the source data, desired portable-context outputs, and proof requirements in this task.",
|
|
670
670
|
"",
|
|
671
671
|
"## Start Here",
|
|
672
672
|
"",
|
|
673
673
|
"1. Read `runtime/authoring-context.json` now.",
|
|
674
|
-
`2. Read \`
|
|
675
|
-
"3. Review `artifacts/source-
|
|
676
|
-
"4. Use the local native `interf-
|
|
674
|
+
`2. Read \`method/README.md\`, \`method/method.json\`, and \`method/${METHOD_SCHEMA_FILE}\` now.`,
|
|
675
|
+
"3. Review `artifacts/source-folder/raw/`.",
|
|
676
|
+
"4. Use the local native `interf-method-author` skill now.",
|
|
677
677
|
"",
|
|
678
678
|
"## Boundaries",
|
|
679
679
|
"",
|
|
680
|
-
`- New
|
|
680
|
+
`- New Method package id: \`${options.methodId}\`.`,
|
|
681
681
|
"- Authoring mode: from scratch.",
|
|
682
|
-
...(options.
|
|
683
|
-
? [`- Reference
|
|
682
|
+
...(options.referenceMethodId
|
|
683
|
+
? [`- Reference Method package id: \`${options.referenceMethodId}\` (context only, not a seed).`]
|
|
684
684
|
: []),
|
|
685
|
-
"- Edit only files under `
|
|
685
|
+
"- Edit only files under `method/`.",
|
|
686
686
|
"- Do not edit source artifacts.",
|
|
687
|
-
"- Keep the
|
|
687
|
+
"- Keep the Method package valid for the current compiler API and `method.schema.json`.",
|
|
688
|
+
"- Use kebab-case ids everywhere: stage ids, skill_dir values, zone ids, reads/writes values, and package ids. Never use underscores.",
|
|
688
689
|
"- 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`.",
|
|
690
|
+
"- For file output zones that replace scaffold files, add `artifacts_must_not_contain` entries that reject `Not yet compiled.` placeholder text; its keys must be artifact paths like `home.md`, not zone ids like `home`.",
|
|
689
691
|
"- Prefer direct file-reading and search tools over shell commands for routine file inspection.",
|
|
690
692
|
"- Do not use shell helpers like `cat`, `sed`, `ls`, or `find` when a native read/search tool can inspect the same files.",
|
|
691
693
|
"",
|
|
692
694
|
"## Goal",
|
|
693
695
|
"",
|
|
694
|
-
"- produce one standalone
|
|
695
|
-
"- replace the neutral scaffold topology with the stage graph this work needs",
|
|
696
|
+
"- produce one standalone Method package tuned to the source data, desired outputs, and checks in this task",
|
|
697
|
+
"- replace the neutral scaffold topology with the stage graph this agent work needs",
|
|
696
698
|
"- define output zones and stage proof so Interf can show whether the data is ready",
|
|
697
699
|
"- preserve deterministic stage and context-interface contracts",
|
|
698
|
-
"- stop once the
|
|
700
|
+
"- stop once the Method edits are complete",
|
|
699
701
|
"",
|
|
700
702
|
].join("\n");
|
|
701
703
|
}
|
|
702
|
-
function
|
|
704
|
+
function renderMethodAuthoringSkill() {
|
|
703
705
|
return [
|
|
704
706
|
"---",
|
|
705
|
-
"name: interf-
|
|
707
|
+
"name: interf-method-author",
|
|
706
708
|
"description: >",
|
|
707
|
-
" Native local
|
|
709
|
+
" Native local Method-authoring skill for an automated Interf Method draft run.",
|
|
708
710
|
"---",
|
|
709
711
|
"",
|
|
710
|
-
"# Interf
|
|
712
|
+
"# Interf Method Authoring",
|
|
711
713
|
"",
|
|
712
714
|
"Read `runtime/authoring-context.json` first.",
|
|
713
|
-
"Then review the neutral
|
|
715
|
+
"Then review the neutral Method package scaffold under `method/` and the raw snapshot under `artifacts/source-folder/raw/`.",
|
|
714
716
|
"",
|
|
715
717
|
"Rules:",
|
|
716
|
-
"- edit only `
|
|
717
|
-
`- keep \`
|
|
718
|
+
"- edit only `method/`",
|
|
719
|
+
`- keep \`method.json\`, \`${METHOD_SCHEMA_FILE}\`, and any changed stage docs aligned`,
|
|
718
720
|
"- 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`",
|
|
721
|
+
"- for file output zones that replace scaffold files, add `artifacts_must_not_contain` entries that reject `Not yet compiled.` placeholder text; its keys must be artifact paths like `home.md`, not zone ids like `home`",
|
|
719
722
|
"- design the stage graph from the source data and preparation-and-evidence brief",
|
|
723
|
+
"- use kebab-case ids everywhere: stage ids, skill_dir values, zone ids, reads/writes values, and package ids; never use underscores",
|
|
720
724
|
"- replace the placeholder `prepare` stage unless that exact stage is truly the final method",
|
|
721
725
|
"- keep the package standalone; do not introduce runtime inheritance or hidden source-package assumptions",
|
|
722
|
-
"- do not introduce wikilinks unless the
|
|
726
|
+
"- do not introduce wikilinks unless the Method also creates the target note by exact basename or explicit relative path",
|
|
723
727
|
"- respect stage boundaries: do not make structure outputs link to notes or entrypoints first created by later stages",
|
|
724
728
|
"- prefer conservative routing changes over speculative note sprawl",
|
|
725
729
|
"- prefer direct file-reading and search tools over shell commands for routine file inspection",
|
|
726
730
|
"- do not use shell helpers like `cat`, `sed`, `ls`, or `find` when a native read/search tool can inspect the same files",
|
|
727
|
-
"- do not hardcode readiness-check answers into
|
|
731
|
+
"- do not hardcode readiness-check answers into Method docs",
|
|
728
732
|
"- do not edit source artifacts",
|
|
729
733
|
"",
|
|
730
734
|
].join("\n");
|
|
731
735
|
}
|
|
732
|
-
function
|
|
733
|
-
return join(
|
|
736
|
+
function improvementMethodDocsPath(compiledPath) {
|
|
737
|
+
return join(methodPackagePathForCompiled(compiledPath), "improve");
|
|
734
738
|
}
|
|
735
|
-
export function
|
|
736
|
-
const shellRoot = mkdtempSync(join(tmpdir(), `interf-
|
|
739
|
+
export function createMethodAuthoringShell(options) {
|
|
740
|
+
const shellRoot = mkdtempSync(join(tmpdir(), `interf-method-author-${options.methodId}-`));
|
|
737
741
|
mkdirSync(join(shellRoot, "runtime"), { recursive: true });
|
|
738
742
|
mkdirSync(join(shellRoot, "artifacts"), { recursive: true });
|
|
739
743
|
mkdirSync(join(shellRoot, "logs"), { recursive: true });
|
|
740
744
|
const context = {
|
|
741
|
-
kind: "interf-
|
|
745
|
+
kind: "interf-method-authoring",
|
|
742
746
|
version: 1,
|
|
743
747
|
generated_at: new Date().toISOString(),
|
|
744
748
|
authoring_mode: "from-scratch",
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
...(options.
|
|
749
|
+
method_id: options.methodId,
|
|
750
|
+
method_label: options.label,
|
|
751
|
+
...(options.referenceMethodId ? { reference_method_id: options.referenceMethodId } : {}),
|
|
748
752
|
task_prompt: options.taskPrompt,
|
|
749
|
-
|
|
750
|
-
|
|
753
|
+
preparation: {
|
|
754
|
+
source_folder_path: options.sourceFolderPath,
|
|
751
755
|
checks: {
|
|
752
756
|
count: options.checks.length,
|
|
753
757
|
questions: options.checks.map((check, index) => ({
|
|
@@ -759,86 +763,90 @@ export function createWorkflowAuthoringShell(options) {
|
|
|
759
763
|
};
|
|
760
764
|
writeFileSync(join(shellRoot, "runtime", "authoring-context.json"), `${JSON.stringify(context, null, 2)}\n`);
|
|
761
765
|
projectRawSnapshot({
|
|
762
|
-
sourcePath: options.
|
|
763
|
-
destinationPath: join(shellRoot, "artifacts", "source-
|
|
766
|
+
sourcePath: options.sourceFolderPath,
|
|
767
|
+
destinationPath: join(shellRoot, "artifacts", "source-folder", "raw"),
|
|
764
768
|
compiledPath: shellRoot,
|
|
765
769
|
mode: "copy",
|
|
766
770
|
prune: true,
|
|
767
771
|
preserveTimestamps: true,
|
|
768
772
|
});
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
773
|
+
copyResolvedTree({
|
|
774
|
+
sourcePath: options.methodPath,
|
|
775
|
+
targetPath: join(shellRoot, "method"),
|
|
776
|
+
shellType: "method-authoring",
|
|
777
|
+
});
|
|
778
|
+
writeNativeAgentSurface(shellRoot, renderMethodAuthoringAgents({
|
|
779
|
+
methodId: options.methodId,
|
|
772
780
|
label: options.label,
|
|
773
|
-
|
|
774
|
-
}), "interf-
|
|
781
|
+
referenceMethodId: options.referenceMethodId ?? null,
|
|
782
|
+
}), "interf-method-author", renderMethodAuthoringSkill());
|
|
775
783
|
return {
|
|
776
784
|
rootPath: shellRoot,
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
promptLogPath: join(shellRoot, "logs", "
|
|
780
|
-
eventLogPath: join(shellRoot, "logs", "
|
|
781
|
-
statusLogPath: join(shellRoot, "logs", "
|
|
785
|
+
methodBeforePath: join(shellRoot, "artifacts", "method-before"),
|
|
786
|
+
methodAfterPath: join(shellRoot, "artifacts", "method-after"),
|
|
787
|
+
promptLogPath: join(shellRoot, "logs", "method-author.prompt.txt"),
|
|
788
|
+
eventLogPath: join(shellRoot, "logs", "method-author.events.ndjson"),
|
|
789
|
+
statusLogPath: join(shellRoot, "logs", "method-author.status.log"),
|
|
782
790
|
};
|
|
783
791
|
}
|
|
784
|
-
function
|
|
792
|
+
function renderMethodImprovementAgents(compiledName, methodId, loopIndex) {
|
|
785
793
|
return [
|
|
786
|
-
`# ${compiledName} —
|
|
794
|
+
`# ${compiledName} — Method Improvement Shell`,
|
|
787
795
|
"",
|
|
788
|
-
"This is an automated
|
|
789
|
-
"It exists to review failed compile/test runs and edit the
|
|
796
|
+
"This is an automated Method-improvement shell generated by Interf.",
|
|
797
|
+
"It exists to review failed compile/test runs and edit the Method package for the next variation.",
|
|
790
798
|
"",
|
|
791
799
|
"## Start Here",
|
|
792
800
|
"",
|
|
793
801
|
"1. Read `runtime/loop-context.json` now.",
|
|
794
|
-
`2. Read \`
|
|
795
|
-
"3. Read `
|
|
796
|
-
"4. Use the local native `interf-
|
|
802
|
+
`2. Read \`method/README.md\`, \`method/method.json\`, and \`method/${METHOD_SCHEMA_FILE}\` now.`,
|
|
803
|
+
"3. Read `method/improve/SKILL.md` now.",
|
|
804
|
+
"4. Use the local native `interf-method-improver` skill now.",
|
|
797
805
|
"",
|
|
798
806
|
"## Boundaries",
|
|
799
807
|
"",
|
|
800
|
-
`-
|
|
808
|
+
`- Method: \`${methodId}\`.`,
|
|
801
809
|
`- Improvement loop: ${loopIndex}.`,
|
|
802
|
-
"- Edit only files under `
|
|
810
|
+
"- Edit only files under `method/`.",
|
|
803
811
|
"- Do not edit checks, test specs, raw files, or generated context outputs.",
|
|
804
812
|
"- Review context outputs under `artifacts/compiled-view/` and test/runtime evidence under `artifacts/`.",
|
|
805
|
-
"- Keep the
|
|
813
|
+
"- Keep the Method package valid for the current compiler API and `method.schema.json`.",
|
|
806
814
|
"- 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`.",
|
|
807
815
|
"",
|
|
808
816
|
"## Goal",
|
|
809
817
|
"",
|
|
810
|
-
"- create a better
|
|
811
|
-
"- preserve deterministic
|
|
812
|
-
"- stop after the
|
|
818
|
+
"- create a better Method variation for this kind of agent work",
|
|
819
|
+
"- preserve deterministic portable-context structure",
|
|
820
|
+
"- stop after the Method edits are complete",
|
|
813
821
|
"",
|
|
814
822
|
].join("\n");
|
|
815
823
|
}
|
|
816
|
-
function
|
|
817
|
-
const path = join(
|
|
824
|
+
function readMethodImprovementDoc(compiledPath) {
|
|
825
|
+
const path = join(improvementMethodDocsPath(compiledPath), "SKILL.md");
|
|
818
826
|
if (!existsSync(path))
|
|
819
827
|
return null;
|
|
820
828
|
return readFileSync(path, "utf8").trim();
|
|
821
829
|
}
|
|
822
|
-
function
|
|
830
|
+
function renderMethodImprovementSkill(methodId, loopIndex, improvementDoc) {
|
|
823
831
|
return [
|
|
824
832
|
"---",
|
|
825
|
-
"name: interf-
|
|
833
|
+
"name: interf-method-improver",
|
|
826
834
|
"description: >",
|
|
827
|
-
" Native local
|
|
828
|
-
" Use it only inside an automated
|
|
835
|
+
" Native local Method-improvement skill for this Interf run.",
|
|
836
|
+
" Use it only inside an automated Method-improvement shell.",
|
|
829
837
|
"---",
|
|
830
838
|
"",
|
|
831
|
-
`# Interf
|
|
839
|
+
`# Interf Method Improvement — ${methodId}`,
|
|
832
840
|
"",
|
|
833
|
-
"This local native skill exists for automated
|
|
841
|
+
"This local native skill exists for automated Method-improvement loops.",
|
|
834
842
|
"Read `runtime/loop-context.json` first.",
|
|
835
|
-
"Then review the linked
|
|
843
|
+
"Then review the linked Method package, `artifacts/compiled-view/`, preserved stage shells, runtime logs, and saved test outputs before editing `method/`.",
|
|
836
844
|
"",
|
|
837
845
|
"## Current Loop",
|
|
838
846
|
"",
|
|
839
|
-
`-
|
|
847
|
+
`- method: \`${methodId}\``,
|
|
840
848
|
`- loop index: ${loopIndex}`,
|
|
841
|
-
"- editable source: `
|
|
849
|
+
"- editable source: `method/improve/SKILL.md`",
|
|
842
850
|
"",
|
|
843
851
|
...(improvementDoc
|
|
844
852
|
? [
|
|
@@ -862,15 +870,10 @@ function projectCompiledReviewArtifactsSnapshot(compiledPath, shellRoot, schema)
|
|
|
862
870
|
copyResolvedTree({
|
|
863
871
|
sourcePath,
|
|
864
872
|
targetPath: join(compiledViewRoot, zone.path),
|
|
865
|
-
shellType: "
|
|
873
|
+
shellType: "method-improvement",
|
|
866
874
|
});
|
|
867
875
|
}
|
|
868
876
|
}
|
|
869
|
-
function linkIfExists(targetPath, linkPathname) {
|
|
870
|
-
if (!existsSync(targetPath))
|
|
871
|
-
return;
|
|
872
|
-
linkPath(targetPath, linkPathname);
|
|
873
|
-
}
|
|
874
877
|
function copyIfExists(sourcePath, targetPath, shellType) {
|
|
875
878
|
if (!existsSync(sourcePath))
|
|
876
879
|
return;
|
|
@@ -894,21 +897,21 @@ function projectCompiledRuntimeArtifacts(compiledPath, shellRoot) {
|
|
|
894
897
|
"logs",
|
|
895
898
|
];
|
|
896
899
|
for (const artifactName of artifactNames) {
|
|
897
|
-
copyIfExists(join(runtimeRoot, artifactName), join(runtimeTarget, artifactName), "
|
|
900
|
+
copyIfExists(join(runtimeRoot, artifactName), join(runtimeTarget, artifactName), "method-improvement");
|
|
898
901
|
}
|
|
899
902
|
}
|
|
900
903
|
export function pruneStageExecutionShells(compiledPath) {
|
|
901
904
|
rmSync(stageExecutionShellsRoot(compiledPath), { recursive: true, force: true });
|
|
902
905
|
}
|
|
903
|
-
export function projectCompiledQueryShell(compiledPath, compiledName,
|
|
904
|
-
const agentsContent = renderCompiledAgents(compiledPath, compiledName,
|
|
906
|
+
export function projectCompiledQueryShell(compiledPath, compiledName, methodId, about, options) {
|
|
907
|
+
const agentsContent = renderCompiledAgents(compiledPath, compiledName, methodId, about, options);
|
|
905
908
|
const querySkillContent = readCompiledQuerySkillSource(compiledPath);
|
|
906
909
|
return writeNativeAgentSurface(compiledPath, agentsContent, "interf-query", renderCompiledQueryNativeSkill(querySkillContent));
|
|
907
910
|
}
|
|
908
911
|
export function projectRawTestQueryShell(rootPath) {
|
|
909
912
|
return writeNativeAgentSurface(rootPath, renderRawTestAgents(), "interf-query", renderRawTestQuerySkill());
|
|
910
913
|
}
|
|
911
|
-
export function createStageExecutionShell(compiledPath, compiledName,
|
|
914
|
+
export function createStageExecutionShell(compiledPath, compiledName, methodId, stage, writeArtifacts = []) {
|
|
912
915
|
const schema = ensureCompiledExecutionSurface(compiledPath);
|
|
913
916
|
const materializedZones = stageMaterializedZoneSet(schema, stage, writeArtifacts);
|
|
914
917
|
const shellsRoot = stageExecutionShellsRoot(compiledPath);
|
|
@@ -920,10 +923,10 @@ export function createStageExecutionShell(compiledPath, compiledName, workflowId
|
|
|
920
923
|
linkPath(compiledInterfConfigPath(compiledPath), join(shellRoot, "interf.json"));
|
|
921
924
|
linkPath(join(compiledRuntimeRoot(compiledPath), "stage-contract.json"), shellRuntimePath(shellRoot, "stage-contract.json"));
|
|
922
925
|
projectCompiledSchemaZones(compiledPath, shellRoot, schema, new Set([...stage.reads, ...stage.writes]), materializedZones);
|
|
923
|
-
|
|
926
|
+
projectMethodMetadata(compiledPath, shellRoot, stage);
|
|
924
927
|
projectStageZoneMountAliases(shellRoot, stage, schema);
|
|
925
|
-
writeExecutionShellPathsFile(shellRoot,
|
|
926
|
-
const agentsContent = renderStageExecutionAgents(compiledName,
|
|
928
|
+
writeExecutionShellPathsFile(shellRoot, methodId, stage, buildStageZoneMounts(compiledPath, shellRoot, stage, schema));
|
|
929
|
+
const agentsContent = renderStageExecutionAgents(compiledName, methodId, stage);
|
|
927
930
|
writeNativeAgentSurface(shellRoot, agentsContent, "interf-stage", renderStageExecutionSkill(stage, readStageMethodDoc(compiledPath, stage)));
|
|
928
931
|
return {
|
|
929
932
|
rootPath: shellRoot,
|
|
@@ -932,9 +935,9 @@ export function createStageExecutionShell(compiledPath, compiledName, workflowId
|
|
|
932
935
|
export function freezeStageExecutionShell(rootPath) {
|
|
933
936
|
return freezePreservedShell(rootPath, "stage-execution");
|
|
934
937
|
}
|
|
935
|
-
export function
|
|
938
|
+
export function createMethodImprovementShell(options) {
|
|
936
939
|
const schema = ensureCompiledExecutionSurface(options.compiledPath);
|
|
937
|
-
const loopRootPath =
|
|
940
|
+
const loopRootPath = methodImprovementLoopRoot(options.compiledPath, options.runId, options.loopIndex);
|
|
938
941
|
const shellRoot = join(loopRootPath, "shell");
|
|
939
942
|
mkdirSync(shellRoot, { recursive: true });
|
|
940
943
|
mkdirSync(join(shellRoot, "runtime"), { recursive: true });
|
|
@@ -942,34 +945,38 @@ export function createWorkflowImprovementShell(options) {
|
|
|
942
945
|
mkdirSync(join(loopRootPath, "logs"), { recursive: true });
|
|
943
946
|
writeFileSync(join(shellRoot, "runtime", "loop-context.json"), `${JSON.stringify(options.context, null, 2)}\n`);
|
|
944
947
|
projectCompiledReviewArtifactsSnapshot(options.compiledPath, shellRoot, schema);
|
|
945
|
-
|
|
946
|
-
|
|
948
|
+
copyResolvedTree({
|
|
949
|
+
sourcePath: methodPackagePathForCompiled(options.compiledPath),
|
|
950
|
+
targetPath: join(shellRoot, "method"),
|
|
951
|
+
shellType: "method-improvement",
|
|
952
|
+
});
|
|
953
|
+
copyIfExists(compiledInterfConfigPath(options.compiledPath), join(shellRoot, "interf.json"), "method-improvement");
|
|
947
954
|
projectCompiledRuntimeArtifacts(options.compiledPath, shellRoot);
|
|
948
|
-
const reviewSources =
|
|
955
|
+
const reviewSources = resolveMethodImprovementReviewSourcePaths(options.compiledPath);
|
|
949
956
|
if (reviewSources.executionShells) {
|
|
950
|
-
copyIfExists(reviewSources.executionShells, join(shellRoot, "artifacts", "execution-shells"), "
|
|
957
|
+
copyIfExists(reviewSources.executionShells, join(shellRoot, "artifacts", "execution-shells"), "method-improvement");
|
|
951
958
|
}
|
|
952
959
|
if (reviewSources.testComparisons) {
|
|
953
|
-
copyIfExists(reviewSources.testComparisons, join(shellRoot, "artifacts", "test-comparisons"), "
|
|
960
|
+
copyIfExists(reviewSources.testComparisons, join(shellRoot, "artifacts", "test-comparisons"), "method-improvement");
|
|
954
961
|
}
|
|
955
962
|
if (reviewSources.targetTestRuns) {
|
|
956
|
-
copyIfExists(reviewSources.targetTestRuns, join(shellRoot, "artifacts", "test-runs"), "
|
|
963
|
+
copyIfExists(reviewSources.targetTestRuns, join(shellRoot, "artifacts", "test-runs"), "method-improvement");
|
|
957
964
|
}
|
|
958
965
|
if (reviewSources.targetTestSandboxes) {
|
|
959
|
-
copyIfExists(reviewSources.targetTestSandboxes, join(shellRoot, "artifacts", "test-sandboxes"), "
|
|
966
|
+
copyIfExists(reviewSources.targetTestSandboxes, join(shellRoot, "artifacts", "test-sandboxes"), "method-improvement");
|
|
960
967
|
}
|
|
961
|
-
const agentsContent =
|
|
962
|
-
writeNativeAgentSurface(shellRoot, agentsContent, "interf-
|
|
968
|
+
const agentsContent = renderMethodImprovementAgents(options.compiledName, options.methodId, options.loopIndex);
|
|
969
|
+
writeNativeAgentSurface(shellRoot, agentsContent, "interf-method-improver", renderMethodImprovementSkill(options.methodId, options.loopIndex, readMethodImprovementDoc(options.compiledPath)));
|
|
963
970
|
return {
|
|
964
971
|
rootPath: shellRoot,
|
|
965
972
|
loopRootPath,
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
promptLogPath: join(loopRootPath, "logs", "
|
|
969
|
-
eventLogPath: join(loopRootPath, "logs", "
|
|
970
|
-
statusLogPath: join(loopRootPath, "logs", "
|
|
973
|
+
methodBeforePath: join(loopRootPath, "method-before"),
|
|
974
|
+
methodAfterPath: join(loopRootPath, "method-after"),
|
|
975
|
+
promptLogPath: join(loopRootPath, "logs", "method-improver.prompt.txt"),
|
|
976
|
+
eventLogPath: join(loopRootPath, "logs", "method-improver.events.ndjson"),
|
|
977
|
+
statusLogPath: join(loopRootPath, "logs", "method-improver.status.log"),
|
|
971
978
|
};
|
|
972
979
|
}
|
|
973
|
-
export function
|
|
974
|
-
return freezePreservedShell(rootPath, "
|
|
980
|
+
export function freezeMethodImprovementShell(rootPath) {
|
|
981
|
+
return freezePreservedShell(rootPath, "method-improvement");
|
|
975
982
|
}
|