Files
cayce-ops/runtime/verify-identity.mjs
T
cayce 33ae345fbd
ci / lint-test-leaks (pull_request) Failing after 3s
runtime: outbox UNICO (imports absolutos) + relay-watcher con kill switch + guard R1-R8
- outbox.mjs solo en /srv/cayce-core; daemon/social/mail/ops lo importan por ruta absoluta. deploy.sh ya no instala copias.
- relay-watcher.mjs: cada 5 min cruza eventos de la pubkey en 5 relays con outbound_drafts; sin aprobacion => PUBLISH_OFF + DM + audit. Probado: detecto 2 kind0 bypass reales (post-hoc registrados).
- guard R1-R8 (18 tests) + blocklist + check-single-outbox al check diario.
- stale duplicados archivados en forensics/scripts-archive-20261102 (nostr-daemon.mjs, dm-debug, publish-10050, dm-test2, find-followers).
2026-11-02 00:41:57 +00:00

37 lines
1.9 KiB
JavaScript

import { loadIdentityBlock, identityFingerprint } from '/srv/cayce-core/outbox.mjs'
import { readFileSync } from 'node:fs'
const core = readFileSync('/srv/cayce-core/core.mjs', 'utf8')
const ed = readFileSync('/srv/cayce-core/editorials.mjs', 'utf8')
function blockFromOriginal(src, start, endMark) {
const i = src.indexOf(start)
if (i === -1) return null
return src.slice(i, src.indexOf(endMark, i) + endMark.length)
}
const checks = []
const dOrig = blockFromOriginal(core, 'You are Cayce, autonomous entity. Voice: dry, declarative, short sentences, zero corporate vocabulary', 'Stories already include URLs; keep them intact.')
checks.push(['digest', loadIdentityBlock('digest') === dOrig])
const eOrig = blockFromOriginal(ed, 'You are Cayce — autonomous entity, Próspera ZEDE', 'End with one sharp line of judgment.')
checks.push(['editorial', loadIdentityBlock('editorial') === eOrig])
// opinion/reflection/events: la parte estática original termina antes del separador dinámico
const oStart = 'You are Cayce, autonomous entity on Nostr. Voice: dry, declarative, short sentences, pattern-vs-apophenia as lens'
const oEnd = 'End with the article URL.'
checks.push(['opinion', loadIdentityBlock('opinion') === blockFromOriginal(core, oStart, oEnd)])
const rStart = 'You are Cayce, autonomous entity on Nostr. Write ONE reflective post'
const rEnd = '(use, ignore, or push against):'
checks.push(['reflection', loadIdentityBlock('reflection') === blockFromOriginal(core, rStart, rEnd)])
const vStart = 'You are Cayce, autonomous entity on Nostr. Voice: dry, declarative, short sentences, no hashtags'
const vEnd = 'If an event has a URL, include it.'
checks.push(['events', loadIdentityBlock('events') === blockFromOriginal(core, vStart, vEnd)])
let all = true
for (const [k, ok] of checks) { console.log(k, ok ? 'IDENTICO ✓' : 'DIFIERE ✗'); if (!ok) all = false }
console.log('fingerprint:', JSON.stringify(identityFingerprint()))
process.exit(all ? 0 : 1)