Skip to content

feat(config): store config defaults and provide sparse mapping functions - #6205

Draft
kanadgupta wants to merge 1 commit into
developfrom
kanad-claude/config-default-values-mapping-ced354
Draft

feat(config): store config defaults and provide sparse mapping functions#6205
kanadgupta wants to merge 1 commit into
developfrom
kanad-claude/config-default-values-mapping-ced354

Conversation

@kanadgupta

Copy link
Copy Markdown
Contributor

Implements CLI-2155: a stored reference of config default values and a mapping function that omits values matching them, so config diff (CLI-2156) and config pull (CLI-2064) can compare sparse configs instead of full effective ones.

Currently in this PR (design docs; implementation follows on this branch):

  • ADR 0017 — Sparse Config Subtraction (docs/adr/0017-sparse-config-subtraction.md): pins the design before code lands. Key points:
    • Defaults are derived from the schema's existing default annotations by decoding {} (getDefaultProjectConfig()), not from a hand-written table that would drift.
    • The mapping core is a pure, parameterized subtractProjectConfig(config, baseline) (strict deep equality, order-sensitive arrays, empty sections dropped), with omitDefaultValues(config) as the defaults-baseline entry point.
    • The remote-block baseline rule: subtraction never prunes [remotes.*] against global defaults — a remote value equal to a global default still overrides a differing base value. A remote block's correct baseline is the merged base config (applied by CLI-2156).
    • Scope split: the merge cascade and API-response→config shape translation land with the diff core in CLI-2156, keeping @supabase/config free of Management API types.
  • CONTEXT.md: a root glossary establishing the vocabulary the config-driven-development work builds on (default config, sparse config, subtract, remote block, base config, drift).

🤖 Generated with Claude Code

Adds ADR 0017 pinning the design for the config defaults mapping
function ahead of implementation: a pure, parameterized subtract core
in @supabase/config, defaults derived from schema annotations, strict
deep equality, and the remote-block baseline rule. Also seeds a root
CONTEXT.md glossary with the project's config vocabulary.

Co-Authored-By: Claude Fable 5 <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