@pixel-point/toolcraft 0.0.18 → 0.0.19
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/package.json +1 -1
- package/src/generate-demand-only-lifecycle.test.mjs +9 -1
- package/src/generate-performance-iteration-execution.test.mjs +3 -3
- package/src/generate-test-delivery-architecture-assertions.mjs +11 -73
- package/src/generate-test-demand-only-lifecycle.mjs +34 -36
- package/src/generate-test-dependency-sandbox.mjs +4 -1
- package/src/generate-test-doc-assertions.mjs +55 -53
- package/src/generate-test-doc-assertions.test.mjs +1 -1
- package/src/generate-test-doc-policy-assertions.mjs +1 -1
- package/src/generate-test-export-doc-assertions.mjs +53 -0
- package/src/generate-test-file-assertions.mjs +51 -8
- package/src/generate-test-integrity-assertions.mjs +5 -2
- package/src/generate-test-integrity-manifest-assertions.mjs +16 -5
- package/src/generate-test-integrity-ownership-assertions.mjs +36 -4
- package/src/generate-test-package-assertions.mjs +4 -0
- package/src/generate-test-product-fixture.mjs +1 -1
- package/src/generate-test-product-fixture.test.mjs +35 -38
- package/src/generate-test-product-iteration.mjs +0 -1
- package/src/generate-test-product-iteration.test.mjs +0 -1
- package/src/generate-test-runtime-boundary-assertions.mjs +20 -0
- package/src/generate-test-standalone-assertions.mjs +0 -16
- package/src/generate-test-standalone-delivery-stages.mjs +2 -86
- package/src/generate.test.mjs +4 -0
- package/src/generated-integrity-manifest.test.mjs +5 -2
- package/src/generated-source-policy.test.mjs +0 -4
- package/src/package-json.mjs +5 -0
- package/src/package-json.test.mjs +21 -0
- package/src/package-manager.mjs +2 -0
- package/src/package-manager.test.mjs +8 -0
- package/src/packaged-template-fallback-helpers.mjs +254 -0
- package/src/packaged-template-fallback.test.mjs +121 -46
- package/src/packaged-template-runtime-assertions.mjs +150 -0
- package/templates/runtime/contracts/component-contracts.choices.test.ts +18 -3
- package/templates/runtime/contracts/component-contracts.choices.ts +8 -3
- package/templates/runtime/contracts/component-contracts.inputs.ts +2 -1
- package/templates/runtime/contracts/component-contracts.runtime-acceptance.test.ts +18 -4
- package/templates/runtime/contracts/component-contracts.runtime-shell.test.ts +1 -1
- package/templates/runtime/contracts/component-contracts.runtime.ts +7 -4
- package/templates/runtime/contracts/component-contracts.visual.test.ts +20 -0
- package/templates/runtime/contracts/component-contracts.visual.ts +4 -0
- package/templates/runtime/contracts/decision-contracts.test.ts +18 -12
- package/templates/runtime/contracts/decision-contracts.ts +4 -4
- package/templates/runtime/contracts/performance-verification-policy.test.ts +12 -12
- package/templates/runtime/contracts/performance-verification-policy.ts +8 -8
- package/templates/runtime/export/artifact-download.ts +1 -0
- package/templates/runtime/export/artifact-frame-renderer.ts +2 -15
- package/templates/runtime/export/artifact-frame-state.ts +16 -0
- package/templates/runtime/export/artifact-scene-frame.test.ts +3 -3
- package/templates/runtime/export/artifact-scene-frame.ts +3 -3
- package/templates/runtime/export/export-error.ts +5 -0
- package/templates/runtime/export/export-renderer-coverage.ts +54 -0
- package/templates/runtime/export/image-artifact-export.ts +2 -2
- package/templates/runtime/export/index.ts +13 -0
- package/templates/runtime/export/product-export-renderer.test.ts +38 -4
- package/templates/runtime/export/product-export-renderer.ts +0 -41
- package/templates/runtime/export/product-svg-export-renderer.ts +21 -0
- package/templates/runtime/export/svg-artifact-export.test.ts +98 -0
- package/templates/runtime/export/svg-artifact-export.ts +120 -0
- package/templates/runtime/export/svg-document.test.ts +221 -0
- package/templates/runtime/export/svg-document.ts +400 -0
- package/templates/runtime/export/svg-policy.ts +47 -0
- package/templates/runtime/index.ts +1 -0
- package/templates/runtime/react/app-shell/runtime-public-api.test.tsx +10 -0
- package/templates/runtime/react/app-shell/settings-transfer.test.ts +21 -0
- package/templates/runtime/react/app-shell/toolcraft-app.scene-export.test.tsx +46 -1
- package/templates/runtime/react/app-shell/toolcraft-app.tsx +7 -2
- package/templates/runtime/react/canvas/canvas-shell-interactions.test.tsx +30 -0
- package/templates/runtime/react/canvas/canvas-shell-pinch-interactions.test.tsx +155 -0
- package/templates/runtime/react/canvas/canvas-shell-rendering.test.tsx +1 -1
- package/templates/runtime/react/canvas/canvas-shell.tsx +16 -5
- package/templates/runtime/react/canvas/canvas-viewport-geometry.ts +133 -0
- package/templates/runtime/react/canvas/use-canvas-viewport-interactions.ts +285 -36
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.color-applicability-layout.test.tsx +134 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.color-layout.test.tsx +16 -1
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.render-isolation.test.tsx +2 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.scene-export-actions.test.tsx +39 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.setup-controls.test.tsx +3 -3
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.source-collection.test.tsx +1 -4
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.source-color-bank.test.tsx +2 -2
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.vector-interaction.test.tsx +6 -6
- package/templates/runtime/react/controls-panel/actions/controls-panel-actions.ts +2 -2
- package/templates/runtime/react/controls-panel/actions/export-action-runner.ts +40 -11
- package/templates/runtime/react/controls-panel/layout/controls-panel-layout.tsx +31 -2
- package/templates/runtime/react/controls-panel/layout/controls-panel-section.tsx +4 -1
- package/templates/runtime/react/controls-panel/renderers/controls-panel-action-renderer.tsx +2 -1
- package/templates/runtime/react/controls-panel/renderers/controls-panel-basic-renderers.tsx +2 -52
- package/templates/runtime/react/controls-panel/values/controls-panel-color-values.ts +1 -9
- package/templates/runtime/react/controls-panel/values/controls-panel-spatial-values.ts +7 -2
- package/templates/runtime/react/orientation-gizmo/orientation-gizmo-math.ts +9 -69
- package/templates/runtime/schema/artifact-export-actions.test.ts +47 -0
- package/templates/runtime/schema/artifact-export-actions.ts +49 -0
- package/templates/runtime/schema/types.ts +1 -0
- package/templates/runtime/state/canvas-background-state.ts +1 -16
- package/templates/runtime/state/canvas-state.ts +32 -20
- package/templates/runtime/state/control-value-codecs.test.ts +98 -0
- package/templates/runtime/state/control-value-codecs.ts +700 -0
- package/templates/runtime/state/control-value-normalization.test.ts +1 -1
- package/templates/runtime/state/control-value-normalization.ts +127 -135
- package/templates/runtime/state/controls-reducer.ts +26 -3
- package/templates/runtime/state/create-template-state.test.ts +30 -0
- package/templates/runtime/state/create-template-state.ts +52 -31
- package/templates/runtime/state/orientation-pose.ts +80 -0
- package/templates/runtime/state/persistence-control-values.test.ts +59 -0
- package/templates/runtime/state/reducer-controls.test.ts +45 -0
- package/templates/runtime/state/reducer-media-reset.test.ts +1 -1
- package/templates/runtime/state/reducer-timeline.test.ts +70 -0
- package/templates/runtime/state/timeline-reducer.ts +40 -2
- package/templates/runtime/testing/performance-schema-queries.ts +2 -2
- package/templates/starter/AGENTS.md +21 -22
- package/templates/starter/docs/toolcraft/README.md +6 -6
- package/templates/starter/docs/toolcraft/acceptance-testing.md +20 -20
- package/templates/starter/docs/toolcraft/agent-worklog.md +88 -1
- package/templates/starter/docs/toolcraft/assembly-workflow.md +7 -6
- package/templates/starter/docs/toolcraft/component-rules.md +2 -2
- package/templates/starter/docs/toolcraft/core/layout.md +6 -1
- package/templates/starter/docs/toolcraft/core/media-upload.md +1 -1
- package/templates/starter/docs/toolcraft/core/performance.md +8 -10
- package/templates/starter/docs/toolcraft/core/reference-study.md +80 -19
- package/templates/starter/docs/toolcraft/core/runtime-boundary.md +2 -1
- package/templates/starter/docs/toolcraft/core/setup-export.md +43 -13
- package/templates/starter/docs/toolcraft/decision-contract.md +2 -2
- package/templates/starter/docs/toolcraft/performance.md +8 -10
- package/templates/starter/docs/toolcraft/renderer-technique.md +2 -2
- package/templates/starter/docs/toolcraft/schema-reference.md +8 -8
- package/templates/starter/docs/toolcraft/workflow.md +14 -14
- package/templates/starter/e2e/app-browser-infinity-canvas-evidence.spec.ts +38 -0
- package/templates/starter/e2e/app-browser-motion-reference-requirements.spec.ts +411 -0
- package/templates/starter/e2e/app-browser-proof-session.spec.ts +85 -0
- package/templates/starter/e2e/app-browser-runtime-requirements.spec.ts +62 -0
- package/templates/starter/e2e/app-browser-selection-scope-evidence.spec.ts +137 -0
- package/templates/starter/e2e/browser-infinity-canvas-svg-evidence.ts +42 -0
- package/templates/starter/e2e/browser-layer-evidence-helpers.ts +15 -36
- package/templates/starter/e2e/browser-product-raster-snapshot.ts +213 -0
- package/templates/starter/e2e/browser-proof-session.ts +43 -15
- package/templates/starter/e2e/browser-proof-surface-action.ts +79 -0
- package/templates/starter/e2e/browser-proof-types.ts +15 -0
- package/templates/starter/e2e/browser-runtime-evidence-requirements.ts +22 -6
- package/templates/starter/e2e/browser-selection-scope-evidence.ts +269 -0
- package/templates/starter/e2e/browser-semantic-evidence-test-helpers.ts +97 -0
- package/templates/starter/e2e/browser-svg-export-evidence.spec.ts +79 -0
- package/templates/starter/e2e/browser-svg-export-evidence.ts +152 -0
- package/templates/starter/e2e/export-artifact-helpers.ts +70 -0
- package/templates/starter/e2e/product-observable-helpers.ts +8 -129
- package/templates/starter/e2e/svg-artifact-inspection.spec.ts +136 -0
- package/templates/starter/e2e/svg-artifact-inspection.ts +331 -0
- package/templates/starter/e2e/svg-download-test-fixtures.ts +34 -0
- package/templates/starter/e2e/toolcraft-delivery-catalog-reporter.ts +198 -15
- package/templates/starter/e2e/toolcraft-feature-verification-reporter.spec.ts +149 -0
- package/templates/starter/e2e/toolcraft-feature-verification-reporter.ts +223 -0
- package/templates/starter/package.json +2 -0
- package/templates/starter/scripts/check-toolcraft-docs.mjs +1 -0
- package/templates/starter/scripts/create-toolcraft-motion-reference-study.mjs +233 -0
- package/templates/starter/scripts/create-toolcraft-motion-reference-study.test.mjs +459 -0
- package/templates/starter/scripts/playwright-test-title-selection.d.mts +45 -0
- package/templates/starter/scripts/run-browser-performance-test-helpers.mjs +0 -27
- package/templates/starter/scripts/run-browser-performance.mjs +0 -6
- package/templates/starter/scripts/run-browser-performance.test.mjs +5 -13
- package/templates/starter/scripts/run-delivery-verification-test-helpers.mjs +0 -34
- package/templates/starter/scripts/run-delivery-verification.test.mjs +135 -31
- package/templates/starter/scripts/run-feature-verification.mjs +212 -0
- package/templates/starter/scripts/run-feature-verification.test.mjs +226 -0
- package/templates/starter/scripts/toolcraft-checkpoint-delivery-state.mjs +21 -8
- package/templates/starter/scripts/toolcraft-checkpoint-delivery-state.test.mjs +32 -92
- package/templates/starter/scripts/toolcraft-checkpoint-transaction.mjs +28 -6
- package/templates/starter/scripts/toolcraft-checkpoint-transaction.test.mjs +8 -63
- package/templates/starter/scripts/toolcraft-delivery-anchor.mjs +28 -8
- package/templates/starter/scripts/toolcraft-delivery-anchor.test.mjs +50 -61
- package/templates/starter/scripts/toolcraft-delivery-architecture-inventory.mjs +0 -4
- package/templates/starter/scripts/toolcraft-delivery-architecture-policy.mjs +0 -1
- package/templates/starter/scripts/toolcraft-delivery-evidence.test.mjs +2 -3
- package/templates/starter/scripts/toolcraft-delivery-executor.mjs +5 -1
- package/templates/starter/scripts/toolcraft-delivery-executor.test.mjs +5 -12
- package/templates/starter/scripts/toolcraft-delivery-functional-context.d.mts +1 -48
- package/templates/starter/scripts/toolcraft-delivery-functional-context.mjs +2 -30
- package/templates/starter/scripts/toolcraft-delivery-functional-context.test.mjs +4 -166
- package/templates/starter/scripts/toolcraft-delivery-functional-initial.test.mjs +4 -20
- package/templates/starter/scripts/toolcraft-delivery-lifecycle.mjs +43 -192
- package/templates/starter/scripts/toolcraft-delivery-performance-iteration-lifecycle.test.mjs +79 -440
- package/templates/starter/scripts/toolcraft-delivery-plan-authority.test.mjs +102 -297
- package/templates/starter/scripts/toolcraft-delivery-plan-construction.mjs +46 -97
- package/templates/starter/scripts/toolcraft-delivery-plan-test-helpers.mjs +125 -0
- package/templates/starter/scripts/toolcraft-delivery-plan-validation.test.mjs +58 -0
- package/templates/starter/scripts/toolcraft-delivery-plan.d.mts +19 -31
- package/templates/starter/scripts/toolcraft-delivery-plan.mjs +254 -252
- package/templates/starter/scripts/toolcraft-delivery-plan.test.mjs +29 -457
- package/templates/starter/scripts/toolcraft-delivery-receipt-performance.test.mjs +1 -1
- package/templates/starter/scripts/toolcraft-delivery-receipt-strictness.test.mjs +3 -72
- package/templates/starter/scripts/toolcraft-delivery-receipt-test-helpers.mjs +7 -36
- package/templates/starter/scripts/toolcraft-delivery-receipt.d.mts +3 -5
- package/templates/starter/scripts/toolcraft-delivery-receipt.mjs +15 -31
- package/templates/starter/scripts/toolcraft-delivery-receipt.test.mjs +28 -20
- package/templates/starter/scripts/toolcraft-delivery-receipt.types.test.mts +22 -30
- package/templates/starter/scripts/toolcraft-feature-verification-plan.d.mts +20 -0
- package/templates/starter/scripts/toolcraft-feature-verification-plan.mjs +146 -0
- package/templates/starter/scripts/toolcraft-feature-verification-plan.test.mjs +96 -0
- package/templates/starter/scripts/toolcraft-functional-proof-model.d.mts +3 -18
- package/templates/starter/scripts/toolcraft-functional-proof-model.mjs +39 -127
- package/templates/starter/scripts/toolcraft-functional-proof-model.test.mjs +25 -362
- package/templates/starter/scripts/toolcraft-functional-proof-model.types.test.mts +6 -83
- package/templates/starter/scripts/toolcraft-functional-proof-primitives.d.mts +11 -0
- package/templates/starter/scripts/toolcraft-functional-proof-primitives.mjs +61 -0
- package/templates/starter/scripts/toolcraft-functional-proof-primitives.test.mjs +43 -0
- package/templates/starter/scripts/toolcraft-integrity-policy.mjs +13 -0
- package/templates/starter/scripts/toolcraft-integrity-test-utils.mjs +1 -1
- package/templates/starter/scripts/toolcraft-layer-evidence-facade.test.mjs +58 -22
- package/templates/starter/scripts/toolcraft-motion-reference-analysis-protocol.mjs +111 -0
- package/templates/starter/scripts/toolcraft-motion-reference-analysis-protocol.test.mjs +116 -0
- package/templates/starter/scripts/toolcraft-motion-reference-artifacts.d.mts +37 -0
- package/templates/starter/scripts/toolcraft-motion-reference-artifacts.mjs +308 -0
- package/templates/starter/scripts/toolcraft-motion-reference-artifacts.test.mjs +420 -0
- package/templates/starter/scripts/toolcraft-motion-reference-artifacts.types.test.mts +50 -0
- package/templates/starter/scripts/toolcraft-motion-reference-command-options.mjs +195 -0
- package/templates/starter/scripts/toolcraft-motion-reference-command-options.test.mjs +224 -0
- package/templates/starter/scripts/toolcraft-motion-reference-contact-sheet.mjs +122 -0
- package/templates/starter/scripts/toolcraft-motion-reference-contact-sheet.test.mjs +153 -0
- package/templates/starter/scripts/toolcraft-motion-reference-evidence-assembly.mjs +270 -0
- package/templates/starter/scripts/toolcraft-motion-reference-evidence.test.mjs +432 -0
- package/templates/starter/scripts/toolcraft-motion-reference-ffmpeg-output.mjs +275 -0
- package/templates/starter/scripts/toolcraft-motion-reference-ffmpeg-output.test.mjs +294 -0
- package/templates/starter/scripts/toolcraft-motion-reference-group-inventory.mjs +148 -0
- package/templates/starter/scripts/toolcraft-motion-reference-image-filter-graph.mjs +101 -0
- package/templates/starter/scripts/toolcraft-motion-reference-image-filter-graph.test.mjs +124 -0
- package/templates/starter/scripts/toolcraft-motion-reference-image-source.mjs +259 -0
- package/templates/starter/scripts/toolcraft-motion-reference-image-source.test.mjs +338 -0
- package/templates/starter/scripts/toolcraft-motion-reference-image-timing.mjs +96 -0
- package/templates/starter/scripts/toolcraft-motion-reference-image-timing.test.mjs +81 -0
- package/templates/starter/scripts/toolcraft-motion-reference-lock-recovery.test.mjs +144 -0
- package/templates/starter/scripts/toolcraft-motion-reference-media-source.mjs +165 -0
- package/templates/starter/scripts/toolcraft-motion-reference-media-source.test.mjs +299 -0
- package/templates/starter/scripts/toolcraft-motion-reference-publication-discovery.test.mjs +142 -0
- package/templates/starter/scripts/toolcraft-motion-reference-publication-isolation.test.mjs +234 -0
- package/templates/starter/scripts/toolcraft-motion-reference-publication-journal-schema.mjs +122 -0
- package/templates/starter/scripts/toolcraft-motion-reference-publication-journal-store.mjs +89 -0
- package/templates/starter/scripts/toolcraft-motion-reference-publication-journal-store.test.mjs +74 -0
- package/templates/starter/scripts/toolcraft-motion-reference-publication-journal.mjs +264 -0
- package/templates/starter/scripts/toolcraft-motion-reference-publication-journal.test.mjs +377 -0
- package/templates/starter/scripts/toolcraft-motion-reference-publication-lease.mjs +254 -0
- package/templates/starter/scripts/toolcraft-motion-reference-publication-lease.test.mjs +130 -0
- package/templates/starter/scripts/toolcraft-motion-reference-publication-staging.mjs +128 -0
- package/templates/starter/scripts/toolcraft-motion-reference-publication-staging.test.mjs +209 -0
- package/templates/starter/scripts/toolcraft-motion-reference-publication.fixtures.mjs +88 -0
- package/templates/starter/scripts/toolcraft-motion-reference-publication.mjs +249 -0
- package/templates/starter/scripts/toolcraft-motion-reference-publication.test.mjs +433 -0
- package/templates/starter/scripts/toolcraft-motion-reference-review-output.mjs +38 -0
- package/templates/starter/scripts/toolcraft-motion-reference-review-output.test.mjs +29 -0
- package/templates/starter/scripts/toolcraft-motion-reference-root-safety.test.mjs +84 -0
- package/templates/starter/scripts/toolcraft-motion-reference-roots.mjs +83 -0
- package/templates/starter/scripts/toolcraft-motion-reference-sampling.mjs +283 -0
- package/templates/starter/scripts/toolcraft-motion-reference-sampling.test.mjs +480 -0
- package/templates/starter/scripts/toolcraft-motion-reference-stage-registry.mjs +39 -0
- package/templates/starter/scripts/toolcraft-motion-reference-stage-registry.test.mjs +59 -0
- package/templates/starter/scripts/toolcraft-motion-reference-stage.mjs +71 -0
- package/templates/starter/scripts/toolcraft-motion-reference-stage.test.mjs +61 -0
- package/templates/starter/scripts/toolcraft-motion-review-numeric.mjs +74 -0
- package/templates/starter/scripts/toolcraft-motion-review-numeric.test.mjs +65 -0
- package/templates/starter/scripts/toolcraft-motion-review-partitioning.mjs +268 -0
- package/templates/starter/scripts/toolcraft-motion-review-partitioning.test.mjs +329 -0
- package/templates/starter/scripts/toolcraft-motion-review-protected-units.mjs +120 -0
- package/templates/starter/scripts/toolcraft-motion-review-protected-units.test.mjs +111 -0
- package/templates/starter/scripts/toolcraft-performance-escalation-policy.test.mjs +77 -345
- package/templates/starter/scripts/toolcraft-performance-receipt-validation.test.mjs +19 -21
- package/templates/starter/scripts/toolcraft-product-boundary-ast.mjs +1 -1
- package/templates/starter/scripts/toolcraft-product-export-boundary.mjs +10 -1
- package/templates/starter/scripts/toolcraft-product-export-boundary.test.mjs +5 -1
- package/templates/starter/scripts/toolcraft-product-observable-facade.test.mjs +46 -1
- package/templates/starter/scripts/toolcraft-receipt-boundary.test.mjs +0 -1
- package/templates/starter/scripts/toolcraft-source-inventory.d.mts +5 -0
- package/templates/starter/scripts/toolcraft-source-inventory.mjs +25 -14
- package/templates/starter/scripts/toolcraft-source-inventory.test.mjs +48 -0
- package/templates/starter/scripts/toolcraft-source-ownership.mjs +0 -1
- package/templates/starter/scripts/toolcraft-source-ownership.test.mjs +30 -5
- package/templates/starter/scripts/toolcraft-verification-receipt-test-helpers.mjs +5 -26
- package/templates/starter/scripts/toolcraft-verification-receipt.d.mts +0 -7
- package/templates/starter/scripts/toolcraft-verification-receipt.mjs +3 -47
- package/templates/starter/scripts/toolcraft-verification-receipt.test.mjs +6 -87
- package/templates/starter/scripts/toolcraft-vitest-runtime-contract.d.mts +19 -0
- package/templates/starter/scripts/toolcraft-vitest-runtime-contract.mjs +107 -0
- package/templates/starter/scripts/toolcraft-vitest-runtime-contract.test.mjs +114 -0
- package/templates/starter/scripts/toolcraft-vitest-runtime-evidence-reporter.mjs +13 -2
- package/templates/starter/scripts/toolcraft-vitest-runtime-evidence-reporter.test.mjs +110 -0
- package/templates/starter/src/app/acceptance/artifact-export-intent.ts +51 -20
- package/templates/starter/src/app/acceptance/canvas-coverage.ts +1 -0
- package/templates/starter/src/app/acceptance/color-bank-labels.ts +11 -15
- package/templates/starter/src/app/acceptance/color-row-grouping.ts +33 -0
- package/templates/starter/src/app/acceptance/control-acceptance-coverage.ts +0 -11
- package/templates/starter/src/app/acceptance/control-acceptance-policy.ts +2 -3
- package/templates/starter/src/app/acceptance/control-component-rules.ts +0 -10
- package/templates/starter/src/app/acceptance/control-labels.ts +30 -1
- package/templates/starter/src/app/acceptance/control-layout-section-rules.ts +18 -0
- package/templates/starter/src/app/acceptance/export-artifact-coverage.ts +25 -17
- package/templates/starter/src/app/acceptance/feature-verification-selection.test.ts +295 -0
- package/templates/starter/src/app/acceptance/feature-verification-selection.ts +161 -0
- package/templates/starter/src/app/acceptance/infinity-canvas.ts +10 -0
- package/templates/starter/src/app/acceptance/interaction-ownership-intent.ts +19 -1
- package/templates/starter/src/app/acceptance/interaction-ownership.ts +18 -2
- package/templates/starter/src/app/acceptance/motion-reference-evidence-validation.mjs +65 -0
- package/templates/starter/src/app/acceptance/motion-reference-evidence-windows.mjs +301 -0
- package/templates/starter/src/app/acceptance/motion-reference-evidence.d.mts +11 -0
- package/templates/starter/src/app/acceptance/motion-reference-evidence.mjs +145 -0
- package/templates/starter/src/app/acceptance/motion-reference-study-behaviors.ts +162 -0
- package/templates/starter/src/app/acceptance/motion-reference-study-coverage.ts +206 -0
- package/templates/starter/src/app/acceptance/motion-reference-study-identity.ts +129 -0
- package/templates/starter/src/app/acceptance/motion-reference-study-partitions.ts +186 -0
- package/templates/starter/src/app/acceptance/motion-reference-study.ts +90 -0
- package/templates/starter/src/app/acceptance/output-export-actions.test.ts +9 -1
- package/templates/starter/src/app/acceptance/output-export-actions.ts +14 -22
- package/templates/starter/src/app/acceptance/output-export-layout-rules.ts +5 -1
- package/templates/starter/src/app/acceptance/output-export-model.ts +4 -0
- package/templates/starter/src/app/acceptance/output-export.ts +4 -1
- package/templates/starter/src/app/acceptance/reference-study-types.ts +167 -17
- package/templates/starter/src/app/acceptance/runtime-coverage.ts +6 -1
- package/templates/starter/src/app/acceptance/selection-scope.test.ts +200 -0
- package/templates/starter/src/app/acceptance/selection-scope.ts +151 -0
- package/templates/starter/src/app/acceptance/transfer-mode-types.ts +114 -0
- package/templates/starter/src/app/acceptance/types.ts +43 -118
- package/templates/starter/src/app/acceptance/validate-coverage.ts +14 -3
- package/templates/starter/src/app/starter-acceptance-data.ts +1 -0
- package/templates/starter/src/app/starter-acceptance.animation-intent.test.ts +3 -0
- package/templates/starter/src/app/starter-acceptance.artifact-export-intent.test.ts +81 -8
- package/templates/starter/src/app/starter-acceptance.background-export.test.ts +2 -0
- package/templates/starter/src/app/starter-acceptance.canvas-sizing.test.ts +2 -0
- package/templates/starter/src/app/starter-acceptance.color-row-grouping.test.ts +118 -0
- package/templates/starter/src/app/starter-acceptance.compound-part-coverage.test.ts +1 -1
- package/templates/starter/src/app/starter-acceptance.contract-fixtures.ts +1 -0
- package/templates/starter/src/app/starter-acceptance.control-applicability.test.ts +1 -0
- package/templates/starter/src/app/starter-acceptance.control-label-context.test.ts +1 -0
- package/templates/starter/src/app/starter-acceptance.control-labels.test.ts +78 -3
- package/templates/starter/src/app/starter-acceptance.control-naming-rules.test.ts +77 -1
- package/templates/starter/src/app/starter-acceptance.custom-control-fit-check.test.ts +1 -1
- package/templates/starter/src/app/starter-acceptance.export-artifact.test.ts +74 -3
- package/templates/starter/src/app/starter-acceptance.export-test-utils.ts +5 -1
- package/templates/starter/src/app/starter-acceptance.image-export-settings.test.ts +2 -0
- package/templates/starter/src/app/starter-acceptance.interaction-ownership.test.ts +19 -3
- package/templates/starter/src/app/starter-acceptance.layers.test.ts +2 -1
- package/templates/starter/src/app/starter-acceptance.media-upload.test.ts +28 -0
- package/templates/starter/src/app/starter-acceptance.motion-reference-evidence.test.ts +17 -0
- package/templates/starter/src/app/starter-acceptance.motion-reference-identity.test.ts +163 -0
- package/templates/starter/src/app/starter-acceptance.motion-reference-mapping.test.ts +133 -0
- package/templates/starter/src/app/starter-acceptance.motion-reference-ownership.test.ts +121 -0
- package/templates/starter/src/app/starter-acceptance.motion-reference-partitions.test.ts +210 -0
- package/templates/starter/src/app/starter-acceptance.motion-reference-test-utils.ts +313 -0
- package/templates/starter/src/app/starter-acceptance.output-export-intent.test.ts +78 -4
- package/templates/starter/src/app/starter-acceptance.product-output-export.test.ts +6 -1
- package/templates/starter/src/app/starter-acceptance.product-readiness.test.ts +18 -1
- package/templates/starter/src/app/starter-acceptance.product-worklog.test.ts +123 -2
- package/templates/starter/src/app/starter-acceptance.reference-custom-timeline.test.ts +2 -0
- package/templates/starter/src/app/starter-acceptance.reference-foundation.test.ts +8 -0
- package/templates/starter/src/app/starter-acceptance.reference-timeline.test.ts +7 -0
- package/templates/starter/src/app/starter-acceptance.section-cohesion.test.ts +2 -0
- package/templates/starter/src/app/starter-acceptance.timeline-playback.test.ts +5 -0
- package/templates/starter/src/app/starter-acceptance.ts +34 -8
- package/templates/starter/src/app/starter-acceptance.video-export-settings.test.ts +2 -0
- package/templates/starter/src/app/starter-acceptance.video-reference-study.test.ts +34 -236
- package/templates/starter/src/app/starter-acceptance.view-interaction.test.ts +4 -0
- package/templates/starter/src/app/starter-acceptance.worklog-test-utils.ts +122 -6
- package/templates/starter/src/app/starter-acceptance.worklog.test.ts +152 -16
- package/templates/starter/src/app/starter-performance.gates.test.ts +20 -18
- package/templates/starter/src/app/starter-performance.lifecycle.test.ts +22 -6
- package/templates/starter/src/app/test-evidence/browser-runtime-contract.ts +3 -0
- package/templates/starter/tsconfig.json +1 -0
- package/templates/starter/scripts/toolcraft-browser-impact-selection.mjs +0 -26
- package/templates/starter/scripts/toolcraft-delivery-framework-refresh.test.mjs +0 -141
- package/templates/starter/scripts/toolcraft-delivery-functional-changed.test.mjs +0 -468
- package/templates/starter/scripts/toolcraft-delivery-functional-model-lifecycle.test.mjs +0 -254
- package/templates/starter/scripts/toolcraft-delivery-functional-semantic-regression.test.mjs +0 -135
- package/templates/starter/scripts/toolcraft-delivery-performance-iteration-durability.test.mjs +0 -329
- package/templates/starter/scripts/toolcraft-delivery-plan-errors.test.mjs +0 -430
- package/templates/starter/scripts/toolcraft-delivery-plan-functional-model.test.mjs +0 -358
- package/templates/starter/scripts/toolcraft-functional-proof-regression-fixtures.mjs +0 -298
- package/templates/starter/scripts/toolcraft-verification-impact-inventory.d.mts +0 -62
- package/templates/starter/scripts/toolcraft-verification-impact-inventory.mjs +0 -344
- package/templates/starter/scripts/toolcraft-verification-impact-inventory.test.mjs +0 -204
- package/templates/starter/scripts/toolcraft-verification-impact-performance-candidates.test.mjs +0 -210
- package/templates/starter/scripts/toolcraft-verification-impact-resolution.mjs +0 -344
- package/templates/starter/scripts/toolcraft-verification-impact-resolution.test.mjs +0 -270
- package/templates/starter/scripts/toolcraft-verification-impact-semantic-resolution.test.mjs +0 -449
- package/templates/starter/scripts/toolcraft-verification-impact-support-resolution.test.mjs +0 -195
- package/templates/starter/scripts/toolcraft-verification-impact.d.mts +0 -132
- package/templates/starter/scripts/toolcraft-verification-impact.mjs +0 -169
- package/templates/starter/scripts/toolcraft-verification-impact.test.mjs +0 -300
- package/templates/starter/scripts/toolcraft-verification-input-roles.mjs +0 -197
- package/templates/starter/scripts/toolcraft-verification-input-roles.test.mjs +0 -225
- package/templates/starter/src/app/acceptance/video-reference-study.ts +0 -217
- package/templates/starter/src/app/starter-verification-impact.json +0 -15
|
@@ -32,6 +32,11 @@ export type ToolcraftSourceInventoryOptions = {
|
|
|
32
32
|
|
|
33
33
|
export const toolcraftSourceExtensions: ReadonlySet<string>;
|
|
34
34
|
|
|
35
|
+
export function resolveToolcraftRootResourcePath(
|
|
36
|
+
resourcePath: string,
|
|
37
|
+
rootDir: string,
|
|
38
|
+
): string;
|
|
39
|
+
|
|
35
40
|
export function classifyToolcraftSourcePath(
|
|
36
41
|
repoPath: string,
|
|
37
42
|
options?: Omit<ToolcraftSourceInventoryOptions, "rootDir" | "sourceRoots">,
|
|
@@ -208,7 +208,21 @@ function pathEscapesRoot(rootPath, targetPath) {
|
|
|
208
208
|
);
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
function
|
|
211
|
+
function resolveExistingResourceAncestor(targetPath) {
|
|
212
|
+
let candidatePath = targetPath;
|
|
213
|
+
for (;;) {
|
|
214
|
+
try {
|
|
215
|
+
return fs.realpathSync(candidatePath);
|
|
216
|
+
} catch (error) {
|
|
217
|
+
if (error?.code !== "ENOENT") throw error;
|
|
218
|
+
const parentPath = path.dirname(candidatePath);
|
|
219
|
+
if (parentPath === candidatePath) throw error;
|
|
220
|
+
candidatePath = parentPath;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export function resolveToolcraftRootResourcePath(resourcePath, rootDir) {
|
|
212
226
|
if (
|
|
213
227
|
typeof resourcePath !== "string" ||
|
|
214
228
|
path.isAbsolute(resourcePath) ||
|
|
@@ -234,6 +248,15 @@ function resolveExplicitResourcePath(resourcePath, rootDir) {
|
|
|
234
248
|
"is outside the configured root boundary",
|
|
235
249
|
);
|
|
236
250
|
}
|
|
251
|
+
const rootRealPath = fs.realpathSync(rootDir);
|
|
252
|
+
const resourceBoundaryPath = resolveExistingResourceAncestor(absolutePath);
|
|
253
|
+
if (pathEscapesRoot(rootRealPath, resourceBoundaryPath)) {
|
|
254
|
+
throw createResourceRootEscapeError(
|
|
255
|
+
resourcePath,
|
|
256
|
+
rootDir,
|
|
257
|
+
"resolves outside the root boundary for configured root",
|
|
258
|
+
);
|
|
259
|
+
}
|
|
237
260
|
return absolutePath;
|
|
238
261
|
}
|
|
239
262
|
|
|
@@ -248,11 +271,8 @@ export function createCanonicalGraphEntries({
|
|
|
248
271
|
entry,
|
|
249
272
|
]),
|
|
250
273
|
);
|
|
251
|
-
const rootRealPath =
|
|
252
|
-
explicitResourcePaths.length > 0 ? fs.realpathSync(rootDir) : undefined;
|
|
253
|
-
|
|
254
274
|
for (const resourcePath of explicitResourcePaths) {
|
|
255
|
-
const absolutePath =
|
|
275
|
+
const absolutePath = resolveToolcraftRootResourcePath(resourcePath, rootDir);
|
|
256
276
|
const repoPath = toPosixPath(path.relative(rootDir, absolutePath));
|
|
257
277
|
if (entriesByRepoPath.has(repoPath)) continue;
|
|
258
278
|
|
|
@@ -264,15 +284,6 @@ export function createCanonicalGraphEntries({
|
|
|
264
284
|
throw error;
|
|
265
285
|
}
|
|
266
286
|
if (!resourceStat.isFile() || resourceStat.isSymbolicLink()) continue;
|
|
267
|
-
const resourceRealPath = fs.realpathSync(absolutePath);
|
|
268
|
-
if (pathEscapesRoot(rootRealPath, resourceRealPath)) {
|
|
269
|
-
throw createResourceRootEscapeError(
|
|
270
|
-
resourcePath,
|
|
271
|
-
rootDir,
|
|
272
|
-
"resolves outside the root boundary for configured root",
|
|
273
|
-
);
|
|
274
|
-
}
|
|
275
|
-
|
|
276
287
|
entriesByRepoPath.set(repoPath, {
|
|
277
288
|
absolutePath,
|
|
278
289
|
repoPath,
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
collectToolcraftSourceInventory,
|
|
10
10
|
collectToolcraftSourceInventorySync,
|
|
11
11
|
createCanonicalGraphEntries,
|
|
12
|
+
resolveToolcraftRootResourcePath,
|
|
12
13
|
} from "./toolcraft-source-inventory.mjs";
|
|
13
14
|
|
|
14
15
|
test("classifies platform, framework, product, test, and generated source", () => {
|
|
@@ -236,3 +237,50 @@ test("accepts an in-root explicit public resource", async (context) => {
|
|
|
236
237
|
["public/preset.bin"],
|
|
237
238
|
);
|
|
238
239
|
});
|
|
240
|
+
|
|
241
|
+
test("resolves only root-relative resources whose real path stays in root", async (context) => {
|
|
242
|
+
const fixtureDir = await fs.mkdtemp(
|
|
243
|
+
path.join(os.tmpdir(), "toolcraft-root-resource-resolver-"),
|
|
244
|
+
);
|
|
245
|
+
context.after(() => fs.rm(fixtureDir, { force: true, recursive: true }));
|
|
246
|
+
const rootDir = path.join(fixtureDir, "app");
|
|
247
|
+
const outsideDir = path.join(fixtureDir, "outside");
|
|
248
|
+
await fs.mkdir(path.join(rootDir, "nested"), { recursive: true });
|
|
249
|
+
await fs.mkdir(outsideDir);
|
|
250
|
+
await fs.writeFile(path.join(rootDir, "nested/resource.json"), "{}\n");
|
|
251
|
+
await fs.writeFile(path.join(outsideDir, "escaped.json"), "{}\n");
|
|
252
|
+
|
|
253
|
+
assert.equal(
|
|
254
|
+
resolveToolcraftRootResourcePath("nested/resource.json", rootDir),
|
|
255
|
+
path.join(rootDir, "nested/resource.json"),
|
|
256
|
+
);
|
|
257
|
+
const missingResourcePath = path.join(rootDir, "missing/deep/resource.json");
|
|
258
|
+
assert.equal(
|
|
259
|
+
resolveToolcraftRootResourcePath("missing/deep/resource.json", rootDir),
|
|
260
|
+
missingResourcePath,
|
|
261
|
+
);
|
|
262
|
+
await assert.rejects(() => fs.lstat(missingResourcePath), { code: "ENOENT" });
|
|
263
|
+
for (const resourcePath of [
|
|
264
|
+
path.join(outsideDir, "escaped.json"),
|
|
265
|
+
"../outside/escaped.json",
|
|
266
|
+
]) {
|
|
267
|
+
assert.throws(
|
|
268
|
+
() => resolveToolcraftRootResourcePath(resourcePath, rootDir),
|
|
269
|
+
(error) => error.code === "TOOLCRAFT_RESOURCE_ROOT_ESCAPE",
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
try {
|
|
274
|
+
await fs.symlink(outsideDir, path.join(rootDir, "linked"));
|
|
275
|
+
} catch (error) {
|
|
276
|
+
if (["EACCES", "ENOSYS", "EPERM"].includes(error?.code)) {
|
|
277
|
+
context.skip(`symbolic links are unavailable: ${error.code}`);
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
throw error;
|
|
281
|
+
}
|
|
282
|
+
assert.throws(
|
|
283
|
+
() => resolveToolcraftRootResourcePath("linked/escaped.json", rootDir),
|
|
284
|
+
(error) => error.code === "TOOLCRAFT_RESOURCE_ROOT_ESCAPE",
|
|
285
|
+
);
|
|
286
|
+
});
|
|
@@ -37,7 +37,6 @@ export const toolcraftProductOwnedGeneratedPaths = Object.freeze([
|
|
|
37
37
|
"src/app/app-acceptance-data.ts",
|
|
38
38
|
"src/app/app-composition.tsx",
|
|
39
39
|
"src/app/app-performance.ts",
|
|
40
|
-
"src/app/app-verification-impact.json",
|
|
41
40
|
"src/app/app-schema.test.ts",
|
|
42
41
|
"src/app/app-schema.ts",
|
|
43
42
|
]);
|
|
@@ -73,16 +73,12 @@ test("collects the same ownership policy for starter-local and generated paths",
|
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
-
test("keeps the signed-manifest trust root
|
|
76
|
+
test("keeps the signed-manifest trust root unique and inside canonical ownership", async () => {
|
|
77
77
|
const generatedPaths =
|
|
78
78
|
await collectToolcraftFrameworkOwnedGeneratedPaths(starterRoot);
|
|
79
79
|
const generatedPathSet = new Set(generatedPaths);
|
|
80
80
|
|
|
81
81
|
assert.ok(requiredProtectedTrustRootFilePaths.length > 0);
|
|
82
|
-
assert.ok(
|
|
83
|
-
requiredProtectedTrustRootFilePaths.length <= 28,
|
|
84
|
-
`The trust root must stay small; received ${requiredProtectedTrustRootFilePaths.length} paths.`,
|
|
85
|
-
);
|
|
86
82
|
assert.equal(
|
|
87
83
|
new Set(requiredProtectedTrustRootFilePaths).size,
|
|
88
84
|
requiredProtectedTrustRootFilePaths.length,
|
|
@@ -141,3 +137,32 @@ test("keeps the signed-manifest trust root small and inside canonical ownership"
|
|
|
141
137
|
);
|
|
142
138
|
}
|
|
143
139
|
});
|
|
140
|
+
|
|
141
|
+
test("uses public motion-reference sentinels while signing transitive owners through canonical inventory", async () => {
|
|
142
|
+
const generatedPaths =
|
|
143
|
+
await collectToolcraftFrameworkOwnedGeneratedPaths(starterRoot);
|
|
144
|
+
const publicSentinels = [
|
|
145
|
+
"scripts/create-toolcraft-motion-reference-study.mjs",
|
|
146
|
+
"src/app/acceptance/motion-reference-evidence.d.mts",
|
|
147
|
+
"src/app/acceptance/motion-reference-evidence.mjs",
|
|
148
|
+
];
|
|
149
|
+
const representativeTransitiveOwners = [
|
|
150
|
+
"scripts/toolcraft-motion-reference-group-inventory.mjs",
|
|
151
|
+
"scripts/toolcraft-motion-reference-publication-journal.mjs",
|
|
152
|
+
];
|
|
153
|
+
|
|
154
|
+
assert.deepEqual(
|
|
155
|
+
requiredProtectedTrustRootFilePaths.filter((relativePath) =>
|
|
156
|
+
relativePath.includes("motion-reference"),
|
|
157
|
+
),
|
|
158
|
+
publicSentinels,
|
|
159
|
+
);
|
|
160
|
+
for (const representativeTransitiveOwner of representativeTransitiveOwners) {
|
|
161
|
+
assert.equal(
|
|
162
|
+
requiredProtectedTrustRootFilePaths.includes(representativeTransitiveOwner),
|
|
163
|
+
false,
|
|
164
|
+
"Transitive implementation modules belong to the complete signed framework inventory, not the public sentinel list.",
|
|
165
|
+
);
|
|
166
|
+
assert.ok(generatedPaths.includes(representativeTransitiveOwner));
|
|
167
|
+
}
|
|
168
|
+
});
|
|
@@ -85,23 +85,6 @@ export async function createReceiptFixture() {
|
|
|
85
85
|
path.join(rootDir, "src", "app", "app-schema.ts"),
|
|
86
86
|
'export const schema = { mode: "initial" };\n',
|
|
87
87
|
);
|
|
88
|
-
await fs.writeFile(
|
|
89
|
-
path.join(rootDir, "src", "app", "app-verification-impact.json"),
|
|
90
|
-
`${JSON.stringify(
|
|
91
|
-
{
|
|
92
|
-
owners: [
|
|
93
|
-
{
|
|
94
|
-
acceptanceIds: ["persistence.reload"],
|
|
95
|
-
kind: "functional",
|
|
96
|
-
path: "src/app/app-schema.ts",
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
version: 2,
|
|
100
|
-
},
|
|
101
|
-
null,
|
|
102
|
-
2,
|
|
103
|
-
)}\n`,
|
|
104
|
-
);
|
|
105
88
|
await fs.writeFile(
|
|
106
89
|
path.join(rootDir, "e2e", "app-performance.spec.ts"),
|
|
107
90
|
'export const scenario = "heavy";\n',
|
|
@@ -190,14 +173,6 @@ export async function writePassedCheckpointFixture(
|
|
|
190
173
|
performance: [],
|
|
191
174
|
version: 2,
|
|
192
175
|
},
|
|
193
|
-
inventory: {
|
|
194
|
-
owners: [{
|
|
195
|
-
acceptanceIds: ["persistence.reload"],
|
|
196
|
-
kind: "functional",
|
|
197
|
-
path: "src/app/app-schema.ts",
|
|
198
|
-
}],
|
|
199
|
-
version: 3,
|
|
200
|
-
},
|
|
201
176
|
});
|
|
202
177
|
const plan = deepFreeze({
|
|
203
178
|
basis: { kind: "initial" },
|
|
@@ -210,7 +185,11 @@ export async function writePassedCheckpointFixture(
|
|
|
210
185
|
steps: [
|
|
211
186
|
{ kind: "docs" },
|
|
212
187
|
{ kind: "code-health" },
|
|
213
|
-
{
|
|
188
|
+
{
|
|
189
|
+
acceptanceIds: null,
|
|
190
|
+
files: ["src/app/app-schema.test.ts"],
|
|
191
|
+
kind: "product-tests",
|
|
192
|
+
},
|
|
214
193
|
{ kind: "build" },
|
|
215
194
|
{
|
|
216
195
|
kind: "browser-functional",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ToolcraftPerformanceReportEvidence } from "./toolcraft-performance-report.mjs";
|
|
2
|
-
import type { ToolcraftDeliveryCatalog } from "./toolcraft-verification-impact.mjs";
|
|
3
2
|
|
|
4
3
|
export const TOOLCRAFT_PERFORMANCE_RECEIPT_VERSION: 5;
|
|
5
4
|
|
|
@@ -34,12 +33,6 @@ export function collectToolcraftVerificationInputs(rootDir: string): Promise<{
|
|
|
34
33
|
sourceHash: string;
|
|
35
34
|
}>;
|
|
36
35
|
|
|
37
|
-
export function validateToolcraftCurrentPerformanceImpactInventory(options: {
|
|
38
|
-
catalog?: ToolcraftDeliveryCatalog;
|
|
39
|
-
knownPassIds?: readonly string[];
|
|
40
|
-
rootDir: string;
|
|
41
|
-
}): Promise<unknown>;
|
|
42
|
-
|
|
43
36
|
export function readToolcraftDurablePerformanceBaseline(
|
|
44
37
|
rootDir: string,
|
|
45
38
|
): Promise<{
|
|
@@ -18,14 +18,6 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
TOOLCRAFT_FULL_PERFORMANCE_VERIFICATION_COMMAND,
|
|
20
20
|
} from "./toolcraft-performance-authority-policy.mjs";
|
|
21
|
-
import {
|
|
22
|
-
createToolcraftProductVerificationContext,
|
|
23
|
-
readToolcraftVerificationImpactInventory,
|
|
24
|
-
} from "./toolcraft-verification-impact.mjs";
|
|
25
|
-
import {
|
|
26
|
-
collectToolcraftDeliveryCatalog,
|
|
27
|
-
validateExplicitToolcraftDeliveryCatalog,
|
|
28
|
-
} from "./toolcraft-delivery-catalog-collector.mjs";
|
|
29
21
|
export {
|
|
30
22
|
TOOLCRAFT_PERFORMANCE_RECEIPT_VERSION,
|
|
31
23
|
assertToolcraftVerificationInputsUnchanged,
|
|
@@ -57,57 +49,21 @@ export async function readToolcraftDurablePerformanceBaseline(rootDir) {
|
|
|
57
49
|
return { receipt };
|
|
58
50
|
}
|
|
59
51
|
|
|
60
|
-
async function getCurrentDeliveryCatalog(rootDir, catalog) {
|
|
61
|
-
return catalog === undefined
|
|
62
|
-
? collectToolcraftDeliveryCatalog(rootDir)
|
|
63
|
-
: validateExplicitToolcraftDeliveryCatalog(catalog);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export async function validateToolcraftCurrentPerformanceImpactInventory({
|
|
67
|
-
catalog,
|
|
68
|
-
knownPassIds = [],
|
|
69
|
-
rootDir,
|
|
70
|
-
}) {
|
|
71
|
-
const { inputRoles } =
|
|
72
|
-
await createToolcraftProductVerificationContext(rootDir);
|
|
73
|
-
const deliveryCatalog = await getCurrentDeliveryCatalog(rootDir, catalog);
|
|
74
|
-
const catalogPassIds = new Set(
|
|
75
|
-
deliveryCatalog.performance.flatMap((row) => row.passIds),
|
|
76
|
-
);
|
|
77
|
-
for (const passId of knownPassIds) {
|
|
78
|
-
if (!catalogPassIds.has(passId)) {
|
|
79
|
-
throw new Error(
|
|
80
|
-
`Renderer pass "${passId}" is absent from the independently derived delivery catalog.`,
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return readToolcraftVerificationImpactInventory(rootDir, {
|
|
85
|
-
catalog: deliveryCatalog,
|
|
86
|
-
inputRoles,
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
|
|
90
52
|
export async function validateToolcraftPerformanceReceipt({ rootDir }) {
|
|
91
53
|
const loaded = await readToolcraftCheckpointBundle(rootDir);
|
|
92
54
|
if (loaded.error) return [loaded.error];
|
|
93
|
-
if (loaded.missing || loaded.bundle.
|
|
55
|
+
if (loaded.missing || loaded.bundle.performanceBaseline === null) {
|
|
94
56
|
return [
|
|
95
|
-
`Toolcraft performance receipt is missing. An operator must run ${TOOLCRAFT_FULL_PERFORMANCE_VERIFICATION_COMMAND} to create a full checkpoint
|
|
57
|
+
`Toolcraft performance receipt is missing. An operator must run ${TOOLCRAFT_FULL_PERFORMANCE_VERIFICATION_COMMAND} to create a full checkpoint.`,
|
|
96
58
|
];
|
|
97
59
|
}
|
|
98
|
-
const receipt = loaded.bundle.
|
|
60
|
+
const receipt = loaded.bundle.performanceBaseline;
|
|
99
61
|
const shapeError = getToolcraftPerformanceReceiptShapeError(receipt);
|
|
100
62
|
if (shapeError) return [shapeError];
|
|
101
63
|
|
|
102
64
|
const baseline = await readToolcraftDurablePerformanceBaseline(rootDir);
|
|
103
65
|
if (baseline.error) return [baseline.error];
|
|
104
66
|
|
|
105
|
-
if (receipt.sourceHash !== baseline.receipt.sourceHash) {
|
|
106
|
-
return [
|
|
107
|
-
"Toolcraft current performance checkpoint does not match the durable performance baseline.",
|
|
108
|
-
];
|
|
109
|
-
}
|
|
110
|
-
|
|
111
67
|
const inventory = await collectToolcraftVerificationInputs(rootDir);
|
|
112
68
|
if (receipt.sourceHash !== inventory.sourceHash) {
|
|
113
69
|
return [
|
|
@@ -22,11 +22,6 @@ import {
|
|
|
22
22
|
import {
|
|
23
23
|
createToolcraftFunctionalProofModelHash,
|
|
24
24
|
} from "./toolcraft-functional-proof-model.mjs";
|
|
25
|
-
import {
|
|
26
|
-
createDeliveryFixture,
|
|
27
|
-
functionalTestName,
|
|
28
|
-
removeDeliveryFixture,
|
|
29
|
-
} from "./run-delivery-verification-test-helpers.mjs";
|
|
30
25
|
import {
|
|
31
26
|
collectToolcraftVerificationInputs,
|
|
32
27
|
} from "./toolcraft-verification-receipt.mjs";
|
|
@@ -87,7 +82,11 @@ function createInitialReceipt(inventory) {
|
|
|
87
82
|
steps: [
|
|
88
83
|
{ kind: "docs" },
|
|
89
84
|
{ kind: "code-health" },
|
|
90
|
-
{
|
|
85
|
+
{
|
|
86
|
+
acceptanceIds: null,
|
|
87
|
+
files: ["src/app/app-schema.test.ts"],
|
|
88
|
+
kind: "product-tests",
|
|
89
|
+
},
|
|
91
90
|
{ kind: "build" },
|
|
92
91
|
{
|
|
93
92
|
kind: "browser-functional",
|
|
@@ -299,86 +298,6 @@ test("does not expose a reusable passed-checkpoint writer", () => {
|
|
|
299
298
|
assert.equal("writeToolcraftPerformanceReceipt" in receiptModule, false);
|
|
300
299
|
});
|
|
301
300
|
|
|
302
|
-
test("current impact validation requires every runtime module and resource owner", async (t) => {
|
|
303
|
-
const rootDir = createDeliveryFixture();
|
|
304
|
-
t.after(() => removeDeliveryFixture(rootDir));
|
|
305
|
-
const appRoot = path.join(rootDir, "src", "app");
|
|
306
|
-
await fs.writeFile(
|
|
307
|
-
path.join(appRoot, "app-composition.tsx"),
|
|
308
|
-
"import '../app.ts'; import './renderer.ts'; export const composition = true;\n",
|
|
309
|
-
);
|
|
310
|
-
await fs.writeFile(
|
|
311
|
-
path.join(appRoot, "app-schema.ts"),
|
|
312
|
-
"export { schema } from './schema.ts';\n",
|
|
313
|
-
);
|
|
314
|
-
await fs.writeFile(
|
|
315
|
-
path.join(appRoot, "app-acceptance-data.ts"),
|
|
316
|
-
"export const acceptance = true;\n",
|
|
317
|
-
);
|
|
318
|
-
await fs.writeFile(
|
|
319
|
-
path.join(appRoot, "app-performance.ts"),
|
|
320
|
-
"export const performance = true;\n",
|
|
321
|
-
);
|
|
322
|
-
await fs.mkdir(path.join(rootDir, "public"), { recursive: true });
|
|
323
|
-
await fs.writeFile(
|
|
324
|
-
path.join(rootDir, "public", "product-pulse.svg"),
|
|
325
|
-
"<svg xmlns=\"http://www.w3.org/2000/svg\"/>\n",
|
|
326
|
-
);
|
|
327
|
-
await fs.writeFile(
|
|
328
|
-
path.join(rootDir, "public", "unowned-texture.svg"),
|
|
329
|
-
"<svg xmlns=\"http://www.w3.org/2000/svg\"/>\n",
|
|
330
|
-
);
|
|
331
|
-
await fs.writeFile(
|
|
332
|
-
path.join(rootDir, "src", "app", "app-verification-impact.json"),
|
|
333
|
-
`${JSON.stringify({
|
|
334
|
-
owners: [
|
|
335
|
-
"src/app.ts",
|
|
336
|
-
"src/app/app-composition.tsx",
|
|
337
|
-
"src/app/app-schema.ts",
|
|
338
|
-
"src/app/renderer.ts",
|
|
339
|
-
"src/app/schema.ts",
|
|
340
|
-
"public/product-pulse.svg",
|
|
341
|
-
"public/unowned-texture.svg",
|
|
342
|
-
].map((ownerPath) => ({
|
|
343
|
-
acceptanceIds: ["persistence.reload"],
|
|
344
|
-
kind: ownerPath.startsWith("public/")
|
|
345
|
-
? "presentation"
|
|
346
|
-
: "functional",
|
|
347
|
-
path: ownerPath,
|
|
348
|
-
})),
|
|
349
|
-
version: 3,
|
|
350
|
-
})}\n`,
|
|
351
|
-
);
|
|
352
|
-
const loaded =
|
|
353
|
-
await receiptModule.validateToolcraftCurrentPerformanceImpactInventory({
|
|
354
|
-
catalog: {
|
|
355
|
-
acceptance: [{
|
|
356
|
-
acceptanceId: "persistence.reload",
|
|
357
|
-
contractHash: "a".repeat(64),
|
|
358
|
-
domainId: "persistence",
|
|
359
|
-
file: "app-controls.spec.ts",
|
|
360
|
-
testName: functionalTestName,
|
|
361
|
-
}],
|
|
362
|
-
performance: [],
|
|
363
|
-
version: 2,
|
|
364
|
-
},
|
|
365
|
-
rootDir,
|
|
366
|
-
});
|
|
367
|
-
|
|
368
|
-
assert.equal(
|
|
369
|
-
loaded.inventory.owners.some(
|
|
370
|
-
({ path: ownerPath }) => ownerPath === "public/product-pulse.svg",
|
|
371
|
-
),
|
|
372
|
-
true,
|
|
373
|
-
);
|
|
374
|
-
assert.equal(
|
|
375
|
-
loaded.inventory.owners.some(
|
|
376
|
-
({ path: ownerPath }) => ownerPath === "public/unowned-texture.svg",
|
|
377
|
-
),
|
|
378
|
-
true,
|
|
379
|
-
);
|
|
380
|
-
});
|
|
381
|
-
|
|
382
301
|
test("full performance recovery points only to the operator command", async (t) => {
|
|
383
302
|
const rootDir = await createReceiptFixture();
|
|
384
303
|
t.after(() => fs.rm(rootDir, { force: true, recursive: true }));
|
|
@@ -388,7 +307,7 @@ test("full performance recovery points only to the operator command", async (t)
|
|
|
388
307
|
missing: true,
|
|
389
308
|
});
|
|
390
309
|
assert.deepEqual(await receiptModule.validateToolcraftPerformanceReceipt({ rootDir }), [
|
|
391
|
-
`Toolcraft performance receipt is missing. An operator must run ${TOOLCRAFT_FULL_PERFORMANCE_VERIFICATION_COMMAND} to create a full checkpoint
|
|
310
|
+
`Toolcraft performance receipt is missing. An operator must run ${TOOLCRAFT_FULL_PERFORMANCE_VERIFICATION_COMMAND} to create a full checkpoint.`,
|
|
392
311
|
]);
|
|
393
312
|
});
|
|
394
313
|
|
|
@@ -16,6 +16,25 @@ export const TOOLCRAFT_VITEST_RUNTIME_EVIDENCE_VERSION: 1;
|
|
|
16
16
|
export const TOOLCRAFT_VITEST_RUNTIME_REQUIREMENTS_ANNOTATION_TYPE: string;
|
|
17
17
|
export const TOOLCRAFT_VITEST_RUNTIME_MARKER_TEST_NAME: string;
|
|
18
18
|
export const TOOLCRAFT_VITEST_RUNTIME_MARKER_FILE_NAMES: readonly string[];
|
|
19
|
+
export const TOOLCRAFT_VITEST_RUNTIME_ACCEPTANCE_SELECTION_ENV: string;
|
|
20
|
+
|
|
21
|
+
export function getToolcraftProductTestProcessEnvironment(
|
|
22
|
+
acceptanceIds: readonly string[] | null,
|
|
23
|
+
inheritedEnvironment?: NodeJS.ProcessEnv,
|
|
24
|
+
): NodeJS.ProcessEnv;
|
|
25
|
+
|
|
26
|
+
export function serializeToolcraftVitestRuntimeAcceptanceSelection(
|
|
27
|
+
acceptanceIds: readonly string[],
|
|
28
|
+
): string;
|
|
29
|
+
|
|
30
|
+
export function parseToolcraftVitestRuntimeAcceptanceSelection(
|
|
31
|
+
serialized: string,
|
|
32
|
+
): string[];
|
|
33
|
+
|
|
34
|
+
export function selectToolcraftVitestRuntimeRequirements(
|
|
35
|
+
requirements: readonly ToolcraftVitestRuntimeRequirement[],
|
|
36
|
+
serializedSelection: string | undefined,
|
|
37
|
+
): readonly ToolcraftVitestRuntimeRequirement[];
|
|
19
38
|
|
|
20
39
|
export function serializeToolcraftVitestRuntimeRequirements(
|
|
21
40
|
requirements: readonly ToolcraftVitestRuntimeRequirement[],
|
|
@@ -7,8 +7,36 @@ export const TOOLCRAFT_VITEST_RUNTIME_MARKER_FILE_NAMES = Object.freeze([
|
|
|
7
7
|
"starter-automated-runtime-evidence.test.ts",
|
|
8
8
|
"app-automated-runtime-evidence.test.ts",
|
|
9
9
|
]);
|
|
10
|
+
export const TOOLCRAFT_VITEST_RUNTIME_ACCEPTANCE_SELECTION_ENV =
|
|
11
|
+
"TOOLCRAFT_VITEST_RUNTIME_ACCEPTANCE_SELECTION";
|
|
10
12
|
const TOOLCRAFT_VITEST_RUNTIME_EVIDENCE_REPORTER =
|
|
11
13
|
"--reporter=./scripts/toolcraft-vitest-runtime-evidence-reporter.mjs";
|
|
14
|
+
const TOOLCRAFT_VITEST_RUNTIME_ACCEPTANCE_SELECTION_VERSION = 1;
|
|
15
|
+
const compare = (left, right) => left < right ? -1 : left > right ? 1 : 0;
|
|
16
|
+
|
|
17
|
+
function getCanonicalAcceptanceIdsError(acceptanceIds) {
|
|
18
|
+
if (
|
|
19
|
+
!Array.isArray(acceptanceIds) ||
|
|
20
|
+
Reflect.ownKeys(acceptanceIds).length !== acceptanceIds.length + 1 ||
|
|
21
|
+
!Array.from(
|
|
22
|
+
{ length: acceptanceIds.length },
|
|
23
|
+
(_, index) => Object.hasOwn(acceptanceIds, index),
|
|
24
|
+
).every(Boolean) ||
|
|
25
|
+
acceptanceIds.some(
|
|
26
|
+
(acceptanceId) =>
|
|
27
|
+
typeof acceptanceId !== "string" ||
|
|
28
|
+
acceptanceId.trim() !== acceptanceId ||
|
|
29
|
+
acceptanceId.length === 0,
|
|
30
|
+
) ||
|
|
31
|
+
acceptanceIds.some(
|
|
32
|
+
(acceptanceId, index) =>
|
|
33
|
+
index > 0 && compare(acceptanceIds[index - 1], acceptanceId) >= 0,
|
|
34
|
+
)
|
|
35
|
+
) {
|
|
36
|
+
return "Toolcraft runtime acceptance selection must be sorted and unique.";
|
|
37
|
+
}
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
12
40
|
|
|
13
41
|
export function getToolcraftProductTestProcessArgs(files) {
|
|
14
42
|
const includesRuntimeMarker =
|
|
@@ -26,6 +54,20 @@ export function getToolcraftProductTestProcessArgs(files) {
|
|
|
26
54
|
];
|
|
27
55
|
}
|
|
28
56
|
|
|
57
|
+
export function getToolcraftProductTestProcessEnvironment(
|
|
58
|
+
acceptanceIds,
|
|
59
|
+
inheritedEnvironment = process.env,
|
|
60
|
+
) {
|
|
61
|
+
const environment = { ...inheritedEnvironment };
|
|
62
|
+
if (acceptanceIds === null) {
|
|
63
|
+
delete environment[TOOLCRAFT_VITEST_RUNTIME_ACCEPTANCE_SELECTION_ENV];
|
|
64
|
+
} else {
|
|
65
|
+
environment[TOOLCRAFT_VITEST_RUNTIME_ACCEPTANCE_SELECTION_ENV] =
|
|
66
|
+
serializeToolcraftVitestRuntimeAcceptanceSelection(acceptanceIds);
|
|
67
|
+
}
|
|
68
|
+
return environment;
|
|
69
|
+
}
|
|
70
|
+
|
|
29
71
|
export function serializeToolcraftVitestRuntimeRequirements(requirements) {
|
|
30
72
|
return JSON.stringify({
|
|
31
73
|
requirements,
|
|
@@ -33,6 +75,71 @@ export function serializeToolcraftVitestRuntimeRequirements(requirements) {
|
|
|
33
75
|
});
|
|
34
76
|
}
|
|
35
77
|
|
|
78
|
+
export function serializeToolcraftVitestRuntimeAcceptanceSelection(
|
|
79
|
+
acceptanceIds,
|
|
80
|
+
) {
|
|
81
|
+
const error = getCanonicalAcceptanceIdsError(acceptanceIds);
|
|
82
|
+
if (error) throw new Error(error);
|
|
83
|
+
return JSON.stringify({
|
|
84
|
+
acceptanceIds,
|
|
85
|
+
version: TOOLCRAFT_VITEST_RUNTIME_ACCEPTANCE_SELECTION_VERSION,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function parseToolcraftVitestRuntimeAcceptanceSelection(serialized) {
|
|
90
|
+
let payload;
|
|
91
|
+
try {
|
|
92
|
+
payload = JSON.parse(serialized);
|
|
93
|
+
} catch {
|
|
94
|
+
throw new Error("Toolcraft runtime acceptance selection is malformed.");
|
|
95
|
+
}
|
|
96
|
+
if (
|
|
97
|
+
!payload ||
|
|
98
|
+
typeof payload !== "object" ||
|
|
99
|
+
Array.isArray(payload) ||
|
|
100
|
+
Object.keys(payload).length !== 2 ||
|
|
101
|
+
!Object.hasOwn(payload, "acceptanceIds") ||
|
|
102
|
+
!Object.hasOwn(payload, "version") ||
|
|
103
|
+
payload.version !== TOOLCRAFT_VITEST_RUNTIME_ACCEPTANCE_SELECTION_VERSION
|
|
104
|
+
) {
|
|
105
|
+
throw new Error("Toolcraft runtime acceptance selection is malformed.");
|
|
106
|
+
}
|
|
107
|
+
const error = getCanonicalAcceptanceIdsError(payload.acceptanceIds);
|
|
108
|
+
if (error) throw new Error(error);
|
|
109
|
+
return payload.acceptanceIds;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function selectToolcraftVitestRuntimeRequirements(
|
|
113
|
+
requirements,
|
|
114
|
+
serializedSelection,
|
|
115
|
+
) {
|
|
116
|
+
if (serializedSelection === undefined) return requirements;
|
|
117
|
+
|
|
118
|
+
const acceptanceIds = parseToolcraftVitestRuntimeAcceptanceSelection(
|
|
119
|
+
serializedSelection,
|
|
120
|
+
);
|
|
121
|
+
const acceptanceRequirements = new Map();
|
|
122
|
+
for (const requirement of requirements) {
|
|
123
|
+
if (requirement.kind !== "acceptance") continue;
|
|
124
|
+
if (acceptanceRequirements.has(requirement.requirementId)) {
|
|
125
|
+
throw new Error(
|
|
126
|
+
`Duplicate Toolcraft acceptance requirement "${requirement.requirementId}".`,
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
acceptanceRequirements.set(requirement.requirementId, requirement);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return acceptanceIds.map((acceptanceId) => {
|
|
133
|
+
const requirement = acceptanceRequirements.get(acceptanceId);
|
|
134
|
+
if (!requirement) {
|
|
135
|
+
throw new Error(
|
|
136
|
+
`Toolcraft runtime selection contains unknown acceptance requirement "${acceptanceId}".`,
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
return requirement;
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
36
143
|
export function parseToolcraftVitestRuntimeRequirements(annotation) {
|
|
37
144
|
if (
|
|
38
145
|
!annotation ||
|