Uh oh!
There was an error while loading. Please reload this page.
refactor(config): rename config document type ProjectConfig to CliConfig (CLI-2235) - #6328
Conversation
…Project naming (CLI-2235)
Coly010
left a comment
There was a problem hiding this comment.
Multi-pass review of the CLI-2235 rename (engineer / architect / DX lenses), run against head b5c88da72.
Verdict
The mechanical rename is verifiably clean — mergeable as-is on the code. The asks are: make the PR body truthful about the three user-visible error tags (see errors.ts comment), reconcile the docs/ADRs that now contradict the tree, and settle four pre-publish naming judgment calls while they're still free.
What was verified (all passing)
- Reverse-rename proof: replayed all 99 symbol mappings + 12 file renames in reverse over HEAD and diffed against the merge base — only 5 files had residual content (all intentional or flagged inline), and exactly one non-symbol string literal changed in the entire 403-file diff (a test temp-dir prefix,
cli-settings.layer.unit.test.ts:15— flagging only so it's a conscious choice). The reflow commit is genuinely formatting-only. - Identifier census balances exactly (e.g.
loadProjectConfig167→0 /loadCliConfig0→167;mockLegacyCliConfig313→0 /mockLegacyCliSettings0→313). Zero stragglers of old names outside the declared carve-outs; carve-outs (apps/cli-go, generatedpackages/api,RemotesSchema,Legacy*) respected. The stringly-typedEffect.catchTag("CliProjectEnvParseError", …)insecrets/set.handler.ts:262was correctly updated. ProjectConfigis genuinely free: no exported binding on any entrypoint (.,/ionode+bun+browser,/effect); export-surface snapshots are set-equal to the base after reverse-rename — nothing added, removed, or mixed; reordering is the correct consequence of.sort().- Generated
schema.jsonis byte-identical between merge base and HEAD (built both, diffed: 5,975 lines identical);$schemaURL value unchanged; zero changes to any.toml/.json/.snapfixture;supabase inittemplate untouched. - Checks: types:check across config/cli/e2e/test-helpers/stack, lint, fmt, knip all green; 198/198 config unit, 5,059 CLI unit, 3,251 integration tests pass.
- Doc fact-check: all four corrected behavioral claims in
cli-config-loading.mdverified true against source — unresolvedenv()stays literal (project.ts:341-343), eager-vs-deferred interpolation (io.ts:531/lib/env.ts:29, onlyfunctions.<name>.env.*deferred),initwrites a commentedconfig.toml(project-init.ts:308), managed state under globalSUPABASE_HOME. Also confirmedMissingCliConfigValueErroris constructed nowhere, as the doc now says.
Findings not anchorable inline (files outside the diff)
packages/stack/README.md:48—cliConfig.supabaseHomemissed by the sweep (supabaseHomeis aCliSettingsfield →cliSettings.supabaseHome).docs/adr/0009-configuration-schema-and-validation.md:25-30+docs/adr/0018-sparse-config-subtraction.md— need dated rename notes; details on theAGENTS.mdcomment.docs/superpowers/plans/2026-08-16-cli-2110-managed-port-allocation.md:78,113-134— live plan (0/44 steps checked) still instructs an implementer to createProjectConfigValueSource/projectConfigValueSourceAtand extendLoadedProjectConfig— all renamed by this PR. Rename the symbols or mark it superseded.apps/cli/src/shared/cli/run.ts:712-714— theCliConfigStorefallback stub's defect strings still say "unexpected root project config access / file access / write"; these can surface in a crash report naming the freed concept.packages/config/src/base.ts:43— internalconst remoteProjectConfigbinds the reserved identifier for what is aCliConfigsub-document (leaks into a comment atio.ts:319). Not exported, so low cost — but it's the one name the PR reserves. SuggestremoteCliConfigBlock.
Severity summary
- Should-fix (in this PR): errors.ts claim/telemetry statement · vocabulary-rule exceptions (
ProjectHome,ProjectLocalServiceVersions) · ADR 0009/0018 rename notes ·cliConfig.workdircomments (×2) · README vocabulary note ·CliSettings/CliProjectContexttag namespace. - Pre-publish judgment calls (decide before first publish, not necessarily here):
LoadCliConfigOptions.projectEnvfield name ·/iofacade naming convention ·BaseCliConfigas the hosted-diff operand type (the one that's expensive to reverse). - Nits: everything else inline + the unanchorable list above.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Coly010
commented
Aug 25, 2026
Review round 1 addressed in 9bebebc + 7f5f92c (replies on every thread). The findings without inline anchors:
Two pre-publish judgment calls filed as explicit decisions rather than rushed here: One bonus find from your Validation after the round: types:check ×5 projects, config 198 tests, CLI test:core (unit + integration incl. the new normalize-error pins), oxlint, oxfmt, knip — all green with verified exit codes. |
Supabase CLI previewnpx --yes https://pkg.pr.new/supabase/cli/supabase@03ec58fe6994e447031c99d541c9500ced4654f9Preview package for commit |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:7f5f92c1f9
ℹ️ 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".
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
… convention (supabase#6335) ## What changed Records the `@supabase/config` naming convention (decided 2026-08-24, applied mechanically by CLI-2235 / supabase#6328) as normative documentation: - **New [ADR 0020](docs/adr/0020-config-naming-vocabulary.md)** — the vocabulary decision and rationale: `CliConfig` = the full config-file document (`supabase/config.toml`/`.json`, the local superset), `ProjectConfig` = the hosted-project subset (a sparse overlay of the hosted sections, being introduced by CLI-2230), `CliSettings` = the CLI's own runtime settings (formerly named `CliConfig`), plus the prefix rule: `Cli*` = the local checkout side, bare `Project*` = the hosted Supabase project, and value-helpers follow the config family regardless of their inputs (`resolveCliConfigValue`, `MissingCliConfigValueError`). - **Repo-root `AGENTS.md`** — new "Config Naming Vocabulary" section so agent/human sessions load the convention at start instead of re-deriving it from PR history. - **`packages/config/README.md`** — the intro blockquote becomes a proper "Naming" section (public contract documentation once the package publishes). - **`packages/config/docs/cli-config-loading.md`** — the Vocabulary section already *used* the settled names; this adds the prefix rule stated *as a rule*, linking ADR 0020. (The issue referenced this file by its pre-CLI-2235 name `project-config-loading.md`.) Stale-vocabulary sweep across `*.md` came back clean: ADRs 0009/0018 already carry CLI-2235 rename addendums and stay untouched as historical records, and every remaining `CliConfig` hit (including legacy `SIDE_EFFECTS.md` files) uses the current document-family meaning. ## Why Renames are free only while `packages/config` is `private: true` — CLI-2169 flips it public, and Studio is already an external consumer waiting on the package (supabase/supabase#48906). The vocabulary drifted once before (`CliConfig` meant the settings service, `ProjectConfig` meant the document); without a recorded decision it would drift again. ## Reviewer context Coordinated with the in-flight CLI-2230 branch: it owns the `ProjectConfig: reserved…` vocabulary bullet in `cli-config-loading.md` and will add a "ProjectConfig mapping" README subsection after this PR's "Naming" section, updating the "introduced by CLI-2230 (in flight)" sentence when it lands. `BaseCliConfig` is deliberately never cited as a prefix-rule example — its name is under an open ruling on CLI-2230. Fixes CLI-2238
Summary
Repo-wide vocabulary rename settling
@supabase/config's core naming before first npm publish (CLI-2235).One prefix rule across the package:
Cli*= the local checkout side; bareProject*= the hosted Supabase project. After this PR no exported name uses a bare "project" to mean the local checkout, andProjectConfigis freed for the hosted-project subset type the API-mapping work (CLI-2230 / CLI-2156) will introduce. Renames are only free while the package isprivate: true, which is why this blocks CLI-2169 (first publish).No functional behavior changes: the config-file surface (
project_id, section names), the generatedschema.json, and the schema URL value are unchanged. Four renamed error tags are user-visible and change deliberately with this release: the stderr and--output-format jsonerror code changes (ProjectConfigParseError→CliConfigParseError,ProjectEnvParseError→CliProjectEnvParseError,MissingProjectConfigValueError→MissingCliConfigValueErroron malformed-config/env failures, andProjectHomeNotDirectoryError→CliProjectHomeNotDirectoryErrorwhen.supabase/is blocked by a file or symlink loop), and the telemetryerror_fingerprintseries fork accordingly (tag:<old>goes flat,tag:<new>starts) — annotate dashboards/alerts keyed on the old values at release. Anormalize-errorunit test now pins the user-facing codes so the next such rename is a visible review event. Service tag strings were renamed with their services (app-internal identity keys) and moved out of the package's namespace:supabase/config/*→supabase/cli/*for all apps/cli-owned services.ADRs 0009/0018/0019 keep their pre-rename symbol names as historical records — the tables below are the mapping.
Step 0 — free the
CliConfigname (apps/cli)CliConfig(service, tagsupabase/config/CliConfig)CliSettings(tagsupabase/cli/CliSettings)LegacyCliConfig(tagsupabase/legacy/CliConfig)LegacyCliSettings(tagsupabase/legacy/CliSettings)cliConfigLayer,mockCliConfig,cliConfigvars, …cliSettingsLayer,mockCliSettings,cliSettings, …cli-config.service.ts/cli-config.layer.ts/legacy-cli-config.*cli-settings.*/legacy-cli-settings.*Config-document family (
ProjectConfig*→CliConfig*)ProjectConfig,ProjectConfigSchema,ProjectConfigJson,toProjectConfigJsonSchemaCliConfig,CliConfigSchema,CliConfigJson,toCliConfigJsonSchemaloadProjectConfig,loadProjectConfigFile,saveProjectConfig,LoadedProjectConfig,Load/SaveProjectConfigOptionsloadCliConfig,loadCliConfigFile,saveCliConfig,LoadedCliConfig,Load/SaveCliConfigOptionsencodeProjectConfigToJson/Toml,projectConfigValueSourceAt,ProjectConfigValueOrigin/SourceencodeCliConfigToJson/Toml,cliConfigValueSourceAt,CliConfigValueOrigin/SourceProjectConfigParseError,MissingProjectConfigValueErrorCliConfigParseError,MissingCliConfigValueErrorProjectConfigStore,projectConfigStoreLayer(+ file renames)CliConfigStore,cliConfigStoreLayer(cli-config.service.ts/cli-config.layer.ts)PROJECT_CONFIG_SCHEMA_URL(value unchanged)CLI_CONFIG_SCHEMA_URLgetDefaultProjectConfig,subtractProjectConfiggetDefaultCliConfig,subtractCliConfigwriteProjectConfig,decodeProjectConfig,ProjectConfigIo,loadFunctionsProjectConfig,renderProjectConfigTemplate,BaseProjectConfig,SparseProjectConfig, …CliConfigsubstitutedLocal-checkout family (
Project*→CliProject*)ProjectEnvironment,loadProjectEnvironment(For),LoadProjectEnvironmentOptions,LiveProjectEnvironmentCliProjectEnvironment,loadCliProjectEnvironment(For), …ProjectPaths,findProjectPaths(For),FindProjectPathsOptions,findProjectRoot(For/FromRepoState)CliProjectPaths,findCliProjectPaths(For), …,findCliProjectRoot(…)ProjectEnvParseErrorCliProjectEnvParseErrorresolveProjectValue(AtPath),resolveProjectSubtree,ResolvedProjectValue,ResolveProjectOptions— config family: they resolveenv()refs in config valuesresolveCliConfigValue(AtPath),resolveCliConfigSubtree,ResolvedCliConfigValue,ResolveCliConfigOptionsProjectContext(apps/cli, tagsupabase/config/ProjectContext) +projectContextLayer(For),mockProjectContext, … + file renamesCliProjectContext(tagsupabase/cli/CliProjectContext) +cliProjectContextLayer(For),mockCliProjectContext, … (cli-project-context.*)ProjectHome(apps/cli) +projectHomeLayer(For),ProjectHomeNotDirectoryError, … + file renamesCliProjectHome(tagsupabase/cli/CliProjectHome) +cliProjectHomeLayer(For), … (cli-project-home.*)ProjectLocalServiceVersions(apps/cli) + layer/mocks + file renamesCliProjectLocalServiceVersions(tagsupabase/cli/CliProjectLocalServiceVersions) (cli-project-local-service-versions.*)projectCommandBaseLayer,provideProjectCommandRuntime(apps/cli)cliProjectCommandBaseLayer,provideCliProjectCommandRuntimeLoadCliConfigOptions.projectEnv(published options field) + theresolveCliConfig*resolvers'projectEnvparamcliProjectEnv(apps/cli-internalCliProjectContext.projectEnvdeliberately keeps its name — filed on CLI-2234)Deliberately unchanged
DuplicateRemoteProjectIdError/InvalidRemoteProjectIdError— "project id" there genuinely means the hosted project ref (the new meaning of "project"). (remoteProjectConfig, initially kept under the same carve-out, was renamed toremoteCliConfigBlockper review — it binds the reservedProjectConfigspelling for what is aCliConfigsub-document.)packages/apigenerated names (v2GetProjectConfig, …) — hosted-project endpoint operations.Legacy*/legacy*ProjectEnv*/LegacyLocalProjectContextsymbols — already namespaced by theirLegacyprefix and pending deletion with the legacy shell.getProjectRoot,internal/utils/misc.go) andapps/cli-go/**.Docs
packages/config/docs/project-config-loading.md— the doc that defined the old vocabulary — is rewritten ascli-config-loading.mdaround the final naming, with stale behavioral claims corrected against current source along the way:env(NAME)resolution does not fail withMissingProjectEnvVarError(that class doesn't exist); the resolvers leave unresolved literals as plain stringsloadCliConfigsubstitutes mostenv(NAME)refs eagerly at load; onlyfunctions.<name>.env.*stays literal for on-demand resolutionsupabase initwrites a commentedconfig.tomltemplate, not a$schema-onlyconfig.jsonSUPABASE_HOME, not repo-local.supabase/Review round 1 (2026-08-25)
Addressed from the multi-pass review:
normalize-errorunit test pinning the error codes.apps/cli/src/next/config/:CliProjectHome,CliProjectLocalServiceVersions,cliProjectCommandBaseLayer/provideCliProjectCommandRuntime. Remaining bareProject*there (ProjectLinkRemote,ProjectLinkState,ProjectRefResolver) describe the hosted project or the link to it — now stated in the vocabulary doc.supabase/config/*→supabase/cli/*(each tag literal verified single-occurrence).remoteProjectConfig→remoteCliConfigBlock;LoadCliConfigOptions.projectEnv→cliProjectEnv(+ resolver params)./iofacade section,LegacyCliSettingsbullet,project_iddual-meaning note, correctedSUPABASE_HOMEkeying +identity.jsoninventory; CLI-2110 plan doc symbols updated;packages/stack/README.mdcliSettings.supabaseHome; stale comment fixes (paths.ts,project.unit.test.ts,push.handler.ts,run.tsdefect strings).Filed as explicit pre-publish decisions rather than rushed here:
/iofacade naming convention → CLI-2234;BaseCliConfigas the hosted-diff operand type → CLI-2230.Linked issue
CLI-2235