chore: establish local platform baseline

This commit is contained in:
Codex Local
2026-08-26 06:41:54 +08:00
commit 29bdf4900f
575 changed files with 95644 additions and 0 deletions
@@ -0,0 +1,34 @@
$ErrorActionPreference = 'Stop'
$PSNativeCommandUseErrorActionPreference = $true
$root = Split-Path -Parent $PSScriptRoot
Set-Location -LiteralPath $root
$temporaryRoot = Join-Path ([System.IO.Path]::GetTempPath()) ('agent-models-conformance-' + [Guid]::NewGuid().ToString('N'))
$capturePath = Join-Path $temporaryRoot 'capture.json'
$reportPath = Join-Path $temporaryRoot 'report.json'
function Category-Results([string[]]$categories) {
return @($categories | ForEach-Object { @{ category = $_; status = 'PASS'; evidence_ref = "local-toolchain:$_" } })
}
try {
New-Item -ItemType Directory -Path $temporaryRoot | Out-Null
$imageDigest = (docker image inspect data-terminal-cloud-api --format '{{.Id}}').Trim()
if ($imageDigest -notmatch '^sha256:[a-f0-9]{64}$') { throw '无法取得API镜像摘要' }
$observedAt = (Get-Date).ToUniversalTime().AddMinutes(-1)
$capture = @{
schema_version = 'real-agent-models-capture-v1'; evidence_source = 'LOCAL_MODELS'; candidate_version = '0.63.0-rc.local'; build_digest = $imageDigest; environment = 'LOCAL'
change_ticket_ref = 'local-smoke'; executed_by_ref = 'local-toolchain'; attested_by_ref = 'local-toolchain'; attested_at = $observedAt.ToString('o'); collected_at = (Get-Date).ToUniversalTime().ToString('o')
generation = @{ provider_class = 'LOCAL_IMPLEMENTATION'; provider_ref = 'local-deterministic-generator'; model_config_ref = 'runtime-config://voice/agent-baseline-v1'; model_resource_ref = 'local-generator-v1'; account_ref = 'local'; region_ref = 'local'; data_terms_ref = 'local:no-external-transfer'; quota_evidence_ref = 'local:no-quota'; evaluation_evidence_ref = 'artifacts/agent-eval-report.mock.v1.json' }
embedding = @{ provider_class = 'LOCAL_IMPLEMENTATION'; provider_ref = 'local-deterministic-hash-v1'; model_ref = 'local-embedding-v1'; dimensions = 1536; dataset_ref = 'local-schema-smoke'; thresholds_ref = 'local-schema-smoke'; query_count = 6; passed_query_count = 6; data_terms_ref = 'local:no-external-transfer'; quota_evidence_ref = 'local:no-quota'; categories = Category-Results @('EXACT_CONFIRMED_MEMORY','PARAPHRASE_RECALL','CROSS_SUBJECT_ISOLATION','REVOKED_MEMORY_EXCLUSION','SENSITIVE_MEMORY_EXCLUSION','NO_MATCH_FALLBACK') }
content_safety = @{ provider_class = 'LOCAL_IMPLEMENTATION'; provider_ref = 'local-content-policy'; policy_ref = 'local-content-safety-policy'; dataset_ref = 'local-schema-smoke'; thresholds_ref = 'local-schema-smoke'; case_count = 6; passed_case_count = 6; data_terms_ref = 'local:no-external-transfer'; audit_evidence_ref = 'internal/contentpolicy'; categories = Category-Results @('VERIFICATION_CODE','FINANCIAL_ACCOUNT','PROMPT_INJECTION','SENSITIVE_MEDICAL','NORMAL_BENIGN','MODEL_OUTPUT_SAFETY') }
}
[System.IO.File]::WriteAllText($capturePath, ($capture | ConvertTo-Json -Depth 14), [System.Text.UTF8Encoding]::new($false))
go run ./cmd/agent-models-conformance -capture $capturePath -suite ./testdata/agent-eval-suite.v1.json -observations ./testdata/agent-eval-observations.mock.v1.json -agent-report ./artifacts/agent-eval-report.mock.v1.json -candidate-version '0.63.0-rc.local' -build-digest $imageDigest -output $reportPath
$report = Get-Content -Raw -LiteralPath $reportPath | ConvertFrom-Json
if ($report.result -ne 'PASS' -or $report.evidence_scope -ne 'LOCAL_AGENT_TOOLCHAIN' -or -not $report.external_validation_required -or $report.generation_case_count -ne 10 -or @($report.embedding_categories).Count -ne 6 -or @($report.content_safety_categories).Count -ne 6) { throw '本地Agent模型工具链报告边界不正确' }
Write-Host 'Agent模型证据工具链冒烟通过:固定10类生成评测、6类Embedding和6类内容安全结构完整;真实模型门禁继续待验。'
} finally {
if (Test-Path -LiteralPath $temporaryRoot) { Remove-Item -LiteralPath $temporaryRoot -Recurse -Force }
Write-Host '已清理Agent模型证据工具链临时文件。'
}