Skip to content

P4: scope cleanup — de-scope experimental surface, emit @glyph (Stage 6)#9

Merged
phenomenon0 merged 1 commit into
mainfrom
feat/p4-scope-cleanup
Jun 20, 2026
Merged

P4: scope cleanup — de-scope experimental surface, emit @glyph (Stage 6)#9
phenomenon0 merged 1 commit into
mainfrom
feat/p4-scope-cleanup

Conversation

@phenomenon0

Copy link
Copy Markdown
Contributor

Stage 6 — P4 scope cleanup

Branches off main. Go-only. No public APIs removed — this is comments/docs plus the header-spelling switch (a one-token change with parser back-compat preserved).

Experimental / de-scoped (code kept, marked in comments)

Each carries a "not integrated into the core Parse/Emit path; experimental, may change" note:

  • Decimal128 (decimal128.go) — standalone, no GType, unreferenced by parse.go/emit.go/types.go/token.go. Known rough edges noted as consequences of it not being wired in.
  • EmitV2 / EmitV2Patch (parse_header.go) — emit-only; there is no ParseV2Document, so output can't be round-tripped through a single v2 decoder.
  • EncodeDictFrame (streaming.go) — emit-only; no DecodeDictFrame, no round-trip test. Per the roadmap's "add DecodeDictFrame OR mark experimental", I took the de-scope route.

Deprecated / experimental zero-caller emitters

Confirmed no production callers via grep before annotating:

  • EmitTokenAware (token_aware.go)
  • CanonicalHash (emit.go) — points users to FingerprintLoose (the cross-language-stable SHA-256 fingerprint) instead.

Two supported emitter layers (documentation)

doc.go now documents the collapse to two supported layers — Loose (CanonicalizeLoose, LLM-facing) and Typed (Emit, schema-bound) — and lists the secondary/experimental emitters as not part of that surface. Public APIs are untouched.

Header spelling (maintainer decision)

EmitHeader now emits the full @glyph spelling; ParseHeader still accepts both @glyph and the legacy @lyph. Updated the three emit-output assertions in v2_test.go; parser-input tests that feed @lyph are left as-is (both spellings still parse).

Notes

  • No README/feature-list edits were needed — none of these symbols were ever advertised as features (verified by grep across all READMEs + docs/).
  • Headers are not in the cross-impl/parity gate (only CanonicalizeLoose is), so the spelling change does not affect parity.
  • JS/Py emitters still emit @lyph (both parsers accept both spellings, so interop is unaffected); aligning their emit spelling is a small recommended follow-up outside this Go-scoped branch.

Verification

ulimit -v 6000000; go test -C go ./glyph/ -skip 'Industrial|Cliff|Perf|Savings|Benchmark' -count=1 → green. go/stream tests green. go vet + go build ./... clean.

🤖 Generated with Claude Code

…glyph

Per the P4 roadmap + maintainer decisions. No public APIs removed; this is
documentation/comments plus the header-spelling switch.

Experimental / de-scoped (code kept, marked in comments, "not integrated into
the core Parse/Emit path; experimental, may change"):
- Decimal128 (decimal128.go): standalone, no GType, unreferenced by the codec.
- EmitV2 / EmitV2Patch (parse_header.go): emit-only; no ParseV2Document exists,
  so output cannot be round-tripped.
- EncodeDictFrame (streaming.go): emit-only; no DecodeDictFrame, no round-trip
  test. Per roadmap "add DecodeDictFrame OR mark experimental", chose the
  de-scope route.

Deprecated / experimental zero-caller emitters (confirmed no production callers
via grep before annotating):
- EmitTokenAware (token_aware.go)
- CanonicalHash (emit.go) — points users to FingerprintLoose instead.

Two supported emitter layers documented in doc.go: Loose (CanonicalizeLoose,
LLM-facing) and Typed (Emit, schema-bound). The secondary/experimental emitters
are listed as not part of that surface.

Header spelling (maintainer decision): EmitHeader now emits the full "@glyph"
spelling; ParseHeader still accepts both "@glyph" and legacy "@Lyph". Updated
the three emit-output assertions in v2_test.go accordingly (parser-input tests
that use "@Lyph" are left as-is, since both spellings still parse).

Note: no user-facing README/feature-list edits were needed — none of these
symbols were ever advertised as features (verified by grep across READMEs/docs).

Headers are not in the cross-impl/parity gate (only CanonicalizeLoose is), so
the spelling change does not affect parity. Full Go suite green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@phenomenon0
phenomenon0 force-pushed the feat/p4-scope-cleanup branch from 34a1227 to ec9c148 Compare June 20, 2026 01:52
@phenomenon0
phenomenon0 merged commit 3b686d4 into main Jun 20, 2026
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