Repository navigation
[PR] feat: compress.protectedContentMarkers — user-declared durable content carriers (#2446 Option A) | [PR] feat: compress.protectedContentMarkers — user-declared durable content carriers (#2446 方案A) - #2576
Closed
ranxianglei wants to merge 3 commits into
Closed
ranxianglei wants to merge 3 commits into
ranxianglei wants to merge 3 commits into
Conversation
added 2 commits
October 10, 2026 10:47
…on test Review follow-up on #2576: in the #2555-composition test both carriers share the substring "never force-push master", so that assertion is satisfied even if the config-marker guard silently stops protecting while a bili-durable marker is also present. Assert the CARRIER-unique token "never merge PRs" survives, which only holds if the config-marker channel itself survived the fold.
…s docs-sync drift) Review follow-up on #2576: the feature's table row was hand-added to CONFIGURATION.md / CONFIGURATION.zh-CN.md but the single-source seed website/config-reference/compress.yaml was never updated, so the #2107 docs-sync drift guard (gen-config-docs.mjs generate + git diff --exit-code) regenerates the table without the row and fails. Add the compress.protectedContentMarkers seed entry (id ct.pcm, EN/ZH desc + site) and regenerate index.html/main.js; verified locally that generate is idempotent and both docs-sync and docs-coverage pass.
Owner
Author
[bot] 🏷 已审 PR #2576( 我做了什么(review 中的两处顺手修,已推送)
两处都是 test-only / docs-only,不碰生产 结构化八问
CI 判定新 head 合并判定:可合。feat + config-surface 变更 ⇒ 需人工 review、不可 auto-merge(§7.4);stacked on #2574,待其合并后 base 自动 retarget master。建议 owner 人工确认后合并。 |
Owner
Author
|
(ai: zhipuai-lb/glm-5.3) 目标 issue #2446 已关(修复以其他方式落地)。列车审查时确认:内容已落地/不再需要,关单处理。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2446 (方案A — the proxy-mode/config lane).
What
New
compress.protectedContentMarkers(string[]): any TEXT message containing any declared substring is a durable content carrier — same HARD exclusion asprotectedTools(untaggedBLOCKEDref, covered by neither suggested nor explicit folds, both compression modes, every wire), but keyed on message text instead of tool name.src/config.ts—CompressSettings.protectedContentMarkers, parse (empty array / non-string / blank entries reject loudly),COMPRESS_SETTING_FIELDS.src/compress-settings.ts—mergeCompresswhitelist passthrough (three-level cascade global→provider→model, whole-array replace).src/durable-message-guards.ts—protectedContentMarkerGuard(markers)factory (undefined for empty list — the guard chain never grows a dead predicate).src/server/handle.ts— wire path: request-resolved markers stamped ontosession.metadata(delete when empty) + composed intoisMessageProtectedalongside lane/marker/registered guards.src/session.ts—protectedContentMarkersOf(session)+ read-path composition ineffectiveConfig(plugin-tool readers see the same list without request context).CONFIGURATION.md+CONFIGURATION.zh-CN.md— table row + full section (⚠ over-pinning / paste risk documented, prefer host-native mechanisms when available).Why this shape
The durable-message protocol now has three host-native channels: built-in lane table (host-identity evidence),
bili-durablefirst-line markers (#2555),POST /__bili/plugin/protect(#2556). All require the HOST to cooperate. #2446's gap: a third-party host (dsh's system-reminder carriers —Instructions from:,<mcp_catalog>) injects standing instructions bili knows nothing about, and in proxy mode bili has no client identity at all, so no lane evidence can ever apply. 方案A is the operator's declarative escape hatch: the user declares the carrier signature once; a config marker reproduces any lane entry one-to-one (same substring granularity as the built-in guards).Config surface (per AGENTS.md §3)
compress.protectedContentMarkers: string[](default none).protectedTools/protectedLatestToolskey on tool name; lane/marker/protect channels require host cooperation or plugin mode. Proxy-mode, text-keyed, user-declared pinning has no carrier.protectendpoint (plugin lane: /__bili/plugin/protect tool (server-side equivalent registration, auxiliary channel) #2556 — plugin-mode only),bili-durablemarkers (needs the host to emit them). 方案A complements all three.protectedTools). No persistence-format change (markers live in session metadata as a plain string array, read-time re-resolved).Tests
tests/issue2446-config-markers.test.ts(4): config validation matrix (accept/trim/reject empty·non-array·non-string·blank); lane-less real fold — configured carrier survives untagged (the 8-refs-for-9-messages pin:BLOCKED_REFis never advertised) while post-carrier neighbors fold; composition — config marker +bili-durable(#2555) co-protect in one session; absent markers — the SAME carrier text folds (protection comes from the knob, not the text).Local: 4/4 green, typecheck clean, regression family green (2555/2419/2447/2481/2446-catalog 18/18; 2556-protect 4/4).
§7.4 self-check