Skip to content

Add SDK testing helpers and repeatable list IDs - #125

Merged
unbraind merged 1 commit into
mainfrom
feat/sdk-testing-context-primitives
Jun 6, 2026
Merged

unbraind merged 1 commit into
mainfrom
feat/sdk-testing-context-primitives

Conversation

@unbraind

@unbraind unbraind commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • add SDK testing helpers for package manifest resource assertions and vector store adapter registration assertions
  • export the helpers/types through the public SDK barrel and document package-author workflows
  • make list-family --ids repeatable so agents can refresh focused working sets without broad scans
  • close and release pm-475h, pm-xevy, and pm-42tb; regenerate CHANGELOG.md via pm-changelog

Verification

  • node scripts/run-tests.mjs test -- tests/unit/sdk-index.spec.ts tests/unit/bootstrap-args.spec.ts tests/unit/list-command.spec.ts
  • node scripts/run-tests.mjs coverage (2526 tests, 100% statements/branches/functions/lines)
  • manual temp smoke with isolated PM_PATH/PM_GLOBAL_PATH and temp npm SDK consumer
  • pnpm build
  • pm test pm-475h --run --progress
  • pm test pm-xevy --run --progress
  • pm test pm-42tb --run --progress
  • pnpm changelog:pm && pnpm changelog:pm:check
  • pm validate --check-resolution --check-history-drift (only pre-existing resolution warnings; no history drift)
  • pm package doctor --project --detail deep --trace
  • pm health --check-only --summary --json
  • pnpm audit --audit-level moderate
  • pnpm security:scan
  • node scripts/release/sentry-telemetry-gate.mjs
  • bash scripts/prod/telemetry/check-stack-health.sh

Notes

  • pm-changelog@2026.6.6 is active and produced the package-owned changelog update.
  • GitHub/release/security sub-agent found no open PRs/issues, no exposed Dependabot or secret-scanning alerts, green latest main CI/Docs, and healthy telemetry/Sentry.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @unbraind, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@unbraind

unbraind commented Jun 6, 2026

Copy link
Copy Markdown
Owner Author

@codex review
/gemini review
@gemini-code-assist review

Please review the SDK testing helper additions and repeatable list --ids agent working-set primitive.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@coderabbitai

coderabbitai Bot commented Jun 6, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@unbraind, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 54 minutes and 30 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 7a9f65ab-4997-4705-886f-9a42fdc7fd67

📥 Commits

Reviewing files that changed from the base of the PR and between aa6edf2 and f6e1e1f.

📒 Files selected for processing (18)
  • .agents/pm/history/pm-42tb.jsonl
  • .agents/pm/history/pm-475h.jsonl
  • .agents/pm/history/pm-xevy.jsonl
  • .agents/pm/tasks/pm-42tb.toon
  • .agents/pm/tasks/pm-475h.toon
  • .agents/pm/tasks/pm-xevy.toon
  • CHANGELOG.md
  • docs/COMMANDS.md
  • docs/EXTENSIONS.md
  • docs/SDK.md
  • src/cli/register-list-query.ts
  • src/sdk/cli-contracts/commander-types.ts
  • src/sdk/index.ts
  • src/sdk/testing.ts
  • tests/fixtures/contracts/full.json
  • tests/unit/bootstrap-args.spec.ts
  • tests/unit/list-command.spec.ts
  • tests/unit/sdk-index.spec.ts
📝 Walkthrough

Walkthrough

This PR implements repeatable --ids flag support for list commands and adds two SDK testing assertion helpers. The --ids flag now accepts repeated invocations that accumulate into comma-separated values. Two new public SDK testing exports—assertPackageManifest and assertRegisteredVectorStoreAdapter—enable package authors to validate manifest metadata and semantic-storage adapter registrations without reimplementing normalization logic.

Changes

CLI and SDK testing enhancements

Layer / File(s) Summary
Repeatable --ids flag for list commands
src/sdk/cli-contracts/commander-types.ts, src/cli/register-list-query.ts, docs/COMMANDS.md, tests/unit/bootstrap-args.spec.ts, tests/unit/list-command.spec.ts, .agents/pm/history/pm-42tb.jsonl, .agents/pm/tasks/pm-42tb.toon
Commander type contract registers ids as a repeatable option; CLI help text and command documentation specify repeated flags accumulate like comma-separated input; bootstrap normalization test verifies repeated --ids arguments merge into a single canonical token with list_merge trace event; list-open CLI test confirms accumulated values produce filtered item results.
SDK testing assertion helpers
src/sdk/testing.ts
Type imports for manifest and resource metadata. RegisteredVectorStoreAdapterExpectation interface specifies adapter name and optional extension scoping. PackageManifestExpectation and PackageManifestResourceExpectation types define expectations for package name, aliases, and categorized resource paths. assertRegisteredVectorStoreAdapter normalizes adapter name, filters registrations, and throws detailed errors listing available adapters. assertPackageManifest validates package name match, aliases inclusion, and per-kind resource paths via internal set-based comparison helper.
SDK barrel re-exports and documentation
src/sdk/index.ts, docs/SDK.md, docs/EXTENSIONS.md
SDK index re-exports assertion functions and expectation types from testing module and RegisteredExtensionVectorStoreAdapter type from extensions loader. SDK documentation adds new helpers to testing export list and shows usage examples: loading a manifest with readPmPackageManifest and asserting normalized fields including aliases and resources by kind (extensions/docs/examples); verifying vector store adapter registration via adapter name. Extensions documentation recommends the manifest assertion approach for package authors/tests.
Comprehensive test coverage
tests/unit/sdk-index.spec.ts, .agents/pm/history/pm-475h.jsonl, .agents/pm/tasks/pm-475h.toon, .agents/pm/history/pm-xevy.jsonl, .agents/pm/tasks/pm-xevy.toon
Test fixture expanded with vector_store_adapters registry entries; barrel import coverage includes assertion helpers and re-exports. Package manifest assertion tests create temporary manifest and validate success path and detailed throw messages for name mismatch, missing aliases, missing resources, and incorrect resource kinds. Vector store adapter assertion tests verify lookup by adapter name and extension, and throw cases for empty name, missing adapter, mismatched extension, and empty registry. Integration test registers and asserts vector store adapter in real extension activation context.
Changelog
CHANGELOG.md
Added three bullet items under Unreleased/Other: repeatable pm list --ids for agent working-set refresh, SDK testing helper for vector store adapter registrations, and SDK testing helper for package manifest resource assertions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • unbraind/pm-cli#70: Both PRs extend argv normalization in normalizeBootstrapInvocation and the list_merge trace behavior, with this PR applying the mechanism to make --ids repeatable alongside other accumulated list flags.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 36.36% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately captures the main changes: adding SDK testing helpers and making list --ids repeatable, which are the primary objectives of this pull request.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, detailing the SDK testing helpers, repeatable list IDs feature, task closures, and extensive verification steps performed.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Add public SDK testing assertions for package manifest resources and vector store adapter registrations, with docs and coverage.

Allow repeated list --ids flags to accumulate for token-efficient agent working-set refresh.

Track and close pm-475h, pm-xevy, and pm-42tb; regenerate the package-owned changelog via pm-changelog.
@unbraind
unbraind force-pushed the feat/sdk-testing-context-primitives branch from aa6edf2 to f6e1e1f Compare June 6, 2026 19:40
@unbraind

unbraind commented Jun 6, 2026

Copy link
Copy Markdown
Owner Author

Updated the PR after CI static found a stale contract snapshot. Added tests/fixtures/contracts/full.json, reran the exact static CI block successfully, corrected pm linked-test metadata, and force-pushed.

@codex review
/gemini review
@gemini-code-assist review

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

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