Evidence URL Verifier
Verify evidence URLs are real and accessible.
Problem
Evidence links often:
- - Point to non-existent resources
- Are placeholders (example.com)
- Expire or get deleted
- Don't match claimed content
Workflow
1. URL Validation
CODEBLOCK0
2. Content Verification
CODEBLOCK1
3. Artifact Existence
CODEBLOCK2
Executable Completion Criteria
| Criteria | Verification |
|---|
| URL resolves | HTTP 200 response |
| Content matches |
Type matches expected |
| No placeholders | Content is substantive |
| Local paths exist | Test-Path returns true |
Privacy/Safety
- - Don't log full URL contents
- Redact sensitive data in responses
- Respect rate limits (max 1 req/sec)
Self-Use Trigger
Use when:
- - Task claims evidence artifact
- URL provided as proof
- Before marking task complete
- Audit of past completions
Verify evidence. Trust but confirm.
证据URL验证器
验证证据URL是否真实可访问。
问题
证据链接通常:
- - 指向不存在的资源
- 是占位符(example.com)
- 过期或被删除
- 与声称的内容不匹配
工作流程
1. URL验证
powershell
function Test-EvidenceUrl {
param([string]$url)
try {
$response = Invoke-WebRequest -Uri $url -Method Head -TimeoutSec 10
return @{
Valid = $true
Status = $response.StatusCode
ContentType = $response.ContentType
}
} catch {
return @{
Valid = $false
Error = $_.Exception.Message
}
}
}
使用示例
$result = Test-EvidenceUrl https://example.com/artifact
if ($result.Valid) {
Write-Host URL有效: $($result.Status)
} else {
Write-Error URL无效: $($result.Error)
}
2. 内容验证
powershell
检查URL是否与声称的内容类型匹配
$response = Invoke-WebRequest -Uri $url
if ($response.ContentType -notlike text/* -and $expectedType -eq text) {
Write-Warning 内容类型不匹配
}
检查占位符文本
$content = $response.Content
if ($content -match lorem ipsum|placeholder|example) {
Write-Warning 内容似乎是占位符
}
3. 工件存在性检查
powershell
对于本地路径
if (Test-Path $artifactPath) {
$size = (Get-Item $artifactPath).Length
if ($size -eq 0) {
Write-Warning 工件文件为空
}
} else {
Write-Error 未找到工件: $artifactPath
}
可执行完成标准
| 标准 | 验证方式 |
|---|
| URL可解析 | HTTP 200响应 |
| 内容匹配 |
类型与预期一致 |
| 无占位符 | 内容实质性存在 |
| 本地路径存在 | Test-Path返回true |
隐私/安全
- - 不记录完整URL内容
- 对响应中的敏感数据进行脱敏处理
- 遵守速率限制(最多1次请求/秒)
自动触发条件
在以下情况下使用:
- - 任务声称存在证据工件
- URL作为证明提供
- 标记任务完成前
- 对过往完成情况进行审计
验证证据。信任但需确认。