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

@@ -49,7 +49,7 @@ N13/N14/N15 are pre-business validation results. They can help identify UI eleme
## Current loop ## Current loop
Current loop: `Stage C / Loop C9 - group source evidence precheck`. Current loop: `Stage C / Loop C10 - log-backed group candidate extraction`.
Plan file: `docs/superpowers/plans/2026-07-09-stage-c-log-backed-receive-messages-loop.md`. Plan file: `docs/superpowers/plans/2026-07-09-stage-c-log-backed-receive-messages-loop.md`.
@@ -70,10 +70,12 @@ Current loop output so far:
6. C6: fixture-backed operator smoke for configured receive source. 6. C6: fixture-backed operator smoke for configured receive source.
7. C7: log-backed contact candidate extraction from sender/receiver JIDs. 7. C7: log-backed contact candidate extraction from sender/receiver JIDs.
8. C8: `isphere_search_contacts` MCP registration and six-tool verification. 8. C8: `isphere_search_contacts` MCP registration and six-tool verification.
9. C9: group source evidence precheck confirmed groupchat/conference/MUC hits in ignored decrypted logs.
## Next business mainline ## Next business mainline
1. Run Stage C Loop C9: verify whether current decrypted log evidence contains group/groupchat identifiers before implementing `isphere_search_groups`. 1. Implement Stage C Loop C10: extract group candidates from log-backed groupchat/conference JIDs.
2. Add group/file read tools after their source decisions are recorded. 2. Register `isphere_search_groups` after group source tests pass.
3. Add `isphere_send_message` and `isphere_send_file` after source discovery and connector selection. 3. Add file read tools after their source decisions are recorded.
4. Keep UIA selector/report work as fallback support, not as the primary roadmap. 4. Add `isphere_send_message` and `isphere_send_file` after source discovery and connector selection.
5. Keep UIA selector/report work as fallback support, not as the primary roadmap.

View File

@@ -19,7 +19,7 @@ Schema notes: `docs/source-discovery/2026-07-09-n12-pre-zyl-schema-notes.md`
| --- | --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- | --- |
| `isphere_receive_messages` | decrypted `PacketReader.ProcessPacket` XMPP `<message>` stanzas via `internal/isphere.EncryptedPacketLogSource` | decrypted `Smark.SendReceive` transport stanzas; decrypted `SaveToDB` `Chat_OnMessageArrived` traces; wrapped `MsgLib.db` after DB wrapper is solved | `docs/source-discovery/2026-07-09-n12-pre-zyl-schema-notes.md#field-mapping-evidence` | C5 env loader wired through ISPHERE_PACKET_LOG_FILE; default source remains empty when unset | fixture-backed configured-source operator smoke | | `isphere_receive_messages` | decrypted `PacketReader.ProcessPacket` XMPP `<message>` stanzas via `internal/isphere.EncryptedPacketLogSource` | decrypted `Smark.SendReceive` transport stanzas; decrypted `SaveToDB` `Chat_OnMessageArrived` traces; wrapped `MsgLib.db` after DB wrapper is solved | `docs/source-discovery/2026-07-09-n12-pre-zyl-schema-notes.md#field-mapping-evidence` | C5 env loader wired through ISPHERE_PACKET_LOG_FILE; default source remains empty when unset | fixture-backed configured-source operator smoke |
| `isphere_search_contacts` | bare sender/receiver JIDs extracted from normalized log-backed messages | decrypted roster/contact stanzas from `Smark.SendReceive`; `MsgLib.db` contact/conversation tables after DB wrapper is solved; UIA helper source if display names are missing | `docs/source-discovery/2026-07-09-n12-pre-zyl-schema-notes.md#log-decryption-result` | C8 MCP tool registered and verify-go-mcp covers default/configured contact smoke; JID-only display/account fallback | enrich display names from roster/db/uia evidence | | `isphere_search_contacts` | bare sender/receiver JIDs extracted from normalized log-backed messages | decrypted roster/contact stanzas from `Smark.SendReceive`; `MsgLib.db` contact/conversation tables after DB wrapper is solved; UIA helper source if display names are missing | `docs/source-discovery/2026-07-09-n12-pre-zyl-schema-notes.md#log-decryption-result` | C8 MCP tool registered and verify-go-mcp covers default/configured contact smoke; JID-only display/account fallback | enrich display names from roster/db/uia evidence |
| `isphere_search_groups` | decrypted XMPP group/message stanzas if groupchat/group JIDs appear | `MsgLib.db` group/conversation tables after DB wrapper is solved; UIA helper source if group display names are missing | `docs/source-discovery/2026-07-09-n12-pre-zyl-schema-notes.md#field-mapping-evidence` | candidate pending group stanza evidence | third | | `isphere_search_groups` | decrypted `PacketReader.ProcessPacket` `type="groupchat"` stanzas and conference/MUC JIDs | `MsgLib.db` group/conversation tables after DB wrapper is solved; UIA helper source if group display names are missing | C9 ignored-log scan: PacketReader 86 groupchat/86 conference hits; Smark 24 groupchat/658 conference/631 muc hits | C9 evidence confirmed; display names still unavailable | implement group candidate extraction from normalized messages |
| `isphere_receive_files` | decrypted `PacketReader.ProcessPacket` file-transfer message stanzas plus `zyl\importal\<hash>` cache mapping | decrypted `Smark.SendReceive` and `SaveToDB` traces for file-reference reconciliation | `docs/source-discovery/2026-07-09-n12-pre-zyl-schema-notes.md#field-mapping-evidence` | candidate pending cache-reference mapping | fourth | | `isphere_receive_files` | decrypted `PacketReader.ProcessPacket` file-transfer message stanzas plus `zyl\importal\<hash>` cache mapping | decrypted `Smark.SendReceive` and `SaveToDB` traces for file-reference reconciliation | `docs/source-discovery/2026-07-09-n12-pre-zyl-schema-notes.md#field-mapping-evidence` | candidate pending cache-reference mapping | fourth |
## Stage C entry rule ## Stage C entry rule

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 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. - 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. 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. 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: 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 ## 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. - 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.