@dailephd/my-dev-kit-lab 0.4.5 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (263) hide show
  1. package/CHANGELOG.md +26 -1
  2. package/README.md +43 -3
  3. package/dist/scripts/cli.js +9 -0
  4. package/dist/src/audits/core/typescriptJavaScriptAnalyzer.js +30 -12
  5. package/dist/src/browser/index.js +2 -0
  6. package/dist/src/browser/playwrightRuntime.js +74 -0
  7. package/dist/src/browser/types.js +10 -0
  8. package/dist/src/cli/help.js +376 -0
  9. package/dist/src/cli/index.js +2 -0
  10. package/dist/src/cli/runLabCli.js +257 -0
  11. package/dist/src/commands/runAuditCommand.js +132 -0
  12. package/dist/src/commands/runControlledExperimentCommand.js +7 -3
  13. package/dist/{scripts/experiments/describeExperiment.js → src/commands/runExperimentDescribeCommand.js} +14 -10
  14. package/dist/{scripts/experiments/listExperiments.js → src/commands/runExperimentListCommand.js} +3 -6
  15. package/dist/{scripts/experiments/runExperiment.js → src/commands/runExperimentRunCommand.js} +80 -22
  16. package/dist/src/commands/runFinalDemoCommand.js +2 -3
  17. package/dist/src/commands/runSecurityValidationCommand.js +271 -0
  18. package/dist/src/commands/runTutorialRunCommand.js +170 -0
  19. package/dist/src/commands/runTutorialValidateCommand.js +138 -0
  20. package/dist/src/core/processTree.js +52 -0
  21. package/dist/src/core/resolveCommand.js +34 -0
  22. package/dist/src/core/runMeasuredCommand.js +39 -31
  23. package/dist/src/runtime/index.js +4 -0
  24. package/dist/src/runtime/labExecutionContext.js +22 -0
  25. package/dist/src/runtime/managedProcess.js +380 -0
  26. package/dist/src/runtime/packageResource.js +22 -0
  27. package/dist/src/runtime/packageRoot.js +37 -0
  28. package/dist/src/screenshot/captureReportScreenshot.js +30 -27
  29. package/dist/src/securityValidation/packageChecks/requiredPackageContents.js +14 -1
  30. package/dist/src/tutorial/index.js +16 -0
  31. package/dist/src/tutorial/loadTutorialContracts.js +60 -0
  32. package/dist/src/tutorial/markdownTutorialWriter.js +53 -0
  33. package/dist/src/tutorial/runTutorial.js +465 -0
  34. package/dist/src/tutorial/scenarioValidation.js +383 -0
  35. package/dist/src/tutorial/subtitleWriter.js +88 -0
  36. package/dist/src/tutorial/targetContractValidation.js +212 -0
  37. package/dist/src/tutorial/tutorialActions.js +110 -0
  38. package/dist/src/tutorial/tutorialArtifacts.js +176 -0
  39. package/dist/src/tutorial/tutorialAssertions.js +249 -0
  40. package/dist/src/tutorial/tutorialCursor.js +149 -0
  41. package/dist/src/tutorial/tutorialLocators.js +37 -0
  42. package/dist/src/tutorial/tutorialManifest.js +74 -0
  43. package/dist/src/tutorial/tutorialOverlay.js +180 -0
  44. package/dist/src/tutorial/tutorialPaths.js +86 -0
  45. package/dist/src/tutorial/tutorialSession.js +398 -0
  46. package/dist/src/tutorial/types.js +48 -0
  47. package/dist/src/tutorial/validationPrimitives.js +141 -0
  48. package/examples/tutorial-browser/index.html +47 -0
  49. package/examples/tutorial-browser/prepare.mjs +14 -0
  50. package/examples/tutorial-browser/scenario.json +17 -0
  51. package/examples/tutorial-browser/server.mjs +14 -0
  52. package/package.json +13 -9
  53. package/dist/scripts/audits/runAudit.js +0 -135
  54. package/dist/scripts/build-gallery.js +0 -3
  55. package/dist/scripts/capture-demo-report.js +0 -3
  56. package/dist/scripts/evaluate-token-savings.js +0 -2
  57. package/dist/scripts/generate-experiment-plots.js +0 -3
  58. package/dist/scripts/generate-prompt-variants.js +0 -2
  59. package/dist/scripts/render-experiment-report.js +0 -2
  60. package/dist/scripts/report-context-integrity-smoke.js +0 -70
  61. package/dist/scripts/run-agent-prompt.js +0 -2
  62. package/dist/scripts/run-controlled-experiment.js +0 -2
  63. package/dist/scripts/run-lab-demo.js +0 -5
  64. package/dist/scripts/run-visualization-demos.js +0 -3
  65. package/dist/scripts/security/resolveToolRoot.js +0 -16
  66. package/dist/scripts/security/runCodeql.js +0 -58
  67. package/dist/scripts/security/runDependencyChecks.js +0 -58
  68. package/dist/scripts/security/runFuzzSmoke.js +0 -29
  69. package/dist/scripts/security/runPackageChecks.js +0 -57
  70. package/dist/scripts/security/runSemgrep.js +0 -64
  71. package/dist/scripts/security/validate.js +0 -266
  72. package/dist/scripts/verify-benchmarks.js +0 -202
  73. package/examples/demo-report-input.json +0 -78
  74. package/examples/lab-demo-cases.json +0 -35
  75. package/examples/real-agent-campaign-cases.json +0 -118
  76. package/tests/fixtures/android/advanced-security-fixtures/backup-configuration/module-a/src/debug/res/xml/ambiguous_backup_rules.xml +0 -4
  77. package/tests/fixtures/android/advanced-security-fixtures/backup-configuration/module-a/src/main/res/xml/ambiguous_backup_rules.xml +0 -4
  78. package/tests/fixtures/android/advanced-security-fixtures/backup-configuration/module-a/src/main/res/xml/backup_rules.xml +0 -5
  79. package/tests/fixtures/android/advanced-security-fixtures/backup-configuration/module-a/src/main/res/xml/broad_backup_rules.xml +0 -4
  80. package/tests/fixtures/android/advanced-security-fixtures/backup-configuration/module-a/src/main/res/xml/data_extraction_rules.xml +0 -10
  81. package/tests/fixtures/android/advanced-security-fixtures/backup-configuration/module-a/src/main/res/xml/unsupported_domain_rules.xml +0 -4
  82. package/tests/fixtures/android/advanced-security-fixtures/backup-configuration/module-b/src/main/res/xml/malformed_backup_rules.xml +0 -4
  83. package/tests/fixtures/android/advanced-security-fixtures/backup-configuration/module-b/src/main/res/xml/unsupported_root.xml +0 -4
  84. package/tests/fixtures/android/advanced-security-fixtures/network-security/module-a/src/debug/res/xml/ambiguous_config.xml +0 -4
  85. package/tests/fixtures/android/advanced-security-fixtures/network-security/module-a/src/main/res/xml/ambiguous_config.xml +0 -4
  86. package/tests/fixtures/android/advanced-security-fixtures/network-security/module-a/src/main/res/xml/base_cleartext_false.xml +0 -8
  87. package/tests/fixtures/android/advanced-security-fixtures/network-security/module-a/src/main/res/xml/broad_and_duplicate_domains.xml +0 -8
  88. package/tests/fixtures/android/advanced-security-fixtures/network-security/module-a/src/main/res/xml/empty_domain.xml +0 -6
  89. package/tests/fixtures/android/advanced-security-fixtures/network-security/module-a/src/main/res/xml/malformed_pin.xml +0 -11
  90. package/tests/fixtures/android/advanced-security-fixtures/network-security/module-a/src/main/res/xml/network_security_config.xml +0 -26
  91. package/tests/fixtures/android/advanced-security-fixtures/network-security/module-b/src/main/res/xml/malformed_network_security_config.xml +0 -6
  92. package/tests/fixtures/android/advanced-security-fixtures/network-security/module-b/src/main/res/xml/unsupported_root.xml +0 -4
  93. package/tests/fixtures/android/advanced-security-fixtures/release-configuration/groovy-release-debuggable-dynamic.gradle +0 -7
  94. package/tests/fixtures/android/advanced-security-fixtures/release-configuration/groovy-release-debuggable-false.gradle +0 -9
  95. package/tests/fixtures/android/advanced-security-fixtures/release-configuration/groovy-release-debuggable-true.gradle +0 -13
  96. package/tests/fixtures/android/advanced-security-fixtures/release-configuration/kotlin-release-debuggable-false.gradle.kts +0 -7
  97. package/tests/fixtures/android/advanced-security-fixtures/release-configuration/kotlin-release-debuggable-true.gradle.kts +0 -10
  98. package/tests/fixtures/android/advanced-security-fixtures/release-configuration/missing-release-build-type.gradle.kts +0 -7
  99. package/tests/fixtures/android/advanced-security-fixtures/resource-resolution/module-a/src/debug/res/xml/network_security_config.xml +0 -8
  100. package/tests/fixtures/android/advanced-security-fixtures/resource-resolution/module-a/src/main/res/xml/backup_rules.xml +0 -4
  101. package/tests/fixtures/android/advanced-security-fixtures/resource-resolution/module-a/src/main/res/xml/network_security_config.xml +0 -8
  102. package/tests/fixtures/android/advanced-security-fixtures/resource-resolution/module-b/src/main/res/xml/malformed_network_security_config.xml +0 -7
  103. package/tests/fixtures/android/advanced-security-fixtures/secret-candidates/SampleActivity.java +0 -8
  104. package/tests/fixtures/android/advanced-security-fixtures/secret-candidates/SampleActivity.kt +0 -9
  105. package/tests/fixtures/android/advanced-security-fixtures/secret-candidates/build.gradle +0 -11
  106. package/tests/fixtures/android/advanced-security-fixtures/secret-candidates/build.gradle.kts +0 -11
  107. package/tests/fixtures/android/advanced-security-fixtures/secret-candidates/google-services.json +0 -16
  108. package/tests/fixtures/android/advanced-security-fixtures/secret-candidates/local.properties +0 -3
  109. package/tests/fixtures/android/advanced-security-fixtures/secret-candidates-bounds/module/binary.properties +0 -0
  110. package/tests/fixtures/android/advanced-security-fixtures/secret-candidates-bounds/module/oversized.json +0 -1
  111. package/tests/fixtures/android/advanced-security-fixtures/signing-configuration/app/fake-release-keystore.jks +0 -1
  112. package/tests/fixtures/android/advanced-security-fixtures/signing-configuration/build/generated-fake.keystore +0 -1
  113. package/tests/fixtures/android/compose-app/app/build.gradle.kts +0 -21
  114. package/tests/fixtures/android/compose-app/app/src/main/AndroidManifest.xml +0 -22
  115. package/tests/fixtures/android/compose-app/app/src/main/java/com/example/composeapp/MainActivity.kt +0 -11
  116. package/tests/fixtures/android/compose-app/build.gradle.kts +0 -4
  117. package/tests/fixtures/android/compose-app/gradle/wrapper/gradle-wrapper.properties +0 -4
  118. package/tests/fixtures/android/compose-app/settings.gradle.kts +0 -2
  119. package/tests/fixtures/android/gradle-metadata-fixtures/catalog-only-plugin/build.gradle.kts +0 -3
  120. package/tests/fixtures/android/gradle-metadata-fixtures/catalog-only-plugin/gradle/libs.versions.toml +0 -5
  121. package/tests/fixtures/android/gradle-metadata-fixtures/comment-safety.gradle.kts +0 -21
  122. package/tests/fixtures/android/gradle-metadata-fixtures/dynamic-values.gradle.kts +0 -17
  123. package/tests/fixtures/android/gradle-metadata-fixtures/groovy-literal.gradle +0 -23
  124. package/tests/fixtures/android/gradle-metadata-fixtures/wrapper-malformed.properties +0 -4
  125. package/tests/fixtures/android/gradle-metadata-fixtures/wrapper-missing-url.properties +0 -3
  126. package/tests/fixtures/android/gradle-metadata-fixtures/wrapper-with-checksum.properties +0 -5
  127. package/tests/fixtures/android/java-app/app/build.gradle +0 -16
  128. package/tests/fixtures/android/java-app/app/src/main/AndroidManifest.xml +0 -19
  129. package/tests/fixtures/android/java-app/app/src/main/java/com/example/javaapp/MainActivity.java +0 -4
  130. package/tests/fixtures/android/java-app/build.gradle +0 -3
  131. package/tests/fixtures/android/java-app/gradle/wrapper/gradle-wrapper.properties +0 -4
  132. package/tests/fixtures/android/java-app/settings.gradle +0 -2
  133. package/tests/fixtures/android/library/build.gradle.kts +0 -3
  134. package/tests/fixtures/android/library/gradle/wrapper/gradle-wrapper.properties +0 -4
  135. package/tests/fixtures/android/library/mylibrary/build.gradle.kts +0 -13
  136. package/tests/fixtures/android/library/mylibrary/src/main/AndroidManifest.xml +0 -2
  137. package/tests/fixtures/android/library/settings.gradle.kts +0 -2
  138. package/tests/fixtures/android/manifest-audit-fixtures/incomplete-intent-filter.xml +0 -14
  139. package/tests/fixtures/android/manifest-audit-fixtures/malformed-exported.xml +0 -10
  140. package/tests/fixtures/android/manifest-audit-fixtures/malformed.xml +0 -5
  141. package/tests/fixtures/android/manifest-audit-fixtures/missing-application.xml +0 -7
  142. package/tests/fixtures/android/manifest-audit-fixtures/missing-component-name.xml +0 -11
  143. package/tests/fixtures/android/manifest-audit-fixtures/permission-coverage.xml +0 -29
  144. package/tests/fixtures/android/manifest-audit-fixtures/risky-components.xml +0 -62
  145. package/tests/fixtures/android/manifest-audit-fixtures/risky-deep-links.xml +0 -45
  146. package/tests/fixtures/android/manifest-audit-fixtures/unresolved-placeholder.xml +0 -14
  147. package/tests/fixtures/android/manifest-audit-fixtures/unusual-namespace-prefix.xml +0 -11
  148. package/tests/fixtures/android/multi-module/app/build.gradle.kts +0 -22
  149. package/tests/fixtures/android/multi-module/app/src/androidTest/java/com/example/multimodule/app/ExampleInstrumentedTest.kt +0 -3
  150. package/tests/fixtures/android/multi-module/app/src/main/AndroidManifest.xml +0 -11
  151. package/tests/fixtures/android/multi-module/app/src/test/java/com/example/multimodule/app/ExampleUnitTest.kt +0 -3
  152. package/tests/fixtures/android/multi-module/build.gradle.kts +0 -5
  153. package/tests/fixtures/android/multi-module/core/build.gradle.kts +0 -14
  154. package/tests/fixtures/android/multi-module/core/src/main/AndroidManifest.xml +0 -2
  155. package/tests/fixtures/android/multi-module/feature-login/build.gradle.kts +0 -18
  156. package/tests/fixtures/android/multi-module/feature-login/src/main/AndroidManifest.xml +0 -2
  157. package/tests/fixtures/android/multi-module/gradle/libs.versions.toml +0 -8
  158. package/tests/fixtures/android/multi-module/gradle/wrapper/gradle-wrapper.properties +0 -4
  159. package/tests/fixtures/android/multi-module/settings.gradle.kts +0 -4
  160. package/tests/fixtures/android/non-android-gradle/build.gradle.kts +0 -3
  161. package/tests/fixtures/android/non-android-gradle/core/build.gradle.kts +0 -3
  162. package/tests/fixtures/android/non-android-gradle/core/src/main/java/com/example/core/Core.java +0 -4
  163. package/tests/fixtures/android/non-android-gradle/gradle/wrapper/gradle-wrapper.properties +0 -4
  164. package/tests/fixtures/android/non-android-gradle/settings.gradle.kts +0 -2
  165. package/tests/fixtures/android/partial/app/build.gradle.kts +0 -7
  166. package/tests/fixtures/android/partial/settings.gradle.kts +0 -2
  167. package/tests/fixtures/android/xml-view-app/app/build.gradle.kts +0 -17
  168. package/tests/fixtures/android/xml-view-app/app/src/main/AndroidManifest.xml +0 -31
  169. package/tests/fixtures/android/xml-view-app/app/src/main/kotlin/com/example/xmlviewapp/MainActivity.kt +0 -7
  170. package/tests/fixtures/android/xml-view-app/app/src/main/res/layout/activity_main.xml +0 -4
  171. package/tests/fixtures/android/xml-view-app/build.gradle.kts +0 -4
  172. package/tests/fixtures/android/xml-view-app/gradle/wrapper/gradle-wrapper.properties +0 -4
  173. package/tests/fixtures/android/xml-view-app/settings.gradle.kts +0 -2
  174. package/tests/fixtures/audits/mixed-language/mixed-docs-claims/README.md +0 -16
  175. package/tests/fixtures/audits/mixed-language/mixed-docs-claims/build.gradle.kts +0 -4
  176. package/tests/fixtures/audits/mixed-language/mixed-docs-claims/src/main/java/com/example/Widget.java +0 -7
  177. package/tests/fixtures/audits/mixed-language/mixed-docs-claims/src/main/kotlin/com/example/Gadget.kt +0 -7
  178. package/tests/fixtures/audits/mixed-language/mixed-generated-vendor/README.md +0 -10
  179. package/tests/fixtures/audits/mixed-language/mixed-generated-vendor/build/Main.class +0 -1
  180. package/tests/fixtures/audits/mixed-language/mixed-generated-vendor/dist/index.js +0 -1
  181. package/tests/fixtures/audits/mixed-language/mixed-generated-vendor/generated/schema.ts +0 -1
  182. package/tests/fixtures/audits/mixed-language/mixed-generated-vendor/src/index.ts +0 -3
  183. package/tests/fixtures/audits/mixed-language/mixed-generated-vendor/vendor/lib.py +0 -2
  184. package/tests/fixtures/audits/mixed-language/mixed-java-kotlin/README.md +0 -10
  185. package/tests/fixtures/audits/mixed-language/mixed-java-kotlin/build.gradle.kts +0 -8
  186. package/tests/fixtures/audits/mixed-language/mixed-java-kotlin/settings.gradle.kts +0 -1
  187. package/tests/fixtures/audits/mixed-language/mixed-java-kotlin/src/main/java/com/example/FooService.java +0 -7
  188. package/tests/fixtures/audits/mixed-language/mixed-java-kotlin/src/main/kotlin/com/example/BarService.kt +0 -7
  189. package/tests/fixtures/audits/mixed-language/mixed-java-kotlin/src/test/java/com/example/FooServiceTest.java +0 -8
  190. package/tests/fixtures/audits/mixed-language/mixed-java-kotlin/src/test/kotlin/com/example/BarServiceTest.kt +0 -8
  191. package/tests/fixtures/audits/mixed-language/mixed-python-ts/README.md +0 -8
  192. package/tests/fixtures/audits/mixed-language/mixed-python-ts/src/app.py +0 -7
  193. package/tests/fixtures/audits/mixed-language/mixed-python-ts/src/index.ts +0 -3
  194. package/tests/fixtures/audits/mixed-language/mixed-python-ts/tests/test_app.py +0 -5
  195. package/tests/fixtures/audits/mixed-language/mixed-ts-js/README.md +0 -7
  196. package/tests/fixtures/audits/mixed-language/mixed-ts-js/src/helper.js +0 -5
  197. package/tests/fixtures/audits/mixed-language/mixed-ts-js/src/index.ts +0 -3
  198. package/tests/fixtures/audits/mixed-language/mixed-ts-js/tests/index.sample.ts +0 -5
  199. package/tests/fixtures/audits/mixed-language/mixed-ts-python-jvm/README.md +0 -10
  200. package/tests/fixtures/audits/mixed-language/mixed-ts-python-jvm/build.gradle.kts +0 -4
  201. package/tests/fixtures/audits/mixed-language/mixed-ts-python-jvm/pytests/test_app.py +0 -5
  202. package/tests/fixtures/audits/mixed-language/mixed-ts-python-jvm/src/app.py +0 -2
  203. package/tests/fixtures/audits/mixed-language/mixed-ts-python-jvm/src/helper.js +0 -5
  204. package/tests/fixtures/audits/mixed-language/mixed-ts-python-jvm/src/index.ts +0 -3
  205. package/tests/fixtures/audits/mixed-language/mixed-ts-python-jvm/src/main/java/com/example/Multiplier.java +0 -7
  206. package/tests/fixtures/audits/mixed-language/mixed-ts-python-jvm/src/main/kotlin/com/example/Divider.kt +0 -7
  207. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/corrected-replay/derived/run-integrity-evidence.json +0 -99
  208. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/corrected-replay/producer/implementation-audit.json +0 -1585
  209. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/corrected-replay/producer/implementation-capsule.json +0 -11455
  210. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/00-request.txt +0 -1
  211. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/artifacts/architecture-context-packet.txt +0 -82
  212. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/artifacts/behavior-model.txt +0 -104
  213. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/artifacts/final-report.txt +0 -41
  214. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/artifacts/implementation-context-packet.txt +0 -114
  215. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/artifacts/implementation-report.txt +0 -92
  216. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/artifacts/judge-report.txt +0 -34
  217. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/artifacts/pseudocode-packet.txt +0 -244
  218. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/artifacts/request-brief.txt +0 -40
  219. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/artifacts/test-context-packet.txt +0 -93
  220. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/artifacts/test-implementation-report.txt +0 -69
  221. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/artifacts/test-strategy-packet.txt +0 -354
  222. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/artifacts/verification-report.txt +0 -85
  223. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/derived/run-integrity-evidence.json +0 -98
  224. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/producer/architecture-audit.json +0 -1169
  225. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/producer/architecture-request.json +0 -29
  226. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/producer/implementation-audit.json +0 -1494
  227. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/producer/implementation-capsule.json +0 -11364
  228. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/producer/implementation-request.json +0 -33
  229. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/producer/test-request.json +0 -74
  230. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/reports/architecture-context-retrieval-report.txt +0 -58
  231. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/reports/implementation-context-retrieval-report.txt +0 -75
  232. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/reports/test-context-retrieval-report.txt +0 -84
  233. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/run.json +0 -62
  234. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/tool-versions/my-dev-kit-version.txt +0 -1
  235. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run/tool-versions/orchestrator-version.txt +0 -1
  236. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/manifests/corrected-replay-manifest.json +0 -19
  237. package/tests/fixtures/ecosystem/context-integrity/v0.4.5/manifests/failed-run-manifest.json +0 -56
  238. package/tests/fixtures/fake-adversarial-cli.js +0 -152
  239. package/tests/fixtures/fake-my-dev-kit-cli.js +0 -83
  240. package/tests/fixtures/full-workflow-library/complete-v1.0.0.json +0 -24
  241. package/tests/fixtures/full-workflow-library/future-minor-v1.1.0-additive.json +0 -25
  242. package/tests/fixtures/stage-context-expectations/complete-v1.0.0.json +0 -230
  243. package/tests/fixtures/stage-context-expectations/future-minor-v1.1.0-additive.json +0 -232
  244. package/tests/fixtures/stage-context-expectations/invalid/malformed-json.txt +0 -1
  245. package/tests/fixtures/stage-context-expectations/invalid/non-object-root.json +0 -1
  246. package/tests/fixtures/stage-context-expectations/minimal-v1.0.0.json +0 -18
  247. package/tests/fixtures/upstream-artifacts/invalid/malformed-json.txt +0 -1
  248. package/tests/fixtures/upstream-artifacts/invalid/non-object-root.json +0 -1
  249. package/tests/fixtures/upstream-artifacts/my-dev-kit/1.10.2/context-capsule/complete-v1.0.0.json +0 -504
  250. package/tests/fixtures/upstream-artifacts/my-dev-kit/1.10.2/context-capsule/future-minor-v1.1.0-additive.json +0 -955
  251. package/tests/fixtures/upstream-artifacts/my-dev-kit/1.10.2/retrieval-audit-record/complete-v1.0.0.json +0 -190
  252. package/tests/fixtures/upstream-artifacts/my-dev-kit/1.10.2/retrieval-audit-record/future-minor-v1.1.0-additive.json +0 -327
  253. package/tests/fixtures/upstream-artifacts/my-dev-kit/1.10.4/PROVENANCE.txt +0 -18
  254. package/tests/fixtures/upstream-artifacts/my-dev-kit/1.10.4/context-capsule/complete-v1.0.0.json +0 -556
  255. package/tests/fixtures/upstream-artifacts/my-dev-kit/1.10.4/retrieval-audit-record/complete-v1.0.0.json +0 -238
  256. package/tests/fixtures/upstream-artifacts/my-dev-kit-1.10.2-identity/PROVENANCE.txt +0 -13
  257. package/tests/fixtures/upstream-artifacts/my-dev-kit-1.10.2-identity/context-capsule.json +0 -7874
  258. package/tests/fixtures/upstream-artifacts/my-dev-kit-1.10.2-identity/retrieval-audit-record.json +0 -1076
  259. package/tests/fixtures/upstream-artifacts/my-dev-kit-orchestrator/1.2.1/workflow-instruction-packet/complete-v1.0.0.json +0 -160
  260. package/tests/fixtures/upstream-artifacts/my-dev-kit-orchestrator/1.2.1/workflow-instruction-packet/future-minor-v1.1.0-additive.json +0 -186
  261. package/tests/fixtures/upstream-artifacts/my-dev-kit-orchestrator/1.2.3/run-integrity/PROVENANCE.txt +0 -31
  262. package/tests/fixtures/upstream-artifacts/my-dev-kit-orchestrator/1.2.3/run-integrity/ready-pass-final-pass.json +0 -132
  263. package/tests/fixtures/upstream-artifacts/my-dev-kit-orchestrator/1.2.3/run-integrity/refresh-required-need-context.json +0 -146
@@ -0,0 +1,48 @@
1
+ /**
2
+ * v0.4.7 tutorial domain contracts.
3
+ *
4
+ * Everything here is declarative and serializable by design. A scenario can
5
+ * describe what to do, but it can never carry JavaScript, a shell command, or
6
+ * an arbitrary URL -- those escape hatches are deliberately absent from the
7
+ * union types below and are rejected by validation, not merely undocumented.
8
+ */
9
+ export const TUTORIAL_SCHEMA_VERSION = "1.0.0";
10
+ export const TARGET_CONTRACT_SCHEMA_VERSION = "1.0.0";
11
+ /** Result schema version for TutorialRunResultV1. */
12
+ export const TUTORIAL_RUN_RESULT_SCHEMA_VERSION = "1.0.0";
13
+ export const MAX_TUTORIAL_STEPS = 500;
14
+ export const MAX_STEP_PAUSE_MS = 60_000;
15
+ export const MIN_VIEWPORT_WIDTH = 320;
16
+ export const MAX_VIEWPORT_WIDTH = 3840;
17
+ export const MIN_VIEWPORT_HEIGHT = 240;
18
+ export const MAX_VIEWPORT_HEIGHT = 2160;
19
+ export const DEFAULT_TUTORIAL_ACTION_TIMEOUT_MS = 5_000;
20
+ export const DEFAULT_TUTORIAL_ASSERTION_TIMEOUT_MS = 5_000;
21
+ /** Stable, path-safe, lowercase identifier shape shared by every tutorial id. */
22
+ export const TUTORIAL_ID_PATTERN = /^[a-z0-9][a-z0-9._-]*$/;
23
+ /** The only placeholder a trusted target contract may use. */
24
+ export const TARGET_ROOT_PLACEHOLDER = "{{targetRoot}}";
25
+ export const TUTORIAL_LOCATOR_KINDS = ["role", "text", "css", "test-id"];
26
+ export const TUTORIAL_ACTION_TYPES = [
27
+ "goto",
28
+ "click",
29
+ "fill",
30
+ "press",
31
+ "hover",
32
+ "drag",
33
+ "wait-for"
34
+ ];
35
+ export const TUTORIAL_GOTO_WAIT_UNTIL = ["load", "domcontentloaded", "networkidle"];
36
+ export const TUTORIAL_WAIT_FOR_STATES = ["visible", "hidden", "attached", "detached"];
37
+ export const TUTORIAL_ASSERTION_TYPES = [
38
+ "element-visible",
39
+ "text-equals",
40
+ "text-contains",
41
+ "url-path-equals",
42
+ "attribute-equals",
43
+ "http-json-equals",
44
+ "json-file-equals",
45
+ "file-exists"
46
+ ];
47
+ export const TUTORIAL_CALLOUT_PLACEMENTS = ["auto", "top", "right", "bottom", "left"];
48
+ export const TUTORIAL_TARGET_PROCESS_CWDS = ["contract-root", "target-root"];
@@ -0,0 +1,141 @@
1
+ import { TUTORIAL_ID_PATTERN } from "./types.js";
2
+ export function createErrorCollector(source) {
3
+ const errors = [];
4
+ return {
5
+ add(location, message) {
6
+ errors.push(`${source} validation failed at ${location}: ${message}`);
7
+ },
8
+ get errors() {
9
+ return errors;
10
+ },
11
+ get length() {
12
+ return errors.length;
13
+ }
14
+ };
15
+ }
16
+ export function isPlainObject(value) {
17
+ return typeof value === "object" && value !== null && !Array.isArray(value);
18
+ }
19
+ export function isNonEmptyString(value) {
20
+ return typeof value === "string" && value.trim().length > 0;
21
+ }
22
+ export function isStableId(value) {
23
+ return typeof value === "string" && TUTORIAL_ID_PATTERN.test(value);
24
+ }
25
+ /** Finite positive integer. Rejects NaN, Infinity, zero, negatives and floats. */
26
+ export function isPositiveInteger(value) {
27
+ return typeof value === "number" && Number.isInteger(value) && value > 0;
28
+ }
29
+ /** Finite non-negative integer. Rejects NaN, Infinity, negatives and floats. */
30
+ export function isNonNegativeInteger(value) {
31
+ return typeof value === "number" && Number.isInteger(value) && value >= 0;
32
+ }
33
+ export function isJsonScalar(value) {
34
+ return (value === null ||
35
+ typeof value === "string" ||
36
+ typeof value === "boolean" ||
37
+ (typeof value === "number" && Number.isFinite(value)));
38
+ }
39
+ export function describeValue(value) {
40
+ if (value === undefined)
41
+ return "undefined";
42
+ if (value === null)
43
+ return "null";
44
+ if (typeof value === "string")
45
+ return JSON.stringify(value);
46
+ if (typeof value === "number" || typeof value === "boolean")
47
+ return String(value);
48
+ if (Array.isArray(value))
49
+ return "an array";
50
+ if (typeof value === "object")
51
+ return "an object";
52
+ return typeof value;
53
+ }
54
+ /**
55
+ * Enforces the exact supported schema version. Prompt 2 supports 1.0.0 only and
56
+ * never reinterprets or auto-upgrades another version, including another minor.
57
+ */
58
+ export function validateSchemaVersion(errors, value, supported) {
59
+ if (value === undefined) {
60
+ errors.add("schemaVersion", `missing required schemaVersion; expected "${supported}".`);
61
+ return;
62
+ }
63
+ if (typeof value !== "string") {
64
+ errors.add("schemaVersion", `expected the string "${supported}", received ${describeValue(value)}.`);
65
+ return;
66
+ }
67
+ if (value !== supported) {
68
+ errors.add("schemaVersion", `unsupported schemaVersion ${JSON.stringify(value)}; this build supports "${supported}" only.`);
69
+ }
70
+ }
71
+ export function validateStableId(errors, location, value) {
72
+ if (!isNonEmptyString(value)) {
73
+ errors.add(location, `expected a non-empty id string, received ${describeValue(value)}.`);
74
+ return false;
75
+ }
76
+ if (!isStableId(value)) {
77
+ errors.add(location, `id ${JSON.stringify(value)} must match ${String(TUTORIAL_ID_PATTERN)} (lowercase letters, digits, dot, underscore, hyphen; must start with a letter or digit).`);
78
+ return false;
79
+ }
80
+ return true;
81
+ }
82
+ export function validateStringRecord(errors, location, value) {
83
+ if (value === undefined) {
84
+ return undefined;
85
+ }
86
+ if (!isPlainObject(value)) {
87
+ errors.add(location, `expected an object of string values, received ${describeValue(value)}.`);
88
+ return undefined;
89
+ }
90
+ let valid = true;
91
+ for (const [key, entry] of Object.entries(value)) {
92
+ if (key.length === 0) {
93
+ errors.add(location, "environment variable names must not be empty.");
94
+ valid = false;
95
+ continue;
96
+ }
97
+ if (typeof entry !== "string") {
98
+ errors.add(`${location}.${key}`, `expected a string value, received ${describeValue(entry)}.`);
99
+ valid = false;
100
+ }
101
+ }
102
+ return valid ? value : undefined;
103
+ }
104
+ export function validateStringArray(errors, location, value) {
105
+ if (value === undefined) {
106
+ return undefined;
107
+ }
108
+ if (!Array.isArray(value)) {
109
+ errors.add(location, `expected an array of strings, received ${describeValue(value)}.`);
110
+ return undefined;
111
+ }
112
+ let valid = true;
113
+ value.forEach((entry, index) => {
114
+ if (typeof entry !== "string") {
115
+ errors.add(`${location}[${index}]`, `expected a string, received ${describeValue(entry)}.`);
116
+ valid = false;
117
+ }
118
+ });
119
+ return valid ? value : undefined;
120
+ }
121
+ /**
122
+ * Optional timeout fields must be finite positive integers when supplied. Zero,
123
+ * negative values, NaN and Infinity are all rejected rather than silently
124
+ * coerced to a default.
125
+ */
126
+ export function validateOptionalTimeout(errors, location, value) {
127
+ if (value === undefined) {
128
+ return;
129
+ }
130
+ if (!isPositiveInteger(value)) {
131
+ errors.add(location, `expected a finite positive integer number of milliseconds, received ${describeValue(value)}.`);
132
+ }
133
+ }
134
+ export function rejectUnknownKeys(errors, location, value, allowed) {
135
+ const allowedSet = new Set(allowed);
136
+ for (const key of Object.keys(value)) {
137
+ if (!allowedSet.has(key)) {
138
+ errors.add(`${location}.${key}`, `unknown field ${JSON.stringify(key)} is not part of this contract.`);
139
+ }
140
+ }
141
+ }
@@ -0,0 +1,47 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>Tutorial Fixture</title>
6
+ <style>
7
+ body { font: 16px/1.5 system-ui, sans-serif; margin: 0; padding: 24px; background: #f6f7f9; color: #111; }
8
+ h1 { margin: 0 0 16px; font-size: 28px; }
9
+ .panel { background: #fff; border: 1px solid #d8dbe0; border-radius: 8px; padding: 16px; margin-bottom: 16px; }
10
+ .row { display: flex; gap: 16px; align-items: flex-start; }
11
+ .col { flex: 1; }
12
+ button { font: inherit; padding: 8px 16px; border-radius: 6px; border: 1px solid #5a6270; background: #fff; cursor: pointer; }
13
+ button:hover { background: #eef1f5; }
14
+ input { font: inherit; padding: 8px; border: 1px solid #b8bec8; border-radius: 6px; width: 100%; box-sizing: border-box; }
15
+ .dropzone { min-height: 72px; border: 2px dashed #9aa3af; border-radius: 8px; padding: 12px; }
16
+ .card { background: #dde7ff; border: 1px solid #5f7fd6; border-radius: 6px; padding: 10px; width: 140px; }
17
+ .hidden { display: none; }
18
+ #status-banner { padding: 10px; border-radius: 6px; background: #e8f5e9; border: 1px solid #66bb6a; }
19
+ </style>
20
+ </head>
21
+ <body>
22
+ <h1 id="page-title">Tutorial Fixture</h1>
23
+ <div class="panel"><p id="intro-text">Welcome to the generic tutorial fixture.</p><button id="primary-action" data-testid="primary-action" data-state="idle">Activate</button> <span id="activation-count" data-testid="activation-count">0</span></div>
24
+ <div class="panel"><label for="name-field">Your name</label><input id="name-field" data-testid="name-field" aria-label="Your name" /><p id="greeting" data-testid="greeting"></p></div>
25
+ <div class="panel"><button id="hover-target" data-testid="hover-target">Hover me</button><p id="hover-readout" data-testid="hover-readout">not hovered</p></div>
26
+ <div class="panel row"><div class="col"><div id="drag-card" data-testid="drag-card" class="card" draggable="true">Draggable card</div></div><div class="col"><div id="drop-zone" data-testid="drop-zone" class="dropzone">Drop target</div></div></div>
27
+ <div class="panel"><div id="status-banner" data-testid="status-banner" class="hidden">Delayed banner is now visible</div></div>
28
+ <script>
29
+ (() => {
30
+ let activations = 0;
31
+ const primary = document.getElementById("primary-action");
32
+ primary.addEventListener("click", () => { activations += 1; document.getElementById("activation-count").textContent = String(activations); primary.setAttribute("data-state", "activated"); });
33
+ const nameField = document.getElementById("name-field");
34
+ const greeting = document.getElementById("greeting");
35
+ nameField.addEventListener("input", () => { greeting.textContent = nameField.value ? `Hello, ${nameField.value}` : ""; });
36
+ nameField.addEventListener("keydown", event => { if (event.key === "Enter") greeting.textContent = `Submitted: ${nameField.value}`; });
37
+ document.getElementById("hover-target").addEventListener("mouseenter", () => { document.getElementById("hover-readout").textContent = "hovered"; });
38
+ const dragCard = document.getElementById("drag-card");
39
+ const dropZone = document.getElementById("drop-zone");
40
+ dragCard.addEventListener("dragstart", event => event.dataTransfer.setData("text/plain", "drag-card"));
41
+ dropZone.addEventListener("dragover", event => event.preventDefault());
42
+ dropZone.addEventListener("drop", event => { event.preventDefault(); dropZone.textContent = "Dropped"; dropZone.setAttribute("data-dropped", "true"); });
43
+ window.setTimeout(() => document.getElementById("status-banner").classList.remove("hidden"), 300);
44
+ })();
45
+ </script>
46
+ </body>
47
+ </html>
@@ -0,0 +1,14 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+
5
+ const sourceRoot = path.dirname(fileURLToPath(import.meta.url));
6
+ const targetRoot = process.argv[2];
7
+ if (!targetRoot) {
8
+ console.error("prepare requires a target root argument");
9
+ process.exit(2);
10
+ }
11
+ fs.mkdirSync(path.join(targetRoot, "app"), { recursive: true });
12
+ fs.mkdirSync(path.join(targetRoot, "out"), { recursive: true });
13
+ for (const file of ["index.html", "server.mjs"]) fs.copyFileSync(path.join(sourceRoot, file), path.join(targetRoot, "app", file));
14
+ fs.writeFileSync(path.join(targetRoot, "out", "report.json"), JSON.stringify({ prepared: true, counts: { widgets: 3 } }, null, 2), "utf8");
@@ -0,0 +1,17 @@
1
+ {
2
+ "schemaVersion": "1.0.0",
3
+ "id": "lab-browser-fixture",
4
+ "title": "Lab browser fixture tutorial",
5
+ "description": "A generic, lab-owned tutorial that exercises browser actions, locators, assertions and visual declarations against a local static fixture app.",
6
+ "targetId": "lab-browser-fixture",
7
+ "browser": { "viewport": { "width": 1024, "height": 768 } },
8
+ "steps": [
9
+ { "id": "open-app", "narration": "Open the fixture application in the browser.", "action": { "type": "goto", "path": "/", "waitUntil": "load" }, "highlight": { "kind": "css", "selector": "#page-title" }, "callout": { "text": "This is the fixture application.", "locator": { "kind": "css", "selector": "#page-title" }, "placement": "bottom" }, "screenshot": { "id": "app-open" }, "assertions": [ { "type": "url-path-equals", "expected": "/" }, { "type": "element-visible", "locator": { "kind": "role", "role": "heading", "name": "Tutorial Fixture" } }, { "type": "text-equals", "locator": { "kind": "css", "selector": "#page-title" }, "expected": "Tutorial Fixture" }, { "type": "file-exists", "path": "out/report.json" }, { "type": "json-file-equals", "path": "out/report.json", "pointer": "/counts/widgets", "expected": 3 }, { "type": "http-json-equals", "path": "/api/status", "pointer": "/ok", "expected": true } ] },
10
+ { "id": "activate", "narration": "Click the primary action button to activate the panel.", "action": { "type": "click", "locator": { "kind": "test-id", "testId": "primary-action" } }, "highlight": { "kind": "test-id", "testId": "primary-action" }, "callout": { "text": "Clicking here activates the panel.", "placement": "auto", "locator": { "kind": "test-id", "testId": "primary-action" } }, "screenshot": { "id": "activated" }, "assertions": [ { "type": "text-equals", "locator": { "kind": "test-id", "testId": "activation-count" }, "expected": "1" }, { "type": "attribute-equals", "locator": { "kind": "test-id", "testId": "primary-action" }, "name": "data-state", "expected": "activated" } ] },
11
+ { "id": "fill-name", "narration": "Type a name into the form field.", "action": { "type": "fill", "locator": { "kind": "test-id", "testId": "name-field" }, "value": "Ada" }, "assertions": [ { "type": "text-contains", "locator": { "kind": "test-id", "testId": "greeting" }, "expected": "Hello, Ada" } ] },
12
+ { "id": "submit-name", "narration": "Press Enter to submit the name.", "action": { "type": "press", "locator": { "kind": "test-id", "testId": "name-field" }, "key": "Enter" }, "screenshot": { "id": "submitted" }, "assertions": [ { "type": "text-contains", "locator": { "kind": "test-id", "testId": "greeting" }, "expected": "Submitted: Ada" } ] },
13
+ { "id": "hover-button", "narration": "Hover the secondary button to reveal its state.", "action": { "type": "hover", "locator": { "kind": "test-id", "testId": "hover-target" } }, "assertions": [ { "type": "text-equals", "locator": { "kind": "test-id", "testId": "hover-readout" }, "expected": "hovered" } ] },
14
+ { "id": "drag-card", "narration": "Drag the card onto the drop target.", "action": { "type": "drag", "source": { "kind": "test-id", "testId": "drag-card" }, "target": { "kind": "test-id", "testId": "drop-zone" } }, "highlight": { "kind": "test-id", "testId": "drop-zone" }, "screenshot": { "id": "dropped" }, "assertions": [ { "type": "attribute-equals", "locator": { "kind": "test-id", "testId": "drop-zone" }, "name": "data-dropped", "expected": "true" } ] },
15
+ { "id": "wait-banner", "narration": "Wait for the delayed status banner to appear.", "action": { "type": "wait-for", "locator": { "kind": "text", "text": "Delayed banner is now visible" }, "state": "visible", "timeoutMs": 5000 }, "callout": { "text": "The banner appears after a short delay." }, "screenshot": { "id": "banner-visible" }, "assertions": [ { "type": "element-visible", "locator": { "kind": "test-id", "testId": "status-banner" } } ] }
16
+ ]
17
+ }
@@ -0,0 +1,14 @@
1
+ import http from "node:http";
2
+ import fs from "node:fs";
3
+ import path from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+
6
+ const root = path.dirname(fileURLToPath(import.meta.url));
7
+ const port = Number(process.env.TUTORIAL_FIXTURE_PORT || 0);
8
+ const server = http.createServer((req, res) => {
9
+ const url = new URL(req.url ?? "/", "http://127.0.0.1");
10
+ if (url.pathname === "/api/status") { res.writeHead(200, { "content-type": "application/json" }); res.end(JSON.stringify({ ok: true, widgets: 3 })); return; }
11
+ const filePath = url.pathname === "/" ? path.join(root, "index.html") : path.join(root, url.pathname);
12
+ fs.readFile(filePath, (error, contents) => { if (error) { res.writeHead(404); res.end("not found"); return; } res.writeHead(200, { "content-type": filePath.endsWith(".html") ? "text/html" : "application/octet-stream" }); res.end(contents); });
13
+ });
14
+ server.listen(port, "127.0.0.1", () => console.log("tutorial fixture listening on " + server.address().port));
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@dailephd/my-dev-kit-lab",
3
- "version": "0.4.5",
3
+ "version": "0.4.7",
4
4
  "type": "module",
5
5
  "description": "Evidence, benchmark, and evaluation companion for my-dev-kit.",
6
6
  "bin": {
7
- "my-dev-kit-lab": "dist/scripts/run-final-demo.js"
7
+ "my-dev-kit-lab": "dist/scripts/cli.js"
8
8
  },
9
9
  "files": [
10
10
  "CHANGELOG.md",
11
- "dist/scripts/",
12
- "!dist/scripts/docs/",
11
+ "dist/scripts/cli.js",
12
+ "dist/scripts/run-final-demo.js",
13
13
  "dist/src/",
14
14
  "benchmarks/",
15
15
  "docs/METRICS.md",
16
- "examples/",
17
- "tests/fixtures/"
16
+ "examples/token-savings-cases.json",
17
+ "examples/tutorial-browser/"
18
18
  ],
19
19
  "repository": {
20
20
  "type": "git",
@@ -72,6 +72,7 @@
72
72
  "test:plots": "vitest run tests/plots tests/commands/generateExperimentPlotsCommand.spec.ts",
73
73
  "test:visualization-demos": "vitest run tests/visualizationDemos tests/commands/runVisualizationDemosCommand.spec.ts",
74
74
  "verify:benchmarks": "tsx scripts/verify-benchmarks.ts",
75
+ "verify:packed-package": "node scripts/verify-packed-package.mjs",
75
76
  "docs:check": "node scripts/check-docs.mjs",
76
77
  "verify": "npm run build && npm run verify:benchmarks",
77
78
  "security:deps": "tsx scripts/security/runDependencyChecks.ts",
@@ -79,22 +80,25 @@
79
80
  "security:codeql": "tsx scripts/security/runCodeql.ts",
80
81
  "security:semgrep": "tsx scripts/security/runSemgrep.ts",
81
82
  "test:security": "vitest run tests/security/",
83
+ "test:tutorial-browser": "vitest run tests/integration/tutorialRealBrowser.spec.ts",
82
84
  "test:fuzz:smoke": "tsx scripts/security/runFuzzSmoke.ts",
83
85
  "security:validate": "tsx scripts/security/validate.ts",
84
86
  "audit": "tsx scripts/audits/runAudit.ts",
85
87
  "report:context-integrity-smoke": "tsx scripts/report-context-integrity-smoke.ts"
86
88
  },
89
+ "dependencies": {
90
+ "playwright": "1.60.0"
91
+ },
87
92
  "devDependencies": {
88
93
  "@types/node": "^24.0.0",
89
- "playwright": "^1.54.1",
90
94
  "tsx": "^4.20.3",
91
95
  "typescript": "^5.8.3",
92
- "vitest": "^3.2.4"
96
+ "vitest": "^4.1.11"
93
97
  },
94
98
  "overrides": {
95
99
  "vite": "7.3.6"
96
100
  },
97
101
  "engines": {
98
- "node": ">=20"
102
+ "node": ">=24"
99
103
  }
100
104
  }
@@ -1,135 +0,0 @@
1
- #!/usr/bin/env node
2
- import { parseAuditArgs, normalizeAuditConfig } from "../../src/audits/core/auditConfig.js";
3
- import { resolveAuditTarget } from "../../src/audits/core/auditTarget.js";
4
- import { runAudit } from "../../src/audits/core/auditRunner.js";
5
- import { AUDIT_EXIT_CODES } from "../../src/audits/core/auditExitCode.js";
6
- import { resolveToolRoot } from "../security/resolveToolRoot.js";
7
- import { buildAuditReportModel } from "../../src/audits/report/auditReportModel.js";
8
- import { writeAuditReports } from "../../src/audits/report/writeAuditReports.js";
9
- // ---------------------------------------------------------------------------
10
- // v0.3.0 Batch 5 -- npm run audit entrypoint.
11
- //
12
- // Thin wiring only: parse args -> normalize config -> resolve target ->
13
- // runAudit() -> buildAuditReportModel() -> writeAuditReports() -> print a
14
- // concise console summary -> set process.exitCode. All report-shaping logic
15
- // (the former inline buildJsonReport()/renderMinimalTextSummary()/
16
- // summarizeInventory()/summarizeSourceOfTruth() functions from Batch 1/2)
17
- // now lives in src/audits/report/ -- see auditReportModel.ts,
18
- // renderAuditJsonReport.ts, renderAuditTextReport.ts, writeAuditReports.ts.
19
- // Mirrors the structure of scripts/security/validate.ts.
20
- // ---------------------------------------------------------------------------
21
- const USAGE = "Usage: npm run audit -- [--target <path>] [--types code-rot,security] " +
22
- "[--include docs,tests,package,architecture,cli] [--format text,json] " +
23
- "[--fail-on blocker|high|medium|low|none] [--out <path>] [--android]\n" +
24
- "\n" +
25
- " --android opts into Batch 2's programmatic Android security integration.\n" +
26
- " Requires --types to include \"security\" (e.g. --types security or --types\n" +
27
- " code-rot,security). Runs the same static, read-only, nineteen-check\n" +
28
- " Android validation security:validate --profile android performs --\n" +
29
- " detection, manifest parsing, and internal advanced security checks --\n" +
30
- " through the existing security adapter, never a subprocess. Confirmed\n" +
31
- " findings are mapped into the normal issue collection; CandidateEvidence\n" +
32
- " remains a separate, bounded summary and is never treated as a confirmed\n" +
33
- " issue. Starts zero Gradle operations, zero external tools, and zero\n" +
34
- " network operations by default; --android does not expose any of those.\n" +
35
- " Example: npm run audit -- --target \"<android-project-path>\" --types security --android --format text,json --fail-on none";
36
- const rawArgs = process.argv.slice(2);
37
- const toolRoot = resolveToolRoot(import.meta.url);
38
- // Help deliberately wins over every other argument, mirroring
39
- // scripts/security/validate.ts -- no config normalization, target
40
- // resolution, audit execution, or report write.
41
- if (rawArgs.includes("--help") || rawArgs.includes("-h")) {
42
- console.log(USAGE);
43
- process.exitCode = 0;
44
- process.exit(0);
45
- }
46
- let config;
47
- try {
48
- const args = parseAuditArgs(rawArgs);
49
- config = normalizeAuditConfig(args, toolRoot);
50
- }
51
- catch (err) {
52
- const msg = err instanceof Error ? err.message : String(err);
53
- console.error(`\nERROR: ${msg}`);
54
- console.error(USAGE);
55
- process.exitCode = AUDIT_EXIT_CODES.FATAL_ERROR;
56
- process.exit(AUDIT_EXIT_CODES.FATAL_ERROR);
57
- }
58
- let target;
59
- try {
60
- target = resolveAuditTarget(config.targetPathArg, toolRoot);
61
- }
62
- catch (err) {
63
- const msg = err instanceof Error ? err.message : String(err);
64
- console.error(`\nERROR: ${msg}`);
65
- console.error(USAGE);
66
- process.exitCode = AUDIT_EXIT_CODES.FATAL_ERROR;
67
- process.exit(AUDIT_EXIT_CODES.FATAL_ERROR);
68
- }
69
- console.log("=".repeat(60));
70
- console.log("my-dev-kit-lab audit");
71
- console.log("=".repeat(60));
72
- console.log(`Tool root : ${toolRoot}`);
73
- if (!target.isSelf) {
74
- console.log(`Target : ${target.rootPath}`);
75
- }
76
- else {
77
- console.log(`Mode : self-audit`);
78
- }
79
- console.log(`Types : ${config.types.join(", ")}`);
80
- console.log(`Include : ${config.include.join(", ")}`);
81
- console.log("");
82
- let result;
83
- try {
84
- result = await runAudit({ config, toolRoot, target });
85
- }
86
- catch (err) {
87
- const msg = err instanceof Error ? err.message : String(err);
88
- console.error(`\nERROR: audit runtime failure: ${msg}`);
89
- process.exitCode = AUDIT_EXIT_CODES.FATAL_ERROR;
90
- process.exit(AUDIT_EXIT_CODES.FATAL_ERROR);
91
- }
92
- const model = buildAuditReportModel(result, { target });
93
- const { writtenPaths } = writeAuditReports({ model, config, outDir: config.out });
94
- console.log(`Issues found : ${model.summary.totalIssues}`);
95
- console.log(` blocker=${model.summary.issuesBySeverity.blocker} high=${model.summary.issuesBySeverity.high} medium=${model.summary.issuesBySeverity.medium} low=${model.summary.issuesBySeverity.low} info=${model.summary.issuesBySeverity.info}`);
96
- console.log(`Skipped detectors : ${model.summary.skippedDetectorCount}`);
97
- if (model.summary.detectorErrorCount > 0) {
98
- console.log(`Detector errors : ${model.summary.detectorErrorCount}`);
99
- for (const e of model.detectorErrors) {
100
- console.log(` [${e.id}] ${e.message}`);
101
- }
102
- }
103
- if (model.summary.noDetectorsRegistered && !model.securitySummary.ran) {
104
- console.log(`Note: no code-rot detectors are registered for this run's --types/--include selection -- this run collected inventory/source-of-truth data only.`);
105
- }
106
- if (model.securitySummary.ran) {
107
- console.log(`\nSecurity validation: verdict=${model.securitySummary.verdictLabel} checks=${model.securitySummary.totalChecks} findings(blocker=${model.securitySummary.findingCounts.blocker} major=${model.securitySummary.findingCounts.major} minor=${model.securitySummary.findingCounts.minor} info=${model.securitySummary.findingCounts.informational})`);
108
- if (model.securitySummary.reportPaths.text) {
109
- console.log(` Full report: ${model.securitySummary.reportPaths.text}`);
110
- }
111
- }
112
- if (model.androidSecurity.summary.requested) {
113
- const android = model.androidSecurity.summary;
114
- console.log(`\nAndroid security validation: status=${android.status} applicable=${android.applicable ?? "n/a"} verdict=${android.verdict ?? "(unknown)"} checks=${android.totalChecks} confirmed=${android.confirmedFindingCount} mappedIssues=${android.mappedIssueCount} candidates=${android.candidateSummary.totalCount}`);
115
- if (android.reportPaths.text) {
116
- console.log(` Full report: ${android.reportPaths.text}`);
117
- }
118
- }
119
- console.log(`\nInventory: ${model.inventory.totalScannedFileCount} file(s) scanned, ${model.inventory.skippedFileCount} skipped`);
120
- console.log(` source=${model.inventory.filesByCategory.source} tests=${model.inventory.filesByCategory.tests} docs=${model.inventory.filesByCategory.docs} package=${model.inventory.filesByCategory.package} config=${model.inventory.filesByCategory.config} scripts=${model.inventory.filesByCategory.scripts} ci=${model.inventory.filesByCategory.ci}`);
121
- console.log(`Source of truth: package=${model.sourceOfTruth.packageName ?? "(none)"}@${model.sourceOfTruth.packageVersion ?? "?"} readme=${model.sourceOfTruth.hasReadme} changelog=${model.sourceOfTruth.hasChangelog} ciWorkflows=${model.sourceOfTruth.ciWorkflowCount}`);
122
- console.log(`Source facts: ${model.sourceFacts.totalFilesAnalyzed} file(s) analyzed (parsed=${model.sourceFacts.filesByParseStatus.parsed} file-level-only=${model.sourceFacts.filesByParseStatus["file-level-only"]} unsupported=${model.sourceFacts.filesByParseStatus.unsupported})`);
123
- if (writtenPaths.length > 0) {
124
- console.log(`\nReports written:`);
125
- for (const p of writtenPaths) {
126
- console.log(` ${p}`);
127
- }
128
- }
129
- console.log(`\nHighest severity: ${model.summary.highestSeverity ?? "(none)"}`);
130
- console.log(`Verdict: ${model.summary.finalVerdictLabel}`);
131
- console.log(`Exit reason: ${model.exit.reason}`);
132
- console.log(model.exit.code === AUDIT_EXIT_CODES.SUCCESS
133
- ? `Exit 0 -- audit completed.`
134
- : `Exit 1 -- fail-on threshold breached.`);
135
- process.exitCode = model.exit.code;
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { runBuildGalleryCommand } from "../src/commands/buildGalleryCommand.js";
3
- process.exitCode = await runBuildGalleryCommand(process.argv.slice(2));
@@ -1,3 +0,0 @@
1
- import { runCaptureDemoReportCommand } from "../src/commands/captureDemoReport.js";
2
- const exitCode = await runCaptureDemoReportCommand(process.argv.slice(2));
3
- process.exitCode = exitCode;
@@ -1,2 +0,0 @@
1
- import { runEvaluateTokenSavingsCommand } from "../src/commands/evaluateTokenSavings.js";
2
- process.exitCode = await runEvaluateTokenSavingsCommand(process.argv.slice(2));
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { runGenerateExperimentPlotsCommand } from "../src/commands/generateExperimentPlotsCommand.js";
3
- process.exitCode = await runGenerateExperimentPlotsCommand(process.argv.slice(2));
@@ -1,2 +0,0 @@
1
- import { runGeneratePromptVariantsCommand } from "../src/commands/generatePromptVariants.js";
2
- process.exitCode = await runGeneratePromptVariantsCommand(process.argv.slice(2));
@@ -1,2 +0,0 @@
1
- import { runRenderExperimentReportCommand } from "../src/commands/renderExperimentReportCommand.js";
2
- process.exitCode = await runRenderExperimentReportCommand(process.argv.slice(2));
@@ -1,70 +0,0 @@
1
- // v0.4.5 context-integrity evaluation: report smoke script. Loads the frozen failed-run and
2
- // corrected-replay fixtures, evaluates them through the existing producer-readiness bridge,
3
- // and writes JSON/text/HTML reports for manual inspection. Not part of any release-readiness
4
- // gate; a developer convenience for inspecting ContextIntegrityReportV1 output.
5
- import { mkdirSync, writeFileSync } from "node:fs";
6
- import { loadContextIntegrityFixture } from "../src/evaluation/ecosystemFixtures/loadContextIntegrityFixture.js";
7
- import { evaluateProducerReadinessBridge } from "../src/evaluation/stageContextMetrics/evaluateProducerReadinessBridge.js";
8
- import { calculateStageContextDeterminism } from "../src/evaluation/stageContextDeterminism/calculateStageContextDeterminism.js";
9
- import { buildContextIntegrityReport } from "../src/report/experiments/buildContextIntegrityReport.js";
10
- import { renderContextIntegrityJsonReport } from "../src/report/experiments/renderContextIntegrityJsonReport.js";
11
- import { renderContextIntegrityText } from "../src/report/experiments/renderContextIntegrityText.js";
12
- import { renderContextIntegrityHtml } from "../src/report/experiments/renderContextIntegrityHtml.js";
13
- const CASES = [
14
- {
15
- kind: "failed-run",
16
- root: "tests/fixtures/ecosystem/context-integrity/v0.4.5/failed-run",
17
- manifest: "tests/fixtures/ecosystem/context-integrity/v0.4.5/manifests/failed-run-manifest.json"
18
- },
19
- {
20
- kind: "corrected-replay",
21
- root: "tests/fixtures/ecosystem/context-integrity/v0.4.5/corrected-replay",
22
- manifest: "tests/fixtures/ecosystem/context-integrity/v0.4.5/manifests/corrected-replay-manifest.json"
23
- }
24
- ];
25
- async function main() {
26
- const outDir = "lab-output/context-integrity-report-smoke";
27
- mkdirSync(outDir, { recursive: true });
28
- for (const c of CASES) {
29
- const fixture = await loadContextIntegrityFixture(c.root, c.manifest);
30
- if (!fixture.ok) {
31
- console.error(`Fixture load failed for ${c.kind}:`, fixture.issues);
32
- process.exitCode = 1;
33
- continue;
34
- }
35
- const bridgeResult = evaluateProducerReadinessBridge({
36
- implementation: { role: "implementation", contextCapsule: fixture.implementationCapsule, retrievalAuditRecord: fixture.implementationAudit },
37
- readiness: fixture.runIntegrityEvidence?.gate.implementationContext,
38
- runIntegrityEvidence: fixture.runIntegrityEvidence,
39
- expectations: {
40
- schemaVersion: "1.0.0",
41
- caseId: "CASE-SMOKE",
42
- title: "smoke",
43
- description: "smoke",
44
- expectedEvidence: [],
45
- expectedStates: {},
46
- warnings: [],
47
- producerReadinessExpectations: {}
48
- }
49
- });
50
- const determinism = calculateStageContextDeterminism([
51
- { runNumber: 1, value: bridgeResult },
52
- { runNumber: 2, value: bridgeResult }
53
- ]);
54
- const report = buildContextIntegrityReport({
55
- fixtureKind: c.kind,
56
- manifest: fixture.manifest,
57
- hashVerification: fixture.hashVerification,
58
- capsule: fixture.implementationCapsule,
59
- audit: fixture.implementationAudit,
60
- bridgeResult,
61
- determinism,
62
- fixtureSelfImmutable: true
63
- });
64
- writeFileSync(`${outDir}/${c.kind}.report.json`, renderContextIntegrityJsonReport(report), "utf8");
65
- writeFileSync(`${outDir}/${c.kind}.report.txt`, renderContextIntegrityText(report), "utf8");
66
- writeFileSync(`${outDir}/${c.kind}.report.html`, renderContextIntegrityHtml(report), "utf8");
67
- console.log(`Wrote ${c.kind} reports. endToEnd=${report.endToEnd?.category}`);
68
- }
69
- }
70
- main();
@@ -1,2 +0,0 @@
1
- import { runAgentPromptCommand } from "../src/commands/runAgentPromptCommand.js";
2
- process.exitCode = await runAgentPromptCommand(process.argv.slice(2));
@@ -1,2 +0,0 @@
1
- import { runControlledExperimentCommand } from "../src/commands/runControlledExperimentCommand.js";
2
- process.exitCode = await runControlledExperimentCommand(process.argv.slice(2));
@@ -1,5 +0,0 @@
1
- import { runLabDemoCommand } from "../src/commands/runLabDemo.js";
2
- const exitCode = await runLabDemoCommand(process.argv.slice(2));
3
- if (exitCode !== 0) {
4
- process.exitCode = exitCode;
5
- }
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { runVisualizationDemosCommand } from "../src/commands/runVisualizationDemosCommand.js";
3
- process.exitCode = await runVisualizationDemosCommand(process.argv.slice(2));
@@ -1,16 +0,0 @@
1
- import fs from "node:fs";
2
- import path from "node:path";
3
- import { fileURLToPath } from "node:url";
4
- export function resolveToolRoot(moduleUrl) {
5
- let current = path.dirname(fileURLToPath(moduleUrl));
6
- while (true) {
7
- if (fs.existsSync(path.join(current, "package.json"))) {
8
- return current;
9
- }
10
- const parent = path.dirname(current);
11
- if (parent === current) {
12
- return process.cwd();
13
- }
14
- current = parent;
15
- }
16
- }