Files
deepgrain-foundry/docs/agent-log.md
T
44r0n7andClaude Opus 5.5 f540c5454f Ingot molds drop bars out of the bottom on their own
Bars no longer get thrown up into the furnace, and F is no longer needed to
collect them. Blocked bars wait in the trough; the short stub stays for the
next firing; F is optional upkeep (clean, chip slag, rake).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 19:00:12 -04:00

111 lines
6.8 KiB
Markdown

# Agent log
What agents have done, newest first. Add an entry for every piece of work: the date, which
note or request it was for, what changed, the files touched, the tests run, and anything left
open or not verified. Keep each entry short; the git history has the details.
## 2026-10-23: ingots drop out of the bottom of the mold (Claude Code, with Codex)
Note: "copper bars go into the furnace. also they shouldnt require the player to press F…".
The owner confirmed the first part was a bug: the knock-out threw bars up into the furnace.
- `src/sim/molds.js`: `ejectIngot` runs from `checkMolds` (every 15 ticks). Bars spawn directly
under the mold, only where `entFreeAt` says there is room; the rest wait in the trough. Metal
is taken from the top so the short stub stays on the floor. `ingot_drop` and `ingot_blocked`
events (blocked is said once per spell via `mo.blockedSaid`, not saved). F on a ready ingot
never launches bars upward; F on an empty, short or spoiled mold still cleans and rakes.
- `src/ui/events.js`: first drop gets a card, later drops a toast; blocked gets a toast. Ingots
no longer emit `cast_ready`.
- Text: `pieces.js`, `progress.js`, `notebook.js`, `info.js`, `docs/DESIGN.md` (with the
decision), `docs/systems/stone-and-liquids.md`, `docs/PROJECT_MAP.md`.
- Tests: `t_molds` (38 checks: downward drops, stub kept, top-up, blocked and warned once,
partial drops, full entity pool, slag), `t_basics`, `t_stone`, `furnace_play.js` and
`play.py` section 6 changed to the new behaviour. All 11 headless suites, `play.py` (109) and
`t_smooth.py` (8) pass. A shot of a mold with a belt one block below shows the bars riding off.
- Open: a belt touching the mold's underside counts as blocked; bars need one open block. The
owner may want a belt directly under the mold to work.
## 2026-10-23: Shift+Q/E build tabs, G pick key removed (Claude Code, with Codex)
Notes: "add shift + q/e to move tabs" and "having the "g pick" there is confusing".
- `src/ui/build-menu.js`: `selectBuildCat(c)` (shared with tab clicks) and `cycleBuildCat(d)`;
the menu hint now reads Q/E cycle · Shift+Q/E tab.
- `src/ui/input.js`: Shift+Q/E switch tabs with the build tool; G is unbound.
- Text: build card (`selection.js`), notebook controls (`notebook.js`), `actions.js` comment,
`docs/DESIGN.md`, `docs/PROJECT_MAP.md` (regenerated, `--check` passes).
- `test/play.py`: checks for Shift+Q/E, wrapping, the remembered piece per tab, plain Q/E,
and that G no longer calls pick while middle mouse still does (109 checks).
- Tests: all 11 headless suites and `play.py` pass; a `tools/shot.py` shot of the Moving tab
shows the new hint. `t_smooth.py` passes, but its "half-resolution smooth still draws" check
failed on several runs with the 'slow' pixel fallback while the machine was busy (load ~14).
The previous commit fails the same way under the same load, so this change didn't cause it.
- Open: that check is timing-sensitive on a loaded machine; rerun it when the machine is idle.
## 2026-10-23: browser tests run locally (Claude Code, with Codex)
Request: get the browser tests, Playwright and Chromium working on the owner's Arch machine
(Python 3.14 refuses a system-wide pip install).
- Playwright 1.64.1 and its Chromium 156 (revision 1248) are in an in-repo `.venv/` made with uv.
- Added `tools/use_venv.py` and called it before Playwright imports in `tools/shot.py`,
`tools/perf.py`, `tools/playthrough.py`, `test/play.py` and `test/t_smooth.py`.
The `sys.prefix` guard prevents an exec loop if the venv lacks Playwright.
- Updated `requirements.txt`, `.gitignore`, `README.md`, `AGENTS.md`, `docs/TESTING.md`
and `docs/PROJECT_MAP.md` for Playwright 1.64.1 and venv setup.
- Checks: regenerated the project map and ran `tools/map.py --check`.
- Tests run with plain `python3`: `test/run_all.py --browser` all passed (11 headless suites,
`play.py` 101 checks, `t_smooth.py` 8 checks) on the newer Chromium; `tools/shot.py` shots
of the stone-uses scene look right in both looks. With `.venv` moved away, `play.py` exits
with the setup message instead of a traceback.
- Open: nothing.
## 2026-10-23: export from claude.ai to a local repository (Claude, in claude.ai)
Request: split the source into small files, deduplicate and tidy a little, test fully, and
write the notes, docs and agent instructions for local development.
- **Source split.**
- `core.js` (3,688 lines), `main.js` (2,012) and `render.js` (938) became 52 files in
`src/sim/`, `src/render/` and `src/ui/`, each with a header line. The build order lives in
`src/manifest.json`.
- Checked that the joined code was identical to before, apart from comments and blank lines.
- Every headless suite gave the same output, line for line, before and after.
- Screenshots of two scenes, in both looks, were pixel-identical before and after
(`tools/shot.py --freeze`).
- **Tidying, behaviour unchanged.**
- One scan loop in `simMove` instead of two mirrored copies.
- A `drawHazardRims` helper replaced 3 copies.
- The belt and filter shader code shares `beltLineSD`, `bandRidge` and `bandColor`.
- Removed unused `refundCost`, `wakeArea`, `brushFor`, and the `PARTS` / `PART_BY_ID` aliases.
- The suites share `suite()` (check / done) from the harness, and failures now set the exit
code.
- **Tests.**
- Six broken old scripts were deleted; they used functions removed long ago.
- Experiments and reports moved to `tools/experiments/`.
- `t_v2` / `t_v4` / `t_v9` were renamed `t_basics` / `t_world` / `t_conveyors`.
- Added `test/run_all.py`.
- **Tools.**
- `tools/shot.py`: repeatable screenshots of a scene set up in JavaScript.
- `tools/where.py`: maps built-page line numbers back to source files.
- `tools/map.py`: the project map's index.
- `tools/scenes/`: example scenes.
- The game skips cursor previews when `GAME.hidePreviews` is set, for clean screenshots.
- **World files outside claude.ai.**
- Pause → Export world file only worked inside claude.ai, through its downloads hook.
- It now falls back to an ordinary browser download (`exportWorld` in `src/ui/saves.js`).
- `test/play.py` checks that an exported file downloads and imports back on the title screen
as the same world.
- **Build.** `build.py` writes `dist/index.html` (a full page), `dist/deepgrain-foundry.html`
(the same without the document wrapper, as the claude.ai artifact used) and
`dist/bundle-lines.json`.
- **Docs.** `AGENTS.md`, `CLAUDE.md`, `README.md`, `NOTES.md`, `docs/PROJECT_MAP.md`,
`docs/DESIGN.md`, `docs/TESTING.md`, `docs/systems/*`, `docs/history/requests.md`.
- **Tests run.** All 11 headless suites pass, as do `test/play.py` (101 checks) and
`test/t_smooth.py` (8 checks).
- **Open.**
- The owner reports that big piles on belts still only move at the top (NOTES.md); not yet
reproduced.
- The game's last claude.ai artifact was version 24.