braidio 0.0.83__tar.gz → 0.0.85__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. {braidio-0.0.83 → braidio-0.0.85}/PKG-INFO +4 -4
  2. {braidio-0.0.83 → braidio-0.0.85}/braidio/mcp/tools.py +1 -1
  3. {braidio-0.0.83 → braidio-0.0.85}/braidio/transforms/__init__.py +53 -10
  4. {braidio-0.0.83 → braidio-0.0.85}/pyproject.toml +10 -6
  5. {braidio-0.0.83 → braidio-0.0.85}/tests/test_transforms.py +88 -2
  6. {braidio-0.0.83 → braidio-0.0.85}/.editorconfig +0 -0
  7. {braidio-0.0.83 → braidio-0.0.85}/.gitattributes +0 -0
  8. {braidio-0.0.83 → braidio-0.0.85}/.gitignore +0 -0
  9. {braidio-0.0.83 → braidio-0.0.85}/LICENSE +0 -0
  10. {braidio-0.0.83 → braidio-0.0.85}/README.md +0 -0
  11. {braidio-0.0.83 → braidio-0.0.85}/braidio/__init__.py +0 -0
  12. {braidio-0.0.83 → braidio-0.0.85}/braidio/_paths.py +0 -0
  13. {braidio-0.0.83 → braidio-0.0.85}/braidio/bodies/__init__.py +0 -0
  14. {braidio-0.0.83 → braidio-0.0.85}/braidio/bodies/_domain.py +0 -0
  15. {braidio-0.0.83 → braidio-0.0.85}/braidio/bodies/_render_nodes.py +0 -0
  16. {braidio-0.0.83 → braidio-0.0.85}/braidio/bodies/_tiers.py +0 -0
  17. {braidio-0.0.83 → braidio-0.0.85}/braidio/bodies/_video.py +0 -0
  18. {braidio-0.0.83 → braidio-0.0.85}/braidio/captions.py +0 -0
  19. {braidio-0.0.83 → braidio-0.0.85}/braidio/compose.py +0 -0
  20. {braidio-0.0.83 → braidio-0.0.85}/braidio/conversation.py +0 -0
  21. {braidio-0.0.83 → braidio-0.0.85}/braidio/cost.py +0 -0
  22. {braidio-0.0.83 → braidio-0.0.85}/braidio/data/skills/braidio/SKILL.md +0 -0
  23. {braidio-0.0.83 → braidio-0.0.85}/braidio/data/skills/braidio-commentary-video/SKILL.md +0 -0
  24. {braidio-0.0.83 → braidio-0.0.85}/braidio/defaults.py +0 -0
  25. {braidio-0.0.83 → braidio-0.0.85}/braidio/delivery.py +0 -0
  26. {braidio-0.0.83 → braidio-0.0.85}/braidio/downloads.py +0 -0
  27. {braidio-0.0.83 → braidio-0.0.85}/braidio/formats.py +0 -0
  28. {braidio-0.0.83 → braidio-0.0.85}/braidio/genre.py +0 -0
  29. {braidio-0.0.83 → braidio-0.0.85}/braidio/importing/__init__.py +0 -0
  30. {braidio-0.0.83 → braidio-0.0.85}/braidio/importing/__main__.py +0 -0
  31. {braidio-0.0.83 → braidio-0.0.85}/braidio/importing/_catalog.py +0 -0
  32. {braidio-0.0.83 → braidio-0.0.85}/braidio/importing/_manifest.py +0 -0
  33. {braidio-0.0.83 → braidio-0.0.85}/braidio/importing/_writer.py +0 -0
  34. {braidio-0.0.83 → braidio-0.0.85}/braidio/kinds.py +0 -0
  35. {braidio-0.0.83 → braidio-0.0.85}/braidio/leveling.py +0 -0
  36. {braidio-0.0.83 → braidio-0.0.85}/braidio/markdown_script.py +0 -0
  37. {braidio-0.0.83 → braidio-0.0.85}/braidio/mcp/__init__.py +0 -0
  38. {braidio-0.0.83 → braidio-0.0.85}/braidio/mcp/_docs.py +0 -0
  39. {braidio-0.0.83 → braidio-0.0.85}/braidio/mcp/_guide.py +0 -0
  40. {braidio-0.0.83 → braidio-0.0.85}/braidio/mcp/_helpers.py +0 -0
  41. {braidio-0.0.83 → braidio-0.0.85}/braidio/mcp/_media.py +0 -0
  42. {braidio-0.0.83 → braidio-0.0.85}/braidio/mcp/credentials.py +0 -0
  43. {braidio-0.0.83 → braidio-0.0.85}/braidio/mcp/metering.py +0 -0
  44. {braidio-0.0.83 → braidio-0.0.85}/braidio/mcp/workspace.py +0 -0
  45. {braidio-0.0.83 → braidio-0.0.85}/braidio/multivoice.py +0 -0
  46. {braidio-0.0.83 → braidio-0.0.85}/braidio/music.py +0 -0
  47. {braidio-0.0.83 → braidio-0.0.85}/braidio/pacing.py +0 -0
  48. {braidio-0.0.83 → braidio-0.0.85}/braidio/project.py +0 -0
  49. {braidio-0.0.83 → braidio-0.0.85}/braidio/provenance.py +0 -0
  50. {braidio-0.0.83 → braidio-0.0.85}/braidio/relevance.py +0 -0
  51. {braidio-0.0.83 → braidio-0.0.85}/braidio/render.py +0 -0
  52. {braidio-0.0.83 → braidio-0.0.85}/braidio/rights.py +0 -0
  53. {braidio-0.0.83 → braidio-0.0.85}/braidio/script.py +0 -0
  54. {braidio-0.0.83 → braidio-0.0.85}/braidio/sources.py +0 -0
  55. {braidio-0.0.83 → braidio-0.0.85}/braidio/structure.py +0 -0
  56. {braidio-0.0.83 → braidio-0.0.85}/braidio/style.py +0 -0
  57. {braidio-0.0.83 → braidio-0.0.85}/braidio/textprep.py +0 -0
  58. {braidio-0.0.83 → braidio-0.0.85}/braidio/timeline.py +0 -0
  59. {braidio-0.0.83 → braidio-0.0.85}/braidio/transforms/_asset_refs.py +0 -0
  60. {braidio-0.0.83 → braidio-0.0.85}/braidio/transforms/_common.py +0 -0
  61. {braidio-0.0.83 → braidio-0.0.85}/braidio/transforms/_dialogue.py +0 -0
  62. {braidio-0.0.83 → braidio-0.0.85}/braidio/transforms/_episode.py +0 -0
  63. {braidio-0.0.83 → braidio-0.0.85}/braidio/transforms/_ingest.py +0 -0
  64. {braidio-0.0.83 → braidio-0.0.85}/braidio/transforms/_narration.py +0 -0
  65. {braidio-0.0.83 → braidio-0.0.85}/braidio/transforms/_segment.py +0 -0
  66. {braidio-0.0.83 → braidio-0.0.85}/braidio/transforms/_video_cut.py +0 -0
  67. {braidio-0.0.83 → braidio-0.0.85}/braidio/transforms/_video_panels.py +0 -0
  68. {braidio-0.0.83 → braidio-0.0.85}/braidio/transforms/_voice.py +0 -0
  69. {braidio-0.0.83 → braidio-0.0.85}/braidio/tts.py +0 -0
  70. {braidio-0.0.83 → braidio-0.0.85}/braidio/video.py +0 -0
  71. {braidio-0.0.83 → braidio-0.0.85}/braidio/voice_library.py +0 -0
  72. {braidio-0.0.83 → braidio-0.0.85}/braidio/weave.py +0 -0
  73. {braidio-0.0.83 → braidio-0.0.85}/braidio/weave_config.py +0 -0
  74. {braidio-0.0.83 → braidio-0.0.85}/conftest.py +0 -0
  75. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/Extraction and nw-App Design.md +0 -0
  76. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/research/commentary-formats-and-styles.md +0 -0
  77. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/research/conversational-vs-narration-tts.md +0 -0
  78. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/research/notebooklm-and-conversational-pacing.md +0 -0
  79. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/style/README.md +0 -0
  80. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/style/anti-platitude-checklist.md +0 -0
  81. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/style/commentary-voice-guide.md +0 -0
  82. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/style/voices/_style-groups.md +0 -0
  83. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/style/voices/amanda-dobbins.md +0 -0
  84. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/style/voices/david-sims.md +0 -0
  85. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/style/voices/griffin-newman.md +0 -0
  86. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/style/voices/helen-molesworth.md +0 -0
  87. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/style/voices/hrishikesh-hirway.md +0 -0
  88. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/style/voices/jason-mantzoukas.md +0 -0
  89. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/style/voices/john-mcwhorter.md +0 -0
  90. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/style/voices/jon-caramanica.md +0 -0
  91. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/style/voices/june-diane-raphael.md +0 -0
  92. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/style/voices/karina-longworth.md +0 -0
  93. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/style/voices/katy-hessel.md +0 -0
  94. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/style/voices/louis-theroux.md +0 -0
  95. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/style/voices/mallory-rubin.md +0 -0
  96. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/style/voices/melvyn-bragg.md +0 -0
  97. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/style/voices/michael-barbaro.md +0 -0
  98. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/style/voices/nate-sloan-charlie-harding.md +0 -0
  99. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/style/voices/paul-scheer.md +0 -0
  100. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/style/voices/sean-fennessey.md +0 -0
  101. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/style/voices/talk-art.md +0 -0
  102. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/style/voices/yasi-salek.md +0 -0
  103. {braidio-0.0.83 → braidio-0.0.85}/misc/docs/youtube_ingest_credentials.md +0 -0
  104. {braidio-0.0.83 → braidio-0.0.85}/tests/_audio.py +0 -0
  105. {braidio-0.0.83 → braidio-0.0.85}/tests/test_body_schema_stability.py +0 -0
  106. {braidio-0.0.83 → braidio-0.0.85}/tests/test_conversation.py +0 -0
  107. {braidio-0.0.83 → braidio-0.0.85}/tests/test_cost.py +0 -0
  108. {braidio-0.0.83 → braidio-0.0.85}/tests/test_credits_card.py +0 -0
  109. {braidio-0.0.83 → braidio-0.0.85}/tests/test_defaults.py +0 -0
  110. {braidio-0.0.83 → braidio-0.0.85}/tests/test_delivery.py +0 -0
  111. {braidio-0.0.83 → braidio-0.0.85}/tests/test_downloads.py +0 -0
  112. {braidio-0.0.83 → braidio-0.0.85}/tests/test_expressiveness.py +0 -0
  113. {braidio-0.0.83 → braidio-0.0.85}/tests/test_formats.py +0 -0
  114. {braidio-0.0.83 → braidio-0.0.85}/tests/test_genre_placement.py +0 -0
  115. {braidio-0.0.83 → braidio-0.0.85}/tests/test_graph_speak.py +0 -0
  116. {braidio-0.0.83 → braidio-0.0.85}/tests/test_importing.py +0 -0
  117. {braidio-0.0.83 → braidio-0.0.85}/tests/test_leveling.py +0 -0
  118. {braidio-0.0.83 → braidio-0.0.85}/tests/test_markdown_script.py +0 -0
  119. {braidio-0.0.83 → braidio-0.0.85}/tests/test_mcp.py +0 -0
  120. {braidio-0.0.83 → braidio-0.0.85}/tests/test_mcp_caller_key.py +0 -0
  121. {braidio-0.0.83 → braidio-0.0.85}/tests/test_media_auth.py +0 -0
  122. {braidio-0.0.83 → braidio-0.0.85}/tests/test_multivoice.py +0 -0
  123. {braidio-0.0.83 → braidio-0.0.85}/tests/test_music.py +0 -0
  124. {braidio-0.0.83 → braidio-0.0.85}/tests/test_namespaced_source.py +0 -0
  125. {braidio-0.0.83 → braidio-0.0.85}/tests/test_nw_app.py +0 -0
  126. {braidio-0.0.83 → braidio-0.0.85}/tests/test_pacing.py +0 -0
  127. {braidio-0.0.83 → braidio-0.0.85}/tests/test_packaging.py +0 -0
  128. {braidio-0.0.83 → braidio-0.0.85}/tests/test_render_settings.py +0 -0
  129. {braidio-0.0.83 → braidio-0.0.85}/tests/test_script.py +0 -0
  130. {braidio-0.0.83 → braidio-0.0.85}/tests/test_sources.py +0 -0
  131. {braidio-0.0.83 → braidio-0.0.85}/tests/test_speak_seam.py +0 -0
  132. {braidio-0.0.83 → braidio-0.0.85}/tests/test_structure.py +0 -0
  133. {braidio-0.0.83 → braidio-0.0.85}/tests/test_textprep_style.py +0 -0
  134. {braidio-0.0.83 → braidio-0.0.85}/tests/test_timeline.py +0 -0
  135. {braidio-0.0.83 → braidio-0.0.85}/tests/test_transforms_dialogue.py +0 -0
  136. {braidio-0.0.83 → braidio-0.0.85}/tests/test_transforms_episode_members.py +0 -0
  137. {braidio-0.0.83 → braidio-0.0.85}/tests/test_transforms_rights.py +0 -0
  138. {braidio-0.0.83 → braidio-0.0.85}/tests/test_transforms_secrets.py +0 -0
  139. {braidio-0.0.83 → braidio-0.0.85}/tests/test_transforms_structure.py +0 -0
  140. {braidio-0.0.83 → braidio-0.0.85}/tests/test_tts_api_key.py +0 -0
  141. {braidio-0.0.83 → braidio-0.0.85}/tests/test_turn_overlap.py +0 -0
  142. {braidio-0.0.83 → braidio-0.0.85}/tests/test_video.py +0 -0
  143. {braidio-0.0.83 → braidio-0.0.85}/tests/test_video_bodies.py +0 -0
  144. {braidio-0.0.83 → braidio-0.0.85}/tests/test_video_footage.py +0 -0
  145. {braidio-0.0.83 → braidio-0.0.85}/tests/test_video_transforms.py +0 -0
  146. {braidio-0.0.83 → braidio-0.0.85}/tests/test_voice_library.py +0 -0
  147. {braidio-0.0.83 → braidio-0.0.85}/tests/test_weave.py +0 -0
  148. {braidio-0.0.83 → braidio-0.0.85}/tests/test_weave_config.py +0 -0
  149. {braidio-0.0.83 → braidio-0.0.85}/tests/test_wire_descriptions.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: braidio
3
- Version: 0.0.83
3
+ Version: 0.0.85
4
4
  Summary: Weave narration with extracted media segments into audiovisual productions
5
5
  Project-URL: Homepage, https://github.com/thorwhalen/braidio
6
6
  Project-URL: Repository, https://github.com/thorwhalen/braidio
@@ -41,7 +41,7 @@ Provides-Extra: importing
41
41
  Requires-Dist: falaw; extra == 'importing'
42
42
  Requires-Dist: illustration>=0.0.11; extra == 'importing'
43
43
  Requires-Dist: lacing; extra == 'importing'
44
- Requires-Dist: nw>=0.0.65; extra == 'importing'
44
+ Requires-Dist: nw>=0.0.108; extra == 'importing'
45
45
  Provides-Extra: markdown
46
46
  Requires-Dist: markdown-it-py; extra == 'markdown'
47
47
  Requires-Dist: mdit-py-plugins; extra == 'markdown'
@@ -53,14 +53,14 @@ Requires-Dist: graze>=0.1.45; extra == 'mcp'
53
53
  Requires-Dist: lacing; extra == 'mcp'
54
54
  Requires-Dist: markdown-it-py; extra == 'mcp'
55
55
  Requires-Dist: mdit-py-plugins; extra == 'mcp'
56
- Requires-Dist: nw>=0.0.65; extra == 'mcp'
56
+ Requires-Dist: nw>=0.0.108; extra == 'mcp'
57
57
  Requires-Dist: py2mcp>=0.1.9; extra == 'mcp'
58
58
  Requires-Dist: pypdf; extra == 'mcp'
59
59
  Requires-Dist: yb[download]>=0.1.24; extra == 'mcp'
60
60
  Provides-Extra: nw-app
61
61
  Requires-Dist: falaw[fal]; extra == 'nw-app'
62
62
  Requires-Dist: lacing; extra == 'nw-app'
63
- Requires-Dist: nw>=0.0.65; extra == 'nw-app'
63
+ Requires-Dist: nw>=0.0.108; extra == 'nw-app'
64
64
  Provides-Extra: video
65
65
  Requires-Dist: burns>=0.0.16; extra == 'video'
66
66
  Requires-Dist: pillow; extra == 'video'
@@ -450,7 +450,7 @@ def save_script(
450
450
  ingested = braidio.transforms.ingest_script(
451
451
  proj,
452
452
  scr,
453
- config=braidio.transforms.format_config(fmt),
453
+ config=braidio.transforms.resolve_config(proj, fmt),
454
454
  source=src,
455
455
  structure=structure,
456
456
  bed=bed,
@@ -91,6 +91,7 @@ video_cut_reuses_existing = _video_cut.reuses_existing_cut
91
91
 
92
92
  __all__ = [
93
93
  "format_config",
94
+ "resolve_config",
94
95
  "ingest_script",
95
96
  "IngestedScript",
96
97
  "weave_project",
@@ -122,16 +123,27 @@ __all__ = [
122
123
  ]
123
124
 
124
125
 
126
+ #: What a narration render was synthesized with: the config keys a re-weave
127
+ #: must keep, or every one of those renders re-synthesizes (and re-bills).
128
+ VOICE_KEYS = ("model_id", "voice_settings")
129
+
130
+
125
131
  def format_config(fmt=None, *, config=None, voice_id=None):
126
- """The weave-config a production records: one rule for every writer.
132
+ """The weave-config a production asks for: one rule for every writer.
127
133
 
128
134
  ``config`` else the format's ``weave``, carrying the narration voice —
129
- ``voice_id`` else ``fmt.narration_voice`` — when there is one. ``weave_project``
130
- and ``save_script`` both resolve through here, so saving and then weaving a
131
- format never rewrites the config node (and so never re-stales its renders).
135
+ ``voice_id`` else ``fmt.narration_voice`` — when there is one. A format's
136
+ ``weave`` holds the editing knobs and its ``narration_delivery`` what the
137
+ narrator speaks with, so the format's config takes the delivery's model and
138
+ settings: what the fast path renders with (braidio#120). An explicit
139
+ ``config`` is used as given. Pure: :func:`resolve_config` is what applies
140
+ it to a project.
132
141
  """
133
142
  if config is None and fmt is not None:
134
- config = fmt.weave
143
+ delivery = fmt.narration_delivery
144
+ config = fmt.weave.with_(
145
+ model_id=delivery.model_id, voice_settings=dict(delivery.voice_settings)
146
+ )
135
147
  if voice_id is None and fmt is not None:
136
148
  voice_id = fmt.narration_voice
137
149
  if voice_id is not None:
@@ -139,6 +151,33 @@ def format_config(fmt=None, *, config=None, voice_id=None):
139
151
  return config
140
152
 
141
153
 
154
+ def resolve_config(project, fmt=None, *, config=None, voice_id=None):
155
+ """The weave-config to ingest into ``project``: :func:`format_config`, minus
156
+ any change to what its narration was already synthesized with.
157
+
158
+ Once a project has narration renders, a re-weave keeps the model and
159
+ settings (:data:`VOICE_KEYS`) its weave-config records, with or without a
160
+ format, unless the caller passes ``config=`` explicitly: changing them
161
+ would re-synthesize, and re-bill, every narration beat (braidio#135,
162
+ option 2). So the model and settings are fixed by a project's first
163
+ render; ``config=`` is how to change them. Before any render (a script
164
+ saved, not yet woven) there is nothing to re-bill, and the format's
165
+ delivery applies. ``weave_project`` and ``save_script`` both resolve
166
+ through here, so saving and then weaving never rewrites the config node.
167
+ """
168
+ import nw
169
+
170
+ resolved = format_config(fmt, config=config, voice_id=voice_id)
171
+ if config is not None or not nw.annotations_at_tier(
172
+ project.root, "narration-renders"
173
+ ):
174
+ return resolved
175
+ nodes = nw.annotations_at_tier(project.root, "weave-configs")
176
+ recorded = dict(nodes[0].body.get("config", {})) if nodes else {}
177
+ kept = {key: recorded[key] for key in VOICE_KEYS if key in recorded}
178
+ return (resolved or WeaveConfig()).with_(**kept)
179
+
180
+
142
181
  def weave_project(
143
182
  project,
144
183
  script,
@@ -168,10 +207,14 @@ def weave_project(
168
207
  ``fmt`` (a :class:`~braidio.formats.Format`) supplies the format's declared
169
208
  defaults — its ``weave`` config, its ``structure`` and its dialogue
170
209
  ``cast`` — for whichever of ``config`` / ``structure`` / ``cast`` the
171
- caller left out; an explicit argument always wins. ``bed`` is the
172
- app-supplied music bed (:class:`~braidio.music.MusicBed`). With no format,
173
- no structure and no bed, this is the plain weave it always was
174
- (thorwhalen/braidio#39).
210
+ caller left out; an explicit argument always wins. Its config carries the
211
+ format's ``narration_delivery`` model and settings, as the fast path renders
212
+ them, until the project has narration renders: from then on a re-weave
213
+ keeps the model and settings it was synthesized with, so it never re-bills
214
+ by surprise, and ``config=`` is how to change them (:func:`resolve_config`,
215
+ braidio#120). ``bed`` is the app-supplied music bed
216
+ (:class:`~braidio.music.MusicBed`). With no format, no structure and no
217
+ bed, this is the plain weave it always was (thorwhalen/braidio#39).
175
218
 
176
219
  ``cast`` (a :class:`~braidio.conversation.ConversationCast`) is what the
177
220
  script's :class:`~braidio.script.Dialogue` beats are voiced with, resolved
@@ -218,7 +261,7 @@ def weave_project(
218
261
  """
219
262
  import nw
220
263
 
221
- config = format_config(fmt, config=config, voice_id=voice_id)
264
+ config = resolve_config(project, fmt, config=config, voice_id=voice_id)
222
265
  if fmt is not None:
223
266
  structure = structure if structure is not None else fmt.structure
224
267
  cast = cast if cast is not None else fmt.cast
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
6
6
 
7
7
  [project]
8
8
  name = "braidio"
9
- version = "0.0.83"
9
+ version = "0.0.85"
10
10
  description = "Weave narration with extracted media segments into audiovisual productions"
11
11
  readme = "README.md"
12
12
  requires-python = ">=3.10"
@@ -128,7 +128,11 @@ video = ["burns>=0.0.16", "pillow", "tituli>=0.0.4"]
128
128
  # published in 0.0.58). braidio declares `production-structure/v1`'s sting and bed
129
129
  # asset ids at import of `braidio.transforms`, so an older nw fails at IMPORT —
130
130
  # the floor is what stops that.
131
- nw-app = ["lacing", "nw>=0.0.65", "falaw[fal]"]
131
+ # nw>=0.0.108: tolerant verifying-trace readers (nw#184, braidio#136). An older
132
+ # reader drops a trace written by a newer nw (it carries `excluded_paths`) and
133
+ # reads the child stale, which can re-render and spend. Every extra pulling nw
134
+ # carries this floor.
135
+ nw-app = ["lacing", "nw>=0.0.108", "falaw[fal]"]
132
136
  # The MCP server (`braidio.mcp`): a Claude.ai connector's tool surface + usage
133
137
  # metering. `fastmcp` + `py2mcp` build and serve it; the nw-app powers the project
134
138
  # and weave tools. The usage-ledger store is dependency-injected by the connector
@@ -137,9 +141,9 @@ nw-app = ["lacing", "nw>=0.0.65", "falaw[fal]"]
137
141
  # dol>=0.3.57: the asset tools use dol.content (ContentRef + content-addressed
138
142
  # store), added in that release — pin the floor so installs don't resolve an
139
143
  # older dol without it.
140
- # nw>=0.0.58: see the nw-app note above (the `secrets=` seam, braidio#58; the
141
- # asset-ref declarations `braidio.transforms` makes on import, nw#55).
142
- mcp = ["fastmcp", "py2mcp>=0.1.9", "pypdf", "dol>=0.3.57", "lacing", "nw>=0.0.65", "falaw[fal]", "yb[download]>=0.1.24", "graze>=0.1.45", "markdown-it-py", "mdit-py-plugins"]
144
+ # nw>=0.0.108: see the nw-app notes above (the `secrets=` seam, braidio#58; the
145
+ # asset-ref declarations, nw#55; tolerant trace readers, nw#184).
146
+ mcp = ["fastmcp", "py2mcp>=0.1.9", "pypdf", "dol>=0.3.57", "lacing", "nw>=0.0.108", "falaw[fal]", "yb[download]>=0.1.24", "graze>=0.1.45", "markdown-it-py", "mdit-py-plugins"]
143
147
  # The importer (`braidio.importing`): a finished commentary production ->
144
148
  # a real project graph. Needs the nw-app layer (it writes annotations) plus
145
149
  # `illustration` for licence normalization.
@@ -156,7 +160,7 @@ mcp = ["fastmcp", "py2mcp>=0.1.9", "pypdf", "dol>=0.3.57", "lacing", "nw>=0.0.65
156
160
  # changelog — the same wads caveat noted for nw and burns above (the version
157
161
  # bump lands in a commit AFTER the feature, so the git log reads one release
158
162
  # early).
159
- importing = ["illustration>=0.0.11", "lacing", "nw>=0.0.65", "falaw"]
163
+ importing = ["illustration>=0.0.11", "lacing", "nw>=0.0.108", "falaw"]
160
164
 
161
165
  # Packaging. The two shipped skills live at braidio/data/skills/<name>/ with
162
166
  # relative symlinks from .claude/skills/. hatchling walks the tree with
@@ -634,13 +634,99 @@ def test_weave_project_applies_a_format_and_its_declared_structure(
634
634
  }
635
635
  assert structure.body["sting_asset_id"] is None # no asset supplied
636
636
  (cfg,) = nw.annotations_at_tier(project.root, "weave-configs")
637
- # the format's narration voice rides in the config now (braidio#115)
637
+ # the format's narration voice rides in the config (braidio#115), and so do
638
+ # its delivery's model and settings, which is what the fast path speaks with
639
+ # (braidio#120: the graph used to record the weave's v2 default instead)
640
+ delivery = braidio.SOLO_EXPLAINER.narration_delivery
638
641
  expected = braidio.SOLO_EXPLAINER.weave.with_(
639
- narration_voice=braidio.SOLO_EXPLAINER.narration_voice
642
+ narration_voice=braidio.SOLO_EXPLAINER.narration_voice,
643
+ model_id=delivery.model_id,
644
+ voice_settings=dict(delivery.voice_settings),
640
645
  )
641
646
  assert cfg.body["config"] == expected.to_dict()
642
647
 
643
648
 
649
+ def test_a_format_narrates_with_its_delivery_on_the_graph(
650
+ project, script_and_source, patched_synthesis, monkeypatch
651
+ ):
652
+ """Fast/graph parity (braidio#120): the model a format's narrator speaks
653
+ with is its ``narration_delivery``'s on both paths."""
654
+ seen = []
655
+ real = braidio.narrate
656
+
657
+ def _narrate(text, out, **kw):
658
+ seen.append(kw["model_id"])
659
+ return real(text, out, **kw)
660
+
661
+ monkeypatch.setattr(braidio, "narrate", _narrate)
662
+ script, source = script_and_source
663
+ braidio.weave_project(project, script, source=source, fmt=braidio.DEEP_DIVE)
664
+ assert seen and set(seen) == {braidio.DEEP_DIVE.narration_delivery.model_id}
665
+
666
+
667
+ def _counting_narrate(monkeypatch):
668
+ """Count synthesis calls over the patched stub (the re-bill measure)."""
669
+ calls = []
670
+ real = braidio.narrate
671
+
672
+ def _narrate(text, out, **kw):
673
+ calls.append(kw["model_id"])
674
+ return real(text, out, **kw)
675
+
676
+ monkeypatch.setattr(braidio, "narrate", _narrate)
677
+ return calls
678
+
679
+
680
+ def test_an_existing_project_keeps_the_model_it_recorded(
681
+ project, script_and_source, patched_synthesis, monkeypatch
682
+ ):
683
+ """No surprise re-bill (braidio#135): a project woven before the delivery
684
+ rule keeps its model and settings when re-woven under a format."""
685
+ import nw
686
+
687
+ calls = _counting_narrate(monkeypatch)
688
+ script, source = script_and_source
689
+ legacy = braidio.SOLO_EXPLAINER.weave.with_(
690
+ narration_voice=braidio.SOLO_EXPLAINER.narration_voice
691
+ ) # what the graph recorded before #120
692
+ braidio.weave_project(project, script, source=source, config=legacy)
693
+ synthesized = len(calls)
694
+
695
+ braidio.weave_project(project, script, source=source, fmt=braidio.SOLO_EXPLAINER)
696
+ (cfg,) = nw.annotations_at_tier(project.root, "weave-configs")
697
+ assert cfg.body["config"] == legacy.to_dict()
698
+ assert len(calls) == synthesized # nothing re-synthesized
699
+
700
+
701
+ def test_dropping_and_restoring_the_format_never_re_bills(
702
+ project, script_and_source, patched_synthesis, monkeypatch
703
+ ):
704
+ """Woven under a format, re-woven without it, then with it again: the
705
+ voice it was synthesized with is kept throughout (#138 review)."""
706
+ calls = _counting_narrate(monkeypatch)
707
+ script, source = script_and_source
708
+ braidio.weave_project(project, script, source=source, fmt=braidio.DEEP_DIVE)
709
+ first = list(calls)
710
+ assert set(first) == {braidio.DEEP_DIVE.narration_delivery.model_id}
711
+ braidio.weave_project(project, script, source=source)
712
+ braidio.weave_project(project, script, source=source, fmt=braidio.DEEP_DIVE)
713
+ assert calls == first
714
+
715
+
716
+ def test_a_script_saved_before_its_first_weave_still_gets_the_delivery(
717
+ project, script_and_source, patched_synthesis, monkeypatch
718
+ ):
719
+ """reelee's flow: ingest with the format's bare weave, then weave with the
720
+ format. Nothing was rendered yet, so nothing is kept: the delivery applies."""
721
+ calls = _counting_narrate(monkeypatch)
722
+ script, source = script_and_source
723
+ braidio.transforms.ingest_script(
724
+ project, script, config=braidio.DEEP_DIVE.weave, source=source
725
+ )
726
+ braidio.weave_project(project, script, source=source, fmt=braidio.DEEP_DIVE)
727
+ assert calls and set(calls) == {braidio.DEEP_DIVE.narration_delivery.model_id}
728
+
729
+
644
730
  # --- re-ingest: identity, freshness, retry (braidio#49, braidio#51) ------------
645
731
 
646
732
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes