unicodepin

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

README

Unicode 15 regression guard

unicodepin enforces two separate RFC-265 policies. Test files (_test.go) are excluded from both.

Pinned runtime closure

Every package under fdb.dev/internal/unicode15 rejects:

  • The standard-library unicode import.
  • Any external, non-standard-library import. The snapshot includes its own transform implementation; upstream golang.org/x/text/transform is not needed.
  • strings and bytes casing helpers (lower, upper, title, including Special variants), EqualFold, TrimSpace, Fields, and FieldsSeq.
  • Compiler-release build constraints, including negated and legacy +build forms.

Package facts propagate violations through local fdb.dev runtime dependencies. Missing local facts fail closed. The source census additionally checks imports and build constraints in every pinned runtime Go file, including files excluded by the current compiler or platform. Its inputs must include all nine runtime packages; an empty population fails.

Compatibility-critical callers

A narrower, direct-use policy applies only to these package/file pairs:

  • pkg/recordlayer/{text_tokenizer,text_index_maintainer,collate_function_key_expression,keystore_key_manager,java_parse}.go
  • pkg/recordlayer/query/plan/cascades/values/{values,uuid_parse}.go
  • pkg/relational/core/parser/case_insensitive.go

These files reject unicode, upstream x/text cases, unicode/norm, collate and language imports (including subpackages), plus strings and bytes lower/upper/title helpers (including Special variants), Title, and EqualFold. Type-resolved references detect calls, import aliases, dot imports, and saved function values without rejecting local names that shadow an import.

This policy does not apply the closure's whole-dependency external import ban to legacy caller packages. Other imports, indirect dependencies, TrimSpace, Fields helpers, and build constraints remain outside this narrower policy. In particular, existing caller whitespace behavior is unchanged. Unrelated files in the same package are not directly policed.

Limits

Standard-library import paths are recognized by the absence of a dot in their first component. Standard-library implementations and APIs beyond the explicit helper restrictions are trusted. The source census covers the pinned tree; outside local wrappers are checked through their currently compiled source facts. Compatibility-caller checks likewise inspect compiled source only.

Documentation

Overview

Package unicodepin guards the RFC-265 runtime closure and compatibility-critical callers.

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name:      "unicodepin",
	Doc:       "rejects unpinned Unicode data in the Unicode 15 closure and compatibility-critical callers (RFC-265)",
	Run:       run,
	FactTypes: []analysis.Fact{new(dependencyFact)},
}

Analyzer is the nogo entry point. Facts protect the pinned runtime closure; a narrower direct-use policy also protects its compatibility-critical callers.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL