Title: feat: registry query layer — shared foundation for layout manifest (#670) and impact analysis (#733) · Issue #748 · github/squad · GitHub
Open Graph Title: feat: registry query layer — shared foundation for layout manifest (#670) and impact analysis (#733) · Issue #748 · github/squad
X Title: feat: registry query layer — shared foundation for layout manifest (#670) and impact analysis (#733) · Issue #748 · github/squad
Description: Summary PRD: docs/proposals/registry-query-layer.md PR #737 ships .squad/repo-registry.json with module/owner/package/criticality data and low-level utilities. But both #670 (versioned file layout manifest) and #733 (PR impact analysis) ...
Open Graph Description: Summary PRD: docs/proposals/registry-query-layer.md PR #737 ships .squad/repo-registry.json with module/owner/package/criticality data and low-level utilities. But both #670 (versioned file layout ...
X Description: Summary PRD: docs/proposals/registry-query-layer.md PR #737 ships .squad/repo-registry.json with module/owner/package/criticality data and low-level utilities. But both #670 (versioned file layout ...
Opengraph URL: https://github.com/github/squad/issues/748
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat: registry query layer — shared foundation for layout manifest (#670) and impact analysis (#733)","articleBody":"## Summary\n\n**PRD:** `docs/proposals/registry-query-layer.md`\n\nPR #737 ships `.squad/repo-registry.json` with module/owner/package/criticality data and low-level utilities. But both #670 (versioned file layout manifest) and #733 (PR impact analysis) need a **query and analysis layer** on top of that data — and they need the **same** one, or they'll diverge on file resolution, criticality scoring, and owner mapping.\n\nThis issue tracks building `scripts/registry-query.mjs`: a set of pure functions that take the repo registry + a list of file paths and return structured analysis (modules touched, owners involved, criticality distribution, risk tier, boundary crossings).\n\n## Why This Must Be One Shared Foundation\n\n1. **Single resolution algorithm.** File→module uses longest-prefix matching. Independent implementations will disagree on edge cases (nested modules like `src/cli/shell/` vs `src/cli/`).\n2. **Single criticality model.** Both need the same tier definitions and scoring.\n3. **Single owner resolution.** #670 needs it for validation diagnostics; #733 needs it for reviewer routing.\n4. **Composability.** Pure function: `analyzeFiles(registry, filePaths) → AnalysisResult`. #670 calls it with expected files; #733 calls it with PR diff files.\n\n## API Surface\n\n- `loadRegistry(path?)` — load and parse repo-registry.json\n- `resolveFile(filePath, registry)` — single file → module/owner/package/tier\n- `analyzeFiles(filePaths, registry)` — batch analysis with aggregates\n- `computeRiskTier(analysis, diffStats?)` — LOW/MEDIUM/HIGH/CRITICAL per #733's criteria\n- `getInvolvedOwners(analysis)` — deduplicated, ranked owner list\n\n## Depends On\n\n- **PR #737** (repo-registry) — must merge first; provides data source + low-level utils\n\n## Feeds Into\n\n- **#670** — versioned file layout manifest (uses query layer for criticality + template resolution)\n- **#733** — PR impact analysis (uses query layer for batch analysis + risk scoring + reviewer routing)\n\n## Acceptance Criteria\n\nSee full PRD at `docs/proposals/registry-query-layer.md` for detailed criteria. Key gates:\n\n- [ ] `scripts/registry-query.mjs` with 5 exported functions\n- [ ] Correct resolution for all path types (source modules, nested modules, critical files, templates, unknown)\n- [ ] `analyzeFiles()` aggregates match expected output for PR #631 (361 files → 18+ modules)\n- [ ] `computeRiskTier()` implements #733's exact threshold criteria\n- [ ] `test/registry-query.test.ts` with ≥20 test cases\n- [ ] Manual integration test against real PR diff\n\n## File Layout\n\n`\nscripts/registry-query.mjs ← NEW (this issue)\ntest/registry-query.test.ts ← NEW (this issue)\n`\n\nBuilds on top of #737's `scripts/registry-utils.mjs` and `.squad/repo-registry.json`.","author":{"url":"https://github.com/diberry","@type":"Person","name":"diberry"},"datePublished":"2026-04-02T16:52:20Z","url":"https://github.com/github/squad/issues/748"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:de8cf8ec-cdfe-a4a4-3dc0-5e91947a747d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EAA2:317608:267EE63:30B8465:6B018D4E |
| html-safe-nonce | 8b925c32b7b7ebeed93dd8657da707685f66d064fde07609789c4d0606ace083 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQUEyOjMxNzYwODoyNjdFRTYzOjMwQjg0NjU6NkIwMThENEUiLCJ2aXNpdG9yX2lkIjoiNzU3Mzc0NjA4NzQ3NTkwNzkxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 92134787378c2cd7d205ebb9913e022336d9a227df7f64639f74c1982dc066df |
| hovercard-subject-tag | issue:4195793755 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/github/squad/748/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a1ad803c730efce14a84f6f0ae9904e4f46d97360f13c1a0a0cfc9dbdfb8307a/github/squad/issues/748 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a1ad803c730efce14a84f6f0ae9904e4f46d97360f13c1a0a0cfc9dbdfb8307a/github/squad/issues/748 |
| og:image:alt | Summary PRD: docs/proposals/registry-query-layer.md PR #737 ships .squad/repo-registry.json with module/owner/package/criticality data and low-level utilities. But both #670 (versioned file layout ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | diberry |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/github/squad git https://github.com/github/squad.git |
| octolytics-dimension-user_id | 9919 |
| octolytics-dimension-user_login | github |
| octolytics-dimension-repository_id | 1151205052 |
| octolytics-dimension-repository_nwo | github/squad |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1151205052 |
| octolytics-dimension-repository_network_root_nwo | github/squad |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width