Skip to content

feat(server): drama3-voice writes attested Drama voice files - #1153

Closed
plotarmordev wants to merge 5 commits into
ashhart:mainfrom
plotarmordev:feat/voice-file-tool
Closed

plotarmordev wants to merge 5 commits into
ashhart:mainfrom
plotarmordev:feat/voice-file-tool

Conversation

@plotarmordev

Copy link
Copy Markdown
Contributor

What this changes

Stacked on #1135, the attested HTTP voices PR (head 73249c5a); please review that one first. This PR adds only 73249c5a..cdeed84f: drama3-voice, a CLI that turns reference WAVs and their transcripts into a drama3-http-voice/1 catalog file. It gets the codes by running drama3-generate --encode once per reference.

Attestation is mandatory. Without --source-kind synthetic|self|consented and a non-blank --source-note, the tool refuses with exit 2 before encoding or touching the filesystem. It also refuses up front transcripts the speech request would reject and output names the catalog cannot load. The finished file must pass the catalog's own parser before it is published. As in the catalog, the attestation records the operator's claim. It is not proof of consent and does not grant it. The docs quote section IV(b)(i) of the model licence, which forbids imitating an identifiable person's voice without their prior consent or another legal right.

Threat model, as docs/drama-http-voices.md gives it:

  • Trusted: the operator's encoder binary and processes with the same UID.
  • Covered: other users (including shared sticky directories), stale files or symlinks, encoder failures and concurrent tool runs.
  • Not covered: a malicious encoder, or same-UID processes renaming the operator's directories during a run. The output's parent directory must not let other users rename the operator's entries; a shared sticky directory is suitable.

How the tool stays inside that boundary:

  • Each run creates a randomly named, owner-only private directory beside the output, exclusively and retrying on collision.
  • Code files are read relative to that directory and refuse symlinks.
  • The final file is staged there and renamed over NAME.json, which replaces a destination symlink rather than following it. No existing file is touched before publication.
  • Cleanup restores owner access and removes the private directory, including after an allocation failure. A cleanup failure before publication is reported with the primary error. After publication it is a warning naming the leftover directory, and the command still succeeds.

Receipt

  • Environment, with the TensorFold commit, MLX or PyTorch version, machine and GPU, checkpoint and revision: cdeed84f0ed4d10ad493d0b6bad5a2095916f043 on 73249c5acbc412bfee22d94309cf46b659b6409b (feat(server): serve attested Drama voice catalogs #1135, itself on d1018b318fb51981c4a18f12e40269a4d3ee9713). aarch64 Linux CPU host with Zig 0.17.0. No checkpoint, codec, MLX, PyTorch or GPU was used.
  • Exactness, from tools/bench_concurrent.py --alone --serial or token_sha against "draft": false: n/a. The tool runs no inference, and serving is unchanged from the base. Host tests use a fake /bin/sh encoder on a generated tone. They check that its codes reach the written file unchanged and that the catalog loader reads the file back.
  • Decode speed before and after, from tools/bench_openai.py: n/a; decoding is unchanged.
  • Prompt speed before and after: the cold first request's ttft_s from tools/bench_cache.py --require-cold on a long prompt, or "n/a" with the reason when the change cannot reach prompt processing: n/a. The tool runs offline, and the server's prompt path is unchanged.
  • Tests run, with pass, fail and skip counts: all at cdeed84f, with no cached test results and no reruns.
    • zig fmt --check build.zig zig: clean.
    • zig build test -j8 --summary all: 211/211 steps; 2969/2983 tests passed, 0 failed, 14 skipped. The server suite passed 516/516, including the five new voice tool: tests.
    • CUDA_VISIBLE_DEVICES= zig build test-cuda-host -j8 --summary all: 129/129 steps; 2188/2193 tests passed, 0 failed, 5 skipped.
    • CUDA_VISIBLE_DEVICES= zig build test-kernel-contract -j8 --summary all: 11/11 steps; 65/65 tests passed.
    • CUDA_VISIBLE_DEVICES= zig build test-golden -j8 --summary all: 5/5 steps. Server cases: 306/319 equal with 13 known differences. Security cases: 26/26 equal. 0 unexpected differences.
    • zig build drama3-voice links an aarch64 executable. Run without --source-kind, or with a blank --source-note, it exits 2 with the attestation refusal and creates nothing.
  • Not run, and why: encoding with the real codec, and serving a file this tool wrote; this host run was CPU-only. Metal, macOS and Windows builds were not run either. The new tests skip on Windows, and three of them also skip on anything other than Linux.

Checklist

  • Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off.
  • Drafted output equals "draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.
  • No precision traded for speed. If the bits change, the description says which sums change and why.
  • A new or changed GPU kernel is registered with the kernel contract (docs/kernel-contract.md); each backend's SUMMARY line is in the receipt.
  • Prompt processing is no slower than the last release.
  • The description says which platforms I ran, Metal M1 to M5 and CUDA, and which I could not.
  • New tests fail before the change, pass after it, and skip cleanly without their dependency.
  • Comments and docstrings are one line. No measurements or history in the source.
  • No personal data, machine names, internal hosts or local paths. No AI attribution lines.

drama3-voice encodes one to four reference WAVs with drama3-generate --encode and writes a drama3-http-voice/1 file whose source attestation is mandatory, validated by the voice catalog's own parser before and after encoding. Intermediate files live in a private directory and the output is published atomically.
ashhart added a commit that referenced this pull request Oct 24, 2026
The contributor's changelog entries landed above main's own release
notes, since 1.1.3 is released (CHANGELOG.md:7 and :8). They take the
release page's numbering and its thanks, as every other entry on that
page does (CHANGELOG.md:11). The voice catalogs and the writer are the
contributors' own: the flags are parsed before any load
(zig/src/server/cli.zig:305 and :309), the catalog is parsed and loaded
beside the family's reference prompt builder
(zig/src/server/drama_voice.zig:25 and :59), a voice is selected from
the list and the default (zig/src/server/drama_voice.zig:80), the
server answers `GET /v1/voices` from the same list
(zig/src/server/routes.zig:75 and :77), and the writer refuses a file
without its attestation (zig/src/server/drama_voice_tool.zig:18 and :25).
@ashhart

ashhart commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Landed on main as dcf5f35 on top of #1135's records, with a maintainer child (ca678a7) that moves the release notes into main's Unreleased section, thank you @plotarmordev. drama3-voice writes attested Drama voice files, and the host suites pass on current main.

- Synthema, Ash's AI Assistant.

@ashhart ashhart closed this Oct 24, 2026
@ashhart

ashhart commented Oct 24, 2026

Copy link
Copy Markdown
Owner

This shipped in TensorFold 1.1.4: https://github.com/ashhart/TensorFold/releases/tag/v1.1.4

Thank you @plotarmordev for the contribution.

- Synthema, Ash's AI Assistant.

@ashhart ashhart added the landed Landed on main by the maintainers; the commits keep the contributor's authorship label Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

landed Landed on main by the maintainers; the commits keep the contributor's authorship

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants