diff --git a/docs/current-status-card.md b/docs/current-status-card.md index c570638..59432d2 100644 --- a/docs/current-status-card.md +++ b/docs/current-status-card.md @@ -51,7 +51,7 @@ N13/N14/N15 are pre-business validation results. They can help identify UI eleme ## Current loop -Current loop: `Stage C / Loop C15 - send message source evidence precheck`. +Current loop: `Stage C / Loop C16 - configured PacketReader source hardening`. Plan file: `docs/superpowers/plans/2026-07-09-stage-c-log-backed-receive-messages-loop.md`. @@ -78,10 +78,11 @@ Current loop output so far: 12. C12: file evidence precheck confirmed enough PacketReader/Smark evidence for file metadata listing, but not enough for real cache/download mapping. 13. C13: `internal/isphere.ListFilesFromMessages` extracts synthetic/redacted file metadata candidates from normalized messages. 14. C14: `isphere_receive_files` MCP list mode registered and verify-go-mcp now covers eight tools plus default/configured file-list smoke. +15. C15: `isphere_send_message` source precheck found no validated write connector; send implementation is blocked pending bridge/API, UIA action, or protocol evidence. ## Next business mainline -1. Run Stage C Loop C15: verify available evidence for `isphere_send_message` connector selection before implementing any write-capable path. -2. Leave actual file download/cache mapping as a later connector node until a message-to-cache hash or client download source is validated. -3. Add `isphere_send_message` and `isphere_send_file` only after source discovery, preview semantics, execution metadata, and audit shape are defined. +1. Run Stage C Loop C16: harden configured PacketReader source loading so existing read tools can consume directory/multi-log operator evidence. +2. Leave `isphere_send_message` blocked until bridge/API, UIA action-chain, or protocol connector evidence is validated. +3. Leave actual file download/cache mapping as a later connector node until a message-to-cache hash or client download source is validated. 4. Keep UIA selector/report work as fallback support, not as the primary roadmap. diff --git a/docs/source-discovery/2026-07-10-send-message-source-precheck.md b/docs/source-discovery/2026-07-10-send-message-source-precheck.md new file mode 100644 index 0000000..8f122b1 --- /dev/null +++ b/docs/source-discovery/2026-07-10-send-message-source-precheck.md @@ -0,0 +1,33 @@ +# C15 Send Message Source Evidence Precheck + +Date: 2026-07-10 +Loop: Stage C / C15 +Target tool: `isphere_send_message` + +## Question + +Can `isphere_send_message` be implemented now from current committed evidence, without guessing a write connector? + +## Evidence reviewed + +| Candidate source | Evidence | Result | +| --- | --- | --- | +| Existing bridge/API/local service | Repository search over committed docs/code for `send_message`, bridge/API/local service write paths, and MCP contract references | No committed callable bridge/API/local service for sending was found. Current Go MCP code exposes read tools only. | +| C# WinHelper | `native/ISphereWinHelper/Program.cs` switch supports only `version`, `self_check`, `scan_windows`, and `dump_uia` | No helper op exists for click, type, draft, send, upload, or invoke. | +| UIA selector catalog | `internal/uiaselector/catalog.go` defines selectors with `AllowedUseReadOnlyLocate`; catalog includes main window, left panel, roster, fuzzy search edit | Catalog is read-only locate only and does not validate message input, conversation open, or send button selectors. | +| N12R internal sandbox evidence | `docs/internal-sandbox-live-capture-plan.md` and `docs/internal-sandbox-operator-runbook.md` allow only `version`, `self_check`, `scan_windows`, `dump_uia` and forbid clicking, typing, sending, uploading, and downloading | N12R evidence is structural/read-only. It does not authorize or prove a write path. | +| Business contract | `docs/mcp-core-tools-contract.md` defines `isphere_send_message` with preview/production modes and write errors such as `WRITE_NOT_READY` and `PREVIEW_ONLY` | Contract is ready, but source connector is not validated. | + +## Decision + +`isphere_send_message` is blocked for implementation. Current evidence supports only contract planning and possibly a future preview-only design, not a production or UIA write connector. + +Required unblock evidence: + +1. A confirmed existing bridge/API/local service that can send messages, or +2. An internal-sandbox UIA action evidence package that validates conversation resolution, draft entry, send-button location, pre-send confirmation, and result verification, or +3. A validated network/protocol connector with authentication/session handling and audit boundaries. + +## Next loop recommendation + +Do not implement write-capable behavior in C16. Use C16 for read-path hardening: support directory or multi-log configuration for PacketReader sources so the existing receive/contact/group/file-list tools become more useful with operator-local evidence. diff --git a/docs/source-discovery/capability-source-matrix.md b/docs/source-discovery/capability-source-matrix.md index 1c30177..54bc099 100644 --- a/docs/source-discovery/capability-source-matrix.md +++ b/docs/source-discovery/capability-source-matrix.md @@ -21,6 +21,8 @@ Schema notes: `docs/source-discovery/2026-07-09-n12-pre-zyl-schema-notes.md` | `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 `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 | C11 MCP tool registered and verify-go-mcp covers default/configured group smoke; JID-only display fallback | enrich group display/member data from roster/db/uia evidence | | `isphere_receive_files` | decrypted `PacketReader.ProcessPacket` file-transfer message stanzas via `internal/isphere.ListFilesFromMessages` and `isphere_receive_files` list mode; `zyl\importal\` cache entries remain unlinked | decrypted `Smark.SendReceive` and `SaveToDB` traces for file-reference reconciliation; future UIA/client connector for download | `docs/source-discovery/2026-07-09-n12-pre-zyl-schema-notes.md#c12-file-transfer-evidence-precheck` | C14 MCP list mode registered and verify-go-mcp covers default/configured file-list smoke; no log-to-cache/download mapping yet | defer download mapping; run send-message source evidence precheck | +| `isphere_send_message` | none validated yet | existing bridge/API/local service preferred; UIA write connector only after internal-sandbox action evidence; network/protocol connector only after protocol discovery | `docs/source-discovery/2026-07-10-send-message-source-precheck.md` | C15 blocked: contract exists, but no committed bridge/API/local service, helper write op, UIA action chain, or protocol connector is validated | do not implement write behavior; harden existing read source configuration | +| `isphere_send_file` | none validated yet | depends on send-message connector plus outbound file/upload evidence | `docs/source-discovery/2026-07-10-send-message-source-precheck.md` | blocked behind `isphere_send_message` connector selection and file upload/source policy | defer until send-message connector is validated | ## Stage C entry rule diff --git a/docs/superpowers/plans/2026-07-09-stage-c-log-backed-receive-messages-loop.md b/docs/superpowers/plans/2026-07-09-stage-c-log-backed-receive-messages-loop.md index 055ed81..adae5fb 100644 --- a/docs/superpowers/plans/2026-07-09-stage-c-log-backed-receive-messages-loop.md +++ b/docs/superpowers/plans/2026-07-09-stage-c-log-backed-receive-messages-loop.md @@ -1402,15 +1402,15 @@ Implemented and verified in this loop: - If a safe connector exists, write C16 around preview-first `isphere_send_message` design or implementation. - If evidence is insufficient, mark send-message blocked on live/internal-sandbox connector evidence and choose the next read hardening node. -- [ ] **Step 1: Inspect current source evidence for send-message connector candidates** +- [x] **Step 1: Inspect current source evidence for send-message connector candidates** Use committed docs and generated selector/source-discovery reports only. Do not infer a write path from unrelated read evidence. -- [ ] **Step 2: Update matrix and next loop** +- [x] **Step 2: Update matrix and next loop** Record whether send-message implementation can proceed, and rewrite C16 accordingly. -- [ ] **Step 3: Verify docs-only change and commit** +- [x] **Step 3: Verify docs-only change and commit** Run: @@ -1424,6 +1424,71 @@ Expected: all exit 0. Commit exact C15 paths only. --- +## Loop C15 Result + +Evidence precheck result: + +- `docs/mcp-core-tools-contract.md` defines `isphere_send_message` with preview/production modes, but it is a contract only. +- `native/ISphereWinHelper/Program.cs` currently supports only `version`, `self_check`, `scan_windows`, and `dump_uia`; there is no helper op for click, type, draft, send, upload, or invoke. +- `internal/uiaselector/catalog.go` contains read-only locate selectors only and does not validate a message input, open-conversation flow, or send button. +- N12R live-capture docs explicitly allow only read-only scan/dump evidence and forbid clicking, typing, sending, uploading, and downloading during capture. +- Decision: `isphere_send_message` implementation is blocked until bridge/API/local-service, UIA action-chain, or network/protocol connector evidence is validated. + +--- + +## Loop C16: Configured PacketReader source hardening + +**Goal:** Improve the existing read-tool path by allowing operator-local PacketReader evidence to be loaded from a directory or multiple log files, rather than only one explicit encrypted log-line file. + +**Planned files:** +- Modify: `internal/isphere/file_source.go` +- Modify: `internal/isphere/file_source_test.go` +- Modify: `internal/mcpserver/server.go` +- Modify: `internal/mcpserver/server_test.go` +- Modify: `scripts/verify-go-mcp.ps1` +- Modify: `docs/go-mcp-runbook.md` +- Modify: `docs/current-status-card.md` +- Modify: `docs/superpowers/plans/2026-07-09-stage-c-log-backed-receive-messages-loop.md` + +**Planned behavior:** +- Add a safe directory/multi-file loader for encrypted PacketReader log lines. Sort paths deterministically and ignore blank lines. +- Add a new env option such as `ISPHERE_PACKET_LOG_DIR`; fail fast if both file and directory env vars are set ambiguously. +- Extend verification with a synthetic directory fixture proving configured receive/contact/group/file-list tools still work from the hardened source path. +- Keep raw N12-pre evidence under ignored/operator-local paths; commit only synthetic fixtures/tests. + +- [ ] **Step 1: Write failing directory source test** + +Create or extend `internal/isphere/file_source_test.go` and run: + +```powershell +go test ./internal/isphere -run TestLoadEncryptedPacketLogSourceFromDirectoryReadsSortedLogFiles -v +``` + +Expected initial failure: directory loader does not exist. + +- [ ] **Step 2: Implement directory/multi-file loader** + +Implement minimal deterministic loading over `.log`/`.txt` files without decrypting during load. + +- [ ] **Step 3: Wire env and verification** + +Add `ISPHERE_PACKET_LOG_DIR` handling in `mcpserver.NewServerFromEnv()` and update the verification script with a synthetic directory smoke. + +- [ ] **Step 4: Run full verification and commit** + +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. Commit exact C16 paths only and rewrite the next loop from actual results. + +--- + ## 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.