Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/CHECKLIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ Race-detector execution is intentionally excluded because CGO must remain disabl

## Phased remaining work

- [x] PERF-JSON-V2-250-252: Reuse bounded private JSON-shaped snapshots for Logger correlation and JMESPath, retaining JSON v2 fallback for custom/raw/invalid/deep inputs and float64 conversion, full-input errors and ownership. Reduce Logger root/slice normalization allocations without changing callback keys, cycles, omission or atomic output; decode existing Validation snapshots directly with exact numbers and diagnostic order. Differential, ownership, concurrent-copy and existing module regressions pass. Four packaged modules and four independent consumers pass tests, vet, tidy and isolation with CGO disabled; licenses, scoped JSON API policy and composed static Linux amd64/arm64 Lambda builds pass. Record identical-source local before/after benchmarks in [performance evidence](PERFORMANCE_JSON_V2_250.json). This is scoped local acceptance, not all-module resource budgets or AWS acceptance; no public API, external dependency or release-version change. Internal root requirements pin the snapshot implementation for independent branch consumers. See issues #250, #251 and #252 (2026-10-16).

- [x] AUDIT-VALIDATION-189-LOCAL: Complete the [finite default factory matrix](VALIDATION_PLAN.md#finite-default-boundary-audit-189) with 43 actual public TypeScript/AJV default observations, twelve preserved strictTypes warnings and two original external registration failures. Reuse existing strict/setup/reference/graph/conditional/numeric/regex corpora; verify referenced enum snapshots, private nested diagnostics, channel-fenced once-only format cancellation and strict native JSON operational errors. No production defect was reproduced; typed registration errors and the absence of AJV logger side effects remain deliberate Go contracts. Packaged tests/vet/tidy/isolation and one independent consumer, scoped JSON v2 and documentation/discovery checks pass with CGO disabled. Exhaustive V-05/V-06/V-07, resources and deferred Draft 4/6 work remain separate (2026-10-13).

- [x] AUDIT-JMESPATH-187-LOCAL: Complete the [finite grammar/number/serialization matrix](JMESPATH_PLAN.md#finite-boundary-audit-187) with 73 actual TypeScript observations and strict native input/custom-error checks. Fix numeric string conversion through Commons and replace delegated legacy serialization with JSON v2, retaining deterministic Go key order and typed errors. Also reproduce and fix #225 null multi-select evaluation using existing syntax nodes, preserving non-null false/zero/empty values and skipping null child callbacks. Packaged tests/vet/tidy/isolation and one independent consumer, scoped JSON policy and documentation/discovery checks pass with CGO disabled. Exhaustive J-08 and resource #200 gates remain open (2026-10-13).
Expand Down
96 changes: 59 additions & 37 deletions docs/MODULE_ACCEPTANCE_SCOPED.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,25 @@
"source": "local module proxy fixtures; not published versions",
"completed": true,
"modules": [
{
"path": "github.com/rambow-cloud/powertools-lambda-go",
"directory": ".",
"public": true,
"version": "v1.2.0",
"archive_sha256": "2265b8b026deb458121cd47f3b84e3b44099265c7ceb995fee97e94ef4ac69b0",
"tests": true,
"vet": true,
"tidy": true,
"consumer_build": true,
"external_modules": [],
"binary_bytes": 2613248
},
{
"path": "github.com/rambow-cloud/powertools-lambda-go/jmespath",
"directory": "jmespath",
"public": true,
"version": "v0.1.0",
"archive_sha256": "175484f2b375c7f22875d4e687ea002dc8dbfd3dfe4ab3612a8f716c1b802be0",
"version": "v1.2.0",
"archive_sha256": "787c9fdc193b837e0e1f97a18732156ec10337c46c78a9fc9a2226419c1ccd3f",
"tests": true,
"vet": true,
"tidy": true,
Expand All @@ -26,61 +39,70 @@
"golang.org/x/tools",
"gopkg.in/yaml.v3"
],
"binary_bytes": 3223040
"binary_bytes": 3414528
},
{
"path": "github.com/rambow-cloud/powertools-lambda-go/parser",
"directory": "parser",
"path": "github.com/rambow-cloud/powertools-lambda-go/logger",
"directory": "logger",
"public": true,
"version": "v0.1.0",
"archive_sha256": "750c955357a32433e4163bbefc03f2c1fa339b05490731b463c60c937386945a",
"version": "v1.2.0",
"archive_sha256": "c9d4151d2b2515991680fc953d5df18fad2d01a2c0d98eab48072913b1f6d302",
"tests": true,
"vet": true,
"tidy": true,
"consumer_build": true,
"external_modules": [],
"binary_bytes": 4545024
"external_modules": [
"github.com/aws/aws-lambda-go",
"github.com/cespare/xxhash/v2",
"github.com/davecgh/go-spew",
"github.com/go-logr/logr",
"github.com/go-logr/stdr",
"github.com/google/go-cmp",
"github.com/pmezard/go-difflib",
"github.com/stretchr/testify",
"go.opentelemetry.io/auto/sdk",
"go.opentelemetry.io/otel",
"go.opentelemetry.io/otel/metric",
"go.opentelemetry.io/otel/trace",
"go.yaml.in/yaml/v3",
"gopkg.in/yaml.v3"
],
"binary_bytes": 3955712
},
{
"path": "github.com/rambow-cloud/powertools-lambda-go/parameters",
"directory": "parameters",
"path": "github.com/rambow-cloud/powertools-lambda-go/validation",
"directory": "validation",
"public": true,
"version": "v0.1.0",
"archive_sha256": "3adfda169361b436e67c5ae13e08caf4f3e244be587bb808e387358c959ed13c",
"version": "v1.2.0",
"archive_sha256": "89b42d88162e26625cfa4b37d09f352688740b24148f1433fcd24a757f0b2335",
"tests": true,
"vet": true,
"tidy": true,
"consumer_build": true,
"external_modules": [
"github.com/aws/aws-sdk-go-v2",
"github.com/aws/aws-sdk-go-v2/config",
"github.com/aws/aws-sdk-go-v2/credentials",
"github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue",
"github.com/aws/aws-sdk-go-v2/feature/ec2/imds",
"github.com/aws/aws-sdk-go-v2/internal/configsources",
"github.com/aws/aws-sdk-go-v2/internal/endpoints/v2",
"github.com/aws/aws-sdk-go-v2/internal/v4a",
"github.com/aws/aws-sdk-go-v2/service/appconfigdata",
"github.com/aws/aws-sdk-go-v2/service/dynamodb",
"github.com/aws/aws-sdk-go-v2/service/dynamodbstreams",
"github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding",
"github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery",
"github.com/aws/aws-sdk-go-v2/service/internal/presigned-url",
"github.com/aws/aws-sdk-go-v2/service/secretsmanager",
"github.com/aws/aws-sdk-go-v2/service/signin",
"github.com/aws/aws-sdk-go-v2/service/ssm",
"github.com/aws/aws-sdk-go-v2/service/sso",
"github.com/aws/aws-sdk-go-v2/service/ssooidc",
"github.com/aws/aws-sdk-go-v2/service/sts",
"github.com/aws/smithy-go"
"github.com/davecgh/go-spew",
"github.com/dlclark/regexp2",
"github.com/dlclark/regexp2/v2",
"github.com/google/go-cmp",
"github.com/jmespath-community/go-jmespath",
"github.com/pmezard/go-difflib",
"github.com/santhosh-tekuri/jsonschema/v6",
"github.com/stretchr/testify",
"golang.org/x/exp",
"golang.org/x/mod",
"golang.org/x/sys",
"golang.org/x/text",
"golang.org/x/tools",
"gopkg.in/yaml.v3"
],
"binary_bytes": 3157504
"binary_bytes": 6434816
}
],
"scope": "Selected modules only; this report does not replace full-workspace acceptance",
"selected_directories": [
".",
"jmespath",
"parameters",
"parser"
"logger",
"validation"
]
}
50 changes: 50 additions & 0 deletions docs/PERFORMANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,56 @@ statistical regression budget or predict Linux Lambda latency. CloudWatch/stdout
I/O, CPU quotas, GC under large-event workloads and cold starts require separate
measurements. No AWS benchmark was run for this change.

## JSON v2 snapshot and normalization comparison (#250–#252)

These changes keep JSON v2 and reduce conversions around it. An internal private
copy handles ordinary JSON-shaped inputs for correlation extraction and JMESPath.
Unsupported types, custom marshalers, raw JSON, invalid values, and deep/cyclic
inputs retain the JSON v2 round trip. The copy preserves float64 numbers and
default empty-container behavior; it does not bypass errors in unrelated fields.
Validation decodes an existing serialized snapshot directly with exact-number
options. Logger combines root preparation/normalization without callbacks and
avoids unused array-index strings while preserving the general callback path.

The same new benchmark sources run against `d991b5af2d0e` and the candidate.
Measurements use Go 1.27.1, Windows amd64, `CGO_ENABLED=0`, `GOMAXPROCS=2`, and
one 500ms run per case. Large Logger/correlation/JMESPath cases use 2,048 records
with 512-byte messages. The large Validation case contains a 2 MiB string body;
it is a different workload from the earlier array-event experiments.

| Operation | Before ns/op | After ns/op | Before B/op | After B/op | Before allocs/op | After allocs/op |
| --- | ---: | ---: | ---: | ---: | ---: | ---: |
| Invocation-bound INFO, 404 output bytes | 7,623 | 6,937 | 4,448 | 3,496 | 53 | 48 |
| Large event log, 1,141,832 output bytes | 5,078,787 | 4,314,234 | 3,963,179 | 3,590,002 | 26,406 | 22,569 |
| Large event correlation snapshot | 4,405,535 | 748,599 | 5,933,979 | 868,712 | 30,765 | 8,196 |
| Large event JMESPath lookup | 4,207,010 | 790,587 | 5,963,999 | 868,767 | 30,764 | 8,197 |
| Compiled Validation, small valid input | 5,044 | 4,184 | 2,321 | 2,241 | 55 | 52 |
| Compiled Validation, large string input | 4,763,843 | 2,955,717 | 6,512,209 | 4,484,167 | 39 | 33 |

The identical direct-JSON invocation control retains 47 allocations, 2,773 bytes
and 404 output bytes. Filtered Logger calls retain zero allocations. Full raw
benchmark output and candidate production-source hashes are recorded in
[PERFORMANCE_JSON_V2_250.json](PERFORMANCE_JSON_V2_250.json).

Run the maintained benchmarks from their owning modules with CGO disabled:

```sh
CGO_ENABLED=0 GOMAXPROCS=2 go test -run '^$' -bench 'Benchmark(Logger|CorrelationSnapshot)' -benchmem -benchtime=500ms -count=1 .
CGO_ENABLED=0 GOMAXPROCS=2 go test -run '^$' -bench '^BenchmarkSearchSnapshot$' -benchmem -benchtime=500ms -count=1 .
CGO_ENABLED=0 GOMAXPROCS=2 go test -run '^$' -bench 'BenchmarkValidation(Compiled|LargeSnapshot)' -benchmem -benchtime=500ms -count=1 .
```

For a baseline checkout without the new benchmark files, copy only the matching
`snapshot_benchmark_test.go` from the candidate before measuring. The root
`internal/jsonvalue` benchmark also compares the private copy with a JSON v2
round-trip control in the same binary. These are descriptive local measurements,
not a Lambda performance guarantee or permission to emit oversized cloud logs.
No AWS tests, new codec/parser, external dependencies or release versions are
included. Logger and JMESPath pin the internal root module to commit
`e300c9596f35` because the released root v1.2.0 lacks the new snapshot helper.
The corresponding Go pseudo-version and workspace mapping keep independent
branch consumers buildable without filesystem replacements in module files.

## Measurement boundaries

Construction and schema compilation happen outside the timed operations. Clocks
Expand Down
28 changes: 28 additions & 0 deletions docs/PERFORMANCE_JSON_V2_250.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"base_commit": "d991b5af2d0ef89cce228c8a6b716c9541714a4a",
"go": "go version go1.27.1 windows/amd64",
"os": "windows",
"architecture": "amd64",
"cgo_enabled": false,
"gomaxprocs": 2,
"benchtime": "500ms",
"count": 1,
"production_source_sha256": {
"jmespath/jmespath.go": "7919b52ae746f798704b4e7e18908fd70e6296430e17d860b2f4f7ba29ae1aa7",
"logger/correlation.go": "ee842ce1961216cac82550bbb4dfbb00150ff8e6abadc64ee8d2de7aeda6e2c0",
"logger/encoding.go": "f65c402c0ef32e88e5455eb87c2846a587fd676737839615f319ed5b19cea982",
"validation/compiler.go": "ca602c8b3dcf83c4629c7f0077dc16604dc0e8a26915da1e3c2aed6f192ba75b",
"validation/validation.go": "9ca8109ecb0b7306cdec61bddeed8686f2a34db973fcd9e83d05d9436c597be7",
"internal/jsonvalue/snapshot.go": "c092612d578ae7bb5ecc33983b0dced5ec2935f7a7d2b999fb643bfe91eb5cc5"
},
"results": {
"logger-before": "goos: windows\ngoarch: amd64\npkg: github.com/rambow-cloud/powertools-lambda-go/logger\ncpu: 12th Gen Intel(R) Core(TM) i5-12500H\nBenchmarkLoggerInvocation/DirectJSON-2 \t 103356\t 5708 ns/op\t 404.0 output-B/op\t 2773 B/op\t 47 allocs/op\nBenchmarkLoggerInvocation/BoundINFO-2 \t 81723\t 7623 ns/op\t 404.0 output-B/op\t 4448 B/op\t 53 allocs/op\nBenchmarkLoggerInvocation/BindAndINFO-2 \t 75841\t 7969 ns/op\t 404.0 output-B/op\t 4737 B/op\t 54 allocs/op\nBenchmarkLoggerInvocation/WrappedINFO-2 \t 65239\t 9199 ns/op\t 404.0 output-B/op\t 6409 B/op\t 68 allocs/op\nBenchmarkLoggerInvocation/Filtered-2 \t31797344\t 17.98 ns/op\t 0 output-B/op\t 0 B/op\t 0 allocs/op\nBenchmarkLogger/Emitted-2 \t 102128\t 5927 ns/op\t 208.0 output-B/op\t 2752 B/op\t 34 allocs/op\nBenchmarkLogger/Filtered-2 \t33663799\t 16.94 ns/op\t 0 output-B/op\t 0 B/op\t 0 allocs/op\nBenchmarkLoggerLargeEvent-2 \t 116\t 5078787 ns/op\t 1141832 output-B/op\t 3963179 B/op\t 26406 allocs/op\nBenchmarkCorrelationSnapshot-2 \t 139\t 4405535 ns/op\t 5933979 B/op\t 30765 allocs/op\nPASS\nok \tgithub.com/rambow-cloud/powertools-lambda-go/logger\t6.637s\n",
"logger-after": "goos: windows\ngoarch: amd64\npkg: github.com/rambow-cloud/powertools-lambda-go/logger\ncpu: 12th Gen Intel(R) Core(TM) i5-12500H\nBenchmarkLoggerInvocation/DirectJSON-2 \t 109866\t 5506 ns/op\t 404.0 output-B/op\t 2773 B/op\t 47 allocs/op\nBenchmarkLoggerInvocation/BoundINFO-2 \t 88748\t 6937 ns/op\t 404.0 output-B/op\t 3496 B/op\t 48 allocs/op\nBenchmarkLoggerInvocation/BindAndINFO-2 \t 82346\t 7432 ns/op\t 404.0 output-B/op\t 3784 B/op\t 49 allocs/op\nBenchmarkLoggerInvocation/WrappedINFO-2 \t 73855\t 8732 ns/op\t 404.0 output-B/op\t 5457 B/op\t 63 allocs/op\nBenchmarkLoggerInvocation/Filtered-2 \t31664607\t 17.59 ns/op\t 0 output-B/op\t 0 B/op\t 0 allocs/op\nBenchmarkLogger/Emitted-2 \t 122216\t 4977 ns/op\t 208.0 output-B/op\t 2416 B/op\t 32 allocs/op\nBenchmarkLogger/Filtered-2 \t35763459\t 16.32 ns/op\t 0 output-B/op\t 0 B/op\t 0 allocs/op\nBenchmarkLoggerLargeEvent-2 \t 140\t 4314234 ns/op\t 1141832 output-B/op\t 3590002 B/op\t 22569 allocs/op\nBenchmarkCorrelationSnapshot-2 \t 801\t 748599 ns/op\t 868712 B/op\t 8196 allocs/op\nPASS\nok \tgithub.com/rambow-cloud/powertools-lambda-go/logger\t6.746s\n",
"jmespath-before": "goos: windows\ngoarch: amd64\npkg: github.com/rambow-cloud/powertools-lambda-go/jmespath\ncpu: 12th Gen Intel(R) Core(TM) i5-12500H\nBenchmarkSearchSnapshot-2 \t 140\t 4207010 ns/op\t 5963999 B/op\t 30764 allocs/op\nPASS\nok \tgithub.com/rambow-cloud/powertools-lambda-go/jmespath\t1.113s\n",
"jmespath-after": "goos: windows\ngoarch: amd64\npkg: github.com/rambow-cloud/powertools-lambda-go/jmespath\ncpu: 12th Gen Intel(R) Core(TM) i5-12500H\nBenchmarkSearchSnapshot-2 \t 808\t 790587 ns/op\t 868767 B/op\t 8197 allocs/op\nPASS\nok \tgithub.com/rambow-cloud/powertools-lambda-go/jmespath\t1.236s\n",
"validation-before": "goos: windows\ngoarch: amd64\npkg: github.com/rambow-cloud/powertools-lambda-go/validation\ncpu: 12th Gen Intel(R) Core(TM) i5-12500H\nBenchmarkValidationCompiled/Valid-2 \t 119641\t 5044 ns/op\t 2321 B/op\t 55 allocs/op\nBenchmarkValidationCompiled/Invalid-2 \t 46845\t 12502 ns/op\t 6775 B/op\t 158 allocs/op\nBenchmarkValidationLargeSnapshot-2 \t 126\t 4763843 ns/op\t 6512209 B/op\t 39 allocs/op\nPASS\nok \tgithub.com/rambow-cloud/powertools-lambda-go/validation\t2.912s\n",
"validation-after": "goos: windows\ngoarch: amd64\npkg: github.com/rambow-cloud/powertools-lambda-go/validation\ncpu: 12th Gen Intel(R) Core(TM) i5-12500H\nBenchmarkValidationCompiled/Valid-2 \t 158913\t 4184 ns/op\t 2241 B/op\t 52 allocs/op\nBenchmarkValidationCompiled/Invalid-2 \t 57051\t 11057 ns/op\t 6694 B/op\t 155 allocs/op\nBenchmarkValidationLargeSnapshot-2 \t 196\t 2955717 ns/op\t 4484167 B/op\t 33 allocs/op\nPASS\nok \tgithub.com/rambow-cloud/powertools-lambda-go/validation\t3.091s\n",
"snapshot": "goos: windows\ngoarch: amd64\npkg: github.com/rambow-cloud/powertools-lambda-go/internal/jsonvalue\ncpu: 12th Gen Intel(R) Core(TM) i5-12500H\nBenchmarkSnapshot/JSONv2RoundTrip-2 \t 139\t 4343293 ns/op\t 5455308 B/op\t 30758 allocs/op\nBenchmarkSnapshot/PrivateCopy-2 \t 753\t 763489 ns/op\t 868712 B/op\t 8196 allocs/op\nPASS\nok \tgithub.com/rambow-cloud/powertools-lambda-go/internal/jsonvalue\t1.812s\n"
},
"limitations": "Local single-run descriptive measurements. Identical new benchmark sources in baseline and candidate. Large Logger/correlation/JMESPath fixture has 2048 records with 512-byte messages; Validation fixture has a 2 MiB string body. Counting sinks, no AWS or latency guarantee."
}
2 changes: 1 addition & 1 deletion examples/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ require (
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect
github.com/jmespath-community/go-jmespath v1.1.1 // indirect
github.com/rambow-cloud/powertools-lambda-go v1.2.0 // indirect
github.com/rambow-cloud/powertools-lambda-go v1.2.1-0.20261015225926-e300c9596f35 // indirect
github.com/rambow-cloud/powertools-lambda-go/commons/awssdk v1.2.0 // indirect
github.com/rambow-cloud/powertools-lambda-go/commons/regex v1.2.0 // indirect
github.com/santhosh-tekuri/jsonschema/v6 v6.0.3 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.work
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ use (

replace github.com/rambow-cloud/powertools-lambda-go v1.2.0 => .

replace github.com/rambow-cloud/powertools-lambda-go v1.2.1-0.20261015225926-e300c9596f35 => .

replace github.com/rambow-cloud/powertools-lambda-go/batch v1.2.0 => ./batch

replace github.com/rambow-cloud/powertools-lambda-go/commons/awssdk v1.2.0 => ./commons/awssdk
Expand Down
2 changes: 1 addition & 1 deletion idempotency/cache/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
require (
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/jmespath-community/go-jmespath v1.1.1 // indirect
github.com/rambow-cloud/powertools-lambda-go v1.2.0 // indirect
github.com/rambow-cloud/powertools-lambda-go v1.2.1-0.20261015225926-e300c9596f35 // indirect
github.com/rambow-cloud/powertools-lambda-go/jmespath v1.2.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
golang.org/x/exp v0.0.0-20230314191032-db074128a8ec // indirect
Expand Down
2 changes: 1 addition & 1 deletion idempotency/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/aws/aws-sdk-go-v2 v1.47.0
github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.21.4
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.68.0
github.com/rambow-cloud/powertools-lambda-go v1.2.0
github.com/rambow-cloud/powertools-lambda-go v1.2.1-0.20261015225926-e300c9596f35
github.com/rambow-cloud/powertools-lambda-go/commons/awssdk v1.2.0
github.com/rambow-cloud/powertools-lambda-go/jmespath v1.2.0
)
Expand Down
2 changes: 1 addition & 1 deletion integration/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/kms v1.51.1
github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.44.2
github.com/aws/aws-sdk-go-v2/service/ssm v1.78.0
github.com/rambow-cloud/powertools-lambda-go v1.2.0
github.com/rambow-cloud/powertools-lambda-go v1.2.1-0.20261015225926-e300c9596f35
github.com/rambow-cloud/powertools-lambda-go/batch v1.2.0
github.com/rambow-cloud/powertools-lambda-go/commons/metadata v1.2.0
github.com/rambow-cloud/powertools-lambda-go/commons/regex v1.2.0
Expand Down
Loading
Loading