docs(p02): record dual slot handoff checkpoint
一些检测仍在等待运行
ci / Portable quality checks (push) Waiting to run
ci / Windows Tauri build (push) Waiting to run

这个提交存在于:
YokiiroBW 2026-07-19 21:39:18 +08:00
父节点 bcc08cf29c
当前提交 8eacb3652c
共有 3 个文件被更改,包括 102 次插入 和 6 次删除

查看文件

@ -100,6 +100,10 @@ Add durable companion and operations slot assignment, then build two independent
- Companion Profiles never gain local-tool authority from slot assignment alone.
- The provisional `/desktop/v1` contract and Mock Gateway are not evidence of compatibility with an unreviewed real AstrBot Gateway.
### First increment
### First increment (completed)
Implement SQLite schema v3 for the two fixed slot assignments, bounded list/assign/clear commands, database and command tests, and a minimal Profile-slot settings surface. This increment intentionally excludes network activation and credential values.
Completion commit: `bcc08cf feat(connection): add persistent dual slot assignment`.
The next increment starts with auto-connect validation, operations switching protection, and duplicate server-instance warnings. Development is paused at this checkpoint for cross-machine handoff.

查看文件

@ -2,7 +2,7 @@
## Current phase
P01 foundation was merged through Forgejo PR #2 at `885abd1`. Development now continues on `feat/p02-dual-connections`, starting with persistent companion/operations slot assignment and its local safety constraints.
P01 foundation was merged through Forgejo PR #2 at `885abd1`. The first P02 increment is complete on `feat/p02-dual-connections`: persistent companion/operations slot assignment and its local safety constraints. Further implementation is paused for cross-machine handoff.
## Completed
@ -32,15 +32,20 @@ P01 foundation was merged through Forgejo PR #2 at `885abd1`. Development now co
- Created `feat/p02-dual-connections` from the updated `main`.
- Re-read `AGENTS.md`, the Forgejo workflow, architecture design, and implementation task documents in full for P02.
- Kept the approved HTTP Forgejo URL repository-local and prevented the machine-wide HTTP-to-SSH rewrite from changing this repository's transport.
- Added SQLite schema v3 with exactly two fixed connection slot rows.
- Added foreign-key cleanup so deleting a Profile clears its assigned slot.
- Enforced that one Profile cannot occupy both companion and operations slots.
- Added bounded Rust list/assign/clear slot commands that reject unknown fields and malformed Profile IDs.
- Added strict frontend slot Schemas and a minimal settings UI that does not activate network connections or read credentials.
- Added v1-to-current and v2-to-v3 migration coverage, slot persistence tests, duplicate-assignment tests, and frontend slot interaction coverage.
- Completed the first P02 increment in `bcc08cf`.
## In progress
- P02 first increment: SQLite schema v3 and bounded companion/operations slot assignment.
- Protocol/security review for credential lifecycle, real Gateway authentication, authoritative server identity, and certificate-change freeze behavior.
- Source-side handoff packaging only; no additional product implementation is in progress.
## Remaining
- Implement and verify the P02 slot persistence and UI increment.
- Implement auto-connect validation, operations switching protection, and duplicate server-instance warnings.
- Implement the formal Rust-owned credential lifecycle without returning secret values to React.
- Implement two independent configured REST/SSE runtimes only against a reviewed contract; continue using the dual Mock Gateway for deterministic tests.
@ -72,6 +77,13 @@ P01 foundation was merged through Forgejo PR #2 at `885abd1`. Development now co
- NSIS installer: passed; `0.1.0-alpha.1`, 3,827,899 bytes.
- NSIS SHA-256: `90EB68CDB5EAEDEA675050DA0F30DDAB5E8A0345FF176690A31FA5F66C818740`.
- Forgejo CI and a real UNC transaction were not executed and are not claimed successful.
- P02 frontend checks: passed; Prettier, ESLint, TypeScript, 4 Vitest tests, and Vite production build.
- P02 Playwright Chromium: passed 1/1.
- P02 Rust fmt, Clippy with warnings denied, and all-target check: passed.
- P02 Rust workspace tests: passed; 56 normal tests, 2 explicit manual tests ignored.
- P02 v2-to-v3 migration: passed without losing the existing Profile row.
- P02 changed-file secret scan: passed; no private-key header, long Bearer credential, AWS key, GitHub token, or OpenAI-style key pattern was found.
- Tauri development startup and Windows installer build were not rerun for this incremental checkpoint and are not claimed.
## Current branch
@ -79,6 +91,8 @@ P01 foundation was merged through Forgejo PR #2 at `885abd1`. Development now co
## Recent commits
- `bcc08cf feat(connection): add persistent dual slot assignment`
- `73693b9 docs(p02): start dual connection phase`
- `885abd1 Merge pull request 'feat(p01): add secure profile foundation and management UI' (#2) from feat/p01-foundation into main`
- `b3420e4 Merge pull request 'feat(p00): bootstrap Tauri desktop and validate high-risk spikes' (#1)`
- `ed74342 feat(foundation): add persistent bootstrap safeguards`
@ -90,4 +104,4 @@ P01 foundation was merged through Forgejo PR #2 at `885abd1`. Development now co
## Next step
Complete the persistent companion/operations slot increment, run the relevant frontend and Rust checks, commit it as a focused Conventional Commit, and push `feat/p02-dual-connections` normally.
After the handoff destination accepts the exact pushed SHA, continue with auto-connect validation, operations switching protection, and duplicate server-instance warnings. Do not enable real Gateway connections until PD-0009 through PD-0012 are resolved.

