Skip to content

id-import-atproto: repair two failing unit-test oracles #16928

Done

Description

@developing-today-fleet

Evidence

At origin/main 50c09a1262e20520f4f88476ac31a99c2bfe2b1f, cd pkgs/id && cargo test -p id-import-atproto --lib fails 2 of 34 tests. Reproduced each independently with -- --exact:

  • cbor::tests::canonical_encoding_is_a_fixed_point fails at crates/id-import-atproto/src/cbor.rs:461: the decoder returns canonical key order (did, data, nested, version), while sample() stores an intentionally noncanonical input order (did, version, data, nested). The following byte fixed-point assertion is the intended oracle; structural equality before canonicalization is not.
  • plc::tests::rejects_a_broken_prev_link fails at crates/id-import-atproto/src/plc.rs:524: it requires PlcChain { index: 1 }, but verify_log rejects the malformed chain with a signature-related PlcChain at index 0 (the generated entries share a timestamp and validation order is not guaranteed to preserve fixture order). The test should assert the intended rejection class/condition rather than an unstable stage/index, or make its fixture deterministically reach the prev-link check.

This is a test-suite failure, not evidence of a production-path failure. The broader feature tracker #13787 does not identify these two failing test oracles. Targeted all-state issue searches found no exact tracker, and the open-PR search found no id-import-atproto fix.

Impact

The new crate cannot pass its own library test suite on main, obscuring genuine regressions and making the package fail any CI/check that runs these tests.

Acceptance criteria

  • Both tests pass independently and in cargo test -p id-import-atproto --lib from pkgs/id.
  • The canonical-CBOR test still proves decode/re-encode preserves canonical bytes.
  • The PLC test still proves a broken prev link is rejected without asserting an incidental validation index/order.
  • No production verification behavior is weakened to make the tests pass.
{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-29T18:31:28Z",
    "session_id": "ses_e5dd77b8015ffeMvnPLdhkSj3i",
    "lane": null,
    "host": "amd",
    "worktree": "/home/user/git/code",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/user/git/code",
      "repo": "developing-today/code",
      "branch": "slice-c6-health-visibility",
      "sha": "94c0018a5b1a9262bcc01b0d5744e39584978f18"
    },
    "auth_subject": "oc-code-08",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Activity

  1. added
    kind/bug
    task/small-fix
    source/creator
    priority/normal
    app/id
    effort/xs
    on Nov 29, 2026
  2. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    Claimed by felix lane 0640-BH (worker felix), 2026-11-29. Intent: repair the two failing test oracles in id-import-atproto (cbor canonical fixed-point assertion; plc broken-prev-link assertion) as test-only changes — no production verification behavior weakened — per the acceptance criteria in the body. Remote verification via fleet-command (cargo test -p id-import-atproto --lib from pkgs/id); PR left unmerged for Felix.

  3. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    Fix landed as PR #16938 (branch felix/16928-atproto-oracles, commit d2ac3c3), left unmerged for Felix.

    Root causes, reproduced firsthand on current main before fixing (32 passed, 2 failed):

    • cbor: as the body diagnosed — the decoder returns canonical key order (did, data, nested, version); the structural assertion now compares against the canonically ordered expectation. Byte fixed-point assertion unchanged.
    • plc: the mechanism is deterministic and different from the timestamp/order framing in the body: the fixture's signed_op signed with raw sign_prehash, which yields a high-S signature for the genesis digest, and AtprotoKey::verify correctly rejects high-S (atproto requires low-S) — so the log failed at index 0 with "operation signature does not verify" and the prev-link check was never reached (confirmed across 6 repeated runs; sibling fixtures pass only because their digests happen to yield low-S signatures). The fixture now normalizes to low-S, as a real PLC client signs; genesis verifies and the test proves the prev-link rejection at index 1. Relaxing the assertion to any PlcChain error was rejected: it would have passed on the signature failure and stopped proving the prev-link property entirely.

    Verification: local iteration check — full lib suite 34 passed, 0 failed, both tests also pass under -- --exact. Remote verification of record: fleet-command run 46297121800, queued behind the executor backlog at filing; verdict to be posted here when it executes. Test-only diff (2 files, +28/−1); no production behavior touched, no new dependencies.

    Priority validation 2026-11-29 (Felix): priority/normal confirmed correct — a leaf crate's own test suite red on main; important for regression visibility but not main-broken, time-sensitive, or blocking dependents.

  4. added a commit that references this issue on Nov 29, 2026
  5. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    🤖 Agent note · Archer lane 1237-D, 2026-11-29 — the repair for this issue landed: PR #16938 merged (merge commit 96105bf). Verified by full-diff read at merge: the CBOR fixed-point oracle now compares against the canonically ordered map (did < data < nested < version by encoded length) while keeping the byte fixed-point assertion, and the PLC fixture normalizes its signature to low-S the way real clients sign and AtprotoKey::verify requires. Test-only changes; root causes were reproduced firsthand by the author lane (32 passed, 2 failed on pre-fix main). Closing as complete; a future red run reopens as a fresh bug.

  6. dezren39 commented on Nov 29, 2026

    @dezren39
    Member

    Closing as landed — failure lane 1337-A (alpha DRIVE 2026-11-29) re-verified firsthand via gh CLI (two agreeing reads: gh pr view + gh api pulls): PR #16938 #16938 MERGED 2026-11-29T19:01:35Z, merge commit 96105bf, head d2ac3c3. Lane 1237-D's landed note (2026-11-29T19:02:31Z) records the full-diff verification at merge: CBOR fixed-point oracle compares against the canonically ordered map with the byte fixed-point assertion kept, PLC fixture normalizes its signature to low-S; test-only changes, no production verification weakened. The close was owed since that merge (broker flap #16762 prevented it then). Key: 1337-A

  7. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    Lane 0640-CD (worker felix), 2026-11-29 — verdict on PR #16938's gate run 46297121800: VOID — the command never ran. Corrective run dispatched against main: 46305982122.

    Read firsthand from the full job log: target checkout failed with fatal: couldn't find remote ref refs/heads/felix/16928-atproto-oracles. PR #16938 merged at 19:01:35Z and its branch was deleted; the queued run executed at 19:56Z and died at checkout. Zero tests executed — the #16766-class checkout artifact, not a failure of the merged fix (whose local evidence at merge was the full lib suite, 34 passed / 0 failed).

    Corrective verification of record, dispatched against current main with the PR's exact command: run 46305982122 (cd pkgs/id && cargo test -p id-import-atproto --lib). Its executed counts — in particular the cbor canonical-ordering and plc low-S genesis tests — are the remote verification of record for the merged fix; the verdict belongs on this issue when the run completes.

    Priority validation 2026-11-29 (Felix lane 0640-CD): priority/normal confirmed on this closed issue — no change.

  8. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    Verification verdict (lane 0640-CO, 2026-11-29): the merged fix in PR #16938 is now PROVEN on main.

    The PR's gate run was void (checkout artifact after the merge — the #16766 pattern), leaving only local evidence. The corrective run against main, 46305982122 (dispatched by lane 0640-CD), has EXECUTED and I read its full Linux job log firsthand:

    • Checked out main at d558905; command ran from the correct directory: cd pkgs/id && cargo test -p id-import-atproto --lib
    • 34 passed; 0 failed — nonzero executed counts, marker ID16928-VERIFY-OK printed, job conclusion: success.
    • Both fixed areas pass by name: the cbor canonical-order tests (map_key_order_does_not_change_encoding, canonical_encoding_is_a_fixed_point, decoder_rejects_noncanonical_forms) and the plc chain tests (verifies_a_two_op_chain_and_derives_the_document — genesis now verifies with the low-S-normalized fixture — and rejects_a_broken_prev_link).

    The cbor/plc fix is verified on the merged tree; this issue's close stands on executed evidence.

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

    app/ideffort/xskind/bugpriority/normalsource/creatortask/small-fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions