2 Commits

Author SHA1 Message Date
zhaoyilun
57a0c08656 tools: complete login probe todo coverage 2026-07-12 14:08:25 +08:00
zhaoyilun
93c1d59809 tools: package login reachability probe 2026-07-12 12:55:53 +08:00
5 changed files with 1392 additions and 2 deletions

View File

@@ -21,6 +21,9 @@
- `docs/source-discovery/2026-07-12-login-reachability-validation-items.md` - `docs/source-discovery/2026-07-12-login-reachability-validation-items.md`
- `docs/source-discovery/2026-07-12-send-upload-deep-dive.md` - `docs/source-discovery/2026-07-12-send-upload-deep-dive.md`
- `docs/source-discovery/2026-07-12-inprocess-adapter-static-map.md` - `docs/source-discovery/2026-07-12-inprocess-adapter-static-map.md`
- `docs/source-discovery/2026-07-12-login-reachability-probe-package.md`
- `scripts/package-login-reachability-probe.ps1`
- `scripts/verify-login-reachability-probe-package.ps1`
- `docs/source-discovery/capability-source-matrix.md` - `docs/source-discovery/capability-source-matrix.md`
本节点通过条件: 本节点通过条件:
@@ -997,3 +1000,10 @@ Use `docs/source-discovery/2026-07-12-login-reachability-validation-items.md` as
``` ```
Business status: contact search, group search, receive messages, and receive file-list remain the stable MCP foundation. `isphere_send_message` and `isphere_send_file` are implemented as preview/contract paths, but production send/file remains blocked until logged-in B-route reachability and sent-record/ack correlation pass. N12-pre/offline evidence remains pre-gate context. Existing UIA selector/report/RPA work is auxiliary evidence and fallback support only; the project core is MCP communication capability for contacts, groups, messages, and files. Business status: contact search, group search, receive messages, and receive file-list remain the stable MCP foundation. `isphere_send_message` and `isphere_send_file` are implemented as preview/contract paths, but production send/file remains blocked until logged-in B-route reachability and sent-record/ack correlation pass. N12-pre/offline evidence remains pre-gate context. Existing UIA selector/report/RPA work is auxiliary evidence and fallback support only; the project core is MCP communication capability for contacts, groups, messages, and files.
Prepared package:
```text
runs/login-reachability-probe-package.zip
C:\Users\zhaoy\Downloads\login-reachability-probe-package-20260712-140706.zip
```

View File

@@ -0,0 +1,105 @@
# Login Reachability Probe Package
Date: 2026-07-12
## Business purpose
This package turns the login validation schema into an operator-runnable package for the 2026-07-13 logged-in environment.
It is for B-route evidence collection. It does not enable production send.
## Generated artifacts
- Package script: `scripts/package-login-reachability-probe.ps1`
- Verification script: `scripts/verify-login-reachability-probe-package.ps1`
- Package directory: `runs/login-reachability-probe-package`
- Package zip: `runs/login-reachability-probe-package.zip`
- Downloads copy: `C:\Users\zhaoy\Downloads\login-reachability-probe-package-20260712-140706.zip`
## What the package contains
- `recorder/ISphereLiveProbeRecorder.exe`
- `tools/isphere-capability-smoke.exe`
- `LOGIN-REACHABILITY-INPUTS.template.json`
- `LOGIN-REACHABILITY-INPUTS.schema.json`
- `TODO-COVERAGE.md`
- `CREATE-RETURN-ZIP.ps1`
- `RUN-LOGIN-REACHABILITY-SUITE.bat`
- numbered operator steps:
- `00-prepare-inputs.bat`
- `01-run-before-recorder.bat`
- `02-run-after-text-recorder.bat`
- `03-run-after-file-recorder.bat`
- `04-create-return-zip.bat`
- copied reference docs:
- `docs/login-reachability-validation-items.md`
- `docs/send-upload-deep-dive.md`
## Operator flow
1. Run only on a machine where iSphere/IMPlatformClient is visibly logged in.
2. Fill `LOGIN-REACHABILITY-INPUTS.json` from the template.
3. Run before-recorder.
4. If text test is enabled, manually send exactly one text message in the official client, then run after-text-recorder.
5. If file test is enabled, manually send exactly one safe small file in the official client, then run after-file-recorder.
6. Run `CREATE-RETURN-ZIP.ps1` or `04-create-return-zip.bat`.
7. Return `isphere-login-reachability-return-*.zip`.
## Required returned schema
The return script writes `LOGIN-REACHABILITY-OUTPUT.json` with these top-level sections:
- `run`
- `targets`
- `runtime`
- `reachability`
- `server_auth`
- `snapshots`
- `attempts`
- `failures`
- `correlation`
## Safety and route status
- `NO_AUTOMATIC_SEND=true`: the package does not send text or files automatically.
- `production_send_enabled=false`
- `production_file_send_enabled=false`
- A-route/RPA remains `backup_only`.
- B-route remains blocked until returned evidence proves logged-in reachability and sent-record/ack correlation.
## Verification
Fresh verification command:
```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File scripts\verify-login-reachability-probe-package.ps1
```
Verified result:
```json
{
"ok": true,
"required_file_count": 22,
"synthetic_return_verified": true,
"online_login_required": true,
"no_automatic_send": true,
"production_send_enabled": false,
"production_file_send_enabled": false
}
```
## Remaining TODO coverage completed
The package now includes the remaining validation TODO fields:
- `runtime_observations`: AppContextManager, MessageScheduling, Chat/XMPP, FileUploadPara, IFileTransfer, FileUploadResult/FileID, and send-file-message finalization evidence or structured failure.
- `group_probe`: group ChatRoom branch and speech/upload permission evidence or structured failure.
- `fallback_a_route`: HWND, `rtbSendMessage`, `btnSend`, file menu evidence, or structured failure when B-route fails.
- `TODO-COVERAGE.md`: maps every P0/P1 validation item to the exact package field or generated evidence path.
## Next decision after returned zip
- If text evidence includes one-shot target, before/after sent-record source, content hash, and ack/ref correlation, move text B-route from contract/probe toward production connector design.
- If file evidence includes FileUploadPara/server/auth data, IFileTransfer reachability, FileUploadResult/FileID or structured failure, and file sent-record/ack correlation, move file B-route to upload connector design.
- If reachability fails with structured reasons, continue offline reverse against the failed step.

View File

@@ -25,6 +25,7 @@ Offline B-route decision: `docs/source-discovery/2026-07-12-offline-broute-rever
In-process adapter static map: `docs/source-discovery/2026-07-12-inprocess-adapter-static-map.md` In-process adapter static map: `docs/source-discovery/2026-07-12-inprocess-adapter-static-map.md`
Send/upload deep dive: `docs/source-discovery/2026-07-12-send-upload-deep-dive.md` Send/upload deep dive: `docs/source-discovery/2026-07-12-send-upload-deep-dive.md`
Login reachability validation items: `docs/source-discovery/2026-07-12-login-reachability-validation-items.md` Login reachability validation items: `docs/source-discovery/2026-07-12-login-reachability-validation-items.md`
Login reachability probe package: `docs/source-discovery/2026-07-12-login-reachability-probe-package.md`
## Source priority ## Source priority
@@ -45,8 +46,8 @@ Route rule: UIA helper / A-route / RPA is a backup route only. It can preserve d
| `isphere_search_contacts` | bare sender/receiver JIDs extracted from normalized log-backed messages loaded from configured PacketReader file or directory source | validated copied `MsgLib.db` tables: `TD_Roster`, `TD_CustomEffigy`, `tblRecent`, `tblChatLevel`, `tblPersonMsg`; decrypted roster/contact stanzas from `Smark.SendReceive`; UIA helper source if display names are still missing | `docs/source-discovery/2026-07-10-msglib-readonly-schema-extraction.md`; `internal/isphere/contacts_test.go`; `internal/tools/isphere_contacts_test.go` | C34 documents optional MsgLib contact display enrichment; R2 adds deterministic exact-match-first ranking, case-insensitive de-duplication across log/MsgLib candidates, and preserves `source`/`raw_ref` | core contact search complete; optional richer fields later | | `isphere_search_contacts` | bare sender/receiver JIDs extracted from normalized log-backed messages loaded from configured PacketReader file or directory source | validated copied `MsgLib.db` tables: `TD_Roster`, `TD_CustomEffigy`, `tblRecent`, `tblChatLevel`, `tblPersonMsg`; decrypted roster/contact stanzas from `Smark.SendReceive`; UIA helper source if display names are still missing | `docs/source-discovery/2026-07-10-msglib-readonly-schema-extraction.md`; `internal/isphere/contacts_test.go`; `internal/tools/isphere_contacts_test.go` | C34 documents optional MsgLib contact display enrichment; R2 adds deterministic exact-match-first ranking, case-insensitive de-duplication across log/MsgLib candidates, and preserves `source`/`raw_ref` | core contact search complete; optional richer fields later |
| `isphere_search_groups` | decrypted `PacketReader.ProcessPacket` `type="groupchat"` stanzas and conference/MUC JIDs loaded from configured PacketReader file or directory source | validated copied `MsgLib.db` tables: `tblMsgGroupPersonMsg`, `TD_WorkGroupAuth`, `tblRecent`; UIA helper source if group display names are still missing | `docs/source-discovery/2026-07-10-msglib-readonly-schema-extraction.md`; `internal/isphere/groups_test.go`; `internal/tools/isphere_groups_test.go`; C9 ignored-log scan: PacketReader 86 groupchat/86 conference hits; Smark 24 groupchat/658 conference/631 muc hits | C34 documents optional MsgLib group display enrichment; R2 adds deterministic exact-match-first ranking, case-insensitive de-duplication across log/MsgLib candidates, and preserves `source`/`raw_ref` | core group search complete; optional member/owner hierarchy later | | `isphere_search_groups` | decrypted `PacketReader.ProcessPacket` `type="groupchat"` stanzas and conference/MUC JIDs loaded from configured PacketReader file or directory source | validated copied `MsgLib.db` tables: `tblMsgGroupPersonMsg`, `TD_WorkGroupAuth`, `tblRecent`; UIA helper source if group display names are still missing | `docs/source-discovery/2026-07-10-msglib-readonly-schema-extraction.md`; `internal/isphere/groups_test.go`; `internal/tools/isphere_groups_test.go`; C9 ignored-log scan: PacketReader 86 groupchat/86 conference hits; Smark 24 groupchat/658 conference/631 muc hits | C34 documents optional MsgLib group display enrichment; R2 adds deterministic exact-match-first ranking, case-insensitive de-duplication across log/MsgLib candidates, and preserves `source`/`raw_ref` | core group search complete; optional member/owner hierarchy later |
| `isphere_receive_files` | decrypted `PacketReader.ProcessPacket` file-transfer message stanzas via `internal/isphere.ListFilesFromMessages` and `isphere_receive_files` list mode; configured PacketReader file or directory source; `zyl\importal\<hash>` cache entries remain unlinked | MsgLib `TD_ReceiveFileRecord` safe metadata through explicit copied-DB path; 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`; `docs/source-discovery/2026-07-10-file-download-mapping-precheck.md`; `docs/source-discovery/2026-07-10-file-cache-mapping-diagnostic.md`; `docs/source-discovery/2026-07-10-file-download-mapping-v2.md`; `docs/reports/2026-07-10-business-goals-smoke.md` | C22 verifies safe file-list contract args; R10 proves resolver scoring with fixture accepted matches; R11 adds structured download preview with `blocked`/`planned` status and side-effect flags false; R13/R14 confirms list is ready but real download is still blocked. | blocked for real download pending accepted real cache mapping and copy gate; list mode is complete | | `isphere_receive_files` | decrypted `PacketReader.ProcessPacket` file-transfer message stanzas via `internal/isphere.ListFilesFromMessages` and `isphere_receive_files` list mode; configured PacketReader file or directory source; `zyl\importal\<hash>` cache entries remain unlinked | MsgLib `TD_ReceiveFileRecord` safe metadata through explicit copied-DB path; 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`; `docs/source-discovery/2026-07-10-file-download-mapping-precheck.md`; `docs/source-discovery/2026-07-10-file-cache-mapping-diagnostic.md`; `docs/source-discovery/2026-07-10-file-download-mapping-v2.md`; `docs/reports/2026-07-10-business-goals-smoke.md` | C22 verifies safe file-list contract args; R10 proves resolver scoring with fixture accepted matches; R11 adds structured download preview with `blocked`/`planned` status and side-effect flags false; R13/R14 confirms list is ready but real download is still blocked. | blocked for real download pending accepted real cache mapping and copy gate; list mode is complete |
| `isphere_send_message` | B-route selected: `in_process_adapter_research` after offline reverse. Static call path is confirmed through `AppContextManager.SendTxtMessageByJid(...)`, `MessageScheduling.SendChatMessage(...)`, `Chat.SendMessage`, and `XMPPConnection.send`, but no existing IPC/plugin/local HTTP send bridge is confirmed; default MCP tool still exposes preview/dry-run unless an explicit connector mode is configured | A-route fallback is now implemented for UI action: `ISPHERE_SEND_CONNECTOR_MODE=uia_rpa` calls WinHelper `uia_send_message` against a configured HWND, writes `rtbSendMessage`, and clicks `btnSend`; this stays backup-only and network/protocol replay remains deferred | `docs/source-discovery/2026-07-10-send-message-source-precheck.md`; `docs/source-discovery/2026-07-10-send-message-connector-selection.md`; `docs/source-discovery/2026-07-10-send-sidecar-b-first-plan.md`; `docs/source-discovery/2026-07-10-returned-live-probe-analysis.md`; `docs/source-discovery/2026-07-10-send-connector-preflight.md`; `docs/source-discovery/2026-07-10-send-sandbox-gate.md`; `docs/source-discovery/2026-07-10-returned-send-sandbox-analysis.md`; `docs/source-discovery/2026-07-10-returned-send-sandbox-analysis-v2.md`; `docs/source-discovery/2026-07-10-returned-send-sent-record-diagnostic.md`; `docs/source-discovery/2026-07-11-a-route-uia-send.md`; `docs/source-discovery/2026-07-11-a-route-open-real-chat-window.md`; `docs/source-discovery/2026-07-12-broute-text-send-static-map.md`; `docs/source-discovery/2026-07-12-broute-bridge-static-map.md`; `docs/source-discovery/2026-07-12-offline-broute-reverse-decision.md`; `docs/source-discovery/2026-07-12-inprocess-adapter-static-map.md`; `docs/source-discovery/2026-07-12-send-upload-deep-dive.md`; `docs/source-discovery/2026-07-12-login-reachability-validation-items.md`; `internal/tools/isphere_send_message_test.go`; `cmd/isphere-capability-smoke/main.go`; `docs/reports/2026-07-10-business-goals-smoke.md` | R6f-R6l define connector contract, audit/idempotency replay, production gate, B-route shell, strict-v2 package, and explicit production closure. R10a validates two returned sent-record packages as manual-only evidence. A-route adds local UI action readiness: synthetic window proof plus real offline `frmP2PChat` open/write/click target proof. Offline B-route reverse confirms the send call path but rejects existing IPC/plugin-first for this evidence set; business delivery is still not verified because local runtime is offline and no success/ack or sent-record hash evidence has passed. | B-route now exposes only the `in_process_contract` connector mode for request-shape/audit validation; next work is the 2026-07-13 login reachability probe using `docs/source-discovery/2026-07-12-login-reachability-validation-items.md` as the active schema: one-shot direct/group target rule, AppContextManager/IAppContextManager and Chat/XMPPConnection reachability, in-process adapter reachability mode, before/after sent-record snapshots, sent-record source identification, structured failure reasons, and content-hash/ack correlation; keep external sidecar preview/probe-only and A-route UI action backup-only; production remains blocked until those P0 items pass | | `isphere_send_message` | B-route selected: `in_process_adapter_research` after offline reverse. Static call path is confirmed through `AppContextManager.SendTxtMessageByJid(...)`, `MessageScheduling.SendChatMessage(...)`, `Chat.SendMessage`, and `XMPPConnection.send`, but no existing IPC/plugin/local HTTP send bridge is confirmed; default MCP tool still exposes preview/dry-run unless an explicit connector mode is configured | A-route fallback is now implemented for UI action: `ISPHERE_SEND_CONNECTOR_MODE=uia_rpa` calls WinHelper `uia_send_message` against a configured HWND, writes `rtbSendMessage`, and clicks `btnSend`; this stays backup-only and network/protocol replay remains deferred | `docs/source-discovery/2026-07-10-send-message-source-precheck.md`; `docs/source-discovery/2026-07-10-send-message-connector-selection.md`; `docs/source-discovery/2026-07-10-send-sidecar-b-first-plan.md`; `docs/source-discovery/2026-07-10-returned-live-probe-analysis.md`; `docs/source-discovery/2026-07-10-send-connector-preflight.md`; `docs/source-discovery/2026-07-10-send-sandbox-gate.md`; `docs/source-discovery/2026-07-10-returned-send-sandbox-analysis.md`; `docs/source-discovery/2026-07-10-returned-send-sandbox-analysis-v2.md`; `docs/source-discovery/2026-07-10-returned-send-sent-record-diagnostic.md`; `docs/source-discovery/2026-07-11-a-route-uia-send.md`; `docs/source-discovery/2026-07-11-a-route-open-real-chat-window.md`; `docs/source-discovery/2026-07-12-broute-text-send-static-map.md`; `docs/source-discovery/2026-07-12-broute-bridge-static-map.md`; `docs/source-discovery/2026-07-12-offline-broute-reverse-decision.md`; `docs/source-discovery/2026-07-12-inprocess-adapter-static-map.md`; `docs/source-discovery/2026-07-12-send-upload-deep-dive.md`; `docs/source-discovery/2026-07-12-login-reachability-validation-items.md`; `docs/source-discovery/2026-07-12-login-reachability-probe-package.md`; `internal/tools/isphere_send_message_test.go`; `cmd/isphere-capability-smoke/main.go`; `docs/reports/2026-07-10-business-goals-smoke.md` | R6f-R6l define connector contract, audit/idempotency replay, production gate, B-route shell, strict-v2 package, and explicit production closure. R10a validates two returned sent-record packages as manual-only evidence. A-route adds local UI action readiness: synthetic window proof plus real offline `frmP2PChat` open/write/click target proof. Offline B-route reverse confirms the send call path but rejects existing IPC/plugin-first for this evidence set; business delivery is still not verified because local runtime is offline and no success/ack or sent-record hash evidence has passed. The login reachability package is now built and verified; it produces `LOGIN-REACHABILITY-OUTPUT.json` with run/targets/runtime/reachability/server_auth/snapshots/attempts/failures/correlation and includes `TODO-COVERAGE.md` for runtime observations, group probe, and fallback A-route evidence. | Run the 2026-07-13 login reachability package in a logged-in environment and return `isphere-login-reachability-return-*.zip`; text production remains blocked until one-shot target, AppContextManager/IAppContextManager or MessageScheduling/Chat reachability, sent-record source, and content-hash/ack correlation pass |
| `isphere_send_file` | B-route selected after offline reverse: managed file send is upload-first through `OffLineFileSend.sendFile()`, `FileUploadPara`, `IMPP.Service*.dll` `IFileTransfer.FileUpload(...)`, then chat file-message finalization through `trans_UploadCompleted(fileId)`, `MessageScheduling.SendFileMessage`, and `Chat.sendFileMessage(...)`; current MCP tool exposes preview/dry-run only | A-route file fallback is not implemented yet; real offline UIA dump did not expose stable `btnSendFile`, so the fallback slice remains toolbar/menu locator discovery; native `TcpFileTransfer.dll` is not the first B-route bridge because managed upload/message flow is now mapped | `docs/source-discovery/2026-07-10-send-message-source-precheck.md`; `docs/source-discovery/2026-07-10-send-message-connector-selection.md`; `docs/source-discovery/2026-07-10-send-sidecar-b-first-plan.md`; `docs/source-discovery/2026-07-10-returned-live-probe-analysis.md`; `docs/source-discovery/2026-07-10-send-connector-preflight.md`; `docs/source-discovery/2026-07-10-send-file-sandbox-gate.md`; `docs/source-discovery/2026-07-11-a-route-open-real-chat-window.md`; `docs/source-discovery/2026-07-12-broute-file-send-static-map.md`; `docs/source-discovery/2026-07-12-broute-bridge-static-map.md`; `docs/source-discovery/2026-07-12-offline-broute-reverse-decision.md`; `docs/source-discovery/2026-07-12-inprocess-adapter-static-map.md`; `docs/source-discovery/2026-07-12-send-upload-deep-dive.md`; `docs/source-discovery/2026-07-12-login-reachability-validation-items.md`; `internal/tools/isphere_files_test.go`; `docs/reports/2026-07-10-business-goals-smoke.md` | R7 registers send-file preview as the tenth MCP tool; R8 adds audit/idempotency duplicate/conflict hardening without raw file paths/content; R9 builds and verifies the online send-file evidence package; R13/R14 confirms preview is ready and production upload remains blocked. Offline B-route reverse confirms upload-first/file-message-second and shows file id/auth/runtime reachability are the blockers. A-route real-window work confirms file-button automation still needs a separate locator node. | blocked until the login reachability probe proves `FileUploadPara` host/port/domain/local path/token presence or hash-only token evidence, logged-in access to `IFileTransfer.FileUpload`, returned `FileUploadResult.FileID`, `trans_UploadCompleted(fileId)` / `Chat.sendFileMessage` finalization, structured failure reasons, before/after sent-record snapshots, and file hash/ack correlation; production file upload/send remains blocked until online upload plus sent-record/ack evidence exists; A-route locator remains backup-only | | `isphere_send_file` | B-route selected after offline reverse: managed file send is upload-first through `OffLineFileSend.sendFile()`, `FileUploadPara`, `IMPP.Service*.dll` `IFileTransfer.FileUpload(...)`, then chat file-message finalization through `trans_UploadCompleted(fileId)`, `MessageScheduling.SendFileMessage`, and `Chat.sendFileMessage(...)`; current MCP tool exposes preview/dry-run only | A-route file fallback is not implemented yet; real offline UIA dump did not expose stable `btnSendFile`, so the fallback slice remains toolbar/menu locator discovery; native `TcpFileTransfer.dll` is not the first B-route bridge because managed upload/message flow is now mapped | `docs/source-discovery/2026-07-10-send-message-source-precheck.md`; `docs/source-discovery/2026-07-10-send-message-connector-selection.md`; `docs/source-discovery/2026-07-10-send-sidecar-b-first-plan.md`; `docs/source-discovery/2026-07-10-returned-live-probe-analysis.md`; `docs/source-discovery/2026-07-10-send-connector-preflight.md`; `docs/source-discovery/2026-07-10-send-file-sandbox-gate.md`; `docs/source-discovery/2026-07-11-a-route-open-real-chat-window.md`; `docs/source-discovery/2026-07-12-broute-file-send-static-map.md`; `docs/source-discovery/2026-07-12-broute-bridge-static-map.md`; `docs/source-discovery/2026-07-12-offline-broute-reverse-decision.md`; `docs/source-discovery/2026-07-12-inprocess-adapter-static-map.md`; `docs/source-discovery/2026-07-12-send-upload-deep-dive.md`; `docs/source-discovery/2026-07-12-login-reachability-validation-items.md`; `docs/source-discovery/2026-07-12-login-reachability-probe-package.md`; `internal/tools/isphere_files_test.go`; `docs/reports/2026-07-10-business-goals-smoke.md` | R7 registers send-file preview as the tenth MCP tool; R8 adds audit/idempotency duplicate/conflict hardening without raw file paths/content; R9 builds and verifies the online send-file evidence package; R13/R14 confirms preview is ready and production upload remains blocked. Offline B-route reverse confirms upload-first/file-message-second and shows file id/auth/runtime reachability are the blockers. A-route real-window work confirms file-button automation still needs a separate locator node. The login reachability package is now built and verified with one-shot file fields, structured failure handling, and before/after recorder output validation. | Run the 2026-07-13 login reachability package in a logged-in environment and return `isphere-login-reachability-return-*.zip`; file production remains blocked until FileUploadPara/server/auth, `IFileTransfer.FileUpload`, FileUploadResult/FileID or structured upload failure, file-message finalization, and file sent-record/ack correlation pass |
## Stage C entry rule ## Stage C entry rule

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,251 @@
param(
[string]$OutputDir = "runs/login-reachability-probe-package"
)
$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest
$repo = (Resolve-Path -LiteralPath (Join-Path $PSScriptRoot "..")).Path
$packageScript = Join-Path $repo "scripts\package-login-reachability-probe.ps1"
if (-not (Test-Path -LiteralPath $packageScript)) {
throw "missing package script: $packageScript"
}
$packageRoot = Join-Path $repo $OutputDir
$zipPath = "$packageRoot.zip"
if (Test-Path -LiteralPath $packageRoot) {
Remove-Item -LiteralPath $packageRoot -Recurse -Force
}
if (Test-Path -LiteralPath $zipPath) {
Remove-Item -LiteralPath $zipPath -Force
}
& powershell -NoProfile -ExecutionPolicy Bypass -File $packageScript -OutputDir $OutputDir
if ($LASTEXITCODE -ne 0) {
throw "package-login-reachability-probe.ps1 failed with exit code $LASTEXITCODE"
}
$requiredFiles = @(
"README.txt",
"OPERATOR-STEPS.md",
"TODO-COVERAGE.md",
"EXPECTED-RETURN-FILES.txt",
"LOGIN-REACHABILITY-INPUTS.template.json",
"LOGIN-REACHABILITY-INPUTS.schema.json",
"LOGIN-REACHABILITY-PACKAGE-MANIFEST.json",
"RUN-LOGIN-REACHABILITY-SUITE.bat",
"00-prepare-inputs.bat",
"01-run-before-recorder.bat",
"02-run-after-text-recorder.bat",
"03-run-after-file-recorder.bat",
"04-create-return-zip.bat",
"CREATE-RETURN-ZIP.ps1",
"compute-text-hash.ps1",
"compute-file-hash.ps1",
"optional-run-capability-smoke.bat",
"docs\login-reachability-validation-items.md",
"docs\send-upload-deep-dive.md",
"tools\isphere-capability-smoke.exe",
"recorder\ISphereLiveProbeRecorder.exe",
"recorder\variants\ISphereLiveProbeRecorder-x86.exe"
)
foreach ($relative in $requiredFiles) {
$path = Join-Path $packageRoot $relative
if (-not (Test-Path -LiteralPath $path)) {
throw "missing package file: $relative"
}
}
$instructionText = @(
Get-Content -LiteralPath (Join-Path $packageRoot "README.txt") -Raw
Get-Content -LiteralPath (Join-Path $packageRoot "OPERATOR-STEPS.md") -Raw
Get-Content -LiteralPath (Join-Path $packageRoot "TODO-COVERAGE.md") -Raw
Get-Content -LiteralPath (Join-Path $packageRoot "EXPECTED-RETURN-FILES.txt") -Raw
Get-Content -LiteralPath (Join-Path $packageRoot "LOGIN-REACHABILITY-INPUTS.template.json") -Raw
Get-Content -LiteralPath (Join-Path $packageRoot "LOGIN-REACHABILITY-PACKAGE-MANIFEST.json") -Raw
) -join "`n"
foreach ($needle in @(
"LOCAL_LOGIN_UNAVAILABLE",
"ONLINE_LOGIN_REQUIRED",
"NO_AUTOMATIC_SEND",
"RUN-LOGIN-REACHABILITY-SUITE.bat",
"LOGIN-REACHABILITY-OUTPUT.json",
"run",
"targets",
"runtime",
"reachability",
"server_auth",
"snapshots",
"attempts",
"failures",
"correlation",
"content_sha256",
"file_sha256",
"duplicate_second_send_attempted",
"duplicate_second_file_send_attempted",
"production_send_enabled",
"production_file_send_enabled",
"runtime_observations",
"group_probe",
"fallback_a_route",
"TODO-COVERAGE",
"backup_only"
)) {
if ($instructionText -notmatch [regex]::Escape($needle)) {
throw "package instructions missing required phrase: $needle"
}
}
if (-not (Test-Path -LiteralPath $zipPath)) {
throw "missing package zip: $zipPath"
}
$inputsTemplate = Join-Path $packageRoot "LOGIN-REACHABILITY-INPUTS.template.json"
$inputsPath = Join-Path $packageRoot "LOGIN-REACHABILITY-INPUTS.json"
$inputs = Get-Content -LiteralPath $inputsTemplate -Raw | ConvertFrom-Json
$inputs.run.operator_confirmed_logged_in = $true
$inputs.run.operator_started_at_local = "2026-07-13T09:00:00+08:00"
$inputs.run.operator_finished_at_local = "2026-07-13T09:05:00+08:00"
$inputs.run.before_recorder_present = $true
$inputs.run.one_shot_text_enabled = $true
$inputs.run.one_shot_file_enabled = $true
$inputs.run.one_text_send_only_confirmed = $true
$inputs.run.one_file_send_only_confirmed = $true
$inputs.targets.direct_jid = "test-direct@example.invalid"
$inputs.targets.group_jid = "test-group@example.invalid"
$inputs.targets.target_selection_source = "verify-script"
$inputs.targets.self_send_or_sandbox_account_confirmed = $true
$inputs.runtime_observations.app_context_manager_reachable = $true
$inputs.runtime_observations.message_scheduling_reachable = $true
$inputs.runtime_observations.chat_xmpp_authenticated = $true
$inputs.runtime_observations.target_jid_mapping_observed = $true
$inputs.runtime_observations.file_upload_para_observed = $true
$inputs.runtime_observations.ifile_transfer_reachable = $true
$inputs.runtime_observations.file_upload_result_file_id_observed = $true
$inputs.runtime_observations.send_file_message_finalization_observed = $true
$inputs.runtime_observations.notes = "synthetic runtime observations"
$inputs.text_attempt.content_sha256 = ("a" * 64)
$inputs.text_attempt.content_length = 16
$inputs.text_attempt.operator_clicked_send_at_local = "2026-07-13T09:01:00+08:00"
$inputs.text_attempt.after_recorder_present = $true
$inputs.text_attempt.success_ack_or_sent_record_present = $true
$inputs.text_attempt.success_ack_or_sent_record = "synthetic sent-record ack for verify script"
$inputs.text_attempt.duplicate_second_send_attempted = $false
$inputs.file_attempt.allowed_dir = "C:\verify"
$inputs.file_attempt.sandbox_file_path = "C:\verify\small.txt"
$inputs.file_attempt.file_sha256 = ("b" * 64)
$inputs.file_attempt.file_size_bytes = 12
$inputs.file_attempt.operator_clicked_send_file_at_local = "2026-07-13T09:03:00+08:00"
$inputs.file_attempt.after_recorder_present = $true
$inputs.file_attempt.file_upload_or_sent_record_present = $true
$inputs.file_attempt.file_upload_or_sent_record = "synthetic file sent-record ack for verify script"
$inputs.file_attempt.duplicate_second_file_send_attempted = $false
$inputs.group_probe.enabled = $true
$inputs.group_probe.group_jid = "test-group@example.invalid"
$inputs.group_probe.chatroom_branch_observed = $true
$inputs.group_probe.speech_permission_state = "allowed"
$inputs.group_probe.upload_permission_state = "allowed"
$inputs.fallback_a_route.enabled_if_b_route_fails = $true
$inputs.fallback_a_route.hwnd = "0x1234"
$inputs.fallback_a_route.rtbSendMessage_present = $true
$inputs.fallback_a_route.btnSend_present = $true
$inputs.fallback_a_route.btnSendFile_or_file_menu_present = $true
$inputs.fallback_a_route.uia_or_screenshot_ref = "synthetic fallback evidence"
$inputs.sent_record_source.source_type = "synthetic"
$inputs.sent_record_source.source_path_or_ref = "verify-script"
$inputs.sent_record_source.before_count = "1"
$inputs.sent_record_source.after_count = "3"
$inputs.sent_record_source.ack_or_ref_id = "verify-ack"
$inputs.sent_record_source.correlation_notes = "synthetic verification only"
$inputs | ConvertTo-Json -Depth 12 | Set-Content -LiteralPath $inputsPath -Encoding UTF8
$beforeProbeDir = Join-Path $packageRoot "return-evidence\before\isphere-live-probe-verify"
$afterTextDir = Join-Path $packageRoot "return-evidence\after-text\isphere-live-probe-verify"
$afterFileDir = Join-Path $packageRoot "return-evidence\after-file\isphere-live-probe-verify"
New-Item -ItemType Directory -Force -Path $beforeProbeDir, $afterTextDir, $afterFileDir | Out-Null
@'
{
"probe_mode": "verify",
"target_count": 1,
"host": { "is_64_bit_os": true, "is_64_bit_process": false, "machine_name": "VERIFY" },
"targets": [
{
"pid": 1234,
"process_name": "IMPlatformClient",
"bitness": "x86",
"assembly_presence": {
"IMPlatformClient.exe": true,
"smack.dll": true,
"IMPP.Interface.dll": true,
"IMPP.Service.dll": true,
"IMPP.ServiceBase.dll": true
}
}
]
}
'@ | Set-Content -LiteralPath (Join-Path $beforeProbeDir "probe_client_runtime.json") -Encoding UTF8
@'
{
"entrypoints": [
{ "id": "text_high_level_by_jid", "capability": "send_message", "assembly_found": true, "reflection_type_found": true, "reflection_method_found": true, "string_type_hint": true, "string_method_hint": true, "available": true, "reflection_error": "" },
{ "id": "text_message_scheduler", "capability": "send_message", "assembly_found": true, "reflection_type_found": true, "reflection_method_found": true, "string_type_hint": true, "string_method_hint": true, "available": true, "reflection_error": "" },
{ "id": "text_wire_chat_send", "capability": "send_message", "assembly_found": true, "reflection_type_found": true, "reflection_method_found": true, "string_type_hint": true, "string_method_hint": true, "available": true, "reflection_error": "" },
{ "id": "file_service_upload", "capability": "send_file", "assembly_found": true, "reflection_type_found": true, "reflection_method_found": true, "string_type_hint": true, "string_method_hint": true, "available": true, "reflection_error": "" },
{ "id": "file_wire_message", "capability": "send_file", "assembly_found": true, "reflection_type_found": true, "reflection_method_found": true, "string_type_hint": true, "string_method_hint": true, "available": true, "reflection_error": "" }
]
}
'@ | Set-Content -LiteralPath (Join-Path $beforeProbeDir "send_entrypoints_preflight.json") -Encoding UTF8
@'
{ "tcp": { "connection_count": 1, "connections": [ { "state": "ESTABLISHED", "remote_port": 5222 } ] } }
'@ | Set-Content -LiteralPath (Join-Path $beforeProbeDir "network_inventory.json") -Encoding UTF8
@'
{ "target_process_seen": true, "initial_route_hint": "B_ROUTE_PROMISING" }
'@ | Set-Content -LiteralPath (Join-Path $beforeProbeDir "feasibility_summary.json") -Encoding UTF8
"after text synthetic evidence" | Set-Content -LiteralPath (Join-Path $afterTextDir "dummy.txt") -Encoding UTF8
"after file synthetic evidence" | Set-Content -LiteralPath (Join-Path $afterFileDir "dummy.txt") -Encoding UTF8
Push-Location $packageRoot
try {
$returnOutput = & powershell -NoProfile -ExecutionPolicy Bypass -File ".\CREATE-RETURN-ZIP.ps1" 2>&1
$returnExit = $LASTEXITCODE
}
finally {
Pop-Location
}
if ($returnExit -ne 0) {
throw "CREATE-RETURN-ZIP.ps1 synthetic verification failed exit=$returnExit output=$($returnOutput -join "`n")"
}
$outputJson = Join-Path $packageRoot "LOGIN-REACHABILITY-OUTPUT.json"
if (-not (Test-Path -LiteralPath $outputJson)) {
throw "missing generated LOGIN-REACHABILITY-OUTPUT.json"
}
$output = Get-Content -LiteralPath $outputJson -Raw | ConvertFrom-Json
foreach ($section in @("run", "targets", "runtime", "reachability", "server_auth", "snapshots", "attempts", "failures", "correlation")) {
if ($null -eq $output.PSObject.Properties[$section]) {
throw "LOGIN-REACHABILITY-OUTPUT.json missing section: $section"
}
}
if ($output.run.validation_ok -ne $true) {
throw "synthetic LOGIN-REACHABILITY-OUTPUT.json should have validation_ok=true"
}
[ordered]@{
ok = $true
package_dir = (Resolve-Path -LiteralPath $packageRoot).Path
zip = (Resolve-Path -LiteralPath $zipPath).Path
required_file_count = $requiredFiles.Count
synthetic_return_verified = $true
online_login_required = $true
no_automatic_send = $true
production_send_enabled = $false
production_file_send_enabled = $false
} | ConvertTo-Json -Depth 6 -Compress