feat: admit signed web novel module family
This commit is contained in:
parent
df5e8f8e3c
commit
eb7223ea4c
41 changed files with 10452 additions and 21 deletions
|
|
@ -6,7 +6,7 @@ const catalog = JSON.parse(readFileSync(new URL('../contracts/module-donor-admis
|
|||
const numbered = JSON.parse(readFileSync(new URL('../contracts/numbered-ipc-registry.json', import.meta.url), 'utf8'))
|
||||
|
||||
test('chaotic donors are read-only candidates and never a bulk merge source', () => {
|
||||
assert.equal(catalog.state, 'THREE_CANDIDATES_ADMITTED_REMAINING_DONORS_QUARANTINED')
|
||||
assert.match(catalog.state, /^[A-Z]+_CANDIDATES_ADMITTED_REMAINING_DONORS_QUARANTINED$/)
|
||||
assert.equal(catalog.root_rule.repair_old_application_in_place, false)
|
||||
assert.equal(catalog.root_rule.bulk_merge_or_wholesale_copy_allowed, false)
|
||||
assert.equal(catalog.root_rule.one_candidate_per_admission_cycle, true)
|
||||
|
|
@ -15,9 +15,13 @@ test('chaotic donors are read-only candidates and never a bulk merge source', ()
|
|||
|
||||
test('candidate coordinates are unique but are not permanent runtime module numbers', () => {
|
||||
const coordinates = catalog.candidates.map((candidate) => candidate.candidate_number)
|
||||
const admitted = catalog.candidates.filter((candidate) => candidate.state.startsWith('ADMITTED'))
|
||||
const pending = catalog.candidates.filter((candidate) => candidate.state.startsWith('QUARANTINED'))
|
||||
assert.equal(new Set(coordinates).size, coordinates.length)
|
||||
assert.equal(catalog.candidates.filter((candidate) => candidate.state.startsWith('ADMITTED')).length, 3)
|
||||
assert.ok(catalog.candidates.slice(3).every((candidate) => candidate.state.startsWith('QUARANTINED')))
|
||||
assert.ok(admitted.length > 0)
|
||||
assert.ok(pending.length > 0)
|
||||
assert.deepEqual(catalog.candidates.slice(0, admitted.length), admitted)
|
||||
assert.deepEqual(catalog.candidates.slice(admitted.length), pending)
|
||||
assert.equal(catalog.root_rule.candidate_number_is_runtime_module_number, false)
|
||||
assert.equal(catalog.root_rule.permanent_module_number_assignment_before_acceptance, false)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ test('identity, webview and direct broker numbers compile into one unique eviden
|
|||
const generated = JSON.parse(readFileSync(new URL('../generated/unified-number-coordinate-tree.json', import.meta.url), 'utf8'))
|
||||
assert.deepEqual(generated, compileUnifiedNumberTree())
|
||||
assert.equal(generated.recordId, 'HLP-UNIFIED-NUMBER-TREE-001')
|
||||
assert.equal(generated.routeCount, 124)
|
||||
assert.equal(new Set(generated.routes.map((route) => route.path)).size, 124)
|
||||
assert.equal(generated.routeCount, 162)
|
||||
assert.equal(new Set(generated.routes.map((route) => route.path)).size, 162)
|
||||
assert.equal(generated.invariants.everyPhysicalCallHasNumberedRoute, true)
|
||||
assert.equal(generated.invariants.everyAcceptedCallHasEvidenceClass, true)
|
||||
assert.ok(generated.routes.every((route) => route.admission && route.evidence))
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
import assert from 'node:assert/strict'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import test from 'node:test'
|
||||
|
||||
const read = (path) => readFileSync(new URL(`../${path}`, import.meta.url), 'utf8')
|
||||
const registry = JSON.parse(read('contracts/numbered-ipc-registry.json'))
|
||||
const runtime = read('src-tauri/src/module_package_runtime.rs')
|
||||
const moduleAdapter = read('src-tauri/src/web_novel_modules.rs')
|
||||
const frontend = [
|
||||
read('src/modules/web-novel/WebNovelWorkspace.tsx'),
|
||||
read('src/modules/web-novel/AuthorModuleCenter.tsx'),
|
||||
read('src/modules/web-novel/AuthorWritingSidecar.tsx'),
|
||||
].join('\n')
|
||||
|
||||
const packages = [
|
||||
'WORKBENCH', 'OUTLINE', 'GRID', 'STORYWORLD', 'DELIVERY',
|
||||
].map((name) => JSON.parse(read(`fixtures/module-packages/HLP-MOD-OFFICIAL-WEB-NOVEL-${name}-0001-0.1.0.ghmod`)))
|
||||
|
||||
test('web novel family has five immutable official identities behind one shared lifecycle', () => {
|
||||
assert.equal(packages.length, 5)
|
||||
assert.ok(packages.every((value) => value.manifest.registrationClass === 'OFFICIAL_LIGHTHOUSE'))
|
||||
assert.ok(packages.every((value) => value.manifest.adapter === 'web-novel-workbench-v1'))
|
||||
assert.equal(new Set(packages.map((value) => value.manifest.moduleNumber)).size, 5)
|
||||
assert.match(runtime, /const BUNDLED_MODULES/)
|
||||
assert.doesNotMatch(frontend, /install_web_novel_author_module|mount_web_novel_author_module|uninstall_web_novel_author_module/)
|
||||
})
|
||||
|
||||
test('all 38 web novel effects cross exact numbered routes and no raw tauri command surface', () => {
|
||||
const routes = registry.operations.filter((route) => Number(route.operation_number.slice(-4)) >= 103 && Number(route.operation_number.slice(-4)) <= 140)
|
||||
assert.equal(routes.length, 38)
|
||||
assert.deepEqual([...new Set(routes.map((route) => route.module_number))], [
|
||||
'HLP-NIPC-MOD-0025', 'HLP-NIPC-MOD-0026', 'HLP-NIPC-MOD-0027', 'HLP-NIPC-MOD-0028', 'HLP-NIPC-MOD-0029',
|
||||
])
|
||||
assert.ok(routes.every((route) => route.admission === 'VERIFIED_HUMAN_ROUTE'))
|
||||
assert.doesNotMatch(frontend, /from ['"]@tauri-apps\/api\/core['"]/)
|
||||
for (const source of ['web_novel_workspace.rs', 'web_novel_import.rs', 'web_novel_author.rs', 'web_novel_modules.rs']) {
|
||||
assert.doesNotMatch(read(`src-tauri/src/${source}`), /#\[tauri::command\]/)
|
||||
}
|
||||
})
|
||||
|
||||
test('advanced effects require their own exact active module number', () => {
|
||||
assert.match(moduleAdapter, /require_module_active\(&app, OUTLINE\)/)
|
||||
assert.match(moduleAdapter, /require_module_active\(&app, GRID\)/)
|
||||
assert.match(moduleAdapter, /require_module_active\(&app, STORYWORLD\)/)
|
||||
assert.match(moduleAdapter, /require_module_active\(&app, DELIVERY\)/)
|
||||
assert.match(moduleAdapter, /shared signed package runtime/)
|
||||
})
|
||||
|
||||
test('workspace is independently lazy-loaded and preserves old account data in place', () => {
|
||||
assert.match(read('src/main.tsx'), /lazy\(\(\) => import\('\.\/modules\/web-novel\/WebNovelWorkspace'\)/)
|
||||
assert.equal(packages[0].payload.adapterConfig.legacyDataPolicy, 'READ_IN_PLACE_NO_DESTRUCTIVE_MIGRATION')
|
||||
assert.equal(packages[0].payload.adapterConfig.thirdPartyPublishDefault, 'DENY')
|
||||
assert.doesNotMatch(read('src-tauri/src/web_novel_workspace.rs'), /serde_json::from_str[^\n]+unwrap_or_default\(\)/)
|
||||
})
|
||||
Loading…
Reference in a new issue