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: record output (dist) hash in the cache entry

Đang mở
#482 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
3-5 ngày
Mức phù hợp với người mới
55/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
build-system

Hướng nghiên cứu

Start with workspace.ts around isStale at line 403 and find recordBuilt and distOracle; first inspect the cache entry shape and input manifest work tracked in #480, plus the stats fast path in #481. Add output digest and dist stats validation, then verify the listed fault cases: truncated, deleted, stale but present, and interrupted dist writes. Done means mismatches trigger rebuilds and unchanged dist files avoid full rehashing.

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

isStale only checks the dist entry exists (existsSync(join(member.dir, distEntry)), workspace.ts:403) — a truncated, corrupted, or externally-deleted-then-touched dist stays "fresh". Record the output hash alongside the input hash and verify integrity on judgement.

  • In recordBuilt: after a successful build, hash the dist output (per distOracle(member.dir) entry point — entry file plus whatever the config emits, or a bounded hash of the dist tree) and store it in the cache entry.
  • In isStale: input-hash match and dist-exists and dist-hash match → fresh. Dist hash mismatch/missing → stale (rebuild), never trusted.
  • Bound the cost: hashing dist every run is the same file-read profile as the input tree; the #481 stats fast path should cover dist files too (record dist file stats, rehash dist only when they drift).

This is the prerequisite for restoring dists from a remote cache (#484): without output verification, a corrupted or interrupted restore is undetectable. It is also the train's answer to "output hermeticity" — actions whose outputs are validated against recorded digests.

Blocked by

#480 (cache entry shape and input-manifest work land first).

Status

  • Output hash recorded in the cache entry post-build
  • isStale verifies dist integrity; mismatch rebuilds
  • Dist stats fast path (no full dist rehash when unchanged)
  • Fault-injection tests: truncated dist, deleted dist file, stale-but-present dist, interrupted write
  • Changeset added
Ngôn ngữ chính
TypeScript
Star
5
Fork
3
Merge trung bình
9 giờ 55 phút
Pull request đã merge (30 ngày)
108

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.