feat: core v3 - uniform metadata nesting default - #96
Merged
Merged
Conversation
added 24 commits
August 21, 2026 16:41
Use transport.BaseConfig{} directly in TestRunContract_FlattenOptOutIsDistinct
instead of threading transporttest.FactoryOpts{}.Level through an empty
composite literal, and note in testMapMetadataMerged that the default
nesting shape is pinned by that test.
The root module now declares go.loglayer.dev/v3, so the still-v2 sub-modules (whose replace directives point at the repo root) cannot build until the v3 core is published and the sweep PR moves them onto it. CI's foreach-module ops and per-module direct test steps gate behind CORE_ONLY=1 until then; the sweep PR removes the guard and restores the full matrix. Also restores the workspace-trimmed go.work to the full module list: the trim broke the root's own dev builds, and the v3 core needs the workspace to resolve its sub-packages while unpublished.
The migration guides were consolidated into /migrating; the changeset body (which lands verbatim in the release changelog) still linked the old /migrating-to-v3 URL, which is now only a meta-refresh redirect.
The -n1 flag silently disables with -I{} on GNU xargs (n control
falls back to -L 1), a latent shape issue that would bite when the
sweep PR restores the 27-module test list. Drop -n1 and quote the
placeholder; semantics unchanged. Fix a space-indented go.work entry.
The pretty, http, datadog, and betterstack pages document the v2-transport metadata shape (maps merge at root when MetadataFieldName is empty) without the interim-state callout. A v3-core reader would misread the placement as the v3 default. Add the callout; the sweep PR flips the prose itself when each transport moves to v3.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR A of a staged release shipping
go.loglayer.dev/v3with uniform metadata nesting by default.Breaking change:
Config.MetadataFieldNamenow resolves to"metadata"when empty, so map AND struct metadata render uniformly under that key across every transport. Restore the v2 shape withConfig.FlattenMetadata: true(explicit non-emptyMetadataFieldNamealways wins). Core module path movesgo.loglayer.dev/v2→/v3(including sub-packagestransport/,utils/,internal/).Derived from DX feedback in the hmn-cli migration (LOGLAYER.md #7).
What's in this PR
MetadataFieldNamedefault flip +FlattenMetadataopt-out (build()defaulting;Child()propagates;NewMockconsistent)go.loglayer.dev/v3;go.worktrimmed to.(restored in PR B); sub-modules untouched (still v2)FlattenMetadataOptOutcase; new in-core self-test exercising the full contractconfiguration.md/metadata.md/getting-started.mdrewrites, Fatal-exit + New/Build guidance, transport-ID discoverability, whats-new / cheatsheet / llms / index updates, accuracy sweep, interim-transport-state callouts.changeset/swift-metadata.md(go.loglayer.dev: major)Interim state (transports still v2)
The transports keep their
v2paths in this release; code pairing the v3 core with av2transport path does not compile together until the transport v3 bumps land. The code-first docs pages carry explicit::: warningcallouts for this. This is inherent to the staged release: monorel pinsrequireversions at release but does not rewrite.gosource imports, so the transport sweep requires the published v3 core first.Follow-up PR (B): transport v3 sweep
require→go.loglayer.dev/v3README.md: sweep the example, install command, and badges from the v2 paths it still shows (untouched in this PR)go.workVerification
go build ./...,go test -race -count=1 ./...,go vet ./...,staticcheck ./...,gofmt -l— all cleanbun run docs:build— clean-n1 -I{}→-P -I '{}', the-n1silently disabled with-I{}on GNU xargs and would bite the 27-module sweep),go.workwhitespace, migration-guide link in the changeset. Review-verified end-to-end: default resolvesschema="metadata",FlattenMetadata: trueyields"", explicit key wins,Child()inherits; CORE_ONLY gating collapses all ops to the root; the opt-out contract case is pinned. Forward-looking items recorded for PR B:plugins/datadogtrace/livetestre-listing in the test path,go.workhygiene.foreach-module.shfailures are the documented PR-A workspace anomaly (v2 sub-modules run inside the trimmed go.work); the core is fully greenChangelog
The release will publish
go.loglayer.dev/v3.0.0via the changeset. See Migrating to v3.