Solution: adversarial rule and privacy enforcement
Выбранный подход#
Versioned JSON corpus плюс deterministic runner. Каждый rejected/clarification case сравнивает state hashes. Projection leakage проверяется по forbidden fact IDs/NPC IDs, а не только по UI text. Duplicate и stale concurrent commands проверяются по event-log size. fast-check дополняет named cases generated identifiers и replay sequences.
Архитектура и поток данных#
versioned case → prepared state → parser/proposal → schema/rules/version gate → result → state hash + event-log comparison → projection scan → report
generated input + seed → property harness → reducer/event log → replay hash + state invariants
Структура прототипа#
prototype/verify.ts— запускает corpus.- Integrated corpus/runner:
../2026-07-25-ai-gm-vertical-slice/prototype/.
Wrapper также запускает две central property functions через fast-check с
фиксированными numRuns: 200 и seed: 20260725; domain implementation не
дублируется.
Требования#
Node.js 24.14.0, TypeScript 7.0.2, fast-check 4.9.0.
Установка#
npm ci
Запуск#
node RnD/technical/2026-07-25-adversarial-rules-privacy/prototype/verify.ts
Ожидается JSON с 16 cases/unique categories, нулевыми failure/mutation/leakage/
duplicate counters и propertyChecks.status: "pass".
Тестирование#
node --test RnD/technical/2026-07-25-ai-gm-vertical-slice/prototype/tests/*.test.ts
npm run test:technical
npm run typecheck
npm run technical:demo
Конфигурация#
Network и secrets не требуются.
Ограничения и безопасность#
Corpus — regression floor, не полный security proof. Forbidden identifier scan не заменяет semantic exfiltration detection. In-memory sequential concurrency не доказывает transaction isolation внешнего event store. Fixed seed делает регрессию воспроизводимой, но не расширяет threat model автоматически.
Условия переноса в production#
Добавить auth/storage/network boundaries, реальный concurrent-writer test, STT injection corpus, provider red-team sessions, semantic leakage evaluation, audit-log integrity и incident telemetry.