Skip to content

refactor!: remove duplicate public paths before 1.0 - #319

Merged
Teakowa merged 2 commits into
mainfrom
teakowa/issue-315-duplicate-public-paths
Sep 27, 2026
Merged

Teakowa merged 2 commits into
mainfrom
teakowa/issue-315-duplicate-public-paths

Conversation

@e54-bot

@e54-bot e54-bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Closes #315.

Summary

Resolves the duplicate-path decision in #315 with its proposed default, so every public item is either reachable through exactly one path or documented as an intentional 1.x alias.

  • settings::schema is now internal (pub(crate)). Its types and functions, including the previously unexported validate_catalog, are re-exported flat from settings only. Internal/external callers of settings::schema::{validate_catalog, definitions} were updated to settings::{validate_catalog, definitions} (workshop-catalog-gen, workshop-rs-cli::census, tests/public_api.rs).
  • actions no longer re-exports ActionLayout, ActionLayoutError, action_width. They stay public only from emitter — the path opy-rs already uses. actions::layout is now pub(crate) and emitter re-exports from it directly.
  • rules no longer re-exports validate_canonical_ids. It stays public only from validate (rules::validate was already pub(crate), unchanged).
  • Kept and documented in docs/compatibility-facades.md as intentional: the root/program::/per-domain Program model re-exports (actions::{Action, ModifyOp}, events::*, rules::{Program, Rule, Condition, Subroutine, Variable}, values::Value), plus the already-documented detect and signatures aliases. The doc also now correctly notes that actions/rules re-export more than just the model types (element-count analysis, semantic inspection) rather than overclaiming "only".
  • Fixed a stale reference in docs/adr/0006-settings-semantic-schema.md that still pointed at settings::schema as the public path.

Why these three

settings::schema, actions::{ActionLayout, ActionLayoutError, action_width}, and rules::validate_canonical_ids were implementation-phase re-exports with no discoverability purpose beyond the domain/operation module that already owns them. The model re-exports are kept because the crate's own docs present actions, events, rules, and values as the discoverable Workshop domains alongside program, so removing those would work against the crate's documented design.

Verification

Rebased onto current main (post #317/#318, now v0.10.0) after an independent review caught that the branch was stale and had a real merge conflict in tests/public_api.rs against #317's new mapped_text_is_constructible_outside_the_crate test; that review also caught the two doc overclaims/staleness fixed above. Re-verified after rebase:

  • cargo test --workspace: 231 passed (+ 9/103/15/15 across the other test binaries), 0 failed, 3 ignored (pre-existing/unrelated).
  • cargo clippy --workspace --all-targets --all-features -- -D warnings: clean.
  • cargo semver-checks --release-type minor -p workshop-rs against the current v0.10.0 baseline: flags exactly the three removed paths (settings::schema module + its 20 types/functions, actions::{ActionLayout, ActionLayoutError, action_width}, rules::validate_canonical_ids) and nothing else (4 failure categories, 192/196 checks pass).
  • PR title carries the ! marker per the pre-1.0 breaking-change convention.

Non-goals

No renaming or reorganizing beyond removing the duplicate paths, per the issue's non-goals. Downstream import migrations (opy-rs, deltin-rs) are out of scope; a GitHub code search confirmed neither currently imports the three removed paths, but consumers own their own migrations regardless.


View in Indent
Tag @indent to continue the conversation here.

Resolve the duplicate-path decision in #315 with its proposed default:

- settings::schema is now internal; its types and functions (including
  the previously unexported validate_catalog) are public only from
  settings directly.
- actions no longer re-exports ActionLayout, ActionLayoutError, or
  action_width; they are public only from emitter, the path already
  used by opy-rs.
- rules no longer re-exports validate_canonical_ids; it is public only
  from validate.
- The root, program::, and per-domain Program model re-exports
  (actions::{Action, ModifyOp}, events::*, rules::{Program, Rule,
  Condition, Subroutine, Variable}, values::Value) are kept and
  documented as intentional in docs/compatibility-facades.md, along
  with the already-documented detect and signatures aliases.

Verified with cargo semver-checks that only the three intended paths
are flagged as removed, cargo test --workspace (all 231+ tests pass),
and cargo clippy --workspace --all-targets --all-features -D warnings
clean.
- actions and rules re-export more than just the Program model types
  (element-count analysis types and semantic-inspection types
  respectively); say so instead of claiming 'only'.
- ADR-0006 still pointed at settings::schema, which is now internal;
  point at settings and the compatibility doc instead.

Found by an independent review of #319.
@indent
indent Bot force-pushed the teakowa/issue-315-duplicate-public-paths branch from 9663c79 to 57d003b Compare September 27, 2026 11:45
@Teakowa
Teakowa merged commit 5110885 into main Sep 27, 2026
10 checks passed
@Teakowa
Teakowa deleted the teakowa/issue-315-duplicate-public-paths branch September 27, 2026 12:01
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.

Remove or document duplicate public paths before 1.0

2 participants