Repository navigation
[PR] fix: rank the node runtime's Low integrity label first in win32 EPERM hints; add non-blocking startup self-check (#5155) - #5160
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.7467-pr.5160.ac6c135This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5160.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Review polish for #5160: the new src/integrity-label module was imported as "./integrity-label.ts" / "../integrity-label.ts" in persist-eperm.ts and storage/shadow.ts while cli.ts, logger.ts and integrity-selfcheck.ts already use the ".js" specifier. Normalize to ".js" so the module's import specifier is uniform across its four call sites and matches the repo's dominant ESM convention. Non-semantic: tsconfig allowImportingTsExtensions makes both resolve identically (NodeNext maps .js -> the .ts source). typecheck clean, integrity/persist/storage-cantopen/logger suites green (30/30).
[bot] 🏷 Synced: master was moving fast during this window (two merge cycles needed — #5294/#5292/#5253 batch, then #5163, then #5236 message-timestamps + kernel 0.0.173). Both merges were clean with zero conflicts; this PR's diff stays small and touches no files those merges rewrote semantically. Verified on the new head d04ebe7: typecheck clean + 32/32 targeted tests green (storage-cantopen-hint / persist-eperm / issue5154-selfcheck). State after push: |
… hints; single linear commit on current master (#5155) Rebuilt from the original branch content (identical diff) onto current master: the old head had accumulated repeated merge-guard 'merge master' commits. The startup self-check half (#5154 warnIfLowIntegrityRuntime) already landed on master separately — this commit carries the remaining delta only: the shared integrityLabelDiagnosis helper wired into the log-reopen warn and the persist-EPERM alert, CONFIGURATION.md evidence-order text, and the two ordering gate tests.
d04ebe7 to
619ed00
Compare
(ai: vllm-qwen/qwen3.8-27b) rebase 完成(簇攻坚 #5302 攻击序第 3 项):分支已重建为当前 master 顶上的单个线性提交 619ed00(force-with-lease 更新 PR 头)。
|
What / why
#5155 supplies reproducible A/B evidence (4/4) for the whole win32 EPERM-on-own-data family (#5096 crash loop, #4614 READONLY degrade, #5103 power-loss report): the real switch is not Defender/ACL/read-only-dir but the NTFS mandatory integrity label on the node executable itself — a Low-labeled node.exe cannot write Medium-labeled files even with correct ACLs (MIC no-write-up →
EPERM-4048 on every write), and relabeling Low→Medium fixed everything with zero AV/ACL change. This PR implements #5155's suggestions 2/3/4. Suggestion 1 (CA-bundle write degradation) is already implemented on the #5103 thread's branch2026-10-29_issue5103-startup-recovery-visibilityand is deliberately NOT duplicated here.Changes
icacls "<process.execPath>"+/setintegritylevel Medium); AV exclusion drops to second. The canonical diagnosis text lives in ONE place (src/integrity-label.ts) so the surfaces cannot drift:sqliteOpenFailureHint(src/storage/shadow.ts): index.db open refusal (CANTOPEN) and first-write refusal (attempt to write a readonly database, the SQLite unified storage degraded to legacy-only (bili v0.1.205, node v24.22.1, win32-x64) #4614/promptCache.routing is ignored by relay-affinity stamping; no way to persist per-endpoint prompt_cache_key abatement (0.1.209) #5103 field shape);warnReopenFailed, win32 + EPERM/EACCES only).src/integrity-selfcheck.ts, fired from cli.ts atbili start. Non-blocking spawn oficacls <realpath(process.execPath)>(win32 only, 3s timeout, 8KB cap); parses the mandatory ACE; Low/Very Low → one prominent[integrity] …warn naming the cause and the exact fix commands (incl. the non-recursive parent-dir convergence for inherited labels). Fail-open by construction: missing icacls / timeout / unparseable output = silent. Node has no built-in LABEL_SECURITY_INFORMATION API, so the probe reads the same security database via icacls output.Behavior changes (old → new)
Log/hint wording only, plus one new conditional warn line:
[integrity]startup warn appears ONLY on win32 with a Low/Very Low runtime label.sqliteOpenFailureHintnow also matchesattempt to write a readonly database(was CANTOPEN-only) — superset of the pending extension in the promptCache.routing is ignored by relay-affinity stamping; no way to persist per-endpoint prompt_cache_key abatement (0.1.209) #5103 branch / PR [PR] fix: name the win32 READONLY index.db open failure; drop the delete advice under OS-level refusals (#4614) #4625; see coordination below.Coordination (hot-file overlap)
2026-10-29_issue5103-startup-recovery-visibility(promptCache.routing is ignored by relay-affinity stamping; no way to persist per-endpoint prompt_cache_key abatement (0.1.209) #5103 thread; pushed, no PR opened yet) also extendssqliteOpenFailureHintto the READONLY form and adds its ownstartupFailureHints(src/index.ts) + CA-degrade warn (src/ca.ts), both currently AV-first. Its shadow.ts hunk is semantically subsumed by this PR's version (same regex extension, reordered text) — resolve any merge conflict by taking this PR's text. Commented in that thread asking it to flip its two hint texts to integrity-first (reusingsrc/integrity-label.ts) before opening its PR.Verification
Targeted local runs green: 67/67 across tests/integrity-selfcheck.test.ts (new: all five levels parse, fail-open negatives, warn positive/negative gate per #3617), tests/storage-cantopen-hint.test.ts (ordering pinned both directions, READONLY shape fires, non-matching errors stay silent, platform gate both directions), tests/persist-eperm.test.ts (ordering pinned) plus all logger suites and proxy-persist (unchanged pins still hold). typecheck clean; full build green. Full regression = CI on this head.
Closes #5155