docs: confirm groupchat source evidence

This commit is contained in:
zhaoyilun
2026-07-09 23:39:29 +08:00
parent 2832e286e7
commit 7e616a1f10
3 changed files with 72 additions and 9 deletions

View File

@@ -1049,15 +1049,15 @@ Implemented and verified in this loop:
- If evidence exists, write a C10 implementation loop for group candidate extraction.
- If evidence does not exist, mark `isphere_search_groups` blocked on additional roster/group evidence and choose the next read slice (`isphere_receive_files` or contact enrichment) instead.
- [ ] **Step 1: Inspect current source evidence for group identifiers**
- [x] **Step 1: Inspect current source evidence for group identifiers**
Use existing ignored metadata/log summaries under `runs/` and committed schema notes. Do not commit raw logs.
- [ ] **Step 2: Update matrix and next loop**
- [x] **Step 2: Update matrix and next loop**
Record whether group extraction can proceed from current evidence. Rewrite C10 accordingly.
- [ ] **Step 3: Verify docs-only change and commit**
- [x] **Step 3: Verify docs-only change and commit**
Run:
@@ -1071,6 +1071,67 @@ Expected: all exit 0. Commit exact C9 paths only.
---
## Loop C9 Result
Evidence precheck result:
- Committed schema notes mention group handling only as a possible mapping (`conversation_id` group JID and `conversation_type` `chat|groupchat|...`).
- Existing ignored metadata summaries did not contain explicit group keywords.
- A temporary ignored Go scanner decrypted selected N12-pre logs and output counts only, with no raw content committed:
- `PacketReader.ProcessPacket`: 245/245 decrypted, 86 `groupchat`, 86 conference, 24 MUC, 86 `type="groupchat"` hits.
- `Smark.SendReceive`: 1078/1078 decrypted, 24 `groupchat`, 658 conference, 631 MUC, 24 `type="groupchat"` hits.
- `SaveToDB`: 14/14 decrypted, no group hits.
- Decision: `isphere_search_groups` can proceed from current log-backed evidence, but display names/member counts remain unavailable until roster/db/uia evidence is solved.
---
## Loop C10: Log-backed group candidate extraction
**Goal:** Extract searchable group candidates from normalized log-backed groupchat messages using group/conference bare JIDs as stable group ids until richer display-name/member evidence is available.
**Planned files:**
- Create: `internal/isphere/groups.go`
- Create: `internal/isphere/groups_test.go`
- Modify: `docs/source-discovery/capability-source-matrix.md`
- Modify: `docs/superpowers/plans/2026-07-09-stage-c-log-backed-receive-messages-loop.md`
**Planned behavior:**
- Consume `[]isphere.Message` records.
- Extract groups from messages where `ConversationType == "groupchat"` or sender/receiver JID contains conference/MUC markers.
- Group fields: `GroupID`, `DisplayName`, `Source`, `Confidence`, `RawRef`.
- For now, `DisplayName` uses the bare group JID; `MemberCount` and `OwnerRef` remain nil/unknown at MCP layer.
- Search query matches group JID/display name case-insensitively.
- This loop does not register `isphere_search_groups`; registration comes after source behavior passes tests.
- [ ] **Step 1: Write failing group extraction test**
Create `internal/isphere/groups_test.go` and run:
```powershell
go test ./internal/isphere -run TestSearchGroupsFromMessagesMatchesGroupchatJIDs -v
```
Expected initial failure: group search types/functions do not exist.
- [ ] **Step 2: Implement group extraction/search**
Create `internal/isphere/groups.go` with minimal pure Go logic over normalized messages and synthetic groupchat fixtures.
- [ ] **Step 3: Run full verification and rewrite Loop C11**
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 C11 around registering `isphere_search_groups` from the C10 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.