Skip to content

feat(sdk): promote execution, diagnostics, and query engines - #573

Merged
unbraind merged 23 commits into
mainfrom
feat/sdk-execution-diagnostics-primitives
Jul 16, 2026
Merged

unbraind merged 23 commits into
mainfrom
feat/sdk-execution-diagnostics-primitives

Conversation

@unbraind

@unbraind unbraind commented Jul 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • promote linked-test execution, batch execution, test-run lifecycle, eval, stats, telemetry, list, search, query pagination, rendering, filters, and parsers into public SDK ownership
  • preserve CLI compatibility through thin re-export shells and reference-identity tests
  • route SDK runtime and evaluation directly through SDK modules, eliminating the reviewed SDK-to-CLI inversion
  • shrink the mandatory private-core import baseline from 62 sources / 538 edges to 51 sources / 412 edges and reduce the ESLint suppression budget from 158 to 157

pm lineage

  • pm-oslr — execution and diagnostics SDK promotion, completed
  • pm-rjqr — public query wrapper lineage, completed; implementation ownership follow-up recorded
  • pm-9x6e — zero-boundary capstone, returned open with the exact 51-source / 412-edge remainder

Verification

  • pnpm release:gates
  • exact 100/100/100/100 coverage: 37,232 statements, 26,504 branches, 7,533 functions, 36,335 lines across 292 files / 5,738 tests
  • 100% repository and exported/member docstring coverage
  • static quality, package boundary, token budget, security, version, and release gates
  • 12-package packed npx smoke and 88-command temporary-directory dogfood
  • installed tarball public-SDK proof: list=1, search=1, eval nDCG=1
  • Sentry/telemetry gate green; transient intermediate relocation event diagnosed and resolved
  • Greptile exact-head review 63dfd757-1e8b-4f11-904c-959c50b8fe28: confidence 5/5, no review comments, no files requiring attention

Summary by cubic

Promotes list/search engines and linked-test execution (with background runs), eval, telemetry, and stats into the public sdk, with CLI commands now thin compatibility exports. Clarifies in docs that noTruncate intentionally overrides limit for list responses.

  • New Features

    • Typed sdk APIs: runList, runSearch (with pagination/rendering/parsers), runEval, runStats, runTelemetry, runTest, runTestAll, and test‑run lifecycle.
    • full list mode and typed results (ListedItem, ListFullResult, tree/projection types); exported query parsers and item‑filter option types.
  • Refactors

    • CLI commands are compatibility exports; runtime/evaluation route through the sdk. Private‑core boundary remains at 51 sources / 412 edges; update-many behavior unchanged.
    • Governance/runtime hardening and analyzer parity: lexical helpers with inline docs, normalized unknown‑error formatting, correct count‑only searches, full dedupe child corpus, positive test‑all timeouts, telemetry limit validation, and restored empty eval --fail-under semantics (with strict validation). Canonical governance exports in sdk/index.ts; normalized list‑filter resolvers.
    • CI/analysis: pin DeepSource TypeScript ESM settings (dialect: typescript, environment: [nodejs, vitest], module_system: es-modules, high complexity threshold) to prevent misclassification.
    • Docs and release hygiene: docs/SDK.md/inventory updated (clarifies noTruncate > limit), changelog regenerated; Windows packed‑extension install test uses an explicit timeout and now passes.
    • Quality gates: static‑quality script at scripts/release/static-quality-gate.mts run via pnpm exec tsx; suppression map pruned; ESLint suppression budget lowered to 154.

Written for commit bd6b03f. Summary will update on new commits.

Review in cubic

unbraind added 3 commits July 16, 2026 08:44
Move linked-test execution, batch supervision, persisted run lifecycle, evaluation, telemetry, and statistics behind public typed SDK contracts while retaining identity-preserving CLI compatibility exports.

Reduce the CLI/MCP private-core boundary by 8 sources and 72 edges, lower the exact ESLint suppression ratchet, document the public composition surface, and record pm-oslr/pm-9x6e evidence with generated changelog output.

Verified with 5,738 tests at exact 100/100/100/100 coverage, strict release gates, packed-package acceptance, 88-command dogfood, and live Sentry/telemetry checks.
Move the cohesive list, search, pagination, rendering, filter, and parser implementations under SDK ownership while preserving thin CLI compatibility exports. Route evaluation and runtime consumers directly through the public SDK boundary and update package mocks and identity tests accordingly.

Ratchet the grandfathered CLI-private import baseline from 54 sources / 466 edges to 51 sources / 412 edges. Record live pm lineage and exact 100/100/100/100 release-gate, packed-package, and 88-command dogfood evidence.
Remove npm-generated legacy package defaults, make the promoted parser documentation SDK-centric, and record the confidence-5 Greptile review. Return the zero-boundary capstone to open and release ownership because 51 source entries / 412 edges remain.

@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, your pull request is larger than the review limit of 150000 diff characters

@unbraind

Copy link
Copy Markdown
Owner Author

@greptileai please review this exact head.

@unbraind

Copy link
Copy Markdown
Owner Author

/gemini review

@unbraind

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 59 minutes.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This change promotes query, evaluation, execution, diagnostics, telemetry, statistics, and linked-test runtimes into public SDK modules. CLI command modules become compatibility re-exports, SDK runtime wiring and documentation are updated, governance integrations consume new contracts, and release verification thresholds are tightened.

Changes

SDK ownership promotion

Layer / File(s) Summary
Boundary and compatibility wiring
src/cli/commands/*, src/cli/shared-parsers.ts, src/sdk/runtime.ts, scripts/release/sdk-import-boundary-baseline.json
CLI command surfaces delegate to SDK-owned implementations, while SDK runtime imports and boundary allowlists point to SDK modules.
Query and evaluation SDK runtimes
src/sdk/query/*, src/sdk/eval.ts, src/sdk/index.ts, docs/SDK.md
List, search, query parsing, and evaluation contracts and runtimes are added to the public SDK with filtering, ranking, pagination, projection, fallback, and metric evaluation behavior.
Linked-test execution and diagnostics
src/sdk/test/*, src/sdk/stats.ts, src/sdk/telemetry.ts, tests/unit/commands/test*.spec.ts`
Linked-test parsing, sandbox execution, assertions, batching, context handling, tracking, background runs, statistics, and telemetry dispatch are implemented and validated.
Governance integration and release gates
packages/pm-governance-audit/extensions/governance-audit/*, eslint-suppressions.json, package.json, scripts/release/static-quality-gate.mjs, CHANGELOG.md
Governance extensions consume full SDK list results, audit flows are reorganized, suppression entries are removed, and the static quality budget is reduced from 158 to 156.
Documentation and verification
docs/SDK.md, docs/SDK_PRIMITIVE_INVENTORY.md, tests/unit/sdk/*, tests/integration/*, .agents/pm/*
Public SDK exports, ownership mappings, identity checks, release contracts, and feature/task evidence are updated.
Estimated code review effort: 5 (Critical) ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant SDK
  participant Store
  participant ExternalProvider
  CLI->>SDK: invoke public runtime
  SDK->>Store: load settings, items, history, or linked tests
  SDK->>ExternalProvider: request semantic search or diagnostics data
  ExternalProvider-->>SDK: provider results or fallback condition
  SDK-->>CLI: structured result, warnings, and diagnostics
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 23.06% 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
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.
Title check ✅ Passed The title matches the main change: promoting SDK execution, diagnostics, and query engines.
Description check ✅ Passed The description accurately summarizes the SDK promotions, CLI compatibility shims, and verification.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@codspeed

codspeed Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

Merging this PR will regress 4 benchmarks

⚡ 7 improved benchmarks
❌ 4 regressed benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ stableStringify (nested contract) 161.3 µs 161.4 µs -0.02%
❌ createQueryFingerprint 514.7 µs 514.7 µs -0.01%
❌ tokenizeAlphaNumeric 367.4 µs 367.4 µs 0%
❌ score query over 2000 docs 5.6 ms 5.6 ms 0%
⚡ encodeQueryCursor 100.9 µs 100.8 µs +0.06%
⚡ build index (2000 docs x 80 words) 162.1 ms 162 ms +0.05%
⚡ jaccardSimilarity 153.2 µs 153.2 µs +0.04%
⚡ decodeQueryCursor 116 µs 116 µs +0.02%
⚡ normalizeLowercaseWhitespace 135.9 µs 135.8 µs +0.02%
⚡ build index (200 docs x 40 words) 8.4 ms 8.4 ms +0.01%
⚡ tokenize + score query over 2000 docs 7.5 ms 7.5 ms +0.01%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing feat/sdk-execution-diagnostics-primitives (bd6b03f) with main (bc4d6de)

Open in CodSpeed

@codecov

codecov Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@deepsource-io

deepsource-io Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in bc4d6de...bd6b03f on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

Important

Some issues found as part of this review are outside of the diff in this pull request and aren't shown in the inline review comments due to GitHub's API limitations. You can see those issues on the DeepSource dashboard.

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Jul 16, 2026 5:41p.m. Review ↗
Shell Jul 16, 2026 5:41p.m. Review ↗
Secrets Jul 16, 2026 5:41p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@greptile-apps

greptile-apps Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR moves several CLI-owned command implementations into the public SDK. The main changes are:

  • Adds SDK-owned list, search, eval, stats, telemetry, and linked-test APIs.
  • Converts CLI command files into thin compatibility re-exports.
  • Updates governance-audit commands to call the promoted SDK surfaces.
  • Adds query pagination, rendering, parser, and filter option exports under src/sdk.
  • Updates release gates, docs, configuration, and tests for the SDK ownership change.

Confidence Score: 5/5

The reviewed changes appear safe to merge.

The changes are mostly SDK ownership moves with compatibility re-exports and matching test/doc updates. No new high-confidence runtime bugs were identified in the reviewed changed paths. Historical list truncation and search count findings were either fixed or explicitly resolved in prior discussion.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • Executed the public-sdk-list-search-eval harness to validate the general-contract evaluation and captured the command log and harness artifact.
  • Reviewed the final proof JSON to confirm the evaluation metrics: listCount: 1, searchCount: 1, evalNdcg: 1, and evalPassed: true.
  • Cross-checked the harness, logs, and proof JSON artifacts to ensure consistency with the reported outcome.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
src/sdk/query/list.ts Adds the SDK-owned list implementation with projection-aware paging, filtering, sorting, and cursor metadata.
src/sdk/query/search.ts Adds the SDK-owned search engine with keyword, semantic, hybrid, count-only, projection, and pagination behavior.
src/sdk/eval.ts Adds SDK-owned eval execution and gating around runSearch with unrounded aggregate metrics.
src/sdk/test/execution.ts Moves linked-test execution into the SDK with sandboxing, assertions, tracking, and diagnostics.
src/sdk/test/batch.ts Adds SDK-owned test-all orchestration, linked-test deduplication, timeout resolution, and run tracking.
src/sdk/telemetry.ts Adds SDK-owned telemetry status, flush, stats, and clear handling with stricter stats limit validation.
src/sdk/stats.ts Adds SDK-owned stats aggregation and optional governance reports.
src/cli/commands/update-many.ts Routes update-many planning through the SDK list API while preserving full projection for mutation previews.
packages/pm-governance-audit/extensions/governance-audit/dedupe-merge.ts Updates dedupe merge to use SDK helpers and full-corpus child indexing.
packages/pm-governance-audit/extensions/governance-audit/dedupe-audit.ts Updates dedupe audit grouping and SDK list usage.
src/sdk/index.ts Expands public SDK exports for query, eval, stats, telemetry, and test APIs.
scripts/release/static-quality-gate.mts Renames and updates the static quality gate script for TypeScript execution.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant CLI as CLI compatibility exports
participant SDK as Public SDK modules
participant Core as Core stores/runtime
participant Gov as Governance audit package

CLI->>SDK: re-export command APIs
Gov->>SDK: call runList/runUpdate/runClose helpers
SDK->>Core: read settings, load items, execute search/tests
Core-->>SDK: return typed records and diagnostics
SDK-->>CLI: return command-compatible results
SDK-->>Gov: return audit and merge data
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant CLI as CLI compatibility exports
participant SDK as Public SDK modules
participant Core as Core stores/runtime
participant Gov as Governance audit package

CLI->>SDK: re-export command APIs
Gov->>SDK: call runList/runUpdate/runClose helpers
SDK->>Core: read settings, load items, execute search/tests
Core-->>SDK: return typed records and diagnostics
SDK-->>CLI: return command-compatible results
SDK-->>Gov: return audit and merge data
Loading

Reviews (42): Last reviewed commit: "docs(sdk): clarify unbounded list preced..." | Re-trigger Greptile

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request promotes execution, diagnostics, and query primitives (including list, search, eval, telemetry, stats, test, test-all, and test-runs) from the CLI command-side into the public SDK, leaving the CLI commands as thin compatibility re-exports. The review feedback focuses on security and robustness improvements, specifically addressing potential prototype pollution vulnerabilities in JSON path traversal and object creation by recommending the use of Object.prototype.hasOwnProperty.call and Object.create(null). Additionally, a more robust implementation for checking linked-test assertions is suggested to prevent future silent failures.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/sdk/test/execution.ts Resolved
Comment thread src/sdk/test/execution.ts Resolved
Comment thread src/sdk/test/parsers.ts Resolved
Comment thread src/sdk/test/parsers.ts Resolved
Comment thread src/sdk/test/parsers.ts Resolved
Comment thread src/sdk/test/parsers.ts Resolved
Comment thread src/sdk/test/parsers.ts Resolved
@greptile-apps

greptile-apps Bot commented Jul 16, 2026

Copy link
Copy Markdown

Greptile Summary

This PR moves several CLI-owned command implementations into public SDK modules. The main changes are:

  • SDK-owned query, evaluation, stats, telemetry, and linked-test execution modules.
  • Thin CLI compatibility shells that re-export the promoted SDK implementations.
  • SDK runtime dispatch updated to call the SDK-owned list, search, stats, telemetry, and test paths.
  • Public SDK exports, documentation, and primitive inventory updated for the promoted APIs.
  • Release gate baselines and tests updated for the reduced import boundary and suppression budget.

Confidence Score: 5/5

Safe to merge with minimal risk.

The changes are mostly implementation relocation with compatibility re-exports, SDK dispatch updates, public export updates, and reference-identity coverage. No functional or security issues were identified in the reviewed changed paths.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • Ran vitest on the release-readiness-runtime and release-automation-contract specs with the skip-build flag, and the test command exited with code 0 while logging 49 passing tests.
  • Executed the public SDK runtime harness, which completed with exit code 0 and demonstrated built SDK imports such as PmClient, create, list, search, and runEval, along with successful list/search counts across multiple public paths.
  • Captured the harness source as an artifact to support reproducibility of the validation.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
src/sdk/query/search.ts Moves search retrieval, filtering, ranking, projection, highlighting, and cursor pagination into SDK ownership.
src/sdk/query/list.ts Moves list filtering, projection, ordering, and pagination into the SDK query module.
src/sdk/test/execution.ts Moves linked-test execution, sandboxing, assertions, diagnostics, and tracking into SDK ownership.
src/sdk/test/batch.ts Moves batch linked-test selection, execution, and tracking into SDK ownership.
src/sdk/test/runs.ts Moves background test-run lifecycle operations into SDK ownership.
src/sdk/eval.ts Moves eval parsing and scoring runtime into SDK ownership while preserving the prior command behavior.
src/sdk/runtime.ts Routes SDK runtime action dispatch for list, search, stats, telemetry, and tests through SDK-owned modules.
src/sdk/index.ts Exports the newly promoted SDK query, eval, telemetry, stats, and linked-test primitives.
scripts/release/sdk-import-boundary-baseline.json Shrinks the accepted CLI-to-core import baseline after moving command implementations into SDK modules.
tests/unit/sdk/execution-diagnostics-primitives.spec.ts Adds SDK primitive and reference-identity coverage for promoted execution and diagnostics APIs.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant CLI as CLI command shell
participant SDK as Public SDK module
participant Runtime as SDK runtime dispatcher
participant Core as Core primitives/stores

CLI->>SDK: re-export command implementation
Runtime->>SDK: dispatch list/search/eval/stats/telemetry/test actions
SDK->>Core: resolve settings, schemas, stores, search/test primitives
Core-->>SDK: records, rankings, diagnostics, telemetry state
SDK-->>Runtime: structured SDK result
SDK-->>CLI: CLI-compatible result contract
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant CLI as CLI command shell
participant SDK as Public SDK module
participant Runtime as SDK runtime dispatcher
participant Core as Core primitives/stores

CLI->>SDK: re-export command implementation
Runtime->>SDK: dispatch list/search/eval/stats/telemetry/test actions
SDK->>Core: resolve settings, schemas, stores, search/test primitives
Core-->>SDK: records, rankings, diagnostics, telemetry state
SDK-->>Runtime: structured SDK result
SDK-->>CLI: CLI-compatible result contract
Loading

Reviews (2): Last reviewed commit: "chore(sdk): finalize reviewed query owne..." | Re-trigger Greptile

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request promotes query, execution, and diagnostics primitives to the public SDK, relocating list, search, evaluation, telemetry, stats, and linked-test execution modules from the CLI command surface to SDK-owned paths under src/sdk. The corresponding CLI commands are updated to serve as compatibility-only re-exports of these SDK primitives, and the import boundary baseline is successfully reduced. Feedback on the changes suggests improving error handling in src/sdk/eval.ts by replacing unsafe type assertions of caught unknown errors with safe type guards.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/sdk/eval.ts Resolved
Comment thread src/sdk/eval.ts Resolved

@coderabbitai coderabbitai 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.

Actionable comments posted: 16

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.agents/pm/features/pm-rjqr.toon:
- Line 37: Update the feature inventory entry at files[7] to document SDK
ownership of the promoted src/sdk/query list/search engines and cohesive query
helpers, along with the remaining CLI compatibility exports and SDK eval
direct-search imports. Include the relevant verification evidence while
preserving the existing closed resolution and audit details.

In `@docs/SDK.md`:
- Around line 804-820: Remove the inline PM tracker references from the “Query
execution” and “Execution and diagnostics” sections of the public SDK reference,
including the “Tracked by” lines and their private tracker links. Keep the
surrounding SDK documentation and section headings unchanged; use the
established pm docs collection link only if a collection reference is required.
- Around line 828-855: Add self-contained declarations for pmRoot, itemId, and
runId in the SDK example before they are used by runTest, runTestAll, and
runTestRunsStatus, or wrap the example in a function that receives these values.
Ensure the resulting snippet can type-check when copied without relying on
undeclared variables.

In `@src/sdk/query/list.ts`:
- Around line 250-251: Revise the public list result types around ListedItem and
ListResult.items so they accurately distinguish full records, tree-mode records,
and compact/field-projected partial records. Remove any casts that represent
projected rows as complete ItemMetadata, and define the corresponding field
optionality and tree-specific fields explicitly. Update the affected list
construction paths and preserve type-safe access for each result variant.

In `@src/sdk/query/parsers.ts`:
- Around line 16-28: Reject blank or whitespace-only numeric arguments before
JavaScript numeric conversion: update parseIntegerLimit in
src/sdk/query/parsers.ts at lines 16-28, the priority parser in
src/sdk/query/parsers.ts at lines 32-41, and offset handling in
src/sdk/query/list.ts at lines 709-719 to trim input and raise the existing
validation error when empty, while preserving normal numeric validation for
non-empty values.

In `@src/sdk/query/search.ts`:
- Around line 1479-1506: Update highlightFieldSnippet so the snippet window
always extends through the complete token beginning at firstMatchIndex, rather
than ending solely at firstMatchIndex plus HIGHLIGHT_SNIPPET_RADIUS. Preserve
the existing radius-based context, bounds clamping, and markTokenRuns
highlighting behavior.
- Around line 2905-2912: Update projectSearchHits so full-mode projection also
removes the internal exact_id_match ranking flag from every returned hit,
alongside matched_all_terms. Preserve all other hit fields and the documented
public shape.

In `@src/sdk/stats.ts`:
- Around line 144-152: Update the history file read flow around the raw variable
to use the existing readFileIfExists utility, preserving the continue behavior
when the file is absent and the existing error propagation for other failures.
Add the utility import from ../core/fs/fs-utils.js and remove the now-unused
isNotFoundError helper and import.

In `@src/sdk/test/batch.ts`:
- Around line 369-389: Update collectTestAllItemTests to start all metadata-only
runTest calls concurrently and await them with Promise.all, preserving each
result’s association with its original filteredItems entry. Build itemTests and
linkedTests from the resolved results while retaining the existing return shape
and run: false behavior.
- Around line 296-308: Update buildLinkedTestKey so the path-based return
includes the normalized env_set, env_clear, pm_context_mode, shared_host_safe,
and assertion metadata, matching the command-based key. Preserve the path and
scope components while ensuring path-linked tests with different metadata
produce distinct deduplication keys.

In `@src/sdk/test/entry.ts`:
- Around line 59-65: Update the Object.entries loop that normalizes kv keys to
detect when normalizedKv already contains normalizedKey before assignment;
return the existing usage-error result for duplicate case-insensitive keys,
while preserving unknown-key handling and normal assignment for unique keys.

In `@src/sdk/test/execution.ts`:
- Around line 865-883: Update parseLinkedTestTimeoutSeconds and the run-level
options.timeout handling to reject any parsed timeout that is zero or negative,
while preserving the existing alias-mismatch validation and flooring behavior.
Ensure both linked-test and run-level timeouts accept only positive integer
results before creating timers.
- Around line 622-650: Update segmentInvokesRecursiveTestAll to detect
shell-wrapped recursive invocations by recognizing common shells such as sh,
bash, cmd, and PowerShell, extracting their command payload arguments, and
inspecting those payloads with the existing detection logic. Preserve the
current direct-launch, node, npx/bunx, pnpm, and npm handling while ensuring
forms like -c, -lc, and /c cannot bypass recursion detection.
- Around line 2040-2044: Update mismatch_detected in the execution result to
compare global tracker item counts against the corresponding selected sandbox
global count in addition to the existing project comparison. Keep the check
gated by params.isPmCommand so global-scope tracker reads correctly report
mismatches and trigger preflight.
- Around line 1824-1828: Bound linked-test regex evaluation in
evaluateRegexAssertions by using a matcher or deadline that cannot stall on
catastrophic patterns, while preserving existing assertion results and failure
reporting. Apply the same bounded-regex policy during parseLinkedTestRegexList
in src/sdk/test/parsers.ts lines 180-202 and readJsonEntryRegexList in
src/sdk/test/parsers.ts lines 396-415 so unsafe patterns are rejected before
execution; update all three sites consistently.

In `@src/sdk/test/parsers.ts`:
- Around line 300-307: Update the numeric parsing in the GTE assertion flow
around values[key] to use strict Number conversion instead of Number.parseFloat,
ensuring partially numeric inputs such as “10oops” fail the existing
finite-number validation and raise PmCliError.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2fce8900-1443-4c25-aa3e-bc613090892c

📥 Commits

Reviewing files that changed from the base of the PR and between bc4d6de and 72ade89.

📒 Files selected for processing (48)
  • .agents/pm/features/pm-oslr.toon
  • .agents/pm/features/pm-rjqr.toon
  • .agents/pm/history/pm-9x6e.jsonl
  • .agents/pm/history/pm-oslr.jsonl
  • .agents/pm/history/pm-rjqr.jsonl
  • .agents/pm/tasks/pm-9x6e.toon
  • CHANGELOG.md
  • docs/SDK.md
  • docs/SDK_PRIMITIVE_INVENTORY.md
  • eslint-suppressions.json
  • package.json
  • scripts/release/sdk-import-boundary-baseline.json
  • scripts/release/static-quality-gate.mjs
  • src/cli/commands/eval.ts
  • src/cli/commands/linked-test-entry.ts
  • src/cli/commands/linked-test-parsers.ts
  • src/cli/commands/list.ts
  • src/cli/commands/search.ts
  • src/cli/commands/stats.ts
  • src/cli/commands/telemetry.ts
  • src/cli/commands/test-all.ts
  • src/cli/commands/test-runs.ts
  • src/cli/commands/test.ts
  • src/cli/shared-parsers.ts
  • src/sdk/eval.ts
  • src/sdk/index.ts
  • src/sdk/query/item-filter-options.ts
  • src/sdk/query/list.ts
  • src/sdk/query/parsers.ts
  • src/sdk/query/search-pagination.ts
  • src/sdk/query/search-rendering.ts
  • src/sdk/query/search.ts
  • src/sdk/runtime.ts
  • src/sdk/stats.ts
  • src/sdk/telemetry.ts
  • src/sdk/test/batch.ts
  • src/sdk/test/entry.ts
  • src/sdk/test/execution.ts
  • src/sdk/test/parsers.ts
  • src/sdk/test/runs.ts
  • tests/integration/release-automation-contract.spec.ts
  • tests/integration/release-readiness-runtime.spec.ts
  • tests/unit/commands/comments-command.spec.ts
  • tests/unit/commands/dedupe-audit-command.spec.ts
  • tests/unit/commands/eval-command.spec.ts
  • tests/unit/commands/normalize-command.spec.ts
  • tests/unit/mcp/mcp-server-branch-residual.spec.ts
  • tests/unit/sdk/execution-diagnostics-primitives.spec.ts
💤 Files with no reviewable changes (2)
  • eslint-suppressions.json
  • scripts/release/sdk-import-boundary-baseline.json

Comment thread .agents/pm/features/pm-rjqr.toon Resolved
Comment thread docs/SDK.md Resolved
Comment thread docs/SDK.md Resolved
Comment thread src/sdk/query/list.ts Resolved
Comment thread src/sdk/query/parsers.ts Resolved
Comment thread src/sdk/test/execution.ts Resolved
Comment thread src/sdk/test/execution.ts Resolved
Comment thread src/sdk/test/execution.ts Resolved
Comment thread src/sdk/test/execution.ts Resolved
Comment thread src/sdk/test/parsers.ts Resolved
Address PR #573 review findings across SDK query projections, numeric parsing, search highlighting, linked-test execution, stats reads, governance callers, and public documentation. Add adversarial regression coverage, preserve bounded tracker I/O, and record exact release-gate evidence on pm-9x6e before returning the incomplete zero-boundary capstone to open.
@unbraind

Copy link
Copy Markdown
Owner Author

@greptileai please review the new head 1f03bce.

@unbraind

Copy link
Copy Markdown
Owner Author

/gemini review

@unbraind

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 59 minutes.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request completes the promotion of execution, diagnostics, and query primitives to the public SDK, moving logic from CLI command modules into SDK-owned modules. This includes migrating test execution, batch orchestration, background run lifecycle, search evaluation, telemetry, and query engines. The changes also include a reduction in the CLI-to-core import boundary baseline and updated documentation. I have identified a critical issue regarding incorrect de-duplication of path-based linked tests in the new SDK implementation.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/sdk/test/batch.ts Resolved

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/sdk/test/execution.ts`:
- Around line 2625-2633: Update the PmCliError message in the
defaultTimeoutSeconds validation to describe the run-level test timeout as a
positive number rather than a positive integer, while preserving the existing
validation logic.

In `@tests/unit/commands/list-command.spec.ts`:
- Around line 1745-1766: Update the future-date fixtures in the list command
test around updatedAfterFuture and createdBeforeFuture to derive one runtime
future ISO date, such as by advancing the current date, and reuse it for both
CLI calls and filter assertions. Preserve the existing expectations that
updated-after returns zero items and created-before retains all items.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8d500a5b-61b1-4d4c-a2a6-125cfbb50980

📥 Commits

Reviewing files that changed from the base of the PR and between 72ade89 and 1f03bce.

📒 Files selected for processing (30)
  • .agents/pm/history/pm-9x6e.jsonl
  • .agents/pm/tasks/pm-9x6e.toon
  • docs/SDK.md
  • packages/pm-governance-audit/extensions/governance-audit/comments-audit.ts
  • packages/pm-governance-audit/extensions/governance-audit/dedupe-audit.ts
  • packages/pm-governance-audit/extensions/governance-audit/dedupe-merge.ts
  • packages/pm-governance-audit/extensions/governance-audit/normalize.ts
  • packages/pm-governance-audit/extensions/governance-audit/runtime-utils.ts
  • packages/pm-governance-audit/extensions/governance-audit/sdk.ts
  • src/cli/commands/update-many.ts
  • src/sdk/eval.ts
  • src/sdk/index.ts
  • src/sdk/query/list.ts
  • src/sdk/query/parsers.ts
  • src/sdk/query/search.ts
  • src/sdk/runtime.ts
  • src/sdk/stats.ts
  • src/sdk/test/batch.ts
  • src/sdk/test/entry.ts
  • src/sdk/test/execution.ts
  • src/sdk/test/parsers.ts
  • tests/unit/commands/linked-test-entry.spec.ts
  • tests/unit/commands/linked-test-parsers.spec.ts
  • tests/unit/commands/list-command.spec.ts
  • tests/unit/commands/search-command.spec.ts
  • tests/unit/commands/stats-command.spec.ts
  • tests/unit/commands/test-all-command.spec.ts
  • tests/unit/commands/test-command.spec.ts
  • tests/unit/core/item/parse-utils.spec.ts
  • tests/unit/packages/governance-audit-runtime.spec.ts

Comment thread src/sdk/test/execution.ts Resolved
Prune stale ESLint suppression state and lower the enforced budget, document governance helpers, correct fractional timeout guidance, stabilize date-window fixtures, remove duplicated test setup, and record the exact bot-round evidence on pm-9x6e.
@unbraind

Copy link
Copy Markdown
Owner Author

@greptileai please review the exact bot-fix head 469ca95.

@unbraind

Copy link
Copy Markdown
Owner Author

/gemini review

@unbraind

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 25 minutes.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request completes the promotion of core execution, diagnostics, and query primitives to the public SDK. It migrates the implementation of these features from the CLI command surface to dedicated SDK modules, while maintaining backward compatibility through thin CLI exports. Additionally, it improves sandbox cleanup reliability, fixes a Windows-specific test timeout regression, and cleans up the static quality gate by moving its configuration to a TypeScript-compatible format. No review comments were provided, so no feedback is necessary.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Remove duplicate governance barrel paths while preserving the complete public SDK surface, reshape shared list filter resolvers for analyzer parity, close the verified Windows packed-install regression, and regenerate the pm-owned changelog from the final tracker state.
@unbraind

Copy link
Copy Markdown
Owner Author

Review requested for exact head 7ad53dd after canonical governance exports, analyzer-safe query filters, verified Windows regression closeout, and final pm-changelog regeneration.

@greptileai review
/gemini review
@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

@unbraind: Starting a full review of exact head 7ad53dd7, including the governance exports, query-filter safety, Windows regression closeout, and changelog regeneration.

✅ Action performed

Full review finished.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request completes a major architectural refactor by promoting core CLI command implementations into a public SDK. It introduces new SDK modules for evaluation, list/query operations, telemetry, and test execution, while updating existing CLI command files to serve as compatibility exports. The changes also include updates to project documentation, the changelog, and internal quality gates to reflect the new SDK-first structure. No review comments were provided for this pull request.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Declare the analyzer dialect, Vitest runtime, ESM module system, and complexity profile explicitly so hosted analysis cannot reinterpret SDK modules as CommonJS scripts. Record the diagnosis and validation handoff on the living quality epic while leaving no inactive item in progress.
@unbraind

Copy link
Copy Markdown
Owner Author

Review requested for exact head 5b2e2d2 after pinning the DeepSource TypeScript ESM/Vitest analyzer contract and recording the hosted analyzer mismatch.

@greptileai review
/gemini review
@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

@unbraind: Starting a full review of exact head 5b2e2d22, including the DeepSource TypeScript ESM/Vitest analyzer contract and hosted-analyzer mismatch documentation.

✅ Action performed

Full review finished.

@gemini-code-assist

Copy link
Copy Markdown

This PR successfully promotes several core CLI command implementations into the public SDK, improving modularity and enabling better programmatic access to the project management runtime. The changes include:

  • SDK Promotion: Query engines (list/search), execution primitives (linked-test execution, batch runs, test-run lifecycle), diagnostics, telemetry, and statistics are now first-class SDK modules.
  • CLI Compatibility: CLI commands have been refactored into thin compatibility re-exports, ensuring no regression in existing command-line behavior.
  • Governance & Release Hardening: Governance extensions now consume the promoted SDK list results directly, and release gates have been tightened with improved analyzer contracts.
  • Analysis Stability: DeepSource TypeScript ESM settings have been pinned to ensure consistent CI quality gate enforcement.

These changes are well-structured and maintain the project's strict quality and coverage standards. No further action is required from my side.

Restore the pre-promotion behavior for an explicit empty fail-under value while retaining strict validation for whitespace and invalid ranges. Add a TDD regression and record exact full-corpus coverage and review evidence on the living quality item.
@unbraind

Copy link
Copy Markdown
Owner Author

Review requested for exact head 34ed577 after restoring SDK eval empty-threshold compatibility with TDD and exact 100/100/100/100 full coverage. Local Greptile review 2544081d-8f90-4d25-a450-ef203fbf0f99 completed at confidence 5/5 with no findings.

@greptileai review
/gemini review
@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

@unbraind: Starting a full review of exact head 34ed577d, including the SDK eval empty-threshold compatibility restoration and accompanying regression coverage.

✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 34 minutes.

@gemini-code-assist

Copy link
Copy Markdown

This PR successfully promotes several core CLI command implementations into the public SDK, improving modularity and enabling better programmatic access to the project management runtime. The changes include:

  • SDK Promotion: Query engines (list/search), execution primitives (linked-test execution, batch runs, test-run lifecycle), diagnostics, telemetry, and statistics are now first-class SDK modules.
  • CLI Compatibility: CLI commands have been refactored into thin compatibility re-exports, ensuring no regression in existing command-line behavior.
  • Governance & Release Hardening: Governance extensions now consume the promoted SDK list results directly, and release gates have been tightened with improved analyzer contracts.
  • Analysis Stability: DeepSource TypeScript ESM settings have been pinned to ensure consistent CI quality gate enforcement.

These changes are well-structured and maintain the project's strict quality and coverage standards. No further action is required from my side.

Comment thread src/sdk/query/list.ts Resolved
Document that noTruncate deliberately overrides limit, matching the GH-154 public contract, CLI help, shell completions, command reference, and regression coverage. Record the declined review suggestion and leave the living quality epic open and unclaimed.
@unbraind

Copy link
Copy Markdown
Owner Author

Review requested for exact head bd6b03f after clarifying the established SDK noTruncate precedence and dispositioning the conflicting pagination suggestion. Local Greptile review 2f0f7676-edd3-4624-9118-857b296bb2f4 completed at confidence 5/5 with no findings.

@greptileai review
/gemini review
@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

@unbraind: Starting a full review of exact head bd6b03f0, including the clarified SDK noTruncate precedence and pagination disposition.

✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 21 minutes.

@gemini-code-assist

Copy link
Copy Markdown

The changes in head bd6b03f0 correctly address the SDK noTruncate precedence and finalize the query engine promotion. The refactoring of CLI commands into thin compatibility re-exports, combined with the consolidated SDK query modules, aligns well with the project's modularity goals. The test coverage and static quality gates remain robust. No further issues identified.

@unbraind

Copy link
Copy Markdown
Owner Author

Final review-hygiene inventory on head bd6b03f: all 75 bot review threads now have an explicit reaction and owner disposition; all remaining bot threads are resolved. Historical DeepSource CommonJS/dashboard false positives were down-voted with analyzer-context replies; implemented, superseded, and no-finding Gemini/CodeRabbit/Greptile feedback was up-voted and acknowledged. All 28 bot issue comments and all 54 currently inventoried bot review submissions were also reacted to. Final hosted Greptile is confidence 5/5 and green.

@unbraind

unbraind commented Aug 4, 2026

Copy link
Copy Markdown
Owner Author

Tracked in PM: pm-9x6e, pm-oslr, pm-rjqr.

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