Skip to content

feat: package-scoped commit history & rollback for AI authoring (ADR-0067) - #2256

Merged
os-zhuang merged 4 commits into
mainfrom
feat/adr-0067-commit-history
Jun 24, 2026
Merged

os-zhuang merged 4 commits into
mainfrom
feat/adr-0067-commit-history

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Implements the ADR-0067 v1 foundation: turn each AI authoring apply into a revertible commit on a package-scoped timeline, so the model becomes "ship, review the history, revert if wrong" instead of "confirm every publish".

What lands

  • sys_metadata_commit object (metadata-core) + registration — groups a turn's metadata changes (by event_seq range) into one unit on top of sys_metadata_history.
  • publishPackageDrafts now records each publish as ONE commit (best-effort, never blocks the publish), capturing a per-artifact revert plan (created → soft-remove; edited → restoreVersion(prevVersion)) + threads an optional message/aiModel.
  • listCommits / revertCommit / rollbackToPackageCommit on the protocol, reusing the existing restoreVersion + delete primitives. A revert is itself an append-only commit.
  • REST routes (http-dispatcher): GET /packages/:id/commits, POST /packages/:id/commits/:cid/revert, POST /packages/:id/rollback.
  • ADR-0067 doc (amends ADR-0045).

Verification

  • objectql: 19 unit tests (commit-history + publish-drafts), no regressions.
  • runtime: 131 http-dispatcher tests (incl. 5 new route tests).
  • objectql + runtime tsup/DTS typecheck clean.

Deferred (per ADR)

Cross-item DB atomicity (ambient-tx) — publishPackageDrafts stays per-item best-effort and records the commit from what landed.

Pairs with cloud (pin + apply_blueprint message) and objectui (Build-history timeline UI) PRs.

🤖 Generated with Claude Code

os-zhuang and others added 3 commits June 24, 2026 02:07
Foundation for ADR-0067: turn each authoring apply into a revertible commit.

- sys_metadata_commit object: groups a turn's metadata changes (by event_seq
  range) into one unit on top of sys_metadata_history; registered alongside it.
- protocol.publishPackageDrafts now records each publish as ONE commit
  (best-effort, never blocks publish), capturing a per-artifact revert plan:
  created -> soft-remove; edited -> restoreVersion(prevVersion).
- protocol.listCommits / revertCommit / rollbackToPackageCommit, reusing the
  existing restoreVersion + delete primitives. A revert is itself an
  append-only commit (operation='revert').
- docs/adr/0067 + protocol-commit-history unit tests.

Deferred (per ADR): cross-item DB atomicity (ambient-tx), REST routes,
cloud turn-wiring, objectui timeline, browser E2E.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Expose the ADR-0067 commit primitives over HTTP, mirroring the
publish-drafts wiring:
- GET  /packages/:id/commits                 -> listCommits (timeline)
- POST /packages/:id/commits/:commitId/revert -> revertCommit
- POST /packages/:id/rollback {commitId}     -> rollbackToPackageCommit

Best-effort (501 when a custom protocol lacks the method); 400 when
rollback is called without a commitId. +5 http-dispatcher route tests
(131 green).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…eDrafts (ADR-0067)

publishPackageDrafts now accepts optional message + aiModel and stamps them
on the recorded commit, so an AI turn's commit carries the user's instruction
(and the authoring model) for the timeline. +1 end-to-end test (19 green).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 24, 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 24, 2026 2:28am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests labels Jun 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/metadata-core, @objectstack/objectql, @objectstack/runtime.

25 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/concepts/cloud-artifact-api.mdx (via packages/runtime)
  • content/docs/concepts/core/services.mdx (via @objectstack/objectql)
  • content/docs/concepts/implementation-status.mdx (via @objectstack/objectql, @objectstack/runtime)
  • content/docs/concepts/metadata-lifecycle.mdx (via @objectstack/metadata-core, @objectstack/objectql)
  • content/docs/concepts/north-star.mdx (via packages/runtime)
  • content/docs/concepts/packages.mdx (via @objectstack/metadata-core, @objectstack/objectql, @objectstack/runtime)
  • content/docs/guides/api-reference.mdx (via @objectstack/runtime)
  • content/docs/guides/authentication.mdx (via @objectstack/objectql, @objectstack/runtime)
  • content/docs/guides/cloud-deployment.mdx (via @objectstack/runtime)
  • content/docs/guides/deployment-vercel.mdx (via @objectstack/objectql, @objectstack/runtime)
  • content/docs/guides/driver-configuration.mdx (via @objectstack/runtime)
  • content/docs/guides/formula.mdx (via packages/objectql)
  • content/docs/guides/hook-bodies.mdx (via @objectstack/runtime)
  • content/docs/guides/kernel-services.mdx (via @objectstack/objectql)
  • content/docs/guides/objectql-migration.mdx (via @objectstack/objectql)
  • content/docs/guides/packages.mdx (via @objectstack/objectql, @objectstack/runtime)
  • content/docs/guides/plugin-chatbot-integration.mdx (via @objectstack/runtime)
  • content/docs/guides/plugins.mdx (via @objectstack/objectql)
  • content/docs/guides/production-readiness.mdx (via @objectstack/runtime)
  • content/docs/guides/single-project-mode.mdx (via @objectstack/runtime)
  • content/docs/protocol/objectos/http-protocol.mdx (via @objectstack/runtime)
  • content/docs/protocol/objectos/index.mdx (via @objectstack/objectql, @objectstack/runtime)
  • content/docs/protocol/objectos/lifecycle.mdx (via @objectstack/runtime)
  • content/docs/protocol/objectql/state-machine.mdx (via @objectstack/objectql)
  • content/docs/releases/v9.mdx (via @objectstack/objectql)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@os-zhuang
os-zhuang merged commit 4d99a5c into main Jun 24, 2026
16 checks passed
@os-zhuang
os-zhuang deleted the feat/adr-0067-commit-history branch June 24, 2026 02:34
os-zhuang added a commit that referenced this pull request Jul 5, 2026
feat(app-shell,plugin-view,plugin-form): record task flows as derived overlays + return invariants (framework#2604 Step 2) (#2256)

objectui@6c1ad9e206249735e8ebf7b77fca75313da28070

Co-authored-by: Claude <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — 281d3e83 Deployed Jun 24, 2026 by vercel[bot]
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/l tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant