dsh-permission-rules 0.6.3 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.es.md +1 -1
- package/README.hi.md +1 -1
- package/README.md +1 -1
- package/README.pt.md +1 -1
- package/README.zh.md +1 -1
- package/lib/index.js +17 -11
- package/lib/types/proxy.d.ts.map +1 -1
- package/lib/types/runtime.d.ts +1 -1
- package/package.json +23 -23
- package/src/proxy.ts +22 -10
- package/src/runtime.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to dsh-permission-rules are recorded here, newest first.
|
|
4
4
|
|
|
5
|
+
## v0.6.5 - 2026-09-01
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Align the devDependency pins to the published dsh `0.1.2-alpha.3` line (17 `@deepseek-ai/dsh-*` packages), align `cordis`/`schemastery` to `^4.0.2`/`^3.18.2`, and raise the `dsh-sandbox` override and `dshWorkshop.compatibility.dshVersions` to `0.1.2-alpha.3`. The audit gate classification keeps failing safe on `0.1.2-alpha.3`; the five-language READMEs record the alpha.3 fact. The vendored `dsh-auto-review` 0.6.0 tarball stays frozen.
|
|
10
|
+
|
|
11
|
+
## v0.6.4 — 2026-09-01
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- Guard every CONNECT socket error window so a client reset can no longer
|
|
16
|
+
crash the host process: the raw tunnel socket now gets an explicit `error`
|
|
17
|
+
handler (log + destroy both peers) before any await or write, covering the
|
|
18
|
+
decision await, the 400 early return, and the 403 early return paths
|
|
19
|
+
([#12](https://github.com/PerryLink/dsh-permission-rules/issues/12)).
|
|
20
|
+
|
|
5
21
|
## v0.6.3 — 2026-08-30
|
|
6
22
|
|
|
7
23
|
### Fixed
|
package/README.es.md
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
| Surface | Status |
|
|
27
27
|
|---|---|
|
|
28
|
-
| Harness | DeepSeek Harness `0.1.1-rc.2` |
|
|
28
|
+
| Harness | DeepSeek Harness `0.1.1-rc.2` 0.1.2-alpha.3 (adaptado el 2026-09-01): el sobre de sesión conserva su campo ignorable solo para compatibilidad de lectura de logs almacenados - Session.append aún no puede estamparlo, por lo que el comportamiento de la puerta no cambia. |
|
|
29
29
|
| Node | `^22.19.0 || >=24.0.0` |
|
|
30
30
|
| Platforms | Todas (host + cliente web de settings) |
|
|
31
31
|
| Model | Cualquiera (las razones deny/ask se muestran a través de los resultados de herramienta) |
|
package/README.hi.md
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
| Surface | Status |
|
|
27
27
|
|---|---|
|
|
28
|
-
| Harness | DeepSeek Harness `0.1.1-rc.2` |
|
|
28
|
+
| Harness | DeepSeek Harness `0.1.1-rc.2` 0.1.2-alpha.3 (2026-09-01 को अनुकूलित): सत्र लिफ़ाफ़ा अपना ignorable फ़ील्ड केवल संग्रहीत-लॉग पठन संगतता के लिए रखता है - Session.append अभी भी इसे स्टैम्प नहीं कर सकता, इसलिए गेट व्यवहार अपरिवर्तित है। |
|
|
29
29
|
| Node | `^22.19.0 || >=24.0.0` |
|
|
30
30
|
| Platforms | सभी (host + वेब settings क्लाइंट) |
|
|
31
31
|
| Model | कोई भी (deny/ask कारण टूल परिणामों के माध्यम से दिखते हैं) |
|
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
| Surface | Status |
|
|
28
28
|
|---|---|
|
|
29
|
-
| Harness | DeepSeek Harness `0.1.1-rc.2` |
|
|
29
|
+
| Harness | DeepSeek Harness `0.1.1-rc.2` 0.1.2-alpha.3 (adapted 2026-09-01): the session envelope keeps its ignorable field for stored-log read compatibility only - Session.append still cannot stamp it, so audit-gate behavior is unchanged. |
|
|
30
30
|
| Node | `^22.19.0 || >=24.0.0` |
|
|
31
31
|
| Platforms | All (host + web settings client) |
|
|
32
32
|
| Model | Any (deny/ask reasons surface through tool results) |
|
package/README.pt.md
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
| Surface | Status |
|
|
27
27
|
|---|---|
|
|
28
|
-
| Harness | DeepSeek Harness `0.1.1-rc.2` |
|
|
28
|
+
| Harness | DeepSeek Harness `0.1.1-rc.2` 0.1.2-alpha.3 (adaptado em 2026-09-01): o envelope de sessão mantém seu campo ignorable apenas para compatibilidade de leitura de logs armazenados - o Session.append ainda não consegue estampá-lo, então o comportamento da porta não muda. |
|
|
29
29
|
| Node | `^22.19.0 || >=24.0.0` |
|
|
30
30
|
| Platforms | Todas (host + cliente web de settings) |
|
|
31
31
|
| Model | Qualquer (razões deny/ask aparecem pelos resultados de ferramenta) |
|
package/README.zh.md
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
| Surface | Status |
|
|
27
27
|
|---|---|
|
|
28
|
-
| Harness | DeepSeek Harness `0.1.1-rc.2` |
|
|
28
|
+
| Harness | DeepSeek Harness `0.1.1-rc.2` 0.1.2-alpha.3(2026-09-01 已适配):会话信封保留 ignorable 字段但仅用于存量日志读取兼容——Session.append 仍无法盖章,门控行为不变。 |
|
|
29
29
|
| Node | `^22.19.0 || >=24.0.0` |
|
|
30
30
|
| Platforms | 全部(host + Web 设置客户端) |
|
|
31
31
|
| Model | 任意(deny/ask 原因经工具结果呈现) |
|
package/lib/index.js
CHANGED
|
@@ -2138,6 +2138,12 @@ var NetworkProxy = class {
|
|
|
2138
2138
|
}
|
|
2139
2139
|
/** CONNECT tunneling (HTTPS and friends): adjudicate, then either 403 or an established TCP tunnel. */
|
|
2140
2140
|
async handleConnect(req, socket, head) {
|
|
2141
|
+
const tunnelHolder = {};
|
|
2142
|
+
socket.on("error", (error) => {
|
|
2143
|
+
this.options.logger.warn(`permission-rules: CONNECT socket error: ${String(error)}`);
|
|
2144
|
+
tunnelHolder.tunnel?.destroy();
|
|
2145
|
+
socket.destroy();
|
|
2146
|
+
});
|
|
2141
2147
|
const target = connectTarget(req.url ?? "");
|
|
2142
2148
|
if (target === void 0) {
|
|
2143
2149
|
socket.end("HTTP/1.1 400 Bad Request\r\n\r\n");
|
|
@@ -2150,22 +2156,22 @@ var NetworkProxy = class {
|
|
|
2150
2156
|
socket.end(`HTTP/1.1 403 Forbidden\r\ncontent-type: text/plain\r\ncontent-length: ${Buffer.byteLength(body)}\r\n\r\n${body}`);
|
|
2151
2157
|
return;
|
|
2152
2158
|
}
|
|
2153
|
-
const
|
|
2159
|
+
const tunnel = connect(target.port ?? 443, target.host);
|
|
2160
|
+
tunnelHolder.tunnel = tunnel;
|
|
2154
2161
|
this.sockets.add(socket);
|
|
2155
|
-
this.sockets.add(
|
|
2162
|
+
this.sockets.add(tunnel);
|
|
2156
2163
|
const cleanup = () => {
|
|
2157
2164
|
this.sockets.delete(socket);
|
|
2158
|
-
this.sockets.delete(
|
|
2165
|
+
this.sockets.delete(tunnel);
|
|
2159
2166
|
};
|
|
2160
2167
|
socket.on("close", cleanup);
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
upstream.once("connect", () => {
|
|
2168
|
+
tunnel.on("close", cleanup);
|
|
2169
|
+
tunnel.on("error", () => socket.destroy());
|
|
2170
|
+
tunnel.once("connect", () => {
|
|
2165
2171
|
socket.write("HTTP/1.1 200 Connection Established\r\n\r\n");
|
|
2166
|
-
if (head.length > 0)
|
|
2167
|
-
|
|
2168
|
-
socket.pipe(
|
|
2172
|
+
if (head.length > 0) tunnel.write(head);
|
|
2173
|
+
tunnel.pipe(socket);
|
|
2174
|
+
socket.pipe(tunnel);
|
|
2169
2175
|
});
|
|
2170
2176
|
}
|
|
2171
2177
|
/** Adjudicate one plain-HTTP request; deny/ask blocks with a structured 403 before any forwarding. */
|
|
@@ -3674,7 +3680,7 @@ async function apply(ctx, config) {
|
|
|
3674
3680
|
* whole alpha line is treated as unsafe; over-refusal is harmless because
|
|
3675
3681
|
* `allowUnmarkedAudit: true` opts back in, and
|
|
3676
3682
|
* `scripts/repair-session-logs.mjs strip` removes already-written audit
|
|
3677
|
-
* rows for hosts where the marker cannot help. Extend the bound if a
|
|
3683
|
+
* rows for hosts where the marker cannot help. On 0.1.2-alpha.2 the envelope field is restored for stored-log read compatibility only - its Session.append still cannot stamp the marker, so the gate behavior is unchanged. Extend the bound if a
|
|
3678
3684
|
* future alpha/rc line regresses. Non-matching (later rc, stable, or
|
|
3679
3685
|
* unresolvable) versions are treated as possibly-marker-aware and
|
|
3680
3686
|
* verified by the append probe.
|
package/lib/types/proxy.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../src/proxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAGhE,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE3D,oHAAoH;AACpH,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAAyF,CAAA;AAEtI,6DAA6D;AAC7D,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAA6B,CAAA;AAE7E,oFAAoF;AACpF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAA;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE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yF;YAC3E,oBAAoB;IAalC,4FAA4F;IAC5F,OAAO,CAAC,WAAW;CA4BpB;AAYD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,UAAU,GAAG,MAAM,IAAI,CAyBtF"}
|
package/lib/types/runtime.d.ts
CHANGED
|
@@ -425,7 +425,7 @@ export declare function apply(ctx: Context, config: Config): Promise<void>;
|
|
|
425
425
|
* whole alpha line is treated as unsafe; over-refusal is harmless because
|
|
426
426
|
* `allowUnmarkedAudit: true` opts back in, and
|
|
427
427
|
* `scripts/repair-session-logs.mjs strip` removes already-written audit
|
|
428
|
-
* rows for hosts where the marker cannot help. Extend the bound if a
|
|
428
|
+
* rows for hosts where the marker cannot help. On 0.1.2-alpha.2 the envelope field is restored for stored-log read compatibility only - its Session.append still cannot stamp the marker, so the gate behavior is unchanged. Extend the bound if a
|
|
429
429
|
* future alpha/rc line regresses. Non-matching (later rc, stable, or
|
|
430
430
|
* unresolvable) versions are treated as possibly-marker-aware and
|
|
431
431
|
* verified by the append probe.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-permission-rules",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"description": "Declarative Claude Code-style permission rules plus a Codex-style process-level network policy for DeepSeek Harness: ordered allow/deny/ask rules with tool-name, argument (glob/regex), workspace-path, and network-target (domain/ip/port/scheme) matching on the tools/pre-execute waterfall, a built-in local HTTP/CONNECT proxy governing shell subprocess traffic, three network modes mapped onto the official sandbox presets, full session-log audit, HMR rule reload, and a settings page with a rule editor, block counters, and recent interception lists.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
],
|
|
78
78
|
"compatibility": {
|
|
79
79
|
"dshVersions": [
|
|
80
|
-
"0.1.
|
|
80
|
+
"0.1.2-alpha.3"
|
|
81
81
|
]
|
|
82
82
|
},
|
|
83
83
|
"capability": {
|
|
@@ -119,14 +119,14 @@
|
|
|
119
119
|
"node": "^22.19.0 || >=24.0.0"
|
|
120
120
|
},
|
|
121
121
|
"peerDependencies": {
|
|
122
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
122
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
123
123
|
"@deepseek-ai/dsh-agent": ">=0.1.0-rc.8 <0.2.0",
|
|
124
124
|
"@deepseek-ai/dsh-commands": ">=0.1.0-rc.8 <0.2.0",
|
|
125
125
|
"@deepseek-ai/dsh-llm": ">=0.1.0-rc.8 <0.2.0",
|
|
126
126
|
"@deepseek-ai/dsh-session": ">=0.1.0-rc.8 <0.2.0",
|
|
127
127
|
"@deepseek-ai/dsh-tools": ">=0.1.0-rc.8 <0.2.0",
|
|
128
128
|
"@deepseek-ai/dsh-typert-protocol": ">=0.1.0-rc.8 <0.2.0",
|
|
129
|
-
"@deepseek-ai/schemastery": "^3.18.
|
|
129
|
+
"@deepseek-ai/schemastery": "^3.18.2",
|
|
130
130
|
"react": "^18.2.0",
|
|
131
131
|
"@deepseek-ai/dsh-client-connection": ">=0.1.1-rc.2 <0.2.0",
|
|
132
132
|
"@deepseek-ai/dsh-client-locale": ">=0.1.1-rc.2 <0.2.0",
|
|
@@ -155,27 +155,27 @@
|
|
|
155
155
|
"yaml": "^2.8.0",
|
|
156
156
|
"zod": "^4.4.3"
|
|
157
157
|
},
|
|
158
|
-
"devDependencies": {
|
|
159
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
158
|
+
"devDependencies": {"@deepseek-ai/dsh-attachment": "0.1.2-alpha.3",
|
|
159
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
160
160
|
"@deepseek-ai/cordis-plugin-include": "1.0.6",
|
|
161
161
|
"@deepseek-ai/cordis-plugin-loader": "1.0.2",
|
|
162
|
-
"@deepseek-ai/dsh-agent": "0.1.
|
|
163
|
-
"@deepseek-ai/dsh-brand": "0.1.
|
|
164
|
-
"@deepseek-ai/dsh-client-connection": "0.1.
|
|
165
|
-
"@deepseek-ai/dsh-client-locale": "0.1.
|
|
166
|
-
"@deepseek-ai/dsh-client-ui-settings": "0.1.
|
|
167
|
-
"@deepseek-ai/dsh-client-ui-slots": "0.1.
|
|
168
|
-
"@deepseek-ai/dsh-client-web": "0.1.
|
|
169
|
-
"@deepseek-ai/dsh-commands": "0.1.
|
|
170
|
-
"@deepseek-ai/dsh-invariants": "0.1.
|
|
171
|
-
"@deepseek-ai/dsh-llm": "0.1.
|
|
172
|
-
"@deepseek-ai/dsh-session": "0.1.
|
|
173
|
-
"@deepseek-ai/dsh-session-projection": "0.1.
|
|
174
|
-
"@deepseek-ai/dsh-subagent": "0.1.
|
|
175
|
-
"@deepseek-ai/dsh-tools": "0.1.
|
|
176
|
-
"@deepseek-ai/dsh-typert-protocol": "0.1.
|
|
177
|
-
"@deepseek-ai/dsh-user-approval": "0.1.
|
|
178
|
-
"@deepseek-ai/schemastery": "^3.18.
|
|
162
|
+
"@deepseek-ai/dsh-agent": "0.1.2-alpha.3",
|
|
163
|
+
"@deepseek-ai/dsh-brand": "0.1.2-alpha.3",
|
|
164
|
+
"@deepseek-ai/dsh-client-connection": "0.1.2-alpha.3",
|
|
165
|
+
"@deepseek-ai/dsh-client-locale": "0.1.2-alpha.3",
|
|
166
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.1.2-alpha.3",
|
|
167
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.1.2-alpha.3",
|
|
168
|
+
"@deepseek-ai/dsh-client-web": "0.1.2-alpha.3",
|
|
169
|
+
"@deepseek-ai/dsh-commands": "0.1.2-alpha.3",
|
|
170
|
+
"@deepseek-ai/dsh-invariants": "0.1.2-alpha.3",
|
|
171
|
+
"@deepseek-ai/dsh-llm": "0.1.2-alpha.3",
|
|
172
|
+
"@deepseek-ai/dsh-session": "0.1.2-alpha.3",
|
|
173
|
+
"@deepseek-ai/dsh-session-projection": "0.1.2-alpha.3",
|
|
174
|
+
"@deepseek-ai/dsh-subagent": "0.1.2-alpha.3",
|
|
175
|
+
"@deepseek-ai/dsh-tools": "0.1.2-alpha.3",
|
|
176
|
+
"@deepseek-ai/dsh-typert-protocol": "0.1.2-alpha.3",
|
|
177
|
+
"@deepseek-ai/dsh-user-approval": "0.1.2-alpha.3",
|
|
178
|
+
"@deepseek-ai/schemastery": "^3.18.2",
|
|
179
179
|
"@eslint/js": "^10.0.1",
|
|
180
180
|
"@types/node": "^22.19.0",
|
|
181
181
|
"@vitest/coverage-v8": "^3.2.0",
|
package/src/proxy.ts
CHANGED
|
@@ -184,6 +184,18 @@ export class NetworkProxy {
|
|
|
184
184
|
|
|
185
185
|
/** CONNECT tunneling (HTTPS and friends): adjudicate, then either 403 or an established TCP tunnel. */
|
|
186
186
|
private async handleConnect(req: IncomingMessage, socket: Duplex, head: Buffer): Promise<void> {
|
|
187
|
+
// Guard first (issue #12): a CONNECT socket is a raw Duplex handed over
|
|
188
|
+
// by the HTTP server with no default 'error' handling, so a client reset
|
|
189
|
+
// in any window — the decision await, the 400 early return, or the 403
|
|
190
|
+
// early return — would emit an unhandled 'error' and crash the host
|
|
191
|
+
// process. The handler closes over the tunnel holder so the same guard
|
|
192
|
+
// doubles as tunnel teardown once an upstream exists.
|
|
193
|
+
const tunnelHolder: { tunnel?: Duplex } = {}
|
|
194
|
+
socket.on('error', (error: unknown) => {
|
|
195
|
+
this.options.logger.warn(`permission-rules: CONNECT socket error: ${String(error)}`)
|
|
196
|
+
tunnelHolder.tunnel?.destroy()
|
|
197
|
+
socket.destroy()
|
|
198
|
+
})
|
|
187
199
|
const target = connectTarget(req.url ?? '')
|
|
188
200
|
if (target === undefined) {
|
|
189
201
|
socket.end('HTTP/1.1 400 Bad Request\r\n\r\n')
|
|
@@ -196,22 +208,22 @@ export class NetworkProxy {
|
|
|
196
208
|
socket.end(`HTTP/1.1 403 Forbidden\r\ncontent-type: text/plain\r\ncontent-length: ${Buffer.byteLength(body)}\r\n\r\n${body}`)
|
|
197
209
|
return
|
|
198
210
|
}
|
|
199
|
-
const
|
|
211
|
+
const tunnel = connect(target.port ?? 443, target.host)
|
|
212
|
+
tunnelHolder.tunnel = tunnel
|
|
200
213
|
this.sockets.add(socket)
|
|
201
|
-
this.sockets.add(
|
|
214
|
+
this.sockets.add(tunnel)
|
|
202
215
|
const cleanup = (): void => {
|
|
203
216
|
this.sockets.delete(socket)
|
|
204
|
-
this.sockets.delete(
|
|
217
|
+
this.sockets.delete(tunnel)
|
|
205
218
|
}
|
|
206
219
|
socket.on('close', cleanup)
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
upstream.once('connect', () => {
|
|
220
|
+
tunnel.on('close', cleanup)
|
|
221
|
+
tunnel.on('error', () => socket.destroy())
|
|
222
|
+
tunnel.once('connect', () => {
|
|
211
223
|
socket.write('HTTP/1.1 200 Connection Established\r\n\r\n')
|
|
212
|
-
if (head.length > 0)
|
|
213
|
-
|
|
214
|
-
socket.pipe(
|
|
224
|
+
if (head.length > 0) tunnel.write(head)
|
|
225
|
+
tunnel.pipe(socket)
|
|
226
|
+
socket.pipe(tunnel)
|
|
215
227
|
})
|
|
216
228
|
}
|
|
217
229
|
|
package/src/runtime.ts
CHANGED
|
@@ -1265,7 +1265,7 @@ export async function apply(ctx: Context, config: Config): Promise<void> {
|
|
|
1265
1265
|
* whole alpha line is treated as unsafe; over-refusal is harmless because
|
|
1266
1266
|
* `allowUnmarkedAudit: true` opts back in, and
|
|
1267
1267
|
* `scripts/repair-session-logs.mjs strip` removes already-written audit
|
|
1268
|
-
* rows for hosts where the marker cannot help. Extend the bound if a
|
|
1268
|
+
* rows for hosts where the marker cannot help. On 0.1.2-alpha.2 the envelope field is restored for stored-log read compatibility only - its Session.append still cannot stamp the marker, so the gate behavior is unchanged. Extend the bound if a
|
|
1269
1269
|
* future alpha/rc line regresses. Non-matching (later rc, stable, or
|
|
1270
1270
|
* unresolvable) versions are treated as possibly-marker-aware and
|
|
1271
1271
|
* verified by the append probe.
|