morphic

module
v0.0.0-...-38da05c Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT

README

dexpace

morphic

Idiomatic SDKs and docs from any API spec. One spec-agnostic IR, many targets.

gate License Go

Morphic is a spec-to-SDK compiler. It reads an API specification, lowers it into one spec-agnostic intermediate representation (IR), and generates SDKs and documentation from that IR. Compilers (spec → IR) and emitters (IR → artifacts) never see each other; the IR is the only thing that passes between them, so supporting a new source format and supporting a new target language are independent pieces of work.

Status: early development. The IR and the OpenAPI 3.0, 3.1 and 3.2 compiler work end to end through the morphic CLI. No emitter exists yet, so today Morphic produces IR, not SDKs. There is no released version, and the IR schema and the CLI may change between commits (what a consumer storing IR pins).

Quick start

Install the CLI. It requires the Go release named by the go directive in go.mod, or newer; under the default GOTOOLCHAIN=auto, an older go command from Go 1.21 on downloads that release itself.

go install github.com/dexpace/morphic/cmd/morphic@latest

Or build it from a checkout with go build -o morphic ./cmd/morphic. Then compile a spec:

morphic compile openapi.yaml                    # IR JSON to stdout
morphic compile openapi.yaml -o api.ir.json     # ...or to a file
morphic validate openapi.yaml                   # diagnostics and exit code only
morphic compile openapi.yaml --explain /components/schemas/Pet

compile lowers one spec into IR JSON, and validate runs the same pipeline and drops the document. Both write what they find in the spec to stderr, one finding per line, as <severity> <code> <location>: <message>:

error openapi/unresolved-ref openapi.yaml#/components/schemas/Pet/discriminator/mapping/dog: discriminator mapping "dog" references unresolved schema "#/components/schemas/Dog": it names nothing in the document it points into

The exit status is 0 for a clean run, 1 when the spec has problems, and 2 when the invocation, the filesystem or Morphic itself failed, or the run was stopped. --explain reports what compiling produced at one place in the spec instead of writing the document.

The CLI reference covers every flag, the triage file that rates or accepts findings, the JSON report, and the options the OpenAPI compiler takes.

Library

The same pipeline is available as a Go package:

eng, err := engine.New()
if err != nil {
    return err
}

res, err := eng.Run(ctx, "openapi.yaml", engine.RunOptions{})
if err != nil {
    return err // misuse, I/O or a broken contract; problems in the spec arrive as diagnostics
}
if res.Failed {
    return errors.New("the spec has problems") // res.Diagnostics says which
}

// Canonical, deterministic bytes, replacing the file atomically as `-o` does.
return output.ReplaceDocument(ctx, "api.ir.json", res.Document, output.Compact)

Morphic as a Go library covers compiling a spec held in memory, typed options, passes of your own, triage, and rendering findings exactly as the CLI prints them.

Pipeline

spec ──▶ compiler ──▶ IR ──▶ passes ──▶ IR ──▶ emitter ──▶ SDK / docs
        (spec → IR)         (IR → IR)          (IR → artifacts)
  • Compilers (compilers/*) turn one source format into an IR document plus diagnostics. Each recognizes its own format from the bytes and owns its options. OpenAPI 3.x is the first; the formats planned after it are in Status.
  • Passes (pass/) are small, order-explicit IR → IR transforms. const-unions rewrites a closed union of strings as the enum of them, validate checks referential integrity and the well-formedness rules the IR states, and names reports names a target may render alike; all three run by default. Deduplication, filtering, version slicing and IR overlays are designed in Architecture but not built.
  • Emitters (emitters/*, not built yet) turn an IR document into the artifacts for one target. SDK runtime policy (retries, timeouts, telemetry, the error taxonomy) is a separate emitter input, not part of the IR.

The packages are layered along the pipeline, and a test enforces the import graph: compilers and emitters never import each other (Architecture §3).

Design principles

Each of these is a load-bearing decision, not a preference. Architecture and IR design give the reasoning.

  • The IR is the contract. A compiler's only output is an IR document plus diagnostics, and an emitter's only input is an IR document plus its own options.
  • Lossless by default, lowered late. Compilers keep source semantics (composition, unions, discriminators, visibility, encodings, streaming) instead of flattening them. Lowering to what a target language can express happens in the emitter, so no target's limits leak back into the shared IR. What the IR does not model structurally is kept verbatim, along with why it was kept.
  • Stable IDs, neutral names. Every named entity gets an ID derived from its location in the source, never from its display name, and no rename rewrites it. Names are stored as written, as sent on the wire, and as a neutral word sequence; casing and reserved-word escaping are left to each emitter.
  • Deterministic output. A document round-trips through JSON. Compiling the same spec twice gives the same bytes, and reordering a spec's declarations changes nothing beyond source order.
  • Diagnostics, not logs. Every stage is a pure function f(input, options) → (output, diagnostics) with no package-level state. Problems in a spec come back as typed ir.Diagnostic values, and the engine decides whether they fail the run, at a severity threshold the caller sets.
  • Heuristics are policy. Anything inferred rather than declared, such as which media types imply a stream or which vendor extensions fill typed fields, is an injectable policy the caller can change or switch off, and what it produces is marked as inferred in the IR's provenance.
  • Untrusted input is bounded. Unless allow-external-refs is set, a $ref reads only files inside the spec's directory, and only through relative references. Budgets on source size, parsed nodes, enum members and YAML alias expansion turn a pathological document into a diagnostic instead of an exhausted host.

Status

Milestone Scope State
1 IR package + OpenAPI 3.x compiler, validate pass, golden corpus, JSON round-trip Implemented
2 Swagger 2.0 lift into the OpenAPI compiler (format-version-normalization seam) Planned
3 First emitters: Go, Kotlin/JVM and Kotlin Multiplatform end to end from one plan (plan / refine / emit boundary) Planned
4 Second family compiler (TypeSpec or Smithy), proving the spec-agnostic claim Planned
5 Event-shaped compiler (AsyncAPI), then GraphQL, Protobuf, Erlang/OTP Planned

The IR is designed against every format above, so a later compiler fills fields rather than adding them. Where one meets a construct the IR has no place for yet, it keeps the construct verbatim, and the IR grows by a versioned change (Architecture §2.5). Until milestone 2, a Swagger 2.0 document is recognized and refused with engine/no-compiler-for-format.

Documentation

Using Morphic:

Document Description
CLI reference Commands and flags, diagnostics and triage, the JSON report, exit codes, and the OpenAPI compiler's options.
Go library The engine from Go: its inputs and options, its errors and verdict, and rendering and writing as the CLI does.

The design documents are normative. Read them before proposing changes to the IR or the pipeline:

Document Description
Architecture Pipeline stages, package layout, layering rules, milestones.
IR design The intermediate representation, one document per domain: node catalog and semantics. Its field shapes are the contract.
OpenAPI lowering How the OpenAPI compiler lowers each construct, one keyed rule each, with the cases, codes and tests that pin it.
Planned lowerings How each format without a lowering specification of its own is planned to lower.
Spec capability matrix What each source format can express: the union the IR is designed against.
Emitter design The emitter contract, the plan / refine / emit boundary, and what each target decides.

Contributing

Start from CONTRIBUTING.md, which says which documents a change needs, walks the common changes step by step, and lists the checks. One command runs everything CI runs, and it must pass before a change lands:

make gate

To report a vulnerability, see SECURITY.md.

License

Licensed under the MIT License. Copyright © 2026 dexpace.

Directories

Path Synopsis
Package barrier runs code its caller does not own and turns a panic in it into an error; Line quotes what that code says on one bounded line.
Package barrier runs code its caller does not own and turns a panic in it into an error; Line quotes what that code says on one bounded line.
cmd
morphic command
Command morphic is the Morphic CLI: it lowers an API spec into Morphic IR.
Command morphic is the Morphic CLI: it lowers an API spec into Morphic IR.
morphic-census command
Command morphic-census compiles API specs and reports which facts of the IR the resulting documents set, as internal/census counts them, with the count of documents and instances for each.
Command morphic-census compiles API specs and reports which facts of the IR the resulting documents set, as internal/census counts them, with the count of documents and instances for each.
morphic-covergate command
Command morphic-covergate judges a coverage profile against the gate's rule that every statement runs.
Command morphic-covergate judges a coverage profile against the gate's rule that every statement runs.
morphic-harness command
Command morphic-harness sweeps API specs through Morphic's bug-catching oracles (harness.Check), each spec run as `morphic compile --verify` runs it, and writes to stdout a line per finding and what each oracle asked and declined (harness.Summary).
Command morphic-harness sweeps API specs through Morphic's bug-catching oracles (harness.Check), each spec run as `morphic compile --verify` runs it, and writes to stdout a line per finding and what each oracle asked and declined (harness.Summary).
morphic-vet command
Command morphic-vet runs the repository's own lint rules, internal/lintrules, as a go vet tool.
Command morphic-vet runs the repository's own lint rules, internal/lintrules, as a go vet tool.
Package compilers defines the contract between spec compilers and the engine: a Compiler lowers source documents of its formats into an ir.Document plus diagnostics, purely and reentrantly.
Package compilers defines the contract between spec compilers and the engine: a Compiler lowers source documents of its formats into an ir.Document plus diagnostics, purely and reentrantly.
compile
Package compile holds what every spec compiler shares: the type registry and its source-coordinate map (invariant 3), diagnostic accumulation, naming on ir's canonical grammar (invariant 4) with the name minted for an unnamed entity, and the ID grammar and namespace declaration.
Package compile holds what every spec compiler shares: the type registry and its source-coordinate map (invariant 3), diagnostic accumulation, naming on ir's canonical grammar (invariant 4) with the name minted for an unnamed entity, and the ID grammar and namespace declaration.
openapi
Package openapi lowers OpenAPI 3.0/3.1/3.2 documents into the Morphic IR.
Package openapi lowers OpenAPI 3.0/3.1/3.2 documents into the Morphic IR.
openapi/internal/annotation
Package annotation reads the documentation-adjacent facts a schema or a carrier declares — descriptions, deprecation, redaction, visibility, XML hints, extensions — and the validation-only JSON Schema keywords the IR keeps verbatim rather than models.
Package annotation reads the documentation-adjacent facts a schema or a carrier declares — descriptions, deprecation, redaction, visibility, XML hints, extensions — and the validation-only JSON Schema keywords the IR keeps verbatim rather than models.
openapi/internal/auth
Package auth lowers what a document says about authentication: the security schemes it declares, and the requirements that name them.
Package auth lowers what a document says about authentication: the security schemes it declares, and the requirements that name them.
openapi/internal/bind
Package bind resolves every $ref of an OpenAPI source, a schema's and a Reference Object's, into an immutable table, over the decoded YAML trees and never through the parser's resolver: for each reference, where its own $ref lands and where its chain ends, or why it does not.
Package bind resolves every $ref of an OpenAPI source, a schema's and a Reference Object's, into an immutable table, over the decoded YAML trees and never through the parser's resolver: for each reference, where its own $ref lands and where its chain ends, or why it does not.
openapi/internal/bind/typed
Package typed answers what the lowering asks of a bind table about the typed schemas it holds: where a schema's $ref lands, the schema written there and the one its chain ends on.
Package typed answers what the lowering asks of a bind table about the typed schemas it holds: where a schema's $ref lands, the schema written there and the one its chain ends on.
openapi/internal/budget
Package budget counts the work and the size of a compile against their limits.
Package budget counts the work and the size of a compile against their limits.
openapi/internal/canary
Package canary pins the parser library behaviours docs/parser-library.md records, one test for each entry.
Package canary pins the parser library behaviours docs/parser-library.md records, one test for each entry.
openapi/internal/convention
Package convention fills the facts an OpenAPI document implies by the names it gives its fields rather than declares: an operation's idempotency token, by the header the key travels in; a credential's redaction, by what it is called; and a response header's HTTP-date text, by the field it is.
Package convention fills the facts an OpenAPI document implies by the names it gives its fields rather than declares: an operation's idempotency token, by the header the key travels in; a credential's redaction, by what it is called; and a response header's HTTP-date text, by the field it is.
openapi/internal/detect
Package detect recognizes an OpenAPI or Swagger document from its bytes: the discriminating key it writes and the version beside it, read off the parse the compile goes on to lower.
Package detect recognizes an OpenAPI or Swagger document from its bytes: the discriminating key it writes and the version beside it, read off the parse the compile goes on to lower.
openapi/internal/diag
Package diag holds the OpenAPI compiler's diagnostic vocabulary: the stable codes it reports under, the single constructor that builds a diagnostic from them, and how one quotes a dependency's error or panic.
Package diag holds the OpenAPI compiler's diagnostic vocabulary: the stable codes it reports under, the single constructor that builds a diagnostic from them, and how one quotes a dependency's error or panic.
openapi/internal/doctree
Package doctree reads an input's bytes, the source's, an overlay's or a document a reference names, into the YAML parser's tree of its first document that holds content, held to the node budget as it is read.
Package doctree reads an input's bytes, the source's, an overlay's or a document a reference names, into the YAML parser's tree of its first document that holds content, held to the node budget as it is read.
openapi/internal/document
Package document lowers what a document says about itself rather than its types or operations: its info and root externalDocs, and, kept verbatim, what the objects around them write that lowers to no node (docs/compilers/openapi.md#document-metadata, docs/compilers/openapi.md#unreferenced-components).
Package document lowers what a document says about itself rather than its types or operations: its info and root externalDocs, and, kept verbatim, what the objects around them write that lowers to no node (docs/compilers/openapi.md#document-metadata, docs/compilers/openapi.md#unreferenced-components).
openapi/internal/fragment
Package fragment is the one place the compiler reads a $ref fragment as a JSON pointer (GitHub #911), and tells an absolute reference, which no base moves, from a relative one.
Package fragment is the one place the compiler reads a $ref fragment as a JSON pointer (GitHub #911), and tells an absolute reference, which no base moves, from a relative one.
openapi/internal/ids
Package ids builds the RFC 6901 pointer that names a position — a jsontext.Pointer from construction on, read back through its methods, never split on '/' — and derives IR identifiers and namespaces from it.
Package ids builds the RFC 6901 pointer that names a position — a jsontext.Pointer from construction on, read back through its methods, never split on '/' — and derives IR identifiers and namespaces from it.
openapi/internal/jsonpath
Package jsonpath evaluates RFC 9535 queries over the JSON value a YAML tree stands for: an alias reads as the node it names, a `<<` merge key's members as members of the mapping merging them, and a scalar as the compiler reads it.
Package jsonpath evaluates RFC 9535 queries over the JSON value a YAML tree stands for: an alias reads as the node it names, a `<<` merge key's members as members of the mapping merging them, and a scalar as the compiler reads it.
openapi/internal/load
Package load turns one source document into a parsed, reference-resolved OpenAPI document plus the identity metadata the rest of the compiler stamps into the IR.
Package load turns one source document into a parsed, reference-resolved OpenAPI document plus the identity metadata the rest of the compiler stamps into the IR.
openapi/internal/lowering
Package lowering holds the context every OpenAPI lowering reads.
Package lowering holds the context every OpenAPI lowering reads.
openapi/internal/lowering/loweringtest
Package loweringtest builds the lowering context the compiler's tests lower under, over a document the load phase read, as the compiler builds its own.
Package loweringtest builds the lowering context the compiler's tests lower under, over a document the load phase read, as the compiler builds its own.
openapi/internal/merge
Package merge reconciles the properties more than one allOf branch declares: folding the declarations into one, composing the models they name, or reporting that they disagree.
Package merge reconciles the properties more than one allOf branch declares: folding the declarations into one, composing the models they name, or reporting that they disagree.
openapi/internal/naming
Package naming names every node the OpenAPI compiler builds as a function of the documents and the node's coordinate (GitHub #981), so which lowering reaches a coordinate first cannot change what it is called.
Package naming names every node the OpenAPI compiler builds as a function of the documents and the node's coordinate (GitHub #981), so which lowering reaches a coordinate first cannot change what it is called.
openapi/internal/nodeview
Package nodeview is the compiler's one reading of a raw YAML tree: a mapping read the way the parser reads it, through aliases and `<<` merge keys, each key and each key written twice settled as the parser's model settles them (docs/parser-library.md#merge-keys, #duplicate-key, #non-scalar-key), and one bounded, iterative walk of a tree as written (Walk).
Package nodeview is the compiler's one reading of a raw YAML tree: a mapping read the way the parser reads it, through aliases and `<<` merge keys, each key and each key written twice settled as the parser's model settles them (docs/parser-library.md#merge-keys, #duplicate-key, #non-scalar-key), and one bounded, iterative walk of a tree as written (Walk).
openapi/internal/oas
Package oas holds the OpenAPI Specification's rules as data, and the engine that checks a source tree against them at the minor it declares.
Package oas holds the OpenAPI Specification's rules as data, and the engine that checks a source tree against them at the minor it declares.
openapi/internal/openapitest
Package openapitest holds the test scaffolding every test package under compilers/openapi would otherwise copy, since test files cannot share unexported helpers.
Package openapitest holds the test scaffolding every test package under compilers/openapi would otherwise copy, since test files cannot share unexported helpers.
openapi/internal/operation
Package operation lowers what a document says an API does: its path items, webhooks and callbacks, the parameters merged onto each operation, and the content of every request body, response and header.
Package operation lowers what a document says an API does: its path items, webhooks and callbacks, the parameters merged onto each operation, and the content of every request body, response and header.
openapi/internal/overlay
Package overlay applies an OpenAPI Overlay document to the parsed node tree, and records which positions in the result the overlay is answerable for.
Package overlay applies an OpenAPI Overlay document to the parsed node tree, and records which positions in the result the overlay is answerable for.
openapi/internal/pagination
Package pagination fills an operation's ir.Pagination: Promote from the extensions a policy maps to the pagination targets (docs/compilers/openapi.md#extension-pagination), and InferWalks, under the pagination-inference policy, from the names its query parameters and its success responses' members give (docs/compilers/openapi.md#pagination-policy).
Package pagination fills an operation's ir.Pagination: Promote from the extensions a policy maps to the pagination targets (docs/compilers/openapi.md#extension-pagination), and InferWalks, under the pagination-inference policy, from the names its query parameters and its success responses' members give (docs/compilers/openapi.md#pagination-policy).
openapi/internal/paramchoice
Package paramchoice reads what the promotion policy maps an operation's key to, the choices among its parameters, once the document is whole (docs/compilers/openapi.md#mutually-exclusive-parameters): each names alternative sets of the operation's parameters by name, resolved as a link's parameters key is.
Package paramchoice reads what the promotion policy maps an operation's key to, the choices among its parameters, once the document is whole (docs/compilers/openapi.md#mutually-exclusive-parameters): each names alternative sets of the operation's parameters by name, resolved as a link's parameters key is.
openapi/internal/provenance
Package provenance places a finding or a lowered position in the input document that supplied it: a pointer through Doc, and a node of a decoded tree through Tree, each a value the package placing asks of directly.
Package provenance places a finding or a lowered position in the input document that supplied it: a pointer through Doc, and a node of a decoded tree through Tree, each a value the package placing asks of directly.
openapi/internal/replacement
Package replacement fills what a deprecation names as its replacement (ir.Deprecation.ReplacedBy): Resolve from the vendor extensions a policy maps to lowering.TargetDeprecationReplacedBy, as every promotion reads the extensions the nodes keep, and Infer, under the replacement policy, from what the deprecation's message names where no such extension is written.
Package replacement fills what a deprecation names as its replacement (ir.Deprecation.ReplacedBy): Resolve from the vendor extensions a policy maps to lowering.TargetDeprecationReplacedBy, as every promotion reads the extensions the nodes keep, and Infer, under the replacement policy, from what the deprecation's message names where no such extension is written.
openapi/internal/resolve
Package resolve answers what a $ref names: the same-document pointer it addresses, the schema declared there and the type interned there, and, for components that are not schemas, the concrete value and declaration site a reference-or-inline entry stands for.
Package resolve answers what a $ref names: the same-document pointer it addresses, the schema declared there and the type interned there, and, for components that are not schemas, the concrete value and declaration site a reference-or-inline entry stands for.
openapi/internal/runtimeexpr
Package runtimeexpr reads the runtime expressions an OpenAPI document writes, as the values of a link and the page walk of an extension do, and finds the members of a body one names, through the reading of the compiled document those steps share (whole.Document).
Package runtimeexpr reads the runtime expressions an OpenAPI document writes, as the values of a link and the page walk of an extension do, and finds the members of a body one names, through the reading of the compiled document those steps share (whole.Document).
openapi/internal/scan
Package scan refuses a source document before any of it is lowered, for shapes the parser library cannot decode: a YAML alias cycle or fan-out, which overflows its stack or exhausts memory (docs/parser-library.md#alias-cycle, docs/parser-library.md#alias-expansion), and nesting so deep that its cost per node, growing with depth, adds up past use (docs/parser-library.md#nesting-cost).
Package scan refuses a source document before any of it is lowered, for shapes the parser library cannot decode: a YAML alias cycle or fan-out, which overflows its stack or exhausts memory (docs/parser-library.md#alias-cycle, docs/parser-library.md#alias-expansion), and nesting so deep that its cost per node, growing with depth, adds up past use (docs/parser-library.md#nesting-cost).
openapi/internal/schema
Package schema lowers OpenAPI schemas into IR types: the shape walk, its compositions, the references between schemas, and the preservation of what the IR has no field for.
Package schema lowers OpenAPI schemas into IR types: the shape walk, its compositions, the references between schemas, and the preservation of what the IR has no field for.
openapi/internal/servers
Package servers lowers the servers a document declares, whichever object declares them, into one registry keyed by ID, and names the ones a scope uses (docs/compilers/openapi.md#servers, docs/compilers/openapi.md#path-item-servers).
Package servers lowers the servers a document declares, whichever object declares them, into one registry keyed by ID, and names the ones a scope uses (docs/compilers/openapi.md#servers, docs/compilers/openapi.md#path-item-servers).
openapi/internal/sourceindex
Package sourceindex answers, in one walk, the questions asked of a decoded source tree before any of it is lowered: how many nodes it declares, how deeply it nests, which aliases name an ancestor, and which mappings carry a tag the parser faults on, as a value the caller carries rather than a walk it repeats.
Package sourceindex answers, in one walk, the questions asked of a decoded source tree before any of it is lowered: how many nodes it declares, how deeply it nests, which aliases name an ancestor, and which mappings carry a tag the parser faults on, as a value the caller carries rather than a walk it repeats.
openapi/internal/spelling
Package spelling relates the primitive kinds OpenAPI spells.
Package spelling relates the primitive kinds OpenAPI spells.
openapi/internal/stream
Package stream reads what the promotion policy maps an operation's or a streaming content's keys to, of the stream an operation's success responses carry, once the document is whole: the frame data that ends it and the request input that asks for it (docs/compilers/openapi.md#streaming-media).
Package stream reads what the promotion policy maps an operation's or a streaming content's keys to, of the stream an operation's success responses carry, once the document is whole: the frame data that ends it and the request input that asks for it (docs/compilers/openapi.md#streaming-media).
openapi/internal/value
Package value classifies YAML scalars and lowers source values into ir.Value, keeping numeric literals as their exact source text so nothing rounds through float64.
Package value classifies YAML scalars and lowers source values into ir.Value, keeping numeric literals as their exact source text so nothing rounds through float64.
openapi/internal/whole
Package whole reads a compiled document once it is whole, for the steps that run after the lowerings: it lists the operations and indexes the members, parameters and headers those steps name (Document).
Package whole reads a compiled document once it is whole, for the steps that run after the lowerings: it lists the operations and indexes the members, parameters and headers those steps name (Document).
openapi/internal/ynode
Package ynode spells yaml.v3 nodes for tests: the constructors for the node kinds a parse produces, the `<<` merge key among them, and the merge chain the compiler's depth bounds are measured against.
Package ynode spells yaml.v3 nodes for tests: the constructors for the node kinds a parse produces, the `<<` merge key among them, and the merge chain the compiler's depth bounds are measured against.
Package engine orchestrates the Morphic pipeline: it asks the registered compilers which of them recognizes the source, dispatches to that one, runs its ordered list of IR passes, and judges whether the run failed.
Package engine orchestrates the Morphic pipeline: it asks the registered compilers which of them recognizes the source, dispatches to that one, runs its ordered list of IR passes, and judges whether the run failed.
cache
Package cache keeps a run's entries between processes: Dir is a directory of them, each named by a Key, held near MaxBytes by removing those unused longest.
Package cache keeps a run's entries between processes: Dir is a directory of them, each named by a Key, held near MaxBytes by removing those unused longest.
internal/atomicfile
Package atomicfile replaces a file's content atomically: the new content is written to a temporary file beside the destination, flushed, and renamed over it, so a reader sees the whole previous content or the whole new one, and a failure, or a cancellation before the rename, leaves the previous content in place.
Package atomicfile replaces a file's content atomically: the new content is written to a temporary file beside the destination, flushed, and renamed over it, so a reader sees the whole previous content or the whole new one, and a failure, or a cancellation before the rename, leaves the previous content in place.
output
Package output writes what a pipeline run produced: the IR document, to a stream or to a file it replaces atomically.
Package output writes what a pipeline run produced: the IR document, to a stream or to a file it replaces atomically.
reader
Package reader reads the documents a compile's references name, for the engine and for any caller that compiles directly.
Package reader reads the documents a compile's references name, for the engine and for any caller that compiles directly.
report
Package report renders what a pipeline run produced: its findings as rated, for a person one per line with what it withheld counted, or for a program as one versioned JSON object, and what it produced at one source coordinate.
Package report renders what a pipeline run produced: its findings as rated, for a person one per line with what it withheld counted, or for a program as one versioned JSON object, and what it produced at one source coordinate.
triage
Package triage rates a run's findings by the rules a caller writes.
Package triage rates a run's findings by the rules a caller writes.
internal
census
Package census counts which facts of the IR compiled documents set: each member of its structs, the emptiness of a member whose empty value differs from its absence, and each value of its enumerations, a sealed sum's tags among them.
Package census counts which facts of the IR compiled documents set: each member of its structs, the emptiness of a member whose empty value differs from its absence, and each value of its enumerations, a sealed sum's tags among them.
ctxtest
Package ctxtest holds the context decorators the tests of cancellation share, so a test anywhere in the module puts a cancel at a chosen check of a context the same way.
Package ctxtest holds the context decorators the tests of cancellation share, so a test anywhere in the module puts a cancel at a chosen check of a context the same way.
decls
Package decls type-checks packages' production sources for tests that hold the source to a hand-written list: of what it declares, such as a sealed sum's kinds, or of the functions that use a name.
Package decls type-checks packages' production sources for tests that hold the source to a hand-written list: of what it declares, such as a sealed sum's kinds, or of the functions that use a name.
exectest
Package exectest builds the commands the tests of the module start as children, so a child of a coverage build never shares a coverage directory with another.
Package exectest builds the commands the tests of the module start as children, so a child of a coverage build never shares a coverage directory with another.
harness
Package harness runs specs through the engine as `morphic compile --verify` does, the default passes included, and applies the bug-catching oracles (Oracles), returning a Result per spec that holds each oracle's Verdict: what it found, or why it declined.
Package harness runs specs through the engine as `morphic compile --verify` does, the default passes included, and applies the bug-catching oracles (Oracles), returning a Result per spec that holds each oracle's Verdict: what it found, or why it declined.
jsonshape
Package jsonshape describes the JSON shape of the types one Go type reaches, as text for the IRVersion pin and as data for the census and the tests that read the IR's types.
Package jsonshape describes the JSON shape of the types one Go type reaches, as text for the IRVersion pin and as data for the census and the tests that read the IR's types.
keydoc
Package keydoc reads the repository's keyed documents: Markdown pages whose entries are third-level headings naming a stable key, each closing with a list of named fields, and the citations other files make of an entry.
Package keydoc reads the repository's keyed documents: Markdown pages whose entries are third-level headings naming a stable key, each closing with a list of named fields, and the citations other files make of an entry.
leakcheck
Package leakcheck fails a test binary whose tests leave a goroutine behind.
Package leakcheck fails a test binary whose tests leave a goroutine behind.
lintrules
Package lintrules holds the lint rules this repository writes for itself: go/analysis analyzers for what no off-the-shelf linter expresses, each about which package may build or spell a part of the IR.
Package lintrules holds the lint rules this repository writes for itself: go/analysis analyzers for what no off-the-shelf linter expresses, each about which package may build or spell a part of the IR.
testspec
Package testspec holds the OpenAPI fixture spec strings that engine, cmd/morphic, cmd/morphic-harness, and internal/harness tests would otherwise each carry as byte-identical copies.
Package testspec holds the OpenAPI fixture spec strings that engine, cmd/morphic, cmd/morphic-harness, and internal/harness tests would otherwise each carry as byte-identical copies.
ir
Package ir defines Morphic's spec-agnostic intermediate representation: the single contract between compilers and emitters.
Package ir defines Morphic's spec-agnostic intermediate representation: the single contract between compilers and emitters.
irfacts
Package irfacts derives what an ir.Document implies and does not state: subtypes, exposed properties, usage, recursion and each entity's name across revisions (docs/ir/derived-facts.md).
Package irfacts derives what an ir.Document implies and does not state: subtypes, exposed properties, usage, recursion and each entity's name across revisions (docs/ir/derived-facts.md).
irtest
Package irtest provides test helpers for IR documents: golden snapshots, fixtures built in one call, filled or nested to a chosen depth, a document's encoding and ID namespaces, diagnostics' codes, and the repository's root.
Package irtest provides test helpers for IR documents: golden snapshots, fixtures built in one call, filled or nested to a chosen depth, a document's encoding and ID namespaces, diagnostics' codes, and the repository's root.
irverify
Package irverify checks a compiled ir.Document against the structural invariants every compiler must uphold: stable IDs, no two nodes claiming one identity, no dangling references, neutral naming, routable Unmodeled entries, in-range provenance, a readable schema stamp, a service and a well-formed source table, and more besides.
Package irverify checks a compiled ir.Document against the structural invariants every compiler must uphold: stable IDs, no two nodes claiming one identity, no dangling references, neutral naming, routable Unmodeled entries, in-range provenance, a readable schema stamp, a service and a well-formed source table, and more besides.
Package pass hosts Morphic's IR-to-IR passes, each a Pass: pure analyses and transforms over an ir.Document.
Package pass hosts Morphic's IR-to-IR passes, each a Pass: pure analyses and transforms over an ir.Document.
Package reuse holds scratch state a check reads one collection after another through, so a collection costs no allocation of its own.
Package reuse holds scratch state a check reads one collection after another through, so a collection costs no allocation of its own.

Jump to

Keyboard shortcuts

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