Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ on:
pull_request:
branches: [main]

permissions:
contents: read

jobs:
ci:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: actions/setup-node@v4
with:
Expand All @@ -23,9 +28,15 @@ jobs:

- run: npm ci

- name: Production dependency audit
run: npm audit --omit=dev --audit-level=high

- name: Type check
run: npm run typecheck

- name: Lint
run: npm run lint

- name: Build
run: npm run build

Expand All @@ -36,10 +47,47 @@ jobs:
- name: Tests
run: npm test

- name: Install protocol package dependencies
working-directory: packages/protocol
run: npm ci

- name: Build and pack protocol package
working-directory: packages/protocol
run: |
npm run build
npm pack --dry-run

- name: Generate SBOM
run: npm sbom --sbom-format cyclonedx > sbom.cdx.json

- uses: actions/upload-artifact@v4
with:
name: backend-sbom-cyclonedx
path: sbom.cdx.json
if-no-files-found: error
retention-days: 30

- name: Verify build output
run: |
if [ ! -f worker.js ]; then
echo "ERROR: worker.js not found after build"
exit 1
fi
echo "Build output size: $(wc -c < worker.js) bytes"

dependency-review:
name: Dependency review
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- if: github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
persist-credentials: false
- if: github.event_name == 'pull_request'
uses: actions/dependency-review-action@v4
with:
fail-on-severity: high
- if: github.event_name != 'pull_request'
run: echo "Dependency review applies to pull requests."
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ npm install
npm run build

# Run tests
npm test # Full suite (82 tests)
npm test # Full suite (245 tests at 0.1.1 branch cut)
npm run opendating:test:e2e # Protocol conformance tests

# Deploy (requires Cloudflare account + wrangler config)
Expand All @@ -129,10 +129,14 @@ npm run deploy
npm install [email protected]
```

`0.1.0` is the current npm registry release. The `0.1.1` contract repair is
implemented on this branch but must not be referenced by install instructions
until the package has been published and its registry artifact verified.

```typescript
import {
createEnvelope, buildGiftWrap, nip44Encrypt, nip44Decrypt,
generateKeypair, validateEnvelope, OPENDATING_PROTOCOL,
generateKeypair, validateEnvelope, getRequestRoute, OPENDATING_PROTOCOL,
type OpenDatingEnvelope, type GiftWrapResult,
} from 'opendating-protocol';
```
Expand Down
16 changes: 16 additions & 0 deletions docs/opendating/PROTOCOL-0.1.1-RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# opendating-protocol 0.1.1

Protocol wire version remains `0.1`. Package 0.1.1 is a backward-compatible contract repair.

## Changes

- Adds `deletion` to `OpenDatingServiceRole` and `ALL_SERVICE_ROLES`.
- Publishes `REQUEST_ROUTES` and `getRequestRoute()` with the service role and expected result type for every v0.1 request.
- Binds `account.delete` to the `deletion` role and `account.delete.result`.
- Corrects `block.remove` and `unmatch.create` routing to `dm_policy`.
- Implements idempotent `block.remove` in the reference service.
- Advertises `account.delete` and `block.remove` in service capability metadata.

## Publication gate

The package builds and the full backend suite passes. Registry publication requires an authenticated npm session and must be followed by a mobile lockfile update to the exact `0.1.1` artifact.
13 changes: 7 additions & 6 deletions docs/opendating/PROTOCOL.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,14 @@ The private key signs responses and decrypts incoming requests.
| Role | Purpose | Status |
|------|---------|--------|
| `system` | Protocol-level operations | ✅ V0.1 |
| `profile` | User profiles | Planned |
| `discovery` | Candidate discovery | Planned |
| `matcher` | Like/match logic | Planned |
| `dm_policy` | Messaging policy | Planned |
| `moderation` | Reports and blocks | Planned |
| `profile` | User profiles | ✅ V0.1 baseline |
| `discovery` | Candidate discovery | ✅ V0.1 baseline |
| `matcher` | Like/match logic | ✅ V0.1 baseline |
| `dm_policy` | Messaging policy | ✅ V0.1 baseline |
| `moderation` | Reports and enforcement | ✅ V0.1 baseline; operator console pending |
| `verification` | Identity verification | Planned |
| `media` | Image/media handling | Planned |
| `media` | Image/media handling | ✅ Hosted media baseline; revocable references pending |
| `deletion` | Account deletion and vanish | ✅ V0.1.1 |

## 7. Request Lifecycle

Expand Down
80 changes: 42 additions & 38 deletions docs/opendating/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,57 +11,61 @@

**Status**: COMPLETE (PROTOCOL-CORE-COMPLETE.md)

## Phase 2: Membership + Profile (Next)
> This file tracks protocol implementation, not production readiness. The current backend is a tested beta baseline and still requires the security, trust-and-safety, legal, reliability, and marketplace gates documented in the mobile repository's `docs/RELEASE-STATUS.md`.

- [ ] User membership model
- [ ] Dating profile schema (kind 30078)
- [ ] Profile CRUD service
- [ ] Profile visibility settings
- [ ] Profile validation
## Phase 2: Membership + Profile ✅ baseline

## Phase 3: Location + Discovery
- [x] User membership model
- [x] Dating profile schema
- [x] Profile CRUD service
- [x] Profile visibility settings
- [x] Profile validation

- [ ] Location schema (geohash)
- [ ] Location update service
- [ ] Candidate discovery query
- [ ] Discovery preferences
- [ ] Distance-based filtering
## Phase 3: Location + Discovery ✅ baseline

## Phase 4: Private Likes + Matching
- [x] Location schema (geohash)
- [x] Location update service
- [x] Candidate discovery query
- [x] Discovery preferences
- [x] Distance-based filtering

- [ ] Like intent schema
- [ ] Like service
- [ ] Mutual match detection
- [ ] Match notification
- [ ] Match state management
## Phase 4: Private Likes + Matching ✅ baseline

## Phase 5: Match-Only Messaging (NIP-17)
- [x] Like intent schema
- [x] Like service
- [x] Mutual match detection
- [x] Match notification event
- [x] Match state management

- [ ] Match-gated DM policy
- [ ] NIP-17 sealed direct messages
- [ ] DM policy service
- [ ] Message history
## Phase 5: Match-Only Messaging (NIP-17) ⚠️ transport baseline

## Phase 6: Block + Unmatch
- [x] Match-gated DM policy
- [x] NIP-17 sealed direct messages
- [x] DM policy service
- [ ] Durable 90-day delivery history and client cursor synchronization

- [ ] Block schema
- [ ] Unmatch schema
- [ ] Block/unmatch service
- [ ] Enforcement in discovery and messaging
## Phase 6: Block + Unmatch ✅ backend baseline

## Phase 7: Reporting + Moderation
- [x] Block schema
- [x] Unmatch schema
- [x] Block/unmatch service, including idempotent removal
- [x] Server enforcement in discovery and messaging
- [ ] Global encrypted client persistence and inbound pre-render enforcement

- [ ] Report schema
- [ ] Moderation service
- [ ] Report queue
- [ ] Admin actions
## Phase 7: Reporting + Moderation ⚠️ operations incomplete

## Phase 8: Deletion / Vanish
- [x] Report schema
- [x] Moderation service baseline
- [x] Report queue baseline
- [x] Admin action protocol
- [ ] Production console, appeals, audit access, vendor moderation, and staffed SLAs

- [ ] Account deletion (NIP-62)
- [ ] Profile vanish
- [ ] Message vanish
- [ ] Data retention compliance
## Phase 8: Deletion / Vanish ⚠️ 0.1.1 contract fixed

- [x] Account deletion service and dedicated advertised role
- [x] Profile/discovery relationship cascade and vanish tombstone
- [ ] Delivery-event and object-storage cascade verification
- [ ] Legal retention policy and 24-hour receipt/SLA

## Phase 9: Verification

Expand Down
Loading
Loading