Skip to content

feat: freeze dual-edition contract and add gated Basic policy core - #1

Merged
forgottenlab merged 2 commits into
mainfrom
feat/dual-edition-basic-policy
Nov 24, 2026
Merged

forgottenlab merged 2 commits into
mainfrom
feat/dual-edition-basic-policy

Conversation

@forgottenlab

@forgottenlab forgottenlab commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

本 PR 完成双版本架构 Phase 0 到 1b:冻结 Basic / Professional 合同、可复用且无副作用的 Basic 策略核心、真实 Windows 快捷方式与磁盘适配器,以及默认关闭的入口开关。这是后续启动入口、数据目录隔离和 Basic 专用导出 runner 之前的可审查检查点。

改动 / What changed

  • Phase 0 — 合同冻结: docs/dual-edition-phase0-contract.md,合成夹具位于 tools/fixtures/dual_edition_phase0/,测试为 tools/check_dual_edition_contract_smoke.py。合同已文档化并经过测试,但还不是默认产品路径。
  • Phase 1a — Basic 策略核心: shared/basic_policy.py 会校验完整计划(含已禁用步骤),在反序列化前拒绝未知原始 JSON 字段,并通过可注入的文件系统、磁盘分类和 LNK 解析接口工作。测试:tools/check_basic_policy_phase1a_smoke.py。
  • Phase 1b — Windows 适配器与门控接入:
    • shared/platform/windows_shell_links.py:IShellLink / COM 解析器(不回退到 os.startfile)
    • shared/platform/windows_drives.py:用 GetVolumePathNameW / GetDriveTypeW 识别映射盘和远程卷
    • shared/edition_policy.py:版本上下文;仅在上下文明确为 basic 时执行 Basic 校验
    • 在计划加载、模板、编辑器预检、RuntimeExecutor.run_plan(),以及 build_single_file_exe()(在创建输出目录或查找 PyInstaller 之前)加入了门控钩子

当前产品路径仍保持 Professional / 单一产品:未设置版本上下文时,Command、Wait、高级 App 配置、现有 LNK 的 shell_open 行为、离线许可和当前导出授权都不变。

本 PR 不包含以下后续工作:

  • Basic / Professional 启动入口,以及启动时设置进程级版本上下文
  • Basic 数据目录隔离(LaunchFlow-Basic),且不探测、不迁移 Professional 数据
  • 受限的 Basic 导出 runner(本 PR 不改动 EMBEDDED_TEMPLATE)
  • 对 Professional 导出授权的单独审计

检查 / How it was checked

在指定的 Miniconda 解释器上运行(Python 3.13.9,PySide6 6.9.3,PyInstaller 6.20.0,cryptography 46.0.3):

  • tools/check_dual_edition_contract_smoke.py
  • tools/check_basic_policy_phase1a_smoke.py
  • tools/check_basic_policy_phase1b_smoke.py
  • 既有无副作用的 path、app_paths、data-migration、coupling、application、URL 和 docs 冒烟测试
  • python -m compileall -q editor runtime shared tools licensing

未调用 PyInstaller,未构建发布产物,也未接触真实许可证或 HWID。

工作区中与本次无关的本地改动(.ai/、CHANGELOG.md 以及部分既有文档)未纳入本 PR。

English Summary

This PR lands Dual Edition Phases 0–1b: the frozen Basic/Professional contract, a side-effect-free Basic policy core, real Windows shortcut and drive adapters, and ingress hooks that stay off unless the edition context is explicitly basic. The current Professional / single-product path is unchanged. Launch entries, Basic data-directory isolation, a Basic-only export runner, and a Professional export-authorization audit are left for follow-up branches. Checks ran on the specified Miniconda interpreter; PyInstaller, release assets, and live licenses/HWID were not touched.

@forgottenlab
forgottenlab merged commit 021adc9 into main Nov 24, 2026
1 check passed
@forgottenlab
forgottenlab deleted the feat/dual-edition-basic-policy branch November 24, 2026 05:42
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