Skip to content

Commit b4adee6

Browse files
docs: define default safe UX contract (#89)
closes #56 P0: Define default safe UX contract
1 parent a0cb4fe commit b4adee6

12 files changed

Lines changed: 224 additions & 37 deletions

File tree

docs/agents/prompts/mix-review.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Use this when the user wants to review the current FL Studio mix.
88
- `fl://status`
99
- `docs/agents/runtime-usage.md`
1010
- `docs/concepts/safety-contract.md`
11+
- `docs/concepts/default-safe-ux.md`
1112

1213
## Workflow
1314

@@ -19,9 +20,11 @@ Use this when the user wants to review the current FL Studio mix.
1920
- critical mix risks
2021
- low-end/stereo issues
2122
- routing or gain-staging problems
22-
- safe next actions
23-
6. Do not mutate FL Studio state unless the user explicitly approves a
24-
rollback-backed write.
23+
- exactly one safest reversible next action
24+
6. Include the risk level for the proposed next action.
25+
7. Ask for explicit confirmation before calling any write tool.
26+
8. If confirmed, apply at most one small reversible change, read back where
27+
supported, report before/after plus rollback or `change_id`, then stop.
2528

2629
## Stop Conditions
2730

@@ -40,5 +43,6 @@ Return:
4043
1. Session/bridge status.
4144
2. Mix review summary.
4245
3. Top risks in priority order.
43-
4. Safe next actions.
44-
5. Any unsupported or unverified behavior that must not be implied as complete.
46+
4. One proposed reversible next action with risk level.
47+
5. Confirmation request, or applied before/after plus rollback or `change_id`.
48+
6. Any unsupported or unverified behavior that must not be implied as complete.

docs/agents/prompts/project-organizer.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,21 @@ project cleanup plan.
99
- `fl://status`
1010
- `docs/agents/runtime-usage.md`
1111
- `docs/concepts/safety-contract.md`
12+
- `docs/concepts/default-safe-ux.md`
1213

1314
## Workflow
1415

1516
1. Confirm bridge/session health.
1617
2. Read current channels, mixer, and playlist metadata through capped resources
1718
or domain tools.
1819
3. Run `fl_plan_project_cleanup`.
19-
4. Present the plan before mutation.
20-
5. Apply only one approved cleanup step at a time with
20+
4. Present a ranked plan, then propose exactly one safest reversible cleanup
21+
step with a risk level.
22+
5. Ask for explicit confirmation before mutation.
23+
6. Apply only one approved cleanup step at a time with
2124
`fl_apply_project_cleanup_step`, and only when rollback/readback are clear.
25+
7. After the write, read back where supported, report before/after plus rollback
26+
or `change_id`, then stop.
2227

2328
## Stop Conditions
2429

@@ -32,5 +37,6 @@ Return:
3237

3338
1. Current organization summary.
3439
2. Proposed groups/routes/colors/names.
35-
3. Safe step queue.
36-
4. Rollback/readback notes for any write-safe-required step.
40+
3. One proposed reversible step with risk level.
41+
4. Confirmation request, or applied before/after plus rollback or `change_id`.
42+
5. Rollback/readback notes for any write-safe-required step.

docs/agents/prompts/routing-review.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,19 @@ or send/return structure in the current FL Studio project.
99
- `fl://status`
1010
- `docs/agents/runtime-usage.md`
1111
- `docs/concepts/safety-contract.md`
12+
- `docs/concepts/default-safe-ux.md`
1213

1314
## Workflow
1415

1516
1. Confirm bridge/session health.
1617
2. Use read-only state first.
1718
3. Run `fl_review_routing`.
1819
4. If cleanup is requested, run `fl_plan_routing_cleanup` before any mutation.
19-
5. Treat cleanup as a plan unless the user explicitly approves a rollback-backed
20-
write step.
20+
5. Treat cleanup as a plan unless the user explicitly approves one exact
21+
rollback-backed write step.
22+
6. Include a risk level for the proposed routing change.
23+
7. After one approved write, read back where supported, report before/after plus
24+
rollback or `change_id`, then stop.
2125

2226
## Stop Conditions
2327

@@ -30,5 +34,6 @@ Return:
3034

3135
1. Current routing risks.
3236
2. Bus/send/grouping issues.
33-
3. Proposed cleanup steps.
34-
4. Which steps are read-only, dry-run, or write-safe-required.
37+
3. One proposed cleanup step with risk level.
38+
4. Whether the step is read-only, dry-run, or write-safe-required.
39+
5. Confirmation request, or applied before/after plus rollback or `change_id`.

docs/agents/runtime-usage.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ checks.
1414
or large tool calls.
1515
4. Choose a current workflow/domain tool. Avoid raw FL API calls and removed
1616
one-off aliases.
17-
5. For writes, plan the rollback unit before mutation.
17+
5. For write-capable workflows, scan/read-only first, propose exactly one
18+
reversible next action with a risk level, and ask for explicit confirmation
19+
before mutation.
20+
6. After one approved write, read back where supported, report before/after plus
21+
rollback or `change_id`, then stop and wait for user direction.
1822

1923
## Tool-Choice Matrix
2024

@@ -50,6 +54,9 @@ checks.
5054

5155
- The selected tool path is current and Knowledgebase-informed.
5256
- Writes, if any, are rollback-backed and verified by readback where supported.
57+
- Write-capable workflows presented a risk level, asked for explicit
58+
confirmation, applied only one reversible change per confirmation, and stopped
59+
after the before/after report.
5360
- Unsupported API behavior is stated as a limit, not implied as completed work.
5461
- Docs, roadmap/API audit, and Knowledgebase are updated when public MCP
5562
behavior changes.

docs/concepts/default-safe-ux.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Default Safe UX
2+
3+
This policy defines the default assistant behavior for user-facing workflows
4+
that may mutate an FL Studio project. It is the product-level expression of the
5+
write-safety contract, not a second write layer.
6+
7+
## Default Sequence
8+
9+
For every workflow that could lead to a persistent FL Studio write, the
10+
assistant must:
11+
12+
1. Scan/read-only first.
13+
2. Explain findings in normal user language.
14+
3. Propose exactly one safest reversible next action.
15+
4. Include a risk level for that proposal.
16+
5. Ask for explicit confirmation before any write.
17+
6. Apply at most one small reversible change per confirmation.
18+
7. Read back the affected state where supported.
19+
8. Show before/after plus rollback or `change_id` where available.
20+
9. Stop and wait for user direction.
21+
22+
Dry-run and planning tools are the default for broad cleanup, export readiness,
23+
routing restructuring, project organization, or any request that could require
24+
several persistent writes.
25+
26+
## Risk Levels
27+
28+
| Risk level | Meaning | Default behavior |
29+
|---|---|---|
30+
| `read-only` | Reads state, files, or server context only. | Safe to run without write confirmation. |
31+
| `low` | One small rollback-backed write with clear target, readback, and restore path. | Propose one action, ask for confirmation, apply one change only. |
32+
| `medium` | Rollback-backed write, but the target is broader, grouped, or depends on state-sensitive API behavior. | Prefer dry-run; require explicit confirmation and stop after one rollback unit. |
33+
| `high` | Technically supported only with substantial project impact, weak readback, or risky target selection. | Do not apply by default; offer manual guidance or a smaller lower-risk alternative. |
34+
| `unsupported` | No safe API path, no rollback path, forbidden surface, or unclear evidence. | Do not write; explain the capability boundary and offer read-only, probe-only, or manual steps. |
35+
36+
## Proposal Shape
37+
38+
Every proposed write should include:
39+
40+
- Finding: the observed problem and evidence.
41+
- Proposed action: one concrete reversible change.
42+
- Risk level: `low`, `medium`, `high`, or `unsupported`.
43+
- Safety basis: why rollback and readback are or are not available.
44+
- Confirmation request: ask the user to approve that exact change.
45+
46+
Do not offer a queue of writes as the default next action. If a workflow finds
47+
many issues, rank them and propose only the safest reversible next step.
48+
49+
## Applied Write Report Shape
50+
51+
After an approved write, report:
52+
53+
- What changed.
54+
- Before/after state.
55+
- Readback result, or the explicit readback limit.
56+
- `change_id`, rollback command, or rollback limitation.
57+
- What was skipped.
58+
- Stop state: the assistant is waiting for the user's next instruction.
59+
60+
## Unsupported Capability Wording
61+
62+
Unsupported operations should be described as product/API boundaries, not raw
63+
failures. Use wording like:
64+
65+
```text
66+
I cannot apply that safely through fls-pilot because FL Studio does not expose a
67+
verified rollback/readback path for this operation. I can give you manual steps
68+
or run a read-only/probe-only check instead.
69+
```
70+
71+
Forbidden user-facing surfaces remain forbidden even when a user asks for them:
72+
plugin loading/insertion, playlist clip editing, pattern or clip deletion,
73+
project open/new/save-as/render automation, raw API escape hatches, broad UI
74+
automation, unsafe automation recording, and full-FLP restore claims.

docs/concepts/safety-contract.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,22 @@ Persistent writes may enter through only:
4343
- `safety.safe_piano_roll_write(...)` for undo-backed Piano Roll generated
4444
scripts with explicit readback limits.
4545

46+
## Default Safe UX
47+
48+
User-facing workflows must expose the write-safety contract as a conservative
49+
assistant flow:
50+
51+
1. Scan/read-only first.
52+
2. Explain findings in normal user language.
53+
3. Propose exactly one safest reversible next action with a risk level.
54+
4. Ask for explicit confirmation before any persistent write.
55+
5. Apply at most one reversible change or one named rollback unit.
56+
6. Read back affected state where supported.
57+
7. Report before/after plus rollback or `change_id` where available.
58+
8. Stop and wait for user direction.
59+
60+
See [Default Safe UX](default-safe-ux.md) for the risk levels and report shape.
61+
4662
## Stop And Fallback Rules
4763

4864
- Do not guess normalized values, dB/Hz mappings, REC event IDs, track indices,

docs/user-guide/prompts.md

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ This page collects useful user prompts for working with fls-pilot. Users do not
55
## Module Examples
66

77
Each example is a user prompt. The assistant may call several tools behind the
8-
scenes, and write tools should be described before execution when the change is
9-
not trivial.
8+
scenes. For workflows that may write to FL Studio, the default behavior is to
9+
scan/read-only first, propose one reversible action with a risk level, ask for
10+
explicit confirmation, apply at most one approved change, read back where
11+
supported, report before/after plus rollback or `change_id`, then stop.
1012

1113
### Transport And Bridge
1214

@@ -37,8 +39,8 @@ Typical tools: `fl_get_project_state`, `fl_mixer`,
3739
Prompt:
3840

3941
```text
40-
Find channels that are not routed to mixer tracks, assign the kick to a free
41-
track, and write a four-on-the-floor kick pattern.
42+
Find channels that are not routed to mixer tracks. Propose the safest one-track
43+
routing fix with a risk level, but do not apply it until I confirm.
4244
```
4345

4446
Typical tools: `fl_detect_unassigned_channels`,
@@ -49,8 +51,8 @@ Typical tools: `fl_detect_unassigned_channels`,
4951
Prompt:
5052

5153
```text
52-
Create a named intro pattern, clone my main groove for the drop, color the drop
53-
pattern red, and add section markers at bars 1, 17, and 33.
54+
Review my pattern and playlist metadata first. Propose one low-risk reversible
55+
organization change, ask for confirmation, then stop.
5456
```
5557

5658
Typical tools: `fl_arrange_new_pattern`, `fl_arrange_clone_pattern`,
@@ -61,8 +63,8 @@ Typical tools: `fl_arrange_new_pattern`, `fl_arrange_clone_pattern`,
6163
Prompt:
6264

6365
```text
64-
Write an 8-bar melody in D Dorian to the selected channel, then quantize it to
65-
1/16 notes.
66+
Prepare an 8-bar D Dorian melody plan for the selected channel. Tell me the
67+
risk level and wait for confirmation before writing to the Piano Roll.
6668
```
6769

6870
Typical tools: `fl_scale_get`, `fl_piano_roll`, or the higher-level
@@ -73,8 +75,8 @@ Typical tools: `fl_scale_get`, `fl_piano_roll`, or the higher-level
7375
Prompt:
7476

7577
```text
76-
Find the EQ on the lead vocal, reduce harshness around 3 kHz, then show the
77-
before and after parameter values.
78+
Find the EQ on the lead vocal and propose one rollback-safe harshness reduction
79+
around 3 kHz. Include the risk level and wait for confirmation.
7880
```
7981

8082
Typical tools: `fl_plugin`, `fl_apply_eq_intent`.
@@ -87,7 +89,7 @@ Prompt:
8789

8890
```text
8991
Run Mix Review, explain the top three problems, and apply only the safest
90-
headroom fix first.
92+
headroom fix first after I confirm the exact proposed change.
9193
```
9294

9395
Typical tools: `fl_review_mix`, `fl_review_low_end_stereo`, `fl_gain_stage`,
@@ -98,8 +100,8 @@ Typical tools: `fl_review_mix`, `fl_review_low_end_stereo`, `fl_gain_stage`,
98100
Prompt:
99101

100102
```text
101-
Group all drum tracks into a Drums bus, mute the bass group for comparison,
102-
then undo the mute when I say so.
103+
Review routing first. Propose one low-risk rollback-safe routing change with a
104+
risk level and wait for confirmation before applying it.
103105
```
104106

105107
Typical tools: `fl_detect_cleanup_candidates`, `fl_group_tracks`,
@@ -131,6 +133,23 @@ Typical tools: `fl_analyze_audio`, `fl_suggest_preset`,
131133

132134
## Useful Prompt Patterns
133135

136+
### Safety-First Examples
137+
138+
```text
139+
Scan my mix first. Do not change anything yet. Tell me the safest next action,
140+
its risk level, and offer only one reversible fix.
141+
```
142+
143+
```text
144+
Review the routing first. Give me a read-only diagnosis and one low-risk
145+
rollback-safe routing change to approve.
146+
```
147+
148+
```text
149+
Prepare this project for export. Report blockers first, use dry-run planning,
150+
and stop before applying anything.
151+
```
152+
134153
```text
135154
Scan first, do not change anything yet.
136155
```

docs/user-guide/workflows.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,24 @@ The normal workflow is conversational:
1010
headroom issue".
1111
2. The assistant reads `fl://agent-briefing`, checks `fl://status`, and uses
1212
relevant resources such as `fl://mixer`, `fl://channels`, or specific tools.
13-
3. For risky or multi-step work, the assistant explains what it plans to do and
14-
which changes are reversible.
15-
4. The assistant applies one approved change or one named rollback unit.
16-
5. The assistant reports what changed, what was skipped, and how to roll it
17-
back.
13+
3. The assistant scans/read-only first and explains findings in normal user
14+
language.
15+
4. The assistant proposes exactly one safest reversible next action with a risk
16+
level and asks for explicit confirmation.
17+
5. After confirmation, the assistant applies at most one reversible change or
18+
one named rollback unit.
19+
6. The assistant reads back where supported, reports before/after plus rollback
20+
or `change_id`, then stops and waits.
1821

1922
Users do not need to know tool names, but direct tool names are available for
2023
precision. These are both valid:
2124

2225
```text
23-
Please rename mixer track 8 to Drums and color it blue.
26+
Please rename mixer track 8 to Drums.
2427
```
2528

2629
```text
27-
Use fl_mixer with action set_name on track 8, then fl_mixer with action set_color on track 8.
30+
Use fl_mixer with action set_name on track 8.
2831
```
2932

3033
## Safety Classes
@@ -48,14 +51,28 @@ For any persistent FL Studio write, the assistant should follow this sequence:
4851
5. Log restore data.
4952
6. Report what changed and how it can be rolled back.
5053

54+
## Default Safe UX
55+
56+
The default assistant posture is scan/read-only first. A write-capable workflow
57+
should propose one reversible action at a time, include a risk level
58+
(`read-only`, `low`, `medium`, `high`, or `unsupported`), and ask for explicit
59+
confirmation before calling a write tool.
60+
61+
After an approved write, the assistant should show before/after, readback status
62+
where supported, and rollback or `change_id` information. It should then stop
63+
instead of continuing through a cleanup queue.
64+
5165
## Recommended Assistant Behavior
5266

5367
- Prefer diagnosis before mutation.
5468
- Use dry-run mode for broad cleanup or export-readiness work.
55-
- Apply only one approved change or one named rollback unit at a time when risk is non-trivial.
69+
- Apply only one approved reversible change or one named rollback unit per
70+
confirmation.
5671
- Clearly state skipped actions when FL Studio API boundaries prevent safe automation.
5772

5873
## Related Pages
5974

6075
- [Prompts](prompts.md) for practical examples.
76+
- [Default Safe UX](../concepts/default-safe-ux.md) for the risk levels and
77+
response shape.
6178
- [Tool Reference](tool-reference.md) for exact tool names and safety annotations.

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ nav:
3131
- Concepts:
3232
- Architecture: concepts/architecture.md
3333
- Safety Contract: concepts/safety-contract.md
34+
- Default Safe UX: concepts/default-safe-ux.md
3435
- API Capability and Safety Audit: concepts/api-capability-audit.md
3536
- Senior Developer Audit Criteria: concepts/senior-dev-audit-criteria.md
3637
- Engineering:

0 commit comments

Comments
 (0)