The host's gate, run before every write.
The built-in secret guard (Reminisce.SecretGuard) runs first and cannot be
turned off; the policy is the host's second line. It sees the owner and the
attributes about to be written and answers:
:ok— write it;{:hold, :review}— write it only with areviewed_by; without one the write is refused as{:error, {:held, :review}};{:refuse, rule}— refuse it as{:error, {:policy, rule}}.ruleis an atom that names the rule, never the words.
Summary
Callbacks
The host's gate on the persona DNA (docs/spec.md §C.3), which a policy may
leave out. It runs before Reminisce.persona_set/3, Reminisce.persona_adopt/4
and Reminisce.persona_fork/4 write, after the library's own rules, and
answers as check/2 does.
Callbacks
@callback check(Reminisce.owner(), attrs :: map()) :: :ok | {:hold, :review} | {:refuse, atom()}
@callback check_persona(Reminisce.owner(), version :: map(), context :: map()) :: :ok | {:hold, :review} | {:refuse, atom()}
The host's gate on the persona DNA (docs/spec.md §C.3), which a policy may
leave out. It runs before Reminisce.persona_set/3, Reminisce.persona_adopt/4
and Reminisce.persona_fork/4 write, after the library's own rules, and
answers as check/2 does.
It sees the agent, the version about to become current (a
Reminisce.Persona.Version, %{number:, status:, basis:, base:, reason:, persona_set_by:, persona_proposed_by:, reviewed_by:, strands:} with no
times, forked_from or change, each strand %{key:, kind:, name:, content:, basis:, new:, derived_from:, sources:, subjects:}), and a
context:
op—:set,:adoptor:fork;change— its change from the current version, asReminisce.persona_change/5answers it withscope: :all, ornilfor a version 1; for a fork, from the parent's version;change_from_first— its change from version 1, ornil;drift— the drift report (Reminisce.persona_drift/3) of the strandschangetouches, ornilwhen there is no current version.
A bound over time, such as "no more than three changes of voice a
quarter", belongs here. Each new strand also passes through check/2,
as the memory it is, with the aspect :persona.