refactor(mattermost): trim monitor gating facade#106021
Conversation
8475203 to
9de3674
Compare
|
Land-ready local proof for
Exact-head CI run https://github.com/openclaw/openclaw/actions/runs/29227391969: rollup |
9de3674 to
43e6fc4
Compare
|
Codex review: needs real behavior proof before merge. Reviewed July 13, 2026, 1:59 AM ET / 05:59 UTC. Summary PR surface: Source -10, Tests +3, Other -8. Total -15 across 6 files. Reproducibility: not applicable. This PR removes unused internal exports rather than addressing a runtime failure, and the relevant change is directly auditable from the import and export graph. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Merge the bounded cleanup after explicit maintainer handling and either a narrow redacted Mattermost runtime smoke or a proof override recognizing that the patch changes export visibility rather than runtime logic. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR removes unused internal exports rather than addressing a runtime failure, and the relevant change is directly auditable from the import and export graph. Is this the best way to solve the issue? Yes. Importing tests from the owning gating module and deriving private parameter types from the function signature is narrower and less drift-prone than retaining a test-only facade. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ce990a3ad9db. Label changesLabel justifications:
Evidence reviewedPR surface: Source -10, Tests +3, Other -8. Total -15 across 6 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (3 earlier review cycles) |
43e6fc4 to
91103ac
Compare
* refactor(mattermost): trim monitor gating facade * chore(ci): shrink Mattermost LOC baseline * chore(ci): refresh deadcode export baseline
* refactor(mattermost): trim monitor gating facade * chore(ci): shrink Mattermost LOC baseline * chore(ci): refresh deadcode export baseline
…hreadDirectMessages The 7.2 cherry-pick resolved extensions/mattermost/src/mattermost/monitor.ts by taking our side wholesale, silently reverting six upstream commits landed between 7.1 and 7.2. Adopt them instead of clobbering: f77c2aa truncate the inbound preview on a code-point boundary (openclaw#101630) b7ab62c preserve text-block boundaries in the draft preview (openclaw#87449) da6a24d prevent hung pre-delivery hooks from blocking lanes (openclaw#104256) 218dcd8 noUncheckedIndexedAccess in the extensions lane (openclaw#105132) 9cdf166 trim the monitor gating facade (openclaw#106021) 70a7e6e (opt-in DM threading by chat type) was already in the impl; three 7.1-era assertions in monitor.test.ts that upstream had superseded move to upstream's semantics (the implementations are byte-identical to upstream). b7ab62c's 173-line monitor hunk (block-preview boundary machinery) was hand-ported onto our activity/warm-fallback interleaving; the block-preview code is now byte-identical to pristine 7.2. threadDirectMessages kept as a thin compat feeding upstream's replyToModeByChatType, because Dockerfile.base's shared config probe still writes it and the probe spans matrix bases older than 2026.7.2. Retire both together later. Mattermost suite 630/632. The 2 remaining timeouts are localized to deliverMattermostReplyWithDraftPreview: with a mocked-rejecting updateMattermostPost, our patched buildFinalEdit attempts the in-place edit (pristine skips it), the edit rejects, and the deliverNormally fallback awaits the unmocked deliverMattermostReplyPayload which never resolves under the test's bare sendMessageMattermost stub. Behavioral divergence in our activity/warm-fallback finalize path, not the upstream port. TODO.
Related: #105595
What Problem This Solves
The shrink-only unused-export ratchet still carried seven Mattermost monitor symbols that had no production consumers. Five were re-exported through the monitor facade only for tests, while two input types were public only to type test helpers.
Why This Change Was Made
Remove the unused facade and type exports. Tests now import the owning gating module directly and derive private input types from the exported function signature, leaving runtime imports and behavior unchanged.
User Impact
No user-visible behavior change. This narrows the internal Mattermost API and reduces the unused-export baseline from 4,986 to 4,979 entries.
Evidence
pnpm deadcode:exports:updateon Linux: 4,979 entriespnpm deadcode:exports: matched 4,979 entriesa6b1ad803cb9185a4e1fc66f4153d64d5fe6667e2b0a9c978e690c9990a74927oxfmt --checkon all touched files: passedpnpm check:loc: passedpnpm tsgo:extensions: passedpnpm tsgo:extensions:test: passedAI assistance: yes. Agent transcript not included pending explicit opt-in.