Skip to content

Publish protocol 0.1.1 deletion routing - #1

Merged
jongan69 merged 2 commits into
mainfrom
codex/protocol-0.1.1
Aug 9, 2026
Merged

Publish protocol 0.1.1 deletion routing#1
jongan69 merged 2 commits into
mainfrom
codex/protocol-0.1.1

Conversation

@jongan69

@jongan69 jongan69 commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Outcome

Repairs the v0.1 service contract without changing the wire version and prepares opendating-protocol 0.1.1 for publication.

Changes

  • adds deletion to the service-role union and advertised role constants
  • publishes canonical request-to-role-to-result routing metadata
  • binds account.delete exclusively to deletion and account.delete.result
  • corrects block.remove and unmatch.create routing to dm_policy
  • advertises deletion, block.remove, and visibility.update capabilities
  • implements idempotent block removal with complete pubkey validation
  • consumes the exact candidate grant atomically before like side effects, preventing concurrent reuse
  • adds protocol conformance, service identity, D1-backed integration, and grant-race coverage
  • adds lint, dependency audit/review, protocol pack, and SBOM CI gates
  • corrects protocol and roadmap documentation

Verification

  • npm run typecheck
  • npm run lint: 0 errors
  • npm run build
  • npm test: 17 files, 248 tests
  • protocol npm ci, build, and pack --dry-run
  • npm audit --omit=dev --audit-level=high: 0 vulnerabilities
  • CycloneDX SBOM generation
  • git diff --check

Publication blocker

The package is buildable and packable, but npm publication is not attempted because the local npm session is not authenticated. After review and merge, authenticate npm, publish [email protected], and pin the mobile repository to that artifact.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The change releases opendating-protocol 0.1.1, adds canonical request routing, supports block removal and deletion capabilities, tightens matcher grant validation, updates protocol documentation, and expands CI checks for linting, dependency auditing, packaging, and SBOM generation.

Changes

Protocol and runtime behavior

Layer / File(s) Summary
Routing and service-role contracts
packages/protocol/src/protocol/*, src/protocols/opendating/protocol/*, src/protocols/opendating/identities/loader.ts
Adds service roles, REQUEST_ROUTES, OpenDatingRequestType, RequestRoute, and getRequestRoute. Adds deletion and block-removal capability declarations.
Block removal and matcher validation
src/protocols/opendating/services/block/service.ts, worker.js, tests/opendating/integration/services.test.ts
Adds idempotent block.remove handling and requires active, unexpired candidate grants for matcher likes.
Protocol conformance and identity validation
tests/opendating/conformance/protocol.test.ts, tests/opendating/unit/service-identities.test.ts
Validates route ownership, message validators, the deletion role, and deletion identity loading.
Worker bundle synchronization
worker.js
Updates the generated bundle with runtime changes and behavior-preserving formatting and metadata changes.

Release and delivery baseline

Layer / File(s) Summary
Protocol package release
packages/protocol/package.json, packages/protocol/src/index.ts, packages/protocol/README.md, README.md
Updates package documentation and version references to 0.1.1 and documents getRequestRoute.
Protocol release documentation
docs/opendating/PROTOCOL-0.1.1-RELEASE.md, docs/opendating/PROTOCOL.md, docs/opendating/ROADMAP.md
Records the 0.1.1 contract, service-role baselines, completed phases, and remaining production work.
CI quality and package verification
.github/workflows/ci.yml, package.json
Adds Oxlint, dependency audits, dependency review, package build and dry-run checks, and CycloneDX SBOM upload.

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

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant BlockService
  participant Database
  participant Response
  Client->>BlockService: block.remove
  BlockService->>Database: delete block relation
  Database-->>BlockService: deletion result
  BlockService->>Response: create block.remove.result
  Response-->>Client: timestamped result
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 18.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
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the protocol 0.1.1 publication and deletion-routing changes, which are central objectives of the pull request.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/protocol-0.1.1

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.

@jongan69
jongan69 marked this pull request as ready for review August 9, 2026 10:24
@jongan69

jongan69 commented Aug 9, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
worker.js (1)

5936-5983: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Consume the candidate grant before side effects.

Two concurrent likes can both pass the SELECT at Line 5943 before either request reaches Line 5981. Each request then increments daily_likes_sent, although INSERT OR IGNORE creates only one intent. Delete the exact validated token with a conditional DELETE first, check meta.changes, and only then create the intent and increment the quota. Update the source matcher service and regenerate this bundle.

🤖 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 `@worker.js` around lines 5936 - 5983, The validated candidate grant must be
consumed before any like side effects to prevent concurrent reuse. In the
candidate-grant flow, replace the later broad delete with a conditional DELETE
matching viewer_id, candidate_id, and the validated candidateGrant, check its
meta.changes, and return the existing invalid_candidate_grant error when no row
was deleted; only then execute intent creation and quota updates. Apply the
change in the source matcher service and regenerate the worker bundle.
🤖 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 @.github/workflows/ci.yml:
- Line 82: Update both checkout steps in the dependency-review and main jobs to
set persist-credentials to false; additionally, gate the dependency-review
checkout with github.event_name == 'pull_request' if the review action does not
require local files for push events. Keep the existing checkout and npm ci flow
unchanged otherwise.

In `@README.md`:
- Around line 129-131: Update the README installation example to reference a
version of opendating-protocol that is available on npm, or publish version
0.1.1 before retaining the command. Ensure the documented npm install command
resolves successfully for users.

In `@src/protocols/opendating/protocol/routing.ts`:
- Line 23: Update the profile supported-type list in the identities loader so it
includes the visibility.update protocol type declared in routing.ts. Use the
existing protocol identifier and preserve ProfileService’s accepted request
behavior, ensuring capability-aware clients advertise and allow this profile
request.

In `@src/protocols/opendating/services/block/service.ts`:
- Around line 40-51: The removeBlock method currently accepts any nonempty
target_pubkey; validate that it is exactly 64 hexadecimal characters before
calling getMemberId. Return the existing invalid_envelope response for malformed
values, while preserving valid-key handling.

---

Outside diff comments:
In `@worker.js`:
- Around line 5936-5983: The validated candidate grant must be consumed before
any like side effects to prevent concurrent reuse. In the candidate-grant flow,
replace the later broad delete with a conditional DELETE matching viewer_id,
candidate_id, and the validated candidateGrant, check its meta.changes, and
return the existing invalid_candidate_grant error when no row was deleted; only
then execute intent creation and quota updates. Apply the change in the source
matcher service and regenerate the worker bundle.
🪄 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: 3e50f617-8502-422b-97f6-2d12c1602033

📥 Commits

Reviewing files that changed from the base of the PR and between b35801d and 09310aa.

⛔ Files ignored due to path filters (14)
  • package-lock.json is excluded by !**/package-lock.json
  • packages/protocol/dist/index.d.ts is excluded by !**/dist/**
  • packages/protocol/dist/index.d.ts.map is excluded by !**/dist/**, !**/*.map
  • packages/protocol/dist/index.js is excluded by !**/dist/**
  • packages/protocol/dist/index.js.map is excluded by !**/dist/**, !**/*.map
  • packages/protocol/dist/protocol/constants.d.ts is excluded by !**/dist/**
  • packages/protocol/dist/protocol/constants.d.ts.map is excluded by !**/dist/**, !**/*.map
  • packages/protocol/dist/protocol/constants.js is excluded by !**/dist/**
  • packages/protocol/dist/protocol/constants.js.map is excluded by !**/dist/**, !**/*.map
  • packages/protocol/dist/protocol/routing.d.ts is excluded by !**/dist/**
  • packages/protocol/dist/protocol/routing.d.ts.map is excluded by !**/dist/**, !**/*.map
  • packages/protocol/dist/protocol/routing.js is excluded by !**/dist/**
  • packages/protocol/dist/protocol/routing.js.map is excluded by !**/dist/**, !**/*.map
  • packages/protocol/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (19)
  • .github/workflows/ci.yml
  • README.md
  • docs/opendating/PROTOCOL-0.1.1-RELEASE.md
  • docs/opendating/PROTOCOL.md
  • docs/opendating/ROADMAP.md
  • package.json
  • packages/protocol/README.md
  • packages/protocol/package.json
  • packages/protocol/src/index.ts
  • packages/protocol/src/protocol/constants.ts
  • packages/protocol/src/protocol/routing.ts
  • src/protocols/opendating/identities/loader.ts
  • src/protocols/opendating/protocol/constants.ts
  • src/protocols/opendating/protocol/routing.ts
  • src/protocols/opendating/services/block/service.ts
  • tests/opendating/conformance/protocol.test.ts
  • tests/opendating/integration/services.test.ts
  • tests/opendating/unit/service-identities.test.ts
  • worker.js

Comment thread .github/workflows/ci.yml Outdated
Comment thread README.md Outdated
Comment thread src/protocols/opendating/protocol/routing.ts
Comment thread src/protocols/opendating/services/block/service.ts
@jongan69
jongan69 merged commit aadb7a9 into main Aug 9, 2026
3 checks passed
@jongan69
jongan69 deleted the codex/protocol-0.1.1 branch August 10, 2026 07:12
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