refine

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2026 License: MIT Imports: 0 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Refine

A GoPlus-authored compiler for Refined OpenAPI 3, Refined Avro, and Refined JSON Schema, with Java 25 code generation and validated serde.

v0.1.0 scope; release tags are issued only after the required CI passes on the exact candidate commit. SPEC.md is the agreed product contract. The implementation and release evidence is tracked in docs/IMPLEMENTATION.md. The finite release gates and documented fail-closed support boundaries are summarized in docs/RELEASE-READINESS.md. The pinned GitHub Actions workflow is the source of truth for the final cross-platform generation, race, Java, Maven, vet, CLI and selected-fuzz gate; focused development checks do not substitute for that run.

Development

Use Go 1.26 or newer. GoPlus is pinned as a module tool at v0.158.0, verified against the latest published module on 2026-09-19. Do not use an older globally installed goplus. Semantic source lives in .gp; generated Go is committed so ordinary Go consumers do not need the GoPlus compiler. The generated //goplus:v v0.28.0 marker is GoPlus's separate source-compatibility vintage, not the compiler distribution version; go tool goplus version reports the actual pinned release.

go mod download
go generate ./...
go tool goplus gen --check ./...
go test -race -timeout=20m ./...
go vet ./...

The full race suite above is a once-per-stable-checkpoint integration gate, not an edit/test loop. During development use the exact affected selections in docs/TESTING.md, preserve cached results, and do not run the ordinary whole suite again before the race suite. Required Java/Maven dependency settings and checkpoint evidence are recorded in docs/IMPLEMENTATION.md; missing-runtime skips are not release evidence.

The implemented surface includes immutable exact values, three-outcome validation and deterministic budgets; the checked Haskell-like language; lossless native ingestion and editable supported constraint units; ordinary and Refined exports with complete documented-loss explanations; immutable Java 25 models, validators, Jackson 3 and Avro binary/JSON serde; native-aware OpenAPI request/response context; schema-derived JetCheck tests and embedded examples; release planning/promotion; and reproducible unsigned Maven assembly. See docs/RUNTIME.md, docs/NATIVE.md, and the Java runtime guide for exact APIs and limits. Unsupported native correspondences, wire encodings and ambiguous automatic projections fail closed; the release does not claim unrestricted conversion among all schemas.

The CLI exposes the implemented phases:

go build -o bin/refine ./cmd/refine
bin/refine typecheck --json language/testdata/contracts.refine
bin/refine check-schema --json language/testdata/contracts.refine
bin/refine fmt language/testdata/contracts.refine
bin/refine inspect-json --json value/testdata/numbers.json
bin/refine explain examples/invoice.refine
bin/refine satisfiable --json examples/evolution/SNAPSHOT.refine Age
bin/refine project maven

typecheck is not payload/native schema validation. See docs/LANGUAGE.md for syntax, static checks, and supported boundaries. check-schema additionally rejects proven-empty declarations while explicitly reporting unknown satisfiability. Unknown permits compilation, not a claim of proof; native schema validity and wire enforcement remain separate checks. The worked examples, native schema guide, Jackson serde guide, Maven workflow, and release planning guide describe executable workflows and their current limits.

The module is goforge.dev/refine, hosted at brain-fuel/refine. MIT licensed. The Maven group ID remains undecided. Maven deployment is explicitly outside the current implementation goal; preparing and testing Java artifacts is in scope.

Documentation

Overview

Package refine implements refinement-aware schema tooling.

Directories

Path Synopsis
Package analysis provides conservative proofs about checked payload contracts.
Package analysis provides conservative proofs about checked payload contracts.
Package cli provides the testable command-line boundary.
Package cli provides the testable command-line boundary.
cmd
refine command
refine-testplan command
Command refine-testplan prints or executes the deterministic CI fuzz plan.
Command refine-testplan prints or executes the deterministic CI fuzz plan.
Package explain derives English contract instructions from checked syntax.
Package explain derives English contract instructions from checked syntax.
internal
ecmaregex
Package ecmaregex executes one checked ECMA-262 2020 Unicode regular expression guest in isolated WebAssembly instances.
Package ecmaregex executes one checked ECMA-262 2020 Unicode regular expression guest in isolated WebAssembly instances.
testplan
Package testplan selects CI fuzz campaigns from committed changes.
Package testplan selects CI fuzz campaigns from committed changes.
Package java emits Java 25 source.
Package java emits Java 25 source.
Package language implements the Haskell/ML-style refinement front end.
Package language implements the Haskell/ML-style refinement front end.
Package native validates and retains ordinary and Refined native schema documents.
Package native validates and retains ordinary and Refined native schema documents.
Package openapi validates pure Refine request/response execution contexts.
Package openapi validates pure Refine request/response execution contexts.
Package pattern executes refinement regular expressions with deterministic work accounting.
Package pattern executes refinement regular expressions with deterministic work accounting.
Package project assembles deterministic Java/Maven project outputs without publishing artifacts or mutating user build files.
Package project assembles deterministic Java/Maven project outputs without publishing artifacts or mutating user build files.
Package provenance tracks exact native-constraint/refinement correspondences.
Package provenance tracks exact native-constraint/refinement correspondences.
Package release plans schema-family versions from caller-supplied evidence.
Package release plans schema-family versions from caller-supplied evidence.
Package schemajson parses immutable, ordered JSON documents without losing native schema syntax, number precision, or escaped UTF-16 code units.
Package schemajson parses immutable, ordered JSON documents without losing native schema syntax, number precision, or escaped UTF-16 code units.
Package validation supplies deterministic, payload-private validation results.
Package validation supplies deterministic, payload-private validation results.
Package value provides immutable, language-neutral refinement values.
Package value provides immutable, language-neutral refinement values.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL