Skip to content

project publication

Aisjam edited this page Nov 15, 2026 · 1 revision

Explicit publication and portable projects

Home · Section index

Working manual · 0.0.1-alpha · source snapshot 16 November 2026

This increment adds working application/core services and regression tests. The normal Broadcast UI does not call them yet. The subsequent CTP/CTL v43 increment (repository reference: file-formats/project-v43.md) adds portable references and recoverable publication copies. Ordinary Save, playback and browsing remain unsigned.

Canonical creative content v1

core/provenance/CreativeContent uses BLAKE2b-256 with separate domain strings for decoded samples and projects. Work IDs remain random, independent of this hash. No filesystem operations occur inside this core API: the caller supplies a verified sample resolver. application/ProjectPublication implements that resolver with AssetBrowserService, loadWaveSample and unpackSample.

A sample payload is BinaryWriter string Contour.Creative.Sample.v1, uint32 sample rate, uint8 channels, uint32 frames and interleaved IEEE float32 PCM in little-endian order. Negative zero becomes positive zero. Nonfinite PCM is rejected. Source bit depth, float/integer file encoding, WAV chunk ordering, filename and container metadata do not participate. Matching decoded samples therefore match even when stored as external WAV or packed project data. This is sample identity, not a perceptual/acoustic similarity hash.

A project payload is BinaryWriter string Contour.Creative.Project.v1, a blob containing a normalized CTP v42 encoding, then a dependency blob. Each domain string uses the existing uint16 byte length; blobs use uint32 byte lengths. The creative encoder explicitly retains the CTP v42 byte layout with a compile-time guard; normal project files now use v43. A future CTP encoder change must retain this creative encoding or introduce a new creative schema and migration; it must not silently change existing published digests. The empty-project known-answer vector also detects changes to v42 defaults.

Included musical data comprises Song assignments, Chain/Phrase/Table pools and stable IDs, note/instrument/velocity/FX values, timings and all grooves, scales and playback quantisation, tracker lane configuration, random seed, performance positions/mutes/solo, effects, master settings, instrument parameters and modulation, sample playback properties, synth presets and voice allocation/output settings. Unused allocated musical objects remain creative content in schema 1; this is not a deduplication of semantically equivalent arrangements.

Normalization excludes:

  • Project title/author, track names and colours, Song colours and legacy timer.
  • Scale names and entry/transpose/highlight editor options (playback options stay).
  • Instrument name/tag/favourite, sample display names and synth module name/visual.
  • Drum bank/slot display labels and licence/attribution text. Their original document values are retained unchanged; policy/evidence must be checked by the future derivative/distribution workflow, outside the creative digest.
  • Resource registry order, unused resource paths and all physical/logical paths.
  • Any external event history, local storage path or UI cursor, none of which is part of the normalized ProjectData.

Instrument slots are replaced with one placeholder resource index; packed PCM is removed only from the detached normalized copy. The dependency blob records uint8 instrument ID, uint8 slot, 32-byte decoded sample digest, then a bool for whether external degradation runs. The baked property is normalized away only after that effective playback distinction is captured. Existing sample-property records retain frames, loops, slices, gain, pan and tuning. No metadata record is invented from WAV defaults: current playback uses explicit project properties.

Synth sample/wave paths and Drum Seven slot paths become Content/<digest>. Drum Nine's four implicit PCM files are also required: each adds uint16 preset ID and a 32-byte sample digest in the existing fixed fileNames order. Missing assets fail hashing; peer advertisements are never accepted as verification.

The source project is never mutated. External paths are cached for one operation; packed samples override missing external paths. Individual decoded samples are limited to 32 MiB, all newly resolved inputs to 64 MiB and 4096 resolutions, and canonical output to 64 MiB. Processing is synchronous worker/editor preparation, never audio-callback work. Cancellation/background UI orchestration remains to be added when the services are wired into the UI.

Scoped signing and publication

PublicationIdentity::unlock reuses IdentityManager's encrypted vault reader and requires current community-guidelines acceptance. The identity manager grants friend access only to this capability class. It exposes signing of validated creative events and contributor attestations, not raw bytes or private keys. The existing NetworkIdentity TLS-only signing capability is unchanged. Secret storage is wiped through the existing Secret destructor.

PublicationManager::publish accepts a document, a stable Work ID, proposed contributors and optionally the preceding publication Event ID. The caller must allocate and retain the Work ID before invoking publication, including across retries. An empty Work ID is rejected. The v43 publication-copy service now persists Work IDs before calling this API. Direct low-level callers must likewise retain their IDs across retries.

First publication computes the canonical hash, signs a shareable Publication and the publisher's separate confirmation, then commits the existing EventStore snapshot. Other proposed contributors remain pending. Re-sharing unchanged content and attribution returns the existing event, with no ledger rewrite. A changed timestamp alone never creates another genesis.

Changed content/attribution requires an explicit previous event, produces a Revision of the same work and preserves prior credited identities/roles. A retry with the original parent returns an already committed matching revision, even when the original result was lost. Separate Work IDs can publish identical content. This service does not grant revision authority merely because someone appears in a contributor list: the previous and original publishing identity must match. Publishing another creator's derivative needs the future explicit policy workflow. No derivative-policy enforcement or collaborative multi-publisher authority is claimed by this increment.

The application adapter publishProjectFile loads a detached CTP and uses <content root>/System/Provenance/events.bin. It does not modify the source CTP, ProjectManager, live audio or any manifest. Publication evidence exists after success regardless of whether any future transfer succeeds. A completed delivery is never inferred from a publication.

Writers reserve <ledger>.publication.lock using atomic directory creation, reload the ledger under that lock, validate/sign and atomically save with SaveManager. A busy/stale lock or corrupt ledger fails without replacing evidence or the caller's output. Only the lock owned by the call is removed. Crash-created stale locks require manual recovery after verifying there is no active writer. There is no transaction spanning a future CTP header write and this ledger yet. All writers to this local publication ledger must use the same locking contract; EventStore itself remains a single-owner data service.

PublicationReference returns schema 1, Work ID, ContentHash, original publishing identity, genesis Event ID and current Event ID. The original API returns this value in memory; v43 now also stores it in CTP/CTL. CTID, Broadcast and EventStore wire schemas remain unchanged.

What should be here

Documentation still to add
Annotated current-build screenshots and a recorded controller walkthrough for this topic.

Evidence and verification

Repository sources used for this page:

  • docs/provenance-publication.md

This is a documentation/source review, not a new runtime or hardware test. Physical response, screenshots and listening examples still need verification on a recorded build.

Clone this wiki locally