hanki

pkg

stdlib/core/pkg.hk: package-manifest data types.

The constructible records a hanki.config.hk manifest and its generated hanki.lock.config.hk lockfile build with. Pure data (no effects, no @intrinsic), the manifest-side analogue of the path data module: a manifest open pkgs these so deps = [Dep(source=…, version=…)] and a lockfile locked = [Locked(…)] are ordinary Hanki struct literals. Hanki has no map or tuple literals, and dependencies are therefore a List<Dep>.

The manifest reader marshals these back positionally by declared field order (§21), and the field order below is therefore a frozen-at-1.0 wire contract: reordering a field is a breaking change to every manifest and lockfile.

Dep

struct Dep
  source: string
  version: string
end

One declared dependency. source is a contrib flat name ("money") or a universe short name ("http") that has a matching top-level URL binding in the manifest (http = "git.sr.ht/~user/http", §17); the binding's presence is what selects the tier, with no cross-source fallthrough. version is a constraint string (^1.2, ~1.2, >=1.2,<2, or an exact 1.2.0).

Locked

struct Locked
  source: string
  version: string
  hash: string
  api: string
  effects: List<string>
end

One resolved dependency in the lockfile. source is the resolved identity: the git URL for a universe package, or the reserved contrib:<name>@<version> string for a bundled contrib one, and never the manifest short name, which leaves the lockfile self-contained. hash is the content pin (a git commit hash for universe; a deterministic fnv1a: tree hash for the git-less seeded contrib source); effects is the approved transitive world+user-effect surface (sorted), the fail-by-default effect-growth gate's recorded approval. api digests the package's exported names and signatures, and a pin that moved can therefore say whether the public interface moved with it. The old source is gone by then, and no other field in the lock can answer that.

Rift

struct Rift
  effect_name: string
  path: string
  deterministic: bool
end

One rift binding: a Rust crate in the application's own tree that answers an effect declaration's ops with native code (HANKI.md §21). effect_name is the module-qualified effect, spelled as a provide head spells it ("audio.Audio"; effect itself is a keyword); path is the crate directory, relative to the manifest and confined under the project; deterministic is the author's claim that the crate is reproducible, which --deterministic requires and cannot verify. Honoured in the root manifest only: a dependency declaring rifts is refused at resolution.