docs: confirm file receive metadata evidence

This commit is contained in:
zhaoyilun
2026-07-10 00:40:02 +08:00
parent 444c0d8ff1
commit 3d68a18097
4 changed files with 87 additions and 10 deletions

View File

@@ -1223,15 +1223,15 @@ Implemented and verified in this loop:
- If evidence exists, write C13 around file metadata extraction from normalized messages/cache references.
- If evidence is insufficient, mark `isphere_receive_files` blocked on additional file-transfer/cache mapping evidence and move to source hardening/docs instead.
- [ ] **Step 1: Inspect current source evidence for file-transfer identifiers**
- [x] **Step 1: Inspect current source evidence for file-transfer identifiers**
Use committed schema notes and ignored summaries/log scans. Do not commit raw logs or decrypted content.
- [ ] **Step 2: Update matrix and next loop**
- [x] **Step 2: Update matrix and next loop**
Record whether file receive implementation can proceed from current evidence. Rewrite C13 accordingly.
- [ ] **Step 3: Verify docs-only change and commit**
- [x] **Step 3: Verify docs-only change and commit**
Run:
@@ -1245,6 +1245,67 @@ Expected: all exit 0. Commit exact C12 paths only.
---
## Loop C12 Result
Evidence precheck result:
- A temporary ignored scanner decrypted selected N12-pre PacketReader/Smark/SaveToDB logs and wrote only count metadata to `runs/offline-evidence-intake/zyl-qqfile-20260709/metadata/c12-file-evidence-counts.json`.
- `PacketReader.ProcessPacket`: 245/245 decrypted, 57 `<subject>` hits, 123 `FILE_TRANSFER` hits, 57 `FILE_TRANSFER_CANCEL` hits, 91 body file-extension hits, and 107 parsed file-candidate messages.
- `Smark.SendReceive`: 1,078/1,078 decrypted, 5 `FILE_TRANSFER` hits, 4 body file-extension hits, and 5 parsed file-candidate messages.
- `SaveToDB`: 14/14 decrypted, 9 generic file-extension hits and 2 attachment-keyword hits, but no parseable XMPP message candidates.
- `archive-list.txt`: 11 `zyl\importal\<hash>` cached file entries across 11 hash directories, with `.doc`, `.docx`, `.jpg`, `.pdf`, and `.xlsx` extensions.
- Decision: `isphere_receive_files` can proceed for read-only file metadata listing from normalized messages, but actual `download_ref`/cache-path resolution remains blocked until a log-to-cache hash mapping or client download connector is validated.
---
## Loop C13: Log-backed file metadata extraction
**Goal:** Extract read-only file metadata candidates from normalized log-backed messages, using message id plus filename as a stable local file id while cache/download resolution remains deferred.
**Planned files:**
- Create: `internal/isphere/files.go`
- Create: `internal/isphere/files_test.go`
- Modify: `docs/source-discovery/capability-source-matrix.md`
- Modify: `docs/current-status-card.md`
- Modify: `docs/superpowers/plans/2026-07-09-stage-c-log-backed-receive-messages-loop.md`
**Planned behavior:**
- Consume `[]isphere.Message` records returned by the existing log-backed receive source.
- Treat a message as a file candidate when `Subject` contains `FILE_TRANSFER` or `Text` contains a supported file extension.
- Extract file name from message text without logging or committing real raw filenames; tests must use synthetic/redacted names.
- File fields: `FileID`, `MessageID`, `ConversationID`, `FileName`, `SizeBytes` nil/unknown, `MimeType` inferred from extension where possible, `CreatedAt` from message timestamp, `DownloadRef` empty, `SavedPath` empty, `SHA256` empty, `Source` `local_readonly`, `RawRef` `packetlog_file_transfer`.
- Query supports `ConversationID`, `MessageID`, `FileID`, `NameContains`, and `Limit`; default/zero limit returns all candidates.
- This loop does not register the MCP tool yet. Registration/list-mode smoke becomes C14 after source behavior passes tests.
- [ ] **Step 1: Write failing file extraction test**
Create `internal/isphere/files_test.go` and run:
```powershell
go test ./internal/isphere -run TestListFilesFromMessagesExtractsFileTransferCandidates -v
```
Expected initial failure: file query/types/functions do not exist.
- [ ] **Step 2: Implement file metadata extraction/search**
Create `internal/isphere/files.go` with minimal pure Go logic over normalized messages and synthetic/redacted fixtures.
- [ ] **Step 3: Run full verification and rewrite Loop C14**
Run:
```powershell
git diff --check
go test ./...
go build ./cmd/isphere-mcp
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/verify-go-mcp.ps1
```
Expected: all exit 0. Remove any generated root `isphere-mcp.exe` after build. Rewrite Loop C14 around registering `isphere_receive_files` list mode from the C13 source behavior.
---
## Self-Review
- Spec coverage: the plan follows the user's cyclic requirement: plan first, implement one loop at a time, update the next loop after each result, and ask only on blockers.