Skip to content

Add deterministic hash utility for artifacts #49

@natashaannn

Description

@natashaannn

Add deterministic hash utility for artifacts

Objective

Introduce a shared deterministic hashing utility for all pipeline artifacts.


Why this matters

Pipeline correctness depends on stable artifact identity.

Without a shared hashing mechanism, cache + validation are unreliable.


Parallelization metadata

Track

scripts

Depends on

Safe to run in parallel with

  • pipeline nodes
  • remotion cleanup

Merge risk

  • low

Files in scope

Primary:

  • scripts/config/hash.ts

Required implementation

1. Deterministic hashing function

Must:

  • accept JSON or buffer
  • produce stable SHA-256

2. Normalize JSON before hashing

Sort keys recursively.

3. Export helper

hashArtifact(content): string


Constraints

  • no filesystem operations

Acceptance criteria

Functional

  • identical inputs produce identical hashes

Unit tests

  • JSON ordering test
  • binary buffer test

Verification commands

Run hash on same object twice.

Expected result:

  • identical output

Explicitly out of scope

  • pipeline integration changes

Suggested branch

refactor/s7-hash-utils

Suggested commit slug

phase-3-step-6-hash-utils

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions