You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RELAY's docs/RCP-ARCHITECTURE.md (canonical choice #4, "Conditional-request layer") names cpp-RCP's request.hpp and rust-RCP's request.rs as the reference shape: one request-kind enum plus shared sequencer-bank, priority-tier, and ledger state, all in a single module.
c-RCP instead keeps a 5-way file split, duplicating that shared state 5 times:
src/request_compound.c src/request_chained.c src/request_triggered.c
src/request_timed.c src/request_cancel.c
include/rcp/request_compound.h (+ matching headers for the other 4)
2353 total lines across these 10 files (2026-08-07 count).
Important: this is not a bug. This session independently re-verified c-RCP's Chained and Cancel implementations are byte-precise and TC18-conformant in their current split form — unlike go-RCP's equivalent layer, which has real wire-format defects (see go-RCP's own tracked redesign, a much larger and more urgent piece of work). This issue is purely about cross-repo architectural consistency, not fixing broken behavior.
Before starting: confirm this is worth doing at all
RCP-ARCHITECTURE.md itself calls this "the largest structural change in this effort — sequenced last, after the smaller items above are stable." Given:
The current 5-file split is functionally correct today.
A unification refactor of this size carries real regression risk for zero behavior change.
The agent picking this up should explicitly raise with the user whether this is worth doing now, or at all, before writing any code — do not treat "RCP-ARCHITECTURE.md names it as the target" as sufficient authorization to start a large refactor unilaterally. This mirrors the standing project convention that large, invasive, non-bug-fixing changes get flagged for explicit human sign-off rather than started autonomously (see go-RCP's conditional-envelope redesign for the same posture on a much larger, bug-driven version of this problem).
If given the go-ahead, what the target shape looks like
One request-kind enum covering Compound, CompoundWait, Triggered, Chained, Timed, and the three cancellation forms (clear-all, clear-non-safestate, clear-single) — replacing the 5 separate per-file type systems.
Shared sequencer-bank, priority-tier, and ledger state owned once, not duplicated per request kind.
Reference the actual cpp-RCP (include/rcp/request.hpp) and rust-RCP (src/request.rs) source directly for the concrete shape — do not design from scratch or from this issue's description alone.
c-RCP's own request_compound.c/request_timed.c were separately named in RCP-ARCHITECTURE.md as reference shapes for wire-layer correctness (the field-level TC18 encoding, e.g. cmp_start_state/cmp_next_state/cmp_sequencer/cmp_exec_delay/cmp_repetitions) even while being flagged for restructuring at the module-organization level — preserve that correctness; this is an organizational refactor, not a wire-format change.
Requirement-id grouping (REQ-CMP-*/REQ-TRIG-*/REQ-CHAIN-*/REQ-TIMED-*/REQ-CANCEL-*) is already c-RCP's own convention and is itself the cross-repo target (canonical choice feat: v0.7.0 TLS transport — mutual TLS interface stub #7) — preserve these prefixes even as the underlying files merge.
Verification standard
Full native build + full test suite + ASan/UBSan build (this repo has one, use it).
Every existing test for Compound/CompoundWait/Triggered/Chained/Timed/Cancel must still pass unchanged in behavior — this is a pure structural refactor, so any test that needs to change its assertions (not just its location/imports) is a signal something broke.
Mutation-test a sample of the moved logic (revert a small piece, confirm the now-missing behavior actually fails a test) to build confidence the refactor didn't silently drop coverage.
Porting this shape to go-RCP — go-RCP's conditional-request layer has its own, much larger, already-tracked redesign (wire-format defects, not just organizational) that should not be conflated with this purely-organizational c-RCP issue.
Background
RELAY's
docs/RCP-ARCHITECTURE.md(canonical choice #4, "Conditional-request layer") names cpp-RCP'srequest.hppand rust-RCP'srequest.rsas the reference shape: one request-kind enum plus shared sequencer-bank, priority-tier, and ledger state, all in a single module.c-RCP instead keeps a 5-way file split, duplicating that shared state 5 times:
2353 total lines across these 10 files (2026-08-07 count).
Important: this is not a bug. This session independently re-verified c-RCP's Chained and Cancel implementations are byte-precise and TC18-conformant in their current split form — unlike go-RCP's equivalent layer, which has real wire-format defects (see go-RCP's own tracked redesign, a much larger and more urgent piece of work). This issue is purely about cross-repo architectural consistency, not fixing broken behavior.
Before starting: confirm this is worth doing at all
RCP-ARCHITECTURE.md itself calls this "the largest structural change in this effort — sequenced last, after the smaller items above are stable." Given:
The agent picking this up should explicitly raise with the user whether this is worth doing now, or at all, before writing any code — do not treat "RCP-ARCHITECTURE.md names it as the target" as sufficient authorization to start a large refactor unilaterally. This mirrors the standing project convention that large, invasive, non-bug-fixing changes get flagged for explicit human sign-off rather than started autonomously (see go-RCP's conditional-envelope redesign for the same posture on a much larger, bug-driven version of this problem).
If given the go-ahead, what the target shape looks like
include/rcp/request.hpp) and rust-RCP (src/request.rs) source directly for the concrete shape — do not design from scratch or from this issue's description alone.request_compound.c/request_timed.cwere separately named in RCP-ARCHITECTURE.md as reference shapes for wire-layer correctness (the field-level TC18 encoding, e.g.cmp_start_state/cmp_next_state/cmp_sequencer/cmp_exec_delay/cmp_repetitions) even while being flagged for restructuring at the module-organization level — preserve that correctness; this is an organizational refactor, not a wire-format change.REQ-CMP-*/REQ-TRIG-*/REQ-CHAIN-*/REQ-TIMED-*/REQ-CANCEL-*) is already c-RCP's own convention and is itself the cross-repo target (canonical choice feat: v0.7.0 TLS transport — mutual TLS interface stub #7) — preserve these prefixes even as the underlying files merge.Verification standard
cfusa:check0 errors,trace --req-coverage 100 --sec-tested 100.Not in scope for this issue