Skip to content

test(kernel-test): end-to-end narrowed fs, pending implementation - #1050

Draft
ci-belphegor wants to merge 1 commit into
grypez/narrowing-3-api-surfacefrom
grypez/narrowing-4-e2e-test
Draft

test(kernel-test): end-to-end narrowed fs, pending implementation#1050
ci-belphegor wants to merge 1 commit into
grypez/narrowing-3-api-surfacefrom
grypez/narrowing-4-e2e-test

Conversation

@ci-belphegor

Copy link
Copy Markdown

Explanation

Adds an end-to-end integration test for narrowing, with every case marked it.fails and a comment naming the PR that unmarks it. This is a ratchet: each later PR in the stack turns one or more cases green, so the middle of the stack produces visible progress instead of several PRs that demonstrate nothing.

Nothing in this repo used .fails before, so this introduces the convention.

The first five cases use a base exo the vat builds itself with explicit M.interface guards and need no fs at all. That is deliberate — it decouples the narrowing cases from the fs rework later in the stack.

Notes for reviewers

A green .fails proves nothing. It passes if the case fails for any reason, including a typo or an unrelated throw. The ratchet buys a forcing function, not coverage; each assertion gets its real scrutiny in the PR that unmarks it. Every case here was verified by unmarking it, reading the actual failure, and re-marking — five on narrow is not implemented, one on E(fs).readFile reporting target has no method "readFile", has [], and two on invalid cluster config.

One thing here must not be refactored. The vat calls narrow/join outside its probe try/catch, deliberately. Two cases assert a refusal by matching /^rejected:/u. If the narrow call sat inside the try, today's stub error would be caught and reported as rejected:narrow is not implemented, those cases would pass for the wrong reason, and the ratchet would be silently defeated. This is noted in the vat's JSDoc.

The file must also typecheck at every point in the stack — it.fails absorbs a runtime failure but not a tsc failure, which would break the package build for everyone. So the fs cases are written against behavior, not types: the vat touches fs as a loosely-typed global endowment.

No changelog — test only.

Stack

PR 4 of 12. Base: #1049.

Eight end-to-end cases for attenuation by narrowing, every one marked
it.fails so that it is green while it fails and turns red once it passes.
Each names the pull request that removes its marker. Nothing in this repo
used .fails before, so the file explains the convention.

A green .fails proves nothing. It passes if the case fails for any reason
at all — a typo, an unrelated throw, a vat that never launched — so what
it buys is a forcing function and visible progress, not coverage. Each
assertion gets its real scrutiny in the pull request that unmarks it.

What each case fails on today, verified by unmarking the file and reading
the errors:

- the five local-exo cases: Error: narrow is not implemented
- receives fs as an exo: rejected:target has no method "readFile", has []
- both config cases: Error: invalid cluster config, from
  SubclusterManager rejecting an fs config shape platformConfigStruct
  does not describe yet

The vat calls narrow and join outside its probe helper, so a stub's own
error rejects the whole method rather than being reported as a refusal.
Without that, the two cases asserting a refusal would pass today on the
stub's error instead of on a guard.

Setup runs inside each case rather than a hook, so a rejected config
fails the one case instead of erroring the file. The fs endowment's
eventual type is claimed locally rather than imported, and the config
that does not typecheck yet goes through a cast: it.fails absorbs a
runtime failure, not a tsc failure.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ci-belphegor
ci-belphegor force-pushed the grypez/narrowing-4-e2e-test branch from c0a45c8 to 7dabc36 Compare September 11, 2026 11:42
@ci-belphegor
ci-belphegor added this pull request to stack #1060 September 11, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant