Commit 834b027
committed
feat: add reproducible env state engine, lock sync, and self-healing rebuilds
This commit introduces Omnipkg’s first full reproducibility and environment
recovery layer.
Design note:
The canonical lock state is the true environment identity.
The local `.omnipkg/omnipkg.lock` is only a local attachment / envelope.
This commit establishes the first working implementation of that model.
Core additions:
- Added `8pkg export` to snapshot a full multi-interpreter environment into a
canonical TOML lock state.
- Added `8pkg sync` to restore, rebuild, and reconcile environments from those
lock states.
- Added machine-global canonical lock registry under
`~/.config/omnipkg/locks/states` for deduplicated known-good env identities.
- Added privacy-scrubbed / path-agnostic lock metadata so exported states can
be reused across machines without leaking local filesystem details.
Healing / recovery:
- Added rebuild-oriented sync flow for recovering from broken or nuked envs.
- Added metadata repair / “Phase 0 Heal” behavior to recover missing or corrupt
package metadata before hard failure.
- Added stronger snapshot + last-known-good behavior around package operations.
- Improved interpreter adoption / recovery flow, including managed Python
bootstrap repair paths.
Execution / runtime hardening:
- Replaced fragile mtime dispatcher invalidation with content hashing.
- Improved executable / dispatcher propagation across adopted interpreters.
- Hardened re-exec flow to use `-m omnipkg.cli` and avoid broken editable shim
edge cases.
- Improved binary-only package handling for validation / verification logic.
Daemon / worker stability:
- Hardened daemon shutdown and orphan cleanup behavior.
- Improved worker IPC reliability by bypassing redirected stdout boundaries.
- Reduced failure modes around long-running background worker management.
Python 3.7 / legacy editable install fixes:
- Fixed sync false-positive behavior caused by legacy egg-link installs from
older pip bootstrap flows.
- Detects legacy `omnipkg.egg-link` installs as requiring sync.
- Cleans stale egg-link / easy-install.pth artifacts after successful sync so
Python 3.7 contexts do not resync forever.
This is the foundational commit for:
- reproducible rebuilds
- lock-driven recovery
- canonical env identity
- future orphan-state recovery / tombstoning
- future compatibility scoring / proven-build telemetry
- future container / template generation from known-good states
New files:
• src/omnipkg/integration/reproducible.py (2385 lines)
Modified:
• src/omnipkg/cli.py (+113/-13 lines)
• src/omnipkg/common_utils.py (+33/-8 lines)
• src/omnipkg/core.py (+504/-196 lines)
• src/omnipkg/dispatcher.c (+220/-4 lines)
• src/omnipkg/dispatcher.py (+255/-89 lines)
• src/omnipkg/installation/verification_strategy.py (+40/-23 lines)
• src/omnipkg/integration/reproducible.py (+2385/-0 lines)
• src/omnipkg/isolation/worker_daemon.py (+189/-37 lines)
• src/omnipkg/package_meta_builder.py (+22/-9 lines)
• pyproject.toml (+1/-1 lines)
• setup.py (+12/-3 lines)
[gitship-generated]1 parent 7c3de5e commit 834b027
11 files changed
Lines changed: 3748 additions & 357 deletions
File tree
- src/omnipkg
- installation
- integration
- isolation
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
50 | 55 | | |
51 | 56 | | |
52 | 57 | | |
| |||
106 | 111 | | |
107 | 112 | | |
108 | 113 | | |
| 114 | + | |
| 115 | + | |
109 | 116 | | |
110 | 117 | | |
111 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
112 | 121 | | |
113 | 122 | | |
114 | 123 | | |
115 | 124 | | |
116 | 125 | | |
117 | 126 | | |
118 | | - | |
| 127 | + | |
119 | 128 | | |
120 | 129 | | |
121 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
580 | 580 | | |
581 | 581 | | |
582 | 582 | | |
583 | | - | |
584 | 583 | | |
585 | | - | |
586 | | - | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
587 | 589 | | |
588 | 590 | | |
589 | 591 | | |
590 | 592 | | |
591 | 593 | | |
592 | 594 | | |
593 | | - | |
594 | | - | |
595 | | - | |
| 595 | + | |
| 596 | + | |
596 | 597 | | |
597 | 598 | | |
598 | 599 | | |
| |||
1018 | 1019 | | |
1019 | 1020 | | |
1020 | 1021 | | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
1021 | 1027 | | |
1022 | 1028 | | |
1023 | 1029 | | |
| |||
1203 | 1209 | | |
1204 | 1210 | | |
1205 | 1211 | | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
1206 | 1289 | | |
1207 | 1290 | | |
1208 | 1291 | | |
| |||
1234 | 1317 | | |
1235 | 1318 | | |
1236 | 1319 | | |
1237 | | - | |
1238 | 1320 | | |
1239 | 1321 | | |
1240 | 1322 | | |
| |||
1319 | 1401 | | |
1320 | 1402 | | |
1321 | 1403 | | |
1322 | | - | |
1323 | | - | |
1324 | | - | |
1325 | 1404 | | |
1326 | 1405 | | |
1327 | 1406 | | |
1328 | 1407 | | |
1329 | 1408 | | |
1330 | 1409 | | |
1331 | 1410 | | |
1332 | | - | |
| 1411 | + | |
1333 | 1412 | | |
1334 | 1413 | | |
1335 | 1414 | | |
1336 | 1415 | | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
1337 | 1420 | | |
1338 | 1421 | | |
1339 | 1422 | | |
| |||
1477 | 1560 | | |
1478 | 1561 | | |
1479 | 1562 | | |
1480 | | - | |
1481 | | - | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
1482 | 1582 | | |
1483 | 1583 | | |
1484 | 1584 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
736 | 736 | | |
737 | 737 | | |
738 | 738 | | |
739 | | - | |
740 | | - | |
741 | | - | |
742 | | - | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | | - | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
747 | 742 | | |
748 | 743 | | |
749 | 744 | | |
| |||
854 | 849 | | |
855 | 850 | | |
856 | 851 | | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
857 | 882 | | |
858 | 883 | | |
859 | 884 | | |
| |||
0 commit comments