Skip to content

api-manifest: stub flag exists but is never set — populate it, cross-check with stub_diag, and surface in docs + a strict mode #4918

Description

@proggeramlug

The structural gap

The API manifest already has the field that solves the stub-tracking problem, and nothing uses it:

  • ApiEntry.stub: bool exists in crates/perry-api-manifest/src/lib.rs (~line 54), added so the unimplemented-API check (Compile-time error for unimplemented Node / Web APIs #463) wouldn't error on intentional no-ops.
  • Zero of ~2,500 entries set it. The method()/property()/class() helper constructors hardcode stub: false (the only 6 occurrences of the literal in entries.rs) and there is no setter/builder to override it.
  • Meanwhile stub_diag.rs (Stub registry + first-call runtime diagnostic for no-op stubs #464) maintains a separate STUB_MANIFEST registry + perry_stub_warn first-call diagnostics — but it's only wired into 3 files (stdlib_stubs.rs, global_fetch.rs, stub_diag.rs itself). The two stub registries don't know about each other.

Result: the manifest drives the .d.ts, docs/src/api/reference.md, the compile-time unimplemented-API check, and the CI drift guard (manifest_consistency.rs) — and every one of those surfaces presents stubs as fully supported. There is no machine-readable difference between fs.readFile (real) and dns.resolve4 (loopback fake).

Work items

Why this is the keystone

Every other issue in the stub epic fixes one lie. This one makes new lies impossible to ship: an API can be real, or it can be visibly fake — never silently fake.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew capability or improvementstubsRegistered API that is a no-op / fake / silently wrong — stub-elimination epic

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions