Skip to content

fix: use block document vocabulary in packages - #779

Merged
ilyabo merged 2 commits into
mainfrom
codex/block-document-package-vocabulary
Jul 1, 2026
Merged

ilyabo merged 2 commits into
mainfrom
codex/block-document-package-vocabulary

Conversation

@ilyabo

@ilyabo ilyabo commented Jul 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Make @sqlrooms/python default Python block commands target generic block-document artifacts instead of CLI worksheet artifacts.
  • Add createSkillRuntimeToolPolicy() so hosts can substitute product-specific high-level agent tool names while package defaults use block_document_agent.
  • Clean package docs, schemas, comments, and tests so reusable packages say block document unless explicitly documenting a host override.

Validation

  • pnpm install
  • pnpm build
  • pnpm --filter @sqlrooms/ai test -- skillRuntimeToolPolicy commandTools
  • pnpm --filter @sqlrooms/artifacts test -- artifactAiSessions
  • pnpm --filter @sqlrooms/mosaic test -- MosaicDashboardSlice
  • pnpm --filter @sqlrooms/python typecheck
  • pnpm --filter @sqlrooms/ai-core test -- AiSlice.onChatFinish
  • pre-push hook: knip, turbo typecheck, circular dependency scan, turbo test

Notes

The only remaining worksheet references under packages/* are in the @sqlrooms/python README example that documents how a host can opt into worksheet-scoped command IDs.

Summary by CodeRabbit

  • New Features

    • Added support for customizing high-level agent tool names for host-specific product surfaces.
    • Expanded Python block command generation to work with block-document workflows by default.
  • Bug Fixes

    • Updated command search and AI session behavior to use block-document terminology and identifiers consistently.
  • Documentation

    • Refreshed AI, Mosaic, and Python guides to describe block-document usage and customization options more clearly.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@ilyabo, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 81a8f611-d0eb-4068-ad8b-4073befc1a05

📥 Commits

Reviewing files that changed from the base of the PR and between d20700b and 91f5a6e.

📒 Files selected for processing (3)
  • packages/ai/__tests__/skillRuntimeToolPolicy.test.ts
  • packages/ai/src/tools/skillRuntimeToolPolicy.ts
  • packages/python/src/PythonBlockCommands.ts
📝 Walkthrough

Walkthrough

This PR renames worksheet-specific terminology to block-document terminology across ai-core, ai, artifacts, mosaic, and python packages. It adds a createSkillRuntimeToolPolicy factory with an options type, removes worksheet_agent from default tools, updates test fixtures/descriptors, and revises documentation and Python command defaults.

Changes

Worksheet-to-block-document rename and tooling

Layer / File(s) Summary
Skill runtime tool policy: default and factory
packages/ai/src/tools/skillRuntimeToolPolicy.ts, packages/ai/src/index.ts, packages/ai/__tests__/skillRuntimeToolPolicy.test.ts, packages/ai/README.md
Removes worksheet_agent from DEFAULT_SKILL_RUNTIME_TOOL_POLICY.highLevelAgentTools, adds CreateSkillRuntimeToolPolicyOptions type and createSkillRuntimeToolPolicy factory, exports both, adds tests, and documents override usage.
Command tools schema and test descriptors
packages/ai/src/tools/commandTools.ts, packages/ai/__tests__/commandTools.test.ts
Updates the resourceType schema description example and renames the add-dashboard-block test command and artifact.rename description to block-document terminology.
Python block commands: artifact-driven configuration
packages/python/src/PythonBlockCommands.ts, packages/python/README.md
Refactors createPythonBlockCommands to derive schemas/keywords/descriptions from configurable artifactType/artifactLabel/commandNamespace options with block-document defaults, and updates README docs.
Artifact type fixtures and docs
packages/artifacts/__tests__/artifactAiSessions.test.ts, packages/artifacts/src/ai/artifactTargetChange.ts
Updates artifact AI session test fixtures and doc comment example from worksheet to block-document artifact type.
Mosaic dashboard docs and test identifiers
packages/mosaic/README.md, packages/mosaic/__tests__/MosaicDashboardSlice.test.ts
Updates README wording for Data Table Explorer and agent extraTools targeting, and updates a test runtime key from worksheet-scoped to document-scoped.
AI core chat finish fixture text
packages/ai-core/__tests__/AiSlice.onChatFinish.test.ts
Updates the fixture user message text from worksheet to block-document wording.

Estimated code review effort: 2 (Simple) | ~12 minutes

Possibly related PRs

  • sqlrooms/sqlrooms#747: Updates the same onChatFinish test fixture, directly aligning with artifact-driven onChatFinish behavior.
  • sqlrooms/sqlrooms#766: Builds on the skillRuntimeToolPolicy module and its default command/tool policy definitions introduced in that PR.

Suggested reviewers: dmitriy-kostianetskiy, lixun910

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: replacing worksheet terminology with block document vocabulary across packages.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/block-document-package-vocabulary

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.

@ilyabo
ilyabo marked this pull request as ready for review July 1, 2026 16:48

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d20700bd6f

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

}: CreateSkillRuntimeToolPolicyOptions = {}): SkillRuntimeToolPolicy {
return {
...DEFAULT_SKILL_RUNTIME_TOOL_POLICY,
commandTools: {...DEFAULT_SKILL_RUNTIME_TOOL_POLICY.commandTools},

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 Clone nested command policy arrays

When a host calls createSkillRuntimeToolPolicy() and then adjusts the returned commandTools policy for its runtime (for example adding a confirmation metadata field), this shallow copy keeps allowedDiscoveryRiskLevels, confirmationRequiredRiskLevels, and confirmationMetadataFields shared with DEFAULT_SKILL_RUNTIME_TOOL_POLICY. That mutation leaks into the exported default and into later policies, even though the surrounding top-level arrays are copied independently.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/python/src/PythonBlockCommands.ts (1)

104-113: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Artifact keywords only applied to add-python-block; other three commands stay hardcoded.

artifactKeywords (derived from commandNamespace/artifactLabel) is spread only into the add-python-block command's keywords (Line 113). The update-python-block-code, run-python-block, and clear-python-block-result commands still use fixed keyword arrays (Lines 166, 214, 258) that never include artifactKeywords. When a host overrides artifactLabel/commandNamespace (e.g. the documented worksheet example in the README), search-by-keyword for these three commands won't surface product-specific vocabulary, undermining the stated goal of the refactor.

🛠️ Proposed fix
       group: commandGroup,
-      keywords: ['python', 'block', 'code', 'update'],
+      keywords: ['python', 'block', 'code', 'update', ...artifactKeywords],
       inputSchema: UpdatePythonBlockCodeInput,
       group: commandGroup,
-      keywords: ['python', 'block', 'run', 'execute'],
+      keywords: ['python', 'block', 'run', 'execute', ...artifactKeywords],
       inputSchema: PythonBlockInput,
       group: commandGroup,
-      keywords: ['python', 'block', 'clear', 'result'],
+      keywords: ['python', 'block', 'clear', 'result', ...artifactKeywords],
       inputSchema: PythonBlockInput,

Also applies to: 166-166, 214-214, 258-258

🤖 Prompt for 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.

In `@packages/python/src/PythonBlockCommands.ts` around lines 104 - 113, The
keyword arrays for the Python block commands are inconsistent because only
add-python-block uses artifactKeywords. Update update-python-block-code,
run-python-block, and clear-python-block-result in PythonBlockCommands so they
also spread artifactKeywords into their keywords arrays, matching
add-python-block and preserving commandNamespace/artifactLabel-driven search
terms across all commands.
🤖 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.

Outside diff comments:
In `@packages/python/src/PythonBlockCommands.ts`:
- Around line 104-113: The keyword arrays for the Python block commands are
inconsistent because only add-python-block uses artifactKeywords. Update
update-python-block-code, run-python-block, and clear-python-block-result in
PythonBlockCommands so they also spread artifactKeywords into their keywords
arrays, matching add-python-block and preserving
commandNamespace/artifactLabel-driven search terms across all commands.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 63d6b0fe-01e5-4664-aa2e-e209dfe088bf

📥 Commits

Reviewing files that changed from the base of the PR and between 3864f8f and d20700b.

📒 Files selected for processing (13)
  • packages/ai-core/__tests__/AiSlice.onChatFinish.test.ts
  • packages/ai/README.md
  • packages/ai/__tests__/commandTools.test.ts
  • packages/ai/__tests__/skillRuntimeToolPolicy.test.ts
  • packages/ai/src/index.ts
  • packages/ai/src/tools/commandTools.ts
  • packages/ai/src/tools/skillRuntimeToolPolicy.ts
  • packages/artifacts/__tests__/artifactAiSessions.test.ts
  • packages/artifacts/src/ai/artifactTargetChange.ts
  • packages/mosaic/README.md
  • packages/mosaic/__tests__/MosaicDashboardSlice.test.ts
  • packages/python/README.md
  • packages/python/src/PythonBlockCommands.ts

@ilyabo
ilyabo merged commit e332281 into main Jul 1, 2026
3 checks passed
@ilyabo
ilyabo deleted the codex/block-document-package-vocabulary branch July 1, 2026 17:10
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