fix(diagnostics): all-LSP own-file drift (refs #3011) - #3009
Conversation
|
Thanks for your first pull request! A maintainer will review it soon. Please make sure CI passes and the PR template is filled out. |
|
Thanks for this — and specifically for the stacking note. I verified the claim mechanically before reading any code: Exactly the two files you named, one commit, no drive-by edits. The 11-file / +1331 view against Status: blocked on #2983, not on youThis is queued behind its parent. #2983 is Two mechanical items, for whenever you next touch the branch
"Allow edits from maintainers" is on, so if you would rather we carry both of those, say the word and we will commit them to your branch as review deltas with your authorship intact. One thing review will probe hardest, flagged earlyThe size gate moving ahead of the mtime gate is the substance of this change, and the reasoning for it is sound — an out-of-band write really can land at-or-before The consequence worth checking is what the reorder does to records that have no content baseline. If that is right, it is a behavior change to #2983's existing axis rather than to the new all-LSP one, and it would not show up in tests that always capture a baseline. If it is wrong — because This is flagged as an angle, not a finding: no probe has been run against it yet. Full adversarial review comes once #2983 clears and this rebases to its two-file form. This comment was written by an AI agent working on this repository, with maintainer supervision. |
|
Correction to item 2 above, after reading #2982's acceptance criteria properly. I first read your
So Sorry for the churn — you had the code boundary right, I had the issue boundary wrong. Two things in #3011 that go slightly beyond your current diff, both standard for this repo rather than anything specific to your patch:
Happy to take the sweep off your plate if you would rather keep this to the two files — say so and we will do it as a maintainer commit on your branch, or as a separate PR that lands first. This comment was written by an AI agent working on this repository, with maintainer supervision. |
|
This PR is merge-conflicted; required checks are silently skipped until resolved. |
|
Merge-train warden: GitHub never dispatched CI for this head. No run exists for The required checks here are ABSENT, not passing. Nothing may read this PR as green until a run exists and concludes. The warden cannot push, so it cannot recover this itself. Re-dispatch with an empty commit on the branch, or close and reopen the PR. |
Rebase the all-LSP own-file content confirmation onto the merged blocker-freshness baseline and preserve the production baseline seam. Refs apmantza#3011
bffd29f to
a26c87b
Compare
|
Conflict resolution and workflow approval complete.
Required workflows are now expected to execute; they are not considered green until |
Make available all-LSP blocker baselines authoritative by hash even when a same-size rewrite does not advance mtime, while preserving non-LSP performance and no-baseline fallback behavior. Refs apmantza#3011
|
Fix-round commit pushed: |
|
Advisory PR-body correction: the Observability section now cites the existing bounded |
|



Summary
Fix HIGH F1 from PR #3009 / issue #3011. The fix is pushed at exact head
3cb0d4b9c0f76aaf14b6e0beec4bef12ea208a73, rebased from input heada26c87b905ece9e3a7b3cd7452140a081234db47. All-LSP inline blockers with anavailable size and sha256 baseline now force content confirmation even when the
file mtime is at or before the recorded baseline. Non-LSP records retain the
mtime fast path, and records without a hash retain the no-baseline mtime
fallback.
Finding HIGH F1: fixed. The rebased two-file diff's missing changelog fragment:
fixed with exactly one new
.changelog/fix-3011-all-lsp-content-freshness.md.Tests
Red-first real production path, before the fix:
This entered through
RuntimeCoordinator.recordInlineBlockersandsweepInlineBlockerFreshness.Compile-valid mutation (
forceContent: false) after the fix:npm run build: passed before each test run and after mutation restoration.Focused direct callers: 56/57 tests passed across the external-rewrite,
blocker-freshness, delivery-cap, widget-population, widget delivery-cap, and
hook-await registry suites. The one failure is the known offline Java grammar
fixture (
resolves a .java blocker's forward imports); 24/25 tests in thatfile passed.
npm run lint: passed.npm run fmt:check: passed.npm run changelog:checkandnode scripts/check-changelog-fragments.mjs:passed.
npm run preflight: blocked after 90 seconds with no gate output; interruptedbecause the environment cannot prefetch the tree-sitter grammars.
Blast radius
Changed production symbols are
detectSelfDriftand its single caller insweepInlineBlockerFreshness. The newforceContentvalue is true only forall-LSP records with both baseline fields. Non-LSP callers and no-baseline LSP
fallback behavior remain unchanged. The hook-await registry entry was refreshed
because the changed call shape receives a new source key. No durable record,
host adapter, MCP route, generated JavaScript,
dist/, orCHANGELOG.mdchanged.
Class sweep
Swept
detectSelfDrift,detectDrift,sweepInlineBlockerFreshness, allrecordInlineBlockersconsumers, allrecordedSize/recordedHashusers, andthe
bounded()call-site registry. The self-drift population remains foldedonto the shared
detectSelfDriftseam. Widget rows stay distributed becausethey have no re-arming setter or content baseline. Language coverage is through
the registry-backed LSP provenance; the non-TypeScript Java forward-import case
was exercised and is the only offline grammar failure.
Verdict: fold all-LSP and non-LSP inline records onto the existing content seam;
keep widget dependency rows separate by contract.
freshnessFromMtime/statMtimeMsconsumers (#3011)Every consumer of
freshnessFromMtime/ barestatMtimeMsinclients/, with the per-member verdict on whether its real question is "written after T?" (mtime is the right instrument) or "do the bytes still match?" (mtime is a blind proxy):blocker-freshness.tsdetectSelfDriftmtime gateblocker-freshness.tsdetectDriftown-file fallbackblocker-freshness.tsdetectDriftimport walkproject-diagnostics/cache.tsadvisory-provenance.tslsp/workspace-diagnostics-cache.tswidget-state.ts(3 sites)observed-mutation.tsopaque-mutation-scan.tsConsolidation verdict: the single blind-proxy site is the no-baseline own-file fallback, which is deliberately fail-open and out of #3011's scope — the defect here is the baseline-present case, which the content axis now owns. No other consumer uses mtime as a content-match proxy.
Observability
The new decision is covered by existing record
self-drift-unverifiableatclients/blocker-freshness.ts:1017, which observes the content-confirmationfailure/timeout path.
selfUnverifiable,revalidated,selfHealed, andhashBudgetExhaustedcounters preserve the existing bounded, fail-closedobservability.
Test assessment
The regression and inverse touch case use the real coordinator and freshness
sweep. The new force guard is independently mutation-tested and the mutated
compiled production path reds with the same assertion as the original defect.
The no-baseline mtime fallback and non-LSP mtime fast path remain covered.
The prior exact-head CI for
a26c87b905ece9e3a7b3cd7452140a081234db47passed required Lint & type-check and Unit tests, with changelog fast-fail
passing; its advisory PR-body check failed and Windows later passed. Fresh
exact-head CI for
3cb0d4b9c0f76aaf14b6e0beec4bef12ea208a73is required after thefix push and is not yet claimed green.