Skip to content

rewrite(phase6): batch 1 — ACF/AVTP/WIREERR catalog re-derivation - #155

Merged
SoundMatt merged 1 commit into
rewrite/v3-from-c-rcpfrom
phase6/acf-avtp-wireerr
Aug 22, 2026
Merged

SoundMatt merged 1 commit into
rewrite/v3-from-c-rcpfrom
phase6/acf-avtp-wireerr

Conversation

@SoundMatt

Copy link
Copy Markdown
Owner

Part of the v3.0.0 ground-up rewrite (#129, ROADMAP.md Phase 17). Phase 6 (requirement catalog), batch 1 of 13.

Background

cpp-RCP's code already references 1015 distinct REQ-* ids via //fusa:req/Catch2 bracket tags against only 412 defined catalog entries — 603 orphaned citations left by porting agents since Phase 1 ("ported from c-RCP REQ-XXX" provenance notes never resolved into real entries). Phase 6 walks these existing citations prefix-by-prefix into real catalog entries or documented gaps.

This batch: ACF/AVTP/WIREERR (93 c-RCP entries)

  • 36 new catalog entries added (28 REQ-ACF-, 7 REQ-AVTP-, 1 REQ-WIREERR-001), each with real req+test tag coverage. Kept these as their own prefixes matching c-RCP's numbering 1:1 (code already had orphaned citations using that exact numbering).
  • 9 genuine gaps filed to .fusa-reqs-pending.json (not force-fit into the catalog as fake "implemented"), including a real TODO(phase1-followup) the code already flags (undefined-length buffer validation) and a deliberate architecture divergence needing an explicit accept/reject call (acf_msg_length caller-override for E2E CRC accounting).
  • Bug fixed along the way: a mislabeled inline comment in avtp.hpp citing REQ-AVTP-022 for behavior that's actually REQ-AVTP-031's.
  • Duplicate-coverage mappings (c-RCP id → existing cpp-RCP REQ-WIRE-* id) recorded in the commit message for future reconciliation.

Verification

Independently re-verified beyond the porting agent's own report: semantic id-keyed diff confirms zero pre-existing catalog entries modified/deleted (raw line-diff showed unrelated churn — pure JSON re-serialization noise, not content change), and zero orphaned ACF/AVTP/WIREERR tags remain in the touched files. Full tree rebuilt from scratch: 0 errors, 0 warnings, 58/58 ctest suites pass.

🤖 Generated with Claude Code

@SoundMatt
SoundMatt force-pushed the phase6/acf-avtp-wireerr branch from 662c7df to 4ac8eae Compare August 22, 2026 10:32
Part of the v3.0.0 ground-up rewrite (cpp-RCP #129, ROADMAP.md Phase 17),
branch rewrite/v3-from-c-rcp. Phase 6 (requirement catalog), batch 1 of 13.

## Background

cpp-RCP's .fusa-reqs.json (412 entries) is missing hundreds of
requirement entries the code was already ported to implement in
Phases 1-5, and cpp-RCP's code already references 1015 distinct REQ-*
ids via //fusa:req/[REQ-XXX] tags against only 412 defined entries --
603 orphaned citations left behind by porting agents as unresolved
"ported from c-RCP REQ-XXX, see file.c:NNN" provenance notes. Phase 6
walks these existing citations prefix-by-prefix and turns each into a
real catalog entry (or a documented gap), rather than re-deriving
requirements from scratch.

## Prefix-scheme decision

Kept REQ-ACF-*/REQ-AVTP-*/REQ-WIREERR-* as their own prefixes reusing
c-RCP's exact id numbers 1:1, rather than folding into cpp-RCP's
existing REQ-WIRE-*/REQ-ACF-*/REQ-ERR-* buckets -- the code already
had orphaned citations using c-RCP's exact numbering (REQ-ACF-044,
REQ-AVTP-014/021/022/023), signaling that was the intended scheme all
along. Existing REQ-WIRE-*/REQ-ACF-*/REQ-ERR-* entries are untouched;
duplicate-coverage mappings recorded below for anyone reconciling the
two schemes later.

## New catalog entries (36)

- REQ-ACF-{001,004,012,013,014,017,019,021,023,024,025-031,032,033,
  038,044,047-053} (28 entries)
- REQ-AVTP-{013,014,015,021,022,023,031} (7 entries)
- REQ-WIREERR-001 (WireErrorCode enum matches TC18 Table 27/30 numbering)

Each has a real //fusa:req tag in acf.hpp/avtp.hpp and //fusa:test +
Catch2 bracket tag coverage in test_acf.cpp/test_avtp.cpp. 3 new tests
added where coverage was genuinely missing: acf_category()/
avtp_category() message-uniqueness (REQ-ACF-001, REQ-AVTP-015),
encoder-forces-correct-type-despite-wrong-caller-header (REQ-ACF-004/
038), WireErrorCode numeric-value pinning (REQ-WIREERR-001). Also
fixed a mislabeled inline comment in avtp.hpp that cited REQ-AVTP-022
for behavior that's actually REQ-AVTP-031's (tscf_reserved_all_zero).

## Genuine gaps found (9, filed to .fusa-reqs-pending.json, not the catalog)

- REQ-ACF-006/040: encode_acf_abb/_gbb honor a caller-supplied nonzero
  acf_msg_length instead of always recomputing -- a documented,
  deliberate divergence needed by e2e.hpp's CRC-trailer accounting,
  flagged here for an explicit accept/reject call rather than silently
  carried forward.
- REQ-ACF-009/041: decoders never validate declared acf_msg_length
  against buffer size -- matches the code's own pre-existing
  TODO(phase1-followup) comment.
- REQ-ACF-011: encode_acf_gbb doesn't zero message_timestamp when
  mtv=false.
- REQ-ACF-018: no read_size_or_segment_num kind-selector; existing doc
  comment contradicts TC18's op-based rule.
- REQ-AVTP-012: no combined stream_id+byte_bus_id address-equality
  construct anywhere.
- REQ-WIREERR-002: no WireErrorCode-to-string function.
- REQ-WIREERR-005: SequencerNotKnown enumerator has zero consumers
  (owner-tracking not yet built).

## Judgment calls, not filed as gaps (documented here, not in the pending file)

- REQ-ACF-037: cpp's op is a 2-state bool, not c-RCP's 3-state enum --
  the OP_NONE fallback case is structurally inapplicable, not missing.
- REQ-AVTP-016/027 (transport retain/release refcounting): cpp-RCP
  uses RAII via l2.hpp/udp.hpp/shmem.hpp instead of a manual-refcount
  transport abstraction -- an architecture divergence, and neither has
  a TC18 citation in c-RCP's own catalog, so they don't fit the
  pending file's TC18-scope contract.

## Existing-duplicate mappings (no action; c-RCP id -> cpp-RCP id already covering it)

ACF: 002/022/034/035/036/037->WIRE-010, 005/039->WIRE-013, 007/008->
WIRE-014, 010->WIRE-004, 015/016/046->WIRE-006, 020->WIRE-004,
042/043/045->WIRE-005.
AVTP: 001/003->WIRE-001, 002/004->WIRE-002, 005/006->WIRE-013,
007/008->WIRE-003, 010/011/025->WIRE-007.

## Out of scope (implemented, but in other files -- noted only, not this batch's concern)

AVTP-009/017-020/024/028/029/030/032-034 (l2.hpp, udp.hpp, shmem.hpp,
lifecycle.hpp, mock.hpp, server.hpp); WIREERR-003/004/006/007 (e2e.hpp,
lifecycle.hpp, request.hpp, pwm.hpp) -- confirmed genuinely implemented
there, will get their own tags when those prefixes' batches run.

## Verification

.fusa-reqs.json: 412 -> 448 entries (+36, 3672 -> 4092 lines).
.fusa-reqs-pending.json: 3 -> 12 entries (+9, 35 -> 123 lines).
include/rcp/acf.hpp: +28 lines. include/rcp/avtp.hpp: +14 lines net.
tests/test_acf.cpp: +84 net. tests/test_avtp.cpp: +22 net.

Independently re-verified (not just the porting agent's own report):
confirmed programmatically that zero of the 412 pre-existing catalog
entries were modified or deleted (semantic id-keyed diff against the
pre-batch base, not just a raw line diff -- the raw diff shows churn
in unrelated CLI/RELAY/Discovery entries that's pure JSON
re-serialization noise, not content change), and that zero orphaned
REQ-ACF-*/REQ-AVTP-*/REQ-WIREERR-* tags remain anywhere in acf.hpp/
avtp.hpp/test_acf.cpp/test_avtp.cpp. Full tree rebuilt from scratch:
0 errors, 0 warnings, 58/58 ctest suites pass (100%).

## CI gate fix found while watching this PR's checks

`cpfusa trace`'s sec-tested gate failed: it was a 17% floor (64/376 at
the time it was written) against `secTestedRequirements/totalRequirements`,
but its own comment already stated the real intent was "a regression
floor against the exact, CYBERSECURITY.md-enumerated subset" losing
test coverage -- not a claim about what fraction of the codebase is
security-relevant. A percentage-of-total is the wrong shape for that
intent once the total catalog is deliberately growing (exactly what
Phase 6 does): this batch's 36 new, correctly non-cybersecurity
REQ-ACF-*/REQ-AVTP-*/REQ-WIREERR-* entries dropped the ratio from
72/412=17.5% to 72/448=16.1%, failing a floor that was never meant to
track total-catalog size. Converted ci.yml's "Enforce security-test
coverage" step to an absolute-count floor (>= 72, the current
CYBERSECURITY.md-enumerated total) instead -- this still catches the
real regression the step exists for (an enumerated id losing its test
tag, or being dropped from severity:cybersecurity) without being
diluted by legitimate, intentional catalog growth elsewhere. Without
this fix, every subsequent Phase 6 batch would hit the same false
failure as the denominator keeps growing toward c-RCP's 1282-entry
scale.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Matt <47545907+SoundMatt@users.noreply.github.com>
@SoundMatt
SoundMatt force-pushed the phase6/acf-avtp-wireerr branch from 4ac8eae to a49896c Compare August 22, 2026 10:32
@SoundMatt
SoundMatt merged commit 2d933e2 into rewrite/v3-from-c-rcp Aug 22, 2026
22 checks passed
@SoundMatt
SoundMatt deleted the phase6/acf-avtp-wireerr branch August 22, 2026 10:41
SoundMatt added a commit that referenced this pull request Aug 22, 2026
…ation (#156)

Part of the v3.0.0 ground-up rewrite (cpp-RCP #129, ROADMAP.md Phase 17),
branch rewrite/v3-from-c-rcp. Phase 6 (requirement catalog), batch 2 of 13.

## Scope

fragment.hpp's REQ-FRAG-* prefix (18 c-RCP entries, all already
orphan-cited in cpp-RCP's own code), the 7-entry REQ-RMAP-* slice that
respqueue.hpp's code already cites (059/061-065/085 -- a real subset of
c-RCP's combined register-map+response-queue module, specific to
response-queue behavior; the rest of REQ-RMAP-*/REQ-REGMAP-* is
deliberately deferred to batch 11's regmap.hpp rename), and loan.hpp's
REQ-LOAN-* prefix (9 c-RCP entries).

## New catalog entries (26)

- REQ-FRAG-{001-015,017,018} (17) -- fragment.hpp's plan_count()/
  plan()/Reassembler, all verified against real code. REQ-FRAG-010
  needed one new test (destruction-safety, RAII) that didn't exist yet.
- REQ-LOAN-{008,009} (2) -- BufferPool destructor free-list release,
  new_buffer_pool(). LOAN-001-007 needed no action: already had
  correct catalog entries and code tags from prior work (LOAN-007's
  tag lives in rcp.hpp/test_rcp.cpp, not loan.hpp -- confirmed
  found-and-covered, not a gap).
- REQ-RMAP-{059,061,062,063,064,065,085} (7) -- respqueue.hpp's
  RespQueue class. REQ-RMAP-065 copied honestly as c-RCP has it:
  scope="tc18-gap", status="partial" -- c-RCP's own text states the
  heartbeat-composition primitives are all present and proven
  composable, but driving them against a real clock/transport is left
  to the integrator; cpp-RCP is at the identical boundary.

## Judgment call, not filed as a gap (documented in-file, not the pending file)

REQ-FRAG-016 (rcp_fragment_reasm_result_t's RCP_FRAGMENT_REASM_ERR_ALLOC,
a distinct allocation-failure return value): no C++ analog -- Reassembler
uses a fixed std::array member with no heap growth and therefore no
allocation-failure path to distinguish. c-RCP's own REQ-FRAG-016 also
carries no TC18 citation, matching the same "architecture divergence,
no spec basis to force a gap entry" precedent as batch 1's
REQ-ACF-037/REQ-AVTP-016/027. The orphaned tag lines were removed from
fragment.hpp/test_fragment.cpp and replaced with an explanatory
comment (prose mentions of the id remain for context, not real
//fusa:req/test tags -- confirmed these don't register as references
to cpfusa's trace tool).

## No gaps filed this batch

Every c-RCP requirement in scope was either genuinely implemented,
already covered by a pre-existing entry, or the one documented
judgment call above -- .fusa-reqs-pending.json is unchanged.

## Verification

Independently re-verified (not just the porting agent's own report):
semantic id-keyed diff confirms zero pre-existing catalog entries
modified/deleted, exactly the 26 new ids added. Zero real orphaned
FRAG/LOAN/RMAP tags remain in the six files in scope (the one apparent
match, REQ-FRAG-016, is plain prose in a regular comment, not a
//fusa:req/test tag -- confirmed by direct grep). Confirmed no new
entry carries "severity": "cybersecurity" (would have diluted the
sec-tested absolute-count floor fixed in batch 1/#155) -- sec count
holds exactly at 72/474, matching the floor. Full tree rebuilt from
scratch: 0 errors, 0 warnings, 58/58 ctest suites pass (100%).

.fusa-reqs.json: 448 -> 474 entries (+26, 4092 -> 4378 lines).
include/rcp/fragment.hpp, tests/test_fragment.cpp: net changes for the
REQ-FRAG-016 tag removal/explanatory-comment swap and the new
REQ-FRAG-010 test. respqueue.hpp/loan.hpp and their test files:
unchanged (already correctly tagged and tested).

Signed-off-by: Matt <47545907+SoundMatt@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant