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 ¶
const ( StageEgg = iota StageChick StageChild StageYouth StageAdult StagePartner )
Growth stages (ADR-0008 Decision 2), youngest first.
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).
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 ¶
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) > ふつう.
Types ¶
type Gate ¶
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 ¶
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 ¶
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 ¶
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.