Skip to content

feat(enrichment): unify binary extension inventory for asset-weight and provenance - #3252

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
bohdansolovie:feat/binary-extensions-scientific-data
Jul 4, 2026
Merged

feat(enrichment): unify binary extension inventory for asset-weight and provenance#3252
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
bohdansolovie:feat/binary-extensions-scientific-data

Conversation

@bohdansolovie

Copy link
Copy Markdown
Contributor

Summary

  • Extract a shared binary-extensions.ts module so asset-weight and provenance use the same binary file inventory instead of duplicated extension lists that can drift.
  • Expand coverage to scientific/data formats commonly committed in ML and analytics repos: HDF5 (.h5, .hdf5), TensorFlow SavedModel (.pb), NumPy (.npy, .npz), Parquet/Feather/Arrow/ORC, MessagePack, lz4, and brotli.
  • Add dedicated parity tests in binary-extensions.test.ts plus regression cases in asset-weight.test.ts and provenance.test.ts.

Motivation

Asset-weight and provenance previously maintained separate binary extension lists. This refactor keeps them synchronized and improves classification for scientific data artifacts that should be treated as binary assets rather than reviewable text.

Test plan

  • npm run build in review-enrichment/
  • binary-extensions.test.ts — parity between isBinaryFileExtension() and BINARY_EXT_RE, case insensitivity, negatives
  • asset-weight.test.ts — scientific/compression formats classified as binary assets
  • provenance.test.ts — scientific data paths classified as binary in provenance analysis

Made with Cursor

…nd provenance

Extract shared binary-extensions module so asset-weight and provenance
stay in sync, and add scientific/data formats (HDF5, NumPy, Parquet,
Arrow, ORC, MessagePack, lz4, brotli) with dedicated parity tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
@bohdansolovie
bohdansolovie requested a review from JSONbored as a code owner July 4, 2026 22:52
@superagent-security superagent-security Bot added the contributor:flagged Contributor flagged for review by trust analysis. label Jul 4, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 4, 2026
@loopover-orb

loopover-orb Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-04 22:51:40 UTC

6 files · 1 AI reviewer · no blockers · readiness 73/100 · CI green · clean

⏸️ Suggested Action - Manual Review

Review summary
This refactor correctly moves the binary extension inventory into a shared analyzer module and wires both asset-weight and provenance to the same source of truth. The added scientific/data extensions are exercised through the helper, regex, asset-weight, and provenance paths, and the post-change files show the imports and dist-based tests are coherent with the existing test style. I do not see a reachable correctness break in the changed code.

Nits — 6 non-blocking
  • nit: review-enrichment/src/analyzers/binary-extensions.ts:89 builds a regex from raw extension strings, which is safe for the current inventory but easy to make unsafe if a future extension contains a regex metacharacter.
  • nit: review-enrichment/test/binary-extensions.test.ts:10 only samples representative extensions instead of asserting helper/regex parity for every value in BINARY_FILE_EXTENSIONS, so future drift inside the shared module could still slip through.
  • review-enrichment/test/binary-extensions.test.ts:10 should loop over BINARY_FILE_EXTENSIONS and assert both isBinaryFileExtension(ext) and BINARY_EXT_RE.test(`x.${ext}`) for every entry.
  • review-enrichment/src/analyzers/binary-extensions.ts:89 should either escape extensions before joining or add a short comment that the inventory is restricted to literal alphanumeric extensions.
  • review-enrichment/test/provenance.test.ts:69 could add one image/archive control such as `assets/logo.png` or `dist/app.zip` now that provenance intentionally inherits the full asset-weight inventory, making that broader behavior explicit.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (no linked issue context).
Validation posture ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 182 registered-repo PR(s), 102 merged, 9 issue(s).
Contributor context ✅ Confirmed Gittensor contributor bohdansolovie; Gittensor profile; 182 PR(s), 9 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: bohdansolovie
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 182 PR(s), 9 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Explain no-issue PR.
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gittensory approves — the gate is satisfied and CI is green.

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

Labels

contributor:flagged Contributor flagged for review by trust analysis. gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants