Repository navigation
test: unblock the Dev Index after the catalogue carded server exports/print - #5
Merged
Merged
Conversation
…/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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The Dev Index workflow has failed on every run since 2026-10-01, and CI on
mainfails the same way, so the CDN index (and the MCP) stopped following the website docs. Two tests intests/validator-013.test.tsfail. Neither is a validator or index regression.1.
the conventions table is backed by the index it is used with(line 89)open77-app
b7240927(2026-09-30, "docs: publish prediction guide and the prediction-merge Lua API") added real server_Gcards forexports(LuaResourceRuntime.Exports.cs, routeserver:exports) andprint(LuaResourceRuntime.cs, routeserver:print) tocontent/api/api.json. The guide-only fallback insrc/index/conventions.tsgoes dormant once a card exists, which is what it is built to do. The test hard-coded the pre-card answer._Gexports/print77e6a97(09-28)42dbb1651e2b1b6(09-30, embedded today)a15d04dbmaintoday0c9e88082.
open77_api answers server:exports and server:print from the guidesThe answer is now the real card,
# server exports(name: string (export name, 1-64 characters), fn: function), and no longer the guide-onlyexports(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.tsandindex.test.tsreadindex/and ignoreOPEN77_INDEX_DIR. The workflow'sOPEN77_INDEX_DIR=index-build npm testsmoke step therefore never tested the new index. The 09-30 run passed against the old snapshot and then committed1e2b1b6, which the tests had never seen. Every run after that failed.What changes
tests/index.test.ts,tests/validator-013.test.ts: both now honourOPEN77_INDEX_DIR(asrp-animations.test.tsalready did), so the Dev Index tests the index it is about to publish. CI still defaults to the embeddedindex/._Gcard 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.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_Gfootnote.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.accessenforcement and the rest of the 0.1.3 tests are untouched. Mutation checks: disablingguideOnlyGlobalsfails 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/main0c9e8808(Node 24, Windows):npm run lint✓,npm run build✓,verify-index --dir index✓ (19 files),npm test→ 19 tests, 18 pass, 0 fail, 1 skipped (runtimeLint, needsOPEN77_TEST_SERVER_DLL)build-index --content open77-app/content --out index-build→ 1739 cards, 105 guides, 1461 sections, build2.31.13+op77.78;verify-index --dir index-build✓;OPEN77_INDEX_DIR=index-build npm test→ 18 pass, 0 fail, 1 skippedNot 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