The padding loop made the fixture 65,538 bytes, past the read limit, so set()
refused while reading and the test passed without the output-size check. The
fixture is now exactly MAX_FILE_BYTES - 4 bytes; with the check removed the
test fails.
- text handed to Flags::from_parts gets the same size limit as a file
- the file is read once, at most one byte past the limit
- a file named by CRAFT_FLAGS_FILE that does not exist is reported
- set() holds a lock file beside the flags file from read to write, so two
programs changing flags at once keep both changes
- set() keeps a comment after the flag it changes
- set() refuses to write a file larger than the reader accepts
Refs #1118
craft-flags keeps one per-user file, ArtCraft/flags.toml beside the AI
layer's ArtCraft/ai, that the launcher and every app read; CRAFT_FLAGS
overrides it for one run. Every flag is off by default. The first two:
AI-MCP (AI agents through MCP) and AI-MODELS (AI models and services).
Loading never fails: a missing or damaged file means defaults, with the
reason in Flags::problems. set() changes one flag atomically and keeps
everything else in the file, and never overwrites a file it can't read.
In the browser every flag is at its default.
Closes#1118
---------
Co-authored-by: David Mann <daaavid.mann@gmail.com>