Skip to content

test: unblock the Dev Index after the catalogue carded server exports/print - #5

Merged
w0dm4n merged 1 commit into
mainfrom
fix/dev-index-tests
Oct 12, 2026
Merged

w0dm4n merged 1 commit into
mainfrom
fix/dev-index-tests

Conversation

@w0dm4n

@w0dm4n w0dm4n commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Why

The Dev Index workflow has failed on every run since 2026-10-01, and CI on main fails the same way, so the CDN index (and the MCP) stopped following the website docs. Two tests in tests/validator-013.test.ts fail. Neither is a validator or index regression.

1. the conventions table is backed by the index it is used with (line 89)

+ []
- [ 'exports', 'print' ]

open77-app b7240927 (2026-09-30, "docs: publish prediction guide and the prediction-merge Lua API") added real server _G cards for exports (LuaResourceRuntime.Exports.cs, route server:exports) and print (LuaResourceRuntime.cs, route server:print) to content/api/api.json. The guide-only fallback in src/index/conventions.ts goes dormant once a card exists, which is what it is built to do. The test hard-coded the pre-card answer.

snapshot app commit cards server _G exports/print
77e6a97 (09-28) 42dbb165 1664 none
1e2b1b6 (09-30, embedded today) a15d04db 1716 both carded
app main today 0c9e8808 1739 both carded

2. open77_api answers server:exports and server:print from the guides

The answer is now the real card, # server exports(name: string (export name, 1-64 characters), fn: function), and no longer the guide-only exports(name: string, fn: function). The test's exact header, guide pointer and guide example regexes all described the fallback rendering.

How the bad snapshot got onto main without being tested

validator-013.test.ts and index.test.ts read index/ and ignore OPEN77_INDEX_DIR. The workflow's OPEN77_INDEX_DIR=index-build npm test smoke step therefore never tested the new index. The 09-30 run passed against the old snapshot and then committed 1e2b1b6, which the tests had never seen. Every run after that failed.

What changes

  • tests/index.test.ts, tests/validator-013.test.ts: both now honour OPEN77_INDEX_DIR (as rp-animations.test.ts already did), so the Dev Index tests the index it is about to publish. CI still defaults to the embedded index/.
  • conventions test: asserts that each guide-only global is active exactly while the index has no _G card for it. It also asserts that on a copy of the index with those cards removed, both server globals come back from the guides.
  • open77_api answers server:exports and server:print, never as missing: asserts the intent on any index. That means one server answer (a card or the guides, never both, never "No native named"), client and server together for the bare name, and both listed under _G. The guide-only footnote is required only while a global is uncarded.
  • new without a server card, exports and print are answered from the guides: keeps the original strict fallback assertions on the index with the cards removed: guide signature, - catalogue: no card on this index, guide pointers, the guide section inlined, and the _G footnote.
  • src/index/conventions.ts, src/server.ts: comments only. They now say the fallback is dormant on catalogues from 2026-09-30 on. No behaviour change.

database.access enforcement and the rest of the 0.1.3 tests are untouched. Mutation checks: disabling guideOnlyGlobals fails the conventions test and the fallback test, and appending the guide answer next to a real card fails the "never both" assertion.

Verified locally

The workflows' steps were run with app content at origin/main 0c9e8808 (Node 24, Windows):

  • CI: npm run lint ✓, npm run build ✓, verify-index --dir index ✓ (19 files), npm test → 19 tests, 18 pass, 0 fail, 1 skipped (runtimeLint, needs OPEN77_TEST_SERVER_DLL)
  • Dev Index: build-index --content open77-app/content --out index-build → 1739 cards, 105 guides, 1461 sections, build 2.31.13+op77.78; verify-index --dir index-build ✓; OPEN77_INDEX_DIR=index-build npm test → 18 pass, 0 fail, 1 skipped

Not merged, not published, no workflow triggered. After merge, a manual Dev Index run (or the next daily one) publishes the current docs and refreshes the embedded snapshot.

🤖 Generated with Claude Code

…/print

Every Dev Index run since 2026-10-01 (and CI on main) failed two tests in
tests/validator-013.test.ts. Neither is a validator or index regression:

- open77-app b7240927 (2026-09-30) published real server `_G` cards for
  `exports` and `print` in content/api/api.json. The guide-only fallback in
  src/index/conventions.ts is designed to go dormant once a card exists, and
  it did; the tests still asserted the fallback's answer:
  `guideOnlyGlobals(index, "server")` deep-equal ["exports", "print"], and
  the server card header `exports(name: string, fn: function)`, now
  `exports(name: string (export name, 1-64 characters), fn: function)`.
- validator-013.test.ts and index.test.ts read `index/` unconditionally, so
  the workflow's `OPEN77_INDEX_DIR=index-build npm test` smoke step never
  saw the new index. The 09-30 run passed against the old snapshot, then
  committed an index the tests had never run against.

Changes:
- both test files honour OPEN77_INDEX_DIR, like rp-animations.test.ts, so
  the Dev Index tests the index it is about to publish;
- the conventions test asserts that each guide-only global is active
  exactly while the index has no card for it, and that both server globals
  come back from the guides on a copy of the index without those cards;
- "answers server:exports and server:print" now asserts intent on any
  index: a server answer (card or guides, never both, never "missing"),
  client + server on the bare name, both listed under _G;
- a new test keeps the original strict fallback assertions (guide
  signature, guide pointers, the guide section inlined, the footnote) on
  the index with the cards removed;
- comments in conventions.ts and server.ts say the fallback is dormant on
  catalogues from 2026-09-30 on.

database.access enforcement and the other 0.1.3 tests are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@w0dm4n
w0dm4n merged commit 39bd1f8 into main Oct 12, 2026
1 check passed
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