Skip to content

refactor(config): dedup migrate idempotency checks, add shadow_sentinel step - #6194

Merged
bug-ops merged 1 commit into
mainfrom
feat/issue-5934/shadow-sentinel-migration
Jul 13, 2026
Merged

refactor(config): dedup migrate idempotency checks, add shadow_sentinel step#6194
bug-ops merged 1 commit into
mainfrom
feat/issue-5934/shadow-sentinel-migration

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Convert ~40 hand-rolled TOML section-header idempotency checks across crates/zeph-config/src/migrate/*.rs (features.rs, memory.rs, mcp.rs, tools.rs, session.rs, serve.rs, infra.rs, llm.rs) to the shared section_header_present() helper, which correctly handles inline-commented headers, implicit subtable parents, and commented-out headers — closing correctness gaps in the raw substring/line checks each step previously hand-rolled.
  • Five conversions changed observable idempotency-guard behavior (narrower, more correct header detection): migrate_goals_config, migrate_memory_graph_config (beam_search), migrate_egress_config, migrate_vigil_config, migrate_tools_compression_config — each now pinned by a regression test on the exact dotted-key/inline-table counterexample that previously suppressed injection by coincidence.
  • Add migration step 81 (migrate_shadow_sentinel_config) and a matching commented [security.shadow_sentinel] block to config/default.toml, closing the gap where this opt-in security section (already fully implemented and wired through SecurityConfig) was undocumented in default.toml and had no migration path for existing configs, unlike every other [security.*] subsection.

Closes #5934
Closes #5933

Test plan

  • cargo +nightly fmt --check clean
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings clean
  • cargo nextest run --config-file .github/nextest.toml -p zeph-config — 768/768 passed (765 baseline + 3 new regression tests)
  • RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler" clean
  • gitleaks protect --staged --no-banner --redact — 0 leaks
  • Real end-to-end migrate-config CLI run against a copy of the shipped config/default.toml (full MIGRATIONS+ConfigMigrator pipeline) — confirmed idempotent, step 81 correctly absent from the pending list since the section is already present (commented)
  • CHANGELOG.md updated under [Unreleased]
  • .local/testing/playbooks/shadow-sentinel-migration-step-81.md and .local/testing/coverage-status.md updated

@github-actions github-actions Bot added refactor Code refactoring without functional changes documentation Improvements or additions to documentation rust Rust code changes config Configuration file changes size/L Large PR (201-500 lines) labels Jul 12, 2026
@bug-ops
bug-ops force-pushed the feat/issue-5934/shadow-sentinel-migration branch from b822b52 to 0372513 Compare July 12, 2026 23:56
@bug-ops
bug-ops enabled auto-merge (squash) July 12, 2026 23:56
…el step

Convert ~40 hand-rolled TOML section-header idempotency checks across
crates/zeph-config/src/migrate/*.rs to the shared section_header_present()
helper, closing correctness gaps from raw substring matching (unanchored
matches on dotted keys, inline tables, and non-header text). Five
conversions changed observable idempotency-guard behavior; each is now
pinned by a regression test.

Add migration step 81 (migrate_shadow_sentinel_config) and the matching
commented [security.shadow_sentinel] block to config/default.toml, closing
the gap where this opt-in security section was undocumented and had no
migration path for existing configs, unlike every other [security.*]
subsection.

Closes #5934
Closes #5933
@bug-ops
bug-ops force-pushed the feat/issue-5934/shadow-sentinel-migration branch from 0372513 to e4f30d6 Compare July 13, 2026 00:01
@bug-ops
bug-ops merged commit 212843d into main Jul 13, 2026
43 checks passed
@bug-ops
bug-ops deleted the feat/issue-5934/shadow-sentinel-migration branch July 13, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration file changes documentation Improvements or additions to documentation refactor Code refactoring without functional changes rust Rust code changes size/L Large PR (201-500 lines)

Projects

None yet

1 participant