fix: bind release receipts and external export ownership

This commit is contained in:
阿白叔 committed 2026-11-16 17:53:58 +08:00
1 parent b070837acb
commit 0440b2efbf
6 files changed
+262 -12

No files matched your search

@@ -96,3 +96,19 @@ Actual summary: `409 passed in 86.98s (0:01:26)`; exit code 0. `git diff --check
- Native inspection runs through the existing independent inspection-only supervisor and is never killed by the pure file-probe timeout. Its diagnostics use retained local temporary directories; complete native result records are also embedded in release evidence. Native tool behavior, native close timing, and on-site reproduction remain unverified here.
- Ambiguous/shared addresses without an exact unique PRJ-to-database mapping remain protected for manual investigation. No address age, unreachable endpoint, process absence alone, or metadata PID is accepted as ownership/release authority.
- No automatic Repair or automatic whole-library backup was added. Full application cancellation/batch/shutdown policy and UI use of the added fields belong to subsequent tasks. Frozen packaging was covered by existing packaging tests and static helper dispatch import, not a new EXE build.
## Review fix round 1
Read the independent review in full; both P1 findings were reproduced before source changes. Fixes are ready for scoped re-review; this report does not claim review acceptance. No public signatures changed and the data-damage-not-occupancy ruling remains unchanged.
1. **Scoped durable release receipts:** added `_proof_covers_session` at the common receipt writer and the durable discovery trust point. A completed/observed proof must match the exact library; a BLOCK/BLOCKS proof must cover the journal's block and have matching observed block membership. The existing operation-ID comparison still prevents a replaced operation receiving an old receipt. Full-library proof remains supported. Single- and multi-block regressions prove an unselected B journal receives no receipt and remains discoverable after clearing memory; additional discovery regressions reject erroneous receipts created by the prior implementation. This fixes the backend sink, rather than filtering UI rows.
2. **Unknown checkpoint external exports:** outside-library command paths alone no longer exclude an exporter/server. The independent `export-owner.json` must identify the exact copy root/project and a valid owner library/lease/token, and export process evidence must match the current full process snapshot's PID, creation time and executable. Missing association, missing identity, or stale identity stays unknown and blocks release; an associated copy remains protected. A proven different-library copy is allowed. Tests obtain owner records through the real `begin_export_analysis`, simulate interpreter restart, and cover both exporter and server descendant. Their PRJ CentralLibrary deliberately points to a different library than the export owner, proving that PRJ reference is not used as ownership authority. The old arbitrary `Other/database` fixture was corrected to expect unknown/protected, not treated as independent ownership evidence.
Red/green commands (the same absolute-import runner is used throughout):
- `python -X utf8 .superpowers/sdd/2026-11-16-issue15-runtime-unblock/run_tests.py -q tests/test_issue15_release_receipts.py` → **4 failed, 1 passed in 1.82 s** before the fix. Subsequent receipt/session/review covering run → **49 passed in 7.92 s**.
- `python -X utf8 .superpowers/sdd/2026-11-16-issue15-runtime-unblock/run_tests.py -q tests/test_issue15_unknown_exports.py tests/test_issue15_resource_release.py -k export` → **5 failed, 2 passed, 21 deselected in 3.93 s** before the fix; → **7 passed, 21 deselected in 3.63 s** after the fix.
- Final covering run repeats the 22 original modules plus `test_issue15_release_receipts.py` and `test_issue15_unknown_exports.py`, with `--junitxml=.superpowers/sdd/2026-11-16-issue15-runtime-unblock/task-1-round1-tests.xml`. Exact command and output are in `task-1-round1-tests.log`: **420 passed in 94.43 s (0:01:34)**, exit code 0, no skipped tests.
- `python -X utf8 -m compileall -q src/cbb_refresh_verify/session_record.py src/cbb_refresh_verify/native_export_guard.py tests/test_issue15_release_receipts.py tests/test_issue15_unknown_exports.py tests/test_issue15_resource_release.py` and `git diff --check` passed.
Process evidence is mocked only at the native snapshot boundary; tests do not launch Mentor. Unknown-copy association uses `_process_snapshot` (full `created`/image evidence), not the abbreviated `query_owners` rows. Incomplete runtime identity therefore remains unknown. The previously documented synchronous checkpoint/export-evidence deadline/handoff requirement remains assigned to Task 2/4. No lifecycle, UI, queue, or native worker expansion was included in this fix round.