Skip to content

Releases: trendvidia/protocompile

v0.23.0

Choose a tag to compare

@trendvidia trendvidia released this 26 Jul 03:05
782e9be

What's Changed

  • catalogs — the reference loader for locale catalog sources (#131) — companion to trendvidia/protowire#195, which pinned the RFC-001 §7 catalog-library source format: a catalog_libraries file is a text-format protowire.schema.catalog.v1.Catalog message, one locale per file, entries keyed by violation code with {param} templates. The new public catalogs package sits beside engineconfig (the shared-surface argument of trendvidia/protolsp#265): Load(baseDir, paths) merges files into one catalog per locale — per-domain files for the same locale merge, a duplicate code across files for one locale is a hard error naming both files, malformed input never partially loads — and FromConfig(cfg) applies the §7 path rule (relative paths resolve against the config file's directory). Output is plain (locale → entries) data; rendering stays in the engine (protocheck's NewMapCatalog consumes Entries directly). The vendored spec set gains proto/schema/catalog/v1/catalog.proto (covered by checkspecdrift), config.proto is re-vendored for its protowire#195 comment update, and the 08_engine_config fixture mirror's catalog_libraries values are .textproto paths now.

Behavior notes for downstream: no compiler-surface change — this release is additive API only (catalogs package, regenerated internal bindings). Unblocks trendvidia/protolsp#267.

Release gate: ci-local-full verified on this tag — generate/lint/test clean, checkspecdrift matches the protowire checkout, benchmarks pass.

Full Changelog: v0.22.0...v0.23.0

v0.22.0

Choose a tag to compare

@trendvidia trendvidia released this 25 Jul 23:27
976cae8

What's Changed

  • Message literals as list elements in annotation arguments (#128) — closes the RFC-001 §8.1 gap from #127: @meta([Item{status: 1}]) previously fell through to opaque expression capture and was rejected with a misleading "must be a literal or a qualified name" error. The element's type path now travels on the dict itself (ast.ExprDict.TypeName(), attached only by the §5.1 annotation classifier), B3 evaluates each element against its explicit type (ir.AnnotationUse.MessageLiteralElem), and fdp lowers elements to LiteralValue.literal.message — a google.protobuf.Any serialized at lowering — flat or nested. Untyped {...} elements under an any-typed context get the same explicit-type-name diagnostic as argument-level literals; message elements join the homogeneity check. Unblocks the deferred @http responses parameter design (protowire#177) and the corpus pairing (protowire#176).
  • Broken and cyclic alias bases diagnosed at the declaration site (#130, closing #129) — type Broken = DoesNotExist; and type A = B; type B = A; compiled with zero diagnostics when no field referenced them, leaking dangling base_type_fqn values into the FileTypeDecls carrier. resolveTypeAliasBases is now the single reporting site: standard cannot-find diagnostics (with import suggestions) at the alias's base expression, plus a local cycle walk reporting each cycle exactly once with a snippet per link. unwrapTypeAlias went fully quiet, so a broken alias reports exactly once whether referenced by twenty fields or none, and imported broken aliases are reported by their declaring file without use-site duplication. The type alias ... is cyclic message text is unchanged.

Behavior notes for downstream: sources that previously compiled while carrying unreferenced broken/cyclic aliases now fail to compile (spec-correct tightening); base_type_fqn consumers no longer see cyclic decl chains in error-free images.

Release gate: ci-local-full verified on this tag — generate/lint/test clean, checkspecdrift matches the protowire checkout, benchmarks pass.

Full Changelog: v0.21.0...v0.22.0

v0.21.0

Choose a tag to compare

@trendvidia trendvidia released this 25 Jul 20:52
d6de621

What's Changed

  • Reserved protowire. prefix rejected in @sensitive(class) values (#125) — RFC-001 §6.7 classification parameter, rule 1 (protowire#111/protowire#163): class names beginning with protowire. are reserved for future spec-defined classes, mirroring the §7 violation-code reservation. The B3 use-arg validation pass now rejects a string-literal class argument (named or positional) that is exactly "protowire" or any dotted extension of it, keyed on the resolved FQN protowire.schema.v1.sensitive — user annotations that happen to be named sensitive are unaffected, as are lookalike prefixes (protowirex.pii), bare @sensitive, and class = "". Closes the v0.19.0/v0.20.0 corpus-ahead-of-toolchain gap: MUST-NOT-COMPILE fixture invalid/reserved_sensitive_class.proto now fails with exactly the expected diagnostic (#123).
  • TypeDecl.base_type_fqn now emitted fully qualified (#126) — the carrier contract pins the field as the FQN of the base type, but the lowering recorded the base as written in source, so bare in-package references stayed bare (type CompanyEmail = Email"Email"). The IR now resolves each alias's base in a quiet resolveTypeAliasBases pass and the new ir.TypeAlias.BaseTypeFQN() accessor feeds the FDP carrier; primitives keep their predeclared name, chained aliases record their immediate base fully qualified, and unresolved bases fall back to the as-written text (#121). Corpus fixtures 02_composition, 06_cross_file_lib, and 14_refinement_kinds now produce exactly the fixture-pinned FQNs (e.g. SettledStatus → fixtures.refine.OrderStatus, DisplayName → google.protobuf.StringValue).

Release gate: ci-local-full verified on this tag — generate/lint/test clean, checkspecdrift matches the protowire checkout, benchmarks pass.

Full Changelog: v0.20.0...v0.21.0

v0.20.0

Choose a tag to compare

@trendvidia trendvidia released this 25 Jul 09:08
fad5fe8

What's Changed

  • report.proto re-vendored at protowire ad3bf9e — the public gen/protowire/schema/v1 bindings pick up two wire-shape additions to EnrichedViolation (#124):
    • for_key = 8 (protowire#125, v1.3.0): marks a violation against a map entry's key rather than its value — a key violation and a value violation on the same entry serialize to identical paths and are disambiguated by this flag. Closes the stale-bindings gap from #116 (v0.19.0 shipped bindings predating the field).
    • source_ref = 9 + the new SourceRef message (protowire#161): the §8.3.1 rule join key — originating file plus canonical descriptor path — engines populate whenever the rule resolved through an embedded source map (50404). Wire consumers join violations back to lowered rules by this key instead of fuzzy-matching source positions.
  • Spec-drift gate green: with the #106 type_chain clarification upstreamed (protowire#165, fixing protowire#155), make checkspecdrift passes clean on all three vendored spec files; ci-local-full (the release gate added in #119) verified on this tag.
  • Also since v0.19.0: bracket-form function options lowered into FunctionDecl.options (#120), in-memory options encoding contract documented on fdp (#115).

Downstream: unblocks trendvidia/protocheck#53 — protocheck can now un-lossy Report.Proto()/ReportFromProto on both fields and pass protowire conformance fixture 15_collections_golden end-to-end.

Full Changelog: v0.19.0...v0.20.0

v0.19.0

Choose a tag to compare

@trendvidia trendvidia released this 24 Jul 04:23
b97c1cf

What's Changed

  • Public report.proto bindings: Report, Violation, and ExecutionMode are now generated into github.com/trendvidia/protocompile/gen/protowire/schema/v1 (package schemav1, alongside the descriptor carriers, vendored at protowire 2fcc218) — for engines producing wire Reports (RFC-001 goal-5 report equality, §6.6 rule 6 gRPC adapters) and tooling consuming them (#111, fixes #108)
  • Map per-element carrier: a map field whose value type is a type alias now expands the alias's rules onto the map field's own AnnotationList — base-to-derived ahead of field-site entries, exactly like repeated element aliases — plus a bare-path TYPE_REFINEMENT entry whose location points at the value-type name inside map<K, V> (#112, fixes #109). Descriptor-shape change vs v0.18.0: these rules previously lowered onto the synthetic entry's value field (…Entry.value[…] paths); that emission is gone. Key-type alias rules deliberately remain on the synthetic entry's key field, where they stay distinguishable from per-value rules
  • Typed map_entry: synthetic map-entry messages now carry options.map_entry = true as the typed field instead of unknown-field bytes, so in-memory reflection consumers (protodesc.NewFile IsMap classification, protoreflect map accessors, dynamicpb) see a map without a wire round-trip; wire encoding is unchanged (#113, fixes #110). Other user-written options intentionally remain unknown-bytes-encoded in memory — see #114 for that contract discussion. protocheck can drop its re-add-map_entry post-processing workaround after bumping

Full Changelog: v0.18.0...v0.19.0

v0.18.0

Choose a tag to compare

@trendvidia trendvidia released this 24 Jul 02:52
845da1b

What's Changed

  • Behavior change: alias-expanded AnnotationList entries now emit in RFC-001 §6.4 evaluation order — base alias rules first, then derived alias rules, then field-level rules. Engines that assumed the previous derived-first order (which violated §6.4) must not reorder; entries are now evaluation-ready as listed (#102, fixes #101)
  • Descriptor-path re-keying: because §8.3.1 ordinals key off AnnotationList order, same-named annotations propagated from a multi-link alias chain resolve to different elementPath[fqn#ordinal] paths than v0.17.1 — the base-most alias's rule is now ordinal 0. Persisted descriptor paths (report keys, suppression lists, LSP bookmarks) from v0.17.1 must be re-derived. SourceMap entries moved in lockstep, and protocheck's chain reconstruction is order-independent and unaffected (#102)
  • SourceEntry.type_chain on TYPE_REFINEMENT entries is now base-to-derived per the documented contract, and the descriptor.proto comment now states explicitly that links are the alias chain only — the concrete base type is never a link; recover it from the first link's TypeDecl.base_type_fqn (#102, #106, fixes #103)
  • Remove stale same-file-only note on unwrapTypeAlias — cross-file annotation propagation is fully supported and now documented as such (#107, fixes #105)

Full Changelog: v0.17.1...v0.18.0

v0.17.1

Choose a tag to compare

@trendvidia trendvidia released this 23 Jul 23:09
ec4f20d

What's Changed

  • Populate declaration-site locations on the protowire.schema.v1 file-scope declaration carriers (50401–50403): AnnotationDecl, FunctionDecl, and TypeDecl now record their declaration-name source location, per RFC-001 §8.2 (#100, fixes #99)
  • Deflake TestSpawnBudgetBoundsGoroutines (#98)
  • CI: build/test on the runner's go-plus (self-hosted macOS, Model B) (#97)
  • Bump github.com/bufbuild/buf from 1.71.0 to 1.72.0 in /internal/tools (#96)

Full Changelog: v0.17.0...v0.17.1