merge: 集成 Codex 风格上下文压缩交互

This commit is contained in:
2026-08-15 08:51:02 +08:00
18 changed files with 2029 additions and 80 deletions

View File

@@ -12,6 +12,7 @@
## Scope
- On 2026-08-15, resume the existing Integration owner to merge reviewed source commit `fd9b5b46a913c515e94e4e26f185d43866c2581f` for the Codex-style AI Programming context-compaction timeline into local `main` and promote its accepted lifecycle facts.
- On 2026-08-14, resume the existing Integration owner to merge reviewed AI Canvas source commit `22378efcee07e7fb80b651e65e3202f1a1dfea1d` into local `main` and promote its accepted project-memory candidates.
- Resume the existing integration owner to fast-forward the completed Robot / AI hardware source commit into local `main` after verifying the current remote `main` tip.
- Fetch the authoritative remote `main`, inspect all commits not present in the
@@ -37,6 +38,7 @@
- Push only after the merge result is clean, verified, and independently
reviewed. Never use `--force`.
- The 2026-08-14 user request authorizes the local `main` merge only. It does not expand this resumption into a remote push; the existing authentication blocker remains a separate follow-up.
- The 2026-08-15 context-compaction request likewise authorizes only a local `main` merge. It does not authorize a remote push or changing the existing OpenCode/model compaction threshold.
## Project Context Loaded
@@ -93,6 +95,15 @@ Gate result:
- Read the source task, ADR-001, canonical AI Canvas architecture/domain memory, and all registry-owned peer task Scope / Intent / Promotion Candidate sections. The source preserves Workspace-owned tasks and Conversation-owned state; no semantic conflict requires human resolution.
- Gate result: Passed for the local AI Canvas merge. Remote push remains outside this resumption.
### 2026-08-15 Context Compaction Integration Resume
- Reused the existing Integration owner because it still exclusively owns `main` and the repository integration lock; `task_context.py touch` refreshed the reservation.
- Verified the main worktree was clean at `953b0f491e44036bc8273fb29dd880e38defae24`, with local `main` two commits ahead of the locally tracked `origin/main`.
- Source task `20260814-codex-compaction-ux-74b3f2a1` was `ready_for_integration`, its final Sol review returned PASS, and source commit `fd9b5b46a913c515e94e4e26f185d43866c2581f` is exactly one direct descendant of current `main`.
- Read the active integration record, source task outcome/verification/promotion candidate, canonical AI Programming architecture/current-state memory, and every registered peer task Scope / Intent / Promotion Candidate section.
- The related threshold and UI-audit tasks agree with the source: automatic compaction remains OpenCode/model-limit-owned, while this source changes only the persistent Renderer interaction and run lifecycle. No semantic conflict requires human resolution.
- Gate result: Passed for the local context-compaction merge. Remote push remains outside this resumption.
## Plan
1. Fetch `origin/main` and verify local `main`, the remote tip, and reviewed AI Canvas source commit topology.
@@ -101,6 +112,14 @@ Gate result:
4. Re-run focused/full checks, production build, project-document gates, and independent Sol review.
5. Commit the verified local merge; do not push unless the user separately requests it and authentication is available.
### 2026-08-15 Context Compaction Integration Plan
1. Form the already verified feature worktree into a dedicated source commit without changing its reviewed files.
2. Merge the direct child into local `main` with a normal no-ff merge and preserve source history.
3. Promote the per-session persistent compaction timeline and `session.compacted != session.idle` invariant into canonical current-state, architecture, evidence, and upgrade commitments.
4. Re-run focused/full unit checks, typecheck, lint, production build, Electron E2E, document drift, and whitespace checks on the merged tree.
5. Obtain an independent read-only Sol PASS/FAIL review, record the result, and keep remote push outside this request.
## Outcome
- On 2026-08-13, resumed this integration task for the user's local-main merge request. `git fetch origin main --prune` succeeded and confirmed `origin/main=22add3f01f2b7cb6318495e8294db006f6f18abf`.
@@ -164,6 +183,9 @@ Gate result:
- The first independent AI Canvas merge review returned `FAIL` on two integration gaps and one safety subfinding: stale confirmation task-refresh errors could overwrite a newer Conversation error, top-level structured WebSocket command errors lacked focused coverage, and unknown Gateway messages could expose upstream details. Confirmation reconciliation now uses an internal task refresh without UI-error side effects; explicit user refreshes retain their error behavior. Matching WebSocket errors are tested as non-retryable, and unknown codes project a fixed Chinese fallback instead of the server message.
- The second independent Sol review returned `PASS` with no blocking findings after those corrections. The verified no-ff merge is ready to commit with `88f9ee8` as first parent and `22378ef` as second parent.
- This resumption intentionally does not push. The previous remote authentication follow-up remains unchanged and does not block completion of the user's requested local merge.
- On 2026-08-15, formed the reviewed context-compaction implementation into source commit `fd9b5b46a913c515e94e4e26f185d43866c2581f`; its parent is exactly current local `main` (`953b0f4`) and the source worktree is clean.
- Started a normal `--no-ff --no-commit` merge of `fd9b5b4` into local `main`; Git reported no textual conflicts. The source task record remains unchanged on `fd9b5b4` and its feature branch and is excluded from the `main` result to preserve task-document ownership boundaries.
- Promoted the accepted compaction facts into canonical current-state, module map, data flow, evidence, and upgrade commitments: compaction is a persistent per-session transcript event, completed status is monotonic, and `session.compacted` cannot end the run or release queued prompts.
## Verification
@@ -200,6 +222,13 @@ Gate result:
- Final post-review `pnpm run build:vite` — Renderer, Electron Main, and Preload passed; only the existing mixed-import and chunk-size warnings remain.
- Second independent final review — `PASS`; it re-ran 4 files / 102 tests plus typecheck, found no unmerged entries or unstaged changes, and confirmed the previous state-isolation, structured-error coverage, and redaction findings are closed.
- Final project-document ownership drift, structure checks, and staged/unstaged whitespace checks — passed before the merge commit.
- 2026-08-15 context-compaction focused selection — 3 files / 236 tests passed on the merged `main` tree.
- 2026-08-15 `pnpm test` — 156 files / 1712 tests passed on the merged `main` tree.
- 2026-08-15 `pnpm run typecheck` — passed.
- 2026-08-15 `pnpm run lint:check` — passed with 0 errors and the same 6 existing warnings outside the merge paths.
- 2026-08-15 `pnpm run build:vite` — Renderer, Electron Main, and Preload production builds passed; only existing chunk-size and mixed-import warnings remain.
- 2026-08-15 Electron E2E selection — `tests/e2e/opencode-slash-commands.spec.ts` passed 3/3, including the manual compaction running-to-completed timeline transition.
- 2026-08-15 staged/unstaged whitespace checks and project-document structure passed; task-aware drift passed after retaining the source task record only on the feature branch.
## Follow-ups
@@ -215,7 +244,8 @@ Gate result:
- Authenticate `git.nianxx.cn` through the local Git credential manager or an
authorized SSH key, then resume this same task to push and verify remote tip
equality. Do not paste a personal access token into the task conversation.
- When bundled OpenCode or the model context profile changes, run a real long-context compaction smoke to reconfirm native Part fields and event ordering; the current Electron E2E uses a controlled EventSource through the real Store/Renderer lifecycle rather than launching OpenCode.
## Promotion Candidates
- None recorded.
- The context-compaction source candidate was promoted into current state, module map, data flow, evidence, and upgrade commitments. No unresolved candidate remains for this local merge.