@dailephd/my-dev-kit-lab 0.4.2 → 0.4.3

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 (92) hide show
  1. package/README.md +23 -113
  2. package/benchmarks/contracts/todo-behavior.md +1 -1
  3. package/benchmarks/projects/task-analytics-large-mixed/README.md +2 -0
  4. package/benchmarks/projects/task-workflow-medium-ts/README.md +3 -1
  5. package/dist/src/evaluation/stageContextDeterminism/calculateStageContextDeterminism.js +52 -0
  6. package/dist/src/evaluation/stageContextDeterminism/canonicalizeStageContextRun.js +53 -0
  7. package/dist/src/evaluation/stageContextDeterminism/index.js +2 -0
  8. package/dist/src/evaluation/stageContextDeterminism/types.js +1 -0
  9. package/dist/src/evaluation/stageContextExpectations/index.js +2 -0
  10. package/dist/src/evaluation/stageContextExpectations/readStageContextExpectationFixtureV1.js +50 -0
  11. package/dist/src/evaluation/stageContextExpectations/readTypes.js +1 -0
  12. package/dist/src/evaluation/stageContextExpectations/types.js +1 -0
  13. package/dist/src/evaluation/stageContextExpectations/validation.js +568 -0
  14. package/dist/src/evaluation/stageContextMetrics/calculateArtifactStateMetrics.js +130 -0
  15. package/dist/src/evaluation/stageContextMetrics/calculateContextSizeMetrics.js +85 -0
  16. package/dist/src/evaluation/stageContextMetrics/calculateExpectationMetrics.js +103 -0
  17. package/dist/src/evaluation/stageContextMetrics/calculateResponsibilityMappingMetrics.js +36 -0
  18. package/dist/src/evaluation/stageContextMetrics/collectContextCapsuleEvidence.js +312 -0
  19. package/dist/src/evaluation/stageContextMetrics/collectRetrievalAuditEvidence.js +35 -0
  20. package/dist/src/evaluation/stageContextMetrics/collectWorkflowInstructionEvidence.js +137 -0
  21. package/dist/src/evaluation/stageContextMetrics/evaluateV043StageContextExecution.js +247 -0
  22. package/dist/src/evaluation/stageContextMetrics/index.js +10 -0
  23. package/dist/src/evaluation/stageContextMetrics/matchStageContextExpectations.js +38 -0
  24. package/dist/src/evaluation/stageContextMetrics/targetKeys.js +35 -0
  25. package/dist/src/evaluation/stageContextMetrics/types.js +1 -0
  26. package/dist/src/evaluation/stageContextSelectors/contextArtifactConsistency.js +79 -0
  27. package/dist/src/evaluation/stageContextSelectors/contextCapsuleSelectors.js +126 -0
  28. package/dist/src/evaluation/stageContextSelectors/index.js +4 -0
  29. package/dist/src/evaluation/stageContextSelectors/retrievalAuditRecordSelectors.js +54 -0
  30. package/dist/src/evaluation/stageContextSelectors/workflowInstructionPacketSelectors.js +51 -0
  31. package/dist/src/evaluation/targetImmutability/captureTargetSnapshot.js +208 -0
  32. package/dist/src/evaluation/targetImmutability/compareTargetSnapshots.js +56 -0
  33. package/dist/src/evaluation/targetImmutability/index.js +3 -0
  34. package/dist/src/evaluation/targetImmutability/types.js +1 -0
  35. package/dist/src/evaluation/targetImmutability/validateTargetImmutabilityConfig.js +130 -0
  36. package/dist/src/evaluation/upstreamArtifacts/artifactReadTypes.js +1 -0
  37. package/dist/src/evaluation/upstreamArtifacts/index.js +3 -0
  38. package/dist/src/evaluation/upstreamArtifacts/jsonTypes.js +1 -0
  39. package/dist/src/evaluation/upstreamArtifacts/myDevKitClassificationTypesV1.js +1 -0
  40. package/dist/src/evaluation/upstreamArtifacts/myDevKitContextArtifactsV1.js +1 -0
  41. package/dist/src/evaluation/upstreamArtifacts/myDevKitSemanticTypesV1.js +1 -0
  42. package/dist/src/evaluation/upstreamArtifacts/orchestratorWorkflowInstructionPacketV1.js +1 -0
  43. package/dist/src/evaluation/upstreamArtifacts/readJsonArtifact.js +53 -0
  44. package/dist/src/evaluation/upstreamArtifacts/readMyDevKitContextCapsuleV1.js +9 -0
  45. package/dist/src/evaluation/upstreamArtifacts/readMyDevKitRetrievalAuditRecordV1.js +9 -0
  46. package/dist/src/evaluation/upstreamArtifacts/readOrchestratorWorkflowInstructionPacketV1.js +9 -0
  47. package/dist/src/evaluation/upstreamArtifacts/runtimeValidation.js +131 -0
  48. package/dist/src/evaluation/upstreamArtifacts/schemaVersion.js +32 -0
  49. package/dist/src/evaluation/upstreamArtifacts/validateMyDevKitContextCapsuleV1.js +1208 -0
  50. package/dist/src/evaluation/upstreamArtifacts/validateMyDevKitRetrievalAuditRecordV1.js +105 -0
  51. package/dist/src/evaluation/upstreamArtifacts/validateOrchestratorWorkflowInstructionPacketV1.js +235 -0
  52. package/dist/src/experiments/plugins/contextStrategyComparison/executeV043StageContextStrategy.js +46 -0
  53. package/dist/src/experiments/plugins/contextStrategyComparison/index.js +9 -0
  54. package/dist/src/experiments/plugins/contextStrategyComparison/loadV043StrategyArtifacts.js +286 -0
  55. package/dist/src/experiments/plugins/contextStrategyComparison/plugin.js +39 -1
  56. package/dist/src/experiments/plugins/contextStrategyComparison/readV043FullWorkflowLibraryFixture.js +162 -0
  57. package/dist/src/experiments/plugins/contextStrategyComparison/resolveV043StrategyInputs.js +43 -0
  58. package/dist/src/experiments/plugins/contextStrategyComparison/resultMapping.js +3 -0
  59. package/dist/src/experiments/plugins/contextStrategyComparison/runV043StageContextStrategyWithAssurance.js +190 -0
  60. package/dist/src/experiments/plugins/contextStrategyComparison/v043FullWorkflowLibraryFixture.js +1 -0
  61. package/dist/src/experiments/plugins/contextStrategyComparison/v043RunAssuranceTypes.js +1 -0
  62. package/dist/src/experiments/plugins/contextStrategyComparison/v043StrategyExecutionTypes.js +1 -0
  63. package/dist/src/experiments/plugins/contextStrategyComparison/v043StrategyIds.js +13 -0
  64. package/dist/src/experiments/plugins/contextStrategyComparison/v043StrategyInputContracts.js +1 -0
  65. package/dist/src/experiments/plugins/contextStrategyComparison/validateV043RunAssuranceConfig.js +59 -0
  66. package/dist/src/experiments/plugins/contextStrategyComparison/validateV043StrategyInput.js +252 -0
  67. package/dist/src/report/experiments/buildContextStrategyComparisonV043Report.js +398 -0
  68. package/dist/src/report/experiments/buildPluginExperimentReport.js +21 -6
  69. package/dist/src/report/experiments/contextStrategyComparisonV043ReportModel.js +1 -0
  70. package/dist/src/report/experiments/index.js +4 -0
  71. package/dist/src/report/experiments/renderContextStrategyComparisonV043Html.js +234 -0
  72. package/dist/src/report/experiments/renderPluginExperimentReportHtml.js +3 -0
  73. package/dist/src/report/experiments/renderPluginExperimentReportText.js +225 -0
  74. package/dist/src/report/experiments/writePluginExperimentReports.js +3 -0
  75. package/dist/src/securityValidation/attackScenarios/scenarios/secretLeakageScenario.js +215 -9
  76. package/docs/METRICS.md +56 -10
  77. package/package.json +1 -1
  78. package/tests/fixtures/full-workflow-library/complete-v1.0.0.json +24 -0
  79. package/tests/fixtures/full-workflow-library/future-minor-v1.1.0-additive.json +25 -0
  80. package/tests/fixtures/stage-context-expectations/complete-v1.0.0.json +230 -0
  81. package/tests/fixtures/stage-context-expectations/future-minor-v1.1.0-additive.json +232 -0
  82. package/tests/fixtures/stage-context-expectations/invalid/malformed-json.txt +1 -0
  83. package/tests/fixtures/stage-context-expectations/invalid/non-object-root.json +1 -0
  84. package/tests/fixtures/stage-context-expectations/minimal-v1.0.0.json +18 -0
  85. package/tests/fixtures/upstream-artifacts/invalid/malformed-json.txt +1 -0
  86. package/tests/fixtures/upstream-artifacts/invalid/non-object-root.json +1 -0
  87. package/tests/fixtures/upstream-artifacts/my-dev-kit/1.10.2/context-capsule/complete-v1.0.0.json +504 -0
  88. package/tests/fixtures/upstream-artifacts/my-dev-kit/1.10.2/context-capsule/future-minor-v1.1.0-additive.json +955 -0
  89. package/tests/fixtures/upstream-artifacts/my-dev-kit/1.10.2/retrieval-audit-record/complete-v1.0.0.json +190 -0
  90. package/tests/fixtures/upstream-artifacts/my-dev-kit/1.10.2/retrieval-audit-record/future-minor-v1.1.0-additive.json +327 -0
  91. package/tests/fixtures/upstream-artifacts/my-dev-kit-orchestrator/1.2.1/workflow-instruction-packet/complete-v1.0.0.json +160 -0
  92. package/tests/fixtures/upstream-artifacts/my-dev-kit-orchestrator/1.2.1/workflow-instruction-packet/future-minor-v1.1.0-additive.json +186 -0
