llm-ingestion-okf/docs/plan
Kjell Tore Guttormsen 770d8d4fbf docs(index): assess a consumer-controlled index ordering - accept, reshape
Order 20260827T123301Z-3790625395 asked for a judgement on a profile-named
`index.sort_key`, explicitly not for code. The finding is accepted and so is
the mechanism; the shape needs one correction.

Verified what the order asserts about us: Door C sorts its index on the
concept path and nothing else (`importer.py:421`, a plain `sorted(documents)`),
and no policy object anywhere in the chain can redirect it. `FacetPolicy`
governs what an entry CARRIES; nothing governs how entries are ARRANGED. A
consumer cannot reach this today, exactly as claimed.

The correction: naming a key is necessary and not sufficient, and the
insufficiency is where the requester's own measured gain lives. A sort needs a
key, a value and a COMPARATOR, and D5's formula seats only the first two.
Measured here: sorted() over N100.9/N100.10/N100.2/N100.20/N100.1/N99.1 puts
N100.10 before N100.2 and N99.1 after the whole N100 family. A `sort_key:
req_number` resolved through default ordering would therefore have produced a
different wrong order, not the 100.0% ascending over 24338 pairs that was
measured. The library already knows this one module over -- `_version_key`
(`structure.py:375`) exists for it and its comment says why.

So: three fields on `IndexPolicy`, not one on `FacetPolicy` -- `sort_key`,
`sort_order` from a closed set (`lexicographic` | `natural`, never a
caller-supplied callable, which would make emitted bytes depend on caller code
and break rebuild-equals-incremental), and `sort_missing`. Concept path stays
the final tie-break so the new ordering REFINES the existing total order rather
than replacing it; trading S8b determinism for retrieval quality would be the
worse failure.

Timing: build after the segmentation voyage lands, as a parameter on the
`_index_sort_key` seam Step 10 leaves behind, unifying both doors' index
writers in the same change. That seam is real and manifest-enforced, but it is
Door B's while this order is Door C's -- a profile naming an ordering that one
door honours and the other ignores would repeat the `IndexPolicy.per_directory`
trap.

Not claimed: that ordering explains the whole gap. T8-4 remains unexplained and
we attach no hypothesis to it either.

Order: 20260827T123301Z-3790625395-from-.claude

Co-Authored-By: Claude <claude-opus-5>
2026-08-31 23:35:25 +02:00
..
execution-order.md feat(guard): bump the pin to >=0.3,<0.4 and pin Door C's allow_reserved=False 2026-08-02 21:08:53 +02:00
index-ordering.md docs(index): assess a consumer-controlled index ordering - accept, reshape 2026-08-31 23:35:25 +02:00
mcp-bundle-population.md docs(mcp): Q2 gains upstream's tool surface as measured prior art 2026-07-27 20:16:47 +02:00
okf-2026-08-timestamp-tightening.md docs(upstream): move the OKF pin to canonical ad30107, re-record V-A8 2026-08-23 20:30:22 +02:00
okf-bundle-consumption-contract.md docs(plan): make retrieval cost a first-order element of the consumption contract 2026-08-25 23:38:34 +02:00
okf-v0.2-alignment.md docs(upstream): move the OKF pin to canonical ad30107, re-record V-A8 2026-08-23 20:30:22 +02:00
phase-1-door-a.md docs(plan): add detailed phase 1-4 implementation plans 2026-07-16 10:58:08 +02:00
phase-2-doors-b-c.md docs(plan): answer the Door B/A capability-gap order from ms-ai-architect 2026-08-26 23:54:35 +02:00
phase-3-configurable-contract.md docs(okf-v0.2): the alignment track lands before the contract freezes 2026-07-26 11:42:37 +02:00
phase-4-node-half.md docs(phase-4): record linkedin-studio's two named requirements before the freeze 2026-07-25 20:34:54 +02:00
references-cue-rule.md fix(structure): a derived reference needs a cue, not just a number shape 2026-08-29 09:26:57 +02:00
structure-derivation.md fix(structure): a derived reference needs a cue, not just a number shape 2026-08-29 09:26:57 +02:00