Skip to content

test: cover CCM extractors, get-only params, schema cache scope, getCurrentUserId#412

Draft
cursor[bot] wants to merge 4 commits into
mainfrom
cursor/missing-test-coverage-f0c1
Draft

test: cover CCM extractors, get-only params, schema cache scope, getCurrentUserId#412
cursor[bot] wants to merge 4 commits into
mainfrom
cursor/missing-test-coverage-f0c1

Conversation

@cursor

@cursor cursor Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Risky behavior now covered

  • CCM GraphQL extractors (ccmViewsExtract, ccmBreakdownExtract, ccmTimeseriesExtract, ccmSummaryExtract, ccmRecommendationsExtract) — stable {items, total} projection and dual-mode summary handling; prevents silent shape regressions in cost dashboards.
  • PR test: enforce registry metadata contracts and coding standards #406 get-only param migrations — 15 resources moved from listFilterFields to get.paramsSchema; ensures agents discover params via harness_describe and that exclusive get-only params (metric, pod_name, reporting_timeframe, cloud_account_id, feature_type) do not pollute the global harness_list filter catalog.
  • Entity schema cache scope isolation — account-scope and project-scope connector schemas do not share cache entries (regression guard for PR Fix live entity schema cache isolation by scope #396).
  • HarnessClient.getCurrentUserId() — caching, inflight deduplication, service-account error message, and retry-after-failure; protects STO exemption actor stamping.

Test files added/updated

File Change
tests/registry/ccm-extractors.test.ts New — 10 extractor contract tests
tests/registry/get-only-params-discoverability.test.ts New — 16 behavioral tests for migrated resources
tests/tools/harness-schema-tool.test.ts Scope cache isolation test
tests/client/harness-client.test.ts 4 getCurrentUserId tests

Why these tests materially reduce regression risk

These paths sit on high-blast-radius surfaces: cost analytics response shaping, agent discovery metadata (wrong filters → failed API calls), schema cache contamination (wrong create payloads), and authenticated-user identity for write preflights. Static coding-standards checks from PR #406 enforce structure but do not prove runtime behavior — these tests close that gap.

Validation: pnpm test on all 4 touched files — 115 tests passing.

Open in Web View Automation 

thisrohangupta and others added 4 commits June 23, 2026 00:42
Update version across package.json, both manifest files, and the
release-metadata test that keeps them in sync.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

AI-Session-Id: 1b46c8db-abe4-4e9f-a38b-750362ead8ac
AI-Tool: claude-code
AI-Model: unknown
Expand automated architecture guardrails to cover:
- Global fetch() limited to documented exceptions (HarnessClient, log-resolver CDN blobs, audit webhooks)
- HarnessClient instantiation only in src/index.ts
- Zod v4 import convention in tool handlers and config
- Explicit openWorldHint annotations on all tool handlers
- No deprecated server.tool() usage
- Runtime registry contract checks (scope, identifierFields, operationPolicy)

Document fetch() exceptions in docs/coding-standards.md.

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
…Fields

Add registry-metadata.test.ts to guard listFilterFields/list operation
alignment, write-handler elicitation wiring, and Zod .describe() on tool
inputs. Move get-only params from listFilterFields to get.paramsSchema on
15 resources so harness_list no longer advertises non-list filters.

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
…urrentUserId

Add behavioral regression tests for recently merged production paths:

- CCM GraphQL extractors: stable {items,total} and dual-mode summary projection
- PR #406 get-only migrations: params on get.paramsSchema, not global filter catalog
- Entity schema cache: account vs project scope do not share entries
- HarnessClient.getCurrentUserId: caching, inflight dedup, service-account error, retry

Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ thisrohangupta
❌ cursoragent
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

3 participants