Skip to content

[pkgdef 1/6] docs(specs): add package definition spec and Go example - #3000

Open
mikeland73 wants to merge 13 commits into
mainfrom
mikeland73/pkgdef-spec
Open

mikeland73 wants to merge 13 commits into
mainfrom
mikeland73/pkgdef-spec

Conversation

@mikeland73

@mikeland73 mikeland73 commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Stack (merge in order):

  1. [pkgdef 1/6] docs(specs): add package definition spec and Go example #3000 — spec + Go example 👈 this PR
  2. [pkgdef 2/6] feat(pkgdef): add package definition library #3001 — internal/pkgdef library
  3. [pkgdef 3/6] feat(pkgdef): wire package definitions into add, lock, install and env #3002 — wiring into add/lock/install/env (behind DEVBOX_FEATURE_PKG_DEFS)
  4. [pkgdef 4/6] feat(pkgs): add the initial set of package definitions #3034 — initial package set (15 definitions)
  5. [pkgdef 5/6] feat(pkgdef): support the initial package set #3035 — format features for the initial package set
  6. [pkgdef 6/6] test(pkgs): install and switch versions of every shipped package #3036 — per-package install/switch tests + CI

Summary

First PR of the package definitions stack, which lets a Devbox project install a tool from the upstream vendor's binary distribution instead of nixpkgs, driven by a declarative package definition file.

  • specs/package-definitions.md: the format specification (<name>.pkg.json or <name>.pkg.jsonc, both parsed as hujson, referenced as pkg:<ref>@<version>), lockfile shape, install strategies, checksums, template variables, activation, security notes. It doubles as the living implementation plan and status table.

  • pkgs/go/go.pkg.jsonc: the first definition. Installs Go from the official go.dev builds, using its JSON index for versions and per-file checksums.

  • Roadmap: Nix-optional Devbox (new section). It covers:

    • Nix as opt-in, so a project without nix packages needs no Nix and gets no nix stdenv env. This matters for iOS/Xcode builds.
    • devbox add go using shipped definitions, with a remembered nix/native preference.
    • Search returning both nix and native packages.
    • A content-keyed cache layout with garbage collection.

    Each part records what in the code still blocks it and the work it implies.

  • Audit findings across the stack (new section): 12 ranked findings from a correctness and security audit of all six PRs, each marked with the PR that fixed it.

  • Spec consistency fixes: requesting a full version (1.22.3) is documented as prefix matching, not an exact pin, matching MatchVersion. Pre-releases are versions containing a letter or a hyphen. Roadmap gaps that later PRs in the stack already fixed are marked as fixed.

Test plan

  • Docs only. The Go example is parsed by a unit test in the next PR and was used end to end in the third (go version go1.22.12 darwin/arm64 from go.dev).

https://claude.ai/code/session_01Bqy92oAnwydcLrbSE7nkVH


Generated by Claude Code

Add the specification for package definitions, a declarative format for
installing a tool from the upstream vendor's binary distribution instead
of nixpkgs, referenced from devbox.json as pkg:<ref>@<version>. The
document doubles as the living implementation plan and status board.

Add pkgs/go/go.pkg.json, the first definition, which installs Go from
the official builds on go.dev using its JSON index for versions and
checksums.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@mikeland73
mikeland73 requested a review from savil October 22, 2026 21:32
@mikeland73
mikeland73 added this pull request to stack #3003 October 22, 2026 21:35
Accept both <name>.pkg.json and <name>.pkg.jsonc. Both are parsed as
hujson; .jsonc is preferred when the file has comments so editors
highlight it correctly. Rename the Go example to go.pkg.jsonc since it
is commented.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@claude

claude Bot commented Oct 25, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@mikeland73 mikeland73 closed this Nov 17, 2026
@mikeland73 mikeland73 reopened this Nov 17, 2026
@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This spec-and-example PR appears safe to merge in the stated stack order.

Summary

Adds the package-definition spec and a Go definition that uses official downloads and checksums.

  • The package-definition guide explains how to describe vendor-built tools.

No new actionable issues found. This was a source review; no tests were run.

Reviews (5) · Last reviewed commit: "docs(specs): say that adding a pkg: ref ..." · Reviewed by Greptile

Comment thread specs/package-definitions.md Resolved
Adds a roadmap section covering nix as opt-in, devbox add with shipped
definitions and a nix/native preference, search returning native packages,
and a content-keyed cache layout with garbage collection. Records the
cross-stack audit findings and applies its corrections to the spec.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Bqy92oAnwydcLrbSE7nkVH
Mark the audit findings as fixed with the PR that fixed them, and update
the install location, cache key (URL only, not the digest), download
layout, PATH order and system detection to match the code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Bqy92oAnwydcLrbSE7nkVH

Copy link
Copy Markdown
Collaborator Author

@greptileai review

This PR now also adds the "Roadmap: Nix-optional Devbox" and "Audit findings across the stack" sections. Your comment about the shared install path is addressed by content-keyed, immutable install dirs in #3001, with the wiring in #3002.


Generated by Claude Code

greptile-apps[bot]
greptile-apps Bot previously approved these changes Nov 23, 2026
@mikeland73
mikeland73 removed the request for review from savil November 23, 2026 20:14

Copy link
Copy Markdown
Collaborator Author

@greptileai review


Generated by Claude Code

Comment thread specs/package-definitions.md Resolved
@greptile-apps
greptile-apps Bot dismissed their stale review November 23, 2026 21:44

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

Copy link
Copy Markdown
Collaborator Author

@greptileai review


Generated by Claude Code

greptile-apps[bot]
greptile-apps Bot previously approved these changes Nov 23, 2026
- Pre-releases are versions with a letter or a hyphen, matching MatchVersion.
- List the allowed platforms and that an omitted checksum means none.
- Roadmap gaps already fixed later in the stack (ref @ splitting, pkg: in
  info/search, nix.System for definitions, pre-PR 2 cache layout) are now
  marked as fixed instead of described as current.
- Drop a stale parenthetical in audit finding 3 and complete finding 10.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Bqy92oVmTnKym4AYzq67zj
@greptile-apps
greptile-apps Bot dismissed their stale review November 23, 2026 22:02

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

Copy link
Copy Markdown
Collaborator Author

@greptileai review


Generated by Claude Code

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants