Skip to content

fix(examples): export CliCommandDefinition so declaration emit can name it - #174

Merged
ScriptedAlchemy merged 1 commit into
mainfrom
fix/audiobook-ab5000
Sep 1, 2026
Merged

fix(examples): export CliCommandDefinition so declaration emit can name it#174
ScriptedAlchemy merged 1 commit into
mainfrom
fix/audiobook-ab5000

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

pnpm examples:check fails reproducibly on main: the audiobook-curator agent-bundle build dies with

error   Failed to generate declaration files. (agent-bundle-index)
[{"code":"AB5000","message":"Error occurred in agent-bundle-index declaration files generation.","severity":"error"}]

(observed in #166's report). The underlying TypeScript diagnostics, recovered by replaying the synthesized DTS program (node_modules/.agent-bundle-dts-* tsconfig) with tsc --declaration --emitDeclarationOnly, are five TS4023s:

src/operations/audible.ts(79,14): error TS4023: Exported variable 'audibleOperations' has or is using name 'CliCommandDefinition' from external module ".../src/cli-command" but cannot be named.

#150 introduced src/cli-command.ts with CliCommandDefinition unexported while the exported operations factories (audibleOperations, discoveryOperations, evidenceOperations, mediaMutationOperations, outputOperations) return objects of defineCliCommand(...) results, so their inferred declaration types must name it from other modules. This is emit-only: tsc --noEmit (the example's typecheck) passes, which is why only the declaration build failed. Fix: export the interface.

Not the dev lock: AB5000 is the CLI's catch-all diagnostic code, and the initial report attributed it to dev-lock contention ("another development process owns this project"). The check pipeline (validate/build/typecheck/test/test:routes) never acquires the dev lock — its only production acquirer is the DevCoordinator behind agent-bundle dev — and dead-pid reclaim is already covered by tests/dev-lock.test.ts ("recovers a dead lock only after probing its recorded pid", the eight-contender recovery-gate test). A leaked dev.lock with a dead owner pid (998818, from this morning's OOM-killed dev session) existed in the primary checkout's example tree and was deleted surgically, but it could not have caused this failure and reproduction succeeds in a pristine worktree.

Regression gate

An emit-only TS4023 is invisible to --noEmit typecheck and to runtime tests by construction; the executable gate is declaration emit itself, which pnpm --filter ./examples/audiobook-curator check (and the examples-check CI job) runs via agent-bundle build. That exact reproduction now passes — package build emits all 39 files including the .d.ts graph.

Test plan

  • Reproduced on pristine main worktree: audiobook build fails with AB5000/TS4023 (serial and 3-way-concurrent)
  • After fix: DTS program replay clean (tsc --declaration --emitDeclarationOnly, exit 0)
  • pnpm --filter ./examples/audiobook-curator check green (validate, build, typecheck, 35+2 tests)
  • Full pnpm examples:check green
  • Root pnpm typecheck and scoped rslint clean

…me it

The audiobook-curator package build's d.ts generation (rslib environment
agent-bundle-index) failed with TS4023 on every exported operations
factory: their inferred return types reference CliCommandDefinition,
which #150 introduced unexported. Declaration emit must import the type
from src/cli-command, so `agent-bundle build` failed with AB5000
("Error occurred in agent-bundle-index declaration files generation.")
while `tsc --noEmit` passed. Reported during examples:check in #166's
report.
@changeset-bot

changeset-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 3fc7067

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T18:59:39.741089Z 3fc7067 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Sep 1, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle@174
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/create-agent-bundle@174
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@174

commit: 3fc7067

@ScriptedAlchemy
ScriptedAlchemy merged commit 514a728 into main Sep 1, 2026
5 of 10 checks passed
@ScriptedAlchemy
ScriptedAlchemy deleted the fix/audiobook-ab5000 branch September 1, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant