Skip to content

feat(storage): bind and cancel managed dependency admission - #2622

Closed
zhiiw wants to merge 20 commits into
apache:mainfrom
zhiiw:codex/managed-admission-cancellation-authority
Closed

feat(storage): bind and cancel managed dependency admission#2622
zhiiw wants to merge 20 commits into
apache:mainfrom
zhiiw:codex/managed-admission-cancellation-authority

Conversation

@zhiiw

@zhiiw zhiiw commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Stacked Draft: depends on #2621. Until the lower slices merge, GitHub's upstream comparison is cumulative. Do not merge this PR before #2621.

Summary

Binds attested dependency environments to managed workspace execution and makes admission lifecycle authoritative across storage owners. This slice owns dependency binding, canonical node_modules routing, dependency singleflight, abandoned-publication replacement, baseline admission cancellation, and owner drain.

Primary invariant

Only an owner-bound, cancellable, and drainable managed admission may issue an execution scope. Cancellation or Host drain must prevent scope issuance or revoke the abandoned acquisition, and a new caller must never inherit a previous caller's aborted singleflight publication.

  • Owner: managed workspace storage owner
  • Atomicity boundary: root admission lock + validated source baseline + dependency lease + revocable execution scope
  • Failure state: source drift, abort, invalid dependency routing, or cancelled publication fails closed; there is no managed-worktree fallback
  • Rollback: remove dependency-mode admission while preserving canonical-tree managed execution

Verification

  • Storage, Runtime, and Runtime Host builds/typecheck passed.
  • Managed dependency/workspace owner suites: 39 passed, 3 platform-conditional skipped on Windows.
  • Covers source drift, shared publications, last-waiter abort/new-waiter races, baseline cancellation, scope issuance cancellation, owner drain, and canonical node_modules routing.

Stack

  1. durable dependency artifact authority (feat(storage): add managed dependency artifact authority #2485, merged)
  2. constrained npm producer (feat(runtime-host): constrain managed npm dependency provisioning #2620)
  3. bundled npm runtime attestation (feat(runtime-host): attest the bundled npm runtime #2621)
  4. This PR: owner-bound and cancellable managed admission authority
  5. production managed inspection task + crash/replay proof
中文说明

**堆叠 Draft:**依赖 #2621。前置切片合并前,上游比较会暂时显示累计 diff;请勿提前合并。

本切片把 dependency execution binding 与 admission cancellation 收敛到同一个 storage owner:只有经过 canonical source baseline、dependency lease 和取消检查后,才能签发可撤销 execution scope。

source drift、非法 dependency 路径和已撤销 singleflight publication 都会 fail closed,不会回退到 managed worktree 的同名目录。

@zhiiw
zhiiw force-pushed the codex/managed-admission-cancellation-authority branch 3 times, most recently from f92c4c3 to 30d982a Compare August 16, 2026 03:58
@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f756cf53-dd05-4644-b2dc-eefb37014cde

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@zhiiw
zhiiw force-pushed the codex/managed-admission-cancellation-authority branch 2 times, most recently from 9c25870 to 090035d Compare August 16, 2026 04:19
@zhiiw
zhiiw force-pushed the codex/managed-admission-cancellation-authority branch from 090035d to 6683551 Compare August 23, 2026 05:24
@zhiiw

zhiiw commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

Rebased this Draft on the rebuilt npm-attestation branch and current main.

The only source conflict was the placement of AsyncLocalStorage; the ASF license header and the admission/cancellation behavior were both preserved. Core and Storage build successfully when rebuilt in dependency order. The owner suite exercised source drift, cancellation, drain, bridge routing, and owner binding; one Windows case remains environment-blocked because fsutil file queryStreams returns exit code 1 during ADS inspection.

中文说明

该 Draft 已基于重建后的 npm attestation 分支与最新主线更新。唯一源码冲突是 AsyncLocalStorage 的位置,ASF 许可证头与 admission/cancellation 行为都已保留。按依赖顺序构建 Core、Storage 可以通过。Owner 定向测试覆盖 source drift、取消、drain、bridge routing 与 owner binding;当前 Windows 环境仍有 1 项因 ADS 探测时 fsutil file queryStreams 返回 1 而受阻,我没有把它误报为全绿。

@zhiiw

zhiiw commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

Closing this Draft as superseded.

The managed admission and cancellation authority has been migrated into the rebuilt M1.3 prerequisites and Gitoxide-based product composition. The design discussion and review history here remain useful, but this branch will not be merged or developed further.

Replacement:

中文说明

关闭此 Draft,标记为已被新实现替代。

managed admission 与 cancellation authority 已迁移到重建后的 M1.3 前置能力和基于 Gitoxide 的产品组合中。本 PR 的设计讨论和审查记录仍会保留,但该分支不会继续开发或合并。

替代实现:

@zhiiw zhiiw closed this Aug 24, 2026
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