← Về thư mục
tests/test_gateway_engine.py
- _Hub · class · L29-L42 — class _Hub
- init · method · L30-L31 — def init(self) -> None
- emitter · method · L33-L38 — def emitter(self, root_frame_id: str)
- emit · function · L34-L36 — def emit(event: dict) -> None
- broadcast · method · L40-L42 — def broadcast(self, root_frame_id: str, event: dict) -> None
- _cfg · function · L45-L51 — def _cfg(tmp_path, *, max_turns: int = 3, stage1: bool = False) -> Config
- _native_call · function · L54-L70 — def _native_call( call_id: str, name: str, arguments: dict, *, ordinal: int = 0, ) -> dict
- _native_reply · function · L73-L87 — def _native_reply(content: str, calls: list[dict]) -> tuple[dict, dict]
- _prepare_message_runner · function · L90-L104 — def _prepare_message_runner(monkeypatch, tmp_path, dispatcher)
- ensure_runtime · function · L97-L100 — def ensure_runtime(state)
- test_native_file_control_calls_create_versioned_artifacts · function · L107-L151 — def test_native_file_control_calls_create_versioned_artifacts(tmp_path)
- write_first · function · L114-L116 — def write_first()
- write_second · function · L118-L120 — def write_second()
- test_trusted_native_write_fails_with_retry_veto_when_capture_fails · function · L154-L187 — def test_trusted_native_write_fails_with_retry_veto_when_capture_fails( tmp_path, monkeypatch )
- write_file · function · L162-L164 — def write_file()
- test_delegated_child_write_is_never_recaptured_as_parent_production · function · L191-L312 — def test_delegated_child_write_is_never_recaptured_as_parent_production( tmp_path, monkeypatch, explicit_save )
- fake_chat · function · L208-L234 — def fake_chat(messages, cfg, **kwargs)
- test_delegated_native_write_is_captured_under_the_child_frame · function · L315-L421 — def test_delegated_native_write_is_captured_under_the_child_frame( tmp_path, monkeypatch )
- fake_chat · function · L325-L356 — def fake_chat(messages, cfg, **kwargs)
- test_trusted_delegation_refuses_an_active_root_background_writer · function · L424-L457 — def test_trusted_delegation_refuses_an_active_root_background_writer( tmp_path, monkeypatch )
- test_trusted_delegation_holds_capture_lease_against_background_launch · function · L460-L502 — def test_trusted_delegation_holds_capture_lease_against_background_launch( tmp_path, monkeypatch )
- child_run · function · L469-L479 — def child_run(self, task)
- spawn_kernel · function · L488-L491 — def spawn_kernel()
- test_trusted_foreground_cells_and_repl_refuse_active_background_before_identity · function · L505-L531 — def test_trusted_foreground_cells_and_repl_refuse_active_background_before_identity( tmp_path, )
- test_trusted_native_writer_refuses_active_background_before_side_effect · function · L534-L561 — def test_trusted_native_writer_refuses_active_background_before_side_effect(tmp_path)
- write_file · function · L541-L545 — def write_file()
- test_background_launch_during_trusted_capture_refuses_before_kernel_spawn · function · L564-L590 — def test_background_launch_during_trusted_capture_refuses_before_kernel_spawn( tmp_path, )
- spawn_kernel · function · L576-L579 — def spawn_kernel()
- test_trusted_capture_is_reentrant_only_for_its_owner_thread · function · L593-L625 — def test_trusted_capture_is_reentrant_only_for_its_owner_thread(tmp_path)
- hold_capture · function · L603-L610 — def hold_capture() -> None
- _external_mutation_snapshot · function · L628-L651 — def _external_mutation_snapshot(runner, state, hub) -> dict
- files_under · function · L635-L642 — def files_under(root: Path) -> list[tuple[str, bytes]]
- test_external_artifact_mutations_refuse_active_workspace_writers_without_delta · function · L659-L733 — def test_external_artifact_mutations_refuse_active_workspace_writers_without_delta( tmp_path, mutation, blocking_lease, )
- invoke · function · L680-L720 — def invoke() -> None
- test_external_upload_resolves_child_frame_to_root_capture_gate · function · L736-L762 — def test_external_upload_resolves_child_frame_to_root_capture_gate(tmp_path)
- test_external_mutation_refuses_an_active_pure_turn_before_calling_manager · function · L765-L796 — def test_external_mutation_refuses_an_active_pure_turn_before_calling_manager( tmp_path, monkeypatch, )
- must_not_upload · function · L774-L778 — def must_not_upload(args, *kwargs)
- test_external_edit_restore_gate_is_always_on_when_stage1_is_disabled · function · L801-L856 — def test_external_edit_restore_gate_is_always_on_when_stage1_is_disabled( tmp_path, monkeypatch, blocking_writer, mutation, )
- must_not_mutate · function · L824-L828 — def must_not_mutate(args, *kwargs)
- invoke · function · L832-L840 — def invoke() -> None
- test_frameless_project_mutation_barrier_is_always_on_when_stage1_is_disabled · function · L859-L888 — def test_frameless_project_mutation_barrier_is_always_on_when_stage1_is_disabled( tmp_path, monkeypatch, )
- compatible_upload · function · L866-L869 — def compatible_upload(payload, *, broadcast=None)
- test_unknown_producer_is_refused_when_stage1_is_disabled · function · L891-L918 — def test_unknown_producer_is_refused_when_stage1_is_disabled( tmp_path, monkeypatch, )
- compatible_upload · function · L898-L901 — def compatible_upload(payload, *, broadcast=None)
- test_external_mutation_lease_spans_durable_write_through_final_event · function · L921-L975 — def test_external_mutation_lease_spans_durable_write_through_final_event(tmp_path)
- BlockingHub · class · L922-L933 — class BlockingHub(_Hub)
- init · method · L923-L926 — def init(self) -> None
- broadcast · method · L928-L933 — def broadcast(self, root_frame_id: str, event: dict) -> None
- upload · function · L941-L951 — def upload() -> None
- test_datapro_link_failure_compensates_under_one_external_mutation · function · L978-L1029 — def test_datapro_link_failure_compensates_under_one_external_mutation( tmp_path, monkeypatch, )
- fail_link · function · L988-L995 — def fail_link(batch_id, artifact_id)
- test_datapro_composite_publishes_one_event_after_success · function · L1032-L1066 — def test_datapro_composite_publishes_one_event_after_success(tmp_path)
- test_datapro_composite_preserves_flag_off_immediate_event_sequence · function · L1069-L1111 — def test_datapro_composite_preserves_flag_off_immediate_event_sequence( tmp_path, monkeypatch, )
- fail_link · function · L1087-L1089 — def fail_link(batch_id, artifact_id)
- test_session_domain_mutation_refuses_active_background_before_side_effect · function · L1114-L1139 — def test_session_domain_mutation_refuses_active_background_before_side_effect( tmp_path, )
- must_not_mutate · function · L1122-L1125 — def must_not_mutate()
- test_recovery_action_refuses_active_background_before_runtime_preparation · function · L1142-L1169 — def test_recovery_action_refuses_active_background_before_runtime_preparation( tmp_path, monkeypatch, )
- must_not_build_runtime · function · L1151-L1155 — def must_not_build_runtime(args, *kwargs)
- test_successful_restore_clears_revert_barrier_after_runtime_publication · function · L1172-L1226 — def test_successful_restore_clears_revert_barrier_after_runtime_publication( tmp_path, monkeypatch )
- Runtime · class · L1192-L1203 — class Runtime
- run · method · L1193-L1195 — def run(self, _plan)
- kernel_status_event · method · L1197-L1203 — def kernel_status_event(self, result, recovery_id)
- test_first_write_guard_reconciles_committed_revert_after_restart · function · L1229-L1257 — def test_first_write_guard_reconciles_committed_revert_after_restart(tmp_path)
- test_first_write_guard_fails_closed_for_corrupt_empty_revert_marker · function · L1260-L1279 — def test_first_write_guard_fails_closed_for_corrupt_empty_revert_marker( tmp_path, monkeypatch )
- test_first_write_guard_never_reconciles_an_active_revert_owner · function · L1282-L1320 — def test_first_write_guard_never_reconciles_an_active_revert_owner( tmp_path, monkeypatch )
- must_not_reconcile · function · L1300-L1303 — def must_not_reconcile(_root)
- test_branch_activation_refuses_active_background_before_materialization · function · L1323-L1351 — def test_branch_activation_refuses_active_background_before_materialization( tmp_path, monkeypatch, )
- must_not_prepare · function · L1332-L1336 — def must_not_prepare(args, *kwargs)
- test_external_mutation_refuses_activation_after_candidate_publication · function · L1354-L1450 — def test_external_mutation_refuses_activation_after_candidate_publication( tmp_path, monkeypatch, )
- hold_after_publication · function · L1398-L1403 — def hold_after_publication(state) -> None
- activate · function · L1407-L1411 — def activate() -> None
- must_not_upload · function · L1426-L1430 — def must_not_upload(args, *kwargs)
- test_deletion_tombstone_refuses_mutation_after_runtime_is_popped · function · L1455-L1526 — def test_deletion_tombstone_refuses_mutation_after_runtime_is_popped( tmp_path, monkeypatch, delete_kind, stage1, )
- block_after_runtime_pop · function · L1474-L1479 — def block_after_runtime_pop(root_frame_id)
- must_not_upload · function · L1481-L1485 — def must_not_upload(args, *kwargs)
- delete · function · L1494-L1501 — def delete() -> None
- test_detached_state_aba_cannot_write_after_deletion_finishes · function · L1531-L1603 — def test_detached_state_aba_cannot_write_after_deletion_finishes( tmp_path, monkeypatch, delete_kind, stage1, )
- delayed_state · function · L1551-L1556 — def delayed_state(args, *kwargs)
- must_not_upload · function · L1558-L1562 — def must_not_upload(args, *kwargs)
- mutate · function · L1567-L1577 — def mutate() -> None
- test_project_deletion_waits_for_frameless_mutation_and_refuses_late_entry · function · L1607-L1690 — def test_project_deletion_waits_for_frameless_mutation_and_refuses_late_entry( tmp_path, monkeypatch, stage1, )
- blocking_upload · function · L1622-L1630 — def blocking_upload(payload, *, broadcast=None)
- mutate · function · L1634-L1644 — def mutate() -> None
- delete · function · L1646-L1650 — def delete() -> None
- test_project_deletion_keeps_a_frameless_path_still_referenced_elsewhere · function · L1693-L1724 — def test_project_deletion_keeps_a_frameless_path_still_referenced_elsewhere( tmp_path, )
- test_project_delete_cleanup_window_refuses_cross_project_same_name_upload · function · L1727-L1804 — def test_project_delete_cleanup_window_refuses_cross_project_same_name_upload( tmp_path, monkeypatch, )
- blocked_cleanup · function · L1748-L1752 — def blocked_cleanup(result, **kwargs)
- observe_upload · function · L1756-L1759 — def observe_upload(payload, *, broadcast=None)
- delete · function · L1764-L1768 — def delete() -> None
- test_upload_cleanup_refuses_a_symlinked_root_swap · function · L1807-L1853 — def test_upload_cleanup_refuses_a_symlinked_root_swap( tmp_path, monkeypatch, )
- swap_before_open · function · L1831-L1843 — def swap_before_open(path, flags, mode=0o777, *, dir_fd=None)
- test_flag_off_project_delete_cleans_frameless_file · function · L1856-L1873 — def test_flag_off_project_delete_cleans_frameless_file(tmp_path)
- test_session_delete_never_unlinks_an_uploads_path_without_global_barrier · function · L1876-L1898 — def test_session_delete_never_unlinks_an_uploads_path_without_global_barrier( tmp_path, )
- test_web_native_schema_history_and_cell_only_completion · function · L1901-L1970 — def test_web_native_schema_history_and_cell_only_completion(monkeypatch, tmp_path)
- Dispatcher · class · L1902-L1911 — class Dispatcher
- init · method · L1903-L1906 — def init(self) -> None
- call · method · L1908-L1911 — def call(self, method, args)
- fake_chat · function · L1920-L1944 — def fake_chat(messages, cfg, on_delta=None, **kwargs)
- fake_execute · function · L1946-L1952 — def fake_execute(state, code, origin, emit, stream=True, language="python")
- test_cancel_after_llm_reply_prevents_returned_cell · function · L1973-L2010 — def test_cancel_after_llm_reply_prevents_returned_cell(monkeypatch, tmp_path)
- fake_chat · function · L1978-L1985 — def fake_chat(messages, cfg, on_delta=None, **kwargs)
- unexpected_execute · function · L1987-L1988 — def unexpected_execute(args, *kwargs)
- _stored_metadata · function · L2013-L2015 — def _stored_metadata(message: dict) -> dict
- test_stopped_cell_turn_stores_and_streams_a_marker_after_narration · function · L2031-L2093 — def test_stopped_cell_turn_stores_and_streams_a_marker_after_narration( monkeypatch, tmp_path, request_text, budget, marker, reason )
- fake_chat · function · L2046-L2048 — def fake_chat(messages, cfg, on_delta=None, **kwargs)
- stopped_execute · function · L2050-L2059 — def stopped_execute(state, code, origin, emit, stream=True, language="python")
- test_cancel_blocked_llm_releases_running_state_and_drops_late_output · function · L2096-L2164 — def test_cancel_blocked_llm_releases_running_state_and_drops_late_output( monkeypatch, tmp_path )
- record_frame_tokens · function · L2108-L2110 — def record_frame_tokens(args, *kwargs)
- fake_chat · function · L2114-L2125 — def fake_chat(messages, cfg, on_delta=None, **kwargs)
- unexpected_execute · function · L2127-L2128 — def unexpected_execute(args, *kwargs)
- test_plan_mode_blocks_code_and_native_tools_and_closes_history · function · L2168-L2249 — def test_plan_mode_blocks_code_and_native_tools_and_closes_history( monkeypatch, tmp_path, with_native_call )
- RefusingDispatcher · class · L2171-L2175 — class RefusingDispatcher
- call · method · L2174-L2175 — def call(self, method, args)
- fake_chat · function · L2201-L2206 — def fake_chat(messages, cfg, on_delta=None, **kwargs)
- unexpected_execute · function · L2208-L2209 — def unexpected_execute(args, *kwargs)
- test_native_env_switch_rebinds_dispatcher_before_next_call · function · L2252-L2327 — def test_native_env_switch_rebinds_dispatcher_before_next_call(monkeypatch, tmp_path)
- Dispatcher · class · L2261-L2270 — class Dispatcher
- init · method · L2262-L2264 — def init(self, label: str) -> None
- call · method · L2266-L2270 — def call(self, method, args)
- fake_chat · function · L2289-L2293 — def fake_chat(messages, cfg, on_delta=None, **kwargs)
- apply_pending · function · L2295-L2300 — def apply_pending(current, emit)
- fake_execute · function · L2302-L2305 — def fake_execute(current, code, origin, emit, stream=True, language="python")
- test_streamed_deltas_hide_fences_and_precede_tool_and_terminal_events · function · L2330-L2402 — def test_streamed_deltas_hide_fences_and_precede_tool_and_terminal_events( monkeypatch, tmp_path )
- fake_chat · function · L2343-L2348 — def fake_chat(messages, cfg, on_delta=None, **kwargs)
- fake_execute · function · L2350-L2361 — def fake_execute(state, code, origin, emit, stream=True, language="python")
- test_code_only_failure_is_visible_after_real_cell_outcome · function · L2405-L2441 — def test_code_only_failure_is_visible_after_real_cell_outcome(monkeypatch, tmp_path)
- fake_chat · function · L2410-L2414 — def fake_chat(messages, cfg, on_delta=None, **kwargs)
- fake_execute · function · L2416-L2424 — def fake_execute(state, code, origin, emit, stream=True, language="python")
- test_conversational_json_fence_does_not_cut_off_later_public_prose · function · L2444-L2485 — def test_conversational_json_fence_does_not_cut_off_later_public_prose( monkeypatch, tmp_path )
- fake_chat · function · L2457-L2462 — def fake_chat(messages, cfg, on_delta=None, **kwargs)
- fake_execute · function · L2464-L2470 — def fake_execute(state, code, origin, emit, stream=True, language="python")
- test_wire_delegation_installs_live_event_and_child_step_sinks · function · L2488-L2577 — def test_wire_delegation_installs_live_event_and_child_step_sinks(tmp_path)
- test_model_path_budget_denial_ends_the_turn_as_budget_exhausted · function · L2580-L2626 — def test_model_path_budget_denial_ends_the_turn_as_budget_exhausted( monkeypatch, tmp_path )
- denying_admit · function · L2598-L2602 — def denying_admit(st, , consumer, *kwargs)
- test_a_team_owned_session_is_metered_and_drains_its_abandoned_streams · function · L2629-L2652 — def test_a_team_owned_session_is_metered_and_drains_its_abandoned_streams( monkeypatch, tmp_path )
- _live_text · function · L2663-L2668 — def _live_text(hub) -> str
- test_native_finalize_after_streamed_prose_starts_a_new_paragraph · function · L2671-L2706 — def test_native_finalize_after_streamed_prose_starts_a_new_paragraph( monkeypatch, tmp_path )
- fake_chat · function · L2690-L2694 — def fake_chat(messages, cfg, on_delta=None, **kwargs)
- test_submit_output_cell_after_single_newline_prose_starts_a_new_paragraph · function · L2709-L2745 — def test_submit_output_cell_after_single_newline_prose_starts_a_new_paragraph( monkeypatch, tmp_path )
- fake_chat · function · L2721-L2725 — def fake_chat(messages, cfg, on_delta=None, **kwargs)
- fake_execute · function · L2727-L2733 — def fake_execute(state, code, origin, emit, stream=True, language="python")
- test_completion_without_prior_prose_gets_no_leading_blank_line · function · L2748-L2767 — def test_completion_without_prior_prose_gets_no_leading_blank_line( monkeypatch, tmp_path )
- finish_silently · function · L2754-L2760 — def finish_silently(state, emit, visible)
- test_trusted_and_gated_completion_chunks_also_start_a_new_paragraph · function · L2771-L2850 — def test_trusted_and_gated_completion_chunks_also_start_a_new_paragraph( monkeypatch, tmp_path, stage )
- ensure_runtime · function · L2798-L2801 — def ensure_runtime(state)
- finish_after_prose · function · L2803-L2826 — def finish_after_prose(state, emit, visible, runner=runner)
- write · function · L2815-L2817 — def write()
- _Gate · class · L2828-L2837 — class _Gate
- active_mode · method · L2830-L2831 — def active_mode(_root_frame_id)
- gate_after_turn · method · L2833-L2834 — def gate_after_turn(self, **fields)
- finalize_after_delivery · method · L2836-L2837 — def finalize_after_delivery(self, **fields)
- test_reopened_messages_project_the_stopped_marker · function · L2853-L2913 — def test_reopened_messages_project_the_stopped_marker(monkeypatch, tmp_path)
- ensure_runtime · function · L2870-L2873 — def ensure_runtime(state)
- fake_chat · function · L2875-L2877 — def fake_chat(messages, cfg, on_delta=None, **kwargs)
- stopped_execute · function · L2879-L2882 — def stopped_execute(state, code, origin, emit, stream=True, language="python")
- test_interrupted_repl_cell_does_not_report_success · function · L2919-L2957 — def test_interrupted_repl_cell_does_not_report_success(monkeypatch, tmp_path)
- fake_execute · function · L2931-L2940 — def fake_execute(state, code, origin, emit, stream=True, language="python")
- test_missing_llm_key_turn_logs_one_line_not_a_traceback · function · L2960-L2994 — def test_missing_llm_key_turn_logs_one_line_not_a_traceback( monkeypatch, tmp_path, capfd )
- no_network · function · L2969-L2970 — def no_network(args, *kwargs)
- keyless · function · L2977-L2980 — def keyless(st=None)
- test_unexpected_turn_failure_still_prints_its_traceback · function · L2997-L3014 — def test_unexpected_turn_failure_still_prints_its_traceback( monkeypatch, tmp_path, capfd )
- broken_chat · function · L3004-L3005 — def broken_chat(messages, cfg, on_delta=None, **kwargs)
- test_model_revision_refusal_in_delegation_wiring_logs_one_line · function · L3017-L3039 — def test_model_revision_refusal_in_delegation_wiring_logs_one_line( monkeypatch, tmp_path, capfd )
- unavailable · function · L3024-L3029 — def unavailable(_st=None)
- test_queued_turn_refusal_logs_one_line · function · L3042-L3062 — def test_queued_turn_refusal_logs_one_line(monkeypatch, tmp_path, capfd)
- refuse · function · L3046-L3051 — def refuse(args, *kwargs)