Skip to content

v3.0.0 fix: harden native PRISM configuration and containers - #361

Merged
Anatolie merged 3 commits into
3.x.xfrom
harden-native-config
Sep 14, 2026
Merged

Anatolie merged 3 commits into
3.x.xfrom
harden-native-config

Conversation

@Anatolie

@Anatolie Anatolie commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Native capacity evidence previously required retired Python settings, while configuration validation silently accepted obsolete names and malformed API values. This updates evidence to qbit-prism-capacity-evidence/v3 with native worker, connection, and job-builder budgets; check-config now lists every unsupported PRISM_* name and rejects them in production.

import-audits resolves PRISM_AUDIT_DIR when --root is absent, API settings use strict startup parsing, and health publication follows PRISM_HEALTH_REFRESH_SECONDS. The optional operator bearer token protects the operator listener and its healthcheck; the independent public service never opens operator credentials.

Implements decision D4 with mounted signing-seed files, a non-root image (UID/GID 10001), an image healthcheck, zero core limits, and Linux process dumpability disabled before credentials load. Database-only migrate/import/backfill commands need no signing seeds. Production Compose and operator preflight require a secrets directory, and CI rejects retired settings in operator guidance.

Compatibility: v1/v2 capacity artifacts must be regenerated. Production operators must provision the documented read-only secret mount and stop passing signing seeds as environment values. Key rotation rehearsal remains #291.

Validation:

  • Rust workspace tests, focused API/config/capacity/auth/health tests, formatting, and workspace Clippy.
  • Disposable PostgreSQL: seedless migration, audit import, CTV backfill, and database-backed API compatibility tests.
  • Full Python suite: 422 tests, with two ckpool-binary tests skipped. Settings-inventory guard, production/HA Compose, preflight, and lifecycle checks pass.
  • Runtime image smoke: non-root execution, core limits, public API health, mounted-token readability, and seedless migration.

The full node/PostgreSQL integration gate and Linux dumpability unit test run in CI. The local image smoke exercises the public service; the coordinator probe is covered by CLI/auth tests and its failure without a listener, without starting qbitd locally.

Closes #288.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-14T19:55:33.554240Z 3e3a2b1 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9ff6c334e9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qbit-prism-server/src/server.rs Resolved
@Anatolie
Anatolie force-pushed the harden-native-config branch from 5167520 to 9470fb6 Compare September 14, 2026 19:35

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9470fb662a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qbit-prism-server/src/server.rs Resolved
@Anatolie
Anatolie merged commit f2cc6ee into 3.x.x Sep 14, 2026
16 checks passed
kiwidream added a commit that referenced this pull request Sep 14, 2026
… keys

Merging the current `3.x.x` brings #361, which bumps the artifact schema
to v3, moves `PRISM_SHARE_COMMIT_BATCH_SIZE`,
`PRISM_SHARE_COMMIT_LINGER_MILLISECONDS` and
`PRISM_STRATUM_VARDIFF_IDLE_SWEEP_SECONDS` out of `CONFIGURATION_KEYS`
into `RETIRED_CONFIGURATION_KEYS`, and adds four keys the harness already
sets. Evidence that names a retired key is now refused outright, as not
having measured the native binary.

Neither branch could see this: each was green alone, and the collision
only exists in the merge. It surfaced as one failing assertion, because
the harness takes `CONFIGURATION_KEYS` and `SCHEMA` from that module
rather than copying them, so the schema string and most of the key list
followed on their own.

What was left to do is the part that was hard-coded. The harness no
longer sets the three retired keys on a frontend and no longer records
them; the side report lists them under `retired_configuration_keys`
instead of `unread_configuration_keys`. Startup only warns about an
unread `PRISM_*` outside production mode, so setting them was never fatal
-- it was just untrue by v3's account.

Under v2 the honest answer was to carry those keys with the values the
frontends really used and annotate them as unread (#288), because nobody
had ruled on them. The server has now ruled, so the honest answer is to
leave them out. The three per-field notes are replaced by one note saying
that, and the README says which release changed the answer and why.

The test asserted the keys were present. It now asserts they are absent
from both the frontend environment and the configuration block, which is
what v3 requires.

Part of #271
kiwidream added a commit that referenced this pull request Sep 14, 2026
#361 added `scripts/check_prism_settings.py`, which refuses any mention of
a retired `PRISM_*` setting in operator guidance unless the line carries a
`<!-- retired-setting: NAME -->` marker. The previous commit rewrote this
README passage to explain that the three keys are retired, and naming them
in prose is exactly what the guard is there to catch: a reader skimming
for a setting name cannot tell an explanation from a recommendation.

Carry the markers and name the settings in words instead. The guard passes
and the passage still says which keys it means.

Found by CI, not locally: the guard is a step of the lint job rather than
part of the Rust or Python suites, so a green `cargo test` says nothing
about it.

Part of #271
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant