Map site feed/game/admin code
Transcript
Thinking18:17:30
I'll start by exploring the repository structure.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && ls && ls renderer server rendere...18:17:30Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && ls && ls renderer server rendere...Grepgame_host|site_unlock_begin|site_unlock_posts|site_unlock_status18:17:30Output not recorded
game_host|site_unlock_begin|site_unlock_posts|site_unlock_statusBashcd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && wc -l REDESIGN.md PLAN....18:17:30Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && wc -l REDESIGN.md PLAN....Grep^#+ .*18:17:30Output not recorded
^#+ .*ReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\REDESIGN.md18:17:30Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\REDESIGN.mdReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\REDESIGN.md18:17:30Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\REDESIGN.mdThinking18:17:45
Let me check front.lua and the main.lua settings related to front mode.
Grepsettings\.front|front_set_mode|FRONT\.mode|'vertical'|\"vertical\"|settings\.vertical|BOOK_VERTICAL|book_vertical18:17:45Output not recorded
settings\.front|front_set_mode|FRONT\.mode|'vertical'|\"vertical\"|settings\.vertical|BOOK_VERTICAL|book_verticalReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\main.lua18:17:45Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\main.luaReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\main.lua18:17:45Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\main.luaReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\front.lua18:17:45Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\front.luaThinking18:17:52
I should check other spots where view mode matters, like how phones get forced into vertical layout and whether FRONT.mode == 'book' affects show_home separately from phone handling. I'll grep for site_set_vertical and BK.feed references in book.lua to trace this.
Grepsite_set_vertical|front_list_on|vertical18:17:52Output not recorded
site_set_vertical|front_list_on|verticalThinking18:17:56
I'm wondering whether the phone forces vertical book mode via the same feed path, and whether setting FRONT.mode to list would also give mobile a list view—need to check main.lua around lines 1300-1340 and book.lua around 130-160 to confirm.
ReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\book.lua18:17:56Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\book.luaReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\main.lua18:17:56Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\main.luaThinking18:18:02
I'm checking where the phone references the front mode list default, and locating the Aa popover in the settings UI code. I also want to grep for any debug hooks or env variables related to front settings that might affect this behavior.
Grepfront=|a327ex_settings|vertical18:18:02Output not recorded
front=|a327ex_settings|verticalGrepsite_debug\.|FRONT\.mode|front = '18:18:02Output not recorded
site_debug\.|FRONT\.mode|front = 'Thinking18:18:08
I should check whether the book layout is used anywhere else besides the front door, like in a phone or stories/collections context, so I'm going to search for where book_draw is called in main.
ReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\REDESIGN.md18:18:08Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\REDESIGN.mdGrepbook_draw|book_invalidate|view == 'home'18:18:08Output not recorded
book_draw|book_invalidate|view == 'home'Thinking18:18:13
I see that the view logic checks whether it's home mode combined with the prose treatment flag to decide book-mode behavior. Next I need to look at the remaining files: game_host.lua, the unlock scripts, games server logic, the pack_games tool, and the build/deploy scripts along with the games README.
ReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\unlock.lua18:18:14Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\unlock.luaReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\games\README.md18:18:14Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\games\README.mdReadC:\Users\a327e\Desktop\a327ex\a327ex-site\server\unlock.lua18:18:14Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\server\unlock.luaThinking18:18:21
I notice that beating a game grants a posts-only token, so I want to trace how game_host.lua and GAME_DEFS unlock posts through the animation, and check where lich-survivors shows up by grepping for "lich" in the renderer.
GrepGAME_DEFS18:18:22Output not recorded
GAME_DEFSBashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && grep -rIl -i "lich" --include=* ...18:18:22Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && grep -rIl -i "lich" --include=* ...Thinking18:18:40
I notice renderer/artifacts.lua references lich, so I want to check game_host.lua's head section, the GAME_DEFS, and other key parts.
ReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\game_host.lua18:18:41Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\game_host.luaGrep(?i)lich18:18:41Output not recorded
(?i)lichThinking18:18:46
There's no GAME_DEFS entry for lich-survivors yet, though the unlock plumbing and server GAMES list already reference it. I should check REDESIGN.md and the gated logs for mentions of "lich," "egg," "unlock," "hiatus," and game_host to see how the site's hosting of lich-survivors is described.
Grep(?i)lich|egg|unlock|hiatus|final hiatus|#56018:18:46Output not recorded
(?i)lich|egg|unlock|hiatus|final hiatus|#560Thinking18:18:50
I should also check PLAN.md and the Anchor workflow docs, and grep through the gated Lich Survivors files for mentions of "game_host" to see how it discusses its hosting plan.
Grepgame_host|site_unlock|unlock|hiatus return|on the site18:18:50Output not recorded
game_host|site_unlock|unlock|hiatus return|on the siteThinking18:18:56
I should check the game directory for a RECORD.md with the plan, but the main task is about the site, so I'll keep focus there. I'm digging into game_host.lua to understand start_instance, game_view_draw, how games get discovered on the "game" view page, and fullscreen game page handling.
I also want to grep for "Type: prototype" in posts to see existing game items and how they render, and look at posts tagged `::game`.
Grep^::game|^Type: (prototype|game)|Fullscreen:18:18:56Output not recorded
^::game|^Type: (prototype|game)|Fullscreen:Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && ls posts | wc -l; ls posts | tai...18:18:56Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && ls posts | wc -l; ls posts | tai...Thinking18:19:02
I should check an example post to see how front matter uses ::game, then search more broadly across posts/ since it might not be at the start of a line.
Grep::game18:19:02Output not recorded
::gameBashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && ls gated/posts | head -20; ls ga...18:19:02Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && ls gated/posts | head -20; ls ga...Thinking18:19:10
I count 10 gated posts out of 277 total, and I'm trying to track down which ones reference games -- my grep for "::game" in the pages didn't turn up anything, so I'll try a plain grep instead since the glob pattern might not be matching properly.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && grep -rln "^::game" posts gated ...18:19:11Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && grep -rln "^::game" posts gated ...Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && head -20 posts/skyland.md; echo ...18:19:11Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && head -20 posts/skyland.md; echo ...Thinking18:19:18
The gated posts only show 10 items while ids go up to 596, with the last public post apparently being #560. I need to check how feed items get ordered and merged in the server feed logic to find where #560 fits in.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && grep -rl "^Id: 560$" posts gated...18:19:19Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && grep -rl "^Id: 560$" posts gated...Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && cat posts/2026-09-19-023441.md; ...18:19:19Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && cat posts/2026-09-19-023441.md; ...Thinking18:19:26
I'm confirming the gated posts range (ids 566-596) and now checking how front.lua merges and sorts the gated entries with the main index, looking at the gated fetch logic in main.lua.
GrepGATED_SCOPE|site_gated_fetch|gated_merge|function merge_gated|__gated|sort_index|table\.sort\(index|index-posts18:19:26Output not recorded
GATED_SCOPE|site_gated_fetch|gated_merge|function merge_gated|__gated|sort_index|table\.sort\(index|index-postsReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\main.lua18:19:26Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\main.luaReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\main.lua18:19:26Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\main.luaThinking18:19:39
I realize the feed order is sorted by date string descending, not by id, so for the game item to appear right after #560, its date needs to fall just after 2026-09-19 02:34:41 — meaning chronologically later, which places it higher in the newest-first list, just above #560.
But I need to check whether any public logs are dated between the game's placement and #560, and also verify what ids are already used across gated items and logs so I can mint a unique id for the new game entry.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && for d in posts gated/posts logs ...18:19:40Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && for d in posts gated/posts logs ...Thinking18:19:51
I'm noticing the ids seem to be shared across posts and logs under a single unified numbering scheme, with gated logs reaching up into the 620+ range. I want to find the overall max id and locate where "next_id" is defined, so I'll search for that reference.
Grepnext_id18:19:53Output not recorded
next_idBashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && grep -h -m1 "^Id: " gated/*.md g...18:19:53Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && grep -h -m1 "^Id: " gated/*.md g...Thinking18:20:05
I'm trying to figure out the most recent dates across the public posts and logs directories to determine what's actually the latest content.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && for f in posts/*.md logs/*.md st...18:21:29Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && for f in posts/*.md logs/*.md st...Thinking18:21:36
I'm confirming that #560 is the newest public entry, so a game dated right after that timestamp but before the next gated one would sort just above it in the list. IDs don't affect ordering since dates control that, so I need to check how the row display and gating logic actually work.
I'm looking at how front.lua draws each row, specifically checking `e.gated` for the gold lock icon, and then tracing how convert.lua writes index entries from the `Id:` field, including cases where no Id is present. I want to find where convert.lua builds the index section so I can see the exact field ordering.
Grepgated|table\.sort|hidden_from_public|admin_only|Visibility|Status:18:21:36Output not recorded
gated|table\.sort|hidden_from_public|admin_only|Visibility|Status:Thinking18:21:40
I should check whether there's an admin-only mechanism involved, so I'm searching api.lua for admin-related identifiers like "compose_is_admin" or "adminToken" to see how admin privileges are handled.
Grepcompose_is_admin|adminToken|x000xx.xxxxx|X000XX.XXXXX|is_admin|require_admin18:21:40Output not recorded
compose_is_admin|adminToken|x000xx.xxxxx|X000XX.XXXXX|is_admin|require_adminThinking18:21:43
That brace glob path seems overly complex, so I'll simplify by just using Grep filtered to Lua files without the glob pattern.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && grep -rnE "compose_is_admin|admi...18:21:43Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && grep -rnE "compose_is_admin|admi...ReadC:\Users\a327e\Desktop\a327ex\a327ex-site\server\api.lua18:21:43Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\server\api.luaReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\compose.lua18:21:43Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\compose.luaReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\compose.lua18:21:43Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\compose.luaThinking18:21:56
I'm realizing the "admin" flag is just a client-side localStorage token that's purely cosmetic, while real protection comes server-side via the X-Admin-Token header checked against the configured read/write tokens. I want to check the /admin/setup route in server.lua and search for how admin pages are actually guarded.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && grep -n -i "admin" server/server...18:21:56Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && grep -n -i "admin" server/server...Thinking18:21:59
This config file might be outdated—I should check the actual live nginx config at deploy/nginx-a327ex-engine.conf instead, looking for the gated and auth_request directives there.
ReadC:\Users\a327e\Desktop\a327ex\a327ex-site\server\server.lua18:22:00Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\server\server.luaBashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && grep -n -i "admin\|gate\|auth_re...18:22:00Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && grep -n -i "admin\|gate\|auth_re...Thinking18:22:08
I'm trying to figure out how admin status actually gets verified—the client-side check just looks for a non-empty token, which is purely cosmetic, while the server checks X-Admin-Token separately. Since the gate's auth_request only distinguishes viewer from reader with no admin scope, I need to read through gate.lua fully to understand how admin-only content could be served.
ReadC:\Users\a327e\Desktop\a327ex\a327ex-site\server\gate.lua18:22:08Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\server\gate.luaThinking18:22:13
I'm checking how admin status is determined—there's no server-side admin check, just a client-side localStorage flag and a desktop env variable, and I want to see how the admin board view in main.lua uses this.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && sed -n 1,80p renderer/tools/depl...18:22:14Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && sed -n 1,80p renderer/tools/depl...Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && sed -n 235,250p server/server.lu...18:22:14Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && sed -n 235,250p server/server.lu...Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && sed -n 80,438p renderer/tools/de...18:22:14Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && sed -n 80,438p renderer/tools/de...Thinking18:22:23
I'm checking deploy.sh to see how the games/ package mirrors to /data/games/<game> with lazy assets, and want to look at build-web.sh and pack_games.py to understand how games get bundled versus lazily loaded, plus how deploy makes the renderer bundle public immediately via engine-boot.js.
A GAME_DEFS entry would land in that public bundle, exposing the game name—which conflicts with REDESIGN §17's rule that gated project names shouldn't appear in any hand-written table. Also, since /data/ is served publicly, the game's files under /data/games/lich-survivors/ would be exposed too, so admin-only access needs either a gated data tree or a hidden path—worth checking build-web.sh and pack_games.py for this.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n -i "game\|prelo...18:22:23Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n -i "game\|prelo...Thinking18:22:30
I realize the games directory is served publicly by nginx, so putting the game package under renderer/games/ would expose the Lua source to anyone — conflicting with the requirement that nothing playable or readable leaks. I should check the lich-survivors directory for how the Anchor port handles this.
Bashcd /c/Users/a327e/Desktop/a327ex/lich-survivors && ls; ls port 2>/dev/null | hea...18:22:30Output not recorded
cd /c/Users/a327e/Desktop/a327ex/lich-survivors && ls; ls port 2>/dev/null | hea...Bashcd /c/Users/a327e/Desktop/a327ex/lich-survivors && sed -n 2100,2150p RECORD.md |...18:22:30Output not recorded
cd /c/Users/a327e/Desktop/a327ex/lich-survivors && sed -n 2100,2150p RECORD.md |...Thinking18:22:41
I like that the transition fades everything to the site's background color so only the egg remains, which keeps continuity smooth. The shipping details check out too: the browser build runs at 60 fps during the fight and ~46 fps in the ending, weighs about 29 MB gzipped, and boots in roughly 6.5 seconds, with 4.6 of those seconds spent on shader compilation.
Now I'm wondering whether game_host hosts games using the site's own wasm engine, since the lich game needs specific gpu_ API features — does the live site's Anchor3 wasm actually contain them? I should check what §32 says about Lich Survivors 6's shader warm-up around line 2230, so let me read lines 2209-2260 for details on the replay player cards and shader compile behavior.
ReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\REDESIGN.md18:22:41Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\REDESIGN.mdReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\REDESIGN.md18:22:41Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\REDESIGN.mdThinking18:22:47
I'm checking whether the replay cards run in a separate engine instance via iframes, then looking at other preview query flags like ?perf and ?nolowlat in engine-boot.js and main.lua, and digging into how site changes get tested privately per REDESIGN.md sections 8-9 and serve-web.py.
ReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\REDESIGN.md18:22:47Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\REDESIGN.mdReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\REDESIGN.md18:22:47Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\REDESIGN.mdThinking18:22:52
I'm noticing the theme gate mechanism checks for admin status through `pageviews_admin()`, so I want to trace how admin device detection works in the client Lua code, including related checks like `X000XX.XXXXX` in main.lua.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n "pageviews_admi...18:22:52Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n "pageviews_admi...Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n "location.searc...18:22:52Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n "location.searc...Thinking18:22:58
I'm noticing that "admin" status here is just a client-side flag — either a nonempty store key or a boot-param token set via localStorage — with no actual server-side verification, so it's suitable for hiding UI content but not for real security.
For true secrecy of gated files, I need enforcement at the server layer, like checking an X-Admin-Token header in nginx or wherever requests are proxied. I'm checking whether `web_http_get` actually sends that token as a header, so I'll search engine-boot for how it's wired up.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n "X-Admin-Token\...18:22:58Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n "X-Admin-Token\...Thinking18:23:13
I'm thinking through the owner's identity here—they have both the viewer cookie and admin tokens on their browser, so distinguishing "admin only" visibility from gated viewers matters: the client-side admin check is just cosmetic gating, and the underlying data files would still be public unless actually protected server-side.
Checking nginx's auth_request setup, the gate handler only validates cookie scope, not any admin token, so a browser fetch for lazy-loaded data files wouldn't carry an admin header anyway since that fetch happens through the engine's JS, not something header-controllable. I'm considering whether viewer identity itself (matching a specific name like the owner's) could serve as the admin check instead, though I can't verify the actual viewer names without VPS access—and I'm also noting other existing admin-adjacent mechanisms like drafts, unlisted pages, and vault for comparison.
There's no built-in server-side "admin-only" item type—gated content is still visible to any valid viewer, and public data paths like /data/games/ expose package files to anyone with the link regardless of listing status. The real solution would need a client-side filter: flag specific index entries as admin-only during serialization, then have entries() skip them unless admin() returns true, while being careful that package files under /data/games/ remain technically fetchable even if hidden from the listing.
ReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\game_host.lua18:23:13Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\game_host.luaThinking18:23:22
I'm trying to figure out whether the Anchor build in the browser is a separate compiled wasm package or part of the site's own engine, since both games seem to share the same Lua VM and canvas rather than running in iframes.
The owner's plan to fade the background out so only the egg remains, upload the game for admin-only viewing, and run a final unlocking animation all point toward an in-canvas setup. I want to check ANCHOR_PORT.md for any notes on hosting to confirm this.
Bashcd /c/Users/a327e/Desktop/a327ex/lich-survivors && grep -n -i "host\|iframe\|sit...18:23:22Output not recorded
cd /c/Users/a327e/Desktop/a327ex/lich-survivors && grep -n -i "host\|iframe\|sit...Bashcd /c/Users/a327e/Desktop/a327ex/lich-survivors && sed -n 100,140p ANCHOR_PORT.m...18:23:22Output not recorded
cd /c/Users/a327e/Desktop/a327ex/lich-survivors && sed -n 100,140p ANCHOR_PORT.m...Thinking18:23:28
I'm thinking the live site's wasm engine build needs a deploy step to host the lich game in game_host, since the game relies on gpu_ calls that game_host may not shadow or composite properly. I want to grep game_host for its handling of gpu_ calls before proceeding.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n "game_view_draw...18:23:28Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n "game_view_draw...Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n "gpu_\|layer3" ...18:23:28Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n "gpu_\|layer3" ...Thinking18:23:32
I notice there's an existing "letter-drop" feature in main.lua around line 3448 that looks like letter physics animation. I should check if this is relevant to per-glyph letter rendering for question 5.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n -i "letter.drop...18:23:33Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n -i "letter.drop...ReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\main.lua18:23:33Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\main.luaReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\elements.lua18:23:33Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\elements.luaThinking18:23:39
The letter-drop mechanism looks like a useful precedent since it already captures on-screen glyph positions. I want to check how that capture mode works in main.lua, specifically looking for the capture function names and the rotated centered-glyph drawing binding.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n "glyph" main.lu...18:23:39Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n "glyph" main.lu...ReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\main.lua18:23:39Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\main.luaReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\main.lua18:23:39Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\main.luaReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\main.lua18:23:39Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\main.luaThinking18:23:50
This is exactly what I need: an engine glyph capture mechanism that records every glyph drawn in a frame (codepoint, font, color, position, size), paired with a function to draw individual glyphs with rotation and scaling centered at a point. This gives me the per-glyph final positions I need, limited to what's actually visible on screen.
For off-screen elements, I'll need to look at how text layout stores token positions in each line's items array, including per-word x-coordinates and font metrics for measuring prefix widths to get glyph-level positions. I want to check the text drawing code around lines 740-900 in elements.lua to see exactly how the draw call works—whether it renders whole word strings at once or goes glyph-by-glyph using font width measurements.
ReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\elements.lua18:23:50Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\elements.luaThinking18:23:58
I'm mapping out how each line item stores its word, font, position, and color, and how screen coordinates get computed from document coordinates plus scroll offset, with per-glyph positions derived from cumulative text widths.
Now I want to trace which Lua files actually handle layout and drawing — likely canvas.lua for the front list's details/rows, and elements.lua for the text layout logic around layout_text_element, including how fonts (Arial-based, with CJK/emoji fallback) resolve glyph widths and paths. I should look at the start of layout_text_element to understand the token/line item structure it builds.
Grep^function layout_text_element|^local function (tokenize|wrap|push_word|flush_line)|items\[#items \+ 1\]|^function (font_for|role_of)|local function role_of18:23:58Output not recorded
^function layout_text_element|^local function (tokenize|wrap|push_word|flush_line)|items\[#items \+ 1\]|^function (font_for|role_of)|local function role_ofReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\elements.lua18:23:58Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\elements.luaThinking18:24:07
I'm looking at how the glyph capture engine binding grabs per-glyph screen coordinates from visible text during rendering, but realizing the posts I need for the unlock animation are inside closed detail rows that have no rendered text to capture yet.
The gated posts get merged into the list as new closed rows, so their titles likely exist as text I could compute positions for using `el._lines`, or I could just open the posts and capture glyphs directly. I want to check how `front_draw_row` renders row titles via the fallback text layout in canvas.lua, so I'm grepping for that function now.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n "front_draw_row...18:24:07Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n "front_draw_row...ReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\front.lua18:24:07Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\front.luaThinking18:24:15
I'm checking how game entries appear in the feed list, looking at the type field used in convert.lua and reviewing existing hosted game examples like anchor3-playground, kimi-k3-playground, knightvspawns, and skyland to see how the row title and full-bleed game strip render.
Now I need to trace the server-side flow: whether the game page requires "Fullscreen: yes" in pages config, pointing to doc.game_page and the 'game' view. I also want to check how the crawler-facing HTML renders `::game` blocks, so I'm grepping server/extensions.lua for game-related handling.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && grep -n -i "game" server/extensi...18:24:16Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && grep -n -i "game" server/extensi...Thinking18:24:23
I'm checking games.lua for the scoreboard validator, then looking at the "Type:" field on posts and how drafts work—confirming that the drafts directory holds local content that doesn't get posted to the site.
Now I want to verify the local preview workflow using build-web.sh and serve-web.py, checking whether serve-web.py proxies /api calls to production or gates admin tokens, and also want to look at run.bat and env vars like X000XX.XXXXX and A327EX_BOOT_PATH to see how the desktop build handles admin access.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && sed -n 1,60p tools/serv...18:24:23Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && sed -n 1,60p tools/serv...Thinking18:24:31
I'm realizing the local dev server doesn't actually enforce admin auth properly—setting a localStorage flag can fake admin status, and since the server maps all data files directly, including gated ones, auth checks are effectively bypassed locally.
For the deploy question, I'm piecing together how deploy.sh and the post-receive hook work: pushing to prod checks out the bundle into the live tree and restarts, with the render directory serving both the staging (new.a327ex.com) and, after cutover, the production site. I want to check the nginx configs and README's deploy section to confirm whether staging is still a separate host and what branch options post-receive supports.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && sed -n 1,60p deploy/nginx-new-a3...18:24:31Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && sed -n 1,60p deploy/nginx-new-a3...Thinking18:24:35
Staging seems retired now, so there's no staging environment to worry about. I should check the README's deploy section to understand the actual deploy flow when pushing to prod main.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && sed -n 95,150p README.md | cut -...18:24:35Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && sed -n 95,150p README.md | cut -...Thinking18:24:41
I notice unlock.lua doesn't name the game directly, so I'm flagging that as a concern tied to the GAME_DEFS entry. I'm also checking the gated-posts path in compose.lua for a visibility flag, since there's no explicit "Visibility:" front matter — I need to search frontmatter.lua or content.lua for a hidden-post indicator.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && grep -n -i "draft\|hidden\|Statu...18:24:41Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && grep -n -i "draft\|hidden\|Statu...ReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\tools\convert.lua18:24:41Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\tools\convert.luaThinking18:24:55
I'm checking how the index is sorted and warns about duplicate ids, then tracing whether bootdata limits included posts. I'm also looking at how `entries()` in front.lua classifies posts into front_kind categories like 'games' based on their Type field.
For question 4, I'm figuring out what date a new item needs to land directly after #560 for all viewers, including gated ones — it needs a timestamp strictly between #560 and #561's dates, like 02:34:42, since sorting is just string comparison on the date field. I'm also checking what id the new item would need, since 561 is already taken, so it'd need something like 621 or risk showing as unnumbered in the list.
Earlier I saw duplicate ids 619/620 in the sorted output, which is a hazard for id minting — I should pin down exactly which items share id 620.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && grep -l "^Id: 620$" gated/*.md g...18:24:55Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && grep -l "^Id: 620$" gated/*.md g...Thinking18:24:59
There's a minor duplicate ID issue between hydancer-10 and snkrx-update-11, though probably not worth dwelling on. I want to check how feed.py mints new IDs around lines 270-300 to briefly describe that process.
Bashsed -n 270,320p /c/Users/a327e/Desktop/a327ex/Anchor/workflow/lib/feed.py | cut ...18:24:59Output not recorded
sed -n 270,320p /c/Users/a327e/Desktop/a327ex/Anchor/workflow/lib/feed.py | cut ...Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && cat gated/posts/this-reality-mus...18:24:59Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && cat gated/posts/this-reality-mus...Thinking18:25:06
Now tracing how a game actually gets packaged and deployed: sync scripts generate renderer/games/<name>/, build-web.sh runs pack_games.py to mirror everything into data/games/<name>/ plus a manifest.lua, and deploy.sh keeps syncing data/games/** on every deploy, with nginx serving it from /data/.
I want to check sync_skyland.sh's structure for the pattern, and confirm whether renderer/games/ is tracked in git or ignored, and whether data/ itself is gitignored — let me check .gitignore.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && cat .gitignore | head -30; sed -...18:25:07Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && cat .gitignore | head -30; sed -...Thinking18:25:16
For the second question, I'm checking whether any game has actually been hosted this way yet—and yes, several have: anchor3-playground, kimi-k3-playground, knightvspawns, skyland, fire-demo inline examples, and the steam chart demos, all embedded via the `::game` syntax in posts. Lich Survivors itself hasn't been hosted yet though.
Now I'm digging into whether game_host's sandbox can actually support the Lich game's engine. It only shadows layer_create, layer3_create, and layer_draw functions, but a full `gpu_*` pipeline—with its own render targets, post-processing passes, and full-screen compositing—isn't handled by the host at all, since the host only composites queued draws. This feels like a gap worth flagging.
Bashcd /c/Users/a327e/Desktop/a327ex/lich-survivors && grep -n "layer_draw\|gpu_pres...18:25:17Output not recorded
cd /c/Users/a327e/Desktop/a327ex/lich-survivors && grep -n "layer_draw\|gpu_pres...Thinking18:25:22
This seems like a standard rendering layer path, so it should be compatible with game_host's composite queueing, and the shared GL context means I don't need to dig deeper into those engine calls. With Q7 coverage settled across the referenced sections, I move on to checking the owner's plan notes about uploading the game.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n -i "unlock\|lic...18:25:23Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n -i "unlock\|lic...Thinking18:25:36
I'm figuring out the cleanest way to hide the book/vertical options without deleting the underlying code: gating the FRONTS segmented control in the settings popover behind a flag so it only shows "List" (or nothing), and forcing the settings loader to normalize the front value so the hidden options can't be selected accidentally.
I also want a single choke point to be safe — clamping `front_set_mode` so that if book mode is ever set, it falls back to list unless an explicit allow-flag is set, which covers both the UI hiding and any stale `book`/`vertical` values left in localStorage from prior sessions. Then I'm double-checking that phone layouts fall through correctly to list mode by default, since book mode previously forced a vertical layout path on mobile.
I should confirm book.lua stays loaded since the gated-row lock drawing still depends on `book_draw_lock`, so it can't be dropped from the bundle even if book mode becomes inaccessible from the UI. Persistence-wise, the only place the mode leaks in is the localStorage settings string and possibly a desktop settings file, with no URL param involved.
For admin verification, since the client only checks a locally-stored non-empty token while real enforcement happens server-side, I want to see whether there's an authenticated endpoint like the admin health check that could let the client actually confirm admin status cryptographically rather than just trusting a stored string.
ReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\health.lua18:25:36Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\health.luaBashcd /c/Users/a327e/Desktop/a327ex/a327ex-site && grep -n "api/compose\|write_toke...18:25:36Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site && grep -n "api/compose\|write_toke...Thinking18:25:57
I need to figure out where to stage the game's files so only admins can see them, since the gate mechanism only covers the `/data/gated/` and `/media/gated/` paths. I could place the package under `data/gated/games/lich-survivors/` and then add an access rule limiting it to the admin identity specifically.
A crucial wrinkle: the gated/posts path gets crawled by the machine-facing content listing, meaning anything placed there gets published to RSS, sitemap, and llms feeds immediately — so that location can't be used for admin-only content without leaking it publicly. I'd need either a client-side injection gated by an admin check, or a genuinely separate gated path that bypasses the public index and crawler entirely.
I also rule out `unlisted/` since those slugs are still fetchable by anyone who knows the URL — fine for obscurity, not for real access control. Then I'm tracing through `server/unlock.lua` and the client's unlock logic to see how an existing admin/viewer gets `scope='full'` without any token being minted, just a direct response flag that the client reads to flip local state.
For the egg animation, I'm mapping out how the gated posts (newer rows above the game in the list) get merged and redrawn: the unlock triggers `site_gated_fetch`, which merges data and calls `site_front_refresh` to rebuild rows, and I'd hook the animation into `poll_gated_index`/`gated_merged_hook` plus the front's height-easing draw cycle so rows appear "held" until the letters finish flying up. I also confirm the gold lock icon logic (`e.gated`) draws correctly per-row regardless of unlock state, and I'm starting to think through how the public feed's `index` ordering and numbering should work for `data/in`...
Now I'm checking how the index and gated entries get sorted and merged — index.lua loads sorted by date descending at boot, gated entries get string-compared by date and merged in, and front.lua just preserves that order without re-sorting, so the front door always shows newest-first with visible row ids. I'm also noting that archive/privacy pages and games get excluded from this ordering, and shifting to Q5 about fonts — theme.lua forces Arial via `TYPEFACES` and `settings.typeface`, loaded through font_load from the assets bundle, so I want to grep theme.lua for the specific font-mapping details.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n "TYPEFACES\|^fu...18:25:57Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n "TYPEFACES\|^fu...Bashcd /c/Users/a327e/Desktop/a327ex/Anchor/engine/engine/src && sed -n 4340,4365p a...18:25:57Output not recorded
cd /c/Users/a327e/Desktop/a327ex/Anchor/engine/engine/src && sed -n 4340,4365p a...Thinking18:26:08
I'm checking whether glyph capture works on the live wasm build, then verifying a few more details: the canvas layout for front rows, where unlock_update gets called in main.lua, and the front_click snapshot analytics—these all look fine.
Now I'm figuring out how a game-type item gets defined: frontmatter like `Type: game` maps to front_kind 'games', giving it a chip and pill labeled "game", and `Fullscreen: yes` turns the post's page into an actual game view. I want to confirm how the `::game <name>` content line gets parsed—whether the name must match GAME_DEFS or falls back to a labeled box—and whether such an item needs a real posts file or could be client-injected, so I'm going to look at the relevant mdparse segment.
ReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\mdparse.lua18:26:08Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\mdparse.luaReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\elements.lua18:26:08Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\elements.luaThinking18:27:45
That confirms the instance-start behavior matches the activation hooks. I also need to check the drawing order — the game composite layers over the UI, so anything flying across the screen would need to render after that composite. I should also verify whether book mode ties into the "hiatus book" reference anywhere.
Checking a few more spots: front.lua's show filters look fine, the tagpage.lua list rows are unaffected, and vertical settings for mobile aren't triggered since list mode takes over on phones.
Now for previewing site changes privately — locally there's run.bat for desktop builds, though admin features require the web build since desktop's compose_is_admin check always returns false. For local web testing, I'd build with the web build script and serve it locally, proxying API calls to production.
I'm also noting that the local web setup exposes all of data/ including gated content with no real auth, and localStorage tricks could fake admin UI access on localhost — but any compose writes would fail against production since the token wouldn't be valid, and cookie behavior through the proxy is uncertain. For true verification there's the headless anchor drive tool using site_debug helpers against the desktop engine. Finally, deployment goes through tools/deploy.sh with various flags controlling content fetch, data sync, and engine updates.
Beyond that, pushing to prod triggers an immediate post-receive hook that updates gated posts, public posts, server files, RSS, sitemap, and crawler HTML right away, plus media is served directly from the working tree via nginx — and the live bundle does have its own cache layer to consider.
There's no admin-only deploy flag, so shipping renderer code visible only to admins has to be gated in code, like `compose_is_admin()` or `pageviews_admin()`. There's precedent for this: the theme gate used an admin token before but now just returns true unconditionally — I want to pull up that section of main.lua to cite it properly.
ReadC:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\main.lua18:27:46Output not recorded
C:\Users\a327e\Desktop\a327ex\a327ex-site\renderer\main.luaBashcd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n "unlock_update\...18:27:46Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n "unlock_update\...Thinking18:28:00
There's precedent for admin-gated in-work features, so I think I have enough on that front. I'm also checking the game_host error/started state and the chip filter logic, but those seem fine to ignore for now—worth noting that the admin's own browser also carries the owner's viewer cookie, which could matter for Q3.
Since I don't know the specific viewer names, I'll state that as unknown, and note that the server-side unlock check already includes the game regardless of public visibility, while the start endpoint is public but rate-limited and requires a valid run record. For admin testing, I should flag that gated posts already appear merged in the admin's view, so the reveal animation would need a way to suppress or hold them beforehand to properly test as a non-privileged viewer. Now I'm pulling together the specific line numbers I'll cite in the report, covering the settings fields, save/load logic, apply function, and UI row in main.lua, plus the front.lua references.
I'm continuing to gather line references across front.lua, book.lua, game_host.lua, unlock.lua, gate.lua, compose.lua, health.lua, pageviews.lua, api.lua, server.lua, convert.lua, and elements.lua to make sure the report cites exact locations for the settings flags, admin checks, gated scope handling, sorting logic, and layout/draw functions.
I also want to verify the deploy.sh flag parsing lines and check serve-web.py, so I'm double-checking the loop that handles command-line arguments in deploy.sh to confirm the right line numbers before citing them.
Bashcd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n -- "--content) ...18:28:00Output not recorded
cd /c/Users/a327e/Desktop/a327ex/a327ex-site/renderer && grep -n -- "--content) ...Read-only research complete: nothing run, edited or opened in a browser. All paths are under C:\Users\a327e\Desktop\a327ex\a327ex-site\ (renderer\, server\, gated\, and so on). The design record is renderer\REDESIGN.md.
1. Feed view modes
Where they are defined. There are three modes: list, book (the carousel) and vertical (the book in one scrolled column).
renderer\main.lua:1866-1869declaressettings.frontand the legacysettings.vertical.renderer\front.lua:36-37holdsFRONT.mode, which is only'list'or'book'.renderer\front.lua:102-108front_set_mode(m)is the single placeFRONT.modechanges. It also callssite_set_vertical, which setsVERTICALatrenderer\book.lua:142-151.renderer\main.lua:1321show_homebuilds the list only whenfront_list_on()is true. Otherwise the wholeview=='home'book path runs.
How the visitor switches. The settings popover has a "Front door" row with a List | Book | Vertical segmented control at main.lua:2178-2194. Clicking sets settings.front and settings.vertical and flags settings_dirty. settings_apply then calls front_set_mode(settings.front) at main.lua:1992, and show_home(true, true) re-shows the front door at main.lua:1994.
Persistence.
- localStorage key
a327ex_settingsstoresfront="list|book|vertical"andvertical=.... It is written bysettings_saveatmain.lua:1884-1897and read back atmain.lua:1898-1944. - On desktop it is the gitignored
renderer\settings.lua. - There is no URL flag. The filter chips use a separate key,
a327ex_front_show.
Smallest clean disable (code kept).
- Add a constant such as
FRONT_BOOK_OK = false. - Clamp in
settings_loadatmain.lua:1932-1933, so a browser that savedbookorverticalgoes back tolist. Without this those browsers stay in the book. - Clamp in
front_set_mode, for exampleif not FRONT_BOOK_OK then m = 'list' end. This is the one choke point. - Skip drawing the "Front door" row at
main.lua:2182-2194. - Keep
book.lualoaded. The list still usesbook_draw_lock(called atfront.lua:433) andbook_invalidate(main.lua:1879). - Phones now take the list path too.
2. Games on the site
Architecture. A game runs inside the site's own Lua VM and canvas. It is not an iframe and not a separate engine instance. renderer\game_host.lua:1-39 describes the sandbox: a private env, shadowed layer_create, layer3_create and layer_draw, and input gated by hover. The game's layers are composited into ui_layer at the element rect. One full game is live at a time. Games start on click and pause when scrolled away. The README is renderer\games\README.md.
Packaging and deploy.
- A sync script copies the dev project into the generated, never-hand-edited
renderer\games\<name>\(templatestools\sync_skyland.shandtools\sync_knightvspawns.sh). - Add a
GAME_DEFSentry ingame_host.lua:43-89:{dir, w, h, pixel?, chips}. tools\build-web.shrunstools\pack_games.py, which mirrors the package torenderer\data\games\<name>\and writes amanifest.lua.- Every
deploy.shrun syncsfontsandgamesby content hash (deploy.sh:396-398). - On the web,
game_host.lua:409-433fetchesdata/games/<name>/file by file. - nginx
location /data/serves those files publicly. Anyrenderer\games\<name>\main.luais therefore fetchable by anyone who knows the URL.
Feed item type for a game. A post file with Type: prototype or Type: game and a ::game <name> line (parsed at mdparse.lua:412). Optional Fullscreen: yes makes its own page a full-window game page. Skyland is the template: posts\skyland.md has Id: 431, Type: prototype, Fullscreen: yes.
How it appears in the list.
front.lua:53-58front_kindfilesprototypeandgameunder the "games" chip.front.lua:232starts game entries open.front.lua:165-175andfront.lua:100-draw them frameless, at the window's full width, with a "game" pill.
Already hosted. All four are public posts.
anchor3-playground(posts\2026-07-07-204709.md)kimi-k3-playground(#410)knightvspawns(#427)skyland(#431)
fire-demo-1 to 3 and the steam-* chart demos are inline "small" embeds.
Lich Survivors is not hosted. There is no renderer\games\lich-survivors, no GAME_DEFS entry and no site_unlock_* call in the game's port\*.lua. lich-survivors\RECORD.md:2253-2256 says so.
The unlock plumbing is built and idle.
- Client
renderer\unlock.luaofferssite_unlock_begin(game),site_unlock_posts(game, run),site_unlock_status(game)andsite_posts_unlocked(). These are visible to games through the sandbox's_Gfallthrough. unlock_updateis polled atmain.lua:3581.- Server
server\unlock.lua:31-39allow-listslich-survivors:min_secs = 60, checkrun.ending=='egg' and powers==0. The endpoints arePOST /api/unlock/startand/api/unlock/finish. - On a win, the client sets
localStorage a327ex_gated = 'posts'and callssite_gated_fetch(scope). The gated posts merge live, with no reload (unlock.lua:100-107). - A viewer who wins gets
{ok, scope='full'}and no new token (server\unlock.lua:175).
Open technical risks for hosting Lich.
game_host.luashadowslayer_create,layer3_createandlayer_drawonly. It does not shadow the game'sgpu_*API.- The port's
RECORD.md:2243-2245lists "hosting" as open (about 29 MB gzipped, about 6.5 s boot, shader compile). - The live wasm may need
deploy.sh --engine. That rebuilds fromAnchor\engine\engine, andgames\README.mdwarns that a bundle deployed against an older engine can desync. - The game has a
game.begin()walk-in hook meant to fire when the play window takes focus (RECORD.md:2143). - The game already fades everything except the egg to the site background
#111111(RECORD.mdround 62).
3. Admin versus viewer
Admin.
- Admin is purely a device-held token.
/admin/setup(server\server.lua:692-709, scriptstatic\admin-setup.js) stores a read token in localStoragex000xx.xxxxxand a write token inx000xx.xxxxx.xxxxx. engine-boot.js:372andengine-boot.js:399expose the read token asweb_boot_param('adminToken').- Client checks:
compose_is_admin()(compose.lua:1488-1494) is true ifx000xx.xxxxxis any non-empty string.front.lua:141uses it to show the "+ New post" row.pageviews_admin()(pageviews.lua:91) is another client check.
- Server enforcement exists only for API calls:
require_admin(server\api.lua:419) compares theX-Admin-Tokenheader against the configured read token, and compose uses the write token (api.lua:793-802). - So the client "is admin" test is cosmetic. Only an authenticated API call proves it.
health.lua:51is a working example.
Viewer (gated).
server\gate.luais the nginxauth_requesttarget for/data/gated/and/media/gated/(nginx confdeploy\nginx-a327ex-engine.conf:139-215).- The cookie
a327ex_gateholds a token fromdata/viewers.lua("full") orreaders.tsv("posts") (gate.lua:111-118). - Nothing in the gate or nginx knows about "admin". The owner is presumably also a viewer.
Is there an existing admin-only item mechanism? No. There is no draft or hidden front-matter flag.
drafts\is local-only.unlisted\pages are reachable by anyone with the URL.gated\posts\is worse than it looks. Since §29 (REDESIGN.md:2138) every item ingated\posts\is live for machines (RSS, sitemap, llms zip, crawler homepage HTML,/raw/posts/), and its media is public. An admin-only game must not be put there, or inposts\.
Realistic ways to show it only to the admin.
- Add a client-injected index row, as
site_add_gated_entry(e)does atmain.lua:1432-1442, called only ifcompose_is_admin(). Precedent: the Reading theme gate,REDESIGN.md:207-215. - The game's files stay publicly fetchable unless a gate rule is added, for example a
gate.luabranch for a/data/gated/games/...path restricted to a specific viewer name or token. A fetch from the engine carries cookies only, not headers. - Even if the public bundle code is hidden behind
compose_is_admin(), the code andGAME_DEFSkey are public (§17 warns against naming gated projects in public tables).
4. Feed order and ids
Ordering and merging.
- Order is by the
Datestring, newest first, not byId. renderer\tools\convert.lua:1157sorts bydate_key.- The client's gated merge (
poll_gated_index,main.lua:1370-1417) appends rows then re-sorts by raw date string (main.lua:1396, also1437). It runs on the unlock, a boot with the cookie, andsite_gated_fetch. - A reader gets
data/gated/index-posts.lua, whichconvert.lua:1190-1198writes beside the full gated index. front.lua:144-154takes entries in index order, so there is no re-sort in the list.
Ids.
- Ids are per feed item, shared by posts and logs. They come from the front-matter
Id:(convert.lua:1114). - They are minted as max+1 (
Anchor\workflow\lib\feed.py:282next_id), and the server can mint too. - The max is currently 620, and
convert.lua:1161warns on duplicates. - Ids are not used for ordering.
"Right after #560" for everyone.
- #560 is
posts\2026-09-19-023441.md, dated2026-09-19 02:34:41. It is the newest public entry. - The first gated item is #561, dated
2026-09-19 12:29:57. - Give the game a
Datebetween those two, such as2026-09-19 02:34:42. It then sorts directly above #560 and below every gated item, for the public, readers and viewers alike. The newer gated posts and logs would build above it. - Give it a fresh unique
Id.
5. Text rendering of posts
Layout.
renderer\elements.lua:320layout_text_elementsplits text into tokens atelements.lua:389-456. Word tokens carry{text, font, color, o, n, url}.- It wraps them into
el._lines(elements.lua:472), with lines shaped{items, height, ascent, y, w, brk, o0}and each token carryingx. - Layout is cached by a memo key at
elements.lua:371-378. - Draw is
draw_text_element(elements.lua:667). Each word is drawn with onelayer_text(layer, tk.text, tk.font, el.x + tk.x, el.y + line.y + dy + oy, col)call (elements.lua:786). - So per-glyph positions are not stored. Per-line and per-word positions are exact in document space (
oyis -scroll), and glyph x can be derived fromfont:text_width(prefix). - The face is Arial only (
main.lua:1927,theme.lua:322TYPEFACES). CJK, Hangul and symbol fallback fonts load lazily.
Rows.
- List row titles (date,
#id, title) are drawn infront.lua:388-457. The title goes throughdraw_text_fallback(elements.lua:2104, cached byfb_layoutat2076). - An open post's body is the
detailselement'schildren, laid out bycanvas.luathroughfront_row_prep(canvas.lua:515, draw at778-785).
Exact per-glyph machinery already exists.
main.lua:2501-2860is the "#drop" letter-drop effect.engine_glyph_capture(true)makes the engine record every glyph the draw emits, as{cp, font, x, y, w, h, color}.engine_glyph_capture_read()returns them. Seemain.lua:4854-4856and5204-5208, andAnchor\engine\engine\src\anchor.c:4346and9615.layer_draw_glyph_c(h, cp, font, cx, cy, angle, sx, sy, color)draws a glyph centered and rotated (main.lua:2827).- Limits: capture covers only what is drawn on screen that frame, and glyph capture is capped at 8192 per frame.
6. Testing privately
- There is no staging.
new.a327ex.comis retired (README.md:184). - Desktop:
renderer\run.batand headlessanchor drivewithsite_debug.*(main.lua:2289+).compose_is_admin()is false on desktop because it needsweb_store_get. - Local web:
bash renderer/tools/build-web.shthenpython renderer/tools/serve-web.py 8000. It serves all ofdata/including gated trees with no auth and proxies/api/*to production. Set localStoragex000xx.xxxxxto any string to see admin UI. Unlock and compose calls would hit the live server. ?perfis a debug readout only.
deploy.sh flags (deploy.sh:46-52): --content, --fetch, --engine, --data, --allow-dirty, and the LAZY_ASSETS environment variable. It refuses uncommitted renderer code.
What goes public immediately.
- Any deploy flips
engine-boot.jsto the new hashed bundle (deploy.sh:421-). All renderer Lua becomes the live public code, includingGAME_DEFS. - It also syncs
data/games/**anddata/fonts/**on every run. git push prod maintakes effect after the VPS smoke test (deploy\post-receive). Content underposts\,gated\posts\,media\andserver\goes live at once.- Hiding the feature therefore has to be done in code, behind
compose_is_admin().
7. What the records already say
REDESIGN.md:1568-1579(§17) covers the hiatus switch and the rule against gated names in public tables.REDESIGN.md:2040-2079(§26) records the posts-unlock design.REDESIGN.md:2173-2174(§30) records the fix that moved the unlock request ids to 95000+.lich-survivors\RECORD.md:4andRECORD.md:2253-2256describe the hook and its gaps.gated\lich-survivors-11.md:59has the owner's plan: sounds, then "uploading the game to the website (admin view only)", then the unlocking animation.gated\lich-survivors-1.md:12records the original premise: the game appears publicly after the goodbye post, and a correct ending unlocks the gated posts.
Nothing in the redesign record mentions the egg break, the letter-flow animation, or disabling the book and vertical modes.