Skip to content

A bin claim on a src/scripts module silently removes it from conventional script discovery (artifact scripts/ ends up empty) #389

Description

@ScriptedAlchemy

What happened

agent-bundle.config.ts:

bin: { hauler: './src/scripts/hauler.ts' },

src/scripts/hauler.ts is a conventional script route (the hooks rewrite target scripts/hauler.mjs). Because configClaimedSources() treats a bin entry as a claim, the module is filtered out of route discovery entirely: inspect --json shows model.packageBuild.bins containing hauler but model.scripts: [], and the host artifact has no scripts/hauler.mjs. No diagnostic is emitted — the file just stops shipping.

The fix was to also declare it explicitly:

scripts: { hauler: './src/scripts/hauler.ts' },
bin:     { hauler: './src/scripts/hauler.ts' },

Ask

Either keep bin-claimed src/scripts/* modules in script discovery (a bin and an artifact script are not mutually exclusive — this is exactly the "same entry, npm bin + hook target" case), or emit a diagnostic when a conventional src/scripts module is claimed by bin alone so the disappearance is visible.

Also observed: simulateHook() from agent-bundle/api takes ~7 s per call on this machine (each call appears to re-prepare the project); the generated wrappers themselves answer in ~0.5 s. Three simulate calls blow a default 30 s test timeout. Caching the prepared project across calls in one process would help consumer test suites.

Pin: agent-bundle@105c65d8f.

Activity

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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions