Repository navigation
feat(pipeline): dynamic-round-pipeline COMPLETE (T1-T11, LD1-LD30) - #72
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds dynamic-pipeline configuration, phase and escalation abstractions, phase-aware state and hashing, verifier ID allocation, prompt-history traversal, executor integration, and unit, integration, and CLI end-to-end coverage. ChangesDynamic pipeline foundation
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Config
participant VerifierLoop
participant SpawnOrchestrator
participant Consensus
participant CompletionRecord
Config->>VerifierLoop: select PL-D or PL-E phases
VerifierLoop->>SpawnOrchestrator: spawn phase verifier batches
SpawnOrchestrator-->>VerifierLoop: return phase verdicts
VerifierLoop->>Consensus: evaluate phase consensus
Consensus-->>VerifierLoop: return phase result
VerifierLoop->>CompletionRecord: write phase-aware hash and metadata
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
Kilo Code Review could not run — your account is out of credits. Add credits or switch to a free model to enable reviews on this change. |
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
9077560 to
c217aaa
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/goal/mod.rs (1)
191-227: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
resume()'s missing-state.jsonfallback silently upgrades legacy goals to the new verifier-id scheme.
StateRecord::default()setsverifier_id_version: 1(new d/s scheme). That's correct fornew()(brand-new goal), butresume()only runs on a goal that already exists (gdir.exists()check passed). If itsstate.jsonhappens to be missing, this fallback promotes an existing goal to the new verifier-id scheme, even though its on-disk verdict directories were written under legacyv{n}ids — subsequent rounds would then mintd{n}/s{n}ids that don't match any existing slot, silently breaking verifier lookups for that goal.Consider a dedicated legacy-safe fallback (
verifier_id_version: 0) for this specific "state.json missing on an existing goal" path, distinct from the "brand new goal" default.🛡️ Proposed fix
let mut state: StateRecord = if state_path.exists() { serde_json::from_str(&fs::read_to_string(&state_path)?)? } else { - StateRecord::default() + // Missing state.json on an EXISTING goal likely predates the dynamic-pipeline + // rollout — default to the legacy verifier-id scheme, not the new d/s scheme. + StateRecord { + verifier_id_version: 0, + ..StateRecord::default() + } };🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/goal/mod.rs` around lines 191 - 227, Update the missing-state fallback in resume so existing goals initialize a StateRecord with verifier_id_version set to the legacy value 0 instead of using StateRecord::default(). Keep StateRecord::default() unchanged for new goals and preserve the existing deserialization path when state.json is present.
🧹 Nitpick comments (1)
tests/dynamic_pipeline_phaseid.rs (1)
158-190: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winTest doesn't actually verify production sort/hash behavior.
This test only calls
Vec::sort_bywith an inline comparator on plain struct literals — it never exercises anyconsensus/hashing code. The comment claims "different phase orderings → different hashes," but no hash is computed here; the assertions would pass identically even ifMatchingVerdicthad noOrd/hashing support at all. Real coverage for phaseId-affecting hash ordering appears to live intests/consensus.rsper the PR summary, so this test mostly documents intent rather than verifying it.Consider calling the actual production sort/hash path (e.g., whatever function computes the canonical ordering before hashing) instead of re-implementing the comparator inline.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/dynamic_pipeline_phaseid.rs` around lines 158 - 190, Update matching_verdict_sorts_by_phase_id_then_verifier_id to invoke the production consensus canonical-ordering or hashing path instead of sorting verdicts with an inline comparator. Assert the resulting canonical order or hash reflects phase_id before verifier_id, preserving coverage of the actual MatchingVerdict behavior and hash computation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/pipeline/esca.rs`:
- Around line 64-78: Keep PL-E active after a rejected PL-E cycle by updating
should_run_escalation to allow nonzero, non-exhausted escalation_depth even when
esca_count is zero; preserve threshold, minimum-m, and retry-limit checks. In
src/pipeline/executor.rs lines 101-115, replace the duplicate predicate with
delegation to esca::should_run_escalation. In tests/dynamic_pipeline_e2e.rs
lines 96-106, assert PL-E is selected from the rejected PL-E state before
simulating Round 4.
In `@src/pipeline/executor.rs`:
- Around line 70-85: The public run_pipeline entry point must not remain an
unconditional panic. Either implement it as a sequential loop over phases that
invokes _phase_executor, short-circuits on the first rejection/error, and
returns the appropriate PipelineResult, with direct contract tests, or
remove/restrict the public API until usable; keep run_pipeline_round as the
separate async implementation.
---
Outside diff comments:
In `@src/goal/mod.rs`:
- Around line 191-227: Update the missing-state fallback in resume so existing
goals initialize a StateRecord with verifier_id_version set to the legacy value
0 instead of using StateRecord::default(). Keep StateRecord::default() unchanged
for new goals and preserve the existing deserialization path when state.json is
present.
---
Nitpick comments:
In `@tests/dynamic_pipeline_phaseid.rs`:
- Around line 158-190: Update
matching_verdict_sorts_by_phase_id_then_verifier_id to invoke the production
consensus canonical-ordering or hashing path instead of sorting verdicts with an
inline comparator. Assert the resulting canonical order or hash reflects
phase_id before verifier_id, preserving coverage of the actual MatchingVerdict
behavior and hash computation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 9e4ee662-1f83-4e1b-87e6-ed32f17b391d
📒 Files selected for processing (26)
.gitignoreexamples/tamper_proof.rsflow/findings/2026-07-24-dynamic-pipeline-impl/green-subagent-task.mdopenspec/changes/add-dynamic-round-pipeline/design.mdopenspec/changes/add-dynamic-round-pipeline/proposal.mdopenspec/changes/add-dynamic-round-pipeline/tasks.mdsrc/consensus/mod.rssrc/goal/mod.rssrc/lib.rssrc/pipeline/esca.rssrc/pipeline/executor.rssrc/pipeline/mod.rssrc/prompt/mod.rssrc/spawn/ids.rssrc/spawn/mod.rssrc/store/config.rstests/cli_e2e.rstests/consensus.rstests/dynamic_pipeline_config.rstests/dynamic_pipeline_e2e.rstests/dynamic_pipeline_phase.rstests/dynamic_pipeline_phaseid.rstests/dynamic_pipeline_verifier_ids.rstests/observe.rstests/spawn_orchestrator.rstests/store.rs
| pub fn should_run_escalation(cfg: &Config, state: EscaState) -> bool { | ||
| if cfg.esca_threshold == 0 { | ||
| return false; | ||
| } | ||
| if cfg.m < 2 { | ||
| return false; | ||
| } | ||
| if state.esca_count < cfg.esca_threshold { | ||
| return false; | ||
| } | ||
| if cfg.esca_max_retries > 0 && state.escalation_depth >= cfg.esca_max_retries { | ||
| return false; | ||
| } | ||
| true | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Keep PL-E active after a rejected PL-E cycle.
After PlEMixedReject, state is { esca_count: 0, escalation_depth: 1 }; both predicates select PL-D again, while the E2E flow proceeds with PL-E. This prevents consecutive escalation retries and makes the retry-depth lifecycle inconsistent.
src/pipeline/esca.rs#L64-L78: treat a nonzero, non-exhaustedescalation_depthas an active PL-E lifecycle, or revise the documented lifecycle if falling back to PL-D is intended.src/pipeline/executor.rs#L101-L115: delegate toesca::should_run_escalationrather than maintaining a divergent duplicate predicate.tests/dynamic_pipeline_e2e.rs#L96-L106: assert pipeline selection after the rejected PL-E state before simulating Round 4.
📍 Affects 3 files
src/pipeline/esca.rs#L64-L78(this comment)src/pipeline/executor.rs#L101-L115tests/dynamic_pipeline_e2e.rs#L96-L106
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/pipeline/esca.rs` around lines 64 - 78, Keep PL-E active after a rejected
PL-E cycle by updating should_run_escalation to allow nonzero, non-exhausted
escalation_depth even when esca_count is zero; preserve threshold, minimum-m,
and retry-limit checks. In src/pipeline/executor.rs lines 101-115, replace the
duplicate predicate with delegation to esca::should_run_escalation. In
tests/dynamic_pipeline_e2e.rs lines 96-106, assert PL-E is selected from the
rejected PL-E state before simulating Round 4.
| pub fn run_pipeline( | ||
| _config: &Config, | ||
| phases: &[Phase], | ||
| _phase_executor: impl Fn(&Phase) -> PhaseResult, | ||
| ) -> PipelineResult { | ||
| // The actual executor is in bin/verifier_loop.rs because it needs access to the | ||
| // async runtime + prompt rendering + spawn primitives. This function documents the | ||
| // contract and provides the output-format builder. | ||
| // | ||
| // The bin/verifier_loop.rs `run_pipeline_round` function implements the actual | ||
| // execution loop using this contract. | ||
| unimplemented!( | ||
| "pipeline executor is implemented in bin/verifier_loop.rs::run_pipeline_round; \ | ||
| this function documents the contract" | ||
| ) | ||
| } |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift
Implement or remove the callable executor entry point.
run_pipeline always panics, despite accepting everything needed to execute the synchronous phase contract. Any integration that calls this public API will fail instead of returning a rejection or completion result. Implement the sequential, short-circuiting loop and add direct contract tests, or keep this API private until it is usable.
🧰 Tools
🪛 Clippy (1.96.0)
[warning] 72-72: unused variable
(warning)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/pipeline/executor.rs` around lines 70 - 85, The public run_pipeline entry
point must not remain an unconditional panic. Either implement it as a
sequential loop over phases that invokes _phase_executor, short-circuits on the
first rejection/error, and returns the appropriate PipelineResult, with direct
contract tests, or remove/restrict the public API until usable; keep
run_pipeline_round as the separate async implementation.
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/bin/verifier_loop.rs`:
- Around line 823-836: Update the dynamic rejection branch around `envelope` and
`Outcome::Failure` to mark the envelope failed with `false` and emit it through
the same error-printing path used by the legacy rejection branch. Ensure
`--json` writes this envelope to stdout before returning failure, while
preserving the existing human-readable output behavior.
- Around line 570-576: Remove the unused PhaseRole import and trace_id binding
from run_dynamic_round, and delete the unused phase_role assignment in the same
function. Preserve the surrounding pipeline imports and execution logic
unchanged.
- Around line 796-821: Add an exhaustion guard before the outcome selection in
the verifier loop: call esca::escalation_exhausted with the current EscaState
and configuration, and return a terminal error when it reports that escalation
retries are exhausted. Ensure this fail-closed path runs before the PL-E/PL-D
fallback logic, while preserving normal outcome application through
esca::apply_outcome for non-exhausted states.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 6d01a054-1e90-45e1-803f-d0b202cd3548
📒 Files selected for processing (8)
src/bin/verifier_loop.rssrc/spawn/orchestrator.rstests/compaction_recovery.rstests/dynamic_pipeline_cli_e2e.rstests/session_reuse.rstests/spawn_goal_file_transport.rstests/spawn_orchestrator.rstests/spawn_stdin_transport.rs
| use verifier_loop::pipeline::{self, esca, PhaseRole}; | ||
|
|
||
| let command = kind.command(); | ||
| let fail = |msg: String| -> Outcome { | ||
| emit_error(output, command, Some(goal_id), Some(round), &msg) | ||
| }; | ||
| let trace_id = verifier_loop::observe::ensure_goal_trace_id(root, goal_id).ok(); |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Remove dead bindings flagged by Clippy.
PhaseRole (line 570 import) and trace_id (line 576) are never used in run_dynamic_round; let phase_role = phase.role; (line 680) is also unused. These are the Clippy unused_imports/unused_variables warnings.
Proposed fix
- use verifier_loop::pipeline::{self, esca, PhaseRole};
+ use verifier_loop::pipeline::{self, esca};- let trace_id = verifier_loop::observe::ensure_goal_trace_id(root, goal_id).ok();
- let phase_id = phase.id.as_str();
- let phase_role = phase.role;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| use verifier_loop::pipeline::{self, esca, PhaseRole}; | |
| let command = kind.command(); | |
| let fail = |msg: String| -> Outcome { | |
| emit_error(output, command, Some(goal_id), Some(round), &msg) | |
| }; | |
| let trace_id = verifier_loop::observe::ensure_goal_trace_id(root, goal_id).ok(); | |
| use verifier_loop::pipeline::{self, esca}; | |
| let command = kind.command(); | |
| let fail = |msg: String| -> Outcome { | |
| emit_error(output, command, Some(goal_id), Some(round), &msg) | |
| }; |
🧰 Tools
🪛 Clippy (1.96.0)
[warning] 570-570: unused import
(warning)
[warning] 576-576: unused variable
(warning)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/bin/verifier_loop.rs` around lines 570 - 576, Remove the unused PhaseRole
import and trace_id binding from run_dynamic_round, and delete the unused
phase_role assignment in the same function. Preserve the surrounding pipeline
imports and execution logic unchanged.
Source: Linters/SAST tools
| // Update esca state. | ||
| let outcome = if rejected { | ||
| if use_escalation { | ||
| // Determine which phase rejected for the outcome enum. | ||
| if phase_approve_counts.len() == 1 { | ||
| esca::InvocationOutcome::PlEMixedReject | ||
| } else { | ||
| esca::InvocationOutcome::PlEFinalReject | ||
| } | ||
| } else { | ||
| if phase_approve_counts.len() == 1 { | ||
| esca::InvocationOutcome::PlDGateReject | ||
| } else { | ||
| esca::InvocationOutcome::PlDConfirmReject | ||
| } | ||
| } | ||
| } else if use_escalation { | ||
| esca::InvocationOutcome::PlEApprove | ||
| } else { | ||
| esca::InvocationOutcome::PlDApprove | ||
| }; | ||
| let esca_state = esca::EscaState::new(state.esca_count, state.escalation_depth); | ||
| let new_esca = esca::apply_outcome(config, esca_state, outcome); | ||
| state.esca_count = new_esca.esca_count; | ||
| state.escalation_depth = new_esca.escalation_depth; | ||
| let _ = std::fs::write(&state_path, serde_json::to_string_pretty(&state).unwrap_or_default()); |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
rg -nP 'esca_max_retries|escaMaxRetries|exhaust' -C3
ast-grep outline src/pipeline/esca.rs --items allRepository: buihongduc132/verifier-loop
Length of output: 165
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== files ==\n'
git ls-files | rg 'src/(bin/verifier_loop\.rs|pipeline/esca\.rs|.*esca.*\.rs|.*verifier.*\.rs)$'
printf '\n== outline src/pipeline/esca.rs ==\n'
ast-grep outline src/pipeline/esca.rs --items all || true
printf '\n== outline src/bin/verifier_loop.rs ==\n'
ast-grep outline src/bin/verifier_loop.rs --items all || trueRepository: buihongduc132/verifier-loop
Length of output: 4176
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- src/pipeline/esca.rs (first 260 lines) ---'
sed -n '1,260p' src/pipeline/esca.rs
echo '--- relevant sections in src/bin/verifier_loop.rs ---'
rg -n 'should_run_escalation|apply_outcome|esca_count|escalation_depth|esca_max_retries|run_dynamic_round' src/bin/verifier_loop.rs -C 6Repository: buihongduc132/verifier-loop
Length of output: 11052
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python3 - <<'PY'
from pathlib import Path
for path in [Path('src/pipeline/esca.rs'), Path('src/bin/verifier_loop.rs')]:
print(f'== {path} exists: {path.exists()} size: {path.stat().st_size if path.exists() else "n/a"}')
PYRepository: buihongduc132/verifier-loop
Length of output: 266
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '== usages of escalation_exhausted =='
rg -n 'escalation_exhausted\s*\(' src
echo
echo '== usages of should_run_escalation =='
rg -n 'should_run_escalation\s*\(' src
echo
echo '== nearby dynamic-round control flow around exhaustion/state =='
sed -n '600,860p' src/bin/verifier_loop.rs | cat -nRepository: buihongduc132/verifier-loop
Length of output: 14577
Fail closed when escalation retries are exhausted. should_run_escalation only disables PL-E; once escalation_depth >= esca_max_retries, this path still falls back to PL-D instead of hard-failing. Call esca::escalation_exhausted here and return a terminal error so exhausted goals don’t keep cycling.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/bin/verifier_loop.rs` around lines 796 - 821, Add an exhaustion guard
before the outcome selection in the verifier loop: call
esca::escalation_exhausted with the current EscaState and configuration, and
return a terminal error when it reports that escalation retries are exhausted.
Ensure this fail-closed path runs before the PL-E/PL-D fallback logic, while
preserving normal outcome application through esca::apply_outcome for
non-exhausted states.
| if rejected { | ||
| let _ = verifier_loop::observe::append_trace_event( | ||
| root, goal_id, "warn", "jewilo.pipeline.rejected", | ||
| serde_json::json!({ "pipeline": pipeline_tag, "output": output_fmt, "rejection": rejection_msg }), | ||
| ); | ||
| eprintln!("pipeline {pipeline_tag} did not reach {output_fmt} consensus"); | ||
| eprintln!(" {rejection_msg}"); | ||
| let env = envelope(command, true) | ||
| .with_goal(goal_id).with_round(round) | ||
| .with_status("rejected"); | ||
| if matches!(output, Output::Human) { | ||
| println!("{output_fmt}"); | ||
| } | ||
| return Outcome::Failure; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
# Inspect the relevant reject path and helper definitions
set -euo pipefail
file="src/bin/verifier_loop.rs"
# Show the target area with line numbers
sed -n '790,860p' "$file" | cat -n
echo
echo "---- envelope / print_error references ----"
rg -n "fn envelope|print_error\\(|with_error\\(|with_status\\(|Output::Human|Output::Json|enum Output|struct Output" "$file" -n
echo
echo "---- surrounding helper definitions ----"
# Show likely helper definitions in manageable chunks
for pat in "fn envelope" "fn print_error" "enum Output" "struct Output"; do
echo "== $pat =="
rg -n "$pat" "$file"
doneRepository: buihongduc132/verifier-loop
Length of output: 5689
🏁 Script executed:
# Inspect helper implementations and the legacy reject path for comparison
set -euo pipefail
file="src/bin/verifier_loop.rs"
# Find relevant line numbers first
rg -n "fn envelope|fn print_error|Outcome::Failure|did not reach .*consensus|rejected" "$file"
# Read the helper regions around the matches
for start in 1 200 400 600 760 820 880 960 1040; do
end=$((start+120))
echo
echo "==== lines $start-$end ===="
sed -n "${start},${end}p" "$file" | cat -n
doneRepository: buihongduc132/verifier-loop
Length of output: 50383
🏁 Script executed:
set -euo pipefail
file="src/bin/verifier_loop.rs"
echo "== reject block =="
sed -n '820,840p' "$file"
echo
echo "== envelope and print_error declarations =="
rg -n "^(fn envelope|fn print_error|enum Output|struct Output)" "$file"Repository: buihongduc132/verifier-loop
Length of output: 1297
Emit the failure envelope on dynamic reject src/bin/verifier_loop.rs:823-836 — env is constructed and then dropped, so --json rejection runs write nothing to stdout. Route this path through the same error printer as the legacy reject path, and mark the envelope as failed (false), not successful (true).
🧰 Tools
🪛 Clippy (1.96.0)
[warning] 830-830: unused variable
(warning)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/bin/verifier_loop.rs` around lines 823 - 836, Update the dynamic
rejection branch around `envelope` and `Outcome::Failure` to mark the envelope
failed with `false` and emit it through the same error-printing path used by the
legacy rejection branch. Ensure `--json` writes this envelope to stdout before
returning failure, while preserving the existing human-readable output behavior.
Source: Coding guidelines
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@openspec/changes/add-dynamic-round-pipeline/tasks.md`:
- Around line 89-91: Resolve the conflicting deployment states in the T14 task
record and the “DEPLOYED TO PROD” section: update the stale status so both
entries consistently reflect whether production deployment is complete,
preserving the documented canary and smoke-test details.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 429682e7-e631-4c39-8289-93b8f75c234c
📒 Files selected for processing (2)
.pi-opa-net/audit/7663a872-ed54-4d5d-9155-9b29aa410841.jsonlopenspec/changes/add-dynamic-round-pipeline/tasks.md
| ### ✅ DEPLOYED TO PROD | ||
| - `jewilo-dev`: deployed (canary) | ||
| - `jewilo` (prod): deployed — prod smoke test proved: `pipeline PL-D 1+1/1 → APPROVE` |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Resolve the contradictory deployment status.
T14 still says production deployment is pending until after merge at Lines 65-66, while this section says production deployment is complete. Update one status so the task record reflects the actual release state.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@openspec/changes/add-dynamic-round-pipeline/tasks.md` around lines 89 - 91,
Resolve the conflicting deployment states in the T14 task record and the
“DEPLOYED TO PROD” section: update the stale status so both entries consistently
reflect whether production deployment is complete, preserving the documented
canary and smoke-test details.
…PROVED
Verifier loop 2/2 APPROVE on the full feature (goalId 22685871, hash
072426-bed6b377). Both verifiers independently verified T1-T11:
- T1 Config schema: 6 fields + LD28 validation + LD19 precedence + LD23 snapshot
- T2 Pipeline constructors: Mixed threshold=m unanimity (LD22)
- T3 phaseId axis: slot paths + StateRecord + env var + MatchingVerdict hash (LD25)
- T4 d/s verifierId scheme: monotonic continuation + v0/v1 migration
- T5 Hash phase binding: phaseId threaded into canonical_matching_json
- T6 OT10 fix: collect_prior_reject_notes_for_phase walks phaseId-ordered history
- T7 esca lifecycle: increment/reset/exhaustion/m<2-freeze
- T8 EXECUTOR WIRING: run_dynamic_round dispatches when is_dynamic_config=true
- T9 Output format: <phaseApproves>+.../m
- T10 completion.json: pipeline + escalationDepth metadata
- T11 REAL E2E: tests/dynamic_pipeline_cli_e2e.rs invokes jewilo NEW via subprocess
Prod verified: jewilo NEW with {dumpAdapter,smartAdapter} config →
'pipeline PL-D 1+1/1 → APPROVE 072326-eea7fdf9'.
Deployed to BOTH jewilo-dev AND jewilo (prod).
5eb1320 to
9b710e4
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/pipeline/executor.rs (1)
101-115: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoffDuplicate escalation-gate logic.
src/pipeline/executor.rs::should_run_escalationmirrorssrc/pipeline/esca.rs::should_run_escalation, but the runtime path usesesca::should_run_escalationinsrc/bin/verifier_loop.rs. Keep a single source of truth or delegate one to the other so threshold/retry changes don’t drift.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/pipeline/executor.rs` around lines 101 - 115, Remove the duplicated gate logic from executor::should_run_escalation and delegate to esca::should_run_escalation, or otherwise make both paths use one shared implementation. Ensure verifier_loop and any executor callers consistently use that single source of truth for threshold, mode, and retry checks.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@flow/findings/2026-07-24-dynamic-pipeline-impl/green-subagent-task.md`:
- Around line 11-18: Resolve the field-count inconsistency in the Config and
goal.json requirements: either identify the sixth configuration field and define
its serde name, default, and validation alongside dump_adapter, smart_adapter,
confirm_count, esca_threshold, and esca_max_retries, or consistently change both
“6” references to “5” so the configuration and snapshot contracts match.
---
Nitpick comments:
In `@src/pipeline/executor.rs`:
- Around line 101-115: Remove the duplicated gate logic from
executor::should_run_escalation and delegate to esca::should_run_escalation, or
otherwise make both paths use one shared implementation. Ensure verifier_loop
and any executor callers consistently use that single source of truth for
threshold, mode, and retry checks.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 673eb980-ab14-4ce0-8644-d09c56ed2bc2
📒 Files selected for processing (35)
.gitignore.pi-opa-net/audit/7663a872-ed54-4d5d-9155-9b29aa410841.jsonl.pi-opa-net/audit/a609b050-bfad-49ce-b590-ee5f525a3057.jsonlexamples/tamper_proof.rsflow/findings/2026-07-24-dynamic-pipeline-impl/green-subagent-task.mdopenspec/changes/add-dynamic-round-pipeline/design.mdopenspec/changes/add-dynamic-round-pipeline/proposal.mdopenspec/changes/add-dynamic-round-pipeline/tasks.mdsrc/bin/verifier_loop.rssrc/consensus/mod.rssrc/goal/mod.rssrc/lib.rssrc/pipeline/esca.rssrc/pipeline/executor.rssrc/pipeline/mod.rssrc/prompt/mod.rssrc/spawn/ids.rssrc/spawn/mod.rssrc/spawn/orchestrator.rssrc/store/config.rstests/cli_e2e.rstests/compaction_recovery.rstests/consensus.rstests/dynamic_pipeline_cli_e2e.rstests/dynamic_pipeline_config.rstests/dynamic_pipeline_e2e.rstests/dynamic_pipeline_phase.rstests/dynamic_pipeline_phaseid.rstests/dynamic_pipeline_verifier_ids.rstests/observe.rstests/session_reuse.rstests/spawn_goal_file_transport.rstests/spawn_orchestrator.rstests/spawn_stdin_transport.rstests/store.rs
🚧 Files skipped from review as they are similar to previous changes (25)
- examples/tamper_proof.rs
- .gitignore
- tests/cli_e2e.rs
- tests/compaction_recovery.rs
- tests/store.rs
- tests/observe.rs
- tests/spawn_stdin_transport.rs
- src/lib.rs
- src/spawn/mod.rs
- tests/dynamic_pipeline_cli_e2e.rs
- tests/spawn_goal_file_transport.rs
- src/prompt/mod.rs
- tests/dynamic_pipeline_config.rs
- src/spawn/orchestrator.rs
- tests/dynamic_pipeline_phaseid.rs
- src/goal/mod.rs
- src/pipeline/esca.rs
- tests/dynamic_pipeline_verifier_ids.rs
- src/pipeline/mod.rs
- tests/dynamic_pipeline_e2e.rs
- tests/dynamic_pipeline_phase.rs
- src/consensus/mod.rs
- src/spawn/ids.rs
- tests/spawn_orchestrator.rs
- tests/consensus.rs
| **T1 — Config (src/store/config.rs):** | ||
| - Add 6 new fields to `Config`: `dump_adapter: Option<String>`, `smart_adapter: Option<String>`, `confirm_count: u32`, `esca_threshold: u32`, `esca_max_retries: u32`. | ||
| - Serde rename: `dumpAdapter`, `smartAdapter`, `confirmCount`, `escaThreshold`, `escaMaxRetries`. | ||
| - Defaults: `confirm_count = 1`, `esca_threshold = 2`, `esca_max_retries = 3`, others `None`. | ||
| - Validation (LD28): `1 ≤ n ≤ m`, `m ≥ 1`, `confirm_count ≥ 1`, `esca_threshold ≥ 0`, `esca_max_retries ≥ 0`. | ||
| - Precedence (LD19): if BOTH `backend` AND `dump_adapter` are set → hard parse error. | ||
| - Snapshot at NEW (LD23): all 6 fields frozen into `goal.json` (extend existing snapshot logic). | ||
| - m<2 ∧ esca_threshold>0 → stderr warning (LD15). |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Resolve the configuration field-count mismatch before implementation.
This section says to add and snapshot six fields, but enumerates only five: dump_adapter, smart_adapter, confirm_count, esca_threshold, and esca_max_retries. Name the missing field and specify its serde name/default/validation, or change both references from six to five so the Config and goal.json contracts are unambiguous.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@flow/findings/2026-07-24-dynamic-pipeline-impl/green-subagent-task.md` around
lines 11 - 18, Resolve the field-count inconsistency in the Config and goal.json
requirements: either identify the sixth configuration field and define its serde
name, default, and validation alongside dump_adapter, smart_adapter,
confirm_count, esca_threshold, and esca_max_retries, or consistently change both
“6” references to “5” so the configuration and snapshot contracts match.
What
Implements the rot-proof foundation of the dynamic-round-pipeline design (LD1–LD30),
captured in `openspec/changes/add-dynamic-round-pipeline/`. Resolves explore OT6
("capture as OpenSpec proposal").
Foundation layer (this PR)
Pipelines derived (rot-proof)
```text
PL-D (default): Gate(m D, n) → Confirm(confirmCount S, confirmCount)
PL-E (escalated): Mixed(⌊m/2⌋ D + ⌈m/2⌉ S, m) → Final(confirmCount S, confirmCount)
```
Adding a future phase type = change a constructor, not the executor.
Tests
carry `phase_id`; serde default `""` preserves historical receipt recompute)
```
cargo test --test dynamic_pipeline_config # 18 pass
cargo test --test dynamic_pipeline_phase # 15 pass
cargo test --test dynamic_pipeline_phaseid # 13 pass
cargo test --test dynamic_pipeline_verifier_ids # 15 pass
cargo test --test dynamic_pipeline_e2e # 4 pass
cargo test # full suite, 0 failures
```
Deploy
WIP deployed as `jewilo-dev` (stable `jewilo` untouched per ceremony). Both binaries
verified smoke-clean.
Deferred to Phase 2 (documented in `tasks.md` T5–T11)
The foundation is additive — types, config, pipeline constructors, id scheme. The
existing single-phase run path is untouched, so this PR is safe to merge while Phase 2
wires the executor.
Design source
Summary by cubic
Adds the dynamic round pipeline end to end (PL‑D/PL‑E) with executor wiring, escalation lifecycle, and phase‑aware hashing. Legacy configs that only set
backendkeep the old single‑phase path.New Features
dumpAdapterorsmartAdapteris set; adds config fields (dumpAdapter,smartAdapter,confirmCount,escaThreshold,escaMaxRetries) with validation and precedence overbackend.escaThreshold=0disable,m<2freeze, andescaMaxRetriescap; persistscurrentPhase,escaCount,escalationDepthinstate.json.verifier_count,id_prefix,id_offset; adopts v1 role‑prefixed ids (d…,s…) with v0→v1 migration to avoid collisions across phases.<phaseApproves>+.../m;completion.jsonincludespipelineandescalationDepth.Bug Fixes
phaseIdand sorts by(phaseId, verifierId); serde defaults keep old receipts stable.Written for commit 9b710e4. Summary will update on new commits.
Summary by CodeRabbit
completion.json, with escalation counters persisted instate.json.phaseId) and sorting deterministically..pi-subagents/.