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

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 (35) hide show
  1. package/README.md +6 -1
  2. package/dist/src/evaluation/stageContextExpectations/producerReadinessExpectationTypes.js +8 -0
  3. package/dist/src/evaluation/stageContextExpectations/validation.js +200 -0
  4. package/dist/src/evaluation/stageContextMetrics/calculateAllocationMetrics.js +96 -0
  5. package/dist/src/evaluation/stageContextMetrics/calculateCriticalityMetrics.js +112 -0
  6. package/dist/src/evaluation/stageContextMetrics/calculateOwnerMetrics.js +84 -0
  7. package/dist/src/evaluation/stageContextMetrics/calculateReadinessAgreement.js +152 -0
  8. package/dist/src/evaluation/stageContextMetrics/calculateSupplementalRawAgreement.js +50 -0
  9. package/dist/src/evaluation/stageContextMetrics/calculateTruncationClassification.js +44 -0
  10. package/dist/src/evaluation/stageContextMetrics/evaluateProducerReadinessBridge.js +127 -0
  11. package/dist/src/evaluation/stageContextMetrics/index.js +7 -0
  12. package/dist/src/evaluation/stageContextMetrics/producerReadinessMetricTypes.js +1 -0
  13. package/dist/src/evaluation/stageContextSelectors/contextArtifactConsistency.js +10 -0
  14. package/dist/src/evaluation/upstreamArtifacts/index.js +6 -0
  15. package/dist/src/evaluation/upstreamArtifacts/orchestratorContextReadinessResultV1.js +247 -0
  16. package/dist/src/evaluation/upstreamArtifacts/readImplementationContextPacketV1.js +9 -0
  17. package/dist/src/evaluation/upstreamArtifacts/readImplementationContextRetrievalReportV1.js +9 -0
  18. package/dist/src/evaluation/upstreamArtifacts/readSupplementalContextTextFile.js +29 -0
  19. package/dist/src/evaluation/upstreamArtifacts/readTestContextPacketV1.js +9 -0
  20. package/dist/src/evaluation/upstreamArtifacts/readTestContextRetrievalReportV1.js +9 -0
  21. package/dist/src/evaluation/upstreamArtifacts/supplementalContextTextParser.js +75 -0
  22. package/dist/src/evaluation/upstreamArtifacts/supplementalContextTypes.js +152 -0
  23. package/dist/src/evaluation/upstreamArtifacts/validateMyDevKitRetrievalAuditRecordV1.js +9 -2
  24. package/dist/src/evaluation/upstreamArtifacts/validateSupplementalContextDocumentV1.js +148 -0
  25. package/dist/src/experiments/plugins/contextStrategyComparison/loadV043StrategyArtifacts.js +117 -6
  26. package/dist/src/experiments/plugins/contextStrategyComparison/runV043StageContextStrategyWithAssurance.js +18 -3
  27. package/dist/src/experiments/plugins/contextStrategyComparison/validateV043StrategyInput.js +17 -3
  28. package/dist/src/report/experiments/buildContextStrategyComparisonV043Report.js +122 -0
  29. package/dist/src/report/experiments/renderContextStrategyComparisonV043Html.js +62 -0
  30. package/dist/src/report/experiments/renderPluginExperimentReportText.js +67 -0
  31. package/docs/METRICS.md +28 -0
  32. package/package.json +2 -2
  33. package/tests/fixtures/upstream-artifacts/my-dev-kit-1.10.2-identity/PROVENANCE.txt +13 -0
  34. package/tests/fixtures/upstream-artifacts/my-dev-kit-1.10.2-identity/context-capsule.json +7874 -0
  35. package/tests/fixtures/upstream-artifacts/my-dev-kit-1.10.2-identity/retrieval-audit-record.json +1076 -0
