engine: tune the default world to a soft program

DefaultConfig now describes a more realistic world: a moderately novel fake
(novelty 0.3), some ambient harm awareness (0.2), and a strong but imperfect
education program (programEffect 0.8) so educated students mostly, not always,
refuse. The headline shifts from 99/70/7 (a perfect program) to 100/83/21 out
of 120 (83/69/18 percent): no program >> random >> most-connected still holds,
targeting still wins by ~4x, but the program is no longer a perfect wall.
Golden values re-pinned in the engine and API tests; the preset base matches.
The forward-chance formula test now neutralises its baseline so it pins the
formula, not the tuned defaults.
This commit is contained in:
Justin Visser 2026-06-18 22:19:44 +02:00
parent 4ac7ba1624
commit c1201caf11
6 changed files with 27 additions and 18 deletions

View file

@ -81,9 +81,9 @@ func TestComparisonEndpointMatchesGoldenValues(t *testing.T) {
// The same golden values the engine tests pin; the API must not // The same golden values the engine tests pin; the API must not
// change them in transit. // change them in transit.
wantReached := map[engine.Strategy]int{ wantReached := map[engine.Strategy]int{
engine.StrategyNone: 99, engine.StrategyNone: 100,
engine.StrategyRandom: 70, engine.StrategyRandom: 83,
engine.StrategyMostConnected: 7, engine.StrategyMostConnected: 21,
} }
if len(comparison.Results) != len(wantReached) { if len(comparison.Results) != len(wantReached) {
t.Fatalf("got %d results, want %d", len(comparison.Results), len(wantReached)) t.Fatalf("got %d results, want %d", len(comparison.Results), len(wantReached))

View file

@ -29,8 +29,8 @@ func TestScenarioEndpointReturnsResultAndTopology(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
if response.Result.NumReached != 7 { // the pinned golden value if response.Result.NumReached != 21 { // the pinned golden value (tuned default world)
t.Errorf("NumReached = %d, want 7", response.Result.NumReached) t.Errorf("NumReached = %d, want 21", response.Result.NumReached)
} }
if response.Config != request.Config { if response.Config != request.Config {
t.Errorf("config not echoed: got %+v", response.Config) t.Errorf("config not echoed: got %+v", response.Config)

View file

@ -7,7 +7,13 @@ import "testing"
// the program scales an educated student) in terms of the weight constants, // the program scales an educated student) in terms of the weight constants,
// so tuning the weights later does not silently break the relationships. // so tuning the weights later does not silently break the relationships.
func TestForwardChance(t *testing.T) { func TestForwardChance(t *testing.T) {
base := DefaultConfig() // ForwardProb 0.38, novelty/harm 0, programEffect 1 // A neutral baseline (the tuned DefaultConfig now carries novelty, harm
// awareness and a soft program); these assertions pin the formula's
// shape, not the default values.
base := DefaultConfig()
base.Novelty = 0
base.HarmAwareness = 0
base.ProgramEffect = 1
t.Run("default not educated is the baseline", func(t *testing.T) { t.Run("default not educated is the baseline", func(t *testing.T) {
if got := base.ForwardChance(false); got != base.ForwardProb { if got := base.ForwardChance(false); got != base.ForwardProb {

View file

@ -50,10 +50,10 @@ func DefaultConfig() Config {
EdgesPerNode: 3, EdgesPerNode: 3,
TriangleProb: 0.45, TriangleProb: 0.45,
ForwardProb: 0.38, ForwardProb: 0.38,
Novelty: 0, // behaviour-neutral until the model is tuned (slice 4) Novelty: 0.3, // a moderately novel/shocking fake
HarmAwareness: 0, // " HarmAwareness: 0.2, // some ambient AI-literacy / harm awareness in the year group
NumEducated: 36, NumEducated: 36,
ProgramEffect: 1.0, // a perfect program: today's hard block, softened in slice 4 ProgramEffect: 0.8, // a strong but imperfect program: educated students mostly, not always, refuse
Origin: 0, Origin: 0,
GraphSeed: 17, GraphSeed: 17,
ThresholdSeed: 2, ThresholdSeed: 2,

View file

@ -23,13 +23,16 @@ func runAllStrategies(t *testing.T) map[Strategy]Result {
} }
func TestRunScenarioGoldenReachValues(t *testing.T) { func TestRunScenarioGoldenReachValues(t *testing.T) {
// Pinned from the first verified run (2026-06-10). The prototype's // Pinned for the tuned default world (2026-06-18): a moderately novel
// figure showed 102/77/10 out of 120 (85%/64%/8%); ours is the same // fake, some ambient harm awareness, and a strong-but-imperfect program
// story with different dice. // (programEffect 0.8), so educated students mostly refuse rather than
// never forwarding. The prototype's figure showed 102/77/10 (85/64/8);
// the story (no program >> random >> most-connected) is the same, the
// dice and the soft program differ.
wantReached := map[Strategy]int{ wantReached := map[Strategy]int{
StrategyNone: 99, // 82% StrategyNone: 100, // 83%
StrategyRandom: 70, // 58% StrategyRandom: 83, // 69%
StrategyMostConnected: 7, // 6% StrategyMostConnected: 21, // 18%
} }
results := runAllStrategies(t) results := runAllStrategies(t)
for strategy, result := range results { for strategy, result := range results {

View file

@ -28,9 +28,9 @@ export const deepfakeSchoolPreset: StudyPreset = {
edgesPerNode: 3, edgesPerNode: 3,
triangleProb: 0.45, triangleProb: 0.45,
forwardProb: 0.38, forwardProb: 0.38,
novelty: 0, novelty: 0.3,
harmAwareness: 0, harmAwareness: 0.2,
programEffect: 1, programEffect: 0.8,
numEducated: 36, numEducated: 36,
origin: 0, origin: 0,
graphSeed: 17, graphSeed: 17,