Skip to content

slice install — lockfile-aware, scripts-off dependency install recorded in the CAS manifest #34

Closed

Description

@hassidan

Summary

Slice relies on an external package manager (bun install / npm install) to populate node_modules, and slice pack / slice run then bundle from disk. There is no slice install, no lockfile awareness, and no way for slice.toml to declare dependencies.

Why it matters

Every competing runtime that targets "run this project" (Deno, Bun) ships install. For Slice's positioning as a multi-tenant / embedded runtime the need is slightly different but still real:

  • A platform operator who receives a tenant's package.json + lockfile must be able to produce a .cas deterministically without trusting arbitrary lifecycle scripts or network access from the tenant.
  • Reproducibility: the CAS is content-addressed, but its inputs (which node_modules tree was on disk) currently are not recorded.

Proposal (scoped — not a full npm clone)

  1. slice install [--frozen] [--ignore-scripts]: read package.json + bun.lock / package-lock.json / pnpm-lock.yaml, fetch tarballs from the registry (or a configured mirror), verify integrity hashes, lay out node_modules (flat/hoisted is sufficient since Slice bundles anyway). Lifecycle scripts off by default — this is the security feature.
  2. Record the lockfile digest and resolved package set inside the CAS manifest so slice inspect can show exactly which dependency versions a bundle contains.
  3. slice.toml [dependencies] as an alternative to package.json for projects that are Slice-first.
  4. Optional: a content-addressed global store (~/.slice/store) so repeated tenant builds share fetched tarballs.

An interim step that costs very little: document the supported path explicitly (bun install --frozen-lockfile --ignore-scripts → slice pack) and have slice pack emit a warning when node_modules is absent instead of failing late inside the bundler.

Activity

  1. siktec-lab commented on Nov 9, 2026

    @siktec-lab
    Collaborator

    Addressed in #41 (�0.10.6).

    • slice compile already embeds the full SLICEPK\x02 CAS archive into the standalone executable, and slice inspect works directly on both .cas archives and standalone binaries.
    • Extended CasIndexHeader and slice inspect to record and display lockfile_blake3 (package-lock.json / pnpm-lock.yaml / yarn.lock / �un.lockb) and resolved package.json dependency versions for build provenance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions