Skip to content

refactor(composition): group automation cluster under automation/ (dissection n9) - #5818

Merged
serrrfirat merged 3 commits into
mainfrom
reborn/composition-dissection-automation
Jul 8, 2026
Merged

serrrfirat merged 3 commits into
mainfrom
reborn/composition-dissection-automation

Conversation

@serrrfirat

Copy link
Copy Markdown
Collaborator

What

Dissection step n9 of the composition god-crate refactor (docs/plans/2026-07-02-reborn-internal-module-refactor.md §3): group the automation cluster (facade + trigger-poller, ~5.2k lines) under a single automation/ internal module. Pure, behavior-preserving move — git mv + import repaths + 1:1 re-pointed crate-root pub use. No public API change.

Stacked on #5785 (n8 slack). Base is the n8 branch; this PR's diff is n9 only. Retarget down the stack as each parent merges.

Files moved → crates/ironclaw_reborn_composition/src/automation/

automation.rs                     → automation/facade.rs        (+ its tests/ subtree)
trigger_poller.rs                 → automation/trigger_poller.rs (+ active_run_lookup)
trigger_poller_trusted_submit.rs  → automation/trigger_poller_trusted_submit.rs

Facade renamed (automation.rs → automation/facade.rs): the old top-level module was itself named automation, so it can't be a submodule of a domain module also called automation. Renaming to facade matches the plan's {facade, trigger_poller} grouping. All three inner mods are ungated.

Pure move — the plan's "pull trigger-poller wiring out of factory.rs" is deferred to a later logic PR (the factory.rs footprint today is only a doc comment + a config field, no extractable block).

Public-API preservation

RebornAutomationProductFacade is still exported at the crate root, now via pub use automation::facade::RebornAutomationProductFacade; (the only changed pub use). Exported item-set is identical to base (264 == 264).

Verification

  • ✅ cfg-matrix: default · --no-default-features · full feature set
  • ✅ Consumer: reborn_cli compiles; architecture boundary tests pass (32, 0 fail — incl. trusted_trigger_submit_request_minting_stays_worker_owned)
  • ✅ Public-surface freeze (independently checked): item-set identical to base, both diff directions empty. Snapshot regenerated (one-line path change).
  • ✅ Stale-path sweep empty; fmt clean; tree clean.

Risk

Low — mechanical move (one intra-cluster rename to resolve the name collision), byte-identical public API, full cfg-matrix green. Draft pending human review (SOC 2 — nothing auto-merges).

@ironloopai

ironloopai Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

🔎 IronLoop Review Status

Head: b8a13a7cb5d11091d0a3af27e0fac0c6ba9f650f
Result: One or more reviewer results were superseded by a newer PR head.
Next: Run @ironloopai review on the latest PR head.
Updated: 2026-07-08T21:02:26.591Z

Current reviewers:

Reviewer State Verdict Findings Last update
ironloop/common-reviewer (reviewer) Superseded N/A N/A 2026-07-08T21:02:26.549Z
Reviewer summaries
Reviewer Detail
ironloop/common-reviewer (reviewer) Superseded by a newer PR head. New head: b8a13a7. Previous verdict: Approved.
Recent activity
Time Reviewer State Detail
2026-07-08T20:38:43.881Z ironloop/common-reviewer (reviewer) Queued Waiting for this reviewer lane to become available.
2026-07-08T20:38:43.894Z ironloop/common-reviewer (reviewer) Queued Added to the local review work handoff.
2026-07-08T20:38:44.838Z ironloop/common-reviewer (reviewer) Started Reviewer worker started attempt 1.
2026-07-08T20:38:47.037Z ironloop/common-reviewer (reviewer) Workspace ready Prepared isolated checkout (head_ref) at 428587c.
2026-07-08T20:40:53.585Z ironloop/common-reviewer (reviewer) Superseded Old-head reviewer is still running after newer head b8a13a7 replaced it. Codex is reviewing; process live; elapsed 2m 8s; timeout in 17m 52s; last heartbeat 2026-07-08T20:40:53.585Z. Codex emitted stderr output at 2026-07-08T20:40:43.079Z.
2026-07-08T20:41:14.667Z ironloop/common-reviewer (reviewer) Result captured Approved; 0 blocking findings.
2026-07-08T20:41:14.667Z ironloop/common-reviewer (reviewer) Completed Review completed and terminal status was persisted.
2026-07-08T21:02:26.549Z ironloop/common-reviewer (reviewer) Superseded A newer PR head replaced this review (b8a13a7).
Available commands
  • @ironloopai help
  • @ironloopai agents
  • @ironloopai review
  • @ironloopai review --agent <agent-id-or-alias>
  • @ironloopai status
Run metadata

Admission: webhook accepted the request and IronLoop persisted review state before this projection.

@coderabbitai

coderabbitai Bot commented Jul 8, 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: c2220b51-f5aa-4a06-992d-d61354870a29

📥 Commits

Reviewing files that changed from the base of the PR and between 428587c and b8a13a7.

📒 Files selected for processing (13)
  • crates/ironclaw_reborn_composition/src/automation/facade.rs
  • crates/ironclaw_reborn_composition/src/automation/facade/tests.rs
  • crates/ironclaw_reborn_composition/src/automation/facade/tests/mutation_tests.rs
  • crates/ironclaw_reborn_composition/src/automation/facade/tests/resolver_tests.rs
  • crates/ironclaw_reborn_composition/src/automation/mod.rs
  • crates/ironclaw_reborn_composition/src/automation/trigger_poller.rs
  • crates/ironclaw_reborn_composition/src/automation/trigger_poller/active_run_lookup.rs
  • crates/ironclaw_reborn_composition/src/automation/trigger_poller_trusted_submit.rs
  • crates/ironclaw_reborn_composition/src/lib.rs
  • crates/ironclaw_reborn_composition/src/runtime.rs
  • crates/ironclaw_reborn_composition/src/test_support/automation.rs
  • crates/ironclaw_reborn_composition/src/test_support/trigger_materializer.rs
  • docs/plans/composition-pubuse.snapshot

📝 Walkthrough

Summary by CodeRabbit

  • Refactor
    • Reorganized internal automation and trigger-polling module wiring.
    • Updated internal routing for trigger-poller trusted-submit components.
    • Redirected the RebornAutomationProductFacade re-export to the new internal location while keeping the external API consistent.
  • Tests
    • Adjusted test/support imports and delegation to match the updated module structure.
    • Updated mutation and resolver tests to use the new facade path.
  • Chores
    • Refreshed the composition public re-export documentation snapshot.

Walkthrough

This PR moves the automation-related modules under a new automation namespace and retargets internal imports, trait-object paths, test helpers, and the documented public re-export path. No public behavior change is shown in the diff.

Changes

Automation module relocation

Layer / File(s) Summary
New automation module root and lib.rs wiring
crates/ironclaw_reborn_composition/src/automation/mod.rs, crates/ironclaw_reborn_composition/src/lib.rs
Adds automation/mod.rs declaring facade, trigger_poller, and trigger_poller_trusted_submit submodules; lib.rs drops old top-level trigger_poller module declarations, adds turn_run_snapshot, and re-exports RebornAutomationProductFacade from automation::facade.
trigger_poller.rs internal re-export wiring
crates/ironclaw_reborn_composition/src/automation/trigger_poller.rs
Updates re-exports of AccessCheckerTriggerFireAuthorizer, ConversationContentRefMaterializer, and TenantScopedTrustedTriggerFireAuthorizer to source from crate::automation::trigger_poller_trusted_submit.
runtime.rs authorizer type and import updates
crates/ironclaw_reborn_composition/src/runtime.rs
Rewires test/support imports and updates build_trigger_fire_authorizer and build_trigger_poller_services_from_conversation_services to use Arc<dyn crate::automation::trigger_poller_trusted_submit::TriggerFireAuthorizer>.
Test support and test import updates
crates/ironclaw_reborn_composition/src/test_support/automation.rs, crates/ironclaw_reborn_composition/src/test_support/trigger_materializer.rs, crates/ironclaw_reborn_composition/src/automation/facade/tests/mutation_tests.rs, crates/ironclaw_reborn_composition/src/automation/facade/tests/resolver_tests.rs
Updates the facade constructor call, delegated test helper call, and facade test imports to the new automation::* paths.
Docs snapshot re-export path update
docs/plans/composition-pubuse.snapshot
Updates the recorded public re-export path for RebornAutomationProductFacade.

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

Possibly related PRs

  • nearai/ironclaw#5609: Both PRs route materialize_trigger_prompt_for_test through automation::trigger_poller_trusted_submit.

Suggested reviewers: think-in-universe

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR explains the refactor, but it misses many required template sections like Change Type, Linked Issue, Security, and Rollback. Fill the missing template sections: Change Type, Linked Issue, Security Impact, DB Impact, Blast Radius, Rollback Plan, Review Follow-Through, and Review track.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed Conventional Commits style and accurately summarizes the automation-cluster refactor under automation/.
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-5818 July 8, 2026 07:38 Destroyed
@github-actions github-actions Bot added size: M 50-199 changed lines risk: low Changes to docs, tests, or low-risk modules contributor: core 20+ merged PRs labels Jul 8, 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 restructures the codebase by grouping the facade, trigger_poller, and trigger_poller_trusted_submit modules under a single internal automation module, updating all relevant imports. Feedback suggests using relative imports (super::) instead of absolute paths (crate::automation::) for sibling submodules within the automation module to make the code more idiomatic and robust to future refactoring.

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 +24 to +27
pub(crate) use crate::automation::trigger_poller_trusted_submit::AccessCheckerTriggerFireAuthorizer;
pub(crate) use crate::automation::trigger_poller_trusted_submit::ConversationContentRefMaterializer;
#[cfg(any(test, feature = "test-support"))]
pub(crate) use crate::automation::trigger_poller_trusted_submit::TenantScopedTrustedTriggerFireAuthorizer;

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

Since trigger_poller and trigger_poller_trusted_submit are sibling submodules within the same automation module, it is more idiomatic and robust to use relative imports (super::) instead of absolute paths (crate::automation::). This prevents the imports from breaking if the parent automation module is ever renamed or relocated.

pub(crate) use super::trigger_poller_trusted_submit::AccessCheckerTriggerFireAuthorizer;
pub(crate) use super::trigger_poller_trusted_submit::ConversationContentRefMaterializer;
#[cfg(any(test, feature = 
References
  1. When importing items from a parent module into a child module in Rust, use super:: for relative imports instead of the full crate path. This makes the import more idiomatic and concise.

@railway-app

railway-app Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

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

Service Status Web Updated (UTC)
ironclaw ✅ Success (View Logs) Web Jul 8, 2026 at 4:52 pm

@serrrfirat
serrrfirat force-pushed the reborn/composition-dissection-slack branch from 4cb65ca to 0a99d20 Compare July 8, 2026 14:11
@serrrfirat
serrrfirat force-pushed the reborn/composition-dissection-automation branch from 0e35ac0 to 92d950b Compare July 8, 2026 14:15
@railway-app
railway-app Bot temporarily deployed to ironclaw-ci-preview / ironclaw-pr-5818 July 8, 2026 14:15 Destroyed
@github-actions github-actions Bot added the scope: docs Documentation label Jul 8, 2026
Base automatically changed from reborn/composition-dissection-slack to main July 8, 2026 16:17
@serrrfirat
serrrfirat force-pushed the reborn/composition-dissection-automation branch from 92d950b to 428587c Compare July 8, 2026 16:42
@railway-app
railway-app Bot temporarily deployed to ironclaw-ci-preview / ironclaw-pr-5818 July 8, 2026 16:42 Destroyed
@github-actions

github-actions Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Coverage ratchet

Ratchet mode: ENFORCING

RATCHET PASS: global
  observed: 85.17% (282588 / 331797 lines)
  floor:    85.3% (tolerance 0.5pp -> effective floor 84.8%)
  denominator: 331797 lines now vs 320188 at floor capture (+11609 lines, +3.63%) — not a material change

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

Reborn integration-tier coverage

Line coverage (Reborn crates): 85.17% — 282588 / 331797 lines

Per-crate breakdown (65 crates, lowest-covered first)
Crate Line % Covered / Total
ironclaw_prompt_envelope 0% 0 / 88
ironclaw_scripts 0% 0 / 347
ironclaw_skill_learning 0% 0 / 61
ironclaw_wasm_sandbox_core 7.37% 7 / 95
ironclaw_runtime_policy 33.2% 80 / 241
ironclaw_event_projections 43.34% 673 / 1553
ironclaw_run_state 52.36% 222 / 424
ironclaw_authorization 53.54% 461 / 861
ironclaw_triggers 59.79% 1740 / 2910
ironclaw_observability 61.54% 16 / 26
ironclaw_webui_v2 63.04% 2555 / 4053
ironclaw_mcp 63.15% 581 / 920
ironclaw_reborn_cli 63.41% 3816 / 6018
ironclaw_reborn_migration 67.01% 1172 / 1749
ironclaw_memory 67.12% 747 / 1113
ironclaw_dispatcher 67.15% 92 / 137
ironclaw_filesystem 67.44% 3815 / 5657
ironclaw_trust 72.88% 661 / 907
ironclaw_capabilities 74.08% 1658 / 2238
ironclaw_wasm_limiter 74.6% 47 / 63
ironclaw_reborn_event_store 74.61% 958 / 1284
ironclaw_extractors 74.72% 538 / 720
ironclaw_first_party_extensions 77.62% 5411 / 6971
ironclaw_llm 77.88% 19479 / 25013
ironclaw_product_context 78.57% 11 / 14
ironclaw_wasm_product_adapters 80.58% 1510 / 1874
ironclaw_process_sandbox 80.65% 671 / 832
ironclaw_reborn_openai_compat 80.95% 956 / 1181
ironclaw_memory_native 81.86% 3226 / 3941
ironclaw_wasm 82.54% 950 / 1151
ironclaw_secrets 82.7% 2791 / 3375
ironclaw_events 83.47% 1762 / 2111
ironclaw_processes 84.06% 965 / 1148
ironclaw_turns 84.24% 13099 / 15549
ironclaw_host_api 85.17% 2549 / 2993
ironclaw_product_workflow 85.84% 10748 / 12521
ironclaw_projects 85.92% 659 / 767
ironclaw_network 86.12% 670 / 778
ironclaw_common 86.46% 1514 / 1751
ironclaw_threads 86.62% 4132 / 4770
ironclaw_slack_v2_adapter 86.79% 1806 / 2081
ironclaw_auth 86.94% 2995 / 3445
ironclaw_reborn_config 86.98% 1730 / 1989
ironclaw_reborn_identity 87.03% 557 / 640
ironclaw_product_adapters 87.29% 3207 / 3674
ironclaw_skills 87.35% 4336 / 4964
ironclaw_hooks 87.84% 9916 / 11289
ironclaw_product_adapter_registry 87.96% 526 / 598
ironclaw_reborn_traces 88.23% 11707 / 13268
ironclaw_extensions 88.26% 2631 / 2981
ironclaw_reborn_composition 88.79% 69829 / 78645
ironclaw_host_runtime 88.95% 17523 / 19700
ironclaw_reborn 89.14% 15703 / 17616
ironclaw_conversations 90% 2924 / 3249
ironclaw_approvals 90.51% 1507 / 1665
ironclaw_event_streams 91.48% 1009 / 1103
ironclaw_loop_support 92.46% 14725 / 15926
ironclaw_attachments 93.06% 630 / 677
ironclaw_resources 93.07% 4622 / 4966
ironclaw_reborn_webui_ingress 93.19% 2217 / 2379
ironclaw_telegram_v2_adapter 93.87% 2452 / 2612
ironclaw_agent_loop 94.58% 8776 / 9279
ironclaw_safety 94.8% 3668 / 3869
ironclaw_first_party_extension_ports 95% 3094 / 3257
ironclaw_outbound 95.59% 3556 / 3720

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 (4 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_oauth v1-only: consumed only by root ironclaw (src/auth/oauth.rs); no crates/* dependents. Crate's own doc comment confirms v1-only. 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

@serrrfirat
serrrfirat marked this pull request as ready for review July 8, 2026 20:38

@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.

✅ IronLoop Review: reviewer

Review at a glance

Verdict Blocking Notes Inline Head
✅ Approved 0 0 0 428587c151f5

Head: 428587c151f5aa9b6ae9a9641e6bd96177e898f9
Next: No reviewer action needed.

Run details

Status: Current
Needs human: no
Needs validation: no

Summary

No concrete issues found. The PR is a scoped module reorganization of the Reborn automation facade and trigger poller with matching internal path updates and no observed behavior change.

Findings

None.

Developer follow-up

After fixing this feedback:

  1. Push the fix to this PR branch.
  2. Re-run this reviewer with @ironloopai review --agent reviewer if you only changed this reviewer's findings.
  3. Re-run all reviewers with @ironloopai review when the fix may affect multiple areas.
  4. Use @ironloopai status to check queued/running/completed/stale/stalled state while reviewers run.

serrrfirat and others added 3 commits July 9, 2026 00:00
…ssection n9)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…issection n9)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@serrrfirat
serrrfirat force-pushed the reborn/composition-dissection-automation branch from 428587c to b8a13a7 Compare July 8, 2026 21:02
@railway-app
railway-app Bot temporarily deployed to ironclaw-ci-preview / ironclaw-pr-5818 July 8, 2026 21:02 Destroyed
@serrrfirat
serrrfirat merged commit 88f8d17 into main Jul 8, 2026
62 checks passed
@serrrfirat
serrrfirat deleted the reborn/composition-dissection-automation branch July 8, 2026 21:30

This branch was successfully deployed

No deployments
ironclaw-ci-preview / ironclaw-pr-5818 — b8a13a7c Deployed Jul 8, 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 scope: docs Documentation size: M 50-199 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant