Repository navigation
Restore indexed libraries safely and enforce PO backup and hardware export integrity - #16
Astro1Deep wants to merge 3 commits into
Conversation
|
Sorry @Astro1Deep, your pull request is larger than the review limit of 150,000 diff characters |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 63436230f7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| volume: RACK_PADS[i].volume ?? 0.707946, | ||
| pan: RACK_PADS[i].pan ?? 0.5, | ||
| tune: RACK_PADS[i].tune ?? 0 | ||
| pad: b * (epProfile ? 12 : 16) + i + 1, |
There was a problem hiding this comment.
Keep EP-specific numbering out of MPC expansion payloads
When EP-133 is selected in the rack, creating an MPC expansion with “include rack” now moves samples to different pads: bank B pad 1 is serialized as pad 13 rather than 17. createOfficialMpcExpansion() also uses this shared helper, and create_mpc_expansion() passes those IDs directly to export_mpc_program(), so the resulting MPC program places B1 on A13 (and similarly shifts subsequent banks). Apply dense 12-key numbering only when the actual export destination is EP-133, preserving 16-pad bank addressing for MPC expansion creation. The same change is present in the checked-in catalogue.
Useful? React with 👍 / 👎.
| if restore_empty_catalog(target_root, Path(script_dir) / 'templates/catalogo.html'): | ||
| emit('Recovered the empty catalog from the existing index; audio and database were preserved.') |
There was a problem hiding this comment.
Allow server startup when catalogue recovery is rejected
If a blank catalogue accompanies an out-of-sync database and JSON metadata, this unconditional recovery call raises before the HTTP server starts. This can occur after an interrupted index: index_mpc_library.main() commits SQLite before writing the JSON and catalogue. Previously the server could still launch, allowing the user to reindex through the UI; now both the catalogue and that recovery action are unavailable. Catch recovery validation/read errors here, report that recovery was skipped, and continue serving without replacing the existing files.
Useful? React with 👍 / 👎.
| temporary=Path(output.name) | ||
| output.write(encoded) | ||
| output.flush();os.fsync(output.fileno()) | ||
| os.replace(temporary,destination) |
There was a problem hiding this comment.
Publish sidecars without replacing concurrent metadata
When two BeatOS processes classify the same legacy WAV concurrently—for example, servers started on different ports against the same library—both can pass the existence check because _SIDECAR_LOCK only protects threads within one process. os.replace() then silently overwrites whichever model/project metadata was published first, while both callers report success. This regresses the previous exclusive open('xb') behavior and loses the conflicting project's provenance. Publish the completed temporary file with an atomic no-replace operation and validate the existing metadata if another writer wins.
Useful? React with 👍 / 👎.
BeatOS could show an empty catalogue over an existing populated index after a volume rename, while reporting an unavailable root as online. Recover blank catalogues from matching existing SQLite/JSON data without reindexing, and report the actual root availability.
Close the opaque-Origin CORS bypass; direct file previews remain offline. Publish backup metadata atomically, reject forged verification flags, detect changes during decoder checks, and bind restore/download requests to the inventoried SHA-256 before streaming any audio. Preserve the original WAV bytes.
Enforce EP-133's 48 destinations and SP-404A/SX's 12 pads per bank. Keep modern MPC universal exports within 128 pads, warn about target-specific omissions, skip empty unsupported deliveries, and stop hidden or reserved rack cells being silently discarded. Add the bank-loading suite to CI.
Validation: 118 Python tests, six JavaScript suites, actual Chrome EN→ES→EN checks on generated and checked-in routes, and a clean ZIP installation/HTTP/MPC round trip on macOS ARM64. An existing recording also passed the independent PO-33 packet CRC/end-marker/structure verifier without modifying its bytes. Physical restoration and native project editing are not certified. Windows verification runs in CI.
README and verification notes distinguish development source from the unchanged v3.8.0 stable download. No new stable release or personal library data is published.