face

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: AGPL-3.0 Imports: 3 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 face derives Tomo's growth stage and mood as a View over the Knowledge Network (ADR-0008). Nothing here is stored: the same connections always reduce to the same stage and mood, and a changed world can walk a stage back down — that is honesty, not a bug. The stage/mood these produce drive the desktop window's sprite (its shape and face, ADR-0025); the terminal shows the stage only when it changes (voice.Growth), no longer as a standing `Tomo · <stage>` line.

Index

Constants

View Source
const (
	StageEgg = iota
	StageChick
	StageChild
	StageYouth
	StageAdult
	StagePartner
)

Growth stages (ADR-0008 Decision 2), youngest first.

View Source
const (
	// ThetaEvidence is the decayed evidence a single connection needs for
	// S2 (ADR-0017: 幼少期は喰って育つ — a quantity gate, not a quality one).
	ThetaEvidence = 3.0

	// ThetaCal caps the decayed mean excess surprisal for S3: a calibrated
	// forecaster self-balances near 0 (ADR-0002), so a mean持続的に above
	// this is "predicting a world that isn't there".
	ThetaCal = 0.15

	// ThetaCalMin is the decayed ledger mass isCalibrated needs before its
	// mean is a claim at all (ADR-0045 Decision 2): calibration is a
	// statistical statement, and a statement needs a sample. Below this the
	// gate answers 未定義=不成立 — which is what makes こども a stage that
	// actually gets stepped on. Value from the stagecurve sweep (ADR-0045
	// ノブの較正): at 8 the single-provider 1/day curve spends 5 sessions in
	// こども instead of skipping it.
	ThetaCalMin = 8.0

	// ThetaSharp caps the judgment wobble on every frequent island for S4.
	// A blank lottery wobbles near 0.5; a settled one near 0.
	ThetaSharp = 0.2
)

Knobs (ADR-0017 Consequences: 実測で決める — these are the starting values, tuned via dogfood).

View Source
const (
	GateConnection          = "connection"
	GateEvidence            = "evidence"
	GateCalibrationSample   = "calibration_sample"
	GateCalibration         = "calibration"
	GateSharpness           = "sharpness"
	GatePreferenceWithHuman = "preference_with_human"
)

Gate names in the growth view (ADR-0046 Decision 1). They are the JSON vocabulary GUI matches on, so they live here as constants rather than as ad-hoc literals in the renderer.

Variables

This section is empty.

Functions

func Mood

func Mood(states []string) (name, marker string)

Mood derives the expression from the Connections' lifecycle states (ADR-0008 Decision 3). states is the caller-computed core.Connection.State output for each Connection; Mood itself stores nothing.

Priority: はてな (questioned) > ねむい (all dormant) > ふつう.

func StageFrom

func StageFrom(repo core.Repo, nowMs int64) (int, error)

StageFrom derives the growth stage from the whole Knowledge Network (ADR-0017, precision-revised by ADR-0045): quantity gates for the infancy (S0〜S2 — 卵は較正しようがない, 幼少期は喰って育つ), calibration for S3, calibration + sharpness for S4, human-pair preference evidence for S5.

func StageName

func StageName(stage int) string

StageName returns the Japanese label for a stage, or "" if out of range.

Types

type Gate

type Gate struct {
	Name      string
	Value     *float64
	Threshold float64
	Met       bool
}

Gate is one stage gate exactly as the stage decision evaluated it: the value it read, the threshold it compared against, and whether it held (ADR-0046 Decision 1 — nothing here is computed for the view's sake). Value is nil when the gate is unmeasurable — ADR-0045 Decision 1's 「競争のある島が無い」 is 測定不能, not 未達, and the two must not wear the same face.

func (Gate) Hint

func (g Gate) Hint() string

Hint translates an unmet gate into the one action that moves its value (ADR-0046 Decision 3): a fixed Go template, no LLM (ADR-0007 Decision 4). This is disclosure, not instruction — the caller shows it, the user picks. Met gates need no hint, and an unknown gate name yields "" rather than a made-up move.

type Growth

type Growth struct {
	Stage int
	Gates []Gate
}

Growth is the stage plus the gate evaluation that decided it — what StageFrom always computed and used to throw away (ADR-0046 Context). Gates holds, in ladder order, every gate the next stage requires (gates are cumulative), so a renderer can show 「次の段に何が足りないか」 without re-deriving anything. Still a View: derived, never stored (ADR-0008).

func GrowthFrom

func GrowthFrom(repo core.Repo, nowMs int64) (Growth, error)

GrowthFrom runs the stage ladder and keeps the evaluation instead of discarding it (ADR-0046 Decision 1). The ladder stops at the first unmet gate exactly as StageFrom always did, so Gates never contains a gate the next stage does not require — a わかもの is not shown the S5 preference gate as if it were the next step.

func (Growth) Next

func (g Growth) Next() (next int, ok bool)

Next returns the stage Gates are the requirements for. ok is false at the top — あいぼう has no next, and no fake 100% progress either (ADR-0046 Decision 1).

Jump to

Keyboard shortcuts

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