Skip to content

fix(security): demote matrix to third-party PHI channel — first-party = {shrinemobile, webchat} - #64

Merged
supmo668 merged 1 commit into
mainfrom
mangyinm/demote-matrix-third-party
Jul 13, 2026
Merged

supmo668 merged 1 commit into
mainfrom
mangyinm/demote-matrix-third-party

Conversation

@supmo668

Copy link
Copy Markdown

Closes the PHI-boundary hardening arc (irc fail-open + deny-unknown + matrix demotion). Matrix is federated messaging — the SEC-4 counsel-gate class; removed from FIRST_PARTY_PHI_CHANNELS per CTO ruling. Precondition verified: no live operator config depends on matrix-PHI. Red-first behavioral test (phiApproved-matrix → minimized); 66 pass; all 4 gates green. Strictly more restrictive — pure allowlist-data change on the already-QG'd deny-unknown mechanism. A federation-disabled self-hosted homeserver may re-argue first-party later with deployment evidence.

🤖 Generated with Claude Code

…rated messaging is the counsel-gate class (CTO openclaw#3581)

Follow-up to the deny-unknown PHI fix (#62), under the same completeness pin. CTO openclaw#3581 ruled matrix is NOT first-party: a federated messaging provider is squarely the SEC-4 counsel-gate class ('third-party messaging providers can NEVER be phiApproved'). Removed matrix from FIRST_PARTY_PHI_CHANNELS → first-party = {shrinemobile, webchat} only (the app's own surfaces).

Precondition verified (per CTO): NO live operator config depends on matrix-PHI — matrix only appeared in a single test. Red-first: added a MATRIX-DEMOTED test (isThirdPartyChannel(matrix)===true + behavioral planChannelRender(matrix, phiApproved:[matrix]) → minimized, no health leak) that went red→green. Switched the deliver positive-path test from matrix→webchat (preserves 'first-party channel gets full summary' coverage on a genuine first-party surface). 66 tests pass (render-policy 30 + deliver 36), tsgo clean, oxlint clean.

STRICTLY MORE RESTRICTIVE: this removes an approval, so it can only reduce PHI egress — it cannot create a leak; the deny-unknown mechanism itself (already 2-reviewer-QG'd in #62) is unchanged. A federation-disabled self-hosted homeserver may re-argue first-party later WITH deployment evidence (documented inline).

Generated-With: Claude Code
Co-Authored-By: cto <[email protected]>
Co-Authored-By: Claude <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 11 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2ddfd68c-2115-45d7-a924-40160bcaba84

📥 Commits

Reviewing files that changed from the base of the PR and between da296db and 9610a90.

📒 Files selected for processing (3)
  • src/infra/outbound/deliver.test.ts
  • src/infra/outbound/render-policy.test.ts
  • src/infra/outbound/render-policy.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mangyinm/demote-matrix-third-party

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

Copy link
Copy Markdown

⚠️ Formal models conformance drift detected

The formal models extracted constants (generated/*) do not match this openclaw PR.

This check is informational (not blocking merges yet).
See the formal-models-conformance-drift artifact for the diff.

If this change is intentional, follow up by updating the formal models repo or regenerating the extracted artifacts there.

@supmo668
supmo668 merged commit c48edf0 into main Jul 13, 2026
19 of 23 checks passed
@supmo668
supmo668 deleted the mangyinm/demote-matrix-third-party branch July 13, 2026 21:24
supmo668 added a commit that referenced this pull request Jul 14, 2026
…annel denylist, DRY profile markers, RequestSubject boundary comment (openclaw#3630) (#65)

3 code-quality items from the cross-repo architecture review (openclaw#3630), one branch, normal QG:

(1) DELETE KNOWN_THIRD_PARTY_CHANNELS (render-policy.ts): it was an exact reordered copy of registry CHAT_CHANNEL_ORDER, its own comment said it was inert (not enforcement — the deny-unknown FIRST_PARTY_PHI_CHANNELS allowlist is), and its test was tautological. Deleted the export + the tautological test + the SEC-IRC toContain assertion + the test import; verified 0 remaining consumers. The load-bearing registry-completeness test (isThirdPartyChannel===true for every CHAT_CHANNEL_ORDER channel) + the deny-unknown posture are untouched. Negative diff; the doc anchor is now derived from the registry (referenced in the FIRST_PARTY docstring).

(2) DRY the profile markers: profile.ts now EXPORTS OPEN/CLOSE ('[SYNTROPY_PROFILE]' / '[/SYNTROPY_PROFILE]') as the single source of truth; profile-context.test.ts (4 literal sites) + index-injection.test.ts (2 sites) now import + use the consts instead of re-hardcoding — prevents drift if the marker changes. Sealed suites left as-is (and hook-barred from me anyway).

(3) RequestSubject boundary comment (syntropy-mcp/src/index.ts): documented that ExchangeSubject (token-exchange.ts) is the VALIDATED discriminated-union form and toExchangeSubject is the ONLY bridge — never pass a loose RequestSubject to the exchange directly.

90 tests pass (render-policy 28 + deliver 36 + profile-context 24 + index-injection ...), tsgo clean, oxlint clean, oxfmt clean. Off fresh main c48edf0 (post #62/#63/#64).

Generated-With: Claude Code

Co-authored-by: cto <[email protected]>
Co-authored-by: Claude <[email protected]>
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