mirror of
https://github.com/bitbaum/printcraft.git
synced 2026-12-04 22:19:24 +01:00
`generate scene` printed a red "✗ Failed" and exited 0. `generate all-scenes` printed "0/2 scenes generated successfully" and exited 0. The generator was never at fault — it detects the rate limit, sets `error` and returns `success=False` correctly. The CLI took that report and threw it away at the process boundary, so every wrapper, `&&` chain, cron job and scrolled-past terminal read a half-finished round as a finished one. That is how round 010 of the Duschwand lost `chain_vv_van` and `chain_teal_kd` to a rate limit in April and sat unfinished for five months: 8 prompts, 7 outputs on disk, exit 0. This is the same defect class the web app has been swept for across #36–#47 — a failure that reports itself as success — found at the CLI boundary of the pipeline that actually produces the client deliverable. Both commands now exit 1 when any scene fails, and `all-scenes` names which ones. `--only-missing` re-runs just the scenes with no output, so recovering from a rate limit no longer means regenerating (and overwriting) the images that worked. The output filename pattern now has one definition — `output_path()` in grok.py, used both by `generate()` which writes the file and by the caller asking whether it already exists, so "is this scene done?" cannot drift from what is actually written. Also corrected the module docstring, which advertised a `generate mural` command that does not exist; the command is `all-scenes`. The Python half of this repo had no tests and no CI at all, which is why a bug this plain survived: `tests/` is new, with 6 tests over the fixed behaviour and a fake generator so no browser or network is touched. CI gets a "Python pipeline tests" step. Deliberately NOT folded into `pnpm run verify` — that gate has to work from a bare `pnpm install`, and pytest needs a Python env — so it is a separate, explicitly documented gate rather than a silent gap; `package.json`'s comment field and the CI step both say so. Verified: 6/6 new pytest pass; each half of the fix mutation-verified (dropping the scene exit, the round exit, or the --only-missing filter each fails a different named test). Root `pnpm run verify` still exits 0 (format + lint 0 errors/8 pre-existing warnings + tsc + 101 JS tests). Reproduced the original defect first — the same harness printed EXIT CODE: 0 before and prints EXIT CODE: 1 after. `printcraft project list-scenes` still loads the real duschwand-roli project. Does NOT retro-fix round 010: those prompts are `chain_*`, ad-hoc names that do not match project.yaml scene ids, so that round was not produced by `all-scenes` and cannot be resumed by it. Finishing it is still manual work. Claude-Session: https://claude.ai/code/session_01SZGjXtzLGk2q9zPUkA3vMf Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
29 lines
573 B
TOML
29 lines
573 B
TOML
[build-system]
|
|
requires = ["setuptools>=64", "wheel"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[project]
|
|
name = "printcraft"
|
|
version = "0.1.0"
|
|
description = "Custom artwork generation for physical print surfaces"
|
|
requires-python = ">=3.11"
|
|
dependencies = [
|
|
"playwright>=1.40",
|
|
"pyyaml>=6.0",
|
|
"pillow>=10.0",
|
|
"typer>=0.12",
|
|
"rich>=13.0",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
dev = ["pytest>=8"]
|
|
|
|
[project.scripts]
|
|
printcraft = "printcraft.cli:app"
|
|
|
|
[tool.setuptools.packages.find]
|
|
include = ["printcraft*"]
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|