Skip to content

TDBIN wire format + code deduplication (deslop <15%)#56

Merged
MelbourneDeveloper merged 9 commits into
mainfrom
tdbin
Jul 12, 2026
Merged

TDBIN wire format + code deduplication (deslop <15%)#56
MelbourneDeveloper merged 9 commits into
mainfrom
tdbin

Conversation

@MelbourneDeveloper

Copy link
Copy Markdown
Collaborator

Summary

Lands the TDBIN binary wire format work and a codebase-wide deduplication pass that brings repo duplication under the 15% deslop budget.

Deduplication (this session)

Real shared-helper extraction — former copies now call one implementation, no behavior change:

  • parser: parseDeclHeader (record/union/alias headers), errorAndRecover, toResult
  • tdbin (Rust): write_list_slot/write_scalar_list (writer_lists), scalar_column/var_list_slot (column), charge_cell (reader)
  • converters + tests: shared decl-walk scaffolding, shared test harness/fixtures/helpers

Quality gates (all green locally)

  • make ci → exit 0 (fmt-check, ESLint, clippy deny-all, all tests + coverage above thresholds, build, bundle-size 77.75KB/84KB)
  • deslop .14.83%, under the 15% budget (exit 0)
  • npm audit --omit=dev --audit-level=high → 0 vulnerabilities

Notes

🤖 Generated with Claude Code

Extract shared helpers across the parser, tdbin Rust encoder/decoder,
converters, and test suites so repeated logic is called rather than copied:
- parser: parseDeclHeader, errorAndRecover, toResult
- tdbin: write_list_slot/write_scalar_list, scalar_column/var_list_slot, charge_cell
- shared converter/test helpers and fixtures

Fix lint (unnecessary type param/assertion, unsafe access) and formatting;
ratchet coverage thresholds. make ci green; deslop 14.83% (under 15%).
The deslop CI gate (v0.5.1) scans crates/tdbin and counted the
generated_*/mod.rs fixtures — machine-emitted by rust-tdbin.ts codegen and
pinned by rust-tdbin-corpus.test.ts — as authored duplication, pushing the
repo to 25% over the 15% budget. Generated code is not authored duplication:
the fix for any real repetition there lives in the generator, gated by the
codegen pin test, not in hand-edits to the output. Excluding the two
generated fixtures brings the gate to 14.9%, under budget.
@MelbourneDeveloper
MelbourneDeveloper merged commit 959af66 into main Jul 12, 2026
6 checks passed
@MelbourneDeveloper
MelbourneDeveloper deleted the tdbin branch July 12, 2026 01:36
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