braidio.rights#
Render profiles: enforce personal-vs-published rights as data.
Rights are encoded on the beats (SegmentBeat.rights, and — mechanically —
the presence of forbidden verbatim text in narration) and a render profile
filters the script into the beats that may actually render:
PERSONAL— include everything, including owned/copyrighted segment audio.PUBLISHED— exclude any non-publishable segment audio and any beat carrying forbidden verbatim text; keep original narration, publishable segments, and short transformative substitutes.
The rule is enforced mechanically: plan_production() routes beats by
their rights flag, and find_verbatim_text() / content_violations()
scan the resulting published beats against a caller-supplied set of
forbidden texts (via RightsPolicy) — so a leak is a test failure, not a
judgment call. braidio owns the scanner + profile filter; the consumer injects
what is forbidden (e.g. Hamilton injects the song’s lyric lines).
Not legal advice.
Module Attributes
The profile a render uses when the caller declares none — the permissive one, so a production that never mentions rights renders everything it was given. |
Functions
|
Whether a segment with |
|
Rights violations in a published plan (empty list = clean). |
|
Forbidden lines that appear (near-)verbatim in |
|
Filter |
|
The publishable test at the level of a bare |
|
Whether |
Classes
|
A beat resolved for a profile — what the renderer actually plays. |
|
Which projection of the production we render. |
|
|
|
Injected rights configuration for the published profile. |
Exceptions
A render would play source audio the profile it claims forbids. |
- braidio.rights.DEFAULT_PROFILE: Profile = Profile.PERSONAL#
The profile a render uses when the caller declares none — the permissive one, so a production that never mentions rights renders everything it was given. Every entry point resolves its default from here (the no-graph fast path
braidio.render.render_production()/braidio.formats.render_format(), the graph pathbraidio.transforms.weave_project(), and the MCP tools), so the two render paths cannot drift into disagreeing about what “unspecified” means.
- class braidio.rights.PlannedBeat(kind, content, from_index, note='', turns=None)[source]#
Bases:
objectA beat resolved for a profile — what the renderer actually plays.
kindis"narration"(synthesizecontent),"clip"(resolvecontentas a segment reference and cut audio),"dialogue"(synthesizeturns) or"scene_break"(a structural boundary — no content; the renderer marks it with music).from_indexpoints at the source beat;noterecords any substitution/drop reasoning.
- class braidio.rights.RenderPlan(profile, beats=<factory>, dropped=<factory>, substituted=<factory>)[source]#
Bases:
object
- class braidio.rights.RightsPolicy(forbidden_texts=<function RightsPolicy.<lambda>>, publishable_clip_rights=frozenset({'public-domain'}))[source]#
Bases:
objectInjected rights configuration for the published profile.
forbidden_textsyields the strings that must not appear verbatim in published narration (e.g. copyrighted lyric lines).publishable_clip_rightsis the set of segmentrightsvalues allowed in the published cut.
- exception braidio.rights.RightsViolation[source]#
Bases:
ValueErrorA render would play source audio the profile it claims forbids.
Raised where a rights decision is verified rather than made — today by the graph path’s episode transform, which checks the members it is about to weave against the profile it is about to stamp on them. A
ValueErrorsubclass so existing callers keep catching it, typed so a caller that cares can tell a rights refusal from a malformed input.
- braidio.rights.clip_plays_under(profile, rights, publishable=frozenset({'public-domain'}))[source]#
Whether a segment with
rightsplays as audio underprofile.The whole clip-routing rule, in one place:
PERSONALplays everything,PUBLISHEDplays only publishable rights.plan_production()asks it when it filters a script, and the graph’s episode transform re-asks it at weave time to verify that the members it inherited still match the profile the production now declares — one rule, asked twice, never copied.- Return type:
- braidio.rights.content_violations(plan, forbidden, *, min_words=5)[source]#
Rights violations in a published plan (empty list = clean).
Fails if any planned beat plays non-publishable segment audio, or any narration beat contains forbidden verbatim text.
- braidio.rights.find_verbatim_text(text, forbidden, *, min_words=5)[source]#
Forbidden lines that appear (near-)verbatim in
text.A line counts as leaked if
textshares a run ofmin_wordsconsecutive words with it (case-insensitive, word-level). Single words and short common phrases don’t trip it — only substantial verbatim quoting.
- braidio.rights.plan_production(script, profile, *, publishable_clip_rights=frozenset({'public-domain'}))[source]#
Filter
scriptinto the beats renderable underprofile.- Return type:
- braidio.rights.rights_are_publishable(rights, publishable=frozenset({'public-domain'}))[source]#
The publishable test at the level of a bare
rightsstring.The graph records rights on nodes, not on
SegmentBeats, so the check has to be askable without a beat in hand — but it must stay the same check.segment_is_publishable()is this function with a beat unwrapped, never a parallel rule.- Return type: