@interf/compiler 0.21.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/build-plan.d.ts +2 -0
- package/dist/cli/commands/{method.js → build-plan.js} +89 -72
- package/dist/cli/commands/{compile.d.ts → build.d.ts} +2 -2
- package/dist/cli/commands/{compile.js → build.js} +18 -18
- package/dist/cli/commands/doctor.js +2 -2
- package/dist/cli/commands/mcp.js +48 -48
- package/dist/cli/commands/prep.js +16 -29
- package/dist/cli/commands/reset.d.ts +1 -1
- package/dist/cli/commands/reset.js +6 -6
- package/dist/cli/commands/runs.js +6 -28
- package/dist/cli/commands/status.js +1 -1
- package/dist/cli/commands/test.d.ts +1 -1
- package/dist/cli/commands/test.js +8 -8
- package/dist/cli/commands/web.js +3 -3
- package/dist/cli/commands/wizard.js +38 -38
- package/dist/cli/index.d.ts +3 -3
- package/dist/cli/index.js +5 -5
- package/dist/interf-ui/404.html +1 -0
- package/dist/interf-ui/__next.__PAGE__.txt +10 -0
- package/dist/interf-ui/__next._full.txt +20 -0
- package/dist/interf-ui/__next._head.txt +5 -0
- package/dist/interf-ui/__next._index.txt +5 -0
- package/dist/{compiler-ui → interf-ui}/__next._tree.txt +3 -4
- package/dist/interf-ui/_next/static/chunks/0.tjb6f4golw..css +3 -0
- package/dist/interf-ui/_next/static/chunks/085-n_jv2ng_q.css +1 -0
- package/dist/interf-ui/_next/static/chunks/0dn41fa_zvgsl.js +1 -0
- package/dist/interf-ui/_next/static/chunks/0g-ea0zj5d-0k.js +1 -0
- package/dist/interf-ui/_next/static/chunks/0gwqglc4iz583.js +1 -0
- package/dist/interf-ui/_next/static/chunks/0haldgm65ve6l.js +1 -0
- package/dist/interf-ui/_next/static/chunks/0nv3am99vjzn4.js +1 -0
- package/dist/{compiler-ui/_next/static/chunks/02f_.8.ebn556.js → interf-ui/_next/static/chunks/0s77gt_o4jwtx.js} +1 -1
- package/dist/interf-ui/_next/static/chunks/0~a36ujuzpaz..js +116 -0
- package/dist/interf-ui/_next/static/chunks/10jeodxe4nkgj.js +31 -0
- package/dist/interf-ui/_next/static/chunks/119h2rouych2t.js +1 -0
- package/dist/interf-ui/_next/static/chunks/13c8b~m8knjsf.js +1 -0
- package/dist/interf-ui/_next/static/chunks/14dznb2qpt-ho.js +91 -0
- package/dist/interf-ui/_next/static/chunks/15z_en80lrq-3.js +5 -0
- package/dist/{compiler-ui/_next/static/chunks/turbopack-0apv8vb-nczuy.js → interf-ui/_next/static/chunks/turbopack-0p.pvcjrtq-jh.js} +1 -1
- package/dist/interf-ui/_next/static/chunks/turbopack-0usj_75.8frlw.js +1 -0
- package/dist/interf-ui/_not-found/__next._full.txt +15 -0
- package/dist/interf-ui/_not-found/__next._head.txt +5 -0
- package/dist/interf-ui/_not-found/__next._index.txt +5 -0
- package/dist/{compiler-ui → interf-ui}/_not-found/__next._not-found.__PAGE__.txt +2 -2
- package/dist/interf-ui/_not-found/__next._not-found.txt +5 -0
- package/dist/{compiler-ui → interf-ui}/_not-found/__next._tree.txt +2 -3
- package/dist/interf-ui/_not-found.html +1 -0
- package/dist/interf-ui/_not-found.txt +15 -0
- package/dist/interf-ui/index.html +1 -0
- package/dist/interf-ui/index.txt +20 -0
- package/dist/packages/build-plans/authoring/build-plan-authoring.d.ts +36 -0
- package/dist/packages/{methods/authoring/method-authoring.js → build-plans/authoring/build-plan-authoring.js} +52 -52
- package/dist/packages/build-plans/authoring/build-plan-edit-session.d.ts +18 -0
- package/dist/packages/{methods/authoring/method-edit-session.js → build-plans/authoring/build-plan-edit-session.js} +34 -34
- package/dist/packages/build-plans/authoring/build-plan-improvement.d.ts +23 -0
- package/dist/packages/build-plans/authoring/build-plan-improvement.js +216 -0
- package/dist/packages/build-plans/authoring/index.d.ts +4 -0
- package/dist/packages/build-plans/authoring/index.js +4 -0
- package/dist/packages/{methods/authoring/lib/method-edit-utils.d.ts → build-plans/authoring/lib/build-plan-edit-utils.d.ts} +3 -3
- package/dist/packages/build-plans/build-plan-resolution.d.ts +6 -0
- package/dist/packages/build-plans/build-plan-resolution.js +7 -0
- package/dist/packages/build-plans/index.d.ts +2 -0
- package/dist/packages/build-plans/index.js +2 -0
- package/dist/packages/build-plans/package/build-plan-definitions.d.ts +61 -0
- package/dist/packages/build-plans/package/build-plan-definitions.js +214 -0
- package/dist/packages/{methods/package/method-helpers.d.ts → build-plans/package/build-plan-helpers.d.ts} +7 -7
- package/dist/packages/{methods/package/method-helpers.js → build-plans/package/build-plan-helpers.js} +20 -20
- package/dist/packages/build-plans/package/build-plan-review-paths.d.ts +10 -0
- package/dist/packages/build-plans/package/build-plan-review-paths.js +31 -0
- package/dist/packages/{methods/package/method-stage-runner.d.ts → build-plans/package/build-plan-stage-runner.d.ts} +12 -12
- package/dist/packages/{methods/package/method-stage-runner.js → build-plans/package/build-plan-stage-runner.js} +10 -10
- package/dist/packages/build-plans/package/builtin-build-plan.d.ts +37 -0
- package/dist/packages/build-plans/package/builtin-build-plan.js +91 -0
- package/dist/packages/{methods → build-plans}/package/context-interface.d.ts +11 -11
- package/dist/packages/{methods → build-plans}/package/context-interface.js +23 -23
- package/dist/packages/build-plans/package/interf-build-plan-package.d.ts +31 -0
- package/dist/packages/build-plans/package/interf-build-plan-package.js +466 -0
- package/dist/packages/{methods → build-plans}/package/lib/package-root.js +1 -1
- package/dist/packages/build-plans/package/local-build-plans.d.ts +74 -0
- package/dist/packages/{methods/package/local-methods.js → build-plans/package/local-build-plans.js} +152 -152
- package/dist/packages/build-plans/package/user-build-plans.d.ts +17 -0
- package/dist/packages/build-plans/package/user-build-plans.js +77 -0
- package/dist/packages/contracts/index.d.ts +1 -1
- package/dist/packages/contracts/lib/preparation-paths.d.ts +37 -37
- package/dist/packages/contracts/lib/preparation-paths.js +43 -43
- package/dist/packages/contracts/lib/schema.d.ts +34 -41
- package/dist/packages/contracts/lib/schema.js +42 -34
- package/dist/packages/engine/action-definitions.d.ts +60 -60
- package/dist/packages/engine/action-definitions.js +198 -197
- package/dist/packages/engine/action-planner.d.ts +2 -2
- package/dist/packages/engine/action-planner.js +5 -5
- package/dist/packages/engine/action-values.d.ts +1 -1
- package/dist/packages/engine/action-values.js +1 -1
- package/dist/packages/engine/agents/index.d.ts +2 -2
- package/dist/packages/engine/agents/index.js +1 -1
- package/dist/packages/engine/agents/lib/args.d.ts +2 -2
- package/dist/packages/engine/agents/lib/args.js +1 -1
- package/dist/packages/engine/agents/lib/constants.js +1 -1
- package/dist/packages/engine/agents/lib/execution-profile.d.ts +5 -5
- package/dist/packages/engine/agents/lib/execution-profile.js +3 -3
- package/dist/packages/engine/agents/lib/executors.d.ts +11 -11
- package/dist/packages/engine/agents/lib/render.js +4 -4
- package/dist/packages/engine/agents/lib/shells.d.ts +30 -30
- package/dist/packages/engine/agents/lib/shells.js +248 -248
- package/dist/packages/engine/agents/lib/types.d.ts +2 -2
- package/dist/packages/engine/agents/lib/verifiable-context-bootstrap.d.ts +3 -0
- package/dist/packages/engine/agents/lib/verifiable-context-bootstrap.js +19 -0
- package/dist/packages/engine/agents/role-executors.d.ts +7 -7
- package/dist/packages/engine/agents/role-executors.js +2 -2
- package/dist/packages/engine/agents/role-router.d.ts +2 -2
- package/dist/packages/engine/agents/role-router.js +1 -1
- package/dist/packages/engine/build/artifact-counts.d.ts +1 -0
- package/dist/packages/engine/{compile → build}/artifact-counts.js +7 -7
- package/dist/packages/engine/{compile → build}/artifact-status.d.ts +8 -8
- package/dist/packages/engine/{compile → build}/artifact-status.js +19 -19
- package/dist/packages/engine/{compile → build}/billing-events.d.ts +4 -4
- package/dist/packages/engine/{compile → build}/billing-events.js +4 -4
- package/dist/packages/engine/build/build-execution.d.ts +4 -0
- package/dist/packages/engine/build/build-execution.js +4 -0
- package/dist/packages/engine/build/build-pipeline.d.ts +56 -0
- package/dist/packages/engine/{compile/compiled-pipeline.js → build/build-pipeline.js} +55 -55
- package/dist/packages/engine/build/build-plan-primitives.d.ts +2 -0
- package/dist/packages/engine/{compile/method-primitives.js → build/build-plan-primitives.js} +1 -1
- package/dist/packages/engine/build/build-plan-runs.d.ts +14 -0
- package/dist/packages/engine/build/build-plan-runs.js +31 -0
- package/dist/packages/engine/build/build-stage-plan.d.ts +16 -0
- package/dist/packages/engine/build/build-stage-plan.js +100 -0
- package/dist/packages/engine/build/build-stage-runner.d.ts +15 -0
- package/dist/packages/engine/{compile/compiled-stage-runner.js → build/build-stage-runner.js} +21 -21
- package/dist/packages/engine/build/build-target.d.ts +11 -0
- package/dist/packages/engine/build/build-target.js +16 -0
- package/dist/packages/engine/{compile → build}/check-evaluator.d.ts +4 -4
- package/dist/packages/engine/{compile → build}/check-evaluator.js +1 -1
- package/dist/packages/engine/{compile → build}/discovery.d.ts +2 -2
- package/dist/packages/engine/{compile → build}/discovery.js +4 -4
- package/dist/packages/engine/{compile → build}/index.d.ts +6 -6
- package/dist/packages/engine/{compile → build}/index.js +5 -5
- package/dist/packages/engine/{compile → build}/lib/schema.d.ts +79 -79
- package/dist/packages/engine/{compile → build}/lib/schema.js +71 -71
- package/dist/packages/engine/build/reset.d.ts +2 -0
- package/dist/packages/engine/build/reset.js +74 -0
- package/dist/packages/engine/{compile → build}/runtime-contracts.js +8 -8
- package/dist/packages/engine/build/runtime-inventory.d.ts +7 -0
- package/dist/packages/engine/{compile → build}/runtime-inventory.js +8 -8
- package/dist/packages/engine/{compile → build}/runtime-paths.js +6 -6
- package/dist/packages/engine/{compile → build}/runtime-prompt.js +11 -11
- package/dist/packages/engine/build/runtime-reconcile.d.ts +2 -0
- package/dist/packages/engine/{compile → build}/runtime-reconcile.js +18 -18
- package/dist/packages/engine/{compile → build}/runtime-runs.js +27 -27
- package/dist/packages/engine/{compile → build}/runtime-types.d.ts +10 -10
- package/dist/packages/engine/build/source-files.d.ts +46 -0
- package/dist/packages/engine/{compile → build}/source-files.js +32 -32
- package/dist/packages/engine/build/state-artifacts.d.ts +9 -0
- package/dist/packages/engine/build/state-artifacts.js +14 -0
- package/dist/packages/engine/build/state-health.d.ts +4 -0
- package/dist/packages/engine/{compile → build}/state-health.js +40 -40
- package/dist/packages/engine/build/state-io.d.ts +11 -0
- package/dist/packages/engine/{compile → build}/state-io.js +22 -22
- package/dist/packages/engine/build/state-paths.js +16 -0
- package/dist/packages/engine/build/state-view.d.ts +5 -0
- package/dist/packages/engine/{compile → build}/state-view.js +29 -29
- package/dist/packages/engine/build/state.d.ts +7 -0
- package/dist/packages/engine/build/state.js +12 -0
- package/dist/packages/engine/build/validate-verifiable-context.d.ts +27 -0
- package/dist/packages/engine/{compile/validate-compiled.js → build/validate-verifiable-context.js} +73 -73
- package/dist/packages/engine/{compile → build}/validate.d.ts +4 -4
- package/dist/packages/engine/{compile → build}/validate.js +27 -27
- package/dist/packages/engine/build/verifiable-context-paths.d.ts +47 -0
- package/dist/packages/engine/build/verifiable-context-paths.js +121 -0
- package/dist/packages/engine/build/verifiable-context-schema.d.ts +21 -0
- package/dist/packages/engine/build/verifiable-context-schema.js +126 -0
- package/dist/packages/engine/client.d.ts +16 -16
- package/dist/packages/engine/client.js +21 -21
- package/dist/packages/engine/cloud-seams.d.ts +3 -3
- package/dist/packages/engine/execution/index.d.ts +2 -2
- package/dist/packages/engine/execution/index.js +1 -1
- package/dist/packages/engine/execution/lib/schema.d.ts +90 -95
- package/dist/packages/engine/execution/lib/schema.js +31 -31
- package/dist/packages/engine/index.d.ts +7 -7
- package/dist/packages/engine/index.js +3 -3
- package/dist/packages/engine/instance-paths.d.ts +39 -39
- package/dist/packages/engine/instance-paths.js +48 -48
- package/dist/packages/engine/lib/schema.d.ts +900 -472
- package/dist/packages/engine/lib/schema.js +137 -153
- package/dist/packages/engine/native-run-handlers.d.ts +12 -12
- package/dist/packages/engine/native-run-handlers.js +135 -135
- package/dist/packages/engine/preparation-store.d.ts +22 -23
- package/dist/packages/engine/preparation-store.js +30 -31
- package/dist/packages/engine/readiness-check-draft.d.ts +2 -2
- package/dist/packages/engine/readiness-check-draft.js +1 -1
- package/dist/packages/engine/requested-artifacts.d.ts +2 -2
- package/dist/packages/engine/routes.d.ts +18 -17
- package/dist/packages/engine/routes.js +20 -19
- package/dist/packages/engine/run-observability.d.ts +5 -3
- package/dist/packages/engine/run-observability.js +101 -89
- package/dist/packages/engine/runtime-caches.d.ts +16 -16
- package/dist/packages/engine/runtime-caches.js +26 -26
- package/dist/packages/engine/runtime-event-applier.d.ts +2 -2
- package/dist/packages/engine/runtime-event-applier.js +1 -1
- package/dist/packages/engine/runtime-persistence.d.ts +9 -9
- package/dist/packages/engine/runtime-persistence.js +16 -16
- package/dist/packages/engine/runtime-proposal-helpers.d.ts +14 -14
- package/dist/packages/engine/runtime-proposal-helpers.js +78 -80
- package/dist/packages/engine/runtime-resource-builders.d.ts +12 -12
- package/dist/packages/engine/runtime-resource-builders.js +19 -19
- package/dist/packages/engine/runtime.d.ts +52 -61
- package/dist/packages/engine/runtime.js +440 -463
- package/dist/packages/engine/server.d.ts +2 -2
- package/dist/packages/engine/server.js +147 -116
- package/dist/packages/engine/service-registry.d.ts +5 -17
- package/dist/packages/engine/service-registry.js +5 -20
- package/dist/packages/engine/verify/lib/schema.d.ts +19 -19
- package/dist/packages/engine/verify/lib/schema.js +36 -8
- package/dist/packages/engine/verify/readiness-check-run.d.ts +15 -16
- package/dist/packages/engine/verify/readiness-check-run.js +46 -46
- package/dist/packages/engine/verify/verify-execution.d.ts +3 -3
- package/dist/packages/engine/verify/verify-execution.js +10 -10
- package/dist/packages/engine/verify/verify-paths.d.ts +4 -4
- package/dist/packages/engine/verify/verify-paths.js +17 -17
- package/dist/packages/engine/verify/verify-sandbox.d.ts +1 -1
- package/dist/packages/engine/verify/verify-sandbox.js +26 -26
- package/dist/packages/engine/verify/verify-targets.d.ts +2 -2
- package/dist/packages/engine/verify/verify-targets.js +17 -17
- package/dist/packages/engine/verify/verify-types.d.ts +2 -2
- package/dist/packages/engine/verify/verify.d.ts +1 -1
- package/dist/packages/engine/verify/verify.js +1 -1
- package/dist/packages/engine/wire-schemas.d.ts +38 -40
- package/dist/packages/engine/wire-schemas.js +13 -13
- package/dist/packages/project/index.d.ts +1 -1
- package/dist/packages/project/interf-bootstrap.d.ts +1 -1
- package/dist/packages/project/interf-bootstrap.js +1 -1
- package/dist/packages/project/interf-detect.d.ts +11 -11
- package/dist/packages/project/interf-detect.js +30 -30
- package/dist/packages/project/interf-scaffold.d.ts +3 -3
- package/dist/packages/project/interf-scaffold.js +72 -72
- package/dist/packages/project/interf.d.ts +4 -4
- package/dist/packages/project/interf.js +3 -3
- package/dist/packages/project/lib/schema.d.ts +12 -12
- package/dist/packages/project/lib/schema.js +14 -14
- package/dist/packages/project/preparation-entries.d.ts +3 -3
- package/dist/packages/project/preparation-entries.js +19 -19
- package/dist/packages/project/source-config.d.ts +10 -10
- package/dist/packages/project/source-config.js +58 -58
- package/package.json +12 -14
- package/public-repo/CONTRIBUTING.md +12 -12
- package/public-repo/README.md +65 -63
- package/public-repo/SECURITY.md +3 -3
- package/public-repo/build-plans/interf-default/README.md +33 -0
- package/public-repo/{methods/interf-default/compile → build-plans/interf-default/build}/stages/shape/SKILL.md +10 -10
- package/public-repo/{methods/interf-default/compile → build-plans/interf-default/build}/stages/structure/SKILL.md +2 -2
- package/public-repo/{methods/interf-default/compile → build-plans/interf-default/build}/stages/summarize/SKILL.md +1 -1
- package/public-repo/{methods/interf-default/method.json → build-plans/interf-default/build-plan.json} +15 -15
- package/public-repo/{methods/interf-default/method.schema.json → build-plans/interf-default/build-plan.schema.json} +4 -4
- package/public-repo/build-plans/interf-default/improve/SKILL.md +18 -0
- package/public-repo/{methods → build-plans}/interf-default/use/query/SKILL.md +6 -6
- package/public-repo/plugins/README.md +1 -1
- package/public-repo/plugins/interf/.claude-plugin/plugin.json +3 -3
- package/public-repo/plugins/interf/README.md +4 -1
- package/public-repo/plugins/interf/skills/interf/SKILL.md +189 -290
- package/public-repo/skills/interf/SKILL.md +189 -290
- package/LICENSE.md +0 -1
- package/README.md +0 -325
- package/TRADEMARKS.md +0 -8
- package/dist/cli/commands/method.d.ts +0 -2
- package/dist/compiler-ui/404.html +0 -1
- package/dist/compiler-ui/__next.__PAGE__.txt +0 -10
- package/dist/compiler-ui/__next._full.txt +0 -21
- package/dist/compiler-ui/__next._head.txt +0 -5
- package/dist/compiler-ui/__next._index.txt +0 -6
- package/dist/compiler-ui/_next/static/chunks/01646j7yi.w5a.css +0 -1
- package/dist/compiler-ui/_next/static/chunks/02r7siaw-_p5w.js +0 -1
- package/dist/compiler-ui/_next/static/chunks/04d0ly-7xb~-j.js +0 -91
- package/dist/compiler-ui/_next/static/chunks/0fhs9psnxqd8s.js +0 -1
- package/dist/compiler-ui/_next/static/chunks/0mssmhpbifj15.css +0 -2
- package/dist/compiler-ui/_next/static/chunks/0nypu~ddwxari.js +0 -116
- package/dist/compiler-ui/_next/static/chunks/0p3s8iyhgcww2.js +0 -31
- package/dist/compiler-ui/_next/static/chunks/0tjf-vu_rz8s0.css +0 -1
- package/dist/compiler-ui/_next/static/chunks/0u6p3fpbbfgtl.js +0 -1
- package/dist/compiler-ui/_next/static/chunks/0wpx5..8dnh0w.js +0 -1
- package/dist/compiler-ui/_next/static/chunks/0y0uj160p0ts~.js +0 -1
- package/dist/compiler-ui/_next/static/chunks/10t8l~_oenf.c.js +0 -1
- package/dist/compiler-ui/_next/static/chunks/13gz9e7z~imx1.js +0 -5
- package/dist/compiler-ui/_next/static/chunks/156xed-b6czaw.js +0 -1
- package/dist/compiler-ui/_next/static/chunks/turbopack-02-3e_c-yz~5g.js +0 -1
- package/dist/compiler-ui/_not-found/__next._full.txt +0 -16
- package/dist/compiler-ui/_not-found/__next._head.txt +0 -5
- package/dist/compiler-ui/_not-found/__next._index.txt +0 -6
- package/dist/compiler-ui/_not-found/__next._not-found.txt +0 -5
- package/dist/compiler-ui/_not-found.html +0 -1
- package/dist/compiler-ui/_not-found.txt +0 -16
- package/dist/compiler-ui/index.html +0 -1
- package/dist/compiler-ui/index.txt +0 -21
- package/dist/packages/engine/agents/lib/compiled-bootstrap.d.ts +0 -3
- package/dist/packages/engine/agents/lib/compiled-bootstrap.js +0 -19
- package/dist/packages/engine/compile/artifact-counts.d.ts +0 -1
- package/dist/packages/engine/compile/compiled-compile.d.ts +0 -4
- package/dist/packages/engine/compile/compiled-compile.js +0 -4
- package/dist/packages/engine/compile/compiled-paths.d.ts +0 -47
- package/dist/packages/engine/compile/compiled-paths.js +0 -121
- package/dist/packages/engine/compile/compiled-pipeline.d.ts +0 -56
- package/dist/packages/engine/compile/compiled-schema.d.ts +0 -21
- package/dist/packages/engine/compile/compiled-schema.js +0 -126
- package/dist/packages/engine/compile/compiled-stage-plan.d.ts +0 -16
- package/dist/packages/engine/compile/compiled-stage-plan.js +0 -100
- package/dist/packages/engine/compile/compiled-stage-runner.d.ts +0 -15
- package/dist/packages/engine/compile/compiled-target.d.ts +0 -11
- package/dist/packages/engine/compile/compiled-target.js +0 -16
- package/dist/packages/engine/compile/method-primitives.d.ts +0 -2
- package/dist/packages/engine/compile/method-runs.d.ts +0 -14
- package/dist/packages/engine/compile/method-runs.js +0 -31
- package/dist/packages/engine/compile/reset.d.ts +0 -2
- package/dist/packages/engine/compile/reset.js +0 -74
- package/dist/packages/engine/compile/runtime-inventory.d.ts +0 -7
- package/dist/packages/engine/compile/runtime-reconcile.d.ts +0 -2
- package/dist/packages/engine/compile/source-files.d.ts +0 -46
- package/dist/packages/engine/compile/state-artifacts.d.ts +0 -9
- package/dist/packages/engine/compile/state-artifacts.js +0 -14
- package/dist/packages/engine/compile/state-health.d.ts +0 -4
- package/dist/packages/engine/compile/state-io.d.ts +0 -11
- package/dist/packages/engine/compile/state-paths.js +0 -16
- package/dist/packages/engine/compile/state-view.d.ts +0 -5
- package/dist/packages/engine/compile/state.d.ts +0 -7
- package/dist/packages/engine/compile/state.js +0 -12
- package/dist/packages/engine/compile/validate-compiled.d.ts +0 -27
- package/dist/packages/methods/authoring/index.d.ts +0 -4
- package/dist/packages/methods/authoring/index.js +0 -4
- package/dist/packages/methods/authoring/method-authoring.d.ts +0 -36
- package/dist/packages/methods/authoring/method-edit-session.d.ts +0 -18
- package/dist/packages/methods/authoring/method-improvement.d.ts +0 -23
- package/dist/packages/methods/authoring/method-improvement.js +0 -217
- package/dist/packages/methods/index.d.ts +0 -2
- package/dist/packages/methods/index.js +0 -2
- package/dist/packages/methods/method-resolution.d.ts +0 -6
- package/dist/packages/methods/method-resolution.js +0 -7
- package/dist/packages/methods/package/builtin-compiled-method.d.ts +0 -37
- package/dist/packages/methods/package/builtin-compiled-method.js +0 -91
- package/dist/packages/methods/package/interf-method-package.d.ts +0 -31
- package/dist/packages/methods/package/interf-method-package.js +0 -466
- package/dist/packages/methods/package/local-methods.d.ts +0 -74
- package/dist/packages/methods/package/method-definitions.d.ts +0 -61
- package/dist/packages/methods/package/method-definitions.js +0 -214
- package/dist/packages/methods/package/method-review-paths.d.ts +0 -10
- package/dist/packages/methods/package/method-review-paths.js +0 -31
- package/dist/packages/methods/package/user-methods.d.ts +0 -17
- package/dist/packages/methods/package/user-methods.js +0 -77
- package/public-repo/methods/interf-default/README.md +0 -33
- package/public-repo/methods/interf-default/improve/SKILL.md +0 -18
- /package/dist/{compiler-ui/_next/static/tYHMLL9oKds1yDoNYgkPV → interf-ui/_next/static/_qJKnA0dammQ306MG_zMq}/_buildManifest.js +0 -0
- /package/dist/{compiler-ui/_next/static/tYHMLL9oKds1yDoNYgkPV → interf-ui/_next/static/_qJKnA0dammQ306MG_zMq}/_clientMiddlewareManifest.js +0 -0
- /package/dist/{compiler-ui/_next/static/tYHMLL9oKds1yDoNYgkPV → interf-ui/_next/static/_qJKnA0dammQ306MG_zMq}/_ssgManifest.js +0 -0
- /package/dist/{compiler-ui → interf-ui}/_next/static/chunks/03~yq9q893hmn.js +0 -0
- /package/dist/{compiler-ui → interf-ui}/_next/static/chunks/0y5z3t-z1c8ks.js.map +0 -0
- /package/dist/{compiler-ui → interf-ui}/_next/static/chunks/turbopack-worker-0sjn--fhq~1cg.js +0 -0
- /package/dist/{compiler-ui → interf-ui}/_next/static/media/GeistMono_Variable.p.17jn9btb_52pq.woff2 +0 -0
- /package/dist/{compiler-ui → interf-ui}/_next/static/media/Geist_Variable-s.p.0-te~ja_gpvcf.woff2 +0 -0
- /package/dist/{compiler-ui → interf-ui}/_next/static/media/worker.102zas1s52_pf.js +0 -0
- /package/dist/packages/{methods/authoring/lib/method-edit-utils.js → build-plans/authoring/lib/build-plan-edit-utils.js} +0 -0
- /package/dist/packages/{methods → build-plans}/package/lib/package-root.d.ts +0 -0
- /package/dist/packages/engine/{compile → build}/runtime-contracts.d.ts +0 -0
- /package/dist/packages/engine/{compile → build}/runtime-paths.d.ts +0 -0
- /package/dist/packages/engine/{compile → build}/runtime-prompt.d.ts +0 -0
- /package/dist/packages/engine/{compile → build}/runtime-runs.d.ts +0 -0
- /package/dist/packages/engine/{compile → build}/runtime-types.js +0 -0
- /package/dist/packages/engine/{compile → build}/runtime.d.ts +0 -0
- /package/dist/packages/engine/{compile → build}/runtime.js +0 -0
- /package/dist/packages/engine/{compile → build}/state-paths.d.ts +0 -0
- /package/dist/packages/engine/{compile → build}/validate-helpers.d.ts +0 -0
- /package/dist/packages/engine/{compile → build}/validate-helpers.js +0 -0
|
@@ -2,14 +2,14 @@ import { cpSync, copyFileSync, existsSync, lstatSync, mkdirSync, mkdtempSync, re
|
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import { basename, dirname, join, relative, sep as pathSep } from "node:path";
|
|
4
4
|
import { CHART_APPROXIMATION_NOTES } from "./chart-guidance.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { buildVerifiableContextSourceFiles } from "../../build/source-files.js";
|
|
6
|
+
import { BUILD_PLAN_PACKAGE_DIR } from "../../../project/interf-detect.js";
|
|
7
7
|
import { CHECK_KINDS, } from "../../../contracts/lib/schema.js";
|
|
8
|
-
import { CONTEXT_INTERFACE_FILE as
|
|
9
|
-
import { stageExecutionShellsRoot,
|
|
10
|
-
import {
|
|
8
|
+
import { CONTEXT_INTERFACE_FILE as BUILD_PLAN_SCHEMA_FILE, contextInterfaceArtifactAbsolutePath as verifiableContextArtifactAbsolutePath, listContextInterfaceArtifacts, readContextInterface as readBuildPlanContextFile, resolveContextInterfacePath as resolveBuildPlanSchemaPath, } from "../../../build-plans/package/context-interface.js";
|
|
9
|
+
import { stageExecutionShellsRoot, buildPlanImprovementLoopRoot, buildPlanPackagePathForVerifiableContext, verifiableContextInterfConfigPath, verifiableContextRuntimeRoot, verifiableContextRuntimeSourceSnapshotPath, verifiableContextRuntimeStageInputsPath, } from "../../build/verifiable-context-paths.js";
|
|
10
|
+
import { ensureBuildPlanArtifactTargets } from "../../build/verifiable-context-schema.js";
|
|
11
11
|
import { listFilesRecursive } from "../../../contracts/utils/filesystem.js";
|
|
12
|
-
import {
|
|
12
|
+
import { resolveBuildPlanImprovementReviewSourcePaths } from "../../../build-plans/package/build-plan-review-paths.js";
|
|
13
13
|
const LOCAL_SKILL_ROOTS = [
|
|
14
14
|
".claude/skills",
|
|
15
15
|
".codex/skills",
|
|
@@ -24,25 +24,25 @@ export function writeNativeAgentSurface(rootPath, agentsContent, skillName, skil
|
|
|
24
24
|
changed = writeNativeSkillCopies(rootPath, skillName, skillContent) || changed;
|
|
25
25
|
return changed;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
return join(
|
|
27
|
+
function verifiableContextQuerySkillSourcePath(verifiableContextPath) {
|
|
28
|
+
return join(buildPlanPackagePathForVerifiableContext(verifiableContextPath), "use", "query", "SKILL.md");
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
const schema =
|
|
30
|
+
function verifiableContextArtifactSummaryLines(verifiableContextPath) {
|
|
31
|
+
const schema = readBuildPlanContextFile(buildPlanPackagePathForVerifiableContext(verifiableContextPath));
|
|
32
32
|
if (!schema)
|
|
33
|
-
return ["- No
|
|
33
|
+
return ["- No Build Plan schema is available yet."];
|
|
34
34
|
return listContextInterfaceArtifacts(schema)
|
|
35
35
|
.filter((artifact) => artifact.kind !== "runtime")
|
|
36
36
|
.map((artifact) => `- \`${artifact.id}\` -> \`${artifact.path}\` (${artifact.role} ${artifact.kind})`);
|
|
37
37
|
}
|
|
38
|
-
export function
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const artifactLines =
|
|
38
|
+
export function renderVerifiableContextAgents(verifiableContextPath, name, buildPlanId, about, options = {}) {
|
|
39
|
+
const buildPlanOriginSelected = options.buildPlanOriginSelected ?? buildPlanId;
|
|
40
|
+
const buildPlanLocalDraft = options.buildPlanLocalDraft === true;
|
|
41
|
+
const artifactLines = verifiableContextArtifactSummaryLines(verifiableContextPath);
|
|
42
42
|
return [
|
|
43
43
|
`# ${name}`,
|
|
44
44
|
"",
|
|
45
|
-
"This is
|
|
45
|
+
"This is verifiable context built by Interf.",
|
|
46
46
|
"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.",
|
|
47
47
|
"",
|
|
48
48
|
...(about
|
|
@@ -51,78 +51,78 @@ export function renderCompiledAgents(compiledPath, name, methodId, about, option
|
|
|
51
51
|
"",
|
|
52
52
|
]
|
|
53
53
|
: []),
|
|
54
|
-
"## How to use this
|
|
54
|
+
"## How to use this verifiable context",
|
|
55
55
|
"",
|
|
56
|
-
"1. Use the local native `interf-query` skill that Interf generated for this
|
|
57
|
-
"2. Let the
|
|
56
|
+
"1. Use the local native `interf-query` skill that Interf generated for this verifiable context.",
|
|
57
|
+
"2. Let the Build Plan docs and declared Artifacts guide retrieval instead of assuming a fixed note layout.",
|
|
58
58
|
"3. Use `.interf/runtime/source-snapshot.json` when you need to inspect the source references behind the output.",
|
|
59
59
|
"",
|
|
60
|
-
"## How this
|
|
60
|
+
"## How this verifiable context works",
|
|
61
61
|
"",
|
|
62
|
-
"- The
|
|
62
|
+
"- The Build Plan defines the context interface this verifiable context implements on disk.",
|
|
63
63
|
"- `.interf/interf.json` records the selected Source binding and Preparation metadata.",
|
|
64
|
-
`-
|
|
65
|
-
...(
|
|
66
|
-
? ["- This
|
|
64
|
+
`- Build Plan seed: \`${buildPlanOriginSelected}\`.`,
|
|
65
|
+
...(buildPlanLocalDraft
|
|
66
|
+
? ["- This verifiable context now carries a local Build Plan draft improved from that seed. Rebuilding this verifiable context reuses the local `.interf/build-plan/` package."]
|
|
67
67
|
: []),
|
|
68
|
-
`- Selected Build Plan
|
|
69
|
-
"- `.interf/
|
|
70
|
-
`- \`.interf/
|
|
71
|
-
"- `.interf/
|
|
72
|
-
"- `.interf/
|
|
73
|
-
"- `.interf/
|
|
68
|
+
`- Selected Build Plan id: \`${buildPlanId}\`.`,
|
|
69
|
+
"- `.interf/build-plan/` is the local editable Build Plan package for this verifiable context.",
|
|
70
|
+
`- \`.interf/build-plan/${BUILD_PLAN_SCHEMA_FILE}\` is the deterministic context interface for this verifiable context.`,
|
|
71
|
+
"- `.interf/build-plan/improve/` is the editable source for Build Plan improvement loops.",
|
|
72
|
+
"- `.interf/build-plan/use/query/` is the editable source for the generated native query shell.",
|
|
73
|
+
"- `.interf/build-plan/build/stages/` defines stage-specific docs that Interf projects into native execution shells for automated runs.",
|
|
74
74
|
"- Native local query skills are generated under local agent skill directories such as `.claude/skills/` and `.codex/skills/`.",
|
|
75
75
|
"- `.interf/runtime/source-snapshot.json` records the source files assigned to the latest runtime snapshot.",
|
|
76
|
-
`-
|
|
76
|
+
`- Build Plan Artifacts are declared in \`.interf/build-plan/${BUILD_PLAN_SCHEMA_FILE}\`.`,
|
|
77
77
|
...artifactLines,
|
|
78
78
|
"- `.interf/runtime/` holds runtime artifacts written by Interf.",
|
|
79
79
|
"- `.interf/tests/` mirrors the latest saved readiness-check run and keeps detailed target runs plus preserved sandboxes.",
|
|
80
|
-
"- `.interf/tests/targets/` holds detailed source-files and
|
|
80
|
+
"- `.interf/tests/targets/` holds detailed source-files and verifiable-context target runs plus preserved test sandboxes.",
|
|
81
81
|
"",
|
|
82
82
|
"## Manual query rules",
|
|
83
83
|
"",
|
|
84
|
-
"- Prefer the
|
|
85
|
-
"- Use the generated native `interf-query` skill for manual querying. The editable source lives at `.interf/
|
|
86
|
-
"- Treat `.interf/` as
|
|
87
|
-
"- Use `.interf/runtime/source-snapshot.json` to find source references for quotes, verification, ambiguity, or evidence the
|
|
84
|
+
"- Prefer the Build Plan-declared context outputs before source re-checks.",
|
|
85
|
+
"- Use the generated native `interf-query` skill for manual querying. The editable source lives at `.interf/build-plan/use/query/SKILL.md`.",
|
|
86
|
+
"- Treat `.interf/` as Build Plan/runtime metadata, not answer evidence, unless explicitly asked to inspect Build Plan or test history.",
|
|
87
|
+
"- Use `.interf/runtime/source-snapshot.json` to find source references for quotes, verification, ambiguity, or evidence the verifiable context does not expose well.",
|
|
88
88
|
"- If exact chart, table, or image-derived evidence matters, inspect the source reference and say whether the answer was text-derived, table-derived, or chart-derived.",
|
|
89
89
|
"",
|
|
90
90
|
"## Commands",
|
|
91
91
|
"",
|
|
92
92
|
"```",
|
|
93
|
-
"interf
|
|
94
|
-
"interf test run readiness checks against this
|
|
93
|
+
"interf build <prep-id> build this verifiable context",
|
|
94
|
+
"interf test run readiness checks against this verifiable context",
|
|
95
95
|
"interf status show deterministic health",
|
|
96
96
|
"```",
|
|
97
97
|
"",
|
|
98
98
|
"## Rules",
|
|
99
99
|
"",
|
|
100
|
-
"- Do not modify source files while answering from this
|
|
100
|
+
"- Do not modify source files while answering from this verifiable context.",
|
|
101
101
|
"- Treat prepared notes as working context, not final truth.",
|
|
102
102
|
"- When confidence is low, verify against the source references before answering strongly.",
|
|
103
103
|
"",
|
|
104
104
|
].join("\n");
|
|
105
105
|
}
|
|
106
|
-
export function
|
|
106
|
+
export function renderVerifiableContextQuerySkill() {
|
|
107
107
|
return [
|
|
108
108
|
"# Manual Query Loop",
|
|
109
109
|
"",
|
|
110
110
|
"This file is the editable authoring source for the generated native local `interf-query` skill.",
|
|
111
111
|
"",
|
|
112
112
|
"Default loop:",
|
|
113
|
-
"1. Read `.interf/
|
|
114
|
-
`2. Use the
|
|
115
|
-
"3. Use `.interf/runtime/source-snapshot.json` for direct quotes, verification, exact lookups, and cases where the
|
|
113
|
+
"1. Read `.interf/build-plan/README.md` and this file first.",
|
|
114
|
+
`2. Use the Build Plan Artifacts declared in \`.interf/build-plan/${BUILD_PLAN_SCHEMA_FILE}\` before consulting source references.`,
|
|
115
|
+
"3. Use `.interf/runtime/source-snapshot.json` for direct quotes, verification, exact lookups, and cases where the verifiable context is missing the needed evidence or is ambiguous.",
|
|
116
116
|
"",
|
|
117
117
|
"Answering rule:",
|
|
118
118
|
"- do not modify source files while answering",
|
|
119
|
-
"- treat the
|
|
119
|
+
"- treat the Build Plan as the verifiable-context contract and use its Artifacts as the working retrieval surface",
|
|
120
120
|
"- say explicitly when an answer depends on approximation, bounded inference, or a source re-check",
|
|
121
|
-
"- use source references to confirm source page, metric family, provenance, or exact wording when the
|
|
122
|
-
"- do not invent navigation or note structure beyond what this
|
|
123
|
-
"- when the
|
|
121
|
+
"- use source references to confirm source page, metric family, provenance, or exact wording when the verifiable context is missing the needed evidence or is ambiguous",
|
|
122
|
+
"- do not invent navigation or note structure beyond what this Build Plan declares",
|
|
123
|
+
"- when the verifiable context is insufficient, verify against source references and then answer",
|
|
124
124
|
"",
|
|
125
|
-
"You can edit this file to bias manual question-answering behavior for this
|
|
125
|
+
"You can edit this file to bias manual question-answering behavior for this verifiable context.",
|
|
126
126
|
"",
|
|
127
127
|
].join("\n");
|
|
128
128
|
}
|
|
@@ -132,7 +132,7 @@ function renderSourceFilesTestAgents() {
|
|
|
132
132
|
"# Source Files Test Shell",
|
|
133
133
|
"",
|
|
134
134
|
"This is an isolated source-files test shell generated by Interf.",
|
|
135
|
-
"There is no
|
|
135
|
+
"There is no verifiable context in this shell.",
|
|
136
136
|
"",
|
|
137
137
|
"## How to use this shell",
|
|
138
138
|
"",
|
|
@@ -143,7 +143,7 @@ function renderSourceFilesTestAgents() {
|
|
|
143
143
|
"## Rules",
|
|
144
144
|
"",
|
|
145
145
|
"- Answer only from source files listed in `runtime/source-files.json`.",
|
|
146
|
-
"- There is no
|
|
146
|
+
"- There is no verifiable context here, so do not assume any verifiable-context Artifacts exist.",
|
|
147
147
|
"- Do not treat hidden runtime files or test artifacts as evidence.",
|
|
148
148
|
...chartNotes,
|
|
149
149
|
"- Write the requested answer and trace files, then stop.",
|
|
@@ -168,19 +168,19 @@ function renderSourceFilesTestQuerySkill() {
|
|
|
168
168
|
"1. Read `runtime/source-files.json`.",
|
|
169
169
|
"2. Verify exact claims against the listed source locators before answering strongly.",
|
|
170
170
|
...chartNotes,
|
|
171
|
-
"8. Do not rely on
|
|
171
|
+
"8. Do not rely on verifiable-context artifacts because they do not exist in this shell.",
|
|
172
172
|
"",
|
|
173
173
|
].join("\n");
|
|
174
174
|
}
|
|
175
|
-
function
|
|
176
|
-
const filePath =
|
|
175
|
+
function readVerifiableContextQuerySkillSource(verifiableContextPath) {
|
|
176
|
+
const filePath = verifiableContextQuerySkillSourcePath(verifiableContextPath);
|
|
177
177
|
if (!existsSync(filePath)) {
|
|
178
|
-
throw new Error(`Missing
|
|
178
|
+
throw new Error(`Missing verifiable-context query skill source at ${filePath}. Interf build runs the local Build Plan package directly, so reseed or repair this verifiable context instead of auto-healing query docs.`);
|
|
179
179
|
}
|
|
180
180
|
return readFileSync(filePath, "utf8").trim();
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
return join(shellRoot,
|
|
182
|
+
function stageShellBuildPlanRoot(shellRoot) {
|
|
183
|
+
return join(shellRoot, BUILD_PLAN_PACKAGE_DIR);
|
|
184
184
|
}
|
|
185
185
|
function shellInputArtifactPath(shellRoot, artifactId) {
|
|
186
186
|
return join(shellRoot, "inputs", artifactId);
|
|
@@ -233,11 +233,11 @@ function linkRelativePath(targetPath, linkPathname) {
|
|
|
233
233
|
mkdirSync(dirname(linkPathname), { recursive: true });
|
|
234
234
|
symlinkSync(relative(dirname(linkPathname), targetPath), linkPathname);
|
|
235
235
|
}
|
|
236
|
-
function
|
|
237
|
-
const
|
|
238
|
-
const schema =
|
|
236
|
+
function loadVerifiableContextSchema(verifiableContextPath) {
|
|
237
|
+
const buildPlanRoot = buildPlanPackagePathForVerifiableContext(verifiableContextPath);
|
|
238
|
+
const schema = readBuildPlanContextFile(buildPlanRoot);
|
|
239
239
|
if (!schema) {
|
|
240
|
-
throw new Error(`Missing
|
|
240
|
+
throw new Error(`Missing Build Plan schema at ${join(buildPlanRoot, BUILD_PLAN_SCHEMA_FILE)}`);
|
|
241
241
|
}
|
|
242
242
|
return schema;
|
|
243
243
|
}
|
|
@@ -247,7 +247,7 @@ function artifactMap(schema) {
|
|
|
247
247
|
function artifactOrThrow(artifacts, artifactId) {
|
|
248
248
|
const artifact = artifacts.get(artifactId);
|
|
249
249
|
if (!artifact) {
|
|
250
|
-
throw new Error(`Missing
|
|
250
|
+
throw new Error(`Missing Build Plan schema Artifact "${artifactId}" for stage shell projection.`);
|
|
251
251
|
}
|
|
252
252
|
return artifact;
|
|
253
253
|
}
|
|
@@ -301,25 +301,25 @@ function ensureShellLocalProjection(sourcePath, targetPath, artifact) {
|
|
|
301
301
|
}
|
|
302
302
|
mkdirSync(targetPath, { recursive: true });
|
|
303
303
|
}
|
|
304
|
-
function
|
|
305
|
-
mkdirSync(
|
|
306
|
-
mkdirSync(
|
|
307
|
-
const schema =
|
|
308
|
-
|
|
304
|
+
function ensureBuildExecutionSurface(verifiableContextPath) {
|
|
305
|
+
mkdirSync(verifiableContextRuntimeRoot(verifiableContextPath), { recursive: true });
|
|
306
|
+
mkdirSync(buildPlanPackagePathForVerifiableContext(verifiableContextPath), { recursive: true });
|
|
307
|
+
const schema = loadVerifiableContextSchema(verifiableContextPath);
|
|
308
|
+
ensureBuildPlanArtifactTargets(verifiableContextPath, schema);
|
|
309
309
|
return schema;
|
|
310
310
|
}
|
|
311
|
-
function
|
|
312
|
-
const path = join(
|
|
311
|
+
function readStageBuildPlanDoc(verifiableContextPath, stage) {
|
|
312
|
+
const path = join(buildPlanPackagePathForVerifiableContext(verifiableContextPath), "build", "stages", stage.skillDir, "SKILL.md");
|
|
313
313
|
if (!existsSync(path))
|
|
314
314
|
return null;
|
|
315
315
|
return readFileSync(path, "utf8").trim();
|
|
316
316
|
}
|
|
317
|
-
function
|
|
318
|
-
return join(
|
|
317
|
+
function stageBuildPlanDocsPath(verifiableContextPath, stage) {
|
|
318
|
+
return join(buildPlanPackagePathForVerifiableContext(verifiableContextPath), "build", "stages", stage.skillDir);
|
|
319
319
|
}
|
|
320
|
-
function renderStageExecutionAgents(
|
|
320
|
+
function renderStageExecutionAgents(verifiableContextName, buildPlanId, stage) {
|
|
321
321
|
return [
|
|
322
|
-
`# ${
|
|
322
|
+
`# ${verifiableContextName} — ${stage.label} Execution Shell`,
|
|
323
323
|
"",
|
|
324
324
|
"This is an ephemeral stage-execution shell generated by Interf.",
|
|
325
325
|
"It is for automated pipeline execution only, not for manual querying.",
|
|
@@ -339,16 +339,16 @@ function renderStageExecutionAgents(compiledName, methodId, stage) {
|
|
|
339
339
|
"- For file Artifacts, `runtime/paths.json` points to the exact file path inside those mount roots.",
|
|
340
340
|
"- `runtime/source-snapshot.json` = source references captured for this run.",
|
|
341
341
|
"- `runtime/stage-inputs.json` = exact source references assigned to this stage.",
|
|
342
|
-
"- declared Artifact paths are also projected at the shell root so
|
|
342
|
+
"- declared Artifact paths are also projected at the shell root so Build Plan-relative contract paths stay valid.",
|
|
343
343
|
"- `runtime/` = stage contract and machine-readable path map for this shell.",
|
|
344
|
-
"- `
|
|
344
|
+
"- `build-plan/` = Build Plan metadata, `build-plan.schema.json`, and docs for the current stage only.",
|
|
345
345
|
"",
|
|
346
346
|
"## Boundaries",
|
|
347
347
|
"",
|
|
348
|
-
`-
|
|
348
|
+
`- Build Plan: \`${buildPlanId}\`.`,
|
|
349
349
|
`- Contract type: \`${stage.contractType}\`.`,
|
|
350
|
-
"- This shell has its own AGENTS/CLAUDE/native skills. It does not inherit the
|
|
351
|
-
"- The
|
|
350
|
+
"- This shell has its own AGENTS/CLAUDE/native skills. It does not inherit the verifiable-context query shell.",
|
|
351
|
+
"- The verifiable-context root itself is not linked into this shell.",
|
|
352
352
|
"- Do not switch into query mode or act like a user-facing assistant.",
|
|
353
353
|
"- Do not modify files under `inputs/` unless the same Artifact is also mounted under `outputs/`.",
|
|
354
354
|
"",
|
|
@@ -366,7 +366,7 @@ function renderStageExecutionAgents(compiledName, methodId, stage) {
|
|
|
366
366
|
"",
|
|
367
367
|
].join("\n");
|
|
368
368
|
}
|
|
369
|
-
function renderStageExecutionSkill(stage,
|
|
369
|
+
function renderStageExecutionSkill(stage, stageBuildPlanDoc) {
|
|
370
370
|
return [
|
|
371
371
|
"---",
|
|
372
372
|
"name: interf-stage",
|
|
@@ -390,64 +390,64 @@ function renderStageExecutionSkill(stage, stageMethodDoc) {
|
|
|
390
390
|
`- contract type: \`${stage.contractType}\``,
|
|
391
391
|
`- reads: ${stage.reads.join(", ")}`,
|
|
392
392
|
`- writes: ${stage.writes.join(", ")}`,
|
|
393
|
-
`- editable source: \`
|
|
393
|
+
`- editable source: \`build-plan/build/stages/${stage.skillDir}/SKILL.md\``,
|
|
394
394
|
"",
|
|
395
|
-
...(
|
|
395
|
+
...(stageBuildPlanDoc
|
|
396
396
|
? [
|
|
397
|
-
"## Stage
|
|
397
|
+
"## Stage Build Plan",
|
|
398
398
|
"",
|
|
399
|
-
|
|
399
|
+
stageBuildPlanDoc,
|
|
400
400
|
"",
|
|
401
401
|
]
|
|
402
402
|
: []),
|
|
403
403
|
].join("\n");
|
|
404
404
|
}
|
|
405
|
-
function
|
|
405
|
+
function renderVerifiableContextQueryNativeSkill(querySkillContent) {
|
|
406
406
|
return [
|
|
407
407
|
"---",
|
|
408
408
|
"name: interf-query",
|
|
409
409
|
"description: >",
|
|
410
|
-
" Native local query skill for
|
|
411
|
-
" Use it for manual questions against
|
|
410
|
+
" Native local query skill for verifiable context built by Interf.",
|
|
411
|
+
" Use it for manual questions against verifiable context and source references.",
|
|
412
412
|
"---",
|
|
413
413
|
"",
|
|
414
414
|
"# Interf Query",
|
|
415
415
|
"",
|
|
416
|
-
"This is the native local query skill for
|
|
417
|
-
"Use it when reading this
|
|
418
|
-
"Editable source: `.interf/
|
|
416
|
+
"This is the native local query skill for verifiable context built by Interf.",
|
|
417
|
+
"Use it when reading this verifiable context manually.",
|
|
418
|
+
"Editable source: `.interf/build-plan/use/query/SKILL.md`.",
|
|
419
419
|
"",
|
|
420
420
|
querySkillContent.trim(),
|
|
421
421
|
"",
|
|
422
422
|
].join("\n");
|
|
423
423
|
}
|
|
424
|
-
function
|
|
425
|
-
const
|
|
426
|
-
mkdirSync(join(
|
|
427
|
-
const
|
|
428
|
-
const
|
|
429
|
-
if (existsSync(
|
|
430
|
-
linkPath(
|
|
424
|
+
function projectBuildPlanMetadata(verifiableContextPath, shellRoot, stage) {
|
|
425
|
+
const shellBuildPlanRoot = stageShellBuildPlanRoot(shellRoot);
|
|
426
|
+
mkdirSync(join(shellBuildPlanRoot, "build", "stages"), { recursive: true });
|
|
427
|
+
const verifiableContextBuildPlanRoot = buildPlanPackagePathForVerifiableContext(verifiableContextPath);
|
|
428
|
+
const buildPlanJsonPath = join(verifiableContextBuildPlanRoot, "build-plan.json");
|
|
429
|
+
if (existsSync(buildPlanJsonPath)) {
|
|
430
|
+
linkPath(buildPlanJsonPath, join(shellBuildPlanRoot, "build-plan.json"));
|
|
431
431
|
}
|
|
432
|
-
const
|
|
433
|
-
if (
|
|
434
|
-
linkPath(
|
|
432
|
+
const buildPlanSchemaPath = resolveBuildPlanSchemaPath(verifiableContextBuildPlanRoot);
|
|
433
|
+
if (buildPlanSchemaPath) {
|
|
434
|
+
linkPath(buildPlanSchemaPath, join(shellBuildPlanRoot, BUILD_PLAN_SCHEMA_FILE));
|
|
435
435
|
}
|
|
436
|
-
const readmePath = join(
|
|
436
|
+
const readmePath = join(verifiableContextBuildPlanRoot, "README.md");
|
|
437
437
|
if (existsSync(readmePath)) {
|
|
438
|
-
linkPath(readmePath, join(
|
|
438
|
+
linkPath(readmePath, join(shellBuildPlanRoot, "README.md"));
|
|
439
439
|
}
|
|
440
|
-
const stageDocsPath =
|
|
440
|
+
const stageDocsPath = stageBuildPlanDocsPath(verifiableContextPath, stage);
|
|
441
441
|
if (existsSync(stageDocsPath)) {
|
|
442
|
-
linkPath(stageDocsPath, join(
|
|
442
|
+
linkPath(stageDocsPath, join(shellBuildPlanRoot, "build", "stages", stage.skillDir));
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function projectVerifiableContextSchemaArtifacts(verifiableContextPath, shellRoot, schema, artifactIds, materializedArtifactIds) {
|
|
446
446
|
const allowedArtifactIds = artifactIds ? new Set(artifactIds) : null;
|
|
447
447
|
for (const artifact of listContextInterfaceArtifacts(schema)) {
|
|
448
448
|
if (allowedArtifactIds && !allowedArtifactIds.has(artifact.id))
|
|
449
449
|
continue;
|
|
450
|
-
const sourcePath =
|
|
450
|
+
const sourcePath = verifiableContextArtifactAbsolutePath(verifiableContextPath, artifact);
|
|
451
451
|
const targetPath = join(shellRoot, artifact.path);
|
|
452
452
|
if (materializedArtifactIds?.has(artifact.id)) {
|
|
453
453
|
ensureShellLocalProjection(sourcePath, targetPath, artifact);
|
|
@@ -456,7 +456,7 @@ function projectCompiledSchemaArtifacts(compiledPath, shellRoot, schema, artifac
|
|
|
456
456
|
linkPath(sourcePath, targetPath);
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
|
-
function buildStageArtifactMounts(
|
|
459
|
+
function buildStageArtifactMounts(verifiableContextPath, shellRoot, stage, schema) {
|
|
460
460
|
const artifacts = artifactMap(schema);
|
|
461
461
|
const mountFor = (artifactId) => {
|
|
462
462
|
const artifact = artifactOrThrow(artifacts, artifactId);
|
|
@@ -490,19 +490,19 @@ function projectStageArtifactMountAliases(shellRoot, stage, schema) {
|
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
|
-
function writeExecutionShellPathsFile(shellRoot,
|
|
493
|
+
function writeExecutionShellPathsFile(shellRoot, buildPlanId, stage, mounts) {
|
|
494
494
|
const paths = {
|
|
495
495
|
kind: "interf-execution-shell",
|
|
496
496
|
version: 1,
|
|
497
|
-
|
|
497
|
+
build_plan: buildPlanId,
|
|
498
498
|
stage: stage.id,
|
|
499
499
|
reads: mounts.reads,
|
|
500
500
|
writes: mounts.writes,
|
|
501
501
|
};
|
|
502
502
|
writeFileSync(shellRuntimePath(shellRoot, "paths.json"), `${JSON.stringify(paths, null, 2)}\n`);
|
|
503
503
|
}
|
|
504
|
-
export function syncStageExecutionShellWrites(
|
|
505
|
-
const schema =
|
|
504
|
+
export function syncStageExecutionShellWrites(verifiableContextPath, shellRoot, stage, writeArtifacts = []) {
|
|
505
|
+
const schema = ensureBuildExecutionSurface(verifiableContextPath);
|
|
506
506
|
const artifacts = artifactMap(schema);
|
|
507
507
|
const stageWriteArtifacts = Array.from(stageWriteArtifactSet(schema, stage))
|
|
508
508
|
.map((artifactId) => artifactOrThrow(artifacts, artifactId));
|
|
@@ -519,25 +519,25 @@ export function syncStageExecutionShellWrites(compiledPath, shellRoot, stage, wr
|
|
|
519
519
|
const shellArtifactStat = lstatSync(shellArtifactPath);
|
|
520
520
|
if (shellArtifactStat.isSymbolicLink())
|
|
521
521
|
continue;
|
|
522
|
-
const
|
|
522
|
+
const verifiableContextArtifactPath = verifiableContextArtifactAbsolutePath(verifiableContextPath, artifact);
|
|
523
523
|
if (shellArtifactStat.isDirectory()) {
|
|
524
524
|
const shellArtifactFiles = listFilesRecursive(shellArtifactPath);
|
|
525
|
-
const
|
|
526
|
-
? listFilesRecursive(
|
|
525
|
+
const verifiableContextArtifactFiles = existsSync(verifiableContextArtifactPath)
|
|
526
|
+
? listFilesRecursive(verifiableContextArtifactPath)
|
|
527
527
|
: [];
|
|
528
|
-
if (shellArtifactFiles.length === 0 &&
|
|
528
|
+
if (shellArtifactFiles.length === 0 && verifiableContextArtifactFiles.length > 0) {
|
|
529
529
|
continue;
|
|
530
530
|
}
|
|
531
|
-
rmSync(
|
|
532
|
-
mkdirSync(dirname(
|
|
533
|
-
cpSync(shellArtifactPath,
|
|
531
|
+
rmSync(verifiableContextArtifactPath, { recursive: true, force: true });
|
|
532
|
+
mkdirSync(dirname(verifiableContextArtifactPath), { recursive: true });
|
|
533
|
+
cpSync(shellArtifactPath, verifiableContextArtifactPath, {
|
|
534
534
|
recursive: true,
|
|
535
535
|
force: true,
|
|
536
536
|
});
|
|
537
537
|
continue;
|
|
538
538
|
}
|
|
539
|
-
mkdirSync(dirname(
|
|
540
|
-
copyFileSync(shellArtifactPath,
|
|
539
|
+
mkdirSync(dirname(verifiableContextArtifactPath), { recursive: true });
|
|
540
|
+
copyFileSync(shellArtifactPath, verifiableContextArtifactPath);
|
|
541
541
|
}
|
|
542
542
|
for (const artifactPath of writeArtifacts) {
|
|
543
543
|
const normalizedArtifactPath = normalizeArtifactRelativePath(artifactPath);
|
|
@@ -548,21 +548,21 @@ export function syncStageExecutionShellWrites(compiledPath, shellRoot, stage, wr
|
|
|
548
548
|
const shellArtifactPath = join(shellRoot, normalizedArtifactPath);
|
|
549
549
|
if (!existsSync(shellArtifactPath))
|
|
550
550
|
continue;
|
|
551
|
-
const
|
|
551
|
+
const verifiableContextArtifactPath = join(verifiableContextPath, normalizedArtifactPath);
|
|
552
552
|
const shellArtifactStat = lstatSync(shellArtifactPath);
|
|
553
553
|
if (shellArtifactStat.isSymbolicLink())
|
|
554
554
|
continue;
|
|
555
555
|
if (shellArtifactStat.isDirectory()) {
|
|
556
|
-
rmSync(
|
|
557
|
-
mkdirSync(dirname(
|
|
558
|
-
cpSync(shellArtifactPath,
|
|
556
|
+
rmSync(verifiableContextArtifactPath, { recursive: true, force: true });
|
|
557
|
+
mkdirSync(dirname(verifiableContextArtifactPath), { recursive: true });
|
|
558
|
+
cpSync(shellArtifactPath, verifiableContextArtifactPath, {
|
|
559
559
|
recursive: true,
|
|
560
560
|
force: true,
|
|
561
561
|
});
|
|
562
562
|
continue;
|
|
563
563
|
}
|
|
564
|
-
mkdirSync(dirname(
|
|
565
|
-
copyFileSync(shellArtifactPath,
|
|
564
|
+
mkdirSync(dirname(verifiableContextArtifactPath), { recursive: true });
|
|
565
|
+
copyFileSync(shellArtifactPath, verifiableContextArtifactPath);
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
568
|
function preservedShellManifestPath(rootPath) {
|
|
@@ -578,14 +578,14 @@ function shouldSkipFrozenStageShellRelativePath(relativePath) {
|
|
|
578
578
|
normalized.includes("/improvement-loops/");
|
|
579
579
|
}
|
|
580
580
|
/**
|
|
581
|
-
* System path prefixes a malicious symlink in a
|
|
581
|
+
* System path prefixes a malicious symlink in a Build Plan package must
|
|
582
582
|
* never reach. Without this, the freeze-snapshot logic could be
|
|
583
583
|
* tricked into copying anything the running user has access to —
|
|
584
584
|
* `/etc/passwd`, `~/.ssh/id_rsa`, etc. (CSO finding).
|
|
585
585
|
*
|
|
586
586
|
* We deliberately allow targets that escape the immediate freeze
|
|
587
587
|
* root: legitimate execution shells contain symlinks pointing back
|
|
588
|
-
* to the parent
|
|
588
|
+
* to the parent Preparation's `interf.json`. The threat is only links
|
|
589
589
|
* that resolve into truly system-level paths.
|
|
590
590
|
*/
|
|
591
591
|
const FORBIDDEN_SYMLINK_TARGET_PREFIXES = [
|
|
@@ -637,7 +637,7 @@ function copyResolvedTree(options) {
|
|
|
637
637
|
// Refuse symlinks resolving into system paths (CSO finding). We
|
|
638
638
|
// deliberately allow links that escape the immediate freeze root
|
|
639
639
|
// because legitimate execution shells contain links back to the
|
|
640
|
-
// parent
|
|
640
|
+
// parent Preparation's interf.json — the only thing we care about
|
|
641
641
|
// is that the realpath does not land in /etc, /sys, /proc, etc.
|
|
642
642
|
ensureSymlinkTargetSafe(realTarget, options.sourcePath);
|
|
643
643
|
const realStat = statSync(realTarget);
|
|
@@ -725,30 +725,30 @@ export function renderClaudeBootstrap(content) {
|
|
|
725
725
|
"",
|
|
726
726
|
].join("\n");
|
|
727
727
|
}
|
|
728
|
-
function
|
|
728
|
+
function renderBuildPlanAuthoringAgents(options) {
|
|
729
729
|
return [
|
|
730
|
-
`# ${options.label} —
|
|
730
|
+
`# ${options.label} — Build Plan Authoring Shell`,
|
|
731
731
|
"",
|
|
732
|
-
"This is an automated
|
|
733
|
-
"It exists to create one standalone
|
|
732
|
+
"This is an automated Build Plan authoring shell generated by Interf.",
|
|
733
|
+
"It exists to create one standalone Build Plan package from the source data, desired verifiable-context outputs, and proof requirements in this task.",
|
|
734
734
|
"",
|
|
735
735
|
"## Start Here",
|
|
736
736
|
"",
|
|
737
737
|
"1. Read `runtime/authoring-context.json` now.",
|
|
738
|
-
`2. Read \`
|
|
738
|
+
`2. Read \`build-plan/README.md\`, \`build-plan/build-plan.json\`, and \`build-plan/${BUILD_PLAN_SCHEMA_FILE}\` now.`,
|
|
739
739
|
"3. Read `runtime/source-files.json` and review the listed source locators.",
|
|
740
|
-
"4. Use the local native `interf-
|
|
740
|
+
"4. Use the local native `interf-build-plan-author` skill now.",
|
|
741
741
|
"",
|
|
742
742
|
"## Boundaries",
|
|
743
743
|
"",
|
|
744
|
-
`- New
|
|
744
|
+
`- New Build Plan id: \`${options.buildPlanId}\`.`,
|
|
745
745
|
"- Authoring mode: from scratch.",
|
|
746
|
-
...(options.
|
|
747
|
-
? [`- Reference
|
|
746
|
+
...(options.referenceBuildPlanId
|
|
747
|
+
? [`- Reference Build Plan id: \`${options.referenceBuildPlanId}\` (context only, not a seed).`]
|
|
748
748
|
: []),
|
|
749
|
-
"- Edit only files under `
|
|
749
|
+
"- Edit only files under `build-plan/`.",
|
|
750
750
|
"- Do not edit source artifacts.",
|
|
751
|
-
"- Keep the
|
|
751
|
+
"- Keep the Build Plan package valid for the current build API and `build-plan.schema.json`.",
|
|
752
752
|
"- Use kebab-case ids everywhere: stage ids, skill_dir values, Artifact ids, reads/writes values, and package ids. Never use underscores.",
|
|
753
753
|
"- Put deterministic validation on Artifact `checks[]`; do not add stage `acceptance` blocks.",
|
|
754
754
|
"- Prefer direct file-reading and search tools over shell commands for routine file inspection.",
|
|
@@ -756,32 +756,32 @@ function renderMethodAuthoringAgents(options) {
|
|
|
756
756
|
"",
|
|
757
757
|
"## Goal",
|
|
758
758
|
"",
|
|
759
|
-
"- produce one standalone
|
|
759
|
+
"- produce one standalone Build Plan package tuned to the source data, desired outputs, and checks in this task",
|
|
760
760
|
"- replace the neutral scaffold topology with the stage graph this agent work needs",
|
|
761
761
|
"- define Artifacts and checks so Interf can show whether the data is ready",
|
|
762
762
|
"- satisfy every `artifact_requirements[]` entry from `runtime/authoring-context.json` when entries are present",
|
|
763
763
|
"- otherwise draft the Build Plan Artifacts from every `requested_artifacts[]` entry; do not ignore or truncate them",
|
|
764
764
|
"- preserve deterministic stage and context-interface contracts",
|
|
765
|
-
"- stop once the
|
|
765
|
+
"- stop once the Build Plan edits are complete",
|
|
766
766
|
"",
|
|
767
767
|
].join("\n");
|
|
768
768
|
}
|
|
769
|
-
function
|
|
769
|
+
function renderBuildPlanAuthoringSkill() {
|
|
770
770
|
return [
|
|
771
771
|
"---",
|
|
772
|
-
"name: interf-
|
|
772
|
+
"name: interf-build-plan-author",
|
|
773
773
|
"description: >",
|
|
774
|
-
" Native local
|
|
774
|
+
" Native local Build Plan authoring skill for an automated Interf Build Plan draft run.",
|
|
775
775
|
"---",
|
|
776
776
|
"",
|
|
777
|
-
"# Interf
|
|
777
|
+
"# Interf Build Plan Authoring",
|
|
778
778
|
"",
|
|
779
779
|
"Read `runtime/authoring-context.json` first.",
|
|
780
|
-
"Then review the neutral
|
|
780
|
+
"Then review the neutral Build Plan package scaffold under `build-plan/`, read `runtime/source-files.json`, and inspect the listed source locators when needed.",
|
|
781
781
|
"",
|
|
782
782
|
"Rules:",
|
|
783
|
-
"- edit only `
|
|
784
|
-
`- keep \`
|
|
783
|
+
"- edit only `build-plan/`",
|
|
784
|
+
`- keep \`build-plan.json\`, \`${BUILD_PLAN_SCHEMA_FILE}\`, and any changed stage docs aligned`,
|
|
785
785
|
"- put deterministic validation on Artifact `checks[]`; do not add stage `acceptance` blocks",
|
|
786
786
|
"- use only CheckKind values listed in `runtime/authoring-context.json`; do not invent aliases",
|
|
787
787
|
"- keep Artifact checks aligned with produced outputs; use stage docs to describe the output contract without requiring exact source-specific phrases in the stage docs",
|
|
@@ -789,34 +789,34 @@ function renderMethodAuthoringSkill() {
|
|
|
789
789
|
"- otherwise draft the Build Plan Artifacts from every `requested_artifacts[]` entry; do not ignore or truncate them",
|
|
790
790
|
"- design the stage graph from the source data and preparation-and-evidence brief",
|
|
791
791
|
"- use kebab-case ids everywhere: stage ids, skill_dir values, Artifact ids, reads/writes values, and package ids; never use underscores",
|
|
792
|
-
"- replace the placeholder `prepare` stage unless that exact stage is truly the final
|
|
792
|
+
"- replace the placeholder `prepare` stage unless that exact stage is truly the final Build Plan",
|
|
793
793
|
"- keep the package standalone; do not introduce runtime inheritance or hidden source-package assumptions",
|
|
794
|
-
"- do not introduce wikilinks unless the
|
|
794
|
+
"- do not introduce wikilinks unless the Build Plan also creates the target note by exact basename or explicit relative path",
|
|
795
795
|
"- respect stage boundaries: do not make structure outputs link to notes or entrypoints first created by later stages",
|
|
796
796
|
"- prefer conservative routing changes over speculative note sprawl",
|
|
797
797
|
"- prefer direct file-reading and search tools over shell commands for routine file inspection",
|
|
798
798
|
"- do not use shell helpers like `cat`, `sed`, `ls`, or `find` when a native read/search tool can inspect the same files",
|
|
799
|
-
"- do not hardcode readiness-check answers into reusable
|
|
799
|
+
"- do not hardcode readiness-check answers into reusable Build Plan docs",
|
|
800
800
|
"- do not edit source artifacts",
|
|
801
801
|
"",
|
|
802
802
|
].join("\n");
|
|
803
803
|
}
|
|
804
|
-
function
|
|
805
|
-
return join(
|
|
804
|
+
function improvementBuildPlanDocsPath(verifiableContextPath) {
|
|
805
|
+
return join(buildPlanPackagePathForVerifiableContext(verifiableContextPath), "improve");
|
|
806
806
|
}
|
|
807
|
-
export function
|
|
808
|
-
const shellRoot = mkdtempSync(join(tmpdir(), `interf-
|
|
807
|
+
export function createBuildPlanAuthoringShell(options) {
|
|
808
|
+
const shellRoot = mkdtempSync(join(tmpdir(), `interf-build-plan-author-${options.buildPlanId}-`));
|
|
809
809
|
mkdirSync(join(shellRoot, "runtime"), { recursive: true });
|
|
810
810
|
mkdirSync(join(shellRoot, "artifacts"), { recursive: true });
|
|
811
811
|
mkdirSync(join(shellRoot, "logs"), { recursive: true });
|
|
812
812
|
const context = {
|
|
813
|
-
kind: "interf-
|
|
813
|
+
kind: "interf-build-plan-authoring",
|
|
814
814
|
version: 1,
|
|
815
815
|
generated_at: new Date().toISOString(),
|
|
816
816
|
authoring_mode: "from-scratch",
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
...(options.
|
|
817
|
+
build_plan_id: options.buildPlanId,
|
|
818
|
+
build_plan_label: options.label,
|
|
819
|
+
...(options.referenceBuildPlanId ? { reference_build_plan_id: options.referenceBuildPlanId } : {}),
|
|
820
820
|
task_prompt: options.taskPrompt,
|
|
821
821
|
allowed_check_kinds: CHECK_KINDS,
|
|
822
822
|
requested_artifacts: options.requestedArtifacts ?? [],
|
|
@@ -834,88 +834,88 @@ export function createMethodAuthoringShell(options) {
|
|
|
834
834
|
},
|
|
835
835
|
};
|
|
836
836
|
writeFileSync(join(shellRoot, "runtime", "authoring-context.json"), `${JSON.stringify(context, null, 2)}\n`);
|
|
837
|
-
writeFileSync(join(shellRoot, "runtime", "source-files.json"), `${JSON.stringify(
|
|
837
|
+
writeFileSync(join(shellRoot, "runtime", "source-files.json"), `${JSON.stringify(buildVerifiableContextSourceFiles(shellRoot, options.sourceFolderPath), null, 2)}\n`);
|
|
838
838
|
copyResolvedTree({
|
|
839
|
-
sourcePath: options.
|
|
840
|
-
targetPath: join(shellRoot, "
|
|
841
|
-
shellType: "
|
|
839
|
+
sourcePath: options.buildPlanPath,
|
|
840
|
+
targetPath: join(shellRoot, "build-plan"),
|
|
841
|
+
shellType: "build-plan-authoring",
|
|
842
842
|
});
|
|
843
|
-
writeNativeAgentSurface(shellRoot,
|
|
844
|
-
|
|
843
|
+
writeNativeAgentSurface(shellRoot, renderBuildPlanAuthoringAgents({
|
|
844
|
+
buildPlanId: options.buildPlanId,
|
|
845
845
|
label: options.label,
|
|
846
|
-
|
|
847
|
-
}), "interf-
|
|
846
|
+
referenceBuildPlanId: options.referenceBuildPlanId ?? null,
|
|
847
|
+
}), "interf-build-plan-author", renderBuildPlanAuthoringSkill());
|
|
848
848
|
return {
|
|
849
849
|
rootPath: shellRoot,
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
promptLogPath: join(shellRoot, "logs", "
|
|
853
|
-
eventLogPath: join(shellRoot, "logs", "
|
|
854
|
-
statusLogPath: join(shellRoot, "logs", "
|
|
850
|
+
buildPlanBeforePath: join(shellRoot, "artifacts", "build-plan-before"),
|
|
851
|
+
buildPlanAfterPath: join(shellRoot, "artifacts", "build-plan-after"),
|
|
852
|
+
promptLogPath: join(shellRoot, "logs", "build-plan-author.prompt.txt"),
|
|
853
|
+
eventLogPath: join(shellRoot, "logs", "build-plan-author.events.ndjson"),
|
|
854
|
+
statusLogPath: join(shellRoot, "logs", "build-plan-author.status.log"),
|
|
855
855
|
};
|
|
856
856
|
}
|
|
857
|
-
function
|
|
857
|
+
function renderBuildPlanImprovementAgents(verifiableContextName, buildPlanId, loopIndex) {
|
|
858
858
|
return [
|
|
859
|
-
`# ${
|
|
859
|
+
`# ${verifiableContextName} — Build Plan Improvement Shell`,
|
|
860
860
|
"",
|
|
861
|
-
"This is an automated
|
|
862
|
-
"It exists to review failed
|
|
861
|
+
"This is an automated Build Plan improvement shell generated by Interf.",
|
|
862
|
+
"It exists to review failed Build/check runs and edit the Build Plan package for the next variation.",
|
|
863
863
|
"",
|
|
864
864
|
"## Start Here",
|
|
865
865
|
"",
|
|
866
866
|
"1. Read `runtime/loop-context.json` now.",
|
|
867
|
-
`2. Read \`
|
|
868
|
-
"3. Read `
|
|
869
|
-
"4. Use the local native `interf-
|
|
867
|
+
`2. Read \`build-plan/README.md\`, \`build-plan/build-plan.json\`, and \`build-plan/${BUILD_PLAN_SCHEMA_FILE}\` now.`,
|
|
868
|
+
"3. Read `build-plan/improve/SKILL.md` now.",
|
|
869
|
+
"4. Use the local native `interf-build-plan-improver` skill now.",
|
|
870
870
|
"",
|
|
871
871
|
"## Boundaries",
|
|
872
872
|
"",
|
|
873
|
-
`-
|
|
873
|
+
`- Build Plan: \`${buildPlanId}\`.`,
|
|
874
874
|
`- Improvement loop: ${loopIndex}.`,
|
|
875
|
-
"- Edit only files under `
|
|
875
|
+
"- Edit only files under `build-plan/`.",
|
|
876
876
|
"- Do not edit checks, test specs, source files, or generated context outputs.",
|
|
877
|
-
"- Review context outputs under `artifacts/
|
|
878
|
-
"- Keep the
|
|
877
|
+
"- Review verifiable-context outputs under `artifacts/verifiable-context-view/` and test/runtime evidence under `artifacts/`.",
|
|
878
|
+
"- Keep the Build Plan package valid for the current build API and `build-plan.schema.json`.",
|
|
879
879
|
"- Put deterministic validation on Artifact `checks[]`; do not add stage `acceptance` blocks.",
|
|
880
880
|
"",
|
|
881
881
|
"## Goal",
|
|
882
882
|
"",
|
|
883
|
-
"- create a better
|
|
884
|
-
"- preserve deterministic
|
|
885
|
-
"- stop after the
|
|
883
|
+
"- create a better Build Plan variation for this kind of agent work",
|
|
884
|
+
"- preserve deterministic verifiable-context structure",
|
|
885
|
+
"- stop after the Build Plan edits are complete",
|
|
886
886
|
"",
|
|
887
887
|
].join("\n");
|
|
888
888
|
}
|
|
889
|
-
function
|
|
890
|
-
const path = join(
|
|
889
|
+
function readBuildPlanImprovementDoc(verifiableContextPath) {
|
|
890
|
+
const path = join(improvementBuildPlanDocsPath(verifiableContextPath), "SKILL.md");
|
|
891
891
|
if (!existsSync(path))
|
|
892
892
|
return null;
|
|
893
893
|
return readFileSync(path, "utf8").trim();
|
|
894
894
|
}
|
|
895
|
-
function
|
|
895
|
+
function renderBuildPlanImprovementSkill(buildPlanId, loopIndex, improvementDoc) {
|
|
896
896
|
return [
|
|
897
897
|
"---",
|
|
898
|
-
"name: interf-
|
|
898
|
+
"name: interf-build-plan-improver",
|
|
899
899
|
"description: >",
|
|
900
|
-
" Native local
|
|
901
|
-
" Use it only inside an automated
|
|
900
|
+
" Native local Build Plan improvement skill for this Interf run.",
|
|
901
|
+
" Use it only inside an automated Build Plan improvement shell.",
|
|
902
902
|
"---",
|
|
903
903
|
"",
|
|
904
|
-
`# Interf
|
|
904
|
+
`# Interf Build Plan Improvement — ${buildPlanId}`,
|
|
905
905
|
"",
|
|
906
|
-
"This local native skill exists for automated
|
|
906
|
+
"This local native skill exists for automated Build Plan improvement loops.",
|
|
907
907
|
"Read `runtime/loop-context.json` first.",
|
|
908
|
-
"Then review the linked
|
|
908
|
+
"Then review the linked Build Plan package, `artifacts/verifiable-context-view/`, preserved stage shells, runtime logs, and saved test outputs before editing `build-plan/`.",
|
|
909
909
|
"",
|
|
910
910
|
"## Current Loop",
|
|
911
911
|
"",
|
|
912
|
-
`-
|
|
912
|
+
`- Build Plan: \`${buildPlanId}\``,
|
|
913
913
|
`- loop index: ${loopIndex}`,
|
|
914
|
-
"- editable source: `
|
|
914
|
+
"- editable source: `build-plan/improve/SKILL.md`",
|
|
915
915
|
"",
|
|
916
916
|
...(improvementDoc
|
|
917
917
|
? [
|
|
918
|
-
"## Improvement
|
|
918
|
+
"## Improvement Guidance",
|
|
919
919
|
"",
|
|
920
920
|
improvementDoc,
|
|
921
921
|
"",
|
|
@@ -923,19 +923,19 @@ function renderMethodImprovementSkill(methodId, loopIndex, improvementDoc) {
|
|
|
923
923
|
: []),
|
|
924
924
|
].join("\n");
|
|
925
925
|
}
|
|
926
|
-
function
|
|
927
|
-
const
|
|
928
|
-
mkdirSync(
|
|
926
|
+
function projectVerifiableContextReviewArtifactsSnapshot(verifiableContextPath, shellRoot, schema) {
|
|
927
|
+
const verifiableContextViewRoot = join(shellRoot, "artifacts", "verifiable-context-view");
|
|
928
|
+
mkdirSync(verifiableContextViewRoot, { recursive: true });
|
|
929
929
|
for (const artifact of listContextInterfaceArtifacts(schema)) {
|
|
930
930
|
if (artifact.kind === "runtime" || artifact.path === "source-files")
|
|
931
931
|
continue;
|
|
932
|
-
const sourcePath =
|
|
932
|
+
const sourcePath = verifiableContextArtifactAbsolutePath(verifiableContextPath, artifact);
|
|
933
933
|
if (!existsSync(sourcePath))
|
|
934
934
|
continue;
|
|
935
935
|
copyResolvedTree({
|
|
936
936
|
sourcePath,
|
|
937
|
-
targetPath: join(
|
|
938
|
-
shellType: "
|
|
937
|
+
targetPath: join(verifiableContextViewRoot, artifact.path),
|
|
938
|
+
shellType: "build-plan-improvement",
|
|
939
939
|
});
|
|
940
940
|
}
|
|
941
941
|
}
|
|
@@ -948,10 +948,10 @@ function copyIfExists(sourcePath, targetPath, shellType) {
|
|
|
948
948
|
shellType,
|
|
949
949
|
});
|
|
950
950
|
}
|
|
951
|
-
function
|
|
952
|
-
const runtimeTarget = join(shellRoot, "artifacts", "
|
|
951
|
+
function projectVerifiableContextRuntimeArtifacts(verifiableContextPath, shellRoot) {
|
|
952
|
+
const runtimeTarget = join(shellRoot, "artifacts", "verifiable-context-runtime");
|
|
953
953
|
mkdirSync(runtimeTarget, { recursive: true });
|
|
954
|
-
const runtimeRoot =
|
|
954
|
+
const runtimeRoot = verifiableContextRuntimeRoot(verifiableContextPath);
|
|
955
955
|
const artifactNames = [
|
|
956
956
|
"run.json",
|
|
957
957
|
"run-history.jsonl",
|
|
@@ -964,40 +964,40 @@ function projectCompiledRuntimeArtifacts(compiledPath, shellRoot) {
|
|
|
964
964
|
"logs",
|
|
965
965
|
];
|
|
966
966
|
for (const artifactName of artifactNames) {
|
|
967
|
-
copyIfExists(join(runtimeRoot, artifactName), join(runtimeTarget, artifactName), "
|
|
967
|
+
copyIfExists(join(runtimeRoot, artifactName), join(runtimeTarget, artifactName), "build-plan-improvement");
|
|
968
968
|
}
|
|
969
969
|
}
|
|
970
|
-
export function pruneStageExecutionShells(
|
|
971
|
-
rmSync(stageExecutionShellsRoot(
|
|
970
|
+
export function pruneStageExecutionShells(verifiableContextPath) {
|
|
971
|
+
rmSync(stageExecutionShellsRoot(verifiableContextPath), { recursive: true, force: true });
|
|
972
972
|
}
|
|
973
|
-
export function
|
|
974
|
-
const agentsContent =
|
|
975
|
-
const querySkillContent =
|
|
976
|
-
return writeNativeAgentSurface(
|
|
973
|
+
export function projectVerifiableContextQueryShell(verifiableContextPath, verifiableContextName, buildPlanId, about, options) {
|
|
974
|
+
const agentsContent = renderVerifiableContextAgents(verifiableContextPath, verifiableContextName, buildPlanId, about, options);
|
|
975
|
+
const querySkillContent = readVerifiableContextQuerySkillSource(verifiableContextPath);
|
|
976
|
+
return writeNativeAgentSurface(verifiableContextPath, agentsContent, "interf-query", renderVerifiableContextQueryNativeSkill(querySkillContent));
|
|
977
977
|
}
|
|
978
978
|
export function projectSourceFilesTestQueryShell(rootPath) {
|
|
979
979
|
return writeNativeAgentSurface(rootPath, renderSourceFilesTestAgents(), "interf-query", renderSourceFilesTestQuerySkill());
|
|
980
980
|
}
|
|
981
|
-
export function createStageExecutionShell(
|
|
982
|
-
const schema =
|
|
981
|
+
export function createStageExecutionShell(verifiableContextPath, verifiableContextName, buildPlanId, stage, writeArtifacts = []) {
|
|
982
|
+
const schema = ensureBuildExecutionSurface(verifiableContextPath);
|
|
983
983
|
const materializedArtifacts = stageMaterializedArtifactSet(schema, stage, writeArtifacts);
|
|
984
|
-
const shellsRoot = stageExecutionShellsRoot(
|
|
984
|
+
const shellsRoot = stageExecutionShellsRoot(verifiableContextPath);
|
|
985
985
|
const shellRoot = join(shellsRoot, `${stage.id}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`);
|
|
986
986
|
mkdirSync(shellRoot, { recursive: true });
|
|
987
987
|
mkdirSync(join(shellRoot, "runtime"), { recursive: true });
|
|
988
988
|
mkdirSync(join(shellRoot, ".interf", "runtime"), { recursive: true });
|
|
989
989
|
mkdirSync(join(shellRoot, "inputs"), { recursive: true });
|
|
990
990
|
mkdirSync(join(shellRoot, "outputs"), { recursive: true });
|
|
991
|
-
linkPath(
|
|
992
|
-
linkPath(join(
|
|
993
|
-
linkIfExists(
|
|
994
|
-
linkIfExists(
|
|
995
|
-
|
|
996
|
-
|
|
991
|
+
linkPath(verifiableContextInterfConfigPath(verifiableContextPath), join(shellRoot, "interf.json"));
|
|
992
|
+
linkPath(join(verifiableContextRuntimeRoot(verifiableContextPath), "stage-contract.json"), shellRuntimePath(shellRoot, "stage-contract.json"));
|
|
993
|
+
linkIfExists(verifiableContextRuntimeSourceSnapshotPath(verifiableContextPath), shellRuntimePath(shellRoot, "source-snapshot.json"));
|
|
994
|
+
linkIfExists(verifiableContextRuntimeStageInputsPath(verifiableContextPath, stage.id), shellRuntimePath(shellRoot, "stage-inputs.json"));
|
|
995
|
+
projectVerifiableContextSchemaArtifacts(verifiableContextPath, shellRoot, schema, new Set([...stage.reads, ...stage.writes]), materializedArtifacts);
|
|
996
|
+
projectBuildPlanMetadata(verifiableContextPath, shellRoot, stage);
|
|
997
997
|
projectStageArtifactMountAliases(shellRoot, stage, schema);
|
|
998
|
-
writeExecutionShellPathsFile(shellRoot,
|
|
999
|
-
const agentsContent = renderStageExecutionAgents(
|
|
1000
|
-
writeNativeAgentSurface(shellRoot, agentsContent, "interf-stage", renderStageExecutionSkill(stage,
|
|
998
|
+
writeExecutionShellPathsFile(shellRoot, buildPlanId, stage, buildStageArtifactMounts(verifiableContextPath, shellRoot, stage, schema));
|
|
999
|
+
const agentsContent = renderStageExecutionAgents(verifiableContextName, buildPlanId, stage);
|
|
1000
|
+
writeNativeAgentSurface(shellRoot, agentsContent, "interf-stage", renderStageExecutionSkill(stage, readStageBuildPlanDoc(verifiableContextPath, stage)));
|
|
1001
1001
|
return {
|
|
1002
1002
|
rootPath: shellRoot,
|
|
1003
1003
|
};
|
|
@@ -1005,48 +1005,48 @@ export function createStageExecutionShell(compiledPath, compiledName, methodId,
|
|
|
1005
1005
|
export function freezeStageExecutionShell(rootPath) {
|
|
1006
1006
|
return freezePreservedShell(rootPath, "stage-execution");
|
|
1007
1007
|
}
|
|
1008
|
-
export function
|
|
1009
|
-
const schema =
|
|
1010
|
-
const loopRootPath =
|
|
1008
|
+
export function createBuildPlanImprovementShell(options) {
|
|
1009
|
+
const schema = ensureBuildExecutionSurface(options.verifiableContextPath);
|
|
1010
|
+
const loopRootPath = buildPlanImprovementLoopRoot(options.verifiableContextPath, options.runId, options.loopIndex);
|
|
1011
1011
|
const shellRoot = join(loopRootPath, "shell");
|
|
1012
1012
|
mkdirSync(shellRoot, { recursive: true });
|
|
1013
1013
|
mkdirSync(join(shellRoot, "runtime"), { recursive: true });
|
|
1014
1014
|
mkdirSync(join(shellRoot, "artifacts"), { recursive: true });
|
|
1015
1015
|
mkdirSync(join(loopRootPath, "logs"), { recursive: true });
|
|
1016
1016
|
writeFileSync(join(shellRoot, "runtime", "loop-context.json"), `${JSON.stringify(options.context, null, 2)}\n`);
|
|
1017
|
-
|
|
1017
|
+
projectVerifiableContextReviewArtifactsSnapshot(options.verifiableContextPath, shellRoot, schema);
|
|
1018
1018
|
copyResolvedTree({
|
|
1019
|
-
sourcePath:
|
|
1020
|
-
targetPath: join(shellRoot, "
|
|
1021
|
-
shellType: "
|
|
1019
|
+
sourcePath: buildPlanPackagePathForVerifiableContext(options.verifiableContextPath),
|
|
1020
|
+
targetPath: join(shellRoot, "build-plan"),
|
|
1021
|
+
shellType: "build-plan-improvement",
|
|
1022
1022
|
});
|
|
1023
|
-
copyIfExists(
|
|
1024
|
-
|
|
1025
|
-
const reviewSources =
|
|
1023
|
+
copyIfExists(verifiableContextInterfConfigPath(options.verifiableContextPath), join(shellRoot, "interf.json"), "build-plan-improvement");
|
|
1024
|
+
projectVerifiableContextRuntimeArtifacts(options.verifiableContextPath, shellRoot);
|
|
1025
|
+
const reviewSources = resolveBuildPlanImprovementReviewSourcePaths(options.verifiableContextPath);
|
|
1026
1026
|
if (reviewSources.executionShells) {
|
|
1027
|
-
copyIfExists(reviewSources.executionShells, join(shellRoot, "artifacts", "execution-shells"), "
|
|
1027
|
+
copyIfExists(reviewSources.executionShells, join(shellRoot, "artifacts", "execution-shells"), "build-plan-improvement");
|
|
1028
1028
|
}
|
|
1029
1029
|
if (reviewSources.readinessRuns) {
|
|
1030
|
-
copyIfExists(reviewSources.readinessRuns, join(shellRoot, "artifacts", "readiness-runs"), "
|
|
1030
|
+
copyIfExists(reviewSources.readinessRuns, join(shellRoot, "artifacts", "readiness-runs"), "build-plan-improvement");
|
|
1031
1031
|
}
|
|
1032
1032
|
if (reviewSources.targetTestRuns) {
|
|
1033
|
-
copyIfExists(reviewSources.targetTestRuns, join(shellRoot, "artifacts", "test-runs"), "
|
|
1033
|
+
copyIfExists(reviewSources.targetTestRuns, join(shellRoot, "artifacts", "test-runs"), "build-plan-improvement");
|
|
1034
1034
|
}
|
|
1035
1035
|
if (reviewSources.targetTestSandboxes) {
|
|
1036
|
-
copyIfExists(reviewSources.targetTestSandboxes, join(shellRoot, "artifacts", "test-sandboxes"), "
|
|
1036
|
+
copyIfExists(reviewSources.targetTestSandboxes, join(shellRoot, "artifacts", "test-sandboxes"), "build-plan-improvement");
|
|
1037
1037
|
}
|
|
1038
|
-
const agentsContent =
|
|
1039
|
-
writeNativeAgentSurface(shellRoot, agentsContent, "interf-
|
|
1038
|
+
const agentsContent = renderBuildPlanImprovementAgents(options.verifiableContextName, options.buildPlanId, options.loopIndex);
|
|
1039
|
+
writeNativeAgentSurface(shellRoot, agentsContent, "interf-build-plan-improver", renderBuildPlanImprovementSkill(options.buildPlanId, options.loopIndex, readBuildPlanImprovementDoc(options.verifiableContextPath)));
|
|
1040
1040
|
return {
|
|
1041
1041
|
rootPath: shellRoot,
|
|
1042
1042
|
loopRootPath,
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
promptLogPath: join(loopRootPath, "logs", "
|
|
1046
|
-
eventLogPath: join(loopRootPath, "logs", "
|
|
1047
|
-
statusLogPath: join(loopRootPath, "logs", "
|
|
1043
|
+
buildPlanBeforePath: join(loopRootPath, "build-plan-before"),
|
|
1044
|
+
buildPlanAfterPath: join(loopRootPath, "build-plan-after"),
|
|
1045
|
+
promptLogPath: join(loopRootPath, "logs", "build-plan-improver.prompt.txt"),
|
|
1046
|
+
eventLogPath: join(loopRootPath, "logs", "build-plan-improver.events.ndjson"),
|
|
1047
|
+
statusLogPath: join(loopRootPath, "logs", "build-plan-improver.status.log"),
|
|
1048
1048
|
};
|
|
1049
1049
|
}
|
|
1050
|
-
export function
|
|
1051
|
-
return freezePreservedShell(rootPath, "
|
|
1050
|
+
export function freezeBuildPlanImprovementShell(rootPath) {
|
|
1051
|
+
return freezePreservedShell(rootPath, "build-plan-improvement");
|
|
1052
1052
|
}
|