Repository navigation
refactor(coverage): give the complete/partial/unknown status one owner and ratchet local completeness enums - #11134
Conversation
…r and ratchet local completeness enums
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
[Medium impact] The PR reaches shared coverage schemas across several analysis areas and one comparison workflow. The code changes appear sound, but the required PR description update should be completed before merging.
|
…'s coverage is unknown (#11162)
Summary
Coverage status had no owner. 71 source files declare 120
z.enum([...])vocabularies that contain"complete". Fifteen of them are the same["complete", "partial", "unknown"]copied into 12 files, and many others leave outunknown, so a producer that cannot tell has to claimcompleteorpartial. This PR addssrc/domain/coverage.tswithcoverageStatusSchema, moves the 16 identical copies onto it, and adds a counted architecture guard so the number of local completeness enums can only go down.This is the first slice of W6 step 2 (structural audit report 05, section 2). No linked issue.
Problem and expected behavior
["complete", "partial"]enum that cannot represent unknown."complete"failsscripts/verify/architecture-guards.mjs(local-completeness-enum). Removing one requires--shrink-baselines, so a removal cannot be undone silently.Change and scope
src/domain/coverage.ts:coverageStatusSchema/CoverageStatus, documented so that absence of a report meansunknown, nevercomplete.protobufWire,callPathSchemas,referenceSourceGraph,relationshipCoverage,toolOutputSchemaGroups,functionComparisonSchemas, Android JNI and native declarations, Apple asset catalog, protobuf capture view, JavaScript route inventory, source-to-bundle comparison) now use the owner. The advertised JSON Schema is the same because the enum values are the same.scripts/verify/completeness-enum-guard.mjs) allows whitespace and line breaks betweenz,.enum(and[, so oxfmt's chained layout is counted, and it skips detail levels (lists containing"summary"), which choose how much to return rather than what was examined.["complete", "partial"],["complete", "partial", "unavailable"],complete-within-inputs) change wire values when migrated, so they need per-domain PRs. A combiner where unknown wins is left out until a fold migrates onto it. The folds I sampled (source-to-bundle comparison, Android JNI, JavaScript routes) each mix in domain-specific outcomes, so they are not drop-in joins.Contract and boundary impact
src/domain/coverage.ts; consumers are the 12 schema files above.reused: "inline").Expected effects:
Evidence and regression coverage
tests/evaluation/completenessEnumGuard.test.tscovers the counter (inline, chained and multi-line lists counted; detail levels and lists without"complete"ignored). The guard is the regression for new enums. Appendingz.enum(["complete", "partial"])tosrc/domain/protobufWire.tsmakesnode scripts/verify/architecture-guards.mjsfail withsrc/domain/protobufWire.ts: 1 (baseline 0).For evidence-bearing changes:
Validation performed
npm run test:local -- src/domain/referenceSourceGraph.test.ts src/domain/callPath.test.ts src/domain/apple/appleAssetCatalog.test.ts src/domain/android/androidJniBindings.test.ts src/domain/javascript/sourceToBundleComparison.test.ts src/domain/javascript/javascriptRouteInventory.test.ts src/contracts/outputSchemaDefinitions.test.ts src/contracts/compactOutputSchema.test.ts src/contracts/toolSchemaMetadata.test.ts— 9 files, 206 tests passed.npm run test:local -- tests/evaluation/completenessEnumGuard.test.ts— 3 passed.node scripts/verify/architecture-guards.mjs— passed; fails as shown above when a new local enum is added.npm run check:fast— passed.Compatibility, safety, and release
Included from #11162 (collapsed into this PR)
This PR also carries #11162, which changes behaviour. The "no behaviour change" statements above cover only the enum migration and guard.
src/domain/coverage.tsaddsjoinCoverageStatus(parts): any unknown gives unknown, then any partial gives partial, otherwise complete.compare_source_to_bundle:coverage.statusnow folds the reference inventory and graph coverage through it. When either input isunknown(or the graph isunavailable), it reports"unknown"where it reported"partial"before. This is an additive output enum value; clients should treat it as not complete. Complete with complete is stillcomplete-within-inputs, and partial without unknown is stillpartial.sourceToBundleComparison.test.ts"source to bundle coverage" covers 5 input pairs. With the base implementation restored, all 5 fail; with the change, 30 of 30 pass.npm run test:local -- src/domain/javascript/sourceToBundleComparison.test.ts(30 passed);npm run test:local -- src/application/analysisView/JavaScriptProvenanceViews.test.ts src/contracts/outputSchemaDefinitions.test.ts src/contracts/compactOutputSchema.test.ts(24 passed);node scripts/verify/architecture-guards.mjs(passed);npm run check:fast(passed).Author readiness
Human owner:
Before merge
type(scope): outcome.