Skip to content

docs: design for sei-chain configuration manager#30

Open
bdchatham wants to merge 5 commits into
mainfrom
design/config-manager
Open

docs: design for sei-chain configuration manager#30
bdchatham wants to merge 5 commits into
mainfrom
design/config-manager

Conversation

@bdchatham
Copy link
Copy Markdown
Collaborator

What

A ≤2-page scoped design (docs/config-manager/DESIGN.md) for a configuration manager that routes seid's config resolution through the existing sei-config library, behind an off-by-default env var (SEI_CONFIG_MANAGER), with a seictl (urfave/cli v3) management surface and a schema-versioning contract.

This PR ships the design only. Implementation lands as separate PRs across three repos (sei-config / sei-chain / seictl).

Key decisions captured

  • The library is the asset; the risk is the seam. seiconfig already implements the unified struct, modes, Validate(), the env→file registry, the (empty) migration registry, and legacy round-trip IO. Nothing calls it yet. The MVP de-risks the seam into seid + round-trip fidelity against real config files.
  • urfave/cli v3 lives in seictl, not in seid. seid is cobra-rooted; two arg-parsers in one binary collide. seid gets only the runtime seam (pure cobra/library call); the urfave/cli v3 UX ships as the seictl binary. (Flagged for reviewers to confirm first.)
  • The seam contract is load-bearing: the gated path must populate both serverCtx.Config (*tmcfg.Config) and serverCtx.Viper (AppOptions) by materializing the two legacy files and re-entering the existing Viper read+merge tail — not by feeding app.New from the in-memory struct (silent key loss). All changes stay inside the sei-chain repo proper; the sei-cosmos fork is untouched.
  • SEI_ prefix collision with seid's WithViper("SEI") is a named must-fix (collision audit = release blocker).
  • No auto-migrate on boot; explicit, dry-run-default, .bak-before-write migration.
  • Modes kept at the prototype's four (validator/full/seed/archive) per owner decision; replayer/drop-seed CRD alignment deferred as a public-contract change. Modes own static role defaults only — never per-node identity, never runtime enforcement.

MVP (first implementation PR)

A real seid home directory resolves through the library and produces a node that behaves identically to the legacy path, behind an off-by-default flag.

In: gate + seam (both channels), collision audit, a fidelity test against a sanitized real config.toml/app.toml, KNOWN_UNMAPPED_FIELDS. Everything else (CLI, sei.toml, migration functions, K8s render-at-init) deferred with explicit un-defer triggers.

Sign-off

Reviewed and signed off across four lenses: seam/integration (product-engineer — APPROVE), operational/deployment (platform-engineer — APPROVE), modes↔node-types (kubernetes-specialist — APPROVE), scope/YAGNI (product-manager — APPROVE). Two nits raised and resolved in the doc.

🤖 Generated with Claude Code

Scoped design for an env-var-gated configuration manager that routes
seid config resolution through the existing sei-config library, plus a
seictl (urfave/cli v3) management surface and a schema-versioning
contract. Spans three repos (sei-config / sei-chain / seictl); this PR
ships the design only. Implementation follows as separate PRs.

Signed off by the seam (product-engineer), operational (platform-engineer),
modes (kubernetes-specialist), and scope (product-manager) reviews.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cursor
Copy link
Copy Markdown

cursor Bot commented Jun 3, 2026

PR Summary

Low Risk
Documentation-only; no executable or config-loading behavior changes until follow-up implementation PRs.

Overview
Adds docs/config-manager/DESIGN.md, a scoped design for routing seid config through the existing sei-config library with no runtime code changes in this PR.

The doc defines an off-by-default SEI_CONFIG_MANAGER gate (v2 vs legacy), a load-bearing seam in PersistentPreRunE that must populate both serverCtx.Config and serverCtx.Viper by materializing legacy config.toml/app.toml and reusing the current Viper merge path (not feeding app.New from the unified struct), plus a SEI_* collision audit as a release blocker. It commits to in-binary seid config … (urfave/cli v3 under a cobra DisableFlagParsing delegate, with config skipping config interception like init), explicit migration (no auto-migrate on boot), mode defaults vs identity keys, MVP fidelity testing, and deferred Phase 3 / CLI / K8s work with un-defer triggers.

Note for reviewers: the PR description still mentions a separate seictl binary; the added design rejects that in favor of seid config ….

Reviewed by Cursor Bugbot for commit f00d06c. Bugbot is set up for automated code reviews on this repo. Configure here.

bdchatham and others added 2 commits June 3, 2026 13:47
- sei-config stays an imported dependency of sei-chain (drop standalone
  seictl framing); CLI surface moves in-binary as a `seid config ...`
  group on urfave/cli v3, with cobra coexistence flagged for review
- add "Future: fold-in" note — sei-config may later collapse into the
  sei-chain tree; seam contract is unchanged, so it's reversible
- move replayer / seed / CRD-alignment to Appendix A, out of core scope

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- seam: `seid config` subtree must skip PersistentPreRunE like `init`
  (else inspecting config triggers interception / recursive gated seam);
  add the DisableFlagParsing→urfave delegation pattern; note urfave v2
  already in tree (v3 = second major version, accepted) + completion gap
- CLI must ship a deterministic exit-code scheme for initContainer/Job
- Appendix A: migration registry keys on version, not mode strings — a
  migration function rewrites cfg.Mode; only `generate --mode` is the door
- dedup the urfave decision to the single Decision callout

Cross-reviewed (round 2) and signed off across seam (product-engineer),
ops (platform-engineer), modes (kubernetes-specialist), scope (product-manager).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bdchatham bdchatham force-pushed the design/config-manager branch from b8d11ab to 879066d Compare June 3, 2026 11:52
bdchatham and others added 2 commits June 3, 2026 14:32
Pure compression, no semantic change from the round-2-signed-off version:
- move the cobra↔urfave delegation pattern + accepted costs to Appendix B
- collapse Non-goals to one line; tighten every core paragraph
- core drops 1512 -> 1142 words; seam contract, collision audit, the
  PersistentPreRunE guard, MVP, and versioning all kept in-body

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Framing change only (technical contract unchanged):
- drop the "seictl is the urfave/cli entry point" framing entirely; seid
  is the single binary and single consumer
- center the seam as seid selecting its configuration manager via an
  experimental env var/config (legacy default vs sei-config-backed)
- Future (deferred): may fold sei-config into seid; sei-k8s-controller
  may consolidate to drive config through seid as the single authority

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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