Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

build-train: fast-path hash checks with mtime/size stats

Đang mở
#481 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
node.js, typescript
Lĩnh vực
build-system, performance

Hướng nghiên cứu

Start with workspace.ts:339 and trace memberInputHash, hashWorkspaceTree, and recordBuilt; first check how #480 narrows the input files, since this issue is blocked by it. Add tests for unchanged, touched, added, deleted, and manifest-free trees, and verify old cache entries invalidate; done means matching stats reuse the hash while mismatches trigger a full rehash.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

ready-for-agent

What to build

Every staleness judgement re-reads and hashes every file in every member's tree (memberInputHash → hashWorkspaceTree, workspace.ts:339). Turbo's trick avoids this: persist a per-file mtime/size manifest alongside the hash; if no file's stats changed since the recorded hash, skip rehashing the tree entirely.

.bos/build-cache.json already persists per-member state — extend the cache entry with a stats manifest:

{
  "every-plugin": {
    "hash": "...",
    "files": { "src/index.ts": [1700000000000, 4021], ... }  // mtimeMs, size
  }
}

Fast path: walk the tree collecting stats only (cheap), compare against the manifest — exact match → reuse the recorded input hash without reading file contents. Any mismatch (new/removed/changed file, or no manifest) → full rehash as today. A stats match with changed content and unchanged mtime+size is theoretically possible but the same residual risk Turbo accepts; mismatches always rehash, never false-fresh.

Cache versioning: bump the cache entry shape (or add a version field) so pre-change caches invalidate cleanly rather than half-matching.

Blocked by

#480 (the input manifest defines what files even get stat'd — build on the narrowed input set).

Status

  • Stats-manifest persisted in the cache entry post-build (recordBuilt)
  • Fast path skips content reads when stats match; falls back to full rehash otherwise
  • Cache shape versioning handles pre-existing .bos/build-cache.json
  • Unit tests: unchanged tree (skip), touched file (rehash), new/deleted file (rehash), missing manifest (rehash)
  • Changeset added
Ngôn ngữ chính
TypeScript
Star
5
Fork
3
Merge trung bình
11 giờ 8 phút
Pull request đã merge (30 ngày)
90

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NEARBuilders/everything-dev

Tất cả issue của NEARBuilders/everything-dev

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.