diff --git a/docs/audio-doctrine.md b/docs/audio-doctrine.md index cb3ee5a..9db502c 100644 --- a/docs/audio-doctrine.md +++ b/docs/audio-doctrine.md @@ -57,6 +57,27 @@ notch are native AquaSynth filter authorities. Formants remain vowel/body color, and PAD spectrum/profile fields remain source-table construction; do not use those surfaces as substitutes for ordinary subtractive filters. +## Scene Voices + +Reference audio is a scene, not a naked oscillator. A patch may contain several +voices whose jobs differ: + +- primary articulatory or instrumental voice; +- coupled tract/source noise; +- release, impact, or transient voice; +- background room tone, bed noise, hum, or environmental texture; +- recording-condition voice or processing that approximates microphone, room, + codec, or capture coloration. + +Those voices can use the whole AquaSynth vocabulary: ordinary `voice` layers, +noise, FM, AM/tremolo, envelopes, filters, formants, additive/spectral sources, +macros, and modulation. The contract is honesty, not austerity. Helper voices +are allowed to improve full parity, but they do not own articulation or +instrument-body evidence unless the relevant lower-layer witnesses move too. +When a scene voice exists mainly to match background noise or capture color, the +report must name that role and score it as context, not as proof that the +primary body learned to speak. + ## Faust Boundary Faust describes pure DSP: inputs to outputs. Architecture files and host code diff --git a/docs/ipa-vocal-tract-roadmap.md b/docs/ipa-vocal-tract-roadmap.md index a0d6636..f199cb7 100644 --- a/docs/ipa-vocal-tract-roadmap.md +++ b/docs/ipa-vocal-tract-roadmap.md @@ -740,6 +740,37 @@ specific, comparable, falsifiable, and reusable by the next round. A pretty report with vague receipts is a failed science artifact even if it obeys the file-count contract. +When the loop is run with source edits enabled, hypothesis agents may golf DSL +syntax, parser/model records, Faust lowering, worker evidence surfaces, and +tests. That is not permission to smear metrics. A source edit must name the +owner it moves, the invariant it protects, files changed, expected metric +movement, verification command, and rollback trigger in `source-change-plan.md`. +The outer loop runs a focused build before scoring so malformed syntax or +broken lowering fails before it pollutes the trial store. + +### Scene Voice Model + +IPA parity candidates are now scenes, not isolated waveforms. Every hypothesis +family must describe the voices in the scene and how each voice is synthesized: + +- `primary-articulatory`: the vocal tract or vocal primitive that owns speech + articulation evidence; +- `tract-noise`: sustained frication, aspiration, turbulence, or hiss coupled + to anatomical controls; +- `release/transient`: closure release, burst, click, or pressure spill; +- `background-room`: room tone, bed noise, hum, or environmental coloration; +- `recording-condition`: microphone/codec/room coloration, gain motion, and + other reference-capture artifacts. + +General AquaSynth primitives are fair game for helper voices: ordinary `voice` +layers, noise, FM, AM/tremolo, envelopes, filters, formants, additive/spectral +layers, macros, and modulation. Those voices are part of full parity, but they +do not count as articulation evidence unless gesture, primitive timeline, and +clean vocal metrics also move. The scientific question is not "can a noise bed +hide the failure?" It is "which voices are in the scene, which owner synthesizes +each one, and which witness proves that the helper voice is not impersonating +speech?" + Five prompt-optimization smokes on 2026-05-29 sharpened that contract. The best agent output came from a fixed receipt packet and a constrained reasoning pass, not from letting an external agent wander the store while thinking. Production diff --git a/state/evidence.jsonl b/state/evidence.jsonl index 2569adc..f43596c 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -244,3 +244,4 @@ {"date":"2026-05-30","area":"ipa-trial-vector-retrieval","lesson":"The IPA trial semantic retrieval organ now uses the local full-ass stack: CultCache `.cc` records remain truth, while `IpaTrialWorker index/search` derives Qdrant points with stable SHA-256 UUIDs and Ollama `qwen3-embedding:0.6b` vectors. Search reports include vector scores, metric facts, evidence tags, contrast candidates, artifact snippets, and show commands, with lexical fallback only when the vector stack is unavailable.","evidence":"tools/IpaTrialWorker/Program.cs; artifacts/parity/ipa-trial-worker-smoke/20260529T2204/qdrant-index-smoke.md; artifacts/parity/ipa-trial-worker-smoke/20260529T2204/qdrant-search-stops.md"} {"date":"2026-05-30","area":"ipa-trial-retrieval-tuning","lesson":"Semantic retrieval smokes showed raw vector similarity was useful but too permissive: class queries could leak through generic weak-articulation language, and mixed-set records could impersonate every class because their target set contains all phonemes. `IpaTrialWorker search` now adds phonetic class-affinity scoring, candidate-specific class ownership for mixed lanes, demotes mixed/generalization to a secondary transfer hint when a real class is present, and only tags dressing when the record itself mentions dressing/FM/AM/envelope/helper evidence.","evidence":"artifacts/parity/ipa-trial-worker-smoke/20260529T2204/retrieval-tuning-20260530-pass1; artifacts/parity/ipa-trial-worker-smoke/20260529T2204/retrieval-tuning-20260530-pass4; tools/IpaTrialWorker/Program.cs"} {"date":"2026-05-31","area":"ipa-trial-primitive-timeline-facts","lesson":"IPA trial evidence must carry primitive phase witnesses inside the CultCache record, not only as CSV artifacts or prose claims. `PrimitiveTimelineFactExtractor` turns `ProbeTimelineReport` samples into contact release, source flow, branch admittance, radiation output, path energy, and passivity facts; `IpaTrialWorker` indexes and reports those facts through search/show/dump so hypothesis agents can cite release/radiation/passivity evidence directly.","evidence":"src/AquaSynth.Core/PrimitiveTimelineFactExtractor.cs; src/AquaSynth.Core/IpaTrialResults.cs; tools/IpaTrialWorker/Program.cs; tests/AquaSynth.Dsl.Tests/IpaTrialOrchestratorTests.cs; artifacts/parity/ipa-timeline-fact-smoke/20260531T233217641"} +{"date":"2026-05-31","area":"ipa-trial-source-golf-scene-voices","lesson":"IPA hypothesis agents need authority to golf the DSL/Faust machine when repeated evidence points at a missing owner, and every parity patch should model the reference as a scene with named voices. Source-edit-enabled rounds may now change parser/model/lowering/Faust/tests/docs with a source-change plan and pre-score build; candidate reports must separate primary articulation, tract noise, release/transient, background-room, and recording-condition voices. General synth primitives are allowed for scene/background modeling, but helper voices cannot impersonate articulation without lower-layer evidence.","evidence":"tools/run-ipa-trial-loop.ps1; docs/ipa-vocal-tract-roadmap.md; docs/audio-doctrine.md"} diff --git a/state/memory.json b/state/memory.json index ab867a6..46b7271 100644 --- a/state/memory.json +++ b/state/memory.json @@ -92,7 +92,7 @@ "Surge XT for modern hybrid synth modulation", "Cardinal/VCV-style patches for modular cable/rate semantics" ], - "rule": "For speech, add schema fields and learned-control lanes only when the parity harness has a loss surface that can exercise them. For reference synths, add DSL abstractions only when rebuilds prove the missing invariant. Parsing alone is inventory, not evidence of expressivity. Pink Trombone should be decomposed into reusable low-level Aqua primitives before audio golf, not copied as a bespoke clone or inflated into PT-shaped modules. After the 2026-05-29 proprioception correction, collapse graph-vocal lowering into a small set of instrumented physical primitives before more utterance golf. Gesture motion belongs in ControlSurface/ControlSpline timeline ownership, not primitive-local smoothing; cut any generated contact/port spline that invents motion not supported by primitive reference timelines. Public clients author gestures through ControlSurfaceCatalog plus ControlSplineTimeline and stream surface control dictionaries; higher-level gesture templates and phoneme_gesture are only spline emitters. IPA descriptors seed which anatomical surfaces move, while local datasets golf numeric spline defaults and patch voice code. Training reports must separate gesture_score, clean_vocal_score, and full_parity_score so full-patch recording-condition helpers cannot impersonate articulation. Frozen IPA gesture rounds own candidate scripts, primitive timelines, gesture metrics, manifests, evidence receipts, metric summaries, candidate clusters, and science briefs; `IpaTrialResult` CultCache records own rendered trial outcomes plus extracted primitive timeline facts for contact release, source flow, branch admittance, radiation output, path energy, and passivity. External Codex IPA exploration must query the `.cc` store through the worker's semantic `search`/`show` organ, backed by Qdrant/Ollama vector retrieval when available; Qdrant is a derived index over CultCache and local artifacts, not a second truth. Search reports expose class focus/match and use phonetic class-affinity plus timeline-fact text so agents do not treat generic weak-articulation language as cross-class evidence. Crude full-store dumps are audit fallback, not agent memory. Statistical science workers and audio parity stages consume those bundles without rewriting gesture evidence. If gesture scores rise but rendered audio is silent, fix the primitive source/tract owner before adding full-patch dressing." + "rule": "For speech, add schema fields and learned-control lanes only when the parity harness has a loss surface that can exercise them. For reference synths, add DSL abstractions only when rebuilds prove the missing invariant. Parsing alone is inventory, not evidence of expressivity. Pink Trombone should be decomposed into reusable low-level Aqua primitives before audio golf, not copied as a bespoke clone or inflated into PT-shaped modules. After the 2026-05-29 proprioception correction, collapse graph-vocal lowering into a small set of instrumented physical primitives before more utterance golf. Gesture motion belongs in ControlSurface/ControlSpline timeline ownership, not primitive-local smoothing; cut any generated contact/port spline that invents motion not supported by primitive reference timelines. Public clients author gestures through ControlSurfaceCatalog plus ControlSplineTimeline and stream surface control dictionaries; higher-level gesture templates and phoneme_gesture are only spline emitters. IPA descriptors seed which anatomical surfaces move, while local datasets golf numeric spline defaults and patch voice code. Training reports must separate gesture_score, clean_vocal_score, and full_parity_score so full-patch recording-condition helpers cannot impersonate articulation. Frozen IPA gesture rounds own candidate scripts, primitive timelines, gesture metrics, manifests, evidence receipts, metric summaries, candidate clusters, and science briefs; `IpaTrialResult` CultCache records own rendered trial outcomes plus extracted primitive timeline facts for contact release, source flow, branch admittance, radiation output, path energy, and passivity. External Codex IPA exploration must query the `.cc` store through the worker's semantic `search`/`show` organ, backed by Qdrant/Ollama vector retrieval when available; Qdrant is a derived index over CultCache and local artifacts, not a second truth. Search reports expose class focus/match and use phonetic class-affinity plus timeline-fact text so agents do not treat generic weak-articulation language as cross-class evidence. Source-edit-enabled IPA rounds may golf DSL syntax, parser/model records, Faust lowering, worker evidence surfaces, and tests when repeated evidence identifies a missing owner; every source edit needs an owner map, invariant, expected metric movement, verification, and rollback trigger. IPA parity candidates should model scene voices explicitly: primary articulation, tract noise, release/transient, background-room, and recording-condition. General synth primitives are allowed for helper scene voices, but they cannot count as articulation without gesture, primitive timeline, and clean-vocal movement. Crude full-store dumps are audit fallback, not agent memory. Statistical science workers and audio parity stages consume those bundles without rewriting gesture evidence. If gesture scores rise but rendered audio is silent, fix the primitive source/tract owner before adding full-patch dressing." }, "ipa_vocal_tract_path": { "status": "This is now the active project center. Roadmap and research notes align the curriculum around structured utterance metadata -> learned utterance embedding -> learned synth automation -> vocal tract/envelope/LFO/filter/spectral controls -> rendered audio loss. The first Core contracts still defend the boundary: PhoneticIntent is the Weksa/language-owned handoff, ArticulatoryPlan is the AquaSynth realization layer, VocalTractMorphology declares anatomy capabilities, ArticulatoryConstraintReport is the host-visible veto surface, and VocalTractPlanResult is the tiny end-to-end proof artifact for host branching. IPA is an authoring input only: tokenization and feature mapping lower into language phonology profiles, timed articulatory gestures, morphology-specific tract/excitation curves, and Faust DSP. The staged support plan starts with tokenization and vowels, then core pulmonic consonants, expanded human IPA, airstream/phonation, and Weksa/alien morphologies. Optional eSpeak NG tests provide the first generated speech workout when ESPEAK_NG or espeak-ng is installed; eSpeak is intelligibility/timing/log-mel pressure, not anatomy truth. AquaSynth owns the learned utterance embedding encoder and synth driver: speech text embeddings plus prosody/emphasis hints plus Ghostlight/Epiphany-shaped character state vectors compress into utterance embeddings, and phonetic features plus that embedding feed a packed-buffer native C# backprop/Adam mapper that predicts tract, AM/FM, LFO, filter, and mel spectral-envelope controls. SpeechBackpropagationPipeline chains the two models: synth-driver target loss returns gradients with respect to its input, slices the utterance-embedding gradient, and updates the utterance encoder from downstream speech loss. The generated ground-truth training fixture renders eSpeak syllables, extracts log-mel evidence, and trains that chained pipeline toward eSpeak-seeded mel/control targets. CultMesh speech training now has payload manifests, peer/lease admission receipts, worker assignment, result collection, and central checkpoint application; workers do not own model updates. Real remote artifact chunk transfer and process supervision remain CultMesh infrastructure surfaces, not AquaSynth workaround territory. IpaGestureExperiment writes frozen descriptor/variant rounds with candidate scripts, primitive timelines, gesture metrics, manifests, and evidence JSONL, then analyzes them into metric summaries, score-band clusters, and a science brief. IpaTrialOrchestrator now writes local five-seed IPA render trials, accepts externally authored candidate scripts through RunCandidateScriptsAsync, writes WAV/report artifacts, evaluator reports, extracted primitive timeline facts, and `ipa-trial-results.cc` CultCache records. `tools/IpaTrialWorker` is the public worker tool for seed/score/search/show/index over the store; search now auto-upserts Qdrant/Ollama evidence chunks including timeline-fact text and returns vector-backed reports, while `tools/run-ipa-trial-loop.ps1` dispatches external Codex hypothesis/evaluator workers around five five-phoneme target sets. The latest seed run improved voiced vowels/nasals after primitive `SourcePort` lowering gained an oscillatory carrier; plosive closure/release remains the next weak owner.", @@ -121,9 +121,9 @@ "binding_rule": "Parameter binding uses field-site references such as `lpf=@/macro/brightness` and `/opgraphs/0/operators/2/level`; the field owns meaning and the parameter owns the runtime value. Avoid target-routing semantics unless a new graph authority is deliberately mapped." }, "last_verified": { - "command": "dotnet build tests\\AquaSynth.Dsl.Tests\\AquaSynth.Dsl.Tests.csproj --no-restore --disable-build-servers -p:UseSharedCompilation=false -p:BuildInParallel=false -v minimal; dotnet build tools\\IpaTrialWorker\\IpaTrialWorker.csproj --no-restore --disable-build-servers -p:UseSharedCompilation=false -p:BuildInParallel=false -v minimal; dotnet test tests\\AquaSynth.Dsl.Tests\\AquaSynth.Dsl.Tests.csproj --no-build --filter \"FullyQualifiedName~IpaTrialOrchestratorTests\" -v minimal; IpaTrialWorker one-candidate timeline fact score/show/search smoke", - "result": "IPA trial records now embed extracted primitive timeline facts. The worker indexes, searches, shows, dumps, and summarizes contact release, radiation output, and path passivity witnesses from the .cc record itself. Focused build/test pass, old-store show compatibility passes, and fresh smoke under artifacts\\parity\\ipa-timeline-fact-smoke\\20260531T233217641 stores release/radiation/passivity facts and retrieves them through Qdrant/Ollama search.", - "commit": "pending ipa primitive timeline facts" + "command": "powershell -NoProfile -ExecutionPolicy Bypass -File tools\\run-ipa-trial-loop.ps1 -Rounds 0 -SkipLocalTrialRun; dotnet build tests\\AquaSynth.Dsl.Tests\\AquaSynth.Dsl.Tests.csproj --no-restore --disable-build-servers -p:UseSharedCompilation=false -p:BuildInParallel=false -v minimal", + "result": "IPA trial loop prompts now allow source-edit-enabled DSL/Faust/worker golf with a source-change plan and pre-score build, and require a scene voice model using general AquaSynth primitives for helper/background voices while preserving articulation evidence boundaries.", + "commit": "pending ipa source golf scene voices" } } diff --git a/state/scratch.md b/state/scratch.md index 7cd32cf..361fefe 100644 --- a/state/scratch.md +++ b/state/scratch.md @@ -2,6 +2,21 @@ Current slice: +- Expanded the IPA trial-loop agent contract so future rounds can golf DSL + syntax, lowering, and Faust machinery when the evidence says the owner is + wrong. `tools/run-ipa-trial-loop.ps1` now gives source-edit-enabled + hypothesis agents authority to edit `src/`, `tests/`, `docs/`, and `tools/` + for named DSL/lowering/Faust/worker evidence hypotheses, requires a + `source-change-plan.md` with owner map, invariant, expected movement, + verification, and rollback trigger, and runs a focused test-project build + before scoring if source edits were allowed. The prompt also requires a + `Scene Voice Model` for every family: primary articulatory voice, tract-noise + voice, release/transient voice, background-room voice, and + recording-condition voice, with ordinary AquaSynth voices/noise/FM/AM/ + envelopes/filters/formants/additive/spectral primitives available for helper + scene voices. Helper voices remain full-parity tools and cannot count as + articulation unless primitive/gesture/clean-vocal witnesses move too. + - Added primitive timeline facts to IPA trial results as first-class CultCache evidence. `IpaTrialResult` now stores extracted `PrimitiveTimelineFact[]` values from `ProbeTimelineReport`: contact opening/closed blocks/reservoir diff --git a/state/spine.yaml b/state/spine.yaml index ed9b1a7..604fa09 100644 --- a/state/spine.yaml +++ b/state/spine.yaml @@ -146,7 +146,7 @@ live_invariants: - IPA training scoring contract is documented. Reports must keep `gesture_score`, `clean_vocal_score`, and `full_parity_score` separate. Gesture score measures descriptor-to-surface coverage, motion direction, spline contour/timing, primitive timeline consequences, and optional external articulation landmarks. Full parity patches may use FM/AM/modulators/envelopes/filters, auxiliary animated voices, and recording-condition helpers, but those helpers cannot count as articulation evidence unless gesture and clean-vocal scores move coherently. - `IpaGestureExperiment.WriteRound` is the first frozen batch harness for IPA hypothesis work. It writes `manifest.yaml`, candidate `.aqua` scripts, primitive `ProbeTimelineReport` CSVs, gesture-layer `metrics.csv`, and per-candidate `evidence.jsonl` under a caller-provided artifact root. `IpaGestureExperiment.AnalyzeRound` writes `analysis/metric-summary.csv`, `analysis/candidate-clusters.csv`, and `analysis/science-brief.md` for the science-worker handoff. This harness owns frozen descriptor/spline/primitive evidence only; clean vocal identity, full spectrogram parity, optimizer checkpoints, and worker orchestration stay downstream. Focused verification: `PatchScriptTests` pass 93/93. - `IpaTrialOrchestrator.RunAsync` is the first local render/scoring worker for IPA trials. It generates candidate patches through `IpaGestureExperiment`, renders them through Faust, compares against local PT fixture references with `AudioAnalyzer`, writes WAV/report artifacts, and stores typed `IpaTrialResult` records in `ipa-trial-results.cc`. The five-seed trial run at `tests/AquaSynth.Dsl.Tests/bin/Debug/net10.0/artifacts/parity/ipa-trials/20260529T214127955/five-seed-trials` showed voiced vowels/nasals became audible only after primitive `SourcePort` lowering gained a true oscillatory voiced carrier; sibilants are pressure, plosives remain weak. Verification: opt-in IPA trial test passed, and focused `PatchScriptTests|IpaTrialResultsRoundTripThroughCultCache` pass 94/94. - - External IPA exploration now has a worker/tool boundary. `tools/IpaTrialWorker` owns `seed`, `score`, `search`, `show`, and audit-only `dump` commands over the typed `.cc` trial-result store; `score` renders external Codex-authored `.aqua` candidates through `IpaTrialOrchestrator.RunCandidateScriptsAsync`, while `search` is the semantic retrieval organ for hypothesis agents. `IpaTrialResult` records now embed extracted primitive timeline facts from `ProbeTimelineReport` for contact closure/reservoir/release, source load/flow, branch admittance/exchanged flow, radiation boundary/output, path area/delay/energy, and passivity; `search`, `show`, `dump`, and summary CSV output surface release/radiation/passivity witnesses directly from the `.cc` record. `search` follows VoidBot's Qdrant shape: `.cc` records plus timeline facts and referenced local artifacts become evidence chunks, local Ollama `qwen3-embedding:0.6b` produces 1024-dim vectors, Qdrant collection `aquasynth_ipa_trial_results` stores stable SHA-256 UUID points with trial/candidate payload metadata, and the report surfaces vector scores, excerpts, tags, metric facts, timeline facts, contrast candidates, `class_focus`, per-hit `class_match`, and `show` commands. Qdrant is a derived index; CultCache remains truth, and lexical/metric search is fallback when the vector stack is unavailable. Retrieval tuning added phonetic class-affinity scoring and candidate-specific mixed-lane ownership so `mix-p` can support stop seams without every mixed candidate matching stop evidence. `tools/run-ipa-trial-loop.ps1` orchestrates external `codex exec` hypothesis/evaluator workers around that store. The active trial shape is five target sets of five phoneme lanes each: vowels, nasals/approximants, fricatives, stops, and mixed generalization. Candidate names are exactly `____.aqua`, with lowercase kebab-case family ids. Three dry external Codex smoke passes refined hypothesizer/evaluator prompts into exact 25-lane output, retrieval receipts, claim audits, evidence-quality ledgers/verdicts, and fail-closed evaluator compliance. A later five-pass prompt optimization showed the best science comes from fixed receipt packets plus constrained reasoning; production prompts now require contrast pairs, `show` metric values, primitive timeline facts/excerpts or explicit `missing`, class-consistent reference matrices, `X owns Y so Z remains true` owner sentences, at least five micro-sweep perturbations before a seam is actionable, and a novelty gate rejecting loudness/dressing-only families as loss-landscape novelty. Verification: focused builds/tests pass, old-store show compatibility passes, and a fresh one-candidate smoke under `artifacts/parity/ipa-timeline-fact-smoke/20260531T233217641` proves release/radiation/passivity facts persist and retrieve through Qdrant/Ollama. + - External IPA exploration now has a worker/tool boundary. `tools/IpaTrialWorker` owns `seed`, `score`, `search`, `show`, and audit-only `dump` commands over the typed `.cc` trial-result store; `score` renders external Codex-authored `.aqua` candidates through `IpaTrialOrchestrator.RunCandidateScriptsAsync`, while `search` is the semantic retrieval organ for hypothesis agents. `IpaTrialResult` records now embed extracted primitive timeline facts from `ProbeTimelineReport` for contact closure/reservoir/release, source load/flow, branch admittance/exchanged flow, radiation boundary/output, path area/delay/energy, and passivity; `search`, `show`, `dump`, and summary CSV output surface release/radiation/passivity witnesses directly from the `.cc` record. `search` follows VoidBot's Qdrant shape: `.cc` records plus timeline facts and referenced local artifacts become evidence chunks, local Ollama `qwen3-embedding:0.6b` produces 1024-dim vectors, Qdrant collection `aquasynth_ipa_trial_results` stores stable SHA-256 UUID points with trial/candidate payload metadata, and the report surfaces vector scores, excerpts, tags, metric facts, timeline facts, contrast candidates, `class_focus`, per-hit `class_match`, and `show` commands. Qdrant is a derived index; CultCache remains truth, and lexical/metric search is fallback when the vector stack is unavailable. Retrieval tuning added phonetic class-affinity scoring and candidate-specific mixed-lane ownership so `mix-p` can support stop seams without every mixed candidate matching stop evidence. `tools/run-ipa-trial-loop.ps1` orchestrates external `codex exec` hypothesis/evaluator workers around that store. Source-edit-enabled rounds now allow agents to golf DSL syntax, parser/model records, Faust lowering, worker evidence surfaces, and tests when evidence points at a repeated owner failure; agents must write `source-change-plan.md`, and the loop runs a focused build before scoring. Candidate reports must include a `Scene Voice Model` naming primary-articulatory, tract-noise, release/transient, background-room, and recording-condition voices, with general AquaSynth synth primitives allowed for helper scene voices but not accepted as articulation evidence unless lower-layer witnesses move. The active trial shape is five target sets of five phoneme lanes each: vowels, nasals/approximants, fricatives, stops, and mixed generalization. Candidate names are exactly `____.aqua`, with lowercase kebab-case family ids. Three dry external Codex smoke passes refined hypothesizer/evaluator prompts into exact 25-lane output, retrieval receipts, claim audits, evidence-quality ledgers/verdicts, and fail-closed evaluator compliance. A later five-pass prompt optimization showed the best science comes from fixed receipt packets plus constrained reasoning; production prompts now require contrast pairs, `show` metric values, primitive timeline facts/excerpts or explicit `missing`, class-consistent reference matrices, scene voice models, `X owns Y so Z remains true` owner sentences, at least five micro-sweep perturbations before a seam is actionable, and a novelty gate rejecting loudness/dressing-only families as loss-landscape novelty. Verification: focused builds/tests pass, old-store show compatibility passes, and a fresh one-candidate smoke under `artifacts/parity/ipa-timeline-fact-smoke/20260531T233217641` proves release/radiation/passivity facts persist and retrieve through Qdrant/Ollama. - TurbulenceJet now includes a release-timed burst-noise component in addition to the deterministic pressure pulse, but a stronger trial barely moved papa; the source is not the main remaining articulation bottleneck. Graph radiation now mixes 30% raw boundary flow with 70% high-passed flow after local admittance weighting, down from the over-bright 15/85 blend. Latest radiation/source artifact under `artifacts/parity/pink-trombone-utterance-logmel/20260527T174236049`: mama/papa/thrombosis cosine 0.6578/0.7692/0.5585, rmsRatio 3.0006/2.6153/2.3488, articulation 0.1437/0.1173/0.1191. Static `closure-release` under `artifacts/parity/pink-trombone-logmel/20260527T174139661` has rmsRatio 0.9900 and speechBandRatio 0.0842. This is still not speaking; next pressure is true tract resonance/passive scattering and pressure storage, not more burst gain. - Same-path two-port area discontinuities now emit `graph_area_energy_in_*` and `graph_area_energy_out_*` probes alongside the three-port branch `graph_connection_energy_*` probes. Use these to inspect passivity and formant-body failures at the scatter sites rather than judging only final output loudness. - `FaustExportOptions.DebugProbeUi` wraps graph probe signals in Faust `vbargraph` UI controls under `/debug/...` without changing audio output arity. Native streaming Faust patches now separate writable controls from read-only probe zones and can read/snapshot probe values after `ProcessBlock`; use this for acoustic graph passivity/radiation inspection, leave it off for normal parity renders. diff --git a/tools/run-ipa-trial-loop.ps1 b/tools/run-ipa-trial-loop.ps1 index e86713b..19e52e5 100644 --- a/tools/run-ipa-trial-loop.ps1 +++ b/tools/run-ipa-trial-loop.ps1 @@ -150,6 +150,31 @@ function Assert-CandidateBatch { } } +function Invoke-SourceEditVerification { + param( + [string]$LogPath, + [bool]$AllowSourceEdits + ) + + if (-not $AllowSourceEdits) { + return + } + + Invoke-LoggedProcess ` + -FilePath "dotnet" ` + -ArgumentList @( + "build", + "tests\AquaSynth.Dsl.Tests\AquaSynth.Dsl.Tests.csproj", + "--no-restore", + "--disable-build-servers", + "-p:UseSharedCompilation=false", + "-p:BuildInParallel=false", + "-v", + "minimal" + ) ` + -LogPath $LogPath +} + $repoRoot = Resolve-RepoRoot $codex = Get-Command $CodexCommand -ErrorAction Stop $loopId = New-Timestamp @@ -234,7 +259,7 @@ for ($round = 1; $round -le $Rounds; $round++) { "--store", $storePath, "--query", - "weak promising generalization vowel nasal fricative stop articulation owner source tract radiation gesture primitive dressing", + "weak promising generalization vowel nasal fricative stop articulation owner source tract radiation gesture primitive dressing DSL lowering Faust machinery scene voices background noise", "--limit", "40", "--output", @@ -267,9 +292,15 @@ Retrieval failure policy: Useful repo surfaces: - docs/ipa-vocal-tract-roadmap.md +- docs/audio-doctrine.md - src/AquaSynth.Core/IpaGestureExperiment.cs +- src/AquaSynth.Core/Model.cs +- src/AquaSynth.Core/PatchScript.cs +- src/AquaSynth.Core/ControlSplineTimeline.cs +- src/AquaSynth.Core/ProbeTimelineReport.cs - src/AquaSynth.Core/FaustExport.cs - src/AquaSynth.Faust/IpaTrialOrchestrator.cs +- tools/IpaTrialWorker/Program.cs - artifacts under $loopRoot Before writing candidates: @@ -277,7 +308,7 @@ Before writing candidates: 1. Run exactly three targeted semantic searches and save the outputs under ${roundDir}: - one for weakest stop/plosive closure evidence; - one for best vowel/nasal/fricative transferable successes; - - one for dressing/FM/AM/noise versus articulation-owner failures. + - one for DSL lowering/Faust machinery, scene voices, background-noise modeling, and dressing/FM/AM/noise versus articulation-owner failures. 2. Open exactly three detailed trial records with `show`: one weak stop/plosive, one transferable success, and one dressing-vs-articulation case when available. 3. In $roundDir/hypotheses.md, include a `Retrieval Receipts` section listing the exact search/show files you used. 4. If fewer than three search receipts and three show receipts exist on disk, stop and create the missing retrieval artifacts before writing `.aqua` files. @@ -301,22 +332,40 @@ $patchDir 6. Write a concise hypothesis report to: $roundDir/hypotheses.md +Source-code golf contract: +- Source edits allowed: $AllowCodexSourceEdits +- When source edits are allowed, you may edit `src/`, `tests/`, `docs/`, and `tools/` to test DSL syntax, DSL lowering, Faust emission, worker scoring, or scene-voice evidence surfaces. +- Do not edit generated artifacts, existing `.cc` stores, existing trial results, or previous round reports. +- Source edits must move one named owner, not add compensators. Use the sentence `X owns Y so Z remains true`. +- Valid source hypotheses include: new patch DSL syntax, parser/model records, Faust lowering changes, ProbeTimeline fields, IpaTrialWorker evidence/reporting, or tests that prove the new syntax/lowering path. +- Invalid source hypotheses include: broad rewrites, changing metric thresholds to flatter candidates, deleting hard evidence, mutating references, or hardcoding a candidate name. +- If you edit source, write `$roundDir/source-change-plan.md` with: owner map, files edited, invariant, expected metric movement, tests/build commands to run, and rollback trigger. +- If you do not edit source, write `Source Edit Decision: none` and explain which evidence is still missing. + +Scene voice model: +- Every candidate patch represents a scene, not a single naked waveform. The report must name the scene voices and say how each is synthesized. +- Required scene voice roles: `primary-articulatory`, `tract-noise`, `release/transient`, `background-room`, and `recording-condition`. +- Use ordinary AquaSynth primitives for helper voices where useful: `voice` layers, noise, FM, AM/tremolo, envelopes, filters, formants, additive/spectral voices, macros, and modulation. These helper voices are allowed in full parity. +- Helper/background voices must not count as articulation evidence unless gesture, primitive timeline, and clean vocal metrics move coherently. +- For each family, say which voices are active, which controls they expose, and which metric/timeline witness would prove the helper is not merely dressing. + Candidate design contract: - Produce exactly 25 files: exactly one candidate for each target lane. No extras. -- Use 3-5 named hypothesis families across the 25 files, for example source-carrier, constriction-place, stop-release, nasal-branch, and dressing-control. +- Use 3-5 named hypothesis families across the 25 files, for example source-carrier, constriction-place, stop-release, nasal-branch, scene-noise-bed, and lowering-release-owner. - Filename schema is mandatory: ____.aqua. - Family ids must be lowercase kebab-case and reused verbatim in filenames and `Hypothesis Families`. - The family segment in filenames is the canonical hypothesis-family id used by the evaluator. - The same family name should appear in filenames across multiple target sets when you are testing generalization. - A family is transferable only if it appears in at least three target sets; otherwise label it exploratory in the report. - Keep `.aqua` scripts parseable and self-contained. Prefer modifying values and gesture contours already visible in seed candidates before inventing new syntax. -- Do not use source edits as a way to rescue malformed candidate patches. -- Only edit source if two or more retrieved trials indicate the same owner-layer failure pattern; otherwise `Source Edit Decision: none`. +- Do not use source edits as a way to rescue malformed candidate patches; use source edits to make a coherent syntax/lowering/Faust owner possible. +- Only edit source if two or more retrieved trials indicate the same owner-layer failure pattern, or if at least two scene-voice candidates need the same missing DSL/lowering primitive; otherwise `Source Edit Decision: none`. - If Source edits allowed is False, do not edit any file outside $patchDir and $roundDir/hypotheses.md. - Before finishing, list $patchDir and verify exact count, target coverage, and filename schema in `Acceptance Checklist`. - A seam claim must use an owner sentence: `X owns Y so Z remains true`. - A seam is actionable only if the next candidate family proposes at least five micro-sweep perturbations across that seam, spread across target lanes when possible. - Novelty gate: a family must move a new owner, control axis, timing contour, or primitive relationship. Raising loudness, burst gain, or dressing alone is not novel. +- Scene novelty can be valid only when it changes a named voice role, routing/lowering primitive, modulation relationship, or background-noise synthesis model and predicts a non-articulation witness such as noise-floor, spectral tilt, RMS stability, or room/recording match. - Include a class-consistent reference matrix that maps each target id to the exact reference trial or fixture id used for comparison; mixed-set evidence cannot silently stand in for single-phoneme evidence. Required `$roundDir/hypotheses.md` shape: @@ -325,11 +374,12 @@ Required `$roundDir/hypotheses.md` shape: - `Loss Landscape Read`: strongest and weakest evidence by family. - `Reference Matrix`: one row per target id with reference trial/fixture id, candidate baseline if known, and whether the evidence is class-consistent or mixed/weak. - `Hypothesis Families`: 3-5 families, each with owner layer, transfer status, evidence_refs, cited trial_ids, at least one concrete metric key/value from `show`, a contrast pair, an owner sentence of the form `X owns Y so Z remains true`, five planned micro-sweep perturbations, and predicted metric movement using `gesture:+/-/flat`, `logmel:+/-/flat`, `articulation:+/-/flat`, `rms:+/-/flat`, `timeline:+/-/flat/risk`. +- `Scene Voice Model`: one row per family with primary voice, helper/background voices, AquaSynth primitives used, controls exposed, expected non-articulation witnesses, and dressing risk. - `Claim Audit`: one row per family: claim -> evidence file(s) -> contrast pair -> metric key/value(s) -> primitive timeline excerpt or `missing` -> predicted movement. - `Evidence Quality Ledger`: one row per family with specificity, comparability, falsifiability, reuse value for the next round, and the weakest missing evidence. Use `high`, `medium`, or `low` for each quality field. - `Novelty Gate`: one row per family saying which new owner/control axis/timing contour/primitive relationship is being explored; write `dressing-only` if the family mainly changes loudness/FM/AM/noise/envelopes. - `Candidate Matrix`: exactly 25 rows with target id, filename, family, expected metric movement, and risk. -- `Source Edit Decision`: `none` unless source edits are allowed and justified by evidence. +- `Source Edit Decision`: `none` unless source edits are allowed and justified by evidence; if source was edited, link `$roundDir/source-change-plan.md`, list files changed, tests/builds run or pending, and rollback trigger. - `Acceptance Checklist`: 25 files, one per target id, filename schema, required report sections, >=3 search receipts, >=3 show receipts. Authority boundary: @@ -337,7 +387,7 @@ Authority boundary: - Do not rewrite existing trial artifacts or the CultCache store directly. - The worker process owns measurement and .cc writes; you own candidate invention and optional source refinements. - Keep gesture_score, clean vocal/audio evidence, and full parity dressing separate. -- Patch candidates may use FM, AM, modulators, envelopes, and extra animated voices, but call out when dressing is compensating for failed articulation. +- Patch candidates should make full use of AquaSynth general synth primitives when modeling the scene: FM, AM, modulators, envelopes, filters, formants, noise voices, additive/spectral layers, and extra animated voices. Call out when these are background/recording-condition voices rather than articulation. - Prefer fixing primitive owners over adding audio dressing when the evidence says air is missing. Return a short final summary naming the files you wrote. @@ -353,6 +403,11 @@ Return a short final summary naming the files you wrote. Assert-CandidateBatch -PatchDirectory $patchDir + $sourceVerifyLog = Join-Path $logRoot "$roundId-source-edit-verification.log" + Invoke-SourceEditVerification ` + -LogPath $sourceVerifyLog ` + -AllowSourceEdits:$AllowCodexSourceEdits + $scoreLog = Join-Path $logRoot "$roundId-score-candidates.log" Invoke-LoggedProcess ` -FilePath "dotnet" ` @@ -404,7 +459,7 @@ Return a short final summary naming the files you wrote. "--store", $storePath, "--query", - "latest round weak promising transfer generalization vowel nasal fricative stop articulation owner source tract radiation gesture primitive dressing", + "latest round weak promising transfer generalization vowel nasal fricative stop articulation owner source tract radiation gesture primitive dressing DSL lowering Faust machinery scene voices background noise", "--limit", "60", "--output", @@ -429,12 +484,13 @@ Round artifacts are under: $roundDir Before judging: -1. Run at least three targeted semantic searches into ${roundDir}: +1. Run exactly three targeted semantic searches into ${roundDir}: - current round candidates by hypothesizer id or round id; - weak regressions / failed articulation; - - promising transfer / generalization. + - promising transfer / generalization, including DSL lowering/Faust/scene-voice source-edit evidence when source edits were allowed. 2. Use `show` on at least one promising and one weak candidate from the current round. 3. If the hypothesis worker skipped the required 25-lane matrix or retrieval receipts, mark orchestration/prompt compliance as failed even if some audio metrics improved. +4. If source edits were allowed, inspect `$roundDir/source-change-plan.md` when present and verify the source edit is a coherent owner move, not a metric hack. Use the worker as your search organ: `$env:DOTNET_CLI_HOME="$roundDir/dotnet-home"; `$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE="1"; `$env:DOTNET_CLI_TELEMETRY_OPTOUT="1"; dotnet run --no-build --no-restore --project tools/IpaTrialWorker/IpaTrialWorker.csproj -- search --store "$storePath" --query "$roundId external-codex-$roundId current round candidates" --limit 30 --output "$roundDir/eval-search-current-round.md" --skip-index true @@ -455,13 +511,16 @@ Verify compliance from disk as well as the hypothesis report: - validate family ids are lowercase kebab-case. - derive canonical family ids only from the filename family segment; ignore prose family names when they disagree. - validate that each actionable seam has a contrast pair, a primitive timeline excerpt or explicit `missing`, an owner sentence, and at least five planned micro-sweep perturbations. -- validate that the hypothesis report includes a class-consistent reference matrix and a novelty gate. -- If any required section, receipt class, per-target validation, filename validation, family extraction, reference matrix, contrast pair, owner sentence, or novelty gate is incomplete, set `Round Compliance: failed`. +- validate that the hypothesis report includes a class-consistent reference matrix, scene voice model, and novelty gate. +- validate that every family identifies primary-articulatory, tract-noise, release/transient, background-room, and recording-condition roles, even if some are explicitly silent. +- validate that helper/background voices are evaluated separately from articulation evidence. +- validate source edit compliance if source edits were allowed: coherent owner map, edited file list, invariant, expected metric movement, verification command, and rollback trigger. +- If any required section, receipt class, per-target validation, filename validation, family extraction, reference matrix, scene voice model, contrast pair, owner sentence, or novelty gate is incomplete, set `Round Compliance: failed`. Task: 1. Evaluate whether the worker's proposed hypotheses follow from the measured evidence. 2. Call out any hypothesis that is likely full-patch dressing impersonating articulation. -3. Recommend exactly one next implementation/refinement target, with file/module owner and why. +3. Recommend exactly one next implementation/refinement target, with file/module owner and why. It may be DSL syntax, Faust lowering, scene-voice modeling, or worker evidence if the receipts support it. 4. Write your evaluator report to: $roundDir/evaluation.md @@ -472,7 +531,9 @@ Required `$roundDir/evaluation.md` shape: - `Family Verdicts`: one row per canonical filename family with improved/flat/regressed/unknown metrics. Treat |delta| < 0.01 as flat; if deltas are not present in cited show artifacts, write `unknown` and reason=`no delta in receipts`. - `Evidence Quality Verdicts`: one row per family with specificity, comparability, falsifiability, reuse value, primitive timeline support, and weakest missing evidence. Penalize vague receipts, search-summary-only claims, missing contrast pairs, missing reference ids, and missing timeline excerpts even when metrics improve. - `Seam Audit`: one row per named seam with owner sentence, contrast pair, timeline excerpt, planned perturbation count, and verdict `actionable` or `not actionable`; fewer than five perturbations means `not actionable`. -- `Novelty Audit`: one row per family saying whether it moves a new owner/control axis/timing contour/primitive relationship or is mainly loudness/dressing. +- `Scene Voice Audit`: one row per family naming scene voices, helper/background synthesis primitives, non-articulation witness, and whether the helper voices are honest context or dressing. +- `Source Edit Audit`: if source edits were allowed, summarize source files changed, invariant claimed, verification result, and whether the edit should survive; otherwise `not allowed`. +- `Novelty Audit`: one row per family saying whether it moves a new owner/control axis/timing contour/primitive relationship/scene-voice model or is mainly loudness/dressing. - `Generalization Read`: whether effects transferred across target sets or overfit one phoneme. - `Dressing Audit`: articulation evidence requires movement in gesture/articulation/primitive timeline metrics; FM/AM/noise/envelope evidence without those is dressing. - `Next Target`: exactly one markdown bullet, final line of the file, and no continuation text: ` | | `. @@ -480,7 +541,7 @@ Required `$roundDir/evaluation.md` shape: Authority boundary: - Do not edit source files. - Do not rewrite trial artifacts. -- Be explicit about which layer owns the failure: gesture DSL, primitive source, tract/radiation lowering, audio scoring, or orchestration. +- Be explicit about which layer owns the failure: gesture DSL, scene voice model, primitive source, tract/radiation lowering, Faust machinery, audio scoring, or orchestration. - Treat the CultCache .cc store as the shared trial memory that future hypothesis workers will query through the worker search/show commands. Return a short final summary naming the report you wrote.