Skip to content

principles: Database extensions principle, two-mode currency - #33

Merged
JaimeStill merged 4 commits into
mainfrom
principles
Nov 25, 2026
Merged

JaimeStill merged 4 commits into
mainfrom
principles

Conversation

@JaimeStill

Copy link
Copy Markdown
Contributor

v1.data.extensions · task 5/5 · principles

Summary

  • New Go Elemental principle "Database extensions"
    (standards/go-elemental/principles/database-extensions.md), listed in both Go Elemental
    indexes, with four rules:
    • an extension's features are native tier;
    • the image is the version;
    • the application declares extensions by name, and the migrator reconciles them;
    • an extension is its own module in each library.
  • "DSL-driven services" covers a declared extension's native forms. "Rolling currency" and "Releases
    and CI" cover a source a Dockerfile builds, pinned by a build argument.
  • sqlate's scripts/currency.sh now has two modes. mise run currency runs report, and
    mise run upgrade runs upgrade, which replaces the inline upgrade task.
    • upgrade moves every pin that report lists, in this order: mise pins, Go modules, action
      pins, image: lines, FROM tags, source ARGs.
    • It skips any pin listed in HOLDS, which ships empty.
  • go-database runs a byte-identical copy of the script, wired the same way. Its postgres module
    now requires go-database v0.13.0, with an Unreleased changelog entry.
  • Both repositories' STANDARDS.md point to the new page, and sqlate's guide no longer says the
    pgvector ARG is raised by hand.

Core changes

  1. database-extensions.md (738 words): rules (a)–(d) from the round, each with its reason.
    Each example link is pinned at a tag, and the page states no repository's version or state.
    Why: the strategy was in a coordinator note that no review could cite, and that note had fallen
    behind the code in four places.
  2. scripts/currency.sh report|upgrade: both modes run the same scans, so upgrade can't
    disagree with currency. Why: neither repository's upgrade moved action pins, FROM tags or
    ARGs, it read no holds, and it ran Go before the mise pins. Rolling currency rules out all
    four.
    [tasks.upgrade]
    run = "scripts/currency.sh upgrade"
  3. The currency pages: a Dockerfile's source ARG is now a covered version, which currency
    reports and upgrade moves, with no hand-raise exception.

Verify

mise run check: ✓ sqlate, ✓ go-database · architecture scripts/check.sh: ✓ all checks passed

  1. In sqlate and in go-database, mise run currency; echo $? prints nothing trailing and 0.
  2. In each repository, mise run upgrade && git status --short prints no upgrade: lines and
    leaves no change.
  3. cmp sqlate/scripts/currency.sh go-database/scripts/currency.sh exits 0 with no output.
  4. In a scratch copy, lower jdx/mise-action to v5.2.0, FROM to postgres:18.4-alpine, and
    PGVECTOR_VERSION to 0.8.6.
    • mise run currency lists all three and exits 1.
    • mise run upgrade prints three upgrade: lines and restores them, after which currency
      exits 0.
    • Lower the ARG again and add pgvector/pgvector 0.8.6: <reason> to HOLDS. The upgrade
      leaves the ARG, and currency prints … held: <reason> and exits 0.
  5. Read architecture/standards/go-elemental/principles/database-extensions.md. It should state
    only rules (a)–(d), with no build flags, catalog names, metric table, sqlint syntax or shipper
    rule.

Decided without you

  1. The page's Dockerfile example is pinned at sqlate's postgres/pgvector/v0.1.0, not v0.8.0,
    because v0.8.0 predates the pgvector build. It also links go-database's examples at
    v0.13.0 and postgres/pgvector/v0.1.0.
  2. Rule (c) gained one sentence: reconciliation acts only on a difference, so a database that is
    already provisioned can migrate under a role that can't install extensions.
  3. The rule that a native file's header names its extension is stated as review-held, because
    sqlint doesn't read the native: header.
  4. The script follows docproc's report line format, which turns go 1.26 -> go 1.27 into
    go 1.26 -> 1.27. It also moves image: lines, runs Go through mise exec, and uses
    mise upgrade --bump --no-global in place of the deprecated --local.
  5. Standards fixes:
    • removed the header line # See docs/features.md from the shared script, since go-database
      has no docs/;
    • release-and-ci.md now names the image: lines the script already read.
  6. Left for a retro:
    • "Rolling currency" doesn't say how a source's latest version is found. The script uses the
      highest semver git tag, because pgvector publishes no releases.
    • Neither mode removes a stray toolchain line from a go directive that is otherwise
      current, which the old upgrade did. No go.mod has one today.
  7. Dropped decisions, now expressed by the page, the docs or doc.go:
    • the image as the sole version source;
    • shipped sets declare no extensions;
    • the engine never requires its extensions, and each extension has its own tier;
    • go-database wraps no pgvector-go type;
    • the principle's level;
    • where the native-forms denial lives;
    • where the shipper rule lives;
    • the ARG as a covered version;
    • the script's shape.

Redirects and escalations

  1. Plan round 2 (asked after round 1, question 4): teach mise run upgrade to move every pin in
    this task rather than in the backlog. Answer: yes.

Merge danger: two-way door · blast radius: docs, dev scripts and task wiring in sqlate,
go-database and architecture; no tag. sqlate and go-database merges wait on CI; architecture's
doesn't.

Needs you: none

Sync

  • coordinator (standards-lab)
    • references.md: the two postgres/pgvector sub-modules, plus pgvector and pgvector-go as
      upstream sources.
    • roadmap/v1.data.extensions.toml: delete. Its pending summary and repos fixes lapse with
      it.
    • context/postgres-extensions.md: delete, with its context/README.md entry.
    • context/data-intelligence.md: point the goal bullet and evidence 10 at the new page, and add
      the database/sql text-format capstone check.
    • context/migration-sets.md: drop the note pointer, and add "no shipped set needs an extension
      yet".
    • roadmap/sqlate-test-tier.toml and roadmap/sqlate-extension-match.toml: create, and add both
      to backlog.
    • roadmap/index.toml: remove v1.data.extensions from active.
  • next: docproc-coverage · staged on accept

scripts/currency.sh takes one mode, report or upgrade, ported from
docproc's shape: each scan emits "<item> <pin> <latest>" lines, and both
modes read the same scans, so upgrade moves exactly what report lists.
mise run currency runs report; mise run upgrade runs upgrade, replacing
the inline task that moved Go before the mise pins.

Decisions:
- upgrade order: mise pins, then each module's go directive, direct
  requirements, and tidy (under `mise exec -- go`, so the Go just pinned
  is used), then action pins, image: lines, Dockerfile FROM tags, and
  Dockerfile source ARGs. The image-line scan is upgraded too, after the
  actions, before the FROM tags.
- Report lines take docproc's "<where>: <item> <pin> -> <latest>" form;
  the go directive now reads "go 1.26 -> 1.27" (was "go 1.26 -> go 1.27").
  Report runs the scans in upgrade's order.
- mise tools are upgraded by naming each unheld trailing tool to
  `mise upgrade --bump --no-global`; --no-global replaces the deprecated
  --local.
- A hold matches an anchored "<item> <pin>: " prefix, the item and pin
  regex-escaped. HOLDS ships empty in mise.toml's [env].
- Left out from docproc: Go-source image pins, tool modules, per-tool
  upgrades.
- STANDARDS.md points to database-extensions.md (arrives in slice 4).
@JaimeStill
JaimeStill merged commit 03385a3 into main Nov 25, 2026
1 check passed
@JaimeStill
JaimeStill deleted the principles branch November 25, 2026 14:18
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