-
Notifications
You must be signed in to change notification settings - Fork 1
feat(workspace): name tonight's first fade plan on the map #1046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
seonghobae
wants to merge
25
commits into
develop
Choose a base branch
from
feat/workspace-first-fade-plan
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
f5c9bee
feat(workspace): name tonight's first fade plan on the map
seonghobae 4c6dd70
fix(ci): wrap fade regression assertion
seonghobae 4ac3d81
test(review): reproduce fade state reset on chord edit
seonghobae ad921ee
style(analysis): apply pinned ruff formatting
seonghobae c5193a3
style(analysis): format extractor source
seonghobae 83997d1
fix(workspace): preserve fade state across chord edits
seonghobae 2cba674
fix(coverage): cover fade energy edge cases
seonghobae 030521b
test(review): reject negative fade RMS ranges
seonghobae 5bbe3e7
fix(review): clamp negative stem RMS boundaries
seonghobae 53c5163
test(review): keep read-only workspace chord editor disabled
seonghobae a7b7458
fix(review): keep read-only chord editor unavailable
seonghobae f135109
style(review): apply Ruff formatting to fade regression
seonghobae ecfe905
style(ci): apply exact Ruff comprehension layout
seonghobae 4d06285
test(workspace): assert read-only chord editor is disabled
seonghobae 0082483
style(analysis): format fade plan tests
seonghobae 7224c45
test(review): reject fade copy without provenance
seonghobae c42407d
test(review): reject native fade copy without provenance
seonghobae c8b5e39
fix(contract): require provenance for fade plan copy
seonghobae 43331fb
fix(workspace): preserve fade plan contract
seonghobae f46c177
test(core): reject out-of-range practice progress
seonghobae 4064405
fix(contract): bound practice progress
seonghobae d50977e
fix(fade): preserve source continuity and project provenance
seonghobae 5c65599
fix(fade): reset identity on external song replacement
seonghobae 08adac5
fix(contract): align fade plan validation
seonghobae c133146
fix(contract): reject control line breaks
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,193 @@ | ||
| use bandscope_desktop_core::project_payload_from_content; | ||
| use serde_json::{json, Value}; | ||
|
|
||
| fn song_with_fade_plan() -> Value { | ||
| json!({ | ||
| "id": "analyzed-song", | ||
| "title": "Late Night Set", | ||
| "sections": [ | ||
| { | ||
| "id": "chorus-1", | ||
| "label": "chorus", | ||
| "groove": "Lifted chorus downbeat", | ||
| "timeRange": { "start": 30, "end": 46 }, | ||
| "confidence": { | ||
| "level": "high", | ||
| "source": "model", | ||
| "notes": "Stem energy corroborates the fade." | ||
| }, | ||
| "roles": [ | ||
| { | ||
| "id": "lead-vocal", | ||
| "name": "Lead Vocal", | ||
| "roleType": "vocal", | ||
| "harmony": { | ||
| "chord": "C#m7", | ||
| "functionLabel": "vi landing", | ||
| "source": "model" | ||
| }, | ||
| "harmonicExplanation": "The landing keeps the tonal floor clear.", | ||
| "cue": { | ||
| "kind": "transition", | ||
| "value": "Let the next downbeat land quieter." | ||
| }, | ||
| "range": { | ||
| "lowestNote": "G#3", | ||
| "highestNote": "C#5" | ||
| }, | ||
| "confidence": { | ||
| "level": "high", | ||
| "source": "model", | ||
| "notes": "Vocal stays while the level comes down." | ||
| }, | ||
| "rehearsalPriority": "high", | ||
| "simplification": "Hold the landing syllable.", | ||
| "setupNote": "Keep the attack short.", | ||
| "transpositionPlan": "Keep the landing shape a whole step lower if needed.", | ||
| "manualOverrides": [], | ||
| "overlapWarnings": [], | ||
| "transcription": [{ | ||
| "pitch": "C#4", | ||
| "onset": 1.0, | ||
| "offset": 1.5, | ||
| "velocity": 0.8 | ||
| }], | ||
| "practiceProgress": 50, | ||
| "fadePlan": "Fade this part; let the next downbeat land quieter.", | ||
| "fadePlanSource": "model" | ||
| } | ||
| ], | ||
| "partGraph": [ | ||
| { | ||
| "role_id": "lead-vocal", | ||
| "is_active": true, | ||
| "handoff_to": [], | ||
| "handoff_from": [] | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "exportSummary": { | ||
| "format": "cue-sheet", | ||
| "headline": "Let the chorus fade together.", | ||
| "focusSections": ["chorus-1"] | ||
| } | ||
| }) | ||
| } | ||
|
|
||
| #[test] | ||
| fn project_contract_round_trips_fade_plan_provenance() { | ||
| let payload = song_with_fade_plan(); | ||
| let content = serde_json::to_string(&payload).expect("fixture should serialize"); | ||
|
|
||
| let parsed = project_payload_from_content(&content) | ||
| .expect("native project contract must accept shared fade-plan fields"); | ||
| let serialized = | ||
| serde_json::to_value(parsed).expect("native project contract should serialize"); | ||
|
|
||
| assert_eq!( | ||
| serialized["sections"][0]["roles"][0]["fadePlan"], | ||
| payload["sections"][0]["roles"][0]["fadePlan"] | ||
| ); | ||
| assert_eq!( | ||
| serialized["sections"][0]["roles"][0]["fadePlanSource"], | ||
| json!("model") | ||
| ); | ||
| } | ||
|
|
||
| #[test] | ||
| fn project_contract_rejects_fade_plan_source_without_fade_plan() { | ||
| let mut payload = song_with_fade_plan(); | ||
| payload["sections"][0]["roles"][0] | ||
| .as_object_mut() | ||
| .expect("role fixture should be an object") | ||
| .remove("fadePlan"); | ||
| let content = serde_json::to_string(&payload).expect("fixture should serialize"); | ||
|
|
||
| assert!( | ||
| project_payload_from_content(&content).is_err(), | ||
| "native persisted contract must reject provenance without the value it describes" | ||
| ); | ||
| } | ||
|
|
||
| #[test] | ||
| fn project_contract_rejects_fade_plan_without_source() { | ||
| let mut payload = song_with_fade_plan(); | ||
| payload["sections"][0]["roles"][0] | ||
| .as_object_mut() | ||
| .expect("role fixture should be an object") | ||
| .remove("fadePlanSource"); | ||
| let content = serde_json::to_string(&payload).expect("fixture should serialize"); | ||
|
|
||
| assert!( | ||
| project_payload_from_content(&content).is_err(), | ||
| "native persisted contract must reject fade-plan copy without provenance" | ||
| ); | ||
| } | ||
|
|
||
| #[test] | ||
| fn project_contract_rejects_invalid_fade_plan_copy_with_source() { | ||
| for fade_plan in [ | ||
| "", | ||
| " ", | ||
| "\u{00A0}\u{2003}\u{3000}", | ||
| "fade here\nthen hold", | ||
| "fade here\rthen hold", | ||
| "fade here\u{000B}then hold", | ||
| "fade here\u{000C}then hold", | ||
| "fade here\u{0085}then hold", | ||
| "fade here\u{2028}then hold", | ||
| "fade here\u{2029}then hold", | ||
| ] { | ||
| let mut payload = song_with_fade_plan(); | ||
| payload["sections"][0]["roles"][0]["fadePlan"] = json!(fade_plan); | ||
| let content = serde_json::to_string(&payload).expect("fixture should serialize"); | ||
|
|
||
| assert!( | ||
| project_payload_from_content(&content).is_err(), | ||
| "native persisted contract must reject blank or multiline sourced fade-plan copy" | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| #[test] | ||
| fn project_contract_rejects_unknown_fade_plan_source() { | ||
| let mut payload = song_with_fade_plan(); | ||
| payload["sections"][0]["roles"][0]["fadePlanSource"] = json!("legacy"); | ||
| let content = serde_json::to_string(&payload).expect("fixture should serialize"); | ||
|
|
||
| assert!( | ||
| project_payload_from_content(&content).is_err(), | ||
| "native persisted contract must reject provenance outside model/user" | ||
| ); | ||
| } | ||
|
|
||
| #[test] | ||
| fn project_contract_preserves_padded_single_line_fade_copy() { | ||
| let mut payload = song_with_fade_plan(); | ||
| payload["sections"][0]["roles"][0]["fadePlan"] = json!(" Fade together. \u{00A0}"); | ||
| payload["sections"][0]["roles"][0]["fadePlanSource"] = json!("user"); | ||
| let content = serde_json::to_string(&payload).expect("fixture should serialize"); | ||
|
|
||
| let parsed = project_payload_from_content(&content) | ||
| .expect("native persisted contract must preserve padded single-line copy"); | ||
| let serialized = | ||
| serde_json::to_value(parsed).expect("native project contract should serialize"); | ||
|
|
||
| assert_eq!( | ||
| serialized["sections"][0]["roles"][0]["fadePlan"], | ||
| payload["sections"][0]["roles"][0]["fadePlan"] | ||
| ); | ||
| } | ||
|
|
||
| #[test] | ||
| fn project_contract_rejects_practice_progress_above_shared_bound() { | ||
| let mut payload = song_with_fade_plan(); | ||
| payload["sections"][0]["roles"][0]["practiceProgress"] = json!(101); | ||
| let content = serde_json::to_string(&payload).expect("fixture should serialize"); | ||
|
|
||
| assert!( | ||
| project_payload_from_content(&content).is_err(), | ||
| "native persisted contract must reject practiceProgress above the shared 0..=100 bound" | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.