feat: add send connector preflight probes

This commit is contained in:
zhaoyilun
2026-07-10 13:37:08 +08:00
parent b2ce7b0e36
commit 1f99681348
11 changed files with 1307 additions and 25 deletions

View File

@@ -28,9 +28,9 @@
| Search contacts | Registered MCP tool; deterministic exact-match ranking and case-insensitive de-duplication across log/JID candidates and optional copied-DB MsgLib display enrichment. | Optional richer fields such as department/title remain future enrichment, not a core search blocker. | complete for core search; optional enrichment later |
| Search groups | Registered MCP tool; deterministic exact-match ranking and case-insensitive de-duplication across groupchat/conference candidates and optional copied-DB MsgLib display enrichment. | Optional member count, owner refs, and nested/group hierarchy remain future enrichment, not a core search blocker. | complete for core search; optional enrichment later |
| Receive messages | PacketReader source works; copied `MsgLib.db` explicit receive works with `source_preference="msglib_readonly"`; R1 precheck says default should remain PacketReader until a future reconciliation helper is implemented. | Future reconciliation helper, source confidence scoring, pagination policy. | future receive helper after R2/R3 |
| Send messages | Contract exists; R5b returned live probe confirms B-route runtime environment and A-route UIA controls, but not production send. | Need non-mutating entrypoint preflight, offline-state handling, dry-run/idempotency/audit, and one approved sandbox send before production. | next R6a/C31 non-mutating connector preflight |
| Send messages | Contract exists; R6a/C31 read-only preflight confirms B-route entrypoint metadata and A-route UIA/offline-state classifier support, but not production send. | Need preview/dry-run contract, idempotency/audit, dynamic observation, and one approved sandbox send before production. | next R6b B-route preview/dry-run contract |
| Receive files | List mode exists from message-derived file metadata; R3/R3b confirm DB file metadata exists but current cache/archive evidence does not map to local files. | R4 download is blocked until better cache evidence or a UI/client download connector is available. | blocked; continue R5 |
| Send files | Contract exists; live probe confirms file-send menu and installed file-transfer DLL candidates. | Blocked behind send-message connector plus upload/file-transfer dry-run evidence. | wait for R6a/C31, then file-send preflight |
| Send files | Contract exists; R6a/C31 metadata confirms file-upload/offline-file/file-message candidates and A-route file menu classifier support. | Blocked behind send-message preview/dry-run plus upload/file-transfer dry-run and sandbox evidence. | wait for R6b, then file-send upload preflight |
## Node Sequence
@@ -401,11 +401,49 @@ powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-go-mcp.ps1
**Stop condition:**
- If entrypoints cannot be confirmed or the live client remains offline, do not start R6 production send.
**R6a Result:**
- Created `docs/source-discovery/2026-07-10-send-connector-preflight.md`.
- Added C# WinHelper `0.4.0` read-only op `probe_send_entrypoints`.
- Added C# WinHelper `0.4.0` read-only op `probe_send_uia_controls`.
- Updated `ISphereLiveProbeRecorder` to include `send_entrypoints_preflight.json` and `send_uia_controls_preflight.json`.
- Manual copied-install metadata probe reports `required_available_count=5`, `all_required_available=true`, and `b_route_entrypoint_preflight="pass"`.
- Synthetic UIA classifier smoke reports `A_ROUTE_OFFLINE_BLOCKED`, matching the R5b live evidence pattern where offline-send blockers must stop production send.
- Decision: next node is R6b B-route preview/dry-run contract. Production `isphere_send_message` and `isphere_send_file` remain blocked.
---
### R6b: B-route preview/dry-run contract
**Purpose:** Add only the non-sending contract layer needed before any real send attempt: target ref input, content/hash/idempotency validation, connector metadata, and local audit for preview/dry-run.
**Files:**
- Create or modify: `internal/tools/isphere_send_message.go`
- Create or modify tests: `internal/tools/isphere_send_message_test.go`
- Modify: `internal/mcpserver/server.go`, `internal/mcpserver/server_test.go`
- Modify: `scripts/verify-go-mcp.ps1`
- Modify docs: `docs/go-mcp-runbook.md`, this roadmap, `docs/current-status-card.md`
**Execution policy:**
- `execution_mode="preview"` or equivalent dry-run returns `send_status="planned"` and never invokes helper send, UI click/type, network capture, upload, or hook.
- `execution_mode="production"` remains rejected until a later sandbox-send gate passes.
- `idempotency_key` and `content_sha256` are validated even in preview so the final production shape does not drift.
- Audit stores target ref, connector, connector stage, content hash, idempotency key hash/ref, and status; it must not store raw message body.
**Acceptance gate:**
- MCP tool list can include `isphere_send_message` only if it is preview/dry-run blocked from production.
- Preview test passes and proves no connector side effects.
- Production request is rejected with a clear blocked status.
- Standard verification still passes with deterministic no-send behavior.
**Stop condition:**
- If target refs cannot be represented without raw local evidence values, stop and add a target-ref design note before coding production-facing arguments.
---
### R6: Send-message preview and production path
**Purpose:** Implement `isphere_send_message` after R6a validates a connector path and a later approved sandbox-send gate proves success/ack behavior.
**Purpose:** Implement production `isphere_send_message` after R6b preview/dry-run exists and a later approved sandbox-send gate proves success/ack behavior.
**Files:**
- Create or modify: `internal/tools/isphere_send_message.go`