fix: address PR27 lifecycle, BOM and netlist review findings
Core regression / Python core, intervention UI and release configuration (push) Failing after 4m4s
Core regression / JavaScript syntax (push) Successful in 5s
Core regression / Python core, intervention UI and release configuration (pull_request) Failing after 4m20s
Core regression / JavaScript syntax (pull_request) Successful in 4s

This commit is contained in:
阿白叔 committed 2026-11-13 16:03:59 +08:00
1 parent 0ee83e77e2
commit f9d5e56bb8
58 files changed
+20646 -164

No files matched your search

+5 -4
View File
@@ -126,10 +126,11 @@ def test_receipt_enrichment_failure_does_not_erase_executor_result(ui, monkeypat
return original(self, run_id, receipt)
monkeypatch.setattr(RunJournal, 'finish', fail_enrichment)
ids = [ui.tasks[0].task_id]
receipt = execute_confirmed_run(ui.service, ui.data, ids, api.preflight(ui.service, ids), Event(), 'f' * 32)
assert receipt['status'] == 'completed'
assert receipt['reporting_errors'][0]['code'] == 'receipt_enrichment_unavailable'
assert RunJournal(ui.data).get('f' * 32)['result']['entries'][0]['state'] == 'completed'
with pytest.raises(OSError, match='controlled enrichment persistence failure'):
execute_confirmed_run(ui.service, ui.data, ids, api.preflight(ui.service, ids), Event(), 'f' * 32)
receipt = RunJournal(ui.data).get('f' * 32)['result']
assert receipt['status'] == receipt['execution_status'] == 'completed'
assert receipt['entries'][0]['state'] == 'completed'
def test_live_owner_and_saved_counts_do_not_follow_selected_task(ui, monkeypatch, qtbot):
@@ -0,0 +1,79 @@
"""A modal confirmation must not reserve a lane that another operation owns."""
from types import SimpleNamespace
import pytest
from dx_productivity.trial_task_center.stop_control import StopControl
@pytest.mark.parametrize('batch', [False, True])
@pytest.mark.parametrize('change', ['worker', 'stop', 'closing', 'task', 'dirty', 'dialog'])
def test_confirmation_rechecks_admission_before_authorizing_or_replacing_controls(ui, monkeypatch, batch, change):
window = ui.window
ui.settle()
submitted = []
monkeypatch.setattr(window, '_run_async', lambda *args, **kwargs: submitted.append(args))
original_task = window._task_id
original_authorization = set(window._dsh_authorized_tasks)
original_dialog = window._dsh_operations.dialog
original_dirty = window.plan_panel.table.dirty
live_stop = StopControl()
live_worker = object()
live_run = {'active': True, 'run_id': 'already-running', 'task_id': 'other-owner'}
def confirm(*_):
if change in {'worker', 'stop'}:
window._batch_stop = live_stop
window._dsh_run_stop = live_stop
window._dsh_live_run = live_run
if change == 'worker':
window._workers.add(live_worker)
elif change == 'closing':
window._close_pending = True
elif change == 'task':
window._task_id = ui.tasks[1].task_id
elif change == 'dirty':
window.plan_panel.table.dirty = True
else:
window._dsh_operations.dialog = SimpleNamespace()
return True
window._quick_run_confirmer = confirm
try:
(window._execute_project_tasks if batch else window._prepare_quick_run)()
assert not submitted, 'stale confirmation must not submit another execution'
assert window._dsh_authorized_tasks == original_authorization
assert '未启动' in window.run_panel.operator_band.text()
if change in {'worker', 'stop'}:
assert window._batch_stop is live_stop
assert window._dsh_run_stop is live_stop
assert window._dsh_live_run is live_run
finally:
window._workers.discard(live_worker)
window._close_pending = False
window._task_id = original_task
window._dsh_operations.dialog = original_dialog
window.plan_panel.table.dirty = original_dirty
window._finish_run()
@pytest.mark.parametrize('batch', [False, True])
def test_idle_confirmation_still_starts_execution_while_read_query_is_busy(ui, monkeypatch, batch):
window = ui.window
ui.settle()
submitted = []
monkeypatch.setattr(window, '_run_async', lambda *args, **kwargs: submitted.append(args))
original_query = window._feedback_query
window._quick_run_confirmer = lambda *_: True
# A background read is not the mutation/execution lane.
window._feedback_query = SimpleNamespace(busy=True, invalidate=lambda: None)
try:
(window._execute_project_tasks if batch else window._prepare_quick_run)()
assert len(submitted) == 1
assert isinstance(window._batch_stop, StopControl)
assert ui.tasks[0].task_id in window._dsh_authorized_tasks
assert not ui.calls # The submitted executor is controlled, with no CAD.
finally:
window._finish_run()
window._feedback_query = original_query