@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,132 @@
1
+ import { parseAuditArgs, normalizeAuditConfig } from "../audits/core/auditConfig.js";
2
+ import { resolveAuditTarget } from "../audits/core/auditTarget.js";
3
+ import { runAudit } from "../audits/core/auditRunner.js";
4
+ import { AUDIT_EXIT_CODES } from "../audits/core/auditExitCode.js";
5
+ import { buildAuditReportModel } from "../audits/report/auditReportModel.js";
6
+ import { writeAuditReports } from "../audits/report/writeAuditReports.js";
7
+ import { createLabExecutionContext } from "../runtime/index.js";
8
+ // ---------------------------------------------------------------------------
9
+ // v0.4.6 Batch 3 -- reusable audit command owner.
10
+ //
11
+ // Extracted from scripts/audits/runAudit.ts (formerly a top-level script
12
+ // with inline try/catch + process.exit()) so both the contributor npm
13
+ // script and the installed CLI router (src/cli/) can call the same
14
+ // argument-parsing/target-resolution/report-writing path instead of
15
+ // maintaining two implementations. Detector/severity/report-schema policy
16
+ // is untouched -- this module only owns CLI argument handling, target
17
+ // resolution, the runAudit() call, report writing, and exit-code mapping.
18
+ // ---------------------------------------------------------------------------
19
+ export const AUDIT_USAGE = "Usage: my-dev-kit-lab audit [--target <path>] [--types code-rot,security] " +
20
+ "[--include docs,tests,package,architecture,cli] [--format text,json] " +
21
+ "[--fail-on blocker|high|medium|low|none] [--out <path>] [--android]\n" +
22
+ "\n" +
23
+ " --android opts into Batch 2's programmatic Android security integration.\n" +
24
+ " Requires --types to include \"security\" (e.g. --types security or --types\n" +
25
+ " code-rot,security). Runs the same static, read-only, nineteen-check\n" +
26
+ " Android validation security:validate --profile android performs --\n" +
27
+ " detection, manifest parsing, and internal advanced security checks --\n" +
28
+ " through the existing security adapter, never a subprocess. Confirmed\n" +
29
+ " findings are mapped into the normal issue collection; CandidateEvidence\n" +
30
+ " remains a separate, bounded summary and is never treated as a confirmed\n" +
31
+ " issue. Starts zero Gradle operations, zero external tools, and zero\n" +
32
+ " network operations by default; --android does not expose any of those.\n" +
33
+ " Example: my-dev-kit-lab audit --target \"<android-project-path>\" --types security --android --format text,json --fail-on none";
34
+ export async function runAuditCommandFromArgs(argv, options = {}) {
35
+ const context = options.context ?? createLabExecutionContext();
36
+ const toolRoot = context.packageRoot;
37
+ const defaultOutRoot = options.defaultOutRoot ?? toolRoot;
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 (argv.includes("--help") || argv.includes("-h")) {
42
+ console.log(AUDIT_USAGE);
43
+ return AUDIT_EXIT_CODES.SUCCESS;
44
+ }
45
+ let config;
46
+ try {
47
+ const args = parseAuditArgs(argv);
48
+ config = normalizeAuditConfig(args, defaultOutRoot);
49
+ }
50
+ catch (err) {
51
+ const msg = err instanceof Error ? err.message : String(err);
52
+ console.error(`\nERROR: ${msg}`);
53
+ console.error(AUDIT_USAGE);
54
+ return AUDIT_EXIT_CODES.FATAL_ERROR;
55
+ }
56
+ let target;
57
+ try {
58
+ target = resolveAuditTarget(config.targetPathArg, toolRoot);
59
+ }
60
+ catch (err) {
61
+ const msg = err instanceof Error ? err.message : String(err);
62
+ console.error(`\nERROR: ${msg}`);
63
+ console.error(AUDIT_USAGE);
64
+ return AUDIT_EXIT_CODES.FATAL_ERROR;
65
+ }
66
+ console.log("=".repeat(60));
67
+ console.log("my-dev-kit-lab audit");
68
+ console.log("=".repeat(60));
69
+ console.log(`Tool root : ${toolRoot}`);
70
+ if (!target.isSelf) {
71
+ console.log(`Target : ${target.rootPath}`);
72
+ }
73
+ else {
74
+ console.log(`Mode : self-audit`);
75
+ }
76
+ console.log(`Types : ${config.types.join(", ")}`);
77
+ console.log(`Include : ${config.include.join(", ")}`);
78
+ console.log("");
79
+ let result;
80
+ try {
81
+ result = await runAudit({ config, toolRoot, target });
82
+ }
83
+ catch (err) {
84
+ const msg = err instanceof Error ? err.message : String(err);
85
+ console.error(`\nERROR: audit runtime failure: ${msg}`);
86
+ return AUDIT_EXIT_CODES.FATAL_ERROR;
87
+ }
88
+ const model = buildAuditReportModel(result, { target });
89
+ const { writtenPaths } = writeAuditReports({ model, config, outDir: config.out });
90
+ console.log(`Issues found : ${model.summary.totalIssues}`);
91
+ 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}`);
92
+ console.log(`Skipped detectors : ${model.summary.skippedDetectorCount}`);
93
+ if (model.summary.detectorErrorCount > 0) {
94
+ console.log(`Detector errors : ${model.summary.detectorErrorCount}`);
95
+ for (const e of model.detectorErrors) {
96
+ console.log(` [${e.id}] ${e.message}`);
97
+ }
98
+ }
99
+ if (model.summary.noDetectorsRegistered && !model.securitySummary.ran) {
100
+ 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.`);
101
+ }
102
+ if (model.securitySummary.ran) {
103
+ 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})`);
104
+ if (model.securitySummary.reportPaths.text) {
105
+ console.log(` Full report: ${model.securitySummary.reportPaths.text}`);
106
+ }
107
+ }
108
+ if (model.androidSecurity.summary.requested) {
109
+ const android = model.androidSecurity.summary;
110
+ 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}`);
111
+ if (android.reportPaths.text) {
112
+ console.log(` Full report: ${android.reportPaths.text}`);
113
+ }
114
+ }
115
+ console.log(`\nInventory: ${model.inventory.totalScannedFileCount} file(s) scanned, ${model.inventory.skippedFileCount} skipped`);
116
+ 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}`);
117
+ 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}`);
118
+ 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})`);
119
+ if (writtenPaths.length > 0) {
120
+ console.log(`\nReports written:`);
121
+ for (const p of writtenPaths) {
122
+ console.log(` ${p}`);
123
+ }
124
+ }
125
+ console.log(`\nHighest severity: ${model.summary.highestSeverity ?? "(none)"}`);
126
+ console.log(`Verdict: ${model.summary.finalVerdictLabel}`);
127
+ console.log(`Exit reason: ${model.exit.reason}`);
128
+ console.log(model.exit.code === AUDIT_EXIT_CODES.SUCCESS
129
+ ? `Exit 0 -- audit completed.`
130
+ : `Exit 1 -- fail-on threshold breached.`);
131
+ return model.exit.code;
132
+ }
@@ -4,9 +4,11 @@ import { parseAgentId } from "../agents/agentRegistry.js";
4
4
  import { readBenchmarkProjectProfiles, readEvaluationCases } from "../evaluation/index.js";
5
5
  import { contextStrategyComparisonPlugin, resolveExperimentTarget } from "../experiments/index.js";
6
6
  import { parsePromptComplexityLevel, parsePromptStrategy } from "../prompts/index.js";
7
+ import { createLabExecutionContext, resolvePackageResource } from "../runtime/index.js";
8
+ const DEFAULT_PROJECT_PROFILES_RESOURCE = "benchmarks/contracts/benchmark-project-profiles.json";
7
9
  export function parseRunControlledExperimentArgs(argv) {
8
10
  let casesPath = "";
9
- let projectProfilesPath = "benchmarks/contracts/benchmark-project-profiles.json";
11
+ let projectProfilesPath;
10
12
  let outDir = "";
11
13
  const caseIds = [];
12
14
  const benchmarkProjects = [];
@@ -109,8 +111,10 @@ export function parseRunControlledExperimentArgs(argv) {
109
111
  includeRealAgents
110
112
  };
111
113
  }
112
- export async function runControlledExperimentFromArgs(args, repoRoot = process.cwd()) {
113
- const projectProfilesPath = path.resolve(repoRoot, args.projectProfilesPath ?? "benchmarks/contracts/benchmark-project-profiles.json");
114
+ export async function runControlledExperimentFromArgs(args, repoRoot = process.cwd(), context) {
115
+ const projectProfilesPath = args.projectProfilesPath
116
+ ? path.resolve(repoRoot, args.projectProfilesPath)
117
+ : resolvePackageResource(context ?? createLabExecutionContext(), DEFAULT_PROJECT_PROFILES_RESOURCE);
114
118
  const casesPath = path.resolve(repoRoot, args.casesPath);
115
119
  const projectProfiles = await readBenchmarkProjectProfiles(projectProfilesPath, repoRoot);
116
120
  const cases = await readEvaluationCases(casesPath, repoRoot, {
@@ -1,5 +1,12 @@
1
- import { createDefaultExperimentPluginRegistry } from "../../src/experiments/index.js";
2
- async function main(argv) {
1
+ import { createDefaultExperimentPluginRegistry } from "../experiments/index.js";
2
+ // ---------------------------------------------------------------------------
3
+ // v0.4.6 Batch 4 -- reusable experiment-describe command owner.
4
+ //
5
+ // Extracted from scripts/experiments/describeExperiment.ts so both the npm
6
+ // script and the installed CLI router call the same registry-lookup and
7
+ // description-building path. Read-only: no filesystem writes.
8
+ // ---------------------------------------------------------------------------
9
+ export async function runExperimentDescribeCommandFromArgs(argv) {
3
10
  try {
4
11
  const args = parseDescribeArgs(argv);
5
12
  const registry = createDefaultExperimentPluginRegistry();
@@ -50,7 +57,7 @@ function buildDescription(plugin) {
50
57
  optionalConfigFields: readConfigFields(plugin, false),
51
58
  targetBehavior: describeTargetBehavior(plugin),
52
59
  expectedReports: describeExpectedReports(plugin),
53
- examples: describeExamples(plugin),
60
+ examples: describeExamples(plugin)
54
61
  };
55
62
  }
56
63
  function printDescription(plugin) {
@@ -95,7 +102,7 @@ function readConfigFields(plugin, required) {
95
102
  .filter((field) => Boolean(field.required) === required)
96
103
  .map((field) => ({
97
104
  ...field,
98
- defaultValue: readDefaultValue(plugin.defaultConfig, field.name),
105
+ defaultValue: readDefaultValue(plugin.defaultConfig, field.name)
99
106
  }));
100
107
  }
101
108
  function readSupportedVariants(plugin) {
@@ -133,11 +140,8 @@ function describeExpectedReports(plugin) {
133
140
  }
134
141
  function describeExamples(plugin) {
135
142
  return [
136
- `npm run experiment:describe -- --experiment ${plugin.metadata.id}`,
137
- `npm run experiment:run -- --experiment ${plugin.metadata.id} --agents fake-agent --complexities short`,
138
- `npm run experiment:run -- --experiment ${plugin.metadata.id} --target "Z:\\Users\\newuser\\Projects\\my-dev-kit-v1" --agents fake-agent --complexities short --no-screenshot`,
143
+ `my-dev-kit-lab experiment describe --experiment ${plugin.metadata.id}`,
144
+ `my-dev-kit-lab experiment run --experiment ${plugin.metadata.id} --agents fake-agent --complexities short`,
145
+ `my-dev-kit-lab experiment run --experiment ${plugin.metadata.id} --target "Z:\\Users\\newuser\\Projects\\my-dev-kit-v1" --agents fake-agent --complexities short --no-screenshot`
139
146
  ];
140
147
  }
141
- if (process.argv[1] && import.meta.url.endsWith(process.argv[1].replaceAll("\\", "/"))) {
142
- process.exitCode = await main(process.argv.slice(2));
143
- }
@@ -1,5 +1,5 @@
1
- import { createDefaultExperimentPluginRegistry } from "../../src/experiments/index.js";
2
- async function main(argv) {
1
+ import { createDefaultExperimentPluginRegistry } from "../experiments/index.js";
2
+ export async function runExperimentListCommandFromArgs(argv) {
3
3
  const json = argv.includes("--json");
4
4
  const registry = createDefaultExperimentPluginRegistry();
5
5
  const plugins = registry.list().map((metadata) => {
@@ -25,7 +25,7 @@ async function main(argv) {
25
25
  function toListedExperiment(metadata, plugin) {
26
26
  return {
27
27
  ...metadata,
28
- supportedVariants: readSupportedVariants(plugin),
28
+ supportedVariants: readSupportedVariants(plugin)
29
29
  };
30
30
  }
31
31
  function readSupportedVariants(plugin) {
@@ -39,6 +39,3 @@ function readArrayField(value, key) {
39
39
  const field = value[key];
40
40
  return Array.isArray(field) ? field : [];
41
41
  }
42
- if (process.argv[1] && import.meta.url.endsWith(process.argv[1].replaceAll("\\", "/"))) {
43
- process.exitCode = await main(process.argv.slice(2));
44
- }
@@ -1,30 +1,65 @@
1
1
  import path from "node:path";
2
- import { parseAgentCommandTemplate } from "../../src/agents/index.js";
3
- import { parseAgentId } from "../../src/agents/agentRegistry.js";
4
- import { readBenchmarkProjectProfiles, readEvaluationCases } from "../../src/evaluation/index.js";
5
- import { createDefaultExperimentPluginRegistry, runExperiment } from "../../src/experiments/index.js";
6
- import { contextStrategyComparisonPlugin } from "../../src/experiments/plugins/contextStrategyComparison/index.js";
7
- import { parsePromptComplexityLevel, parsePromptStrategy } from "../../src/prompts/index.js";
8
- import { writePluginExperimentReports } from "../../src/report/index.js";
9
- async function main(argv) {
2
+ import { parseAgentCommandTemplate } from "../agents/index.js";
3
+ import { parseAgentId } from "../agents/agentRegistry.js";
4
+ import { readBenchmarkProjectProfiles, readEvaluationCases } from "../evaluation/index.js";
5
+ import { contextStrategyComparisonPlugin, createDefaultExperimentPluginRegistry, resolveExperimentTarget, runExperiment } from "../experiments/index.js";
6
+ import { buildDefaultExperimentOutputRoot } from "../experiments/outputPaths.js";
7
+ import { parsePromptComplexityLevel, parsePromptStrategy } from "../prompts/index.js";
8
+ import { writePluginExperimentReports } from "../report/index.js";
9
+ import { createLabExecutionContext, resolvePackageResource } from "../runtime/index.js";
10
+ // ---------------------------------------------------------------------------
11
+ // v0.4.6 Batch 4 -- reusable experiment-run command owner.
12
+ //
13
+ // Extracted from scripts/experiments/runExperiment.ts. Reuses the existing
14
+ // generic runner (src/experiments/runner.ts) and the registered
15
+ // context-strategy-comparison plugin unchanged. Two things move relative to
16
+ // the source-checkout script:
17
+ //
18
+ // 1. Bundled resource lookup (the default cases/project-profiles files) goes
19
+ // through Batch 1's resolvePackageResource() instead of a
20
+ // process.cwd()-relative path, so it no longer depends on the checkout.
21
+ // 2. The implicit (no --out) output root, for installed execution only, is
22
+ // rooted under workspaceRoot instead of the tool/package root -- computed
23
+ // with the same buildDefaultExperimentOutputRoot() helper the runner
24
+ // itself uses internally, so the plugin/target/run subdirectory shape is
25
+ // unchanged, only the root differs. Explicit --out is pre-resolved
26
+ // against invocationCwd so its resolution base never changes.
27
+ //
28
+ // Self-target fallback (no --target) and relative --target resolution are
29
+ // untouched -- both still go through the shared toolRoot (packageRoot),
30
+ // matching runAuditCommand.ts / runSecurityValidationCommand.ts.
31
+ // ---------------------------------------------------------------------------
32
+ const DEFAULT_CASES_RESOURCE = "examples/token-savings-cases.json";
33
+ const DEFAULT_PROJECT_PROFILES_RESOURCE = "benchmarks/contracts/benchmark-project-profiles.json";
34
+ export async function runExperimentRunCommandFromArgs(argv, options = {}) {
10
35
  try {
11
36
  const args = parseRunExperimentArgs(argv);
12
- const toolRoot = process.cwd();
37
+ const context = options.context ?? createLabExecutionContext();
38
+ const toolRoot = context.packageRoot;
13
39
  const registry = createDefaultExperimentPluginRegistry();
14
- const inputs = await loadPluginInputs(args, toolRoot);
40
+ const inputs = await loadPluginInputs(args, toolRoot, context);
41
+ const runId = generateExperimentRunId(args.experimentId);
42
+ const outputRoot = resolveOutputRoot(args, {
43
+ toolRoot,
44
+ invocationCwd: context.invocationCwd,
45
+ installedDefaultOutputRoot: options.installedDefaultOutputRoot,
46
+ experimentId: args.experimentId,
47
+ runId
48
+ });
15
49
  const result = await runExperiment({
16
50
  pluginId: args.experimentId,
17
51
  registry,
18
52
  targetPath: args.targetPath,
19
- outputRoot: args.outDir,
53
+ outputRoot,
20
54
  config: args.config,
21
55
  inputs,
22
56
  toolRoot,
57
+ runId
23
58
  });
24
59
  const reports = await writePluginExperimentReports({
25
60
  run: result,
26
61
  plugin: registry.describe(result.pluginId),
27
- outputRoot: String(result.metadata?.outputRoot ?? ""),
62
+ outputRoot: String(result.metadata?.outputRoot ?? "")
28
63
  });
29
64
  console.log([
30
65
  `Experiment: ${result.pluginId}`,
@@ -35,7 +70,7 @@ async function main(argv) {
35
70
  `Target root: ${result.target.targetRoot}`,
36
71
  `Output: ${String(result.metadata?.outputRoot ?? "")}`,
37
72
  `Report JSON: ${reports.outputPaths.jsonPath}`,
38
- `Report HTML: ${reports.outputPaths.htmlPath}`,
73
+ `Report HTML: ${reports.outputPaths.htmlPath}`
39
74
  ].join("\n"));
40
75
  return result.status === "failed" ? 1 : 0;
41
76
  }
@@ -150,11 +185,33 @@ export function parseRunExperimentArgs(argv) {
150
185
  continueOnFailure,
151
186
  requireAgents,
152
187
  includeRealAgents,
153
- commandTemplates: Object.keys(commandTemplates).length > 0 ? commandTemplates : undefined,
154
- }),
188
+ commandTemplates: Object.keys(commandTemplates).length > 0 ? commandTemplates : undefined
189
+ })
155
190
  };
156
191
  }
157
- async function loadPluginInputs(args, toolRoot) {
192
+ function resolveOutputRoot(args, params) {
193
+ if (args.outDir) {
194
+ // Pre-resolve to an absolute path against invocationCwd so its
195
+ // resolution base never depends on toolRoot/packageRoot.
196
+ return path.resolve(params.invocationCwd, args.outDir);
197
+ }
198
+ if (!params.installedDefaultOutputRoot) {
199
+ // Preserve the runner's own internal toolRoot-relative default.
200
+ return undefined;
201
+ }
202
+ const target = resolveExperimentTarget(args.targetPath, params.toolRoot);
203
+ return buildDefaultExperimentOutputRoot({
204
+ toolRoot: params.installedDefaultOutputRoot,
205
+ pluginId: params.experimentId,
206
+ target,
207
+ runId: params.runId
208
+ });
209
+ }
210
+ function generateExperimentRunId(pluginId) {
211
+ const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
212
+ return `${pluginId}-${timestamp}`;
213
+ }
214
+ async function loadPluginInputs(args, toolRoot, context) {
158
215
  if (args.experimentId !== contextStrategyComparisonPlugin.metadata.id) {
159
216
  return undefined;
160
217
  }
@@ -162,12 +219,16 @@ async function loadPluginInputs(args, toolRoot) {
162
219
  if (!validation.valid || !validation.config) {
163
220
  throw new Error(`Invalid context strategy comparison config: ${validation.errors.join("; ")}`);
164
221
  }
165
- const projectProfilesPath = path.resolve(toolRoot, validation.config.projectProfilesPath ?? "benchmarks/contracts/benchmark-project-profiles.json");
166
- const casesPath = path.resolve(toolRoot, validation.config.casesPath);
222
+ const projectProfilesPath = args.config.projectProfilesPath
223
+ ? path.resolve(toolRoot, args.config.projectProfilesPath)
224
+ : resolvePackageResource(context, DEFAULT_PROJECT_PROFILES_RESOURCE);
225
+ const casesPath = args.config.casesPath
226
+ ? path.resolve(toolRoot, args.config.casesPath)
227
+ : resolvePackageResource(context, DEFAULT_CASES_RESOURCE);
167
228
  const projectProfiles = await readBenchmarkProjectProfiles(projectProfilesPath, toolRoot);
168
229
  const cases = await readEvaluationCases(casesPath, toolRoot, {
169
230
  projectProfiles,
170
- requireProjectProfileRef: true,
231
+ requireProjectProfileRef: true
171
232
  });
172
233
  return { cases, projectProfiles, env: process.env };
173
234
  }
@@ -194,6 +255,3 @@ function parsePositiveInteger(label, value) {
194
255
  function withoutUndefined(value) {
195
256
  return Object.fromEntries(Object.entries(value).filter(([, entryValue]) => entryValue !== undefined));
196
257
  }
197
- if (process.argv[1] && import.meta.url.endsWith(process.argv[1].replaceAll("\\", "/"))) {
198
- process.exitCode = await main(process.argv.slice(2));
199
- }
@@ -72,7 +72,7 @@ export function parseRunFinalDemoArgs(argv) {
72
72
  throw new Error("Usage: --cases <path> --out <dir> --kit-command <command>");
73
73
  return { casesPath, outDir, kitCommand, agents, strategies, complexities, caseIds, benchmarkProjects, maxRuns, screenshot, includeRealAgents, continueOnFailure, timeoutMs };
74
74
  }
75
- export async function runFinalDemoFromArgs(args, repoRoot = process.cwd()) {
75
+ export async function runFinalDemoFromArgs(args, repoRoot = process.cwd(), context) {
76
76
  const rootOut = path.resolve(repoRoot, args.outDir);
77
77
  const experimentDir = path.join(rootOut, "controlled-experiment");
78
78
  const plotsDir = path.join(rootOut, "plots");
@@ -81,7 +81,6 @@ export async function runFinalDemoFromArgs(args, repoRoot = process.cwd()) {
81
81
  const galleryDir = path.join(rootOut, "gallery");
82
82
  const experiment = await runControlledExperimentFromArgs({
83
83
  casesPath: args.casesPath,
84
- projectProfilesPath: "benchmarks/contracts/benchmark-project-profiles.json",
85
84
  outDir: experimentDir,
86
85
  agents: args.agents,
87
86
  strategies: args.strategies,
@@ -92,7 +91,7 @@ export async function runFinalDemoFromArgs(args, repoRoot = process.cwd()) {
92
91
  includeRealAgents: args.includeRealAgents,
93
92
  continueOnFailure: args.continueOnFailure,
94
93
  timeoutMs: args.timeoutMs
95
- }, repoRoot);
94
+ }, repoRoot, context);
96
95
  const plots = await runGenerateExperimentPlotsFromArgs({ experimentDir, outDir: plotsDir }, repoRoot);
97
96
  const firstProject = experiment.projectProfiles[0]?.rootPath ?? "benchmarks/projects/todo-ts";
98
97
  const visualization = await runVisualizationDemosFromArgs({ projectPath: firstProject, kitCommand: args.kitCommand, outDir: visualizationsDir, timeoutMs: args.timeoutMs }, repoRoot);