Releases: apstndb/spannerplan
Releases · apstndb/spannerplan
Release list
v0.2.1
v0.2.1
Documentation and internal dependency housekeeping. No behavior changes; all rendered output and error strings are unchanged.
Added
ECOSYSTEM.md(#50): defines the roles of spannerplan, spannerplan-rs, spannerplanviz, and rendertree-web, the "text in libraries, rasterize at the edge" principle, governance rules (Go-first semantics changes, release-train-pinned parity CI, v0 semver policy), and a compatibility matrix.
Changed
- The input path (
ExtractQueryPlanand friends) now uses the extractedgithub.com/apstndb/protoyamlmodule (#51). Semantics are identical by construction (goccy YAML → protojson withDiscardUnknown); all tests pass with zero golden changes.
Deprecated
- The in-repo
protoyamlpackage is frozen and marked Deprecated (#51). ItsMarshaloutput format was never a designed artifact (an accident of reflection-based encoding). New code should usegithub.com/apstndb/protoyaml, which implements the canonical protojson-over-YAML mapping. The frozen package will be removed in v0.3.0 now that spanner-mycli has migrated (apstndb/spanner-mycli#784).
v0.2.0
Breaking Changes
Newnow returns*ValidationErrorfor plan validation failures, including empty plan input. Existingerrors.Is(err, ErrEmptyPlanNodes)and other category sentinel checks continue to work, and existing error message text is preserved. Code that compared returned errors by direct equality, such aserr == ErrEmptyPlanNodes, should switch toerrors.Is.
New Features
- Added
ErrInvalidPlan, an umbrella sentinel that matches every validation failure returned byNew. - Added
ValidationError, a structured validation error withKind,NodeIndex, andChildIndexfields so callers can inspect invalid plan input without depending on message text. Newnow wraps bothErrInvalidPlanand the specific category sentinel for each validation failure, so callers can choose either broad or specificerrors.Ischecks.- Added executable documentation through
ExampleNew_invalidPlan, showing botherrors.Isanderrors.Asusage.
Compatibility Notes
- Existing validation error strings are intentionally preserved in this release.
- Existing category sentinels still match through
errors.Is. - There are no dependency, CLI, or rendering-output changes in this release.
Validation
go test -v ./...go vet ./...golangci-lint run --timeout=5mgit diff --check v0.1.11..HEAD
v0.1.11
v0.1.11
Patch release after v0.1.10.
Added
- Added intent-based scalar appendix print presets:
basic,enhanced,full, andnone(#45). - Added preset parsing for
rendertree --printandplantree/reference.ParsePrintSections, while preserving comma-separated low-level section names (#45). - Added public
plantree/reference.PrintPreset,ParsePrintPreset,PrintPreset.Sections, andNewPrintSectionshelpers so callers can preserve thenildefault versus explicit-emptyPrintSectionsdistinction (#45). - Added regression coverage for preset parsing, explicit empty/blank appendix suppression, preset/list validation, CLI config behavior, and public reference helpers (#45).
- Added repository-level Gemini Code Assist configuration with
code_review.comment_severity_threshold: HIGH(#46).
Changed
- Updated
rendertree --printhelp and README documentation to describe the new preset values and explicit empty suppression behavior (#45). - Improved repository README navigation with a pkg.go.dev badge and clearer package, command, example, and helper directory overview (#42).
- Reorganized
cmd/rendertreeREADME sections into a clearer hierarchy (#42).
Validation
git diff --check v0.1.10..origin/maingo test ./...mise x -- golangci-lint run --timeout=5m
v0.1.11-alpha.1
v0.1.11-alpha.1
Alpha prerelease for the next patch release after v0.1.10.
Added
- Added intent-based scalar appendix print presets:
basic,enhanced,full, andnone(#45). - Added preset parsing for
rendertree --printandplantree/reference.ParsePrintSections, while preserving comma-separated low-level section names (#45). - Added public
plantree/reference.PrintPreset,ParsePrintPreset,PrintPreset.Sections, andNewPrintSectionshelpers so callers can preserve thenildefault versus explicit-emptyPrintSectionsdistinction (#45). - Added regression coverage for preset parsing, explicit empty/blank appendix suppression, preset/list validation, CLI config behavior, and public reference helpers (#45).
- Added repository-level Gemini Code Assist configuration with
code_review.comment_severity_threshold: HIGH(#46).
Changed
- Updated
rendertree --printhelp and README documentation to describe the new preset values and explicit empty suppression behavior (#45). - Improved repository README navigation with a pkg.go.dev badge and clearer package, command, example, and helper directory overview (#42).
- Reorganized
cmd/rendertreeREADME sections into a clearer hierarchy (#42).
Validation
git diff --check v0.1.10..origin/maingo test ./...mise x -- golangci-lint run --timeout=5m
v0.1.10
Patch release for the rendering-helper and scalar-appendix work merged after v0.1.9.
Added
- Added the public
treerenderpackage for generic ASCII tree rendering.- Provides
Render,RenderTree, andRenderTreeWithOptions. - Provides
DefaultStyleandCompactStyle. - Supports wrapping through
RenderOptions.WrapWidth. - Supports continuation indentation modes including fixed-prefix and anchor-based hanging indentation.
- Exposes
Row.Text,Row.TreePartLines,PrefixMetrics, and related helpers for callers that need stable tree-prefix handling.
- Provides
- Added the public
asciitablepackage for aligned table and appendix rendering.- Provides
RenderTablewith typedTableSpecandColumndefinitions. - Provides
RenderAppendixwith typedAppendixSpecdefinitions. - Supports left, right, and center alignment.
- Preserves multiline table cells without wrapping them unexpectedly.
- Provides
- Added
examples/pgexplainjson, a dependency-free PostgreSQLEXPLAIN (ANALYZE, FORMAT JSON)renderer that demonstrates the generictreerenderandasciitablehelpers.- Supports compact tree output.
- Supports total-width wrapping.
- Generates preorder IDs for PostgreSQL plans, which do not provide stable plan-node IDs.
- Added scalar child-link accessors and documentation in
plantree.RowWithPredicates.TreePartLinesexposes tree prefixes as one line per rendered node-text line.RowWithPredicates.ScalarChildLinkspreserves scalar child links in originalPlanNode.ChildLinksorder.ScalarChildLinkcarries child index, type, variable, description, and the scalar child node.RowWithPredicates.KeysandRowWithPredicates.ChildLinksremain populated as compatibility mirrors.
- Added scalar appendix controls to
cmd/rendertree.--print=predicates,ordering,aggregateselects semantic appendix sections.--print=typedprints all typed scalar links as a raw debug dump.--print=fullprints all scalar links, including unnamed links, as a raw debug dump.--print=""suppresses appendix output.--show-varsshows scalar assignment variable names.--resolve-varsresolves direct scalar variable aliases.--resolve-vars-recursiverecursively expands scalar variable aliases for investigation.
- Added scalar appendix controls to
plantree/reference.- Added
PrintSection,PrintSections,ParsePrintSection, andParsePrintSections. - Added
WithPrintSections,WithShowScalarVars,WithResolveScalarVars, andWithResolveScalarVarsRecursive. - Extended
RenderConfigwithPrintSections,ShowScalarVars,ResolveScalarVars, andResolveScalarVarsRecursive. RenderConfig.PrintSectionsdistinguishes omitted/null config from an explicit empty list, so JSON[]can intentionally suppress appendices.
- Added
- Added the shared internal
internal/scalarappendixpackage used by bothcmd/rendertreeandplantree/reference.- Centralizes scalar appendix parsing, validation, rendering, and scalar variable resolution.
- Keeps public packages as facades rather than exposing internal symbols.
- Added Gemini review style-guide guidance to avoid readability-reducing micro-optimizations and to treat JSON tags as API design choices.
Changed
cmd/rendertreenow reuses the shared scalar appendix implementation instead of carrying its own separate section parsing and rendering logic.plantree/referencenow renders appendices through the shared scalar appendix implementation.asciitableappendix rendering was generalized beyond predicates throughAppendixSpecandRenderAppendix.treerenderis now public instead of only being available under an internal package.- The unreleased predicate-specific
asciitablecompatibility API from the development branch was replaced by the more general appendix API before release. treerenderhanging-indent validation now requiresGetContinuationAnchoronly when wrapping is active.- The golangci-lint GitHub Actions workflow is pinned to a concrete v2 release.
- Local review scratch files are ignored by git.
Fixed
WithHangingIndentandRenderConfig{HangingIndent: true}no longer fail when no wrap width is configured; without wrapping, hanging indent is a no-op.- Empty print-section strings now parse as an explicit empty section list, allowing callers to suppress appendix output.
- Scalar appendix JSON config preserves explicit empty
printSectionsslices while still treating omitted/null as the default predicate appendix.
Merged PRs
- #39:
feat: expose generic render helpers - #40:
feat: add scalar appendix sections - #41:
refactor: share scalar appendix rendering
Validation
go test ./...mise x -- golangci-lint run --timeout=5mgit diff --check v0.1.9..origin/main
v0.1.9
Changes
Added
- Added
QueryPlan.ParentLinks(childIndex)to return every incoming parent child link for a plan node, preserving stable plan traversal order and each parent'sChildLinksorder. - Added
ResolvedParentLink, containing the parentPlanNodeand theChildLinkthat points to the child node. - Added support for treating scalar Full Text Search
Search Predicatechild links as predicates inQueryPlan.IsPredicate, so downstream renderers can surface Full Text Search predicates without custom plan-shape logic. - Added QueryPlan, plantree, and reference renderer tests for simple and compound Full Text Search predicate shapes.
- Added tests covering duplicate incoming links from the same parent, incoming links from multiple parents, empty and out-of-range
ParentLinkslookups, returned-slice isolation, and compatibility with existing single-parent lookup behavior.
Changed
- Preserved existing
GetParentNodeByChildIndexbehavior while adding the all-parent-links API, keeping the existing single-parent map compatible for current callers. - Clarified
QueryPlan.IsVisibledocumentation: it controls operator-tree child-link visibility, hides scalar plan nodes unless the child link type isScalar, and treats nil links as the root node.
Full Changelog
v0.1.8
Changes
Added
- Added plantree/reference.RenderConfig with JSON-friendly wrapWidth and hangingIndent fields for serialized and cross-language callers.
- Added plantree/reference.RenderTreeTableWithConfig(...) as a high-level rendering entrypoint for JSON-like configuration flows, including browser and WASM integrations.
- Added equivalence and validation coverage for the new config-based rendering API in plantree/reference/reference_test.go.
- Added official browser and WebAssembly embedding guidance to the README and plantree/reference package docs.
- Added a minimal examples/wasm/render syscall/js example that decodes Spanner QueryPlan JSON and returns explicit {output} / {error} results for downstream browser-facing integrations.
Changed
- Removed the direct github.com/apstndb/lox dependency from this module by replacing the remaining helpers with github.com/samber/lo, standard-library code, and a local sorted-entry helper.
- Hardened the WASM example to recover from unexpected panics, accept Uint8Array input, reject unknown config fields, and stay buildable under go test ./... on non-js/wasm platforms.
Full Changelog
v0.1.7
What's Changed
Fixed
- Hanging-indent continuation lines now keep a child guide when the wrapped node has descendants, so vertical tree connections remain visible across wrapped lines.
- Added regression coverage in
internal/treerenderandplantreefor the connected child-guide behavior. - Updated hanging-indent renderer tests to use the stable
TrimTrailingSpacewrapping behavior, avoiding expectations that depended on invisible trailing spaces.
Full Changelog
v0.1.6
What's Changed
Added
- Added
plantree.WithHangingIndent()as the preferred public API for enabling hanging indent in wrapped output.
Changed
plantree/referenceandrendertreenow useplantree.WithHangingIndent()as their public hanging-indent integration path.- Deprecated the enum-based public
plantree.WithContinuationIndent(...)/ContinuationIndent*surface while keeping it as a compatibility path. - Added regression coverage to keep the deprecated continuation-indent behavior aligned with
WithHangingIndent().
Full Changelog
v0.1.5
What's Changed
Added
- Added opt-in hanging-indent wrapping in
plantreeviaWithContinuationIndent(ContinuationIndentNodePrefix). (#22) - Added
rendertree --hanging-indentandplantree/referencehanging-indent support via functional options. (#23) - Added repeatable
rendertree --custom-columnflags that accept the same YAML/JSON schema as--custom-file. (#24)
Changed
rendertreenow rejects mixing--customwith--custom-file. (#21)- The delimiter-based
--customsyntax is now deprecated in favor of--custom-columnand--custom-file. (#24) - Added a repository
.gemini/styleguide.mdto bias Gemini reviews toward correctness and CLI behavior over micro-allocation noise. (#24)