Skip to content

test: cover dbops authoring flow and entity schema cache gaps#419

Closed
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/missing-test-coverage-2659
Closed

test: cover dbops authoring flow and entity schema cache gaps#419
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/missing-test-coverage-2659

Conversation

@cursor

@cursor cursor Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Risky behavior now covered

DBOPS LLM authoring flow (PR #309)

  • database_snapshot_object list — query param mapping (object_typeobjectType, sizelimit) and snapshot-names path construction
  • database_snapshot_object getobject_names validation (missing, empty, non-array) and default object_type: "Table"
  • database_default_authoring_instance get — path and response contract for auto-selecting an authoring instance
  • database_llm_authoring_pipeline getdbSchema/dbInstance query params for Accept & Commit pipeline resolution
  • database_execute_llm_authoring_pipeline run — read-only mode blocks low_write execute; bodyBuilder omits empty runtime_inputs, accepts camelCase branches, enforces mutual exclusion; skipScopeBodyInjection metadata

Entity schema cache (PR #396)

  • preloadBundledEntitySchemas — warms runtime cache on account match, skips warm on mismatch, does not overwrite existing entries
  • Scope validation — org scope without org_id, project scope without project_id (fetcher + harness_schema tool)
  • Org-scope cache isolation — distinct org IDs produce separate cache entries (prevents cross-org schema bleed)
  • Live navigation helpersgetResourceDefinitions, getRootDefinition, navigateEntitySchemaPath, getEntitySchemaSummary bundled vs live hints
  • extractLiveSchemayamlSchema and nested data.yaml_schema envelopes; throws on non-schema responses
  • buildBundledSchemaKey and org-level bundledSnapshotMatchesScope rejection

Test files added/updated

File Change
tests/registry/dbops.test.ts +6 describe blocks (snapshot list/get, authoring GETs, read-only gate)
tests/registry/toolsets/dbops.test.ts +4 bodyBuilder/metadata edge cases
tests/tools/entity-schema-bundled.test.ts scope validation + preloadBundledEntitySchemas warm path
tests/tools/entity-schema-cache-keys.test.ts buildBundledSchemaKey, org scope gate
tests/tools/harness-schema-tool.test.ts org/project scope validation, org cache isolation
tests/tools/entity-schema-live.test.ts new — navigation helpers + extractLiveSchema shapes

Why these tests materially reduce regression risk

  • DBOPS Accept & Commit is a billing-adjacent write path; incorrect body normalization or read-only bypass would cause silent API failures or unintended mutations.
  • Entity schema cache bugs cause cross-tenant/org schema bleed — agents would receive wrong field definitions when creating Harness resources.
  • Scope validation gaps previously only had partial coverage (project without org_id); org and project_id guards are now enforced at both fetcher and tool layers.

Validation

pnpm test tests/registry/dbops.test.ts tests/registry/toolsets/dbops.test.ts \
  tests/tools/entity-schema-bundled.test.ts tests/tools/entity-schema-cache-keys.test.ts \
  tests/tools/harness-schema-tool.test.ts tests/tools/entity-schema-live.test.ts

116 tests passed (6 files).

Open in Web View Automation 

thisrohangupta and others added 2 commits June 24, 2026 18:46
Bump version to 3.2.2 across package.json, root and directory bundle
manifests, and the release-metadata version contract test.

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

AI-Session-Id: 7ac8d1f2-ac05-4023-8226-8b0012f3adae
AI-Tool: claude-code
AI-Model: unknown
…scope validation

Add regression tests for recently merged production code:

- DBOPS: snapshot_object list/get validation, default authoring instance
  and LLM pipeline GET dispatch, execute read-only gating, bodyBuilder
  edge cases (empty runtime_inputs, camelCase branches)
- Entity schema: preloadBundledEntitySchemas warm/no-overwrite behavior,
  org/project scope validation, org-scope cache isolation, live navigation
  helpers and alternate extractLiveSchema response shapes

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.

@thisrohangupta

Copy link
Copy Markdown
Collaborator

Closing as stale: merge conflicts with main and work superseded by merged PRs (#447, #446, #449, #469, #440, #398, etc.) or duplicate agent-generated attempts. Reopen from a fresh branch if still needed.

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