Skip to content

docs: freeze vNext phase 0 contracts - #87

Merged
Dailin521 merged 1 commit into
mainfrom
feat/vnext-phase-0-contracts
Aug 24, 2026
Merged

docs: freeze vNext phase 0 contracts#87
Dailin521 merged 1 commit into
mainfrom
feat/vnext-phase-0-contracts

Conversation

@Dailin521

Copy link
Copy Markdown
Owner

Summary

  • add Accepted vNext/ADR-0001 through ADR-0010
  • freeze the current v0.5 Node Core and CLI compatibility surfaces
  • define canonical vNext error codes and legacy adapter mappings
  • define behavior-fixture semantics and the staged PR execution index
  • record the current cross-runtime lock contract and the unresolved shared-SQLite-Home and Restore transaction safety gaps
  • link the phase-0 baseline from README and AGENTS.md

Scope

Documentation only. This PR does not change runtime code, CLI output, exit codes, error classes, or released behavior.

Validation

  • git diff --check
  • all local Markdown links resolve
  • ADR inventory/metadata check: 10 Accepted vNext ADRs and 5 contract/migration documents
  • npm run web:build
  • focused Node suite: 88 tests, 86 passed, 2 Windows-only skipped
  • independent adversarial review: no remaining findings

The full local npm test was also attempted. This Work Mode sandbox cannot run ps -p <pid> -o lstart= (fatal library error, lookup self), so lock-dependent tests fail before their assertions. GitHub CI is the authoritative full-suite gate.

@Dailin521
Dailin521 merged commit c7ff852 into main Aug 24, 2026
8 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 81561200ab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


- 备份路径必填;
- 使用同一 Codex Home 的 restore 锁;
- 备份 metadata 与 session manifest 必须合法并绑定当前 Codex Home;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Scope session-manifest validation to session restores

For a normal backup with no pending journal, restore --no-sessions currently validates metadata.json but never reads session-meta-backup.json, because restoreBackup gates that validation on restoreSessions. This line therefore freezes a stricter behavior than v0.5: a missing or malformed session manifest would currently still permit a config/DB-only restore, while future adapters or contract tests following this document may reject it. Qualify the requirement as applying when sessions are selected (or when pending-recovery coverage requires the manifest).

AGENTS.md reference: AGENTS.md:L9-L13

Useful? React with 👍 / 👎.

| `root-model` | 根级 model、Provider section model 与 turn_context model 不同 | Follow/Keep/Explicit 三种 Switch 语义清晰;非目标字段和换行符不变 |
| `encrypted-content` | rollout 含来自原 Provider 的 `encrypted_content` | 只同步可见性元数据;保留加密内容字节并返回明确 warning |
| `large-rollout` | 超大 rollout、超过 64 KiB 的行、Unicode 与特殊 model 字符 | 流式处理且目标字段正确;未修改字节、CRLF 与原 mtime 按合同保持 |
| `malformed-rollout` | 截断、无效 JSONL、文件扫描期间消失等 | 不读取越界、不覆盖无法证明安全的内容;按操作返回 skip/error 并保留原字节 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Record malformed rollout rewriting as a migration gap

When a malformed non-header JSONL line still contains a recognizable turn_context and model field, the current Node implementation rewrites that line using raw regular expressions; for example, a truncated line ending after "model":"old" is changed to the target model rather than preserved. This expected result therefore does not describe v0.5 behavior and would conceal a Node/.NET parity difference. Mark preservation as a target safety change with the current behavior explicitly recorded, or defer this expectation until the implementation and regression test land.

AGENTS.md reference: AGENTS.md:L9-L13

Useful? React with 👍 / 👎.


| Legacy Code / 状态 | Canonical Code | 映射要求 |
| --- | --- | --- |
| `RECOVERY_REQUIRED`、`recovery_required` | `RECOVERY_REQUIRED` | 保留备份路径、operationId 与恢复要求 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Map pre-existing journals to PENDING_TRANSACTION

When a write is blocked by an already-pending journal, the current RecoveryRequiredError carries the legacy code RECOVERY_REQUIRED, but the canonical table assigns that scenario to PENDING_TRANSACTION. This blanket mapping sends the typed blocker back to RECOVERY_REQUIRED, making PENDING_TRANSACTION effectively unreachable through the planned adapter and conflating a pre-existing recovery blocker with an incomplete automatic rollback. Split the mapping by exception type or operation context so RecoveryRequiredError maps to PENDING_TRANSACTION while genuine rollback failures remain RECOVERY_REQUIRED.

AGENTS.md reference: AGENTS.md:L9-L13

Useful? React with 👍 / 👎.


| Fixture ID | 运行方式 | 关键预期 / 安全门槛 |
| --- | --- | --- |
| `locked-rollout` | 平台真实文件锁 | 锁定文件不被写;其他安全目标可形成 Partial Result;返回 `ROLLOUT_LOCKED` 语义并可重试 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Qualify locked-rollout parity by platform

On Linux and macOS, the current Node implementation does not test or honor advisory rollout locks: splitLockedSessionChanges returns every change as writable whenever process.platform !== "win32", and ordinary POSIX reads and renames are not blocked by another process holding flock. Consequently this cross-platform fixture's assertion that a platform-real locked file is never written cannot pass for the current Node baseline. Record the Unix behavior as an unresolved migration gap or scope the current expectation to Windows until compatible Unix lock detection is implemented and tested.

AGENTS.md reference: AGENTS.md:L58-L63

Useful? React with 👍 / 👎.

@Dailin521
Dailin521 deleted the feat/vnext-phase-0-contracts branch August 24, 2026 08:52
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