119 lines
5.8 KiB
PowerShell
119 lines
5.8 KiB
PowerShell
param(
|
||
[string]$ReportPath = ""
|
||
)
|
||
|
||
$ErrorActionPreference = "Stop"
|
||
Set-StrictMode -Version Latest
|
||
|
||
$repo = (Resolve-Path -LiteralPath (Join-Path $PSScriptRoot "..")).Path
|
||
if ([string]::IsNullOrWhiteSpace($ReportPath)) {
|
||
$ReportPath = Join-Path $repo "docs\reports\2026-07-10-business-goals-smoke.md"
|
||
}
|
||
|
||
Push-Location $repo
|
||
try {
|
||
$verifyOutput = & powershell -NoProfile -ExecutionPolicy Bypass -File (Join-Path $repo "scripts\verify-go-mcp.ps1")
|
||
if ($LASTEXITCODE -ne 0) {
|
||
$verifyOutput | ForEach-Object { Write-Host $_ }
|
||
throw "verify-go-mcp.ps1 failed with exit code $LASTEXITCODE"
|
||
}
|
||
$jsonLine = @($verifyOutput | Where-Object {
|
||
$trimmed = ([string]$_).Trim()
|
||
$trimmed.StartsWith("{") -and $trimmed.EndsWith("}")
|
||
}) | Select-Object -Last 1
|
||
if (-not $jsonLine) {
|
||
throw "verify-go-mcp.ps1 did not emit JSON summary"
|
||
}
|
||
$mcp = $jsonLine | ConvertFrom-Json
|
||
|
||
$searchContactsReady = ([int]$mcp.configured_contact_count -ge 1)
|
||
$searchGroupsReady = ([int]$mcp.configured_group_count -ge 1)
|
||
$receiveMessagesReady = ([int]$mcp.configured_receive_message_count -ge 1)
|
||
$sendMessagePreviewReady = ([bool]$mcp.send_preview_tool_present)
|
||
$sendMessageProductionReady = ([bool]$mcp.production_send_enabled)
|
||
$receiveFilesListReady = ([int]$mcp.configured_file_count -ge 1)
|
||
$receiveFilesDownloadReady = $false
|
||
$receiveFilesDownloadPreviewBlocked = ([bool]$mcp.receive_file_download_preview_blocked)
|
||
$sendFilePreviewReady = ([bool]$mcp.send_file_preview_tool_present)
|
||
$sendFileProductionReady = ([bool]$mcp.send_file_production_enabled)
|
||
|
||
$blockers = New-Object System.Collections.Generic.List[string]
|
||
if (-not $sendMessageProductionReady) { $blockers.Add("send_message_production_missing_strict_machine_sent_record_evidence") }
|
||
if (-not $receiveFilesDownloadReady) { $blockers.Add("receive_files_download_missing_real_cache_mapping_and_copy_gate") }
|
||
if (-not $sendFileProductionReady) { $blockers.Add("send_file_production_missing_upload_connector_and_returned_file_send_evidence") }
|
||
|
||
$summaryJsonBlock = [ordered]@{
|
||
search_contacts_ready = $searchContactsReady
|
||
search_groups_ready = $searchGroupsReady
|
||
receive_messages_ready = $receiveMessagesReady
|
||
send_message_preview_ready = $sendMessagePreviewReady
|
||
send_message_production_ready = $sendMessageProductionReady
|
||
receive_files_list_ready = $receiveFilesListReady
|
||
receive_files_download_ready = $receiveFilesDownloadReady
|
||
receive_files_download_preview_blocked = $receiveFilesDownloadPreviewBlocked
|
||
send_file_preview_ready = $sendFilePreviewReady
|
||
send_file_production_ready = $sendFileProductionReady
|
||
} | ConvertTo-Json -Depth 4 -Compress
|
||
|
||
$reportLines = @(
|
||
"# Business Goals Smoke - 2026-07-10",
|
||
"",
|
||
"## 业务目标状态",
|
||
"",
|
||
"| 目标 | 当前状态 | 说明 |",
|
||
"| --- | --- | --- |",
|
||
"| 搜索联系人 | 可用 | MCP smoke 证明配置化 fixture 下可返回联系人候选。 |",
|
||
"| 搜索群组 | 可用 | MCP smoke 证明配置化 fixture 下可返回群组候选。 |",
|
||
"| 收消息 | 基础可用 | PacketReader/log-backed 默认路线和显式 MsgLib 路线已存在;R12 增加对账辅助但未改变默认路由。 |",
|
||
"| 发消息 | preview 可用,生产阻断 | isphere_send_message 可规划发送并做审计/idempotency;两个 returned sent-record 包仍未给出机器可验证 sent-record。 |",
|
||
"| 收文件 | list 可用,download 阻断 | isphere_receive_files 可列文件,download preview 返回机器可读阻断原因;真实下载缺少 cache mapping 和 copy gate。 |",
|
||
"| 发文件 | preview 可用,生产阻断 | isphere_send_file 可做 allowed-dir 文件 SHA256/size preview;真实上传缺少返回包/上传连接器证据。 |",
|
||
"",
|
||
"## Smoke 输出摘要",
|
||
"",
|
||
'```json',
|
||
$summaryJsonBlock,
|
||
'```',
|
||
"",
|
||
"## 剩余业务阻断",
|
||
"",
|
||
"- 发消息生产:缺少严格机器 sent-record/content-hash after 证据。",
|
||
"- 收文件下载:缺少真实 cache mapping 和 copy gate。",
|
||
"- 发文件生产:缺少 upload connector 和 returned file-send evidence。",
|
||
"",
|
||
"## 结论",
|
||
"",
|
||
"数字员工现在可使用:搜索联系人、搜索群组、收消息基础读取、收文件列表、发消息 preview、发文件 preview。",
|
||
"",
|
||
"数字员工还不能使用:生产发消息、真实下载文件、生产发文件。"
|
||
)
|
||
$report = $reportLines -join "`n"
|
||
|
||
$parent = Split-Path -Parent $ReportPath
|
||
if (-not [string]::IsNullOrWhiteSpace($parent)) {
|
||
New-Item -ItemType Directory -Force -Path $parent | Out-Null
|
||
}
|
||
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
|
||
[System.IO.File]::WriteAllText($ReportPath, ($report + "`n"), $utf8NoBom)
|
||
|
||
[ordered]@{
|
||
ok = $true
|
||
verification = "business_goals_smoke"
|
||
search_contacts_ready = $searchContactsReady
|
||
search_groups_ready = $searchGroupsReady
|
||
receive_messages_ready = $receiveMessagesReady
|
||
send_message_preview_ready = $sendMessagePreviewReady
|
||
send_message_production_ready = $sendMessageProductionReady
|
||
receive_files_list_ready = $receiveFilesListReady
|
||
receive_files_download_ready = $receiveFilesDownloadReady
|
||
receive_files_download_preview_blocked = $receiveFilesDownloadPreviewBlocked
|
||
send_file_preview_ready = $sendFilePreviewReady
|
||
send_file_production_ready = $sendFileProductionReady
|
||
remaining_business_blockers = @($blockers)
|
||
report_path = "docs/reports/2026-07-10-business-goals-smoke.md"
|
||
} | ConvertTo-Json -Depth 6 -Compress
|
||
}
|
||
finally {
|
||
Pop-Location
|
||
}
|