@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
@@ -0,0 +1,232 @@
1
+ {
2
+ "schemaVersion": "1.1.0",
3
+ "caseId": "CASE-STAGE-CONTEXT-002",
4
+ "title": "Complete stage-context expectation",
5
+ "description": "Complete valid expectation fixture covering every expectation category.",
6
+ "futureMinorRootField": "preserved",
7
+ "expectedEvidence": [
8
+ {
9
+ "expectationId": "REQ-FILE-001",
10
+ "inclusion": "required",
11
+ "sourceArtifact": "context-capsule",
12
+ "category": "file",
13
+ "match": { "path": "src/example.ts" },
14
+ "notes": [],
15
+ "futureMinorNestedField": "preserved"
16
+ },
17
+ {
18
+ "expectationId": "REQ-SYMBOL-001",
19
+ "inclusion": "required",
20
+ "sourceArtifact": "context-capsule",
21
+ "category": "symbol",
22
+ "match": { "symbolId": "symbol:src/example.ts#Example" },
23
+ "notes": []
24
+ },
25
+ {
26
+ "expectationId": "REQ-SOURCE-RANGE-001",
27
+ "inclusion": "required",
28
+ "sourceArtifact": "context-capsule",
29
+ "category": "source-range",
30
+ "match": { "filePath": "src/example.ts", "startLine": 1, "endLine": 10 },
31
+ "notes": []
32
+ },
33
+ {
34
+ "expectationId": "ALLOW-CONTRACT-001",
35
+ "inclusion": "allowed",
36
+ "sourceArtifact": "context-capsule",
37
+ "category": "contract",
38
+ "match": { "symbolId": "contract:src/example.ts#ExampleContract" },
39
+ "notes": []
40
+ },
41
+ {
42
+ "expectationId": "ALLOW-VALIDATOR-001",
43
+ "inclusion": "allowed",
44
+ "sourceArtifact": "context-capsule",
45
+ "category": "validator",
46
+ "match": { "symbolId": "validator:src/example.ts#validateExample" },
47
+ "notes": []
48
+ },
49
+ {
50
+ "expectationId": "ALLOW-CONSTANT-001",
51
+ "inclusion": "allowed",
52
+ "sourceArtifact": "context-capsule",
53
+ "category": "constant",
54
+ "match": { "symbolId": "constant:src/example.ts#EXAMPLE_CONST" },
55
+ "notes": []
56
+ },
57
+ {
58
+ "expectationId": "FORBID-ERROR-001",
59
+ "inclusion": "forbidden",
60
+ "sourceArtifact": "context-capsule",
61
+ "category": "error",
62
+ "match": { "symbolId": "error:src/example.ts#ExampleError" },
63
+ "notes": []
64
+ },
65
+ {
66
+ "expectationId": "ALLOW-SCHEMA-001",
67
+ "inclusion": "allowed",
68
+ "sourceArtifact": "context-capsule",
69
+ "category": "schema-or-serializer",
70
+ "match": { "symbolId": "schema:src/example.ts#ExampleSchema" },
71
+ "notes": []
72
+ },
73
+ {
74
+ "expectationId": "REQ-RESPONSIBILITY-001",
75
+ "inclusion": "required",
76
+ "sourceArtifact": "context-capsule",
77
+ "category": "production-responsibility",
78
+ "match": { "responsibilityId": "fixture.responsibility.001" },
79
+ "notes": []
80
+ },
81
+ {
82
+ "expectationId": "ALLOW-RESPONSIBILITY-001",
83
+ "inclusion": "allowed",
84
+ "sourceArtifact": "retrieval-audit-record",
85
+ "category": "production-responsibility",
86
+ "match": { "responsibilityId": "fixture.responsibility.002" },
87
+ "notes": []
88
+ },
89
+ {
90
+ "expectationId": "REQ-TEST-FILE-001",
91
+ "inclusion": "required",
92
+ "sourceArtifact": "context-capsule",
93
+ "category": "test-file",
94
+ "match": { "path": "tests/example.spec.ts" },
95
+ "notes": []
96
+ },
97
+ {
98
+ "expectationId": "ALLOW-FIXTURE-001",
99
+ "inclusion": "allowed",
100
+ "sourceArtifact": "context-capsule",
101
+ "category": "fixture",
102
+ "match": { "path": "tests/fixtures/example.json" },
103
+ "notes": []
104
+ },
105
+ {
106
+ "expectationId": "ALLOW-FACTORY-001",
107
+ "inclusion": "allowed",
108
+ "sourceArtifact": "context-capsule",
109
+ "category": "factory",
110
+ "match": { "path": "tests/factories/exampleFactory.ts" },
111
+ "notes": []
112
+ },
113
+ {
114
+ "expectationId": "FORBID-MOCK-001",
115
+ "inclusion": "forbidden",
116
+ "sourceArtifact": "context-capsule",
117
+ "category": "mock",
118
+ "match": { "path": "tests/mocks/exampleMock.ts" },
119
+ "notes": []
120
+ },
121
+ {
122
+ "expectationId": "ALLOW-SETUP-FILE-001",
123
+ "inclusion": "allowed",
124
+ "sourceArtifact": "context-capsule",
125
+ "category": "setup-file",
126
+ "match": { "path": "tests/setup.ts" },
127
+ "notes": []
128
+ },
129
+ {
130
+ "expectationId": "REQ-TEST-CONFIGURATION-001",
131
+ "inclusion": "required",
132
+ "sourceArtifact": "context-capsule",
133
+ "category": "test-configuration",
134
+ "match": { "path": "vitest.config.ts" },
135
+ "notes": []
136
+ },
137
+ {
138
+ "expectationId": "REQ-PACKAGE-SCRIPT-001",
139
+ "inclusion": "required",
140
+ "sourceArtifact": "context-capsule",
141
+ "category": "package-script",
142
+ "match": { "name": "test" },
143
+ "notes": []
144
+ },
145
+ {
146
+ "expectationId": "ALLOW-TEST-COMMAND-001",
147
+ "inclusion": "allowed",
148
+ "sourceArtifact": "context-capsule",
149
+ "category": "test-command",
150
+ "match": { "commandText": "vitest run tests/example.spec.ts" },
151
+ "notes": []
152
+ },
153
+ {
154
+ "expectationId": "REQ-WORKFLOW-001",
155
+ "inclusion": "required",
156
+ "sourceArtifact": "workflow-instruction-packet",
157
+ "category": "workflow",
158
+ "match": { "id": "workflow.feature" },
159
+ "notes": []
160
+ },
161
+ {
162
+ "expectationId": "REQ-STAGE-001",
163
+ "inclusion": "required",
164
+ "sourceArtifact": "workflow-instruction-packet",
165
+ "category": "stage",
166
+ "match": { "id": "stage.feature.implementation" },
167
+ "notes": []
168
+ },
169
+ {
170
+ "expectationId": "ALLOW-COMMAND-001",
171
+ "inclusion": "allowed",
172
+ "sourceArtifact": "workflow-instruction-packet",
173
+ "category": "command",
174
+ "match": { "id": "command.repo.lint" },
175
+ "notes": []
176
+ },
177
+ {
178
+ "expectationId": "ALLOW-RULE-001",
179
+ "inclusion": "allowed",
180
+ "sourceArtifact": "full-workflow-library",
181
+ "category": "rule",
182
+ "match": { "id": "rule.quality.prefer-tests" },
183
+ "notes": []
184
+ },
185
+ {
186
+ "expectationId": "FORBID-REPORT-CONTRACT-001",
187
+ "inclusion": "forbidden",
188
+ "sourceArtifact": "workflow-instruction-packet",
189
+ "category": "report-contract",
190
+ "match": { "id": "report.other-summary" },
191
+ "notes": []
192
+ },
193
+ {
194
+ "expectationId": "REQ-PROVENANCE-001",
195
+ "inclusion": "required",
196
+ "sourceArtifact": "workflow-instruction-packet",
197
+ "category": "provenance",
198
+ "match": { "evidenceId": "symbol:src/example.ts#Example" },
199
+ "notes": []
200
+ }
201
+ ],
202
+ "expectedStates": {
203
+ "contextCapsule": {
204
+ "contextAdequacyStatus": "context sufficient with listed assumptions",
205
+ "roleAdequacyStatus": "context sufficient with listed assumptions",
206
+ "freshnessState": "fresh",
207
+ "truncated": false,
208
+ "fullFileFallbackUsed": 0,
209
+ "unresolvedItemIds": ["fixture.unresolved.001"],
210
+ "warningCount": 1
211
+ },
212
+ "retrievalAuditRecord": {
213
+ "contextAdequacyStatus": "context sufficient with listed assumptions",
214
+ "roleAdequacyStatus": "context sufficient with listed assumptions",
215
+ "freshnessState": "fresh",
216
+ "truncated": false,
217
+ "fullFileFallbackUsed": 1,
218
+ "unresolvedItemIds": [],
219
+ "warningCount": 1
220
+ },
221
+ "workflowInstructionPacket": {
222
+ "adequacyStatus": "adequate",
223
+ "truncated": false,
224
+ "unresolvedReferences": ["command.repo.unresolved-example"],
225
+ "warningCount": 0
226
+ },
227
+ "targetImmutability": {
228
+ "newMutationCount": 0
229
+ }
230
+ },
231
+ "warnings": []
232
+ }
@@ -0,0 +1 @@
1
+ { this is not valid JSON
@@ -0,0 +1,18 @@
1
+ {
2
+ "schemaVersion": "1.0.0",
3
+ "caseId": "CASE-STAGE-CONTEXT-001",
4
+ "title": "Minimal stage-context expectation",
5
+ "description": "Minimal valid expectation fixture for contract validation.",
6
+ "expectedEvidence": [
7
+ {
8
+ "expectationId": "REQ-FILE-001",
9
+ "inclusion": "required",
10
+ "sourceArtifact": "context-capsule",
11
+ "category": "file",
12
+ "match": { "path": "src/example.ts" },
13
+ "notes": []
14
+ }
15
+ ],
16
+ "expectedStates": {},
17
+ "warnings": []
18
+ }
@@ -0,0 +1 @@
1
+ { "schemaVersion": "1.0.0", "generatedAt": "2026-07-21T00:00:00.000Z", "tool": { "name": "my-dev-kit", "version": "1.10.2" }
@@ -0,0 +1 @@
1
+ ["this artifact is an array, not an object"]