Implement stateful Notifications domain for @counterfact/github#41
Draft
Copilot wants to merge 4 commits into
Draft
Implement stateful Notifications domain for @counterfact/github#41Copilot wants to merge 4 commits into
@counterfact/github#41Copilot wants to merge 4 commits into
Conversation
Copilot
AI
changed the title
Implement notifications domain in GitHub simulator
Implement stateful Notifications domain for Jun 8, 2026
@counterfact/github
Copilot created this pull request from a session on behalf of
pmcelhaney
June 8, 2026 23:40
View session
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.
Summary
Implemented the Notifications domain in the GitHub simulator by replacing random responses with stateful thread/subscription behavior and wiring it through a dedicated domain context. This adds realistic global and repo-scoped notification flows (list, mark read, mark done, manage subscription).
Original Prompt
Implement the next task from
.github/todoincounterfact/apis: complete.github/todo/notifications-v2.mdby adding a dedicatedroutes/notifications/_.context.ts, wiring it into root context and test harness, implementing all notifications/thread/subscription/repo-notifications route handlers, seeding notification scenario data, adding unit and route tests, deleting the completed todo file, and creating a PR.Manual acceptance tests
GET /notificationsreturns seeded unread threads.PUT /notificationsreturns202and subsequentGET /notificationsexcludes those threads by default.GET /notifications/threads/:idreturns thread data for existing IDs and404for unknown IDs.PATCH /notifications/threads/:idreturns205and the thread is no longer unread.DELETE /notifications/threads/:id/subscriptionreturns204, and subsequentGETfor that subscription returns404.PUT /repos/:owner/:repo/notificationsmarks only that repo’s threads as read (other repos remain unread).Tasks
Notifications domain context
github/routes/notifications/_.context.tswith notification + subscription state stores and methods:all=falsebehavior), repo scoping, pagination, and participating filter behavior.Root context + harness wiring
github/routes/_.context.ts./notificationsingithub/test-support/create-context.ts.Route implementations
routes/notifications.tsroutes/notifications/threads/{thread_id}.tsroutes/notifications/threads/{thread_id}/subscription.tsroutes/repos/{owner}/{repo}/notifications.tsthread_idhandling viaString($.path.thread_id)before lookup/mutation.Scenario seeding
notificationsscenario ingithub/scenarios/index.tsand included it inseedGitHub.counterfact/platform-apiand initial thread subscription state.Tests
github/test/notifications.context.test.tsfor direct domain-context unit coverage.github/test/routes.test.tswith notification HTTP-route coverage (global, thread, subscription, repo-scoped flows).Example behavior
Task cleanup
.github/todo/notifications-v2.md.