@interf/compiler 0.9.5 → 0.16.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/README.md +135 -91
- package/TRADEMARKS.md +2 -13
- package/agent-skills/interf-actions/SKILL.md +143 -38
- package/agent-skills/interf-actions/references/cli.md +134 -67
- package/builtin-methods/interf-default/README.md +3 -4
- package/builtin-methods/interf-default/compile/stages/shape/SKILL.md +2 -2
- package/builtin-methods/interf-default/compile/stages/summarize/SKILL.md +2 -1
- package/builtin-methods/interf-default/improve/SKILL.md +1 -1
- package/builtin-methods/interf-default/method.json +10 -4
- package/builtin-methods/interf-default/method.schema.json +0 -9
- package/builtin-methods/interf-default/use/query/SKILL.md +5 -5
- package/dist/cli/commands/agents.d.ts +2 -0
- package/dist/cli/commands/agents.js +213 -0
- package/dist/cli/commands/compile.d.ts +8 -25
- package/dist/cli/commands/compile.js +83 -359
- package/dist/cli/commands/doctor.js +2 -2
- package/dist/cli/commands/login.d.ts +7 -0
- package/dist/cli/commands/login.js +39 -0
- package/dist/cli/commands/logout.d.ts +2 -0
- package/dist/cli/commands/logout.js +16 -0
- package/dist/cli/commands/mcp.d.ts +42 -0
- package/dist/cli/commands/mcp.js +239 -0
- package/dist/cli/commands/method.d.ts +2 -0
- package/dist/cli/commands/method.js +113 -0
- package/dist/cli/commands/prep.d.ts +2 -0
- package/dist/cli/commands/prep.js +152 -0
- package/dist/cli/commands/reset.d.ts +8 -1
- package/dist/cli/commands/reset.js +47 -26
- package/dist/cli/commands/runs.d.ts +2 -0
- package/dist/cli/commands/runs.js +120 -0
- package/dist/cli/commands/status.d.ts +6 -1
- package/dist/cli/commands/status.js +68 -111
- package/dist/cli/commands/verify.d.ts +7 -1
- package/dist/cli/commands/verify.js +69 -85
- package/dist/cli/commands/web.d.ts +0 -9
- package/dist/cli/commands/web.js +201 -121
- package/dist/cli/commands/wizard.d.ts +9 -0
- package/dist/cli/commands/wizard.js +689 -0
- package/dist/cli/index.d.ts +10 -7
- package/dist/cli/index.js +19 -12
- package/dist/compiler-ui/404.html +1 -1
- package/dist/compiler-ui/__next.__PAGE__.txt +2 -2
- package/dist/compiler-ui/__next._full.txt +3 -3
- package/dist/compiler-ui/__next._head.txt +1 -1
- package/dist/compiler-ui/__next._index.txt +2 -2
- package/dist/compiler-ui/__next._tree.txt +2 -2
- package/dist/compiler-ui/_next/static/chunks/{177mvn4rse235.js → 0jipmpez3_ehh.js} +16 -16
- package/dist/compiler-ui/_next/static/chunks/{18a8f2jkv3z.c.css → 13awzu4tooflw.css} +1 -1
- package/dist/compiler-ui/_not-found/__next._full.txt +2 -2
- package/dist/compiler-ui/_not-found/__next._head.txt +1 -1
- package/dist/compiler-ui/_not-found/__next._index.txt +2 -2
- package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +1 -1
- package/dist/compiler-ui/_not-found/__next._not-found.txt +1 -1
- package/dist/compiler-ui/_not-found/__next._tree.txt +2 -2
- package/dist/compiler-ui/_not-found.html +1 -1
- package/dist/compiler-ui/_not-found.txt +2 -2
- package/dist/compiler-ui/index.html +1 -1
- package/dist/compiler-ui/index.txt +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/packages/contracts/index.d.ts +2 -1
- package/dist/packages/contracts/index.js +1 -0
- package/dist/packages/contracts/lib/preparation-paths.d.ts +117 -0
- package/dist/packages/contracts/lib/preparation-paths.js +177 -0
- package/dist/packages/contracts/lib/schema.d.ts +187 -13
- package/dist/packages/contracts/lib/schema.js +148 -3
- package/dist/packages/contracts/utils/filesystem.d.ts +9 -0
- package/dist/packages/contracts/utils/filesystem.js +142 -0
- package/dist/packages/{local-service → engine}/action-definitions.d.ts +14 -14
- package/dist/packages/{local-service → engine}/action-definitions.js +35 -29
- package/dist/packages/{local-service → engine}/action-planner.d.ts +1 -1
- package/dist/packages/{local-service → engine}/action-planner.js +3 -2
- package/dist/packages/{agents → engine/agents}/index.d.ts +3 -0
- package/dist/packages/{agents → engine/agents}/index.js +3 -0
- package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.js +2 -2
- package/dist/packages/engine/agents/lib/detection.d.ts +13 -0
- package/dist/packages/{agents → engine/agents}/lib/detection.js +11 -0
- package/dist/packages/{agents → engine/agents}/lib/executors.d.ts +2 -2
- package/dist/packages/{agents → engine/agents}/lib/shells.d.ts +5 -5
- package/dist/packages/{agents → engine/agents}/lib/shells.js +117 -58
- package/dist/packages/{agents → engine/agents}/lib/user-config.d.ts +4 -2
- package/dist/packages/engine/agents/lib/user-config.js +24 -0
- package/dist/packages/engine/agents/registry.d.ts +91 -0
- package/dist/packages/engine/agents/registry.js +321 -0
- package/dist/packages/engine/agents/role-executors.d.ts +35 -0
- package/dist/packages/engine/agents/role-executors.js +88 -0
- package/dist/packages/engine/agents/role-router.d.ts +66 -0
- package/dist/packages/engine/agents/role-router.js +73 -0
- package/dist/packages/{local-service → engine}/client.d.ts +59 -60
- package/dist/packages/{local-service → engine}/client.js +137 -145
- package/dist/packages/{compiler → engine/compile}/artifact-counts.js +1 -1
- package/dist/packages/{compiler → engine/compile}/compiled-paths.d.ts +9 -2
- package/dist/packages/{compiler → engine/compile}/compiled-paths.js +30 -15
- package/dist/packages/{compiler → engine/compile}/compiled-pipeline.d.ts +12 -1
- package/dist/packages/{compiler → engine/compile}/compiled-pipeline.js +39 -9
- package/dist/packages/{compiler → engine/compile}/compiled-schema.d.ts +2 -2
- package/dist/packages/{compiler → engine/compile}/compiled-schema.js +4 -4
- package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.js +8 -4
- package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.js +3 -3
- package/dist/packages/{compiler → engine/compile}/compiled-target.d.ts +3 -3
- package/dist/packages/{compiler → engine/compile}/compiled-target.js +3 -3
- package/dist/packages/{compiler → engine/compile}/discovery.js +1 -1
- package/dist/packages/{compiler → engine/compile}/index.d.ts +1 -0
- package/dist/packages/{compiler → engine/compile}/index.js +1 -0
- package/dist/packages/{compiler → engine/compile}/lib/schema.d.ts +26 -31
- package/dist/packages/{compiler → engine/compile}/lib/schema.js +2 -13
- package/dist/packages/engine/compile/method-runs.d.ts +14 -0
- package/dist/packages/{compiler → engine/compile}/method-runs.js +5 -6
- package/dist/packages/{compiler → engine/compile}/reset.js +3 -1
- package/dist/packages/{compiler → engine/compile}/runtime-acceptance.js +17 -14
- package/dist/packages/{compiler → engine/compile}/runtime-contracts.js +0 -3
- package/dist/packages/{compiler → engine/compile}/runtime-prompt.js +1 -1
- package/dist/packages/{compiler → engine/compile}/runtime-reconcile.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/runtime-reconcile.js +12 -10
- package/dist/packages/{compiler → engine/compile}/runtime-runs.d.ts +1 -2
- package/dist/packages/{compiler → engine/compile}/runtime-runs.js +3 -43
- package/dist/packages/{compiler → engine/compile}/runtime-types.d.ts +1 -5
- package/dist/packages/{compiler → engine/compile}/runtime.d.ts +2 -2
- package/dist/packages/{compiler → engine/compile}/runtime.js +1 -1
- package/dist/packages/engine/compile/source-files.d.ts +46 -0
- package/dist/packages/engine/compile/source-files.js +149 -0
- package/dist/packages/engine/compile/state-artifacts.d.ts +9 -0
- package/dist/packages/{compiler → engine/compile}/state-artifacts.js +4 -3
- package/dist/packages/{compiler → engine/compile}/state-health.js +2 -2
- package/dist/packages/{compiler → engine/compile}/state-io.d.ts +3 -2
- package/dist/packages/{compiler → engine/compile}/state-io.js +13 -7
- package/dist/packages/{compiler → engine/compile}/state-paths.d.ts +2 -1
- package/dist/packages/engine/compile/state-paths.js +16 -0
- package/dist/packages/engine/compile/state-view.d.ts +5 -0
- package/dist/packages/{compiler → engine/compile}/state-view.js +20 -30
- package/dist/packages/engine/compile/state.d.ts +7 -0
- package/dist/packages/{compiler → engine/compile}/state.js +3 -3
- package/dist/packages/{compiler → engine/compile}/validate-compiled.js +2 -2
- package/dist/packages/{compiler → engine/compile}/validate.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/validate.js +3 -3
- package/dist/packages/engine/connection-config.d.ts +38 -0
- package/dist/packages/engine/connection-config.js +75 -0
- package/dist/packages/{execution → engine/execution}/lib/schema.d.ts +52 -72
- package/dist/packages/{execution → engine/execution}/lib/schema.js +3 -3
- package/dist/packages/engine/index.d.ts +22 -0
- package/dist/packages/engine/index.js +15 -0
- package/dist/packages/engine/instance-paths.d.ts +100 -0
- package/dist/packages/engine/instance-paths.js +165 -0
- package/dist/packages/{local-service → engine}/lib/schema.d.ts +392 -2408
- package/dist/packages/{local-service → engine}/lib/schema.js +164 -76
- package/dist/packages/{local-service → engine}/native-run-handlers.d.ts +7 -5
- package/dist/packages/{local-service → engine}/native-run-handlers.js +71 -27
- package/dist/packages/engine/preparation-store.d.ts +104 -0
- package/dist/packages/engine/preparation-store.js +194 -0
- package/dist/packages/{local-service → engine}/readiness-check-draft.d.ts +2 -2
- package/dist/packages/engine/routes.d.ts +78 -0
- package/dist/packages/engine/routes.js +92 -0
- package/dist/packages/{local-service → engine}/run-observability.d.ts +3 -3
- package/dist/packages/{local-service → engine}/run-observability.js +25 -24
- package/dist/packages/engine/runtime-caches.d.ts +76 -0
- package/dist/packages/engine/runtime-caches.js +191 -0
- package/dist/packages/engine/runtime-event-applier.d.ts +12 -0
- package/dist/packages/engine/runtime-event-applier.js +177 -0
- package/dist/packages/engine/runtime-persistence.d.ts +47 -0
- package/dist/packages/engine/runtime-persistence.js +137 -0
- package/dist/packages/engine/runtime-proposal-helpers.d.ts +35 -0
- package/dist/packages/engine/runtime-proposal-helpers.js +251 -0
- package/dist/packages/engine/runtime-resource-builders.d.ts +52 -0
- package/dist/packages/engine/runtime-resource-builders.js +149 -0
- package/dist/packages/engine/runtime.d.ts +318 -0
- package/dist/packages/{local-service → engine}/runtime.js +835 -1011
- package/dist/packages/{local-service → engine}/server.d.ts +15 -0
- package/dist/packages/engine/server.js +1257 -0
- package/dist/packages/engine/service-registry.d.ts +47 -0
- package/dist/packages/engine/service-registry.js +137 -0
- package/dist/packages/{testing → engine/verify}/lib/schema.d.ts +11 -11
- package/dist/packages/{testing → engine/verify}/lib/schema.js +3 -3
- package/dist/packages/{testing → engine/verify}/readiness-check-run.d.ts +9 -16
- package/dist/packages/{testing → engine/verify}/readiness-check-run.js +38 -94
- package/dist/packages/{testing → engine/verify}/test-execution.js +6 -6
- package/dist/packages/{testing → engine/verify}/test-paths.js +5 -4
- package/dist/packages/{testing → engine/verify}/test-sandbox.d.ts +0 -1
- package/dist/packages/{testing → engine/verify}/test-sandbox.js +17 -33
- package/dist/packages/{testing → engine/verify}/test-specs.js +1 -1
- package/dist/packages/{testing → engine/verify}/test-targets.d.ts +1 -1
- package/dist/packages/{testing → engine/verify}/test-targets.js +9 -9
- package/dist/packages/{testing → engine/verify}/test.d.ts +1 -1
- package/dist/packages/{testing → engine/verify}/test.js +1 -1
- package/dist/packages/{method-authoring → methods/authoring}/method-authoring.d.ts +12 -4
- package/dist/packages/{method-authoring → methods/authoring}/method-authoring.js +70 -7
- package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.d.ts +2 -2
- package/dist/packages/{method-authoring → methods/authoring}/method-improvement.d.ts +4 -4
- package/dist/packages/{method-authoring → methods/authoring}/method-improvement.js +16 -10
- package/dist/packages/{method-package → methods/package}/builtin-compiled-method.d.ts +4 -5
- package/dist/packages/{method-package → methods/package}/builtin-compiled-method.js +10 -16
- package/dist/packages/{method-package → methods/package}/context-interface.d.ts +5 -41
- package/dist/packages/{method-package → methods/package}/context-interface.js +3 -25
- package/dist/packages/{method-package → methods/package}/interf-method-package.d.ts +4 -4
- package/dist/packages/{method-package → methods/package}/interf-method-package.js +24 -35
- package/dist/packages/{method-package → methods/package}/lib/package-root.js +2 -2
- package/dist/packages/{method-package → methods/package}/local-methods.d.ts +18 -8
- package/dist/packages/{method-package → methods/package}/local-methods.js +64 -45
- package/dist/packages/{method-package → methods/package}/method-definitions.d.ts +16 -36
- package/dist/packages/{method-package → methods/package}/method-definitions.js +53 -40
- package/dist/packages/{method-package → methods/package}/method-helpers.d.ts +2 -14
- package/dist/packages/{method-package → methods/package}/method-helpers.js +12 -46
- package/dist/packages/{method-package → methods/package}/method-review-paths.d.ts +1 -1
- package/dist/packages/{method-package → methods/package}/method-review-paths.js +1 -1
- package/dist/packages/{method-package → methods/package}/method-stage-runner.d.ts +4 -9
- package/dist/packages/{method-package → methods/package}/method-stage-runner.js +3 -31
- package/dist/packages/methods/package/user-methods.d.ts +17 -0
- package/dist/packages/methods/package/user-methods.js +77 -0
- package/dist/packages/{project-model → project}/index.d.ts +0 -1
- package/dist/packages/{project-model → project}/index.js +0 -1
- package/dist/packages/{project-model → project}/interf-bootstrap.d.ts +1 -1
- package/dist/packages/{project-model → project}/interf-bootstrap.js +1 -1
- package/dist/packages/{project-model → project}/interf-detect.d.ts +8 -3
- package/dist/packages/{project-model → project}/interf-detect.js +38 -38
- package/dist/packages/project/interf-scaffold.d.ts +3 -0
- package/dist/packages/{project-model → project}/interf-scaffold.js +30 -39
- package/dist/packages/{project-model → project}/lib/schema.d.ts +2 -2
- package/dist/packages/{project-model → project}/lib/schema.js +39 -2
- package/dist/packages/project/preparation-entries.d.ts +11 -0
- package/dist/packages/{project-model → project}/preparation-entries.js +14 -14
- package/dist/packages/{project-model → project}/source-config.d.ts +12 -12
- package/dist/packages/{project-model → project}/source-config.js +81 -53
- package/dist/packages/{project-model → project}/source-folders.d.ts +5 -5
- package/dist/packages/{project-model → project}/source-folders.js +16 -16
- package/package.json +8 -8
- package/CHANGELOG.md +0 -93
- package/LICENSE +0 -183
- package/dist/cli/commands/action-input-cli.d.ts +0 -25
- package/dist/cli/commands/action-input-cli.js +0 -73
- package/dist/cli/commands/control-path.d.ts +0 -11
- package/dist/cli/commands/control-path.js +0 -72
- package/dist/cli/commands/create-method-wizard.d.ts +0 -64
- package/dist/cli/commands/create-method-wizard.js +0 -434
- package/dist/cli/commands/create.d.ts +0 -6
- package/dist/cli/commands/create.js +0 -183
- package/dist/cli/commands/default.d.ts +0 -2
- package/dist/cli/commands/default.js +0 -39
- package/dist/cli/commands/executor-flow.d.ts +0 -29
- package/dist/cli/commands/executor-flow.js +0 -163
- package/dist/cli/commands/init.d.ts +0 -26
- package/dist/cli/commands/init.js +0 -771
- package/dist/cli/commands/list.d.ts +0 -2
- package/dist/cli/commands/list.js +0 -30
- package/dist/cli/commands/preparation-action.d.ts +0 -8
- package/dist/cli/commands/preparation-action.js +0 -29
- package/dist/cli/commands/preparation-picker.d.ts +0 -5
- package/dist/cli/commands/preparation-picker.js +0 -36
- package/dist/cli/commands/preparation-selection.d.ts +0 -6
- package/dist/cli/commands/preparation-selection.js +0 -11
- package/dist/cli/commands/service-action-flow.d.ts +0 -9
- package/dist/cli/commands/service-action-flow.js +0 -19
- package/dist/cli/commands/source-config-wizard.d.ts +0 -51
- package/dist/cli/commands/source-config-wizard.js +0 -670
- package/dist/cli/commands/test.d.ts +0 -17
- package/dist/cli/commands/test.js +0 -188
- package/dist/packages/agents/lib/detection.d.ts +0 -7
- package/dist/packages/agents/lib/user-config.js +0 -16
- package/dist/packages/compiler/method-runs.d.ts +0 -15
- package/dist/packages/compiler/raw-snapshot.d.ts +0 -49
- package/dist/packages/compiler/raw-snapshot.js +0 -101
- package/dist/packages/compiler/state-artifacts.d.ts +0 -8
- package/dist/packages/compiler/state-paths.js +0 -13
- package/dist/packages/compiler/state-view.d.ts +0 -4
- package/dist/packages/compiler/state.d.ts +0 -7
- package/dist/packages/local-service/index.d.ts +0 -18
- package/dist/packages/local-service/index.js +0 -13
- package/dist/packages/local-service/routes.d.ts +0 -32
- package/dist/packages/local-service/routes.js +0 -37
- package/dist/packages/local-service/runtime.d.ts +0 -133
- package/dist/packages/local-service/server.js +0 -627
- package/dist/packages/method-package/index.d.ts +0 -11
- package/dist/packages/method-package/index.js +0 -11
- package/dist/packages/method-package/method-stage-policy.d.ts +0 -5
- package/dist/packages/method-package/method-stage-policy.js +0 -31
- package/dist/packages/project-model/interf-scaffold.d.ts +0 -3
- package/dist/packages/project-model/preparation-entries.d.ts +0 -11
- package/dist/packages/project-model/project-paths.d.ts +0 -12
- package/dist/packages/project-model/project-paths.js +0 -33
- package/dist/packages/shared/filesystem.d.ts +0 -2
- package/dist/packages/shared/filesystem.js +0 -55
- /package/dist/compiler-ui/_next/static/{84FaeF3EzBF9kKTMjSEVN → a3UiUF0DiMEbfWy_0gihg}/_buildManifest.js +0 -0
- /package/dist/compiler-ui/_next/static/{84FaeF3EzBF9kKTMjSEVN → a3UiUF0DiMEbfWy_0gihg}/_clientMiddlewareManifest.js +0 -0
- /package/dist/compiler-ui/_next/static/{84FaeF3EzBF9kKTMjSEVN → a3UiUF0DiMEbfWy_0gihg}/_ssgManifest.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/file-types.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/file-types.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/logger.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/logger.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/naming.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/naming.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/parse.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/parse.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/path-guards.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/path-guards.js +0 -0
- /package/dist/packages/{local-service → engine}/action-values.d.ts +0 -0
- /package/dist/packages/{local-service → engine}/action-values.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/agents.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/agents.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/args.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/args.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/constants.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/constants.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/execution-profile.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/execution-profile.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/execution.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/execution.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/executors.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/logs.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/logs.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/preflight.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/preflight.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/render.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/render.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/schema.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/schema.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/status.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/status.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/types.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/types.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/artifact-counts.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/compiled-compile.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/compiled-compile.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/discovery.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/method-primitives.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/method-primitives.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/reset.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-acceptance.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-contracts.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-inventory.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-inventory.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-paths.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-paths.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-prompt.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-types.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/state-health.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/validate-compiled.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/validate-helpers.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/validate-helpers.js +0 -0
- /package/dist/packages/{execution → engine/execution}/adapters.d.ts +0 -0
- /package/dist/packages/{execution → engine/execution}/adapters.js +0 -0
- /package/dist/packages/{execution → engine/execution}/events.d.ts +0 -0
- /package/dist/packages/{execution → engine/execution}/events.js +0 -0
- /package/dist/packages/{execution → engine/execution}/index.d.ts +0 -0
- /package/dist/packages/{execution → engine/execution}/index.js +0 -0
- /package/dist/packages/{local-service → engine}/readiness-check-draft.js +0 -0
- /package/dist/packages/{testing → engine/verify}/index.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/index.js +0 -0
- /package/dist/packages/{testing → engine/verify}/test-execution.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/test-paths.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/test-profile-presets.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/test-profile-presets.js +0 -0
- /package/dist/packages/{testing → engine/verify}/test-specs.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/test-types.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/test-types.js +0 -0
- /package/dist/packages/{method-authoring → methods/authoring}/index.d.ts +0 -0
- /package/dist/packages/{method-authoring → methods/authoring}/index.js +0 -0
- /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.d.ts +0 -0
- /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.js +0 -0
- /package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.js +0 -0
- /package/dist/packages/{method-package → methods/package}/lib/package-root.d.ts +0 -0
- /package/dist/packages/{project-model → project}/interf.d.ts +0 -0
- /package/dist/packages/{project-model → project}/interf.js +0 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { basename, dirname, join } from "node:path";
|
|
3
|
-
import { targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, compiledInterfConfigPath, } from "../
|
|
3
|
+
import { targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, compiledInterfConfigPath, } from "../compile/compiled-paths.js";
|
|
4
|
+
import { asPreparationDataDir, preparationTestsSpecsRoot, } from "../../contracts/lib/preparation-paths.js";
|
|
4
5
|
const TEST_ID_PATTERN = /^[a-z0-9][a-z0-9-]{0,79}$/;
|
|
5
6
|
export const TEST_SPEC_EXTENSIONS = new Set([".json"]);
|
|
6
7
|
export function testSpecRootPath(sourcePath) {
|
|
7
|
-
return
|
|
8
|
+
return preparationTestsSpecsRoot(asPreparationDataDir(sourcePath));
|
|
8
9
|
}
|
|
9
10
|
export function testSpecTypePath(sourcePath, type) {
|
|
10
11
|
return join(testSpecRootPath(sourcePath), type);
|
|
@@ -18,7 +19,7 @@ export function targetTestRunsPath(compiledPath, type) {
|
|
|
18
19
|
return join(targetTestRunsRootForCompiled(compiledPath), type);
|
|
19
20
|
}
|
|
20
21
|
if (isPreparationTestsRootPath(compiledPath)) {
|
|
21
|
-
return join(compiledPath, type === "
|
|
22
|
+
return join(compiledPath, type === "source-files" ? "source-files" : "compiled", "runs");
|
|
22
23
|
}
|
|
23
24
|
throw new Error(`Unsupported test artifact root: ${compiledPath}. Expected portable context or interf/<preparation>/.interf/tests root.`);
|
|
24
25
|
}
|
|
@@ -30,7 +31,7 @@ export function targetTestSandboxesPath(compiledPath, type) {
|
|
|
30
31
|
return join(targetTestSandboxesRootForCompiled(compiledPath), type);
|
|
31
32
|
}
|
|
32
33
|
if (isPreparationTestsRootPath(compiledPath)) {
|
|
33
|
-
return join(compiledPath, type === "
|
|
34
|
+
return join(compiledPath, type === "source-files" ? "source-files" : "compiled", "sandboxes");
|
|
34
35
|
}
|
|
35
36
|
throw new Error(`Unsupported test artifact root: ${compiledPath}. Expected portable context or interf/<preparation>/.interf/tests root.`);
|
|
36
37
|
}
|
|
@@ -2,7 +2,6 @@ import type { TestTargetCandidate } from "./test-types.js";
|
|
|
2
2
|
export type TestSandboxRetentionMode = "on-failure" | "always";
|
|
3
3
|
export interface TestSandbox {
|
|
4
4
|
rootPath: string;
|
|
5
|
-
rawPath: string;
|
|
6
5
|
targetPath: string;
|
|
7
6
|
compiledPath: string | null;
|
|
8
7
|
preserve(destinationPath: string): string;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import { cpSync,
|
|
1
|
+
import { cpSync, mkdirSync, mkdtempSync, renameSync, rmSync, writeFileSync, } from "node:fs";
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
|
-
import { dirname, join
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
4
|
import { refreshCompiledBootstrapGuidance } from "../agents/lib/compiled-bootstrap.js";
|
|
5
|
-
import { readInterfConfig } from "
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { saveCompiledInterfConfig } from "
|
|
9
|
-
import {
|
|
10
|
-
import { refreshCompiledArtifacts } from "../
|
|
11
|
-
import { testRootForCompiled, stageExecutionShellsRoot, targetTestSandboxesRootForCompiled, methodImprovementLoopsRoot, compiledQueryAcceptanceRoot, compiledRuntimeLogsRoot, } from "../
|
|
12
|
-
function toPortableRelativePath(fromPath, toPath) {
|
|
13
|
-
return relative(fromPath, toPath).split(sep).join("/");
|
|
14
|
-
}
|
|
5
|
+
import { readInterfConfig, resolveSourceInputPath } from "../../project/interf.js";
|
|
6
|
+
import { projectSourceFilesTestQueryShell } from "../agents/lib/shells.js";
|
|
7
|
+
import { asPreparationDataDir, preparationPortableContextPath, } from "../../contracts/lib/preparation-paths.js";
|
|
8
|
+
import { saveCompiledInterfConfig } from "../../project/source-config.js";
|
|
9
|
+
import { buildCompiledSourceFiles } from "../compile/source-files.js";
|
|
10
|
+
import { refreshCompiledArtifacts } from "../compile/state.js";
|
|
11
|
+
import { testRootForCompiled, stageExecutionShellsRoot, targetTestSandboxesRootForCompiled, methodImprovementLoopsRoot, compiledQueryAcceptanceRoot, compiledRuntimeLogsRoot, } from "../compile/compiled-paths.js";
|
|
15
12
|
function sanitizeCompiledArtifacts(compiledPath) {
|
|
16
13
|
for (const absolutePath of [
|
|
17
14
|
testRootForCompiled(compiledPath),
|
|
@@ -28,16 +25,14 @@ export function createTestSandbox(target) {
|
|
|
28
25
|
let sandboxRoot = mkdtempSync(join(tmpdir(), "interf-test-sandbox-"));
|
|
29
26
|
let preserved = false;
|
|
30
27
|
const sandboxCompiledPath = () => (target.type === "compiled"
|
|
31
|
-
?
|
|
28
|
+
? preparationPortableContextPath(asPreparationDataDir(sandboxRoot), target.name)
|
|
32
29
|
: null);
|
|
33
|
-
const sandboxRawPath = () => (target.type === "compiled"
|
|
34
|
-
? join(portableContextPath(sandboxRoot, target.name), "raw")
|
|
35
|
-
: join(sandboxRoot, "raw"));
|
|
36
30
|
const sandboxTargetPath = () => (target.type === "compiled"
|
|
37
|
-
?
|
|
31
|
+
? preparationPortableContextPath(asPreparationDataDir(sandboxRoot), target.name)
|
|
38
32
|
: sandboxRoot);
|
|
39
33
|
try {
|
|
40
34
|
if (target.type === "compiled") {
|
|
35
|
+
const sourceInputPath = resolveSourceInputPath(target.path);
|
|
41
36
|
mkdirSync(dirname(sandboxTargetPath()), { recursive: true });
|
|
42
37
|
cpSync(target.path, sandboxTargetPath(), { recursive: true });
|
|
43
38
|
sanitizeCompiledArtifacts(sandboxTargetPath());
|
|
@@ -45,29 +40,21 @@ export function createTestSandbox(target) {
|
|
|
45
40
|
if (!sandboxConfig) {
|
|
46
41
|
throw new Error(`Sandbox portable context is missing interf.json: ${sandboxTargetPath()}`);
|
|
47
42
|
}
|
|
48
|
-
if (!existsSync(resolveCompiledRawPath(sandboxTargetPath(), sandboxConfig))) {
|
|
49
|
-
throw new Error(`Sandbox portable context is missing its local raw snapshot: ${sandboxTargetPath()}. Rebuild the portable context before testing it.`);
|
|
50
|
-
}
|
|
51
43
|
saveCompiledInterfConfig(sandboxTargetPath(), {
|
|
52
44
|
...sandboxConfig,
|
|
53
45
|
checks: [],
|
|
54
46
|
source: {
|
|
55
|
-
path:
|
|
47
|
+
path: sourceInputPath,
|
|
48
|
+
preparation_path: sourceInputPath,
|
|
56
49
|
},
|
|
57
50
|
});
|
|
58
51
|
refreshCompiledBootstrapGuidance(sandboxTargetPath());
|
|
59
52
|
refreshCompiledArtifacts(sandboxTargetPath(), { ensureViewSpec: true });
|
|
60
53
|
}
|
|
61
54
|
else {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
compiledPath: target.path,
|
|
66
|
-
mode: "link-or-copy",
|
|
67
|
-
prune: false,
|
|
68
|
-
preserveTimestamps: false,
|
|
69
|
-
});
|
|
70
|
-
projectRawTestQueryShell(sandboxTargetPath());
|
|
55
|
+
mkdirSync(join(sandboxTargetPath(), "runtime"), { recursive: true });
|
|
56
|
+
writeFileSync(join(sandboxTargetPath(), "runtime", "source-files.json"), `${JSON.stringify(buildCompiledSourceFiles(sandboxTargetPath(), target.path), null, 2)}\n`);
|
|
57
|
+
projectSourceFilesTestQueryShell(sandboxTargetPath());
|
|
71
58
|
}
|
|
72
59
|
}
|
|
73
60
|
catch (error) {
|
|
@@ -78,9 +65,6 @@ export function createTestSandbox(target) {
|
|
|
78
65
|
get rootPath() {
|
|
79
66
|
return sandboxRoot;
|
|
80
67
|
},
|
|
81
|
-
get rawPath() {
|
|
82
|
-
return sandboxRawPath();
|
|
83
|
-
},
|
|
84
68
|
get targetPath() {
|
|
85
69
|
return sandboxTargetPath();
|
|
86
70
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readdirSync, writeFileSync, } from "node:fs";
|
|
2
2
|
import { basename, extname, join } from "node:path";
|
|
3
|
-
import { readJsonFileWithSchema } from "
|
|
3
|
+
import { readJsonFileWithSchema } from "../../contracts/utils/parse.js";
|
|
4
4
|
import { TestSpecSchema } from "./lib/schema.js";
|
|
5
5
|
import { TEST_SPEC_EXTENSIONS, assertTestId, assertWritableTestSpecPath, testSpecFilePath, testSpecTypePath, normalizeTestId, } from "./test-paths.js";
|
|
6
6
|
function readTestSpecFile(filePath) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TestTargetCandidate } from "./test-types.js";
|
|
2
2
|
export declare function listCompiledTestTargets(sourcePath: string): TestTargetCandidate[];
|
|
3
3
|
export declare function createCompiledTestTarget(compiledPath: string, compiledName: string, methodId?: string): TestTargetCandidate;
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function createSourceFilesTestTarget(sourcePath: string): TestTargetCandidate;
|
|
5
5
|
export declare function listTestTargets(sourcePath: string): TestTargetCandidate[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { listPortableContextsForSourceFolder } from "
|
|
2
|
-
import { computeCompiledHealth } from "../
|
|
3
|
-
import { DEFAULT_METHOD_ID, resolveMethodId } from "
|
|
1
|
+
import { listPortableContextsForSourceFolder } from "../../project/interf-detect.js";
|
|
2
|
+
import { computeCompiledHealth } from "../compile/state.js";
|
|
3
|
+
import { DEFAULT_METHOD_ID, resolveMethodId } from "../../methods/method-resolution.js";
|
|
4
4
|
function summarizeTargetSortKey(target) {
|
|
5
5
|
return `${target.name}\u0000${target.method}`;
|
|
6
6
|
}
|
|
@@ -22,15 +22,15 @@ export function createCompiledTestTarget(compiledPath, compiledName, methodId =
|
|
|
22
22
|
eligible: health.status === "compiled",
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
export function
|
|
25
|
+
export function createSourceFilesTestTarget(sourcePath) {
|
|
26
26
|
return {
|
|
27
|
-
type: "
|
|
28
|
-
name: "
|
|
27
|
+
type: "source-files",
|
|
28
|
+
name: "source-files",
|
|
29
29
|
path: sourcePath,
|
|
30
|
-
method: "
|
|
30
|
+
method: "source-files",
|
|
31
31
|
status: "compiled",
|
|
32
|
-
stage: "
|
|
33
|
-
summary: "Run the checks against
|
|
32
|
+
stage: "source-files",
|
|
33
|
+
summary: "Run the checks against source file references in an isolated test shell.",
|
|
34
34
|
eligible: true,
|
|
35
35
|
};
|
|
36
36
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type { TestCaseExpect, TestCase, TestSpec, TestCheckResult, TestCaseResult, TestTargetResult, TestTargetRun, TestTargetType, LoadedTestSpec, TestTargetCandidate, } from "./test-types.js";
|
|
2
2
|
export { listTestSpecs, loadTestSpec, loadTestSpecFromFile, writeTestSpec, } from "./test-specs.js";
|
|
3
|
-
export {
|
|
3
|
+
export { createSourceFilesTestTarget, createCompiledTestTarget, listCompiledTestTargets, listTestTargets, } from "./test-targets.js";
|
|
4
4
|
export { runTargetTests, runTargetTestsWithJudge, runTargetTestsAuto, saveTargetTestRun, } from "./test-execution.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { listTestSpecs, loadTestSpec, loadTestSpecFromFile, writeTestSpec, } from "./test-specs.js";
|
|
2
|
-
export {
|
|
2
|
+
export { createSourceFilesTestTarget, createCompiledTestTarget, listCompiledTestTargets, listTestTargets, } from "./test-targets.js";
|
|
3
3
|
export { runTargetTests, runTargetTestsWithJudge, runTargetTestsAuto, saveTargetTestRun, } from "./test-execution.js";
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import type { MethodExecutor } from "
|
|
2
|
-
import { validateMethodPackage } from "../
|
|
3
|
-
import type { SourceReadinessCheck } from "
|
|
1
|
+
import type { MethodExecutor } from "../../engine/agents/lib/executors.js";
|
|
2
|
+
import { validateMethodPackage } from "../package/local-methods.js";
|
|
3
|
+
import type { SourceReadinessCheck } from "../../project/lib/schema.js";
|
|
4
|
+
/**
|
|
5
|
+
* Walk method.json after a successful authoring run and fill in
|
|
6
|
+
* `role: "general"` for any stage missing a role field. Custom role
|
|
7
|
+
* names are kept as-is. Idempotent — does nothing when every stage
|
|
8
|
+
* already declares a role. Returns the list of stage ids that were
|
|
9
|
+
* touched so the runtime can surface that to the user.
|
|
10
|
+
*/
|
|
11
|
+
export declare function ensureStageRoles(methodPath: string): string[];
|
|
4
12
|
export interface MethodAuthoringRunResult {
|
|
5
13
|
status: "updated" | "no-change" | "invalid" | "executor-failed";
|
|
6
14
|
changed: boolean;
|
|
@@ -10,7 +18,7 @@ export interface MethodAuthoringRunResult {
|
|
|
10
18
|
shellPath: string;
|
|
11
19
|
}
|
|
12
20
|
export declare function runMethodAuthoringDraft(options: {
|
|
13
|
-
|
|
21
|
+
prepDataDir: string;
|
|
14
22
|
sourceFolderPath: string;
|
|
15
23
|
baseMethodId?: string;
|
|
16
24
|
methodId: string;
|
|
@@ -1,9 +1,62 @@
|
|
|
1
|
-
import { rmSync } from "node:fs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { existsSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { createMethodAuthoringShell } from "../../engine/agents/lib/shells.js";
|
|
4
|
+
import { createScratchLocalMethodPackage } from "../package/interf-method-package.js";
|
|
5
|
+
import { CONTEXT_INTERFACE_FILE } from "../package/context-interface.js";
|
|
6
|
+
import { loadMethodDefinitionFromDir, validateMethodPackage, methodDefinitionPath, } from "../package/local-methods.js";
|
|
6
7
|
import { runMethodEditSession } from "./method-edit-session.js";
|
|
8
|
+
/**
|
|
9
|
+
* Walk method.json after a successful authoring run and fill in
|
|
10
|
+
* `role: "general"` for any stage missing a role field. Custom role
|
|
11
|
+
* names are kept as-is. Idempotent — does nothing when every stage
|
|
12
|
+
* already declares a role. Returns the list of stage ids that were
|
|
13
|
+
* touched so the runtime can surface that to the user.
|
|
14
|
+
*/
|
|
15
|
+
export function ensureStageRoles(methodPath) {
|
|
16
|
+
const methodJsonPath = join(methodPath, "method.json");
|
|
17
|
+
if (!existsSync(methodJsonPath))
|
|
18
|
+
return [];
|
|
19
|
+
let raw;
|
|
20
|
+
try {
|
|
21
|
+
raw = readFileSync(methodJsonPath, "utf8");
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
let parsed;
|
|
27
|
+
try {
|
|
28
|
+
parsed = JSON.parse(raw);
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
34
|
+
return [];
|
|
35
|
+
const value = parsed;
|
|
36
|
+
if (!Array.isArray(value.stages))
|
|
37
|
+
return [];
|
|
38
|
+
const touched = [];
|
|
39
|
+
let changed = false;
|
|
40
|
+
const nextStages = value.stages.map((stage) => {
|
|
41
|
+
if (!stage || typeof stage !== "object" || Array.isArray(stage))
|
|
42
|
+
return stage;
|
|
43
|
+
const stageRecord = stage;
|
|
44
|
+
const declaredRole = typeof stageRecord.role === "string" && stageRecord.role.trim().length > 0
|
|
45
|
+
? stageRecord.role.trim()
|
|
46
|
+
: null;
|
|
47
|
+
if (declaredRole)
|
|
48
|
+
return stage;
|
|
49
|
+
const id = typeof stageRecord.id === "string" ? stageRecord.id : "(unknown)";
|
|
50
|
+
touched.push(id);
|
|
51
|
+
changed = true;
|
|
52
|
+
return { ...stageRecord, role: "general" };
|
|
53
|
+
});
|
|
54
|
+
if (!changed)
|
|
55
|
+
return [];
|
|
56
|
+
value.stages = nextStages;
|
|
57
|
+
writeFileSync(methodJsonPath, `${JSON.stringify(value, null, 2)}\n`);
|
|
58
|
+
return touched;
|
|
59
|
+
}
|
|
7
60
|
function buildMethodAuthoringPrompt() {
|
|
8
61
|
return [
|
|
9
62
|
"This is an automated Interf Method-authoring run, not an open-ended chat session.",
|
|
@@ -14,13 +67,14 @@ function buildMethodAuthoringPrompt() {
|
|
|
14
67
|
`Then read \`method/README.md\`, \`method/method.json\`, and \`method/${CONTEXT_INTERFACE_FILE}\`.`,
|
|
15
68
|
"The `method/` directory starts as a neutral Method package scaffold, not as a suggested Method.",
|
|
16
69
|
"Replace the scaffold purpose, inputs, context interface, stages, stage docs, proof rules, and query guidance with the Method this agent work actually needs.",
|
|
17
|
-
"
|
|
70
|
+
"Read `runtime/source-files.json` and inspect the listed source locators before editing the package.",
|
|
18
71
|
"Prefer direct file-reading and search tools over shell commands for routine file inspection.",
|
|
19
72
|
"Do not use shell helpers like `cat`, `sed`, `ls`, or `find` when a native read/search tool can inspect the same files.",
|
|
20
73
|
"Edit only files under `method/`.",
|
|
21
74
|
"Keep the Method package valid for the current compiler API and `method.schema.json`.",
|
|
22
75
|
"Choose stage ids, stage order, reads, writes, acceptance criteria, and stage docs from the source data and preparation-and-evidence brief.",
|
|
23
76
|
"Use kebab-case ids everywhere: stage ids, skill_dir values, zone ids, reads/writes values, and package ids. Never use underscores.",
|
|
77
|
+
"Each stage MAY declare a `role`: one of `extractor`, `summarizer`, `structurer`, `verifier`, or `general`. Pick the role that best matches what the stage's prompt asks the agent to do. Omit `role` (or use `general`) when the stage doesn't fit any specialized role. Custom role names are allowed; the engine treats unknown roles as `general`.",
|
|
24
78
|
"Do not preserve the placeholder `prepare` stage unless the final Method genuinely needs a stage with that exact role.",
|
|
25
79
|
"When editing acceptance criteria: `zone_counts_at_least` maps declared zone ids to fixed numeric minimums.",
|
|
26
80
|
"`zone_counts_at_least_counts` also maps declared zone ids to runtime count-key strings such as `source_total`; `source_total` is a value, never a zone key.",
|
|
@@ -76,7 +130,7 @@ function validateAuthoredMethodPackage(methodPath) {
|
|
|
76
130
|
}
|
|
77
131
|
export async function runMethodAuthoringDraft(options) {
|
|
78
132
|
const methodPath = createScratchLocalMethodPackage({
|
|
79
|
-
|
|
133
|
+
prepDataDir: options.prepDataDir,
|
|
80
134
|
methodId: options.methodId,
|
|
81
135
|
label: options.label,
|
|
82
136
|
hint: options.hint,
|
|
@@ -102,6 +156,15 @@ export async function runMethodAuthoringDraft(options) {
|
|
|
102
156
|
if (session.status !== "updated") {
|
|
103
157
|
rmSync(methodPath, { recursive: true, force: true });
|
|
104
158
|
}
|
|
159
|
+
else {
|
|
160
|
+
// 0.15 — auto-fill `role: "general"` for any stage the agent
|
|
161
|
+
// didn't explicitly tag. Idempotent and silent when every stage
|
|
162
|
+
// already declares a role.
|
|
163
|
+
const touched = ensureStageRoles(methodPath);
|
|
164
|
+
if (touched.length > 0 && options.onStatus) {
|
|
165
|
+
options.onStatus(`STATUS: filled role=general on ${touched.length} stage(s) the author didn't tag (${touched.join(", ")}).`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
105
168
|
return {
|
|
106
169
|
status: session.status,
|
|
107
170
|
changed: session.changed,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MethodExecutor } from "
|
|
2
|
-
import type { MethodValidationResult } from "../
|
|
1
|
+
import type { MethodExecutor } from "../../engine/agents/lib/executors.js";
|
|
2
|
+
import type { MethodValidationResult } from "../package/local-methods.js";
|
|
3
3
|
import { type MethodEditShellArtifacts } from "./lib/method-edit-utils.js";
|
|
4
4
|
export interface MethodEditSessionResult {
|
|
5
5
|
status: "updated" | "no-change" | "invalid" | "executor-failed";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { MethodExecutor } from "
|
|
2
|
-
import { type MethodValidationResult } from "../
|
|
3
|
-
import type { SourcePreparationConfig } from "
|
|
4
|
-
import type { MethodImprovementLoopSummary } from "
|
|
1
|
+
import type { MethodExecutor } from "../../engine/agents/lib/executors.js";
|
|
2
|
+
import { type MethodValidationResult } from "../package/local-methods.js";
|
|
3
|
+
import type { SourcePreparationConfig } from "../../project/lib/schema.js";
|
|
4
|
+
import type { MethodImprovementLoopSummary } from "../../engine/compile/lib/schema.js";
|
|
5
5
|
export interface MethodImprovementRunResult {
|
|
6
6
|
status: "updated" | "no-change" | "invalid" | "executor-failed";
|
|
7
7
|
changed: boolean;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { appendFileSync, existsSync, mkdirSync, writeFileSync, } from "node:fs";
|
|
2
2
|
import { join, relative } from "node:path";
|
|
3
|
-
import { createMethodImprovementShell, freezeMethodImprovementShell, } from "
|
|
4
|
-
import { validateMethodPackage } from "../
|
|
5
|
-
import { CONTEXT_INTERFACE_FILE } from "../
|
|
6
|
-
import { readJsonFileWithSchema } from "
|
|
7
|
-
import { resolveMethodImprovementReviewPaths } from "../
|
|
8
|
-
import { targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, methodImprovementRunRoot, methodPackagePathForCompiled, } from "
|
|
9
|
-
import { readInterfConfig } from "
|
|
10
|
-
import { saveCompiledInterfConfig } from "
|
|
11
|
-
import { MethodImprovementRunLedgerSchema, } from "
|
|
3
|
+
import { createMethodImprovementShell, freezeMethodImprovementShell, } from "../../engine/agents/lib/shells.js";
|
|
4
|
+
import { validateMethodPackage } from "../package/local-methods.js";
|
|
5
|
+
import { CONTEXT_INTERFACE_FILE } from "../package/context-interface.js";
|
|
6
|
+
import { readJsonFileWithSchema } from "../../contracts/utils/parse.js";
|
|
7
|
+
import { resolveMethodImprovementReviewPaths } from "../package/method-review-paths.js";
|
|
8
|
+
import { targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, methodImprovementRunRoot, methodPackagePathForCompiled, } from "../../engine/compile/compiled-paths.js";
|
|
9
|
+
import { readInterfConfig } from "../../project/interf.js";
|
|
10
|
+
import { saveCompiledInterfConfig } from "../../project/source-config.js";
|
|
11
|
+
import { MethodImprovementRunLedgerSchema, } from "../../engine/compile/lib/schema.js";
|
|
12
12
|
import { runMethodEditSession } from "./method-edit-session.js";
|
|
13
|
+
import { ensureStageRoles } from "./method-authoring.js";
|
|
13
14
|
function toShellArtifactPath(absolutePath, sourceRoot, shellRoot) {
|
|
14
15
|
if (!absolutePath)
|
|
15
16
|
return null;
|
|
@@ -64,7 +65,7 @@ function buildMethodImprovementPrompt() {
|
|
|
64
65
|
"Treat the Method package as four aligned layers: purpose, inputs, context interface, and stages.",
|
|
65
66
|
"Prefer editing the stage docs, Method contract, input contract, or schema ownership that actually change portable-context outputs.",
|
|
66
67
|
"Edit only files under `method/`.",
|
|
67
|
-
"Do not edit checks, test specs,
|
|
68
|
+
"Do not edit checks, test specs, source files, or generated portable-context outputs.",
|
|
68
69
|
"Keep the Method package valid for the current compiler API and `method.schema.json`.",
|
|
69
70
|
"Respect stage boundaries: a stage may only introduce links that resolve within that stage's declared writes or already-existing read zones.",
|
|
70
71
|
"Do not make one stage point at files or notes that are only created later by another stage.",
|
|
@@ -169,6 +170,11 @@ export async function runMethodImprovementLoop(options) {
|
|
|
169
170
|
validate: validateMethodPackage,
|
|
170
171
|
maxValidationRepairAttempts: 1,
|
|
171
172
|
});
|
|
173
|
+
if (session.status === "updated") {
|
|
174
|
+
// 0.15 — fill role=general on any stage the improvement run
|
|
175
|
+
// dropped a role from. Idempotent and silent when complete.
|
|
176
|
+
ensureStageRoles(methodRoot);
|
|
177
|
+
}
|
|
172
178
|
const preservedShellManifestPath = freezeMethodImprovementShell(shell.rootPath);
|
|
173
179
|
writeMethodImprovementRunLedger(options.compiledPath, options.runId, buildMethodImprovementLoopRecord({
|
|
174
180
|
targetName: compiledName,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { type CompiledZoneKind } from "../../engine/compile/method-primitives.js";
|
|
2
|
+
declare const BUILTIN_COMPILED_STAGE_IDS: {
|
|
3
3
|
readonly SUMMARIZE: "summarize";
|
|
4
4
|
readonly STRUCTURE: "structure";
|
|
5
5
|
readonly SHAPE: "shape";
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type BuiltinCompiledStageId = typeof BUILTIN_COMPILED_STAGE_IDS[keyof typeof BUILTIN_COMPILED_STAGE_IDS];
|
|
8
8
|
export declare const BUILTIN_COMPILED_ZONE_IDS: {
|
|
9
|
-
readonly RAW: "raw";
|
|
10
9
|
readonly SUMMARIES: "summaries";
|
|
11
10
|
readonly KNOWLEDGE_ENTITIES: "knowledge-entities";
|
|
12
11
|
readonly KNOWLEDGE_CLAIMS: "knowledge-claims";
|
|
@@ -35,4 +34,4 @@ export declare function requiredCompiledZoneOwners<TStage extends {
|
|
|
35
34
|
id: string;
|
|
36
35
|
writes: readonly string[];
|
|
37
36
|
}>(stages: readonly TStage[], zoneId: BuiltinCompiledZoneId): string[];
|
|
38
|
-
export {
|
|
37
|
+
export {};
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { readJsonFileWithSchema } from "
|
|
4
|
-
import {
|
|
5
|
-
import { MethodCompiledSchemaSchema } from "../compiler/lib/schema.js";
|
|
3
|
+
import { readJsonFileWithSchema } from "../../contracts/utils/parse.js";
|
|
4
|
+
import { MethodCompiledSchemaSchema } from "../../engine/compile/lib/schema.js";
|
|
6
5
|
import { PACKAGE_ROOT } from "./lib/package-root.js";
|
|
7
|
-
|
|
6
|
+
const BUILTIN_COMPILED_STAGE_IDS = {
|
|
8
7
|
SUMMARIZE: "summarize",
|
|
9
8
|
STRUCTURE: "structure",
|
|
10
9
|
SHAPE: "shape",
|
|
11
10
|
};
|
|
12
11
|
export const BUILTIN_COMPILED_ZONE_IDS = {
|
|
13
|
-
RAW: "raw",
|
|
14
12
|
SUMMARIES: "summaries",
|
|
15
13
|
KNOWLEDGE_ENTITIES: "knowledge-entities",
|
|
16
14
|
KNOWLEDGE_CLAIMS: "knowledge-claims",
|
|
@@ -30,12 +28,7 @@ const BuiltinMethodPackageSchema = z.object({
|
|
|
30
28
|
stages: z.array(BuiltinMethodStageSchema).min(1),
|
|
31
29
|
});
|
|
32
30
|
let builtinCompiledContractCache = null;
|
|
33
|
-
|
|
34
|
-
return join(PACKAGE_ROOT, "builtin-methods", "interf-default");
|
|
35
|
-
}
|
|
36
|
-
function builtinMethodPath(relativePath) {
|
|
37
|
-
return join(builtinMethodRootPath(), relativePath);
|
|
38
|
-
}
|
|
31
|
+
const BUILTIN_DEFAULT_METHOD_ROOT = join(PACKAGE_ROOT, "builtin-methods", "interf-default");
|
|
39
32
|
function assertBuiltinZoneId(value) {
|
|
40
33
|
if (!BUILTIN_ZONE_ID_SET.has(value)) {
|
|
41
34
|
throw new Error(`Built-in Interf Method schema declares unsupported zone id "${value}".`);
|
|
@@ -51,13 +44,15 @@ function assertBuiltinStageId(value) {
|
|
|
51
44
|
function loadBuiltinCompiledContract() {
|
|
52
45
|
if (builtinCompiledContractCache)
|
|
53
46
|
return builtinCompiledContractCache;
|
|
54
|
-
const
|
|
47
|
+
const schemaPath = join(BUILTIN_DEFAULT_METHOD_ROOT, "method.schema.json");
|
|
48
|
+
const methodPath = join(BUILTIN_DEFAULT_METHOD_ROOT, "method.json");
|
|
49
|
+
const schema = readJsonFileWithSchema(schemaPath, "built-in Interf Method schema", MethodCompiledSchemaSchema);
|
|
55
50
|
if (!schema) {
|
|
56
|
-
throw new Error(`Missing or invalid built-in Method schema at ${
|
|
51
|
+
throw new Error(`Missing or invalid built-in Method schema at ${schemaPath}.`);
|
|
57
52
|
}
|
|
58
|
-
const method = readJsonFileWithSchema(
|
|
53
|
+
const method = readJsonFileWithSchema(methodPath, "built-in Interf Method package", BuiltinMethodPackageSchema);
|
|
59
54
|
if (!method) {
|
|
60
|
-
throw new Error(`Missing or invalid built-in Method package at ${
|
|
55
|
+
throw new Error(`Missing or invalid built-in Method package at ${methodPath}.`);
|
|
61
56
|
}
|
|
62
57
|
const zones = schema.zones.map((zone) => ({
|
|
63
58
|
id: assertBuiltinZoneId(zone.id),
|
|
@@ -91,4 +86,3 @@ export function requiredCompiledZoneOwners(stages, zoneId) {
|
|
|
91
86
|
.filter((stage) => stage.writes.includes(zoneId))
|
|
92
87
|
.map((stage) => stage.id)));
|
|
93
88
|
}
|
|
94
|
-
export { COMPILED_ZONE_KINDS };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { type MethodCompiledSchema, type MethodCompiledZone, type MethodZoneId } from "
|
|
2
|
+
import { type MethodCompiledSchema, type MethodCompiledZone, type MethodZoneId } from "../../engine/compile/lib/schema.js";
|
|
3
3
|
export declare const CONTEXT_INTERFACE_FILE = "method.schema.json";
|
|
4
4
|
export declare const ContextInterfaceSchema: z.ZodObject<{
|
|
5
5
|
kind: z.ZodLiteral<"method-schema">;
|
|
@@ -9,8 +9,8 @@ export declare const ContextInterfaceSchema: z.ZodObject<{
|
|
|
9
9
|
zones: z.ZodArray<z.ZodObject<{
|
|
10
10
|
id: z.ZodString;
|
|
11
11
|
role: z.ZodEnum<{
|
|
12
|
-
output: "output";
|
|
13
12
|
runtime: "runtime";
|
|
13
|
+
output: "output";
|
|
14
14
|
input: "input";
|
|
15
15
|
working: "working";
|
|
16
16
|
}>;
|
|
@@ -25,31 +25,6 @@ export declare const ContextInterfaceSchema: z.ZodObject<{
|
|
|
25
25
|
description: z.ZodString;
|
|
26
26
|
}, z.core.$strip>>;
|
|
27
27
|
}, z.core.$strip>;
|
|
28
|
-
export declare const ContextInterfaceZoneSchema: z.ZodObject<{
|
|
29
|
-
id: z.ZodString;
|
|
30
|
-
role: z.ZodEnum<{
|
|
31
|
-
output: "output";
|
|
32
|
-
runtime: "runtime";
|
|
33
|
-
input: "input";
|
|
34
|
-
working: "working";
|
|
35
|
-
}>;
|
|
36
|
-
path: z.ZodString;
|
|
37
|
-
kind: z.ZodEnum<{
|
|
38
|
-
runtime: "runtime";
|
|
39
|
-
file: "file";
|
|
40
|
-
directory: "directory";
|
|
41
|
-
}>;
|
|
42
|
-
required: z.ZodBoolean;
|
|
43
|
-
owned_by: z.ZodArray<z.ZodString>;
|
|
44
|
-
description: z.ZodString;
|
|
45
|
-
}, z.core.$strip>;
|
|
46
|
-
export declare const ContextInterfaceZoneIdSchema: z.ZodString;
|
|
47
|
-
export declare const ContextInterfaceZoneRoleSchema: z.ZodEnum<{
|
|
48
|
-
output: "output";
|
|
49
|
-
runtime: "runtime";
|
|
50
|
-
input: "input";
|
|
51
|
-
working: "working";
|
|
52
|
-
}>;
|
|
53
28
|
export declare const MethodInputSpecSchema: z.ZodObject<{
|
|
54
29
|
id: z.ZodString;
|
|
55
30
|
label: z.ZodString;
|
|
@@ -57,23 +32,15 @@ export declare const MethodInputSpecSchema: z.ZodObject<{
|
|
|
57
32
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
58
33
|
examples: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
59
34
|
}, z.core.$strict>;
|
|
60
|
-
export declare const MethodInputContractSchema: z.ZodArray<z.ZodObject<{
|
|
61
|
-
id: z.ZodString;
|
|
62
|
-
label: z.ZodString;
|
|
63
|
-
description: z.ZodString;
|
|
64
|
-
required: z.ZodDefault<z.ZodBoolean>;
|
|
65
|
-
examples: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
66
|
-
}, z.core.$strict>>;
|
|
67
35
|
export type ContextInterface = MethodCompiledSchema;
|
|
68
36
|
export type ContextInterfaceZone = MethodCompiledZone;
|
|
69
37
|
export type ContextInterfaceZoneId = MethodZoneId;
|
|
70
|
-
export type ContextInterfaceZoneRole = z.infer<typeof ContextInterfaceZoneRoleSchema>;
|
|
71
38
|
export type MethodInputSpec = z.infer<typeof MethodInputSpecSchema>;
|
|
72
|
-
|
|
39
|
+
interface ContextInterfaceStageLike {
|
|
73
40
|
id: string;
|
|
74
41
|
writes: readonly string[];
|
|
75
42
|
}
|
|
76
|
-
|
|
43
|
+
interface ContextInterfaceSummary {
|
|
77
44
|
inputZones: ContextInterfaceZone[];
|
|
78
45
|
workingZones: ContextInterfaceZone[];
|
|
79
46
|
outputZones: ContextInterfaceZone[];
|
|
@@ -82,15 +49,12 @@ export interface ContextInterfaceSummary {
|
|
|
82
49
|
export declare function contextInterfaceFilePath(rootPath: string): string;
|
|
83
50
|
export declare function resolveContextInterfacePath(rootPath: string): string | null;
|
|
84
51
|
export declare function contextInterfaceExists(rootPath: string): boolean;
|
|
85
|
-
export declare function contextInterfaceRelativePath(): string;
|
|
86
|
-
export declare function listContextInterfaceZones(contextInterface: ContextInterface): ContextInterfaceZone[];
|
|
87
|
-
export declare function findContextInterfaceZone(contextInterface: ContextInterface, zoneId: ContextInterfaceZoneId): ContextInterfaceZone | null;
|
|
88
52
|
export declare function contextInterfaceZoneAbsolutePath(compiledPath: string, zone: Pick<ContextInterfaceZone, "path">): string;
|
|
89
53
|
export declare function contextInterfaceArtifactPath(zone: Pick<ContextInterfaceZone, "path" | "kind">): string;
|
|
90
|
-
export declare function contextInterfaceArtifactPathsForZoneIds(contextInterface: ContextInterface, zoneIds: readonly ContextInterfaceZoneId[]): string[];
|
|
91
54
|
export declare function summarizeContextInterface(contextInterface: ContextInterface): ContextInterfaceSummary;
|
|
92
55
|
export declare function deriveMethodInputsFromContextInterface(contextInterface: ContextInterface | null | undefined): MethodInputSpec[];
|
|
93
56
|
export declare function buildContextInterface(stages: ContextInterfaceStageLike[], label?: string): ContextInterface;
|
|
94
57
|
export declare function writeContextInterfaceFile(rootPath: string, stages: ContextInterfaceStageLike[], label?: string): ContextInterface;
|
|
95
58
|
export declare function writeContextInterface(rootPath: string, contextInterface: ContextInterface): ContextInterface;
|
|
96
59
|
export declare function readContextInterface(rootPath: string): ContextInterface | null;
|
|
60
|
+
export {};
|