package/README.md CHANGED
@@ -1,66 +1,19 @@
1
1
  # my-dev-kit-lab
2
2
 
3
- > Current release state: v0.4.1 is the latest published baseline. v0.4.0 delivered the Android validation MVP; v0.4.1 delivered advanced Android security. v0.4.2 is implemented and release-prepared (package metadata `0.4.2`) but not yet published. Manual pentest is post-v1 / version TBD.
3
+ my-dev-kit-lab is the experiment, audit, and evidence companion for [my-dev-kit](https://www.npmjs.com/package/@dailephd/my-dev-kit). It helps users compare repository-context strategies, audit project health, validate CLI/package and Android security boundaries, and turn each run into reviewable reports and visual artifacts.
4
4
 
5
- my-dev-kit-lab is the experiment, evidence, reporting, security-validation, and audit companion for my-dev-kit. It runs reproducible experiments that test whether my-dev-kit's graph-guided retrieval helps coding-agent workflows, collects metrics, renders reports, generates plots, captures screenshots, builds gallery outputs, performs automated CLI/package security validation, and runs the generic audit framework.
5
+ my-dev-kit provides local repository indexing and graph-guided retrieval. my-dev-kit-lab supplies the controlled benchmarks, agent adapters, metrics, security checks, and reports needed to evaluate when that retrieval is useful. Results are evidence for a specific target and configuration; they do not guarantee token savings or security.
6
6
 
7
- The generic experiment-plugin framework was introduced in `v0.2.0`. Its first plugin, `context-strategy-comparison`, preserves the raw-full-file vs my-dev-kit-guided comparison through the plugin runner. Later releases added the generic audit framework, language-aware code-rot detectors for TypeScript/JavaScript, Python, Java, and Kotlin, a security-validation audit adapter, and Android validation. See [CHANGELOG.md](CHANGELOG.md) for the complete release history.
8
-
9
- my-dev-kit is most useful when the repository is larger than the task. It helps coding agents work with large codebases through reusable structural indexing, graph-guided retrieval, targeted source slices, and auditable context selection. Results are scoped evidence; the project does not claim that my-dev-kit always saves tokens.
10
-
11
- **my-dev-kit** is the repo indexing and graph-guided retrieval engine.
12
- **my-dev-kit-lab** is the separate lab layer that feeds it benchmark inputs and records evaluation outputs.
13
-
14
- ---
7
+ The latest published release is v0.4.3 (stage-specific bounded-context and workflow-instruction evaluation). See [docs/CURRENT_STATE.md](docs/CURRENT_STATE.md).
15
8
 
16
9
  ## Current capabilities
17
10
 
18
- - Benchmark projects at small, medium, and large complexity levels
19
- - Project complexity metrics and benchmark case metadata with answer keys
20
- - Prompt variant generation at `short`, `medium`, `long`, and `multi-step` complexity levels
21
- - Fake-agent adapter for deterministic smoke and demo validation
22
- - Codex and Claude adapters for real-agent campaigns
23
- - Controlled experiment runner comparing `raw-full-file` vs `my-dev-kit-guided` strategies
24
- - Deterministic correctness scoring from answer keys
25
- - Token usage, duration, and status comparisons between matched strategy pairs
26
- - HTML experiment report rendering
27
- - Static SVG plot generation
28
- - Optional PNG screenshot capture
29
- - Gallery manifest and static gallery index output
30
- - Visualization demos using my-dev-kit commands against benchmark projects
31
- - Final demo workflow combining all pipeline stages
32
- - Generic experiment-plugin command surface: `experiment:list`, `experiment:describe`, and `experiment:run`
33
- - First experiment plugin: `context-strategy-comparison`
34
- - Target-aware experiment execution for local projects via `experiment:run -- --target <path>`
35
- - Plugin-aware JSON and HTML reports with plugin, target, variant, metric, artifact, warning, skip, and failure metadata
36
- - Security validation framework: dependency audit, package tarball inspection, CLI adversarial tests, static scans (CodeQL/Semgrep), bounded fuzz smoke, attack-scenario checks, and structured verdict/report output — runnable against any local project via `security:validate --target <path>`. `security:validate` remains the standalone, focused security-validation command; it is not replaced by the audit adapter below.
37
- - Generic audit framework: `npm run audit` runs conservative code-rot and security detectors and writes text/JSON reports under `reports/audits/` by default. `code-rot` and `security` are the currently implemented audit types (`--types code-rot`, `--types security`, or combined `--types code-rot,security`); `quality`, `project`, and `all` audit types are planned and fail cleanly instead of running. Audit does not modify target files and does not auto-fix issues. See [docs/COMMANDS.md](docs/COMMANDS.md) for full flags.
38
- - Language-aware code-rot detectors for TypeScript/JavaScript, Python, Java, and Kotlin, built on a shared source-facts model and normalized language/file-role inventory. Java/Kotlin support is conservative static analysis only: no compiler parsing, type/classpath resolution, or Gradle/Maven execution.
39
- - Security-validation audit adapter: `npm run audit -- --types security` runs the same `security:validate` internals through the shared audit/report surface, mapping findings into audit issues and linking back to the original `reports/security/` report. `security:validate`'s own checks and reports are unaffected.
40
- - Android validation: `security:validate --profile android` runs nineteen static checks against an Android project (manifest, permissions, exported components, network security config, backup/release configuration, secrets, signing, WebView/FileProvider, sensitive storage/logging, and Firebase/Google services), with optional opt-in Gradle operations and external tools (Semgrep, OSV-Scanner, Android Lint, Dependency-Check). Default execution starts zero Gradle processes, zero external tools, and zero network operations.
41
- - Android-aware generic audit: `npm run audit -- --types security --android` runs the same static Android validation through the audit adapter, mapping confirmed findings into audit issues while keeping review-only `CandidateEvidence` separate and never treated as a confirmed issue.
42
-
43
- ---
44
-
45
- ## Architecture overview
46
-
47
- ```mermaid
48
- flowchart TD
49
- A[scripts/experiments] --> B[Experiment plugin registry + runner]
50
- B --> C[context-strategy-comparison]
51
- C --> D[Controlled experiment foundations]
52
- D --> E[Plugin + legacy artifacts]
53
- E --> F[Plugin-aware reports]
54
- E --> G[Plots / screenshots / gallery]
55
- H[scripts/security] --> I[Automated security validation]
56
- I --> J[Security reports + verdict]
57
- I --> K[Android validation]
58
- L[scripts/audits] --> M[Generic audit framework]
59
- M --> N[Code-rot detectors]
60
- M --> I
61
- ```
62
-
63
- ---
11
+ - **Run context-strategy experiments:** compare `raw-full-file` with `my-dev-kit-guided` using deterministic fixtures or locally configured Codex and Claude CLIs.
12
+ - **Audit repository health:** run conservative code-rot detectors for TypeScript/JavaScript, Python, Java, and Kotlin, or adapt security findings into the common audit report.
13
+ - **Validate CLI/package security:** inspect dependencies, package contents, path and subprocess boundaries, malformed inputs, optional static scanners, and bounded fuzz targets.
14
+ - **Validate Android projects:** run nineteen static checks by default, with Gradle operations, external tools, and network access available only through explicit opt-in flags.
15
+ - **Review evidence:** generate JSON and HTML reports, SVG plots, optional screenshots, visualization demos, and a static gallery.
16
+ - **Evaluate stage-context strategies:** compare the two legacy strategies against six additional bounded stage-context strategies — `architecture-context-only`, `architecture-plus-implementation-refresh`, `architecture-plus-implementation-and-test-refresh`, `full-workflow-library`, `bounded-workflow-instruction-packet`, and `combined-bounded-stage-context` — selected through programmatic configuration, not CLI flags. Each strategy's evidence is reported through bounded `report.json`, `report.html`, and `report.txt` output with an explicit `available`/`unavailable`/`not-applicable` metric-availability model and no composite score, grade, ranking, or winning strategy.
64
17
 
65
18
  ## Quickstart
66
19
 
@@ -170,10 +123,13 @@ When `--target` is omitted, the experiment runs in self mode against my-dev-kit-
170
123
  | Report screenshot | `lab-output/<report>/experiment-report.png` |
171
124
  | Plugin experiment report JSON | `lab-output/experiments/<plugin>/<target>/<run>/report.json` |
172
125
  | Plugin experiment report HTML | `lab-output/experiments/<plugin>/<target>/<run>/report.html` |
126
+ | Plugin experiment report text | `lab-output/experiments/<plugin>/<target>/<run>/report.txt` |
173
127
  | Plot data | `lab-output/<plots>/plot-data.json` |
174
128
  | SVG charts | `lab-output/<plots>/charts/*.svg` |
175
129
  | Gallery manifest | `lab-output/<gallery>/gallery-manifest.json` |
176
130
  | Gallery index | `lab-output/<gallery>/gallery-index.html` |
131
+ | Audit reports | `reports/audits/<type>/code-rot-audit.txt` and `.json` |
132
+ | Security reports | `reports/security/<prefix>-security-validation.txt` and `.json` |
177
133
 
178
134
  ---
179
135
 
@@ -202,70 +158,22 @@ See [docs/METRICS.md](docs/METRICS.md) for full metric definitions.
202
158
  - Codex may expose token totals but can produce timeouts or invalid-output runs
203
159
  - Small projects may make raw-full-file cheaper than my-dev-kit-guided; larger localized tasks are where my-dev-kit is expected to become more useful
204
160
  - The generic experiment-plugin framework currently ships one plugin, `context-strategy-comparison`; future plugins such as warm-index reuse, incremental-change, and context-window scaling are not implemented yet
205
- - The current baseline does not prove token savings are guaranteed; it produces auditable evidence for specific cases, targets, agents, and strategies
161
+ - The current release does not guarantee token savings; it produces auditable evidence for specific cases, targets, agents, and strategies
206
162
  - Provider telemetry dashboards, semantic LLM judging, and cloud API billing integration are not yet implemented
207
-
208
- ---
209
-
210
- ## Roadmap direction
211
-
212
- my-dev-kit-lab is at a working baseline. The raw-vs-indexed experiment pipeline is fully implemented and produces reproducible artifacts, and real-agent campaign support exists for Codex and Claude. Recent releases added language-aware code-rot detectors (TypeScript/JavaScript, Python, Java, Kotlin), a security-validation audit adapter, and Android validation with an Android-aware extension of that same adapter.
213
-
214
- - `v0.4.0` and `v0.4.1`: Android automated security validation (published)
215
- - `v0.4.2`: Android-aware extension of the existing security audit adapter (see [CHANGELOG.md](CHANGELOG.md) for release status)
216
- - manual pentest: post-v1 / version TBD
217
-
218
- See [docs/ROADMAP.md](docs/ROADMAP.md) for the complete, versioned plan.
163
+ - The six new stage-context strategies have no CLI flags yet, are configured programmatically, and do not yet include plots, screenshots, or gallery integration
164
+ - The published upstream artifacts the stage-context strategies read do not expose considered-but-unselected reads or unnecessary-read evidence; those metrics report `unavailable` rather than zero
219
165
 
220
166
  ---
221
167
 
222
168
  ## Security validation
223
169
 
224
- my-dev-kit-lab owns a release-security validation track for **my-dev-kit**. This work is separate from the experiment pipeline and does not replace the generic experiment-plugin roadmap. Its purpose is to generate release-validation evidence for the local CLI/package before release preparation.
225
-
226
- `security:validate` remains the standalone, focused command for this validation and is unaffected by the current checked-out state. `npm run audit -- --types security` additionally adapts the same `security:validate` internals into the shared audit/report surface (mapped issues, a `securitySummary` field, and links to the original `reports/security/` output) — it does not replace or duplicate `security:validate`'s own checks or reports.
227
-
228
- This is not a web application pentest framework. **my-dev-kit** is a local CLI/package, so the validation model is CLI/package adversarial testing focused on whether it remains:
229
-
230
- - local-first
231
- - deterministic
232
- - read-only with respect to user source files
233
- - network-free during normal CLI operation
234
- - LLM-free
235
- - database-free
236
- - safe to run on local repositories
237
-
238
- The automated validation gate is implemented. It combines static scans, dependency/package checks, adversarial CLI tests, bounded fuzz smoke tests, and attack-scenario checks with structured text/JSON reports and a four-category verdict.
239
-
240
- ### Security commands
241
-
242
- | Command | Description |
243
- |---|---|
244
- | `npm run security:deps` | npm audit, OSV-Scanner (if available), outdated packages |
245
- | `npm run security:package` | npm pack --dry-run, forbidden content detection |
246
- | `npm run security:codeql` | CodeQL CLI availability check; skipped gracefully when absent |
247
- | `npm run security:semgrep` | Semgrep scan via local binary or npx; skipped gracefully when both absent |
248
- | `npm run test:security` | Automated security and adversarial CLI tests (path traversal, read-only boundaries, malformed artifacts, JSON safety, and related checks) |
249
- | `npm run test:fuzz:smoke` | 9 bounded fuzz targets, seeded PRNG, completes in under 1 second |
250
- | `npm run security:validate` | Runs selected security checks, applies profile-aware defaults when requested, and writes text/JSON reports according to `--format` |
251
-
252
- CodeQL, Semgrep, and OSV-Scanner are optional. When unavailable locally, they are recorded as `skipped` in the report, not as passed. That can lead to `ready except optional manual checks`; it does not silently turn missing tooling into a clean pass.
253
-
254
- Each security command can validate my-dev-kit-lab itself or another local project via `--target <path>`. When `--target` is omitted, the framework performs self-validation. Target projects are inspected in place: their source files are not modified by default, generated artifacts stay under `reports/security/` unless `--out` is used, and external-target reports identify the tool root, target root, target package metadata, target git metadata, command cwd, exit code, and stdout/stderr summaries.
255
-
256
- `security:validate` supports `--checks`, `--profile`, `--format`, `--fail-on`, `--out`, and `--report-prefix`. The no-flag path remains backward compatible and still runs the classic implemented check groups: `deps`, `package`, `static`, `cli-adversarial`, and `fuzz`. Supplying `--profile` without `--checks` swaps in that profile's default checks; supplying explicit `--checks` always wins over profile defaults.
257
-
258
- The current attack-scenario checks cover boundary, subprocess, secrets, and network assumptions. They are automated adversarial checks, not a manual pentest. Manual pentest is deferred until after `v1.0.0`. `verdictImpact` metadata from each registered scenario drives blocker categorization in report reasoning, and narrowed `--checks` runs are labeled as scoped rather than described as a full release gate.
259
-
260
- JSON report poisoning/config-injection checks use a baseline-diff schema guard so legitimate additive JSON fields do not fail the guard while payload-created trusted top-level fields still do. Text reports are sanitized to strip ANSI/control-byte payloads before rendering.
261
-
262
- Known limits remain intentionally explicit: secret scanning is bounded rather than exhaustive, the network/local-first check is a bounded static assumption check rather than proof of runtime isolation, package-boundary severity is still result-level rather than per-evidence-item, and profile-specific scenario behavior is limited to profile-based scenario selection/default checks.
170
+ `npm run security:validate` is the standalone security-validation command. It checks local CLI/package boundaries and can inspect another local project with `--target <path>`. The generic audit command can reuse those results through `--types security`, but it does not replace the standalone validator or its reports.
263
171
 
264
- For external-target validation, `security:validate` reads the target `package.json`, detects `scripts.test:security`, and runs `npm run test:security` in the target project root when that script exists. This behavior is validated both from the source checkout and from an installed packed tarball because published-package execution differs from local source execution.
172
+ Android validation uses `--profile android`. Its default path is static and non-destructive: it starts zero Gradle processes, zero external tools, and zero network operations. Only confirmed `SecurityFinding` records can become audit issues; Android `CandidateEvidence` remains review-only evidence.
265
173
 
266
- Generated security reports under `reports/security/` are excluded from git by default. They are produced locally or in CI as release-gate evidence and are not committed to the repository.
174
+ Optional scanners are reported as `skipped` when unavailable, never as passed. The framework does not provide runtime isolation proof, device or APK/AAB analysis, signing verification, Play Console validation, automatic fixes, or manual pentesting. Manual pentest remains deferred until post-v1/version TBD.
267
175
 
268
- See [docs/COMMANDS.md](docs/COMMANDS.md) for full command options and [docs/security-validation-framework.md](docs/security-validation-framework.md) for the security model, implemented modules, and release verdicts.
176
+ See [COMMANDS.md](docs/COMMANDS.md) for exact syntax and [Security Validation Framework](docs/security-validation-framework.md) for checks, evidence semantics, verdicts, and limitations.
269
177
 
270
178
  ---
271
179
 
@@ -291,10 +199,12 @@ Support is optional and does not affect access to the project.
291
199
  ## Documentation
292
200
 
293
201
  - [docs/PROJECT_OVERVIEW.md](docs/PROJECT_OVERVIEW.md) — product purpose and target users
294
- - [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) — current and future architecture
202
+ - [docs/CURRENT_STATE.md](docs/CURRENT_STATE.md) — implemented, planned, validated, blocked, and next state
203
+ - [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) — current components, ownership, flows, and invariants
295
204
  - [docs/WORKFLOWS.md](docs/WORKFLOWS.md) — step-by-step workflows with diagrams
296
205
  - [docs/COMMANDS.md](docs/COMMANDS.md) — all commands with options and examples
297
206
  - [docs/TUTORIAL.md](docs/TUTORIAL.md) — first-run walkthrough
298
207
  - [docs/METRICS.md](docs/METRICS.md) — metric definitions and interpretation
299
- - [docs/ROADMAP.md](docs/ROADMAP.md) — current baseline and future phases
208
+ - [docs/ROADMAP.md](docs/ROADMAP.md) — versioned plans, dependencies, exclusions, and acceptance criteria
300
209
  - [docs/GALLERY.md](docs/GALLERY.md) — gallery output explained
210
+ - [docs/security-validation-framework.md](docs/security-validation-framework.md) — security evidence, verdicts, and safety boundaries
@@ -66,5 +66,5 @@ Answer key requirements:
66
66
  - `answerKey.expectedFiles` lists files a correct answer may need to cite
67
67
  - `answerKey.expectedSymbols` lists relevant symbols
68
68
  - `answerKey.expectedFacts` lists weighted facts with unique `id`, `text`, `weight`, and `required`
69
- - `answerKey.minimumCorrectFacts` defines the future scoring threshold, but scoring is not implemented in this prompt
69
+ - `answerKey.minimumCorrectFacts` defines the required-fact threshold used by deterministic correctness scoring
70
70
  - optional `forbiddenWrongClaims` records claims that should be penalized by a later correctness scorer
@@ -1 +1,3 @@
1
+ # task-analytics-large-mixed
2
+
1
3
  Mixed TypeScript and Python benchmark project for deterministic task analytics, quality labeling, and report generation.
@@ -1 +1,3 @@
1
- Task workflow benchmark project with multiple services, validation rules, filtering, summarization, and deterministic imports.
1
+ # task-workflow-medium-ts
2
+
3
+ TypeScript task-workflow benchmark with multiple services, validation rules, filtering, summarization, and deterministic imports.
@@ -0,0 +1,52 @@
1
+ import { createHash } from "node:crypto";
2
+ import { canonicalizeStageContextRun } from "./canonicalizeStageContextRun.js";
3
+ function sha256Hex(text) {
4
+ return createHash("sha256").update(Buffer.from(text, "utf8")).digest("hex");
5
+ }
6
+ export function calculateStageContextDeterminism(candidates) {
7
+ if (candidates.length === 0) {
8
+ throw new Error("calculateStageContextDeterminism requires at least one candidate.");
9
+ }
10
+ if (candidates.length === 1) {
11
+ return {
12
+ availability: "not-applicable",
13
+ repeatCount: 1,
14
+ deterministic: null,
15
+ baselineSha256: null,
16
+ runDigests: [],
17
+ mismatchRunNumbers: [],
18
+ reason: "Repeated-run determinism requires at least two runs."
19
+ };
20
+ }
21
+ let runDigests;
22
+ try {
23
+ runDigests = candidates.map((candidate) => ({
24
+ runNumber: candidate.runNumber,
25
+ sha256: sha256Hex(canonicalizeStageContextRun(candidate.value))
26
+ }));
27
+ }
28
+ catch {
29
+ return {
30
+ availability: "unavailable",
31
+ repeatCount: candidates.length,
32
+ deterministic: null,
33
+ baselineSha256: null,
34
+ runDigests: [],
35
+ mismatchRunNumbers: [],
36
+ reason: "Stage-context run values could not be canonicalized for determinism comparison."
37
+ };
38
+ }
39
+ const baselineSha256 = runDigests[0].sha256;
40
+ const mismatchRunNumbers = runDigests
41
+ .filter((digest) => digest.sha256 !== baselineSha256)
42
+ .map((digest) => digest.runNumber);
43
+ return {
44
+ availability: "available",
45
+ repeatCount: candidates.length,
46
+ deterministic: mismatchRunNumbers.length === 0,
47
+ baselineSha256,
48
+ runDigests,
49
+ mismatchRunNumbers,
50
+ reason: null
51
+ };
52
+ }
@@ -0,0 +1,53 @@
1
+ export function canonicalizeStageContextRun(value) {
2
+ const seen = new WeakSet();
3
+ function serialize(input) {
4
+ if (input === null)
5
+ return "null";
6
+ const kind = typeof input;
7
+ if (kind === "bigint") {
8
+ throw new TypeError("Stage-context run values must not contain BigInt.");
9
+ }
10
+ if (kind === "function") {
11
+ throw new TypeError("Stage-context run values must not contain functions.");
12
+ }
13
+ if (kind === "symbol") {
14
+ throw new TypeError("Stage-context run values must not contain symbols.");
15
+ }
16
+ if (kind === "undefined") {
17
+ return "null";
18
+ }
19
+ if (kind === "number") {
20
+ if (!Number.isFinite(input)) {
21
+ throw new RangeError("Stage-context run values must not contain non-finite numbers.");
22
+ }
23
+ return JSON.stringify(input);
24
+ }
25
+ if (kind === "boolean" || kind === "string") {
26
+ return JSON.stringify(input);
27
+ }
28
+ if (Array.isArray(input)) {
29
+ if (seen.has(input)) {
30
+ throw new TypeError("Stage-context run values must not contain circular references.");
31
+ }
32
+ seen.add(input);
33
+ const items = input.map((item) => (item === undefined ? "null" : serialize(item)));
34
+ seen.delete(input);
35
+ return `[${items.join(",")}]`;
36
+ }
37
+ if (kind === "object") {
38
+ const obj = input;
39
+ if (seen.has(obj)) {
40
+ throw new TypeError("Stage-context run values must not contain circular references.");
41
+ }
42
+ seen.add(obj);
43
+ const keys = Object.keys(obj)
44
+ .filter((key) => obj[key] !== undefined)
45
+ .sort();
46
+ const parts = keys.map((key) => `${JSON.stringify(key)}:${serialize(obj[key])}`);
47
+ seen.delete(obj);
48
+ return `{${parts.join(",")}}`;
49
+ }
50
+ throw new TypeError("Stage-context run values contain an unsupported type.");
51
+ }
52
+ return serialize(value);
53
+ }
@@ -0,0 +1,2 @@
1
+ export { canonicalizeStageContextRun } from "./canonicalizeStageContextRun.js";
2
+ export { calculateStageContextDeterminism } from "./calculateStageContextDeterminism.js";
@@ -0,0 +1,2 @@
1
+ export { validateStageContextExpectationFixtureV1 } from "./validation.js";
2
+ export { readStageContextExpectationFixtureV1 } from "./readStageContextExpectationFixtureV1.js";
@@ -0,0 +1,50 @@
1
+ import { readFile } from "node:fs/promises";
2
+ import path from "node:path";
3
+ import { validateStageContextExpectationFixtureV1 } from "./validation.js";
4
+ export async function readStageContextExpectationFixtureV1(sourcePathInput) {
5
+ const sourcePath = path.resolve(sourcePathInput);
6
+ let raw;
7
+ try {
8
+ raw = await readFile(sourcePath, "utf8");
9
+ }
10
+ catch (error) {
11
+ const code = error.code;
12
+ if (code === "ENOENT") {
13
+ return {
14
+ ok: false,
15
+ sourcePath,
16
+ code: "FILE_NOT_FOUND",
17
+ message: `Stage context expectation fixture was not found at "${sourcePath}".`
18
+ };
19
+ }
20
+ return {
21
+ ok: false,
22
+ sourcePath,
23
+ code: "UNREADABLE_FILE",
24
+ message: `Stage context expectation fixture at "${sourcePath}" could not be read: ${error.message}`
25
+ };
26
+ }
27
+ let parsed;
28
+ try {
29
+ parsed = JSON.parse(raw);
30
+ }
31
+ catch (error) {
32
+ return {
33
+ ok: false,
34
+ sourcePath,
35
+ code: "MALFORMED_JSON",
36
+ message: `Stage context expectation fixture at "${sourcePath}" is not valid JSON: ${error.message}`
37
+ };
38
+ }
39
+ if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
40
+ return {
41
+ ok: false,
42
+ sourcePath,
43
+ code: "NON_OBJECT_ROOT",
44
+ message: `Stage context expectation fixture at "${sourcePath}" must parse to a JSON object at the root.`,
45
+ expected: "object",
46
+ actual: parsed
47
+ };
48
+ }
49
+ return validateStageContextExpectationFixtureV1(parsed, sourcePath);
50
+ }