router

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package router classifies text blobs so the engine can decide WHO gets squeezed and who must pass through untouched.

Quality contract: only provably-safe kinds are compressed today — machine output (tests, logs). Prose, code and JSON blobs are routed but NOT mutated by the head/tail squeezer: naive truncation of JSON breaks validity, and prose/code carry signal that elision destroys. JSON has its own structural path (tabular lifting), which rewrites rather than truncates.

KindCode is detected by a column-0 opener plus marker density, and the engine returns it untouched before terminal hygiene runs — sanitizing a source file would rewrite bytes the caller is about to compile.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kind

type Kind int

Kind classifies a text blob found inside a message.

const (
	KindUnknown    Kind = iota
	KindProse           // human-written text: never touch
	KindCode            // source code: never touch
	KindJSON            // structured data: never naive-truncate
	KindTestOutput      // go test / pytest / vitest style output
	KindLogOutput       // timestamped/leveled log lines
)

func Classify

func Classify(s string) Kind

Classify returns the kind of content in s using cheap heuristics over sampled windows. Deterministic by construction — same bytes, same kind.

func (Kind) String

func (k Kind) String() string

Jump to

Keyboard shortcuts

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