Skip to content

feat(pr-review): define linked issue source contracts - #5706

Closed
iscekic wants to merge 3 commits into
mobile-pr-review-context-5458-s10from
mobile-pr-review-context-5458-s11
Closed

iscekic wants to merge 3 commits into
mobile-pr-review-context-5458-s10from
mobile-pr-review-context-5458-s11

Conversation

@iscekic

@iscekic iscekic commented Aug 29, 2026 •

Copy link
Copy Markdown
Collaborator

No new behavior — the work prepares linked-issue support without changing the mobile app.


Summary

PR_CONTEXT_ISSUE_QUERIES adds PrReviewContextClosingIssues and PrReviewContextIssueEvents with ContextIssueEndpoint; PR_REVIEW_GRAPHQL_DOCUMENTS registers both for validation without activating reads.
contextIssueSchema validates issue and repository identity; contextIssueEventSchema maps five event types into directed connected, referenced, or duplicate records with removed markers.
Invalid createdAt values and URLs become null, and endpoints remain nullable; validation covers ConnectedEvent, DisconnectedEvent, CrossReferencedEvent, MarkedAsDuplicateEvent, and UnmarkedAsDuplicateEvent.

Files
  • apps/web/src/lib/github-pr-review/context-issues.ts — Added (+104/-0 lines). Adds server-only queries with 100-item cursor pages, total counts, and the pull request identity. Closing references set userLinkedOnly: false; both queries include issue numbers, titles, states, URLs, and repository names. Cross-reference selections also include referencedAt and willCloseTarget; normalization retains createdAt, not these two fields. Raw issue inputs omit relationships and require nonempty repository.nameWithOwner; endpoints accept only Issue, PullRequest, or null. Connected events map source to subject; cross-references retain source and target; duplicate events map duplicate to canonical. Event identifiers must be nonempty; disconnect and unmark events set removed.
  • apps/web/src/routers/github-pr-review-router.ts — Modified (+2/-0 lines). Imports the linked-issue queries and adds them to the document registry; existing routes and reader calls remain unchanged.
  • apps/web/src/lib/github-pr-review/context-issues-schema.test.ts — Added (+145/-0 lines). Adds 134 direct normalization cases for the linked-issue schemas.
  • apps/web/src/routers/github-pr-review-graphql-schema.test.ts — Modified (+2/-2 lines). Updates GraphQL schema validation coverage for the expanded document registry.

Tests: 2 files changed: context-issues-schema.test.ts added and github-pr-review-graphql-schema.test.ts updated; 134 direct normalization cases added.
Generated: 0 files changed.


Visual Changes

Visual Changes: N/A

Verification

No manual tests ran for this level because it defines source contracts without connecting the reader or changing mobile presentation.
Provider, fixture, mobile, and runtime acceptance remain in their approved later phases.

Reviewer Notes

Human steps

No human steps are required before merge or after merge.

Scope and automated evidence

  • Repository: Kilo-Org/cloud; worktree: /Users/igor/Projects/.worktrees/mobile-pr-review-context-5458.
  • Scope: level 11 only, from mobile-pr-review-context-5458-s10 to mobile-pr-review-context-5458-s11.
  • The handoff reports 155 passing tests across both changed suites, six passing scoped checks, and a passing fresh implementation review.

Notes

This level defines linked-issue source contracts. Reader integration and live backend/iOS verification remain pending on the completed stack tip.

Stacked PRs — merge bottom to top. Each level shows only its own diff.

Runtime verification (E2E, user advocacy, simplify) runs on the tip PR over every level.
Every level keeps its own checks, its own bot review, and its own threads; each one is answered on its own PR.
Each level is its own deliverable: it builds and passes its own checks alone.
A finding on a level is repaired on that level, then carried upward with stack.sh forward.

  1. mobile-pr-review-context-5458-s1 — ci(pr-review): enable checks for context stack bases #5679
  2. mobile-pr-review-context-5458-s2 — feat(pr-review): define source-backed context contracts #5682
  3. mobile-pr-review-context-5458-s3 — feat(pr-review): normalize optional context payloads #5684
  4. mobile-pr-review-context-5458-s4 — feat(pr-review): map available REST context metadata #5687
  5. mobile-pr-review-context-5458-s5 — feat(pr-review): isolate optional context reads #5690
  6. mobile-pr-review-context-5458-s6 — feat(pr-review): complete labels and requested people #5691
  7. mobile-pr-review-context-5458-s7 — feat(pr-review): define review source documents and normalization #5695
  8. mobile-pr-review-context-5458-s8 — feat(pr-review): select source-backed review decisions #5696
  9. mobile-pr-review-context-5458-s9 — feat(pr-review): integrate independent review context reads #5699
  10. mobile-pr-review-context-5458-s10 — test(pr-review): preserve review source failure coverage #5703
  11. mobile-pr-review-context-5458-s11 — feat(pr-review): define linked issue source contracts #5706 ← this PR
  12. mobile-pr-review-context-5458-s12 — feat(pr-review): integrate typed linked issue context #5707
  13. mobile-pr-review-context-5458-s13 — test(pr-review): cover linked issue source failures #5708
  14. mobile-pr-review-context-5458-s14 — feat(pr-review): preserve structured policy evidence #5709
  15. mobile-pr-review-context-5458-s15 — feat(pr-review): normalize applicable merge policies #5712
  16. mobile-pr-review-context-5458-s16 — feat(pr-review): read applicable merge policies #5713
  17. mobile-pr-review-context-5458-s17 — feat(pr-review): define requirement observation contracts #5720
  18. mobile-pr-review-context-5458-s18 — feat(pr-review): expand named policy requirements #5723
  19. mobile-pr-review-context-5458-s19 — feat(pr-review): evaluate evidenced check requirements #5727
  20. mobile-pr-review-context-5458-s20 — feat(pr-review): evaluate evidenced merge policies #5728
  21. mobile-pr-review-context-5458-s21 — test(pr-review): preserve check evaluation coverage #5730
  22. mobile-pr-review-context-5458-s22 — test(pr-review): preserve policy evaluation coverage #5732
  23. mobile-pr-review-context-5458-s23 — feat(pr-review): integrate requirement observation reads #5735
  24. mobile-pr-review-context-5458-s24 — test(pr-review): preserve requirement source coverage #5736
  25. mobile-pr-review-context-5458-s25 — test(pr-review): complete requirement reader coverage #5739
  26. mobile-pr-review-context-5458-s26 — feat(pr-review): preserve queue membership and position #5741
  27. mobile-pr-review-context-5458-s27 — refactor(pr-review): share mobile-safe context contracts #5744 (tip)

@kilo-code-bot

kilo-code-bot Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (4 files)
  • apps/web/src/lib/github-pr-review/context-issues.ts
  • apps/web/src/lib/github-pr-review/context-issues-schema.test.ts
  • apps/web/src/routers/github-pr-review-graphql-schema.test.ts
  • apps/web/src/routers/github-pr-review-router.ts

Reviewed by grok-4.6 · Input: 140.9K · Output: 17.5K · Cached: 311.3K

Review guidance: REVIEW.md from base branch mobile-pr-review-context-5458-s10

@iscekic

iscekic commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator Author

Closing: the owner stopped this workflow section. The branch is retained.

@iscekic iscekic closed this Aug 31, 2026
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