installer-setup: hal0 setup --emit-answers round-trip#1120
Merged
Conversation
Add dump_answers/write_answers to hal0.install.answers as the serializer counterpart to the #1115 loader, and wire `hal0 setup --emit-answers PATH` so a resolved run (interactive-equivalent default, --auto, or --answers) snapshots its concrete choices to a hal0-setup.yaml and exits before any apply. Closes the round trip: configure once, emit the file, replay forever with --auto --answers. Never inlines a Hugging Face token (spec §8) — only huggingface.token_env. Slot capabilities the answer-file schema doesn't yet support (embed/ rerank/stt/tts/vision) are warned-and-skipped rather than emitting a file load_answers would reject. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1117
Summary
dump_answers(sel) -> dictandwrite_answers(sel, path)tosrc/hal0/install/answers.py— the serializer counterpart to theload_answersloader merged in installer-setup: answer-file core loader (hal0 setup --answers) #1115/installer-setup: answer-file core loader (hal0 setup --answers) #1119, closing the round trip described inhandoffs/hal0-setup-answers-spec-2026-07-05.md§2/§3.hal0 setup --emit-answers PATHtosrc/hal0/cli/setup_command.py: resolves aSelections(via--answers/load_answersif given, elsebuild_auto_selections(...)for--auto/default), writes it to ahal0-setup.yaml(version: 1), prints the path, and returns before any apply/slot-write/sentinel step. Added as a single early-return branch alongside the existing options, to minimize conflicts with the sibling--planPR (installer-setup: hal0 setup --plan dry-run preview #1116) touching the same callback.huggingface: {token_env: HF_TOKEN}only.embed/rerank/stt/tts/vision—load_answersonly acceptschat/codertoday) are warned-and-skipped indump_answersrather than emitting a fileload_answerswould reject.Acceptance criteria
dump_answers(sel) -> dictproduces aversion: 1mapping matching the exact key layoutload_answersreads (model_store.path,slots[],apps.*.enabled,gen.mode/gen.capabilities,npu.opt_in).write_answers(sel, path)yaml.safe_dumps the doc with a leading header comment noting the file was resolved against detected hardware.--emit-answersadded to thesetup(...)typer callback; writes the file and returns beforerun_install/apply_setupis ever reached.--auto, from--answers, and from the bare default (no TTY interactive block).dump_answers→yaml.safe_dump→load_answersreproduces an equivalentSelections(storage_dir, slot capabilities/models/device/profile, extensions, npu_opt_in, comfyui_defaults), both for a hand-builtSelectionsand forbuild_auto_selections(...)on a fake hardware profile.token_env: HF_TOKEN.--emit-answersmakes no slot/sentinel writes (run_install/apply_setupmonkeypatched to raise; not called).Test plan
🤖 Generated with Claude Code