docs: design for sei-chain configuration manager#30
Conversation
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>
PR SummaryLow Risk Overview The doc defines an off-by-default Note for reviewers: the PR description still mentions a separate Reviewed by Cursor Bugbot for commit f00d06c. Bugbot is set up for automated code reviews on this repo. Configure here. |
- 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>
b8d11ab to
879066d
Compare
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>
What
A ≤2-page scoped design (
docs/config-manager/DESIGN.md) for a configuration manager that routesseid's config resolution through the existingsei-configlibrary, behind an off-by-default env var (SEI_CONFIG_MANAGER), with aseictl(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
seiconfigalready 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.seictl, not inseid.seidis cobra-rooted; two arg-parsers in one binary collide.seidgets only the runtime seam (pure cobra/library call); the urfave/cli v3 UX ships as theseictlbinary. (Flagged for reviewers to confirm first.)serverCtx.Config(*tmcfg.Config) andserverCtx.Viper(AppOptions) by materializing the two legacy files and re-entering the existing Viper read+merge tail — not by feedingapp.Newfrom the in-memory struct (silent key loss). All changes stay inside the sei-chain repo proper; thesei-cosmosfork is untouched.SEI_prefix collision withseid'sWithViper("SEI")is a named must-fix (collision audit = release blocker)..bak-before-write migration.validator/full/seed/archive) per owner decision;replayer/drop-seedCRD alignment deferred as a public-contract change. Modes own static role defaults only — never per-node identity, never runtime enforcement.MVP (first implementation PR)
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