feat: add receive file download preview contract
This commit is contained in:
@@ -803,19 +803,19 @@ Created `docs/source-discovery/2026-07-10-returned-send-sent-record-diagnostic.m
|
||||
- If resolver lacks accepted mapping, response: `ok=false`, `download_status="blocked"`, `blocked_reason_code="file_cache_mapping_missing"`.
|
||||
- If resolver has accepted mapping in fixture tests, response: `ok=true`, `download_status="planned"`, no file copy during preview.
|
||||
|
||||
- [ ] **Step 1: Write blocked-preview test**
|
||||
- [x] **Step 1: Write blocked-preview test**
|
||||
|
||||
Add `TestISphereReceiveFilesDownloadPreviewBlockedWithoutMapping`, asserting `blocked_reason_code="file_cache_mapping_missing"` and `file_contents_read=false`.
|
||||
|
||||
- [ ] **Step 2: Write planned-preview fixture test**
|
||||
- [x] **Step 2: Write planned-preview fixture test**
|
||||
|
||||
Add `TestISphereReceiveFilesDownloadPreviewPlannedWithFixtureMapping`, using an injected fixture resolver and asserting `download_status="planned"`, `file_contents_read=false`, and `file_copied=false`.
|
||||
|
||||
- [ ] **Step 3: Implement preview contract**
|
||||
- [x] **Step 3: Implement preview contract**
|
||||
|
||||
Keep non-preview real download blocked unless R10 accepted mapping exists and a separate production-copy gate is added.
|
||||
|
||||
- [ ] **Step 4: Verify and commit**
|
||||
- [x] **Step 4: Verify and commit**
|
||||
|
||||
```powershell
|
||||
git diff --check
|
||||
@@ -830,6 +830,15 @@ git push gitea main
|
||||
|
||||
**Acceptance gate:** 数字员工可以理解“为什么现在不能下载”,并在有映射时得到 planned preview。
|
||||
|
||||
|
||||
**R11 Result:**
|
||||
|
||||
- Actual implementation files are `internal/tools/isphere_files.go` and `internal/tools/isphere_files_test.go`.
|
||||
- Added structured download preview blocked response for missing mapping.
|
||||
- Added injected fixture resolver test for planned preview.
|
||||
- Standard MCP smoke now reports `receive_file_download_preview_blocked=true`.
|
||||
- Real file copy/download remains blocked; preview reads no file contents and returns no raw paths.
|
||||
|
||||
---
|
||||
|
||||
### R12: Receive-message reconciliation helper
|
||||
|
||||
Reference in New Issue
Block a user