Commit Graph
15 Commits
Author SHA1 Message Date
Martin Vogel 46daeae2eb fix(resolver): new X() targets the constructor X declares
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>
2026-11-01 17:52:31 +01:00
Martin Vogel 3ac5f6eada fix(resolver): a function const is not visible before its own line in its scope
`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>
2026-11-01 17:42:17 +01:00
Martin Vogel 7790bc038c fix(resolver): mapped and infer type names shadow a same-named type
`{ [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>
2026-11-01 17:33:32 +01:00
Martin Vogel 18d8a9aa6c fix(resolver): a TypeScript type name is USES_TYPE, never USAGE
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>
2026-11-01 17:11:05 +01:00
Martin Vogel e0d2a414fa fix(resolver): CommonJS names follow the object module.exports finally is
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>
2026-11-01 16:27:40 +01:00
Martin Vogel 73a906ca16 fix(resolver): JavaScript member rule withholds what an assignment does not settle
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>
2026-11-01 16:19:53 +01:00
Martin Vogel a32c207f11 wip(resolver): clang-format binding.c and fix the deprecated sprintf in the TS proof test
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-01 16:09:33 +01:00
Martin Vogel 20dd0d8715 wip(resolver): JavaScript member rule and format pass, untested
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>
2026-11-01 14:27:22 +01:00
Martin Vogel 7a13f401eb wip(resolver): JavaScript and TypeScript modules, scopes and exports
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>
2026-11-01 14:07:04 +01:00
Martin Vogel decc140035 Complete strict resolver regression migration
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-28 07:37:07 +01:00
Martin Vogel f0509f95c1 Require explicit import proofs and expose per-edge capabilities
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-28 05:26:51 +01:00
Martin Vogel 642fe3fe46 Complete proof bridges and migrate resolver quality contracts
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-28 04:48:12 +01:00
Martin Vogel 9440839c27 Complete strict resolver proof integration and quality accounting
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-27 19:16:41 +01:00
Martin Vogel 891d6eb249 Require occurrence-bound evidence for cross-file edges
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-25 22:14:52 +01:00
Martin Vogel 75f45ba248 Add shared semantic resolution with explicit proof admission
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-10-25 18:20:22 +01:00