wingfoil 0.2.2 → 0.3.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 +83 -43
- package/dist/agent/discovery.d.ts +72 -0
- package/dist/agent/discovery.d.ts.map +1 -0
- package/dist/agent/discovery.js +210 -0
- package/dist/agent/discovery.js.map +1 -0
- package/dist/agent/execute.d.ts +206 -0
- package/dist/agent/execute.d.ts.map +1 -0
- package/dist/agent/execute.js +581 -0
- package/dist/agent/execute.js.map +1 -0
- package/dist/agent/index.d.ts +23 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +85 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/launch.d.ts +133 -0
- package/dist/agent/launch.d.ts.map +1 -0
- package/dist/agent/launch.js +380 -0
- package/dist/agent/launch.js.map +1 -0
- package/dist/agent/manifest.d.ts +30 -0
- package/dist/agent/manifest.d.ts.map +1 -0
- package/dist/agent/manifest.js +93 -0
- package/dist/agent/manifest.js.map +1 -0
- package/dist/agent/placeholders.d.ts +49 -0
- package/dist/agent/placeholders.d.ts.map +1 -0
- package/dist/agent/placeholders.js +177 -0
- package/dist/agent/placeholders.js.map +1 -0
- package/dist/agent/run-log.d.ts +254 -0
- package/dist/agent/run-log.d.ts.map +1 -0
- package/dist/agent/run-log.js +612 -0
- package/dist/agent/run-log.js.map +1 -0
- package/dist/agent/schema.d.ts +100 -0
- package/dist/agent/schema.d.ts.map +1 -0
- package/dist/agent/schema.js +89 -0
- package/dist/agent/schema.js.map +1 -0
- package/dist/agent/step.d.ts +41 -0
- package/dist/agent/step.d.ts.map +1 -0
- package/dist/agent/step.js +95 -0
- package/dist/agent/step.js.map +1 -0
- package/dist/build-info.json +4 -0
- package/dist/cli/error.d.ts +11 -2
- package/dist/cli/error.d.ts.map +1 -1
- package/dist/cli/error.js +27 -6
- package/dist/cli/error.js.map +1 -1
- package/dist/cli/exit.d.ts +33 -3
- package/dist/cli/exit.d.ts.map +1 -1
- package/dist/cli/exit.js +54 -3
- package/dist/cli/exit.js.map +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init-command.d.ts.map +1 -1
- package/dist/cli/init-command.js +4 -2
- package/dist/cli/init-command.js.map +1 -1
- package/dist/cli/mcp-command.d.ts +13 -4
- package/dist/cli/mcp-command.d.ts.map +1 -1
- package/dist/cli/mcp-command.js +25 -8
- package/dist/cli/mcp-command.js.map +1 -1
- package/dist/cli/output.d.ts +12 -4
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +15 -4
- package/dist/cli/output.js.map +1 -1
- package/dist/cli/program.d.ts +1 -1
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +162 -40
- package/dist/cli/program.js.map +1 -1
- package/dist/cli/registrar.d.ts +1 -1
- package/dist/cli/registrar.d.ts.map +1 -1
- package/dist/cli/registrar.js +67 -6
- package/dist/cli/registrar.js.map +1 -1
- package/dist/cli/suggest.d.ts +20 -0
- package/dist/cli/suggest.d.ts.map +1 -0
- package/dist/cli/suggest.js +49 -0
- package/dist/cli/suggest.js.map +1 -0
- package/dist/cli/warning.d.ts +26 -0
- package/dist/cli/warning.d.ts.map +1 -0
- package/dist/cli/warning.js +66 -0
- package/dist/cli/warning.js.map +1 -0
- package/dist/cli.js +11 -2
- package/dist/cli.js.map +1 -1
- package/dist/core/agent-execute.d.ts +44 -0
- package/dist/core/agent-execute.d.ts.map +1 -0
- package/dist/core/agent-execute.js +71 -0
- package/dist/core/agent-execute.js.map +1 -0
- package/dist/core/agent-list.d.ts +95 -0
- package/dist/core/agent-list.d.ts.map +1 -0
- package/dist/core/agent-list.js +207 -0
- package/dist/core/agent-list.js.map +1 -0
- package/dist/core/agent-show.d.ts +44 -0
- package/dist/core/agent-show.d.ts.map +1 -0
- package/dist/core/agent-show.js +188 -0
- package/dist/core/agent-show.js.map +1 -0
- package/dist/core/approval-authority.d.ts +17 -14
- package/dist/core/approval-authority.d.ts.map +1 -1
- package/dist/core/approval-authority.js +9 -9
- package/dist/core/approval-authority.js.map +1 -1
- package/dist/core/builtin-asset.d.ts +18 -15
- package/dist/core/builtin-asset.d.ts.map +1 -1
- package/dist/core/builtin-asset.js +17 -14
- package/dist/core/builtin-asset.js.map +1 -1
- package/dist/core/builtin-integrity.d.ts +12 -2
- package/dist/core/builtin-integrity.d.ts.map +1 -1
- package/dist/core/builtin-integrity.js +85 -9
- package/dist/core/builtin-integrity.js.map +1 -1
- package/dist/core/confinement.d.ts +3 -1
- package/dist/core/confinement.d.ts.map +1 -1
- package/dist/core/confinement.js +7 -4
- package/dist/core/confinement.js.map +1 -1
- package/dist/core/context.d.ts +150 -98
- package/dist/core/context.d.ts.map +1 -1
- package/dist/core/context.js +602 -66
- package/dist/core/context.js.map +1 -1
- package/dist/core/directive-assign.d.ts +33 -7
- package/dist/core/directive-assign.d.ts.map +1 -1
- package/dist/core/directive-assign.js +67 -27
- package/dist/core/directive-assign.js.map +1 -1
- package/dist/core/directive-scope.d.ts +36 -0
- package/dist/core/directive-scope.d.ts.map +1 -0
- package/dist/core/directive-scope.js +34 -0
- package/dist/core/directive-scope.js.map +1 -0
- package/dist/core/directives-list.d.ts +13 -3
- package/dist/core/directives-list.d.ts.map +1 -1
- package/dist/core/directives-list.js +18 -6
- package/dist/core/directives-list.js.map +1 -1
- package/dist/core/dry-run.d.ts +33 -0
- package/dist/core/dry-run.d.ts.map +1 -0
- package/dist/core/dry-run.js +45 -0
- package/dist/core/dry-run.js.map +1 -0
- package/dist/core/element-ref.d.ts +23 -0
- package/dist/core/element-ref.d.ts.map +1 -0
- package/dist/core/element-ref.js +24 -0
- package/dist/core/element-ref.js.map +1 -0
- package/dist/core/error-details.d.ts +20 -0
- package/dist/core/error-details.d.ts.map +1 -0
- package/dist/core/error-details.js +65 -0
- package/dist/core/error-details.js.map +1 -0
- package/dist/core/exit-code.d.ts.map +1 -1
- package/dist/core/exit-code.js +6 -7
- package/dist/core/exit-code.js.map +1 -1
- package/dist/core/git-identity.d.ts +46 -11
- package/dist/core/git-identity.d.ts.map +1 -1
- package/dist/core/git-identity.js +140 -27
- package/dist/core/git-identity.js.map +1 -1
- package/dist/core/index.d.ts +184 -10
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1045 -185
- package/dist/core/index.js.map +1 -1
- package/dist/core/init.d.ts +45 -5
- package/dist/core/init.d.ts.map +1 -1
- package/dist/core/init.js +134 -24
- package/dist/core/init.js.map +1 -1
- package/dist/core/loaders.d.ts +170 -14
- package/dist/core/loaders.d.ts.map +1 -1
- package/dist/core/loaders.js +570 -89
- package/dist/core/loaders.js.map +1 -1
- package/dist/core/memory-add-link.d.ts +28 -0
- package/dist/core/memory-add-link.d.ts.map +1 -0
- package/dist/core/memory-add-link.js +67 -0
- package/dist/core/memory-add-link.js.map +1 -0
- package/dist/core/memory-add-type.d.ts +25 -1
- package/dist/core/memory-add-type.d.ts.map +1 -1
- package/dist/core/memory-add-type.js +59 -1
- package/dist/core/memory-add-type.js.map +1 -1
- package/dist/core/memory-amend.d.ts +80 -0
- package/dist/core/memory-amend.d.ts.map +1 -0
- package/dist/core/memory-amend.js +160 -0
- package/dist/core/memory-amend.js.map +1 -0
- package/dist/core/memory-supersede.d.ts +28 -0
- package/dist/core/memory-supersede.d.ts.map +1 -0
- package/dist/core/memory-supersede.js +79 -0
- package/dist/core/memory-supersede.js.map +1 -0
- package/dist/core/memory-transition.d.ts +190 -30
- package/dist/core/memory-transition.d.ts.map +1 -1
- package/dist/core/memory-transition.js +480 -59
- package/dist/core/memory-transition.js.map +1 -1
- package/dist/core/registry.d.ts +82 -10
- package/dist/core/registry.d.ts.map +1 -1
- package/dist/core/registry.js +50 -0
- package/dist/core/registry.js.map +1 -1
- package/dist/core/relevance.d.ts +74 -12
- package/dist/core/relevance.d.ts.map +1 -1
- package/dist/core/relevance.js +45 -27
- package/dist/core/relevance.js.map +1 -1
- package/dist/core/require-reason.d.ts.map +1 -1
- package/dist/core/require-reason.js +6 -5
- package/dist/core/require-reason.js.map +1 -1
- package/dist/core/required-fields.d.ts +28 -0
- package/dist/core/required-fields.d.ts.map +1 -0
- package/dist/core/required-fields.js +60 -0
- package/dist/core/required-fields.js.map +1 -0
- package/dist/core/revision.d.ts +82 -0
- package/dist/core/revision.d.ts.map +1 -0
- package/dist/core/revision.js +144 -0
- package/dist/core/revision.js.map +1 -0
- package/dist/core/types.d.ts +28 -2
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +12 -3
- package/dist/core/types.js.map +1 -1
- package/dist/core/workflow-core-checks.d.ts +34 -0
- package/dist/core/workflow-core-checks.d.ts.map +1 -0
- package/dist/core/workflow-core-checks.js +403 -0
- package/dist/core/workflow-core-checks.js.map +1 -0
- package/dist/core/workflow-create-remove.d.ts +65 -0
- package/dist/core/workflow-create-remove.d.ts.map +1 -0
- package/dist/core/workflow-create-remove.js +277 -0
- package/dist/core/workflow-create-remove.js.map +1 -0
- package/dist/core/workflow-deduction.d.ts +48 -0
- package/dist/core/workflow-deduction.d.ts.map +1 -0
- package/dist/core/workflow-deduction.js +523 -0
- package/dist/core/workflow-deduction.js.map +1 -0
- package/dist/core/workflow-diagnostics.d.ts +83 -0
- package/dist/core/workflow-diagnostics.d.ts.map +1 -0
- package/dist/core/workflow-diagnostics.js +375 -0
- package/dist/core/workflow-diagnostics.js.map +1 -0
- package/dist/core/workflow-exit-state.d.ts +125 -0
- package/dist/core/workflow-exit-state.d.ts.map +1 -0
- package/dist/core/workflow-exit-state.js +243 -0
- package/dist/core/workflow-exit-state.js.map +1 -0
- package/dist/core/workflow-finalize.d.ts +37 -0
- package/dist/core/workflow-finalize.d.ts.map +1 -0
- package/dist/core/workflow-finalize.js +153 -0
- package/dist/core/workflow-finalize.js.map +1 -0
- package/dist/core/workflow-list-show.d.ts +176 -0
- package/dist/core/workflow-list-show.d.ts.map +1 -0
- package/dist/core/workflow-list-show.js +268 -0
- package/dist/core/workflow-list-show.js.map +1 -0
- package/dist/core/workflow-next.d.ts +268 -0
- package/dist/core/workflow-next.d.ts.map +1 -0
- package/dist/core/workflow-next.js +503 -0
- package/dist/core/workflow-next.js.map +1 -0
- package/dist/core/workflow-registry.d.ts +52 -0
- package/dist/core/workflow-registry.d.ts.map +1 -0
- package/dist/core/workflow-registry.js +158 -0
- package/dist/core/workflow-registry.js.map +1 -0
- package/dist/core/workflow-start-end.d.ts +71 -0
- package/dist/core/workflow-start-end.d.ts.map +1 -0
- package/dist/core/workflow-start-end.js +298 -0
- package/dist/core/workflow-start-end.js.map +1 -0
- package/dist/core/workflow-status.d.ts +83 -0
- package/dist/core/workflow-status.d.ts.map +1 -0
- package/dist/core/workflow-status.js +125 -0
- package/dist/core/workflow-status.js.map +1 -0
- package/dist/core/write-guard.d.ts +51 -8
- package/dist/core/write-guard.d.ts.map +1 -1
- package/dist/core/write-guard.js +139 -9
- package/dist/core/write-guard.js.map +1 -1
- package/dist/directives/index.d.ts +3 -2
- package/dist/directives/index.d.ts.map +1 -1
- package/dist/directives/index.js +5 -3
- package/dist/directives/index.js.map +1 -1
- package/dist/directives/schema.d.ts +34 -29
- package/dist/directives/schema.d.ts.map +1 -1
- package/dist/directives/schema.js +35 -29
- package/dist/directives/schema.js.map +1 -1
- package/dist/directives/version.d.ts +28 -0
- package/dist/directives/version.d.ts.map +1 -0
- package/dist/directives/version.js +51 -0
- package/dist/directives/version.js.map +1 -0
- package/dist/dna/edit.d.ts +7 -6
- package/dist/dna/edit.d.ts.map +1 -1
- package/dist/dna/edit.js +96 -41
- package/dist/dna/edit.js.map +1 -1
- package/dist/dna/mutate.js +18 -3
- package/dist/dna/mutate.js.map +1 -1
- package/dist/dna/path.d.ts +2 -2
- package/dist/dna/roles.d.ts +1 -1
- package/dist/dna/schema.d.ts +61 -3
- package/dist/dna/schema.d.ts.map +1 -1
- package/dist/dna/schema.js +121 -6
- package/dist/dna/schema.js.map +1 -1
- package/dist/mcp/dna-resource.d.ts.map +1 -1
- package/dist/mcp/dna-resource.js +4 -4
- package/dist/mcp/dna-resource.js.map +1 -1
- package/dist/mcp/index.d.ts +8 -4
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +13 -2
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/memory-resource.d.ts.map +1 -1
- package/dist/mcp/memory-resource.js +30 -19
- package/dist/mcp/memory-resource.js.map +1 -1
- package/dist/mcp/prompt.d.ts +61 -24
- package/dist/mcp/prompt.d.ts.map +1 -1
- package/dist/mcp/prompt.js +176 -47
- package/dist/mcp/prompt.js.map +1 -1
- package/dist/mcp/read-only.d.ts +39 -0
- package/dist/mcp/read-only.d.ts.map +1 -1
- package/dist/mcp/read-only.js +61 -0
- package/dist/mcp/read-only.js.map +1 -1
- package/dist/mcp/registrar.d.ts +10 -0
- package/dist/mcp/registrar.d.ts.map +1 -1
- package/dist/mcp/registrar.js +48 -12
- package/dist/mcp/registrar.js.map +1 -1
- package/dist/mcp/server.d.ts +21 -14
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +41 -15
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/session-resource.d.ts +13 -0
- package/dist/mcp/session-resource.d.ts.map +1 -0
- package/dist/mcp/session-resource.js +65 -0
- package/dist/mcp/session-resource.js.map +1 -0
- package/dist/mcp/workflow-resource.d.ts +18 -0
- package/dist/mcp/workflow-resource.d.ts.map +1 -1
- package/dist/mcp/workflow-resource.js +37 -8
- package/dist/mcp/workflow-resource.js.map +1 -1
- package/dist/memory/add.d.ts +110 -24
- package/dist/memory/add.d.ts.map +1 -1
- package/dist/memory/add.js +251 -64
- package/dist/memory/add.js.map +1 -1
- package/dist/memory/audit.d.ts +152 -39
- package/dist/memory/audit.d.ts.map +1 -1
- package/dist/memory/audit.js +257 -103
- package/dist/memory/audit.js.map +1 -1
- package/dist/memory/commit-message.d.ts +60 -38
- package/dist/memory/commit-message.d.ts.map +1 -1
- package/dist/memory/commit-message.js +167 -21
- package/dist/memory/commit-message.js.map +1 -1
- package/dist/memory/entry.d.ts.map +1 -1
- package/dist/memory/entry.js +1 -2
- package/dist/memory/entry.js.map +1 -1
- package/dist/memory/frontmatter-edit.d.ts +16 -4
- package/dist/memory/frontmatter-edit.d.ts.map +1 -1
- package/dist/memory/frontmatter-edit.js +13 -1
- package/dist/memory/frontmatter-edit.js.map +1 -1
- package/dist/memory/git-log.d.ts +18 -6
- package/dist/memory/git-log.d.ts.map +1 -1
- package/dist/memory/git-log.js +40 -13
- package/dist/memory/git-log.js.map +1 -1
- package/dist/memory/history.d.ts +73 -12
- package/dist/memory/history.d.ts.map +1 -1
- package/dist/memory/history.js +128 -44
- package/dist/memory/history.js.map +1 -1
- package/dist/memory/index.d.ts +13 -11
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +34 -3
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/query.d.ts +161 -19
- package/dist/memory/query.d.ts.map +1 -1
- package/dist/memory/query.js +435 -55
- package/dist/memory/query.js.map +1 -1
- package/dist/memory/schema.d.ts +52 -3
- package/dist/memory/schema.d.ts.map +1 -1
- package/dist/memory/schema.js +132 -8
- package/dist/memory/schema.js.map +1 -1
- package/dist/memory/state-machine.d.ts +65 -10
- package/dist/memory/state-machine.d.ts.map +1 -1
- package/dist/memory/state-machine.js +134 -46
- package/dist/memory/state-machine.js.map +1 -1
- package/dist/memory/submit.d.ts +52 -3
- package/dist/memory/submit.d.ts.map +1 -1
- package/dist/memory/submit.js +118 -11
- package/dist/memory/submit.js.map +1 -1
- package/dist/storage/build-stamp.d.ts +18 -0
- package/dist/storage/build-stamp.d.ts.map +1 -0
- package/dist/storage/build-stamp.js +68 -0
- package/dist/storage/build-stamp.js.map +1 -0
- package/dist/storage/builtin-adapters.d.ts +32 -0
- package/dist/storage/builtin-adapters.d.ts.map +1 -0
- package/dist/storage/builtin-adapters.js +100 -0
- package/dist/storage/builtin-adapters.js.map +1 -0
- package/dist/storage/builtin-directives.d.ts +0 -29
- package/dist/storage/builtin-directives.d.ts.map +1 -1
- package/dist/storage/builtin-directives.js +9 -4
- package/dist/storage/builtin-directives.js.map +1 -1
- package/dist/storage/commit.d.ts +310 -3
- package/dist/storage/commit.d.ts.map +1 -1
- package/dist/storage/commit.js +807 -33
- package/dist/storage/commit.js.map +1 -1
- package/dist/storage/document.d.ts +6 -0
- package/dist/storage/document.d.ts.map +1 -1
- package/dist/storage/document.js +10 -1
- package/dist/storage/document.js.map +1 -1
- package/dist/storage/dry-run.d.ts +65 -0
- package/dist/storage/dry-run.d.ts.map +1 -0
- package/dist/storage/dry-run.js +150 -0
- package/dist/storage/dry-run.js.map +1 -0
- package/dist/storage/errors.d.ts +26 -0
- package/dist/storage/errors.d.ts.map +1 -1
- package/dist/storage/errors.js +27 -1
- package/dist/storage/errors.js.map +1 -1
- package/dist/storage/frontmatter.d.ts +1 -1
- package/dist/storage/frontmatter.js +1 -1
- package/dist/storage/git-read.d.ts +64 -0
- package/dist/storage/git-read.d.ts.map +1 -0
- package/dist/storage/git-read.js +107 -0
- package/dist/storage/git-read.js.map +1 -0
- package/dist/storage/index.d.ts +13 -5
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +39 -2
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/layout.d.ts +2 -2
- package/dist/storage/layout.d.ts.map +1 -1
- package/dist/storage/layout.js +2 -7
- package/dist/storage/layout.js.map +1 -1
- package/dist/storage/memory-path.d.ts +18 -5
- package/dist/storage/memory-path.d.ts.map +1 -1
- package/dist/storage/memory-path.js +41 -5
- package/dist/storage/memory-path.js.map +1 -1
- package/dist/storage/snapshot.js +1 -1
- package/dist/storage/templates.d.ts +33 -6
- package/dist/storage/templates.d.ts.map +1 -1
- package/dist/storage/templates.js +170 -16
- package/dist/storage/templates.js.map +1 -1
- package/dist/validation/config-version.d.ts +19 -0
- package/dist/validation/config-version.d.ts.map +1 -0
- package/dist/validation/config-version.js +53 -0
- package/dist/validation/config-version.js.map +1 -0
- package/dist/validation/diagnostic.d.ts +40 -0
- package/dist/validation/diagnostic.d.ts.map +1 -0
- package/dist/validation/diagnostic.js +41 -0
- package/dist/validation/diagnostic.js.map +1 -0
- package/dist/validation/format.d.ts +74 -0
- package/dist/validation/format.d.ts.map +1 -0
- package/dist/validation/format.js +104 -0
- package/dist/validation/format.js.map +1 -0
- package/dist/validation/id.d.ts +14 -0
- package/dist/validation/id.d.ts.map +1 -1
- package/dist/validation/id.js +35 -11
- package/dist/validation/id.js.map +1 -1
- package/dist/validation/identity.d.ts +40 -0
- package/dist/validation/identity.d.ts.map +1 -0
- package/dist/validation/identity.js +78 -0
- package/dist/validation/identity.js.map +1 -0
- package/dist/validation/index.d.ts +9 -3
- package/dist/validation/index.d.ts.map +1 -1
- package/dist/validation/index.js +30 -1
- package/dist/validation/index.js.map +1 -1
- package/dist/validation/secret-scan.d.ts +3 -2
- package/dist/validation/secret-scan.d.ts.map +1 -1
- package/dist/validation/secret-scan.js +32 -11
- package/dist/validation/secret-scan.js.map +1 -1
- package/dist/validation/warning.d.ts +30 -16
- package/dist/validation/warning.d.ts.map +1 -1
- package/dist/validation/warning.js +74 -7
- package/dist/validation/warning.js.map +1 -1
- package/dist/workflow/bindings.d.ts +152 -0
- package/dist/workflow/bindings.d.ts.map +1 -0
- package/dist/workflow/bindings.js +249 -0
- package/dist/workflow/bindings.js.map +1 -0
- package/dist/workflow/create.d.ts +13 -0
- package/dist/workflow/create.d.ts.map +1 -0
- package/dist/workflow/create.js +41 -0
- package/dist/workflow/create.js.map +1 -0
- package/dist/workflow/deduce.d.ts +400 -0
- package/dist/workflow/deduce.d.ts.map +1 -0
- package/dist/workflow/deduce.js +1109 -0
- package/dist/workflow/deduce.js.map +1 -0
- package/dist/workflow/manifest-edit.d.ts +19 -0
- package/dist/workflow/manifest-edit.d.ts.map +1 -0
- package/dist/workflow/manifest-edit.js +124 -0
- package/dist/workflow/manifest-edit.js.map +1 -0
- package/dist/workflow/schema.d.ts +158 -19
- package/dist/workflow/schema.d.ts.map +1 -1
- package/dist/workflow/schema.js +163 -15
- package/dist/workflow/schema.js.map +1 -1
- package/package.json +18 -8
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Immutable built-in assets pre-flight check (REQ-SEC-07 — task-042-immutable-builtin-assets).
|
|
3
3
|
*
|
|
4
|
-
* **The rule is REQ-SEC-07's, the layout is spec-011's.** REQ-SEC-07 states that built-in directives
|
|
5
|
-
*
|
|
4
|
+
* **The rule is REQ-SEC-07's, the layout is spec-011's.** REQ-SEC-07 states that built-in directives,
|
|
5
|
+
* built-in workflow templates and (since task-196) built-in agent adapters cannot be removed. This
|
|
6
|
+
* module checks the first two only: no operation removes an adapter (`spec-016` §2.1), and
|
|
7
|
+
* `test/core/builtin-adapter-writers.test.ts` keeps it so. `spec-011-storage-layout` supplies the structure
|
|
6
8
|
* that rule is expressed over — the `directives/{built-in,custom}/` and `workflows/{built-in,custom}/`
|
|
7
|
-
* split, where `built-in/`
|
|
8
|
-
*
|
|
9
|
-
* the
|
|
9
|
+
* split, where `built-in/` holds the official templates shipped by the `wingfoil` npm package (the P3.8
|
|
10
|
+
* directive templates `wingfoil init` installs, task-057; no workflow templates ship yet) and `custom/`
|
|
11
|
+
* holds the project's own assets. This repository's own `directives/built-in/` holds only `.gitkeep`:
|
|
12
|
+
* its hand-authored configuration predates the templates. Only the removability rule comes from
|
|
13
|
+
* REQ-SEC-07; spec-011 never speaks about removal or protection.
|
|
10
14
|
*
|
|
11
15
|
* Classification is **structural** (which subdirectory holds the file), not the directive
|
|
12
16
|
* frontmatter's `kind:` field — and that is the one point spec-011 does settle: the six P3.8 template
|
|
@@ -32,20 +36,19 @@
|
|
|
32
36
|
* This lives in `src/core` (not `src/directives`/`src/workflow`) because REQ-SEC-07 crosscuts both
|
|
33
37
|
* pillars identically and both the CLI and MCP surfaces must enforce it the same way (REQ-SYS-05) —
|
|
34
38
|
* the same reasoning `requireGitIdentity` (REQ-SEC-01, task-014) already established for a
|
|
35
|
-
* cross-cutting mutating-op pre-flight.
|
|
36
|
-
* `
|
|
37
|
-
*
|
|
38
|
-
* wiring it into the actual mutating op to the dependent task (task-052-directive-remove for
|
|
39
|
-
* `directive.remove`; a future task for `workflow.remove`).
|
|
39
|
+
* cross-cutting mutating-op pre-flight. It shipped (task-042) before either remove operation; both now
|
|
40
|
+
* call it: `directive remove` (task-052-directive-remove) and `workflow remove` (task-211,
|
|
41
|
+
* `./workflow-create-remove.ts`).
|
|
40
42
|
*
|
|
41
43
|
* **Scope:** this module delivers REQ-SEC-07's *first* clause only. The second — "removal of a
|
|
42
|
-
* still-referenced custom asset is rejected naming the referrer" — is
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
44
|
+
* still-referenced custom asset is rejected naming the referrer" — is each remove operation's own, per
|
|
45
|
+
* `dl-030-req-sec-07-referenced-asset-ownership` (`ready`): the directive half is `checkUnreferenced`
|
|
46
|
+
* (`./directive-assign.ts`, task-052), the workflow half `workflow remove`'s include and open-instance
|
|
47
|
+
* refusals (task-211). `requireCustomAsset` is therefore the FIRST of two checks a remove op runs, never
|
|
48
|
+
* the only one.
|
|
46
49
|
*/
|
|
47
50
|
import { type CoreResult } from './types';
|
|
48
|
-
/** The two pillars
|
|
51
|
+
/** The two pillars whose removal this check guards — `built-in/` is immutable in both (REQ-SEC-07 also names built-in agent adapters, which no operation removes). */
|
|
49
52
|
export type AssetKind = 'directive' | 'workflow';
|
|
50
53
|
/**
|
|
51
54
|
* The allow-list: true only when `relativePath` is positively recognised as a removable `custom/`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtin-asset.d.ts","sourceRoot":"","sources":["../../src/core/builtin-asset.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"builtin-asset.d.ts","sourceRoot":"","sources":["../../src/core/builtin-asset.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAE3D,sKAAsK;AACtK,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;AAiDjD;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAEzF;AAcD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAQ1F"}
|
|
@@ -5,12 +5,16 @@ exports.requireCustomAsset = requireCustomAsset;
|
|
|
5
5
|
/**
|
|
6
6
|
* Immutable built-in assets pre-flight check (REQ-SEC-07 — task-042-immutable-builtin-assets).
|
|
7
7
|
*
|
|
8
|
-
* **The rule is REQ-SEC-07's, the layout is spec-011's.** REQ-SEC-07 states that built-in directives
|
|
9
|
-
*
|
|
8
|
+
* **The rule is REQ-SEC-07's, the layout is spec-011's.** REQ-SEC-07 states that built-in directives,
|
|
9
|
+
* built-in workflow templates and (since task-196) built-in agent adapters cannot be removed. This
|
|
10
|
+
* module checks the first two only: no operation removes an adapter (`spec-016` §2.1), and
|
|
11
|
+
* `test/core/builtin-adapter-writers.test.ts` keeps it so. `spec-011-storage-layout` supplies the structure
|
|
10
12
|
* that rule is expressed over — the `directives/{built-in,custom}/` and `workflows/{built-in,custom}/`
|
|
11
|
-
* split, where `built-in/`
|
|
12
|
-
*
|
|
13
|
-
* the
|
|
13
|
+
* split, where `built-in/` holds the official templates shipped by the `wingfoil` npm package (the P3.8
|
|
14
|
+
* directive templates `wingfoil init` installs, task-057; no workflow templates ship yet) and `custom/`
|
|
15
|
+
* holds the project's own assets. This repository's own `directives/built-in/` holds only `.gitkeep`:
|
|
16
|
+
* its hand-authored configuration predates the templates. Only the removability rule comes from
|
|
17
|
+
* REQ-SEC-07; spec-011 never speaks about removal or protection.
|
|
14
18
|
*
|
|
15
19
|
* Classification is **structural** (which subdirectory holds the file), not the directive
|
|
16
20
|
* frontmatter's `kind:` field — and that is the one point spec-011 does settle: the six P3.8 template
|
|
@@ -36,17 +40,16 @@ exports.requireCustomAsset = requireCustomAsset;
|
|
|
36
40
|
* This lives in `src/core` (not `src/directives`/`src/workflow`) because REQ-SEC-07 crosscuts both
|
|
37
41
|
* pillars identically and both the CLI and MCP surfaces must enforce it the same way (REQ-SYS-05) —
|
|
38
42
|
* the same reasoning `requireGitIdentity` (REQ-SEC-01, task-014) already established for a
|
|
39
|
-
* cross-cutting mutating-op pre-flight.
|
|
40
|
-
* `
|
|
41
|
-
*
|
|
42
|
-
* wiring it into the actual mutating op to the dependent task (task-052-directive-remove for
|
|
43
|
-
* `directive.remove`; a future task for `workflow.remove`).
|
|
43
|
+
* cross-cutting mutating-op pre-flight. It shipped (task-042) before either remove operation; both now
|
|
44
|
+
* call it: `directive remove` (task-052-directive-remove) and `workflow remove` (task-211,
|
|
45
|
+
* `./workflow-create-remove.ts`).
|
|
44
46
|
*
|
|
45
47
|
* **Scope:** this module delivers REQ-SEC-07's *first* clause only. The second — "removal of a
|
|
46
|
-
* still-referenced custom asset is rejected naming the referrer" — is
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
48
|
+
* still-referenced custom asset is rejected naming the referrer" — is each remove operation's own, per
|
|
49
|
+
* `dl-030-req-sec-07-referenced-asset-ownership` (`ready`): the directive half is `checkUnreferenced`
|
|
50
|
+
* (`./directive-assign.ts`, task-052), the workflow half `workflow remove`'s include and open-instance
|
|
51
|
+
* refusals (task-211). `requireCustomAsset` is therefore the FIRST of two checks a remove op runs, never
|
|
52
|
+
* the only one.
|
|
50
53
|
*/
|
|
51
54
|
const types_1 = require("./types");
|
|
52
55
|
/** The `.wingfoil/` top-level directory that holds each pillar's assets (spec-011 layout). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtin-asset.js","sourceRoot":"","sources":["../../src/core/builtin-asset.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"builtin-asset.js","sourceRoot":"","sources":["../../src/core/builtin-asset.ts"],"names":[],"mappings":";;AA8GA,gEAEC;AAwBD,gDAQC;AAhJD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,mCAA2D;AAK3D,8FAA8F;AAC9F,MAAM,kBAAkB,GAA8B;IACpD,SAAS,EAAE,YAAY;IACvB,QAAQ,EAAE,WAAW;CACtB,CAAC;AAEF,oGAAoG;AACpG,MAAM,cAAc,GAAG,QAAQ,CAAC;AAEhC,8EAA8E;AAC9E,MAAM,gBAAgB,GAAG,UAAU,CAAC;AAEpC;;;;;;;GAOG;AACH,MAAM,sBAAsB,GAA8B;IACxD,SAAS,EAAE,uCAAuC;IAClD,QAAQ,EAAE,sCAAsC;CACjD,CAAC;AAEF;;;;GAIG;AACH,SAAS,UAAU,CAAC,YAAoB;IACtC,OAAO,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC;AAED;;;;;GAKG;AACH,SAAS,iBAAiB,CAAC,IAAe,EAAE,YAAoB,EAAE,YAAoB;IACpF,MAAM,QAAQ,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IAC1C,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IACtC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,KAAK,EAAE,IAAI,OAAO,KAAK,GAAG,IAAI,OAAO,KAAK,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACtG,OAAO,QAAQ,CAAC,CAAC,CAAC,KAAK,kBAAkB,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,YAAY,CAAC;AAClF,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,0BAA0B,CAAC,IAAe,EAAE,YAAoB;IAC9E,OAAO,iBAAiB,CAAC,IAAI,EAAE,YAAY,EAAE,cAAc,CAAC,CAAC;AAC/D,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,mBAAmB,CAAC,IAAe,EAAE,YAAoB;IAChE,OAAO,iBAAiB,CAAC,IAAI,EAAE,YAAY,EAAE,gBAAgB,CAAC,CAAC;AACjE,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,kBAAkB,CAAC,IAAe,EAAE,YAAoB;IACtE,IAAI,0BAA0B,CAAC,IAAI,EAAE,YAAY,CAAC,EAAE,CAAC;QACnD,OAAO,IAAA,cAAM,EAAO,SAAS,CAAC,CAAC;IACjC,CAAC;IACD,MAAM,OAAO,GAAG,mBAAmB,CAAC,IAAI,EAAE,YAAY,CAAC;QACrD,CAAC,CAAC,sBAAsB,CAAC,IAAI,CAAC;QAC9B,CAAC,CAAC,kBAAkB,YAAY,YAAY,IAAI,WAAW,kBAAkB,CAAC,IAAI,CAAC,IAAI,cAAc,IAAI,CAAC;IAC5G,OAAO,IAAA,eAAO,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -9,10 +9,15 @@ export interface BuiltinIntegrityFailure {
|
|
|
9
9
|
readonly name: string;
|
|
10
10
|
readonly kind: BuiltinTemplateKind;
|
|
11
11
|
readonly message: string;
|
|
12
|
+
/**
|
|
13
|
+
* The spec-007 §2 `pattern_id` of the blocking finding, present only when the source failed the
|
|
14
|
+
* secret scan ({@link secretScanFailure}) rather than its schema check.
|
|
15
|
+
*/
|
|
16
|
+
readonly patternId?: string;
|
|
12
17
|
}
|
|
13
18
|
/**
|
|
14
|
-
* Schema-check every `sources` entry, in list order (REQ-SYS-07: deterministic,
|
|
15
|
-
* iteration), and return the FIRST one that fails — or `null` when every source is valid (including
|
|
19
|
+
* Schema-check, then secret-scan, every `sources` entry, in list order (REQ-SYS-07: deterministic,
|
|
20
|
+
* no unordered iteration), and return the FIRST one that fails — or `null` when every source is valid (including
|
|
16
21
|
* the trivial, always-passing case of an empty list, which is what `src/storage/templates.ts`'s
|
|
17
22
|
* `builtinTemplateSources` derives from the P1.1 minimal skeleton, whose built-in directory holds only
|
|
18
23
|
* a `.gitkeep`; `templateScaffold` yields the six P3.8 built-in directives since
|
|
@@ -22,6 +27,11 @@ export interface BuiltinIntegrityFailure {
|
|
|
22
27
|
* reported as a failure ({@link unknownKindMessage}) rather than skipped or thrown on — it cannot be
|
|
23
28
|
* checked, so it must not be installed.
|
|
24
29
|
*
|
|
30
|
+
* The secret scan ({@link secretScanFailure}) is spec-007 §4 step 5's "additional integrity gate run
|
|
31
|
+
* in the same pre-write pass" (task-135, `bug-038`): a source that passes its schema check but
|
|
32
|
+
* carries a `blocking` spec-007 §2 finding fails too, naming the template and the `pattern_id`. A
|
|
33
|
+
* source is scanned only once its schema check has passed, so each source reports one failure.
|
|
34
|
+
*
|
|
25
35
|
* Callers — `initWingfoilProject` AND `initWingfoilStorage`, both in `src/core/init.ts`; every
|
|
26
36
|
* `initStorage` write path there is one — MUST run this before writing any file: REQ-SEC-10's fit
|
|
27
37
|
* criterion requires the abort to happen "before writing partial assets". This function itself never
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtin-integrity.d.ts","sourceRoot":"","sources":["../../src/core/builtin-integrity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"builtin-integrity.d.ts","sourceRoot":"","sources":["../../src/core/builtin-integrity.ts"],"names":[],"mappings":"AAuCA,OAAO,EAA4C,KAAK,mBAAmB,EAAE,KAAK,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAM5H,YAAY,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAE7E;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAkJD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,SAAS,qBAAqB,EAAE,GACxC,uBAAuB,GAAG,IAAI,CAiBhC"}
|
|
@@ -16,9 +16,17 @@ exports.verifyBuiltinTemplates = verifyBuiltinTemplates;
|
|
|
16
16
|
* ordering determinism surface against REQ-SYS-07. Distribution-channel assurance lives in `adr-009`
|
|
17
17
|
* / `spec-015` (npm provenance) instead. Do not "strengthen" this module with hashing.
|
|
18
18
|
*
|
|
19
|
+
* The same pre-write pass also runs the spec-007 §4 step 5 secret scan over each source (task-135,
|
|
20
|
+
* `bug-038`), which is a separate gate from the REQ-SEC-10 schema check, serving REQ-SEC-08: a
|
|
21
|
+
* secret in a shipped template would be installed into every new project. It is a regex scan of
|
|
22
|
+
* the content, not a digest, so the paragraph above still holds.
|
|
23
|
+
*
|
|
24
|
+
* Since task-196 it also checks the built-in agent adapter manifests `init` installs under
|
|
25
|
+
* `.wingfoil/agents/built-in/` (kind `adapter`, `spec-016` §2.1), against the task-177 manifest schema.
|
|
26
|
+
*
|
|
19
27
|
* A cross-pillar concern by construction — checking a directive source needs the Directives pillar's
|
|
20
28
|
* `DirectiveFrontmatter` schema, checking a workflow source needs the Workflow pillar's `Workflow`
|
|
21
|
-
* schema — so, per `src/core/loaders.ts`'s own precedent ("Cross-file concerns ... need the caller to
|
|
29
|
+
* schema and its loader rules, an adapter source the `agent` module's manifest parser — so, per `src/core/loaders.ts`'s own precedent ("Cross-file concerns ... need the caller to
|
|
22
30
|
* have actually loaded the referenced files ... live in the loader, not [a pillar] schema module"),
|
|
23
31
|
* this lives in `core`, not in either pillar module or in `storage` (which only carries the raw
|
|
24
32
|
* {@link BuiltinTemplateSource} shape — see `src/storage/templates.ts`). Reuses the exact same
|
|
@@ -30,10 +38,12 @@ exports.verifyBuiltinTemplates = verifyBuiltinTemplates;
|
|
|
30
38
|
* randomness) — the same corrupted input always yields the same failure, and callers may pass a
|
|
31
39
|
* fixture list in tests via {@link BuiltinTemplateSource} without touching disk.
|
|
32
40
|
*/
|
|
41
|
+
const manifest_1 = require("../agent/manifest");
|
|
33
42
|
const schema_1 = require("../directives/schema");
|
|
34
43
|
const storage_1 = require("../storage");
|
|
35
44
|
const validation_1 = require("../validation");
|
|
36
45
|
const schema_2 = require("../workflow/schema");
|
|
46
|
+
const workflow_diagnostics_1 = require("./workflow-diagnostics");
|
|
37
47
|
/**
|
|
38
48
|
* `true` iff `source.content` parses as a `.md` document with a frontmatter block that validates
|
|
39
49
|
* against `DirectiveFrontmatter` (the same schema `core/loaders.ts`'s `loadDirectives` runs custom
|
|
@@ -55,13 +65,41 @@ function isValidDirectiveSource(source) {
|
|
|
55
65
|
}
|
|
56
66
|
}
|
|
57
67
|
/**
|
|
58
|
-
* `true` iff `source.content` parses as YAML
|
|
59
|
-
* schema `core/loaders.ts`'s `loadWorkflowsYaml` runs every included workflow file through)
|
|
68
|
+
* `true` iff `source.content` parses as YAML, validates against the `Workflow` schema (the same
|
|
69
|
+
* schema `core/loaders.ts`'s `loadWorkflowsYaml` runs every included workflow file through), and
|
|
70
|
+
* raises no error under the loader's per-file rules (`workflowFileDiagnostics`, spec-003 §
|
|
71
|
+
* "Diagnostics") — so a template that passes integrity also loads (task-196, `bug-183`: a template
|
|
72
|
+
* with neither `kind` nor `startable`/`includable` used to pass here and be refused by the loader).
|
|
73
|
+
*
|
|
74
|
+
* The template is checked as the only file of a registry whose names are NOT complete: a rule that
|
|
75
|
+
* needs another file (an `include` naming a workflow outside the template) is undecidable here, and
|
|
76
|
+
* the loader's own rule is to report nothing it cannot decide. Warnings never fail it, as they never
|
|
77
|
+
* fail a load.
|
|
60
78
|
*/
|
|
61
79
|
function isValidWorkflowSource(source) {
|
|
80
|
+
let workflow;
|
|
62
81
|
try {
|
|
63
|
-
|
|
64
|
-
|
|
82
|
+
workflow = (0, validation_1.runValidation)(schema_2.Workflow, (0, validation_1.parseYaml)(source.content, source.name), source.name);
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
const index = { byName: new Map([[workflow.name, 0]]), namesComplete: false };
|
|
88
|
+
const loaded = [{ file: source.name, workflow, rawName: workflow.name }];
|
|
89
|
+
return !(0, workflow_diagnostics_1.workflowFileDiagnostics)(loaded, index, 0).some((diagnostic) => diagnostic.severity === 'error');
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* `true` iff `source.content` is a valid BUILT-IN adapter manifest (`spec-016` §2.2–§2.3, task-196):
|
|
93
|
+
* the task-177 parser `loadAdapter` runs, with kind `built-in` (so `verified_with` is required) and
|
|
94
|
+
* the source's name as the file basename the manifest's `name` must equal.
|
|
95
|
+
*/
|
|
96
|
+
function isValidAdapterSource(source) {
|
|
97
|
+
try {
|
|
98
|
+
(0, manifest_1.parseAdapterManifest)(source.content, {
|
|
99
|
+
name: source.name,
|
|
100
|
+
kind: 'built-in',
|
|
101
|
+
file: `${storage_1.BUILTIN_ADAPTERS_DIR}/${source.name}.yaml`,
|
|
102
|
+
});
|
|
65
103
|
return true;
|
|
66
104
|
}
|
|
67
105
|
catch {
|
|
@@ -72,8 +110,9 @@ function isValidWorkflowSource(source) {
|
|
|
72
110
|
* Per-kind schema-check policy: the `isValid` predicate to apply and the exact REQ-SEC-10 abort-message
|
|
73
111
|
* builder to use when it fails. Keyed by {@link BuiltinTemplateKind} so each kind's validator and its
|
|
74
112
|
* BDD wording live together and `verifyBuiltinTemplates` branches on `kind` exactly once. The message
|
|
75
|
-
* strings are verbatim BDD contracts — P3.8 "Error - a built-in template fails
|
|
76
|
-
* and P4.17 "Error - a built-in workflow template is structurally invalid" — do
|
|
113
|
+
* strings of the first two kinds are verbatim BDD contracts — P3.8 "Error - a built-in template fails
|
|
114
|
+
* its integrity check" and P4.17 "Error - a built-in workflow template is structurally invalid" — do
|
|
115
|
+
* not reword. The `adapter` kind (task-196) follows the directive message's shape.
|
|
77
116
|
*
|
|
78
117
|
* Declared as an EXHAUSTIVE `Record` so widening {@link BuiltinTemplateKind} is a compile error until
|
|
79
118
|
* the new kind gets a policy; look it up only through {@link policyFor}, never by bare indexing.
|
|
@@ -87,6 +126,11 @@ const INTEGRITY_POLICY = {
|
|
|
87
126
|
isValid: isValidWorkflowSource,
|
|
88
127
|
message: (name) => `built-in workflow template invalid: ${name}`,
|
|
89
128
|
},
|
|
129
|
+
// task-196: the built-in directive's message shape; no BDD scenario pins this wording yet.
|
|
130
|
+
adapter: {
|
|
131
|
+
isValid: isValidAdapterSource,
|
|
132
|
+
message: (name) => `built-in adapter template integrity check failed: ${name}`,
|
|
133
|
+
},
|
|
90
134
|
};
|
|
91
135
|
/**
|
|
92
136
|
* The REQ-SEC-10 message for a source whose `kind` has no policy — the fail-closed branch. Not a BDD
|
|
@@ -112,8 +156,32 @@ function policyFor(kind) {
|
|
|
112
156
|
return Object.prototype.hasOwnProperty.call(INTEGRITY_POLICY, kind) ? INTEGRITY_POLICY[kind] : undefined;
|
|
113
157
|
}
|
|
114
158
|
/**
|
|
115
|
-
*
|
|
116
|
-
*
|
|
159
|
+
* The spec-007 §4 step 5 secret scan of one built-in source (task-135, `bug-038`): `null` when the
|
|
160
|
+
* content carries no `blocking` finding, otherwise a failure naming the template and the FIRST
|
|
161
|
+
* blocking finding's `pattern_id` and line (`scanText` reports findings in line order, then in the
|
|
162
|
+
* declared pattern order, so the choice is deterministic, REQ-SYS-07).
|
|
163
|
+
*
|
|
164
|
+
* The scan runs on the source's content exactly as it would be written, with the §3 exclusions
|
|
165
|
+
* `scanText` applies (fenced examples, placeholder values) and no `security-ignore` list: an ignore
|
|
166
|
+
* file belongs to the project being initialized, which does not exist yet. `warn` findings never
|
|
167
|
+
* fail it (§4 step 6), and they are not surfaced: `init` has no warning channel, and a built-in
|
|
168
|
+
* template is not the operator's to review.
|
|
169
|
+
*/
|
|
170
|
+
function secretScanFailure(source) {
|
|
171
|
+
const [finding] = (0, validation_1.scanText)(source.content, source.name).blocking;
|
|
172
|
+
if (finding === undefined)
|
|
173
|
+
return null;
|
|
174
|
+
return {
|
|
175
|
+
name: source.name,
|
|
176
|
+
kind: source.kind,
|
|
177
|
+
patternId: finding.patternId,
|
|
178
|
+
message: `built-in ${source.kind} template secret scan failed: ${source.name} ` +
|
|
179
|
+
`(${finding.patternId}, line ${finding.line})`,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Schema-check, then secret-scan, every `sources` entry, in list order (REQ-SYS-07: deterministic,
|
|
184
|
+
* no unordered iteration), and return the FIRST one that fails — or `null` when every source is valid (including
|
|
117
185
|
* the trivial, always-passing case of an empty list, which is what `src/storage/templates.ts`'s
|
|
118
186
|
* `builtinTemplateSources` derives from the P1.1 minimal skeleton, whose built-in directory holds only
|
|
119
187
|
* a `.gitkeep`; `templateScaffold` yields the six P3.8 built-in directives since
|
|
@@ -123,6 +191,11 @@ function policyFor(kind) {
|
|
|
123
191
|
* reported as a failure ({@link unknownKindMessage}) rather than skipped or thrown on — it cannot be
|
|
124
192
|
* checked, so it must not be installed.
|
|
125
193
|
*
|
|
194
|
+
* The secret scan ({@link secretScanFailure}) is spec-007 §4 step 5's "additional integrity gate run
|
|
195
|
+
* in the same pre-write pass" (task-135, `bug-038`): a source that passes its schema check but
|
|
196
|
+
* carries a `blocking` spec-007 §2 finding fails too, naming the template and the `pattern_id`. A
|
|
197
|
+
* source is scanned only once its schema check has passed, so each source reports one failure.
|
|
198
|
+
*
|
|
126
199
|
* Callers — `initWingfoilProject` AND `initWingfoilStorage`, both in `src/core/init.ts`; every
|
|
127
200
|
* `initStorage` write path there is one — MUST run this before writing any file: REQ-SEC-10's fit
|
|
128
201
|
* criterion requires the abort to happen "before writing partial assets". This function itself never
|
|
@@ -142,6 +215,9 @@ function verifyBuiltinTemplates(sources) {
|
|
|
142
215
|
if (!policy.isValid(source)) {
|
|
143
216
|
return { name: source.name, kind: source.kind, message: policy.message(source.name) };
|
|
144
217
|
}
|
|
218
|
+
const secret = secretScanFailure(source);
|
|
219
|
+
if (secret !== null)
|
|
220
|
+
return secret;
|
|
145
221
|
}
|
|
146
222
|
return null;
|
|
147
223
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtin-integrity.js","sourceRoot":"","sources":["../../src/core/builtin-integrity.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"builtin-integrity.js","sourceRoot":"","sources":["../../src/core/builtin-integrity.ts"],"names":[],"mappings":"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"}
|
|
@@ -22,7 +22,9 @@ import { type CoreResult } from './types';
|
|
|
22
22
|
* does not ask.
|
|
23
23
|
*
|
|
24
24
|
* @param root - Project root.
|
|
25
|
-
* @param relativePath -
|
|
25
|
+
* @param relativePath - The path of the file the operation is about to touch, as the refusal should
|
|
26
|
+
* name it: root-relative POSIX, or absolute (resolved as is) — the run log passes its configured
|
|
27
|
+
* `paths.runs` spelling, so a refusal names `/etc/<id>.jsonl` rather than a `../` climb (bug-288).
|
|
26
28
|
* @param action - The verb for the refusal's first clause, e.g. `'remove'` → `cannot remove '<path>'`
|
|
27
29
|
* (P3.3's own message shape, shared with `requireCustomAsset`).
|
|
28
30
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confinement.d.ts","sourceRoot":"","sources":["../../src/core/confinement.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"confinement.d.ts","sourceRoot":"","sources":["../../src/core/confinement.ts"],"names":[],"mappings":"AAiCA,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,GACb,UAAU,CAAC,IAAI,CAAC,CAUlB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,GACb,UAAU,CAAC,IAAI,CAAC,CAKlB"}
|
package/dist/core/confinement.js
CHANGED
|
@@ -24,9 +24,10 @@ exports.requireConfinedWriteTarget = requireConfinedWriteTarget;
|
|
|
24
24
|
* have prevented; the refusal has to land before the filesystem is touched at all.
|
|
25
25
|
*
|
|
26
26
|
* **Baseline.** This guard resolves against the **working tree**, not `HEAD`, and that is deliberate
|
|
27
|
-
* —
|
|
28
|
-
*
|
|
29
|
-
*
|
|
27
|
+
* — the filesystem-effect read the `command-baseline` directive and `spec-006-core-domain-api` §6
|
|
28
|
+
* declare, argued in `task-102`'s Execution Notes and ratified in
|
|
29
|
+
* `dl-086-a-guard-over-a-filesystem-effect-resolves-on-the-filesystem`, never settled here. The
|
|
30
|
+
* one-line reason: what this predicts is where `unlinkSync` — or, on the write path,
|
|
30
31
|
* `writeFileSync` — will land, and both follow the symlinks that are on disk, not the ones a commit
|
|
31
32
|
* records.
|
|
32
33
|
*/
|
|
@@ -56,7 +57,9 @@ const types_1 = require("./types");
|
|
|
56
57
|
* does not ask.
|
|
57
58
|
*
|
|
58
59
|
* @param root - Project root.
|
|
59
|
-
* @param relativePath -
|
|
60
|
+
* @param relativePath - The path of the file the operation is about to touch, as the refusal should
|
|
61
|
+
* name it: root-relative POSIX, or absolute (resolved as is) — the run log passes its configured
|
|
62
|
+
* `paths.runs` spelling, so a refusal names `/etc/<id>.jsonl` rather than a `../` climb (bug-288).
|
|
60
63
|
* @param action - The verb for the refusal's first clause, e.g. `'remove'` → `cannot remove '<path>'`
|
|
61
64
|
* (P3.3's own message shape, shared with `requireCustomAsset`).
|
|
62
65
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confinement.js","sourceRoot":"","sources":["../../src/core/confinement.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"confinement.js","sourceRoot":"","sources":["../../src/core/confinement.ts"],"names":[],"mappings":";;AAgEA,sDAcC;AA4BD,gEASC;AAnHD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,yCAAiC;AAEjC,wDAAsG;AAEtG,mCAA2D;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,SAAgB,qBAAqB,CACnC,IAAY,EACZ,YAAoB,EACpB,MAAc;IAEd,MAAM,QAAQ,GAAG,IAAA,mCAAqB,EAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IAC3D,IAAI,QAAQ,CAAC,MAAM;QAAE,OAAO,IAAA,cAAM,EAAO,SAAS,CAAC,CAAC;IACpD,OAAO,IAAA,eAAO,EAAC;QACb,IAAI,EAAE,YAAY;QAClB,OAAO,EACL,UAAU,MAAM,KAAK,YAAY,sBAAsB,QAAQ,CAAC,IAAI,+BAA+B;YACnG,qGAAqG;YACrG,0DAA0D;KAC7D,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,SAAgB,0BAA0B,CACxC,IAAY,EACZ,YAAoB,EACpB,MAAc;IAEd,MAAM,QAAQ,GAAG,qBAAqB,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;IACnE,IAAI,CAAC,QAAQ,CAAC,EAAE;QAAE,OAAO,QAAQ,CAAC;IAClC,IAAI,CAAC,IAAA,6BAAe,EAAC,IAAA,gBAAI,EAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QAAE,OAAO,IAAA,cAAM,EAAO,SAAS,CAAC,CAAC;IAC/E,OAAO,IAAA,eAAO,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,IAAA,kCAAoB,EAAC,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,CAAC;AAC9F,CAAC"}
|