Repository navigation
3.x.x: check unread PRISM settings on the serve path (#461 S-A) - #462
Merged
Merged
Conversation
The retired inventory was taken from the Python runtime at 3e233d2, but the 2.x.x line continued to e76234a and added one more runtime-read name, PRISM_CANDIDATE_ORPHAN_TERMINAL_CONFIRMATIONS, the predecessor of native PRISM_CANDIDATE_ORPHAN_CONFIRMATIONS. Without it the name could be presented as live guidance again, and the cutover inventory would claim a completeness it does not have. Record both inventory commits in the header so the next audit knows where the sweep stopped. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Only check-config called config::check_environment(); Command::Run went straight to Config::from_env(). A deploy that skips the preflight could therefore start a native frontend silently on a 2.x.x environment, where every leftover PRISM_* name is inert and the operator has no signal that the settings they set are doing nothing. Run the same check first, in the same order check-config uses, so production refuses to start and lab mode warns before any listener binds. The check reads the process environment the runtime itself reads and reuses config::production_mode(), so there is no second reader and no separate notion of production. The diagnostic names each offending variable and never its value. Co-Authored-By: Claude Fable 5.1 <[email protected]>
The serve-path tests proved the diagnostic appeared but not that it came first or that it stopped the process. Moving check_environment() after Config::from_env() left every test green, and turning the production bail into a warning also left them green, because the fixture's unreachable node made `run` exit non-zero either way. Give the production test a known setting the parser rejects and assert its error is absent, so the parse can only be reached once the unread names are gone; assert the node's transport failure is absent too, so the refusal is the whole failure rather than one line before a later exit. The lab test now asserts that same transport failure is present, which is the positive proof that a warning let startup continue. The dead listener, port and elapsed-time scaffolding is gone: server::run contacts the node before binding stratum, so none of it observed anything. Correct the guidance while it is being rewritten. check-config does not validate every setting group; the public reader's database settings belong to check-public-database-config. Scope the paragraph to the coordinator serve path, which is the only command this change touches. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This was referenced Sep 18, 2026
Closed
25 of 40 tasks
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.
Part of #461 (S-A). Target
3.x.x, base pin587aef59.What
qbit-prism-serverwith no subcommand (Command::Run) now callsconfig::check_environment()beforeConfig::from_env()— the same unread-PRISM_*checkcheck-configalready performs: refuse in production mode naming every unread variable (values never printed), warn in lab mode. A deploy that skipscheck-configno longer starts silently on a 2.x.x environment (crates/qbit-prism-server/src/tools.rs).No allow-list was added: under every Compose overlay combination, every
PRISM_*name that reaches a container runningqbit-prism-serveris already innative-settings.txt(the four non-nativePRISM_POSTGRES_*names reach only the replica entrypoint).retired-settings.txtis refreshed from 2.x.xe76234aa(+PRISM_CANDIDATE_ORPHAN_TERMINAL_CONFIRMATIONS, the pre-#420 name ofPRISM_CANDIDATE_ORPHAN_CONFIRMATIONS); header records both inventory commits.docs/prism-configuration.mddocuments the serve-path behaviour and keepscheck-configas the preflight.Corrects #288's "retired-settings warning, deferred P3":
check-confighad it; only the serve path lacked it.Tests (
crates/qbit-prism-server/tests/config_cli.rs)unread_environment_stops_the_serve_path_in_production— real binary, production mode, unread names plus a deliberately malformed known boolean: the unread diagnostic is the whole failure; the boolean parse error and the fixture's RPC transport error never appear (pins the ordering beforeConfig::from_envand before any node contact).unread_environment_only_warns_on_the_lab_serve_path— warning printed, then startup continues to the fixture's unreachable node.retired_inventory_covers_the_final_python_runtime_name— inventory entry and C-sort.Mutation checks (applied and restored): removing the call → 2 tests fail; moving it after
from_env→ production test fails;bail!→eprintln!→ production test + existing check-config test fail; dropping the retired name → inventory test fails.Gates:
cargo fmt --all --check,cargo clippy --locked --workspace --all-targets -- -D warnings,check_gate_env_reads.py,check_prism_settings.py,check_toolchain_pin.py,config_cli(21),capacity::bound_configuration_uses_only_native_runtime_settings,tests.test_check_prism_settings— all pass.Not covered
public-api,migrate,import-audits,backfill-ctvand the other subcommands still skip the check (unchanged scope). No Compose-level test proves a real 2.x.x overlay is refused end to end.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.