Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-weknora) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-weknora) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-weknora) / End-to-end inside dsh (latest, advisory) (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Build & Publish (dsh-weknora) / Publish to npm (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s
44 lines
2.1 KiB
JavaScript
44 lines
2.1 KiB
JavaScript
'use strict'
|
|
|
|
// Offline CLI. It consumes reviewed fixture files and never calls a provider.
|
|
// A real deployment adapter must reserve/attest its diagnostic lane before
|
|
// using the pure continuation module; this command is only for acceptance.
|
|
|
|
const fs = require('node:fs')
|
|
const path = require('node:path')
|
|
const { runDiagnosticContinuation } = require('./wiki_leaf_diagnostic_continuation.cjs')
|
|
|
|
function argument(name) {
|
|
const prefix = `--${name}=`
|
|
const value = process.argv.slice(2).find(arg => arg.startsWith(prefix))
|
|
return value?.slice(prefix.length)
|
|
}
|
|
|
|
const allowed = new Set(['--manifest=', '--source=', '--outcome='])
|
|
const unknown = process.argv.slice(2).filter(arg => ![...allowed].some(prefix => arg.startsWith(prefix)))
|
|
if (unknown.length || !argument('manifest') || !argument('source') || !argument('outcome')) {
|
|
console.error('usage: node scripts/run_wiki_leaf_diagnostic_continuation.cjs --manifest=FILE --source=FILE --outcome=FILE')
|
|
process.exitCode = 2
|
|
} else {
|
|
try {
|
|
const read = file => fs.readFileSync(path.resolve(file), 'utf8')
|
|
const manifest = JSON.parse(read(argument('manifest')))
|
|
const source = read(argument('source'))
|
|
const outcome = JSON.parse(read(argument('outcome')))
|
|
const capture = []
|
|
const result = runDiagnosticContinuation(manifest, source, () => outcome, artifact => {
|
|
// Keep the CLI output replay-safe. The real private capture sink owns
|
|
// the raw response; this fixture command emits hashes and byte counts.
|
|
capture.push({ status: artifact.status, idempotency_key: artifact.idempotency_key,
|
|
response_sha256: artifact.response_sha256, response_bytes: artifact.response_bytes })
|
|
})
|
|
const windows = result.windows.map(window => ({ key: window.key, status: window.status,
|
|
start_rune: window.start_rune, end_rune: window.end_rune, text_sha256: window.text_sha256 }))
|
|
process.stdout.write(JSON.stringify({ receipt: result.receipt, windows, capture }, null, 2) + '\n')
|
|
} catch (error) {
|
|
process.stderr.write(JSON.stringify({ passed: false, code: error.code || 'continuation_failed', error: error.message }) + '\n')
|
|
process.exitCode = 1
|
|
}
|
|
}
|
|
|