You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a baseline-only workspace authority backed by immutable RuntimeEvents and one atomic SQLite writer.
Define strict maka.workspace.epoch_opened@1 and baseline-specific maka.workspace.baseline_accepted@1 facts.
Keep the future generic maka.workspace.version_accepted@1 namespace available for real mutation, undo, rebaseline, and merge protocols.
Place each epoch on a deterministic, store-owned control-plane RuntimeEvent spine rather than a user Session or AgentRun.
Reserve maka_workspace_authority from ordinary Session creation/import and conversation lifecycle paths.
Add schema 7 projections for workspace epochs, versions, and heads, guarded by runtime_workspace_version_authority@1; schema 8 adds a singleton durable storage-root binding.
Bind the authority database to one authenticated durable rootId before logical state exists, and revalidate that binding in the same SQLite transaction that commits the two canonical facts and all three projections.
Rebuild disposable projections from strict immutable facts and fail closed on malformed, orphaned, duplicated, or row/payload-mismatched authority state.
Read canonical facts and projections from one SQLite snapshot so a concurrent baseline commit cannot produce false corruption.
Why
A managed Git workspace needs one durable answer to which baseline identity Maka accepted for an epoch. Git refs retain artifacts but do not own Runtime acceptance; mutable projections cannot be the source of truth.
RuntimeEvents remain the canonical causal facts. SQLite projections are disposable and continuously cross-checked against them.
Merge gate: verified artifact receipt
This authority remains package-internal and must not gain a production caller until the Baseline Open composition supplies a durable, typed, and re-verifiable receipt from the Git workspace owner. The foundation PR itself may merge independently because no public execution path can invoke the raw writer.
The current foundation proves fact shape, atomic persistence, arbitration, and rebuild behavior. It does not run Git and therefore cannot independently prove that a supplied commit/tree exists. Raw OIDs, a TypeScript brand, or a caller-provided verified: true flag are not acceptable substitutes for the receipt seam.
Invariant and atomic boundary
For one baseline bundle, the epoch-opened fact, baseline-accepted fact, epoch projection, version projection, and head projection become visible together or not at all. Concurrent exact submissions converge; conflicting identities fail closed.
Protocol owner: strict contracts and pure scanner in @maka/core
Writer owner: a storage-internal registered writer backed by SqliteRuntimeStore; it is unavailable from the public package surface
Atomic boundary: one BEGIN IMMEDIATE ... COMMIT transaction
Rollback: uncommitted bundles disappear completely; schemas 7/8 are additive, while binary downgrade requires a pre-upgrade backup
Scope limits
This PR intentionally does not:
execute Git or independently verify commit/tree/ref existence;
create or own a managed repository/worktree;
define generic mutation-version, prepared, settled, no-op, or head-CAS facts;
integrate Write/Edit, provider admission, Desktop, CLI, or automatic resume.
The verified receipt contract and Baseline Open composition are the required next slices before this authority can become a production acceptance path.
The baseline-protocol findings are addressed in e2e23f2f, with one explicit merge gate retained.
The fact is now baseline-specific: maka.workspace.baseline_accepted@1 / workspace_baseline_accepted_v1.
The generic workspace.version_accepted@1 namespace is no longer frozen around baseline-only parents/origin rules.
maka_workspace_authority is rejected by the ordinary Session identity guard, covering regular creation and import paths that share that guard.
The architecture document now states that this PR must remain Draft until a durable, typed, re-verifiable Git baseline receipt is consumed by the Baseline Open composition.
I am not treating a TypeScript brand or caller-provided verified: true as a solution to the missing-artifact problem. This branch proves the RuntimeEvent/SQLite authority mechanics only; it will not be marked Ready or gain a production caller before the receipt seam exists.
Local validation is green: core/storage/runtime builds, changed-file Biome formatting, and 26 focused authority/storage tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a baseline-only workspace authority backed by immutable RuntimeEvents and one atomic SQLite writer.
maka.workspace.epoch_opened@1and baseline-specificmaka.workspace.baseline_accepted@1facts.maka.workspace.version_accepted@1namespace available for real mutation, undo, rebaseline, and merge protocols.maka_workspace_authorityfrom ordinary Session creation/import and conversation lifecycle paths.runtime_workspace_version_authority@1; schema 8 adds a singleton durable storage-root binding.rootIdbefore logical state exists, and revalidate that binding in the same SQLite transaction that commits the two canonical facts and all three projections.Why
A managed Git workspace needs one durable answer to which baseline identity Maka accepted for an epoch. Git refs retain artifacts but do not own Runtime acceptance; mutable projections cannot be the source of truth.
RuntimeEvents remain the canonical causal facts. SQLite projections are disposable and continuously cross-checked against them.
Merge gate: verified artifact receipt
This authority remains package-internal and must not gain a production caller until the Baseline Open composition supplies a durable, typed, and re-verifiable receipt from the Git workspace owner. The foundation PR itself may merge independently because no public execution path can invoke the raw writer.
The current foundation proves fact shape, atomic persistence, arbitration, and rebuild behavior. It does not run Git and therefore cannot independently prove that a supplied commit/tree exists. Raw OIDs, a TypeScript brand, or a caller-provided
verified: trueflag are not acceptable substitutes for the receipt seam.Invariant and atomic boundary
For one baseline bundle, the epoch-opened fact, baseline-accepted fact, epoch projection, version projection, and head projection become visible together or not at all. Concurrent exact submissions converge; conflicting identities fail closed.
@maka/coreSqliteRuntimeStore; it is unavailable from the public package surfaceBEGIN IMMEDIATE ... COMMITtransactionScope limits
This PR intentionally does not:
The verified receipt contract and Baseline Open composition are the required next slices before this authority can become a production acceptance path.
Validation
中文说明
概要
新增 baseline-only Workspace Authority,以 immutable RuntimeEvents 为事实权威,并由一个 SQLite 专用原子 writer 提交。
maka.workspace.epoch_opened@1与 baseline-specificmaka.workspace.baseline_accepted@1。maka.workspace.version_accepted@1命名空间。maka_workspace_authority。rootId;该 binding 与两条 canonical facts、三张 projection 在同一 SQLite transaction 中重新校验并提交。合并硬门槛:verified artifact receipt
本 authority 保持 package-internal;Baseline Open composition 提供由 Git workspace owner 持久化、typed、可重读并可重新验证的 receipt 之前,不得拥有生产 caller。由于 raw writer 不存在 public execution path,本 foundation PR 本身可以独立合并。
当前 foundation 只证明事实形状、原子持久化、并发仲裁与 projection rebuild。它不执行 Git,因此不能独立证明 supplied commit/tree 真实存在。裸 OID、TypeScript brand 或 caller 自报
verified: true都不能替代 receipt seam。不变量与原子边界
同一个 baseline bundle 的 epoch-opened fact、baseline-accepted fact、epoch/version/head projection 只能一起可见或一起不可见。并发 exact submission 收敛,identity 冲突 fail closed。
@maka/corestrict contract 与 pure scannerSqliteRuntimeStore实现且不暴露在 package public surfaceBEGIN IMMEDIATE ... COMMIT明确不包含
verified receipt contract 与 Baseline Open composition 是本 authority 成为生产 acceptance path 之前的必需后续切片。
验证