@interf/compiler 0.18.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/build-plan.js +376 -0
- 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.d.ts +0 -34
- package/dist/cli/commands/mcp.js +261 -60
- package/dist/cli/commands/prep.js +67 -35
- package/dist/cli/commands/reset.d.ts +1 -1
- package/dist/cli/commands/reset.js +6 -6
- package/dist/cli/commands/runs.js +105 -33
- package/dist/cli/commands/status.js +4 -2
- package/dist/cli/commands/test.d.ts +10 -0
- package/dist/cli/commands/{verify.js → test.js} +19 -21
- package/dist/cli/commands/web.js +82 -8
- package/dist/cli/commands/wizard.js +63 -64
- package/dist/cli/index.d.ts +4 -4
- package/dist/cli/index.js +7 -7
- package/dist/interf-ui/404.html +1 -0
- package/dist/interf-ui/__next.__PAGE__.txt +10 -0
- package/dist/{compiler-ui → interf-ui}/__next._full.txt +12 -12
- package/dist/interf-ui/__next._head.txt +5 -0
- package/dist/{compiler-ui → interf-ui}/__next._index.txt +4 -4
- package/dist/{compiler-ui → interf-ui}/__next._tree.txt +3 -3
- 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/{compiler-ui/_next/static/chunks/0_i-3_5l9t2qe.js → interf-ui/_next/static/chunks/0dn41fa_zvgsl.js} +1 -1
- 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/{compiler-ui/_next/static/chunks/08g7lvje.te.u.js → interf-ui/_next/static/chunks/0nv3am99vjzn4.js} +1 -1
- package/dist/{compiler-ui/_next/static/chunks/0n51hrfoufc7g.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/{compiler-ui/_next/static/chunks/08m7vf5asqlsm.js → interf-ui/_next/static/chunks/14dznb2qpt-ho.js} +5 -5
- package/dist/interf-ui/_next/static/chunks/15z_en80lrq-3.js +5 -0
- package/dist/{compiler-ui/_next/static/chunks/turbopack-10e~t1yzi4svj.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/{compiler-ui → interf-ui}/_not-found/__next._full.txt +9 -9
- package/dist/interf-ui/_not-found/__next._head.txt +5 -0
- package/dist/{compiler-ui → interf-ui}/_not-found/__next._index.txt +4 -4
- 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 -2
- package/dist/interf-ui/_not-found.html +1 -0
- package/dist/{compiler-ui → interf-ui}/_not-found.txt +9 -9
- package/dist/interf-ui/index.html +1 -0
- package/dist/{compiler-ui → interf-ui}/index.txt +12 -12
- 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} +57 -88
- 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/build-plans/package/local-build-plans.js +472 -0
- 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 +38 -41
- package/dist/packages/contracts/lib/schema.js +44 -35
- package/dist/packages/engine/action-definitions.d.ts +228 -67
- package/dist/packages/engine/action-definitions.js +277 -273
- package/dist/packages/engine/action-planner.d.ts +2 -2
- package/dist/packages/engine/action-planner.js +8 -15
- 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 +33 -31
- package/dist/packages/engine/agents/lib/shells.js +254 -250
- 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/connection-config.js +1 -1
- 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 +100 -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 +45 -39
- package/dist/packages/engine/instance-paths.js +54 -48
- package/dist/packages/engine/lib/schema.d.ts +1568 -484
- package/dist/packages/engine/lib/schema.js +172 -161
- package/dist/packages/engine/native-run-handlers.d.ts +12 -12
- package/dist/packages/engine/native-run-handlers.js +138 -136
- package/dist/packages/engine/preparation-store.d.ts +31 -36
- package/dist/packages/engine/preparation-store.js +42 -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 +5 -0
- package/dist/packages/engine/requested-artifacts.js +36 -0
- 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 +103 -90
- 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 +15 -15
- package/dist/packages/engine/runtime-proposal-helpers.js +81 -85
- package/dist/packages/engine/runtime-resource-builders.d.ts +16 -11
- package/dist/packages/engine/runtime-resource-builders.js +32 -21
- package/dist/packages/engine/runtime.d.ts +53 -60
- package/dist/packages/engine/runtime.js +555 -453
- package/dist/packages/engine/server.d.ts +2 -2
- package/dist/packages/engine/server.js +226 -143
- 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 +42 -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 +36 -36
- 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 +205 -12
- package/dist/packages/project/lib/schema.js +59 -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 +62 -58
- package/dist/packages/project/source-folders.js +1 -1
- package/package.json +14 -17
- package/public-repo/CONTRIBUTING.md +47 -0
- package/public-repo/README.md +327 -0
- package/public-repo/SECURITY.md +67 -0
- package/public-repo/build-plans/interf-default/README.md +33 -0
- package/public-repo/build-plans/interf-default/build/stages/shape/SKILL.md +27 -0
- package/{builtin-methods/interf-default/compile → public-repo/build-plans/interf-default/build}/stages/structure/SKILL.md +2 -2
- package/{builtin-methods/interf-default/compile → public-repo/build-plans/interf-default/build}/stages/summarize/SKILL.md +1 -1
- package/{builtin-methods/interf-default/method.json → public-repo/build-plans/interf-default/build-plan.json} +16 -16
- package/{builtin-methods/interf-default/method.schema.json → public-repo/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/build-plans/interf-default/use/query/SKILL.md +23 -0
- package/public-repo/plugins/README.md +9 -0
- package/public-repo/plugins/interf/.claude-plugin/plugin.json +21 -0
- package/public-repo/plugins/interf/.mcp.json +12 -0
- package/public-repo/plugins/interf/README.md +32 -0
- package/public-repo/plugins/interf/skills/interf/SKILL.md +376 -0
- package/public-repo/skills/interf/SKILL.md +376 -0
- package/README.md +0 -311
- package/agent-skills/interf-actions/SKILL.md +0 -185
- package/agent-skills/interf-actions/references/cli.md +0 -243
- package/builtin-methods/interf-default/README.md +0 -29
- package/builtin-methods/interf-default/compile/stages/shape/SKILL.md +0 -31
- package/builtin-methods/interf-default/improve/SKILL.md +0 -18
- package/builtin-methods/interf-default/use/query/SKILL.md +0 -28
- package/dist/cli/commands/method.d.ts +0 -2
- package/dist/cli/commands/method.js +0 -113
- package/dist/cli/commands/verify.d.ts +0 -10
- package/dist/compiler-ui/404.html +0 -1
- package/dist/compiler-ui/__next.__PAGE__.txt +0 -10
- package/dist/compiler-ui/__next._head.txt +0 -5
- package/dist/compiler-ui/_next/static/chunks/06yhdspx~ca5-.js +0 -5
- package/dist/compiler-ui/_next/static/chunks/06z~l3kwb891e.js +0 -1
- package/dist/compiler-ui/_next/static/chunks/0_c_tvh-cukjz.css +0 -3
- package/dist/compiler-ui/_next/static/chunks/0b-ywny_j0g~0.js +0 -1
- package/dist/compiler-ui/_next/static/chunks/0b52v41o1gixx.js +0 -1
- package/dist/compiler-ui/_next/static/chunks/0f_geuwdesg_c.js +0 -114
- package/dist/compiler-ui/_next/static/chunks/0gpzgsv0w.q~m.js +0 -31
- package/dist/compiler-ui/_next/static/chunks/0ilwfezfvu6~-.js +0 -1
- package/dist/compiler-ui/_next/static/chunks/0xxmf45eskdt~.css +0 -1
- package/dist/compiler-ui/_next/static/chunks/14wtz~vq25~qq.js +0 -1
- package/dist/compiler-ui/_next/static/chunks/turbopack-0.uq1k8c0j4s..js +0 -1
- package/dist/compiler-ui/_not-found/__next._head.txt +0 -5
- 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/index.html +0 -1
- 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 -34
- 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 -73
- package/dist/packages/methods/package/local-methods.js +0 -457
- 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/dist/{compiler-ui/_next/static/6qyE1u9m_oBUkvAhhoCmO → interf-ui/_next/static/_qJKnA0dammQ306MG_zMq}/_buildManifest.js +0 -0
- /package/dist/{compiler-ui/_next/static/6qyE1u9m_oBUkvAhhoCmO → interf-ui/_next/static/_qJKnA0dammQ306MG_zMq}/_clientMiddlewareManifest.js +0 -0
- /package/dist/{compiler-ui/_next/static/6qyE1u9m_oBUkvAhhoCmO → 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
- /package/{LICENSE.md → public-repo/LICENSE.md} +0 -0
- /package/{TRADEMARKS.md → public-repo/TRADEMARKS.md} +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
|
|
63
|
-
"- `.interf/interf.json` records the selected
|
|
64
|
-
`-
|
|
65
|
-
...(
|
|
66
|
-
? ["- This
|
|
62
|
+
"- The Build Plan defines the context interface this verifiable context implements on disk.",
|
|
63
|
+
"- `.interf/interf.json` records the selected Source binding and Preparation metadata.",
|
|
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
|
-
`-
|
|
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
|
|
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,70 +756,74 @@ 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
|
+
"- otherwise draft the Build Plan Artifacts from every `requested_artifacts[]` entry; do not ignore or truncate them",
|
|
763
764
|
"- preserve deterministic stage and context-interface contracts",
|
|
764
|
-
"- stop once the
|
|
765
|
+
"- stop once the Build Plan edits are complete",
|
|
765
766
|
"",
|
|
766
767
|
].join("\n");
|
|
767
768
|
}
|
|
768
|
-
function
|
|
769
|
+
function renderBuildPlanAuthoringSkill() {
|
|
769
770
|
return [
|
|
770
771
|
"---",
|
|
771
|
-
"name: interf-
|
|
772
|
+
"name: interf-build-plan-author",
|
|
772
773
|
"description: >",
|
|
773
|
-
" Native local
|
|
774
|
+
" Native local Build Plan authoring skill for an automated Interf Build Plan draft run.",
|
|
774
775
|
"---",
|
|
775
776
|
"",
|
|
776
|
-
"# Interf
|
|
777
|
+
"# Interf Build Plan Authoring",
|
|
777
778
|
"",
|
|
778
779
|
"Read `runtime/authoring-context.json` first.",
|
|
779
|
-
"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.",
|
|
780
781
|
"",
|
|
781
782
|
"Rules:",
|
|
782
|
-
"- edit only `
|
|
783
|
-
`- keep \`
|
|
783
|
+
"- edit only `build-plan/`",
|
|
784
|
+
`- keep \`build-plan.json\`, \`${BUILD_PLAN_SCHEMA_FILE}\`, and any changed stage docs aligned`,
|
|
784
785
|
"- put deterministic validation on Artifact `checks[]`; do not add stage `acceptance` blocks",
|
|
785
786
|
"- use only CheckKind values listed in `runtime/authoring-context.json`; do not invent aliases",
|
|
786
|
-
"- keep Artifact checks
|
|
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",
|
|
787
788
|
"- satisfy every `artifact_requirements[]` entry from `runtime/authoring-context.json` when entries are present",
|
|
789
|
+
"- otherwise draft the Build Plan Artifacts from every `requested_artifacts[]` entry; do not ignore or truncate them",
|
|
788
790
|
"- design the stage graph from the source data and preparation-and-evidence brief",
|
|
789
791
|
"- use kebab-case ids everywhere: stage ids, skill_dir values, Artifact ids, reads/writes values, and package ids; never use underscores",
|
|
790
|
-
"- 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",
|
|
791
793
|
"- keep the package standalone; do not introduce runtime inheritance or hidden source-package assumptions",
|
|
792
|
-
"- 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",
|
|
793
795
|
"- respect stage boundaries: do not make structure outputs link to notes or entrypoints first created by later stages",
|
|
794
796
|
"- prefer conservative routing changes over speculative note sprawl",
|
|
795
797
|
"- prefer direct file-reading and search tools over shell commands for routine file inspection",
|
|
796
798
|
"- do not use shell helpers like `cat`, `sed`, `ls`, or `find` when a native read/search tool can inspect the same files",
|
|
797
|
-
"- do not hardcode readiness-check answers into reusable
|
|
799
|
+
"- do not hardcode readiness-check answers into reusable Build Plan docs",
|
|
798
800
|
"- do not edit source artifacts",
|
|
799
801
|
"",
|
|
800
802
|
].join("\n");
|
|
801
803
|
}
|
|
802
|
-
function
|
|
803
|
-
return join(
|
|
804
|
+
function improvementBuildPlanDocsPath(verifiableContextPath) {
|
|
805
|
+
return join(buildPlanPackagePathForVerifiableContext(verifiableContextPath), "improve");
|
|
804
806
|
}
|
|
805
|
-
export function
|
|
806
|
-
const shellRoot = mkdtempSync(join(tmpdir(), `interf-
|
|
807
|
+
export function createBuildPlanAuthoringShell(options) {
|
|
808
|
+
const shellRoot = mkdtempSync(join(tmpdir(), `interf-build-plan-author-${options.buildPlanId}-`));
|
|
807
809
|
mkdirSync(join(shellRoot, "runtime"), { recursive: true });
|
|
808
810
|
mkdirSync(join(shellRoot, "artifacts"), { recursive: true });
|
|
809
811
|
mkdirSync(join(shellRoot, "logs"), { recursive: true });
|
|
810
812
|
const context = {
|
|
811
|
-
kind: "interf-
|
|
813
|
+
kind: "interf-build-plan-authoring",
|
|
812
814
|
version: 1,
|
|
813
815
|
generated_at: new Date().toISOString(),
|
|
814
816
|
authoring_mode: "from-scratch",
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
...(options.
|
|
817
|
+
build_plan_id: options.buildPlanId,
|
|
818
|
+
build_plan_label: options.label,
|
|
819
|
+
...(options.referenceBuildPlanId ? { reference_build_plan_id: options.referenceBuildPlanId } : {}),
|
|
818
820
|
task_prompt: options.taskPrompt,
|
|
819
821
|
allowed_check_kinds: CHECK_KINDS,
|
|
822
|
+
requested_artifacts: options.requestedArtifacts ?? [],
|
|
820
823
|
artifact_requirements: options.artifactRequirements ?? [],
|
|
821
824
|
preparation: {
|
|
822
825
|
source_folder_path: options.sourceFolderPath,
|
|
826
|
+
source_profile: options.sourceProfile ?? null,
|
|
823
827
|
checks: {
|
|
824
828
|
count: options.checks.length,
|
|
825
829
|
questions: options.checks.map((check, index) => ({
|
|
@@ -830,88 +834,88 @@ export function createMethodAuthoringShell(options) {
|
|
|
830
834
|
},
|
|
831
835
|
};
|
|
832
836
|
writeFileSync(join(shellRoot, "runtime", "authoring-context.json"), `${JSON.stringify(context, null, 2)}\n`);
|
|
833
|
-
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`);
|
|
834
838
|
copyResolvedTree({
|
|
835
|
-
sourcePath: options.
|
|
836
|
-
targetPath: join(shellRoot, "
|
|
837
|
-
shellType: "
|
|
839
|
+
sourcePath: options.buildPlanPath,
|
|
840
|
+
targetPath: join(shellRoot, "build-plan"),
|
|
841
|
+
shellType: "build-plan-authoring",
|
|
838
842
|
});
|
|
839
|
-
writeNativeAgentSurface(shellRoot,
|
|
840
|
-
|
|
843
|
+
writeNativeAgentSurface(shellRoot, renderBuildPlanAuthoringAgents({
|
|
844
|
+
buildPlanId: options.buildPlanId,
|
|
841
845
|
label: options.label,
|
|
842
|
-
|
|
843
|
-
}), "interf-
|
|
846
|
+
referenceBuildPlanId: options.referenceBuildPlanId ?? null,
|
|
847
|
+
}), "interf-build-plan-author", renderBuildPlanAuthoringSkill());
|
|
844
848
|
return {
|
|
845
849
|
rootPath: shellRoot,
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
promptLogPath: join(shellRoot, "logs", "
|
|
849
|
-
eventLogPath: join(shellRoot, "logs", "
|
|
850
|
-
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"),
|
|
851
855
|
};
|
|
852
856
|
}
|
|
853
|
-
function
|
|
857
|
+
function renderBuildPlanImprovementAgents(verifiableContextName, buildPlanId, loopIndex) {
|
|
854
858
|
return [
|
|
855
|
-
`# ${
|
|
859
|
+
`# ${verifiableContextName} — Build Plan Improvement Shell`,
|
|
856
860
|
"",
|
|
857
|
-
"This is an automated
|
|
858
|
-
"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.",
|
|
859
863
|
"",
|
|
860
864
|
"## Start Here",
|
|
861
865
|
"",
|
|
862
866
|
"1. Read `runtime/loop-context.json` now.",
|
|
863
|
-
`2. Read \`
|
|
864
|
-
"3. Read `
|
|
865
|
-
"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.",
|
|
866
870
|
"",
|
|
867
871
|
"## Boundaries",
|
|
868
872
|
"",
|
|
869
|
-
`-
|
|
873
|
+
`- Build Plan: \`${buildPlanId}\`.`,
|
|
870
874
|
`- Improvement loop: ${loopIndex}.`,
|
|
871
|
-
"- Edit only files under `
|
|
875
|
+
"- Edit only files under `build-plan/`.",
|
|
872
876
|
"- Do not edit checks, test specs, source files, or generated context outputs.",
|
|
873
|
-
"- Review context outputs under `artifacts/
|
|
874
|
-
"- 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`.",
|
|
875
879
|
"- Put deterministic validation on Artifact `checks[]`; do not add stage `acceptance` blocks.",
|
|
876
880
|
"",
|
|
877
881
|
"## Goal",
|
|
878
882
|
"",
|
|
879
|
-
"- create a better
|
|
880
|
-
"- preserve deterministic
|
|
881
|
-
"- 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",
|
|
882
886
|
"",
|
|
883
887
|
].join("\n");
|
|
884
888
|
}
|
|
885
|
-
function
|
|
886
|
-
const path = join(
|
|
889
|
+
function readBuildPlanImprovementDoc(verifiableContextPath) {
|
|
890
|
+
const path = join(improvementBuildPlanDocsPath(verifiableContextPath), "SKILL.md");
|
|
887
891
|
if (!existsSync(path))
|
|
888
892
|
return null;
|
|
889
893
|
return readFileSync(path, "utf8").trim();
|
|
890
894
|
}
|
|
891
|
-
function
|
|
895
|
+
function renderBuildPlanImprovementSkill(buildPlanId, loopIndex, improvementDoc) {
|
|
892
896
|
return [
|
|
893
897
|
"---",
|
|
894
|
-
"name: interf-
|
|
898
|
+
"name: interf-build-plan-improver",
|
|
895
899
|
"description: >",
|
|
896
|
-
" Native local
|
|
897
|
-
" 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.",
|
|
898
902
|
"---",
|
|
899
903
|
"",
|
|
900
|
-
`# Interf
|
|
904
|
+
`# Interf Build Plan Improvement — ${buildPlanId}`,
|
|
901
905
|
"",
|
|
902
|
-
"This local native skill exists for automated
|
|
906
|
+
"This local native skill exists for automated Build Plan improvement loops.",
|
|
903
907
|
"Read `runtime/loop-context.json` first.",
|
|
904
|
-
"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/`.",
|
|
905
909
|
"",
|
|
906
910
|
"## Current Loop",
|
|
907
911
|
"",
|
|
908
|
-
`-
|
|
912
|
+
`- Build Plan: \`${buildPlanId}\``,
|
|
909
913
|
`- loop index: ${loopIndex}`,
|
|
910
|
-
"- editable source: `
|
|
914
|
+
"- editable source: `build-plan/improve/SKILL.md`",
|
|
911
915
|
"",
|
|
912
916
|
...(improvementDoc
|
|
913
917
|
? [
|
|
914
|
-
"## Improvement
|
|
918
|
+
"## Improvement Guidance",
|
|
915
919
|
"",
|
|
916
920
|
improvementDoc,
|
|
917
921
|
"",
|
|
@@ -919,19 +923,19 @@ function renderMethodImprovementSkill(methodId, loopIndex, improvementDoc) {
|
|
|
919
923
|
: []),
|
|
920
924
|
].join("\n");
|
|
921
925
|
}
|
|
922
|
-
function
|
|
923
|
-
const
|
|
924
|
-
mkdirSync(
|
|
926
|
+
function projectVerifiableContextReviewArtifactsSnapshot(verifiableContextPath, shellRoot, schema) {
|
|
927
|
+
const verifiableContextViewRoot = join(shellRoot, "artifacts", "verifiable-context-view");
|
|
928
|
+
mkdirSync(verifiableContextViewRoot, { recursive: true });
|
|
925
929
|
for (const artifact of listContextInterfaceArtifacts(schema)) {
|
|
926
930
|
if (artifact.kind === "runtime" || artifact.path === "source-files")
|
|
927
931
|
continue;
|
|
928
|
-
const sourcePath =
|
|
932
|
+
const sourcePath = verifiableContextArtifactAbsolutePath(verifiableContextPath, artifact);
|
|
929
933
|
if (!existsSync(sourcePath))
|
|
930
934
|
continue;
|
|
931
935
|
copyResolvedTree({
|
|
932
936
|
sourcePath,
|
|
933
|
-
targetPath: join(
|
|
934
|
-
shellType: "
|
|
937
|
+
targetPath: join(verifiableContextViewRoot, artifact.path),
|
|
938
|
+
shellType: "build-plan-improvement",
|
|
935
939
|
});
|
|
936
940
|
}
|
|
937
941
|
}
|
|
@@ -944,10 +948,10 @@ function copyIfExists(sourcePath, targetPath, shellType) {
|
|
|
944
948
|
shellType,
|
|
945
949
|
});
|
|
946
950
|
}
|
|
947
|
-
function
|
|
948
|
-
const runtimeTarget = join(shellRoot, "artifacts", "
|
|
951
|
+
function projectVerifiableContextRuntimeArtifacts(verifiableContextPath, shellRoot) {
|
|
952
|
+
const runtimeTarget = join(shellRoot, "artifacts", "verifiable-context-runtime");
|
|
949
953
|
mkdirSync(runtimeTarget, { recursive: true });
|
|
950
|
-
const runtimeRoot =
|
|
954
|
+
const runtimeRoot = verifiableContextRuntimeRoot(verifiableContextPath);
|
|
951
955
|
const artifactNames = [
|
|
952
956
|
"run.json",
|
|
953
957
|
"run-history.jsonl",
|
|
@@ -960,40 +964,40 @@ function projectCompiledRuntimeArtifacts(compiledPath, shellRoot) {
|
|
|
960
964
|
"logs",
|
|
961
965
|
];
|
|
962
966
|
for (const artifactName of artifactNames) {
|
|
963
|
-
copyIfExists(join(runtimeRoot, artifactName), join(runtimeTarget, artifactName), "
|
|
967
|
+
copyIfExists(join(runtimeRoot, artifactName), join(runtimeTarget, artifactName), "build-plan-improvement");
|
|
964
968
|
}
|
|
965
969
|
}
|
|
966
|
-
export function pruneStageExecutionShells(
|
|
967
|
-
rmSync(stageExecutionShellsRoot(
|
|
970
|
+
export function pruneStageExecutionShells(verifiableContextPath) {
|
|
971
|
+
rmSync(stageExecutionShellsRoot(verifiableContextPath), { recursive: true, force: true });
|
|
968
972
|
}
|
|
969
|
-
export function
|
|
970
|
-
const agentsContent =
|
|
971
|
-
const querySkillContent =
|
|
972
|
-
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));
|
|
973
977
|
}
|
|
974
978
|
export function projectSourceFilesTestQueryShell(rootPath) {
|
|
975
979
|
return writeNativeAgentSurface(rootPath, renderSourceFilesTestAgents(), "interf-query", renderSourceFilesTestQuerySkill());
|
|
976
980
|
}
|
|
977
|
-
export function createStageExecutionShell(
|
|
978
|
-
const schema =
|
|
981
|
+
export function createStageExecutionShell(verifiableContextPath, verifiableContextName, buildPlanId, stage, writeArtifacts = []) {
|
|
982
|
+
const schema = ensureBuildExecutionSurface(verifiableContextPath);
|
|
979
983
|
const materializedArtifacts = stageMaterializedArtifactSet(schema, stage, writeArtifacts);
|
|
980
|
-
const shellsRoot = stageExecutionShellsRoot(
|
|
984
|
+
const shellsRoot = stageExecutionShellsRoot(verifiableContextPath);
|
|
981
985
|
const shellRoot = join(shellsRoot, `${stage.id}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`);
|
|
982
986
|
mkdirSync(shellRoot, { recursive: true });
|
|
983
987
|
mkdirSync(join(shellRoot, "runtime"), { recursive: true });
|
|
984
988
|
mkdirSync(join(shellRoot, ".interf", "runtime"), { recursive: true });
|
|
985
989
|
mkdirSync(join(shellRoot, "inputs"), { recursive: true });
|
|
986
990
|
mkdirSync(join(shellRoot, "outputs"), { recursive: true });
|
|
987
|
-
linkPath(
|
|
988
|
-
linkPath(join(
|
|
989
|
-
linkIfExists(
|
|
990
|
-
linkIfExists(
|
|
991
|
-
|
|
992
|
-
|
|
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);
|
|
993
997
|
projectStageArtifactMountAliases(shellRoot, stage, schema);
|
|
994
|
-
writeExecutionShellPathsFile(shellRoot,
|
|
995
|
-
const agentsContent = renderStageExecutionAgents(
|
|
996
|
-
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)));
|
|
997
1001
|
return {
|
|
998
1002
|
rootPath: shellRoot,
|
|
999
1003
|
};
|
|
@@ -1001,48 +1005,48 @@ export function createStageExecutionShell(compiledPath, compiledName, methodId,
|
|
|
1001
1005
|
export function freezeStageExecutionShell(rootPath) {
|
|
1002
1006
|
return freezePreservedShell(rootPath, "stage-execution");
|
|
1003
1007
|
}
|
|
1004
|
-
export function
|
|
1005
|
-
const schema =
|
|
1006
|
-
const loopRootPath =
|
|
1008
|
+
export function createBuildPlanImprovementShell(options) {
|
|
1009
|
+
const schema = ensureBuildExecutionSurface(options.verifiableContextPath);
|
|
1010
|
+
const loopRootPath = buildPlanImprovementLoopRoot(options.verifiableContextPath, options.runId, options.loopIndex);
|
|
1007
1011
|
const shellRoot = join(loopRootPath, "shell");
|
|
1008
1012
|
mkdirSync(shellRoot, { recursive: true });
|
|
1009
1013
|
mkdirSync(join(shellRoot, "runtime"), { recursive: true });
|
|
1010
1014
|
mkdirSync(join(shellRoot, "artifacts"), { recursive: true });
|
|
1011
1015
|
mkdirSync(join(loopRootPath, "logs"), { recursive: true });
|
|
1012
1016
|
writeFileSync(join(shellRoot, "runtime", "loop-context.json"), `${JSON.stringify(options.context, null, 2)}\n`);
|
|
1013
|
-
|
|
1017
|
+
projectVerifiableContextReviewArtifactsSnapshot(options.verifiableContextPath, shellRoot, schema);
|
|
1014
1018
|
copyResolvedTree({
|
|
1015
|
-
sourcePath:
|
|
1016
|
-
targetPath: join(shellRoot, "
|
|
1017
|
-
shellType: "
|
|
1019
|
+
sourcePath: buildPlanPackagePathForVerifiableContext(options.verifiableContextPath),
|
|
1020
|
+
targetPath: join(shellRoot, "build-plan"),
|
|
1021
|
+
shellType: "build-plan-improvement",
|
|
1018
1022
|
});
|
|
1019
|
-
copyIfExists(
|
|
1020
|
-
|
|
1021
|
-
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);
|
|
1022
1026
|
if (reviewSources.executionShells) {
|
|
1023
|
-
copyIfExists(reviewSources.executionShells, join(shellRoot, "artifacts", "execution-shells"), "
|
|
1027
|
+
copyIfExists(reviewSources.executionShells, join(shellRoot, "artifacts", "execution-shells"), "build-plan-improvement");
|
|
1024
1028
|
}
|
|
1025
1029
|
if (reviewSources.readinessRuns) {
|
|
1026
|
-
copyIfExists(reviewSources.readinessRuns, join(shellRoot, "artifacts", "readiness-runs"), "
|
|
1030
|
+
copyIfExists(reviewSources.readinessRuns, join(shellRoot, "artifacts", "readiness-runs"), "build-plan-improvement");
|
|
1027
1031
|
}
|
|
1028
1032
|
if (reviewSources.targetTestRuns) {
|
|
1029
|
-
copyIfExists(reviewSources.targetTestRuns, join(shellRoot, "artifacts", "test-runs"), "
|
|
1033
|
+
copyIfExists(reviewSources.targetTestRuns, join(shellRoot, "artifacts", "test-runs"), "build-plan-improvement");
|
|
1030
1034
|
}
|
|
1031
1035
|
if (reviewSources.targetTestSandboxes) {
|
|
1032
|
-
copyIfExists(reviewSources.targetTestSandboxes, join(shellRoot, "artifacts", "test-sandboxes"), "
|
|
1036
|
+
copyIfExists(reviewSources.targetTestSandboxes, join(shellRoot, "artifacts", "test-sandboxes"), "build-plan-improvement");
|
|
1033
1037
|
}
|
|
1034
|
-
const agentsContent =
|
|
1035
|
-
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)));
|
|
1036
1040
|
return {
|
|
1037
1041
|
rootPath: shellRoot,
|
|
1038
1042
|
loopRootPath,
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
promptLogPath: join(loopRootPath, "logs", "
|
|
1042
|
-
eventLogPath: join(loopRootPath, "logs", "
|
|
1043
|
-
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"),
|
|
1044
1048
|
};
|
|
1045
1049
|
}
|
|
1046
|
-
export function
|
|
1047
|
-
return freezePreservedShell(rootPath, "
|
|
1050
|
+
export function freezeBuildPlanImprovementShell(rootPath) {
|
|
1051
|
+
return freezePreservedShell(rootPath, "build-plan-improvement");
|
|
1048
1052
|
}
|