Skip to content

fix: reject invalid saved policy without resetting defaults - #705

Open
guangyu-reflexio wants to merge 5 commits into
mainfrom
team/config-stored-policy-validation
Open

guangyu-reflexio wants to merge 5 commits into
mainfrom
team/config-stored-policy-validation

Conversation

@guangyu-reflexio

@guangyu-reflexio guangyu-reflexio commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

An invalid recognized saved setting can currently be caught by a config loader and replaced by defaults, losing unrelated retention holds or storage routing. Reject the invalid saved policy through one shared error family, including validation during legacy conversion. This retires zero configuration knobs. It is a prerequisite for safely restoring/redesigning previously fixed housekeeping settings.

Changes

  • Add StoredConfigurationError as the parent of existing ConfigurationMigrationError types.
  • Convert persisted-schema Pydantic errors, including legacy normalization, to value-free errors naming only affected top-level settings; suppress the original traceback context.
  • Local-file loading and CLI storage discovery propagate this family. API writes keep ordinary Pydantic validation.
  • Preserve removed-field read compatibility and absent-field defaults. Missing-file, unreadable JSON/decryption and legacy-disk behavior remain separate existing contracts.

Dependencies

Stacked on #704 (which depends on #703). Incremental diff: team/config-discovery-timing-correction...team/config-stored-policy-validation. Merge parents first.

Test Plan

  • Standalone OSS storage model/local-file scope: 51 passed. Real file correction/save/reload preserves retention holds; invalid reads and CLI discovery preserve file bytes and reject fallback.
  • Cross-repository focused gate: 108 passed; post-normalization compatibility gate: 120 passed. Earlier broader guard/import scope: 164 passed.
  • Explicit Pyright for all changed Python files and Ruff lint/format passed. Privacy regressions check supplied values, dynamic map keys and formatted tracebacks.
  • Replacing the typed error with generic ValueError fails all ten local-file/adapter regressions; source restored exactly.
  • Independent local correctness/verification reviews: no remaining findings. Automatic current-head Codex P0/P1 and normal installed-artifact CI remain required. No production configuration changed.

Codex P1 diagnostic-key collision fixed: reporting only authoritative top-level settings excludes nested map identifiers even when they match declared properties (enabled, model, db_url, similarity_threshold). Reinstating the initial formatter fails all five privacy regressions; corrected source restored. Latest-head review/CI qualification is pending.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 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-10-17T23:15:42.942651Z 1900c5a New commits
🔒 Security Review ✅ Completed 2026-10-17T23:06:22.492864Z 6963097 PR opened
ℹ️ 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.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 15 billable files and costs up to $3.75.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 19 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: ReflexioAI/reflexio/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: beff4669-af83-4d2b-b700-ec203c25eca6
📥 Commits

Reviewing files that changed from the base of the PR and between fea811c and 1900c5a.

📒 Files selected for processing: 15
  • .env.example
  • developer.md
  • reflexio/cli/bootstrap_config.py
  • reflexio/config_migration.py
  • reflexio/durable_learning_policy.py
  • reflexio/models/config_schema.py
  • reflexio/server/services/configurator/base_configurator.py
  • reflexio/server/services/configurator/local_file_config_storage.py
  • reflexio/server/services/durable_learning/scheduler.py
  • tests/conftest.py
  • tests/models/test_extraction_geometry.py
  • tests/models/test_storage_config_union.py
  • tests/server/services/configurator/test_config_storage_contract.py
  • tests/server/services/durable_learning/test_scheduler.py
  • tests/test_durable_learning_policy.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@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: 6963097b7f

ℹ️ 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 reflexio/models/config_schema.py Outdated
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