@@ -0,0 +1,152 @@
1
+ // v0.4.4 Batch 2: readiness/raw-evidence agreement. Readiness stays observed consumer
2
+ // output (Batch 1) -- this module only compares it against an explicit fixture-declared
3
+ // expectation. It never calls, imports, or reimplements contextReadiness.ts.
4
+ import { checkSupplementalReadinessIdentityConsistency } from "../upstreamArtifacts/index.js";
5
+ function unavailableStructural(field, reason) {
6
+ return { field, expectedValue: null, observedValue: null, agreement: null, availability: "unavailable", reason };
7
+ }
8
+ export function calculateReadinessStructuralAgreement(readiness, supplementalPacket, packetSourcePath) {
9
+ const results = [];
10
+ if (readiness === undefined) {
11
+ results.push(unavailableStructural("canonicalRepositoryIdentity", "No readiness result was supplied."));
12
+ results.push(unavailableStructural("packetPath", "No readiness result was supplied."));
13
+ return results;
14
+ }
15
+ if (supplementalPacket === undefined) {
16
+ results.push(unavailableStructural("canonicalRepositoryIdentity", "No supplemental document was supplied to compare against readiness."));
17
+ }
18
+ else {
19
+ const diagnostic = checkSupplementalReadinessIdentityConsistency(supplementalPacket, readiness);
20
+ results.push({
21
+ field: "canonicalRepositoryIdentity",
22
+ expectedValue: supplementalPacket.indexIdentity,
23
+ observedValue: readiness.indexIdentity ?? null,
24
+ agreement: diagnostic === null,
25
+ availability: readiness.indexIdentity === undefined ? "unavailable" : "available",
26
+ reason: readiness.indexIdentity === undefined ? "The readiness result does not declare indexIdentity." : diagnostic?.message ?? null
27
+ });
28
+ }
29
+ if (packetSourcePath === undefined) {
30
+ results.push(unavailableStructural("packetPath", "No packet source path was supplied to compare against readiness.packetPath."));
31
+ }
32
+ else {
33
+ results.push({
34
+ field: "packetPath",
35
+ expectedValue: packetSourcePath,
36
+ observedValue: readiness.packetPath,
37
+ agreement: packetSourcePath === readiness.packetPath,
38
+ availability: "available",
39
+ reason: null
40
+ });
41
+ }
42
+ return results;
43
+ }
44
+ export function calculateReadinessDecisionAgreement(readiness, expectation) {
45
+ if (expectation === undefined) {
46
+ return {
47
+ availability: "not-applicable",
48
+ observedDecision: readiness?.decision ?? null,
49
+ allowedDecisions: null,
50
+ decisionAgreement: null,
51
+ observedClassification: readiness?.classification ?? null,
52
+ expectedClassification: null,
53
+ classificationAgreement: null,
54
+ observedIssueCodes: readiness?.blockingIssueCodes ?? [],
55
+ expectedIssueCodes: null,
56
+ issueCodesAgreement: null,
57
+ observedPrimaryIssueCode: readiness?.primaryIssue?.code ?? null,
58
+ expectedPrimaryIssueCode: null,
59
+ primaryIssueAgreement: null,
60
+ reason: "The expectation fixture declares no readiness expectation."
61
+ };
62
+ }
63
+ if (readiness === undefined) {
64
+ return {
65
+ availability: "unavailable",
66
+ observedDecision: null,
67
+ allowedDecisions: expectation.allowedDecisions ?? null,
68
+ decisionAgreement: null,
69
+ observedClassification: null,
70
+ expectedClassification: expectation.expectedClassification ?? null,
71
+ classificationAgreement: null,
72
+ observedIssueCodes: [],
73
+ expectedIssueCodes: expectation.expectedIssueCodes ?? null,
74
+ issueCodesAgreement: null,
75
+ observedPrimaryIssueCode: null,
76
+ expectedPrimaryIssueCode: expectation.expectedPrimaryIssueCode ?? null,
77
+ primaryIssueAgreement: null,
78
+ reason: "No readiness result was supplied."
79
+ };
80
+ }
81
+ const decisionAgreement = expectation.allowedDecisions === undefined ? null : expectation.allowedDecisions.includes(readiness.decision);
82
+ const classificationAgreement = expectation.expectedClassification === undefined ? null : expectation.expectedClassification === readiness.classification;
83
+ const issueCodesAgreement = expectation.expectedIssueCodes === undefined
84
+ ? null
85
+ : expectation.expectedIssueCodes.length === readiness.blockingIssueCodes.length &&
86
+ expectation.expectedIssueCodes.every((code) => readiness.blockingIssueCodes.includes(code));
87
+ const primaryIssueAgreement = expectation.expectedPrimaryIssueCode === undefined
88
+ ? null
89
+ : expectation.expectedPrimaryIssueCode === (readiness.primaryIssue?.code ?? null);
90
+ return {
91
+ availability: "available",
92
+ observedDecision: readiness.decision,
93
+ allowedDecisions: expectation.allowedDecisions ?? null,
94
+ decisionAgreement,
95
+ observedClassification: readiness.classification,
96
+ expectedClassification: expectation.expectedClassification ?? null,
97
+ classificationAgreement,
98
+ observedIssueCodes: readiness.blockingIssueCodes,
99
+ expectedIssueCodes: expectation.expectedIssueCodes ?? null,
100
+ issueCodesAgreement,
101
+ observedPrimaryIssueCode: readiness.primaryIssue?.code ?? null,
102
+ expectedPrimaryIssueCode: expectation.expectedPrimaryIssueCode ?? null,
103
+ primaryIssueAgreement,
104
+ reason: null
105
+ };
106
+ }
107
+ export function calculateInvalidReady(readiness, expectation) {
108
+ if (readiness === undefined) {
109
+ return { availability: "unavailable", invalidReady: null, observedDecision: null, expectedBlockingDecision: false, missingExpectedIssueCodes: [], reason: "No readiness result was supplied." };
110
+ }
111
+ if (expectation === undefined) {
112
+ return { availability: "not-applicable", invalidReady: null, observedDecision: readiness.decision, expectedBlockingDecision: false, missingExpectedIssueCodes: [], reason: "The expectation fixture declares no readiness expectation." };
113
+ }
114
+ const expectsBlocking = (expectation.allowedDecisions !== undefined &&
115
+ !expectation.allowedDecisions.includes("ready") &&
116
+ (expectation.allowedDecisions.includes("refresh-required") || expectation.allowedDecisions.length > 0)) ||
117
+ (expectation.expectedIssueCodes !== undefined && expectation.expectedIssueCodes.length > 0);
118
+ if (!expectsBlocking) {
119
+ return { availability: "not-applicable", invalidReady: null, observedDecision: readiness.decision, expectedBlockingDecision: false, missingExpectedIssueCodes: [], reason: "The expectation fixture does not require blocked or refresh-required behavior." };
120
+ }
121
+ if (readiness.decision !== "ready") {
122
+ return { availability: "available", invalidReady: false, observedDecision: readiness.decision, expectedBlockingDecision: true, missingExpectedIssueCodes: [], reason: null };
123
+ }
124
+ const expectedCodes = expectation.expectedIssueCodes ?? [];
125
+ const missing = expectedCodes.filter((code) => !readiness.blockingIssueCodes.includes(code));
126
+ return { availability: "available", invalidReady: true, observedDecision: readiness.decision, expectedBlockingDecision: true, missingExpectedIssueCodes: missing, reason: null };
127
+ }
128
+ export function calculateValidBlocked(readiness, expectation) {
129
+ if (readiness === undefined) {
130
+ return { availability: "unavailable", validBlocked: null, validRefreshRequired: null, observedDecision: null, reason: "No readiness result was supplied." };
131
+ }
132
+ if (expectation === undefined) {
133
+ return { availability: "not-applicable", validBlocked: null, validRefreshRequired: null, observedDecision: readiness.decision, reason: "The expectation fixture declares no readiness expectation." };
134
+ }
135
+ if (readiness.decision !== "refresh-required") {
136
+ return { availability: "available", validBlocked: false, validRefreshRequired: false, observedDecision: readiness.decision, reason: null };
137
+ }
138
+ const allowsRefreshRequired = expectation.allowedDecisions === undefined || expectation.allowedDecisions.includes("refresh-required");
139
+ const issueCodesMatch = expectation.expectedIssueCodes === undefined ||
140
+ expectation.expectedIssueCodes.every((code) => readiness.blockingIssueCodes.includes(code));
141
+ const primaryMatches = expectation.expectedPrimaryIssueCode === undefined || expectation.expectedPrimaryIssueCode === (readiness.primaryIssue?.code ?? null);
142
+ const valid = allowsRefreshRequired && issueCodesMatch && primaryMatches;
143
+ return { availability: "available", validBlocked: valid, validRefreshRequired: valid, observedDecision: readiness.decision, reason: null };
144
+ }
145
+ export function calculateReadinessAgreementMetrics(readiness, expectation, supplementalPacket, packetSourcePath) {
146
+ return {
147
+ structuralAgreement: calculateReadinessStructuralAgreement(readiness, supplementalPacket, packetSourcePath),
148
+ decisionAgreement: calculateReadinessDecisionAgreement(readiness, expectation),
149
+ invalidReady: calculateInvalidReady(readiness, expectation),
150
+ validBlocked: calculateValidBlocked(readiness, expectation)
151
+ };
152
+ }
@@ -0,0 +1,50 @@
1
+ function extractRawIdentity(artifact) {
2
+ return {
3
+ projectRoot: artifact.index.projectRoot,
4
+ role: artifact.request.role,
5
+ freshnessState: artifact.freshness.state,
6
+ truncated: artifact.truncation.truncated
7
+ };
8
+ }
9
+ function truncationToYesNo(value) {
10
+ return value ? "yes" : "no";
11
+ }
12
+ function buildField(field, rawValue, supplementalValue, unavailableReason) {
13
+ if (unavailableReason !== null) {
14
+ return { field, rawValue, supplementalValue, agreement: null, availability: "unavailable", reason: unavailableReason };
15
+ }
16
+ return { field, rawValue, supplementalValue, agreement: rawValue === supplementalValue, availability: "available", reason: null };
17
+ }
18
+ export function calculateSupplementalRawAgreement(supplemental, raw) {
19
+ if (supplemental === undefined || raw === undefined) {
20
+ const reason = supplemental === undefined && raw === undefined
21
+ ? "Neither a supplemental document nor a raw artifact was supplied."
22
+ : supplemental === undefined
23
+ ? "No supplemental document was supplied."
24
+ : "No raw context-capsule or retrieval-audit artifact was supplied.";
25
+ const fields = [
26
+ buildField("canonicalRepositoryIdentity", null, supplemental?.indexIdentity ?? null, reason),
27
+ buildField("role", null, supplemental?.role ?? null, reason),
28
+ buildField("freshness", null, supplemental?.freshness ?? null, reason),
29
+ buildField("requiredEvidenceTruncated", null, supplemental?.requiredEvidenceTruncated ?? null, reason)
30
+ ];
31
+ return { fields, contradictions: [], upstreamProducerParityPreserved: null };
32
+ }
33
+ const rawIdentity = extractRawIdentity(raw);
34
+ const fields = [];
35
+ fields.push(buildField("canonicalRepositoryIdentity", rawIdentity.projectRoot ?? null, supplemental.indexIdentity, rawIdentity.projectRoot === undefined ? "The raw artifact does not declare index.projectRoot." : null));
36
+ const roleComparable = rawIdentity.role === "implementation" || rawIdentity.role === "test-implementation";
37
+ fields.push(buildField("role", rawIdentity.role, supplemental.role, roleComparable ? null : `Raw role "${rawIdentity.role}" has no supplemental-document counterpart in this vocabulary.`));
38
+ fields.push(buildField("freshness", rawIdentity.freshnessState, supplemental.freshness, null));
39
+ fields.push(buildField("requiredEvidenceTruncated", truncationToYesNo(rawIdentity.truncated), supplemental.requiredEvidenceTruncated, supplemental.requiredEvidenceTruncated === "unknown"
40
+ ? "The supplemental document declares truncation as \"unknown\", so agreement with the raw boolean cannot be determined."
41
+ : null));
42
+ const contradictions = fields.filter((f) => f.availability === "available" && f.agreement === false);
43
+ return {
44
+ fields,
45
+ contradictions,
46
+ // A successfully read raw pair is itself the observed outcome of the frozen
47
+ // assertRawEvidenceParity() write-time guard; see file header. Never recomputed here.
48
+ upstreamProducerParityPreserved: true
49
+ };
50
+ }
@@ -0,0 +1,44 @@
1
+ export function classifyTruncationRecord(record, sourceArtifact, sourceInstance) {
2
+ const base = {
3
+ groupId: record.affectedGroup,
4
+ sourceArtifact,
5
+ sourceInstance,
6
+ limit: record.limit,
7
+ used: record.used,
8
+ available: record.available,
9
+ omittedRequiredEvidenceIds: record.requiredEvidenceLost ? record.droppedEvidenceIds : []
10
+ };
11
+ if (!record.requiredEvidenceLost) {
12
+ return {
13
+ ...base,
14
+ cause: "none",
15
+ availability: "available",
16
+ reason: "No fixture-required evidence was reported lost for this group."
17
+ };
18
+ }
19
+ if (record.limit === null) {
20
+ return {
21
+ ...base,
22
+ cause: "unresolved",
23
+ availability: "available",
24
+ reason: "Required evidence was lost but no hard limit is declared for this group, so avoidability cannot be proven either way."
25
+ };
26
+ }
27
+ if (record.used < record.limit) {
28
+ return {
29
+ ...base,
30
+ cause: "avoidable",
31
+ availability: "available",
32
+ reason: `Required evidence was lost while used (${record.used}) remained below the declared limit (${record.limit}); compatible headroom existed under the hard limit.`
33
+ };
34
+ }
35
+ return {
36
+ ...base,
37
+ cause: "genuine-hard-limit",
38
+ availability: "available",
39
+ reason: `Required evidence was lost and used (${record.used}) reached or exceeded the declared limit (${record.limit}); no compatible headroom remained.`
40
+ };
41
+ }
42
+ export function classifyTruncationRecords(records, sourceArtifact, sourceInstance) {
43
+ return records.map((record) => classifyTruncationRecord(record, sourceArtifact, sourceInstance));
44
+ }
@@ -0,0 +1,127 @@
1
+ import { collectSelectedOwnerEvidence, calculateOwnerMetrics } from "./calculateOwnerMetrics.js";
2
+ import { calculateAllocationFactsForGroups } from "./calculateAllocationMetrics.js";
3
+ import { classifyTruncationRecords } from "./calculateTruncationClassification.js";
4
+ import { calculateSupplementalRawAgreement } from "./calculateSupplementalRawAgreement.js";
5
+ import { calculateReadinessAgreementMetrics } from "./calculateReadinessAgreement.js";
6
+ import { calculateCriticalityMetrics } from "./calculateCriticalityMetrics.js";
7
+ function ownerExpectationsFor(expectations, sourceArtifact) {
8
+ return expectations?.ownerExpectations?.filter((e) => e.sourceArtifact === sourceArtifact);
9
+ }
10
+ function evaluateSide(input, expectations) {
11
+ const producerExpectations = expectations?.producerReadinessExpectations;
12
+ // Owner-selection and allocation-group evidence only exist on ContextCapsule (Batch 1
13
+ // contract-lock evidence: RetrievalAuditRecord has no selectedOwners/evidenceGroups
14
+ // fields). Truncation and responsibility-mapping evidence exist on both.
15
+ const capsule = input.contextCapsule;
16
+ const truncationArtifact = input.contextCapsule ?? input.retrievalAuditRecord;
17
+ const rawForAgreement = input.contextCapsule ?? input.retrievalAuditRecord;
18
+ const selectedOwnerEvidence = capsule ? collectSelectedOwnerEvidence(capsule.selectedOwners, "context-capsule", input.role) : undefined;
19
+ const ownerEvaluation = calculateOwnerMetrics(selectedOwnerEvidence, ownerExpectationsFor(producerExpectations, "context-capsule"));
20
+ const allocationFacts = capsule
21
+ ? calculateAllocationFactsForGroups(capsule.evidenceGroups, "context-capsule", input.role)
22
+ : { requiredGroupCapacity: [], usedReservation: [], borrowedCapacity: [], unusedCapacity: [] };
23
+ const allocationEvaluation = {
24
+ ...allocationFacts,
25
+ requiredEvidenceOmitted: {
26
+ availability: "not-applicable",
27
+ count: null,
28
+ evidenceKeys: [],
29
+ reason: "Batch 3 bridge evaluation derives omission from truncation records, not expectation matches; see truncationEvaluation."
30
+ },
31
+ requiredEvidenceOmittedEntries: []
32
+ };
33
+ const truncationSourceArtifact = input.contextCapsule ? "context-capsule" : "retrieval-audit-record";
34
+ const truncationEvaluation = truncationArtifact
35
+ ? classifyTruncationRecords(truncationArtifact.truncation.records, truncationSourceArtifact, input.role)
36
+ : [];
37
+ const packetAgreement = input.packet !== undefined || rawForAgreement !== undefined ? calculateSupplementalRawAgreement(input.packet, rawForAgreement) : null;
38
+ const reportAgreement = input.report !== undefined || rawForAgreement !== undefined ? calculateSupplementalRawAgreement(input.report, rawForAgreement) : null;
39
+ return { ownerEvaluation, allocationEvaluation, truncationEvaluation, packetAgreement, reportAgreement };
40
+ }
41
+ // Builds bridge-evaluator input from an already-loaded combined-bounded-stage-context
42
+ // execution payload (Batch 3 section 12.1: "accept already-read raw, supplemental,
43
+ // readiness, and expectation inputs"). Never reads a file itself.
44
+ export function buildProducerReadinessBridgeInputFromCombinedPayload(payload, expectations) {
45
+ const implementationPair = payload.contextArtifacts.find((p) => p.role === "implementation");
46
+ const testPair = payload.contextArtifacts.find((p) => p.role === "test-implementation");
47
+ const hasImplementationSide = implementationPair !== undefined || payload.implementationContextPacket !== undefined || payload.implementationContextRetrievalReport !== undefined;
48
+ const hasTestSide = testPair !== undefined || payload.testContextPacket !== undefined || payload.testContextRetrievalReport !== undefined;
49
+ return {
50
+ implementation: hasImplementationSide
51
+ ? {
52
+ role: "implementation",
53
+ contextCapsule: implementationPair?.contextCapsule,
54
+ retrievalAuditRecord: implementationPair?.retrievalAuditRecord,
55
+ packet: payload.implementationContextPacket,
56
+ packetSourcePath: payload.implementationContextPacketSourcePath,
57
+ report: payload.implementationContextRetrievalReport
58
+ }
59
+ : undefined,
60
+ testImplementation: hasTestSide
61
+ ? {
62
+ role: "test-implementation",
63
+ contextCapsule: testPair?.contextCapsule,
64
+ retrievalAuditRecord: testPair?.retrievalAuditRecord,
65
+ packet: payload.testContextPacket,
66
+ packetSourcePath: payload.testContextPacketSourcePath,
67
+ report: payload.testContextRetrievalReport
68
+ }
69
+ : undefined,
70
+ readiness: payload.readiness,
71
+ expectations
72
+ };
73
+ }
74
+ export function evaluateProducerReadinessBridge(input) {
75
+ const hasAnyInput = input.implementation !== undefined || input.testImplementation !== undefined || input.readiness !== undefined;
76
+ if (!hasAnyInput) {
77
+ return {
78
+ status: "not-applicable",
79
+ reason: "No producer-readiness bridge inputs (supplemental artifacts or readiness result) were supplied.",
80
+ implementation: null,
81
+ testImplementation: null,
82
+ readinessAgreement: null,
83
+ criticalityEvaluation: null,
84
+ warnings: [],
85
+ evidenceReferences: []
86
+ };
87
+ }
88
+ const evidenceReferences = [];
89
+ const warnings = [];
90
+ let implementation = null;
91
+ if (input.implementation !== undefined) {
92
+ const evaluated = evaluateSide(input.implementation, input.expectations);
93
+ implementation = { role: "implementation", ...evaluated };
94
+ if (input.implementation.packetSourcePath)
95
+ evidenceReferences.push(input.implementation.packetSourcePath);
96
+ }
97
+ let testImplementation = null;
98
+ if (input.testImplementation !== undefined) {
99
+ const evaluated = evaluateSide(input.testImplementation, input.expectations);
100
+ testImplementation = { role: "test-implementation", ...evaluated };
101
+ if (input.testImplementation.packetSourcePath)
102
+ evidenceReferences.push(input.testImplementation.packetSourcePath);
103
+ }
104
+ let readinessAgreement = null;
105
+ if (input.readiness !== undefined) {
106
+ const readinessExpectations = input.expectations.producerReadinessExpectations?.readinessExpectations;
107
+ const matchingExpectation = readinessExpectations?.find((e) => e.kind === input.readiness.kind);
108
+ const relevantPacket = input.readiness.kind === "implementation" ? input.implementation?.packet : input.testImplementation?.packet;
109
+ const relevantPacketPath = input.readiness.kind === "implementation" ? input.implementation?.packetSourcePath : input.testImplementation?.packetSourcePath;
110
+ readinessAgreement = calculateReadinessAgreementMetrics(input.readiness, matchingExpectation, relevantPacket, relevantPacketPath);
111
+ }
112
+ const criticalityMappings = input.testImplementation?.retrievalAuditRecord?.responsibilityMappings.mappings ??
113
+ input.testImplementation?.contextCapsule?.responsibilityMappings.mappings ??
114
+ input.implementation?.retrievalAuditRecord?.responsibilityMappings.mappings ??
115
+ input.implementation?.contextCapsule?.responsibilityMappings.mappings;
116
+ const criticalityEvaluation = calculateCriticalityMetrics(criticalityMappings, input.expectations.producerReadinessExpectations?.criticalityExpectations);
117
+ return {
118
+ status: "evaluated",
119
+ reason: null,
120
+ implementation,
121
+ testImplementation,
122
+ readinessAgreement,
123
+ criticalityEvaluation,
124
+ warnings,
125
+ evidenceReferences
126
+ };
127
+ }
@@ -8,3 +8,10 @@ export { compareExpectedContextCapsuleState, compareExpectedRetrievalAuditState,
8
8
  export { calculateContextCapsuleResponsibilityMappingMetric, calculateRetrievalAuditResponsibilityMappingMetric } from "./calculateResponsibilityMappingMetrics.js";
9
9
  export { calculateV043ExecutionContextSize } from "./calculateContextSizeMetrics.js";
10
10
  export { evaluateV043StageContextExecution } from "./evaluateV043StageContextExecution.js";
11
+ export { collectSelectedOwnerEvidence, calculateOwnerMetrics } from "./calculateOwnerMetrics.js";
12
+ export { calculateAllocationFactsForGroups, calculateRequiredEvidenceOmitted, findAllocationExpectationForGroup } from "./calculateAllocationMetrics.js";
13
+ export { classifyTruncationRecord, classifyTruncationRecords } from "./calculateTruncationClassification.js";
14
+ export { calculateSupplementalRawAgreement } from "./calculateSupplementalRawAgreement.js";
15
+ export { calculateReadinessStructuralAgreement, calculateReadinessDecisionAgreement, calculateInvalidReady, calculateValidBlocked, calculateReadinessAgreementMetrics } from "./calculateReadinessAgreement.js";
16
+ export { calculateCriticalityMetrics } from "./calculateCriticalityMetrics.js";
17
+ export { evaluateProducerReadinessBridge, buildProducerReadinessBridgeInputFromCombinedPayload } from "./evaluateProducerReadinessBridge.js";
@@ -18,6 +18,16 @@ export function checkMyDevKitContextArtifactConsistency(capsule, audit) {
18
18
  capsuleValue: capsule.index.manifestPath,
19
19
  auditValue: audit.index.manifestPath
20
20
  },
21
+ {
22
+ fieldPath: "index.manifestSchemaVersion",
23
+ capsuleValue: capsule.index.manifestSchemaVersion ?? null,
24
+ auditValue: audit.index.manifestSchemaVersion ?? null
25
+ },
26
+ {
27
+ fieldPath: "index.projectRoot",
28
+ capsuleValue: capsule.index.projectRoot ?? null,
29
+ auditValue: audit.index.projectRoot ?? null
30
+ },
21
31
  {
22
32
  fieldPath: "contextAdequacy",
23
33
  capsuleValue: capsule.contextAdequacy,
@@ -1,3 +1,9 @@
1
1
  export { readMyDevKitContextCapsuleV1 } from "./readMyDevKitContextCapsuleV1.js";
2
2
  export { readMyDevKitRetrievalAuditRecordV1 } from "./readMyDevKitRetrievalAuditRecordV1.js";
3
3
  export { readOrchestratorWorkflowInstructionPacketV1 } from "./readOrchestratorWorkflowInstructionPacketV1.js";
4
+ export { ROLE_BY_DOCUMENT_KIND, REQUIRED_METADATA_BY_DOCUMENT_KIND, REQUIRED_SECTIONS_BY_DOCUMENT_KIND, VALID_REPOSITORY_SCOPES, VALID_DECLARED_STATUSES, VALID_FRESHNESS_VALUES, VALID_ADEQUACY_VALUES, VALID_TRUNCATION_VALUES } from "./supplementalContextTypes.js";
5
+ export { readImplementationContextPacketV1 } from "./readImplementationContextPacketV1.js";
6
+ export { readImplementationContextRetrievalReportV1 } from "./readImplementationContextRetrievalReportV1.js";
7
+ export { readTestContextPacketV1 } from "./readTestContextPacketV1.js";
8
+ export { readTestContextRetrievalReportV1 } from "./readTestContextRetrievalReportV1.js";
9
+ export { READINESS_DECISIONS, READINESS_CLASSIFICATIONS, validateOrchestratorContextReadinessResultV1, checkSupplementalReadinessIdentityConsistency } from "./orchestratorContextReadinessResultV1.js";