diff --git a/.gitignore b/.gitignore index b19dcdf9..5a42d78c 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,9 @@ artifacts/**/*.json artifacts/**/*.xml artifacts/**/*.txt artifacts/**/*.sarif +# 1103/12-08. Step logs from check:scale:* and verify:extreme-scale. They were +# committed once, and every local merge-gate run rewrote them. +artifacts/**/*.log artifacts/tests/e2e/ artifacts/tests/browser-capabilities/ artifacts/storybook/ diff --git a/README.md b/README.md index 03dcf59a..7f0bdb0e 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,7 @@ See `docs/architecture/frontend-application-foundation.md`, `docs/architecture/overview.md`, `docs/architecture/layers.md`, and `docs/architecture/starter-experience.md`. The removable vertical slice is -under `src/features/reference-feature`; its domain, application input, HTTP +the reference sample, src/features/reference-feature; its domain, application input, HTTP binding, contracts, route runtime, and presentation own their contributions. The central installed catalogs only aggregate selected contributions. The generic starter routes continue to typecheck, test, and build after that diff --git a/artifacts/phase5/check-architecture.log b/artifacts/phase5/check-architecture.log deleted file mode 100644 index 70a3edf3..00000000 --- a/artifacts/phase5/check-architecture.log +++ /dev/null @@ -1,5 +0,0 @@ -$ node scripts/check-architecture.ts -Static import graph: 330 modules, 984 dependencies, all imports resolved -Architecture graph fixtures: 16 regression checks PASS -TypeScript-only source policy: PASS (src, scripts, tests, .storybook, recipes; no fixture exceptions) -Architecture fixtures: allowed PASS, 9 forbidden rejected diff --git a/artifacts/phase5/check-types-app.log b/artifacts/phase5/check-types-app.log deleted file mode 100644 index 388c04b1..00000000 --- a/artifacts/phase5/check-types-app.log +++ /dev/null @@ -1 +0,0 @@ -$ tsc --project tsconfig.app.json diff --git a/artifacts/phase5/check-types-test.log b/artifacts/phase5/check-types-test.log deleted file mode 100644 index 08d11af4..00000000 --- a/artifacts/phase5/check-types-test.log +++ /dev/null @@ -1 +0,0 @@ -$ tsc --project tsconfig.test.json diff --git a/artifacts/phase5/traffic-regression.log b/artifacts/phase5/traffic-regression.log deleted file mode 100644 index fe4cb21b..00000000 --- a/artifacts/phase5/traffic-regression.log +++ /dev/null @@ -1,20 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/unit/http-retry-lifecycle.test.ts (4 tests) 4ms - โœ“ tests/unit/realtime/bounded-polling-policy.test.ts (3 tests) 6ms - โœ“ tests/unit/realtime/realtime-reconnect-policy.test.ts (7 tests) 6ms - โœ“ tests/unit/retry-policy.test.ts (4 tests) 5ms - โœ“ tests/unit/realtime/bounded-poll-coordinator.test.ts (16 tests) 25ms - โœ“ tests/unit/realtime/live-poll-handoff-coordinator.test.ts (13 tests) 71ms - โœ“ tests/unit/resumable-upload-runtime.test.ts (18 tests) 87ms - โœ“ tests/unit/realtime/realtime-reconnect-coordinator.test.ts (25 tests) 32ms - โœ“ tests/unit/tanstack-cache-coordinator.test.ts (8 tests) 168ms - โœ“ tests/unit/resumable-upload-runtime-teardown.test.ts (4 tests) 163ms - โœ“ tests/unit/realtime/stream-coordinator.test.ts (36 tests) 625ms - - Test Files  11 passed (11) - Tests  138 passed (138) - Start at  08:27:14 - Duration  1.40s (transform 1.56s, setup 3.50s, import 2.09s, tests 1.19s, environment 2ms) - diff --git a/artifacts/quality/extreme-scale-gates/build.log b/artifacts/quality/extreme-scale-gates/build.log deleted file mode 100644 index 98603526..00000000 --- a/artifacts/quality/extreme-scale-gates/build.log +++ /dev/null @@ -1,37 +0,0 @@ -contract set: 0 package(s) sha256:ad6aab71fea6a9ff87cbd170b984b339965afc90d85bb57f87801c9e0c020da2 -vite v8.1.5 building client environment for production... - transforming...โœ“ 2113 modules transformed. -rendering chunks... -computing gzip size... -dist/index.html 1.12 kB โ”‚ gzip: 0.45 kB -dist/.vite/manifest.json 8.11 kB โ”‚ gzip: 1.04 kB -dist/.vite/module-inventory.json 21.94 kB โ”‚ gzip: 3.15 kB -dist/assets/index-C0p5zoj4.css 39.62 kB โ”‚ gzip: 8.51 kB -dist/assets/installed-contract-contributions-CFHdeDEf.js 0.16 kB โ”‚ gzip: 0.15 kB -dist/assets/not-found-page-CHQA5rw5.js 0.45 kB โ”‚ gzip: 0.30 kB -dist/assets/reference-resource-status-page-t3RWROLD.js 0.51 kB โ”‚ gzip: 0.45 kB -dist/assets/use-reference-failure-action-BYb2UYeT.js 0.57 kB โ”‚ gzip: 0.37 kB -dist/assets/session-provider-CIR3Mmin.js 0.60 kB โ”‚ gzip: 0.39 kB -dist/assets/application-provider-_OkSTAcq.js 0.61 kB โ”‚ gzip: 0.34 kB -dist/assets/reference-resource-page-1-Q0DGen.js 1.21 kB โ”‚ gzip: 0.77 kB -dist/assets/reference-resource-detail-page-D5mbWw2a.js 1.23 kB โ”‚ gzip: 0.72 kB -dist/assets/async-state-CfvFHl3I.js 1.53 kB โ”‚ gzip: 0.49 kB -dist/assets/auth-example-page-htVwyPYW.js 1.78 kB โ”‚ gzip: 0.94 kB -dist/assets/context-routes-CEM0c3Wb.js 1.80 kB โ”‚ gzip: 0.70 kB -dist/assets/server-state-DQADfngu.js 2.24 kB โ”‚ gzip: 0.90 kB -dist/assets/home-page-a_jMrdst.js 2.37 kB โ”‚ gzip: 1.27 kB -dist/assets/state-gallery-page-CunviFji.js 2.70 kB โ”‚ gzip: 1.22 kB -dist/assets/reference-resource-form-page-BHq_gRJf.js 2.77 kB โ”‚ gzip: 1.50 kB -dist/assets/installed-feature-contracts-DgTAlLr2.js 4.52 kB โ”‚ gzip: 1.43 kB -dist/assets/ui-gallery-page-Ru0CrH32.js 8.09 kB โ”‚ gzip: 2.90 kB -dist/assets/platform-overview-page-BgxC-c_W.js 11.90 kB โ”‚ gzip: 4.08 kB -dist/assets/route-input-DpW3PpRj.js 19.72 kB โ”‚ gzip: 6.27 kB -dist/assets/use-reference-feature-DkrwJNPz.js 23.75 kB โ”‚ gzip: 8.06 kB -dist/assets/preload-helper-ChbRSsLi.js 101.06 kB โ”‚ gzip: 27.93 kB -dist/assets/design-system-Bd1NzELd.js 213.52 kB โ”‚ gzip: 65.78 kB -dist/assets/index-zhAbJ8ef.js 294.86 kB โ”‚ gzip: 91.72 kB - -โœ“ built in 361ms -runtime config: local profile written to dist/config.json (APP_ENV=local, AUTH_MODE=demo) -service worker mode null: skipping worker build -$ node scripts/build-frontend.ts diff --git a/artifacts/quality/extreme-scale-gates/check-app-build-input-bundle.log b/artifacts/quality/extreme-scale-gates/check-app-build-input-bundle.log deleted file mode 100644 index d6bc0c9a..00000000 --- a/artifacts/quality/extreme-scale-gates/check-app-build-input-bundle.log +++ /dev/null @@ -1,2 +0,0 @@ -app build input: app=template-app contexts=1 features=1 generatedImports=1 bundle=1 feature dirs PASS -$ node scripts/check-app-build-input.ts --require-bundle diff --git a/artifacts/quality/extreme-scale-gates/check-app-build-input.log b/artifacts/quality/extreme-scale-gates/check-app-build-input.log deleted file mode 100644 index 24ccd47a..00000000 --- a/artifacts/quality/extreme-scale-gates/check-app-build-input.log +++ /dev/null @@ -1,2 +0,0 @@ -app build input: app=template-app contexts=1 features=1 generatedImports=1 bundle=not checked PASS -$ node scripts/check-app-build-input.ts diff --git a/artifacts/quality/extreme-scale-gates/check-architecture.log b/artifacts/quality/extreme-scale-gates/check-architecture.log deleted file mode 100644 index 565ed845..00000000 --- a/artifacts/quality/extreme-scale-gates/check-architecture.log +++ /dev/null @@ -1,5 +0,0 @@ -Static import graph: 363 modules, 1043 dependencies, all imports resolved -Architecture graph fixtures: 16 regression checks PASS -TypeScript-only source policy: PASS (src, scripts, tests, .storybook, recipes; no fixture exceptions) -Architecture fixtures: allowed PASS, 9 forbidden rejected -$ node scripts/check-architecture.ts diff --git a/artifacts/quality/extreme-scale-gates/check-diagnostics.log b/artifacts/quality/extreme-scale-gates/check-diagnostics.log deleted file mode 100644 index bfc6c2b0..00000000 --- a/artifacts/quality/extreme-scale-gates/check-diagnostics.log +++ /dev/null @@ -1,2 +0,0 @@ -Diagnostics contract: 8 diagnostics and 5 telemetry producers PASS -$ node scripts/check-diagnostics.ts diff --git a/artifacts/quality/extreme-scale-gates/check-feature-index.log b/artifacts/quality/extreme-scale-gates/check-feature-index.log deleted file mode 100644 index 27dc0c3a..00000000 --- a/artifacts/quality/extreme-scale-gates/check-feature-index.log +++ /dev/null @@ -1 +0,0 @@ -$ node scripts/generate-product-feature-index.ts --check diff --git a/artifacts/quality/extreme-scale-gates/check-observability.log b/artifacts/quality/extreme-scale-gates/check-observability.log deleted file mode 100644 index 02d9e4c9..00000000 --- a/artifacts/quality/extreme-scale-gates/check-observability.log +++ /dev/null @@ -1,23 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/platform/telemetry/telemetry-port.test.ts (3 tests) 8ms - โœ“ tests/platform/telemetry/redact-telemetry.test.ts (14 tests) 17ms - โœ“ tests/platform/telemetry/telemetry-buffer.test.ts (8 tests) 22ms - โœ“ tests/platform/validation/validation-budget.test.ts (7 tests) 10ms - โœ“ tests/platform/telemetry/telemetry-deduplicator.test.ts (8 tests) 13ms - โœ“ tests/architecture/observability-boundaries.test.ts (4 tests) 142ms - โœ“ tests/platform/errors/platform-errors.test.ts (16 tests) 23ms - โœ“ tests/platform/telemetry/trace-context.test.ts (6 tests) 63ms - โœ“ tests/platform/validation/bounded-json.test.ts (10 tests) 107ms - โœ“ tests/platform/errors/app-error.test.ts (10 tests) 7ms - โœ“ tests/platform/errors/failure-boundary.test.tsx (4 tests) 55ms - โœ“ tests/platform/telemetry/telemetry-pipeline.test.ts (9 tests) 785ms - โœ“ bounds network sends during a repeated error storm  718ms - - Test Files  12 passed (12) - Tests  99 passed (99) - Start at  13:29:27 - Duration  1.58s (transform 1.38s, setup 3.81s, import 1.84s, tests 1.25s, environment 902ms) - -$ node scripts/run-vitest.ts run tests/platform/errors tests/platform/validation tests/platform/telemetry tests/architecture/observability-boundaries.test.ts --reporter=default diff --git a/artifacts/quality/extreme-scale-gates/check-registries.log b/artifacts/quality/extreme-scale-gates/check-registries.log deleted file mode 100644 index 1abd421a..00000000 --- a/artifacts/quality/extreme-scale-gates/check-registries.log +++ /dev/null @@ -1,2 +0,0 @@ -Registry governance: 11 registries PASS; compatibility=breaking -$ node scripts/check-registries.ts diff --git a/artifacts/quality/extreme-scale-gates/check-release-coherence.log b/artifacts/quality/extreme-scale-gates/check-release-coherence.log deleted file mode 100644 index e981f0df..00000000 --- a/artifacts/quality/extreme-scale-gates/check-release-coherence.log +++ /dev/null @@ -1,16 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/platform/release/release-coherence.test.ts (10 tests) 9ms - โœ“ tests/platform/release/release-mismatch-recovery.test.ts (10 tests) 14ms - โœ“ tests/release/old-asset-reachability.test.ts (4 tests) 8ms - โœ“ tests/platform/release/cache-policy.test.ts (5 tests) 39ms - โœ“ tests/release/release-matrix.test.ts (7 tests) 48ms - โœ“ tests/release/mixed-replica.test.ts (7 tests) 69ms - - Test Files  6 passed (6) - Tests  43 passed (43) - Start at  13:29:30 - Duration  914ms (transform 1.31s, setup 1.45s, import 2.18s, tests 187ms, environment 1ms) - -$ node scripts/run-vitest.ts run tests/platform/release tests/release --reporter=default diff --git a/artifacts/quality/extreme-scale-gates/check-request-fanout.log b/artifacts/quality/extreme-scale-gates/check-request-fanout.log deleted file mode 100644 index 03e090d1..00000000 --- a/artifacts/quality/extreme-scale-gates/check-request-fanout.log +++ /dev/null @@ -1,3 +0,0 @@ -request fan-out: 77 files scanned, 0 per-row dispatches PASS -request fan-out fixtures: forbidden 3 rejected in 3 files, allowed 0 violations PASS -$ node scripts/check-request-fanout.ts && node scripts/check-request-fanout.ts --fixture diff --git a/artifacts/quality/extreme-scale-gates/check-scale-baseline.log b/artifacts/quality/extreme-scale-gates/check-scale-baseline.log deleted file mode 100644 index b624defd..00000000 --- a/artifacts/quality/extreme-scale-gates/check-scale-baseline.log +++ /dev/null @@ -1,4 +0,0 @@ -compatibility: structural=true compiler=true timing=true -axes: absolute 28 (ok), growth 8 (ok), relative 16 compiler + 12 timing -scale baseline gate: PASSED (artifacts/scale/baseline-comparison.json) -$ node scripts/scale/check-scale-baseline.ts diff --git a/artifacts/quality/extreme-scale-gates/check-scale-main.log b/artifacts/quality/extreme-scale-gates/check-scale-main.log deleted file mode 100644 index c9cf9ea5..00000000 --- a/artifacts/quality/extreme-scale-gates/check-scale-main.log +++ /dev/null @@ -1,10 +0,0 @@ -PASSED main:architecture-topology (3173ms) -PASSED main:traffic-budgets (1489ms) -PASSED main:scale-units (2433ms) -PASSED main:composition-s0-s1 (91ms) -PASSED main:composition-s0-s2 (232ms) -PASSED main:composition-scale-suite (941ms) -PASSED main:typescript-diagnostics (1543ms) -PASSED main:baseline-regression (1739ms) -scale tier main: PASSED (artifacts/scale/main/summary.json) -$ node scripts/scale/run-scale-profile.ts main diff --git a/artifacts/quality/extreme-scale-gates/check-scale-nightly.log b/artifacts/quality/extreme-scale-gates/check-scale-nightly.log deleted file mode 100644 index 32a2a312..00000000 --- a/artifacts/quality/extreme-scale-gates/check-scale-nightly.log +++ /dev/null @@ -1,14 +0,0 @@ -PASSED nightly:architecture-topology (3175ms) -PASSED nightly:traffic-budgets (1393ms) -PASSED nightly:scale-units (2435ms) -PASSED nightly:composition-s0-s1 (90ms) -PASSED nightly:composition-s0-s2 (226ms) -PASSED nightly:composition-scale-suite (861ms) -PASSED nightly:typescript-diagnostics (1552ms) -PASSED nightly:baseline-regression (1750ms) -PASSED nightly:topology-s3-s4 (6995ms) -PASSED nightly:telemetry-storm (3703ms) -PASSED nightly:session-cycles (1703ms) -PASSED nightly:browser-soak (121407ms) -scale tier nightly: PASSED (artifacts/scale/nightly/summary.json) -$ node scripts/scale/run-scale-profile.ts nightly diff --git a/artifacts/quality/extreme-scale-gates/check-scale-pr.log b/artifacts/quality/extreme-scale-gates/check-scale-pr.log deleted file mode 100644 index e629a086..00000000 --- a/artifacts/quality/extreme-scale-gates/check-scale-pr.log +++ /dev/null @@ -1,6 +0,0 @@ -PASSED pr:architecture-topology (4307ms) -PASSED pr:traffic-budgets (1446ms) -PASSED pr:scale-units (2377ms) -PASSED pr:composition-s0-s1 (87ms) -scale tier pr: PASSED (artifacts/scale/pr/summary.json) -$ node scripts/scale/run-scale-profile.ts pr diff --git a/artifacts/quality/extreme-scale-gates/check-scale-release.log b/artifacts/quality/extreme-scale-gates/check-scale-release.log deleted file mode 100644 index d145f26f..00000000 --- a/artifacts/quality/extreme-scale-gates/check-scale-release.log +++ /dev/null @@ -1,13 +0,0 @@ -PASSED release:release-coherence (1123ms) -PASSED release:architecture-topology (3142ms) -PASSED release:traffic-budgets (1432ms) -PASSED release:scale-units (2318ms) -PASSED release:composition-s0-s1 (95ms) -PASSED release:composition-s0-s2 (235ms) -PASSED release:composition-scale-suite (843ms) -PASSED release:typescript-diagnostics (1499ms) -PASSED release:baseline-regression (1820ms) -PASSED release:topology-s3-s4 (7137ms) -PASSED release:telemetry-storm (3364ms) -scale tier release: PASSED (artifacts/scale/release/summary.json) -$ node scripts/scale/run-scale-profile.ts release diff --git a/artifacts/quality/extreme-scale-gates/check-topology.log b/artifacts/quality/extreme-scale-gates/check-topology.log deleted file mode 100644 index f971e428..00000000 --- a/artifacts/quality/extreme-scale-gates/check-topology.log +++ /dev/null @@ -1,19 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/platform/cardinality/cardinality-budget.test.ts (3 tests) 7ms - โœ“ tests/platform/cardinality/compose-unique-record.test.ts (2 tests) 9ms - โœ“ tests/architecture/context-lazy-loading.test.ts (1 test) 6ms - โœ“ tests/platform/routing/context-route-module.test.ts (3 tests) 9ms - โœ“ tests/architecture/topology-cardinality.test.ts (9 tests) 13ms - โœ“ tests/platform/cardinality/extreme-scale-registry.test.ts (3 tests) 2363ms - โœ“ keeps 10k -> 100k composition growth below a quadratic regression budget  391ms - โœ“ keeps one million lookups bounded on a 100k-entry runtime registry  1515ms - โœ“ selects and resolves 100k feature ids within the membership budget  455ms - - Test Files  6 passed (6) - Tests  21 passed (21) - Start at  13:29:21 - Duration  2.94s (transform 231ms, setup 1.63s, import 305ms, tests 2.41s, environment 1ms) - -$ node scripts/run-vitest.ts run tests/architecture/topology-cardinality.test.ts tests/architecture/context-lazy-loading.test.ts tests/platform/cardinality tests/platform/routing --reporter=default diff --git a/artifacts/quality/extreme-scale-gates/check-traffic.log b/artifacts/quality/extreme-scale-gates/check-traffic.log deleted file mode 100644 index dbc62acb..00000000 --- a/artifacts/quality/extreme-scale-gates/check-traffic.log +++ /dev/null @@ -1,21 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/platform/traffic/request-budget.test.ts (7 tests) 17ms - โœ“ tests/platform/resilience/retry-budget.test.ts (6 tests) 7ms - โœ“ tests/platform/resilience/deadline.test.ts (3 tests) 6ms - โœ“ tests/platform/traffic/concurrency-budget.test.ts (6 tests) 11ms - โœ“ tests/platform/execution/execution-context.test.ts (10 tests) 11ms - โœ“ tests/platform/traffic/traffic-budget.test.ts (9 tests) 11ms - โœ“ tests/platform/traffic/operation-traffic-policy.test.ts (7 tests) 10ms - โœ“ tests/platform/traffic/request-fanout.test.ts (6 tests) 49ms - โœ“ tests/platform/traffic/request-deduplication.test.ts (3 tests) 47ms - โœ“ tests/platform/traffic/http-budget-integration.test.ts (9 tests) 130ms - โœ“ tests/platform/traffic/traffic-amplification.test.ts (3 tests) 391ms - - Test Files  11 passed (11) - Tests  69 passed (69) - Start at  13:29:25 - Duration  1.34s (transform 858ms, setup 4.17s, import 1.44s, tests 690ms, environment 2ms) - -$ node scripts/run-vitest.ts run tests/platform/execution tests/platform/traffic tests/platform/resilience --reporter=default diff --git a/artifacts/quality/extreme-scale-gates/check-types-app.log b/artifacts/quality/extreme-scale-gates/check-types-app.log deleted file mode 100644 index 388c04b1..00000000 --- a/artifacts/quality/extreme-scale-gates/check-types-app.log +++ /dev/null @@ -1 +0,0 @@ -$ tsc --project tsconfig.app.json diff --git a/artifacts/quality/extreme-scale-gates/check-types-test.log b/artifacts/quality/extreme-scale-gates/check-types-test.log deleted file mode 100644 index 08d11af4..00000000 --- a/artifacts/quality/extreme-scale-gates/check-types-test.log +++ /dev/null @@ -1 +0,0 @@ -$ tsc --project tsconfig.test.json diff --git a/artifacts/quality/extreme-scale-gates/check-types.log b/artifacts/quality/extreme-scale-gates/check-types.log deleted file mode 100644 index 9a7a2716..00000000 --- a/artifacts/quality/extreme-scale-gates/check-types.log +++ /dev/null @@ -1,7 +0,0 @@ -$ corepack pnpm check:types:app && corepack pnpm check:types:node && corepack pnpm check:types:test && corepack pnpm check:types:recipes && corepack pnpm check:types:web-worker && corepack pnpm check:types:service-worker -$ tsc --project tsconfig.app.json -$ tsc --project tsconfig.node.json -$ tsc --project tsconfig.test.json -$ node scripts/check-optional-recipe-types.ts -$ tsc --project tsconfig.web-worker.json -$ tsc --project tsconfig.service-worker.json diff --git a/artifacts/quality/extreme-scale-gates/lint.log b/artifacts/quality/extreme-scale-gates/lint.log deleted file mode 100644 index 90a5c4cf..00000000 --- a/artifacts/quality/extreme-scale-gates/lint.log +++ /dev/null @@ -1 +0,0 @@ -$ eslint src scripts tests recipes .storybook vite.config.ts vitest.config.ts playwright*.config.ts --max-warnings=0 diff --git a/artifacts/quality/extreme-scale-gates/test-extreme-scale-focused.log b/artifacts/quality/extreme-scale-gates/test-extreme-scale-focused.log deleted file mode 100644 index 45372352..00000000 --- a/artifacts/quality/extreme-scale-gates/test-extreme-scale-focused.log +++ /dev/null @@ -1,23 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/scripts/generate-product-feature-index.test.ts (8 tests) 41ms - โœ“ tests/platform/traffic/request-deduplication.test.ts (3 tests) 54ms - โœ“ tests/platform/traffic/request-fanout.test.ts (6 tests) 56ms - โœ“ tests/architecture/request-fanout.test.ts (4 tests) 194ms - โœ“ tests/features/reference-feature/reference-request-deduplication.test.ts (3 tests) 50ms - โœ“ tests/features/reference-feature/reference-request-fanout.test.ts (8 tests) 68ms - โœ“ tests/architecture/app-build-input.test.ts (4 tests) 2380ms - โœ“ accepts the production generator's output and an app-local bundle  771ms - โœ“ rejects a generator regression that imports every discovered feature  673ms - โœ“ rejects a production bundle that contains another app's feature  643ms - โœ“ tests/scale/global-local-independence.test.ts (7 tests) 7755ms - โœ“ keeps App A's generated indexes and reachable source graph identical from S0 to S2 on disk  5260ms - โœ“ selects another app from the same repository without App A's features  982ms - - Test Files  8 passed (8) - Tests  43 passed (43) - Start at  13:29:12 - Duration  8.30s (transform 919ms, setup 1.94s, import 1.61s, tests 10.60s, environment 1ms) - -$ node scripts/run-vitest.ts run tests/scale/global-local-independence.test.ts tests/architecture/app-build-input.test.ts tests/architecture/request-fanout.test.ts tests/platform/traffic/request-fanout.test.ts tests/platform/traffic/request-deduplication.test.ts tests/features/reference-feature/reference-request-fanout.test.ts tests/features/reference-feature/reference-request-deduplication.test.ts tests/scripts/generate-product-feature-index.test.ts --reporter=default diff --git a/artifacts/quality/extreme-scale-gates/test-platform.log b/artifacts/quality/extreme-scale-gates/test-platform.log deleted file mode 100644 index d634a635..00000000 --- a/artifacts/quality/extreme-scale-gates/test-platform.log +++ /dev/null @@ -1,55 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/architecture/app-build-input.test.ts (4 tests) 9429ms - โœ“ accepts the production generator's output and an app-local bundle  1340ms - โœ“ rejects a generator regression that imports every discovered feature  5122ms - โœ“ rejects a production bundle that contains another app's feature  2464ms - โœ“ tests/platform/cardinality/extreme-scale-registry.test.ts (3 tests) 3975ms - โœ“ keeps 10k -> 100k composition growth below a quadratic regression budget  634ms - โœ“ keeps one million lookups bounded on a 100k-entry runtime registry  2331ms - โœ“ selects and resolves 100k feature ids within the membership budget  1007ms - โœ“ tests/platform/telemetry/telemetry-pipeline.test.ts (9 tests) 1077ms - โœ“ bounds network sends during a repeated error storm  961ms - โœ“ tests/platform/traffic/traffic-amplification.test.ts (3 tests) 558ms - โœ“ keeps physical requests bounded when every dispatch fails  307ms - โœ“ tests/architecture/request-fanout.test.ts (4 tests) 344ms - โœ“ finds no per-row dispatch in feature code or application use cases  330ms - โœ“ tests/architecture/observability-boundaries.test.ts (4 tests) 235ms - โœ“ tests/platform/traffic/http-budget-integration.test.ts (9 tests) 133ms - โœ“ tests/platform/validation/bounded-json.test.ts (10 tests) 140ms - โœ“ tests/platform/telemetry/trace-context.test.ts (6 tests) 82ms - โœ“ tests/platform/errors/failure-boundary.test.tsx (4 tests) 87ms - โœ“ tests/platform/traffic/request-fanout.test.ts (6 tests) 75ms - โœ“ tests/platform/traffic/request-deduplication.test.ts (3 tests) 74ms - โœ“ tests/platform/release/cache-policy.test.ts (5 tests) 40ms - โœ“ tests/platform/errors/platform-errors.test.ts (16 tests) 19ms - โœ“ tests/platform/telemetry/telemetry-buffer.test.ts (8 tests) 20ms - โœ“ tests/platform/telemetry/redact-telemetry.test.ts (14 tests) 14ms - โœ“ tests/platform/traffic/request-budget.test.ts (7 tests) 7ms - โœ“ tests/platform/release/release-mismatch-recovery.test.ts (10 tests) 12ms - โœ“ tests/architecture/topology-cardinality.test.ts (9 tests) 10ms - โœ“ tests/platform/telemetry/telemetry-deduplicator.test.ts (8 tests) 9ms - โœ“ tests/platform/traffic/concurrency-budget.test.ts (6 tests) 11ms - โœ“ tests/platform/execution/execution-context.test.ts (10 tests) 12ms - โœ“ tests/platform/traffic/traffic-budget.test.ts (9 tests) 8ms - โœ“ tests/platform/validation/validation-budget.test.ts (7 tests) 11ms - โœ“ tests/platform/traffic/operation-traffic-policy.test.ts (7 tests) 11ms - โœ“ tests/platform/routing/context-route-module.test.ts (3 tests) 10ms - โœ“ tests/platform/release/release-coherence.test.ts (10 tests) 13ms - โœ“ tests/platform/cardinality/compose-unique-record.test.ts (2 tests) 5ms - โœ“ tests/platform/telemetry/telemetry-port.test.ts (3 tests) 6ms - โœ“ tests/platform/resilience/retry-budget.test.ts (6 tests) 5ms - โœ“ tests/platform/errors/app-error.test.ts (10 tests) 6ms - โœ“ tests/platform/cardinality/cardinality-budget.test.ts (3 tests) 7ms - โœ“ tests/architecture/context-lazy-loading.test.ts (1 test) 6ms - โœ“ tests/platform/resilience/deadline.test.ts (3 tests) 7ms - โœ“ tests/architecture/module-hierarchy.test.ts (1 test) 6ms - - Test Files  35 passed (35) - Tests  223 passed (223) - Start at  13:29:32 - Duration  33.44s (transform 977ms, setup 7.36s, import 2.52s, tests 16.46s, environment 1.01s) - -JUNIT report written to /shared/codebase/clean-architecture-frontend-template/artifacts/tests/platform.xml -$ node scripts/run-vitest.ts run tests/platform tests/architecture --no-file-parallelism --reporter=default --reporter=junit --outputFile.junit=artifacts/tests/platform.xml diff --git a/artifacts/quality/extreme-scale-gates/test-reference-feature.log b/artifacts/quality/extreme-scale-gates/test-reference-feature.log deleted file mode 100644 index 84e4fd89..00000000 --- a/artifacts/quality/extreme-scale-gates/test-reference-feature.log +++ /dev/null @@ -1,30 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/features/reference-feature/reference-error.test.ts (3 tests) 102ms - โœ“ tests/features/reference-feature/reference-telemetry.test.ts (4 tests) 55ms - โœ“ tests/features/reference-feature/reference-http-problem-mapping.test.ts (6 tests) 12ms - โœ“ tests/features/reference-feature/reference-request-deduplication.test.ts (3 tests) 112ms - โœ“ tests/features/reference-feature/reference-request-fanout.test.ts (8 tests) 189ms - โœ“ tests/features/reference-feature/reference-traffic-policy.test.ts (1 test) 9ms - โœ“ tests/features/reference-feature/installed-context-routing.test.ts (2 tests) 108ms - โœ“ tests/features/reference-feature/reference-contract.test.ts (7 tests) 35ms - โœ“ tests/features/reference-feature/feature-module.test.ts (1 test) 6ms - โœ“ tests/features/reference-feature/reference-http-gateway.test.ts (2 tests) 8ms - โœ“ tests/features/reference-feature/reference-installed-executor.test.ts (1 test) 7ms - โœ“ tests/features/reference-feature/reference-diagnostics.test.ts (1 test) 81ms - โœ“ tests/features/reference-feature/reference-runtime-composition.test.ts (3 tests) 201ms - โœ“ tests/features/reference-feature/reference-production-vertical.test.tsx (1 test) 1243ms - โœ“ traverses bootstrap, router, application, HTTP schema/mapper and query cache  1237ms - โœ“ tests/features/reference-feature/reference-page.test.tsx (11 tests) 3248ms - โœ“ mounts list and detail keys under the installed governed namespace  1035ms - โœ“ renders backend forbidden even when the client access hint allowed entry  423ms - โœ“ deduplicates create, preserves input and surfaces a conflict  584ms - - Test Files  15 passed (15) - Tests  54 passed (54) - Start at  13:30:06 - Duration  7.80s (transform 13.26s, setup 7.90s, import 20.03s, tests 5.42s, environment 2.84s) - -JUNIT report written to /shared/codebase/clean-architecture-frontend-template/artifacts/tests/reference-feature.xml -$ node scripts/run-vitest.ts run tests/features/reference-feature --reporter=default --reporter=junit --outputFile.junit=artifacts/tests/reference-feature.xml --passWithNoTests diff --git a/artifacts/scale/main/architecture-topology.log b/artifacts/scale/main/architecture-topology.log deleted file mode 100644 index 26511617..00000000 --- a/artifacts/scale/main/architecture-topology.log +++ /dev/null @@ -1,25 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/platform/cardinality/cardinality-budget.test.ts (3 tests) 6ms - โœ“ tests/platform/cardinality/compose-unique-record.test.ts (2 tests) 7ms - โœ“ tests/architecture/module-hierarchy.test.ts (1 test) 5ms - โœ“ tests/architecture/context-lazy-loading.test.ts (1 test) 6ms - โœ“ tests/platform/routing/context-route-module.test.ts (3 tests) 10ms - โœ“ tests/architecture/topology-cardinality.test.ts (9 tests) 11ms - โœ“ tests/architecture/observability-boundaries.test.ts (4 tests) 97ms - โœ“ tests/architecture/request-fanout.test.ts (4 tests) 206ms - โœ“ tests/platform/cardinality/extreme-scale-registry.test.ts (3 tests) 2005ms - โœ“ keeps 10k -> 100k composition growth below a quadratic regression budget  407ms - โœ“ keeps one million lookups bounded on a 100k-entry runtime registry  1229ms - โœ“ selects and resolves 100k feature ids within the membership budget  366ms - โœ“ tests/architecture/app-build-input.test.ts (4 tests) 2215ms - โœ“ accepts the production generator's output and an app-local bundle  714ms - โœ“ rejects a generator regression that imports every discovered feature  626ms - โœ“ rejects a production bundle that contains another app's feature  613ms - - Test Files  10 passed (10) - Tests  34 passed (34) - Start at  13:30:24 - Duration  2.82s (transform 645ms, setup 2.94s, import 949ms, tests 4.57s, environment 2ms) - diff --git a/artifacts/scale/main/baseline-regression.log b/artifacts/scale/main/baseline-regression.log deleted file mode 100644 index 041945a2..00000000 --- a/artifacts/scale/main/baseline-regression.log +++ /dev/null @@ -1,3 +0,0 @@ -compatibility: structural=true compiler=true timing=true -axes: absolute 28 (ok), growth 8 (ok), relative 16 compiler + 12 timing -scale baseline gate: PASSED (artifacts/scale/main/baseline-regression.json) diff --git a/artifacts/scale/main/composition-s0-s1.log b/artifacts/scale/main/composition-s0-s1.log deleted file mode 100644 index 8b47e2ad..00000000 --- a/artifacts/scale/main/composition-s0-s1.log +++ /dev/null @@ -1,5 +0,0 @@ -PASS registry-composition:growth (exponents 0.00) -PASS product-feature-selection:growth (exponents 0.00) -PASS product-feature-resolution:growth (exponents 0.00) -PASS context-hierarchy-composition:growth (exponents 0.00) -composition scale artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/main/composition-s0-s1.json diff --git a/artifacts/scale/main/composition-s0-s2.log b/artifacts/scale/main/composition-s0-s2.log deleted file mode 100644 index 5a79c68b..00000000 --- a/artifacts/scale/main/composition-s0-s2.log +++ /dev/null @@ -1,5 +0,0 @@ -PASS registry-composition:growth (exponents 0.00, 0.64) -PASS product-feature-selection:growth (exponents 0.00, 0.83) -PASS product-feature-resolution:growth (exponents 0.00, 0.83) -PASS context-hierarchy-composition:growth (exponents 0.00, 0.34) -composition scale artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/main/composition-s0-s2.json diff --git a/artifacts/scale/main/composition-scale-suite.log b/artifacts/scale/main/composition-scale-suite.log deleted file mode 100644 index 9ce1a4eb..00000000 --- a/artifacts/scale/main/composition-scale-suite.log +++ /dev/null @@ -1,11 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/scale/tsc-diagnostics-parser.test.ts (3 tests) 7ms - โœ“ tests/scale/composition-scale.test.ts (6 tests) 232ms - - Test Files  2 passed (2) - Tests  9 passed (9) - Start at  13:30:31 - Duration  596ms (transform 94ms, setup 326ms, import 114ms, tests 239ms, environment 0ms) - diff --git a/artifacts/scale/main/scale-units.log b/artifacts/scale/main/scale-units.log deleted file mode 100644 index 52c54bf4..00000000 --- a/artifacts/scale/main/scale-units.log +++ /dev/null @@ -1,17 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/scale/growth-regression.test.ts (7 tests) 6ms - โœ“ tests/scale/traffic/retry-after-jitter.test.ts (5 tests) 38ms - โœ“ tests/scale/traffic/amplification-metrics.test.ts (6 tests) 5ms - โœ“ tests/scale/benchmark.test.ts (4 tests) 8ms - โœ“ tests/scale/synthetic-topology.test.ts (8 tests) 8ms - โœ“ tests/scale/scale-baseline.test.ts (11 tests) 11ms - โœ“ tests/scale/traffic/failure-scenarios.test.ts (5 tests) 1420ms - โœ“ bounds physical requests when all upstream calls fail  896ms - - Test Files  7 passed (7) - Tests  46 passed (46) - Start at  13:30:29 - Duration  2.04s (transform 695ms, setup 1.76s, import 808ms, tests 1.50s, environment 1ms) - diff --git a/artifacts/scale/main/traffic-budgets.log b/artifacts/scale/main/traffic-budgets.log deleted file mode 100644 index b49a8ea7..00000000 --- a/artifacts/scale/main/traffic-budgets.log +++ /dev/null @@ -1,20 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/platform/resilience/deadline.test.ts (3 tests) 4ms - โœ“ tests/platform/traffic/request-budget.test.ts (7 tests) 5ms - โœ“ tests/platform/resilience/retry-budget.test.ts (6 tests) 7ms - โœ“ tests/platform/traffic/concurrency-budget.test.ts (6 tests) 11ms - โœ“ tests/platform/traffic/traffic-budget.test.ts (9 tests) 10ms - โœ“ tests/platform/execution/execution-context.test.ts (10 tests) 9ms - โœ“ tests/platform/traffic/operation-traffic-policy.test.ts (7 tests) 9ms - โœ“ tests/platform/traffic/request-fanout.test.ts (6 tests) 59ms - โœ“ tests/platform/traffic/request-deduplication.test.ts (3 tests) 47ms - โœ“ tests/platform/traffic/http-budget-integration.test.ts (9 tests) 124ms - โœ“ tests/platform/traffic/traffic-amplification.test.ts (3 tests) 379ms - - Test Files  11 passed (11) - Tests  69 passed (69) - Start at  13:30:27 - Duration  1.13s (transform 1.01s, setup 3.62s, import 1.55s, tests 663ms, environment 2ms) - diff --git a/artifacts/scale/main/typescript-diagnostics.log b/artifacts/scale/main/typescript-diagnostics.log deleted file mode 100644 index f0982fbb..00000000 --- a/artifacts/scale/main/typescript-diagnostics.log +++ /dev/null @@ -1,5 +0,0 @@ -tsc app: files=827 types=279186 instantiations=700415 -PASS tsc:types (exponents 0.84, 0.96) -PASS tsc:symbols (exponents 0.51, 0.80) -PASS tsc:instantiations (exponents 0.97, 0.99) -tsc diagnostics artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/main/typescript-diagnostics.json diff --git a/artifacts/scale/nightly/architecture-topology.log b/artifacts/scale/nightly/architecture-topology.log deleted file mode 100644 index 9debb7bf..00000000 --- a/artifacts/scale/nightly/architecture-topology.log +++ /dev/null @@ -1,25 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/platform/cardinality/compose-unique-record.test.ts (2 tests) 5ms - โœ“ tests/platform/cardinality/cardinality-budget.test.ts (3 tests) 5ms - โœ“ tests/architecture/module-hierarchy.test.ts (1 test) 6ms - โœ“ tests/architecture/context-lazy-loading.test.ts (1 test) 7ms - โœ“ tests/platform/routing/context-route-module.test.ts (3 tests) 8ms - โœ“ tests/architecture/topology-cardinality.test.ts (9 tests) 13ms - โœ“ tests/architecture/observability-boundaries.test.ts (4 tests) 109ms - โœ“ tests/architecture/request-fanout.test.ts (4 tests) 151ms - โœ“ tests/platform/cardinality/extreme-scale-registry.test.ts (3 tests) 1946ms - โœ“ keeps 10k -> 100k composition growth below a quadratic regression budget  378ms - โœ“ keeps one million lookups bounded on a 100k-entry runtime registry  1201ms - โœ“ selects and resolves 100k feature ids within the membership budget  365ms - โœ“ tests/architecture/app-build-input.test.ts (4 tests) 2219ms - โœ“ accepts the production generator's output and an app-local bundle  671ms - โœ“ rejects a generator regression that imports every discovered feature  648ms - โœ“ rejects a production bundle that contains another app's feature  649ms - - Test Files  10 passed (10) - Tests  34 passed (34) - Start at  13:30:41 - Duration  2.82s (transform 580ms, setup 3.20s, import 787ms, tests 4.47s, environment 2ms) - diff --git a/artifacts/scale/nightly/baseline-regression.log b/artifacts/scale/nightly/baseline-regression.log deleted file mode 100644 index 47c89185..00000000 --- a/artifacts/scale/nightly/baseline-regression.log +++ /dev/null @@ -1,3 +0,0 @@ -compatibility: structural=true compiler=true timing=true -axes: absolute 28 (ok), growth 8 (ok), relative 16 compiler + 12 timing -scale baseline gate: PASSED (artifacts/scale/nightly/baseline-regression.json) diff --git a/artifacts/scale/nightly/browser-soak.log b/artifacts/scale/nightly/browser-soak.log deleted file mode 100644 index 7751993d..00000000 --- a/artifacts/scale/nightly/browser-soak.log +++ /dev/null @@ -1,12 +0,0 @@ -browser soak: passed classification=stable samples=24 cycles=2012 -PASS cycles (2012 >= 200) -PASS post-warmup samples (18 >= 3) -PASS navigation (0 failures) -PASS heap slope (stable) -PASS listeners (stable, delta 2) -PASS timers (delta 0, max 2) -PASS in-flight settles (final 0, max 0) -PASS storage growth (keys 0, bytes 0) -PASS backend failure exercised (68 settled visits, 479 API requests, 24 telemetry events) -PASS request amplification (479 requests / 336 visits) -PASS telemetry rate (max 14/min, 24 posts, 24 events) diff --git a/artifacts/scale/nightly/composition-s0-s1.log b/artifacts/scale/nightly/composition-s0-s1.log deleted file mode 100644 index f6854892..00000000 --- a/artifacts/scale/nightly/composition-s0-s1.log +++ /dev/null @@ -1,5 +0,0 @@ -PASS registry-composition:growth (exponents 0.00) -PASS product-feature-selection:growth (exponents 0.00) -PASS product-feature-resolution:growth (exponents 0.00) -PASS context-hierarchy-composition:growth (exponents 0.00) -composition scale artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/nightly/composition-s0-s1.json diff --git a/artifacts/scale/nightly/composition-s0-s2.log b/artifacts/scale/nightly/composition-s0-s2.log deleted file mode 100644 index cf0e827b..00000000 --- a/artifacts/scale/nightly/composition-s0-s2.log +++ /dev/null @@ -1,5 +0,0 @@ -PASS registry-composition:growth (exponents 0.00, 0.64) -PASS product-feature-selection:growth (exponents 0.00, 0.85) -PASS product-feature-resolution:growth (exponents 0.00, 0.83) -PASS context-hierarchy-composition:growth (exponents 0.00, 0.34) -composition scale artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/nightly/composition-s0-s2.json diff --git a/artifacts/scale/nightly/composition-scale-suite.log b/artifacts/scale/nightly/composition-scale-suite.log deleted file mode 100644 index 055c5b6a..00000000 --- a/artifacts/scale/nightly/composition-scale-suite.log +++ /dev/null @@ -1,11 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/scale/tsc-diagnostics-parser.test.ts (3 tests) 6ms - โœ“ tests/scale/composition-scale.test.ts (6 tests) 191ms - - Test Files  2 passed (2) - Tests  9 passed (9) - Start at  13:30:48 - Duration  514ms (transform 78ms, setup 296ms, import 81ms, tests 197ms, environment 0ms) - diff --git a/artifacts/scale/nightly/scale-units.log b/artifacts/scale/nightly/scale-units.log deleted file mode 100644 index acaba57c..00000000 --- a/artifacts/scale/nightly/scale-units.log +++ /dev/null @@ -1,17 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/scale/traffic/retry-after-jitter.test.ts (5 tests) 34ms - โœ“ tests/scale/traffic/amplification-metrics.test.ts (6 tests) 6ms - โœ“ tests/scale/benchmark.test.ts (4 tests) 8ms - โœ“ tests/scale/growth-regression.test.ts (7 tests) 6ms - โœ“ tests/scale/synthetic-topology.test.ts (8 tests) 8ms - โœ“ tests/scale/scale-baseline.test.ts (11 tests) 14ms - โœ“ tests/scale/traffic/failure-scenarios.test.ts (5 tests) 1453ms - โœ“ bounds physical requests when all upstream calls fail  896ms - - Test Files  7 passed (7) - Tests  46 passed (46) - Start at  13:30:45 - Duration  2.07s (transform 436ms, setup 1.74s, import 563ms, tests 1.53s, environment 1ms) - diff --git a/artifacts/scale/nightly/session-cycles.log b/artifacts/scale/nightly/session-cycles.log deleted file mode 100644 index 978ef846..00000000 --- a/artifacts/scale/nightly/session-cycles.log +++ /dev/null @@ -1,12 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/scale/session/network-flap.test.ts (2 tests) 324ms - โœ“ tests/scale/session/long-session.test.ts (1 test) 921ms - โœ“ returns timers, listeners, leases, buffers and cache entries to a stable bound  919ms - - Test Files  2 passed (2) - Tests  3 passed (3) - Start at  13:31:03 - Duration  1.37s (transform 228ms, setup 296ms, import 363ms, tests 1.24s, environment 0ms) - diff --git a/artifacts/scale/nightly/telemetry-storm.log b/artifacts/scale/nightly/telemetry-storm.log deleted file mode 100644 index 0823d58b..00000000 --- a/artifacts/scale/nightly/telemetry-storm.log +++ /dev/null @@ -1,19 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/platform/telemetry/telemetry-port.test.ts (3 tests) 6ms - โœ“ tests/platform/telemetry/telemetry-deduplicator.test.ts (8 tests) 11ms - โœ“ tests/platform/telemetry/telemetry-buffer.test.ts (8 tests) 15ms - โœ“ tests/platform/telemetry/redact-telemetry.test.ts (14 tests) 11ms - โœ“ tests/platform/telemetry/trace-context.test.ts (6 tests) 43ms - โœ“ tests/platform/telemetry/telemetry-pipeline.test.ts (9 tests) 669ms - โœ“ bounds network sends during a repeated error storm  609ms - โœ“ tests/scale/telemetry/telemetry-storm.test.ts (4 tests) 2882ms - โœ“ does not turn 100000 identical failures into 100000 sends  748ms - โœ“ bounds sends and buffer when a storm has many distinct fingerprints  2099ms - - Test Files  7 passed (7) - Tests  52 passed (52) - Start at  13:30:59 - Duration  3.35s (transform 427ms, setup 1.75s, import 534ms, tests 3.64s, environment 1ms) - diff --git a/artifacts/scale/nightly/topology-s3-s4.log b/artifacts/scale/nightly/topology-s3-s4.log deleted file mode 100644 index d035d0dc..00000000 --- a/artifacts/scale/nightly/topology-s3-s4.log +++ /dev/null @@ -1,16 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/platform/cardinality/extreme-scale-registry.test.ts (3 tests) 1822ms - โœ“ keeps 10k -> 100k composition growth below a quadratic regression budget  313ms - โœ“ keeps one million lookups bounded on a 100k-entry runtime registry  1163ms - โœ“ selects and resolves 100k feature ids within the membership budget  345ms - โœ“ tests/scale/global-local-independence.test.ts (7 tests) 6311ms - โœ“ keeps App A's generated indexes and reachable source graph identical from S0 to S2 on disk  4764ms - โœ“ selects another app from the same repository without App A's features  583ms - - Test Files  2 passed (2) - Tests  10 passed (10) - Start at  13:30:52 - Duration  6.64s (transform 87ms, setup 327ms, import 80ms, tests 8.13s, environment 0ms) - diff --git a/artifacts/scale/nightly/traffic-budgets.log b/artifacts/scale/nightly/traffic-budgets.log deleted file mode 100644 index 7d62db26..00000000 --- a/artifacts/scale/nightly/traffic-budgets.log +++ /dev/null @@ -1,20 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/platform/traffic/concurrency-budget.test.ts (6 tests) 9ms - โœ“ tests/platform/resilience/deadline.test.ts (3 tests) 4ms - โœ“ tests/platform/traffic/request-budget.test.ts (7 tests) 7ms - โœ“ tests/platform/resilience/retry-budget.test.ts (6 tests) 5ms - โœ“ tests/platform/traffic/traffic-budget.test.ts (9 tests) 8ms - โœ“ tests/platform/execution/execution-context.test.ts (10 tests) 10ms - โœ“ tests/platform/traffic/operation-traffic-policy.test.ts (7 tests) 9ms - โœ“ tests/platform/traffic/request-fanout.test.ts (6 tests) 41ms - โœ“ tests/platform/traffic/request-deduplication.test.ts (3 tests) 40ms - โœ“ tests/platform/traffic/http-budget-integration.test.ts (9 tests) 121ms - โœ“ tests/platform/traffic/traffic-amplification.test.ts (3 tests) 316ms - - Test Files  11 passed (11) - Tests  69 passed (69) - Start at  13:30:44 - Duration  1.04s (transform 890ms, setup 3.40s, import 1.40s, tests 570ms, environment 2ms) - diff --git a/artifacts/scale/nightly/typescript-diagnostics.log b/artifacts/scale/nightly/typescript-diagnostics.log deleted file mode 100644 index a9f17c57..00000000 --- a/artifacts/scale/nightly/typescript-diagnostics.log +++ /dev/null @@ -1,5 +0,0 @@ -tsc app: files=827 types=279186 instantiations=700415 -PASS tsc:types (exponents 0.84, 0.96) -PASS tsc:symbols (exponents 0.51, 0.80) -PASS tsc:instantiations (exponents 0.97, 0.99) -tsc diagnostics artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/nightly/typescript-diagnostics.json diff --git a/artifacts/scale/pr/architecture-topology.log b/artifacts/scale/pr/architecture-topology.log deleted file mode 100644 index 7bb024ec..00000000 --- a/artifacts/scale/pr/architecture-topology.log +++ /dev/null @@ -1,25 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/architecture/module-hierarchy.test.ts (1 test) 14ms - โœ“ tests/architecture/topology-cardinality.test.ts (9 tests) 37ms - โœ“ tests/architecture/observability-boundaries.test.ts (4 tests) 210ms - โœ“ tests/architecture/context-lazy-loading.test.ts (1 test) 18ms - โœ“ tests/platform/cardinality/cardinality-budget.test.ts (3 tests) 22ms - โœ“ tests/platform/cardinality/compose-unique-record.test.ts (2 tests) 12ms - โœ“ tests/platform/routing/context-route-module.test.ts (3 tests) 11ms - โœ“ tests/architecture/request-fanout.test.ts (4 tests) 234ms - โœ“ tests/platform/cardinality/extreme-scale-registry.test.ts (3 tests) 2791ms - โœ“ keeps 10k -> 100k composition growth below a quadratic regression budget  721ms - โœ“ keeps one million lookups bounded on a 100k-entry runtime registry  1649ms - โœ“ selects and resolves 100k feature ids within the membership budget  420ms - โœ“ tests/architecture/app-build-input.test.ts (4 tests) 2872ms - โœ“ accepts the production generator's output and an app-local bundle  996ms - โœ“ rejects a generator regression that imports every discovered feature  897ms - โœ“ rejects a production bundle that contains another app's feature  723ms - - Test Files  10 passed (10) - Tests  34 passed (34) - Start at  13:30:15 - Duration  3.81s (transform 625ms, setup 4.78s, import 1.11s, tests 6.22s, environment 2ms) - diff --git a/artifacts/scale/pr/composition-s0-s1.log b/artifacts/scale/pr/composition-s0-s1.log deleted file mode 100644 index bd2058b4..00000000 --- a/artifacts/scale/pr/composition-s0-s1.log +++ /dev/null @@ -1,5 +0,0 @@ -PASS registry-composition:growth (exponents 0.00) -PASS product-feature-selection:growth (exponents 0.00) -PASS product-feature-resolution:growth (exponents 0.00) -PASS context-hierarchy-composition:growth (exponents 0.00) -composition scale artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/pr/composition-s0-s1.json diff --git a/artifacts/scale/pr/scale-units.log b/artifacts/scale/pr/scale-units.log deleted file mode 100644 index 7d2a53fa..00000000 --- a/artifacts/scale/pr/scale-units.log +++ /dev/null @@ -1,17 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/scale/traffic/amplification-metrics.test.ts (6 tests) 5ms - โœ“ tests/scale/growth-regression.test.ts (7 tests) 6ms - โœ“ tests/scale/traffic/retry-after-jitter.test.ts (5 tests) 38ms - โœ“ tests/scale/benchmark.test.ts (4 tests) 7ms - โœ“ tests/scale/synthetic-topology.test.ts (8 tests) 10ms - โœ“ tests/scale/scale-baseline.test.ts (11 tests) 11ms - โœ“ tests/scale/traffic/failure-scenarios.test.ts (5 tests) 1429ms - โœ“ bounds physical requests when all upstream calls fail  919ms - - Test Files  7 passed (7) - Tests  46 passed (46) - Start at  13:30:21 - Duration  2.02s (transform 485ms, setup 1.52s, import 646ms, tests 1.51s, environment 1ms) - diff --git a/artifacts/scale/pr/traffic-budgets.log b/artifacts/scale/pr/traffic-budgets.log deleted file mode 100644 index 2026fd77..00000000 --- a/artifacts/scale/pr/traffic-budgets.log +++ /dev/null @@ -1,20 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/platform/traffic/request-budget.test.ts (7 tests) 5ms - โœ“ tests/platform/resilience/deadline.test.ts (3 tests) 5ms - โœ“ tests/platform/traffic/concurrency-budget.test.ts (6 tests) 10ms - โœ“ tests/platform/resilience/retry-budget.test.ts (6 tests) 5ms - โœ“ tests/platform/execution/execution-context.test.ts (10 tests) 9ms - โœ“ tests/platform/traffic/traffic-budget.test.ts (9 tests) 10ms - โœ“ tests/platform/traffic/operation-traffic-policy.test.ts (7 tests) 7ms - โœ“ tests/platform/traffic/request-fanout.test.ts (6 tests) 44ms - โœ“ tests/platform/traffic/request-deduplication.test.ts (3 tests) 40ms - โœ“ tests/platform/traffic/http-budget-integration.test.ts (9 tests) 127ms - โœ“ tests/platform/traffic/traffic-amplification.test.ts (3 tests) 328ms - - Test Files  11 passed (11) - Tests  69 passed (69) - Start at  13:30:20 - Duration  1.09s (transform 1.03s, setup 3.64s, import 1.52s, tests 590ms, environment 2ms) - diff --git a/artifacts/scale/release/architecture-topology.log b/artifacts/scale/release/architecture-topology.log deleted file mode 100644 index 30f4f1ab..00000000 --- a/artifacts/scale/release/architecture-topology.log +++ /dev/null @@ -1,25 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/platform/cardinality/compose-unique-record.test.ts (2 tests) 7ms - โœ“ tests/architecture/context-lazy-loading.test.ts (1 test) 7ms - โœ“ tests/platform/routing/context-route-module.test.ts (3 tests) 9ms - โœ“ tests/platform/cardinality/cardinality-budget.test.ts (3 tests) 6ms - โœ“ tests/architecture/module-hierarchy.test.ts (1 test) 6ms - โœ“ tests/architecture/topology-cardinality.test.ts (9 tests) 12ms - โœ“ tests/architecture/observability-boundaries.test.ts (4 tests) 101ms - โœ“ tests/architecture/request-fanout.test.ts (4 tests) 155ms - โœ“ tests/platform/cardinality/extreme-scale-registry.test.ts (3 tests) 1941ms - โœ“ keeps 10k -> 100k composition growth below a quadratic regression budget  383ms - โœ“ keeps one million lookups bounded on a 100k-entry runtime registry  1177ms - โœ“ selects and resolves 100k feature ids within the membership budget  379ms - โœ“ tests/architecture/app-build-input.test.ts (4 tests) 2191ms - โœ“ accepts the production generator's output and an app-local bundle  659ms - โœ“ rejects a generator regression that imports every discovered feature  635ms - โœ“ rejects a production bundle that contains another app's feature  660ms - - Test Files  10 passed (10) - Tests  34 passed (34) - Start at  13:33:08 - Duration  2.80s (transform 512ms, setup 3.13s, import 681ms, tests 4.43s, environment 2ms) - diff --git a/artifacts/scale/release/baseline-regression.log b/artifacts/scale/release/baseline-regression.log deleted file mode 100644 index 2de93de9..00000000 --- a/artifacts/scale/release/baseline-regression.log +++ /dev/null @@ -1,3 +0,0 @@ -compatibility: structural=true compiler=true timing=true -axes: absolute 28 (ok), growth 8 (ok), relative 16 compiler + 12 timing -scale baseline gate: PASSED (artifacts/scale/release/baseline-regression.json) diff --git a/artifacts/scale/release/composition-s0-s1.log b/artifacts/scale/release/composition-s0-s1.log deleted file mode 100644 index edb0d391..00000000 --- a/artifacts/scale/release/composition-s0-s1.log +++ /dev/null @@ -1,5 +0,0 @@ -PASS registry-composition:growth (exponents 0.00) -PASS product-feature-selection:growth (exponents 0.00) -PASS product-feature-resolution:growth (exponents 0.00) -PASS context-hierarchy-composition:growth (exponents 0.00) -composition scale artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/release/composition-s0-s1.json diff --git a/artifacts/scale/release/composition-s0-s2.log b/artifacts/scale/release/composition-s0-s2.log deleted file mode 100644 index c3156c6c..00000000 --- a/artifacts/scale/release/composition-s0-s2.log +++ /dev/null @@ -1,5 +0,0 @@ -PASS registry-composition:growth (exponents 0.00, 0.65) -PASS product-feature-selection:growth (exponents 0.00, 0.90) -PASS product-feature-resolution:growth (exponents 0.00, 0.85) -PASS context-hierarchy-composition:growth (exponents 0.00, 0.44) -composition scale artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/release/composition-s0-s2.json diff --git a/artifacts/scale/release/composition-scale-suite.log b/artifacts/scale/release/composition-scale-suite.log deleted file mode 100644 index d366d63e..00000000 --- a/artifacts/scale/release/composition-scale-suite.log +++ /dev/null @@ -1,11 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/scale/tsc-diagnostics-parser.test.ts (3 tests) 7ms - โœ“ tests/scale/composition-scale.test.ts (6 tests) 186ms - - Test Files  2 passed (2) - Tests  9 passed (9) - Start at  13:33:15 - Duration  494ms (transform 86ms, setup 297ms, import 80ms, tests 193ms, environment 0ms) - diff --git a/artifacts/scale/release/release-coherence.log b/artifacts/scale/release/release-coherence.log deleted file mode 100644 index f348e9a1..00000000 --- a/artifacts/scale/release/release-coherence.log +++ /dev/null @@ -1,15 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/platform/release/release-coherence.test.ts (10 tests) 8ms - โœ“ tests/platform/release/release-mismatch-recovery.test.ts (10 tests) 14ms - โœ“ tests/release/old-asset-reachability.test.ts (4 tests) 7ms - โœ“ tests/platform/release/cache-policy.test.ts (5 tests) 29ms - โœ“ tests/release/release-matrix.test.ts (7 tests) 39ms - โœ“ tests/release/mixed-replica.test.ts (7 tests) 67ms - - Test Files  6 passed (6) - Tests  43 passed (43) - Start at  13:33:06 - Duration  780ms (transform 1.11s, setup 1.22s, import 1.79s, tests 163ms, environment 1ms) - diff --git a/artifacts/scale/release/scale-units.log b/artifacts/scale/release/scale-units.log deleted file mode 100644 index 12c471b0..00000000 --- a/artifacts/scale/release/scale-units.log +++ /dev/null @@ -1,17 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/scale/traffic/amplification-metrics.test.ts (6 tests) 6ms - โœ“ tests/scale/growth-regression.test.ts (7 tests) 9ms - โœ“ tests/scale/traffic/retry-after-jitter.test.ts (5 tests) 27ms - โœ“ tests/scale/benchmark.test.ts (4 tests) 11ms - โœ“ tests/scale/synthetic-topology.test.ts (8 tests) 13ms - โœ“ tests/scale/scale-baseline.test.ts (11 tests) 11ms - โœ“ tests/scale/traffic/failure-scenarios.test.ts (5 tests) 1362ms - โœ“ bounds physical requests when all upstream calls fail  874ms - - Test Files  7 passed (7) - Tests  46 passed (46) - Start at  13:33:12 - Duration  1.96s (transform 513ms, setup 1.59s, import 672ms, tests 1.44s, environment 1ms) - diff --git a/artifacts/scale/release/telemetry-storm.log b/artifacts/scale/release/telemetry-storm.log deleted file mode 100644 index 89083c98..00000000 --- a/artifacts/scale/release/telemetry-storm.log +++ /dev/null @@ -1,12 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/scale/telemetry/telemetry-storm.test.ts (4 tests) 2705ms - โœ“ does not turn 100000 identical failures into 100000 sends  672ms - โœ“ bounds sends and buffer when a storm has many distinct fingerprints  1998ms - - Test Files  1 passed (1) - Tests  4 passed (4) - Start at  13:33:26 - Duration  3.01s (transform 58ms, setup 146ms, import 52ms, tests 2.71s, environment 0ms) - diff --git a/artifacts/scale/release/topology-s3-s4.log b/artifacts/scale/release/topology-s3-s4.log deleted file mode 100644 index 2ada7f2a..00000000 --- a/artifacts/scale/release/topology-s3-s4.log +++ /dev/null @@ -1,12 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/scale/global-local-independence.test.ts (7 tests) 6484ms - โœ“ keeps App A's generated indexes and reachable source graph identical from S0 to S2 on disk  4707ms - โœ“ selects another app from the same repository without App A's features  646ms - - Test Files  1 passed (1) - Tests  7 passed (7) - Start at  13:33:19 - Duration  6.79s (transform 53ms, setup 145ms, import 49ms, tests 6.48s, environment 0ms) - diff --git a/artifacts/scale/release/traffic-budgets.log b/artifacts/scale/release/traffic-budgets.log deleted file mode 100644 index 31abbdee..00000000 --- a/artifacts/scale/release/traffic-budgets.log +++ /dev/null @@ -1,20 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - โœ“ tests/platform/traffic/request-budget.test.ts (7 tests) 5ms - โœ“ tests/platform/traffic/concurrency-budget.test.ts (6 tests) 10ms - โœ“ tests/platform/resilience/retry-budget.test.ts (6 tests) 5ms - โœ“ tests/platform/resilience/deadline.test.ts (3 tests) 6ms - โœ“ tests/platform/traffic/traffic-budget.test.ts (9 tests) 9ms - โœ“ tests/platform/execution/execution-context.test.ts (10 tests) 13ms - โœ“ tests/platform/traffic/operation-traffic-policy.test.ts (7 tests) 7ms - โœ“ tests/platform/traffic/request-fanout.test.ts (6 tests) 47ms - โœ“ tests/platform/traffic/request-deduplication.test.ts (3 tests) 50ms - โœ“ tests/platform/traffic/http-budget-integration.test.ts (9 tests) 121ms - โœ“ tests/platform/traffic/traffic-amplification.test.ts (3 tests) 331ms - - Test Files  11 passed (11) - Tests  69 passed (69) - Start at  13:33:11 - Duration  1.08s (transform 940ms, setup 3.62s, import 1.46s, tests 603ms, environment 2ms) - diff --git a/artifacts/scale/release/typescript-diagnostics.log b/artifacts/scale/release/typescript-diagnostics.log deleted file mode 100644 index a9e02468..00000000 --- a/artifacts/scale/release/typescript-diagnostics.log +++ /dev/null @@ -1,5 +0,0 @@ -tsc app: files=827 types=279186 instantiations=700415 -PASS tsc:types (exponents 0.84, 0.96) -PASS tsc:symbols (exponents 0.51, 0.80) -PASS tsc:instantiations (exponents 0.97, 0.99) -tsc diagnostics artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/release/typescript-diagnostics.json diff --git a/config/ci/ungated-scripts.json b/config/ci/ungated-scripts.json index 42d1fd1b..6d1ed86d 100644 --- a/config/ci/ungated-scripts.json +++ b/config/ci/ungated-scripts.json @@ -19,7 +19,7 @@ }, { "script": "check:remediation-ledger", - "reason": "Checks the prose ledger of the 2026-08-14 adapter re-review (docs/operations/adapter-remediation-ledger.md) against test-file markers and the file-transfer bundle budget. It passes at this commit, but it is a history record run by hand, not a current contract: it fails when a product removes the optional file-transfer recipe or when a test split moves a marked test to another file, and neither should block a merge. Run it after moving those tests or changing that budget, and point the ledger rows at the new files." + "reason": "Checks the prose ledger of the 2026-08-14 adapter re-review (docs/operations/adapter-remediation-ledger.md) against test-file markers and the file-transfer bundle budget. It is a history record run by hand, not a current contract: it fails when a product removes the optional file-transfer recipe or when a test split moves a marked test to another file, and neither should block a merge. Run it after moving those tests or changing that budget, and point the ledger rows at the new files." }, { "script": "check:scale:baseline", diff --git a/docs/README.md b/docs/README.md index f6c82275..6435d08c 100644 --- a/docs/README.md +++ b/docs/README.md @@ -41,7 +41,10 @@ README์™€ ์ž…๊ตฌ ๋ฌธ์„œ๋Š” ์˜์–ด, recipeยทledgerยท์Šคํƒ€์ผ ๋ฌธ์„œ๋Š” ํ•œ๊ตญ์–ด - ๋ฒ„์ „๋ณ„ ๋ณ€๊ฒฝ: [`../CHANGELOG.md`](../CHANGELOG.md) `verify:documentation`์€ ์ด ํŒŒ์ผ๊ณผ ์ด ์ ˆ์—์„œ ๋งํฌํ•œ ๋ฌธ์„œ(ํด๋” ๋งํฌ๋Š” ๊ทธ ์•ˆ์˜ `.md` ์ „๋ถ€)์— -์ ํžŒ repo ๊ฒฝ๋กœยท๋งํฌยทpackage scriptยทFE-GATE ID๊ฐ€ ์‹ค์ œ๋กœ ์žˆ๋Š”์ง€ ๊ฒ€์‚ฌํ•œ๋‹ค. `CHANGELOG.md`๋Š” +์ ํžŒ repo ๊ฒฝ๋กœยท๋งํฌยทpackage scriptยทFE-GATE ID๊ฐ€ ์‹ค์ œ๋กœ ์žˆ๋Š”์ง€ ๊ฒ€์‚ฌํ•œ๋‹ค. ๋ช…๋ น(์ธ๋ผ์ธ ์ฝ”๋“œ์™€ +์…ธ ์ฝ”๋“œ ๋ธ”๋ก) ์•ˆ์˜ ๊ฒฝ๋กœ ์ธ์ž๋„ ๋ณธ๋‹ค. ์ง ๋ฐฑ์—”๋“œ ํ…œํ”Œ๋ฆฟ(`clean-architecture-backend-template`)์˜ +๊ฒฝ๋กœ์™€ ๋งํฌ๋Š” ๊ทธ checkout์ด ์ด checkout ์˜†์— ์žˆ์„ ๋•Œ๋งŒ ํ™•์ธํ•˜๊ณ , ์—†์œผ๋ฉด ์‹คํŒจ ๋Œ€์‹  ํ™•์ธํ•˜์ง€ +๋ชปํ•œ ๊ฒƒ์œผ๋กœ ์ถœ๋ ฅ๊ณผ `artifacts/quality/documentation-review.json`์— ๋‚จ๊ธด๋‹ค. `CHANGELOG.md`๋Š” ์ง€๋‚œ ์ƒํƒœ๋ฅผ ์ ๋Š” ๋ฌธ์„œ๋ผ ๋นผ๊ณ , git์ด ๋ฌด์‹œํ•˜๋Š” ์ƒ์„ฑ ์‚ฐ์ถœ๋ฌผ๊ณผ ๋ณต์‚ฌํ•œ ํ”„๋กœ์ ํŠธ๊ฐ€ ์ง€์šด ์ž‘์—… ์ด๋ ฅ์€ ์—†์–ด๋„ ๋œ๋‹ค. ์„ค๋ช…ยท์ˆ˜์น˜๊ฐ€ ์ฝ”๋“œ์™€ ๋งž๋Š”์ง€๋Š” ๊ฒ€์‚ฌํ•˜์ง€ ์•Š๋Š”๋‹ค. ๊ทœ์น™๊ณผ ์˜ˆ์™ธ์˜ ์ •๋ณธ์€ `scripts/verify-documentation-readiness.ts`๋‹ค. diff --git a/docs/accessibility/manual-checklist.md b/docs/accessibility/manual-checklist.md index 2e4158db..21804569 100644 --- a/docs/accessibility/manual-checklist.md +++ b/docs/accessibility/manual-checklist.md @@ -77,5 +77,5 @@ What the automated run scans: annotation. - The reference sample's list in its success, empty and error states, its detail, its form with submit errors and its status page, each after that - state is on screen (`tests/e2e/reference-form.spec.ts`, removed with the + state is on screen (tests/e2e/reference-form.spec.ts, removed with the sample). diff --git a/docs/architecture/scale-architecture.md b/docs/architecture/scale-architecture.md index bba6bf92..aa4fad13 100644 --- a/docs/architecture/scale-architecture.md +++ b/docs/architecture/scale-architecture.md @@ -210,7 +210,7 @@ src/ The exact path layout may adapt to current repository conventions, but ownership boundaries are mandatory. -> 2026-11-03 ํ˜„์žฌ: ์œ„ ๊ทธ๋ฆผ์˜ ์ตœ์ƒ์œ„ `domain/` ํด๋”๋Š” ์—†๋‹ค. domain ๊ณ„์ธต์€ ๊ธฐ๋Šฅ ์•ˆ(`src/features/reference-feature/domain`)์—๋งŒ ์žˆ๋‹ค. `src/platform`์—๋Š” `execution`ยท`release`ยท`routing`๋„ ์žˆ๋‹ค. +> 2026-11-03 ํ˜„์žฌ: ์œ„ ๊ทธ๋ฆผ์˜ ์ตœ์ƒ์œ„ `domain/` ํด๋”๋Š” ์—†๋‹ค. domain ๊ณ„์ธต์€ ๊ธฐ๋Šฅ ์•ˆ(`src/features//domain`)์—๋งŒ ์žˆ๋‹ค. `src/platform`์—๋Š” `execution`ยท`release`ยท`routing`๋„ ์žˆ๋‹ค. > ์ƒ‰์ธ์€ ์ƒ์„ฑ๊ธฐ๊ฐ€ git์ด ๋ฌด์‹œํ•˜๋Š” `src/.generated/`์— ์“ด๋‹ค. ์กฐ๋ฆฝ ์ฝ”๋“œ๋Š” `src/bootstrap/`์— ์žˆ๊ณ  `compose-product.ts`๋ผ๋Š” ํŒŒ์ผ์€ ์—†๋‹ค. ์‹ค์ œ ํด๋” ๋ชฉ๋ก์˜ ์ •๋ณธ์€ [`layers.md`](layers.md)๋‹ค. ## 5. Module Ownership diff --git a/docs/architecture/starter-experience.md b/docs/architecture/starter-experience.md index 69f45b68..9e0b397c 100644 --- a/docs/architecture/starter-experience.md +++ b/docs/architecture/starter-experience.md @@ -161,7 +161,8 @@ selected app. Every build and check script runs it first; run it yourself with invalidation, topic versions and the external `contractPackages` the release manifest is checked against at boot), its message catalogs, and `loadRuntime`, which imports `feature-runtime.ts` dynamically. - `src/features/reference-feature/feature-module.ts` is the complete example. + The reference sample's feature-module.ts (src/features/reference-feature, + while it is installed) is the complete example. 2. Create `src/features//feature-runtime.ts` with `defineFeatureRuntime`: the `schemas` (FE-REG-SCHEMA rows for the feature's route and API schemas), the adapter contributions @@ -171,7 +172,8 @@ selected app. Every build and check script runs it first; run it yourself with it (`application.features.load`) when one of the feature's routes is entered. Do not import it statically from anywhere: each feature would add its whole executable code to the initial chunk again, about 3.9 KB gzip - (`tests/unit/feature-shape-growth.test.ts` bounds one feature at 1 KiB). + (tests/unit/feature-shape-growth.test.ts, which goes with the reference + sample, bounds one feature at 1 KiB). An HTTP API is written once, as its contract contribution descriptor: it executes, and `check:registries` governs the FE-REG-API row projected from it (`projectApiOperationRows` in `src/contracts/api-operations.ts`). @@ -182,7 +184,7 @@ selected app. Every build and check script runs it first; run it yourself with `FEATURE_CONTEXT_ROUTES`. Page components are imported lazily here, and each route handle carries the route's params/search `codecs`; the owning context loads this file only when its route root is visited - (`src/features/reference-feature/context-routes.ts`). Each handle's + (the reference sample's context-routes.ts shows one). Each handle's `routeId` must be a route of a feature contract in the same context; the context refuses the routes when they load, naming the route, context and features (`src/contexts/bounded-context-module.ts`). diff --git a/docs/contracts/compatibility.md b/docs/contracts/compatibility.md index 2d172d24..5d1337b2 100644 --- a/docs/contracts/compatibility.md +++ b/docs/contracts/compatibility.md @@ -25,7 +25,7 @@ reader that accepts it must ship before any writer sends it. | `FEATURE_OVERRIDES` | record; unknown feature id ignored | additive | `featureOverrideArtifactSchema` in `src/contracts/release-artifacts.ts` | | Release manifest V2 | strict object | breaking | `releaseManifestV2ArtifactSchema` in `src/contracts/release-artifacts.ts` | | HTTP success/failure envelope (V3 with `responseEnvelope: "ENVELOPE_V1"`) | strict object (`meta` strips) | breaking | `successEnvelopeSchema`, `failureEnvelopeSchema` in `src/adapters/http/backend-envelope.ts` | -| HTTP V3 response DTO (reference feature) | `.strip()` drops unknown fields | additive | `referenceResourceDtoSchema` in `src/features/reference-feature/contracts/reference-schemas.ts` | +| HTTP V3 response DTO (reference feature) | `.strip()` drops unknown fields | additive | `referenceResourceDtoSchema` in the reference sample's contracts/reference-schemas.ts | | Realtime envelope | exact key set; unknown `eventType` is `MALFORMED_EVENT` | breaking | `decodeUnsafe` in `src/adapters/realtime/event-codec.ts` | | Browser RPC transport error code | closed vocabulary; unknown code is a protocol violation | breaking | `decodeTransportFailure` in `src/adapters/browser-rpc/browser-rpc-runtime.ts` | | Persisted client storage | versioned key; incompatible value discarded | use a new key version | `defineStorageKey` in `src/contracts/storage-keys.ts` | diff --git a/docs/manual/01-add-a-feature.md b/docs/manual/01-add-a-feature.md index 2b565262..18eb38e9 100644 --- a/docs/manual/01-add-a-feature.md +++ b/docs/manual/01-add-a-feature.md @@ -5,7 +5,7 @@ - ๋ผˆ๋Œ€๋Š” ์†์œผ๋กœ ๋งŒ๋“ค์ง€ ์•Š๋Š”๋‹ค. `corepack pnpm create:feature `๋กœ ๋งŒ๋“ ๋‹ค. - ๋ผˆ๋Œ€๋ฅผ ์‹ค์ œ ๊ธฐ๋Šฅ์œผ๋กœ ๋ฐ”๊พธ๋Š” ์ˆœ์„œ๊ฐ€ ์•„๋ž˜ 0~11๋‹จ๊ณ„๋‹ค. -์ฐธ์กฐ ๊ธฐ๋Šฅ(`src/features/reference-feature/`)์„ ๋ณต์‚ฌํ•ด ์ด๋ฆ„์„ ๋ฐ”๊พธ๋Š” ๋ฐฉ๋ฒ•์€ ์“ฐ์ง€ ์•Š๋Š”๋‹ค. +์ฐธ์กฐ ๊ธฐ๋Šฅ(src/features/reference-feature/)์„ ๋ณต์‚ฌํ•ด ์ด๋ฆ„์„ ๋ฐ”๊พธ๋Š” ๋ฐฉ๋ฒ•์€ ์“ฐ์ง€ ์•Š๋Š”๋‹ค. ๊ทธ ๋ฐฉ๋ฒ•์€ ์ ‘๋‘์–ด ์—†๋Š” ์ „์—ญ ID, ์ฐธ์กฐ ์ „์šฉ ๊ณ„์•ฝ ์ถœ์ฒ˜, ๊ธฐ๋Šฅ ๋ฐ– ํ…Œ์ŠคํŠธ ์˜์กด ๋•Œ๋ฌธ์— ์—ฌ๋Ÿฌ ๋ฒˆ ๋ง‰ํžŒ๋‹ค. ์ƒ์„ฑ ๋ช…๋ น์€ ์ด ๋ฌธ์ œ๋ฅผ ๋ฏธ๋ฆฌ ํ”ผํ•œ ํŒŒ์ผ์„ ์“ด๋‹ค. @@ -117,7 +117,7 @@ corepack pnpm create:feature invoice-feature - ๋ช…๋ น ์ž์ฒด๊ฐ€ ๊ฑฐ๋ถ€ํ•œ๋‹ค. ID ํ˜•์‹, ๊ธฐ์กด ๊ธฐ๋Šฅยทcontext์™€ ๊ฒน์นจ, ๋ผ์šฐํŠธยท๊ฒฝ๋กœยทchunkยท๋ฌธ๊ตฌ ํ‚ค ์ถฉ๋Œ, topic ์ถฉ๋Œ, ํŒจํ‚ค์ง€ ์‹ ์› ํ˜•์‹. - ์ƒ์„ฑ๊ธฐ๊ฐ€ ๊ฑฐ๋ถ€ํ•œ๋‹ค. ์„ ์–ธ ํ—ค๋”๊ฐ€ ๋ฆฌํ„ฐ๋Ÿด์ด ์•„๋‹˜, ์—†๋Š” context, ์˜ˆ์‚ฐ ์ดˆ๊ณผ. - ์ด๋•Œ ๋ช…๋ น์€ ๋งŒ๋“  ํŒŒ์ผ์„ ๋ชจ๋‘ ์ง€์šฐ๊ณ  `the feature index generator rejected the feature, nothing was kept:`๋กœ ๋๋‚œ๋‹ค. -- **๋ชป ์žก์Œ**: `--context reference-context`๋กœ ์ฐธ์กฐ context์— ๋„ฃ์œผ๋ฉด ์ฐธ์กฐ ๊ธฐ๋Šฅ ํ…Œ์ŠคํŠธ `tests/features/reference-feature/installed-context-routing.test.ts`๊ฐ€ ๊นจ์ง„๋‹ค. ๊ทธ ํ…Œ์ŠคํŠธ๋Š” ์ฐธ์กฐ context์˜ ๋ผ์šฐํŠธ ์ˆ˜๋ฅผ ์ •ํ™•ํžˆ ๋น„๊ตํ•œ๋‹ค. ์ฐธ์กฐ context์—๋Š” ๋„ฃ์ง€ ์•Š๋Š”๋‹ค. +- **๋ชป ์žก์Œ**: `--context reference-context`๋กœ ์ฐธ์กฐ context์— ๋„ฃ์œผ๋ฉด ์ฐธ์กฐ ๊ธฐ๋Šฅ ํ…Œ์ŠคํŠธ tests/features/reference-feature/installed-context-routing.test.ts๊ฐ€ ๊นจ์ง„๋‹ค. ๊ทธ ํ…Œ์ŠคํŠธ๋Š” ์ฐธ์กฐ context์˜ ๋ผ์šฐํŠธ ์ˆ˜๋ฅผ ์ •ํ™•ํžˆ ๋น„๊ตํ•œ๋‹ค. ์ฐธ์กฐ context์—๋Š” ๋„ฃ์ง€ ์•Š๋Š”๋‹ค. โ‘ฃ **์“ธ ์Šคํ‚ฌ**: `clean-architecture`, `codebase-design` @@ -137,7 +137,7 @@ corepack pnpm create:feature invoice-feature - ์žˆ์œผ๋ฉด `domain/.ts`์— ๋‘”๋‹ค. - ์ƒ์„ฑ ํ•จ์ˆ˜์—์„œ ๋ถˆ๋ณ€์‹์„ ๊ฒ€์‚ฌํ•˜๊ณ  `Object.freeze`๋กœ ๊ณ ์ •ํ•œ๋‹ค. - ์ด๋ฆ„์€ ์™€์ด์–ด ํ•„๋“œ๊ฐ€ ์•„๋‹ˆ๋ผ ์—…๋ฌด ์ด๋ฆ„์œผ๋กœ ์ง“๋Š”๋‹ค(์ฐธ์กฐ ๊ธฐ๋Šฅ์€ `name`์„ `displayName`์œผ๋กœ ๋ฐ”๊พผ๋‹ค). -- ์˜ˆ์ œ: `src/features/reference-feature/domain/` +- ์˜ˆ์ œ(์ฐธ์กฐ ๊ธฐ๋Šฅ): src/features/reference-feature/domain/ - ๊ธธ์ด ์ œํ•œ(์˜ˆ: ์ œ๋ชฉ 100์ž)์€ domain์ด ์•„๋‹ˆ๋ผ ๊ฒฝ๊ณ„ ๊ฒ€์ฆ์— ๋‘”๋‹ค. - ๊ฒฝ๊ณ„ ๊ฒ€์ฆ: ๊ฐ’์ด ์•ฑ์— ๋“ค์–ด์˜ค๊ฑฐ๋‚˜ ๋‚˜๊ฐ€๋Š” ์ž๋ฆฌ(์š”์ฒญยท์‘๋‹ต ์Šคํ‚ค๋งˆ, ํผ ์Šคํ‚ค๋งˆ)์—์„œ ํ•˜๋Š” ๊ฒ€์‚ฌ๋‹ค. - ์„œ๋ฒ„๊ฐ€ ์ •ํ•œ ์ œํ•œ์ด๋ฉด `contracts/-schemas.ts`์— ์ƒ์ˆ˜๋กœ ๋‘๊ณ  ์š”์ฒญ ์Šคํ‚ค๋งˆ์™€ ํผ ์Šคํ‚ค๋งˆ๊ฐ€ ๊ฐ™์€ ์ƒ์ˆ˜๋ฅผ ์“ด๋‹ค. ์ˆซ์ž๊ฐ€ ๋‘ ๊ณณ์—์„œ ๊ฐˆ๋ผ์ง€์ง€ ์•Š๋Š”๋‹ค. @@ -217,7 +217,7 @@ DTO์™€ problem details(`type`ยท`title`ยท`status`)๋ฅผ ๊ฐ์‹ธ์ง€ ์•Š๊ณ  ๋ณด๋‚ด๋Š” 2. problem ์Šคํ‚ค๋งˆ๋ฅผ problem details ๋ชจ์–‘์œผ๋กœ ๋ฐ”๊พผ๋‹ค. 3. `classifyProblem`์ด ๋ชจ๋“  ํŒ์ •์„ ์ •ํ•œ๋‹ค. ์‹คํ–‰๊ธฐ๊ฐ€ ๋จผ์ € ์ •ํ•˜๋Š” ํŒ์ •์€ ์—†๋‹ค. -์ฐธ์กฐ ๊ธฐ๋Šฅ(`src/features/reference-feature/`)์ด ์ด ๋ชจ์–‘์ด๋‹ค. ์ฐธ์กฐ ๊ธฐ๋Šฅ์˜ MSW ๋ณธ๋ฌธ๋„ DTO์™€ problem details๋‹ค. +์ฐธ์กฐ ๊ธฐ๋Šฅ(src/features/reference-feature/)์ด ์ด ๋ชจ์–‘์ด๋‹ค. ์ฐธ์กฐ ๊ธฐ๋Šฅ์˜ MSW ๋ณธ๋ฌธ๋„ DTO์™€ problem details๋‹ค. **์ž…๋ ฅ๊ณผ ์Šคํ‚ค๋งˆ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ** @@ -342,7 +342,7 @@ projectRequest: (input) => Object.freeze({ - ์ฐธ์กฐ ๊ธฐ๋Šฅ์€ ์ƒ์„ฑ operation์— ๋ชฉ๋ก route(`REFERENCE_RESOURCE_LIST`)๋ฅผ ์ ์—ˆ๋‹ค. ์‹ค์ œ๋กœ ๋ณด๋‚ด๋Š” ํ™”๋ฉด์€ ํผ route๋‹ค. ๋™์ž‘์€ ๊ฐ™๊ณ  ๊ธฐ๋ก์˜ ์ด๋ฆ„ํ‘œ๋งŒ ๋‹ค๋ฅด๋‹ค. ์ƒˆ ๊ธฐ๋Šฅ์€ ์œ„ ๊ธฐ์ค€์„ ๋”ฐ๋ฅธ๋‹ค. - `needs`์—๋Š” ์‹ค์ œ๋กœ ์“ฐ๋Š” ๊ฒƒ๋งŒ ์ ๋Š”๋‹ค. - ํ…œํ”Œ๋ฆฟ์ด ๋งŒ๋“ค์ง€ ์•Š๋Š” capability(์˜ˆ: `indexedDb`)๋Š” `src/bootstrap/product-composition.ts`์—์„œ ๋งŒ๋“ ๋‹ค. ์ œํ’ˆ์ด ์ƒˆ๋กœ ๋งŒ๋“œ๋Š” capability์˜ ํƒ€์ž…์€ `src/features/product-capabilities.ts`์— ์ ๋Š”๋‹ค. [03 ๋ฌธ์„œ](03-outside-feature-folder.md)๋ฅผ ๋ณธ๋‹ค. -- ๋ฌธ์ œ ์‘๋‹ต ๋งคํ•‘ ์˜ˆ์ œ: `src/features/reference-feature/adapters/reference-http-gateway.ts` +- ๋ฌธ์ œ ์‘๋‹ต ๋งคํ•‘ ์˜ˆ์ œ(์ฐธ์กฐ ๊ธฐ๋Šฅ): src/features/reference-feature/adapters/reference-http-gateway.ts โ‘ข **์žก๋Š” ๊ฒ€์‚ฌ / ๋ชป ์žก๋Š” ๊ฒƒ** @@ -385,8 +385,8 @@ projectRequest: (input) => Object.freeze({ โ‘ก **๊ธฐ์ค€** - ๊ฒฝ๋กœ๋Š” ๊ณ„์•ฝ์—๋งŒ ์ ๋Š”๋‹ค. ํŽ˜์ด์ง€์™€ ๋งํฌ๋Š” route ID์™€ `buildRouteUrl`๋กœ URL์„ ๋งŒ๋“ ๋‹ค. ๊ฒฝ๋กœ ๋ฌธ์ž์—ด์„ ํŽ˜์ด์ง€์— ๋‹ค์‹œ ์ ์ง€ ์•Š๋Š”๋‹ค. -- ํŒŒ๋ผ๋ฏธํ„ฐ๋‚˜ ๊ฒ€์ƒ‰๊ฐ’์ด ์žˆ๋Š” ๋ผ์šฐํŠธ๋Š” `context-routes.ts`์˜ handle์— `codecs`๋ฅผ ์‹ฃ๋Š”๋‹ค. ์˜ˆ์ œ: `src/features/reference-feature/context-routes.ts`. - - ๋งํฌ์šฉ URL ํ•จ์ˆ˜๋„ ๊ฐ™์€ codec์„ `buildRouteUrl`์˜ ์„ธ ๋ฒˆ์งธ ์ธ์ž๋กœ ๋„˜๊ธด๋‹ค. ์ƒ์„ฑ๋œ ํŒ์€ ํŒŒ๋ผ๋ฏธํ„ฐ๊ฐ€ ์—†์–ด์„œ ๋„˜๊ธฐ์ง€ ์•Š๋Š”๋‹ค. ์•ˆ ๋„˜๊ธฐ๋ฉด `Unregistered route codec: `๋กœ throwํ•œ๋‹ค. codec ID๋Š” ๊ณ„์•ฝ `routeRuntimeContracts`์˜ `paramsCodec`ยท`searchCodec` ๊ฐ’์ด๋‹ค. ์˜ˆ์ œ: `src/features/reference-feature/presentation/reference-routes.ts`. +- ํŒŒ๋ผ๋ฏธํ„ฐ๋‚˜ ๊ฒ€์ƒ‰๊ฐ’์ด ์žˆ๋Š” ๋ผ์šฐํŠธ๋Š” `context-routes.ts`์˜ handle์— `codecs`๋ฅผ ์‹ฃ๋Š”๋‹ค. ์˜ˆ์ œ(์ฐธ์กฐ ๊ธฐ๋Šฅ): src/features/reference-feature/context-routes.ts. + - ๋งํฌ์šฉ URL ํ•จ์ˆ˜๋„ ๊ฐ™์€ codec์„ `buildRouteUrl`์˜ ์„ธ ๋ฒˆ์งธ ์ธ์ž๋กœ ๋„˜๊ธด๋‹ค. ์ƒ์„ฑ๋œ ํŒ์€ ํŒŒ๋ผ๋ฏธํ„ฐ๊ฐ€ ์—†์–ด์„œ ๋„˜๊ธฐ์ง€ ์•Š๋Š”๋‹ค. ์•ˆ ๋„˜๊ธฐ๋ฉด `Unregistered route codec: `๋กœ throwํ•œ๋‹ค. codec ID๋Š” ๊ณ„์•ฝ `routeRuntimeContracts`์˜ `paramsCodec`ยท`searchCodec` ๊ฐ’์ด๋‹ค. ์˜ˆ์ œ(์ฐธ์กฐ ๊ธฐ๋Šฅ): src/features/reference-feature/presentation/reference-routes.ts. - ์ƒ์„ธ ๊ฒฝ๋กœ๋Š” ๋ชฉ๋ก ๊ฒฝ๋กœ ๋’ค์— `/items/:`์„ ๋ถ™์ธ๋‹ค. ์˜ˆ: `/notice/items/:noticeId`. `/notice/:noticeId`๋กœ ๋‘์ง€ ์•Š๋Š”๋‹ค. - ๋ผ์šฐํ„ฐ(React Router)๋Š” ๊ฐ™์€ ์ž๋ฆฌ์—์„œ ์ •์  ๊ฒฝ๋กœ๋ฅผ ๋จผ์ € ๊ณ ๋ฅธ๋‹ค. ์ž‘์„ฑ ํผ `/notice/new`๊ฐ€ ์žˆ์œผ๋ฉด id๊ฐ€ `new`์ธ ๊ณต์ง€๋Š” `/notice/:noticeId`๋กœ ์—ด ์ˆ˜ ์—†๋‹ค. - `items/`๋ฅผ ๋ผ์šฐ๋ฉด ์ •์  ๊ฒฝ๋กœ์™€ ๊ฒน์น˜์ง€ ์•Š๋Š”๋‹ค. ์ฐธ์กฐ ๊ธฐ๋Šฅ๋„ ์ด๋ ‡๊ฒŒ ํ•œ๋‹ค(`/examples/reference-resources/items/:resourceId`). @@ -436,7 +436,7 @@ projectRequest: (input) => Object.freeze({ - ํ˜•์‹: `qinv.` + ์†Œ๋ฌธ์žยท์ˆซ์ž 26์ž. `scripts/create-feature.ts`์˜ `randomTopicSuffix`๊ฐ€ ์“ฐ๋Š” ๋ฐฉ์‹์ด๋‹ค. - `measureResult`์—์„œ `JSON.stringify`๋ฅผ ์“ฐ์ง€ ์•Š๋Š”๋‹ค. ๋ฌธ์ž์—ด ๋ฐ”์ดํŠธ์™€ ํ•ญ๋ชฉ๋‹น ๊ณ ์ • ํฌ๊ธฐ๋กœ ์–ด๋ฆผํ•œ๋‹ค(์ƒ์„ฑ๋œ `measureItems` ์ฐธ๊ณ ). - `KEYED` ์“ฐ๊ธฐ๋Š” `requiresIdempotencyKey: true`, `duplicatePolicy: "REJECT_WHILE_ACTIVE"`, `invalidate: [topic]`์„ ์“ด๋‹ค. - - ์˜ˆ์ œ: `src/features/reference-feature/presentation/use-reference-feature.ts`์˜ ์ƒ์„ฑ ๋ฎคํ…Œ์ด์…˜ ์ •์ฑ…. + - ์˜ˆ์ œ(์ฐธ์กฐ ๊ธฐ๋Šฅ): src/features/reference-feature/presentation/use-reference-feature.ts์˜ ์ƒ์„ฑ ๋ฎคํ…Œ์ด์…˜ ์ •์ฑ…. โ‘ข **์žก๋Š” ๊ฒ€์‚ฌ / ๋ชป ์žก๋Š” ๊ฒƒ** @@ -465,7 +465,7 @@ projectRequest: (input) => Object.freeze({ - ํ™”๋ฉด ๋ฌธ๊ตฌ๋Š” ๋ชจ๋‘ catalog์—์„œ ๊ฐ€์ ธ์˜จ๋‹ค(`message(key)`). - ๋งํฌ๋Š” 6๋‹จ๊ณ„์˜ URL ํ•จ์ˆ˜๋กœ ๋งŒ๋“ ๋‹ค. -- ๊ฒฐ๊ณผ ๋ถˆ๋ช… ํ™”๋ฉด ์˜ˆ์ œ: `src/features/reference-feature/presentation/reference-resource-form-page.tsx` +- ๊ฒฐ๊ณผ ๋ถˆ๋ช… ํ™”๋ฉด ์˜ˆ์ œ(์ฐธ์กฐ ๊ธฐ๋Šฅ): src/features/reference-feature/presentation/reference-resource-form-page.tsx โ‘ข **์žก๋Š” ๊ฒ€์‚ฌ / ๋ชป ์žก๋Š” ๊ฒƒ** @@ -561,7 +561,7 @@ projectRequest: (input) => Object.freeze({ expect(await posts[0]!.json()).toEqual({ title: "์ƒˆ ๊ณต์ง€", body: "๋ณธ๋ฌธ์ž…๋‹ˆ๋‹ค." }); ``` - - ํ•ธ๋“ค๋Ÿฌ๋ฅผ ์ง์ ‘ ์จ์„œ ์š”์ฒญ์„ ๋ชจ์œผ๋Š” ๋ฐฉ๋ฒ•๋„ ์žˆ๋‹ค. ์˜ˆ์ œ: `tests/features/reference-feature/reference-production-vertical.test.tsx`์˜ 504 ์žฌ์ „์†ก ํ…Œ์ŠคํŠธ. + - ํ•ธ๋“ค๋Ÿฌ๋ฅผ ์ง์ ‘ ์จ์„œ ์š”์ฒญ์„ ๋ชจ์œผ๋Š” ๋ฐฉ๋ฒ•๋„ ์žˆ๋‹ค. ์˜ˆ์ œ(์ฐธ์กฐ ๊ธฐ๋Šฅ): tests/features/reference-feature/reference-production-vertical.test.tsx์˜ 504 ์žฌ์ „์†ก ํ…Œ์ŠคํŠธ. - ๋น ๋ฅด๊ฒŒ ๋Œ๋ฆฌ๊ธฐ: `node scripts/run-vitest.ts run tests/features/` - CI์—์„œ๋Š” `test:coverage`(FE-GATE-005)๊ฐ€ `tests/features`๋ฅผ ๋ˆ๋‹ค. `test:unit`์€ `tests/unit`๋งŒ ๋ˆ๋‹ค. diff --git a/docs/manual/02-decision-tables.md b/docs/manual/02-decision-tables.md index 63f21efb..a471a40c 100644 --- a/docs/manual/02-decision-tables.md +++ b/docs/manual/02-decision-tables.md @@ -177,7 +177,7 @@ context๋Š” URL ์•ž๋ถ€๋ถ„ ํ•˜๋‚˜(๋ผ์šฐํŠธ ๋ฃจํŠธ)๋ฅผ ๊ฐ€์ง„๋‹ค. ๊ทธ ์•„๋ž˜ ๊ธฐ **์ •๋ณธ**: ์–ด๋–ค statusยทcode๊ฐ€ "์ ์šฉ ์•ˆ ๋จ"์ธ์ง€๋Š” `clean-architecture-backend-template/docs/web/http-contract.md` ยง2๋‹ค. -**์–ด๋””์— ์ ๋‚˜**: `contracts/-contract-contribution.ts`์˜ `commandEffect`(`classifyProblem`, `classifyStatus`, Envelope operation์ด๋ฉด `refusedBeforeWrite`). ์˜ˆ์ œ: `src/features/reference-feature/contracts/reference-feature-contract-contribution.ts`์˜ `CREATE_EFFECT`. +**์–ด๋””์— ์ ๋‚˜**: `contracts/-contract-contribution.ts`์˜ `commandEffect`(`classifyProblem`, `classifyStatus`, Envelope operation์ด๋ฉด `refusedBeforeWrite`). ์˜ˆ์ œ(์ฐธ์กฐ ๊ธฐ๋Šฅ): src/features/reference-feature/contracts/reference-feature-contract-contribution.ts์˜ `CREATE_EFFECT`. **ํ‹€๋ฆฌ๋ฉด** diff --git a/docs/manual/README.md b/docs/manual/README.md index c252c66a..3b515366 100644 --- a/docs/manual/README.md +++ b/docs/manual/README.md @@ -3,7 +3,7 @@ ์ด ํด๋”๋Š” ์ด ํ…œํ”Œ๋ฆฟ์œผ๋กœ ๋งŒ๋“  ํ”„๋กœ์ ํŠธ์— **์ƒˆ ๊ธฐ๋Šฅ ํ•˜๋‚˜๋ฅผ ์ถ”๊ฐ€ํ•˜๋Š” ์ ˆ์ฐจ**๋ฅผ ์ ๋Š”๋‹ค. ๊ธฐ๋Šฅ ํ•˜๋‚˜๋Š” ํ™”๋ฉด(๋ผ์šฐํŠธ์™€ ํŽ˜์ด์ง€)๊ณผ ๊ทธ ํ™”๋ฉด์ด ์“ฐ๋Š” API ํ˜ธ์ถœ์„ ํ•จ๊ป˜ ๋œปํ•œ๋‹ค. -์‹œ์ž‘์€ `corepack pnpm create:feature `๋‹ค. ์ด ๋ช…๋ น์ด ๋ชจ๋“  merge ๊ฒŒ์ดํŠธ๋ฅผ ํ†ต๊ณผํ•˜๋Š” ๊ฐ€์žฅ ์ž‘์€ ๊ธฐ๋Šฅ์„ ๋งŒ๋“ ๋‹ค. +์‹œ์ž‘์€ `corepack pnpm create:feature `๋‹ค. ์ด ๋ช…๋ น์ด ๋ชจ๋“  merge ๊ฒŒ์ดํŠธ๋ฅผ ํ†ต๊ณผํ•˜๋„๋ก ๋งŒ๋“  ๊ฐ€์žฅ ์ž‘์€ ๊ธฐ๋Šฅ์„ ๋งŒ๋“ ๋‹ค(๋ธŒ๋ผ์šฐ์ € ๊ฒŒ์ดํŠธ๋Š” ๋“œ๋ฆด ๋ฐ–, `docs/manual/reference/create-feature.md`). ๊ทธ ๋’ค ์ด ๋งค๋‰ด์–ผ์˜ ๋‹จ๊ณ„๋Œ€๋กœ ๋ผˆ๋Œ€๋ฅผ ์‹ค์ œ ๊ธฐ๋Šฅ์œผ๋กœ ๋ฐ”๊พผ๋‹ค. ## ๋ˆ„๊ฐ€ ์ฝ๋Š”๊ฐ€ diff --git a/docs/manual/reference/create-feature.md b/docs/manual/reference/create-feature.md index ee822ffd..07966292 100644 --- a/docs/manual/reference/create-feature.md +++ b/docs/manual/reference/create-feature.md @@ -1,6 +1,7 @@ # create:feature ์ฐธ์กฐ -๋ชจ๋“  merge ๊ฒŒ์ดํŠธ๋ฅผ ํ†ต๊ณผํ•˜๋Š” ๊ฐ€์žฅ ์ž‘์€ ๊ธฐ๋Šฅ์„ ๋งŒ๋“œ๋Š” ๋ช…๋ น์ด๋‹ค. ์ •๋ณธ์€ `scripts/create-feature.ts`๋‹ค. +๋ชจ๋“  merge ๊ฒŒ์ดํŠธ๋ฅผ ํ†ต๊ณผํ•˜๋„๋ก ๋งŒ๋“  ๊ฐ€์žฅ ์ž‘์€ ๊ธฐ๋Šฅ์„ ๋งŒ๋“œ๋Š” ๋ช…๋ น์ด๋‹ค. ์ •๋ณธ์€ `scripts/create-feature.ts`๋‹ค. +`test:feature-scaffold`๊ฐ€ ์ƒ์„ฑํ•œ ๊ธฐ๋Šฅ์œผ๋กœ `config/ci/gates.json`์˜ merge ๋‹จ๊ณ„ ๋ช…๋ น์„ ๋Œ๋ ค ํ™•์ธํ•œ๋‹ค. ๋ธŒ๋ผ์šฐ์ € ๊ฒŒ์ดํŠธ(FE-GATE-008ยท009์˜ ๋ธŒ๋ผ์šฐ์ € ๋ช…๋ น)์™€ `test:system`์€ ๋นผ๊ณ  ๋ˆ๋‹ค. ๋บ€ ๋ช…๋ น๊ณผ ์ด์œ ๋Š” `scripts/lib/feature-scaffold-drill.ts`์— ์žˆ๋‹ค. ํ…œํ”Œ๋ฆฟ ๋ฌธ์ž์—ด์ด ๊ทธ ํŒŒ์ผ ์•ˆ์— ์žˆ๊ณ , ์ฐธ์กฐ ๊ธฐ๋Šฅ์„ importํ•˜์ง€ ์•Š๋Š”๋‹ค. ๊ทธ๋ž˜์„œ ์ฐธ์กฐ ๊ธฐ๋Šฅ์„ ์ง€์šด ํ”„๋กœ์ ํŠธ์—์„œ๋„ ๋™์ž‘ํ•œ๋‹ค. ## ์‚ฌ์šฉ๋ฒ• @@ -98,7 +99,7 @@ create:feature: in (new context), route at Next: 1. Before a release, have a person review and sign artifacts/tests/a11y-manual/.md (FE-GATE-028). ... - 2. Run the merge gates: corepack pnpm check:types, lint, ... + 2. Run the merge gates: corepack pnpm ci:gate -- FE-GATE- for each gate of the merge stage ... The feature's own tests: node scripts/run-vitest.ts run tests/features/ ... The registry baseline does not change: ... ``` @@ -134,6 +135,6 @@ corepack pnpm generate:feature-index ## ์•Œ๋ ค์ง„ ํ•œ๊ณ„ -- `--context reference-context`๋กœ ์ฐธ์กฐ context์— ๋„ฃ์œผ๋ฉด `tests/features/reference-feature/installed-context-routing.test.ts`๊ฐ€ ๊นจ์ง„๋‹ค. ๊ทธ ํ…Œ์ŠคํŠธ๋Š” ์ฐธ์กฐ context์˜ ๋ผ์šฐํŠธ ์ˆ˜๋ฅผ ์ •ํ™•ํžˆ ๋น„๊ตํ•œ๋‹ค. +- `--context reference-context`๋กœ ์ฐธ์กฐ context์— ๋„ฃ์œผ๋ฉด ์ฐธ์กฐ ๊ธฐ๋Šฅ ํ…Œ์ŠคํŠธ tests/features/reference-feature/installed-context-routing.test.ts๊ฐ€ ๊นจ์ง„๋‹ค. ๊ทธ ํ…Œ์ŠคํŠธ๋Š” ์ฐธ์กฐ context์˜ ๋ผ์šฐํŠธ ์ˆ˜๋ฅผ ์ •ํ™•ํžˆ ๋น„๊ตํ•œ๋‹ค. - ๋“œ๋ฆด์€ `check:bundle`(FE-GATE-012), ๋ธŒ๋ผ์šฐ์ € ํ…Œ์ŠคํŠธ(`test:a11y`, `test:e2e`)๋ฅผ ๋Œ๋ฆฌ์ง€ ์•Š๋Š”๋‹ค. - ์ƒˆ context๋Š” ์•ฑ์ด ํ•˜๋‚˜์ผ ๋•Œ๋งŒ ๋งŒ๋“ ๋‹ค. ์•ฑ์ด ์—ฌ๋Ÿฟ์ด๋ฉด `--context`๋กœ ๊ธฐ์กด context๋ฅผ ๊ณ ๋ฅธ๋‹ค. diff --git a/docs/manual/reference/patterns.md b/docs/manual/reference/patterns.md index a584972c..4a5800bf 100644 --- a/docs/manual/reference/patterns.md +++ b/docs/manual/reference/patterns.md @@ -3,7 +3,7 @@ ๊ธฐ๋Šฅ์„ ๋งŒ๋“ค ๋•Œ ์“ฐ๋Š” ํŒจํ„ด๊ณผ, ๊ทธ ํŒจํ„ด์˜ ์ •์˜์™€ ์˜ˆ์ œ๊ฐ€ ์–ด๋”” ์žˆ๋Š”์ง€ ์ ๋Š”๋‹ค. - **์ •์˜**: ํ”Œ๋žซํผ(๊ธฐ๋Šฅ ๋ฐ–)์—์„œ ํŒจํ„ด์„ ์ œ๊ณตํ•˜๋Š” ํŒŒ์ผ. -- **์˜ˆ์ œ**: ๋ณต์‚ฌํ•ด ๋ณผ ์ˆ˜ ์žˆ๋Š” ๊ธฐ๋Šฅ ์ฝ”๋“œ. `์ƒ์„ฑ ๋ผˆ๋Œ€`๋Š” `create:feature`๊ฐ€ ๋งŒ๋“œ๋Š” ์ฝ”๋“œ๋‹ค. `์ฐธ์กฐ ๊ธฐ๋Šฅ`์€ `src/features/reference-feature/`๋‹ค. +- **์˜ˆ์ œ**: ๋ณต์‚ฌํ•ด ๋ณผ ์ˆ˜ ์žˆ๋Š” ๊ธฐ๋Šฅ ์ฝ”๋“œ. `์ƒ์„ฑ ๋ผˆ๋Œ€`๋Š” `create:feature`๊ฐ€ ๋งŒ๋“œ๋Š” ์ฝ”๋“œ๋‹ค. `์ฐธ์กฐ ๊ธฐ๋Šฅ`์€ src/features/reference-feature/๋‹ค. ์ฐธ์กฐ ๊ธฐ๋Šฅ์€ ์ง€์šธ ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ ๊ทธ ๊ฒฝ๋กœ๋Š” ๋ฐฑํ‹ฑ ์—†์ด ์ ๋Š”๋‹ค. ๋ฐฑํ‹ฑ ๊ฒฝ๋กœ๋Š” ๋ฌธ์„œ ๊ฒ€์‚ฌ(`verify:documentation`)๊ฐ€ ์กด์žฌ๋ฅผ ํ™•์ธํ•œ๋‹ค. - ์˜ˆ์ œ๊ฐ€ ์—†๋Š” ํŒจํ„ด์€ **์—†์Œ**์ด๋ผ๊ณ  ์ ์—ˆ๋‹ค. ๊ทธ ํŒจํ„ด์€ ์ •์˜๋ฅผ ์ฝ๊ณ  ์ง์ ‘ ์“ด๋‹ค. ์ฐธ์กฐ ๊ธฐ๋Šฅ์€ ์˜ˆ์ œ์ผ ๋ฟ์ด๋‹ค. ๋ณต์‚ฌํ•ด ์ด๋ฆ„์„ ๋ฐ”๊พธ์ง€ ์•Š๋Š”๋‹ค. ๋ชจ์–‘์„ ๋ณด๊ณ  ์ƒ์„ฑ ๋ผˆ๋Œ€์— ์˜ฎ๊ธด๋‹ค. @@ -13,12 +13,12 @@ | ํŒจํ„ด | ์ •์˜ | ์˜ˆ์ œ | ๊ฒ€์‚ฌ | |---|---|---|---| | ๊ธฐ๋Šฅ ๋ชจ๋“ˆ ๋“ฑ๋ก | `src/features/feature-module.ts` (`defineFeatureModule`, `defineFeatureRuntime`), ์ƒ์„ฑ๊ธฐ | ์ƒ์„ฑ ๋ผˆ๋Œ€ `feature-module.ts`, `feature-runtime.ts` | ์ƒ์„ฑ๊ธฐ, ๊ธฐ๋Šฅ ID์™€ ๊ณ„์•ฝ `featureId` ์ผ์น˜ | -| context ์†Œ์† ์„ ์–ธ | `src/contexts/bounded-context-module.ts` | `src/contexts/reference-context/context-module.ts` | ์ƒ์„ฑ๊ธฐ(์—†๋Š” context, ์˜ˆ์‚ฐ), ์•ฑ ๋ชจ๋“ˆ(๋ฃจํŠธ ๋ฐ– ๋ผ์šฐํŠธ) | +| context ์†Œ์† ์„ ์–ธ | `src/contexts/bounded-context-module.ts` | ์ฐธ์กฐ ๊ธฐ๋Šฅ์˜ src/contexts/reference-context/context-module.ts | ์ƒ์„ฑ๊ธฐ(์—†๋Š” context, ์˜ˆ์‚ฐ), ์•ฑ ๋ชจ๋“ˆ(๋ฃจํŠธ ๋ฐ– ๋ผ์šฐํŠธ) | | context ์ „์šฉ ๋ ˆ์ด์•„์›ƒ | `docs/architecture/starter-experience.md` "Product home and layouts" | `tests/helpers/fixture-layout-product.tsx` (ํ…Œ์ŠคํŠธ fixture) | `tests/component/context-layouts.test.tsx` | | ์•ฑ ํ™ˆ ๋Œ€์‹ ํ•˜๊ธฐ | `src/contracts/routes.ts`์˜ `FEATURE_REPLACEABLE_PLATFORM_ROUTE_IDS` | ์—†์Œ (๊ธฐ๋Šฅ ์˜ˆ์ œ) | ์กฐ๋ฆฝ (๋‘ ๊ธฐ๋Šฅ์ด `APP_HOME`์„ ์„ ์–ธํ•˜๋ฉด ์‹คํŒจ) | | ์กฐ๋ฆฝ ๊ธฐ์—ฌ(`needs`) | `src/features/feature-adapter-contribution.ts` | ์ƒ์„ฑ ๋ผˆ๋Œ€ `adapters/create--feature-input.ts` | ์กฐ๋ฆฝ (์—†๋Š” capability, ๋‹ค๋ฅธ ๊ธฐ๋Šฅ์˜ input) | | ์ œํ’ˆ capability | `src/features/product-capabilities.ts`(ํƒ€์ž…), `src/bootstrap/product-composition.ts`(๊ฐ’), `src/bootstrap/product-composition-contract.ts` | `recipes/frontend-capabilities/indexeddb-feature-capability.ts` | `check:types` | -| ๊ธฐ๋Šฅ ๋„๊ธฐ | `config/runtime/.json`์˜ `FEATURE_OVERRIDES` | `config/runtime/local.json` | `tests/component/product-feature-switch.test.tsx` | +| ๊ธฐ๋Šฅ ๋„๊ธฐ | `config/runtime/.json`์˜ `FEATURE_OVERRIDES` | `config/runtime/local.json` | ์ฐธ์กฐ ๊ธฐ๋Šฅ์˜ tests/component/product-feature-switch.test.tsx | ## ๋ผ์šฐํŠธ diff --git a/docs/operations/adapter-remediation-ledger.md b/docs/operations/adapter-remediation-ledger.md index 9f20bab4..78819d06 100644 --- a/docs/operations/adapter-remediation-ledger.md +++ b/docs/operations/adapter-remediation-ledger.md @@ -88,9 +88,9 @@ Rollout state starts at `NOT_STARTED`; documented-unimplemented items start at | N-03 | Live V3 path | `corepack pnpm exec vitest run tests/unit/http-execution-v3.test.ts -t "retry-time fence"` | `fix: preserve command effect certainty across retries` | `FIXED_NOT_RELEASED` | command effect verdict regression | Red reproduced `SCOPE_FENCED` with `NOT_STARTED` after one dispatched attempt โ†’ green `MAYBE_APPLIED`; lattice table 9/9; `check:types` PASS; `lint` PASS | | N-04 | Live composition teardown | `corepack pnpm exec vitest run tests/unit/telemetry.test.ts tests/unit/runtime-adapters.test.ts` | `fix: terminate telemetry work on disposal` | `FIXED_NOT_RELEASED` | telemetry delivery loss after teardown change | Red 10 failed (5 lifecycle + 5 capacity) โ†’ green 34/34; `check:diagnostics` PASS; `check:types` PASS; `check:architecture` PASS; `lint` PASS | | N-05 | Rollout blocker (sidecar not composed) | `corepack pnpm exec vitest run tests/unit/conditional-validator-store.test.ts` | `fix: harden bounded state sidecars` | `FIXED_NOT_RELEASED` | persisted validator key incompatibility | Red collision case (two valid bindings sharing one delimiter-joined key) โ†’ green; key is now a bounded validated tuple encoded with `JSON.stringify` | -| N-06 | Legacy V2 rollback seam | `corepack pnpm exec vitest run tests/integration/http-client.test.ts` | `fix: harden the legacy HTTP rollback path` | `FIXED_NOT_RELEASED` | legacy keyed command rejection spike | Red 4 invalid-key cases โ†’ green; rejection happens before credentials and fetch (0 credential calls, 0 fetches) | -| N-07 | Legacy V2 rollback seam | `corepack pnpm exec vitest run tests/integration/http-client.test.ts tests/integration/auth-recovery.test.ts` | `fix: harden the legacy HTTP rollback path` | `FIXED_NOT_RELEASED` | legacy credential timeout regression | Red never-settling owner โ†’ green; credential wait races the existing attempt controller so no extra timer is added; ownership maps to REQUEST_TIMEOUT / REQUEST_ABORTED / AUTH_INTEGRATION_FAILURE with zero fetches | -| N-08 | Legacy V2 rollback seam | `corepack pnpm exec vitest run tests/unit/bounded-json-compatibility.test.ts` | `fix: harden the legacy HTTP rollback path` | `FIXED_NOT_RELEASED` | legacy JSON failure-code drift | Green 7/7 including throwing cancel/releaseLock; `readBoundedJson` now delegates to `bounded-body-reader` with the legacy codes preserved | +| N-06 | Legacy V2 rollback seam | The V2 client test tests/integration/http-client.test.ts (deleted with the V2 client on 2026-11-03) | `fix: harden the legacy HTTP rollback path` | `FIXED_NOT_RELEASED` | legacy keyed command rejection spike | Red 4 invalid-key cases โ†’ green; rejection happens before credentials and fetch (0 credential calls, 0 fetches) | +| N-07 | Legacy V2 rollback seam | The V2 client tests tests/integration/http-client.test.ts and tests/integration/auth-recovery.test.ts (deleted with the V2 client on 2026-11-03) | `fix: harden the legacy HTTP rollback path` | `FIXED_NOT_RELEASED` | legacy credential timeout regression | Red never-settling owner โ†’ green; credential wait races the existing attempt controller so no extra timer is added; ownership maps to REQUEST_TIMEOUT / REQUEST_ABORTED / AUTH_INTEGRATION_FAILURE with zero fetches | +| N-08 | Legacy V2 rollback seam | The V2 bounded JSON test tests/unit/bounded-json-compatibility.test.ts (deleted with the V2 client on 2026-11-03) | `fix: harden the legacy HTTP rollback path` | `FIXED_NOT_RELEASED` | legacy JSON failure-code drift | Green 7/7 including throwing cancel/releaseLock; `readBoundedJson` now delegates to `bounded-body-reader` with the legacy codes preserved | | N-09 | Live cross-context host | `corepack pnpm exec vitest run tests/unit/cross-tab-invalidation.test.ts` | `fix: harden bounded state sidecars` | `FIXED_NOT_RELEASED` | cross-tab invalidation drop | Red foreign-area pulse accepted โ†’ green 13/13; localStorage captured once and `StorageEvent.storageArea` compared by object identity; pulse key registered as `CACHE_INVALIDATION_PULSE`; `check:registries` PASS | | N-10 | Cursor runtime `AVAILABLE_NOT_COMPOSED` | `corepack pnpm exec vitest run tests/unit/cursor-pagination-runtime.test.ts` | `fix: harden bounded state sidecars` | `FIXED_NOT_RELEASED` | pagination abort semantics change | Red never-settling loader โ†’ green `PAGINATION_ABORTED` with the late page ignored | | N-11 | Live composition | `corepack pnpm exec vitest run tests/unit/telemetry.test.ts -t capacity` | `fix: terminate telemetry work on disposal` | `FIXED_NOT_RELEASED` | capacity rejection on valid composition | Red 5/5 capacity cases โ†’ green; ceilings documented in VD-07 ยง7-4 | @@ -194,7 +194,7 @@ Captured after every correctness task landed. | `git diff --check` | 0 | clean | | `corepack pnpm test:component` | 0 | 126 passed | | `corepack pnpm test:integration` | 0 | 52 passed | -| `corepack pnpm test:reference-feature` | 0 | 26 passed | +| test:reference-feature (the reference sample's script) | 0 | 26 passed | | `corepack pnpm test:recipes` | 0 | 17 passed | | `corepack pnpm test:unit` | 1 | 1585 passed / 19 failed tests; the 19 are the unchanged pre-existing `ci-artifact-contract` sandbox failures | | `corepack pnpm check:registries` | 0 | 11 registries PASS | @@ -340,13 +340,13 @@ Run on the landed tree. Only what actually passed is claimed as passing. | `tests/unit` + `tests/integration`, no exclusions | โ€” | 1643 passed / 1747; the 104 failures are the four environmental files below | | `corepack pnpm test:component` | 0 | 126 passed | | `corepack pnpm test:recipes` | 0 | 17 passed | -| `corepack pnpm test:reference-feature` | 0 | 26 passed | +| test:reference-feature (the reference sample's script) | 0 | 26 passed | ### Environmental failures, not claimed as green | Gate | Status | Attribution | | --- | --- | --- | -| `tests/unit/ci-workflow-generation.test.ts` | 82 failed / 325 passed | Identical on the pre-change baseline (`git stash` comparison). The subprocess gates it spawns cannot run in this sandbox. | +| tests/unit/ci-workflow-generation.test.ts | 82 failed / 325 passed | Identical on the pre-change baseline (`git stash` comparison). The subprocess gates it spawns cannot run in this sandbox. | | `tests/system/ci-runner/ci-artifact-contract.test.ts` | fails | Unchanged pre-existing sandbox, cgroup and `/tmp` permission behaviour. | | `tests/unit/security-followup.test.ts`, `tests/integration/provider-guardian-transaction.test.ts`, `tests/unit/risk-coverage.test.ts` | flaky under full-suite load | Historical baseline result. All three passed in a fresh process (78 passed together). | @@ -390,12 +390,12 @@ files above plus the two flaky-under-load ones: | File | Failed | Attribution | | --- | ---: | --- | -| `tests/unit/ci-workflow-generation.test.ts` | 82 | Identical on the pre-change baseline (`git stash` comparison). Its subprocess gates cannot run in this sandbox. | +| tests/unit/ci-workflow-generation.test.ts | 82 | Identical on the pre-change baseline (`git stash` comparison). Its subprocess gates cannot run in this sandbox. | | `tests/system/ci-runner/ci-artifact-contract.test.ts` | 19 | Unchanged pre-existing sandbox, cgroup and `/tmp` permission behaviour. | | `tests/unit/security-followup.test.ts` | 2 | Passes in isolation. | | `tests/integration/provider-guardian-transaction.test.ts` | 1 | Historical baseline: passed in isolation; current suite is classified as process integration. | -1619 passed / 1723 total, and `tests/unit/removal-fixture.test.ts`, +1619 passed / 1723 total, and tests/unit/removal-fixture.test.ts, `tests/unit/supply-chain.test.ts` and `tests/integration/security-followup-archive.test.ts` โ€” the three that had to be excluded before โ€” now pass in the full run. diff --git a/docs/operations/performance-evidence.md b/docs/operations/performance-evidence.md index 6bf1c888..10371362 100644 --- a/docs/operations/performance-evidence.md +++ b/docs/operations/performance-evidence.md @@ -22,7 +22,7 @@ Performance evidence is deliberately split by measurement context: | ์ดˆ๊ธฐ JS ์˜ˆ์‚ฐ | 204,800 gzip bytes(200 KiB) | | ํ…œํ”Œ๋ฆฟ ๊ธฐ์ค€์„ (2026-11-01, ์ปค๋ฐ‹ `298201f`) | 202,509~202,522 gzip bytes, 16๊ฐœ ํŒŒ์ผ. local ํ”„๋กœํ•„, `VITE_BUILD_ID`๊ฐ€ `local-build`์ผ ๋•Œ์™€ CI ๋ชจ์–‘(`gitea--`)์ผ ๋•Œ๋‹ค. ๋นŒ๋“œ ID๊ฐ€ ๋ฒˆ๋“ค์— ๋“ค์–ด๊ฐ€๋ฏ€๋กœ ๋นŒ๋“œ๋งˆ๋‹ค ์ˆ˜์‹ญ~์ˆ˜๋ฐฑ ๋ฐ”์ดํŠธ ๋‹ค๋ฅด๋‹ค | | ์—ฌ์œ  | ์•ฝ 2,280 bytes(1.1%) | -| ๊ธฐ๋Šฅ ํ•˜๋‚˜๋ฅผ ๋”ํ•  ๋•Œ | ์ฐธ์กฐ ๊ธฐ๋Šฅ ๋ชจ์–‘ ๋ณต์‚ฌ๋ณธ ํ•˜๋‚˜์— ์•ฝ +650~750 bytes(`298201f` ์ธก์ •, ์ƒํ•œ์€ `tests/unit/feature-shape-growth.test.ts`์˜ 1 KiB). ๊ธฐ๋Šฅ ์‹คํ–‰๋ถ€(`feature-runtime.ts`)๋Š” ๋ผ์šฐํŠธ์— ๋“ค์–ด๊ฐˆ ๋•Œ ๋ฐ›๋Š” lazy chunk๋‹ค | +| ๊ธฐ๋Šฅ ํ•˜๋‚˜๋ฅผ ๋”ํ•  ๋•Œ | ์ฐธ์กฐ ๊ธฐ๋Šฅ ๋ชจ์–‘ ๋ณต์‚ฌ๋ณธ ํ•˜๋‚˜์— ์•ฝ +650~750 bytes(`298201f` ์ธก์ •, ์ƒํ•œ์€ ์ฐธ์กฐ ๊ธฐ๋Šฅ๊ณผ ํ•จ๊ป˜ ์ง€์›Œ์ง€๋Š” tests/unit/feature-shape-growth.test.ts์˜ 1 KiB). ๊ธฐ๋Šฅ ์‹คํ–‰๋ถ€(`feature-runtime.ts`)๋Š” ๋ผ์šฐํŠธ์— ๋“ค์–ด๊ฐˆ ๋•Œ ๋ฐ›๋Š” lazy chunk๋‹ค | | lazy chunk ์˜ˆ์‚ฐ | ํŒŒ์ผ๋งˆ๋‹ค 122,880 gzip bytes(120 KiB). ๊ธฐ์ค€์„ ์˜ lazy JS๋Š” 17๊ฐœ, ํ•ฉ๊ณ„ 28,204 bytes์ด๊ณ  ๊ฐ€์žฅ ํฐ ๊ฒƒ์€ `use-reference-feature` 8,386 bytes๋‹ค | ์ฒญํฌ ์ด๋ฆ„์œผ๋กœ ํฌ๊ธฐ๋ฅผ ํŒ๋‹จํ•˜์ง€ ์•Š๋Š”๋‹ค. rolldown์€ ๊ณต์šฉ ์ฒญํฌ์— ์•ˆ์— ๋“  ๋ชจ๋“ˆ diff --git a/docs/testing/taxonomy.md b/docs/testing/taxonomy.md index 46e5d172..f3a199e9 100644 --- a/docs/testing/taxonomy.md +++ b/docs/testing/taxonomy.md @@ -18,7 +18,7 @@ Each gate is blocking in its declared scope. Failures are not downgraded with `test:all` is the normal product-development loop. It runs, in order, `test:runtime-schema`, `test:unit`, `test:contract`, `test:component`, -`test:integration`, `test:reference-feature`, `test:platform` (`tests/platform` +`test:integration`, test:reference-feature (removed with the reference sample), `test:platform` (`tests/platform` and `tests/architecture`), `check:release-coherence` and `test:recipes` (`package.json` `test:all`). It does not include `test:system`. CI-runner and supply-chain assurance has different host prerequisites and is invoked diff --git a/eslint.config.ts b/eslint.config.ts index 4d9f6f4c..cc8f0336 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -941,30 +941,6 @@ export default [ "react-hooks/rules-of-hooks": "off", }, }, - { - files: [ - `tests/fixtures/architecture/forbidden/**/*.${sourceExtensions}`, - ], - rules: { - "no-restricted-imports": restrictedImports( - [ - "**/adapters/**", - "**/application/ports/out/**", - "@tanstack/**", - "react", - "react-dom", - "**/application/**", - ], - "forbidden architecture fixture: this import must be rejected.", - ), - "no-restricted-globals": [ - "error", - "fetch", - "localStorage", - "sessionStorage", - ], - }, - }, { files: [ `tests/fixtures/browser-file-storage-boundaries/forbidden/**/*.${sourceExtensions}`, diff --git a/scripts/check-architecture.ts b/scripts/check-architecture.ts index 1a232292..f4bcba5b 100644 --- a/scripts/check-architecture.ts +++ b/scripts/check-architecture.ts @@ -1,11 +1,13 @@ import { parseAsync } from "@babel/core"; -import { spawnSync } from "node:child_process"; import { mkdir, readFile, readdir } from "node:fs/promises"; import { dirname, extname, isAbsolute, relative, resolve, sep } from "node:path"; import { fileURLToPath, pathToFileURL } from "node:url"; import { createRequire } from "node:module"; +import { ESLint } from "eslint"; + import { architectureDependencyReportArtifactSchema } from "./contracts/release-artifacts.ts"; +import { checkArchitectureLintFixtures } from "./lib/architecture-lint-fixtures.ts"; import { formatArchitectureViolation } from "./lib/architecture-violation-message.ts"; import { writeValidatedJsonArtifact } from "./lib/validated-json-artifact.ts"; @@ -79,7 +81,6 @@ const architectureConfig = parseArchitectureConfig( const architectureRules = architectureConfig.forbidden; const sourceExtensionPattern = /\.(?:ts|tsx|mts|cts)$/u; const declarationExtensionPattern = /\.d\.(?:ts|mts|cts)$/u; -const lintFixtureExtensionPattern = sourceExtensionPattern; const forbiddenJavaScriptExtensionPattern = /\.(?:js|jsx|mjs|cjs)$/u; const forbiddenLocalJavaScriptSpecifierPattern = /\.(?:js|jsx|mjs|cjs)(?:[?#]|$)/u; @@ -89,13 +90,6 @@ const relativeSpecifierPattern = /^\.{1,2}(?:\/|$)/u; await mkdir(dirname(qualityArtifact), { recursive: true }); -const configuredPnpmCli = process.env.npm_execpath; - -if (!configuredPnpmCli) { - throw new Error("check:architecture must run through the pnpm script"); -} -const pnpmCli = configuredPnpmCli; - if ( (architectureConfig.allowed?.length ?? 0) > 0 || (architectureConfig.required?.length ?? 0) > 0 @@ -106,12 +100,6 @@ if ( } validateArchitectureRules(architectureRules); -function runPnpm(arguments_: string[]) { - return spawnSync(process.execPath, [pnpmCli, ...arguments_], { - encoding: "utf8", - }); -} - // 12-05 (D-11): this graph is the only architecture checker. dependency-cruiser // 18 cannot parse TypeScript 7, so it cruised zero modules and still passed. // .dependency-cruiser.json keeps its name and is read here as the rule file. @@ -211,68 +199,22 @@ process.stdout.write( `TypeScript-only source policy: PASS (${typeScriptOnlyPolicy.checkedRoots.join(", ")}; no fixture exceptions)\n`, ); -const allowed = runPnpm([ - "exec", - "eslint", - "tests/fixtures/architecture/allowed", - "--no-ignore", - "--max-warnings=0", -]); - -const forbidden = runPnpm([ - "exec", - "eslint", - "tests/fixtures/architecture/forbidden", - "--no-ignore", - "--max-warnings=0", -]); - -async function fixtureFiles(directory: string): Promise { - const entries = await readdir(directory, { withFileTypes: true }); - const files = await Promise.all( - entries.map((entry) => { - const target = `${directory}/${entry.name}`; - return entry.isDirectory() - ? fixtureFiles(target) - : lintFixtureExtensionPattern.test(entry.name) - ? [target] - : []; - }), - ); - return files.flat(); -} - -const forbiddenResults = await Promise.all( - (await fixtureFiles("tests/fixtures/architecture/forbidden")).map((file) => ({ - file, - result: runPnpm([ - "exec", - "eslint", - file, - "--no-ignore", - "--max-warnings=0", - ]), - })), -); -const acceptedForbidden = forbiddenResults.filter( - ({ result }) => result.status === 0, -); - -if ( - allowed.status !== 0 || - forbidden.status === 0 || - acceptedForbidden.length > 0 -) { - process.stderr.write(allowed.stderr || allowed.stdout); - process.stderr.write(forbidden.stderr || forbidden.stdout); - for (const { file } of acceptedForbidden) { - process.stderr.write(`Forbidden fixture was accepted: ${file}\n`); +// 1103/12-04. Each fixture is linted under the production configuration of +// the path it stands for, and a forbidden one must be reported by the rule it +// names (scripts/lib/architecture-lint-fixtures.ts). +const lintFixtures = await checkArchitectureLintFixtures({ + root: projectRoot, + linter: new ESLint({ cwd: projectRoot }), +}); +if (lintFixtures.failures.length > 0) { + for (const failure of lintFixtures.failures) { + process.stderr.write(`Architecture lint fixture: ${failure}\n`); } process.exit(1); } process.stdout.write( - `Architecture fixtures: allowed PASS, ${forbiddenResults.length} forbidden rejected\n`, + `Architecture fixtures: ${lintFixtures.allowed} allowed PASS, ${lintFixtures.forbidden} forbidden rejected by the production rule for their layer\n`, ); async function analyzeSourceGraph( diff --git a/scripts/contracts/release-artifacts.ts b/scripts/contracts/release-artifacts.ts index d70ed79a..367140d3 100644 --- a/scripts/contracts/release-artifacts.ts +++ b/scripts/contracts/release-artifacts.ts @@ -1428,6 +1428,9 @@ export const documentationReviewArtifactSchema = z .object({ path: nonEmptyString, missingPaths: z.array(nonEmptyString), + // 1103/12-05. References into a paired repository that is not + // checked out beside this one. Reported, not failed. + unverifiedLinks: z.array(nonEmptyString), missingScripts: z.array(nonEmptyString), unknownGateIds: z.array(nonEmptyString), }) diff --git a/scripts/create-feature.ts b/scripts/create-feature.ts index b035bbf1..e2f7a100 100644 --- a/scripts/create-feature.ts +++ b/scripts/create-feature.ts @@ -13,8 +13,11 @@ import { import { createFileSystemDeclarationSource } from "./generate-product-feature-index.ts"; /** - * U7. `pnpm create:feature ` writes the smallest feature that passes every - * merge gate: one list route without params, one GET (SAFE, EXTERNAL_BEARER), + * U7. `pnpm create:feature ` writes the smallest feature meant to pass + * every merge gate. test:feature-scaffold runs the merge stage on it except the + * commands SCAFFOLD_DRILL_EXCLUDED_SCRIPTS names (browser gates, test:system; + * scripts/lib/feature-scaffold-drill.ts). The feature has one list route + * without params, one GET (SAFE, EXTERNAL_BEARER), * one query, one invalidation topic, one CollectionPage with ko-KR and en-US * copy, and a router page test plus an input test. The templates live in this * file and import nothing from a sample feature, so the command keeps working @@ -1415,7 +1418,7 @@ function report(plan: FeaturePlan): string { "", "Next:", ` 1. Before a release, have a person review and sign artifacts/tests/a11y-manual/${plan.routeId}.md (FE-GATE-028). The merge gates check only its format.`, - " 2. Run the merge gates: corepack pnpm check:types, lint, check:architecture, check:registries, check:i18n, check:design-system, check:diagnostics, verify:documentation, test:unit, test:component, test:integration, test:coverage, check:ci, build.", + " 2. Run the merge gates: corepack pnpm ci:gate -- FE-GATE- for each gate of the merge stage in config/ci/gates.json (README lists the loop). test:feature-scaffold runs them on a generated feature except the browser gates FE-GATE-008/009 and test:system.", ` The feature's own tests: node scripts/run-vitest.ts run tests/features/${plan.id} (test:coverage runs them in CI)`, " The registry baseline does not change: new routes, operations, schemas and invalidation topics are additive.", ]; diff --git a/scripts/lib/architecture-lint-fixtures.ts b/scripts/lib/architecture-lint-fixtures.ts new file mode 100644 index 00000000..f2570043 --- /dev/null +++ b/scripts/lib/architecture-lint-fixtures.ts @@ -0,0 +1,177 @@ +import { readdir, readFile } from "node:fs/promises"; +import path from "node:path"; + +/** + * 1103/12-04. The architecture lint fixtures are linted under the production + * configuration of the layer they stand for. + * + * They used to be linted where they live, under tests/, by an ESLint entry of + * their own that banned every layer's imports and globals at once, and a + * fixture counted as rejected whenever ESLint exited non-zero. Deleting the + * production rule for a layer therefore still left "9 forbidden rejected": + * presentation code could call `fetch` and the fixtures said it could not. + * + * Each fixture is now linted as if it were the file at `lintAs`, so exactly + * the production entries for that path apply, and a forbidden fixture passes + * only when the rule named in `rejectedBy` reports it. + */ +export type ArchitectureLintRule = "no-restricted-imports" | "no-restricted-globals"; + +export type ArchitectureLintFixture = Readonly<{ + /** Relative to tests/fixtures/architecture. */ + file: string; + /** The production path whose ESLint configuration the fixture is linted under. */ + lintAs: string; + /** For a forbidden fixture: the production rule that must reject it. */ + rejectedBy?: ArchitectureLintRule; +}>; + +export const ARCHITECTURE_LINT_FIXTURE_ROOT = "tests/fixtures/architecture"; + +const LAYER_RULES: ReadonlySet = new Set([ + "no-restricted-imports", + "no-restricted-globals", +]); + +const at = (layer: string, file: string) => + `${layer}/__architecture_fixture__/${path.posix.basename(file)}`; + +export const ARCHITECTURE_LINT_FIXTURES: readonly ArchitectureLintFixture[] = Object.freeze([ + ...[ + "allowed/bootstrap-composes-adapter.ts", + ].map((file) => ({ file, lintAs: at("src/bootstrap", file) })), + ...[ + "allowed/presentation-facade.ts", + "allowed/presentation-facade.tsx", + ].map((file) => ({ file, lintAs: at("src/presentation", file) })), + ...[ + "forbidden/application-imports-adapter.ts", + "forbidden/application-imports-tanstack.ts", + ].map((file) => ({ + file, + lintAs: at("src/application", file), + rejectedBy: "no-restricted-imports" as const, + })), + // Domain code lives inside features; src/features/*/domain is the entry + // that applies to it. + { + file: "forbidden/domain-imports-react.ts", + lintAs: "src/features/__architecture_fixture__/domain/domain-imports-react.ts", + rejectedBy: "no-restricted-imports", + }, + { + file: "forbidden/presentation-direct-fetch.tsx", + lintAs: at("src/presentation", "presentation-direct-fetch.tsx"), + rejectedBy: "no-restricted-globals", + }, + ...[ + "forbidden/presentation-imports-adapter.ts", + "forbidden/presentation-imports-adapter.tsx", + "forbidden/presentation-imports-output-port.tsx", + "forbidden/presentation-imports-tanstack.tsx", + ].map((file) => ({ + file, + lintAs: at("src/presentation", file), + rejectedBy: "no-restricted-imports" as const, + })), + { + file: "forbidden/template-imports-application.tsx", + lintAs: at("src/presentation/templates", "template-imports-application.tsx"), + rejectedBy: "no-restricted-imports", + }, +]); + +type LintMessage = Readonly<{ + ruleId: string | null; + message: string; + fatal?: boolean; + line?: number; +}>; + +export type ArchitectureLinter = Readonly<{ + lintText( + code: string, + options: Readonly<{ filePath: string; warnIgnored: boolean }>, + ): Promise[]>; +}>; + +export type ArchitectureLintFixtureResult = Readonly<{ + allowed: number; + forbidden: number; + failures: readonly string[]; +}>; + +const SOURCE_FILE = /\.(?:ts|tsx)$/u; + +async function filesBelow(root: string, directory: string): Promise { + const entries = await readdir(path.join(root, directory), { withFileTypes: true }); + const files = await Promise.all(entries.map((entry) => { + const relative = path.posix.join(directory, entry.name); + if (entry.isDirectory()) return filesBelow(root, relative); + return SOURCE_FILE.test(entry.name) ? [relative] : []; + })); + return files.flat(); +} + +export async function checkArchitectureLintFixtures(input: Readonly<{ + root: string; + linter: ArchitectureLinter; + fixtures?: readonly ArchitectureLintFixture[]; +}>): Promise { + const fixtures = input.fixtures ?? ARCHITECTURE_LINT_FIXTURES; + const failures: string[] = []; + const onDisk = new Set([ + ...await filesBelow(input.root, path.posix.join(ARCHITECTURE_LINT_FIXTURE_ROOT, "allowed")), + ...await filesBelow(input.root, path.posix.join(ARCHITECTURE_LINT_FIXTURE_ROOT, "forbidden")), + ].map((file) => path.posix.relative(ARCHITECTURE_LINT_FIXTURE_ROOT, file))); + const listed = new Set(fixtures.map(({ file }) => file)); + for (const file of [...onDisk].filter((candidate) => !listed.has(candidate)).sort()) { + failures.push(`${file}: not listed in ARCHITECTURE_LINT_FIXTURES, so nothing says what must reject it`); + } + for (const fixture of fixtures) { + const forbidden = fixture.file.startsWith("forbidden/"); + if (forbidden !== (fixture.rejectedBy !== undefined)) { + failures.push(`${fixture.file}: a forbidden fixture names its rule and an allowed one names none`); + continue; + } + if (!onDisk.has(fixture.file)) { + failures.push(`${fixture.file}: listed fixture does not exist`); + continue; + } + const code = await readFile( + path.join(input.root, ARCHITECTURE_LINT_FIXTURE_ROOT, fixture.file), + "utf8", + ); + const [result] = await input.linter.lintText(code, { + filePath: path.join(input.root, fixture.lintAs), + warnIgnored: true, + }); + const messages = result?.messages ?? []; + const unlinted = messages.filter((message) => message.fatal || message.ruleId === null); + if (unlinted.length > 0) { + failures.push( + `${fixture.file} (as ${fixture.lintAs}) was not linted: ${unlinted.map(({ message }) => message).join("; ")}`, + ); + continue; + } + const layerMessages = messages.filter(({ ruleId }) => ruleId !== null && LAYER_RULES.has(ruleId)); + if (fixture.rejectedBy !== undefined) { + if (!layerMessages.some(({ ruleId }) => ruleId === fixture.rejectedBy)) { + failures.push( + `${fixture.file} (as ${fixture.lintAs}) was accepted: the production ${fixture.rejectedBy} rule for that path no longer rejects it`, + ); + } + } else if (layerMessages.length > 0) { + failures.push( + `${fixture.file} (as ${fixture.lintAs}) was rejected: ${layerMessages + .map(({ ruleId, line, message }) => `${ruleId} at line ${line ?? "?"}: ${message}`) + .join("; ")}`, + ); + } + } + return Object.freeze({ + allowed: fixtures.filter(({ rejectedBy }) => rejectedBy === undefined).length, + forbidden: fixtures.filter(({ rejectedBy }) => rejectedBy !== undefined).length, + failures: Object.freeze(failures), + }); +} diff --git a/scripts/lib/ci-artifact-validator.ts b/scripts/lib/ci-artifact-validator.ts index 2c309466..c39cd78e 100644 --- a/scripts/lib/ci-artifact-validator.ts +++ b/scripts/lib/ci-artifact-validator.ts @@ -9,6 +9,10 @@ import type { CiGateArtifactSchema, } from "../contracts/ci-gates.ts"; import { ciContractReportSchema } from "./ci-contract-report.ts"; +import { + COVERAGE_SUMMARY_METRICS, + COVERAGE_SUMMARY_OPTIONAL_METRICS, +} from "./coverage-summary-metrics.ts"; import { architectureDependencyReportArtifactSchema, automatedA11yArtifactSchema, @@ -76,16 +80,17 @@ const coverageCounterSchema = z context.addIssue({ code: "custom", path: ["pct"], message: "coverage pct is not exact" }); } }); +// 1103/12-09. The key list is shared with the risk coverage gate, which reads +// the same file; this schema used to refuse the `branchesTrue` the reporter +// always writes. const coverageSummarySchema = z .record( z.string(), z - .object({ - lines: coverageCounterSchema, - statements: coverageCounterSchema, - functions: coverageCounterSchema, - branches: coverageCounterSchema, - }) + .object(Object.fromEntries([ + ...COVERAGE_SUMMARY_METRICS.map((metric) => [metric, coverageCounterSchema]), + ...COVERAGE_SUMMARY_OPTIONAL_METRICS.map((metric) => [metric, coverageCounterSchema.optional()]), + ])) .strict(), ) .refine((value) => "total" in value, "coverage summary lacks total"); diff --git a/scripts/lib/coverage-summary-metrics.ts b/scripts/lib/coverage-summary-metrics.ts new file mode 100644 index 00000000..9579bb33 --- /dev/null +++ b/scripts/lib/coverage-summary-metrics.ts @@ -0,0 +1,24 @@ +/** + * The keys of one entry in Vitest's `coverage-summary.json`. Two readers check + * that file: the CI evidence validator (ci-artifact-validator.ts) and the risk + * coverage gate (risk-coverage.ts). They kept separate lists, and the + * validator refused `branchesTrue` while the gate accepted it, so FE-GATE-005 + * failed at its evidence step after every test had passed (1103/12-09). + */ + +/** The four metrics both readers evaluate. */ +export const COVERAGE_SUMMARY_METRICS = Object.freeze([ + "lines", + "statements", + "functions", + "branches", +] as const); + +/** + * Keys the reporter may add. istanbul-lib-coverage 3.2.2 puts `branchesTrue` + * in every blank summary, so the total always carries it. Each is still + * checked as a counter; neither reader evaluates it. + */ +export const COVERAGE_SUMMARY_OPTIONAL_METRICS = Object.freeze([ + "branchesTrue", +] as const); diff --git a/scripts/lib/feature-scaffold-drill.ts b/scripts/lib/feature-scaffold-drill.ts new file mode 100644 index 00000000..bbbd06f7 --- /dev/null +++ b/scripts/lib/feature-scaffold-drill.ts @@ -0,0 +1,143 @@ +import { spawnSync } from "node:child_process"; + +import type { CiGateContract } from "../contracts/ci-gates.ts"; +import { classifyGateStepResult, type GateStepExpectation } from "./ci-step-result.ts"; +import { FIXTURE_PNPM_ENVIRONMENT } from "./fixture-node-modules.ts"; +import type { RemovalCheck } from "./removal-fixture.ts"; + +/** + * 1103/12-02. test:feature-scaffold proves that a feature from + * `create:feature` passes the merge gates. It ran a hand-kept list of 15 + * commands while the merge stage has 88, so a template change that broke a + * generated feature in any other merge command passed FE-GATE-020. + * + * The drill now runs the merge stage of the copy's config/ci/gates.json, in + * stage order, each command once. A command added to the merge stage runs here + * unless this list names it, with the reason it cannot run in the drill. + */ +const BROWSER = + "needs Playwright browsers. FE-GATE-020 runs in a merge job without them " + + "(merge_gate matrix browser: false). The generated routes in the browser " + + "gates are reviewed as 1103/12-01 and 12-03."; +const DRILL = + "a removal drill copies the repository again. The drill runs the generated " + + "feature's own removal instead (feature-removal)."; + +export const SCAFFOLD_DRILL_EXCLUDED_SCRIPTS: Readonly> = Object.freeze({ + "verify:lockfile": + "runs pnpm install, which writes into the node_modules the copy links from " + + "the repository (scripts/lib/fixture-node-modules.ts).", + "test:e2e": BROWSER, + "test:browser-capabilities": BROWSER, + "verify:browser-capability-evidence": `reads the test:browser-capabilities results; ${BROWSER}`, + "test:storybook": BROWSER, + "test:visual": BROWSER, + "check:test-evidence:browser": `reads the browser gates' results; ${BROWSER}`, + "test:a11y": BROWSER, + "test:system": + "needs the CI runner's bubblewrap, systemd and cgroup v2 " + + "(scripts/check-system-test-prerequisites.ts). It tests the provider " + + "sandbox, which a feature does not reach.", + "test:sample-removal": DRILL, + "test:feature-scaffold": "is this drill.", + "test:optional-recipe-removal": DRILL, + "test:browser-file-storage-removal": DRILL, + "test:realtime-removal": DRILL, +}); + +export type ScaffoldDrillCommand = Readonly<{ + /** `:`, the check's name in the drill report. */ + name: string; + script: string; + args: readonly string[]; + expectation: GateStepExpectation; +}>; + +type ContractShape = Pick; + +export function scaffoldDrillCommands( + contract: ContractShape, + excluded: Readonly> = SCAFFOLD_DRILL_EXCLUDED_SCRIPTS, +): readonly ScaffoldDrillCommand[] { + const merge = contract.stages.find(({ id }) => id === "merge"); + if (!merge) throw new TypeError("the CI contract has no merge stage"); + const commands = new Map(contract.commands.map((command) => [command.id, command])); + const mergeScripts = new Set(); + const seen = new Set(); + const selected: ScaffoldDrillCommand[] = []; + for (const gateId of merge.gateIds) { + const gate = contract.gates.find(({ id }) => id === gateId); + if (!gate) throw new TypeError(`the merge stage names an undefined gate: ${gateId}`); + for (const commandId of gate.commandIds) { + const command = commands.get(commandId); + if (!command) throw new TypeError(`${gateId} names an undefined command: ${commandId}`); + mergeScripts.add(command.script); + if (seen.has(commandId) || Object.hasOwn(excluded, command.script)) continue; + seen.add(commandId); + selected.push(Object.freeze({ + name: `${gateId}:${commandId}`, + script: command.script, + args: Object.freeze([...(command.args ?? [])]), + expectation: command.expect === "pass" + ? Object.freeze({ kind: "pass" as const }) + : Object.freeze({ + kind: "fail" as const, + expectedExitCode: command.expectedExitCode ?? 1, + expectedDiagnosticId: command.expectedDiagnosticId ?? "", + }), + })); + } + } + // An exclusion for a command that moved out of the merge stage would hide + // nothing today and silently drop it if it came back. A command the contract + // no longer has at all (a removal drill pruned its capability) is not stale. + const contractScripts = new Set(contract.commands.map(({ script }) => script)); + const stale = Object.keys(excluded).filter( + (script) => contractScripts.has(script) && !mergeScripts.has(script), + ); + if (stale.length > 0) { + throw new TypeError( + `the scaffold drill excludes scripts the contract runs outside the merge stage: ${stale.join(", ")}`, + ); + } + return Object.freeze(selected); +} + +/** + * Runs one merge command in the fixture. A negative fixture command passes + * only with its registered exit code and diagnostic, as in run-ci-gate.ts. + */ +export function runScaffoldDrillCommand( + command: ScaffoldDrillCommand, + root: string, + pnpmCli: string, +): RemovalCheck { + const capture = command.expectation.kind === "fail"; + const result = spawnSync(process.execPath, [pnpmCli, command.script, ...command.args], { + cwd: root, + encoding: "utf8", + stdio: capture ? "pipe" : "inherit", + maxBuffer: 64 * 1024 * 1024, + env: { ...process.env, ...FIXTURE_PNPM_ENVIRONMENT }, + }); + if (capture) { + process.stdout.write(result.stdout ?? ""); + process.stderr.write(result.stderr ?? ""); + } + const classification = classifyGateStepResult(command.expectation, { + status: result.status, + signal: result.signal, + stdout: result.stdout ?? "", + stderr: result.stderr ?? "", + ...(result.error ? { error: { code: (result.error as NodeJS.ErrnoException).code } } : {}), + }); + if (classification.expectationMet) return { name: command.name, passed: true }; + const invocation = `corepack pnpm ${[command.script, ...command.args].join(" ")}`; + return { + name: command.name, + passed: false, + failure: command.expectation.kind === "fail" + ? `${invocation}: ${classification.kind}, expected exit ${command.expectation.expectedExitCode} with ${JSON.stringify(command.expectation.expectedDiagnosticId)}, got exit ${result.status ?? result.signal}` + : `${invocation} exited ${result.status ?? result.signal ?? "on a spawn error"}`, + }; +} diff --git a/scripts/lib/removal-fixture.ts b/scripts/lib/removal-fixture.ts index fd39e717..efbbf9b3 100644 --- a/scripts/lib/removal-fixture.ts +++ b/scripts/lib/removal-fixture.ts @@ -46,6 +46,41 @@ export const REMOVAL_FIXTURE_COPY_TARGETS = Object.freeze([ * provider suite down with it โ€” twenty-odd failures with one cause. */ +/** + * The repository's documents. A drill that adds or removes a feature copies + * them as well (REMOVAL_FIXTURE_COPY_TARGETS plus these), because the change + * must leave the documents valid (1103/14-04). The capability drills do not: + * the documents describe the capability they delete, and what those drills + * prove is that the code still builds and tests without it. + */ +export const REMOVAL_FIXTURE_DOCUMENT_TARGETS = Object.freeze([ + "README.md", + "CHANGELOG.md", + "docs", +] as const); + +/** + * 1103/02-06. Tests that read REMOVAL_FIXTURE_DOCUMENT_TARGETS. A fixture + * copied without the documents cannot run them: every capability drill + * (FE-GATE-020) failed its `test` check on ENOENT for README.md and + * CHANGELOG.md, whatever the removal did. prepareRemovalFixture deletes them + * from such a fixture, and the repository's own test:unit keeps running them. + * This is the only list; the sample drill used to keep the exclusion to itself. + */ +export const REMOVAL_FIXTURE_DOCUMENT_TESTS = Object.freeze([ + "tests/unit/changelog-review-ids.test.ts", + "tests/unit/documentation-readiness.test.ts", +] as const); + +/** The tests a fixture copied from `copyTargets` cannot run. */ +export function removalFixtureExcludedTests( + copyTargets: readonly string[], +): readonly string[] { + return REMOVAL_FIXTURE_DOCUMENT_TARGETS.every((target) => copyTargets.includes(target)) + ? [] + : REMOVAL_FIXTURE_DOCUMENT_TESTS; +} + /** * Regenerated result trees under `artifacts/`: traces, coverage HTML, recorded * videos and Storybook bundles. They are tens of megabytes and mean nothing to @@ -114,6 +149,9 @@ export async function prepareRemovalFixture( for (const target of copyTargets) { await cp(target, path.join(root, target), { recursive: true }); } + for (const test of removalFixtureExcludedTests(copyTargets)) { + await rm(path.join(root, test), { force: true }); + } await copyReleaseEvidenceTree(process.cwd(), root); runFixtureGit(root, ["init", "--quiet", "--initial-branch=fixture"]); await linkFixtureNodeModules(root); @@ -465,8 +503,14 @@ export async function pruneRemovalFixtureCiContract(options: Readonly<{ ]); // D-13: the reduced contract is a new baseline, recorded the way a project // that removes the capability records it; canonical check:ci then applies. + // 1103/16-02. A product feature owns no CI script; an empty list used to + // leave a trailing blank that the baseline schema refuses. await updateCiContractBaseline(options.root, { owner: "removal-fixture", - reason: `removal fixture pruned ${[...options.removedScripts].join(", ")}`, + reason: `removal fixture pruned ${ + options.removedScripts.size === 0 + ? "no CI scripts" + : [...options.removedScripts].join(", ") + }`, }); } diff --git a/scripts/lib/risk-coverage.ts b/scripts/lib/risk-coverage.ts index 0d951f22..9a12908a 100644 --- a/scripts/lib/risk-coverage.ts +++ b/scripts/lib/risk-coverage.ts @@ -8,14 +8,12 @@ import { import path from "node:path"; import babelParser from "@babel/eslint-parser"; +import { + COVERAGE_SUMMARY_METRICS as coverageMetrics, + COVERAGE_SUMMARY_OPTIONAL_METRICS, +} from "./coverage-summary-metrics.ts"; import { normalizeRepositoryRelativePath } from "./repository-file-inventory.ts"; -const coverageMetrics = [ - "lines", - "statements", - "functions", - "branches", -] as const; const teamIdPattern = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u; const maximumWaiverDurationMs = 90 * 24 * 60 * 60 * 1_000; @@ -641,16 +639,20 @@ function parseCoverageCounter(value: unknown, label: string): CoverageCounter { function parseCoverageMetrics(value: unknown, label: string): CoverageMetrics { if (!isRecord(value)) throw new TypeError(`${label} must be an object`); + const optionalMetrics: readonly string[] = COVERAGE_SUMMARY_OPTIONAL_METRICS; const unknownMetrics = Object.keys(value).filter( - (metric) => metric !== "branchesTrue" && !coverageMetrics.includes(metric as CoverageMetric), + (metric) => + !optionalMetrics.includes(metric) && !coverageMetrics.includes(metric as CoverageMetric), ); if (unknownMetrics.length > 0) { throw new TypeError( `${label} has unknown coverage metric keys: ${unknownMetrics.sort().join(", ")}`, ); } - if (value.branchesTrue !== undefined) { - parseCoverageCounter(value.branchesTrue, `${label}.branchesTrue`); + for (const metric of optionalMetrics) { + if (value[metric] !== undefined) { + parseCoverageCounter(value[metric], `${label}.${metric}`); + } } const parsed = {} as Record; for (const metric of coverageMetrics) { diff --git a/scripts/run-and-validate-provider.ts b/scripts/run-and-validate-provider.ts index 597989d8..09511f4a 100644 --- a/scripts/run-and-validate-provider.ts +++ b/scripts/run-and-validate-provider.ts @@ -1,7 +1,7 @@ import { spawn } from "node:child_process"; import { randomBytes } from "node:crypto"; import { constants } from "node:fs"; -import { access, appendFile, lstat } from "node:fs/promises"; +import { access, appendFile, lstat, stat } from "node:fs/promises"; import path from "node:path"; import { @@ -274,12 +274,21 @@ async function runProviderInSandbox( bwrapArguments.push("--dir", directory); } bwrapArguments.push("--ro-bind", workspaceRoot, workspaceRoot); - if (await exists(path.join(workspaceRoot, ".git"))) { + const repositoryMetadata = path.join(workspaceRoot, ".git"); + const metadataKind = await entryKind(repositoryMetadata); + if (metadataKind === "directory") { bwrapArguments.push( "--size", String(PROVIDER_MASK_BYTES), - "--tmpfs", path.join(workspaceRoot, ".git"), - "--remount-ro", path.join(workspaceRoot, ".git"), + "--tmpfs", repositoryMetadata, + "--remount-ro", repositoryMetadata, ); + } else if (metadataKind === "other") { + // 1103/11-04. A linked worktree or a submodule checkout has a one-line + // `gitdir:` file here, and a tmpfs cannot be mounted on a file. /dev/null + // is bound over it instead. bubblewrap mounts binds nodev, so the provider + // can neither read the line nor write the path; the directory it names + // lies outside the workspace and is never bound into the sandbox. + bwrapArguments.push("--ro-bind", "/dev/null", repositoryMetadata); } bwrapArguments.push( "--ro-bind", candidateRoot, "/candidate", @@ -597,6 +606,16 @@ function missingDestinationAncestors(target: string): string[] { return ancestors.reverse(); } +/** What `target` is once symlinks are followed, as bubblewrap will see it. */ +async function entryKind(target: string): Promise<"directory" | "other" | null> { + try { + return (await stat(target)).isDirectory() ? "directory" : "other"; + } catch (error) { + if (hasErrorCode(error, "ENOENT")) return null; + throw error; + } +} + async function exists(target: string): Promise { try { await lstat(target); diff --git a/scripts/test-feature-scaffold.ts b/scripts/test-feature-scaffold.ts index 61654558..92f4a267 100644 --- a/scripts/test-feature-scaffold.ts +++ b/scripts/test-feature-scaffold.ts @@ -1,9 +1,16 @@ +import { spawnSync } from "node:child_process"; import { mkdir, rm, writeFile } from "node:fs/promises"; +import { loadCiGateContract } from "./contracts/ci-gates.ts"; +import { + runScaffoldDrillCommand, + scaffoldDrillCommands, +} from "./lib/feature-scaffold-drill.ts"; import { createRemovalFixtureRoot, prepareRemovalFixture, REMOVAL_FIXTURE_COPY_TARGETS, + REMOVAL_FIXTURE_DOCUMENT_TARGETS, renderRemovalJunit, requireRemovalFixtureEnvironment, runRemovalFixtureCheck, @@ -14,7 +21,16 @@ import { /** * U7. A feature from `create:feature` passes the merge gates without an edit * and breaks no other test. A copy of the repository, sample feature - * included, gets one generated feature and then runs the gates. + * included, gets one generated feature and then runs the merge stage of its + * config/ci/gates.json: every command except those + * SCAFFOLD_DRILL_EXCLUDED_SCRIPTS names with a reason (the browser gates, + * test:system, the install check and the removal drills). 1103/12-02: this + * used to be a hand-kept list of 15 commands. + * + * 1103/16-02. The generated feature is then removed again with + * `test:sample-removal -- --feature=`, the path the manual tells every + * product feature to take and that no gate ran. + * * test:sample-removal repeats the generation after deleting the sample * (decision 4), which proves the command needs nothing from it. */ @@ -24,6 +40,12 @@ const REPORT = "artifacts/tests/feature-scaffold.xml"; const pnpmCli = requireRemovalFixtureEnvironment("npm_execpath"); const fixtureRoot = await createRemovalFixtureRoot("feature-scaffold"); +function fixtureCommit(root: string): string { + const head = spawnSync("git", ["rev-parse", "HEAD"], { cwd: root, encoding: "utf8" }); + if (head.status !== 0) throw new Error(`feature scaffold fixture has no commit: ${head.stderr}`); + return head.stdout.trim(); +} + function check(name: string, script: string, extra: readonly string[] = []): RemovalCheck { return runRemovalFixtureCheck(name, fixtureRoot, pnpmCli, script, extra); } @@ -32,9 +54,7 @@ try { // verify:documentation and the documentation tests read these. await prepareRemovalFixture(fixtureRoot, [ ...REMOVAL_FIXTURE_COPY_TARGETS, - "README.md", - "CHANGELOG.md", - "docs", + ...REMOVAL_FIXTURE_DOCUMENT_TARGETS, ]); const created = check("create-feature", "create:feature", [FEATURE_ID]); const checks: RemovalCheck[] = [created]; @@ -42,23 +62,16 @@ try { // Commits the copy with the feature, as a project would: git-based // checks (git grep, git ls-files) then see the feature's files. sealRemovalFixtureRepository(fixtureRoot); - checks.push( - check("typecheck", "check:types"), - check("lint", "lint"), - check("architecture", "check:architecture"), - check("registries", "check:registries"), - check("i18n", "check:i18n"), - check("design-system", "check:design-system"), - check("diagnostics", "check:diagnostics"), - check("documentation", "verify:documentation"), - check("unit", "test:unit"), - check("component", "test:component"), - check("integration", "test:integration"), - check("features", "exec", ["node", "scripts/run-vitest.ts", "run", "tests/features"]), - check("coverage", "test:coverage"), - check("ci-contract", "check:ci"), - check("build", "build"), - ); + // build:release-candidate records the build's commit and refuses one that + // is not a commit ID. CI sets VITE_COMMIT_SHA for the whole workflow; a + // local run gets the copy's own sealed commit instead of "local". + if (!process.env["VITE_COMMIT_SHA"]?.trim()) { + process.env["VITE_COMMIT_SHA"] = fixtureCommit(fixtureRoot); + } + for (const command of scaffoldDrillCommands(await loadCiGateContract(fixtureRoot))) { + checks.push(runScaffoldDrillCommand(command, fixtureRoot, pnpmCli)); + } + checks.push(check("feature-removal", "test:sample-removal", ["--", `--feature=${FEATURE_ID}`])); } const failed = checks.filter((entry) => !entry.passed); await mkdir("artifacts/tests", { recursive: true }); diff --git a/scripts/test-sample-removal.ts b/scripts/test-sample-removal.ts index 81bec4c0..1c97d0c0 100644 --- a/scripts/test-sample-removal.ts +++ b/scripts/test-sample-removal.ts @@ -18,6 +18,8 @@ import { pruneRemovalFixtureCiContract, pruneScriptOrchestration, regenerateRemovalFixtureWorkflow, + REMOVAL_FIXTURE_COPY_TARGETS, + REMOVAL_FIXTURE_DOCUMENT_TARGETS, renderRemovalJunit, requireRemovalFixtureEnvironment, runRemovalFixtureCheck, @@ -201,16 +203,22 @@ function outcome(name: string, findings: readonly string[], label: string): Remo } try { - await prepareRemovalFixture(fixtureRoot); + // 1103/14-04. The documents come too: removing a feature must leave them + // valid, and the fixture used to leave them out with the tests that read + // them, so a manual naming the sample's files passed here and then failed + // FE-GATE-017 in the product that removed it. + await prepareRemovalFixture(fixtureRoot, [ + ...REMOVAL_FIXTURE_COPY_TARGETS, + ...REMOVAL_FIXTURE_DOCUMENT_TARGETS, + ]); + // Fixture-only deletions: a project that removes the sample keeps these. + // verify:documentation runs in this fixture, so a current contract document + // must not name them as backtick paths (docs/manual/reference/patterns.md). for (const excludedFixtureTest of [ "tests/unit/ci-workflow-generation.test.ts", "tests/unit/__snapshots__/ci-workflow-generation.test.ts.snap", "tests/unit/removal-fixture.test.ts", "tests/unit/http-scenario-evidence.test.ts", - // They check README.md and CHANGELOG.md, which the fixture does not copy - // (REMOVAL_FIXTURE_COPY_TARGETS); removing a feature does not change them. - "tests/unit/changelog-review-ids.test.ts", - "tests/unit/documentation-readiness.test.ts", ]) { await rm(path.join(fixtureRoot, excludedFixtureTest), { force: true }); } @@ -399,6 +407,13 @@ try { } const gateChecks = (prefix: string): RemovalCheck[] => [ check(`${prefix}typecheck`, "check:types"), + // 1103/14-04 (FOLLOW-UP 09-07). Merge and documentation gates the drill + // did not run: the documents, lint, screen text and design tokens can + // name or use what the removal deleted. + check(`${prefix}lint`, "lint"), + check(`${prefix}documentation`, "verify:documentation"), + check(`${prefix}i18n`, "check:i18n"), + check(`${prefix}design-system`, "check:design-system"), check(`${prefix}architecture`, "check:architecture"), check(`${prefix}registries`, "check:registries"), check(`${prefix}unit-integration`, "test:all"), diff --git a/scripts/verify-documentation-readiness.ts b/scripts/verify-documentation-readiness.ts index 0165ec7e..18fbcd9a 100644 --- a/scripts/verify-documentation-readiness.ts +++ b/scripts/verify-documentation-readiness.ts @@ -1,6 +1,6 @@ import { existsSync } from "node:fs"; import { mkdir, readdir, readFile } from "node:fs/promises"; -import { dirname, join, matchesGlob, normalize } from "node:path/posix"; +import { dirname, join, matchesGlob, normalize, resolve } from "node:path/posix"; import { fileURLToPath } from "node:url"; import { RETIRED_GATE_IDS } from "./contracts/ci-gates.ts"; @@ -207,21 +207,62 @@ const deletedHistory = [ .flatMap(([, cell = ""]) => [...cell.matchAll(/`([^`]+)`/gu)].map(([, entry = ""]) => entry.replace(/\/$/u, ""))) .filter((entry) => !exists(entry)); -// A backtick span is a path when it starts at a top-level entry or at an -// entry beside the document; line numbers and anchors are dropped. +// 1103/12-05. The paired templates a document may name (`/docs/โ€ฆ`) or +// link (`../../..//โ€ฆ`). They are looked up beside the checkout the +// documents are read from; where none is checked out (CI, a nested worktree) +// the reference is reported as not verified instead of passing silently. +const SIBLING_REPOSITORIES = new Set(["clean-architecture-backend-template"]); +const siblingsRoot = resolve(process.cwd(), ".."); + +// A backtick span is a path when it starts at a top-level entry, at an entry +// beside the document or at a paired repository; line numbers and anchors are +// dropped. A path into a paired repository is returned relative to this one +// (`..//โ€ฆ`). function namedPath(token: string, document: string): string | null { const candidate = token.replace(/#.*$/u, "").replace(/:\d[\d,:-]*$/u, ""); if (!candidate.includes("/") || candidate.startsWith("/") || /[\s*<>{}$()|]|\.\.\./u.test(candidate)) return null; const first = candidate.split("/")[0] ?? ""; if (topLevelEntries.has(first)) return candidate; + if (SIBLING_REPOSITORIES.has(first)) return `../${candidate}`; return first !== "." && first !== ".." && exists(join(dirname(document), first)) ? join(dirname(document), candidate) : null; } +// A link that leaves the repository is kept (`../โ€ฆ`); the caller looks it up +// beside the checkout. function linkedPath(target: string, document: string): string | null { if (/^(?:[a-z][a-z+.-]*:|#)/iu.test(target)) return null; - const resolved = normalize(join(dirname(document), target.replace(/#.*$/u, ""))); - return resolved.startsWith("../") ? null : resolved; + return normalize(join(dirname(document), target.replace(/#.*$/u, ""))); +} +// 1103/12-05. A command span is not a path, so the paths it takes as +// arguments (`corepack pnpm exec vitest run tests/โ€ฆ`, `node scripts/โ€ฆ`) were +// never looked up. Leading `NAME=value` assignments are skipped, a +// `--flag=value` argument is read as its value, and placeholders (``, +// globs, `$VAR`) are left alone by namedPath. +const COMMAND_HEADS = new Set(["corepack", "pnpm", "npx", "node", "vitest", "playwright", "tsc", "eslint", "bash", "sh"]); +function commandPaths(command: string, document: string): (string | null)[] { + const words = command.trim().replace(/^\$\s+/u, "").split(/\s+/u); + let head = 0; + while (/^[A-Z_][A-Z0-9_]*=/u.test(words[head] ?? "")) head += 1; + if (!COMMAND_HEADS.has(words[head] ?? "")) return []; + return words + .slice(head + 1) + .map((word) => namedPath(word.replace(/^--?[\w.-]+=/u, "").replace(/^["']|["']$/gu, ""), document)); +} +// Lines of fenced shell blocks (```bash, ```sh, ```shell, ```console or no +// language), which is where most documented commands are. +function fencedCommands(text: string): string[] { + const commands: string[] = []; + let fence: string | null = null; + for (const line of text.split("\n")) { + const marker = /^\s*```(\w*)/u.exec(line); + if (marker) { + fence = fence === null ? (marker[1] ?? "") : null; + continue; + } + if (fence !== null && /^(?:bash|sh|shell|console|zsh)?$/u.test(fence)) commands.push(line); + } + return commands; } const index = await readFile(DOCUMENT_INDEX, "utf8").catch(() => ""); @@ -239,18 +280,42 @@ for (const document of contractDocuments) { if (text === null) { // A linked document that is gone is reported as the index's broken link. if (document === DOCUMENT_INDEX) { - documentReferences.push({ path: document, missingPaths: [document], missingScripts: [], unknownGateIds: [] }); + documentReferences.push({ + path: document, + missingPaths: [document], + unverifiedLinks: [], + missingScripts: [], + unknownGateIds: [], + }); } continue; } const named = [ - ...[...text.matchAll(/`([^`\n]+)`/gu)].map(([, token = ""]) => namedPath(token, document)), + ...[...text.matchAll(/`([^`\n]+)`/gu)].flatMap(([, token = ""]) => [ + namedPath(token, document), + ...commandPaths(token, document), + ]), + ...fencedCommands(text).flatMap((command) => commandPaths(command, document)), ...[...text.matchAll(/\]\(([^)\s]+)\)/gu)].map(([, target = ""]) => linkedPath(target, document)), ]; const missingPaths = new Set(); + const unverifiedLinks = new Set(); for (const file of named) { if (file === null) continue; const trimmed = file.replace(/\/$/u, ""); + if (trimmed.startsWith("../")) { + // Outside this repository: the first folder past the `..` steps is the + // paired checkout. Without it the reference cannot be checked here. + const segments = trimmed.split("/"); + const checkout = segments.slice(0, segments.findIndex((segment) => segment !== "..") + 1).join("/"); + const relativeToSiblings = trimmed.replace(/^\.\.\//u, ""); + if (!existsSync(resolve(siblingsRoot, checkout.replace(/^\.\.\//u, "")))) { + unverifiedLinks.add(trimmed); + } else if (!existsSync(resolve(siblingsRoot, relativeToSiblings))) { + missingPaths.add(trimmed); + } + continue; + } if ( !exists(trimmed) && !NOT_CREATED.has(trimmed) && @@ -270,6 +335,7 @@ for (const document of contractDocuments) { documentReferences.push({ path: document, missingPaths: [...missingPaths].sort(), + unverifiedLinks: [...unverifiedLinks].sort(), missingScripts: [...missingScripts].sort(), unknownGateIds: [...new Set([...text.matchAll(/\bFE-GATE-\d+\b/gu)].map(([id]) => id))] .filter((id) => !gateIds.has(id)) @@ -370,4 +436,11 @@ if (!passed) { ); process.exit(1); } +const unverified = documentReferences.flatMap((entry) => entry.unverifiedLinks); +if (unverified.length > 0) { + process.stdout.write( + `Documentation readiness: ${unverified.length} reference(s) into paired repositories not verified ` + + `(no checkout beside ${process.cwd()}): ${[...new Set(unverified)].join(", ")}\n`, + ); +} process.stdout.write("Documentation readiness: PASS_SCOPED\n"); diff --git a/tests/browser-capabilities/indexeddb-runtime.spec.ts b/tests/browser-capabilities/indexeddb-runtime.spec.ts index e3fa690b..c02a959f 100644 --- a/tests/browser-capabilities/indexeddb-runtime.spec.ts +++ b/tests/browser-capabilities/indexeddb-runtime.spec.ts @@ -1020,15 +1020,12 @@ test("fails a blocked v2 upgrade closed, then closes its late connection after t ); expect(blocker).toBe("OPEN"); + // 1103/11-05. The BLOCKED status lasts only blockedTimeoutMs before the + // runtime closes, and each poll is a page.evaluate round trip, so a loaded + // host saw CLOSED first. The settled open result below already says the + // upgrade was blocked; tests/unit/indexeddb-runtime.test.ts pins the + // transient status on a controlled clock. await startLifecycleRuntime(page, name, 2, 500); - await expect - .poll(async () => await lifecycleStatus(page)) - .toEqual({ - kind: "BLOCKED", - currentVersion: 1, - targetVersion: 2, - }); - const blocked = await settleLifecycleRuntime(page); expect(blocked).toMatchObject({ opened: { diff --git a/tests/browser-capabilities/resumable-upload.spec.ts b/tests/browser-capabilities/resumable-upload.spec.ts index 3d84d0b0..a1c60946 100644 --- a/tests/browser-capabilities/resumable-upload.spec.ts +++ b/tests/browser-capabilities/resumable-upload.spec.ts @@ -2,9 +2,12 @@ import { createHash } from "node:crypto"; import type { Route } from "@playwright/test"; +import capabilitiesConfig from "../../playwright.capabilities.config.ts"; import { expect, test } from "../support/browser/strict-browser-test.ts"; -const PAGE_ORIGIN = "http://127.0.0.1:4174"; +// The page is served from the capability config's baseURL; a copy of its port +// here drifted silently whenever the config moved. +const PAGE_ORIGIN = new URL(capabilitiesConfig.use?.baseURL ?? "").origin; const API_ORIGIN = "https://upload-api.example.test"; const OBJECT_ORIGIN = "https://upload-objects.example.test"; const SESSION_ID = "session_browser_01"; diff --git a/tests/component/boot-unexpected-failure.test.tsx b/tests/component/boot-unexpected-failure.test.tsx index 9da395bb..f5800893 100644 --- a/tests/component/boot-unexpected-failure.test.tsx +++ b/tests/component/boot-unexpected-failure.test.tsx @@ -1,7 +1,7 @@ // @vitest-environment jsdom import { render, screen, within } from "@testing-library/react"; -import { describe, expect, it, vi } from "vitest"; +import { afterEach, describe, expect, it, vi } from "vitest"; import { BootErrorShell } from "../../src/presentation/boundaries/boot-error-shell.tsx"; @@ -16,6 +16,12 @@ vi.mock("../../src/bootstrap/create-runtime-composition.ts", () => ({ }, })); +// The reportError stub must not reach the next test in this file; the config +// does not set unstubGlobals. +afterEach(() => { + vi.unstubAllGlobals(); +}); + describe("unexpected boot failure (09-04)", () => { it("is shown as BOOT_UNEXPECTED_FAILURE and reports the error in development", async () => { document.body.innerHTML = diff --git a/tests/e2e/compact-smoke.spec.ts b/tests/e2e/compact-smoke.spec.ts index 73269951..d084c229 100644 --- a/tests/e2e/compact-smoke.spec.ts +++ b/tests/e2e/compact-smoke.spec.ts @@ -1,5 +1,14 @@ import { expect, test } from "../support/browser/strict-browser-test.ts"; +/** + * 1103/11-06. The preview server serves a build made from this process's + * environment (playwright.config.ts webServer), and the build takes its + * identity from VITE_BUILD_ID the way scripts/generate-runtime-config.ts + * does: CI sets gitea--, a local run falls back to + * "local-build". A fixed "local-build" failed FE-GATE-008 in every CI run. + */ +const EXPECTED_BUILD_ID = process.env["VITE_BUILD_ID"] || "local-build"; + test("boots and navigates the compact production shell", async ({ page }) => { await page.goto("/"); await expect(page.getByRole("main")).toBeVisible(); @@ -15,7 +24,7 @@ test("boots and navigates the compact production shell", async ({ page }) => { .getByRole("link", { name: "UI ๊ตฌ์„ฑ์š”์†Œ", exact: true }) .click(); await expect(page).toHaveURL(/\/examples\/ui$/); - await expect(page.locator("html")).toHaveAttribute("data-build-id", "local-build"); + await expect(page.locator("html")).toHaveAttribute("data-build-id", EXPECTED_BUILD_ID); const overflow = await page.evaluate( () => document.documentElement.scrollWidth - window.innerWidth, ); diff --git a/tests/system/ci-runner/ci-artifact-contract.test.ts b/tests/system/ci-runner/ci-artifact-contract.test.ts index ec92a221..3aa99b33 100644 --- a/tests/system/ci-runner/ci-artifact-contract.test.ts +++ b/tests/system/ci-runner/ci-artifact-contract.test.ts @@ -6,7 +6,7 @@ import { tmpdir } from "node:os"; import path from "node:path"; import { setTimeout as delay } from "node:timers/promises"; -import { afterAll, afterEach, describe, expect, it } from "vitest"; +import { afterAll, afterEach, beforeAll, describe, expect, it } from "vitest"; import type { CiGateArtifact, @@ -62,6 +62,11 @@ import { * default instead would hide a genuinely hung test. */ const PROCESS_HEAVY_TIMEOUT_MS = 30_000; +/** + * The provider base fixture runs `build:release-candidate`, bounded at 120s + * (ensureProviderBaseFixture), and then copies and archives the result. + */ +const PROVIDER_BASE_FIXTURE_TIMEOUT_MS = 180_000; const temporaryRoots: string[] = []; let providerBaseRoot: string | undefined; @@ -448,7 +453,16 @@ describe("CI artifact validator", () => { }); }); -describe("candidate archive and provider upload boundaries", () => { +// 1103/11-03. Every test here spawns a provider launch chain or copies the +// release-candidate fixture, so the whole block runs on the provider budget; +// eight tests were still on the 10s unit default and timed out under load. +// The base fixture is built once in beforeAll, on its own ceiling, so a test +// selected alone with -t no longer pays for the build inside its own budget. +describe("candidate archive and provider upload boundaries", { timeout: PROCESS_HEAVY_TIMEOUT_MS }, () => { + beforeAll(async () => { + await ensureProviderBaseFixture(); + }, PROVIDER_BASE_FIXTURE_TIMEOUT_MS); + it("accepts only the manifest-bound candidate member set and bytes", async () => { const fixture = await createCandidateArchiveFixture(); await expect( @@ -601,7 +615,7 @@ describe("candidate archive and provider upload boundaries", () => { providerValidationInput(fixture, Buffer.from(`${JSON.stringify(report)}\n`)), ), ).rejects.toThrow(/candidate identity mismatch/i); - }, 30_000); + }); it("uses the reverified archive manifest when extracted candidate files are mutated", async () => { const fixture = await createProviderFixture(); @@ -686,7 +700,6 @@ describe("candidate archive and provider upload boundaries", () => { }); expect(retried.status, retried.stderr).toBe(0); }, - 20_000, ); it("drains and kills provider background processes before sealing evidence", async () => { @@ -728,7 +741,7 @@ describe("candidate archive and provider upload boundaries", () => { expect(JSON.parse(await readFile(sealedPath, "utf8"))).toEqual( expect.objectContaining({ provider: "fixture" }), ); - }, 10_000); + }); it("does not expose or mutate a host path outside the sandboxed workspace", async () => { const fixture = await createProviderFixture(); @@ -749,7 +762,45 @@ describe("candidate archive and provider upload boundaries", () => { }); expect(result.status, result.stderr).toBe(0); await expect(readFile(canary, "utf8")).resolves.toBe("host-secret\n"); - }, 10_000); + }); + + // 1103/11-04. In a linked worktree or a submodule checkout `.git` is a + // one-line `gitdir:` file. The sandbox hid `.git` with a tmpfs, which + // bubblewrap cannot mount on a file, so every provider run in a worktree + // ended with "Can't mkdir โ€ฆ/.git: Not a directory" before the provider ran. + it.each(["directory", "file"] as const)( + "hides repository metadata from the provider when .git is a %s", + async (shape) => { + const fixture = await createProviderFixture(); + await rm(fixture.reportPath); + const metadata = path.join(fixture.root, ".git"); + await rm(metadata, { recursive: true, force: true }); + if (shape === "directory") { + await mkdir(metadata); + await writeFile(path.join(metadata, "HEAD"), "ref: refs/heads/fixture\n"); + } else { + await writeFile(metadata, "gitdir: /repository/.git/worktrees/fixture\n"); + } + const providerScript = path.join(fixture.root, "provider-git-metadata.mjs"); + // Exit 9 when the provider can see what the metadata says, exit 8 when + // it can change it. + await writeFile(providerScript, [ + "import { appendFileSync, readFileSync, readdirSync, statSync, writeFileSync } from 'node:fs';", + `const metadata = ${JSON.stringify(metadata)};`, + "const directory = statSync(metadata).isDirectory();", + "let visible = false;", + "try { visible = directory ? readdirSync(metadata).length > 0 : readFileSync(metadata).length > 0; } catch {}", + "if (visible) process.exit(9);", + "try { appendFileSync(directory ? `${metadata}/HEAD` : metadata, 'mutated\\n'); process.exit(8); } catch {}", + providerV2WriterSource({ importFs: false }), + ].join("\n")); + const result = runProviderSupervisor(fixture, { + command: `node ${JSON.stringify(providerScript)}`, + sealedPath: path.join(fixture.root, "provider-evidence/vulnerability-report.json"), + }); + expect(result.status, result.stderr).toBe(0); + }, + ); it("applies effective aggregate cgroup limits without exposing command or credentials", async () => { const fixture = await createProviderFixture(); @@ -851,7 +902,7 @@ describe("candidate archive and provider upload boundaries", () => { expect(trace.every((entry) => !processExists(entry.pid))).toBe(true); await expect(lstat(fixture.reportPath)).rejects.toMatchObject({ code: "ENOENT" }); await expect(findProviderRawReferences(fixture.reportPath, reportIdentity)).resolves.toEqual([]); - }, PROCESS_HEAVY_TIMEOUT_MS); + }); it("kills and collects an active provider when its guardian dies", async () => { const fixture = await createProviderFixture(); @@ -894,7 +945,7 @@ describe("candidate archive and provider upload boundaries", () => { sealedPath, }); expect(retried.status, retried.stderr).toBe(0); - }, 20_000); + }); it("collects the whole provider scope when its supervisor dies", async () => { const fixture = await createProviderFixture(); @@ -934,7 +985,7 @@ describe("candidate archive and provider upload boundaries", () => { await expect(lstat(cgroupRoot)).rejects.toMatchObject({ code: "ENOENT" }); expect(cgroupPids.every((pid) => !processExists(pid))).toBe(true); await expect(findProviderRawReferences(fixture.reportPath, reportIdentity)).resolves.toEqual([]); - }, 10_000); + }); it("fails closed when the guardian dies after scope collection and before commit", async () => { const fixture = await createProviderFixture(); @@ -979,7 +1030,7 @@ describe("candidate archive and provider upload boundaries", () => { await execution.completion; } } - }, 10_000); + }); it("cleans published evidence when the supervisor dies and permits same-workspace retry", async () => { const fixture = await createProviderFixture(); @@ -1025,7 +1076,7 @@ describe("candidate archive and provider upload boundaries", () => { await execution.completion; } } - }, 15_000); + }); it("observes EMFILE at the provider FD limit and still emits valid evidence", async () => { const fixture = await createProviderFixture(); @@ -1046,7 +1097,7 @@ describe("candidate archive and provider upload boundaries", () => { }); expect(result.status, result.stderr).toBe(0); await expect(lstat(fixture.reportPath)).rejects.toMatchObject({ code: "ENOENT" }); - }, 10_000); + }); it("enforces CPU RLIMIT before the independent wall-clock timeout", async () => { const fixture = await createProviderFixture(); @@ -1063,7 +1114,7 @@ describe("candidate archive and provider upload boundaries", () => { expect(result.stderr).toMatch(/exit=(?:137|152)|signal=SIG(?:XCPU|KILL)/iu); expect(result.stderr).not.toMatch(/timed out/iu); await expect(lstat(fixture.reportPath)).rejects.toMatchObject({ code: "ENOENT" }); - }, 10_000); + }); it.each(["output", "timeout"] as const)( "kills descendants and collects the scope on provider %s termination", @@ -1107,7 +1158,6 @@ describe("candidate archive and provider upload boundaries", () => { expect(cgroupPids.every((pid) => !processExists(pid))).toBe(true); await expect(findProviderRawReferences(fixture.reportPath, reportIdentity)).resolves.toEqual([]); }, - 10_000, ); it.each(["vulnerability", "provenance"] as const)( @@ -1150,7 +1200,6 @@ describe("candidate archive and provider upload boundaries", () => { await waitForChildClose(canary.child); } }, - 10_000, ); }); @@ -2173,6 +2222,27 @@ async function createProviderFixture() { }; } +/** + * Top-level entries the provider base fixture leaves behind: build output, + * installed modules (linked separately below), and other checkouts or scratch + * trees that can live inside a checkout. `.claude/worktrees/*` and + * `.worktrees/*` are other worktrees of this repository and `.tmp/*` holds + * removal-drill fixtures, each with its own node_modules; copying them filled + * every /tmp/ci-provider-upload-* root with those trees, and the suite failed + * with timeouts and ENOTEMPTY clean-ups (1103/11-04). None of them is tracked, + * so the candidate's tracked-file inventory does not miss them. + */ +const PROVIDER_BASE_FIXTURE_UNCOPIED_ENTRIES: readonly string[] = Object.freeze([ + ".release", + "artifacts", + "dist", + "node_modules", + ".claude", + ".worktrees", + ".tmp", + "graphify-out", +]); + async function ensureProviderBaseFixture(): Promise { if (providerBaseRoot) return providerBaseRoot; const sourceRoot = process.cwd(); @@ -2183,7 +2253,7 @@ async function ensureProviderBaseFixture(): Promise { const relative = path.relative(sourceRoot, source); if (!relative) return true; const first = relative.split(path.sep)[0]; - return ![".release", "artifacts", "dist", "node_modules"].includes(first ?? ""); + return !PROVIDER_BASE_FIXTURE_UNCOPIED_ENTRIES.includes(first ?? ""); }, }); // The release evidence, minus the trace and Storybook trees. Copying the diff --git a/tests/unit/architecture-lint-fixtures.test.ts b/tests/unit/architecture-lint-fixtures.test.ts new file mode 100644 index 00000000..0c37b46d --- /dev/null +++ b/tests/unit/architecture-lint-fixtures.test.ts @@ -0,0 +1,67 @@ +import { cp, mkdtemp, rm, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import path from "node:path"; + +import { ESLint } from "eslint"; +import { afterEach, describe, expect, it } from "vitest"; + +import { + ARCHITECTURE_LINT_FIXTURE_ROOT, + checkArchitectureLintFixtures, +} from "../../scripts/lib/architecture-lint-fixtures.ts"; + +const roots: string[] = []; + +afterEach(async () => { + await Promise.all(roots.splice(0).map((root) => rm(root, { recursive: true, force: true }))); +}); + +// 1103/12-04. The fixtures used to be linted under an ESLint entry of their +// own, so deleting a production layer rule still left them "rejected". +describe("architecture lint fixtures", () => { + it("are rejected by the production rules for their layer, and only the forbidden ones", async () => { + const result = await checkArchitectureLintFixtures({ + root: process.cwd(), + linter: new ESLint({ cwd: process.cwd() }), + }); + expect(result).toEqual({ allowed: 3, forbidden: 9, failures: [] }); + }, 30_000); + + it("fail when the production presentation rules lose their layer bans", async () => { + const result = await checkArchitectureLintFixtures({ + root: process.cwd(), + linter: new ESLint({ + cwd: process.cwd(), + overrideConfig: [{ + files: ["src/presentation/**/*.{ts,tsx}"], + rules: { "no-restricted-globals": "off", "no-restricted-imports": "off" }, + }], + }), + }); + expect(result.failures).toEqual(expect.arrayContaining([ + expect.stringContaining("forbidden/presentation-direct-fetch.tsx (as src/presentation/"), + expect.stringContaining("forbidden/presentation-imports-adapter.ts (as src/presentation/"), + expect.stringContaining("forbidden/template-imports-application.tsx (as src/presentation/templates/"), + ])); + expect(result.failures.join("\n")).not.toMatch(/application-imports|domain-imports/u); + }, 30_000); + + it("fail for a fixture nobody says what must reject", async () => { + const root = await mkdtemp(path.join(tmpdir(), "architecture-lint-fixtures-")); + roots.push(root); + await cp(ARCHITECTURE_LINT_FIXTURE_ROOT, path.join(root, ARCHITECTURE_LINT_FIXTURE_ROOT), { + recursive: true, + }); + await writeFile( + path.join(root, ARCHITECTURE_LINT_FIXTURE_ROOT, "forbidden/unlisted.ts"), + "export const unlisted = true;\n", + ); + const result = await checkArchitectureLintFixtures({ + root, + linter: { lintText: async () => [{ messages: [{ ruleId: "no-restricted-imports", message: "x" }] }] }, + }); + expect(result.failures).toContain( + "forbidden/unlisted.ts: not listed in ARCHITECTURE_LINT_FIXTURES, so nothing says what must reject it", + ); + }); +}); diff --git a/tests/unit/coverage-summary-artifact.test.ts b/tests/unit/coverage-summary-artifact.test.ts new file mode 100644 index 00000000..960c3c5f --- /dev/null +++ b/tests/unit/coverage-summary-artifact.test.ts @@ -0,0 +1,66 @@ +import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import path from "node:path"; + +import { afterEach, describe, expect, it } from "vitest"; + +import { loadCiGateContract } from "../../scripts/contracts/ci-gates.ts"; +import { validateCiArtifact } from "../../scripts/lib/ci-artifact-validator.ts"; + +const SUMMARY_PATH = "artifacts/tests/coverage/coverage-summary.json"; +const roots: string[] = []; + +afterEach(async () => { + await Promise.all(roots.splice(0).map((root) => rm(root, { recursive: true, force: true }))); +}); + +const counter = (total: number, covered = total) => ({ + total, + covered, + skipped: 0, + pct: total === 0 ? 100 : Math.floor((covered / total) * 10_000) / 100, +}); +const metrics = { + lines: counter(4), + statements: counter(4), + functions: counter(1), + branches: counter(2), +}; + +async function validateSummary(summary: unknown): Promise { + const contract = await loadCiGateContract(process.cwd()); + const artifact = contract.artifacts.find((entry) => entry.path === SUMMARY_PATH); + const schema = contract.artifactSchemas.find((entry) => entry.id === artifact?.schemaId); + if (!artifact || !schema) throw new Error(`the CI contract no longer declares ${SUMMARY_PATH}`); + const root = await mkdtemp(path.join(tmpdir(), "coverage-summary-artifact-")); + roots.push(root); + await mkdir(path.join(root, path.dirname(SUMMARY_PATH)), { recursive: true }); + await writeFile(path.join(root, SUMMARY_PATH), `${JSON.stringify(summary)}\n`); + await validateCiArtifact({ root, artifact, schema }); +} + +// 1103/12-09. istanbul-lib-coverage 3.2.2 puts `branchesTrue` in every blank +// summary, so the json-summary total always carries it. The CI evidence check +// refused the key that the risk-coverage gate reading the same file accepts, +// and FE-GATE-005 failed after every test had passed. +describe("coverage summary evidence (1103/12-09)", () => { + it("accepts the summary the coverage reporter writes, with branchesTrue", async () => { + await expect(validateSummary({ + total: { ...metrics, branchesTrue: counter(0) }, + "src/a.ts": metrics, + })).resolves.toBeUndefined(); + }); + + it("accepts a summary without branchesTrue", async () => { + await expect(validateSummary({ total: metrics, "src/a.ts": metrics })) + .resolves.toBeUndefined(); + }); + + it("still validates branchesTrue as a counter and refuses other keys", async () => { + await expect(validateSummary({ + total: { ...metrics, branchesTrue: { ...counter(0), pct: 0 } }, + })).rejects.toThrow(/pct/u); + await expect(validateSummary({ total: { ...metrics, branchesFalse: counter(0) } })) + .rejects.toThrow(/branchesFalse/u); + }); +}); diff --git a/tests/unit/documentation-readiness.test.ts b/tests/unit/documentation-readiness.test.ts index f639b9aa..0dcd9f13 100644 --- a/tests/unit/documentation-readiness.test.ts +++ b/tests/unit/documentation-readiness.test.ts @@ -1,5 +1,5 @@ import { spawnSync } from "node:child_process"; -import { cp, mkdtemp, readFile, rm, writeFile } from "node:fs/promises"; +import { cp, mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import path from "node:path"; @@ -10,26 +10,38 @@ const INPUTS = ["README.md", "docs", "artifacts/tests/a11y-manual"]; /** * Runs verify:documentation on a copy of its inputs, each `changes` entry * applied to its document and every `removed` file deleted. Code facts (src, - * package.json, gates.json) are read from this repository, not the copy. + * package.json, gates.json) are read from this repository, not the copy. The + * copy is a `frontend` folder; `siblings` are files written beside it, where a + * checkout of the paired repositories would be. */ async function verify( changes: Readonly string>>, removed: readonly string[] = [], + siblings: Readonly> = {}, ) { - const root = await mkdtemp(path.join(tmpdir(), "documentation-readiness-")); + const parent = await mkdtemp(path.join(tmpdir(), "documentation-readiness-")); + const root = path.join(parent, "frontend"); try { + for (const [file, content] of Object.entries(siblings)) { + await mkdir(path.dirname(path.join(parent, file)), { recursive: true }); + await writeFile(path.join(parent, file), content); + } for (const input of INPUTS) await cp(input, path.join(root, input), { recursive: true }); for (const [document, mutate] of Object.entries(changes)) { const target = path.join(root, document); await writeFile(target, mutate(await readFile(target, "utf8"))); } for (const file of removed) await rm(path.join(root, file)); - return spawnSync(process.execPath, [path.resolve("scripts/verify-documentation-readiness.ts")], { + const result = spawnSync(process.execPath, [path.resolve("scripts/verify-documentation-readiness.ts")], { cwd: root, encoding: "utf8", }); + const report = await readFile(path.join(root, "artifacts/quality/documentation-review.json"), "utf8") + .then((json) => JSON.parse(json) as { documentReferences: { path: string; unverifiedLinks?: string[] }[] }) + .catch(() => null); + return { ...result, report }; } finally { - await rm(root, { recursive: true, force: true }); + await rm(parent, { recursive: true, force: true }); } } @@ -69,7 +81,9 @@ describe("verify:documentation failure output (1101/14-06)", () => { // files now, and the current contract documents (docs/README.md ยง1) may only // name paths, package scripts and gate IDs that exist. describe("verify:documentation current contract documents (1101/14-05)", () => { - const ROUTE_IDS = /`(?:APP_HOME|EXAMPLES_[A-Z]+|NOT_FOUND|REFERENCE_RESOURCE_[A-Z]+)`/gu; + // Written without the sample's route prefix: the sample removal drill runs + // this file and refuses any file that still names the removed sample. + const ROUTE_IDS = /`(?:APP_HOME|EXAMPLES_[A-Z]+|NOT_FOUND|[A-Z]+_RESOURCE_[A-Z]+)`/gu; it("does not need README or the checklist to list route IDs", async () => { const result = await verify({ @@ -128,6 +142,62 @@ describe("verify:documentation current contract documents (1101/14-05)", () => { }); }); +// 1103/12-05. Paths inside a command and links into the paired repositories +// were never looked up: a deleted V2 test stayed in a `vitest run` command, +// and a broken link to the backend template's contract passed. +describe("verify:documentation commands and sibling links (1103/12-05)", () => { + const CI_DOC = "docs/operations/ci-quality-gates.md"; + const BACKEND = "clean-architecture-backend-template/docs/web/http-contract.md"; + + it.each([ + ["an inline command", "`corepack pnpm exec vitest run tests/integration/no-such-client.test.ts`"], + ["a shell block", "```bash\nnode tests/integration/no-such-client.test.ts --flag\n```"], + ])("fails when %s names a path that does not exist", async (_shape, line) => { + const result = await verify({ [CI_DOC]: (text) => `${text}\n${line}\n` }); + expect(result.status).toBe(1); + expect(result.stderr).toContain(`${CI_DOC} names paths that do not exist: tests/integration/no-such-client.test.ts`); + }); + + it("looks up a command's existing arguments and leaves placeholders alone", async () => { + const result = await verify({ + [CI_DOC]: (text) => `${text}\n\`corepack pnpm exec vitest run tests/unit/documentation-readiness.test.ts -t "x"\`\n` + + "```bash\ncorepack pnpm drill:runbook -- FE-RB-005 --release-root \n```\n", + }); + expect(result.status, result.stderr).toBe(0); + }); + + it("checks a link or a path into a paired repository checked out beside this one", async () => { + const naming = (target: string) => (text: string) => + `${text}\n[contract](../../../${target}) and \`${target}\`\n`; + const present = await verify( + { [CI_DOC]: naming(BACKEND) }, + [], + { [BACKEND]: "# contract\n" }, + ); + expect(present.status, present.stderr).toBe(0); + + const broken = await verify( + { [CI_DOC]: naming("clean-architecture-backend-template/docs/web/no-such.md") }, + [], + { [BACKEND]: "# contract\n" }, + ); + expect(broken.status).toBe(1); + expect(broken.stderr).toContain( + `${CI_DOC} names paths that do not exist: ../clean-architecture-backend-template/docs/web/no-such.md`, + ); + }); + + it("reports a link into a paired repository that is not checked out as unverified", async () => { + const result = await verify({ + [CI_DOC]: (text) => `${text}\n[contract](../../../clean-architecture-backend-template/docs/web/no-such.md)\n`, + }); + expect(result.status, result.stderr).toBe(0); + expect(result.stdout).toContain("not verified"); + expect(result.report?.documentReferences.find((entry) => entry.path === CI_DOC)?.unverifiedLinks) + .toEqual(["../clean-architecture-backend-template/docs/web/no-such.md"]); + }); +}); + // 1101/14-03. The entry documents drew a top-level domain layer that does not // exist, left out three of the nine src folders, and layers.md named a // minority of the architecture rules while claiming it could not drift. diff --git a/tests/unit/feature-scaffold-drill.test.ts b/tests/unit/feature-scaffold-drill.test.ts new file mode 100644 index 00000000..603118db --- /dev/null +++ b/tests/unit/feature-scaffold-drill.test.ts @@ -0,0 +1,87 @@ +import { readFile } from "node:fs/promises"; + +import { describe, expect, it } from "vitest"; + +import { loadCiGateContract } from "../../scripts/contracts/ci-gates.ts"; +import { + SCAFFOLD_DRILL_EXCLUDED_SCRIPTS, + scaffoldDrillCommands, +} from "../../scripts/lib/feature-scaffold-drill.ts"; + +// 1103/12-02. The scaffold drill claimed "every merge gate" and ran 15 +// hand-picked commands of the 88 in the merge stage. +describe("feature scaffold drill commands", () => { + it("are the merge stage minus the named exclusions, each command once", async () => { + const contract = await loadCiGateContract(process.cwd()); + const merge = contract.stages.find(({ id }) => id === "merge")!; + const mergeCommandIds = new Set( + merge.gateIds.flatMap((gateId) => contract.gates.find(({ id }) => id === gateId)!.commandIds), + ); + const commands = scaffoldDrillCommands(contract); + const runCommandIds = commands.map(({ name }) => name.split(":").slice(1).join(":")); + expect(new Set(runCommandIds).size).toBe(runCommandIds.length); + for (const commandId of mergeCommandIds) { + const command = contract.commands.find(({ id }) => id === commandId)!; + expect( + runCommandIds.includes(commandId) || Object.hasOwn(SCAFFOLD_DRILL_EXCLUDED_SCRIPTS, command.script), + commandId, + ).toBe(true); + } + expect(commands.map(({ script }) => script)).toEqual(expect.arrayContaining([ + "check:types", "lint", "test:unit", "test:coverage", "build", "check:bundle", + "test:contract", "test:runtime-schema", "check:request-fanout", "build:release-candidate", + ])); + for (const reason of Object.values(SCAFFOLD_DRILL_EXCLUDED_SCRIPTS)) { + expect(reason.length).toBeGreaterThan(10); + } + }); + + it("keeps a negative fixture's registered exit and diagnostic", async () => { + const contract = await loadCiGateContract(process.cwd()); + expect(scaffoldDrillCommands(contract).find(({ script }) => script === "check:types:fixture")) + .toMatchObject({ expectation: { kind: "fail", expectedExitCode: 1, expectedDiagnosticId: "error TS2322:" } }); + }); + + it("runs a command added to the merge stage without an edit to the drill", async () => { + const contract = structuredClone(await loadCiGateContract(process.cwd())); + contract.commands.push({ id: "check-probe", script: "check:probe", expect: "pass" } as never); + contract.gates.find(({ id }) => id === "FE-GATE-010")!.commandIds.push("check-probe"); + expect(scaffoldDrillCommands(contract).map(({ name }) => name)).toContain("FE-GATE-010:check-probe"); + }); + + it("refuses an exclusion for a command the contract runs outside the merge stage", async () => { + const contract = await loadCiGateContract(process.cwd()); + const merge = new Set(contract.stages.find(({ id }) => id === "merge")!.gateIds); + const mergeCommandIds = new Set( + contract.gates.filter(({ id }) => merge.has(id)).flatMap(({ commandIds }) => commandIds), + ); + const mergeScripts = new Set( + contract.commands.filter(({ id }) => mergeCommandIds.has(id)).map(({ script }) => script), + ); + const outside = contract.commands.find(({ script }) => !mergeScripts.has(script))!; + expect(() => scaffoldDrillCommands(contract, { + ...SCAFFOLD_DRILL_EXCLUDED_SCRIPTS, + [outside.script]: "not in the merge stage", + })).toThrow(`outside the merge stage: ${outside.script}`); + }); + + // A removal drill prunes its capability's commands from the contract, and + // this file runs inside that fixture too. + it("accepts an exclusion whose command the contract no longer has", async () => { + const contract = structuredClone(await loadCiGateContract(process.cwd())); + const removed = contract.commands.find(({ script }) => + Object.hasOwn(SCAFFOLD_DRILL_EXCLUDED_SCRIPTS, script) + )!; + contract.commands = contract.commands.filter(({ id }) => id !== removed.id); + for (const gate of contract.gates) { + gate.commandIds = gate.commandIds.filter((id) => id !== removed.id); + } + expect(() => scaffoldDrillCommands(contract)).not.toThrow(); + }); + + it("is what test:feature-scaffold runs", async () => { + const drill = await readFile("scripts/test-feature-scaffold.ts", "utf8"); + expect(drill).toContain("scaffoldDrillCommands("); + expect(drill).toContain("loadCiGateContract(fixtureRoot)"); + }); +}); diff --git a/tests/unit/navigation-policy.test.ts b/tests/unit/navigation-policy.test.ts index 35f492da..c4903c86 100644 --- a/tests/unit/navigation-policy.test.ts +++ b/tests/unit/navigation-policy.test.ts @@ -43,6 +43,16 @@ describe("installed route registry", () => { allowed: false, action: "show-sign-in", }); + // 1101/10-03. A session still being recovered waits; showing sign-in + // there would bounce a returning user out of a page they may enter. + expect(decideRouteAccess(route.routeId, "recovery-pending")).toEqual({ + allowed: false, + action: "wait-for-session", + }); + expect(decideRouteAccess(route.routeId, "authenticated")).toEqual({ + allowed: true, + action: "none", + }); } }); diff --git a/tests/unit/removal-fixture.test.ts b/tests/unit/removal-fixture.test.ts index 001b11e0..e48b8283 100644 --- a/tests/unit/removal-fixture.test.ts +++ b/tests/unit/removal-fixture.test.ts @@ -1,4 +1,5 @@ -import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises"; +import { existsSync } from "node:fs"; +import { mkdir, mkdtemp, readdir, readFile, rm, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import path from "node:path"; @@ -8,6 +9,10 @@ import { loadCiGateContract } from "../../scripts/contracts/ci-gates.ts"; import { assertNoRuntimeImports, pruneRemovalFixtureCiContract, + REMOVAL_FIXTURE_COPY_TARGETS, + REMOVAL_FIXTURE_DOCUMENT_TARGETS, + REMOVAL_FIXTURE_DOCUMENT_TESTS, + removalFixtureExcludedTests, removeRuntimeDependentTests, renderRemovalJunit, runtimeImportGraph, @@ -92,6 +97,25 @@ it("prunes removed command and evidence references and re-baselines the contract expect(packageDocument.scripts["check:ci"]).not.toMatch(/reduced/u); }); +// 1103/16-02. A product feature owns no CI script, so its removal prunes +// nothing. The baseline reason then ended in a blank ("removal fixture pruned +// ") and the baseline schema refused it before any gate ran. +it("re-baselines a removal that prunes no CI script", async () => { + const root = await copyCiContract("removal-fixture-no-scripts-"); + + await pruneRemovalFixtureCiContract({ + root, + removedScripts: new Set(), + removedEvidencePathFragments: [], + }); + + const baseline = JSON.parse( + await readFile(path.join(root, "config/ci/contract-baseline.json"), "utf8"), + ) as Record; + expect(baseline["reason"]).toBe("removal fixture pruned no CI scripts"); + await expect(loadCiGateContract(root)).resolves.toBeDefined(); +}); + it("rejects a contract that no longer matches its committed baseline", async () => { const root = await copyCiContract("removal-fixture-baseline-drift-"); const baselinePath = path.join(root, "config/ci/contract-baseline.json"); @@ -113,6 +137,47 @@ it("rejects pruning that leaves a reduced gate without commands", async () => { })).rejects.toThrow(/commandIds|too small|at least 1/i); }); +// 1103/02-06. Three FE-GATE-020 drills copied the repository without its +// documents and still ran the tests that read them, so each failed its `test` +// check on ENOENT whatever it removed. Only the sample drill excluded them. +describe("document tests in a removal fixture", () => { + it("leaves the document tests out exactly when the documents are not copied", () => { + expect(removalFixtureExcludedTests(REMOVAL_FIXTURE_COPY_TARGETS)) + .toEqual(REMOVAL_FIXTURE_DOCUMENT_TESTS); + expect(removalFixtureExcludedTests([ + ...REMOVAL_FIXTURE_COPY_TARGETS, + ...REMOVAL_FIXTURE_DOCUMENT_TARGETS, + ])).toEqual([]); + }); + + // This file also runs inside the capability fixtures, which hold neither + // the documents nor these tests; the two go together. + it("names tests that read the documents, present exactly where the documents are", async () => { + const documentsPresent = REMOVAL_FIXTURE_DOCUMENT_TARGETS.every((target) => existsSync(target)); + for (const test of REMOVAL_FIXTURE_DOCUMENT_TESTS) { + expect(existsSync(test), test).toBe(documentsPresent); + if (documentsPresent) { + await expect(readFile(test, "utf8")).resolves.toMatch(/README\.md|CHANGELOG\.md/u); + } + } + }); + + it("is the only exclusion list: every drill prepares its fixture through it", async () => { + const drills: string[] = []; + for (const name of await readdir("scripts")) { + if (!/^test-.*\.ts$/u.test(name)) continue; + const source = await readFile(path.join("scripts", name), "utf8"); + if (!source.includes("./lib/removal-fixture.ts")) continue; + drills.push(name); + expect(source, name).toContain("prepareRemovalFixture("); + for (const test of REMOVAL_FIXTURE_DOCUMENT_TESTS) { + expect(source, name).not.toContain(test); + } + } + expect(drills).toEqual(expect.arrayContaining(["test-sample-removal.ts", "test-feature-scaffold.ts"])); + }); +}); + describe("release evidence fixture copy", () => { it("keeps the release evidence and leaves the regenerated trees behind", async () => { const { copyReleaseEvidenceTree, RELEASE_EVIDENCE_REGENERATED_TREES } = diff --git a/tests/unit/runbook-drill.test.ts b/tests/unit/runbook-drill.test.ts index 38d85701..8bd5bfab 100644 --- a/tests/unit/runbook-drill.test.ts +++ b/tests/unit/runbook-drill.test.ts @@ -125,5 +125,10 @@ describe("runbook drill verdicts", () => { expect(source).not.toMatch(/assertion\([^;]*,\s*true\s*\)/u); expect(source).not.toMatch(/Asserted:\s*true\b/u); expect(source).not.toMatch(/injectedMountFailure\s*=\s*true/u); + // 0929/11-08. The drill records string verdicts now; the patterns above + // only knew the old boolean shape, so a constant "PASS" went unnoticed. + expect(source).not.toMatch(/assertion\([^;]*,\s*["']PASS["']\s*,?\s*\)/u); + expect(source).not.toMatch(/(?:Asserted|AsExpected):\s*["']PASS["']/u); + expect(source).not.toMatch(/verdict\(\s*true\s*\)/u); }); }); diff --git a/tests/unit/task3-selective-integration.test.ts b/tests/unit/task3-selective-integration.test.ts index 9a000c10..fcc47b9b 100644 --- a/tests/unit/task3-selective-integration.test.ts +++ b/tests/unit/task3-selective-integration.test.ts @@ -1,7 +1,9 @@ import { spawn } from "node:child_process"; +import { writeFileSync } from "node:fs"; import { lstat, mkdir, mkdtemp, readFile, readdir, rename, rm, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import path from "node:path"; +import { pathToFileURL } from "node:url"; import { afterEach, describe, expect, it } from "vitest"; @@ -15,6 +17,14 @@ import { generateCiWorkflow } from "../../scripts/generate-ci-workflow.ts"; import { validatePackageScriptGraph } from "../../scripts/lib/package-script-graph.ts"; const roots: string[] = []; +/** + * Test watchdog only, as in tests/integration/provider-guardian-transaction.test.ts. + * It bounds a hang. The wrapper has no protocol deadline for EOF, and a loaded + * host can take longer than a second just to start a child. + */ +const PROCESS_WATCHDOG_MS = 5_000; +/** The extra pipe on which spawnLoadedScopeWrapper reports the wrapper loaded. */ +const SCOPE_WRAPPER_LOADED_FD = 3; afterEach(async () => { await Promise.all(roots.splice(0).map((root) => rm(root, { recursive: true, force: true }))); @@ -154,23 +164,24 @@ describe("selective Task 3 contract closure", () => { const reportPath = path.join(root, "raw.json"); await writeFile(reportPath, "partial\n"); const identity = await lstat(reportPath); - const child = spawn(process.execPath, [ - path.resolve("scripts/lib/provider-scope-wrapper.ts"), + const child = spawnLoadedScopeWrapper(await mkdtemp(path.join(tmpdir(), "provider-scope-loader-")), [ "1", reportPath, String(identity.dev), String(identity.ino), - ], { stdio: ["pipe", "pipe", "pipe"] }); + ]); const completion = waitForChildResult(child); + await waitForScopeWrapperLoaded(child); + // Time to exit on its own, which it must not do before EOF. await new Promise((resolve) => setTimeout(resolve, 75)); expect(child.exitCode).toBeNull(); await expect(readFile(reportPath, "utf8")).resolves.toBe("partial\n"); - child.stdin.end(); - const result = await within(completion, 1_000, "provider scope EOF close"); + child.stdin!.end(); + const result = await within(completion, PROCESS_WATCHDOG_MS, "provider scope EOF close"); expect(result).toEqual({ code: 125, signal: null }); await expect(lstat(reportPath)).rejects.toMatchObject({ code: "ENOENT" }); await expect(readdir(root)).resolves.toEqual([]); - }); + }, PROCESS_WATCHDOG_MS * 3); it("tracks npm run-script dependencies instead of bypassing the graph", () => { expect(validatePackageScriptGraph({ root: "npm run-script missing" }, "root")) @@ -224,6 +235,43 @@ describe("selective Task 3 contract closure", () => { }); }); +/** + * 1103/10-01. Starts the unchanged scope wrapper through a loader that writes + * one byte to an extra pipe once the import has finished: by then the wrapper + * has opened its liveness channel and attached the EOF handler. Closing stdin + * at a fixed 75 ms put the child's whole start-up inside the EOF limit, and a + * loaded host failed the test with "EOF close timed out". The wrapper reads its + * launch identity from argv after the main module, so the loader takes the + * wrapper's place there. + */ +function spawnLoadedScopeWrapper( + loaderDirectory: string, + launchArguments: readonly string[], +): ReturnType { + roots.push(loaderDirectory); + const loader = path.join(loaderDirectory, "provider-scope-loaded.mjs"); + writeFileSync(loader, [ + 'import { closeSync, writeSync } from "node:fs";', + `await import(${JSON.stringify( + pathToFileURL(path.resolve("scripts/lib/provider-scope-wrapper.ts")).href, + )});`, + `writeSync(${SCOPE_WRAPPER_LOADED_FD}, "1");`, + `closeSync(${SCOPE_WRAPPER_LOADED_FD});`, + "", + ].join("\n")); + return spawn(process.execPath, [loader, ...launchArguments], { + stdio: ["pipe", "pipe", "pipe", "pipe"], + }); +} + +async function waitForScopeWrapperLoaded(child: ReturnType): Promise { + const loaded = (child.stdio as readonly unknown[])[SCOPE_WRAPPER_LOADED_FD] as NodeJS.ReadableStream; + await within(new Promise((resolve, reject) => { + loaded.once("data", () => resolve()); + loaded.once("end", () => reject(new Error("provider scope wrapper exited before it loaded"))); + }), PROCESS_WATCHDOG_MS, "provider scope wrapper start-up"); +} + async function waitForChildResult( child: ReturnType, ): Promise> {