Skip to content

cmd/pxf: pxf build — compile v1.2 schemas to a lowered FileDescriptorSet image (#164) - #167

Merged
trendvidia merged 1 commit into
mainfrom
pxf-build-164
Jul 25, 2026
Merged

cmd/pxf: pxf build — compile v1.2 schemas to a lowered FileDescriptorSet image (#164)#167
trendvidia merged 1 commit into
mainfrom
pxf-build-164

Conversation

@trendvidia

Copy link
Copy Markdown
Owner

Implements #164 with Option 1 for the dependency layout: the trendvidia/protocompile fork (v0.20.0) coexists with upstream bufbuild/protocompile v0.14.1 in the root module graph — different module paths, no conflict — so go install github.com/trendvidia/protowire/cmd/pxf@latest stays a single binary.

What

New pxf build subcommand, the end-user front-end for the two-stage workflow:

pxf build -o image.binpb ./schemas/...   # only v1.2-aware step (fork pipeline: incremental.Run + queries.FDS)
buf generate image.binpb                 # all-stock plugin chain
  • Inputs: directory args are import roots (every .proto beneath, root-relative import paths; trailing /... accepted); file args compile under their base name with the parent dir as root. Two args claiming one import path for different files is a hard error.
  • Engine config (§9.4): engineconfig.Load with the normative precedence — --function-library (per-setting flag) > --config > PROTOWIRE_CONFIG > discovered protowire.config.textproto (upward walk from the first arg) > defaults. Configured function_libraries compile into the image; engine-runtime knobs are ignored per the issue scope.
  • --check: compile + rendered diagnostics only, no output — the CI entry point.
  • Bundled resolution: protowire/schema/v1/annotations.proto, pxf/annotations.proto (and the rest of the canonical tree) serve from the repo-root BundledProto embed; WKTs from the compiler's opener. No -p needed.
  • Output: deterministic marshaling → byte-identical images across runs; default stdout, -o for a file.

Acceptance mapping

  • ✅ positive testdata/schema-extensions/ fixtures → byte-stable FDS, loadable by stock protodesc (TestBuildPositiveCorpus, TestBuildDirectoryRoot)
  • --check over invalid/ exits non-zero per the manifest, modulo Reject reserved 'protowire.' prefix in @sensitive(class) values (RFC-001 §6.7 rule 1) protocompile#123 (reserved_sensitive_class.proto — recorded in checkKnownGaps; the skip flips to a failure the moment a fork upgrade closes the gap)
  • ✅ two-stage workflow documented in cmd/pxf/README.md (glance table, full section, PROTOWIRE_CONFIG env row)
  • buf generate equivalence with the internal/schemaext harness is the same fork pipeline + forked protoc-gen-go already exercised by the nested-module CI job; no new harness added here

Refs: RFC-001 §8.5/§9.4, umbrella #55 (M7 tooling), #69 stay-forked resolution.

Closes #164.

…Set image (#164)

Two-stage workflow: pxf build is the only v1.2-aware step; the image it
emits is stock protobuf for unmodified buf/protoc. Dependency layout is
Option 1 — the trendvidia/protocompile fork coexists with upstream
bufbuild/protocompile v0.14.1 in the root module graph, keeping
go install .../cmd/pxf@latest a single binary.

- directory args are import roots (trailing /... accepted); file args
  compile under their base name
- engine config per RFC-001 §9.4: --function-library > --config >
  PROTOWIRE_CONFIG > discovered protowire.config.textproto > defaults;
  function_libraries compile into the image
- canonical annotation libraries + WKTs resolve from the bundled embed
- deterministic marshaling: byte-stable images across runs
- --check: diagnostics-only CI entry point

Tests pin the #164 acceptance bar: positive corpus byte-stable and
loadable by stock protodesc; every invalid/ fixture rejected modulo the
tracked gap trendvidia/protocompile#123 (skip flips to failure when the
fork closes it).
@trendvidia
trendvidia merged commit f58b577 into main Jul 25, 2026
6 checks passed
@trendvidia
trendvidia deleted the pxf-build-164 branch July 25, 2026 09:47
trendvidia added a commit that referenced this pull request Jul 26, 2026
CHANGELOG: cut the 1.5.0 section (docs platform layer 1, pxf openapi,
@http operation surface, @sensitive class, pxf build, corpus pins for
message-literal list elements and cyclic aliases, §6.4/§7
tightenings); restore the missing [1.4.0] header lost at the last cut
and add the pxf build entry #167 missed. STABILITY.md gains the v1.5
section: additive minor, no wire changes, conformance-claim deltas
enumerated.
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.

pxf build: compile v1.2 schemas to a lowered FileDescriptorSet image

1 participant