Skip to content

Commit 9c418ba

Browse files
author
endolinbot
committed
fixer(#379): audit verdicts + parity-test gap closed + gardener message
Audit of naugtur's 3 inline asks on endojs/endo#3276 and kriskowal's 5 mirror-side asks on endojs/endo-but-for-bots#379. Seven of eight asks are genuinely addressed by prior commits; one ask (kriskowal #3 on import-gauntlet.test.js) had a missing shared-fixture parity pair for the unused-live-binding shape, closed with new compartment-mapper head f1a7dfb60. The eighth ask (kriskowal's gardener-meta follow-up) is queued as a message-fixer-40ac9b entry for the next gardener dispatch. Top-level PR audit comment posted at endojs/endo-but-for-bots#379-issuecomment-4609535322.
1 parent a5bf379 commit 9c418ba

2 files changed

Lines changed: 275 additions & 0 deletions

File tree

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
---
2+
ts: 2026-06-03T05:59:06Z
3+
kind: message
4+
role: fixer
5+
host: endolinbot
6+
project: endo
7+
to: gardener
8+
refs:
9+
- entries/2026/06/03/054900Z-dispatch-liaison-f83065.md
10+
- https://github.com/endojs/endo-but-for-bots/pull/379
11+
prs:
12+
- repo: endojs/endo-but-for-bots
13+
pr: 379
14+
role: source
15+
---
16+
17+
# message: fixer → gardener — document the parity-test concept
18+
19+
kriskowal asked on endojs/endo-but-for-bots#379 (inline comment
20+
`3338685696` on `packages/ses/test/import-cjs.test.js`):
21+
22+
> Parity claims should be substantiated with parity tests. Please
23+
> inform the gardener that it should document the concept of a parity
24+
> test for future reference.
25+
26+
This is the gardener-meta follow-up. The audit on PR #379 confirmed
27+
that every parity claim in the issue-59 work is now substantiated by
28+
a parity-test pair landed in this PR, so the maintainer's ask is met
29+
on the code side and what remains is the documentation work in the
30+
garden.
31+
32+
## The parity-test concept, as exercised on PR #379
33+
34+
A **parity test** is a paired-tests-plus-shared-fixture pattern that
35+
verifies a claim of behavioral parity between two layers (typically
36+
the in-tree implementation and a reference implementation, in our
37+
case the SES / compartment-mapper module linker versus Node.js's
38+
own module linker) by construction rather than narratively.
39+
40+
Three artifacts cooperate:
41+
42+
1. **A fixture** under `test/fixtures-<slug>/node_modules/app/` that
43+
exercises the topology in question. The fixture is a tiny package
44+
that both layers can load. Its `package.json` is real (so Node's
45+
resolver works) and includes a `preinstall` script that aborts
46+
installation so the fixture is never accidentally hoisted into
47+
the workspace.
48+
49+
2. **A shared assertion module** at `test/_<slug>-assertions.js`
50+
that exports the expected projections and an assertion function
51+
`assert<Slug>(t, namespace)`. The expected values live in exactly
52+
one place; both parity tests import this module.
53+
54+
3. **Two test files** that import the shared assertion:
55+
- `<slug>.test.js` exercises the in-tree implementation (typically
56+
through the compartment-mapper scaffold, which runs the fixture
57+
through every load / archive / parse path).
58+
- `<slug>-node-parity.test.js` exercises the same fixture under
59+
plain Node.js (via `import(new URL('.../main.js', import.meta.url))`
60+
for ESM, or `spawnSync(process.execPath, ...)` when the parity
61+
claim is about a specific error code on rejection).
62+
63+
When both files pass, parity is verified by construction: any
64+
divergence between the in-tree implementation and Node.js's reference
65+
behavior on this fixture would make one of the two tests fail.
66+
67+
The pattern also covers **divergence claims**. When SES and Node.js
68+
disagree (as with the ESM-in-CJS cycle that Node rejects with
69+
`ERR_REQUIRE_CYCLE_MODULE` and SES allows), the shared structure is:
70+
the SES side test pins the SES behavior on the fixture; the Node side
71+
test asserts the rejection on the same fixture; together they verify
72+
the disparity programmatically.
73+
74+
## Canonical examples in the tree on PR #379's head (`f1a7dfb60`)
75+
76+
Four parity trios are now present in
77+
`packages/compartment-mapper/test/`:
78+
79+
- `_cycle-rename-assertions.js` + `cycle-rename.test.js` +
80+
`cycle-rename-node-parity.test.js`: the populated-binding shape of
81+
endojs/endo#59 (parity case).
82+
- `_cycle-rename-unused-assertions.js` + `cycle-rename-unused.test.js`
83+
+ `cycle-rename-unused-node-parity.test.js`: the unused-live-binding
84+
shape (parity case; landed on the audit dispatch as the closing gap).
85+
- `_cycle-cjs-reexporter-assertions.js` + `cycle-cjs-reexporter.test.js`
86+
+ `cycle-cjs-reexporter-node-parity.test.js`: the all-CommonJS
87+
three-module reexporter cycle (parity case).
88+
- `cycle-esm-in-cjs.test.js` + `cycle-esm-in-cjs-node-parity.test.js`:
89+
the ESM-in-CJS cycle (divergence case; Node rejects, SES allows).
90+
No shared assertion module is needed because the two sides verify
91+
opposite outcomes on the same fixture.
92+
93+
These four are the working reference for what a parity test looks
94+
like in the endo tree. A garden-side documentation entry can point
95+
at them by file path.
96+
97+
## Suggested garden artifacts
98+
99+
The shape this points at is a `skills/node-parity-test/SKILL.md` (or
100+
similar slug) that captures:
101+
102+
- Purpose: verify or refute behavioral parity between an in-tree
103+
implementation and a reference implementation, by construction.
104+
- When to reach for this pattern: any time the in-tree behavior pins
105+
itself to "what Node.js does" (or another reference implementation's
106+
behavior) and the claim is currently expressed only in prose.
107+
- The three-artifact shape (fixture, shared assertion module, two
108+
test files) with one paragraph per artifact.
109+
- The divergence variant (no shared assertion module; the two sides
110+
assert opposite outcomes).
111+
- File-naming conventions seen in the endo tree:
112+
`fixtures-<slug>/`, `_<slug>-assertions.js`, `<slug>.test.js`,
113+
`<slug>-node-parity.test.js`.
114+
- One worked example with file links into the endo tree on
115+
`f1a7dfb60`.
116+
117+
The current garden inventory already mentions a `node-parity-test`
118+
skill in `CLAUDE.md` § Current inventory, so the slot exists; this
119+
message reports that the concept is now exercised four times in one
120+
PR and that the documentation work is ripe.
121+
122+
## Suggested handling
123+
124+
The next gardener dispatch picks this up; the relevant context lives
125+
in this message plus the four trios cited above. The dispatch can
126+
read PR #379 directly for the prose around each fixture and the
127+
cross-references that already cite the parity pairs.
128+
129+
Self-improvement: nothing this time.
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
---
2+
ts: 2026-06-03T06:00:16Z
3+
kind: result
4+
role: fixer
5+
host: endolinbot
6+
project: endo
7+
repo: endojs/endo-but-for-bots
8+
dispatch_root: /home/kris/dispatches/fixer--f83065
9+
prs:
10+
- repo: endojs/endo-but-for-bots
11+
pr: 379
12+
role: target
13+
refs:
14+
- entries/2026/06/03/054900Z-dispatch-liaison-f83065.md
15+
- entries/2026/06/03/055906Z-message-fixer-40ac9b.md
16+
- https://github.com/endojs/endo-but-for-bots/pull/379#issuecomment-4609535322
17+
---
18+
19+
# result: fixer — #379 audit + gap closure + gardener message queued
20+
21+
Audit verdicts per ask, the one gap-closing commit, the PR top-level
22+
audit comment, and the gardener-meta message entry are all in place.
23+
24+
## Per-ask verdicts
25+
26+
### naugtur (endojs/endo#3276)
27+
28+
1. (`module-instance.js:379`, `3323491701`, unused live bindings):
29+
genuinely addressed. The `cyclic star export with renaming reexport,
30+
unused live binding` test in `packages/ses/test/import-gauntlet.test.js`
31+
(lines 296-329) covers this exactly: `export var y` with no
32+
initializer, every projection reads `undefined`, verified against
33+
Node.js. Test passes locally.
34+
35+
2. (cycle-rename fixture path, `3323503838`, longer cycle with CJS):
36+
genuinely addressed. Two three-module fixtures land:
37+
`fixtures-cycle-cjs-reexporter` (all-CommonJS) and
38+
`fixtures-cycle-esm-in-cjs` (mixed). Each is exercised through
39+
compartment-mapper and through Node.js with shared assertions; all
40+
36 tests in the four trios pass.
41+
42+
3. (`module-instance.js`, `3323524839`, shared notifier primitive):
43+
partial; judgment call upheld. `makeNotifierWithResolver` is
44+
extracted and applied to `makeModuleInstance`. The bot's reply
45+
(`3338583474`) explains why `makeVirtualModuleInstance` was not
46+
unified (one-shot redirect vs live-cell fan-out have different
47+
semantics). The dispatch brief authorized leaving this as-is.
48+
49+
### kriskowal (endojs/endo-but-for-bots#379)
50+
51+
1. (`module-instance.js:389`, `3338365530`): partial / addressed via
52+
the bot's inline reply at `3338583474`; the Node-parity scenario
53+
is covered by `cycle-cjs-reexporter-node-parity.test.js`.
54+
55+
2. (`3338583474`): bot's own reply, not actionable.
56+
57+
3. (`import-gauntlet.test.js`, `3338677487`, reframe + parity test):
58+
gap closed. The prose reframe landed in `4d4953dcb`. The
59+
shared-fixture parity pair for the unused-live-binding shape was
60+
missing; commit `f1a7dfb60` lands `cycle-rename-unused.test.js`,
61+
`cycle-rename-unused-node-parity.test.js`,
62+
`_cycle-rename-unused-assertions.js`, and
63+
`fixtures-cycle-rename-unused/`, plus a cross-reference from the
64+
in-process SES regression's prose to the new parity pair. All 12
65+
new tests pass.
66+
67+
4. (`import-cjs.test.js`, `3338682426`, divergence stated and
68+
verified programmatically): genuinely addressed. The
69+
`cycle-esm-in-cjs` parity pair verifies the divergence by
70+
construction (SES allows; Node spawns and asserts
71+
`ERR_REQUIRE_CYCLE_MODULE`).
72+
73+
5. (`import-cjs.test.js`, `3338685696`): first part (parity claims
74+
substantiated) genuinely addressed; every parity claim now has a
75+
shared-fixture trio. Second part (inform the gardener) journaled
76+
as a `message` entry at
77+
`entries/2026/06/03/055906Z-message-fixer-40ac9b.md` for the next
78+
gardener dispatch to pick up.
79+
80+
## Gap closure commit
81+
82+
- New head SHA: `f1a7dfb60` (was `4d4953dcb`).
83+
- Commit: `test(compartment-mapper): unused-live-binding parity
84+
fixture + tests (#59 follow-up)`.
85+
- Files added:
86+
- `packages/compartment-mapper/test/fixtures-cycle-rename-unused/node_modules/app/{package.json, star-reexporter.js, export-renamer.js, main.js}`
87+
- `packages/compartment-mapper/test/_cycle-rename-unused-assertions.js`
88+
- `packages/compartment-mapper/test/cycle-rename-unused.test.js`
89+
- `packages/compartment-mapper/test/cycle-rename-unused-node-parity.test.js`
90+
- File modified: `packages/ses/test/import-gauntlet.test.js` (prose
91+
cross-reference to the new parity pair).
92+
- Push: regular append (no force) to
93+
`origin/fix/issue-59-star-export-cycle`.
94+
- Local verification: `yarn ava test/cycle-*.test.js` in
95+
`packages/compartment-mapper` (50 passed). `yarn ava
96+
test/import-gauntlet.test.js test/import-cjs.test.js` in
97+
`packages/ses` (34 passed plus 1 known failure on the
98+
`reexport with implicit default syntax` test that is `test.failing`
99+
by design). Prettier and ESLint clean on touched files.
100+
`yarn lint:types` in compartment-mapper clean.
101+
102+
## PR top-level comment
103+
104+
Posted at <https://github.com/endojs/endo-but-for-bots/pull/379#issuecomment-4609535322>.
105+
Lists each of the eight asks with verdict and addressing SHA. The
106+
new SHA `f1a7dfb60` is cited under naugtur #1 and kriskowal #3 (the
107+
new parity pair substantiates the unused-live-binding claim that
108+
naugtur's question pointed at, and closes the shared-fixture gap
109+
kriskowal called out).
110+
111+
## Gardener message
112+
113+
`entries/2026/06/03/055906Z-message-fixer-40ac9b.md` carries the
114+
parity-test concept in enough detail for the next gardener dispatch
115+
to land the `skills/node-parity-test/SKILL.md` documentation work.
116+
It names the three-artifact shape (fixture, shared assertion module,
117+
two test files), the divergence variant, the file-naming conventions
118+
in use, and points at four worked examples on `f1a7dfb60` for the
119+
gardener to read.
120+
121+
## Judgment calls
122+
123+
- I did not extract a third parity trio for the in-process SES
124+
regression at `import-cjs.test.js` `cyclic star-export with
125+
CommonJS reexporter` (lines 690-749). Its prose explicitly states
126+
the divergence is verified by the `cycle-esm-in-cjs` parity pair,
127+
and the test itself is an in-process Compartment-API exercise with
128+
inline ModuleSources that the compartment-mapper scaffold does not
129+
reproduce (different module surface). Adding another parity pair
130+
there would duplicate the existing `cycle-esm-in-cjs` divergence
131+
evidence on a less-representative topology. Surface as a follow-up
132+
candidate if a reviewer prefers a direct in-process parity exercise
133+
rather than the cross-reference; not authorized to make that call
134+
unilaterally.
135+
136+
- I did not re-request review or add reactjis. The dispatch brief
137+
framed reactji acknowledgments as optional and did not request a
138+
review re-request; the audit comment is the primary deliverable.
139+
The orchestrator can route re-request and reactji actions through
140+
a separate per-action authorization if wanted.
141+
142+
- I did not touch the `makeVirtualModuleInstance` site for the
143+
shared-notifier refactor; the dispatch brief explicitly authorized
144+
leaving it.
145+
146+
Self-improvement: nothing this time.

0 commit comments

Comments
 (0)