查看文件

@ -0,0 +1,78 @@
# P02 dual-slot checkpoint and handoff
Date: 2026-07-19
## Source state
- Branch: `feat/p02-dual-connections`
- Base merge: `885abd1553ed8f1428de7118a6f4b59f7e22a45c`
- Planning commit: `73693b9 docs(p02): start dual connection phase`
- Feature commit: `bcc08cf feat(connection): add persistent dual slot assignment`
- Remote transport: approved ordinary Forgejo HTTP push
- Force push, rebase, and automatic main merge: not used
## Completed scope
- SQLite schema v3 creates exactly two fixed rows: `companion` and `operations`.
- A foreign key clears slot assignment when a Profile is deleted.
- A unique Profile constraint prevents one Profile from occupying both slots.
- Rust exposes bounded list, assign, and clear commands.
- Slot requests reject unknown fields, malformed Profile IDs, missing Profiles, and duplicate cross-slot assignment.
- The frontend validates Rust payloads with strict Zod Schemas.
- The settings UI assigns or clears Profiles without activating REST/SSE or reading credentials.
- Stored `server_instance_id` is displayed as metadata only; the increment does not enroll or silently replace server identity.
## Security boundary
- No Token, password, API Key, Cookie, Authorization header, or NAS credential field was added to slot IPC.
- Slot assignment alone grants no local-tool permission.
- React does not receive stored credentials.
- Real Gateway compatibility, token refresh, identity enrollment, and certificate pinning remain explicitly unresolved in PD-0009 through PD-0012.
## Verification
- `npm.cmd --prefix H:\AstrBot-Desktop run check:frontend`: passed.
- Prettier: passed.
- ESLint: passed.
- TypeScript: passed.
- Vitest: 4 passed.
- Vite production build: passed.
- `npm.cmd --prefix H:\AstrBot-Desktop run test:e2e`: passed, Chromium 1/1.
- `cargo fmt --all --manifest-path H:\AstrBot-Desktop\Cargo.toml -- --check`: passed.
- `cargo clippy --workspace --all-targets --manifest-path H:\AstrBot-Desktop\Cargo.toml -- -D warnings`: passed.
- `cargo check --workspace --all-targets --manifest-path H:\AstrBot-Desktop\Cargo.toml`: passed.
- `cargo test --workspace --manifest-path H:\AstrBot-Desktop\Cargo.toml`: passed, 56 normal tests and 2 explicit manual tests ignored.
- Changed-file high-risk secret pattern scan: passed with no matches.
Not rerun at this incremental checkpoint:
- real Tauri development startup;
- Windows release or NSIS build;
- Forgejo Actions;
- real AstrBot Gateway compatibility;
- real UNC file transaction.
No success is claimed for the items above.
## Remaining P02 work
1. Add auto-connect validation for at most two Profiles and one Profile per slot.
2. Block Operations Profile switching while an operations task is active.
3. Add duplicate `server_instance_id` warnings without silent identity merging.
4. Resolve the credential enrollment and rotation lifecycle.
5. Resolve first-contact server identity confirmation.
6. Implement validated certificate fingerprint binding without disabling TLS verification.
7. Only then enable two independent configured REST/SSE runtimes and Mock-backed failure tests.
## Handoff status
The first controller status call failed before project lookup because the global dev-handoff config references missing files:
- identity file: `C:\Users\Administrator\Documents\Codex\2026-07-14\ke\work\ssh\astrbot_vm_ed25519`
- known-hosts file: `C:\Users\Administrator\Documents\Codex\2026-07-14\ke\work\ssh\known_hosts`
The controller also reported host-key verification failure. No handoff ID, VM workspace, branch, or HAPI session has been created or claimed.
## Next concrete step
Restore or reconfigure the authorized VM SSH identity and known-hosts paths, rerun `dev-handoff status`, then send this exact pushed checkpoint to `vm-codex`. If the controller stops at `ready_to_accept`, report that state honestly and wait for the VM worker.