Repository navigation
Commit 7612e4c
authored
fix(routing): source capability evidence from explicit catalog provenance (#1799)
* docs(devlog): plan the local-model capability evidence and plugin routing unit
* docs(devlog): fold audit round 1 blockers into the capability provenance design
* docs(devlog): fold audit round 2 precision fixes into the phase docs
* docs(devlog): make the remote exact-head verifier self-contained
* docs(devlog): fold audit round 4 blockers and link issues #1796/#1797
* docs(devlog): fold audit round 5 blockers (fail-closed remote steps, antigravity tri-state)
* docs(devlog): make each remote verifier step self-contained; widen phase 1 scope
* docs(devlog): record the six-round audit ledger and verdict-capture caveat
* docs(devlog): capture jawcode generated metadata in provenance (round 7)
* docs(devlog): own the lookup extraction, add the context-cap regression
* docs(devlog): record rounds 7-8 and the writer-vs-producer lesson
* fix(routing): source capability evidence from explicit catalog provenance (#1796)
candidateCapabilityEvidence() read the cached Codex catalog through a filter
expecting `id`/`provider`/`contextWindow`/`inputModalities`, while the catalog
writer emits `slug`/`context_window`/`input_modalities`. Every row was
discarded -- 17 of 17 on a live install -- so the catalog branch of the evidence
chain was dead code. It stayed invisible because the catalog is the fourth
fallback: any provider declaring inline capability maps is answered earlier.
A model registered through `ocx models add` has no such maps, so it routed as
image-blind and context-unknown.
Reading the written fields directly would have been wrong. ensureStrictCatalogFields
synthesizes `input_modalities: ["text"]` and `context_window: 128000` so Codex's
strict parser accepts the file, so their presence cannot distinguish an assertion
from a placeholder, and reading them would turn unknown into a confident
`image: false` -- the opposite of this module's "unknown is not zero" contract.
Instead applyCatalogModelMetadata now stamps `opencodex_capability_provenance`
carrying only values a real source asserted, plus exact provider/model_id, and
capability.ts reads that block and nothing else. Two real sources exist and both
are consulted: the CatalogModel and the generated jawcode metadata table, whose
lookup is now exported from parsing.ts so the two callers cannot drift. The
generated context is capped the same way applyCatalogMetadata caps it.
Three secondary defects fixed along the way:
- The adapter tool fallback was gated on `catalogRow === undefined`, which was
only safe while the lookup never matched. Repairing the lookup would have
silently revoked `tools: true` for every openai-chat and anthropic candidate.
- Synthesized combo rows (a generic 128k/text fallback) are excluded from the
stamp; their values are placeholders, not assertions.
- parseAntigravityAvailableModels collapsed an absent `supportsImages` into
`["text"]`, making "nobody said" indistinguishable from "the provider said no".
The tri-state is restored; the strict catalog still gets its default downstream.
Evidence: the new test fails 5/10 without the fix and passes 10/10 with it.
End to end, with the lidge provider's inline maps removed so the catalog is the
only source, evidence goes from `{tools:true}` to
`{contextWindow:262144, image:true, tools:true}`.
Plan and eight-round audit: devlog/_plan/260816_local_model_capability_and_plugin_routing/
* fix(catalog): read llama.cpp served context from meta.n_ctx (#1797)
A llama.cpp server reports its context under `meta.n_ctx` (what the server was
started with) and `meta.n_ctx_train` (the model's trained maximum). Neither was
in the recognized context list, so a correct local server produced no context
evidence at all.
Both are appended LAST in the precedence chain, so any provider already
supplying a recognized field keeps its current behavior. `n_ctx` is preferred
over `n_ctx_train` because routing must not promise a window the running server
will refuse.
The image half of #1797 is deliberately NOT fixed here. The `multimodal` token
lives in the Ollama-style `models[]` array while extractProviderModelItems reads
only `data[]` envelopes, and its comment is explicit that a stray `models` key
must not be trusted. Even a hand-merged item would stay image-unknown, because
`multimodal` is not among the recognized capability strings. Both halves need an
identity-safe join and a capability mapping, which is its own audited change.
The fourth test characterizes that gap so the follow-up has a live witness.
Verified: tests 1, 2 and 4 fail without this change and pass with it; test 3
passes either way and guards the precedence ordering.
* docs(devlog): record the implementation, verification evidence, and CI baseline
* docs: address CodeRabbit review findings on #1799
Five threads, all accepted:
- Move the browser/Computer Use plugin routing guidance out of the untracked
host file and into the tracked AGENTS_INSTALL.md. Listing ~/.codex/AGENTS.md
as shipped was wrong: it is not in the PR and cannot be reproduced from a
clone. The host copy is now recorded as host-only verification.
- Mark the first provenance snippet in 010 as superseded and add one
authoritative "Final stamp algorithm" section carrying the combo guard, the
generated-metadata fallback, and the context cap, verbatim from effort.ts.
Three separate audit rounds amended that snippet; leaving the original inline
invited implementing from the wrong one.
- Correct the 004 ledger scope from six rounds to eight, matching the rounds it
actually records.
- Renumber the 020 accept criteria, which restarted at 2 and repeated 3.
- Add console language tags to the two transcript fences (MD040).
* docs: address the second CodeRabbit round on #1799
- Criterion 5 in 020 claimed the full suite was green. It was not: the recorded
run has seven GUI dependency failures. Restated to the honest bar - the
targeted suites pass, the full run carries only documented environment
failures, and no failure is attributable to this change.
- 030 still selected ~/.codex/AGENTS.md as the placement and verified it there,
contradicting the correction already recorded in 040. Marked the placement
superseded and pointed every row at the tracked AGENTS_INSTALL.md.
- Backticked the bare PR references in the triage doc (MD018).1 parent e1769b5 commit 7612e4c
18 files changed
Lines changed: 2132 additions & 22 deletions
File tree
- devlog/_plan
- 260816_local_model_capability_and_plugin_routing
- 260816_pr_merge_campaign
- src
- codex/catalog
- providers
- routing
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
0 commit comments