Thanks to visit codestin.com
Credit goes to github.com

Skip to content

CLI broken on boot: [email protected] published without quality/ directory (metrics-collector + seed-metrics) #782

@pradeaguiar12-ship-it

Description

@pradeaguiar12-ship-it

Bug

[email protected] was published to npm without the quality/ directory in the
tarball payload. The CLI eagerly imports from it via commands/metrics/*, so the
entire CLI fails on boot with MODULE_NOT_FOUND — not just the metrics
subcommand.

Repro (clean install)

mkdir test-aiox && cd test-aiox
npm pack [email protected]
tar -tzf aiox-core-5.2.9.tgz | grep "quality/" || echo "❌ quality/ missing from tarball"

Error

Error: Cannot find module '../../../quality/metrics-collector'
Require stack:
- .aiox-core/cli/commands/metrics/record.js
- .aiox-core/cli/commands/metrics/index.js
- .aiox-core/cli/index.js
    at Function._resolveFilename (node:internal/modules/cjs/loader:1383:15)
    ...
  code: 'MODULE_NOT_FOUND'

Affected files (4)

All four eagerly require from ../../../quality/:

File Imports
cli/commands/metrics/record.js:12 MetricsCollector from quality/metrics-collector
cli/commands/metrics/show.js:12 MetricsCollector from quality/metrics-collector
cli/commands/metrics/cleanup.js:12 MetricsCollector from quality/metrics-collector
cli/commands/metrics/seed.js:12,44 seedMetrics, generateSeedData from quality/seed-metrics

And the eager registration in cli/index.js:

```js
const { createMetricsCommand } = require('./commands/metrics');
// ...
program.addCommand(createMetricsCommand());
```

means any invocation — `aiox --help`, `aiox qa run`, `aiox info`, anything — explodes.

Impact

Every subcommand (`workers`, `manifest`, `qa`, `mcp`, `migrate`, `generate`,
`config`, `pro`, …) is blocked on boot, not just `metrics`. Fresh installs of
v5.2.9 have an unusable CLI.

Likely cause

`quality/` was probably gitignored or excluded from the `files` field in the
package's `package.json` during the 3.11a release. Reference: commit headers
say "Story 3.11a - Quality Gates Metrics Collector".

Suggested fixes (any of)

  1. Include `quality/` in the published payload (verify `files` field or
    `.npmignore`).
  2. Make `cli/commands/metrics` imports lazy so the CLI degrades gracefully
    when `quality/` is absent (only the `metrics` subcommand would fail).
  3. Move `MetricsCollector` and `seed-metrics` into the published tree
    (e.g., under `core/quality/`).

Local workaround applied

Created honest stubs at `.aiox-core/quality/metrics-collector.js` and
`.aiox-core/quality/seed-metrics.js` that throw an explicit error if any
`metrics` subcommand is invoked. CLI now boots; other subcommands functional.

Environment

  • aiox-core: 5.2.9 (npm)
  • node: 22.21.0
  • npm: 10.9.4
  • OS: macOS (darwin 25.5.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: cliCLI tools (bin/, packages/aios-pro-cli/)status: needs-triageAwaiting initial triage

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions