Skip to content

fix(plateau): source に MLIT_PLATEAU を含め、source_ref を付ける - #44

Merged
nyampire merged 1 commit into
mainfrom
fix/plateau-source-tags
Jul 19, 2026
Merged

fix(plateau): source に MLIT_PLATEAU を含め、source_ref を付ける#44
nyampire merged 1 commit into
mainfrom
fix/plateau-source-tags

Conversation

@nyampire

Copy link
Copy Markdown
Owner

このツールで行った編集は source=RapiD_Plateau_JP だけを付けていました。何が編集したかは分かりますが、データがどこから来たのかを示していません。

親の import 規約(MLIT PLATEAU/imports outline)は changeset に次の 2 つを求めています。

source     = MLIT_PLATEAU
source_ref = https://wiki.openstreetmap.org/wiki/MLIT_PLATEAU/imports_outline

両方を設定します。MLIT_PLATEAU はデータの出所、RapiD_Plateau_JP は編集に使ったツールで、答えている問いが違うので changeset は両方を持てます。

source     = aerial imagery;MLIT_PLATEAU;RapiD_Plateau_JP
source_ref = https://wiki.openstreetmap.org/wiki/MLIT_PLATEAU/imports_outline

区切りはスペースなしです。既存のコードが ; で join しており、他の値も aerial imagery;mapillary の形のためです。

source_ref の取り消し

Plateau データを使わなくなったときは source_ref を消します。commit パネルは再描画のたびにタグを組み直すので、転記を取り消した後もそのままだと、実態のない出典を主張する changeset になってしまいます。

ユーザーが自分で入れた source_ref は、付ける側でも消す側でも触りません。

テストのための切り出し

判定ロジックを modules/util/plateau_changeset_tags.js に移しました。元は updateSessionChangesetTags() という contexteditor を閉じ込めたクロージャの中にあり、テストから到達できませんでした。純粋関数にしたことで、冪等性と取り消しの挙動を先にテストとして書けるようになっています。

テスト 734 件グリーン。

別途対応が必要なこと

ツール自身の wiki ページ JA:MLIT PLATEAU/Plateau RapiDRapiD_Plateau_JP のみを記載しており MLIT_PLATEAU に触れていません。この PR でツールの挙動は親規約に沿いますが、wiki の記述とは食い違う状態になるため、デプロイ後に wiki 側の更新が必要です。

Edits made with this tool set only source=RapiD_Plateau_JP, which says what made
the edit but not where the data came from. The parent import convention
(wiki.openstreetmap.org/wiki/MLIT_PLATEAU/imports_outline) asks for
source=MLIT_PLATEAU together with a source_ref pointing back at that page, so
uploads were attributing the data to nothing in particular.

Set both values. They answer different questions and the changeset can carry
both: MLIT_PLATEAU is the data's origin, RapiD_Plateau_JP is the tool.

    source     = aerial imagery;MLIT_PLATEAU;RapiD_Plateau_JP
    source_ref = https://wiki.openstreetmap.org/wiki/MLIT_PLATEAU/imports_outline

source_ref is withdrawn again when the edit stops using Plateau data — the
commit panel recomputes these on every render, so an undone transfer would
otherwise leave behind a provenance claim the changeset no longer earns. A
source_ref the user typed is never touched, on either path.

The logic moved into modules/util/plateau_changeset_tags.js. It was unreachable
from a test inside updateSessionChangesetTags(), a closure over context and
editor; as a pure function it is directly testable, which is what let the
idempotency and undo cases be written as tests first.
@nyampire
nyampire merged commit 0fe0973 into main Jul 19, 2026
3 checks passed
@nyampire
nyampire deleted the fix/plateau-source-tags branch July 19, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant