Heimdall/tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Meta Vens 1d221ab7b6 Make app capability rules data instead of code
Every app profile carried an evaluateSharedCapabilities function beside a
sharedRule string describing what that function did. Two representations of one
rule, free to drift, and the reason a profile could never arrive at runtime: you
cannot accept a function from a stranger and run it inside the auth authority.

The rules were never more than a disjunction. Every sharedRule across all four
built-in profiles is "a || b || c" over a closed vocabulary, and one of them is
a bare reference to another capability. So the executable form is a list, not an
expression language, and anyOf is now the only representation. The readable form
is derived from it rather than stored beside it.

Evaluation runs to a fixed point because capabilities may reference each other:
repixelizer's queue_submit derives from app_access, and a single pass grants it
only when the rules happen to be declared in dependency order. It terminates
because the granted set only grows and is bounded by the rule count.

validateCapabilityRules is the gate that makes runtime registration acceptable.
A term must name a fact Heimdall itself produces or another capability in the
same profile. A registered app selects from what Heimdall has already decided is
true about an account; it cannot invent a fact to grant itself something, and it
cannot reach into another app's capabilities. An unknown term is refused rather
than treated as false, because a rule that silently never fires becomes a
support ticket instead of an error.

The four built-in profiles are now seed data rather than special cases: a
registered app produces the same shape and runs through the same evaluator.

Behaviour is unchanged. 74 tests pass, 18 of them new, covering derived
capabilities in both declaration orders, hybrid capabilities never being granted
from shared rules, and every rejection path in the validator.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-06 23:58:58 +02:00
..
access-plugin.test.ts Bind auth completions to their attempt handles 2026-08-22 12:01:56 +02:00
app.test.ts Retire the Spotiverse profile; keep the spotify provider intact for restore 2026-09-06 01:47:10 +02:00
browser-adapter.test.ts Resume Heimdall auth from browser return witness 2026-08-22 11:42:28 +02:00
capability-rules.test.ts Make app capability rules data instead of code 2026-09-06 23:58:58 +02:00
idunn-candidate-bind.test.ts Move the private command port with the candidate 2026-09-06 22:15:34 +02:00
idunn-rudp-health.test.ts Label signed health with its schema 2026-08-22 02:50:40 +02:00
odin-publication.test.ts Give Heimdall Odin documents unique catalog keys 2026-08-22 03:47:02 +02:00
presence-identity-descriptor.test.ts Read Idunn stores in the layout Idunn actually writes 2026-09-06 16:07:47 +02:00
process-write-lease.test.ts Retract the CultLib divergence claim; read each .cc with the right client 2026-09-06 19:11:19 +02:00
security.test.ts Authenticate Heimdall health publications 2026-08-20 19:56:35 +02:00
store.test.ts Add Eve access plugin and private auth plane 2026-08-22 00:44:57 +02:00
verse-runtime.test.ts Retire the Spotiverse profile; keep the spotify provider intact for restore 2026-09-06 01:47:10 +02:00
verse-witness.test.ts Retire the Spotiverse profile; keep the spotify provider intact for restore 2026-09-06 01:47:10 +02:00