Skip to content

refactor(perl): adopt shared ripr-perl-facts-v2 wire types in shadow mode #3218

Open

Description

@EffortlessSteven

Parent programme: #3216
Migration oracle: #3217
Shared wire authority: EffortlessMetrics/perl-lsp-swarm#8134
Shared wire implementation: EffortlessMetrics/perl-lsp-swarm#9274/#9276
Cross-repository package seam: EffortlessMetrics/perl-lsp-swarm#9340
Producer conformance: EffortlessMetrics/perl-lsp-swarm#8165

Objective

Add the shared typed ripr-perl-facts-v2 contract to ripr-swarm and decode v2 packets in shadow mode without changing the production Perl pipeline yet.

The result is one consumer-side wire authority ready for cutover, plus an explicit bounded legacy-v1 diagnostic module. No new private packet vocabulary may be introduced.

Preconditions

The producer side must have landed:

  • perl-lsp-swarm#9274 — authoritative dependency-light v2 Rust types + generated schema;
  • perl-lsp-swarm#9276 — canonical serialization, schema/packet digest, and shared validation;
  • perl-lsp-swarm#9340 — a versioned/pinned cross-repository dependency coordinate that works outside the producer workspace.

Use that exact package/source. Do not invent a second local v2 model because the shared crate is inconvenient, copy generated Rust into this repo, depend on a floating producer branch, or assume a colocated checkout.

Scope

Shared v2 dependency

  • add the exact shared contract dependency/artifact under lang-perl;
  • pin its version/source according to repository dependency policy;
  • expose the wire version and schema digest through one RIPR adapter module;
  • preserve the no-parser/no-LSP/no-runtime dependency boundary.

Shadow decoder

Introduce a pure consumer boundary that:

bytes
-> canonical v2 decode
-> wire structural validation
-> canonical packet digest validation
-> typed shadow summary

The shadow summary records fact-class counts, status/coverage, identities, boundaries, limitations, and reference counts. It performs no finding projection and no actionability decision.

Legacy v1 disposition

Move the current private v1 packet structs and decoder out of the future authoritative module into a clearly named bounded location such as:

analysis/language/perl/legacy_v1.rs

The v1 path may remain available only for:

It must not silently decode when the caller requested v2, and it must carry an owner and retirement condition.

Shadow comparison

For v2 candidate packets in the migration corpus, compare:

  • shared type decode;
  • schema digest;
  • packet digest;
  • canonical counts and IDs;
  • explicit coverage and limitation state.

Do not compare by serializing into the old v1 model.

Codex implementation brief

Branch / PR

branch: refactor/perl-v2-wire-shadow
PR title: refactor(perl): adopt shared v2 wire types in shadow mode (#<issue>)

Read first

Implement in order

  1. Add the exact shared v2 package dependency with a dependency-contract test.
  2. Extract current v1 wire structs into legacy_v1 without changing behavior.
  3. Add wire_v2 decode/validate/shadow-summary code using only shared types.
  4. Add schema/version/digest mismatch tests.
  5. Add a compile-time or architecture check preventing new packet structs outside the shared/legacy modules.
  6. Run the test(perl): pin real-producer v1 contradictions and the v2 migration oracle #3217 corpus through both explicit paths and emit a typed migration report.

Do not

  • do not switch PerlAdapter::analyze_diff or analyze_repo to v2 in this PR;
  • do not map v2 facts into Finding;
  • do not add serde aliases that reinterpret conflicting v1 fields as v2;
  • do not add parser, LSP, async-runtime, network, or execution dependencies to the wire path;
  • do not delete legacy fixtures before test(perl): pin real-producer v1 contradictions and the v2 migration oracle #3217 proves their disposition;
  • do not copy the shared model into ripr-swarm.

Tests

Positive:

Negative:

  • wrong schema/version;
  • wrong schema digest;
  • invalid packet digest;
  • malformed range/identity/reference;
  • v1 bytes sent to v2 decoder;
  • v2 bytes sent to explicit legacy-v1 decoder;
  • dependency contract violation;
  • local duplicate wire type introduced.

Removal proof:

  • replacing a shared type with a local duplicate or deleting the architecture check must make a focused test fail.

Verification

cargo fmt --all -- --check
cargo check -p ripr --features lang-perl --locked
cargo test -p ripr --features lang-perl --lib analysis::language::perl --locked
cargo xtask check-dependency-contracts
cargo xtask check-fixture-contracts
cargo xtask check-static-language
cargo xtask check-pr
git diff --check

Acceptance

  • RIPR builds against the authoritative cross-repository v2 package/source.
  • V2 decoding and canonical validation work in shadow mode.
  • The current v1 model is explicitly legacy and non-authoritative.
  • V1/v2 selection is explicit; no heuristic fallback occurs.
  • Contract/schema/digest identity is exposed for later subject binding and receipts.
  • Architecture checks block a new private duplicate wire model.
  • No colocated checkout or copied model is required.
  • Production findings and outputs are unchanged.

Non-goals

  • No production cutover.
  • No managed-producer changes.
  • No finding or output changes.
  • No actionability or support-tier change.
  • No v1 semantic repair.

Activity

  1. added
    status/needs-work
    on Aug 14, 2026
  2. coderabbitai commented on Aug 14, 2026

    @coderabbitai
    🔗 Related PRs

    #3068 - feat(schema): bind non-riprAgent published schemas to canonical producers (#2923) [merged]
    #3134 - fix(analysis): type and fixture-prove path-dependency edge capture (#3037) [merged]
    #3171 - release(scope): recover W6 from exact main with bounded exclusions [merged]
    #3193 - test(fixtures): isolate unchanged proof identity [merged]
    #3203 - test(gate): reject vacuous non-promotion charters [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  3. EffortlessSteven commented on Aug 28, 2026

    @EffortlessSteven
    MemberAuthor

    Blocked upstream (producer prerequisites not landed; verified 2026-08-28 against current state).

    Precondition check per the cross-repository execution law in #3216 ("producer #9274/#9276/#9340 -> consumer #3218"):

    • perl-lsp-swarm#9274 (dependency-light ripr-perl-facts-v2 wire types): OPEN — no merged PR references it (gh pr list --state all --search "9274 in:title" returns none).
    • perl-lsp-swarm#9276 (canonical v2 serialization, digests, validation): OPEN.
    • perl-lsp-swarm#9340 (versioned/pinned cross-repository package coordinate): OPEN.

    The shared-v2 dependency this issue requires ("use that exact package/source; do not invent a second local v2 model … or depend on a floating producer branch") therefore does not exist in consumable form yet. The in-repo part that could proceed without it (extracting v1 into legacy_v1.rs) would leave the shadow-decoder objective — the issue's core — unimplementable and half-landed, so the claim waits as a unit.

    Consumer train state: PR 1 (#3217) landed and closed; next unblocked consumer work requires the producer families above. Recorded so no agent re-derives the block or starts a divergent local v2 model.

  4. added
    status/blocked-upstream
    and removed
    status/needs-work
    on Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status/blocked-upstream

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions