Skip to content

[codex] Refactor Reborn composition internals - #5585

Merged
ilblackdragon merged 6 commits into
mainfrom
codex/reborn-composition-dissection-pr-n3
Jul 4, 2026
Merged

ilblackdragon merged 6 commits into
mainfrom
codex/reborn-composition-dissection-pr-n3

Conversation

@serrrfirat

Copy link
Copy Markdown
Collaborator

Summary

Implements PR n3 of the Reborn composition dissection by grouping composition internals behind clearer module boundaries:

  • moves observability-owned code under observability/, including budget events, hooks, operator logs, lifecycle, trace capture, and trajectory observer wiring
  • moves outbound delivery preferences/capability surface under outbound/
  • moves filesystem support services/readers under support::fs
  • extracts local-dev budget gate evidence helpers out of runtime.rs
  • keeps caller-facing imports on module-level reexports to avoid leaking leaf file layout into composition callers
  • fixes live projection publisher sequencing so multiple publisher instances share one monotonic sequence counter

Review cleanup

After the maintainability pass, this PR intentionally does not include unrelated HTML-to-Markdown golden fixture churn or a post-refactor composition-pubuse.snapshot baseline.

Validation

  • cargo fmt --check
  • git diff --check
  • cargo clippy -p ironclaw_reborn_composition --all-targets --features "webui-v2-beta root-llm-provider slack-v2-host-beta openai-compat-beta libsql postgres test-support"
  • env -u NEARAI_API_KEY -u NEARAI_BASE_URL -u NEARAI_API_BASE_URL -u LLM_BACKEND -u LLM_USE_CODEX_AUTH cargo test -p ironclaw_reborn_composition --features "webui-v2-beta root-llm-provider slack-v2-host-beta openai-compat-beta libsql postgres test-support" -- --test-threads=1

Note: the unsanitized local shell has NEARAI_API_KEY, LLM_BACKEND, and LLM_USE_CODEX_AUTH set, which makes existing env-sensitive provider tests fail. The full composition suite passes with those env vars removed.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: daad1b27-1f78-40b8-8089-63c4aa43ab66

📥 Commits

Reviewing files that changed from the base of the PR and between cbab3ad and 62d193d.

📒 Files selected for processing (13)
  • crates/ironclaw_architecture/tests/reborn_dependency_boundaries.rs
  • crates/ironclaw_reborn_composition/src/factory.rs
  • crates/ironclaw_reborn_composition/src/lib.rs
  • crates/ironclaw_reborn_composition/src/observability/operator_logs.rs
  • crates/ironclaw_reborn_composition/src/projection/tests/live_progress_stream.rs
  • crates/ironclaw_reborn_composition/src/runtime.rs
  • crates/ironclaw_reborn_composition/src/runtime/local_dev.rs
  • crates/ironclaw_reborn_composition/src/runtime/local_dev/outbound_delivery.rs
  • crates/ironclaw_reborn_composition/src/slack_host_beta.rs
  • crates/ironclaw_reborn_composition/src/slack_host_beta/runtime_setup.rs
  • crates/ironclaw_reborn_composition/src/slack_outbound_targets.rs
  • crates/ironclaw_reborn_composition/src/test_support/outbound_delivery.rs
  • crates/ironclaw_reborn_composition/src/webui.rs
💤 Files with no reviewable changes (11)
  • crates/ironclaw_reborn_composition/src/slack_outbound_targets.rs
  • crates/ironclaw_reborn_composition/src/runtime/local_dev/outbound_delivery.rs
  • crates/ironclaw_reborn_composition/src/slack_host_beta/runtime_setup.rs
  • crates/ironclaw_reborn_composition/src/slack_host_beta.rs
  • crates/ironclaw_reborn_composition/src/test_support/outbound_delivery.rs
  • crates/ironclaw_reborn_composition/src/projection/tests/live_progress_stream.rs
  • crates/ironclaw_reborn_composition/src/runtime/local_dev.rs
  • crates/ironclaw_reborn_composition/src/factory.rs
  • crates/ironclaw_reborn_composition/src/webui.rs
  • crates/ironclaw_reborn_composition/src/lib.rs
  • crates/ironclaw_reborn_composition/src/runtime.rs

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added broader observability and runtime wiring, improving trace, budget, hook, and operator logging support across the app.
    • Added support for local-dev resource gate evidence and shared outbound delivery access points.
  • Bug Fixes

    • Updated module paths and runtime wiring so local development, WebUI, and outbound delivery flows continue to work after the internal reorganization.
    • Fixed a monotonic live-update sequence issue so streamed progress events stay in order across publishers.
  • Tests

    • Added regression coverage for live progress sequencing and malformed budget gate references.

Walkthrough

Reorganizes ironclaw_reborn_composition internal modules under new observability, support::fs, and outbound trees, updating dozens of import/re-export paths accordingly. Adds a local-dev budget-gate evidence adapter, a live-projection-sequence regression test, one boundary-test allowlist update, and switches two benchmarks' black_box import source.

Changes

Reborn composition module reorg and related fixes

Layer / File(s) Summary
Crate root and observability module surfaces
crates/ironclaw_reborn_composition/src/lib.rs, .../observability/mod.rs, .../observability/hooks/{audit.rs,mod.rs}
Removes prior top-level module declarations, adds the observability module tree, and remaps public re-exports (budget, hooks, operator logs, trajectory observer) to observability::*.
Outbound entrypoint and import rewires
.../outbound/mod.rs, .../runtime/approval.rs, .../runtime/local_dev*, .../slack_host_beta*, .../slack_outbound_targets.rs, .../test_support/outbound_delivery.rs, .../runtime/tests/outbound_delivery.rs
Introduces the outbound module entrypoint and switches call sites from outbound_delivery_capability_surface/outbound_preferences to crate::outbound.
support::fs filesystem and project-service wiring
.../support/{mod.rs,fs/*}, .../factory.rs, .../webui.rs, .../openai_compat_serve.rs
Declares the support::fs module tree and rewires attachment/filesystem/project-service construction in factory, WebUI, and OpenAI-compat code to use it.
Runtime observability wiring and local-dev budget gate evidence
.../observability/budget_evidence.rs, .../runtime.rs, .../runtime_input.rs, .../runtime/local_dev/refreshing_capability_port.rs
Adds local_dev_resource_gate_evidence and rewires runtime trace-capture, budget-event, hooks, and trajectory-observer paths to observability::*.
Shared live projection sequence regression test
.../projection/tests/live_progress_stream.rs
Adds a test confirming two publishers from the same RebornProjectionServices share a monotonic projection sequence.
Dependency boundary allowlist update
crates/ironclaw_architecture/tests/reborn_dependency_boundaries.rs
Updates the allowlisted source path for the moved trace_capture.rs.

Benchmark black_box import cleanup

Layer / File(s) Summary
black_box import source change
crates/ironclaw_safety/benches/{safety_check.rs,safety_pipeline.rs}
Switches black_box import from criterion to std::hint.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Runtime
  participant local_dev_resource_gate_evidence
  participant BudgetGateStore
  Runtime->>local_dev_resource_gate_evidence: pending_resource_gate(LoopGateRef)
  local_dev_resource_gate_evidence->>local_dev_resource_gate_evidence: budget_gate_id_from_gate_ref(ref)
  local_dev_resource_gate_evidence->>BudgetGateStore: lookup gate record
  BudgetGateStore-->>local_dev_resource_gate_evidence: BudgetGateRecord or error
  local_dev_resource_gate_evidence-->>Runtime: bool (status == Pending)
Loading

Possibly related issues

Possibly related PRs

  • nearai/ironclaw#4672: This PR moves the ProjectScopedAttachmentLander/ProjectScopedAttachmentReader types introduced there into the new crate::support::fs module.
  • nearai/ironclaw#4779: Both change outbound-delivery capability import paths in runtime/local_dev/outbound_delivery.rs.
  • nearai/ironclaw#4933: This PR's ProjectScopedFilesystemReader/WebUI filesystem wiring builds on the filesystem facade types added there.
🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description has Summary and Validation, but it omits required sections like Change Type, Linked Issue, and the trust-boundary checklist. Fill in the missing template sections, especially Change Type, Linked Issue, Security Impact, trust-boundary checklist, Database Impact, Blast Radius, Rollback Plan, and Review Follow-Through.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed Clear and directly matches the refactor of Reborn composition internals.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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 temporarily deployed to ironclaw-ci-preview / ironclaw-pr-5585 July 3, 2026 07:57 Destroyed
@github-actions github-actions Bot added size: L 200-499 changed lines risk: low Changes to docs, tests, or low-risk modules contributor: core 20+ merged PRs labels Jul 3, 2026

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request reorganizes the internal module structure of the ironclaw_reborn_composition crate, grouping related modules into new subdirectories: observability/, outbound/, and support/fs/. It also updates import paths across the codebase, changes the live progress sequence counter to be shared via Arc<AtomicU64>, and updates benchmark files to use std::hint::black_box. Feedback on the changes includes a recommendation to merge redundant imports from the newly created outbound module in webui.rs to improve readability.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +29 to +35
outbound::{
OutboundDeliveryTargetProvider, OutboundDeliveryTargetRegistry,
RebornOutboundPreferencesFacade,
},
outbound::{
outbound_delivery_synthetic_provider, outbound_delivery_target_set_operator_tool_info,
},

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.

medium

These imports from the outbound module are redundant and can be merged into a single block to improve readability and maintainability.

    outbound::{
        OutboundDeliveryTargetProvider, OutboundDeliveryTargetRegistry,
        RebornOutboundPreferencesFacade, outbound_delivery_synthetic_provider,
        outbound_delivery_target_set_operator_tool_info,
    },

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Addressed in 8e5defa — collapsed the duplicated outbound::{...} block in webui.rs into a single import group.

@serrrfirat
serrrfirat marked this pull request as ready for review July 3, 2026 07:58
@github-actions

github-actions Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ 3 Reborn crate(s) have 0 int-tier coverage (target: 0) — ironclaw_reborn_identity, ironclaw_reborn_traces, ironclaw_webui_v2

Reborn integration-tier coverage

Line coverage (Reborn crates): 16.89% — 10833 / 64125 lines

Per-crate breakdown (11 crates, lowest-covered first)
Crate Line % Covered / Total
ironclaw_reborn_identity 0% 0 / 230
ironclaw_reborn_traces 0% 0 / 6662
ironclaw_webui_v2 0% 0 / 2785
ironclaw_reborn_event_store 0.73% 6 / 825
ironclaw_reborn_config 1.31% 15 / 1142
ironclaw_product_adapter_registry 5.62% 25 / 445
ironclaw_product_workflow 7.21% 715 / 9910
ironclaw_product_adapters 12.55% 283 / 2255
ironclaw_reborn 23.46% 2036 / 8678
ironclaw_reborn_composition 24.83% 7742 / 31179
ironclaw_product_context 78.57% 11 / 14

This signal is informational: coverage never gates the PR — not the percentage, not the per-crate holes, not the 0-coverage callout.

@railway-app

railway-app Bot commented Jul 3, 2026 •

Copy link
Copy Markdown

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

Service Status Web Updated (UTC)
ironclaw ✅ Success (View Logs) Web Jul 3, 2026 at 11:58 pm

@railway-app
railway-app Bot temporarily deployed to ironclaw-ci-preview / ironclaw-pr-5585 July 3, 2026 08:32 Destroyed
@railway-app
railway-app Bot temporarily deployed to ironclaw-ci-preview / ironclaw-pr-5585 July 3, 2026 08:54 Destroyed
ilblackdragon and others added 2 commits July 3, 2026 23:46
Resolve conflicts from the composition module reorg landing alongside main:

- projection.rs: keep the shared `live_sequence` counter (main + PR both
  implement it; use the local binding so it isn't double-allocated)
- slack_host_beta.rs / slack_host_beta/runtime_setup.rs: keep the PR's
  `crate::outbound::` module rename while preserving main's newly-added
  `extension_lifecycle` / `RebornUserIdentityLookup` imports

Also repoint main's new `test_support/outbound_delivery.rs` from the moved
`crate::outbound_delivery_capability_surface::` path to
`crate::outbound::outbound_delivery_capability_surface::`, and address the
Gemini review note by collapsing the duplicated `outbound::{...}` import
block in webui.rs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…publishers

The PR's live-projection fix makes multiple `LiveProjectionPublisher`
instances built from one `RebornProjectionServices` share a single
monotonic `Arc<AtomicU64>` sequence counter, but nothing pinned that
behavior — a revert to a per-publisher `AtomicU64::new(0)` passed every
existing live-progress test.

Add a regression test that drives two independently created publishers
(via the milestone-sink path, no feature gate) and asserts their live
reasoning items land on distinct projection cursors. Verified red on a
reintroduced per-publisher counter (the two items collide on cursor
BASE+1 and collapse to one), green with the shared counter.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ironloopai

ironloopai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

IronLoop Review Status

Head: 62d193df8b5dc203cb6d2f83dad54220f9889ae9
Updated: 2026-07-03T23:51:46.146Z
Admission: webhook accepted the request and IronLoop persisted review state before this projection.

Current reviewers:

Reviewer State What it means Last update
none Queued No reviewer jobs scheduled yet. n/a

Recent activity:

Time Reviewer State Detail
n/a n/a Waiting No progress events recorded yet.

Commands:

  • @ironloop review
  • @ironloop review <agent-alias>
  • @ironloop status

@railway-app
railway-app Bot temporarily deployed to ironclaw-ci-preview / ironclaw-pr-5585 July 3, 2026 23:51 Destroyed
@ilblackdragon
ilblackdragon enabled auto-merge July 3, 2026 23:56
@ilblackdragon
ilblackdragon added this pull request to the merge queue Jul 4, 2026
Merged via the queue into main with commit e85cbbb Jul 4, 2026
107 checks passed
@ilblackdragon
ilblackdragon deleted the codex/reborn-composition-dissection-pr-n3 branch July 4, 2026 00:10
@ironclaw-ci ironclaw-ci Bot mentioned this pull request Jul 4, 2026

This branch was successfully deployed

No deployments
ironclaw-ci-preview / ironclaw-pr-5585 — 62d193df Deployed Jul 3, 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 risk: low Changes to docs, tests, or low-risk modules size: L 200-499 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants