Feat/coverage external bucket and swift methods - #77
Merged
Conversation
Cross-repo coverage counted every unresolved client call as an internal blind spot, conflating genuine gaps with calls to hardcoded third-party hosts. Split those out and improve Swift verb detection so fewer internal calls are missed. - Swift URLSession method inference: scan a symmetric window (the verb is often set before the path is appended) and recognize enum / .rawValue / leading-dot `.method = .x` forms, validated against the verb set; GET only as a last resort. - Swift external detection: tag a client route whose base URL is a hardcoded absolute host with external=true + host (internal/extractors/swiftextractor). - Linker: httpCoverage gains an `external` tally; external client calls are bucketed out of unresolved and produce no cross-repo edge (internal/linkers/crossrepo). - Metric: CoverageSummary.ExternalEdges; unresolved_edges is now internal-only; surfaced in the coverage explainer, coverage_report, and the global receipt. - Bump extractor cacheVersion v88 -> v89 (Swift facts change) and register the cachecov guard entry for v89. Totals reconcile per service: detected = resolved + unresolved + external.
…or wins Aggregate coverage counts couldn't tell which client calls were unresolved, so every fix was guesswork. Add a per-call verdict and land the no-risk extractor gaps, so the residual can be triaged from data. - crossrepo: UnmatchedClientRouteKeys mirrors linkHTTP's resolution exactly; shared indexServerRoutes keeps the verdict in lockstep. - engine: flagUnmatchedRoutes tags client call sites unmatched_by_server + unmatched_reason (no_method | generic_path | no_match), recomputed each link. - kotlin/retrofit: absolute-URL annotations tagged external=true + host. - ruby routes: `match ... via:` verbs and `scope`/`namespace path:` prefixes. - Bump extractor cacheVersion v89 -> v90 and register the cachecov guard entry.
Rails routes both PATCH and PUT to a resources `update` action, but the Ruby extractor modeled only PATCH — so mobile clients calling PUT for updates had no server route to match, despite the endpoint being served. - ruby routes: resources/resource update emits both PATCH and PUT (restfulActions + restfulActionsSingular); only:/except: keep them together. - crossrepo: split the client-side no_match verdict into method_mismatch (a server route shares the path suffix but not the verb) vs path_unknown (no server serves the path), via a method-agnostic suffix index — so the residual triages itself. - Bump extractor cacheVersion v90 -> v91 and register the cachecov guard entry. Measured on a 3-repo graph: unresolved client calls dropped 97 -> 59 (38 PUT updates recovered); the remainder splits 51 path_unknown / 7 method_mismatch / 1 generic_path.
… path: routes The Ruby route extractor missed three common Rails DSL forms, so real backend endpoints weren't modeled and mobile clients calling them couldn't resolve. - get/post/match now accept a symbol path arg (`get :cities_by_zip`) via a new positional-only path helper that also avoids mistaking a `to:` handler string for the path. - `scope :users` (bare positional symbol) applies the path prefix, like `scope path: 'users'`. - `resource(s) ..., path: 'x'` overrides the URL segment (the resource name still drives props and the nested member param). - Bump extractor cacheVersion v91 -> v92 and register the cachecov guard entry.
The Swift endpoint extractor derived the HTTP method only from a `method`
switch parsed one line at a time, so two common shapes silently fell back to
GET — making real POST/PUT/DELETE calls miss their backend route:
- multi-line case-label lists: `switchReturns` read labels only from the line
starting with `case `, dropping continuation-line labels
(`case .a,\n .b: return .post`). Accumulate labels across lines until the `:`.
- single-value method properties: `var method: HTTPMethod { return .post }`
(no switch) yielded no cases; read its lone verb and apply it to every case.
- Bump extractor cacheVersion v92 -> v94 (two distinct re-extraction triggers)
and register the cachecov guard entries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.