Skip to content

feat(warden): add repo-local public-export-example-coverage rule#713

Merged
graphite-app[bot] merged 1 commit into
mainfrom
trl-943-graduate-public-api-example-coverage-into-a-repo-local
Jun 9, 2026
Merged

feat(warden): add repo-local public-export-example-coverage rule#713
graphite-app[bot] merged 1 commit into
mainfrom
trl-943-graduate-public-api-example-coverage-into-a-repo-local

Conversation

@galligan

@galligan galligan commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Graduates public-API example coverage into a repo-local Warden rule (TRL-943), replacing scripts/check-public-api-examples.ts.

  • New public-export-example-coverage rule in packages/warden (scope repo-local, alongside warden-export-symmetry/warden-rules-use-ast): inventories non-type-only named re-exports on the five public surface package barrels and requires a leading @example TSDoc on each exported declaration. Built on the shared ast.ts helpers (no TS compiler dependency), anchored to this repo via the rule module's on-disk location so it stays silent in consumer repos.
  • Severity: missing @example on a minimumExports entry → error; other inventoried exports → warn; minimum export absent from the barrel, star/non-relative re-exports on a target barrel, unreadable resolved source → error.
  • publicExportExampleCoverageTrail wrapper + full registry symmetry; 15 new tests including a real-repo baseline over all five barrels.
  • The policy table stays in the rule module with a TSDoc note: wardenConfigSchema has no per-rule config channel today, so configured-not-hard-coded is deferred to a config-channel design.
  • Removes the root script + its test and drops docs:api-examples from the check pipeline — the warden run (trails:check) now owns this coverage (verified end-to-end by stripping an @example and watching the rule fail the warden run).
  • Warden guides regenerated (rule count 63); changeset: @ontrails/warden minor.

Linear: TRL-943

Verification

  • bun test packages/warden (1082 pass), package typecheck/lint clean
  • End-to-end: removed @example from packages/cli/src/output.ts → warden run fails with the new rule's diagnostic; restored byte-exact
  • bun run warden:agents:check, warden:skills:check, plugin:metadata:check, bun run check/build/test/publish:check/wayfinder:dogfood green at the stack tip

@linear-code

linear-code Bot commented Jun 9, 2026

Copy link
Copy Markdown

TRL-943

galligan commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • queue:merge - adds this PR to the back of the merge queue
  • queue:priority - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@galligan galligan force-pushed the trl-943-graduate-public-api-example-coverage-into-a-repo-local branch from 528d048 to 03e2b0d Compare June 9, 2026 19:24
@galligan galligan force-pushed the trl-942-graduate-scaffold-version-sync-into-the-create-surface branch from 40a5bea to 142b3f4 Compare June 9, 2026 19:24
@galligan galligan marked this pull request as ready for review June 9, 2026 20:25

@greptile-apps greptile-apps 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.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@graphite-app

graphite-app Bot commented Jun 9, 2026

Copy link
Copy Markdown

Merge activity

## Summary

Graduates public-API example coverage into a repo-local Warden rule (TRL-943), replacing `scripts/check-public-api-examples.ts`.

- New `public-export-example-coverage` rule in `packages/warden` (scope `repo-local`, alongside `warden-export-symmetry`/`warden-rules-use-ast`): inventories non-type-only named re-exports on the five public surface package barrels and requires a leading `@example` TSDoc on each exported declaration. Built on the shared `ast.ts` helpers (no TS compiler dependency), anchored to this repo via the rule module's on-disk location so it stays silent in consumer repos.
- Severity: missing `@example` on a `minimumExports` entry → error; other inventoried exports → warn; minimum export absent from the barrel, star/non-relative re-exports on a target barrel, unreadable resolved source → error.
- `publicExportExampleCoverageTrail` wrapper + full registry symmetry; 15 new tests including a real-repo baseline over all five barrels.
- The policy table stays in the rule module with a TSDoc note: `wardenConfigSchema` has no per-rule config channel today, so configured-not-hard-coded is deferred to a config-channel design.
- Removes the root script + its test and drops `docs:api-examples` from the `check` pipeline — the warden run (`trails:check`) now owns this coverage (verified end-to-end by stripping an `@example` and watching the rule fail the warden run).
- Warden guides regenerated (rule count 63); changeset: `@ontrails/warden` minor.

Linear: TRL-943

## Verification

- `bun test packages/warden` (1082 pass), package typecheck/lint clean
- End-to-end: removed `@example` from `packages/cli/src/output.ts` → warden run fails with the new rule's diagnostic; restored byte-exact
- `bun run warden:agents:check`, `warden:skills:check`, `plugin:metadata:check`, `bun run check`/`build`/`test`/`publish:check`/`wayfinder:dogfood` green at the stack tip
@graphite-app graphite-app Bot force-pushed the trl-942-graduate-scaffold-version-sync-into-the-create-surface branch from 142b3f4 to bb5a219 Compare June 9, 2026 20:27
@graphite-app graphite-app Bot force-pushed the trl-943-graduate-public-api-example-coverage-into-a-repo-local branch from 03e2b0d to 5be032c Compare June 9, 2026 20:27
Base automatically changed from trl-942-graduate-scaffold-version-sync-into-the-create-surface to main June 9, 2026 20:30
@graphite-app graphite-app Bot merged commit 5be032c into main Jun 9, 2026
9 checks passed
@graphite-app graphite-app Bot deleted the trl-943-graduate-public-api-example-coverage-into-a-repo-local branch June 9, 2026 20:30
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