Skip to content

compiler: conformance cases for own-schema paths (specification#11, part 1) - #12

Merged
Kinflou merged 1 commit into
mainfrom
cases/own-schema-paths
Nov 14, 2026
Merged

Kinflou merged 1 commit into
mainfrom
cases/own-schema-paths

Conversation

@Kinflou

@Kinflou Kinflou commented Nov 14, 2026

Copy link
Copy Markdown
Member

Part of #11, which stays open: this is only the own-schema-path cases. Epic: ComlineProject/core#281. Proposal: Own schemas, provenance and dependency groups (docs#178, docs#181). The rule itself is core#282.

The rule the cases hold implementations to

Within a package, its own schemas are reached only as package::..., parent::... or self::.... An absolute first segment of a use is std or a dependency. A bare path that reaches one of the package's own schemas is an error at once (no edition, no deprecation period).

New group imports (compiler/src/imports.cue -> compiler/cases/imports.json)

Errors, code import::bare-own-schema-path:

  • bare-own-item, bare-own-namespace, bare-own-multi, bare-own-glob: each form of a use (use models::Blob, use models, use models::{Blob, Tag}, use models::*);
  • bare-own-nested: a schema in a directory (use shapes::models::Blob from shapes/api).

Clean, the same schemas through the relative forms:

  • package-item, package-namespace (with a qualified reference models::Blob after it), package-multi, package-glob, package-nested;
  • parent-item, self-item.

A first segment that isn't the package's:

  • dependency-path: a bare path naming a dependency builds;
  • std-path: a bare path naming std builds (use std::http::Request);
  • unknown-first-segment: a bare path that matches nothing is still import::unresolved, not the new error.

What keeps a first segment from meaning two things (no code; the cases say what the message contains, as acceptance does):

  • own-schema-named-like-dependency: the shadowing guard (core#256) refuses a package with a dependency and an own schema of the same first word;
  • dependency-named-std, dependency-named-package, dependency-named-parent, dependency-named-self: the reserved dependency names.

bounded's three uses of the package's own models schema now say package::models::Blob (ids and outcomes unchanged).

Catalog

The catalog (catalog/) has no diagnostics section yet; the codes the corpus uses are the closed list in specs/compiler.cue. The new import::bare-own-schema-path, and import::unresolved (existing in core, first used by a case here), are added there, in the family::kebab-name style of unverified:: and settings::. When the catalog grows diagnostics (shared-vocabulary kind diagnostic), they move with the rest.

Version

VERSION is not bumped. It moves for wire and profile changes (0.11 added a framing fact); compiler cases and size rules went in without a bump (#4, #5). The compiler/readme.md corpus table lists the group.

Left for #11

Groups (group on a dependency entry, and regrouping), and the format kind of case for import ordering. They wait for core#284, and core's conformance runner would fail on them until then.

Checked

specs/check.sh --check is clean. Run against core with the rule (ComlineProject/core feat/own-schema-relative-paths): all imports cases and the rest pass.

…art)

A package's own schemas are reached only through package::, parent:: or
self::; an absolute first segment is std or a dependency. New group
imports: a bare path to an own schema, in each form of a use, is
import::bare-own-schema-path; the relative forms, a dependency's and
std's paths build; a path matching nothing is import::unresolved; a
schema named like a dependency, and the reserved dependency names
(std, package, parent, self), are refused.

bounded's three uses of the package's own models schema say package::.
Groups and the format cases stay with specification#11.
@Kinflou
Kinflou marked this pull request as ready for review November 14, 2026 22:43
@Kinflou
Kinflou merged commit 16dfe40 into main Nov 14, 2026
7 checks passed
@Kinflou
Kinflou deleted the cases/own-schema-paths branch November 14, 2026 22:54
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