adventure: read a finished run back and tell Pete what it was about

Two halves of the same gap. A dispatch announcing a clear, a retreat or a death
said how an expedition ended and gave a reader no way to reach what happened in
it — so those three facts now carry the run they concluded, and Pete's permalink
can open the log behind the headline.

Finding that run is done by asking what is actually true at the moment a
dispatch is filed rather than by threading a run id through five call sites that
have already let go of it. Both guards on that lookup are load-bearing: a run
with no beats behind it would mint a link to a 404, and without the recency
window a campaign death at the Empty Throne would attach itself to whatever
dungeon that player last walked.

The other half is the summary. Every line of the liveblog is assembled by Pete
out of a beat's own nouns, which is right for a log — it has to be exactly what
happened, in order. But a report is read afterwards and the question it answers
is not "what happened", it is "what was that run", and that is a judgement. So
this is the one piece of prose on the channel, and it earns the model far better
than a dispatch headline does.

It runs on the roster ticker, not at the moment the run ends. A run ending is
already a chokepoint with a dispatch being authored against it, and a second
generation there would stall the command that killed the boss. One per tick, and
a run that can't be summarised is closed out with an empty beat rather than
retried forever — the row is what stops the sweep picking it up again, and a
report with no summary is still the log and the numbers.

The prompt states the one permitted name twice and forbids arithmetic: a model
asked to write warmly about a party will invent a second member of it, and a
total it works out itself will contradict the exact totals printed beside it.
Both were seen against the real box before this was tightened.

Claude-Session: https://claude.ai/code/session_012bxpQQJDjC1mTtLN3VVtBQ
This commit is contained in:
prosolis
2026-07-24 17:11:21 -07:00
parent a5b1961486
commit 7a5c8341f0
8 changed files with 633 additions and 6 deletions
+14 -1
View File
@@ -48,6 +48,13 @@ type Fact struct {
Milestone string `json:"milestone,omitempty"`
OccurredAt int64 `json:"occurred_at"`
NoPush bool `json:"no_push,omitempty"` // backfill: suppress Pete web-push
// RunID names the expedition this fact is the ENDING of, and only the three
// facts that are one carry it: a clear, a retreat, a death. It is what lets
// Pete's dispatch link back to the run's own report — the log, the numbers,
// the moment it turned — instead of leaving a paragraph about an outcome with
// no way back to what produced it. Empty everywhere else, and safe to be
// empty: Pete renders the dispatch exactly as it did before the report existed.
RunID string `json:"run_id,omitempty"`
// Headline/Lede are LLM-authored prose for this fact, both optional. Pete
// prefers them over its own template when present and past its prose-guard,
// and falls back to the template otherwise — so an empty pair (LLM off, or
@@ -459,7 +466,7 @@ func PushSiege(ctx context.Context, snap SiegeSnapshot) error {
type RunBeat struct {
RunID string `json:"run_id"`
Seq int64 `json:"seq"`
Kind string `json:"kind"` // start|room|combat|trap|treasure|haul|lock|camp|region|end
Kind string `json:"kind"` // start|room|combat|trap|treasure|haul|lock|camp|region|end|summary
OccurredAt int64 `json:"occurred_at"`
Token string `json:"token,omitempty"` // `start` only: whose run this is
@@ -478,6 +485,12 @@ type RunBeat struct {
HPMax int `json:"hp_max,omitempty"`
Crits int `json:"crits,omitempty"`
Fumbles int `json:"fumbles,omitempty"`
// Prose is the single exception to "nouns and numbers only", and it is
// confined to the one kind that has any: `summary`, the three sentences the
// local model writes over a finished run. Pete guards it exactly as it guards
// a dispatch lede and drops the words (not the beat) on a rejection. Every
// other kind must leave this empty — Pete scrubs it if they don't.
Prose string `json:"prose,omitempty"`
}
// PushRunBeats delivers a batch of beats. Unlike the snapshots this is