← Về thư mục
tests/test_host_data_service.py
- _ample_free_disk · function · L25-L39 — def _ample_free_disk(monkeypatch)
- FakeStore · class · L42-L160 — class FakeStore
- init · method · L43-L81 — def init(self) -> None
- get_artifact · method · L83-L85 — def get_artifact(self, artifact_id)
- resolve_frame_scope · method · L87-L89 — def resolve_frame_scope(self, frame_id)
- query · method · L91-L96 — def query(self, sql, *, params=None, limit=None, timeout_s=5.0, scope=None): #
scope is what publishes the session-scoped my_* views on the real # store. It used to be accepted by the SDK and dropped, so the base # artifact tables were readable directly across every project.
- schema · method · L98-L99 — def schema(self)
- list_artifacts · method · L101-L103 — def list_artifacts(self, filters=None)
- resolve_artifact_path · method · L105-L106 — def resolve_artifact_path(self, ident)
- record_cell_artifact · method · L108-L110 — def record_cell_artifact(self, **fields)
- version_meta · method · L112-L114 — def version_meta(self, version_id)
- set_version_snapshot · method · L116-L117 — def set_version_snapshot(self, version_id, snapshot_path)
- set_priority · method · L119-L120 — def set_priority(self, artifact_id, priority)
- frame_detail · method · L125-L129 — def frame_detail(self, frame_id, *, page, page_size, visible_to_user_id=None)
- search_frames · method · L131-L135 — def search_frames(self, pattern, *, project_id, limit, visible_to_user_id=None)
- browse_frames · method · L137-L143 — def browse_frames( self, *, project_id, status, roots_only, limit, visible_to_user_id=None )
- producing_cell_for_version · method · L145-L146 — def producing_cell_for_version(self, version_id)
- lineage_inputs · method · L148-L149 — def lineage_inputs(self, version_id)
- lineage_edges_for · method · L151-L153 — def lineage_edges_for(self, version_id, direction)
- version_for_path · method · L155-L160 — def version_for_path(self, path, *, root_frame_id, project_id): # Required, not defaulted, so this fake cannot keep accepting the # unscoped call that production can no longer make -- which is how a # fake comes to certify a signature the real store has dropped.
- _service · function · L163-L194 — def _service( tmp_path: Path, store: FakeStore | None = None, *, trusted_delivery: bool = False, team_mode: bool = False, )
- resolve · function · L182-L186 — def resolve(path, *, must_exist=False)
- _real_service · function · L197-L233 — def _real_service( tmp_path: Path, *, trusted_delivery: bool, team_mode: bool = False, )
- resolve · function · L216-L225 — def resolve(path, *, must_exist=False)
- test_query_projection_and_schema_keep_store_contract · function · L236-L257 — def test_query_projection_and_schema_keep_store_contract(tmp_path)
- test_a_caller_supplied_scope_is_ignored · function · L260-L278 — def test_a_caller_supplied_scope_is_ignored(tmp_path)
- test_artifact_search_keeps_filter_mutation_and_ranking · function · L281-L307 — def test_artifact_search_keeps_filter_mutation_and_ranking(tmp_path)
- test_rank_artifacts_never_mutates_source_rows · function · L310-L316 — def test_rank_artifacts_never_mutates_source_rows()
- _team_artifact_source · function · L319-L344 — def _team_artifact_source( tmp_path: Path, *, version_id: str = "v-owned", payload: bytes = b"exact-version-bytes", snapshot: bool = True, )
- test_team_artifact_path_stages_current_and_historical_exact_bytes · function · L347-L388 — def test_team_artifact_path_stages_current_and_historical_exact_bytes(tmp_path)
- test_team_artifact_path_is_stable_and_concurrently_idempotent · function · L391-L402 — def test_team_artifact_path_is_stable_and_concurrently_idempotent(tmp_path)
- test_team_artifact_path_repeated_hit_does_not_consume_session_quota · function · L405-L435 — def test_team_artifact_path_repeated_hit_does_not_consume_session_quota( tmp_path, monkeypatch, )
- test_team_artifact_path_enforces_daemon_wide_quota_across_sessions · function · L438-L475 — def test_team_artifact_path_enforces_daemon_wide_quota_across_sessions( tmp_path, monkeypatch, )
- test_team_artifact_path_fails_closed_without_root_scope · function · L478-L486 — def test_team_artifact_path_fails_closed_without_root_scope(tmp_path)
- test_team_artifact_path_preserves_disk_free_reserve · function · L489-L505 — def test_team_artifact_path_preserves_disk_free_reserve(tmp_path, monkeypatch)
- test_staging_contracts_do_not_depend_on_the_hosts_free_disk · function · L509-L529 — def test_staging_contracts_do_not_depend_on_the_hosts_free_disk(tmp_path, monkeypatch)
- test_team_artifact_path_denies_foreign_version_before_staging · function · L532-L554 — def test_team_artifact_path_denies_foreign_version_before_staging(tmp_path)
- test_team_artifact_path_safely_replaces_preexisting_cache_alias · function · L558-L578 — def test_team_artifact_path_safely_replaces_preexisting_cache_alias( tmp_path, alias_kind, )
- test_team_artifact_path_refuses_symlinked_cache_parent · function · L581-L591 — def test_team_artifact_path_refuses_symlinked_cache_parent(tmp_path)
- test_team_artifact_path_refuses_aliased_snapshot_source · function · L595-L608 — def test_team_artifact_path_refuses_aliased_snapshot_source(tmp_path, alias_kind)
- test_team_artifact_path_detects_snapshot_name_swap_during_stream · function · L611-L642 — def test_team_artifact_path_detects_snapshot_name_swap_during_stream( tmp_path, monkeypatch, )
- swap_name_after_first_read · function · L625-L633 — def swap_name_after_first_read(descriptor, count)
- test_team_artifact_path_does_not_follow_cache_parent_swap · function · L645-L673 — def test_team_artifact_path_does_not_follow_cache_parent_swap(tmp_path, monkeypatch)
- swap_cache_parent_after_source_open · function · L654-L661 — def swap_cache_parent_after_source_open(descriptor, count)
- test_team_artifact_path_rejects_tampered_snapshot · function · L676-L685 — def test_team_artifact_path_rejects_tampered_snapshot(tmp_path)
- test_team_artifact_path_bounds_oversized_source_read_to_recorded_size · function · L688-L713 — def test_team_artifact_path_bounds_oversized_source_read_to_recorded_size( tmp_path, monkeypatch, )
- observe_read · function · L700-L704 — def observe_read(descriptor, count)
- test_single_user_artifact_path_keeps_direct_path_compatibility · function · L716-L729 — def test_single_user_artifact_path_keeps_direct_path_compatibility(tmp_path)
- test_real_team_store_stages_each_immutable_version_in_session_root · function · L732-L760 — def test_real_team_store_stages_each_immutable_version_in_session_root(tmp_path)
- test_save_artifact_copies_snapshot_and_preserves_record_shape · function · L763-L802 — def test_save_artifact_copies_snapshot_and_preserves_record_shape(tmp_path)
- test_save_artifact_forwards_the_retrieval_envelope · function · L805-L823 — def test_save_artifact_forwards_the_retrieval_envelope(tmp_path)
- test_flag_off_provenance_record_preserves_legacy_record_shape · function · L826-L852 — def test_flag_off_provenance_record_preserves_legacy_record_shape(tmp_path)
- test_flag_off_real_host_capture_keeps_legacy_response_and_no_observation · function · L856-L903 — def test_flag_off_real_host_capture_keeps_legacy_response_and_no_observation( tmp_path, operation )
- test_trusted_host_capture_freezes_exact_bytes_before_the_store_call · function · L907-L956 — def test_trusted_host_capture_freezes_exact_bytes_before_the_store_call( tmp_path, monkeypatch, operation )
- inspect_record · function · L920-L931 — def inspect_record(**fields)
- test_trusted_host_capture_reuses_head_bytes_but_audits_each_cell · function · L960-L1021 — def test_trusted_host_capture_reuses_head_bytes_but_audits_each_cell( tmp_path, operation )
- test_trusted_host_freeze_fault_never_reaches_the_store_or_leaves_bytes · function · L1025-L1050 — def test_trusted_host_freeze_fault_never_reaches_the_store_or_leaves_bytes( tmp_path, monkeypatch, operation )
- fail_fsync · function · L1035-L1036 — def fail_fsync(_descriptor)
- test_trusted_host_rejects_mid_freeze_rewrite_with_restored_mtime · function · L1054-L1131 — def test_trusted_host_rejects_mid_freeze_rewrite_with_restored_mtime( tmp_path, monkeypatch, operation )
- rewrite_after_first_source_read · function · L1070-L1087 — def rewrite_after_first_source_read(descriptor, size)
- test_trusted_host_store_fault_removes_prefreeze_and_persists_nothing · function · L1135-L1171 — def test_trusted_host_store_fault_removes_prefreeze_and_persists_nothing( tmp_path, operation )
- test_frames_modes_validate_before_store_access · function · L1174-L1191 — def test_frames_modes_validate_before_store_access(tmp_path)
- test_lineage_projection_and_bounded_graph · function · L1194-L1235 — def test_lineage_projection_and_bounded_graph(tmp_path)
- test_provenance_soft_failure_and_dynamic_store_provider · function · L1238-L1254 — def test_provenance_soft_failure_and_dynamic_store_provider(tmp_path)
- test_artifact_marker_rejects_untrusted_ids · function · L1258-L1262 — def test_artifact_marker_rejects_untrusted_ids(tmp_path, version_id)
- test_view_image_confines_a_caller_supplied_path_to_the_workspace · function · L1265-L1304 — def test_view_image_confines_a_caller_supplied_path_to_the_workspace(tmp_path)