Repository navigation
feat(go): add guest visibility and invitations (#168) - #190
Conversation
Co-authored-by: Copilot <[email protected]> Copilot-Session: 7b842425-e150-41a6-9cd2-6b0842fe8c01
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 47 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThis PR adds researched guest API contracts, remote guest retrieval and invitation support, and host-only ChangesGuest operations
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant Operator as CLI operator
participant Execute as app.Execute
participant GuestCommands as guest command handlers
participant RemoteClient as remote guest client
participant CallableAPI as Callable API
Operator->>Execute: invoke guests.list or guests.invite
Execute->>GuestCommands: dispatch command
GuestCommands->>RemoteClient: retrieve guests or submit invitation
RemoteClient->>CallableAPI: authenticated request
CallableAPI-->>RemoteClient: paginated data or result envelope
RemoteClient-->>GuestCommands: validated response
GuestCommands-->>Operator: projected guests or submitted result
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Co-authored-by: Copilot <[email protected]> Copilot-Session: 7b842425-e150-41a6-9cd2-6b0842fe8c01
There was a problem hiding this comment.
Actionable comments posted: 10
🧹 Nitpick comments (3)
internal/app/guests_execute_test.go (1)
112-142: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winOptional: extend the privacy assertions to the resumed page.
The first page checks that no private value appears in the output (lines 106-110). The resumed page projects the cohost record, which comes from a payload that contains
private-cohostand the remote cursor. Repeat the same check forsecondso a future regression in cohost projection is caught.♻️ Proposed addition
if call != 6 { t.Fatalf("request count = %d, want two complete guest traversals", call) } + for _, privateValue := range []string{cohostUserID, guestCursor, "private-guest-2"} { + if strings.Contains(second.Stdout+second.Stderr, privateValue) { + t.Fatalf("second page exposed private value %q", privateValue) + } + } }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/app/guests_execute_test.go` around lines 112 - 142, Extend the resumed-page assertions after decoding `secondEnvelope` to verify that `second.Stdout` and `second.Stderr` do not contain the private value, matching the existing privacy checks for the first response while preserving the current pagination assertions.internal/remote/guests.go (1)
189-192: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReuse
eventJSONContentTypeingetGuestsPage.The helper applies the same
mime.ParseMediaTyperule as the inline check. Replace the inline check and remove the unusedmimeimport.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/remote/guests.go` around lines 189 - 192, Update getGuestsPage to use the existing eventJSONContentType helper for validating the response Content-Type instead of duplicating mime.ParseMediaType logic; preserve the ErrProtocolChanged guests content type error behavior and remove the now-unused mime import.internal/remote/guests_test.go (1)
18-59: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtend
internal/remote/guests_test.gowith request and pagination coverage.
- Capture
InviteGuestsAsHostrequests and assert the path,Authorizationheader, and encodeddata.paramsfields.- Add
GetGuestscases for missing ornullnextCursor, empty data with a cursor, repeated cursors, and rejection of the 21st non-empty page.- Assert
paging.maxResultsis500and the first-pagepaging.cursorisnull.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/remote/guests_test.go` around lines 18 - 59, Extend the tests around InviteGuestsAsHost to capture its HTTP request and verify the path, Authorization header, and encoded data.params values, including paging.maxResults=500 and a null first-page paging.cursor. Add GetGuests table cases covering missing/null nextCursor, empty data with a cursor, repeated cursors, and rejection after the 20th non-empty page (the 21st page).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/REMOTE-API-CONTRACT.md`:
- Around line 3-9: Align the review-status wording between this document and the
spec/partiful.openapi.json contract metadata: update the spec’s info.description
from the proposed/pending-review status to the owner-reviewed status for
revision 2026-08-12.5, matching the statement in this document.
- Around line 299-302: Update the “Historical provenance” sentence in the
documentation to say “27-operation historical draft lineage,” keeping the
referenced commit and surrounding provenance text unchanged.
- Around line 274-282: Add a guest provenance block to the ledger documenting
build Sf-HOOx63XpPtr5pPkTvg and deployment dpl_D7TPPj16g1fU46JSHSyrsRURxrK9,
alongside the existing getGuests and addInvitedGuestsAsHost request facts.
Preserve the current request details and clearly associate both identifiers with
the guest research evidence.
In `@internal/app/guests.go`:
- Line 606: Align guestsCollectionSuccessSchema with projectGuestList by
changing the partySize minimum from one to zero, so projected remoteGuest.Count
values of 0 remain schema-valid; do not add protocol-level rejection of
non-positive counts.
- Around line 551-561: Remove the caller-supplied query value from the Details
map in the ambiguous contact error returned by the contact-matching flow. Keep
the existing candidates data and match.ambiguous error fields unchanged, using
publicCandidates to provide disambiguation context.
In `@internal/remote/guests.go`:
- Around line 264-280: Update requiredGuestCount to validate the upper bound
using an exactly representable float64 limit such as 1<<53, replacing the
int-based MaxInt conversion. Preserve the existing checks for missing,
non-integer, and values below 1, and ensure values above the exact bound are
rejected before converting to int.
In `@spec/partiful.api-evidence.json`:
- Around line 397-404: The getGuests 200-status classification is inconsistent
across the machine-readable and human-readable ledgers. In
spec/partiful.api-evidence.json lines 397-404, update
operationClaims.getGuests.status to match the pointer claim for
`#/paths/`~1getGuests/post/responses/200; in
docs/research/2026-08-10-partiful-api-contract-evidence-ledger.md lines 51-55,
list the callable operations with protocol-specified 200 completion so the count
matches the JSON ledger and reconcile the later “four operations with
protocol-specified callable completion” statement.
- Around line 439-440: Update the earlier unresolvedUncertainty statement
listing callable operations with unknown parameter sets to include getGuests and
addInvitedGuestsAsHost alongside the existing operations, keeping the
uncertainty text consistent with the newly documented guest-list and host-invite
evidence.
- Around line 1349-1359: Remove all four evidence claims whose pointers target
addInvitedGuestsAsHost requestBody data.params.properties.guests from
spec/partiful.api-evidence.json, while preserving the existing
materialClaimCount value of 1739.
In `@spec/partiful.openapi.json`:
- Around line 3789-3796: Update the GetGuestsResponse.result.paging.nextCursor
schema to allow the explicit JSON null value alongside string, matching
decodeGuestNextCursor and the documented terminal behavior for nullish cursors.
---
Nitpick comments:
In `@internal/app/guests_execute_test.go`:
- Around line 112-142: Extend the resumed-page assertions after decoding
`secondEnvelope` to verify that `second.Stdout` and `second.Stderr` do not
contain the private value, matching the existing privacy checks for the first
response while preserving the current pagination assertions.
In `@internal/remote/guests_test.go`:
- Around line 18-59: Extend the tests around InviteGuestsAsHost to capture its
HTTP request and verify the path, Authorization header, and encoded data.params
values, including paging.maxResults=500 and a null first-page paging.cursor. Add
GetGuests table cases covering missing/null nextCursor, empty data with a
cursor, repeated cursors, and rejection after the 20th non-empty page (the 21st
page).
In `@internal/remote/guests.go`:
- Around line 189-192: Update getGuestsPage to use the existing
eventJSONContentType helper for validating the response Content-Type instead of
duplicating mime.ParseMediaType logic; preserve the ErrProtocolChanged guests
content type error behavior and remove the now-unused mime import.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: b02daaf4-84f9-4c9f-9479-78ec1d1a1989
📒 Files selected for processing (13)
docs/CLI-PRODUCT-CONTRACT.mddocs/REMOTE-API-CONTRACT.mddocs/research/2026-08-10-partiful-api-contract-evidence-ledger.mddocs/research/2026-08-12-guest-mapping-public-assets.mdinternal/app/app.gointernal/app/execute_test.gointernal/app/guests.gointernal/app/guests_execute_test.gointernal/remote/guests.gointernal/remote/guests_test.gospec/partiful.api-evidence.jsonspec/partiful.openapi.jsontests/remote-api-contract.test.js
Co-authored-by: Copilot <[email protected]> Copilot-Session: 7b842425-e150-41a6-9cd2-6b0842fe8c01
Summary
Implements the evidence-backed Go guest slice for #168.
guests listwith bounded reviewed cursor traversal and privacy-safe local paginationguests invite --contactwith exact confirmed, single-use mutation plansgetGuestsandaddInvitedGuestsAsHostrequests and submitted-only completion2026-08-12.5No live invitation or credential capture was used.
Validation
go test -race ./...go vet ./...go build ./...go mod verifynpm test -- tests/remote-api-contract.test.jsnpm run typecheckCloses #168.
Summary by CodeRabbit
New Features
Documentation