Skip to content

refactor(metaschema-modules): define events_module.record_error inline, drop the alteration - #127

Merged
pyramation merged 1 commit into
mainfrom
feat/events-module-inline-record-error
Sep 7, 2026
Merged

refactor(metaschema-modules): define events_module.record_error inline, drop the alteration#127
pyramation merged 1 commit into
mainfrom
feat/events-module-inline-record-error

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

Summary

Pre-launch we don't carry incremental schema changes, so the add_record_error ALTER TABLE change from #126 is folded into the table definition:

  • events_module/table.sql: record_error text NOT NULL DEFAULT '' sits next to record_event.
  • deploy|revert|verify/.../events_module/alterations/add_record_error.sql and its pgpm.plan line are removed.
  • sql/metaschema-modules--0.44.1.{sql,bundle.tar.gz} repackaged.

Companion PR in constructive-db updates the vendored copy and the insert_events_module trigger's requires:.

Link to Devin session: https://app.devin.ai/sessions/3c6cf9b1ca924b54954c60c1e77b1b07
Open in Devin Desktop: https://app.devin.ai/desktop/session/3c6cf9b1ca924b54954c60c1e77b1b07?variant=devin
Requested by: @pyramation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@tenki-reviewer

tenki-reviewer Bot commented Sep 6, 2026

Copy link
Copy Markdown

Review complete. 🟡 1 medium

💬 Inline comments (1)


The change removes the standalone add_record_error alteration (deploy/revert/verify plus its pgpm.plan entry) and instead inlines record_error text NOT NULL DEFAULT '' directly into the 2017 base events_module/table CREATE TABLE, then regenerates the committed sql/metaschema-modules--0.44.1.sql bundle to match.

Files Change
deploy/.../events_module/table.sql, pgpm.plan, revert/.../add_record_error.sql, verify/.../add_record_error.sql Removes the standalone add_record_error change and folds the column into the base table definition
sql/metaschema-modules--0.44.1.sql Regenerates the bundle with record_error in the CREATE TABLE and drops the trailing ALTER

Primary concern: the released v0.44.1 tag already shipped the standalone ALTER, so regenerating the same 0.44.1 artifact with a different digest breaks byte reproducibility and version immutability; the change should ship as 0.44.2. A secondary, lower-confidence concern is that folding the column into the long-applied base change may leave existing deployments (that already recorded events_module/table in the ledger) without record_error on upgrade.

Reviewed commit: 0517310

@tenki-reviewer tenki-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR folds the record_error column into the base events_module/table change and regenerates the sql/metaschema-modules--0.44.1.sql bundle, but does so by mutating the already-released v0.44.1 artifact instead of bumping the version.

Key findings

achievement_rewards_table_id uuid NOT NULL DEFAULT uuid_nil(),
achievement_rewards_table_name text NOT NULL DEFAULT '',
record_event text NOT NULL DEFAULT '',
record_error text NOT NULL DEFAULT '',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 bug · medium

Mutate released v0.44.1 artifact without version bump

The released v0.44.1 (tag) shipped sql/metaschema-modules--0.44.1.sql ending in ALTER TABLE ... ADD COLUMN record_error, but this PR regenerates that same 0.44.1 artifact with record_error folded into the CREATE TABLE (sql/metaschema-modules--0.44.1.sql:365) while package.json and metaschema-modules.control still declare 0.44.1. The same version now maps to two different install artifacts with different sha256 digests, breaking byte reproducibility and version immutability for consumers who pinned or installed v0.44.1. The installed schema is functionally identical, so there is no data loss, but the change should ship as a new version rather than mutating the released artifact.

📋 Prompt for AI Agents

In packages/metaschema-modules, bump the version from 0.44.1 to 0.44.2 in package.json (line 3) and metaschema-modules.control (default_version), and regenerate sql/metaschema-modules--0.44.2.sql plus its .bundle.tar.gz from deploy/ + pgpm.plan, leaving the released 0.44.1 artifact untouched so consumers who installed v0.44.1 keep a stable, byte-reproducible artifact.

@pyramation
pyramation merged commit d065171 into main Sep 7, 2026
30 checks passed
@pyramation
pyramation deleted the feat/events-module-inline-record-error branch September 7, 2026 00:14
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