chore(r): do not bump SCHEMA_BUMP for the new R language

Restore parse-cache.ts and incremental-parse-cache.test.ts to upstream/main,
so this branch no longer touches either file.

- R files were never parsed before this branch, so no parse-cache entry for
  them can be stale: .r files had no language and were in no chunk.
- Chunk keys are a hash of the chunk's file paths and content hashes with no
  language or grammar component, so chunks of existing languages keep exactly
  the same keys and entries; adding R only adds new R chunks.
- The cache version is `${SCHEMA_BUMP}+${package version}`, so any release
  changes the package part and invalidates every entry anyway.
- The bump only protected reviewers re-testing successive heads of this branch
  on a single package version, and it kept conflicting with upstream's own
  bumps on every merge.

The diff against upstream/main adds no capture or ParseWorkerResult change for
any other language: shared edits are optional provider hooks that only R
defines (postParse, resolveMemberOwnerNode, cfgVisitor, rename).
This commit is contained in:
Mick Cooney 2026-10-15 17:26:01 +01:00
parent 52ea6649b0
commit eac10308fc
2 changed files with 4 additions and 25 deletions

View file

@ -866,27 +866,7 @@ import { copyV8CacheIfPresent, tryLoadV8Cache, writeV8CacheFile } from './v8-sid
// Older worker and durable captures cannot prove property-reader dispatch.
// v141: detached method owners retain names without fabricated graph ids.
// Re-extract both worker and durable captures before workspace ownership runs.
// v142: R provider fixes, collapsed into one bump because none of them has
// shipped. R scope queries anchor a `@scope.function` on every named-function
// assignment and named function-valued argument (the same nodes the
// `@declaration.function`/`@declaration.method` anchors use), so each def is
// owned by its own Function scope instead of the module/Class scope, and
// capture the `pkg::`/`pkg:::` qualifier of namespaced calls as
// `@reference.qualified-name` so it reaches `site.rawQualifiedName`. The R
// provider also keeps only the argument that names an S4 definition
// (shouldSkipDefinitionCapture), so `setClass("A", contains = "VIRTUAL")` no
// longer defines a Class `VIRTUAL`, `setGeneric(..., valueClass = "numeric")` a
// Function `numeric`, nor `setMethod("show", "Foo", ...)` a Method `Foo`; the R
// scope emitter likewise keeps only the argument that names a `setClass` class
// or a `library`/`require`/`source` import, so `library(lib.loc = libO, pkgP)`
// no longer imports `libO` and a comment before the first argument no longer
// hides the class or import. Definitions and scope captures are parse-time
// facts replayed verbatim from the warm cache, so stale ones (the pre-fix scope
// tree, the unqualified call-site shape, the mis-selected arguments) would
// persist on unchanged files; both stores must re-extract. R also gains a CFG
// visitor, so cached R parse results carry no CFG side channel and must
// re-extract before a `--pdg` run can reuse them.
const SCHEMA_BUMP = 142;
const SCHEMA_BUMP = 141;
const GITNEXUS_PKG_VERSION = (() => {
try {
// package.json sits at gitnexus/package.json — two levels up from

View file

@ -323,9 +323,8 @@ describe('PARSE_CACHE_VERSION', () => {
// Moved 138 -> 139 for provider graph/capture fixes exercised by real rename fixtures (#3486).
// Moved 139 -> 140 for Ruby accessor ownership captures used by rename (#3557).
// Moved 140 -> 141 for detached Go ownership captures used by rename (#3559).
// Moved 141 -> 142 for the R provider fixes (scope-function anchors, `pkg::` qualifier capture, S4/import first-argument selection).
it('pins SCHEMA_BUMP to 142 so concurrent bumps cannot silently collide (#2766, #3015, #3088, #2885, #3128, #2865, #3130, #1432, #3161, #3179, #3219, #3190, #3253, #3273, #3339, #3354, #3371, #2965, #3390, #3398, #3396, #3394, #3399, #3414, #3408, #3402, #3446, #3450, #3499, #3502, #3487, #3505, #3504, #3497, #3486, #3559)', () => {
expect(Number(PARSE_CACHE_VERSION.split('+', 1)[0])).toBe(142);
it('pins SCHEMA_BUMP to 141 so concurrent bumps cannot silently collide (#2766, #3015, #3088, #2885, #3128, #2865, #3130, #1432, #3161, #3179, #3219, #3190, #3253, #3273, #3339, #3354, #3371, #2965, #3390, #3398, #3396, #3394, #3399, #3414, #3408, #3402, #3446, #3450, #3499, #3502, #3487, #3505, #3504, #3497, #3486, #3559)', () => {
expect(Number(PARSE_CACHE_VERSION.split('+', 1)[0])).toBe(141);
expect(PARSE_CACHE_BUCKET_COUNT).toBe(128);
// The PREVIOUS version must fail the reuse gate, not merely differ from the
// current one — a hardcoded number outside the conflict hunk rebases cleanly
@ -335,7 +334,7 @@ describe('PARSE_CACHE_VERSION', () => {
59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103,
104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122,
123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141,
123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140,
]) {
expect(Number(PARSE_CACHE_VERSION.split('+', 1)[0])).not.toBe(taken);
}