Skip to content

feat(output): support declarative column formats - #167

Merged
samzong merged 3 commits into
mainfrom
feat/column-formats
Aug 29, 2026
Merged

feat(output): support declarative column formats#167
samzong merged 3 commits into
mainfrom
feat/column-formats

Conversation

@samzong

@samzong samzong commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

What is changed?

  • Add declarative column_formats for currency, fixed-point source scaling, grouping, and fraction bounds.
  • Preserve exact scaled values without floating-point conversion and keep JSON, YAML, and raw output unchanged.
  • Expose column labels and formats through catalog schema 19 and bump the generated runtime schema.
  • Add overlay validation, code generation, runtime formatting, catalog round-trip coverage, and usage documentation.

Why

  • Let downstream generated CLIs produce readable monetary tables entirely through overlays, without application-specific renderers.

Verification

  • make check
  • go test -race ./...
  • go test -race -count=1 ./pkg/runtime ./internal/codegen/render ./internal/overlay
  • Generated and built a Tokener scratch CLI, then verified catalog metadata and live currency table output.

Signed-off-by: samzong <samzong.lu@gmail.com>
@codspeed-hq

codspeed-hq Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will degrade performance by 48.38%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 21 regressed benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
yaml 2.5 ms 5.2 ms -52.25%
BenchmarkBuildFlat 929.1 µs 1,941 µs -52.13%
large 1.2 ms 2.4 ms -49.93%
BenchmarkFindCatalogCommand 4.4 µs 8.7 µs -49.9%
large 804.3 µs 1,602.5 µs -49.81%
BenchmarkCatalogJSON 1.5 ms 3 ms -49.7%
yaml-large 8.1 ms 16 ms -49.29%
small 98.5 µs 194.3 µs -49.28%
miss 1.9 ms 3.7 ms -49.25%
hit 1.9 ms 3.8 ms -49.23%
json-large 1.7 ms 3.3 ms -48.78%
small 73.8 µs 143.7 µs -48.67%
json-small 130.6 µs 253.6 µs -48.52%
BenchmarkFormatTableInferredColumns 483 µs 938.1 µs -48.51%
BenchmarkParseNormalize 3.2 ms 6.2 ms -48.28%
table 382.5 µs 730.1 µs -47.61%
small 67.2 µs 127.8 µs -47.41%
json 693.7 µs 1,287.3 µs -46.11%
large 692.5 µs 1,279.7 µs -45.88%
small 55.2 µs 99.8 µs -44.71%
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing feat/column-formats (dbf2a69) with main (8ab1b86)

Open in CodSpeed

Signed-off-by: samzong <samzong.lu@gmail.com>
## Considered and deferred

- pkg/runtime/paginate.go:66 [DEFERRED]: setBodyParam still round-trips body-cursor request bodies through float64; pre-existing surface outside the reviewed findings.

Signed-off-by: samzong <samzong.lu@gmail.com>
@samzong
samzong merged commit 9d4892b into main Aug 29, 2026
4 of 5 checks passed
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.

1 participant