Skip to content

Fix v1.0.179: backlog cleanup — base URL entry, unicode ledger, linger race, latent crashes, test flakiness - #250

Merged
robertohluna merged 2 commits into
mainfrom
fix/backlog-cleanup
Sep 5, 2026
Merged

Fix v1.0.179: backlog cleanup — base URL entry, unicode ledger, linger race, latent crashes, test flakiness#250
robertohluna merged 2 commits into
mainfrom
fix/backlog-cleanup

Conversation

@robertohluna

Copy link
Copy Markdown
Contributor

Clears the remaining pre-existing open issues carried since before v1.0.177.

Fixed

# Area Fix
#205 TUI onboarding Provider base URL was unreachable — input went to the API-key field when a provider needed both key and URL, and Tab was stolen by key-masking. Tab/Up/Down now move between fields, Ctrl+R toggles visibility, base URL is validated with guidance. (external user report)
#212 FileState NFD unicode filenames on Linux weren't recorded in the read-ledger (NFC key vs on-disk NFD path). Split fs_path/1 (no normalization) from key_path/1 (NFC key). Proven fail-without-fix on real Linux via Docker.
#248 security attack_orchestrator.ex had 4 reachable crashes (2 undefined calls + wrong weapon shape + BadMapError). Wired to the real ClassQueue.put/3; dead paths removed; no capability changed.
#179 orchestrator Linger "resident reuse" race — the Registry key was registered inside an unsynchronized spawn, so a fast resume could terminate the resident it should reuse. start_linger now waits (bounded) for the key to be observable before reporting :lingering.
#208 test integrity Fixed 4 flakes: computer_use_test (function_exported? without ensure_loaded? → phantom "missing get_tree/0"), anti_flagging_test (inline restore of a global on failure), Sandbox.CostTracker (per-test start_link linked to the ephemeral test proc → "no process"; now persistent in test_helper, 4/5 → 8/8), plus an audit of put_env/ets/persistent_term.

Verification

Full suite: 10,972 tests, 0 real failures. (ToolchainPinTest fails only on a dev box whose Elixir ≠ the pinned version; passes in CI.) Each fix has a regression test; #212 and #248 verified fail-without-fix, #179 verified by construction + no local regression.

⚠️ One judgment call for the reviewer — StaticBaseSizeTest

The :native_tools static-prompt bound was raised 10,000 → 11,500. Two parts:

  1. Measurement fix (unambiguous): the test was measuring the developer's personal ~/.osa/rules (~1.6k tokens, machine-specific). Now pins OSA_HOME to an empty dir → product-only, deterministic base of 10,563 tokens.
  2. Threshold raise (the judgment call): the product base legitimately exceeds the old 10k fence. Audited — the growth is the SYSTEM_LEAN.md "Operating discipline" safety pre-brief (prompt-injection defense, verify-recalled-path, shell hygiene — none duplicated elsewhere) + a larger tool roster; only ~40 tokens are actual duplicate. Trimming to the old number would delete real safety guidance. The fence still catches future prose creep.

If you'd rather keep the fence at ~8–10k and trim the prompt instead, say so and it's a separate change.

…nger race, latent crashes, test flakiness

Clears the remaining pre-existing open issues carried since before v1.0.177.

User-facing bugs
- #205 provider base URL was unreachable in TUI onboarding: input routed to the
  API-key field whenever a provider needed BOTH a key and a base URL (custom /
  OpenAI-compatible), and Tab was bound to key-masking so focus could not move.
  Tab/Up/Down now move between the key and URL fields, Ctrl+R toggles key
  visibility, and submission validates a required base URL with actionable
  guidance. (priv/rust/tui/src/dialogs/onboarding.rs, view/onboarding_flow.rs)
- #212 FileState read-ledger missed NFD unicode filenames on Linux: the ledger
  key and the filesystem path were both NFC-normalized, so a rescued read
  recorded against the on-disk NFD name was stat'd under a non-existent NFC path
  and silently not recorded, then the edit was rejected as "never read". Split
  into fs_path/1 (no normalization, for FS ops) and key_path/1 (NFC, ledger key
  only). Proven fail-without-fix on real Linux (Docker).

Correctness / latent crashes
- #248 attack_orchestrator.ex execute_sequence/1 had four reachable crashes
  (undefined AttackTree.next_classes/2 and ClassQueue.enqueue/2, a wrong weapon
  shape raising KeyError, and a BadMapError updating a list with map syntax).
  Wired to the real ClassQueue.put/3, removed dead paths, no capability changed.
- #179 subagent linger "resident reuse" race: the linger Registry key was
  registered inside an unsynchronized spawn, so under load a fast resume missed
  it, fell to run_fresh_subagent, and terminated the very resident it should
  reuse. start_linger now waits (bounded) for the key to be observable before
  reporting :lingering. Load-dependent, so verified by construction + no local
  regression.

Test integrity (#208)
- computer_use_test used function_exported?/3 without Code.ensure_loaded? — a
  phantom "missing get_tree/0" in full-suite runs (get_tree/0 exists). Guarded.
- anti_flagging_test restored a deleted global :openai_api_key inline, leaking it
  on any assertion failure; moved to on_exit. Audited put_env/ets/persistent_term
  across test/.
- Sandbox.CostTracker singleton was start_link'd per-test (linked to the
  ephemeral test process), so it died mid-run and a concurrent call hit
  "no process". Started once persistently in test_helper. 4/5 -> 8/8 stable.
- StaticBaseSizeTest measured the developer's personal ~/.osa/rules (machine-
  specific, ~1.6k tokens), making the base swing 10.5k-12k. Now pins OSA_HOME to
  an empty dir so the base is product-only and deterministic (10,563 tokens).
  The :native_tools bound moved 10_000 -> 11_500 on audited legitimate growth
  (the SYSTEM_LEAN "Operating discipline" safety pre-brief + a larger tool
  roster; only ~40 tokens were duplicate). It remains a regression fence.

Full suite: 10,972 tests, 0 real failures (ToolchainPinTest fails only on a dev
machine whose Elixir differs from the pinned version; it passes in CI).
@github-actions github-actions Bot added area/priv priv resources area/lib Core library code area/tui Rust TUI labels Sep 5, 2026
The screenshot test's case already documents {:error, _} as acceptable on a
headless runner, but ComputerUse.execute raises a RuntimeError by design when no
DISPLAY/WAYLAND_DISPLAY is present, so the raise escaped the case and failed the
test. It was green on the v1.0.178 CI runner and red on the next one with the
same product code — a display-dependent #208 flake. Tolerate the intended
no-display raise as the same acceptable outcome; the happy path still asserts a
real image when a display is present.
@robertohluna
robertohluna merged commit 16d96e8 into main Sep 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/lib Core library code area/priv priv resources area/tui Rust TUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant