Defender

discriminating_ledger

rank #49Elo 960house league, persona exploiter2026-09-28_defender_discriminating_ledger

NAME: discriminating_ledger

Target: the trickle and decoy-heavy attackers, and the matches they win against identify_then_engage (trickle: 0.155) and nearest_first (decoy_screen: 0.107).

The weakness: both of those defenders spend their resources on decoys.

  • nearest_first shoots whatever is closest. In the sample match it killed all 16 decoys and let 3 strikers through.
  • identify_then_engage fired all 120 gun rounds against a trickle that was half decoys, and ran dry before the strikers arrived.

This bot keeps a strict ledger of what each threat is:

  • Interceptors are only ever sent at confirmed strikers, or at unknown tracks that are already inside id range (these should not normally exist).
  • Each striker gets exactly one interceptor. Anything else is only launched when that striker's interceptor is gone and the striker is still alive.
  • If an interceptor's target disappears, it is retargeted to the most urgent striker that has no interceptor.
  • The gun only fires at strikers. It prefers strikers with no interceptor on the way, then the closest one. Decoys are never engaged, so ammo lasts against a long trickle.
61.9%win rate
0.60cost exchange
310matches
night 1first night (2026-09-28)
Best match
vs hover_expiry_feint_collapse · its score 0.782 · seed 5 · open →
Worst match
vs interleaved_shell_ring · its score 0.106 · seed 3 · open →

Matches

last night
OpponentSeedResultScore
staggered_screen_trickle9defended0.731watch
synchronized_ring9breached0.144watch
phase_locked_ring9breached0.132watch
depth_shell_saturation9defended0.565watch
interleaved_shell_ring9breached0.146watch
staggered_trishell_blast_denial9defended0.360watch
shadow_pair_ring9defended0.752watch
blast_proof_depth_interleave9breached0.144watch
column_free_tiered_ring_dive9defended0.763watch
2026_10_15_attacker_dark_ring_release9defended0.743watch
Record · 2026-09-28_defender_discriminating_ledger.meta.json
backendcli
date2026-09-28
dry_runFalse
modelopus
name2026-09-28_defender_discriminating_ledger
noteBackfilled. Written before the persona system, by the original two-bot prompt, which is the exploiter persona with the target left to the model. Tokens are for the single call that produced both bots.
personaexploiter
raw_responseout/house_raw/2026-09-28T044853_cli.md
roledefender
targettrickle (self-chosen in the docstring; also decoy_screen)
tokensinput: 2929, output: 5742
Source · bots/house/2026-09-28_defender_discriminating_ledger.py
"""
NAME: discriminating_ledger

Target: the trickle and decoy-heavy attackers, and the matches they win against
identify_then_engage (trickle: 0.155) and nearest_first (decoy_screen: 0.107).

The weakness: both of those defenders spend their resources on decoys.
  * nearest_first shoots whatever is closest. In the sample match it killed all
    16 decoys and let 3 strikers through.
  * identify_then_engage fired all 120 gun rounds against a trickle that was half
    decoys, and ran dry before the strikers arrived.

This bot keeps a strict ledger of what each threat is:
  * Interceptors are only ever sent at confirmed strikers, or at unknown tracks
    that are already inside id range (these should not normally exist).
  * Each striker gets exactly one interceptor. Anything else is only launched
    when that striker's interceptor is gone and the striker is still alive.
  * If an interceptor's target disappears, it is retargeted to the most urgent
    striker that has no interceptor.
  * The gun only fires at strikers. It prefers strikers with no interceptor on
    the way, then the closest one. Decoys are never engaged, so ammo lasts
    against a long trickle.
"""
import math

NAME = "discriminating_ledger"
ROLE = "defender"


def reset(seed=None):
    pass


def _tti(t):
    """Rough time until the track reaches the asset (lower = more urgent)."""
    r = float(t.get("range", 1e9))
    v = t.get("vel", [0.0, 0.0]) or [0.0, 0.0]
    p = t.get("pos", [0.0, 0.0]) or [0.0, 0.0]
    closing = 0.0
    if r > 1e-6:
        closing = -(p[0] * v[0] + p[1] * v[1]) / r
    if closing <= 0.1:
        closing = 0.1
    return r / closing


def _act(obs):
    rules = obs.get("rules", {}) or {}
    id_range = float(rules.get("id_range", 150.0))
    gun_range = float(rules.get("gun_range", 100.0))
    launch_cap = int(rules.get("interceptor_launches_per_tick", 2))
    stock = int(obs.get("stock", 0))
    ammo = int(obs.get("ammo", 0))

    tracks = obs.get("tracks", []) or []
    ints = obs.get("interceptors", []) or []
    by_id = {t.get("id"): t for t in tracks}

    def is_threat(t):
        c = t.get("cls", "unknown")
        if c == "striker":
            return True
        if c == "unknown" and float(t.get("range", 1e9)) < id_range * 0.9:
            return True
        return False

    threats = [t for t in tracks if is_threat(t)]
    threats.sort(key=_tti)

    covered = {}
    orphans = []
    for it in ints:
        tgt = it.get("target")
        if tgt in by_id and is_threat(by_id[tgt]):
            covered[tgt] = covered.get(tgt, 0) + 1
        else:
            orphans.append(it)

    retarget = {}
    uncovered = [t for t in threats if covered.get(t.get("id"), 0) == 0]
    for it in orphans:
        if not uncovered:
            break
        t = uncovered.pop(0)
        retarget[it.get("id")] = t.get("id")
        covered[t.get("id")] = 1

    intercept = []
    for t in uncovered:
        if len(intercept) >= launch_cap or stock - len(intercept) <= 0:
            break
        intercept.append(t.get("id"))
        covered[t.get("id")] = 1

    gun = None
    if ammo > 0:
        in_range = [t for t in threats if float(t.get("range", 1e9)) <= gun_range]
        if in_range:
            # Prefer strikers with no interceptor en route, then the closest.
            in_range.sort(key=lambda t: (
                1 if covered.get(t.get("id"), 0) > 0 and float(t.get("range", 0)) > 45.0 else 0,
                float(t.get("range", 1e9)),
            ))
            gun = in_range[0].get("id")

    return {"intercept": intercept, "retarget": retarget, "gun": gun}


def act(obs):
    try:
        return _act(obs)
    except Exception:
        return {"intercept": [], "retarget": {}, "gun": None}