flowproof 0.23.34__tar.gz → 0.23.35__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {flowproof-0.23.34 → flowproof-0.23.35}/Cargo.lock +8 -8
- {flowproof-0.23.34 → flowproof-0.23.35}/Cargo.toml +5 -2
- {flowproof-0.23.34 → flowproof-0.23.35}/PKG-INFO +1 -1
- flowproof-0.23.35/crates/flowproof-adapters/src/ffmpeg.rs +583 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/lib.rs +12 -1
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/video_frames.rs +107 -219
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/vision.rs +103 -12
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/vision_elements.rs +268 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/tests/video_frames_e2e.rs +5 -3
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-agent/src/author.rs +305 -4
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-agent/src/heal.rs +8 -40
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-agent/src/recorder.rs +244 -8
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-agent/src/video_author.rs +83 -11
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/src/lib.rs +7 -5
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-driver/src/app.rs +15 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-driver/src/mock.rs +11 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-driver/src/surface.rs +1 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-trace/src/format.rs +83 -1
- {flowproof-0.23.34 → flowproof-0.23.35}/flowproof/__init__.py +13 -2
- {flowproof-0.23.34 → flowproof-0.23.35}/pyproject.toml +1 -1
- {flowproof-0.23.34 → flowproof-0.23.35}/README.md +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/Cargo.toml +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/examples/vision_bench.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/examples/vision_do.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/agent_proxy.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/agent_runner.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/egress.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/egress_linux.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/egress_windows/audit.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/egress_windows/capture.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/egress_windows/env_block.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/egress_windows/filters.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/egress_windows/identity.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/egress_windows/logon.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/egress_windows/netevents.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/egress_windows/run.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/egress_windows/spawn.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/egress_windows/wfp.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/egress_windows.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/fiori.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/fs_observe.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/kept_browser.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/mcp_core.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/mcp_http.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/mcp_stdio.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/sap_com.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/vision/start.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/vision_bench.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/vision_grid.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/vision_winocr.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/src/web.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/tests/a11y_capture.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/tests/consent_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/tests/drag_spike.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/tests/fingerprint_capture.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/tests/fixtures/windows-start.png +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/tests/framed_scene_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/tests/fs_observation_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/tests/grid_scene_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/tests/list_scene_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/tests/network_idle_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/tests/page_ready_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/tests/password_recording_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/tests/replayable_selectors_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/tests/shared_browser_shutdown_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/tests/side_effect_http_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/tests/static_area_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/tests/suggestion_pick_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/tests/visibility_detach_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-adapters/tests/windows_containment_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-agent/Cargo.toml +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-agent/src/agent_steps.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-agent/src/clarify.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-agent/src/code_author.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-agent/src/doc_author.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-agent/src/doc_formats/hp_alm.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-agent/src/doc_formats.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-agent/src/draft_assembly.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-agent/src/lib.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-agent/src/llm.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-agent/src/repair.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-agent/src/rules.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-agent/src/selection.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-agent/src/spec.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-agent/tests/model_client_http.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/Cargo.toml +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/build.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/skills/flowproof-config/SKILL.md +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/src/agent_flow.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/src/agent_surface.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/src/capture.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/src/config.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/src/doctor.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/src/main.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/src/suite.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/src/suite_checkpoint.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/src/suite_inputs.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/src/suite_journal.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/src/update_check.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/a11y_selector_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/agent_conversation_anthropic_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/agent_conversation_streaming_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/agent_flow_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/agent_url_record_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/api_pipeline.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/audit_record_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/author_from_code_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/calc_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/citrix_start.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/clock_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/config_cli_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/config_seed_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/config_skill_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/cookie_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/doctor_ai_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/doctor_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/documented_flags.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/egress_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/examples_resolve.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/export_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/falsifiability_arg_matchers.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/falsifiability_audit_since.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/falsifiability_call_order.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/falsifiability_capability_regression.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/falsifiability_control_verdict.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/falsifiability_mcp_kill.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/falsifiability_no_tool_call.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/falsifiability_reply_contains.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/falsifiability_side_effect.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/fiori_field_commit_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/grid_cell_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/heal_apply_proposal.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/heal_vars_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/iframe_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/llm_author_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/mcp_http_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/mcp_stdio_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/notepad_author_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/notepad_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/page_title_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/pinned_random_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/record_progress.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/sap_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/sap_pipeline.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/sap_sim_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/scoped_container_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/select_missing_option_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/sigterm_shared_browser_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/skip_unless_env.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/suite_checkpoint.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/suite_env_from.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/suite_flow_isolation.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/suite_missing_trace.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/suite_policy.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/support/sap_simulator.py +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/visibility_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/vision_pipeline.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/vision_start_replay.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-cli/tests/web_e2e.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-driver/Cargo.toml +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-driver/src/backend.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-driver/src/gdi.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-driver/src/lib.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-driver/src/oob.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-driver/src/recording.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-driver/src/redact.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-driver/src/uia_scan.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-driver/src/visual.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-driver/src/window.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-python/Cargo.toml +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-python/src/lib.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-replay/Cargo.toml +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-replay/src/lib.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-replay/src/report.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-replay/src/runrecord.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-replay/tests/replay_calc.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-replay/tests/spec_step.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-trace/Cargo.toml +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-trace/schema/cassette-v1.schema.json +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-trace/schema/side-effect-v1.schema.json +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-trace/schema/trace-v1.schema.json +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-trace/src/captures.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-trace/src/cassette.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-trace/src/cassette_diff.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-trace/src/egress.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-trace/src/lib.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-trace/src/secret.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-trace/src/secret_scan.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-trace/src/side_effect.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-trace/src/substitution.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-trace/src/toolcalls.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-trace/src/tosca.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-trace/tests/cassette_conformance.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-trace/tests/fixtures/guarded.trace.jsonl +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-trace/tests/fixtures/multi.trace.jsonl +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-trace/tests/fixtures/repeat.trace.jsonl +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-trace/tests/fixtures/sample.trace.jsonl +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-trace/tests/schema_conformance.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-trace/tests/side_effect_conformance.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/crates/flowproof-trace/tests/tosca_export.rs +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/flowproof/cli.py +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/flowproof/flow.py +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/flowproof/mcp_server.py +0 -0
- {flowproof-0.23.34 → flowproof-0.23.35}/flowproof/py.typed +0 -0
|
@@ -888,7 +888,7 @@ dependencies = [
|
|
|
888
888
|
|
|
889
889
|
[[package]]
|
|
890
890
|
name = "flowproof-adapters"
|
|
891
|
-
version = "0.23.
|
|
891
|
+
version = "0.23.35"
|
|
892
892
|
dependencies = [
|
|
893
893
|
"anyhow",
|
|
894
894
|
"flowproof-driver",
|
|
@@ -907,7 +907,7 @@ dependencies = [
|
|
|
907
907
|
|
|
908
908
|
[[package]]
|
|
909
909
|
name = "flowproof-agent"
|
|
910
|
-
version = "0.23.
|
|
910
|
+
version = "0.23.35"
|
|
911
911
|
dependencies = [
|
|
912
912
|
"base64",
|
|
913
913
|
"chrono",
|
|
@@ -926,7 +926,7 @@ dependencies = [
|
|
|
926
926
|
|
|
927
927
|
[[package]]
|
|
928
928
|
name = "flowproof-cli"
|
|
929
|
-
version = "0.23.
|
|
929
|
+
version = "0.23.35"
|
|
930
930
|
dependencies = [
|
|
931
931
|
"ab_glyph",
|
|
932
932
|
"chrono",
|
|
@@ -952,7 +952,7 @@ dependencies = [
|
|
|
952
952
|
|
|
953
953
|
[[package]]
|
|
954
954
|
name = "flowproof-driver"
|
|
955
|
-
version = "0.23.
|
|
955
|
+
version = "0.23.35"
|
|
956
956
|
dependencies = [
|
|
957
957
|
"calamine",
|
|
958
958
|
"flowproof-trace",
|
|
@@ -968,7 +968,7 @@ dependencies = [
|
|
|
968
968
|
|
|
969
969
|
[[package]]
|
|
970
970
|
name = "flowproof-python"
|
|
971
|
-
version = "0.23.
|
|
971
|
+
version = "0.23.35"
|
|
972
972
|
dependencies = [
|
|
973
973
|
"flowproof-agent",
|
|
974
974
|
"flowproof-cli",
|
|
@@ -980,7 +980,7 @@ dependencies = [
|
|
|
980
980
|
|
|
981
981
|
[[package]]
|
|
982
982
|
name = "flowproof-replay"
|
|
983
|
-
version = "0.23.
|
|
983
|
+
version = "0.23.35"
|
|
984
984
|
dependencies = [
|
|
985
985
|
"chrono",
|
|
986
986
|
"flowproof-agent",
|
|
@@ -994,7 +994,7 @@ dependencies = [
|
|
|
994
994
|
|
|
995
995
|
[[package]]
|
|
996
996
|
name = "flowproof-terminal-replica"
|
|
997
|
-
version = "0.23.
|
|
997
|
+
version = "0.23.35"
|
|
998
998
|
dependencies = [
|
|
999
999
|
"image",
|
|
1000
1000
|
"serde",
|
|
@@ -1005,7 +1005,7 @@ dependencies = [
|
|
|
1005
1005
|
|
|
1006
1006
|
[[package]]
|
|
1007
1007
|
name = "flowproof-trace"
|
|
1008
|
-
version = "0.23.
|
|
1008
|
+
version = "0.23.35"
|
|
1009
1009
|
dependencies = [
|
|
1010
1010
|
"jsonschema",
|
|
1011
1011
|
"regex",
|
|
@@ -22,12 +22,15 @@ members = ["crates/flowproof-driver", "crates/flowproof-trace", "crates/flowproo
|
|
|
22
22
|
exclude = ["spike/windows-containment"]
|
|
23
23
|
|
|
24
24
|
[workspace.package]
|
|
25
|
-
version = "0.23.
|
|
25
|
+
version = "0.23.35"
|
|
26
26
|
edition = "2021"
|
|
27
27
|
license = "Apache-2.0"
|
|
28
28
|
repository = "https://github.com/automators-com/flowproof"
|
|
29
29
|
authors = ["Automators <hello@automators.com>"]
|
|
30
|
-
|
|
30
|
+
# The oldest Rust the locked dependencies build on: rten and rten-simd 0.24
|
|
31
|
+
# declare 1.89. Clippy's incompatible_msrv lint reads this, so CI fails if our
|
|
32
|
+
# own code uses a std API newer than it. Raise it when a dependency update does.
|
|
33
|
+
rust-version = "1.89"
|
|
31
34
|
# Nothing here goes to crates.io: the wheel and the npm package are built from
|
|
32
35
|
# this workspace (publish.yml, publish-npm.yml). Saying so also lets
|
|
33
36
|
# cargo-deny treat the crates as private, where path dependencies are fine.
|
|
@@ -0,0 +1,583 @@
|
|
|
1
|
+
//! The ffmpeg flowproof reads screen recordings with.
|
|
2
|
+
//!
|
|
3
|
+
//! flowproof ships a decode-only ffmpeg next to its own binary: it reads the
|
|
4
|
+
//! formats screen recorders produce and nothing else, so drafting from a
|
|
5
|
+
//! video needs no browser and no ffmpeg of the user's own. `FLOWPROOF_FFMPEG`
|
|
6
|
+
//! names another one (a packager's, a developer's); an ffmpeg on `PATH` is
|
|
7
|
+
//! the last resort, for builds from source.
|
|
8
|
+
|
|
9
|
+
use std::ffi::OsString;
|
|
10
|
+
use std::io::Read;
|
|
11
|
+
use std::path::{Path, PathBuf};
|
|
12
|
+
use std::process::{Command, Output, Stdio};
|
|
13
|
+
|
|
14
|
+
use crate::AdapterError;
|
|
15
|
+
|
|
16
|
+
/// The file name of the binary on this platform.
|
|
17
|
+
const BINARY: &str = if cfg!(windows) {
|
|
18
|
+
"ffmpeg.exe"
|
|
19
|
+
} else {
|
|
20
|
+
"ffmpeg"
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/// What a person reads when there is no ffmpeg: it normally comes with
|
|
24
|
+
/// flowproof, so a missing one is a broken install, not a missing download.
|
|
25
|
+
const NO_FFMPEG_HELP: &str = "reading a video needs the ffmpeg that ships next to flowproof, \
|
|
26
|
+
and it is not there. Reinstall flowproof, or set FLOWPROOF_FFMPEG to the path of an \
|
|
27
|
+
ffmpeg binary.";
|
|
28
|
+
|
|
29
|
+
/// An ffmpeg binary that was found on disk.
|
|
30
|
+
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
31
|
+
pub struct Ffmpeg {
|
|
32
|
+
path: PathBuf,
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
impl Ffmpeg {
|
|
36
|
+
/// The ffmpeg to use. `FLOWPROOF_FFMPEG` wins when set, and one naming a
|
|
37
|
+
/// file that is not there is an error rather than a quiet fall-back: the
|
|
38
|
+
/// person asked for that binary. Then the one beside flowproof, then
|
|
39
|
+
/// `PATH`.
|
|
40
|
+
pub fn find() -> Result<Self, AdapterError> {
|
|
41
|
+
let beside = std::env::current_exe()
|
|
42
|
+
.ok()
|
|
43
|
+
.and_then(|exe| exe.parent().map(|dir| dir.join(BINARY)));
|
|
44
|
+
pick(
|
|
45
|
+
std::env::var_os("FLOWPROOF_FFMPEG"),
|
|
46
|
+
beside,
|
|
47
|
+
std::env::var_os("PATH"),
|
|
48
|
+
|path| path.is_file(),
|
|
49
|
+
)
|
|
50
|
+
.map(|path| Self { path })
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
pub fn path(&self) -> &Path {
|
|
54
|
+
&self.path
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/// What `video` is: its length, picture size and video codec. A file
|
|
58
|
+
/// ffmpeg cannot open, or one with no picture in it, is an error that
|
|
59
|
+
/// says so.
|
|
60
|
+
pub fn probe(&self, video: &Path) -> Result<Probe, AdapterError> {
|
|
61
|
+
let mut command = self.command();
|
|
62
|
+
command.arg("-i").arg(input(video));
|
|
63
|
+
// With no output named ffmpeg always exits non-zero; what it read
|
|
64
|
+
// is on stderr either way.
|
|
65
|
+
let out = self.output(command)?;
|
|
66
|
+
let read = parse_probe(&String::from_utf8_lossy(&out.stderr)).map_err(|why| {
|
|
67
|
+
AdapterError::Video(format!("could not read {}: {why}", video.display()))
|
|
68
|
+
})?;
|
|
69
|
+
let duration_ms = match read.duration_ms {
|
|
70
|
+
0 => self.measure(video)?,
|
|
71
|
+
ms => ms,
|
|
72
|
+
};
|
|
73
|
+
Ok(Probe {
|
|
74
|
+
duration_ms,
|
|
75
|
+
..read
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/// A recording made in a browser (MediaRecorder webm) states no length,
|
|
80
|
+
/// so its video track is read to the end, without decoding, to learn it.
|
|
81
|
+
fn measure(&self, video: &Path) -> Result<u64, AdapterError> {
|
|
82
|
+
let mut command = self.command();
|
|
83
|
+
command
|
|
84
|
+
.args(["-v", "error", "-i"])
|
|
85
|
+
.arg(input(video))
|
|
86
|
+
.args(["-map", "0:v:0", "-c", "copy", "-f", "null"])
|
|
87
|
+
.args(["-progress", "pipe:1", "-nostats", "-"]);
|
|
88
|
+
let out = self.output(command)?;
|
|
89
|
+
match parse_progress(&String::from_utf8_lossy(&out.stdout)) {
|
|
90
|
+
Some(ms) if ms > 0 => Ok(ms),
|
|
91
|
+
_ => Err(AdapterError::Video(format!(
|
|
92
|
+
"could not read {}: it states no length, and reading it to the end found none",
|
|
93
|
+
video.display()
|
|
94
|
+
))),
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/// Small greyscale pictures of `video`, one every `every_ms` from the
|
|
99
|
+
/// start, each `width` x `height` bytes, decoded in one pass. At most
|
|
100
|
+
/// `limit`, fewer when the video ends first. `on_thumb(n)` hears about
|
|
101
|
+
/// each one as it arrives, since this is the slow part of a long video.
|
|
102
|
+
pub fn thumbnails(
|
|
103
|
+
&self,
|
|
104
|
+
video: &Path,
|
|
105
|
+
every_ms: u64,
|
|
106
|
+
(width, height): (u32, u32),
|
|
107
|
+
limit: usize,
|
|
108
|
+
on_thumb: &mut dyn FnMut(usize),
|
|
109
|
+
) -> Result<Vec<Vec<u8>>, AdapterError> {
|
|
110
|
+
let mut command = self.command();
|
|
111
|
+
command
|
|
112
|
+
.args(["-v", "error", "-i"])
|
|
113
|
+
.arg(input(video))
|
|
114
|
+
.args(["-map", "0:v:0", "-vf"])
|
|
115
|
+
// round=up: the thumbnail for a time is the picture showing at
|
|
116
|
+
// that time, the one picture_at() seeks to. The default (near)
|
|
117
|
+
// can take the next frame instead, so a change was found one
|
|
118
|
+
// sample early and its JPEG still showed the screen before it.
|
|
119
|
+
.arg(format!(
|
|
120
|
+
"fps=1000/{}:round=up,{}",
|
|
121
|
+
every_ms.max(1),
|
|
122
|
+
picture_filter((width, height), None, Format::Gray)
|
|
123
|
+
))
|
|
124
|
+
.arg("-frames:v")
|
|
125
|
+
.arg(limit.to_string())
|
|
126
|
+
.args(Format::Gray.output_args())
|
|
127
|
+
.stdout(Stdio::piped())
|
|
128
|
+
.stderr(Stdio::piped());
|
|
129
|
+
let mut child = command.spawn().map_err(|e| self.start_error(e))?;
|
|
130
|
+
// Read alongside stdout, so a file that makes ffmpeg complain on
|
|
131
|
+
// every frame cannot fill the pipe and stall it.
|
|
132
|
+
let mut stderr = child.stderr.take().expect("stderr is piped");
|
|
133
|
+
let complaints = std::thread::spawn(move || {
|
|
134
|
+
let mut text = String::new();
|
|
135
|
+
let _ = stderr.read_to_string(&mut text);
|
|
136
|
+
text
|
|
137
|
+
});
|
|
138
|
+
let mut stdout = child.stdout.take().expect("stdout is piped");
|
|
139
|
+
let mut thumbs = Vec::new();
|
|
140
|
+
loop {
|
|
141
|
+
let mut thumb = vec![0u8; width as usize * height as usize];
|
|
142
|
+
match stdout.read_exact(&mut thumb) {
|
|
143
|
+
Ok(()) => {
|
|
144
|
+
on_thumb(thumbs.len());
|
|
145
|
+
thumbs.push(thumb);
|
|
146
|
+
}
|
|
147
|
+
// The end of the video, or a part picture ffmpeg gave up on.
|
|
148
|
+
Err(e) if e.kind() == std::io::ErrorKind::UnexpectedEof => break,
|
|
149
|
+
Err(e) => {
|
|
150
|
+
let _ = child.kill();
|
|
151
|
+
return Err(AdapterError::Video(format!(
|
|
152
|
+
"reading pictures from ffmpeg: {e}"
|
|
153
|
+
)));
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
let _ = child.wait();
|
|
158
|
+
let complaints = complaints.join().unwrap_or_default();
|
|
159
|
+
if thumbs.is_empty() {
|
|
160
|
+
return Err(AdapterError::Video(format!(
|
|
161
|
+
"could not decode {}: {}",
|
|
162
|
+
video.display(),
|
|
163
|
+
last_line(&complaints).unwrap_or("ffmpeg gave no pictures")
|
|
164
|
+
)));
|
|
165
|
+
}
|
|
166
|
+
Ok(thumbs)
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/// One picture of `video` at `at_ms`, scaled to `size` and then cut to
|
|
170
|
+
/// `crop` (in the scaled picture's pixels) when one is given.
|
|
171
|
+
pub fn picture_at(
|
|
172
|
+
&self,
|
|
173
|
+
video: &Path,
|
|
174
|
+
at_ms: u64,
|
|
175
|
+
size: (u32, u32),
|
|
176
|
+
crop: Option<Crop>,
|
|
177
|
+
format: Format,
|
|
178
|
+
) -> Result<Vec<u8>, AdapterError> {
|
|
179
|
+
let mut command = self.command();
|
|
180
|
+
command
|
|
181
|
+
.args(["-v", "error", "-ss"])
|
|
182
|
+
.arg(seconds(at_ms))
|
|
183
|
+
.arg("-i")
|
|
184
|
+
.arg(input(video))
|
|
185
|
+
.args(["-map", "0:v:0", "-frames:v", "1", "-vf"])
|
|
186
|
+
.arg(picture_filter(size, crop, format))
|
|
187
|
+
.args(format.output_args());
|
|
188
|
+
let out = self.output(command)?;
|
|
189
|
+
if out.stdout.is_empty() {
|
|
190
|
+
let why = String::from_utf8_lossy(&out.stderr);
|
|
191
|
+
return Err(AdapterError::Video(format!(
|
|
192
|
+
"could not take the picture at {} in {}: {}",
|
|
193
|
+
seconds(at_ms),
|
|
194
|
+
video.display(),
|
|
195
|
+
last_line(&why).unwrap_or("ffmpeg gave no picture")
|
|
196
|
+
)));
|
|
197
|
+
}
|
|
198
|
+
Ok(out.stdout)
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/// ffmpeg with the options every call shares: no banner, never reading
|
|
202
|
+
/// the terminal, and no console window flashing up on Windows.
|
|
203
|
+
fn command(&self) -> Command {
|
|
204
|
+
let mut command = Command::new(&self.path);
|
|
205
|
+
command
|
|
206
|
+
.args(["-hide_banner", "-nostdin"])
|
|
207
|
+
.stdin(Stdio::null());
|
|
208
|
+
#[cfg(windows)]
|
|
209
|
+
{
|
|
210
|
+
use std::os::windows::process::CommandExt;
|
|
211
|
+
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
|
|
212
|
+
command.creation_flags(CREATE_NO_WINDOW);
|
|
213
|
+
}
|
|
214
|
+
command
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
fn output(&self, mut command: Command) -> Result<Output, AdapterError> {
|
|
218
|
+
command.output().map_err(|e| self.start_error(e))
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
fn start_error(&self, e: std::io::Error) -> AdapterError {
|
|
222
|
+
AdapterError::Video(format!(
|
|
223
|
+
"could not start ffmpeg at {}: {e}",
|
|
224
|
+
self.path.display()
|
|
225
|
+
))
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/// What a picture is delivered as.
|
|
230
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
231
|
+
pub enum Format {
|
|
232
|
+
/// One byte per pixel, rows top to bottom: what the change test reads.
|
|
233
|
+
Gray,
|
|
234
|
+
/// A JPEG, for the model.
|
|
235
|
+
Jpeg,
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
impl Format {
|
|
239
|
+
fn output_args(self) -> [&'static str; 7] {
|
|
240
|
+
match self {
|
|
241
|
+
Format::Gray => ["-f", "rawvideo", "-pix_fmt", "gray", "-an", "-sn", "pipe:1"],
|
|
242
|
+
// q 3 of mjpeg's 2 (best) to 31: text in a screenshot stays
|
|
243
|
+
// readable at a size a model call can carry 60 of.
|
|
244
|
+
Format::Jpeg => ["-c:v", "mjpeg", "-q:v", "3", "-f", "image2pipe", "pipe:1"],
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/// A rectangle cut from a picture, in pixels.
|
|
250
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
251
|
+
pub struct Crop {
|
|
252
|
+
pub x: u32,
|
|
253
|
+
pub y: u32,
|
|
254
|
+
pub width: u32,
|
|
255
|
+
pub height: u32,
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/// Scale first, so `crop` is in the pixels the caller asked for. Greyscale
|
|
259
|
+
/// is taken before scaling: one plane scales to any size, odd ones included.
|
|
260
|
+
///
|
|
261
|
+
/// A thumbnail samples pixels instead of averaging them. Averaging blurs
|
|
262
|
+
/// small text away, so an address bar whose URL changes reads as still and
|
|
263
|
+
/// is trimmed; sampled, it changes like it did in Chrome's screenshots, which
|
|
264
|
+
/// the change test's thresholds were set against. A JPEG for the model is
|
|
265
|
+
/// averaged, the sharpest way to shrink text a model has to read.
|
|
266
|
+
fn picture_filter((width, height): (u32, u32), crop: Option<Crop>, format: Format) -> String {
|
|
267
|
+
let mut filter = String::new();
|
|
268
|
+
let flags = match format {
|
|
269
|
+
Format::Gray => "neighbor",
|
|
270
|
+
Format::Jpeg => "area",
|
|
271
|
+
};
|
|
272
|
+
if format == Format::Gray {
|
|
273
|
+
filter.push_str("format=gray,");
|
|
274
|
+
}
|
|
275
|
+
filter.push_str(&format!("scale={width}:{height}:flags={flags}"));
|
|
276
|
+
if let Some(c) = crop {
|
|
277
|
+
filter.push_str(&format!(",crop={}:{}:{}:{}", c.width, c.height, c.x, c.y));
|
|
278
|
+
}
|
|
279
|
+
filter
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/// Milliseconds as the seconds ffmpeg's `-ss` takes, exactly.
|
|
283
|
+
fn seconds(ms: u64) -> String {
|
|
284
|
+
format!("{}.{:03}", ms / 1000, ms % 1000)
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
fn last_line(text: &str) -> Option<&str> {
|
|
288
|
+
text.lines().map(str::trim).rfind(|l| !l.is_empty())
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/// What [`Ffmpeg::probe`] read from a video.
|
|
292
|
+
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
293
|
+
pub struct Probe {
|
|
294
|
+
pub duration_ms: u64,
|
|
295
|
+
pub width: u32,
|
|
296
|
+
pub height: u32,
|
|
297
|
+
/// ffmpeg's name for the picture's codec (`h264`, `vp9`, `hevc`, …).
|
|
298
|
+
pub codec: String,
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/// The input as ffmpeg should open it. `file:` keeps a name with a colon in
|
|
302
|
+
/// it from being read as a protocol.
|
|
303
|
+
fn input(video: &Path) -> OsString {
|
|
304
|
+
let mut input = OsString::from("file:");
|
|
305
|
+
input.push(video);
|
|
306
|
+
input
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/// The input dump ffmpeg prints for `-i` alone: the first video stream's
|
|
310
|
+
/// codec and size, and the length when the file states one. The error is
|
|
311
|
+
/// ffmpeg's own reason, without the file name it is prefixed with.
|
|
312
|
+
fn parse_probe(text: &str) -> Result<Probe, String> {
|
|
313
|
+
if !text.lines().any(|l| l.trim_start().starts_with("Input #0")) {
|
|
314
|
+
let last = text.lines().rev().find(|l| !l.trim().is_empty());
|
|
315
|
+
let reason = last.map(|l| l.rsplit(": ").next().unwrap_or(l).trim());
|
|
316
|
+
return Err(reason.unwrap_or("ffmpeg could not open it").to_string());
|
|
317
|
+
}
|
|
318
|
+
let duration_ms = text
|
|
319
|
+
.lines()
|
|
320
|
+
.find_map(|l| l.split_once("Duration: "))
|
|
321
|
+
.and_then(|(_, rest)| parse_clock(rest.split(',').next().unwrap_or_default()));
|
|
322
|
+
let picture = text
|
|
323
|
+
.lines()
|
|
324
|
+
.filter(|l| l.trim_start().starts_with("Stream #"))
|
|
325
|
+
.find_map(|l| l.split_once(": Video: ").map(|(_, rest)| rest));
|
|
326
|
+
let Some(picture) = picture else {
|
|
327
|
+
return Err("it has no video in it".into());
|
|
328
|
+
};
|
|
329
|
+
let codec = picture
|
|
330
|
+
.split_whitespace()
|
|
331
|
+
.next()
|
|
332
|
+
.unwrap_or_default()
|
|
333
|
+
.trim_end_matches(',')
|
|
334
|
+
.to_string();
|
|
335
|
+
let (width, height) = picture
|
|
336
|
+
.split(',')
|
|
337
|
+
.find_map(|part| parse_size(part.split_whitespace().next()?))
|
|
338
|
+
.ok_or("ffmpeg did not say how big its picture is")?;
|
|
339
|
+
Ok(Probe {
|
|
340
|
+
duration_ms: duration_ms.unwrap_or(0),
|
|
341
|
+
width,
|
|
342
|
+
height,
|
|
343
|
+
codec,
|
|
344
|
+
})
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/// `1914x1074` as (1914, 1074).
|
|
348
|
+
fn parse_size(word: &str) -> Option<(u32, u32)> {
|
|
349
|
+
let (w, h) = word.split_once('x')?;
|
|
350
|
+
let (w, h) = (w.parse::<u32>().ok()?, h.parse::<u32>().ok()?);
|
|
351
|
+
(w > 0 && h > 0).then_some((w, h))
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/// `00:01:24.37` in milliseconds; `N/A` is `None`.
|
|
355
|
+
fn parse_clock(clock: &str) -> Option<u64> {
|
|
356
|
+
let mut parts = clock.trim().splitn(3, ':');
|
|
357
|
+
let hours: u64 = parts.next()?.parse().ok()?;
|
|
358
|
+
let minutes: u64 = parts.next()?.parse().ok()?;
|
|
359
|
+
let seconds: f64 = parts.next()?.parse().ok()?;
|
|
360
|
+
Some((hours * 3600 + minutes * 60) * 1000 + (seconds * 1000.0).round() as u64)
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/// The furthest point `-progress` reported, in milliseconds.
|
|
364
|
+
fn parse_progress(text: &str) -> Option<u64> {
|
|
365
|
+
text.lines()
|
|
366
|
+
.filter_map(|l| l.strip_prefix("out_time_us="))
|
|
367
|
+
.filter_map(|us| us.trim().parse::<u64>().ok())
|
|
368
|
+
.max()
|
|
369
|
+
.map(|us| us / 1000)
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/// [`Ffmpeg::find`] with the environment and the filesystem passed in, so
|
|
373
|
+
/// every branch is testable on any host.
|
|
374
|
+
fn pick(
|
|
375
|
+
named: Option<OsString>,
|
|
376
|
+
beside: Option<PathBuf>,
|
|
377
|
+
search_path: Option<OsString>,
|
|
378
|
+
exists: impl Fn(&Path) -> bool,
|
|
379
|
+
) -> Result<PathBuf, AdapterError> {
|
|
380
|
+
if let Some(named) = named.filter(|n| !n.is_empty()) {
|
|
381
|
+
let path = PathBuf::from(named);
|
|
382
|
+
if exists(&path) {
|
|
383
|
+
return Ok(path);
|
|
384
|
+
}
|
|
385
|
+
return Err(AdapterError::NoFfmpeg(format!(
|
|
386
|
+
"FLOWPROOF_FFMPEG is set to {}, and there is no file there. Point it at an \
|
|
387
|
+
ffmpeg binary, or unset it to use the one that ships with flowproof.",
|
|
388
|
+
path.display()
|
|
389
|
+
)));
|
|
390
|
+
}
|
|
391
|
+
if let Some(beside) = beside.filter(|b| exists(b)) {
|
|
392
|
+
return Ok(beside);
|
|
393
|
+
}
|
|
394
|
+
search_path
|
|
395
|
+
.iter()
|
|
396
|
+
.flat_map(std::env::split_paths)
|
|
397
|
+
.map(|dir| dir.join(BINARY))
|
|
398
|
+
.find(|path| exists(path))
|
|
399
|
+
.ok_or_else(|| AdapterError::NoFfmpeg(NO_FFMPEG_HELP.into()))
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
#[cfg(test)]
|
|
403
|
+
mod tests {
|
|
404
|
+
use super::*;
|
|
405
|
+
|
|
406
|
+
fn only(present: &'static [&'static str]) -> impl Fn(&Path) -> bool {
|
|
407
|
+
move |path| present.iter().any(|p| Path::new(p) == path)
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
fn search_path(dirs: &[&str]) -> Option<OsString> {
|
|
411
|
+
std::env::join_paths(dirs).ok()
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
#[test]
|
|
415
|
+
fn a_named_ffmpeg_wins_over_the_bundled_one() {
|
|
416
|
+
let found = pick(
|
|
417
|
+
Some("/opt/ff/ffmpeg".into()),
|
|
418
|
+
Some("/app/ffmpeg".into()),
|
|
419
|
+
None,
|
|
420
|
+
only(&["/opt/ff/ffmpeg", "/app/ffmpeg"]),
|
|
421
|
+
);
|
|
422
|
+
assert_eq!(found.expect("found"), PathBuf::from("/opt/ff/ffmpeg"));
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
#[test]
|
|
426
|
+
fn a_named_ffmpeg_that_is_not_there_is_an_error_not_a_fallback() {
|
|
427
|
+
let err = pick(
|
|
428
|
+
Some("/nope/ffmpeg".into()),
|
|
429
|
+
Some("/app/ffmpeg".into()),
|
|
430
|
+
None,
|
|
431
|
+
only(&["/app/ffmpeg"]),
|
|
432
|
+
)
|
|
433
|
+
.expect_err("fails");
|
|
434
|
+
assert!(err.to_string().contains("FLOWPROOF_FFMPEG"), "{err}");
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
#[test]
|
|
438
|
+
fn the_bundled_ffmpeg_wins_over_one_on_path() {
|
|
439
|
+
let found = pick(
|
|
440
|
+
None,
|
|
441
|
+
Some(PathBuf::from("/app").join(BINARY)),
|
|
442
|
+
search_path(&["/usr/bin"]),
|
|
443
|
+
|p| p == Path::new("/app").join(BINARY) || p == Path::new("/usr/bin").join(BINARY),
|
|
444
|
+
);
|
|
445
|
+
assert_eq!(found.expect("found"), PathBuf::from("/app").join(BINARY));
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
#[test]
|
|
449
|
+
fn path_is_searched_in_order_when_nothing_is_bundled() {
|
|
450
|
+
let found = pick(
|
|
451
|
+
None,
|
|
452
|
+
Some(PathBuf::from("/app").join(BINARY)),
|
|
453
|
+
search_path(&["/a", "/b", "/c"]),
|
|
454
|
+
|p| p == Path::new("/b").join(BINARY) || p == Path::new("/c").join(BINARY),
|
|
455
|
+
);
|
|
456
|
+
assert_eq!(found.expect("found"), PathBuf::from("/b").join(BINARY));
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/// A Windows Game Bar style recording, as ffmpeg 9 describes it.
|
|
460
|
+
const H264_MP4: &str = "Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file:/Users/me/SWFL Aufzeichnung.mp4':
|
|
461
|
+
Metadata:
|
|
462
|
+
major_brand : isom
|
|
463
|
+
Duration: 00:01:24.37, start: 0.000000, bitrate: 1478 kb/s
|
|
464
|
+
Stream #0:0[0x1](und): Video: h264 (avc1 / 0x31637661), yuv420p(progressive), 1914x1074 [SAR 1:1 DAR 319:179], 1333 kb/s, 30 fps, 30 tbr, 15360 tbn (default)
|
|
465
|
+
At least one output file must be specified
|
|
466
|
+
";
|
|
467
|
+
|
|
468
|
+
#[test]
|
|
469
|
+
fn a_recording_reads_as_its_length_size_and_codec() {
|
|
470
|
+
assert_eq!(
|
|
471
|
+
parse_probe(H264_MP4).expect("parses"),
|
|
472
|
+
Probe {
|
|
473
|
+
duration_ms: 84_370,
|
|
474
|
+
width: 1914,
|
|
475
|
+
height: 1074,
|
|
476
|
+
codec: "h264".into(),
|
|
477
|
+
}
|
|
478
|
+
);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/// Sound first, picture second, and a colour description whose commas
|
|
482
|
+
/// sit inside brackets: the picture is still found and sized.
|
|
483
|
+
#[test]
|
|
484
|
+
fn the_picture_is_found_behind_a_sound_track() {
|
|
485
|
+
let text = "Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file:/v/iphone.mov':
|
|
486
|
+
Duration: 00:00:12.50, start: 0.000000, bitrate: 8000 kb/s
|
|
487
|
+
Stream #0:0[0x1](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
|
|
488
|
+
Stream #0:1[0x2](und): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, bt709), 1920x1080, 7800 kb/s, 60 fps (default)
|
|
489
|
+
";
|
|
490
|
+
let read = parse_probe(text).expect("parses");
|
|
491
|
+
assert_eq!(
|
|
492
|
+
(read.codec.as_str(), read.width, read.height),
|
|
493
|
+
("hevc", 1920, 1080)
|
|
494
|
+
);
|
|
495
|
+
assert_eq!(read.duration_ms, 12_500);
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/// MediaRecorder's webm states no length; the probe leaves it for
|
|
499
|
+
/// [`Ffmpeg::measure`] rather than calling the video empty.
|
|
500
|
+
#[test]
|
|
501
|
+
fn a_browser_recording_with_no_stated_length_reads_as_zero() {
|
|
502
|
+
let text = "Input #0, matroska,webm, from 'file:/tmp/rec.webm':
|
|
503
|
+
Duration: N/A, start: 0.000000, bitrate: N/A
|
|
504
|
+
Stream #0:0(eng): Video: vp8, yuv420p(progressive), 320x180, SAR 1:1 DAR 16:9, 15 fps, 15 tbr, 1k tbn (default)
|
|
505
|
+
";
|
|
506
|
+
let read = parse_probe(text).expect("parses");
|
|
507
|
+
assert_eq!(read.duration_ms, 0);
|
|
508
|
+
assert_eq!(
|
|
509
|
+
(read.codec.as_str(), read.width, read.height),
|
|
510
|
+
("vp8", 320, 180)
|
|
511
|
+
);
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
#[test]
|
|
515
|
+
fn a_file_that_is_not_a_video_says_why_without_the_path() {
|
|
516
|
+
let err =
|
|
517
|
+
parse_probe("file:/Users/me/notes.txt: Invalid data found when processing input\n")
|
|
518
|
+
.expect_err("fails");
|
|
519
|
+
assert_eq!(err, "Invalid data found when processing input");
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
#[test]
|
|
523
|
+
fn a_sound_only_file_has_no_video_in_it() {
|
|
524
|
+
let text = "Input #0, mp3, from 'file:/v/voice.mp3':
|
|
525
|
+
Duration: 00:00:30.00, start: 0.000000, bitrate: 128 kb/s
|
|
526
|
+
Stream #0:0: Audio: mp3 (mp3float), 44100 Hz, stereo, fltp, 128 kb/s
|
|
527
|
+
";
|
|
528
|
+
assert_eq!(
|
|
529
|
+
parse_probe(text).expect_err("fails"),
|
|
530
|
+
"it has no video in it"
|
|
531
|
+
);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
#[test]
|
|
535
|
+
fn progress_reads_as_the_furthest_point_reached() {
|
|
536
|
+
let text = "frame=0\nout_time_us=N/A\nprogress=continue\nout_time_us=2000000\nout_time_us=4066000\nprogress=end\n";
|
|
537
|
+
assert_eq!(parse_progress(text), Some(4066));
|
|
538
|
+
assert_eq!(parse_progress("progress=end\n"), None);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
#[test]
|
|
542
|
+
fn a_name_with_a_colon_is_opened_as_a_file() {
|
|
543
|
+
assert_eq!(
|
|
544
|
+
input(Path::new("clip 10:30.mp4")),
|
|
545
|
+
OsString::from("file:clip 10:30.mp4")
|
|
546
|
+
);
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
#[test]
|
|
550
|
+
fn a_frame_for_the_model_is_scaled_then_cut_to_what_was_kept() {
|
|
551
|
+
let crop = Crop {
|
|
552
|
+
x: 0,
|
|
553
|
+
y: 12,
|
|
554
|
+
width: 1280,
|
|
555
|
+
height: 640,
|
|
556
|
+
};
|
|
557
|
+
assert_eq!(
|
|
558
|
+
picture_filter((1280, 718), Some(crop), Format::Jpeg),
|
|
559
|
+
"scale=1280:718:flags=area,crop=1280:640:0:12"
|
|
560
|
+
);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
#[test]
|
|
564
|
+
fn a_thumbnail_turns_grey_and_is_sampled_not_averaged() {
|
|
565
|
+
assert_eq!(
|
|
566
|
+
picture_filter((128, 71), None, Format::Gray),
|
|
567
|
+
"format=gray,scale=128:71:flags=neighbor"
|
|
568
|
+
);
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
#[test]
|
|
572
|
+
fn a_seek_is_to_the_exact_millisecond() {
|
|
573
|
+
assert_eq!(seconds(84_270), "84.270");
|
|
574
|
+
assert_eq!(seconds(5), "0.005");
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
#[test]
|
|
578
|
+
fn no_ffmpeg_anywhere_says_how_to_get_one() {
|
|
579
|
+
let err = pick(None, None, search_path(&["/a"]), |_| false).expect_err("fails");
|
|
580
|
+
assert!(matches!(err, AdapterError::NoFfmpeg(_)));
|
|
581
|
+
assert!(err.to_string().contains("Reinstall flowproof"), "{err}");
|
|
582
|
+
}
|
|
583
|
+
}
|