Skip to content

feat(go): add guest visibility and invitations (#168) - #190

Merged
KalebCole merged 3 commits into
mainfrom
feat/168-guests
Aug 12, 2026
Merged

KalebCole merged 3 commits into
mainfrom
feat/168-guests

Conversation

@KalebCole

@KalebCole KalebCole commented Aug 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

Implements the evidence-backed Go guest slice for #168.

  • adds host-only guests list with bounded reviewed cursor traversal and privacy-safe local pagination
  • distinguishes attendee denial from an empty host guest list
  • adds consequential guests invite --contact with exact confirmed, single-use mutation plans
  • resolves the private contact identity during planning, rebinds contact/event facts during apply, and dispatches the stored reviewed identity
  • validates the current getGuests and addInvitedGuestsAsHost requests and submitted-only completion
  • advances the reviewed contract revision to 2026-08-12.5

No live invitation or credential capture was used.

Validation

  • go test -race ./...
  • go vet ./...
  • go build ./...
  • go mod verify
  • npm test -- tests/remote-api-contract.test.js
  • npm run typecheck
  • privacy guard and diff check

Closes #168.

Summary by CodeRabbit

  • New Features

    • Added commands to view an event’s guest list with pagination.
    • Added host guest invitations using email addresses, phone contacts, or user IDs.
    • Added preview and confirmation workflows with privacy-safe request details.
    • Added validation for permissions, event ownership, ambiguous contacts, and stale plans.
  • Documentation

    • Updated API contracts and research to document guest retrieval and invitation behavior.
    • Added request, response, pagination, and completion schemas for guest operations.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 7b842425-e150-41a6-9cd2-6b0842fe8c01
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@KalebCole, you've reached your PR review limit, so we couldn't start this review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 342b5c76-7090-436c-abe4-508f0d012859

📥 Commits

Reviewing files that changed from the base of the PR and between ffdfa91 and a5e3cbf.

📒 Files selected for processing (8)
  • docs/REMOTE-API-CONTRACT.md
  • docs/research/2026-08-10-partiful-api-contract-evidence-ledger.md
  • internal/app/guests.go
  • internal/app/guests_execute_test.go
  • internal/remote/guests.go
  • spec/partiful.api-evidence.json
  • spec/partiful.openapi.json
  • tests/remote-api-contract.test.js
📝 Walkthrough

Walkthrough

This PR adds researched guest API contracts, remote guest retrieval and invitation support, and host-only guests.list and guests.invite CLI commands. It also advances the contract revision to 2026-08-12.5 and adds comprehensive validation.

Changes

Guest operations

Layer / File(s) Summary
Guest API contracts and evidence
docs/REMOTE-API-CONTRACT.md, docs/research/..., spec/partiful.api-evidence.json, spec/partiful.openapi.json
Documents and specifies getGuests pagination, reviewed guest fields, host invitation parameters, generic completion handling, and fail-closed unknown behavior.
Remote guest transport
internal/remote/guests.go, internal/remote/guests_test.go
Adds bounded guest pagination, guest field validation, catalog hashing, authenticated invitations, and strict mutation response validation.
CLI guest commands
internal/app/app.go, internal/app/guests.go, internal/app/guests_execute_test.go
Adds host guest listing and contact invitation commands with permission checks, contact resolution, redacted plans, stale-plan detection, confirmation, and privacy-safe output.
Revision and contract validation
docs/CLI-PRODUCT-CONTRACT.md, internal/app/execute_test.go, tests/remote-api-contract.test.js
Advances contract metadata to 2026-08-12.5 and updates product, application, API, evidence, operation-count, and claim-count assertions.

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
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the Go implementation of guest visibility and invitations, which matches the primary changes.
Linked Issues check ✅ Passed The changes implement host guest listing, contact invitations, privacy protections, permission handling, reviewed plans, and contract validation required by issue #168.
Out of Scope Changes check ✅ Passed The code, tests, specifications, and documentation changes directly support the guest visibility and invitation objectives in issue #168.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/168-guests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.8.1

🚀 View preview at
https://KalebCole.github.io/partiful-cli/pr-preview/pr-190/

Built to branch gh-pages at 2026-08-12 18:55 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 7b842425-e150-41a6-9cd2-6b0842fe8c01

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

🧹 Nitpick comments (3)
internal/app/guests_execute_test.go (1)

112-142: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Optional: 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-cohost and the remote cursor. Repeat the same check for second so 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 win

Reuse eventJSONContentType in getGuestsPage.

The helper applies the same mime.ParseMediaType rule as the inline check. Replace the inline check and remove the unused mime import.

🤖 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 win

Extend internal/remote/guests_test.go with request and pagination coverage.

  • Capture InviteGuestsAsHost requests and assert the path, Authorization header, and encoded data.params fields.
  • Add GetGuests cases for missing or null nextCursor, empty data with a cursor, repeated cursors, and rejection of the 21st non-empty page.
  • Assert paging.maxResults is 500 and the first-page paging.cursor is null.
🤖 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

📥 Commits

Reviewing files that changed from the base of the PR and between c7bd9d5 and ffdfa91.

📒 Files selected for processing (13)
  • docs/CLI-PRODUCT-CONTRACT.md
  • docs/REMOTE-API-CONTRACT.md
  • docs/research/2026-08-10-partiful-api-contract-evidence-ledger.md
  • docs/research/2026-08-12-guest-mapping-public-assets.md
  • internal/app/app.go
  • internal/app/execute_test.go
  • internal/app/guests.go
  • internal/app/guests_execute_test.go
  • internal/remote/guests.go
  • internal/remote/guests_test.go
  • spec/partiful.api-evidence.json
  • spec/partiful.openapi.json
  • tests/remote-api-contract.test.js

Comment thread docs/REMOTE-API-CONTRACT.md Resolved
Comment thread docs/REMOTE-API-CONTRACT.md Resolved
Comment thread docs/REMOTE-API-CONTRACT.md Resolved
Comment thread internal/app/guests.go Resolved
Comment thread internal/app/guests.go Resolved
Comment thread internal/remote/guests.go Resolved
Comment thread spec/partiful.api-evidence.json Resolved
Comment thread spec/partiful.api-evidence.json Resolved
Comment thread spec/partiful.api-evidence.json Resolved
Comment thread spec/partiful.openapi.json Resolved
Co-authored-by: Copilot <[email protected]>

Copilot-Session: 7b842425-e150-41a6-9cd2-6b0842fe8c01
@KalebCole
KalebCole merged commit 855b8ed into main Aug 12, 2026
2 checks passed
@KalebCole
KalebCole deleted the feat/168-guests branch August 12, 2026 18:57
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.

Implement guest visibility and invitation in Go

1 participant