feat(reborn): add text-only loop driver host factory - #3439
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the RebornLoopDriverHost and its factory to manage agent loops, implementing several ports for context, prompts, inputs, and checkpoints. It also extends the ironclaw_turns crate with a LoopCheckpointStore for record persistence. Feedback identifies an unnecessary async keyword, recommends using constants for hardcoded strings, and suggests an optimization to avoid a clone during scope validation.
| } | ||
| } | ||
|
|
||
| pub async fn build_text_only_host( |
There was a problem hiding this comment.
The build_text_only_host method is marked as async, but it does not perform any asynchronous operations. All validations and object constructions within the method are synchronous. Unless future implementations or trait requirements necessitate it, the async keyword can be removed to simplify the API.
| } | ||
|
|
||
| fn persisted_profile_id(profile_id: &RunProfileId) -> RunProfileId { | ||
| if profile_id.as_str() == "interactive_default" { |
| run_context: &LoopRunContext, | ||
| ) -> Result<(), RebornLoopDriverHostError> { | ||
| if thread_scope.tenant_id != run_context.scope.tenant_id | ||
| || Some(thread_scope.agent_id.clone()) != run_context.scope.agent_id |
There was a problem hiding this comment.
9e24eb7 to
8cacf0e
Compare
Code Review: PR #3439 — feat(reborn): add text-only loop driver host factoryWhere this fits in the Reborn integrationThis PR closes the loop on the Reborn agent-loop architecture. PR #3446 (KB-001) introduced a The PR also introduces a new architectural primitive: two-stage checkpoints. Until now,
Same trust pattern as the Overview12 files, +2104/−32. Core additions:
Strengths
Issues to addressCorrectness — typed-internals violation (blocking)
fn persisted_profile_id(profile_id: &RunProfileId) -> RunProfileId {
if profile_id.as_str() == "interactive_default" {
RunProfileId::default_profile()
} else {
profile_id.clone()
}
}The rule is explicit: "Match-on-string-literals means the type should be an enum. Fix the type."
The fix is to either:
Don't paper over it with a comment — the rule says "the compiler is the only durable enforcement." Related upstream stringly-typed leak (not introduced here, but exposed by this PR's tests): Correctness — other
Performance / scale (flag as follow-up)
Style / project conventions
Test coverage gaps
Risk labeling
SummaryApprove with the following addressed before merge:
The architecture and validation discipline here are excellent. The typed-internals violation is the primary blocker; the performance shape is the secondary concern (inherited from existing patterns, not introduced here). |
|
Addressed the review feedback in
Verification run locally:
GitHub checks are green. |
* feat(reborn): add text-only loop driver host factory * fix(reborn): persist text host checkpoint mapping * test(reborn): expand text host coverage * fix(reborn): address ilblackdragon review — typed profile and checkpoint hardening (nearai#3439)
Closes #3407.
Summary
AgentLoopDriverHostfactory with trait-object-backed portsFollow-ups
Risk
Tests
cargo fmt --all -- --checkCARGO_TARGET_DIR=/tmp/ironclaw-target-pr3439-review cargo test -p ironclaw_turns --test run_profile_contract --test checkpoint_state_store_contractCARGO_TARGET_DIR=/tmp/ironclaw-target-pr3439-review cargo test -p ironclaw_reborn --test loop_driver_hostCARGO_TARGET_DIR=/tmp/ironclaw-target-pr3439-review cargo test -p ironclaw_turns --features postgresCARGO_TARGET_DIR=/tmp/ironclaw-target-pr3439-review cargo test -p ironclaw_reborn --testsCARGO_TARGET_DIR=/tmp/ironclaw-target-pr3439-review cargo test -p ironclaw_architecture --test reborn_dependency_boundaries -- --nocaptureCARGO_TARGET_DIR=/tmp/ironclaw-target-pr3439-review cargo clippy -p ironclaw_turns -p ironclaw_reborn --all-targets -- -D warningsgit diff --checkbash scripts/pre-commit-safety.sh