Skip to content

test: add the issue triage catalog and part10 walker for the regression bank - #524

Merged
awatson1978 merged 1 commit into
release/1.0-beta-corefrom
core/bank-infra
Sep 29, 2026
Merged

awatson1978 merged 1 commit into
release/1.0-beta-corefrom
core/bank-infra

Conversation

@awatson1978

@awatson1978 awatson1978 commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

This PR begins the green regression bank — step 4 of section 6 in RELEASE_PLAN.md. The idea behind the bank: every upstream dcmjs issue that was harvested for the rewrite gets a triage record, and the ones that describe real, reproducible behavior get a pinned test. This PR lands the two shared pieces the bank needs before any of those tests can arrive: the triage catalog and a byte-level file walker.

The catalog is test/issues/catalog.json. It's the triage record for all 172 upstream issues. Each entry carries the issue's metadata (number, title, state, an excerpt) plus a triage block with a category, an area, a disposition, a status, and the test file it maps to when one exists. It's data, not code, so it lands in its own declared commit.

The walker is test/issues/part10Walker.js — a small standalone helper for inspecting written DICOM Part 10 files (the standard file format: 128-byte preamble, "DICM" magic, then the File Meta group and the dataset) element by element. The important design choice is that it deliberately re-parses writer output with independent code rather than the library's own reader. That way, structural assertions — tag ordering, pad-byte placement, fragment counts, sequence length encoding — are made against the actual bytes, standing in for the external consumers (pydicom, DCMTK, dcm4che) that the upstream issues cite. It exports datasetStart, readElementHeader, walkTopLevelElements, findElement, and parseEncapsulatedPixelData, and its scope is intentionally narrow: Explicit VR Little Endian only, which covers every synthetic fixture in the suite.

Here's how the bank's tests use it — this is from the issue 365 test (writer emitting tags out of order), which lands in a later batch:

import { walkTopLevelElements } from "./part10Walker.js";

const outBuffer = dicomDict.write();
const elements = walkTopLevelElements(outBuffer);
const tags = elements.map(e => e.tag);

// dciodvfy's complaint: tags out of order. Assert strictly ascending.
for (let i = 1; i < tags.length; i++) {
    expect(parseInt(tags[i], 16)).toBeGreaterThan(parseInt(tags[i - 1], 16));
}

The test files themselves follow in five batched PRs, each sized to stay within the review budget. Issues whose triage status is gap or triaged don't get test files yet — those arrive later, together with the code that fixes them, per section 7 of the plan.

🤖 Generated with Claude Code

@awatson1978
awatson1978 merged commit 40eb60a into release/1.0-beta-core Sep 29, 2026
8 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant