Skip to content

fix(ci): restore main coverage across PostgreSQL and workspace E2E - #6893

Merged
ilblackdragon merged 1 commit into
mainfrom
agent/fix-main-coverage-collation
Jul 30, 2026
Merged

ilblackdragon merged 1 commit into
mainfrom
agent/fix-main-coverage-collation

Conversation

@ilblackdragon

Copy link
Copy Markdown
Member

Summary

  • add a forward PostgreSQL migration that gives ordered-projection paths the same bytewise "C" collation as authoritative filesystem paths
  • repair the long-prefix ordered-query contract case so it uses a valid ordering shape
  • update the workspace accessibility scenario to assert preserved branch expansion and a single roving tab stop
  • fix the Code Coverage failures observed on main after Fix Windows clippy for legacy skill backfill imports #6890

Change Type

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • CI/Infrastructure
  • Security
  • Dependencies

Linked Issue

Related #6890

Validation

  • cargo fmt --all -- --check
  • cargo clippy --all --benches --tests --examples --all-features -- -D warnings
  • cargo build
  • Relevant tests pass: full ironclaw_filesystem crate suite against PostgreSQL; the exact filesystem suite under LLVM coverage; the failing Playwright scenario
  • cargo test --features integration if database-backed or integration behavior changed
  • Manual testing: applied V34 idempotently to an already-populated pgvector/pgvector:pg16 database and verified the projection path collation is C; also applied the embedded migration chain to a fresh database
  • If a coding agent was used and supports it, review-pr or pr-shepherd --fix was run before requesting review

Additional lint evidence: cargo clippy -p ironclaw_filesystem --all-targets --all-features -- -D warnings.

Test Strategy

User behavior: Ordered filesystem queries return projected descendants consistently regardless of the PostgreSQL database locale. Selecting a workspace file keeps manually expanded sibling branches visible while maintaining one keyboard tab stop.

Risk areas:

  • Model behavior
  • Browser
  • Side effect
  • Persistence
  • Security or permissions
  • External provider
  • Cross-component behavior

Tests added or updated:

  • Unit or contract: updated postgres_ordered_index_projects_rows_under_long_prefixes; existing keyset and no-backfill PostgreSQL contracts reproduce the locale regression and pass after V34.
  • Reborn integration: Not applicable: no turn, runner, capability, or product-orchestration behavior changed.
  • Recorded fixture: Not applicable: no model request or tool-choice behavior changed.
  • Browser E2E: updated test_workspace_tree_keyboard_navigation_and_accessibility to assert the preserved expanded item remains visible, unselected, and outside the roving tab stop.
  • Backend or runtime: ran the full filesystem crate against PostgreSQL and the complete DB contract test binary under LLVM coverage using the same pgvector/pgvector:pg16 image as CI.
  • Live canary: Not applicable: the failure is hermetically reproducible with local PostgreSQL and Playwright fixtures.

What the tests prove: V34 repairs bytewise descendant ranges on both fresh and populated locale-backed databases; ordered projections remain write-maintained without backfill; valid keyset pagination returns rows; the workspace tree preserves expansion without creating a second tab stop.

Commands run:

  • DATABASE_URL=postgres://... IRONCLAW_REQUIRE_POSTGRES=1 cargo llvm-cov test -p ironclaw_filesystem --test db_root_filesystem_contract -- --nocapture
  • DATABASE_URL=postgres://... IRONCLAW_REQUIRE_POSTGRES=1 cargo test -p ironclaw_filesystem
  • python3 -m pytest tests/e2e/scenarios/test_reborn_v2_file_download.py::test_workspace_tree_keyboard_navigation_and_accessibility -v --timeout=120
  • cargo fmt --all -- --check
  • git diff --check
  • cargo clippy -p ironclaw_filesystem --all-targets --all-features -- -D warnings

Security Impact

None. This does not change permissions, network access, secrets, sandboxing, or tool execution.

Reborn Trust-Boundary Checklist

N/A: this patch changes a PostgreSQL path collation migration and test assertions only. It introduces no trust-bearing types, prompt content, hashes, status/error variants, queues, drivers, or host/sandbox boundaries.

Database Impact

Adds PostgreSQL migration V34. It changes root_filesystem_ordered_index_rows.path from the database-default collation to "C", matching root_filesystem_entries.path. Stored values and projection rows are unchanged. PostgreSQL may rebuild the dependent primary-key index and takes the schema lock required by ALTER COLUMN; the migration is conditional and idempotent. libSQL is unaffected because its ordered path comparisons are already bytewise.

Blast Radius

PostgreSQL ordered exact/prefix filesystem projections and the workspace-tree E2E assertion. The migration can briefly block concurrent access while PostgreSQL alters the column and rebuilds dependent indexes. No trait, dependency, serialization, or product contract changes.

Rollback Plan

Revert the code/test commit after stopping ordered readers and writers, then apply the documented reverse DDL to restore root_filesystem_ordered_index_rows.path to COLLATE "default"; recreate dependent indexes if PostgreSQL reports them invalidated. Existing rows require no data conversion. Rolling back reintroduces locale-dependent descendant-query failures, so it is operationally safe only where the database default collation has compatible bytewise ordering.

Review Follow-Through

Reviewer judgment requested on the migration lock window for unusually large ordered-projection tables. No data rewrite or backfill is introduced, and the exact main-coverage failures are reproduced and fixed locally.


Review track: C (DB/CI)

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 56712c58-70e5-4154-ad17-6466e0910317

📥 Commits

Reviewing files that changed from the base of the PR and between 62cf5fe and 19faaca.

📒 Files selected for processing (4)
  • crates/ironclaw_filesystem/src/postgres.rs
  • crates/ironclaw_filesystem/tests/db_root_filesystem_contract.rs
  • migrations/V34__root_filesystem_ordered_index_path_collation.sql
  • tests/e2e/scenarios/test_reborn_v2_file_download.py

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Improved ordered file-system path comparisons to use consistent bytewise ordering, helping ensure reliable results for paths with long shared prefixes.
    • Updated keyboard navigation behavior so previously focused directory entries remain visible while correctly becoming unselected and non-focusable.
  • Tests

    • Expanded coverage for ordered path queries and accessibility-focused directory navigation.

Walkthrough

The PR adds a conditional PostgreSQL migration for bytewise ordering of root filesystem paths, wires it into the migration schema, broadens the related ordered-query test, and updates a file-download accessibility E2E expectation.

Changes

Root filesystem collation

Layer / File(s) Summary
Collation migration and ordered-query validation
migrations/V34__root_filesystem_ordered_index_path_collation.sql, crates/ironclaw_filesystem/src/postgres.rs, crates/ironclaw_filesystem/tests/db_root_filesystem_contract.rs
The V34 migration conditionally applies "C" collation to root_filesystem_ordered_index_rows.path, the migration is added to the schema string, and the ordered-query test uses Filter::All.

File download accessibility state

Layer / File(s) Summary
Tree selection expectation
tests/e2e/scenarios/test_reborn_v2_file_download.py
The guide tree item is expected to remain visible while becoming unselected and non-focusable.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: italic-jinxin


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@railway-app

railway-app Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the ironclaw-pr-6893 environment in ironclaw-ci-preview

Service Status Web Updated (UTC)
ironclaw ✅ Success (View Logs) Web Jul 30, 2026 at 2:44 am

@railway-app
railway-app Bot temporarily deployed to ironclaw-ci-preview / ironclaw-pr-6893 July 30, 2026 02:34 Destroyed
@github-actions github-actions Bot added scope: db/postgres PostgreSQL backend DB MIGRATION PR adds or modifies PostgreSQL or libSQL migration definitions size: S 10-49 changed lines risk: low Changes to docs, tests, or low-risk modules contributor: core 20+ merged PRs labels Jul 30, 2026
@ironloopai

ironloopai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

🔎 Review · PR #6893

🟢 Completed · Review submitted

Submitted review →

Reviewed the complete trusted base-to-head comparison. The PostgreSQL collation migration is correctly wired after V33, conditionally updates existing schemas, and aligns ordered projection range comparisons with authoritative paths. The ordered-query and workspace accessibility test changes match their surrounding contracts. No actionable findings identified.

Automatic · PR opened · attempt 1 of 3 · completed in 1m 42s

Run details
  • Repository: nearai/ironclaw
  • Base: main at 62cf5fe
  • Head: agent/fix-main-coverage-collation at 19faaca
  • Created: Jul 30, 2026, 2:39 AM UTC
  • Updated: Jul 30, 2026, 2:41 AM UTC
  • Run: ba3cfbe8-d2c9-4fec-9bbb-86b7a20d1b6a
  • Latest attempt: 1 · Completed · abb02c9d-91c0-45cd-bd52-de6b14656e34

@ironloopai ironloopai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Review complete · PR #6893

✅ No actionable findings

Reviewed the complete trusted base-to-head comparison. The PostgreSQL collation migration is correctly wired after V33, conditionally updates existing schemas, and aligns ordered projection range comparisons with authoritative paths. The ordered-query and workspace accessibility test changes match their surrounding contracts. No actionable findings identified.

Validation and technical details
  • Inspected all four changed files and surrounding PostgreSQL migration, ordered-query, projection, and E2E code.
  • Verified the trusted comparison refs: 62cf5fe..19faaca.
  • Confirmed PostgreSQL supports changing a text column's collation while retaining the foreign-key relationship used by the ordered projection table.
  • git diff --check refs/ironloop/base..refs/ironloop/head passed.
  • python3 -m py_compile tests/e2e/scenarios/test_reborn_v2_file_download.py passed.
  • Rust and database-backed tests were not rerun because cargo and a PostgreSQL test connection were unavailable in the review environment.
  • Base: main
  • Head: agent/fix-main-coverage-collation at 19faaca
  • Run: ba3cfbe8-d2c9-4fec-9bbb-86b7a20d1b6a

@github-actions

Copy link
Copy Markdown
Contributor

Coverage ratchet

Ratchet mode: ENFORCING

RATCHET PASS: global
  observed: 85.53% (314903 / 368162 lines)
  floor:    85.11% (tolerance 0.5pp -> effective floor 84.61%)
  denominator: 368162 lines now vs 360961 at floor capture (+7201 lines, +1.99%) — not a material change

RATCHET PASS: ironclaw_runner
  observed: 86.82% (14550 / 16759 lines)
  floor:    83.58% (tolerance 0.5pp -> effective floor 83.08%)
  floor_covered_lines: 13083 (tolerance 20 lines -> effective floor 13063)
  denominator: 16759 lines now vs 15653 at floor capture (+1106 lines, +7.07%) — material change (>5%)

RATCHET PASS: ironclaw_processes
  observed: 88.05% (5838 / 6630 lines)
  floor:    82.29% (tolerance 0.5pp -> effective floor 81.79%)
  floor_covered_lines: 5140 (tolerance 20 lines -> effective floor 5120)
  denominator: 6630 lines now vs 6246 at floor capture (+384 lines, +6.15%) — material change (>5%)

RATCHET PASS: ironclaw_turns
  observed: 86.23% (9422 / 10927 lines)
  floor:    85.36% (tolerance 0.5pp -> effective floor 84.86%)
  floor_covered_lines: 9181 (tolerance 20 lines -> effective floor 9161)
  denominator: 10927 lines now vs 10755 at floor capture (+172 lines, +1.6%) — not a material change

⚠️ 2 Reborn crate(s) have 0 int-tier coverage (target: 0) — ironclaw_prompt_envelope, ironclaw_scripts

Reborn integration-tier coverage

Line coverage (Reborn crates): 85.53% — 314903 / 368162 lines

Per-crate breakdown (60 crates, lowest-covered first)
Crate Line % Covered / Total
ironclaw_prompt_envelope 0% 0 / 88
ironclaw_scripts 0% 0 / 345
ironclaw_process_sandbox 34.38% 120 / 349
ironclaw_host_ingress 42.5% 17 / 40
ironclaw_event_projections 43.51% 684 / 1572
ironclaw_libsql_runtime 59.91% 127 / 212
ironclaw_observability 61.54% 16 / 26
ironclaw_authorization 63.02% 610 / 968
ironclaw_memory 64.41% 959 / 1489
ironclaw_telegram_v2_adapter 69.69% 731 / 1049
ironclaw_trust 73.21% 664 / 907
ironclaw_wasm_limiter 74.6% 47 / 63
ironclaw_extractors 74.72% 538 / 720
ironclaw_capabilities 74.95% 2882 / 3845
ironclaw_projects 76.48% 400 / 523
ironclaw_mcp 76.6% 779 / 1017
ironclaw_filesystem 77.55% 5990 / 7724
ironclaw_reborn_cli 78.37% 10795 / 13774
ironclaw_wasm 79.72% 735 / 922
ironclaw_llm 80.82% 23319 / 28854
ironclaw_memory_native 81.02% 3299 / 4072
ironclaw_auth 81.88% 6679 / 8157
ironclaw_first_party_extensions 82.38% 6682 / 8111
ironclaw_host_api 83.68% 9728 / 11625
ironclaw_events 83.8% 1536 / 1833
ironclaw_reborn_identity 83.8% 450 / 537
ironclaw_operator 84.41% 5561 / 6588
ironclaw_secrets 84.56% 2798 / 3309
ironclaw_network 85.09% 959 / 1127
ironclaw_reborn_config 85.23% 2101 / 2465
ironclaw_skills 85.29% 4494 / 5269
ironclaw_telegram_extension 85.4% 1299 / 1521
ironclaw_extension_host 85.52% 19926 / 23299
ironclaw_approvals 86.08% 1818 / 2112
ironclaw_triggers 86.11% 2803 / 3255
ironclaw_turns 86.23% 9422 / 10927
ironclaw_reborn_composition 86.23% 22037 / 25556
ironclaw_webui 86.37% 11171 / 12934
ironclaw_hooks 86.73% 9950 / 11473
ironclaw_runner 86.82% 14550 / 16759
ironclaw_common 86.99% 1772 / 2037
ironclaw_reborn_event_store 87.19% 1327 / 1522
ironclaw_product 87.44% 21336 / 24402
ironclaw_extensions 87.45% 4927 / 5634
ironclaw_reborn_openai_compat 88% 3724 / 4232
ironclaw_processes 88.05% 5838 / 6630
ironclaw_reborn_traces 88.13% 11987 / 13601
ironclaw_threads 88.57% 4921 / 5556
ironclaw_host_runtime 89.09% 20539 / 23054
ironclaw_slack_extension 89.26% 2027 / 2271
ironclaw_conversations 90.03% 3171 / 3522
ironclaw_loop_host 90.82% 17597 / 19375
ironclaw_resources 90.84% 4474 / 4925
ironclaw_event_streams 91.24% 1063 / 1165
ironclaw_attachments 93.06% 630 / 677
ironclaw_outbound 93.91% 4101 / 4367
ironclaw_agent_loop 94.59% 10201 / 10785
ironclaw_safety 95.22% 3941 / 4139
ironclaw_first_party_extension_ports 95.71% 3837 / 4009
ironclaw_runtime_policy 96.56% 814 / 843

This table itself is informational and never gates the PR on its own — not the percentage, not the per-crate holes, not the 0-coverage callout. A separate coverage ratchet (dry-run until enforce=true; see tests/integration/coverage-floor.toml) can fail the build on specific configured floors.

Exemptions (3 entry/entries excluded from the accounting above)
Module / Crate Reason Issue
crate: ironclaw_embeddings v1-only: consumed only by root ironclaw (src/app.rs, src/tools/builtin/memory.rs, src/workspace/mod.rs, src/config/{mod,embeddings}.rs); no crates/* dependents. Covered by "Tests (Legacy)". #5657
crate: ironclaw_gateway v1-only: consumed only by root ironclaw (src/channels/web/platform/static_files.rs, src/channels/web/handlers/frontend.rs); no crates/* dependents. Covered by "Tests (Legacy)". #5657
crate: ironclaw_tui v1-only: consumed only by root ironclaw (src/main.rs, src/channels/tui.rs); no crates/* dependents. Crate's own doc comment confirms it bridges INTO v1, not Reborn. Covered by "Tests (Legacy)". #5657

@ilblackdragon
ilblackdragon marked this pull request as ready for review July 30, 2026 03:31
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@ilblackdragon
ilblackdragon merged commit f4542a6 into main Jul 30, 2026
65 of 66 checks passed
@ilblackdragon
ilblackdragon deleted the agent/fix-main-coverage-collation branch July 30, 2026 03:32
l3ocifer pushed a commit to l3ocifer/frick-ironclaw that referenced this pull request Sep 3, 2026

This branch was successfully deployed

No deployments
ironclaw-ci-preview / ironclaw-pr-6893 — 19faaca0 Deployed Jul 30, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: core 20+ merged PRs DB MIGRATION PR adds or modifies PostgreSQL or libSQL migration definitions risk: low Changes to docs, tests, or low-risk modules scope: db/postgres PostgreSQL backend size: S 10-49 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant