Skip to content

spec: close event-write contract evidence for #167 - #188

Merged
KalebCole merged 3 commits into
mainfrom
spec/167-event-write-mapping
Aug 12, 2026
Merged

KalebCole merged 3 commits into
mainfrom
spec/167-event-write-mapping

Conversation

@KalebCole

@KalebCole KalebCole commented Aug 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

Phase 1 contract evidence for #167. This PR proposes product and remote revision 2026-08-12.4, pending one delegated review. It does not implement Go, change shipped .3 constants, use credentials, or make a live Partiful mutation.

  • records the current public build, deployment, exact asset URLs, hashes, and module IDs
  • closes createEvent and cancelEvent request/completion mappings
  • maps a closed product update allowlist onto official Firestore PATCH/Value/Document protocol
  • defines account/input/request/precondition-bound single-use plans and exact cancel confirmation
  • changes create/update/cancel success to submitted-only because no post-write complete Event is established
  • keeps upload unregistered and resolves built-in posters only by an exact catalog ID

Key mappings

  • Create: event + cohostIds: []; fixed first-party fallback display/poster defaults; callable completion only
  • Update: title, description, startDate, endDate, timezone, maxCapacity/enableWaitlist, customFields, image, plus private updatedBy; location, visibility, and display settings are excluded because they use field-specific callables
  • Cancel: {eventId,cancellationMessage,shouldSkipNotifyGuests}; owned PUBLISHED, positive-guest, future event; exact confirmation required

Verification

  • npm test -- --run tests/remote-api-contract.test.js — 36 passed
  • TZ=America/Los_Angeles npx vitest run --exclude 'tests/*integration.test.js' --exclude 'tests/smoke-real-api.test.js' — 300 passed
  • npm run typecheck
  • go test ./...
  • go test -race ./...
  • go vet ./... && go build ./... && go mod verify
  • staged privacy scan and git diff --check

Review gate

One delegated reviewer is required before merge. Go implementation remains blocked until this contract proposal is reviewed and merged.

Summary by CodeRabbit

  • Documentation

    • Updated the proposed API and CLI contract to revision 2026-08-12.4.
    • Documented event creation, updates, and cancellation, including validation, confirmations, safeguards, request formats, and submitted-only results.
    • Added research covering callable APIs, Firestore updates, completion behavior, and known limitations.
  • API Specification

    • Expanded event request and response schemas with stricter fields and typed Firestore values.
    • Added support for event completion responses and Firestore update parameters.
  • Tests

    • Added coverage for event-write validation, response formats, protocol statuses, and contract revisions.

@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: 23 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: c849a9fc-efe7-4326-9a6c-c9a4811f8556

📥 Commits

Reviewing files that changed from the base of the PR and between 3b79a57 and 42635ad.

📒 Files selected for processing (7)
  • 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-event-write-mapping-public-assets.md
  • spec/partiful.api-evidence.json
  • spec/partiful.openapi.json
  • tests/remote-api-contract.test.js
📝 Walkthrough

Walkthrough

The PR proposes revision 2026-08-12.4 for event creation, update, and cancellation. It documents request and mutation safeguards, expands OpenAPI schemas, records supporting research, and adds contract-test coverage.

Changes

Event-write contract

Layer / File(s) Summary
Event-write evidence and protocol basis
docs/research/*
The research records callable request construction, Firestore PATCH semantics, event-field projections, preconditions, completion behavior, and unresolved authorization and business-state details.
Product commands and mutation-plan rules
docs/CLI-PRODUCT-CONTRACT.md, docs/REMOTE-API-CONTRACT.md, docs/adr/0001-greenfield-go-module-seams.md
The proposed contract defines strict create validation, closed-field updates, cancellation confirmation, mutation-plan bindings, single-attempt application, and submitted-only results.
OpenAPI request and response schemas
spec/partiful.openapi.json
The OpenAPI snapshot adds structured create and cancel requests, typed completion responses, Firestore PATCH parameters, event schemas, and recursive Firestore value schemas.
Evidence, schema, and revision assertions
tests/remote-api-contract.test.js
Tests cover event-write schemas, protocol statuses, evidence provenance, submitted-only semantics, claim counts, and proposed-versus-shipped revision consistency.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related issues

  • KalebCole/partiful-cli issue 167 — Defines the event create, update, and cancellation contracts and safeguards covered by this PR.

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the event-write contract evidence changes and references the related issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch spec/167-event-write-mapping

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
Preview removed because the pull request was closed.
2026-08-12 17:10 UTC

@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: 4

🧹 Nitpick comments (1)
docs/CLI-PRODUCT-CONTRACT.md (1)

658-665: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Confirm that a positive guest count must block cancellation.

Line 660 makes "the observed guest count must be a positive integer" a hard precondition. A non-matching fact then returns state.conflict / EVENT_PRECONDITION_FAILED. The result is that a host cannot cancel an owned PUBLISHED event that has zero guests.

The supporting research states the opposite scope for this fact. docs/research/2026-08-12-event-write-mapping-public-assets.md lines 236-238 record only that the observed UI cancel choice was for an event with a positive guest count, and state that UI exposure is not promoted to endpoint authorization.

If the positive count is intended only as a binding fact for staleness detection, bind it without making it a gate. If the gate is intentional, record the reason so the zero-guest cancel path is a documented product limitation.

🤖 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 `@docs/CLI-PRODUCT-CONTRACT.md` around lines 658 - 665, Revise the cancellation
contract around the documented planning preconditions so a positive guest count
is treated only as an observed/bound staleness fact, not as a required
authorization gate. Preserve conflict handling for known mismatched bound facts
where appropriate, but allow cancellation of owned PUBLISHED events with zero
guests; alternatively, document the explicit product rationale if the
guest-count gate is intentional.
🤖 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/CLI-PRODUCT-CONTRACT.md`:
- Around line 685-689: Update the events cancel failure-mapping text to remove
“malformed Firestore Document” from the contract.protocol_changed cases, while
preserving the mappings for unrecognized statuses, endpoint errors/bodies, and
missing completion envelopes.

In `@spec/partiful.openapi.json`:
- Around line 3437-3477: Update the PartifulPosterImage schema’s height and
width properties to accept null in addition to numbers, matching the nullable
fields in the referenced Poster schema and allowing catalog entries with missing
dimensions. If the implementation guarantees numeric dimensions instead,
document that constraint and retain the existing strict numeric types.
- Around line 2296-2308: Update the nullValue property in the relevant OpenAPI
schema to use JSON null by replacing its string type and NULL_VALUE constant
with type "null". Preserve the surrounding object schema and required nullValue
field.

In `@tests/remote-api-contract.test.js`:
- Around line 954-958: Validate that both headings used to compute the
event-writes slice are present and ordered before calling slice; fail the test
explicitly when either indexOf result is -1 or the start boundary is not before
the end boundary. Keep the existing eventWrites assertions unchanged once the
guarded bounds are confirmed.

---

Nitpick comments:
In `@docs/CLI-PRODUCT-CONTRACT.md`:
- Around line 658-665: Revise the cancellation contract around the documented
planning preconditions so a positive guest count is treated only as an
observed/bound staleness fact, not as a required authorization gate. Preserve
conflict handling for known mismatched bound facts where appropriate, but allow
cancellation of owned PUBLISHED events with zero guests; alternatively, document
the explicit product rationale if the guest-count gate is intentional.
🪄 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: efb8dba1-6bea-4b25-af8a-0cdf0855b043

📥 Commits

Reviewing files that changed from the base of the PR and between 1ad98d0 and 3b79a57.

📒 Files selected for processing (9)
  • docs/CLI-PRODUCT-CONTRACT.md
  • docs/REMOTE-API-CONTRACT.md
  • docs/adr/0001-greenfield-go-module-seams.md
  • docs/research/2026-08-10-contract-evidence-sources.md
  • docs/research/2026-08-10-partiful-api-contract-evidence-ledger.md
  • docs/research/2026-08-12-event-write-mapping-public-assets.md
  • spec/partiful.api-evidence.json
  • spec/partiful.openapi.json
  • tests/remote-api-contract.test.js

Comment thread docs/CLI-PRODUCT-CONTRACT.md Resolved
Comment thread spec/partiful.openapi.json Resolved
Comment thread spec/partiful.openapi.json Resolved
Comment thread tests/remote-api-contract.test.js Resolved
Ubuntu added 2 commits August 12, 2026 17:02
Co-authored-by: Copilot <[email protected]>

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

Copilot-Session: 7b842425-e150-41a6-9cd2-6b0842fe8c01
@KalebCole
KalebCole merged commit 0d57e67 into main Aug 12, 2026
2 checks passed
@KalebCole
KalebCole deleted the spec/167-event-write-mapping branch August 12, 2026 17:09
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