Commit graph

30 commits

Author SHA1 Message Date
4be6e020ea AM-4: gate scenario YAML, retarget on audited source, re-measure
Some checks failed
ci / check (push) Failing after 3s
Adopts both remediations from CB-EV-0001 §4 (maintainer decision).

Option A — serde_yaml is now optional behind cb-game-runtime's
`scenarios` feature. The scenario module, the ScenarioGame impl and the
string parsers behind it are cfg-gated; cb-sim opts in explicitly. Both
configurations compile and lint clean under -D warnings.

A trap worth recording: `default-features = false` on a *member*
dependency is silently ignored when the workspace dependency does not
specify it. The first attempt gated nothing while looking correct — the
build succeeded and cargo tree still showed all six YAML crates. Fixed
by setting it on the workspace dependency. This is the positive-control
failure mode in miniature: success was not evidence the change applied.

Retarget — AM-4 now measures third-party source under audit, split by
build configuration, replacing a crate count that was unreachable
without undoing K5/K7 and that does not compare across ecosystems.

Re-measured via the new `make dep-weight`, whose own positive control
refuses to report when any crate's source cannot be located:

  shipped runtime   23 crates   246,250 lines   target <=250,000  met
  dev toolchain     29 crates   317,021 lines   target <=350,000  met
  own source                      3,408 lines

Scenario tooling costs 70,771 lines a shipped game never compiles —
the split the single number was hiding.

Targets are set at current measurement plus headroom, so they bind on
future growth rather than retroactively passing what had failed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 03:35:41 +02:00
8e11fc412e Amend CB-EV-0001; add CB-WP-0002 for cost accounting
Some checks failed
ci / check (push) Failing after 4s
AM-4: measured what each remediation option actually buys, rather than
leaving one recommendation unquantified. serde_yaml optional removes 6
crates, not 5 — ryu belongs to that group, since serde_json now uses
zmij for floats. Full ladder: -6 to 27, serde_json -4 more to 23,
inlining SHA-256 -8 to 19, inlining ChaCha12 -4 to 15. Only
reimplementing a primitive gets under 20, so the target is unreachable
without undoing K5/K7.

Also records that crate count compares badly across ecosystems, and
offers the alternative the count is a proxy for: 307,317 lines of
third-party source under audit against 3,398 of our own.

AM-12: corrected from "uncomputable" to measured. The refusal to
estimate was right; the claim that no instrument existed was wrong.
Session transcripts carry exact per-message usage including the cache
breakdown. This session cost $248.46 at Fable 5 rates, of which 53% is
cache reads — cost is driven by context size times turn count, not by
output volume. What is still missing is per-task attribution, since
nothing marks task boundaries in a transcript.

CB-WP-0002 makes cost measurable and attributable: survey the
instruments, decide the attribution model by ADR, spec metrics that
include cost composition rather than a bare total, build a collector
whose positive control refuses to emit unreconciled numbers, and prove
it by answering a question that could not be answered before.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 03:26:03 +02:00
custodian-sync
5ea1497e47 chore(consistency): sync task status from DB [auto]
Some checks failed
ci / check (push) Failing after 3s
Updated by fix-consistency on 2026-07-31:
  - update .custodian-brief.md for clay-borg
2026-07-31 03:11:56 +02:00
63dcffd9f1 T09: InnerLoop v1.0 — corrected from the first full pass
Some checks failed
ci / check (push) Has been cancelled
The loop has now survived CB-WP-0001 end to end and is revised from what
that pass actually taught, recorded in
history/260731-inner-loop-retrospective.md.

Held up: the adversarial review (one blocking and three significant
findings on its single use, resolved with new measurements rather than
argument), the parity-cap rule, the provisional U-item mechanism, and
the ADR gate.

The gap: both serious errors in the pass were measurement errors, and
the loop caught neither. Review reads prose; these were claims about
numbers. In both cases a harness ran successfully while doing no work —
a JS harness timing rejected no-ops, and a Rust benchmark computing
throughput for rounds that never completed.

v1.0 adds:
- Measurement validity: a harness must assert it performed the work it
  reports. A number from a run that cannot prove it did the work is void.
- Metric feasibility: every metric names its instrument and is checked
  reachable against the contracts in its own spec.
- No silently-ignored input; decisions get commands, not defaults;
  scaffolds are exercised or marked; coverage gates that count tags say
  so.
- Evidence must state what a comparison does not support.
- The chaos roll is recorded even when it changes nothing, so a
  mechanism that never fires is visible rather than assumed.

CB-WP-0001 is complete: 9/9 tasks done.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 03:11:19 +02:00
eb1378e667 T08 complete: benchmarks, determinism evidence, and one missed metric
evidence/CB-EV-0001-game-kernel.md records the acceptance run against
the CB-RES-0001 baseline.

Met: AM-1 rule coverage 58/58; AM-6 throughput 1.65M events/s against a
100k target; AM-7 scaling 1.08x at 20x workload and a 100k-event replay
in 4.13ms against a 5s budget; AM-8 zero divergence over 10 full runs
with fmt and clippy clean; AM-10 zero foreign collection types.

Not met and reported as such: AM-4 at 33 transitive crates against a
<=20 target. Attribution is in the evidence file. The recommended fix
is making serde_yaml optional (-5, a test-only concern), after which
the remainder is sha2 and rand_chacha, which K5 and K7 require. We are
not hand-rolling crypto primitives to win a dependency count.

AM-12 is recorded as uncomputable: per-task token counts were never
instrumented, and inventing a USD figure would defeat the metric.

A measurement error was found and corrected before publication. The
first benchmark reported 9.3M events/s on a flat curve. The workload
had a player selecting SUPPORT while parked at Stress 4, so GR-R03
rejected it, rounds never completed, and throughput was computed for
rounds that never happened. The bench now asserts the per-round event
count and panics rather than measuring a stalled loop. The corrected
figure is 5.6x lower.

The evidence file states plainly what the boardgame.io comparison does
and does not support: the ~450x command-rate ratio is cross-runtime and
cross-feature-set, so it is a direction, not a verdict, per the
InnerLoop parity-cap rule.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 03:09:14 +02:00
85d93a9e3c T08 iter 6: game end and the three scoring modes; AM-1 at 100%
- GR-R09: after Round 5's End the game ends and scoring runs instead of
  the round advancing.
- GR-E01: claimed Problems sum their printed values against the
  player-count threshold (2p 5, 3-4p 7, 5-6p 9 in dataset 0.1).
- GR-E02 SHARED GROUND: shared score, Mastery reduced per Blame token
  and per Denied Problem.
- GR-E03 COMMON PROBLEM: personal score is claimed value less Blame,
  tiebroken by lower Stress then more Bonds.
- GR-E04 BONDED COALITIONS: connected components over Bonds only, so
  Rivalries do not connect and an unbonded player is a coalition of
  one; tiebroken by lower combined Stress then fewer Blame.

Ties yield every tied candidate rather than an arbitrary pick, which is
what "shared victory" in GR-E03/E04 asks for.

AM-1 rule coverage is now 58/58 (100%), 21 scenarios, 17 tests.

Caveat recorded rather than papered over: GR-E02's "successes" is not
defined in dataset 0.1. It is implemented as the count of claimed
Problems and both scoring scenarios are marked provisional, so a
ground-game ruling flips a scenario rather than the kernel.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 02:33:27 +02:00
0e92535f11 T08 iter 5: the DARVO sequence machine
Resolution step 3 (GR-R06), the last unimplemented step:

- GR-D02 binding: one stage per consecutive round, DENY then ATTACK
  then REVERSE, regardless of the player's later Stress.
- GR-D03 DENY: turn one face-up, unsolved, unprotected Problem face
  down and Deny it. Under the U3 default no legal target is a no-op and
  the sequence still advances.
- GR-D04 ATTACK: one extra Attack under the normal relation rules, then
  place the Focus token beside the target even if it was cancelled.
- GR-D05 REVERSE: flip Focus to Blame, +1 Stress to the holder, one
  Protection to the owner, unless the holder's GROUND-ND rejects it.
  Under the U5 default the owner takes -2 either way and the sequence
  ends.
- GR-D06 early end: a Support through a Bond that predates this round's
  Support step cancels the stage and ends the sequence, and the placed
  Focus token is removed. GROUND-GR ends it after the stage resolves.
- GR-D07: the marker returns to OFF, so a later End can re-trigger.

The Attack rules are now one routine shared by the chosen ATTACK Action
and the DARVO extra Attack, so GR-A06..A09 cannot drift between them.

Stage targets are named by their own command during Reveal, validated
against what the stage admits: DENY needs an eligible Problem, ATTACK
another player, and only a player with a live sequence may choose.

18 scenarios pass; AM-1 coverage 47/58 (81%), up from 41/58.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 02:30:58 +02:00
290ad06c31 T08 iter 4: GROUND-OU/ND choices and Support consent
Closes the three rules deferred in iter 2 and 3 because each needed a
decision from a player rather than a default I would have invented:

- GR-A11 GROUND-OU: restore a Denied Problem, protect a face-up one
  from Deny, or cancel an Attack aimed at the chooser.
- GR-A12 GROUND-ND: remove a Blame token, break a relation involving
  the chooser, or reject a Reverse.
- GR-L02 / GR-A05: the Support target answers after Reveal — accept or
  decline a Bond where no relation exists, flip or break an existing
  Rivalry. A Bond can no longer form without consent.

Each choice is validated against the state it claims to act on: a
restore needs a Denied Problem, a cancel needs an Attack actually aimed
at the chooser, a Blame removal needs that token present, a break needs
that relation to exist. GR takes no sub-choice, and OU and ND may only
use choices from their own list.

GR-A09 ordering follows the U8 default: an OU cancellation is chosen at
step 1 and applies first, so a Protection token is spent only when it
is what actually cancels.

14 scenarios pass; AM-1 coverage 41/58 (70%), up from 34/58.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 02:27:25 +02:00
27016af216 Add the AM-1 rule-coverage gate
make coverage compares the GR-rule IDs defined in specs/GroundRules.md
against the covers: lists in scenarios/ground/*.yaml. It exits 1 if a
scenario claims a rule the spec does not define, so coverage cannot be
inflated by an invented ID, and exits 2 while rules remain uncovered.

Current reading: 34/58 (58%). AM-1 requires 100%.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 02:23:38 +02:00
27b7fe4329 T08 iter 3: GROUND modes, INVESTIGATE, SOLVE
Fills in resolution steps 1, 4 and 6 (GR-R06):

- GR-R05 mode choice: a player who revealed GROUND picks GR/OU/ND after
  Reveal. Resolution refuses to start while any revealed GROUND lacks a
  mode, and only that player may choose it.
- GR-A10 GROUND-GR: self -2 Stress and Freedom readied.
- GR-A01 INVESTIGATE: reveal the chosen hidden non-Denied Problem, then
  draw one Solution; the draw still happens when nothing is revealable.
- GR-A02 SOLVE: spend a Solution of the Problem's suit and claim it; a
  later resolver the same round spends nothing, per Lead order.
- GR-A13 tightened: INVESTIGATE must target a hidden Problem, SOLVE a
  face-up non-Denied one. Previously any existing Problem was accepted.

Deck exhaustion (U4) reshuffles the discard, seeded from the game seed
and round so validate stays a pure function of state. The resulting
order travels inside DeckReshuffled, so replay never re-derives it.

Still pending, each because it needs its own decision command rather
than a default: GROUND-OU and GROUND-ND three-way choices (GR-A11/A12)
and the DARVO stage machine (GR-D02..D07). No scenario claims coverage
of them.

Filler picks in existing scenarios moved from GROUND to INVESTIGATE:
GROUND now has a real Stress effect, which was polluting the Support
and Attack assertions.

11 scenarios pass, 34 rules covered; 17 tests, fmt/clippy green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 02:23:09 +02:00
b58a9139aa T08 iter 2: Reveal, Resolve, End; relations and the DARVO trigger
Round machinery, system-driven (GR-R04/R06/R08):

- GR-R06 fixed step order with GR-R07 Lead-first ordering inside a step.
  Steps 1 (GROUND), 3 (DARVO stages), 4 (INVESTIGATE) and 6 (SOLVE) are
  not implemented yet; their Actions resolve as no-ops and no scenario
  claims coverage of them.
- SUPPORT GR-A03/A04/A05 and ATTACK GR-A06..A09, with relation
  formation, flip and break per GR-L01/L03/L04 and Protection
  cancellation.
- GR-R08 End: DARVO trigger at Stress 5 in Lead order, Lead rotation,
  Round advance, per-round flags cleared.
- Stress clamps 0-5 on every application, the U2 default, so a mid-round
  spike that is reduced before End does not trigger DARVO.

Two consent-dependent rules are deliberately left out because they need
a decision command rather than a default: Bond formation (GR-L02) and
the target's flip-or-break choice on Support-through-Rivalry (GR-A05).
Both are noted in code and covered by a provisional scenario.

Fixes a defect in the T07 scaffold: relations were keyed by a tuple,
which JSON cannot use as an object key, so state_hash would have
panicked on any state holding a relation. Relation keys are now a Pair
newtype serialized as "a-b", with a regression test.

setup.patch may now create a final key so scenarios can seed open-ended
maps; a typo anywhere earlier in the path is still an error.

8 scenarios pass, 28 rules covered; 17 tests, fmt/clippy green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 02:19:34 +02:00
a09d76f370 T08 iter 1: scenario runner executes; GROUND setup and Select step
Replaces the RunOutcome::Unimplemented stub with a real runner:

- ScenarioGame trait: games own setup presets and the command
  vocabulary, the runner owns execution, assertions, and determinism.
- K8 double-run: every scenario runs twice on the same seed and fails
  on state-hash divergence.
- K4/K11: applied events go through Envelope into EventLog, so seq
  monotonicity is enforced on the real path, not just in unit tests.
- setup.patch was parsed and silently dropped; the runner now applies
  it generically and errors on a path that does not exist, so a typo
  in a scenario can never pass as a no-op.
- Assertions: dot-path state lookup over objects and arrays, ordered
  event subsequence matching by field subset, exact rejects-set match.

GROUND rules realized: GR-S01..S04 setup (seeded shuffle, deal, Lead,
Surface Problem face up), GR-R02 Select commit, GR-R03 stress gate and
Freedom spend, GR-A13 targeting legality.

cb-sim dispatches by the scenario's game prefix and reports rule
coverage. 3 scenarios pass, 7 rules covered; fmt/clippy/tests green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 02:14:34 +02:00
be52250850 chore: mark T07 done
Some checks failed
ci / check (push) Failing after 26s
2026-07-31 01:57:30 +02:00
467e2c561d T07: Cargo workspace scaffold — cb-kernel/cb-events/cb-game-runtime/games-ground/cb-sim, HashMap deny-lint, scenario format + runner stub, Criterion skeleton, Makefile, CI
Some checks failed
ci / check (push) Has been cancelled
2026-07-31 01:57:13 +02:00
396990539a T06: kernel spec — crate boundaries, event-sourced pipeline, determinism contract, 12 acceptance metrics tied to CB-RES-0001 2026-07-31 01:43:31 +02:00
dd262169bf T05: GROUND rules spec derived from GROUND-DARVO-CORE-0.1 (numbered rules, 10 flagged underdeterminations) 2026-07-31 01:33:54 +02:00
53c1b18ec1 T04: adversarial review round + survey corrections + ADR-0002 (reimplement, assimilate patterns) 2026-07-31 01:25:02 +02:00
a7e31d4210 T03: game-kernel SOTA survey with measured boardgame.io baseline harness 2026-07-31 01:11:04 +02:00
38ffd8b7fd Add M-D2-CST token-cost metric with committed model price sheet 2026-07-31 00:53:22 +02:00
1218ee024e chore(consistency): refresh WORK-RECORDS.md 2026-07-31 00:48:22 +02:00
custodian-sync
d0640f19ca chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-07-31:
  - update .custodian-brief.md for clay-borg
2026-07-31 00:48:17 +02:00
1e414d1c99 InnerLoop v0.2: loop tiers with chaos roll, adversarial survey review, runnable-baseline option 2026-07-31 00:48:04 +02:00
5d1c1bc866 Phase A: codify inner loop (specs/InnerLoop.md) and metrics/scenario conventions 2026-07-31 00:31:14 +02:00
52b006580b Adopt TRSL V1C1 license; link ground-game and target-revenue sister repos 2026-07-31 00:25:30 +02:00
70f02ec09c chore(consistency): record state-hub IDs for CB-WP-0001; add WORK-RECORDS.md 2026-07-31 00:13:55 +02:00
custodian-sync
10ba7bc76f chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-07-31:
  - update .custodian-brief.md for clay-borg
2026-07-31 00:13:42 +02:00
60c0029e2b Add CB-WP-0001: establish assimilate-and-surpass inner loop via GROUND kernel 2026-07-31 00:13:10 +02:00
f9cfa7025c Add specs/ArchitectureBlueprint.md reference architecture 2026-07-31 00:02:35 +02:00
705496a677 Add INTENT.md and archive initial exploration notes
Distills the architectural exploration into a top-level intent doc
per the repo's own proposed structure.
2026-07-30 23:55:43 +02:00
8b66604235 Initial commit 2026-07-30 21:18:53 +00:00