1
0
Fork 0
polaris-task-force/tests
Z8MB1E 2384c7f5a4 feat(intelligence): add the faction relation ledger collection and score math
Pairwise faction attitudes were hand-typed into a per-faction array, so the
two directions of one relationship lived in different documents and could
disagree with each other.

Add `faction-relation-entries`: one row per event that moved one faction's
attitude toward another, with the score computed on read instead of stored.
Entries are directed by default with a mutual flag for shared events; severity
tiers set the delta with a custom override; decaying entries halve per
half-life (new GameRules knob, 30 days default) while lasting shifts never
fade; voiding retires an entry with a stamped reason instead of deleting it;
hidden entries still move the score but never explain it to players.

`factionRelations.ts` holds the pure math (severity presets, decay, directed
and mutual scores, bands), and `factionRelationLedger.ts` is the single read
path so the voided, hidden and undiscovered-faction rules exist in one place.
Reads run as the caller, never with `overrideAccess`; GM notes are gated by
field read access, and hidden rows are censored by an `afterRead` hook.

Includes the permission group, the `admin:faction-relation-entries:manage`
page gate, the integration spec, and the migration that creates the table and
its enums.
2026-11-18 14:13:20 -05:00
..
audit test(audit): support exact route filtering in the mobile audit 2026-10-13 10:38:45 -04:00
e2e fix(map-objectives): read Playwright request failure via errorText 2026-10-27 02:13:44 -04:00
fixtures Revert "feat(minigames): make Bomperator own-seat movement server-authoritative" 2026-10-21 20:25:38 -04:00
helpers test(vitest): isolate:false shared forks with per-pid template clones + memoized payload boot 2026-10-21 12:54:30 -04:00
int feat(intelligence): add the faction relation ledger collection and score math 2026-11-18 14:13:20 -05:00
push-schema.ts test(int-suite): auto-accept drizzle push prompts in tests/push-schema.ts 2026-10-21 10:03:33 -04:00
seed-baseline.ts feat(test): run tests against a dedicated truncated database 2026-09-22 17:58:17 -04:00
test-db.ts test(vitest): honor KEEP_TEST_DBS=0 as force-drop escape hatch 2026-10-21 13:04:15 -04:00
vitest-global.ts test(vitest): parallel forks with per-worker database clones 2026-10-21 10:41:57 -04:00
vitest-marker.ts test(vitest): parallel forks with per-worker database clones 2026-10-21 10:41:57 -04:00
vitest-reporter.ts test(vitest): isolate:false shared forks with per-pid template clones + memoized payload boot 2026-10-21 12:54:30 -04:00
vitest-teardown.ts test(vitest): honor KEEP_TEST_DBS=0 as force-drop escape hatch 2026-10-21 13:04:15 -04:00
vitest-worker-setup.ts test(vitest): isolate:false shared forks with per-pid template clones + memoized payload boot 2026-10-21 12:54:30 -04:00