Skip to content

Feat/coverage external bucket and swift methods - #77

Merged
dejo1307 merged 6 commits into
mainfrom
feat/coverage-external-bucket-and-swift-methods
Jul 8, 2026
Merged

Feat/coverage external bucket and swift methods#77
dejo1307 merged 6 commits into
mainfrom
feat/coverage-external-bucket-and-swift-methods

Conversation

@dejo1307

@dejo1307 dejo1307 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

dejo1307 added 6 commits July 8, 2026 13:21
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.
@dejo1307
dejo1307 merged commit be76612 into main Jul 8, 2026
4 checks passed
@dejo1307
dejo1307 deleted the feat/coverage-external-bucket-and-swift-methods branch July 18, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant