Skip to content

chore(quality): arch-review fix-packet — delete shadow channel denylist, import profile-marker consts in tests, RequestSubject boundary comment - #65

Merged
supmo668 merged 1 commit into
mainfrom
mangyinm/arch-review-fix-packet
Jul 14, 2026
Merged

supmo668 merged 1 commit into
mainfrom
mangyinm/arch-review-fix-packet

Conversation

@supmo668

@supmo668 supmo668 commented Jul 14, 2026 •

Copy link
Copy Markdown

CTO architecture-review fix-packet: (1) KNOWN_THIRD_PARTY_CHANNELS deleted (exact reordered copy of registry CHAT_CHANNEL_ORDER, inert, tautological test) — deny-unknown allowlist + registry-completeness pin untouched, doc anchor derived from registry, negative diff, 0 consumers (tsgo clean); (2) profile-marker consts imported in 5 non-sealed test sites; (3) RequestSubject/ExchangeSubject boundary comment. 90 tests pass, all gates clean.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Strengthened privacy controls so unknown and third-party channels are denied by default.
    • Prevented PHI-approved settings from bypassing channel safety rules.
    • Preserved support for approved first-party channels.
  • Maintenance

    • Improved profile-block consistency across integrations and validation documentation.
    • Updated automated coverage for profile handling and channel privacy behavior.

…annel denylist, DRY profile markers, RequestSubject boundary comment (openclaw#3630)

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]>
@coderabbitai

coderabbitai Bot commented Jul 14, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The changes export shared Syntropy profile delimiters for test reuse, update profile-related fixtures, remove the static third-party channel registry in favor of runtime policy classification, refine policy tests, and document token-exchange subject validation boundaries.

Changes

Syntropy profile delimiters

Layer / File(s) Summary
Shared profile delimiter contract
extensions/syntropy/src/profile.ts, extensions/syntropy/src/index-injection.test.ts, extensions/syntropy/src/profile-context.test.ts
OPEN and CLOSE are exported and reused by profile injection and cache-related tests instead of hardcoded delimiter strings.

Outbound PHI policy

Layer / File(s) Summary
Deny-unknown PHI posture
src/infra/outbound/render-policy.ts, src/infra/outbound/render-policy.test.ts
The static KNOWN_THIRD_PARTY_CHANNELS export is removed; documentation and tests now cover first-party allowlisting, runtime classification, and denylist sanitization.
Token-exchange subject boundary
extensions/syntropy-mcp/src/index.ts
A comment identifies toExchangeSubject as the validation and narrowing boundary before token exchange.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: enhancement

Suggested reviewers: majesticgarden

Poem

I’m a rabbit with markers, neat and bright,
Sharing profile tags just right.
Unknown channels meet a guarded gate,
While subjects validate before exchange state.
Hop, hop—clean contracts celebrate!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is far too brief and does not follow the required template sections or detail level. Rewrite it using the template: Summary bullets, Change Type, Scope, Linked Issue/PR, Security Impact, Verification, Evidence, Compatibility, Recovery, and Risks.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is specific and accurately covers the main changes, even though it is a bit verbose.
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 mangyinm/arch-review-fix-packet

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 a1d0d85 into main Jul 14, 2026
18 of 23 checks passed
@supmo668
supmo668 deleted the mangyinm/arch-review-fix-packet branch July 14, 2026 06:21

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

🤖 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 `@extensions/syntropy-mcp/src/index.ts`:
- Around line 254-259: Update the boundary comment near toExchangeSubject to
describe ExchangeSubject as the narrowed discriminated-union form rather than
“validated,” and state that toExchangeSubject only performs presence checks
without validating token claims, channel membership, or provenance. Preserve the
instruction that RequestSubject must not be passed directly to the exchange.
🪄 Autofix (Beta)

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

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 029a2b9a-2c5f-426d-819a-564a4589dc74

📥 Commits

Reviewing files that changed from the base of the PR and between c48edf0 and 8eaa907.

📒 Files selected for processing (6)
  • extensions/syntropy-mcp/src/index.ts
  • extensions/syntropy/src/index-injection.test.ts
  • extensions/syntropy/src/profile-context.test.ts
  • extensions/syntropy/src/profile.ts
  • src/infra/outbound/render-policy.test.ts
  • src/infra/outbound/render-policy.ts
💤 Files with no reviewable changes (1)
  • src/infra/outbound/render-policy.test.ts

Comment on lines +254 to +259
*
* BOUNDARY: this is the LOOSE inbound shape (all-optional). `ExchangeSubject`
* (token-exchange.ts) is the VALIDATED discriminated-union form the exchange
* requires; `toExchangeSubject` (below) is the ONLY bridge — it validates/narrows
* a RequestSubject into an ExchangeSubject (or null). Never pass a RequestSubject
* to the exchange directly.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🔵 Trivial | 💤 Low value

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n -C4 '\b(toExchangeSubject|RequestSubject|ExchangeSubject|getUserToken)\b' extensions/syntropy-mcp/src

Repository: Syntropy-Health/openclaw

Length of output: 50380


🏁 Script executed:

sed -n '230,290p' extensions/syntropy-mcp/src/index.ts && printf '\n---\n' && sed -n '680,705p' extensions/syntropy-mcp/src/index.ts && printf '\n---\n' && sed -n '55,95p' extensions/syntropy-mcp/src/token-exchange.ts

Repository: Syntropy-Health/openclaw

Length of output: 6332


Clarify the boundary wording toExchangeSubject only narrows RequestSubject to ExchangeSubject with presence checks; it doesn’t validate token claims, channel membership, or provenance, so “validated” overstates the guarantee.

🤖 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 `@extensions/syntropy-mcp/src/index.ts` around lines 254 - 259, Update the
boundary comment near toExchangeSubject to describe ExchangeSubject as the
narrowed discriminated-union form rather than “validated,” and state that
toExchangeSubject only performs presence checks without validating token claims,
channel membership, or provenance. Preserve the instruction that RequestSubject
must not be passed directly to the exchange.

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