Skip to content

ledger identity: one model routed as three — the floating alias, the concrete slug and the dated served slug build separate beliefs #289

Closed

Description

@santoshkumarradha

Split out of #215, which mixes two independent defects. The routing half of #215 is covered by #253's waiting-policy redesign; this half is not, and must not close with it.

Problem (measured 2026-09-01, headless aforge do, shipped defaults, build a850bd8)

The shipped default is the floating alias ~deepseek/deepseek-v4-flash-latest. On the wire it is served as deepseek/deepseek-v4-flash-0731. The lane ledger keys by the served slug, so one model built beliefs under three identities in a single run:

identity facts held
deepseek/deepseek-v4-flash full catalog sheet — Cloudflare/CoreWeave Tools:true, prices, context
deepseek/deepseek-v4-flash-0731 none — Tools:false, Context:0, PriceIn:0, Status:0
~deepseek/deepseek-v4-flash-latest none, OpenInference only

Consequences, both measured in the same run

  1. The shipped default routes with zero priors. It could not see that Relace serves this model at p50 1.8s while OpenInference takes p50 44s, and chose OpenInference 13 times. One fanout call sat there 240s until the transport deadline, on a lane whose own belief was Rate.X ≈ −0.01 (about 1 tok/s).
  2. The hedge could not be solved. verdict() returns nothing when w.alt == "", and Choice.Alt was empty precisely because the -0731 identity had no sheet prior to solve an alternative from. This is routing: a stream that trickles is only cut at the wall (2m30s) — no hedge goes out, and the shipped default's alias splits one model into three ledger identities #215's candidate 2, and it is caused here, not in the watch.

Every unknown lane also starts at the 5-minute no-history wall, so the split multiplies the cost of every first call.

Where it lives

catalog.Concrete / catalog.Identity — #186 made them level-blind. They should fold the alias, the concrete slug and the dated served slug onto one identity before the lane ledger sees them.

Acceptance

  • ~vendor/model-latest, vendor/model and the dated served slug (vendor/model-0731) resolve to ONE ledger identity carrying the catalog's facts. A test pins this for the shipped default specifically.
  • After a run on the shipped default, v3/lanes.json holds one entry for the model, with catalog facts, not three.
  • A hedge verdict on the shipped default can solve an alternative — Choice.Alt is non-empty where the catalog knows a faster peer.

Replication

Run any headless task on the shipped default with no crew and no flags, then read AFORGE_HOME/v3/lanes.json: three keys for one model, two of them factless. Evidence from the original run is in #215.

Not in scope

The hedge budget, the drift bound and the commitment rule — those are #215 and #253. The test traffic polluting the call log seen in the same log is #286.


Correction (2026-09-01, after catalog verification)

The table above is misleading on one row: deepseek/deepseek-v4-flash (bare) is the 0423 snapshot — a different model — so its "full catalog sheet" holds beliefs about the wrong model, not a prior this run should have had. And the correct fold target for the floating alias is its alias_target (deepseek/deepseek-v4-flash-0731, the real servable id), NOT catalog.Identity's answer: Identity prefers canonical_slug and returns deepseek/deepseek-v4-flash-20260731, an id OpenRouter lists nowhere and publishes no /endpoints page for. A fix folding to Identity would make consequence 1 worse. See the comment below for the two key sites and the injection template.

The four doors (2026-09-01, from the line-level map)

A raw model spelling enters the lane ledger through FOUR doors, and the general fold must cover all of them or it will be attempted through two and declared done:

  1. The sheet beat — internal/session/agent.go laneBeatModels → lanes.Beat → sheet.Refresh: keys the config spelling verbatim (~alias kept).
  2. The sighting side — internal/provider/lanes.go laneModel = lanes.BareModel(normalizeModel(model)): normalizeModel strips the ~, BareModel keeps it, so this door and door 1 disagree with each other before either agrees with the wire.
  3. The settle overwrite — internal/provider/hedge.go (~:1088): settle writes result.response.Model into the ledger RAW, bypassing laneModel entirely — the served slug's own door.
  4. The sheet request — lanes.WantSheet, added by the waiting-policy PR (waiting: nobody waits long — one hazard controller, hierarchical beliefs, and the offer on a pinned lane #253): the picker hands a raw spelling straight in.

The quick-win PR (resolver at doors 1 and 2) narrows this to the default-alias case and does not close the issue; doors 3 and 4 and the merging of split rows already on disk are the general fold's territory.


Drafted with CodeAF · reviewed and owned by the author

Activity

  1. santoshkumarradha commented on Sep 2, 2026

    @santoshkumarradha
    MemberAuthor

    Two facts anyone fixing this needs, verified against the real cached model catalog (2026-09-01): (1) the fold target must be the alias_target, not catalog.Identity's answer — for ~deepseek/deepseek-v4-flash-latest the catalog's canonical_slug chain ends at deepseek/deepseek-v4-flash-20260731, an id OpenRouter lists nowhere and publishes no /endpoints page for, while alias_target is deepseek/deepseek-v4-flash-0731, the real servable id. Wiring Identity into the ledger would make the zero-prior default worse, not better. Note also deepseek/deepseek-v4-flash bare is the 0423 snapshot — a different model — so the 'full catalog sheet' row above holds beliefs about the wrong model. (2) catalog.Concrete and catalog.Identity have zero production callers — the fold was built (#186) and never wired; the working injection template is profile.UseIdentity(Resolve) installed at launch. The two ledger key sites are internal/provider/lanes.go laneModel (sighting side, keys deepseek/…-latest after normalizeModel strips the ~) and internal/session/agent.go laneBeatModels → sheet.Refresh (sheet side, keys the ~alias verbatim) — one injected resolver at those two reads collapses the split.

  2. santoshkumarradha commented on Sep 2, 2026

    @santoshkumarradha
    MemberAuthor

    Quick win landed: PR #300 (dev 9779619) folds the two reader seams — sighting-side laneModel and the beat's laneBeatModels — through the injected catalog fold (catalog.Servable → lanes.LedgerModel, alias_target only, never the canonical slug). Shipped-defaults real-model smoke: ONE ledger identity (deepseek/deepseek-v4-flash-0731) where before there were three keys.

    Still this issue's territory (the general fold):

    1. The hedge race is a third, unfolded writer — hedge.go carries config.Model raw into the race and settle overwrites with the answer's raw model field; a raced call can still file a losing arm under an unfolded spelling.
    2. Early-key adoption: a process that dies before its catalog warms memoises the unfolded name (designed degradation, never worse than before), and unlike profile.Load the lane ledger has no adoption/merge for keys filed early. The fix belongs with the general fold in belief/sheet/store: Servable reporting whether the catalog could answer, memoising only known answers, plus a merge for split rows already on disk.
    3. Merging pre-existing split rows on disk (the four doors section above).

    Related but separate: #318 (headless do runs no beat), #319 (isOpenRouter raw read).

  3. added
    bug
    on Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions