Skip to content

fix: comprehensive audit remediation (2026-08-05) — flaky tests, export validation, agent tool gating, storage pane - #236

Closed
appergb wants to merge 197 commits into
mainfrom
audit/remediation-2026-08-05
Closed

fix: comprehensive audit remediation (2026-08-05) — flaky tests, export validation, agent tool gating, storage pane#236
appergb wants to merge 197 commits into
mainfrom
audit/remediation-2026-08-05

Conversation

@appergb

@appergb appergb commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Summary

Comprehensive evidence-driven audit remediation batch produced from 8 module audits (domain/ops, persistence/media, render/playback/export, agent/gen, core/tauri, web, tests/CI/release, upstream comparison).

Local validation (all green)

  • cargo fmt --all --check: PASS
  • cargo clippy --workspace --all-targets -- -D warnings: PASS
  • cargo test --workspace -- --test-threads=1: PASS
  • pnpm test: 134 files / 1114 tests PASS
  • pnpm build: PASS (pre-existing chunk warnings only)
  • git diff --check, check_windows_product_ci.py + unit tests: PASS

Key fixes

  • CI gates: cargo fmt gate was failing (fixed); Linux rust job workspace tests now serialized (--test-threads=1, mirroring windows-product) — eliminates load-sensitive flaky failures (ff.rs capture-limit + availability probe tests hardened, 22+ consecutive parallel passes); provisioner unit tests wired into CI; web job frozen-lockfile.
  • Export correctness: produced files now ffprobe-validated (streams/codec/duration) before success; export fails closed when no system fonts would render text blank.
  • Agent: smart_reframe no longer advertised-but-always-failing — gated behind a VisionBridge capability (base ALL 39→38, KNOWN 54 unchanged); new test: no advertised tool unconditionally fails.
  • Media: LibraryStore::remove cleanup failures now logged; cache_key parse panic removed.
  • Ops: dead ripple test removed + real validate_shifts coverage; snap re-stick test added.
  • Core/web: project_saved event wired to frontend; new read-only generation_log command + Home generation activity UI (upstream semantic port).
  • Web UX: MediaPanel view/sort/filter implemented (were dead buttons); SaveAsProgress/AiEditTab i18n; AiEdit heuristic disclosure; 24px AgentPanel hit target.
  • Settings: new Storage pane (usage + guarded clear, models require confirm) — upstream StoragePane semantic port.
  • Docs: tool counts (44 advertised / 54 KNOWN), secret whitelist, project deps, search-model external-hosting status corrected to match code.

Notes

  • Base: main (currently 185 commits behind this branch — branch contains the full agent/advanced-ai-workflows delta + this batch).
  • Upstream comparison: no substantive editing-core behavioral gaps; cloud surfaces deliberately re-architected (BYOK + Codex CLI).

baiqing added 30 commits July 29, 2026 16:01
baiqing added 28 commits August 2, 2026 02:48
Consolidates the Beta-2 working-tree state (advanced AI workflows, security
hardening, per-turn MCP binding, redaction, safe asset protocol, path policy,
process tree, media catalog) with the audit remediation:

- fmt: format media_bridge/project_root/codex (CI fmt gate was failing)
- tests: harden 2 load-sensitive ffprobe tests (capture-limit + availability
  probe); remove dead ripple_delete test, add real validate_shifts coverage
- CI: serialize Linux workspace tests (--test-threads=1), wire provisioner
  unit tests, frozen-lockfile web install
- export: ffprobe-validate produced files (streams/codec/duration); fail
  closed on fontless text export
- agent: gate smart_reframe behind VisionBridge capability (was advertised
  but always failing; ALL 39->38, KNOWN 54 unchanged)
- media: log LibraryStore::remove cleanup failures; panic-free cache_key
- core/web: wire project_saved event; add read-only generation_log command
  + Home generation activity UI (upstream semantic port)
- web: real view/sort/filter in MediaPanel; i18n SaveAsProgress/AiEditTab;
  AiEdit heuristic disclosure; 24px AgentPanel close target
- settings: new Storage pane (usage + guarded clear) - upstream StoragePane
  semantic port
- docs: tool counts 44/54, secret whitelist, project deps, search model
  status, storage/project overviews
- dispatch-tools.md: ALL 38, add VISION constant, 13 advertised extensions
- README.md: 44 compatible tools (was 45)
…nformationByHandle

project_root.rs and home.rs used MetadataExt::volume_serial_number/file_index
(std issue rust-lang/rust#63010, nightly-only) in their Windows identity
branches — never compiled on macOS, broke all 4 Windows CI jobs with E0658.
Mirror the proven safe_asset_protocol.rs pattern (BY_HANDLE_FILE_INFORMATION).
Verified: opentake-project cargo check --target x86_64-pc-windows-msvc passes.
…test

- safe_asset_protocol.rs: DRIVE_FIXED/DRIVE_REMOVABLE are not exported from
  Win32::Storage::FileSystem in windows-sys 0.61 (E0432) — define locally,
  matching safe_fs/windows.rs.
- project_root.rs test: on Windows cap-std opens retained dir handles without
  FILE_SHARE_DELETE, so the namespace cannot be rebound while open (rename
  fails closed with sharing violation). Split the rebind test: Unix asserts
  stays-bound-after-rebind; Windows asserts the stronger fail-closed property
  (rename blocked while retained, works after drop).
- process_tree.rs: Job Object HANDLE is *mut c_void (not Send); codex/chat
  commands hold ProcessTree across await -> 9 E0277 errors on Windows only.
  Add justified unsafe impl Send (exclusive ownership, close-once).
- codex.rs:11: std::process::Command test import is unix-only -> cfg(all(test, unix))
- fs_availability.rs: drop unused CloudFilters/FileSystem constants (bit masks
  are hardcoded with explicit values)
- safe_asset_protocol.rs: parent-identity test helpers are non-Windows-only
- home.rs: metadata fetch moved into the unix branch (unused on Windows)
- domain/media.rs to_manifest_entry: stripped project-relative path used the
  host separator ('\' on Windows), rejected by path_policy -> 6 library test
  failures. Normalize to forward slashes (bundle paths travel platforms);
  add cfg(windows) regression test.
- fs_availability.rs: needless_return in Windows-only branch (clippy -D).
- codex.rs: run_agent_turn_with_executable is unix-test-only -> cfg(all(test, unix)).
The round-4 restructure renamed the cfg(not(macos)) param to ; on
Linux the Windows-only usage is compiled out -> unused-variable warning ->
clippy -D warnings failure. Keep the  underscore name.
TestTurnGate and turn_context are only used by unix shell-script tests;
after gating run_agent_turn_with_executable to unix they are dead on
Windows test builds (clippy -D dead_code).
After gating TestTurnGate/turn_context to unix, AppCoreHandle/CoreHandle,
ToolResult and AppCore imports are unused on Windows test builds.
…tability

- ff.rs: availability-probe and cancellable-ffprobe tests asserted immediate
  pid death; SIGKILLed orphans linger as zombies until init reaps them, so
  kill -0 still succeeds under loaded CI (2 Linux failures). Poll with a
  bounded deadline, mirroring assert_capture_limit_kills_tree. Also relax the
  nonreturning_wait elapsed bound (2s->5s) — the deadline-fires assertion is
  unchanged.
- Windows rebind tests (prepared_project_detects..., mcp inspect_project_media
  ..., safe_asset_protocol project_helper_rejects...) renamed bundles while
  retained handles were open — cap-std strips FILE_SHARE_DELETE so Windows
  fails those renames closed. Split each into cfg(unix) (original rebind
  assertion) + cfg(windows) (fail-closed rename-blocked assertion).
Only the cfg(unix) project_helper_rejects_an_ambient_bundle_replacement test
uses it; on Windows test builds the cfg(test) import was unused.
… loaded CI)

Two consecutive windows-product failures hit the two documented
environment-flaky chromium tests (audit G): virtual_time_... Timeout(20s) at
chromium.rs:80 and sandbox_progress_... render timed out after 90s. Both pass
in the fresh-state dedicated steps minutes earlier, then time out inside the
workspace sequence on a loaded runner.

- chromium.rs test helper timeouts 20s -> 60s (timeout SEMANTICS are still
  asserted by the deliberate 500ms timeout test)
- production motion sandbox deadline 90s -> 180s (complex renders on slow or
  loaded machines; still fail-closed)
cargo test --workspace stops at the first failing target, so security_config
never ran on Windows CI until the motion-timeout fix let the workspace step
reach it. The include_str!(lib.rs) assertion searched for '\n            "opentake-asset",'
but Windows git materializes CRLF (no .gitattributes) — normalize line
endings before matching.
@appergb

appergb commented Aug 8, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #237, which contains the final reviewed fixes, exact-SHA CI/release workflow, updated Windows logic contracts, and current v1.0.0-beta.2 verification evidence.

@appergb appergb closed this Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant