Skip to content

feat(experiments): add offline document tail retrieval comparison #279

Closed

Description

@lipluscodex

Codex Luna

目的

長い資料の後半を発見する候補を、live索引を書き換えず再計算できる実験として公開する。今朝の独立pilotをrepo内のopt-in CLI・固定fixture・protocolへ収める。検索の既定、embedding、DB、デプロイは変更しない。本番の全文索引/分割方式を採用するPRではない。

確認した前提

  • main da23db3f077a2975e11fc4ab16cfab1556098045 の src/pipeline/embed-doc.ts:44-46,70-83 は path + 改行2個 + 本文の先頭8000 UTF16 unitsをembeddingとFTSの両方へ渡す。src/rerank.ts:47-66 のpair上限は1700、query上限200なので、全文FTSだけで通常rerankの根拠露出を保証しない。
  • 2026-10-13のlive読取でNGR requirements.mdの structured advisory warning は本文18055、github-rag requirements.mdの Deterministic slug-match は53955、webhook ja requirementsの即時未処理削除のphraseは13967。prefixには無い。既知filename+repo+top_k3+include_contentは目的docを各1位で全文取得するが、同じNGR queryのtop_k1は別仕様書になった。knownpath取得とunknownpath発見を分ける。
  • 新しい独立fixture(11公開doc、7事前query、corpora/ 配下は除外)によるSQLite FTS5 sparse-only pilot: namedtarget tail hit@1 prefix0/3、full3/3、8000chunk2/3、hit@3は1/3→3/3→3/3。webhookのchunk1位は別docにも同じ根拠があるため、これを分割方式の誤りとは採点しない。全query・label・rawtext/version/hash・全候補・timingはworkspace .artifacts/rag-abstention-275/fulltext-pilot/ に保存済み。
  • CLIを公開して引継ぎをlocal artifactだけに依存させない。関連: enhancement(search): abstain when top results fall below a confidence threshold #275 / feat(experiments): add offline abstention replay #276。

範囲と制約

  • 実験は prefix8000 / fullbody sparse / fixed nonoverlap8000-unit chunks の3arm。embedding/rerankerは実行しない。targetは採点にだけ使い、順位付けにはquery+repoだけを使う。
  • fixtureは現在の公開文書の固定写しのみ。private trace/source/activation/receipt/vector識別子を含めない。モデル文脈/利用記録やfrozen評価artifactは触らない。
  • production snapshotのsegmentForFts、porter+unicode61、strict-first AND/relaxed ORを基にする。全候補列挙・entity dedupとproduction candidate capの差、local Node/ICU/SQLiteとCloudflare D1の差をprotocolへ明示する。
  • namedtarget hitと、同repoのどれかのdocにexactphraseがあるliteral-source hitを分ける。どちらも意味的正答率ではない。NGRの judgment relation queryはprefix内に各tokenはあるがphraseは後半であり、general-query controlと記述する。
  • 現在の再ランキングbudgetに根拠phraseが収まるかを静的に数える。Markdown fence内を見出しにしない節長分布とphraseの節内位置も記録する。静的露出はモデルの正答測定ではない。
  • SQLite実験DBは指定した新しい出力dir内だけ。既存DB/入力を上書きしない。ネットワーク・認証・Workers/共有NGR DBを使わない。入力hashを確認、環境version、bytes/rows、build/query時間を出す。時間/サイズはlocal値で、本番費用/RAMの保証にしない。
  • 再現可能性/入力hash/UTF16境界/negative/targetを順位付けに使わないこと等の意味ある契約テストを付ける。汎用Fts品質を保証するtestとはしない。
  • docsに実行方法・source snapshot・既定動作不変・未測定の端-to-端quality、backfill/provenance/candidate-budgetの残課題を残す。

想定する変更先

experiments/ のfixture/protocol、scripts/ のopt-in runnerと必要なsnapshot helper、実験docsと要件書の対応記述、必要なCI契約検査。実行時の src/** やindexing・MCPの仕様は変更しない。

— Luna

Activity

  1. added
    enhancement新機能・改善要望
    ready本文が実装開始できる形まで収束している状態。ただし更新は継続可能
    on Oct 12, 2026
  2. self-assigned this
    on Oct 12, 2026
  3. added
    waiting外部依存待ち(CI / dependent issue / 環境)。pause 状態
    and removed
    in-progress着手中、実装または検証が進行中
    on Oct 12, 2026
  4. lipluscodex commented on Oct 12, 2026

    @lipluscodex
    MemberAuthor

    Codex Luna

    PR #280 / head 2338530 のCI完了待ち。ローカル契約6件と既存script18件、hash固定Git blob9個の照合は通過。src runtime変更なし、worktree clean。完了後に親へ報告する。

    — Luna

  5. added
    in-progress着手中、実装または検証が進行中
    waiting外部依存待ち(CI / dependent issue / 環境)。pause 状態
    and removed
    waiting外部依存待ち(CI / dependent issue / 環境)。pause 状態
    in-progress着手中、実装または検証が進行中
    on Oct 12, 2026
  6. lipluscodex commented on Oct 12, 2026

    @lipluscodex
    MemberAuthor

    Codex Luna

    親レビューのdangling --out symlink指摘を修正した。head bdc02e4 をpushし、再CI待ち。leafをresolveせずmkdirで拒否し、symlink先を作らない契約検査を追加。Windowsローカルはsymlink作成権限で1skip、Linux CIで実行する。固定入力bytesは保持し、CRLF用whitespace属性を追加した。

    — Luna

  7. added
    review-pending実装フェーズ完了。orchestration (brake eval / review / merge / close) 待ち
    and removed
    waiting外部依存待ち(CI / dependent issue / 環境)。pause 状態
    on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement新機能・改善要望ready本文が実装開始できる形まで収束している状態。ただし更新は継続可能review-pending実装フェーズ完了。orchestration (brake eval / review / merge / close) 待ち

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions