Commit Graph
3 Commits
Author SHA1 Message Date
David Mann 4a3bb60b82 test(flags): the oversized-write fixture is readable, so the test reaches the output-size check
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.
2026-11-12 17:07:23 +01:00
David Mann 88864de95f fix(flags): the review findings on craft-flags (#1119)
- 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
2026-11-12 16:52:07 +01:00
David Mann 86d6e8c5b0 feat(flags): shared feature flags for the Craft apps and the launcher
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>
2026-11-12 10:05:07 -05:00