Agent pack
Publishing packages from blueforge-org
The publish path for fleet packages — what runs, what to check, nothing published by accident.
Verified 2026-10-11 by reading origin/main of blueforge-org at b0648e0b (2026-10-10). Nothing was published or dispatched.
Registry: https://api.packr.blueforge.studio, scope @blueforge-studio/*. Tokens: see tokens.md.
Newest authoritative doc: blueforge-org/docs/packages/PUBLISHING.md (2026-09-12), stale in places (below); HANDOVER.md (2026-09-29) is newest on gotchas.
Scope: this covers packages that live in blueforge-org. Packages in other repos publish through their own pipeline: e.g. @blueforge-studio/flags lives in
forge-control and goes through forge-control's .gitea/workflows/publish.yml (the change adding it is forge-git PR #1977, reportedly unmerged, unverified by me).
Before publishing from any repo, check which workflow owns it.
The normal path: bump the version, merge
- Edit
package.json#versionby hand (no changesets). Package needspublishConfig.registry= the packr URL andfiles: ["dist"];dist/is gitignored. - Merge to
main..gitea/workflows/publish-changed.ymlruns on a push touchingpackages/**(concurrency grouppublish-packr, 30 min timeout). - It finds changed packages (diff against the last
publish/*tag), adds their dependents, sorts topologically on dependencies + peerDependencies, and for each package: builds itsprebuildDepsfirst, checkspnpm view name@ver, builds, tests, packs and validates exports, thenpnpm publish <tgz> --access public --no-git-checks --registry …. - Effective gate = the version bump. A changed package whose version is already on packr returns
already-published(skipped), so only bumped packages ship. A 409 counts as already-published. - Secrets (names only):
PACKR_TOKEN(read),PACKR_TOKEN_PUBLISH(read + publish). A missing publish secret fails preflight. An expired token gives 401: a human mints a new one (seetokens.md).
Outcomes: already-published-broken (version on packr but exported files missing) exits non-zero with no tag; the fix is a version bump.
A failed package makes its dependents skip. The publish/batch-<date>-<epoch> tag is cut only when nothing failed, but already-published
counts as published, so a tag can be cut when nothing new shipped.
Manual path
- There is no
release-packageworkflow on forge-git.release-packageis only a script (scripts/release-package.ts) called per package bypublish-changed.ts..github/workflows/publish-manual.ymlhas a per-package input but GitHub Actions is off for the org, so it never runs. (An unmerged branchfeat/package-release-scriptsadds release scripts; whether it adds a dispatch workflow is UNVERIFIED.) - Dispatch the real workflow:
fgit ci dispatch blueforge-studio/blueforge-org publish-changed.yml --ref main --input dry_run=true, then again with--input publish_all=trueor no inputs. Pass the filename. There is no per-package input: it publishes everything changed since the last tag. Needed for lockfile-only changes, which do not trigger it (it fires only onpackages/**). - One package locally:
pnpm exec tsx scripts/release-package.ts --package <name|dir> [--dry-run]. Needs the publish token, which only the operator supplies. - Never
pnpm publishby hand from a checkout withoutdist: that shippedsidecar-schemas@0.4.1broken. - Agents do not mint tokens or run a real publish unless the operator says so; do the dry run, then hand the token step to the operator.
Gotchas
- Dependency not built:
publish-changed.tsnow builds<dep>...for everyprebuildDepsfirst. Cause was a node16distresolution failure (TS2307) when a dependency'sdistis absent (vision-gateway@0.7.1, marketing-kit@0.6.1). - Stale-dist phantom failures (green alone, red in the suite):
pnpm -r --filter './packages/**' --no-bail --workspace-concurrency=1 build || trueonce per worktree;--no-bailgoes beforebuild. - pnpm overrides live in
pnpm-workspace.yaml(pnpm 10 ignores thepnpmfield in package.json here). In consuming repos that run pnpm 9.15 and 11 they must be declared in both places. *.jsongitignore was narrowed 2026-09-29;HANDOVER.md:44,57still describe the old blanket rule. New packages can 401 on first publish (unverified, from a peer's memory).- Queueing: the only mechanism in source is the single
publish-packrconcurrency group (cancel-in-progress: false). A queued publish is not a failure: check, don't re-dispatch. - UNVERIFIED: the cache-save ETIMEDOUT false failure, and whether test jobs are required PR checks (
ci/gitea-pr-gatebranch exists). Treat blueforge-org as force-merge (no required PR gate) until told otherwise. fgit ci logsis reported broken inHANDOVER.md:73; usefgit ci why/jobs.
Verify: a merged PR is not a published version
pnpm view @blueforge-studio/<pkg> versions --registry https://api.packr.blueforge.studio (and dist-tags.latest). The script verifies a tarball with
npm pack <spec> --pack-destination <tmp> + tar -tzf. Also fgit ci runs blueforge-studio/blueforge-org. A successful full batch cuts a publish/batch-* tag.
Consumers: bumping a pin
Edit the range in the consumer's package.json, pnpm install (needs a packr token in .npmrc; PACKR_TOKEN in deploy environments), commit lockfile too.
Pin first: sidecar schemas are .strict(), so a new key fails any repo pinned below the version that added it. Order: publish the schema, bump
every consumer's pin, then write the new field. Confirm the version is on packr before bumping.
Stale text to ignore
PUBLISHING.md:113-118,185-188saypublish-changed.tsrewritesworkspace:*; no rewrite was found (pnpm handles it).:133saystea actions run: usefgit ci dispatch.:46,251sayfgit token create(UNVERIFIED);claude/TOKENS.md:36sayspackr admin tokens create. The troubleshooting table omitsalready-published-broken.claude/CLIS.md:96cites a "Publish pipeline" section that does not exist (real one:CLAUDE.md"Package Registry (packr)", ~168-178).:40has the wrong host (packr-registry.blueforge.studio; real isapi.packr.blueforge.studio).claude/TOKENS.md:30-51says both active tokens are 401: current token state not verified.