docs(wren): clarify catalog/schema as Wren Engine namespace, not DB settings#1517
Conversation
…ettings Addresses consistent AI agent misinterpretation of wren_project.yml's catalog/schema as the database's native catalog/schema. - context_cli.py: add inline comments to init template making clear these are engine-internal namespace fields, and annotate table_reference in the example model to indicate that IS the actual database location - wren_project.md: expand field table descriptions for catalog/schema and add a two-level catalog/schema distinction table - wren-generate-mdl/SKILL.md: add explicit IMPORTANT warning in Phase 4 Step 1 instructing agents to keep wren_project.yml defaults and not copy database catalog/schema values there; annotate model table_reference example with inline comments Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@cli-skills/wren-generate-mdl/SKILL.md`:
- Around line 157-165: Revise the guidance about `catalog` and `schema` in
`wren_project.yml` to soften the absolute tone: change the “Always keep the
defaults” wording to something like “Keep the defaults (`catalog: wren`,
`schema: public`) unless you are intentionally configuring a multi-project
namespace,” and add a brief pointer referencing per-model `table_reference` for
actual DB catalog/schema so the existing multi-project exception is clear;
update the sentence that currently reads “Do NOT copy database catalog/schema
values into `wren_project.yml`” to match the softened guidance.
In `@wren/src/wren/context_cli.py`:
- Around line 55-63: Update the unit tests in
wren/tests/unit/test_context_cli.py to assert the scaffolded file contents (not
just existence): open the generated wren_project.yml and assert it contains the
exact lines "catalog: wren", "schema: public" and "data_source: postgres" (from
the scaffold in context_cli.py), and open models/example/metadata.yml and assert
it contains the expected model metadata strings created by the scaffold (e.g.,
table_reference or any known keys your scaffold writes). Locate and modify the
existing test function(s) that currently only check file presence (look for
names like test_context_scaffold or test_write_project_scaffold) to add these
content assertions and fail if the strings are missing.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: a6411503-57c0-4411-973e-c769583a779b
📒 Files selected for processing (3)
cli-skills/wren-generate-mdl/SKILL.mdwren/docs/wren_project.mdwren/src/wren/context_cli.py
…tions - SKILL.md: soften "Always keep the defaults" to "Keep the defaults unless intentionally configuring a multi-project namespace" so the documented exception is not contradicted - test_context_cli.py: add content assertions to test_init_creates_scaffold verifying wren_project.yml contains namespace clarification comments and models/example/metadata.yml contains the table_reference annotation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
context_cli.py: Add inline comments to thewren context inittemplate socatalog/schemaare clearly marked as Wren Engine namespace fields — not the database catalog/schema. Also annotate the example modeltable_referenceto make clear that IS the actual database location.wren_project.md: Expand thecatalog/schemafield descriptions with an explicit callout and add a two-level distinction table showing where each level ofcatalog/schemalives and what it refers to.wren-generate-mdl/SKILL.md: Add anIMPORTANTwarning block in Phase 4 Step 1 (afterwren context init) explicitly telling agents to keep the defaults and not copy database catalog/schema intowren_project.yml. Annotate the modeltable_referenceYAML example with inline comments.Motivation
AI agents (and users) consistently copy their database's native
catalog/schemaintowren_project.yml, which causes schema resolution failures. The field names are identical at two levels of the project but have completely different semantics — this patch makes the distinction impossible to miss.Test plan
wren context initoutput includes the namespace comments inwren_project.ymlmodels/example/metadata.ymlhas annotatedtable_referencewren_project.mdfield table clearly distinguishes Wren namespace from DB locationwren context initscaffold and Step 2🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
Chores
Tests