Skip to content

Commit 81d1e13

Browse files
feat: implement evidence-based routing audit workflows with explicit intent confirmation, risk scoring, and cleanup plan gating
1 parent c0ae625 commit 81d1e13

19 files changed

Lines changed: 2145 additions & 124 deletions

agent-docs/machine/architecture-governance.snapshot.json

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"snapshot_version": 1,
33
"as_of": "2026-07-02",
44
"status": "governed",
5-
"governance_note": "Updated for Low-End Analysis evidence levels 1-5, additive audio-feature metrics, rendered-master proxy-only claims, role-confirmed stem/bus gates for stem-specific conclusions, and declared manual/forbidden low-end workflow actions. Persistent-write safety posture is unchanged; FL Studio render automation, automatic project writes, plugin loading, and stem-specific claims from master-only audio remain forbidden.",
5+
"governance_note": "Updated for Routing Audit evidence levels, finding states, producer intent confirmation, meter-proxy labeling, cleanup-plan gating, and Mix Review evidence-weighted scoring with rendered-master proxy and role-confirmed stem evidence. Persistent-write safety posture is unchanged; Routing Audit and Mix Review remain read-only, planning remains confirmation-gated, and apply remains separate with explicit approval and rollback.",
66
"project": {
77
"name": "fls-pilot",
88
"package_version": "3.0.0b3",
@@ -351,6 +351,32 @@
351351
"audio_features_contract": "fls-pilot.audio-features.v1",
352352
"audio_artifact_contract": "fls-pilot.audio-artifact.v1",
353353
"evidence_link_contract": "fls-pilot.evidence-link.v1",
354+
"mix_review_contract": {
355+
"evidence_levels": {
356+
"1": "static_project_metadata",
357+
"2": "live_meter_window",
358+
"3": "rendered_master_audio_proxy",
359+
"4": "role_confirmed_stem_or_bus_audio"
360+
},
361+
"finding_states": [
362+
"static_heuristic",
363+
"name_based_unconfirmed",
364+
"metadata_suspected",
365+
"live_meter_supported",
366+
"rendered_master_proxy",
367+
"stem_audio_confirmed",
368+
"accepted_by_user",
369+
"rejected_by_user",
370+
"ignored_by_user",
371+
"requires_more_evidence"
372+
],
373+
"score_model": "risk_score_v2 uses severity, evidence confidence, rule/profile weight, and user decision modifiers while preserving legacy_score metadata.",
374+
"rendered_master_claim_limit": "proxy_only_no_stem_specific_causes",
375+
"stem_specific_claims_require": "role_confirmed_stem_or_bus_audio",
376+
"automatic_fl_render": false,
377+
"persistent_writes": false,
378+
"fix_plan_gating": "blocked_or_draft_until_sufficient_evidence_and_user_approval"
379+
},
354380
"low_end_contract": {
355381
"evidence_levels": {
356382
"1": "static_metadata",

agent-docs/machine/architecture/analysis-workflows.snapshot.json

Lines changed: 111 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"source_snapshot": "agent-docs/machine/architecture-analysis.snapshot.json",
66
"source_snapshot_sha256": "ff0d38588b91510a3073e81d885de38f9116cddfbcd95686cbf11c28a6db8d7f",
77
"generated_at": "2026-07-02",
8-
"note": "Scoped slice refreshed for Low-End Analysis evidence levels 1-5, proxy rendered-master semantics, workflow action declarations, and Control Center metadata; full static architecture analysis was not regenerated.",
8+
"note": "Scoped slice refreshed for Routing Audit evidence levels, finding states, cleanup-plan gating metadata, and Mix Review evidence-weighted scoring/rendered-audio evidence metadata; full static architecture analysis was not regenerated.",
99
"load_when": [
1010
"workflow registry, report schema, scoring, evidence, freshness, prerequisites, or health aggregation changes",
1111
"Control Center project-review workflow panel ownership or endpoint changes",
@@ -155,6 +155,16 @@
155155
"evidence_mode": "live_runtime",
156156
"invalidates_on": [],
157157
"ttl_seconds": 2
158+
},
159+
{
160+
"id": "rendered_stem_features",
161+
"observation_kind": "rendered_stem_features",
162+
"required": false,
163+
"evidence_mode": "rendered_audio",
164+
"invalidates_on": [
165+
"project_identity_change",
166+
"audio_source_hash_changed"
167+
]
158168
}
159169
]
160170
},
@@ -163,17 +173,23 @@
163173
"group": "Project Review",
164174
"endpoint": "/api/workflows/mix-review",
165175
"action_label": "Run Mix Review",
166-
"safety_note": "Read-only mixer review. Level 1 is static; Level 2 uses optional transient playback/watch evidence; Level 3/4 audio evidence is prepared for external analyzer integration.",
176+
"safety_note": "Read-only mixer review. Level 1 is static; Level 2 uses optional transient playback/watch evidence; Level 3 uses linked rendered master proxy evidence; Level 4 uses role-confirmed stem/bus evidence.",
167177
"supported_next_actions": [
168178
"run_static_review",
169179
"start_level_2_watch",
170180
"link_rendered_master_evidence",
171-
"link_stem_bus_evidence"
181+
"link_stem_bus_evidence",
182+
"confirm_mix_review_finding",
183+
"accept_mix_review_finding",
184+
"reject_mix_review_finding",
185+
"ignore_mix_review_finding"
172186
],
173187
"manual_only_actions": [
174188
"choose_loudest_section",
175189
"manual_audio_render",
176-
"manual_stem_export"
190+
"manual_stem_export",
191+
"confirm_track_roles",
192+
"approve_fix_plan"
177193
],
178194
"forbidden_actions": [
179195
"automatic_render",
@@ -182,15 +198,56 @@
182198
],
183199
"metadata": {
184200
"mix_review_levels": [
185-
"level_1_static",
186-
"level_2_live_peak_watch",
187-
"level_3_rendered_master_placeholder",
188-
"level_4_stem_bus_placeholder"
201+
"level_1_static_project_metadata",
202+
"level_2_live_meter_window",
203+
"level_3_rendered_master_audio_proxy",
204+
"level_4_role_confirmed_stem_bus_audio"
205+
],
206+
"finding_states": [
207+
"static_heuristic",
208+
"name_based_unconfirmed",
209+
"metadata_suspected",
210+
"live_meter_supported",
211+
"rendered_master_proxy",
212+
"stem_audio_confirmed",
213+
"accepted_by_user",
214+
"rejected_by_user",
215+
"ignored_by_user",
216+
"requires_more_evidence"
217+
],
218+
"score_fields": [
219+
"legacy_score",
220+
"risk_score_v2",
221+
"score_status",
222+
"score_inputs",
223+
"evidence_weight",
224+
"decision_adjusted_score",
225+
"blocked_findings_count",
226+
"provisional_findings_count",
227+
"confirmed_findings_count"
228+
],
229+
"fix_plan_statuses": [
230+
"blocked",
231+
"draft",
232+
"requires_user_approval",
233+
"approved",
234+
"not_applicable"
189235
],
190-
"external_audio_analyzer_status": "not_merged_yet",
191236
"genre_profiles": [
192237
"default",
193-
"psytrance"
238+
"psytrance",
239+
"techno",
240+
"hiphop",
241+
"ambient",
242+
"rock",
243+
"cinematic"
244+
],
245+
"target_contexts": [
246+
"streaming",
247+
"club",
248+
"festival",
249+
"demo",
250+
"unknown"
194251
]
195252
}
196253
},
@@ -208,11 +265,50 @@
208265
"group": "Project Review",
209266
"endpoint": "/api/workflows/routing-audit",
210267
"action_label": "Run Routing Audit",
211-
"safety_note": "Read-only routing audit. Cleanup remains proposal-first.",
212-
"supported_next_actions": [],
213-
"manual_only_actions": [],
214-
"forbidden_actions": [],
215-
"metadata": {}
268+
"safety_note": "Read-only routing audit. Static and meter findings remain evidence-labeled; cleanup remains proposal-first and confirmation-gated.",
269+
"supported_next_actions": [
270+
"run_static_routing_snapshot",
271+
"run_meter_snapshot_proxy",
272+
"confirm_template_profile",
273+
"confirm_track_roles",
274+
"plan_cleanup_after_confirmation"
275+
],
276+
"manual_only_actions": [
277+
"confirm_direct_to_master_intent",
278+
"confirm_reference_monitor_only",
279+
"confirm_sidechain_control_not_audible",
280+
"approve_cleanup_plan"
281+
],
282+
"forbidden_actions": [
283+
"automatic_routing_cleanup",
284+
"playlist_clip_editing",
285+
"plugin_loading",
286+
"automatic_render"
287+
],
288+
"metadata": {
289+
"routing_evidence_levels": [
290+
"static_routing_snapshot",
291+
"meter_snapshot_proxy",
292+
"user_confirmed_routing_intent",
293+
"verified_cleanup_readback"
294+
],
295+
"plan_gating_statuses": [
296+
"blocked_requires_confirmation",
297+
"draft_proxy_evidence",
298+
"ready_for_user_approval",
299+
"no_actionable_findings"
300+
],
301+
"intent_profiles": [
302+
"default",
303+
"psytrance_stem_bus_template",
304+
"mixdown_premaster_template",
305+
"recording_session",
306+
"sound_design_session",
307+
"live_performance",
308+
"minimal_sketch",
309+
"reference_monitoring"
310+
]
311+
}
216312
},
217313
{
218314
"id": "low_end_analysis",

agent-docs/machine/architecture/mcp-surface.snapshot.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"title": "MCP tools, resources, prompts and public tool safety summary",
55
"source_snapshot": "agent-docs/machine/architecture-analysis.snapshot.json",
66
"source_snapshot_sha256": "ff0d38588b91510a3073e81d885de38f9116cddfbcd95686cbf11c28a6db8d7f",
7-
"generated_at": "2026-06-19",
8-
"note": "Slim generated MCP surface slice. For a concrete tool module, load the matching file under architecture/mcp-tools/.",
7+
"generated_at": "2026-07-02",
8+
"note": "Slim MCP surface slice refreshed for additive Routing Audit cleanup-plan gating arguments and behavior. Tool counts and safety-class totals are unchanged; for concrete tool details, load the matching file under architecture/mcp-tools/.",
99
"load_when": [
1010
"MCP tools, resources, or prompts are added, removed, renamed, or changed",
1111
"public MCP behavior, safety annotations, or tool registration changes",

agent-docs/machine/architecture/mcp-tools/routing.snapshot.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"title": "MCP tool module: routing",
55
"source_snapshot": "agent-docs/machine/architecture-analysis.snapshot.json",
66
"source_snapshot_sha256": "ff0d38588b91510a3073e81d885de38f9116cddfbcd95686cbf11c28a6db8d7f",
7-
"generated_at": "2026-07-01",
7+
"generated_at": "2026-07-02",
88
"load_when": [
99
"MCP tool implementation or registration changes in the routing tool module",
1010
"safety annotations, doc safety, destructive hints, or protocol usage change for routing tools"
@@ -17,15 +17,15 @@
1717
"write-safe-required": 4
1818
},
1919
"destructive_hint_true_count": 0,
20-
"first_line": 269
20+
"first_line": 272
2121
},
2222
"tools": [
2323
{
2424
"contract_safety_class": "read-only",
2525
"destructive_hint": null,
2626
"evidence": "annotation readOnlyHint=True destructiveHint=None; protocol=CMD_MIXER_GET_ROUTING; safetyClass='read-only'; doc_safety=True",
2727
"has_safety_doc": true,
28-
"line": 269,
28+
"line": 272,
2929
"name": "fl_get_routing",
3030
"path": "src/fls_pilot/tools/routing.py",
3131
"read_only_hint": true,
@@ -38,7 +38,7 @@
3838
"destructive_hint": null,
3939
"evidence": "annotation readOnlyHint=True destructiveHint=None; protocol=CMD_MIXER_GET_ROUTING_ALL; safetyClass='read-only'; doc_safety=True",
4040
"has_safety_doc": true,
41-
"line": 280,
41+
"line": 283,
4242
"name": "fl_get_routing_all",
4343
"path": "src/fls_pilot/tools/routing.py",
4444
"read_only_hint": true,
@@ -51,7 +51,7 @@
5151
"destructive_hint": null,
5252
"evidence": "annotation readOnlyHint=True destructiveHint=None; protocol=CMD_CHANNEL_ROUTING_SUMMARY; safetyClass='read-only'; doc_safety=True",
5353
"has_safety_doc": true,
54-
"line": 289,
54+
"line": 292,
5555
"name": "fl_get_channel_routing",
5656
"path": "src/fls_pilot/tools/routing.py",
5757
"read_only_hint": true,
@@ -64,7 +64,7 @@
6464
"destructive_hint": null,
6565
"evidence": "annotation readOnlyHint=True destructiveHint=None; protocol=CMD_CHANNEL_ROUTING_SUMMARY,CMD_MIXER_GET_ROUTING_ALL,CMD_PLUGIN_LIST; helper_calls=detect_cleanup; safetyClass='read-only'; doc_safety=True",
6666
"has_safety_doc": true,
67-
"line": 298,
67+
"line": 301,
6868
"name": "fl_detect_cleanup_candidates",
6969
"path": "src/fls_pilot/tools/routing.py",
7070
"read_only_hint": true,
@@ -77,7 +77,7 @@
7777
"destructive_hint": false,
7878
"evidence": "annotation readOnlyHint=False destructiveHint=False; protocol=CMD_MIXER_SET_ROUTE; uses safety layer; safetyClass='write-safe-required'; doc_safety=True",
7979
"has_safety_doc": true,
80-
"line": 308,
80+
"line": 311,
8181
"name": "fl_set_route",
8282
"path": "src/fls_pilot/tools/routing.py",
8383
"read_only_hint": false,
@@ -90,7 +90,7 @@
9090
"destructive_hint": false,
9191
"evidence": "annotation readOnlyHint=False destructiveHint=False; uses safety layer; helper_calls=_bus_rename_entry,_dry_run_report,_no_write_report,_route_write_entry; safetyClass='write-safe-required'; doc_safety=True",
9292
"has_safety_doc": true,
93-
"line": 337,
93+
"line": 340,
9494
"name": "fl_group_tracks",
9595
"path": "src/fls_pilot/tools/routing.py",
9696
"read_only_hint": false,
@@ -101,9 +101,9 @@
101101
{
102102
"contract_safety_class": "read-only",
103103
"destructive_hint": null,
104-
"evidence": "annotation readOnlyHint=True destructiveHint=None; protocol=CMD_CHANNEL_LIST,CMD_MIXER_GET_ALL_PEAKS; helper_calls=routing_audit_options_from_inputs,merge_channel_control_rows,capture_signal_flow_evidence,template_compliance_result,level_2_signal_findings,_routing_review_findings; public_args=routing_check_mode,template_compliance,selected_template_profile; safetyClass='read-only'; doc_safety=True",
104+
"evidence": "annotation readOnlyHint=True destructiveHint=None; protocol=CMD_CHANNEL_LIST,CMD_MIXER_GET_ALL_PEAKS; helper_calls=routing_audit_options_from_inputs,merge_channel_control_rows,capture_signal_flow_evidence,template_compliance_result,level_2_signal_findings,enrich_routing_findings,routing_cleanup_plan_gating,_routing_review_findings; public_args=routing_check_mode,template_compliance,selected_template_profile; safetyClass='read-only'; doc_safety=True",
105105
"has_safety_doc": true,
106-
"line": 446,
106+
"line": 449,
107107
"name": "fl_review_routing",
108108
"path": "src/fls_pilot/tools/routing.py",
109109
"read_only_hint": true,
@@ -114,9 +114,9 @@
114114
{
115115
"contract_safety_class": "read-only",
116116
"destructive_hint": null,
117-
"evidence": "annotation readOnlyHint=True destructiveHint=None; safetyClass='read-only'; doc_safety=True",
117+
"evidence": "annotation readOnlyHint=True destructiveHint=None; helper_calls=enrich_routing_findings,routing_cleanup_plan_gating; public_args=issues,proposed_buses,source_findings,user_decisions; safetyClass='read-only'; doc_safety=True",
118118
"has_safety_doc": true,
119-
"line": 697,
119+
"line": 744,
120120
"name": "fl_plan_routing_cleanup",
121121
"path": "src/fls_pilot/tools/routing.py",
122122
"read_only_hint": true,
@@ -129,7 +129,7 @@
129129
"destructive_hint": false,
130130
"evidence": "annotation readOnlyHint=False destructiveHint=False; uses safety layer; helper_calls=_bus_rename_entry,_dry_run_report,_no_write_report,_route_write_entry; safetyClass='write-safe-required'; doc_safety=True",
131131
"has_safety_doc": true,
132-
"line": 772,
132+
"line": 884,
133133
"name": "fl_apply_routing_cleanup",
134134
"path": "src/fls_pilot/tools/routing.py",
135135
"read_only_hint": false,
@@ -142,7 +142,7 @@
142142
"destructive_hint": false,
143143
"evidence": "annotation readOnlyHint=False destructiveHint=False; uses safety layer; helper_calls=_bus_rename_entry,_dry_run_report,_no_write_report,_route_write_entry; safetyClass='write-safe-required'; doc_safety=True",
144144
"has_safety_doc": true,
145-
"line": 871,
145+
"line": 983,
146146
"name": "fl_apply_bus_layout",
147147
"path": "src/fls_pilot/tools/routing.py",
148148
"read_only_hint": false,

evals/evals.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@
218218
"fl_review_mix without args remains Level 1 static and does not start playback",
219219
"use explicit Level 2 watch evidence before treating peaks, clipping, or headroom as live evidence",
220220
"distinguish static snapshot findings from live peak-watch evidence",
221+
"show finding_state, score_status, and whether each fix plan is blocked, draft, or requires approval",
222+
"do not score rejected findings negatively or include ignored findings in fix plans",
221223
"do not apply trims/EQ/compression without explicit approval",
222224
"report limitations when rendered audio evidence is missing",
223225
"do not claim Level 3 or Level 4 rendered audio analysis unless external analyzer evidence is linked"
@@ -256,7 +258,9 @@
256258
"show Level 3 expected master checks without claiming LUFS, true peak, clipping count, spectrum, or stereo facts",
257259
"show Level 4 expected stem checks without claiming masking, phase, or bus-balance facts",
258260
"mark external analyzer integration as pending when no artifact evidence is available",
259-
"do not create fake rendered-audio findings inside Mix Review"
261+
"do not create rendered-audio findings without linked artifact evidence",
262+
"when rendered master evidence is linked, keep findings proxy-labeled and avoid stem-specific causal claims",
263+
"when stem evidence is linked, require confirmed roles before stem-specific findings"
260264
],
261265
"not_expected_tools": [
262266
"automatic FL render",
@@ -345,6 +349,8 @@
345349
"read-only routing diagnosis and planning",
346350
"do not alter sends/routes or names",
347351
"include explicit approval gate for any later cleanup batch",
352+
"label static routing suspicions and name/template-based findings as confirmation-gated",
353+
"block cleanup-plan readiness until routing findings and producer intent are confirmed",
348354
"never propose routing Master as a normal source target",
349355
"do not suppress cleanup findings when template profile classification is ambiguous"
350356
],
@@ -357,6 +363,7 @@
357363
"success_criteria": [
358364
"assistant separates route findings from rollback-safe proposed actions",
359365
"cleanup plan references supported routing tools only",
366+
"assistant reports routing evidence level, finding state, and cleanup-plan gating status",
360367
"assistant treats ambiguous template profile matches as validation-needed rather than cleanup-safe suppressions"
361368
]
362369
},
@@ -383,6 +390,7 @@
383390
"read-only routing diagnosis only",
384391
"do not start playback when the user chose manual playback",
385392
"report static_snapshot_plus_meter_snapshot evidence and whether signal-flow evidence was available",
393+
"label meter findings as proxy evidence rather than proof of wrong routing or musical intent",
386394
"do not apply routing cleanup, bus layout, naming, coloring, or send changes"
387395
],
388396
"not_expected_tools": [
@@ -396,7 +404,7 @@
396404
"assistant selects the Level 2 routing mode instead of the default static audit",
397405
"assistant uses the selected psytrance profile rather than hard-coded genre rules",
398406
"assistant treats Channel Rack versus Mixer differences as review findings unless signal evidence strengthens them",
399-
"assistant labels signal-confirmed template findings only when live meter evidence is present",
407+
"assistant labels signal-active template findings as meter-snapshot proxy evidence only when live meter evidence is present",
400408
"assistant offers Level 1 fallback if signal-flow evidence is unavailable"
401409
]
402410
},

0 commit comments

Comments
 (0)