feat(identity): ノートの同一性キーと origin 判定を導入する - #62
Merged
Conversation
複数サーバーで観測した同じノートを束ねるための identity (正規化 AP object id) を追加する (notedeck#1058)。 - identity モジュール: uri が無いローカルノートは host + ID から組み立て、 純粋 Renote の Announce id (末尾 /activity) を origin 側の行と一致させる。 host は UTS#46 で ASCII 小文字化し、比較はすべて Rust 側で済ませる - NormalizedNote に _identity / _isOrigin / _identityTrusted / contentHidden を追加。旧 JSON は serde default で読み、DB 読み出しの共通関数で補完する - notes_cache に identity 列と索引 (V7、列追加のみ)。既存行の backfill は 起動をブロックしないチャンク API で行い、完了前は uri 列でフォールバック - find_notes_by_identity (account 横断) と search_cached_notes_across - CLI ログインの host を NoteDeck 経路と同じ ASCII 小文字で保存 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkkqpTo56FUVjoksbhLj1n
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
CI の stable toolchain が進み、Result<Response, Response> を返す認証 middleware が result_large_err で落ちるようになった。axum の from_fn の 定型なので Err を Box にはできず、この関数に限って許可する。 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkkqpTo56FUVjoksbhLj1n
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
複数サーバーで観測した同じノートを束ねるための identity (正規化 ActivityPub object id) を導入する。設計の正本は notedeck-dev/notedeck#1058 の設計コメント (v5.1)。この PR は P0 (notecli 側) にあたる。
変更
identityモジュール:identity_of/normalize_host/identity_host。uri が無いローカルノートは host + ID から組み立て、純粋 Renote の Announce id (末尾/activity) を origin 側の行と一致させる。host は UTS#46 で ASCII 小文字化 (ポート保持)。フラグメント・クエリ・末尾スラッシュには触れないNormalizedNoteに_identity/_isOrigin/_identityTrusted/contentHiddenを追加。origin 判定となりすまし検査 (リモート投稿者の host と identity の host の一致) は Rust 側で済ませ、フロントは真偽値を読むだけ。RawNoteにisHiddenを named field で受けるparse_cached_noteで補完する (5 経路すべて)notes_cacheにidentity列と索引 (V7)。migration は列追加だけにし、既存行の backfill はbackfill_identity_chunkで起動後にバックグラウンドで行う。完了前はfind_notes_by_identityが uri 列でフォールバックするfind_notes_by_identity(account 横断)、search_cached_notes_across(複数アカウントの variant 返却)テスト
/activity/ Mastodon / 大文字 / Unicode host / ポート / フラグメント / 解釈不能)isHidden透過・旧 JSON の補完・serde 名/activity行)、origin / trusted フラグ、backfill と uri フォールバック、旧 JSON の補完、横断検索tests::get_credentials_no_tokenは develop でも落ちる既存のフレーク (keychain の並列テスト干渉)🤖 Generated with Claude Code
https://claude.ai/code/session_01FkkqpTo56FUVjoksbhLj1n