Skip to content

test(cli): add example regression coverage#34

Merged
marmar9615-cloud merged 1 commit intomainfrom
test/cli-example-regressions
Apr 28, 2026
Merged

test(cli): add example regression coverage#34
marmar9615-cloud merged 1 commit intomainfrom
test/cli-example-regressions

Conversation

@marmar9615-cloud
Copy link
Copy Markdown
Owner

Summary

Adds CLI regression coverage for public CLI behavior and copyable examples as post-v0.4.0 v1-readiness work.

Release / prior PR context

Claude / parallel work context

Claude may be implementing v0.5 core signing schemas/canonicalization. This PR is parallel-safe because it only touches CLI tests/docs, examples index text, root scripts, and changelog. It does not touch core source, spec files, signed-manifest design docs, or MCP runtime files.

Files added

  • packages/cli/src/tests/examples-regression.test.ts
  • scripts/validate-examples.mjs

Files modified

  • CHANGELOG.md
  • examples/README.md
  • package.json
  • packages/cli/README.md

CLI behaviors covered

  • agentbridge version reports the CLI package metadata version.
  • agentbridge mcp-config preserves stdio, Codex, Claude Desktop, Cursor/generic JSON, and v0.4.0 HTTP transport snippets.
  • mcp-config uses placeholder token references and does not leak env-provided tokens or real-looking bearer tokens.
  • agentbridge validate accepts adopter quickstart manifests.
  • agentbridge validate accepts scanner regression valid fixtures and fails safely for the invalid fixture.
  • agentbridge generate openapi generates and validates manifests for both OpenAPI examples.
  • OpenAPI regression generation reports the skipped HEAD /reports/{reportId}/exports operation.
  • scripts/validate-examples.mjs validates built-CLI behavior across valid JSON manifest examples, the intentional invalid fixture, SDK-basic generated output, and both OpenAPI generated manifests.

Validation

  • npx vitest run packages/cli/src/tests passed: 2 files / 28 tests.
  • npm run typecheck:clean passed.
  • npm test passed: 18 files / 216 tests.
  • npm run build passed.
  • npm run pack:dry-run passed.
  • npm run validate:examples passed.
  • node packages/cli/dist/bin.js version printed 0.4.0.
  • node packages/cli/dist/bin.js mcp-config passed and showed stdio/Codex/Claude/Cursor/generic/HTTP snippets.
  • node packages/cli/dist/bin.js validate examples/adopter-quickstart/manifest.basic.json passed.
  • node packages/cli/dist/bin.js generate openapi examples/openapi-regression/catalog-regression.openapi.json --out /tmp/agentbridge.openapi-regression.generated.json passed and reported the skipped HEAD operation.
  • node packages/cli/dist/bin.js validate /tmp/agentbridge.openapi-regression.generated.json passed.

Safety / release confirmations

  • No core, spec, or signed-manifest files were touched.
  • No MCP runtime files were touched.
  • No package versions changed.
  • No package-lock.json changes.
  • No npm publish, git tag, or GitHub release happened.
  • Dependabot was untouched.

@marmar9615-cloud marmar9615-cloud merged commit 93ca211 into main Apr 28, 2026
2 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 238b8804a8

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

import { join, resolve } from "node:path";
import { spawnSync } from "node:child_process";

const root = resolve(new URL("..", import.meta.url).pathname);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Resolve script root with fileURLToPath

validate:examples computes root from new URL(...).pathname, which is not a safe filesystem path on non-POSIX setups: it keeps percent-encoding (e.g. spaces as %20) and produces /C:/...-style paths on Windows. In those environments, cwd/cli point to invalid locations and the script fails before running validations. Use fileURLToPath(new URL("..", import.meta.url)) (then path.resolve) so the npm script works reliably across developer machines.

Useful? React with 👍 / 👎.

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