WeKnora deployment source with the reviewed wiki identity, summary and recovery fixes
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
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
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
const assert = require('node:assert/strict')
|
||||
const { test } = require('node:test')
|
||||
const { spawnSync } = require('node:child_process')
|
||||
const path = require('node:path')
|
||||
const { materials, sourceSummary, versionWithSources, cleanupBlocker } = require('./verify_current_generation.cjs')
|
||||
|
||||
test('99 real files are unique and remain in one complete model batch', () => {
|
||||
const sources = materials()
|
||||
assert.equal(sources.length, 99)
|
||||
assert.equal(new Set(sources.map(source => source.name)).size, 99)
|
||||
assert.equal(new Set(sourceSummary(sources).map(source => source.sha256)).size, 99)
|
||||
assert.ok(sources.reduce((sum, source) => sum + [...source.text].length, 0) < 12000)
|
||||
const all = [...sources, ...materials(100, 1)]
|
||||
assert.equal(new Set(all.map(source => source.text)).size, 100)
|
||||
})
|
||||
|
||||
test('source verification detects missing and truncated middle files', () => {
|
||||
const sources = materials()
|
||||
assert.throws(() => versionWithSources([{ number: 2, sources: sources.filter((_, index) => index !== 49) }], 2, sources), /Every submitted source/)
|
||||
const truncated = sources.map((source, index) => index === 49 ? { ...source, text: source.text.slice(0, 30) } : source)
|
||||
assert.throws(() => versionWithSources([{ number: 2, sources: truncated }], 2, sources), /Every submitted source/)
|
||||
})
|
||||
|
||||
test('cleanup retains active jobs and every resource they depend on', () => {
|
||||
const agent = { id: 'agent', archived: true, jobs: [], depends_on: [], deleted: false }
|
||||
const flow = { id: 'flow', archived: true, jobs: [], depends_on: ['agent'], deleted: false }
|
||||
const task = { id: 'task', archived: true, jobs: [{ status: 'running' }], depends_on: ['flow'], deleted: false }
|
||||
const fixtures = [agent, flow, task]
|
||||
assert.equal(cleanupBlocker(task, fixtures), 'job_not_terminal')
|
||||
assert.equal(cleanupBlocker(flow, fixtures), 'dependent_fixture_retained')
|
||||
assert.equal(cleanupBlocker(agent, fixtures), 'dependent_fixture_retained')
|
||||
task.jobs[0].status = 'failed'
|
||||
assert.equal(cleanupBlocker(task, fixtures), '')
|
||||
task.deleted = true
|
||||
assert.equal(cleanupBlocker(flow, fixtures), '')
|
||||
flow.deleted = true
|
||||
assert.equal(cleanupBlocker(agent, fixtures), '')
|
||||
})
|
||||
|
||||
test('unarchived fixtures and uncertain submissions cannot be deleted', () => {
|
||||
const human = { id: 'human', archived: false, jobs: [], depends_on: [], deleted: false }
|
||||
assert.equal(cleanupBlocker(human, [human]), 'archive_missing')
|
||||
human.archived = true
|
||||
human.uncertain = true
|
||||
assert.equal(cleanupBlocker(human, [human]), 'request_outcome_uncertain')
|
||||
})
|
||||
|
||||
test('executing without explicit opt-in performs no production work', () => {
|
||||
const env = { ...process.env }
|
||||
delete env.RUN_CURRENT_GENERATION
|
||||
const result = spawnSync(process.execPath, [path.join(__dirname, 'verify_current_generation.cjs')], { env, encoding: 'utf8', timeout: 5000 })
|
||||
assert.equal(result.status, 0)
|
||||
assert.match(result.stdout, /Prepared only/)
|
||||
assert.equal(result.stderr, '')
|
||||
})
|
||||
Reference in New Issue
Block a user