Skip to content

spike(rust/scaffold): create spike/audio-sync Cargo binary crate #95

Description

@natashaannn

User story

As a coding agent implementing the Rust FFT spike (tracked in #93), I want a minimal, buildable Cargo binary crate at spike/audio-sync/, so that subsequent issues have a clean project skeleton to add code into.

Background

RFC 0001 (#90) proposes rewriting the editing pipeline in Rust. To validate that the agent-driven Rust dev loop is workable before committing, the team is running a spike: port the FFT cross-correlation algorithm from scripts/sync/AudioSyncer.js to a standalone Rust binary and verify output matches across three target machines.

This issue creates the Cargo crate skeleton only — no algorithm logic. It must be entirely isolated from the existing Next.js/Node repo: no root-level Cargo.toml workspace, no changes to package.json, no CI config. The crate lives under spike/ and can be deleted wholesale when the spike is done.

Acceptance criteria

Happy path

Given the repository is checked out on a machine with Rust toolchain installed (rustup + stable toolchain)
When cargo build --manifest-path spike/audio-sync/Cargo.toml is run
Then it exits 0 and produces a binary

Error path / edge case

Given someone runs npm install or npm run build in the repo root
When Node resolves workspace packages
Then there is no change in behaviour — the Cargo crate is invisible to the Node toolchain

Out of scope

  • Any algorithm logic — src/lib.rs and src/main.rs should be stubs only
  • CI configuration or cross-compilation setup
  • A root-level Cargo.toml workspace — explicitly forbidden

Technical context

Required dependencies (add to spike/audio-sync/Cargo.toml):

Stub src/main.rs:

fn main() {
    println!("audio-sync spike — not yet implemented");
}

Stub src/lib.rs: empty file (subsequent issues will add functions here).

.gitignore addition: add spike/audio-sync/target/ to the repo's root .gitignore so build artifacts are not tracked.

No workspace: spike/audio-sync/Cargo.toml must be a standalone manifest, not a member of any workspace. Do not create a spike/Cargo.toml.

Implementation details

  1. Create spike/audio-sync/Cargo.toml:
[package]
name = "audio-sync"
version = "0.1.0"
edition = "2021"

[dependencies]
rustfft = "6"
hound = "3"
  1. Create spike/audio-sync/src/main.rs with the stub above.
  2. Create spike/audio-sync/src/lib.rs as an empty file.
  3. Add spike/audio-sync/target/ to the root .gitignore.
  4. Run cargo build --manifest-path spike/audio-sync/Cargo.toml and confirm it exits 0.
  5. Commit spike/audio-sync/Cargo.toml, spike/audio-sync/Cargo.lock, spike/audio-sync/src/main.rs, spike/audio-sync/src/lib.rs, and the .gitignore change.

Additional test scenarios

  • N/A — this issue scaffolds the project; no logic to test yet

Hard constraints

  • Must not create a root-level Cargo.toml or any workspace config
  • Must not modify any file outside spike/ except the root .gitignore
  • Must use rustfft (not a C FFT binding) — the spike's purpose is to validate pure-Rust development

Dependency issues

Independent of #94 (fixtures) — can be done in parallel.
Issues #96, #97, #98 (algorithm ports) all depend on this one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions