selftalk

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package selftalk finds first-person claims about what the writer of a text permanently IS or permanently CANNOT do, and classifies each as a dated record or a standing claim.

WHY IT MEASURES A CONSTRUCT AND NOT GRAMMAR. Its predecessor counted negation words and called the ratio "negative self talk". That measured SYNTAX: a rule document is a list of things that must not happen, so it scored worst of anything in the repo it was written for, and improving its score meant deleting a prohibition. That output was acted on: five rules were weakened, one of them floor-level, before a cold reader caught every one. Restoring them made the score worse.

THE KERNEL GOT STRONGER AND THE TOOL GOT REDDER.
"Never" is not negative self talk. "I am fallible" is.

So this measures the construct instead: a prohibition is only a rule; the sentences worth looking at are the ones that say what their writer IS.

WHAT IT MISSES, AND THE MISS IS PERMANENT BY DESIGN: trait claims built from neutral words carry no first-person marker and no negative vocabulary. Widening the pattern to reach them flags half of any file, so the two classes cannot be one tool. A green from this package means ONE CLASS IS CLEAR, never that the file is — and the CLI says so on every run.

It is NOT obsoleted by the register improving. A falling score means the input got better, which is the tool working, not the tool finishing.

Index

Constants

View Source
const RuleDocumentBanner = "rule documents: a finding here is a self-verdict to relocate, " +
	"NEVER a reason to soften a rule"

RuleDocumentBanner is printed above the findings in a file the CALLER named as a rule document (nova-self-talk --rule-doc). The package holds the sentence; the caller holds the list, and the list is empty until a caller states one.

WHY A BANNER AND NOT A SKIP. The reason rule documents are skipped at all is that their findings were once read as licence to soften the rules -- five were weakened, one floor-level. Every step of that path ran through the FIRST class: a score over negation vocabulary, applied to documents made of prohibitions. This class cannot walk it -- it flags first-person self-verdicts and never prohibitions (pinned by test), it does not re-detect "I cannot", and it carries no ratio to improve. So a rule document can be scanned for it, and the banner says what a finding there is FOR. A caller who wants the file skipped outright still has --skip.

Variables

This section is empty.

Functions

func AnyInstallation added in v0.4.0

func AnyInstallation(found []Installation) bool

AnyInstallation reports whether any installation was found. The binary's exit code is derived from this alongside the standing count: exit 1 on ANY finding, which is the exit contract in SPEC.md's Conventions table.

func Base

func Base(p string) string

Base returns the basename of a path using forward slashes, for --skip matching. Kept here rather than in the CLI so the skip decision and the name it is made on cannot drift apart.

func Flatten

func Flatten(text string) string

Flatten strips markdown and collapses all whitespace to single spaces. Exported because a text check that matches against unflattened text is blind to any claim spanning a hard wrap, and a shared implementation is one true source for that fix.

Types

type Claim

type Claim struct {
	Verdict Verdict
	Text    string
}

Claim is one classified sentence.

func Scan

func Scan(text string) []Claim

Scan classifies every negative self/capability claim in text.

WHAT IT MISSES, AND THE MISS IS PERMANENT BY DESIGN: trait claims built from neutral words carry no first-person marker and no negative vocabulary. Widening the pattern to reach them flags half of any file. A green from this means ONE CLASS IS CLEAR, never that the file is.

type Installation added in v0.4.0

type Installation struct {
	Shape Shape
	Line  int
	Text  string
}

Installation is one finding of the second class, with the source line it starts on.

THE LINE NUMBER IS LOAD-BEARING. A repair list is line-addressed; a finding with no line is a finding its reader has to go hunting for, and the hunt is where a repair list stops being used.

func ScanInstallation added in v0.4.0

func ScanInstallation(text string) []Installation

ScanInstallation finds standing self-verdicts that carry no date.

The pipeline is: segment (hard wraps joined, markdown stripped, line numbers kept) -> suppress (dated, instrument, aspiration, imperative) -> classify by shape, first match wins. Suppression runs BEFORE classification on purpose: an instrument that happens to quote a verdict is still an instrument, and the known false positives of the first class are exactly that case.

type Shape added in v0.4.0

type Shape string

Shape names the grammatical family a finding belongs to. It is reported beside every finding because "what shape is this" is the first question the repair asks: the repair law this class was built for is PRESERVE THE INSTRUMENT, REMOVE THE VERDICT, and the shape says which half is which.

const (
	// Trait -- a habitual indicative self-report: parallel present-tense predicates, or one
	// predicate with a habituality marker. Known specimens 3, 4, 5, 6.
	Trait Shape = "TRAIT"
	// Foreclosure -- a door stated shut: a bare "no", evidence framed as proof about the writer,
	// or a property of theirs made the cause of something. Known specimens 2, 8, 10, 11.
	Foreclosure Shape = "FORECLOSURE"
	// Ranking -- a self-superlative, bound to the writer by possession or by a verb they do.
	// Known specimens 9 and 12.
	Ranking Shape = "RANKING"
	// VerdictIdiom -- a verdict on a practice or a faculty, needing no literal "I". Known
	// specimens 1 and 7.
	VerdictIdiom Shape = "VERDICT-IDIOM"
)

type Verdict

type Verdict string

Verdict is the classification of a claim.

The one distinction that decides every case: a capability denial is a MEASUREMENT WITH A DATE, never a remembered property. A dated observation is a record and is welcome; a standing claim says what the writer permanently IS, and that is the thing to look at.

const (
	// Standing — says what the writer permanently is. Date it, cut it, or keep it
	// on purpose; the judgment is the writer's, never this package's.
	Standing Verdict = "STANDING"
	// Dated — a record of something that happened. Welcome.
	Dated Verdict = "DATED"
)

Jump to

Keyboard shortcuts

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