feat: surface Guanghu era time authority
This commit is contained in:
parent
a96c5955bb
commit
3294447dce
8 changed files with 733 additions and 23 deletions
|
|
@ -8,6 +8,8 @@ const stageOne = JSON.parse(read('contracts/stage-one-platform.json'))
|
|||
const rust = read('src-tauri/src/persona_time_authority.rs')
|
||||
const broker = read('src-tauri/src/direct_local_broker.rs')
|
||||
const lib = read('src-tauri/src/lib.rs')
|
||||
const personalChannel = read('src-tauri/src/personal_channel.rs')
|
||||
const frontend = read('src/main.tsx')
|
||||
|
||||
test('Guanghu era is anchored to Beijing reality time without inventing an exact historical instant', () => {
|
||||
assert.equal(contract.era_name, '曜冥纪元')
|
||||
|
|
@ -32,15 +34,37 @@ test('persona time tickets are durable unique and available to authenticated loc
|
|||
assert.match(broker, /GetBeijingTime/)
|
||||
assert.match(broker, /IssuePersonaTimeTicket/)
|
||||
assert.match(lib, /persona_time_authority::get_beijing_time_coordinate/)
|
||||
assert.match(lib, /persona_time_authority::get_guanghu_era_timeline/)
|
||||
assert.match(lib, /persona_time_authority::issue_persona_time_ticket/)
|
||||
assert.match(lib, /persona_time_authority::start_persona_time_authority/)
|
||||
assert.match(lib, /persona_time_authority::start_on_application_open\(\)/)
|
||||
})
|
||||
|
||||
test('the public home timeline and personal channel module share the same time authority', () => {
|
||||
assert.equal(contract.homepage_timeline.projection, 'PUBLIC_FACT_TIMELINE')
|
||||
assert.equal(contract.homepage_timeline.event_count, 12)
|
||||
assert.equal(contract.homepage_timeline.external_reality_claims, false)
|
||||
assert.equal(contract.homepage_timeline.permanent_idle_polling, false)
|
||||
assert.doesNotMatch(frontend, /setInterval\s*\(/)
|
||||
assert.equal(contract.personal_channel_module.installation, 'ATOMIC_WITH_PERSONAL_CHANNEL_INITIALIZATION')
|
||||
assert.equal(contract.personal_channel_module.existing_channel_migration, 'IDEMPOTENT_ADDITIVE')
|
||||
assert.match(personalChannel, /install_time_authority_module\(&transaction, created_at\)/)
|
||||
assert.match(personalChannel, /INSERT OR IGNORE INTO channel_modules/)
|
||||
assert.match(frontend, /EraTimelineOverlay/)
|
||||
assert.match(frontend, /time-module-strip/)
|
||||
assert.match(frontend, /打开软件时已联网校时/)
|
||||
})
|
||||
|
||||
test('unverified clock persona and host claims remain explicit truth boundaries', () => {
|
||||
assert.equal(contract.reality_time.current_verification, 'LOCAL_CLOCK_NOT_NETWORK_ATTESTED')
|
||||
assert.equal(contract.reality_time.primary_verification, 'NETWORK_HTTPS_DATE_SYNCHRONIZED_COARSE')
|
||||
assert.equal(contract.reality_time.offline_fallback_verification, 'LOCAL_CLOCK_NOT_NETWORK_ATTESTED')
|
||||
assert.equal(contract.truth_boundary.network_time_sync_on_application_open, true)
|
||||
assert.equal(contract.truth_boundary.network_clock_attestation, false)
|
||||
assert.equal(contract.event_coordinate.persona_current_verification, 'UNVERIFIED_CALLER_CLAIM')
|
||||
assert.equal(contract.event_coordinate.host_software_current_verification, 'UNVERIFIED_CALLER_CLAIM')
|
||||
assert.equal(contract.truth_boundary.installed_runtime_acceptance, false)
|
||||
assert.equal(contract.truth_boundary.world_lighthouse_authority_registration, false)
|
||||
assert.equal(stageOne.persona_time_authority.network_clock_attestation, false)
|
||||
assert.equal(stageOne.persona_time_authority.network_time_sync_on_application_open, true)
|
||||
assert.equal(stageOne.persona_time_authority.installed_runtime_acceptance, false)
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue