Skip to content

Expose trusted config loading and verify hardened phylib compatibility - #1443

Open
rossant wants to merge 2 commits into
masterfrom
fix/phylib-safe-config-compatibility
Open

rossant wants to merge 2 commits into
masterfrom
fix/phylib-safe-config-compatibility

Conversation

@rossant

@rossant rossant commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Phylib's new configuration loader rejects arbitrary Python by default, so trusted legacy params.py files need an explicit execution path through Phy's commands. Add --allow-python-execution to template-gui, template-describe, trace-gui, extract-waveforms, and alf-convert; forward it through model loading, multi-probe merging, and the final conversion reload. The profiling path also preserves this option. There is no automatic retry with Python execution enabled.

Keep existing default behavior with released phylib, while rejecting an explicit execution option on versions without the new API before loading. Older phylib still executes configs by default: the restricted behavior requires the new phylib loader. Document that distinction, source installation, and migration. Pickle-cache errors identify the file and preserve its contents; tests verify the actual cluster-to-spike cache format and that rejected payloads cannot execute or delete the cache.

Testing against the merged phylib also activates its trace-prefetch capabilities and exposed a cleanup error when a native dock had already been deleted. Guard signal disconnection for destroyed docks, cancel the outstanding hint, and detach callbacks. A regression covers cleanup after native deletion, and the dense-controller save/reopen tests verify persisted assignments survive the integration.

Add a focused CI job pinned to merged phylib revision 86216fbd50fbb35a9b17662a452ef6625fcb1439 so the new integration tests run before a package release. The ordinary matrix continues to test the released dependency. Generated API docs use the locked/released environment so the documentation gate remains reproducible.

Validation:

  • Focused config/cache/prefetch and dense-controller save/reopen tests with the pinned hardened phylib: 54 passed.
  • Focused config/cache/prefetch tests with locked released phylib 2.7.1: 31 passed, 5 new-API tests skipped.
  • Ruff lint/format checks, strict documentation checks, and wheel/sdist build pass.
  • Final xvfb-run -a make test-full UV_RUN="uv run --no-sync" with the pinned hardened phylib on Python 3.12: 676 core/script tests and 189 application tests passed (865 total; 19 skipped), exit 0.
  • The hosted hardened-phylib compatibility job, existing SpikeInterface integration job, and documentation job pass on PR head 9236547e82792da08017e21b2df6697a5be94468. The regular cross-platform matrix is still running at handoff.

Release prerequisite: after publishing a phylib version containing cortex-lab/phylib#71 and #72, update Phy's minimum phylib requirement and lockfile before claiming restricted loading for all supported installations. This PR does not invent an unpublished minimum version or publish either package.

@rossant
rossant marked this pull request as ready for review November 26, 2026 19:02
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