Skip to content

docs(architecture): audit managed workspace authorities - #4718

Open
jjj-n wants to merge 2 commits into
apache:mainfrom
jjj-n:codex/maka-3522-managed-workspace-doc-audit
Open

docs(architecture): audit managed workspace authorities#4718
jjj-n wants to merge 2 commits into
apache:mainfrom
jjj-n:codex/maka-3522-managed-workspace-doc-audit

Conversation

@jjj-n

@jjj-n jjj-n commented Sep 4, 2026

Copy link
Copy Markdown

Summary

  • bring the live Workspace Version Authority document forward to runtime schema 15, including causal successor projections and the current schema-10 migration evidence;
  • replace the obsolete macOS/Windows crash-proof matrix with the Linux CI and Windows recovery gates that actually run today;
  • mark the managed dependency storage authority as the merged feat(storage): add managed dependency artifact authority #2485 foundation, retain its no-production-consumer boundary, and point the remaining producer/supply-chain/consumer work at tracking(storage): complete managed dependencies #4326;
  • link the separate managed mutation lifecycle authority instead of leaving the successor contract implicit.

Three other paths originally listed in this subsystem were intentionally deleted by #4174 with the dormant Git workspace write path, so this audit does not restore them.

Refs #3522

Verification

  • npm run format:check — 1,922 files checked, no fixes required
  • npm run lint — 3,224 files checked, no fixes required
  • npm run build --workspace @maka/core
  • npm run build --workspace @maka/storage
  • NODE_NO_WARNINGS=1 node --test --test-concurrency=1 packages/core/dist/__tests__/workspace-version-authority.test.js packages/storage/dist/__tests__/workspace-version-authority-persistence.test.js packages/storage/dist/__tests__/sqlite-recovery-concurrency.test.js packages/storage/dist/__tests__/sqlite-runtime-crash.test.js packages/storage/dist/__tests__/managed-dependency-environment.test.js packages/storage/dist/__tests__/managed-dependency-environment-crash.test.js — 85 passed, 2 POSIX-only cases skipped on Windows, 0 failed
  • git diff --check
  • all four relative architecture links and all five implementation/test paths named by the two live documents resolve on main

Without NODE_NO_WARNINGS=1, Node 24.11.1 emits the node:sqlite ExperimentalWarning on the owner child process's stderr before READY; that pre-existing test treats any stderr as failure. The same owner/crash file passes 5/5 with only that runtime warning suppressed.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: OpenAI Codex audited the current implementation, migrations, CI routes, tests, issue/PR history, and drafted the documentation corrections. The human contributor remains responsible for the submitted result.

Checklist

  • Tests cover the change and fail without it — documentation-only change; existing authority and crash suites were used as implementation evidence
  • Lint, format, typecheck and the affected suites pass locally — formatting, core/storage builds, and focused suites were run as listed above

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

Generated-by: OpenAI Codex
Signed-off-by: jjj-n <1357598741@qq.com>
@github-actions github-actions Bot added the effort/S Under 100 readable lines label Sep 4, 2026

@hqhq1025 hqhq1025 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed exact head c370f92215a607a7a16de8aaff52a0591aa3b86d. The diff updates the managed-dependency foundation status and brings the workspace-version document forward to schema 15, successor/mutation projections, current migrations, and current CI claims. I checked the two documents against the merged #2485 implementation, the mutation lifecycle authority, schema migrations and projection rebuild/read paths, #4174's removals, #4326's remaining-work tracker, and the Windows workflows.

Local validation passed: repository format and lint, Core and Storage builds, ASF headers, git diff --check, and the six focused authority/recovery suites (83 passed, 4 Windows-only skips on Linux, 0 failed). Hosted test is green, and the head merges cleanly with current main at 5846521372d2dd0d3d2d33dc7784dd046dc3f7c8. I did not run native Windows or power-loss validation.

Two P2 documentation findings remain inline.

Automated review notice: This comment was posted by an automated review agent operated by hqhq1025. It is not an independent human review and does not replace one.

|---|---|
| 协议 owner | `@maka/core` 的 strict fact contract 与 pure scanner |
| baseline 写入 owner | storage-internal WeakMap writer;不属于 package API当前没有 production baseline producer;独立 successor/mutation writer 不由旧 owner 提供 |
| 写入 owner | baseline 与 successor/mutation writer 都是 storage-internal seam,不属于 package API当前没有 production producer/consumer |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[P2] Keep this table consistently scoped after adding mutation writers. This new row broadens the table to baseline and successor/mutation writers, but the following rows still define the canonical source as exactly two RuntimeEvents, disposable state as only the three baseline projections, and rollback as five baseline parts. That is no longer the schema-15 authority described by this row: sqlite-runtime-store.ts:1781-1826 also validates the tool T1/outcome evidence for every successor and derives active mutation reservations, while sqlite-runtime-store.ts:1715-1740 rebuilds runtime_managed_mutation_reservations alongside the three version projections. A future consumer following this current implementation contract could omit required mutation facts or reservation state. Please either scope the whole table explicitly to the baseline transaction or update all of these rows to describe the full mutation ledger and its separate transaction boundaries.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed: the section now scopes the table explicitly to the baseline transaction. The intro states that the mutation ledger, per-successor tool T1/outcome evidence validation, active mutation reservations derivation, and the runtime_managed_mutation_reservations projection rebuild with its separate transaction boundaries are defined by the Managed Mutation Lifecycle Authority document, and that the canonical source, disposable state, and rollback rows cover only the baseline parts. The writer-owner row states the same limitation explicitly.

| 真实 SIGKILL crash harness | 发布门槛 | 发布门槛 | 当前不承诺 |
| SQLite bundle 原子性 | 支持 | 实现预期;无独立 recovery gate | 支持 |
| 多进程 exact/conflict arbitration | 支持 | 实现预期;无独立 recovery gate | recovery/baseline gate |
| schema 10→current 并发升级 | 支持 | 实现预期;无独立 recovery gate | recovery/baseline gate |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[P2] Do not describe the scheduled non-blocking Windows lane as a gate. The test that proves both multi-process arbitration and schema-10 migration, sqlite-recovery-concurrency.test.js, appears only in .github/workflows/windows-baseline.yml:156-175. That workflow is schedule/manual-only, and both its job and storage step are continue-on-error; .github/workflows/windows-recovery.yml does not run this suite, and its pull-request path filter does not include the SQLite workspace-authority implementation or tests. This exact head consequently has only the Linux test check. Please label these two matrix entries as non-blocking scheduled Windows evidence, or wire the suite into a blocking Windows workflow before calling it a recovery/baseline gate.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed: both matrix entries are now labeled as non-blocking scheduled Windows evidence, and a note under the matrix documents that the arbitration and schema-10 concurrency evidence comes from the schedule/manual windows-baseline.yml lane with continue-on-error, that blocking windows-recovery.yml neither runs sqlite-recovery-concurrency.test.js nor covers the workspace-authority implementation and tests in its PR path filter, and that blocking CI evidence for the workspace authority is currently provided by the Linux test check only.

@hqhq1025 hqhq1025 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed exact head f3389555d16db4909c410ca0f5a506321db0935f. The follow-up correctly closes both earlier documentation findings: section 2 now scopes the canonical facts, projections, rollback, and transaction rows to the baseline writer while delegating successor/mutation ownership to the linked lifecycle authority; section 9 now labels the Windows arbitration/migration coverage as scheduled non-blocking evidence and accurately states that the blocking recovery workflow does not run that suite or watch those paths.

I found no remaining P0-P3 issue in this increment. I checked the claims against .github/workflows/windows-baseline.yml, .github/workflows/windows-recovery.yml, the linked mutation-authority document, and the current schema/projection implementation. Repository formatting, ASF header audit, git diff --check, exact-head hosted test, and a clean patch-preserving merge onto current main dd7d1d595b7f9284e01fe76cf547c979a6d84a0a passed. I did not rerun native Windows or power-loss tests for this documentation-only increment.

Automated review notice: This comment was posted by an automated review agent operated by hqhq1025. It is not an independent human review and does not replace one.

@github-actions github-actions Bot added effort/M Under 500 readable lines and removed effort/S Under 100 readable lines labels Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/M Under 500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants