Skip to content

docs(adr): ADR-0027 metadata-authoring — staged authoring, publish & promotion lifecycle#1427

Merged
os-zhuang merged 6 commits into
mainfrom
claude/metadata-ui-db-package-331jh
Jun 1, 2026
Merged

docs(adr): ADR-0027 metadata-authoring — staged authoring, publish & promotion lifecycle#1427
os-zhuang merged 6 commits into
mainfrom
claude/metadata-ui-db-package-331jh

Conversation

@os-zhuang

@os-zhuang os-zhuang commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

What

Adds ADR-0025 proposing @objectstack/metadata-authoring — a server-side, transport-agnostic package that owns the metadata authoring lifecycle in two phases:

  • Stage (high-frequency, cheap, zero runtime impact): every visual edit accumulates as a draft in a workspace bound to a package version under development. No DDL, no live activation.
  • Publish (low-frequency, batched, transactional): validate the whole draft as a set → compute & preview the migration plan → run batched physical DDL → seal an immutable sys_package_version (semver + checksum) → swap the env's active-version pointer. Rollback = swap the pointer back.

Why

The first draft modelled a single commit(change) that persisted + ran DDL + hot-activated on every edit — an anti-pattern for low-code (no mainstream platform ALTER TABLEs production on each canvas click). This revision splits it into stage() + publish() and makes the package version — not a person's env-local overlay rows — the unit of work.

The design is grounded in how mainstream systems handle this (comparison table in the ADR): Salesforce sandbox + Unlocked Package deploy, ServiceNow Update Sets, Mendix Team Server + deploy-time DB sync, OutSystems 1-Click Publish + LifeTime promotion, Hasura migrations. It revives ADR-0016 §2's draft-workspace north-star (the §9 MVP took a local-first shortcut).

Design highlights

  • Two cadences: stage() (draft, no DDL) vs publish() (batched DDL + seal + pointer-swap activation).
  • L2 physical DDL deferred to publish and planned/previewed as a set (dry-run).
  • Dependency-cycle-free: depends only on spec + metadata-core; reaches storage/DDL/activation via injected ports (adapters in objectql/runtime).
  • Activation is a pointer swap → failed publish leaves the running app untouched; rollback swaps back.
  • Explicit schema-ahead recovery for non-transactional DDL; honors schemaMode: external.
  • Incremental 5-phase migration plan, each phase shipping green.

Scope

Documentation only (ADR). No code changes yet — package scaffold (Phase 0) is a follow-up once the design is reviewed.

Builds on ADR-0003 / ADR-0005 / ADR-0008 / ADR-0010 / ADR-0016.

https://claude.ai/code/session_01G33V5WWZc13ptd8ELBLkQg

…commit engine

Extract the visual-edit → database commit pipeline (validate → protect →
OCC → L1 sys_metadata persist + L2 schema-sync DDL → changelog → notify)
into a new transport-agnostic @objectstack/metadata-authoring package.
Depends only on spec + metadata-core; reaches storage/DDL via injected
ports whose adapters live in objectql, breaking the dependency cycle.

https://claude.ai/code/session_01G33V5WWZc13ptd8ELBLkQg
@vercel

vercel Bot commented Jun 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 1, 2026 1:44am

Request Review

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation labels Jun 1, 2026
Reframe the metadata-authoring package around two cadences instead of a
per-edit commit: stage() accumulates drafts in a package-version workspace
with zero runtime/DDL impact; publish() validates the set, plans+previews
the migration, runs batched DDL, seals an immutable version, and activates
via pointer swap. The publish unit is the package version, not per-person
overlay rows. Adds a mainstream-platform comparison (Salesforce/ServiceNow/
Mendix/OutSystems/Hasura) and revives ADR-0016 §2's draft-workspace north-star.

https://claude.ai/code/session_01G33V5WWZc13ptd8ELBLkQg
@os-zhuang os-zhuang changed the title docs(adr): ADR-0025 metadata-authoring — transport-agnostic metadata commit engine docs(adr): ADR-0025 metadata-authoring — staged authoring & package publish Jun 1, 2026
…fecycle

Detail the complete development business process grounded in the existing
data model (sys_package / sys_package_version{draft|published|deprecated} /
sys_package_installation pointer / sys_environment / sys_metadata.state):
actors+roles, the package-version state machine, phase-by-phase flow
(openDraft → stage → diff/validate → preview → publish → promote
Dev/Staging/Prod → rollback/deprecate/distribute), data-model mapping,
migration & data lifecycle with destructive gating by environment type,
concurrency/collaboration, approval gates, ports, and a gap analysis of
exists vs net-new. No new tables — the package is pure orchestration.

https://claude.ai/code/session_01G33V5WWZc13ptd8ELBLkQg
…dmap

Add the complete capability map (authoring/migration/release/environments/
governance/recovery/distribution/collaboration/source-duality) marking what
ships when, and a milestone roadmap (M0 seams → M1 staging → M2 publish →
M3 promote+govern → M4 advanced migration/DX → M5 collaboration) where each
milestone delivers standalone value, is non-breaking, and coexists with the
§9 MVP. Bake in now (deliver later): ordered MigrationPlan for expand-contract
zero-downtime migrations, per-target-environment DDL execution, and seal
accepting either DB-draft or file/Git authoring (ADR-0006 two-flows-one-schema).
Recommend M0+M1+M2 as the smallest end-to-end MVP.

https://claude.ai/code/session_01G33V5WWZc13ptd8ELBLkQg
claude added 2 commits June 1, 2026 01:40
main introduced ADR-0025 (plugin package distribution) and ADR-0026
(client-side UI plugin distribution), so renumber the metadata-authoring
ADR to 0027 and rename its slug to ...-lifecycle (the doc is the full
authoring/publish/promotion lifecycle, not a per-edit commit). Add a
boundary cross-reference: ADR-0025/0026 own how a sealed package is
distributed/installed; ADR-0027 owns how it is authored, staged, sealed,
and promoted — meeting at the sealed sys_package_version artifact.

https://claude.ai/code/session_01G33V5WWZc13ptd8ELBLkQg
@os-zhuang os-zhuang changed the title docs(adr): ADR-0025 metadata-authoring — staged authoring & package publish docs(adr): ADR-0027 metadata-authoring — staged authoring, publish & promotion lifecycle Jun 1, 2026
@os-zhuang os-zhuang marked this pull request as ready for review June 1, 2026 01:42
@os-zhuang os-zhuang merged commit 679311a into main Jun 1, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants