Skip to content

feat(compile)!: require a description on every named resource - #917

Merged
kvlonge merged 4 commits into
mainfrom
feat/chi-390-required-descriptions
Oct 3, 2026
Merged

kvlonge merged 4 commits into
mainfrom
feat/chi-390-required-descriptions

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Why

Resources without descriptions ship to catalogues and docs with nothing to explain them, and the old SQBRTEST105 check only covered scenarios as a rule finding (CHI-390).

Changes

  • Breaking: new compile error P010 when a named resource has no non-empty description. Covers models, scenarios, seeds, sources, SQL and table functions (new FUNCTION description key), Python UDFs (@udf(description=) or a docstring), named SQL hooks, Python hooks, loaders, tasks, assets, checks and providers. Model descriptions resolve from the header, [defaults]/[path_defaults], or model_schema.
  • One finding per resource at its declaration, with help showing the exact snippet to add.
  • A guard test fails if a new discovered resource kind is neither required nor explicitly exempt.
  • Breaking: SQBRTEST105 is retired (replaced by P010); remove it from [rules] select/ignore.
  • sqb format reports a missing description as a fault, using the same resolution as compile and SQL-only discovery.
  • Fixtures, example projects, playground templates and docs describe every resource.

Verification

  • Unit tests per resource kind; DuckDB E2E for each kind (missing gives P010 with snippet, present is clean), path-default file order, format/compile agreement, and cache invalidation on description edits.
  • Pinned benchmark fingerprints change only by the new description output (verified by stripping it).
  • One independent review plus a follow-up; make test, make check-ci.

@kvlonge
kvlonge enabled auto-merge (squash) October 3, 2026 00:22
Missing descriptions are a P010 compile error for models, scenarios, seeds,
sources, SQL and Python functions, named SQL and Python hooks, loaders, tasks,
assets, checks and providers. Each finding points at the declaration and shows
the exact header, YAML or decorator snippet to add. FUNCTION headers and @udf
accept a new description (docstring fallback for Python UDFs), and @loader
accepts description= with a docstring fallback. format --check and format now
fault on missing MODEL, SCENARIO, FUNCTION and HOOK header descriptions,
resolving [defaults], [path_defaults] and model_schema descriptions exactly as
compile does. SQBRTEST105 is retired in favour of the compiler requirement.

BREAKING CHANGE: projects with undescribed resources no longer compile.
SQBRTEST105 was replaced by P010 and must be removed from [rules] select and
ignore selectors, which otherwise fail with C000.
Add neutral generated descriptions (for example "Test model orders.") to the
inline and on-disk test, script and performance-project fixtures so they compile
under the P010 description requirement: MODEL, SCENARIO, FUNCTION, HOOK and SCHEMA
headers, seed and source YAML entries (including dlt resources), and docstrings on
Python tasks, assets, checks, loaders, hooks and UDFs. Generated benchmark
projects now emit descriptions too, so their fingerprints change for this reason
only. Diagnostic line expectations that moved with inserted lines are updated.
Describe the P010 requirement, where each resource kind declares its
description, the new FUNCTION and @udf description fields, loader and
provider docstrings, dlt resource descriptions and the format --check fault.
Add descriptions to every documentation and README example and regenerate the
agent skill references.
…rator

The same-runner compile ratio job generated one project with head's
generator and compiled it with both builds, so any change that adds
syntax to the generators (such as FUNCTION descriptions) made the base
build reject the project. compare_compile_performance now accepts
--base-root: the base project is written by the base checkout's own
write_benchmark_project (run with the head interpreter and the base root
on PYTHONPATH), head's project by head's generator, and each build
compiles its own project. Base generation failures stop the comparison
with the generator's stderr tail, and the report notes per-side
generation. Without --base-root the single-project behaviour is kept.
@kvlonge
kvlonge force-pushed the feat/chi-390-required-descriptions branch from 5c0a30d to aeeb41b Compare October 3, 2026 00:51
@kvlonge
kvlonge merged commit 2fafd63 into main Oct 3, 2026
36 checks passed
@kvlonge
kvlonge deleted the feat/chi-390-required-descriptions branch October 3, 2026 01:13
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