Skip to content

Restore indexed libraries safely and enforce PO backup and hardware export integrity - #16

Open
Astro1Deep wants to merge 3 commits into
mainfrom
codex/auditoria-po-20261105
Open

Astro1Deep wants to merge 3 commits into
mainfrom
codex/auditoria-po-20261105

Conversation

@Astro1Deep

Copy link
Copy Markdown
Owner

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.

@sourcery-ai

sourcery-ai Bot commented Nov 5, 2026

Copy link
Copy Markdown

Sorry @Astro1Deep, your pull request is larger than the review limit of 150,000 diff characters

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T23:16:24.686788Z 6343623 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread templates/catalogo.html
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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread serve_mpc.py
Comment on lines +2020 to +2021
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.')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread po_backup_protocols.py
temporary=Path(output.name)
output.write(encoded)
output.flush();os.fsync(output.fileno())
os.replace(temporary,destination)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant