Skip to content

Settings as code: layered config files with schema, repo-shared layer, migration flow #438

Closed

Description

@currentbits

Inspired by Conductor's settings system (the most disciplined config design in the category): layered TOML files — managed (org) > project-local (gitignored) > repo-shared (committed, only takes effect after merge to the default branch) > user > defaults. JSON schema URLs on the first line give editor autocomplete. Unknown keys are rejected in repo files (catches typos), ignored in managed. Named scripts merge by ID across layers, with a local layer able to hide a shared entry. Legacy config gets a migration flow that opens a PR.

Solenta's settings currently live in the store blob; a layered file-based system makes project config reviewable, shareable, and diffable — and the repo-shared layer pairs with #378 (repo-versioned agent defs).

Activity

  1. added
    enhancement
    plan:todo
    on Aug 18, 2026
  2. currentbits commented on Aug 20, 2026

    @currentbits
    OwnerAuthor

    Concrete prior art for the repo-shared layer: T3's t3.json at the repo root (packages/contracts/src/t3ProjectFile.ts @ beab6886). Deliberately tiny — four keys, all optional:

    • $schema — https://t3.codes/schema/t3.json, same editor-autocomplete trick as the TOML design above.
    • iconPath — workspace-relative project icon, checked before built-in icon locations (see Project icons: auto-detected from the repo (favicon, app icon, HTML link), overridable per project #610).
    • defaultThreadEnvMode — "worktree" | "local", where new threads in this repo start. Precedence is explicit and documented in the schema annotation itself: composer pick > per-project setting in the app > checked-in t3.json > global default. That is the layering, stated where the person editing the file will read it.
    • scripts[] — shared with everyone who opens the repo, each with icon, runOnWorktreeCreate, previewUrl, autoOpenPreview (max N entries).

    Two things worth stealing beyond the file itself: every field carries a description annotation that is the schema doc (one source of truth for the file, the schema, and the settings UI), and runOnWorktreeCreate gives the repo a say in worktree provisioning — the checked-in half of #396.

  3. added
    plan:doing
    and removed
    plan:todo
    on Oct 24, 2026
  4. currentbits commented on Oct 24, 2026

    @currentbits
    OwnerAuthor

    Implemented on branch coder/settings-as-code-layered-config-files-wi-c39838 (commit 37bf94df), kept as JSON by decision. TOML was dropped because "$schema" gives editor autocomplete with no new dependency.

    • Local layer: solenta.local.json, gitignored and per checkout, sits over solenta.json. Quick actions merge by id (or by name when there is no id), and {"id": "x", "hidden": true} hides a shared entry. The trust hash covers the merged set, so a local edit asks for approval again.
    • Strict keys: an unknown key is now a file error at the top level, in quick action rows, in devServer and in automation rows.
    • Schema: site/solenta.schema.json is meant to be served at https://solenta.app/solenta.schema.json, but it only appears there once the site is deployed.
    • Migration: Edit project → Move to solenta.json opens a PR from a new worktree thread based on origin's default branch. Stored settings are left in place until the user clears them after the PR merges.

    Deliberately skipped (agreed on the thread):

    Tests: the full electron suite passed (5031 tests). New electron/test/layered-config.test.js; the editProject renderer cases pass.

  5. added
    plan:done
    and removed
    plan:doing
    on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementplan:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions