Conflicts are unions: the JVM lane's overload_set covers Java, Kotlin and C#, and the merged-target and Class-callable rules here cover TypeScript, JavaScript, Vue and Svelte.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
JavaScript instance and inherited members, `super.m()`, a member assigned in a block,
and a class type parameter blocking its name file-wide all abstain today. Each entry
says why and what was tried, so turning one into an edge has to come with a real rule.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
The evidence writer sized its id table and digest array by every fact it wrote. A composed
occurrence fact is cited only by its own row, so it never needed either, and those facts
are about half of a large repository. They now cost nothing past their row, and each
table holds only the nodes other facts can cite.
The root array is sized by the roots that exist, not by twice the row count, and a row's
fact id takes four bytes.
Writer's peak tracked memory:
linux drivers/net: 1,789 -> 541 MB
django: 447 -> 280 MB
Total peak RSS is unchanged, because the peak is in parallel_resolve, before the writer
runs. redis and django stay identical to base 9c946d51 in edges, nodes and all logical
tables, including fact ids and digests.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
A TSX script's own component, a nested namespace sibling and a rest-parameter callee
all resolve to their exact oracle targets in both routes, so those known gaps are
required now and the parameter shadow stays a hard negative.
The imported annotation pinned USAGE, which es_usage_crossfile_typescript forbids at
such an occurrence. It requires USES_TYPE at that span, and the second-file decoy and
local same-named class are checked on USES_TYPE too. The namespace constructor call
remains a counted gap.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
The logical occurrence tables became read-only views, so the oracle's synthetic writer
failed at setup and 16 cases went red without testing anything. The fixtures now write
resolver_occurrence_rows with their strings in resolver_text.
Each corruption keeps its meaning: moving a start byte still leaves the end in place, a
wrong identity is still a wrong identity, and a deleted evidence row is now an
occurrence with no identities, which the oracle rejects the same way. The oracle itself
and every assertion are unchanged.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
mkc_c8_typescript_constructor_samefile and lrp_ts_s3_constructor name the declared
`constructor` as the target of `new Widget(name)`, and the edge went to the Class,
which the quality harness reports as WRONG_OCCURRENCE. A class that declares a
constructor now answers with it, in the same file and through an import. A class
without one stays the Class node, the materialized callable ts.same-file-constructor
requires.
Oracle changes, each because a rule is true now and a stricter entry replaces a gap:
- lsp_resolution_probe: implicit `new` targets the Class, required, not an
unmaterialized gap; s3 requires Widget.constructor. Its three TS annotation entries
pinned USAGE, which es_usage_crossfile_typescript forbids at the same occurrence;
they require USES_TYPE at that span, and the b/types.ts decoy is checked on USES_TYPE.
- matrix_known_classes, matrix_new_constructs, node_creation_probe: TS calls that are
now proved are required instead of counted gaps. Their forms and targets are unchanged.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
These known gaps are closed by the static selection walker. A field sharing a method's name carries the #field QN the graph gives it, and new on a class with no declared constructor binds the class.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Kotlin a.b = c recorded a write to a. The carrier now names the last navigation, and the walker reads a and b and writes c through a chain of any length. A type parameter's name was bound to its bound as a type mention in all three walkers: it now mentions the parameter, which has no node.
fun <T> consume(value: T) no longer competes with consume(value: Int) for an Int, since an exact match is the most specific.
Capabilities text names the remaining gaps. Narrow sanitized run: resolver_oo resolver_kotlin resolver_cs resolver_java kotlin_typed_calls registry call_reference_contract resolver_capabilities resolver_quality resolver_contract extraction: 744 pass, 0 fail.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
`accept(target); const target = () => {};` in one scope reads the const in its dead
zone, and `var` reads undefined, so no reference there names the function. The
binder treated a function value as visible everywhere, which published the edge
pipeline_cross_file_method_defines_method_venue_parity forbids. A closure still names
it, its own body included.
Tests: the CommonJS contract now counts the promoted case as found, and the JSX oracle
requires the USAGE that `<UI.Widget />` genuinely has: it reads that namespace member,
while the invocation stays a counted gap.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
`{ [K in Keys]: K }` and `T extends Array<infer U> ? U : never` bind K and U where
they are written. With USES_TYPE now walking every type name, both reached a
same-named module type, which is a wrong edge. They block that name the way a type
parameter does.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Red: ref partial struct and a splitting #if lose whole files; two overloads in two files of a partial class stay ambiguous even when one matches exactly; nameof emits a call reference.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
`import { foo as bar }` then `bar()` kept an unresolved_calls row even with the exact
edge admitted. The per-file LSP reported the exported name, and the diagnostic joins
its call site by spelling, so it never found the occurrence that later cleared it.
It reports the spelling the file wrote now.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
es_usage_crossfile_typescript caught a wrong edge: with type positions resolving, a
parameter annotation also published USAGE to the interface. Its oracle forbids that,
because USAGE means a value. Every annotated name in TypeScript did this, so USAGE on
real code counted types as values.
A written type name, and the `Ns` root of `Ns.Type`, now abstains from USAGE with
reason usage_names_a_type. `typeof value` stays USAGE: it reads a value.
USES_TYPE had to take those names over, and it only looked at signatures and a few
body forms. It now walks every type name in the TS family, so class fields, heritage
clauses and alias bodies are not lost.
Also promotes two known gaps these rules satisfy: the TS parameter annotation and the
CommonJS `module.exports = async function`.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Twelve RQ_KNOWN_GAP cases (inline constructor receivers, implicit constructors,
parameter-property and field receivers, a TS script's own declaration) now resolve
to the exact oracle target, and rq_check reports them as PROMOTE_TO_REQUIRED. Their
oracles are unchanged; only the excuse goes.
tslsp_param_property_this_dispatch_issue514 and tslsp_field_new_initializer_issue514
pinned the inference label lsp_ts_method. Those receivers are proved now, so they
assert the stricter ts514_proved_count at the same exact target; the decoy counts
(wrong override, unknown, factory, plain parameter) are untouched.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Red: the per-file observation pool's work budget runs out and every later site is lost, whatever it is. Found on a 4,000-line form-binding test in Play.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
An extension on Iterable or Collection applies to a List, a Set or a project Iterable, and to nothing else. Past a vararg, position no longer says which parameter an argument lands on, so it no longer excludes. A project class is never an Array.
resolver_oo: 7 pass, 0 fail.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
A static method reaches no instance member by simple name and has no this (JLS 15.12.3). An array argument does not fit its element's scalar parameter. A class body inside a static method has instances of its own.
The Kotlin typed oracle's 15 recovered gaps become required edges. The raw-owner test now asserts Companion in the method's QN, because the unnamed companion's members exist in the graph.
Narrow sanitized run: resolver_oo registry call_reference_contract resolver_capabilities resolver_java kotlin_typed_calls resolver_kotlin resolver_cs resolver_quality resolver_contract: 232 pass, 0 fail.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Known gaps these rules close become required edges, so a regression fails: default, named and vararg arguments, generic inference, contextual literals, local flow, smart casts, inherited and extension members, labelled this, C# narrowing and visibility.
Abstentions that were pinned and are now correct emissions, each with its reason at the case: an argument of unknown type keeps the only candidate of its arity; arity excludes a zero-argument overload; a function outranks a property of the name at one scope level; a parameter type outside the project cannot exclude; a top-level initializer's ::handler is a reference from the file; ::handler nested in an if or a pair is still a callable reference.
Wrong-signature negatives are all kept and now hold through the argument-fit rule. wrong-overload is removed because overloads share one graph node, so the two cannot differ there.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Kotlin 'a f b' had no call carrier at all. A member of an anonymous class has no node, so its calls now belong to the enclosing declaration, like a lambda's. The closed-member check was global, so any free function named accept, get or run never bound: it now asks whether an enclosing type actually has that member from a listed external supertype. Even a single candidate must fit its arguments: a project namesake of the wrong signature is not the target. Scalars compare by family across the three languages, a Kotlin Int variable is not a Long, and C# ref, this and static contexts follow the language.
Assigned tests: generated_member_registers_by_qn_only now asserts the short-name index, since the guess it pinned is retired. The C# field-hint fixture's receiver is a local of unknowable type, which stays unbound; a declared field is the positive.
resolver_kotlin and resolver_cs still have oracle updates pending in the next commit.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Once the logical tables became views, the digest and the currency check accepted any
view with the right columns, so a look-alike over other rows would have been certified
as this generation's data. store_graph_digest's fail-closed test caught it. Both now
compare a view's stored definition to what the writer creates.
The integration tests that damage a generation now damage the compact rows, because
the logical names can no longer be written to.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
llvm-project never published: clang/test/Lexer/Inputs/inc1.h includes one header
tens of thousands of times, past what a file's proof pool analyses, and that failed
the whole generation. The new test reproduces the shape and pins that another file's
call still resolves. RED on the old code: rc -2.
Also pin that an include written through a macro proves nothing for its own file,
while another file's literal include of the same header still resolves.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Three CommonJS facts the export table had wrong:
- `exports = x` without module.exports detaches the name, so a later `exports.y`
is not an export. It was published as one.
- `exports.y` or `module.exports.y` written before the last `module.exports =`
went to the replaced object.
- `exports = module.exports = createApp; exports.named = named` makes `named` a
name of the required value. `require(x).named` looked only for a member declared
under createApp, and `module.exports = require('./app')` did not forward names.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
An adversarial read of the member rule found eight wrong edges on one fixture:
- A function inside a nested scope named its `this` owner by spelling, so a
parameter or local `Owner` reached the module-level `Owner`'s members.
- `get m()` was taken for the callable; a call invokes what the getter returned.
- Object.assign, Object.defineProperty, mixin and `delete` replace members without
spelling an assignment.
- A class field initializer inside a member inherited the literal's `this`.
Owners now need a module-level function, mutator calls and `delete` make every
member of that owner unknown, and a class body clears `this`.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
New suite resolver_oo, sequential and parallel. Not yet run: expectations still need their first pass and RED proof.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Preserves the js-ts lane's on-disk work after its tools were refused. Nothing here has been through a suite: no RED proof, no precision sample for the member rule. Not ready to integrate.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Checkpoint against a usage limit. Proved on express and kilocode subtrees; the
test suites have not run on this tree yet, so later commits may adjust it.
- Real lexical scopes replace the module-wide veto on any local name.
- CommonJS syntax, module extensions, package.json type and TypeScript prove a
module; a classic browser script stays unproved.
- require bindings and an exported-name table: aliases, default exports, barrels,
export *, export * as, module.exports and exports.x.
- Directory imports resolve through main and index.
- TS method proofs survive destructuring, catch, generics and decorators, take
own and inherited methods, this.field and new X() receivers, and have no budget.
- TS annotations give exact type-name occurrences.
- A registered route suppresses the unresolved diagnostic again.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Compose and derive share their steps, and these pin the result: same fingerprint,
order and revoked authority over complete, incomplete, repeated and open premises.
Identical abstained rows still make one fact, and a row at another site its own.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
ORDER BY CAST(project AS BLOB) cannot use an index, so a digest sorted every
reconstructed row in memory. Ordering by the column itself gives the same order,
since a text column compares by its bytes, and the planner walks the keys. The digest's
golden value is unchanged.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
The evidence was one transaction, so its WAL held a second copy of every row until
the final checkpoint. That second copy decides whether the largest repositories fit
on the disk at all.
A staging store is private until the atomic rename and a failure discards it, so it
now commits as rows accumulate and the WAL can reset. A partial generation still cannot
pass for a whole one, because the receipt is written last. The general
replace_generation keeps its one savepoint and its rollback.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Sealing interned one more proof node per occurrence, and most occurrences abstain.
Nothing reads that node before it is written, yet it was over half of all facts
and about a quarter of a large index's resolver memory, single-threaded to build.
A sealed row that produced no edge now marks its fact pending. The writer composes
the same fact from the row's own columns, using the steps cbm_resolve_proof_derive
uses, and sorts and numbers it together with the real nodes, so every fact id and
digest stays what it was. Rows that compare equal still become one fact, as
interning made them. Emitted rows keep their node, since admission reads it.
Also test that a long write logs progress.
Proof on redis, base 9c946d51 -> this commit: peak RSS 1,679 -> 809 MB, resolve phase
1.1 s, with edges, nodes and all seven logical resolver tables hashing identically.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
A stored resolver generation forces a full rebuild, because design stage 5 (incremental optimization) is not implemented. Main's new delta-route assertions now assert FORCED_FULL with a known-gap note saying to restore them; the ADR-survives and incremental-equals-full contracts still run. The #1419 probe counted main's ADR sidecar, which only the full-rebuild route migrates: that sidecar holds user-authored decisions and outlives every publish, so FULL is correct there and the probe now covers the private stage it was written for.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
A fact's strings now feed json_object in the resolver_facts view, which passes
invalid bytes straight through. fact_json replaced them, so a payload was always
strict JSON. Facts with such text now store it as fact_json would have written it.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
TypeScript sat over 11 minutes in semantic_class_facts, sampled at
ts_node_named_child: fetching a child by index walks from the first child, so
enumerating n children costs n*n/2 steps.
A new counter charges that real cost at the loop, and the complexity suite gates
its ratio when one file's top level doubles. It lands at ~4 here; the fix follows.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
An occurrence names its project, file, scope and two 64-character content
identities, and a fact names them again inside a JSON payload. Written out
row by row that is about 3 KB per occurrence: redis publishes a 2.9 GB
database for a 180 MB graph.
The cost test pins bytes per occurrence by page count, never wall time, and
that the dictionary does not grow with the row count. The round-trip test pins
what compaction may not change: every column reads back byte for byte,
including property shapes the compact form does not recognise.
Corruption tests now target what is stored: the logical names become views, so
dropping one of those or any compact table must read as unavailable, and
removing or changing compact rows must invalidate the receipt.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Each pool below holds a whole project's proofs and refused publication once its
fixed budget ran out:
shared resolver 64M django needs 133M, kubernetes 2.28G
graph buffer 4G kubernetes needs 5.03G
infra adapters 4M kubernetes' 6456 YAML files exhaust it
The shared test reaches its budget with one small Go file and a long project name,
because every proof hashes that name; the same file under a short name is the
control. The graph and adapter tests spend the former budget up front instead of
building a project that size. The graph pool is private, so that needs a test seam.
RED: cbm_shared_resolver_build returns NULL for the long name only,
cbm_gbuf_record_resolution fails, and the adapter pool refuses a leaf.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
yyjson's strict writer refuses a whole document over one undecodable byte. Source
files can be in any encoding, and the strict resolver puts source text in JSON on
its way to publication, treating a NULL write as fatal:
record_properties call arguments and callee -> aborted_previous_preserved
fact_json proof lookup keys and scopes -> persist_failed
pass_pkgmap import paths and names -> aborted_previous_preserved
lsp_surface definitions and imports -> every file's surface row dropped
Neovim and redis took the first route: a latin-1 string argument in a test file
stopped the whole index. Main writes these same bytes into edge properties raw, so it
published, with invalid UTF-8 inside that JSON.
Add cbm_json_write_text: valid documents are written unchanged at no extra cost,
and only a document the writer refused has its strings repaired, replacing undecodable
bytes with U+FFFD. That covers every field of a document, rather than each field that
happens to carry source text today. The exact-bytes columns (resolver_occurrences
spelling, resolver_lookups key) keep the original bytes; the MCP layer normalizes
those at its own encoding boundary.
The pending unresolved-call key is compared against text read back from that JSON,
so it applies the same replacement to both sides.
The UTF-8 sequence check moves from mcp.c to foundation/str_util so there is one copy.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Each route is one way such bytes reach a strict JSON writer before publication:
a call argument (redis deps/tre/tests/retest.c, neovim's legacy specs), a callee
spelling, and an import path. The parallel leg also checks the argument text
survives on the published edge as U+FFFD.
RED: cbm_pipeline_run returns CBM_PIPELINE_ABORT_PRESERVE_DB or
CBM_PIPELINE_PERSIST_FAILED, depending on the route.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Shape of redis src/defrag.c🔢 an #ifdef splitting a long else-if chain
puts the first syntax error more than 16 levels under the root. Today that
fails the whole file before its include table exists, and the next declared
binding dereferences it, so the indexing worker dies with SIGSEGV.
RED: SIGSEGV in c_proof_direct_class.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Threads main's Go rel_path (#1910) through the proof-source and import-snapshot variants, keeps main's ADR sidecar so the rebuild no longer re-applies ADRs, and keeps the feature's removal of the import name fallback and JVM tail join, inside which main had added a generated-member filter. Main took semantic index version 12 for Markdown Section names, so the resolver generation becomes version 13.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
The reviewed reconciliation of tests/test_pipeline.c kept main's call sites of cross_file_call_has_strategy but dropped its definition, and test_resolver_integration.c used a bare yyjson.h that no include path provides. Neither candidate had been compiled.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Adds a class-filtered, thread-local, one-shot realloc failure hook compiled only with CBM_MEM_TEST_API, and a regression that fails the primary edge array's first growth. The old code registered the secondary and dedup entries and returned a positive id while the array the dump reads stayed empty, so a retry appeared to succeed and the edge was lost and leaked.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Resolves the nine textual conflicts with the reviewed reconciliation: semantic index version 12 on top of main's migrations, digest stream v3 because both sides independently claimed v2, incremental metadata-current requires main completeness and the strict resolver generation receipt, and exact call joins by extraction index, full span and origin. Unresolved-call diagnostics reconcile only after final proof sealing and successful projection.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>