diff --git a/.github/workflows/production-truth.yml b/.github/workflows/production-truth.yml index 243535e..f626e99 100644 --- a/.github/workflows/production-truth.yml +++ b/.github/workflows/production-truth.yml @@ -10,6 +10,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 # 乙未/戊午相容性測試要讀修正前的 commit(7ae87f6)作對照;淺層 checkout 抓不到 - uses: actions/setup-node@v4 with: @@ -33,3 +35,6 @@ jobs: - name: Arrival mechanics contracts (incl. 紙落定即入簿) run: node scripts/test-arrival.mjs + + - name: 乙未/戊午 repair — old books, notes and bindings still restore + run: node scripts/test-liushijiazi-book-compat.mjs diff --git a/assets/oracles.draw-pool.js b/assets/oracles.draw-pool.js index cf2b2c9..3c43331 100644 --- a/assets/oracles.draw-pool.js +++ b/assets/oracles.draw-pool.js @@ -2,7 +2,7 @@ // Every entry passed the fail-closed production gates. Regenerate via: node scripts/build-draw-pool.mjs window.DRAW_POOL = { "schema": "draw-pool/1.0", - "content_version": "66068302782a9e690bd1d16c208678ac5022036d36a64b62d9a9d296249e9125", + "content_version": "9433062177a366ccd13b3708955704c73d035929e65a0eca3f9a8798d3f03527", "policy": { "allowed_transcription_status": [ "VERIFIED", @@ -46,7 +46,7 @@ window.DRAW_POOL = { "edition_title": "北港朝天宮官方六十甲子籤(modern reference edition)", "slip_count": 60, "source_file": "data/corpora/liushijiazi/slip_texts.json", - "source_sha256": "aa54acd813a1d22cca63388ca2a60ff31801de137887b2756fd75dbcdbbc6014", + "source_sha256": "b85e704ea80288b60103a554326461ec3233ab38c21876ce0c941e1bceddbd9c", "data_quality": { "decoded_char_refs": 0 }, @@ -3826,7 +3826,7 @@ window.DRAW_POOL = { "slip_number": 10, "original_slip_label": "乙未", "historical_text": { - "poem_text": "右上角籤首資料\n花開結子一半枯\n可惜今年爾虛度\n漸漸日落西山去" + "poem_text": "花開結子一半枯\n可惜今年爾虛度\n漸漸日落西山去\n勸君不用向前途" }, "provenance": { "edition_id": "ref-lsjz-010", @@ -4150,7 +4150,7 @@ window.DRAW_POOL = { "slip_number": 28, "original_slip_label": "戊午", "historical_text": { - "poem_text": "右上籤號與卦象\n於今莫作此當時\n虎落平陽被犬欺\n世間凡事何難定" + "poem_text": "於今莫作此當時\n虎落平陽被犬欺\n世間凡事何難定\n千山萬水也遲疑" }, "provenance": { "edition_id": "ref-lsjz-028", diff --git a/data/corpora/liushijiazi/README.md b/data/corpora/liushijiazi/README.md index e9f1fd2..04e92f7 100644 --- a/data/corpora/liushijiazi/README.md +++ b/data/corpora/liushijiazi/README.md @@ -62,6 +62,31 @@ python3 data/corpora/liushijiazi/validate_corpus_package.py # 預期 517 PASS / ## 修改指南 +### 2026-11-14 詩文 OCR 窄修(#10/#28) + +依同版北港官方影像的 agent 目視核圖修復兩筆詩文;不是 human approval, +未升級 authenticity、license、human_verified 或 production eligibility。 +原 OCR 錯文、逐句修復、來源 URL/SHA-256 保存在 Study 03 的 +`poem-corrections.json`;原始 OCR evidence 不覆寫。詳見 +`docs/LIUSHIJIAZI-OCR-REPAIR-2026-11-14.md`。 + +重建順序(repo root;Python 需 openpyxl,既有 validators 另需 jsonschema): + +```bash +python3 research/oracle-corpus-study-03-liushijiazi-full/poem_corrections.py +python3 data/corpora/liushijiazi/build_corpus_package.py +python3 scripts/build-liushijiazi-texts.py +python3 data/corpora/liushijiazi/build_liushijiazi_layer.py +node scripts/build-draw-pool.mjs +python3 scripts/test-liushijiazi-poem-repair.py +node scripts/test-liushijiazi-book-compat.mjs +``` + +完整 acquisition 重跑時,`generate_ingest.py` 寫出 attestation 前也套用同一修正; +若遇到既有錯文/已核正讀法以外的新讀法會中止,要求重新核圖,不默默覆蓋。 +corpus builder 另拒絕兩筆 stale ingest;production builder 拒絕兩個已知 OCR 標題。 +這些都是窄範圍回歸防護,不是其餘籤文正確性的證明。 + | 想改什麼 | 改哪裡 | |---|---| | 新增/修正研究結論 | 改 Study 03 frozen package(research/oracle-corpus-study-03-liushijiazi-full/data/*.jsonl),重跑 `build_corpus_package.py`——本目錄 6 檔為 derived artifact,不要手改 | diff --git a/data/corpora/liushijiazi/attestations.json b/data/corpora/liushijiazi/attestations.json index c3eae9f..865cbf5 100644 --- a/data/corpora/liushijiazi/attestations.json +++ b/data/corpora/liushijiazi/attestations.json @@ -391,14 +391,14 @@ "item_license_status": "unresolved", "item_url": "https://www.matsu.org.tw/upload_files/web/uploadfile/2024080515/original/240805152108670080.jpg", "license_status": "unsure", - "notes": "OCR 逐字轉錄官方圖檔,未改字;詩文層跨 carrier 交叉一致為佐證;五行/卦頭/聖意層個別欄位疑 OCR 誤讀待人工複核——不因不通順而猜改", + "notes": "原始 2026-08-15 註記(歷史轉錄聲明,非本次核驗結論):「OCR 逐字轉錄官方圖檔,未改字;詩文層跨 carrier 交叉一致為佐證;五行/卦頭/聖意層個別欄位疑 OCR 誤讀待人工複核——不因不通順而猜改」;2026-11-14 agent 目視核對同版官方原圖,僅修正詩文四句;非 human confirmation,其他欄位與狀態未升級;原 OCR/逐句修復與影像 SHA-256 見 poem-corrections.json#att-bg-010", "numbering_in_source": "乙未", "retrieval_date": "2026-08-15", "slip_id": "slip-lsjz-010", "slip_number": 10, "source_id": "src-beigang-official", "source_type": "primary", - "text": "右上角籤首資料\n花開結子一半枯\n可惜今年爾虛度\n漸漸日落西山去", + "text": "花開結子一半枯\n可惜今年爾虛度\n漸漸日落西山去\n勸君不用向前途", "text_status": "uncertain", "title_in_source": "可惜今年爾虛度", "transcription_by": "agent(autoglm image recognition)", @@ -1099,14 +1099,14 @@ "item_license_status": "unresolved", "item_url": "https://www.matsu.org.tw/upload_files/web/uploadfile/2024080515/original/240805152118799412.jpg", "license_status": "unsure", - "notes": "OCR 逐字轉錄官方圖檔,未改字;詩文層跨 carrier 交叉一致為佐證;五行/卦頭/聖意層個別欄位疑 OCR 誤讀待人工複核——不因不通順而猜改", + "notes": "原始 2026-08-15 註記(歷史轉錄聲明,非本次核驗結論):「OCR 逐字轉錄官方圖檔,未改字;詩文層跨 carrier 交叉一致為佐證;五行/卦頭/聖意層個別欄位疑 OCR 誤讀待人工複核——不因不通順而猜改」;2026-11-14 agent 目視核對同版官方原圖,僅修正詩文四句;非 human confirmation,其他欄位與狀態未升級;原 OCR/逐句修復與影像 SHA-256 見 poem-corrections.json#att-bg-028", "numbering_in_source": "戊午", "retrieval_date": "2026-08-15", "slip_id": "slip-lsjz-028", "slip_number": 28, "source_id": "src-beigang-official", "source_type": "primary", - "text": "右上籤號與卦象\n於今莫作此當時\n虎落平陽被犬欺\n世間凡事何難定", + "text": "於今莫作此當時\n虎落平陽被犬欺\n世間凡事何難定\n千山萬水也遲疑", "text_status": "uncertain", "title_in_source": "虎落平陽被犬欺", "transcription_by": "agent(autoglm image recognition)", diff --git a/data/corpora/liushijiazi/build_corpus_package.py b/data/corpora/liushijiazi/build_corpus_package.py index a3745b3..78d49f1 100644 --- a/data/corpora/liushijiazi/build_corpus_package.py +++ b/data/corpora/liushijiazi/build_corpus_package.py @@ -61,6 +61,10 @@ def main(): corpus_rows = load_jsonl(os.path.join(DATA_SRC, "corpus.jsonl")) slips = load_jsonl(os.path.join(DATA_SRC, "slip.jsonl")) atts = load_jsonl(os.path.join(DATA_SRC, "attestation.jsonl")) + # Refuse stale ingest even if someone bypasses the acquisition pipeline. + sys.path.insert(0, SRC) + from poem_corrections import validate_corrections + validate_corrections(atts) items = load_jsonl(os.path.join(DATA_SRC, "concrete_item.jsonl")) vgs = load_jsonl(os.path.join(DATA_SRC, "variant_group.jsonl")) sources = load_jsonl(os.path.join(DATA_SRC, "source_record.jsonl")) diff --git a/data/corpora/liushijiazi/slip_texts.csv b/data/corpora/liushijiazi/slip_texts.csv index 729d7ee..4a6f85d 100644 --- a/data/corpora/liushijiazi/slip_texts.csv +++ b/data/corpora/liushijiazi/slip_texts.csv @@ -8,7 +8,7 @@ deity_tradition,corpus_id,slip_number,original_slip_label,poem_text,edition,edit 媽祖(北港朝天宮,living-tradition mapping),liushijiazi,7,乙丑,雲開月出見分明;不須進退問前途;婚姻皆由天註定;和合清吉萬事成,北港朝天宮官方六十甲子籤(modern reference edition),ref-lsjz-007,現代(官方網站版;reference edition 由 Study 03 comparison 建立),https://www.matsu.org.tw/?act=menuinfo&ml_id=20240116002&cmd=list (北港官方籤詩列表);attestation: att-bg-007,PROBABLE,沿用 corpus package authenticity(58 PROBABLE / 2 VERIFIED);historical baseline 維持 0/60(古本文字未取得,不因身分證升級) 媽祖(北港朝天宮,living-tradition mapping),liushijiazi,8,乙卯,禾稻看看結成完;此事必定兩相全;回到家中寬心坐;妻兒鼓舞樂團圓,北港朝天宮官方六十甲子籤(modern reference edition),ref-lsjz-008,現代(官方網站版;reference edition 由 Study 03 comparison 建立),https://www.matsu.org.tw/?act=menuinfo&ml_id=20240116002&cmd=list (北港官方籤詩列表);attestation: att-bg-008,PROBABLE,沿用 corpus package authenticity(58 PROBABLE / 2 VERIFIED);historical baseline 維持 0/60(古本文字未取得,不因身分證升級) 媽祖(北港朝天宮,living-tradition mapping),liushijiazi,9,乙巳,龍虎相隨在深山;君爾何須背後看;不知此去相愛悞;他日與我卻無干,北港朝天宮官方六十甲子籤(modern reference edition),ref-lsjz-009,現代(官方網站版;reference edition 由 Study 03 comparison 建立),https://www.matsu.org.tw/?act=menuinfo&ml_id=20240116002&cmd=list (北港官方籤詩列表);attestation: att-bg-009,PROBABLE,沿用 corpus package authenticity(58 PROBABLE / 2 VERIFIED);historical baseline 維持 0/60(古本文字未取得,不因身分證升級) -媽祖(北港朝天宮,living-tradition mapping),liushijiazi,10,乙未,右上角籤首資料;花開結子一半枯;可惜今年爾虛度;漸漸日落西山去,北港朝天宮官方六十甲子籤(modern reference edition),ref-lsjz-010,現代(官方網站版;reference edition 由 Study 03 comparison 建立),https://www.matsu.org.tw/?act=menuinfo&ml_id=20240116002&cmd=list (北港官方籤詩列表);attestation: att-bg-010,PROBABLE,沿用 corpus package authenticity(58 PROBABLE / 2 VERIFIED);historical baseline 維持 0/60(古本文字未取得,不因身分證升級) +媽祖(北港朝天宮,living-tradition mapping),liushijiazi,10,乙未,花開結子一半枯;可惜今年爾虛度;漸漸日落西山去;勸君不用向前途,北港朝天宮官方六十甲子籤(modern reference edition),ref-lsjz-010,現代(官方網站版;reference edition 由 Study 03 comparison 建立),https://www.matsu.org.tw/?act=menuinfo&ml_id=20240116002&cmd=list (北港官方籤詩列表);attestation: att-bg-010,PROBABLE,沿用 corpus package authenticity(58 PROBABLE / 2 VERIFIED);historical baseline 維持 0/60(古本文字未取得,不因身分證升級) 媽祖(北港朝天宮,living-tradition mapping),liushijiazi,11,乙酉,靈雞漸漸見分明;凡事且看子丑寅;雲開月出照天下;郎君即便見太平,北港朝天宮官方六十甲子籤(modern reference edition),ref-lsjz-011,現代(官方網站版;reference edition 由 Study 03 comparison 建立),https://www.matsu.org.tw/?act=menuinfo&ml_id=20240116002&cmd=list (北港官方籤詩列表);attestation: att-bg-011,PROBABLE,沿用 corpus package authenticity(58 PROBABLE / 2 VERIFIED);historical baseline 維持 0/60(古本文字未取得,不因身分證升級) 媽祖(北港朝天宮,living-tradition mapping),liushijiazi,12,乙亥,長江風浪漸漸靜;于今得進可安寧;必有貴人相扶助;凶事脫出見太平,北港朝天宮官方六十甲子籤(modern reference edition),ref-lsjz-012,現代(官方網站版;reference edition 由 Study 03 comparison 建立),https://www.matsu.org.tw/?act=menuinfo&ml_id=20240116002&cmd=list (北港官方籤詩列表);attestation: att-bg-012,PROBABLE,沿用 corpus package authenticity(58 PROBABLE / 2 VERIFIED);historical baseline 維持 0/60(古本文字未取得,不因身分證升級) 媽祖(北港朝天宮,living-tradition mapping),liushijiazi,13,丙子,命內正逢羅孛關;用盡心機總未休;作福問神難得過;恰是行舟上高灘,北港朝天宮官方六十甲子籤(modern reference edition),ref-lsjz-013,現代(官方網站版;reference edition 由 Study 03 comparison 建立),https://www.matsu.org.tw/?act=menuinfo&ml_id=20240116002&cmd=list (北港官方籤詩列表);attestation: att-bg-013,PROBABLE,沿用 corpus package authenticity(58 PROBABLE / 2 VERIFIED);historical baseline 維持 0/60(古本文字未取得,不因身分證升級) @@ -26,7 +26,7 @@ deity_tradition,corpus_id,slip_number,original_slip_label,poem_text,edition,edit 媽祖(北港朝天宮,living-tradition mapping),liushijiazi,25,戊子,總是前途莫心勞;求神問聖枉是多;但看雞犬日過後;不須作福事如何,北港朝天宮官方六十甲子籤(modern reference edition),ref-lsjz-025,現代(官方網站版;reference edition 由 Study 03 comparison 建立),https://www.matsu.org.tw/?act=menuinfo&ml_id=20240116002&cmd=list (北港官方籤詩列表);attestation: att-bg-025,PROBABLE,沿用 corpus package authenticity(58 PROBABLE / 2 VERIFIED);historical baseline 維持 0/60(古本文字未取得,不因身分證升級) 媽祖(北港朝天宮,living-tradition mapping),liushijiazi,26,戊寅,選出牡丹第一枝;勸君折取莫遲疑;世間若問相知處;萬事逢春正及時,北港朝天宮官方六十甲子籤(modern reference edition),ref-lsjz-026,現代(官方網站版;reference edition 由 Study 03 comparison 建立),https://www.matsu.org.tw/?act=menuinfo&ml_id=20240116002&cmd=list (北港官方籤詩列表);attestation: att-bg-026,PROBABLE,沿用 corpus package authenticity(58 PROBABLE / 2 VERIFIED);historical baseline 維持 0/60(古本文字未取得,不因身分證升級) 媽祖(北港朝天宮,living-tradition mapping),liushijiazi,27,戊辰,君爾寬心且自由;門庭清吉家無憂;財寶自然終吉利;凡事無傷不用求,北港朝天宮官方六十甲子籤(modern reference edition),ref-lsjz-027,現代(官方網站版;reference edition 由 Study 03 comparison 建立),https://www.matsu.org.tw/?act=menuinfo&ml_id=20240116002&cmd=list (北港官方籤詩列表);attestation: att-bg-027,PROBABLE,沿用 corpus package authenticity(58 PROBABLE / 2 VERIFIED);historical baseline 維持 0/60(古本文字未取得,不因身分證升級) -媽祖(北港朝天宮,living-tradition mapping),liushijiazi,28,戊午,右上籤號與卦象;於今莫作此當時;虎落平陽被犬欺;世間凡事何難定,北港朝天宮官方六十甲子籤(modern reference edition),ref-lsjz-028,現代(官方網站版;reference edition 由 Study 03 comparison 建立),https://www.matsu.org.tw/?act=menuinfo&ml_id=20240116002&cmd=list (北港官方籤詩列表);attestation: att-bg-028,PROBABLE,沿用 corpus package authenticity(58 PROBABLE / 2 VERIFIED);historical baseline 維持 0/60(古本文字未取得,不因身分證升級) +媽祖(北港朝天宮,living-tradition mapping),liushijiazi,28,戊午,於今莫作此當時;虎落平陽被犬欺;世間凡事何難定;千山萬水也遲疑,北港朝天宮官方六十甲子籤(modern reference edition),ref-lsjz-028,現代(官方網站版;reference edition 由 Study 03 comparison 建立),https://www.matsu.org.tw/?act=menuinfo&ml_id=20240116002&cmd=list (北港官方籤詩列表);attestation: att-bg-028,PROBABLE,沿用 corpus package authenticity(58 PROBABLE / 2 VERIFIED);historical baseline 維持 0/60(古本文字未取得,不因身分證升級) 媽祖(北港朝天宮,living-tradition mapping),liushijiazi,29,戊申,枯木可惜未逢春;如今還在暗中藏;寬心且守風霜退;還君依舊作乾坤,北港朝天宮官方六十甲子籤(modern reference edition),ref-lsjz-029,現代(官方網站版;reference edition 由 Study 03 comparison 建立),https://www.matsu.org.tw/?act=menuinfo&ml_id=20240116002&cmd=list (北港官方籤詩列表);attestation: att-bg-029,PROBABLE,沿用 corpus package authenticity(58 PROBABLE / 2 VERIFIED);historical baseline 維持 0/60(古本文字未取得,不因身分證升級) 媽祖(北港朝天宮,living-tradition mapping),liushijiazi,30,戊戍,漸漸看此月中和;過後須妨未得高;改變顏色前途去;凡事必定見重勞,北港朝天宮官方六十甲子籤(modern reference edition),ref-lsjz-030,現代(官方網站版;reference edition 由 Study 03 comparison 建立),https://www.matsu.org.tw/?act=menuinfo&ml_id=20240116002&cmd=list (北港官方籤詩列表);attestation: att-bg-030,PROBABLE,沿用 corpus package authenticity(58 PROBABLE / 2 VERIFIED);historical baseline 維持 0/60(古本文字未取得,不因身分證升級) 媽祖(北港朝天宮,living-tradition mapping),liushijiazi,31,己丑,綠柳蒼蒼正當時;任君此去作乾坤;花葉結實無殘謝;福祿自有慶家門,北港朝天宮官方六十甲子籤(modern reference edition),ref-lsjz-031,現代(官方網站版;reference edition 由 Study 03 comparison 建立),https://www.matsu.org.tw/?act=menuinfo&ml_id=20240116002&cmd=list (北港官方籤詩列表);attestation: att-bg-031,PROBABLE,沿用 corpus package authenticity(58 PROBABLE / 2 VERIFIED);historical baseline 維持 0/60(古本文字未取得,不因身分證升級) diff --git a/data/corpora/liushijiazi/slip_texts.json b/data/corpora/liushijiazi/slip_texts.json index 9bd281f..2d462d7 100644 --- a/data/corpora/liushijiazi/slip_texts.json +++ b/data/corpora/liushijiazi/slip_texts.json @@ -126,7 +126,7 @@ "corpus_id": "liushijiazi", "slip_number": 10, "original_slip_label": "乙未", - "poem_text": "右上角籤首資料\n花開結子一半枯\n可惜今年爾虛度\n漸漸日落西山去", + "poem_text": "花開結子一半枯\n可惜今年爾虛度\n漸漸日落西山去\n勸君不用向前途", "edition_id": "ref-lsjz-010", "edition_title": "北港朝天宮官方六十甲子籤(modern reference edition)", "edition_date_period": "現代(官方網站版;reference edition 由 Study 03 comparison 建立)", @@ -360,7 +360,7 @@ "corpus_id": "liushijiazi", "slip_number": 28, "original_slip_label": "戊午", - "poem_text": "右上籤號與卦象\n於今莫作此當時\n虎落平陽被犬欺\n世間凡事何難定", + "poem_text": "於今莫作此當時\n虎落平陽被犬欺\n世間凡事何難定\n千山萬水也遲疑", "edition_id": "ref-lsjz-028", "edition_title": "北港朝天宮官方六十甲子籤(modern reference edition)", "edition_date_period": "現代(官方網站版;reference edition 由 Study 03 comparison 建立)", diff --git a/data/corpora/liushijiazi/slip_texts_review.xlsx b/data/corpora/liushijiazi/slip_texts_review.xlsx index 3d6dc45..551d789 100644 Binary files a/data/corpora/liushijiazi/slip_texts_review.xlsx and b/data/corpora/liushijiazi/slip_texts_review.xlsx differ diff --git a/data/corpora/liushijiazi/slips.json b/data/corpora/liushijiazi/slips.json index 70909a2..d3d0b1c 100644 --- a/data/corpora/liushijiazi/slips.json +++ b/data/corpora/liushijiazi/slips.json @@ -214,7 +214,7 @@ "reference_attestation_id": "att-bg-010", "reference_basis": "北港官方圖檔版為 comparison-based reference edition(60-vs-60 全量比對;#7 #19 #38 #41 #46 #48 #57 #60 另經 human 目視確認 observed transcription)", "reference_edition_id": "ref-lsjz-010", - "reference_text": "右上角籤首資料\n花開結子一半枯\n可惜今年爾虛度\n漸漸日落西山去", + "reference_text": "花開結子一半枯\n可惜今年爾虛度\n漸漸日落西山去\n勸君不用向前途", "slip_id": "slip-lsjz-010", "slip_number": 10, "source_package_notes": "干支 乙未(官網列表 label)" @@ -610,7 +610,7 @@ "reference_attestation_id": "att-bg-028", "reference_basis": "北港官方圖檔版為 comparison-based reference edition(60-vs-60 全量比對;#7 #19 #38 #41 #46 #48 #57 #60 另經 human 目視確認 observed transcription)", "reference_edition_id": "ref-lsjz-028", - "reference_text": "右上籤號與卦象\n於今莫作此當時\n虎落平陽被犬欺\n世間凡事何難定", + "reference_text": "於今莫作此當時\n虎落平陽被犬欺\n世間凡事何難定\n千山萬水也遲疑", "slip_id": "slip-lsjz-028", "slip_number": 28, "source_package_notes": "干支 戊午(官網列表 label)" diff --git a/data/corpora/liushijiazi/source_texts.json b/data/corpora/liushijiazi/source_texts.json index 5e4186b..59726b0 100644 --- a/data/corpora/liushijiazi/source_texts.json +++ b/data/corpora/liushijiazi/source_texts.json @@ -259,7 +259,7 @@ "10": { "slip_no": 10, "ganzhi": "乙未", - "poem": "右上角籤首資料\n花開結子一半枯\n可惜今年爾虛度\n漸漸日落西山去", + "poem": "花開結子一半枯\n可惜今年爾虛度\n漸漸日落西山去\n勸君不用向前途", "ocr_full": "**籤序干支**:乙未\n\n**卦名**:雷地豫卦\n\n**五行方位**:屬金利在秋天 四方皆宜\n\n**籤詩標題**:花開結子一半枯\n\n**籤詩四句**:\n花開結子一半枯\n可惜今年爾虛度\n漸漸日落西山去\n勸君不用向前途\n\n**聖意各項目**:\n* **討海**:不好\n* **作埕**:無望\n* **魚苗**:得半失\n* **求財**:破財不見大\n* **求月令**:過期无收\n* **耕作**:豐收\n* **經商**:不好\n* **月令**:難通\n* **六甲**:子難養\n* **婚姻**:得許離\n* **家運**:安靜\n* **失物**:難尋\n* **行人**:月尾回\n* **透信**:難到\n* **六畜**:難飼失\n* **宅**:有異星\n* **作事**:不成\n* **功名**:得枉費\n* **移居**:不可\n* **墓基**:必犯鬼運\n* **出外**:遇貴人\n* **求兒**:來\n* **治病**:犯土煞\n* **兩脚**:難親\n* **到期**:不順\n* **年冬**:頗好\n\n**廟公的話**:\n豫卦,有悅樂之意,傾向於怠慢之意,終有竄縱家道之患。來此卦算是吉卦,可是容易造成這些惡行為。因此附配乙未下籤是。聖母諱導吾誠信,和樂容易沈溺。做人必屬高瞻遠矚,做事更須居安思危,不可在安樂中,自己的為主不住自己,即吉。換言之,應持堅固的志操扣緊心弦,踐穩腳跟,然後奮發努力,定可抓到好機會而向利運。否則樂極生悲,必然陷於危機。\n\n**籤解**:\n問出外,不可,勸君不用向前途,主往返回空勞也。問婚姻,籤詩有結子一半枯,今年沒處度;恐怕難成。問事業,難成,日落西山去。\n\n但得此籤的人,今年雖零落,然而後有大發達之意,此點宜注意。\n\n**卦運勢**:\n豫卦,凡事豫則立不豫則廢。但性未修圓明者,則禁枯得失,福盡禍至,樂極生悲。\n\n**籤閣聖意**:\n剪刀;是聖意使人警惕,力而儉則富。例如合家大小,靠剪刀手藝勤做活,必有掘土逢金之喜。\n\n**卦頭故事**:\n奉吟是一個未出嫁的姑娘,一次的受災險,差點送命。\n\n(註解文字):你的半枯作為,必然在田裡種的白多,今年的心血,必被久旱所耗盡了法了。不是你一意要堅守用真,柔弱不久再遇,或君只聞要聽不偏位。\n\n(出處):錄自「三條崙包公廟」\n\n**判詞**:刀剪\n\n**圖示**:剪刀圖案", "legacy_layers": [ { @@ -752,7 +752,7 @@ "28": { "slip_no": 28, "ganzhi": "戊午", - "poem": "右上籤號與卦象\n於今莫作此當時\n虎落平陽被犬欺\n世間凡事何難定", + "poem": "於今莫作此當時\n虎落平陽被犬欺\n世間凡事何難定\n千山萬水也遲疑", "ocr_full": "以下是台灣北港朝天宮六十甲子籤詩(戊午籤)之逐字轉錄:\n\n---\n\n**【籤序干支】**\n戊午\n\n**【卦名】**\n於今莫作此當時\n\n**【五行方位】**\n屬火利在夏天 宜其南方\n\n**【圖示】**\n(圖繪:叉、鑣)\n\n**【籤詩四句】**\n虎落平陽被犬欺\n世間凡事何難定\n千山萬水也遲疑\n楚項烏江自刎\n\n**【聖意各項目】**\n* **討海**:無利\n* **作運**:忌好口\n* **魚苗**:不利\n* **求財**:不得\n* **耕作**:半收\n* **經商**:難多如人意敗\n* **月令**:九人不敗\n* **六甲**:須防難\n* **婚姻**:行三思\n* **家道**:恐人作怪\n* **失物**:難尋了\n* **求事**:人難得\n* **透信**:急急須\n* **六畜**:不安\n* **移居**:大不好\n* **填墓**:恐犯六十年官\n* **出外**:被人欺\n* **行舟**:了財帛\n* **凡事**:被人害\n* **治病**:難醫(小字:大吉不吉利)\n* **功名**:機無好時\n* **求事**:難成\n\n**【廟公的話】**\n震上艮下,是山上打雷。其警擊小過之象。「小過」二字倒轉來說:就是「過小」之意。可小事,不可大事,所以此卦是時運不濟之卦。占者,萬事不如意也。若能安份而行正者,小過自亡矣。俗曰:虧人是禍,容人則福。獎己乃災,兌己乃德。現人行忌,須檢點自己之行為,免有失。否則,只顧眼前之利慾,不思日後之因果者,易招失敗,就有千山萬水的困難。最好休管閒事,保平安也。\n\n**【籤解】**\n六甲,先男,須防產厄。大命,重難,宜求神。厝宅,有沖犯,宜解祭。婚姻,結姻前三思,要智慧不要勇敢。凡事,宜守,要者,知足不得,能忍自安,而喜進正心行方便。\n\n**【卦運勢】**\n小過卦運勢\n小過者過也。故有對大事,難以達成,但穩重去做能夠達成。\n\n**【籤閣聖意】**\n先說「蟻爻」乃武器也;再說「小過」卦,古人稱為「門前有兵」有成避災害的意思。以上綜括,占者份內的事認真做,份外的事不可望。凡事退守吉、急進凶。看蟻爻圖也能會意:怕事忍事不生事自然無事。\n\n**【卦頭故事 / 判詞】**\n項羽,秦末相人,少有奇才,力能扛鼎,起兵過秦章,九戰皆破之,自稱西楚霸王。後楚漢之爭,困垓下立,卒爲漢將韓信追死自刎。正是:虎落平陽被犬敗,一貼兒都不錯。\n\n**【頁碼】**\n28", "legacy_layers": [ { diff --git a/data/production/draw-pool.report.json b/data/production/draw-pool.report.json index f0f67b4..a8507a5 100644 --- a/data/production/draw-pool.report.json +++ b/data/production/draw-pool.report.json @@ -1,5 +1,5 @@ { - "content_version": "66068302782a9e690bd1d16c208678ac5022036d36a64b62d9a9d296249e9125", + "content_version": "9433062177a366ccd13b3708955704c73d035929e65a0eca3f9a8798d3f03527", "status": "PASSED", "total_entries": 260, "corpora": [ @@ -37,7 +37,7 @@ "edition_title": "北港朝天宮官方六十甲子籤(modern reference edition)", "slip_count": 60, "source_file": "data/corpora/liushijiazi/slip_texts.json", - "source_sha256": "aa54acd813a1d22cca63388ca2a60ff31801de137887b2756fd75dbcdbbc6014", + "source_sha256": "b85e704ea80288b60103a554326461ec3233ab38c21876ce0c941e1bceddbd9c", "data_quality": { "decoded_char_refs": 0 }, @@ -49,5 +49,5 @@ ], "gates_evaluated": 12, "gate_failures": 0, - "pool_sha256": "fc06b19d37fb957543b959c1da7d85e628e885401c48b235fb9655a56fc38fe5" + "pool_sha256": "d66f5c7dbfc47875e9ce5d044969f663256b98d90931c03b437d1954fad09ab6" } \ No newline at end of file diff --git a/docs/LIUSHIJIAZI-OCR-REPAIR-2026-11-14.md b/docs/LIUSHIJIAZI-OCR-REPAIR-2026-11-14.md new file mode 100644 index 0000000..bdcc94a --- /dev/null +++ b/docs/LIUSHIJIAZI-OCR-REPAIR-2026-11-14.md @@ -0,0 +1,73 @@ +# 六十甲子籤 #10/#28 OCR 詩文修復 + +日期:2026-11-14 Asia/Taipei。獨立分支 `fix/liushijiazi-010-028-ocr`,基底 GitHub origin/main `7ae87f6e45526a7dc8ef6f47c24c16d50a444a8d`。只做本機修復與測試,沒有部署、合併 main 或清除使用者資料。本次不是全量逐字核對,不能斷言只有兩支有錯。 + +## 逐句核圖與來源版本 + +直接下載並以影像檢視工具讀取北港朝天宮兩張官方原圖,依右上詩文直書由右至左逐句核對;圖下頁碼分別 10/28,干支乙未/戊午。保留原圖字形「爾」「陽」,不拿其他 carrier 的「汝」「洋」替換。 + +| 籤 | 第一句 | 第二句 | 第三句 | 第四句 | +|---|---|---|---|---| +| 10 乙未 | 花開結子一半枯 | 可惜今年爾虛度 | 漸漸日落西山去 | 勸君不用向前途 | +| 28 戊午 | 於今莫作此當時 | 虎落平陽被犬欺 | 世間凡事何難定 | 千山萬水也遲疑 | + +- [北港官方第 10 圖](https://www.matsu.org.tw/upload_files/web/uploadfile/2024080515/original/240805152108670080.jpg):SHA-256 `000fc7f956b242f456b68bd220c8e3c646cd3544d7d5b80e64d877555e28acfc`。 +- [北港官方第 28 圖](https://www.matsu.org.tw/upload_files/web/uploadfile/2024080515/original/240805152118799412.jpg):SHA-256 `65f2c11da401006caea1168cb987e85ccaf94d23c4ba41abe8657eaf977f0a0f`。 + +兩張的本次下載 SHA-256 均等於 Study 03 concrete_item 在 2026-08-15 的存檔 checksum,URL 同屬 2024-08-05 批次;這次是同一數位影像版本修復,不是換版本。核圖者是 agent,不冒稱 Crystal/人類逐字確認,不升級既有研究、授權或確認狀態。 + +## 錯誤與生成鏈 + +兩筆北港 `att-bg-010`/`att-bg-028` 的 source_text 分別以「右上角籤首資料」「右上籤號與卦象」開頭,接著是原詩前三句,漏掉第四句。不是原詩第一句遺失。 + +確定的傳播鏈:Study 03 `data/attestation.jsonl` → `build_corpus_package.py` → `attestations.json`/`slips.json` → 身分轉錄 JSON/CSV/review XLSX → `build-draw-pool.mjs` → 公開頁用的 `assets/oracles.draw-pool.js`。`build_liushijiazi_layer.py` 也把 reference_text 複製到 `source_texts.json.poem`,故一併重建。 + +Study 03 comparison 原本已含兩支正確四句,與 attestation 不一致。舊 fallback parser 只認七字 CJK,無法辨識七字 OCR 欄位標題,測試可重現它將標題+前三句當四句的弱點;但當年完整 acquisition/OCR temp inputs 未在這個 checkout,不宣稱已還原當年整條執行路徑。現有 align 路徑不應被說成必然失敗。 + +修復保留舊錯文於 `poem-corrections.json.before`,將已核四句寫入 source attestation,再由生成流程重建。`generate_ingest.py` 加入同一 evidence-backed correction hook;未知新讀法中止待核,不自動猜字。原始 OCR evidence 不改;註解其他欄位、其他 carrier 與其餘 58 籤不在本次核圖範圍。 + +新增 `build-liushijiazi-texts.py`,把 reference 詩文同步到既有身分 JSON、CSV、Excel;edition/干支/transcription status 不改。Excel 語意差異只有 E11、E29。CSV 保留原 CRLF;`git -c core.whitespace=cr-at-eol diff --check` 通過。 + +## 舊籤簿相容性 + +260 個 entry ID 與 schema 全部保留;只有 `liushijiazi-010`/`liushijiazi-028` 的 historical_text 改變。content_version 隨內容更新為 `9433062177a366ccd13b3708955704c73d035929e65a0eca3f9a8798d3f03527`。 + +公開頁舊籤簿以 entryId/question/note/ts 保存,bindings v2 以 entry_id 綁首次結果,沒有以 pool content_version 作儲存鍵。離線 VM 使用兩筆虛構舊紀錄,執行實際 DRAW_POLICY 和 showSlip 邏輯,確認相同正規化問題跨殿不重抽、同 ID 取得修正後詩文、日期與私人筆記可恢復,storage 零寫入。沒有改儲存 key、來源、schema 或任何 UI 邏輯。 + +因此未來部署後,既有 #10/#28 以目前資料重新打開時會看到修正詩文,仍是原支籤、原問題、日期及筆記;已匯出的舊圖片或文字不會被追溯更新。VM 與 renderer 測試不是正式站真人瀏覽器驗收;正式站重開、快取行為、ChatGPT 私人 app bundle 均未在本輪實測或更新。 + +## 可重跑測試結果 + +| 測試 | 結果 | +|---|---| +| scoped source/correction/export regression | PASS:兩筆同版修復;其他 records/statuses 不變;JSON/CSV/XLSX 對齊;未知讀法、缺/重複 targets 中止 | +| 已知錯文回灌 mutation | PASS:兩種七字標題分別使 production build 失敗,舊 pool 檔移除(僅隔離 temp fixture) | +| 舊籤簿/筆記/跨殿 bindings offline VM | PASS:260 IDs 穩定、兩筆假資料恢復、無重抽/無 storage writes | +| corpus validator | 517 PASS / 0 FAIL | +| Study 03 validator | 2204 PASS / 0 FAIL | +| Study 03 semantic regression | 211 PASS / 0 FAIL | +| historical layer validator | A1/A1b/A2/A3/A4/A5/A6/A7 全通過 | +| draw-pool regression | 60 PASS / 0 FAIL | +| slip-render regression | 14 PASS / 0 FAIL | +| arrival regression | 36 PASS / 0 FAIL | +| interpretation pool regression | 29 PASS / 0 FAIL | +| 重跑已提交資料生成鏈兩次 | 受影響衍生檔 byte-identical,含 XLSX | + +修復專屬測試與重建指令見 `data/corpora/liushijiazi/README.md`;一般測試: + +```bash +python3 data/corpora/liushijiazi/validate_corpus_package.py +python3 research/oracle-corpus-study-03-liushijiazi-full/validate_full60.py +python3 research/oracle-corpus-study-03-liushijiazi-full/semantic_regression.py +python3 data/corpora/liushijiazi/validate_liushijiazi_layer.py +node scripts/test-draw-pool.mjs +node scripts/test-slip-render.mjs +node scripts/test-arrival.mjs +node scripts/test-interpretation-pool.mjs +``` + +未測:完整外部 acquisition → ingest 重跑(缺當年 inputs);正式站與 ChatGPT 真人使用/快取;其餘 58 籤原圖逐字核對。沒有未解測試失敗。既有未確認註解/異文、license 狀態照舊,不能用此次通過宣稱全部文字正確或可公開再製。 + +## 交付/部署範圍 + +此修復提交只供審查:來源 correction journal、兩筆 attestation、產生的 corpus/exports/draw pool、窄防護與測試文件。公開執行時真正需要換的資料是 draw pool;沒有 runtime UI、CSP、網域、localStorage 遷移或刪除程式。私人 ChatGPT 另有 bundle 的話,必須另外核對其來源與重建流程,不能假定此 repo 改完就已更新。正式服務、main 及使用者紀錄完全未動。 diff --git a/docs/design/2026-11-14-arrival-ink-pass.md b/docs/design/2026-11-14-arrival-ink-pass.md new file mode 100644 index 0000000..8ba4e5f --- /dev/null +++ b/docs/design/2026-11-14-arrival-ink-pass.md @@ -0,0 +1,138 @@ +# The Arrival — ink pass(入廟體驗與視覺升級提案 v1) + +**日期:** 2026-11-14 **作者:** 飛寶(Claude Fable 5.2) **分支:** `fable/arrival-ink`(疊在 `fable/interp-three-halls` 上) +**性質:** 提案+可走的 preview。未 merge、未動正式站、未碰 ChatGPT plugin。 + +## 一、選的方向 + +**灰墨為骨、齊白石式的點色為人氣;全部用程式畫,不用概念圖當素材。** + +從 Murphy 的九張圖裡,我取的是: + +| 取 | 來自 | 取什麼 | +|---|---|---| +| ✔ | 03 灰墨廟埕、04 八大筆意 | 宣紙底、淡墨染的牆與遠樹、留白的埕、一枝橫過天際的老樹 | +| ✔ | 05 齊白石筆意 | 顏色只點在「人會碰的東西」上:硃砂柱、門、燈籠、柑、紅塑膠凳、麻雀 | +| ✔ | 02 灰墨日常、09 藍線生活 | 茶水桌、電扇、塑膠凳、籃子——有人顧的角落,不是擺設 | +| ✘ | 01 三方向(寫實油畫感) | 太寫實;且三張是三種天氣,不是三種廟 | +| ✘ | 06/07/08 藍線建築 | 精緻、對稱、貴氣——README 已指出不合適;08 的神龕正中軸也違反「中軸不預選」 | + +**為什麼不直接用那幾張 PNG:** 它們是單張、未分層、每張的廟都不是同一座;拿來當背景會把門、柱、籤筒焊死, +手機一裁就切到門,三殿也不可能相等。所以這一輪把「同一套筆」做成三支 SVG 濾鏡,整座廟從山門到籤筒都用它畫: + +- `#ink-line` 乾筆線(手抖+墨色濃淡) +- `#ink-wash` 淡墨染(邊緣暈開、濃淡不勻) +- `#ink-rough` 色塊毛邊(硃砂、門扇) + +Kimi 的定位(「與不確定性相處的介面」「一本會呼吸的冊子」)我用在氣質上:畫面安靜但不空,問題有案可放。 +**籤紙沒有動**(`assets/slip.css`、`assets/slip-render.js` 與 main 相同,測試有鎖)。 + +## 二、做了什麼(都在 `paper/arrival.html`) + +| 段落 | 以前 | 現在 | +|---|---|---| +| 山門 | 淡藍線描底紋 | 兩根硃砂柱、一道簷、一條門檻;入內後埕是「落定」的(520ms),不是切換 | +| 廟埕 | CSS 色塊的牆與殿 | 宣紙、淡墨牆(牆頭是一筆)、牆外遠樹、老樹、近柱是一筆濃墨 | +| 殿面 | 十幾個 CSS 盒子拼的立面,隨視窗拉伸 | **一份墨筆立面**(燕尾脊、出簷、額枋、四柱三開間、窗櫺、台基、階、石獅),三殿共用,**固定 8:9 不拉伸** | +| 轉身選殿 | 同 | 機制不變(先轉正、再進殿)。寬螢幕兩側收進紙的留白,一次只正對一殿 | +| 進殿 | 整個埕放大淡出 | **推門**:正對的那一殿門扇打開、門內的光亮起來,然後才走進去 | +| 殿內 | 聖號牌+香爐+籤筒 | 加上樑、柱、神幔、一對燈(會晃、有光暈)、一對燭(火會跳)、兩盤柑;案緣是一筆濃墨 | +| 籤筒 | 白色圓筒 | 竹色的筒、筒裡還有別的籤(按住時輕晃);抽法不變 | +| 生活 | 牆邊的 CSS 小物 | 前景帶的墨筆小景:長凳、萬年青、麻雀(會跳)、茶水桌+電扇+紅塑膠凳+柑、腳踏車、竹掃帚、水桶、金爐(有煙) | +| 桌機 | 430px 的手機欄置中 | 畫面放寬到 1040px:同一座廟多露牆與埕;文字欄維持閱讀寬度 | +| 手機橫放 | 山門的「入內」被擠出畫面(既有問題) | 門檻自動收緊,可捲動 | + +**可動的東西沒有焊在背景上:** 門扇、門內的光、簷下燈籠、殿內的燈與燭火、香煙、樹冠、樹影、麻雀、籤枝、筒裡的籤—— +各自成層,由 CSS 驅動;`prefers-reduced-motion` 全部停下。 + +## 三、保留的規則(測試有鎖) + +- **三殿平等**:一份立面模板、一組尺寸(`--hall-w/h` 設在整條站列上)、同一個推門動作;老樹的樹冠最遠只到第一站的簷角邊,不替任何一殿遮蔭。 +- **中軸不預選**:boot/reload 一律面向中軸空段;空段中央不放任何小景。 +- **先轉正再進殿**:`release` 的 `facedNow` 判準未動。 +- **私人的問題與籤簿**:一事一籤、紙落定即入簿、筆記——未動;沒有新增任何對外請求。 +- **增建殿 fail-closed**:月老用同一份模板,只剩放樣虛線——無門、無光、無獅、無墨染,也沒有任何抽籤路徑。 +- **聲音層**:未動(葉聲的來源位置跟著樹冠的新位置更新了一個數字)。 + +## 四、考據與界線 + +建築語彙讀自王保原手稿的立面圖(簷線、柱間、基座、進深)——黃秀蕙〈王保原藝師手稿—廟宇建築剪黏圖面(一)概述〉。 +**曲率與比例是 Draw One 自己的 roof grammar hypothesis,不是任何一座真廟的量測或臨摹,也不代表所有台灣宮廟** +(這句寫在模板旁,測試有鎖)。八大山人、齊白石只是筆墨方向的參考(虛實、節制、點色),沒有臨摹任何作品。 + +## 五、測過的、沒測到的 + +**測過(本機 headless Chrome)** + +| 套件 | 結果 | +|---|---| +| `test-arrival.mjs`(含新增 R9 ink 契約 11 條) | 50/50 | +| `test-arrival-ink-e2e.mjs`(新;五種視窗:390×844、360×640、844×390、1024×768、1440×900;月老;reduced motion) | 全過(115 條上下,依轉身次數而定) | +| `test-interpretation-e2e.mjs`(解讀層+入簿,跑在新畫面上) | 32/32 | +| `test-interpretation-pool.mjs`/`test-sound.mjs`/`test-slip-render.mjs`/`test-draw-pool.mjs` | 76/68/14/60 | +| `test-sound-e2e.mjs` | 49 過、2 未過——都是沙箱連不到 Google Fonts(產圖要抓字型),main 上同樣這 2 條 | + +`test-arrival-ink-e2e` 的點擊位置由 DOM 算,不寫死座標。 + +**沒測到(請真機看)** + +1. **iPhone Safari 的效能與濾鏡長相。** SVG 濾鏡在 WebKit 的渲染和 Chrome 不完全一樣,轉身時可能掉幀。這是這一輪最大的未知數。若卡:把立面與小景預先轉成點陣圖(同一份 SVG 出圖),互動層不變。 +2. **字型。** 沙箱抓不到 Noto Serif TC,我看到的截圖是替代字型;真機的字距、匾的寬度請看一眼。 +3. **真機的聲音與觸感**(沒改,但畫面節奏變了,推門 380ms+走近 560ms 是否太慢/太快,要用手感判)。 +4. **深色模式、超寬螢幕(>1600px)、Android 低階機**:未測。 +5. **「帶走這支籤」產圖**:流程沒動,但沙箱測不了(同上,字型)。 + +## 六、我自己不滿意、下一輪想補的 + +- **筆還不夠像筆。** 現在的線是等寬筆畫加濾鏡,沒有真正的提按與收鋒;殿面的屋頂染得偏灰、偏糊。要更像八大/齊白石,需要手寫的變寬筆路(或請 Murphy 依這份立面的骨架出「可分層」的筆觸素材:脊、簷、柱、門、樹各一層,透明底)。 +- **手機上埕面下半部仍偏空。** 前景帶補了生活,但還可以更近身(例如你站的簷下:案、茶杯、籤簿就在手邊——01/03 圖的前景桌是好方向)。 +- **石獅只是兩團墨。** 夠寫意,但辨識度低。 +- **手機橫放時殿很小**(畫面高度不夠)。可用,但不好看。 +- **山門還是文字為主。** 門的「跨」只有落定的那半秒;想做成真的一步(門檻在腳下、埕在門框裡先露一角)。 + +## 七、需要你決定的 + +1. 這個方向(灰墨+點色、全程式繪製)對不對?還是要更濃(接近 05)或更淡(接近 03)? +2. 生活物件的密度:現在是「節制」。要不要再多(供桌、拜拜的人影)?人影我這一輪刻意沒畫。 +3. 推門與走近的節奏。 + +## Round 4(2026-11-14 晚):筆路 v2——力道在走勢,不在濃淡 + +回饋來源:Crystal(下筆有力、走勢不軟、上色輕薄;偏好 Murphy v1 的筆觸)、牛牛(結構線清楚、暈染輕;不加物件密度,可少量落葉/掃痕;推門一瞬偏白;匾額裁切、石獅辨識、驗收捷徑可關)、Astra(跨殿原籤掛錯聖號)。 + +### 判斷 + +- v1 的線軟,原因不是太淡,而是**等寬筆畫+抖動濾鏡**:沒有起筆、行筆、收筆。Murphy v1 好看的地方是「一筆有提按、兩頭出鋒、飛白順著筆勢」。 +- Murphy 的 PNG 圖層**沒有直接沿用**:它是影像生成的輸出(不透明合成、與 320×360 模板不逐點對齊、只有屋頂與柱、僅桌機 Chromium 試過),放進來會讓門、光、燈這些要動的東西對不上,也多出數百 KB 的點陣圖。沿用的是它的**筆法**。Opuscar 的 Canvas 筆刷(MIT)也只當參考,沒有帶進程式。 +- 做法:`INKPEN`——每一筆是由中鋒線取樣、依筆勢(`both` 兩頭出鋒/`press` 頓起提收/`post` 立柱/`flick` 挑)算出寬度的**實心形**;飛白是沿筆勢的 evenodd 細縫(真透明),偏在筆的後段。邊緣只用很小的 `#ink-edge` 位移,保持利。seed 固定,三殿仍是同一份字串(三殿平等不變)。 +- 染退後:屋面與牆的墨染降到約 0.2/0.07 以下,只托結構;硃砂柱色薄(.74)而筆實。 + +### 這一輪動了什麼 + +| 項目 | 內容 | +|---|---| +| 殿面 | 正脊燕尾一筆到底+兩挑、簷口一筆、瓦壟、額枋、雀替、台基、階、窗櫺、四柱、門框全部改用 INKPEN | +| 老樹、山門簷、殿內樑柱、供桌、長椅 | 同一支筆 | +| 石獅 | 重畫剪影:頭、鬃、胸、前腿、座,面向門,點睛 | +| 未落成之殿 | 改用 `k-plan` 放樣虛線層(同一份中鋒線),其餘層全關 | +| 推門 | `#threshold`:門內暖光先漫出、殿從光裡定下來,不再露出紙白;reduced motion 與未落成之殿不做 | +| 匾額 | 字級依字數(`--chars`),`max-width: 78%`,不依身分 | +| 掃痕與落葉 | 一處掃痕+一小堆葉、樹下四片;沒有新增物件種類,中軸中央仍留白(窄螢幕也驗) | +| 供桌 | 電扇移上桌面、桌寬縮,讓出中軸 | + +### 沒做/沒測到 + +- iPhone Safari、Android Chrome、LINE 內建瀏覽器的實機觀感與 SVG 濾鏡效能——沙盒只有桌機 Chromium。 +- 真字型(沙盒連不到 Google Fonts)下的匾額字寬。 +- 「站姿匾額裁切」:依字數縮放與上限寬度是防守性修正;若牛牛看到的是別的裁切,需要截圖定位。 +- 福的乙未/戊午修正(本機分支 `fix/liushijiazi-010-028-ocr`)不在這條分支;本輪沒有碰籤詩資料。 + +## Round 5(2026-11-14 夜):驗收後整合 + +- **殿內聖號被捲出畫面(Astra P2,牛牛重現)**:兩個原因都處理。 + 1. 短高規則(`max-height: 720px`)原本排在 `.tube-*`/`.stick` 基礎規則之前,同權重被蓋掉、從未生效;現在移到其後,籤筒 246px、提示上移真的作用。 + 2. 走向籤筒的自動捲動保留(籤筒半露會攔截捲頁手勢),但頂列改為 sticky:回埕永遠在;聖號牌一旦被遮或捲出,頂列出現一行完整聖號(同一個字串)。聖號牌不縮、不搬,三殿同一條規則。 + - 回驗(e2e 新增一節):360×601、390×601、1024×601、1024×768、844×390、390×844——進殿落定後「完整聖號認得出、回埕在畫面內、籤筒整支與提示在畫面內」。 +- **硃砂柱遠看稍躁(牛牛)**:飛白減半(dry 1.1→0.6)、硃砂退一階(.74→.64);筆形不動。 +- **乙未/戊午(福)**:接入 `fix/liushijiazi-010-028-ocr`;260 個 entry id 不變,只有這兩支 `poem_text` 改變。其餘 58 支未逐字核圖,狀態照舊。 +- **合併**:整合在 `fable/arrival-ink`,對 `main` 開 PR、不自行合併——無法從這裡確認 `main` 是否連動正式站(見 PR 說明)。回復點 tag:`restore/main-before-ink-v2`=`7ae87f6`。 diff --git a/docs/testing/qa-cheatsheet.md b/docs/testing/qa-cheatsheet.md index d59424e..fc64261 100644 --- a/docs/testing/qa-cheatsheet.md +++ b/docs/testing/qa-cheatsheet.md @@ -38,6 +38,7 @@ node scripts/test-sound.mjs # 聲音層 source contracts node scripts/test-sound-e2e.mjs # runtime E2E(需 playwright-core+本機 Chromium,無則 SKIP) node scripts/test-interpretation-pool.mjs # 解曰層:三殿 pool、暫緩名單、fail-closed 反例(CI 跑這套) node scripts/test-interpretation-e2e.mjs # 解曰層+紙落定即入簿 runtime E2E(同上,無瀏覽器則 SKIP;SHOTS=目錄 可出截圖) +node scripts/test-arrival-ink-e2e.mjs # 入廟 ink pass:五種視窗裁切、三殿相等、推門、可動層、月老、reduced motion(SHOTS=目錄 可出截圖) ``` E2E 環境變數:`PW_CORE=` 指 playwright-core 路徑、`CHROMIUM=` 指瀏覽器執行檔 diff --git a/paper/arrival.html b/paper/arrival.html index e10939f..62f06f4 100644 --- a/paper/arrival.html +++ b/paper/arrival.html @@ -16,8 +16,9 @@ 空間公共(對誰都一樣),記憶私人(只在你的籤簿與案上)。 ------------------------------------------------------------------ */ :root { - --ground: #d9d2c0; /* 埕的地 */ - --ground-far: #c7bfab; /* 埕的遠處(簷影) */ + --ground: #e9dfc9; /* 埕的地=宣紙(ink pass:紙色回暖,灰交給墨) */ + --ground-far: #ddd1b8; /* 紙的暗處 */ + --xuan-grain: url("data:image/svg+xml,"); --paper: #f5efe2; --ink: #262119; --ink-soft: #6f6757; @@ -33,7 +34,9 @@ font-family: "Noto Sans TC", ui-sans-serif, system-ui, sans-serif; overflow: hidden; } - .app { position: relative; max-width: 430px; height: 100dvh; margin: 0 auto; overflow: hidden; } + /* 桌機不是放大的手機:畫面放寬到 1040px,同一座廟多露一點牆與埕; + 殿面固定長寬比(--hall-w/h 由 buildCourt 依視窗算),文字欄維持閱讀寬度。 */ + .app { position: relative; max-width: 1040px; height: 100dvh; margin: 0 auto; overflow: hidden; } .screen { position: absolute; inset: 0; display: none; flex-direction: column; @@ -46,15 +49,34 @@ 底紋=門檻感:王保原手稿式線描(角上插角草、中央曲團), 佛頭青單色、opacity ≤ .12——是「入廟前」,不是空白 landing。 */ #s-gate { - background: - url("data:image/svg+xml,") 14px 14px / 150px 150px no-repeat, - url("data:image/svg+xml,") calc(100% - 14px) calc(100% - 14px) / 150px 150px no-repeat, - url("data:image/svg+xml,") center 11% / 300px 110px no-repeat, - url("data:image/svg+xml,") center 44% / 280px 280px no-repeat, - var(--ground); + background: var(--xuan-grain), var(--ground); align-items: center; justify-content: center; padding: 0 34px; } + /* 山門(ink pass):兩柱一楣一道門檻——門是用來跨的,不是用來看的。 + 屋脊與簷寫意幾筆;柱是硃砂染;門內留白=埕還沒到。 */ + #s-gate > :not(.gate-ink) { position: relative; z-index: 1; } + #s-gate { overflow-y: auto; } + /* 矮視窗(手機橫放):門檻不能把「入內」擠出畫面 */ + @media (max-height: 560px) { + #s-gate { justify-content: flex-start; padding-top: 16px; padding-bottom: 16px; } + #s-gate .gate-roof { display: none; } + #s-gate .gate-post { top: 0; } + #s-gate .gate-date { margin-bottom: 10px; } + #s-gate .gate-rules { padding: 12px 6px; gap: 6px; } + #s-gate .gate-weather { margin-top: 14px; gap: 8px; } + #s-gate .gate-enter { margin-top: 14px; padding: 8px 26px 8px 30px; } + } + .gate-ink { position: absolute; pointer-events: none; } + .gate-roof { left: -3%; right: -3%; top: calc(-6px + env(safe-area-inset-top)); width: 106%; height: clamp(96px, 17vh, 150px); } + .gate-post { top: clamp(84px, 15vh, 132px); bottom: 0; width: clamp(16px, 4.6vw, 30px); + background: linear-gradient(90deg, rgba(165, 67, 46, 0.5), rgba(165, 67, 46, 0.84) 30%, rgba(150, 58, 40, 0.8) 70%, rgba(165, 67, 46, 0.42)); + filter: url(#ink-rough); } + .gate-post.l { left: clamp(10px, 3.4vw, 34px); } + .gate-post.r { right: clamp(10px, 3.4vw, 34px); } + .gate-sill { left: 0; right: 0; bottom: calc(10px + env(safe-area-inset-bottom)); height: 9px; + background: linear-gradient(90deg, transparent, rgba(30, 26, 20, 0.82) 6%, rgba(30, 26, 20, 0.9) 50%, rgba(30, 26, 20, 0.8) 94%, transparent); + border-radius: 5px; filter: url(#ink-rough); } .gate-rules { border-top: 1px solid rgba(74, 66, 52, 0.5); border-bottom: 1px solid rgba(74, 66, 52, 0.5); @@ -99,7 +121,26 @@ 跑滿整條站列(殿長在牆上,不浮空);殿=凸出牆面的量體(簷+側影+ 門洞+台階落地);柱在站與站之間、1.55x 近景速,正對時在畫框外。 左右交替擴建=Draw One 自己的 geometry hypothesis(非文化依據)。 */ - #s-court { background: var(--ground); } + #s-court { background: var(--xuan-grain), var(--ground); } + /* 門檻:推門到進殿之間不露白——門內的光先漫出來,殿是從光裡定下來的 */ + .threshold { position: absolute; inset: 0; z-index: 25; pointer-events: none; opacity: 0; + background: radial-gradient(58% 44% at 50% 44%, rgba(232, 178, 108, 0.94) 0%, rgba(176, 116, 62, 0.92) 46%, rgba(52, 40, 28, 0.95) 100%); + transition: opacity 360ms ease-in; } + .threshold.on { opacity: 1; } + .threshold.leaving { transition: opacity 620ms ease-out; } + /* 世界回來/跨進來:埕不是切換過來的,是落定的 */ + @keyframes court-arrive { from { opacity: 0; transform: scale(1.045); } to { opacity: 1; transform: none; } } + #s-court.on .court-view { animation: court-arrive 520ms cubic-bezier(0.2, 0.7, 0.2, 1); } + @media (prefers-reduced-motion: reduce) { #s-court.on .court-view { animation: none; } } + /* 寬螢幕:兩側收進紙的留白——一次只正對一殿,鄰殿只在霧裡(不是三張並排的卡) */ + @media (min-width: 700px) { + .court-view::after { + content: ""; position: absolute; inset: 0; pointer-events: none; + background: linear-gradient(90deg, var(--ground) 0%, rgba(233, 223, 201, 0) 13%, rgba(233, 223, 201, 0) 87%, var(--ground) 100%); + } + .desk { padding-left: max(20px, calc(50% - 300px)); padding-right: max(20px, calc(50% - 300px)); } + .sheet { max-width: 600px; margin: 0 auto; border-left: 1.5px solid var(--rule); border-right: 1.5px solid var(--rule); } + } .court-view { position: relative; flex: 1; overflow: hidden; touch-action: pan-y; cursor: grab; @@ -110,13 +151,24 @@ /* 遠景(0.35x):天光與遠簷影 */ .far-strip { position: absolute; inset: 0; will-change: transform; } - .far-sky { + .far-sky { /* 天=留白;只在牆頭上方染一點遠樹 */ position: absolute; left: -200%; right: -200%; top: 0; height: 26%; - background: linear-gradient(180deg, #e3ddcd 0%, #ddd6c4 70%, #d7d0bd 100%); + background: transparent; } - .far-eaveshadow { - position: absolute; left: -200%; right: -200%; top: 0; height: 9%; - background: linear-gradient(180deg, rgba(52, 45, 34, 0.30), transparent); + .far-trees { /* 牆外的樹:淡墨團,0.35x 緩緩錯開——牆外還有世界 */ + position: absolute; left: -200%; right: -200%; top: 9%; height: 17%; + background: + radial-gradient(70px 34px at 60px 78%, rgba(52, 46, 36, 0.20), transparent 70%), + radial-gradient(54px 30px at 112px 64%, rgba(52, 46, 36, 0.16), transparent 70%), + radial-gradient(84px 40px at 250px 72%, rgba(52, 46, 36, 0.17), transparent 70%), + radial-gradient(48px 26px at 318px 86%, rgba(52, 46, 36, 0.13), transparent 70%), + radial-gradient(60px 30px at 452px 80%, rgba(52, 46, 36, 0.15), transparent 70%); + background-size: 560px 100%; background-repeat: repeat-x; + filter: blur(1.2px); + } + .far-eaveshadow { /* 你站在簷下:畫面頂端一道濃墨的簷影 */ + position: absolute; left: -200%; right: -200%; top: 0; height: 7%; + background: linear-gradient(180deg, rgba(38, 33, 25, 0.34), transparent); } /* 中景(1x):連續遠側牆+殿量體 */ @@ -125,27 +177,22 @@ will-change: transform; } /* 牆:跑滿整條站列,殿長在牆上 */ - .stage-strip::before { + .stage-strip::before { /* 牆=一道淡墨染;牆頭是一筆(手抖得剛好的那種),不是色帶 */ content: ""; position: absolute; left: -60%; right: -60%; top: 24%; height: 30%; background: - /* 牆頭瓦壓頂:牆是砌出來的,不是一條色帶 */ - linear-gradient(180deg, #b3ab97 0 2px, rgba(74, 66, 52, 0.30) 2px 3px, transparent 3px) top / 100% 6px no-repeat, - repeating-linear-gradient(90deg, rgba(74, 66, 52, 0.13) 0 2px, transparent 2px 13px) top / 100% 4px no-repeat, - /* 歲月斑與壁腳返潮 */ - radial-gradient(340px 90px at 30% 104%, rgba(74, 66, 52, 0.07), transparent 70%), - radial-gradient(520px 130px at 68% -10%, rgba(245, 239, 226, 0.10), transparent 72%), - radial-gradient(240px 70px at 84% 102%, rgba(74, 66, 52, 0.05), transparent 70%), - linear-gradient(0deg, rgba(74, 66, 52, 0.10), transparent 14%), - linear-gradient(180deg, #cfc8b4 0%, #cac2ad 78%, #c2baa4 100%); - border-top: 1px solid rgba(74, 66, 52, 0.28); - box-shadow: inset 0 -14px 18px -14px rgba(52, 45, 34, 0.35); + url("data:image/svg+xml,") top / 260px 12px repeat-x, + radial-gradient(340px 90px at 30% 104%, rgba(52, 46, 36, 0.10), transparent 70%), + radial-gradient(520px 130px at 68% -10%, rgba(245, 239, 226, 0.14), transparent 72%), + radial-gradient(240px 70px at 84% 102%, rgba(52, 46, 36, 0.07), transparent 70%), + linear-gradient(0deg, rgba(52, 46, 36, 0.10), transparent 14%), + linear-gradient(180deg, rgba(52, 46, 36, 0.07) 0%, rgba(52, 46, 36, 0.035) 70%, rgba(52, 46, 36, 0.07) 100%); } /* 牆腳線=地平線 */ - .stage-strip::after { + .stage-strip::after { /* 牆腳線=地平線 */ content: ""; position: absolute; left: -60%; right: -60%; top: 54%; height: 1px; - background: rgba(74, 66, 52, 0.4); + background: rgba(52, 46, 36, 0.38); } .station { position: relative; flex: 0 0 auto; height: 100%; @@ -153,439 +200,130 @@ will-change: transform, opacity; } - /* 殿=凸出牆面的量體 */ + /* ============ 墨筆殿面(2026-11 ink pass) ============ + 殿=一份寫意墨筆立面(HALL_INK_SVG),三殿共用同一模板(equality): + 燕尾脊、出簷、額枋、四柱三開間、步口退縮、台基與階——骨架讀自王保原手稿的 + 立面語彙(簷線/柱間/基座/進深),是 Draw One 自己的 roof grammar, + 不是任何一座真廟的量測或臨摹。固定長寬比(不拉伸):桌機、手機同一張臉。 + 可動的東西不焊在畫裡:門扇、門內的光、燈籠各自成層。 */ .facade { position: absolute; inset: 0; cursor: pointer; pointer-events: auto; } - /* 凸出的殿身:比牆亮半階、左右各一道側影=進深;落在台基上 */ - .facade .body { - position: absolute; left: 13%; right: 13%; top: 21.5%; bottom: 49.8%; - background: linear-gradient(180deg, #d6cfba 0%, #d1c9b3 100%); - border-left: 1px solid rgba(74, 66, 52, 0.30); - border-right: 1px solid rgba(38, 33, 25, 0.42); - box-shadow: - inset -6px 0 8px -6px rgba(38, 33, 25, 0.4), - inset 6px 0 8px -6px rgba(245, 239, 226, 0.5); - } - /* 步口退縮:明間整面退後半步,簷下才有深度可言 */ - .facade .recess { - position: absolute; left: 27.4%; right: 27.4%; top: 21.5%; bottom: 50%; - background: rgba(38, 33, 25, 0.075); - box-shadow: - inset 0 14px 16px -10px rgba(38, 33, 25, 0.42), - inset 10px 0 12px -9px rgba(38, 33, 25, 0.32), - inset -10px 0 12px -9px rgba(38, 33, 25, 0.32); - } - /* 水車堵:簷下堵帶上一道極淡的曲團草連續紋(礦物青線稿,手稿轉印感) */ - .facade .frieze { - position: absolute; left: 13.6%; right: 13.6%; top: 22.8%; height: 2%; - background: - url("data:image/svg+xml,") center / 28px 10px repeat-x, - rgba(245, 239, 226, 0.16); - border-top: 1px solid rgba(74, 66, 52, 0.28); - border-bottom: 1px solid rgba(74, 66, 52, 0.28); - } - /* 堵面:框飾型彩繪——佛頭青雙線框,中央留白(框在,題材不上) */ - .facade .panel { - position: absolute; top: 30%; bottom: 52.5%; - border: 1px solid rgba(74, 66, 52, 0.22); - background: rgba(38, 33, 25, 0.03); - } - .facade .panel::before { - content: ""; position: absolute; inset: 2px; - border: 1px solid rgba(79, 100, 120, 0.42); - } - .facade .panel::after { - content: ""; position: absolute; inset: 5px; - border: 1px solid rgba(79, 100, 120, 0.20); - } - .facade .panel-l { left: 16.9%; width: 6.5%; } - .facade .panel-r { right: 16.9%; width: 6.5%; } - /* 簷柱與角柱:三開間;柱撐簷,屋頂不再浮空。柱腳有礎 */ - .facade .col { - position: absolute; top: 20%; bottom: 50%; width: 3.2%; - background: - linear-gradient(180deg, transparent 68%, rgba(38, 33, 25, 0.12) 100%), - linear-gradient(90deg, #b6ad96 0%, #a49b81 50%, #8b8269 100%); - border-left: 1px solid rgba(245, 239, 226, 0.35); - border-right: 1px solid rgba(38, 33, 25, 0.4); - } - .facade .col::after { - content: ""; position: absolute; left: -22%; right: -22%; bottom: 0; height: 6.5%; - background: #c6bea9; - border: 1px solid rgba(74, 66, 52, 0.35); - } - .facade .col-ol { left: 12.3%; } - .facade .col-or { right: 12.3%; } - .facade .col-il { left: 24.6%; } - .facade .col-ir { right: 24.6%; } - /* 插角/雀替層:柱樑交接處的草仔曲線(木色骨+青線彩飾,同一 motif 重複) */ - .facade .carve { position: absolute; left: 12%; right: 12%; top: 20.2%; height: 8.5%; } - .facade .carve svg { display: block; width: 100%; height: 100%; } - /* 石獅一對:守門石雕的重量(≈0.85m 含座,以殿門 2.4m 為 world scale)。 - bottom 錨定=任何視窗高度都貼地;DOM 在柱之後=頭臉永不被柱遮。 */ - .facade .lion { - position: absolute; bottom: 44.6%; width: 34px; height: 50px; - } - .facade .lion svg { display: block; width: 100%; height: 100%; } - .facade .lion-l { left: 19.5%; } - .facade .lion-r { right: 19.5%; transform: scaleX(-1); } - /* 供奉軸:門內的神龕/案桌一瞥——被感知,不被展示 */ - .facade .altar { - position: absolute; left: 31.5%; right: 31.5%; top: 28%; bottom: 50%; - overflow: hidden; - } - .facade .altar svg { display: block; width: 100%; height: 100%; } - @keyframes candle { 0%, 100% { opacity: 0.75; } 46% { opacity: 1; } 58% { opacity: 0.85; } } - .facade .altar .flames { animation: candle 5s ease-in-out infinite; } - @media (prefers-reduced-motion: reduce) { .facade .altar .flames { animation: none; } } - /* 燈籠列:廟埕頭頂的場域訊號——小、疏、低垂度,不壓中軸 */ - .lived.lantern-rope { top: 4.6%; height: 1px; background: rgba(74, 66, 52, 0.30); } - .lived.lantern { - top: 5%; width: 15px; height: 18px; - background: radial-gradient(60% 52% at 50% 40%, #b25a48, #92473b 82%); - border-radius: 46% 46% 42% 42% / 56% 56% 44% 44%; - border-top: 2px solid rgba(74, 66, 52, 0.55); - box-shadow: inset 0 -2px 2px rgba(38, 33, 25, 0.25); - } - .lived.lantern::before { /* 吊繩 */ - content: ""; position: absolute; top: -6px; left: 50%; width: 1px; height: 6px; - background: rgba(74, 66, 52, 0.5); - } - .lived.lantern::after { /* 纓 */ - content: ""; position: absolute; bottom: -4px; left: 50%; margin-left: -0.5px; - width: 1px; height: 4px; background: rgba(140, 60, 45, 0.6); - } - /* 台基:殿抬離埕面,階沿見光 */ - .facade .podium { - position: absolute; left: 11%; right: 11%; top: 50%; height: 4.3%; - background: linear-gradient(180deg, #d2cab5 0%, #c3bba5 30%, #b4ac96 100%); - border-top: 1px solid rgba(245, 239, 226, 0.55); - border-bottom: 1px solid rgba(74, 66, 52, 0.35); - box-shadow: - inset 10px 0 10px -9px rgba(38, 33, 25, 0.3), - inset -10px 0 10px -9px rgba(38, 33, 25, 0.3); - } - /* 屋頂(Move 1 roof silhouette):屋面量體+曲線正脊+燕尾收勢+出簷。 - SVG 三殿共用同一模板(equality);出簷寬於殿身,脊探出牆頂(24%)之上, - void 時鄰殿屋脊自然入畫。曲率/斜度為 Draw One 自己的 roof grammar - (漢式宮廟語彙;證據參考王保原營造圖,非任一特定廟的尺寸規格)。 */ - .facade .roof { - position: absolute; left: 2.5%; right: 2.5%; top: 6.5%; height: 15.8%; - } - .facade .roof svg { display: block; width: 100%; height: 100%; overflow: visible; } - /* 簷下影:落在殿身與後方連續牆上=出簷深度(收在建築包絡線內) */ - .facade .eave-shadow { - position: absolute; left: 10%; right: 10%; top: 21.8%; height: 5.5%; - background: linear-gradient(180deg, rgba(38, 33, 25, 0.38), transparent); - } - /* 門洞:退縮明間裡的入口——石作門框、門檻;內裡向下透一點暖 */ - .facade .doorway { - position: absolute; left: 31.5%; right: 31.5%; top: 28%; bottom: 50%; - background: linear-gradient(180deg, rgba(24, 21, 15, 0.9) 0%, rgba(38, 33, 25, 0.74) 55%, rgba(84, 66, 40, 0.5) 100%); - border: 2px solid #b3aa93; border-bottom: 0; - } - .facade .doorway::after { - content: ""; position: absolute; left: -5%; right: -5%; bottom: -2px; height: 5px; - background: linear-gradient(90deg, #8a8168 0%, #9d947c 44% 56%, #8a8168 100%); /* 門檻中段被踏亮 */ - } - .facade .doorway::before { /* 裡面有人:殿內的光極緩地呼吸,不是 portal */ - content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 58%; - background: radial-gradient(80% 95% at 50% 100%, rgba(166, 120, 60, 0.2), transparent 75%); - animation: hearth 9s ease-in-out infinite; - } - @keyframes hearth { 0%, 100% { opacity: 0.55; } 44% { opacity: 0.95; } 62% { opacity: 0.7; } } - @media (prefers-reduced-motion: reduce) { .facade .doorway::before { animation: none; opacity: 0.65; } } - /* 階:三級,由台基落到埕 */ - .facade .steps { - position: absolute; left: 36%; right: 36%; top: 50.9%; height: 4.6%; - clip-path: polygon(7% 0, 93% 0, 100% 100%, 0 100%); - background: linear-gradient(180deg, - #d6ceba 0%, #d6ceba 30%, #a9a18b 30%, #a9a18b 34%, - #cbc3ae 34%, #cbc3ae 64%, #a29a84 64%, #a29a84 68%, - #c0b8a3 68%, #c0b8a3 96%, #99917b 96%, #99917b 100%); - } - .facade .steps::after { /* 階心被走亮:人都從中間上 */ - content: ""; position: absolute; inset: 0; - background: linear-gradient(90deg, transparent 32%, rgba(245, 239, 226, 0.24) 47% 53%, transparent 68%); - } - /* 聖名匾:深木沉金、細框、有年代——莊重安靜,不發光(Round 5.5) */ - .facade .plaque2 { - position: absolute; left: 50%; top: 23.2%; transform: translateX(-50%); - background: linear-gradient(180deg, #3d352a 0%, #2e2822 55%, #262019 100%); + .ink-hall { + position: absolute; left: 50%; bottom: calc(46% - var(--hall-h, 290px) * 0.085); + width: var(--hall-w, 258px); height: var(--hall-h, 290px); + transform: translateX(-50%); + } + .ink-hall svg { display: block; width: 100%; height: 100%; overflow: visible; } + /* 門扇:平常半掩(裡面有人),第二次點=推門——門開了才走進去 */ + .ink-hall .door-l, .ink-hall .door-r { transition: transform 380ms cubic-bezier(0.3, 0.7, 0.2, 1); transform-box: fill-box; } + .ink-hall .door-l { transform-origin: 0% 50%; transform: scaleX(0.74); } + .ink-hall .door-r { transform-origin: 100% 50%; transform: scaleX(0.74); } + .facade.opening .door-l, .facade.opening .door-r { transform: scaleX(0.16); } + /* 門內的光:燭火極緩地呼吸(被感知,不被展示) */ + @keyframes hearth { 0%, 100% { opacity: 0.5; } 44% { opacity: 0.95; } 62% { opacity: 0.68; } } + .ink-hall .hearth { animation: hearth 9s ease-in-out infinite; } + .facade.opening .hearth { animation: none; opacity: 1; transition: opacity 380ms ease; } + /* 簷下燈籠:風來才動,幅度小 */ + @keyframes lantern-sway { 0%, 100% { transform: rotate(-2.2deg); } 50% { transform: rotate(2.6deg); } } + .ink-hall .hl { transform-box: fill-box; transform-origin: 50% 0%; animation: lantern-sway 7.5s ease-in-out infinite; } + .ink-hall .hl.b { animation-duration: 9.2s; animation-delay: -3s; } + @media (prefers-reduced-motion: reduce) { + .ink-hall .hearth, .ink-hall .hl { animation: none; } + .ink-hall .door-l, .ink-hall .door-r { transition: none; } + } + /* 聖名匾:墨底留白字——莊重安靜,不發光;掛在額枋上(隨殿面走,不隨視窗漂) */ + .ink-hall .plaque2 { + position: absolute; left: 50%; top: 46.5%; transform: translate(-50%, -50%); + background: #2a2620; border: 1px solid rgba(20, 16, 11, 0.9); - box-shadow: - inset 0 0 0 2px rgba(191, 160, 94, 0.5), - inset 0 0 0 3px rgba(20, 16, 11, 0.6), - inset 0 1px 1px rgba(245, 239, 226, 0.07), - 0 2px 4px rgba(38, 33, 25, 0.45); + box-shadow: inset 0 0 0 2px rgba(239, 229, 208, 0.34), 0 1px 3px rgba(38, 33, 25, 0.4); font-family: "Noto Serif TC", serif; font-weight: 700; - font-size: 19px; letter-spacing: 0.3em; text-indent: 0.3em; - padding: 8px 12px 7px; white-space: nowrap; - color: #c2a262; - text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5); + font-size: clamp(11px, calc(var(--hall-w, 258px) * 0.212 / var(--chars, 3)), 21px); letter-spacing: 0.26em; text-indent: 0.26em; + padding: 0.32em 0.5em 0.26em; white-space: nowrap; max-width: 78%; + color: #efe5d0; } .facade .last-mark2 { - position: absolute; left: 50%; top: 58%; transform: translateX(-50%); + position: absolute; left: 50%; top: 58.5%; transform: translateX(-50%); font-size: 10px; letter-spacing: 0.2em; color: var(--ink-soft); white-space: nowrap; } /* ============ Lived layer:時間與人的痕跡 ============ - 全部 pointer-events:none、不可互動、不進 facade 模板。 + 全部 pointer-events:none、不可互動、不進殿面模板。 局部聚集+留白+非對稱;位置以站序(相對 void)推算—— - 痕跡屬於地方,不屬於任何一位(無 per-hall styling 分支)。 */ + 痕跡屬於地方,不屬於任何一位(無 per-hall styling 分支)。 + 墨筆小景(INK 表):坐的、吃的、掃的、停的——有人在這裡過日子, + 不是高級祠堂。顏色只點在人會碰的東西上(柑、燈籠、塑膠凳)。 */ .lived { position: absolute; pointer-events: none; } - .lived.bench { /* 等的人坐的長凳(≈1.5m),沒擺得很正 */ - bottom: 44.4%; margin-bottom: 19px; width: 88px; height: 7px; - background: linear-gradient(180deg, #a4967a, #8a7c60); - border: 1px solid rgba(74, 66, 52, 0.4); - transform: rotate(-0.7deg); - } - .lived.bench::before, .lived.bench::after { - content: ""; position: absolute; top: 100%; width: 6px; height: 19px; - background: #857758; border: 1px solid rgba(74, 66, 52, 0.35); border-top: 0; - } - .lived.bench::before { left: 8px; } - .lived.bench::after { right: 8px; transform: rotate(1.2deg); } - .lived.broom { /* 竹掃帚靠牆(≈1.35m) */ - bottom: 44.2%; margin-bottom: 28px; width: 3.5px; height: 12.6%; - background: linear-gradient(180deg, #9a8a68, #8a7a58); - transform: rotate(8deg); transform-origin: 50% 100%; - } - .lived.broom::after { - content: ""; position: absolute; top: 100%; left: 50%; - width: 20px; height: 28px; transform: translateX(-50%); - background: - repeating-linear-gradient(90deg, rgba(74, 66, 52, 0.25) 0 1px, transparent 1px 4px), - linear-gradient(180deg, #a08e66, #8f7d55); - clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%); + .lived svg { display: block; width: 100%; height: 100%; overflow: visible; } + .lived.cushion { /* 階前拜墊:三殿都有(儀式同尊),擺位各自微偏 */ + bottom: 43.2%; width: 28px; height: 9px; margin-left: -14px; + background: radial-gradient(50% 60% at 50% 40%, rgba(150, 70, 50, 0.55) 0 50%, rgba(110, 58, 44, 0.4) 100%); + border-radius: 50%; filter: blur(0.4px); } - .lived.leaves { /* 掃攏成一小堆的葉 */ - top: 53.9%; width: 24px; height: 6px; - background: radial-gradient(60% 100% at 50% 100%, rgba(96, 86, 56, 0.5), rgba(96, 86, 56, 0.15) 80%, transparent); - border-radius: 50% 50% 0 0; - } - .lived.notice { /* 一張普通公告,貼得不很正,字讀不清 */ - top: 38.5%; width: 19px; height: 26px; - background: - repeating-linear-gradient(180deg, transparent 0 5px, rgba(74, 66, 52, 0.28) 5px 6px) content-box, - var(--paper); - padding: 4px 3px; - border: 1px solid rgba(74, 66, 52, 0.35); - box-shadow: 0 1px 1px rgba(38, 33, 25, 0.2); - transform: rotate(-1.6deg); - opacity: 0.95; - } - .lived.stones { /* 增建殿旁的砌石料:工班的真實 */ - bottom: 46.4%; width: 16px; height: 9px; - background: #a9a08a; border: 1px solid rgba(74, 66, 52, 0.4); - box-shadow: - 19px 1px 0 -1px #b2a992, 19px 1px 0 0 rgba(74, 66, 52, 0.35), - 9px -8px 0 -1px #a49b84, 9px -8px 0 0 rgba(74, 66, 52, 0.35); - } - .lived.cushion { /* 階前拜墊:三殿都有(儀式同尊),擺位各自微偏;布色是褪過的 */ - bottom: 43.4%; width: 26px; height: 8px; margin-left: -13px; - background: radial-gradient(50% 60% at 50% 38%, #97775f 0 55%, #7d6350 100%); - border-radius: 50%; - opacity: 0.5; - } - /* (自審刪除:曾有一把靠廊的傘——7px 寬讀不出傘形,只剩一根可疑的斜棍。 - 歧義物是 noise,不是人味。) */ - /* ---- Round 3.5 utility & weathering:有人在管,不只有人在拜 ---- */ - /* (自審刪除 ×2:帚邊的畚斗——16px 只讀得出一顆石頭。同傘,歧義即 noise。) */ - /* ---- Round 5 courtyard life:埕自己的生活(普通的下午) ---- */ - .lived.tree-shade { /* 樹蔭落進埕面=時間、天氣、地方感;光影可過中軸,障礙物不行 */ + .lived.tree-shade { /* 樹蔭落進埕面:淡墨染,光影可過中軸,障礙物不行 */ top: 54%; bottom: 0; background: - radial-gradient(44px 24px at 8% 22%, rgba(74, 66, 52, 0.15), transparent 62%), - radial-gradient(60px 30px at 15% 44%, rgba(74, 66, 52, 0.13), transparent 62%), - radial-gradient(38px 20px at 24% 28%, rgba(74, 66, 52, 0.14), transparent 62%), - radial-gradient(52px 26px at 20% 70%, rgba(74, 66, 52, 0.13), transparent 62%), - radial-gradient(34px 18px at 30% 52%, rgba(74, 66, 52, 0.12), transparent 62%), - radial-gradient(46px 22px at 11% 86%, rgba(74, 66, 52, 0.14), transparent 62%), - radial-gradient(40px 20px at 36% 80%, rgba(74, 66, 52, 0.11), transparent 62%), - radial-gradient(30px 16px at 40% 34%, rgba(74, 66, 52, 0.10), transparent 62%), - radial-gradient(44px 22px at 47% 60%, rgba(74, 66, 52, 0.09), transparent 62%), - radial-gradient(28px 15px at 53% 26%, rgba(74, 66, 52, 0.08), transparent 62%), - radial-gradient(36px 18px at 58% 78%, rgba(74, 66, 52, 0.08), transparent 62%), - radial-gradient(30px 16px at 64% 44%, rgba(74, 66, 52, 0.07), transparent 62%), - radial-gradient(26px 14px at 72% 64%, rgba(74, 66, 52, 0.06), transparent 62%), - radial-gradient(22px 12px at 80% 36%, rgba(74, 66, 52, 0.05), transparent 62%), - radial-gradient(20px 11px at 88% 70%, rgba(74, 66, 52, 0.045), transparent 62%); - } - .lived.tree-shade-wall { /* 枝影掃到牆上一點就好 */ - top: 26%; height: 26%; - background: - radial-gradient(40px 26px at 20% 32%, rgba(74, 66, 52, 0.07), transparent 60%), - radial-gradient(52px 32px at 42% 62%, rgba(74, 66, 52, 0.055), transparent 60%), - radial-gradient(32px 22px at 64% 38%, rgba(74, 66, 52, 0.04), transparent 60%); - } - .lived.tree-canopy { top: -1%; height: 20%; } - .lived.tree-canopy svg { display: block; width: 100%; height: 100%; } - .lived.tree-trunk { top: 4%; height: 55%; width: 46px; } - .lived.tree-trunk svg { display: block; width: 100%; height: 100%; } - .lived.bench-brick { /* 磚砌矮台:有人會坐、會靠、會等人的地方 */ - background: - repeating-linear-gradient(180deg, transparent 0 7px, rgba(74, 66, 52, 0.28) 7px 8px), - repeating-linear-gradient(90deg, transparent 0 14px, rgba(74, 66, 52, 0.12) 14px 15px), - linear-gradient(90deg, #a8836b, #9a7660 55%, #8a6a56); - border: 1px solid rgba(56, 50, 40, 0.4); - } - .lived.bench-brick::before { /* 石板檯面,出沿 */ - content: ""; position: absolute; left: -4px; right: -4px; top: -7px; height: 7px; - background: linear-gradient(180deg, #d5cdb8, #c2baa5); - border: 1px solid rgba(56, 50, 40, 0.4); - } - .lived.bench-brick::after { /* 落地影 */ - content: ""; position: absolute; left: -6%; right: -6%; bottom: -5px; height: 8px; - background: radial-gradient(50% 100% at 50% 0, rgba(38, 33, 25, 0.22), transparent 75%); - } - .lived.bike { bottom: 45.3%; width: 92px; height: 58px; transform: rotate(-6deg); } /* 成人車 ≈1.55m;bottom 錨定貼地 */ - .lived.bike svg { display: block; width: 100%; height: 100%; } - .lived.leafbits { /* 樹下散葉:掃不完的 */ - top: 72%; width: 70px; height: 16px; - background: - radial-gradient(4px 3px at 12% 40%, rgba(96, 86, 56, 0.4), transparent 80%), - radial-gradient(3px 2.5px at 34% 70%, rgba(96, 86, 56, 0.35), transparent 80%), - radial-gradient(4px 3px at 55% 30%, rgba(96, 86, 56, 0.38), transparent 80%), - radial-gradient(3px 2.5px at 76% 60%, rgba(96, 86, 56, 0.3), transparent 80%), - radial-gradient(3px 2.5px at 92% 40%, rgba(96, 86, 56, 0.32), transparent 80%); - } - .lived.stools { /* 疊起的塑膠凳(≈0.45m):用完收好,但疊得不齊 */ - bottom: 44.9%; width: 29px; height: 23px; - background: linear-gradient(90deg, transparent 0 4px, rgba(118, 74, 64, 0.7) 4px 6px, - transparent 6px 23px, rgba(118, 74, 64, 0.7) 23px 25px, transparent 25px) bottom / 100% 10px no-repeat; - } - .lived.stools::before, .lived.stools::after { - content: ""; position: absolute; left: 0; right: 0; height: 6px; - background: linear-gradient(180deg, #a4685a 0 4px, #8c574b 4px); - border-radius: 2px; - } - .lived.stools::before { top: 0; left: 1px; right: -1px; transform: rotate(-1.6deg); } - .lived.stools::after { top: 8px; } - .lived.ghost { /* 撕掉的舊公告:淺一塊的牆,角上還黏著殘膠 */ - top: 39.6%; width: 17px; height: 22px; - background: rgba(245, 239, 226, 0.16); - border: 1px solid rgba(74, 66, 52, 0.10); - transform: rotate(1.1deg); - } - .lived.ghost::before, .lived.ghost::after { - content: ""; position: absolute; width: 4px; height: 3px; - background: rgba(245, 239, 226, 0.45); - } - .lived.ghost::before { top: -1px; left: 0; } - .lived.ghost::after { bottom: 2px; right: 1px; } - .lived.wallpatch { /* 補過的一塊牆:新灰比舊牆平、也比舊牆生 */ - top: 44.2%; width: 27px; height: 19px; - background: rgba(214, 207, 188, 0.55); - border: 1px solid rgba(74, 66, 52, 0.10); - transform: rotate(-0.5deg); - } - .lived.downspout { /* 雨水管沿牆而下,兩個管箍 */ - top: 24.4%; height: 30.2%; width: 5px; - background: linear-gradient(90deg, #b0a791, #9c937d 60%, #877e68); - border-right: 1px solid rgba(38, 33, 25, 0.3); - } - .lived.downspout::before, .lived.downspout::after { - content: ""; position: absolute; left: -2px; right: -2px; height: 3px; - background: #8f866f; border: 1px solid rgba(38, 33, 25, 0.25); - } - .lived.downspout::before { top: 17%; } - .lived.downspout::after { top: 63%; } - .lived.conduit { /* 電管線走牆面進配電箱 */ - top: 24.4%; height: 16.8%; width: 2px; - background: rgba(74, 66, 52, 0.35); - } - .lived.utilbox { /* 配電箱:這裡有水電要管 */ - top: 40.5%; width: 18px; height: 24px; - background: linear-gradient(180deg, #b8b09c, #a49b85); - border: 1px solid rgba(38, 33, 25, 0.4); - box-shadow: 0 1px 2px rgba(38, 33, 25, 0.25); - } - .lived.utilbox::before { - content: ""; position: absolute; left: 3px; right: 3px; top: 4px; bottom: 4px; - border: 1px solid rgba(74, 66, 52, 0.35); - } - .lived.tap { /* 洗埕的水龍頭 */ - top: 49.2%; width: 3.5px; height: 17px; - background: #8f866f; - } - .lived.tap::after { - content: ""; position: absolute; top: 0; left: 0; width: 9px; height: 3.5px; - background: #7d7460; border-radius: 0 1px 1px 0; - } - .lived.bucket { /* 鍍鋅水桶等在龍頭下(≈0.3m) */ - bottom: 45.6%; width: 18px; height: 15px; - background: linear-gradient(90deg, #b7b4a2, #a5a290 45%, #8e8b79); - clip-path: polygon(5% 0, 95% 0, 86% 100%, 14% 100%); - } - .lived.bucket::before { /* 提把歪在一邊 */ - content: ""; position: absolute; top: -7px; left: 3px; width: 13px; height: 8px; - border: 1px solid rgba(56, 50, 40, 0.5); border-bottom: 0; - border-radius: 50% 50% 0 0 / 100% 100% 0 0; - transform: rotate(-8deg); - } - .lived.extinguisher { /* 消防安檢是廟的真日常(≈0.5m) */ - bottom: 45.6%; width: 9px; height: 22px; - background: linear-gradient(90deg, #a24f41, #8a4237 60%, #6f352c); - border-radius: 4px 4px 1px 1px; - } - .lived.extinguisher::after { - content: ""; position: absolute; top: -3px; left: 1.5px; width: 5px; height: 3px; - background: #4a4234; - } - .lived.podpatch { /* 台基補過的一角:石色跟原來對不齊 */ - left: 13.5%; top: 50.5%; width: 13px; height: 9px; - background: rgba(226, 219, 200, 0.75); - border: 1px solid rgba(74, 66, 52, 0.12); - } - /* 未落成(假設性增建):只有放樣輪廓 */ - .station.hypothetical .facade .body { - background: none; - border: 1px dashed rgba(74, 66, 52, 0.5); - box-shadow: none; - } - .station.hypothetical .facade .doorway { - background: rgba(38, 33, 25, 0.06); - border: 1px dashed rgba(74, 66, 52, 0.5); - } - .station.hypothetical .facade .doorway::after { display: none; } - .station.hypothetical .facade .doorway::before { display: none; } /* 未落成,裡面沒有人 */ - /* 放樣中的柱、台基、階:只有放樣輪廓,未砌石 */ - .station.hypothetical .facade .col, - .station.hypothetical .facade .podium, - .station.hypothetical .facade .steps { - background: rgba(38, 33, 25, 0.04); - border: 1px dashed rgba(74, 66, 52, 0.5); - box-shadow: none; clip-path: none; - } - .station.hypothetical .facade .col::after { display: none; } - .station.hypothetical .facade .recess, - .station.hypothetical .facade .frieze, - .station.hypothetical .facade .panel { display: none; } - /* 未落成=未開光:無獅、無供奉、無雕飾彩繪 */ - .station.hypothetical .facade .lion, - .station.hypothetical .facade .altar, - .station.hypothetical .facade .carve { display: none; } - /* 放樣中的屋頂:同一骨架,只剩虛線輪廓(脊與簷口留形,屋面未上瓦) */ - .station.hypothetical .roof .r-face { - fill: none; stroke: rgba(74, 66, 52, 0.5); stroke-width: 1.2; stroke-dasharray: 5 4; - } - .station.hypothetical .roof .r-ridge { - fill: none; stroke: rgba(74, 66, 52, 0.5); stroke-width: 1.2; stroke-dasharray: 5 4; - } - .station.hypothetical .roof .r-eave { stroke: rgba(74, 66, 52, 0.5); stroke-width: 1.5; stroke-dasharray: 5 4; } - .station.hypothetical .roof .r-tiles, - .station.hypothetical .roof .r-eaveline, - .station.hypothetical .roof .r-curl { display: none; } - .station.hypothetical .facade .eave-shadow { display: none; } + radial-gradient(44px 24px at 8% 22%, rgba(52, 46, 36, 0.20), transparent 62%), + radial-gradient(60px 30px at 15% 44%, rgba(52, 46, 36, 0.17), transparent 62%), + radial-gradient(38px 20px at 24% 28%, rgba(52, 46, 36, 0.18), transparent 62%), + radial-gradient(52px 26px at 20% 70%, rgba(52, 46, 36, 0.16), transparent 62%), + radial-gradient(34px 18px at 30% 52%, rgba(52, 46, 36, 0.15), transparent 62%), + radial-gradient(46px 22px at 11% 86%, rgba(52, 46, 36, 0.17), transparent 62%), + radial-gradient(40px 20px at 36% 80%, rgba(52, 46, 36, 0.13), transparent 62%), + radial-gradient(30px 16px at 40% 34%, rgba(52, 46, 36, 0.12), transparent 62%), + radial-gradient(44px 22px at 47% 60%, rgba(52, 46, 36, 0.10), transparent 62%), + radial-gradient(28px 15px at 53% 26%, rgba(52, 46, 36, 0.09), transparent 62%), + radial-gradient(36px 18px at 58% 78%, rgba(52, 46, 36, 0.09), transparent 62%), + radial-gradient(30px 16px at 64% 44%, rgba(52, 46, 36, 0.07), transparent 62%), + radial-gradient(26px 14px at 72% 64%, rgba(52, 46, 36, 0.06), transparent 62%), + radial-gradient(22px 12px at 80% 36%, rgba(52, 46, 36, 0.05), transparent 62%); + animation: shade-drift 14s ease-in-out infinite; + } + @keyframes shade-drift { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } } + .lived.tree { top: -2%; height: 62%; } + .lived.tree .sway { transform-box: fill-box; transform-origin: 10% 60%; animation: canopy-sway 11s ease-in-out infinite; } + @keyframes canopy-sway { 0%, 100% { transform: rotate(-0.5deg); } 50% { transform: rotate(0.7deg); } } + .lived.sprite { bottom: 44.6%; } /* 落地物:bottom 錨在埕面線上,任何視窗高度都貼地 */ + .lived.wallthing { top: 37%; } + .lived.lantern-rope { top: 4.6%; height: 1px; background: rgba(52, 46, 36, 0.42); } + .lived.lantern { + top: 5%; width: 11px; height: 13px; + background: radial-gradient(60% 55% at 45% 40%, rgba(190, 74, 52, 0.92), rgba(160, 58, 43, 0.78) 80%); + border-radius: 46% 46% 44% 44% / 54% 54% 46% 46%; + } + .lived.lantern::before { content: ""; position: absolute; top: -5px; left: 50%; width: 1px; height: 5px; background: rgba(52, 46, 36, 0.5); } + /* 麻雀:埕上唯一會自己動的——偶爾跳兩步,不表演 */ + .lived.sparrow { bottom: 41.5%; width: 22px; height: 16px; animation: sparrow-hop 13s steps(1, end) infinite; } + @keyframes sparrow-hop { + 0%, 100% { transform: translate(0, 0); } 31% { transform: translate(0, 0); } 32% { transform: translate(7px, -3px); } + 33.5% { transform: translate(14px, 0); } 61% { transform: translate(14px, 0); } 62% { transform: translate(8px, -3px) scaleX(-1); } + 63.5% { transform: translate(0, 0) scaleX(-1); } 90% { transform: translate(0, 0) scaleX(-1); } 91% { transform: translate(0, 0); } + } + .lived.leaf { width: 9px; height: 5px; border-radius: 60% 40% 60% 40%; background: rgba(118, 90, 58, 0.78); } + .lived.burner-smoke { + width: 3px; height: 46px; bottom: calc(44.6% + 74px); + background: linear-gradient(180deg, transparent 0%, rgba(90, 84, 72, 0.34) 60%, rgba(90, 84, 72, 0.1) 100%); + filter: blur(2.5px); transform-origin: 50% 100%; animation: smoke-sway 10s ease-in-out infinite; + } + @media (prefers-reduced-motion: reduce) { + .lived.tree-shade, .lived.tree .sway, .lived.sparrow, .lived.burner-smoke { animation: none; } + } + /* 放樣線:平常不顯示 */ + .ink-hall .k-plan { display: none; fill: none; stroke: rgba(52, 46, 36, 0.55); stroke-width: 1.3; stroke-dasharray: 6 5; stroke-linecap: round; } + /* 未落成(假設性增建):同一份立面,只剩放樣的虛線——無筆、無墨染、無門、無光、無獅 */ + .station.hypothetical .ink-hall .k-wash, + .station.hypothetical .ink-hall .k-brush, + .station.hypothetical .ink-hall .k-solid, + .station.hypothetical .ink-hall .k-life { display: none; } + .station.hypothetical .ink-hall .k-plan { display: block; } /* 月老未落成:暫掛的紙名條,不是聖名匾 */ .station.hypothetical .plaque2 { background: var(--paper); color: var(--ink-soft); border: 1px dashed rgba(74, 66, 52, 0.55); - box-shadow: none; text-shadow: none; - font-size: 18px; font-weight: 650; padding: 6px 9px 5px; - opacity: 0.8; + box-shadow: none; + font-weight: 650; padding: 5px 9px 4px; + opacity: 0.85; } .build-mark2 { - position: absolute; left: 50%; top: 40%; transform: translateX(-50%); + position: absolute; left: 50%; top: 62%; transform: translateX(-50%); font-size: 11px; letter-spacing: 0.3em; color: var(--cinnabar); white-space: nowrap; } @@ -613,11 +351,11 @@ } /* 地面(0.9x 鋪面縫+固定光帶+引路) */ - .ground-fixed { + .ground-fixed { /* 埕面=紙;牆腳壓一道淡影,中央留一塊亮(人走的地方) */ position: absolute; left: 0; right: 0; top: 54%; bottom: 0; background: - radial-gradient(46% 24% at 50% 58%, rgba(245, 239, 226, 0.16), transparent 76%), - linear-gradient(180deg, #c9c1ac 0%, var(--ground) 30%, #ddd6c5 100%); + radial-gradient(46% 24% at 50% 58%, rgba(250, 244, 230, 0.34), transparent 76%), + linear-gradient(180deg, rgba(52, 46, 36, 0.13) 0%, transparent 20%); } .ground-joints { position: absolute; top: 54%; bottom: 0; display: flex; @@ -638,11 +376,9 @@ /* 近景(1.55x):柱,站與站之間;正對時在畫框外,轉身時掃過 */ .near-strip { position: absolute; inset: 0; will-change: transform; } - .near-strip i { + .near-strip i { /* 近柱=濃墨一筆(近濃遠淡);轉身時掃過,正對時在畫框外 */ position: absolute; top: -4%; bottom: -2%; width: 34px; - background: linear-gradient(90deg, #b9b19c 0%, #a8a08b 45%, #90886f 100%); - border-left: 1px solid rgba(245, 239, 226, 0.35); - border-right: 2px solid rgba(38, 33, 25, 0.45); + background: linear-gradient(90deg, transparent 0%, rgba(30, 26, 20, 0.78) 16%, rgba(30, 26, 20, 0.9) 52%, rgba(30, 26, 20, 0.62) 84%, transparent 100%); } .turn-hint { @@ -712,21 +448,52 @@ /* ============ 殿 ============ */ /* 殿內的光不是燈箱:上方一團暖(燭),往下沉入地色 */ - #s-hall { + #s-hall { /* 殿內:紙暗一階(屋頂在頭上),上方一團燭的暖 */ background: - radial-gradient(340px 300px at 50% 9%, rgba(190, 150, 90, 0.12), transparent 72%), - linear-gradient(180deg, #cfc7b2 0%, var(--ground) 30%); - overflow-y: auto; + radial-gradient(360px 320px at 50% 10%, rgba(206, 150, 84, 0.16), transparent 72%), + var(--xuan-grain), + linear-gradient(180deg, #d8ccb0 0%, #e1d6bd 34%, var(--ground) 62%); + overflow-y: auto; overflow-x: hidden; } .hall-top { display: flex; justify-content: space-between; align-items: flex-start; padding: calc(10px + env(safe-area-inset-top)) 14px 0; - } + position: sticky; top: 0; z-index: 6; /* 回埕永遠找得到 */ + } + /* 聖號被捲出畫面時(短視窗走向籤筒、讀籤往下捲),頂上留一行小字:你仍知道自己在誰的殿裡。 + 三殿同一條規則;聖號牌本身不縮、不搬。 */ + .hall-top::before { content: ""; position: absolute; inset: 0 0 -10px 0; z-index: -1; opacity: 0; transition: opacity 240ms ease; + background: linear-gradient(180deg, rgba(222, 211, 186, 0.97) 0%, rgba(222, 211, 186, 0.92) 68%, rgba(222, 211, 186, 0) 100%); pointer-events: none; } + .hall-name { align-self: center; font-family: "Noto Serif TC", serif; font-weight: 700; font-size: 15px; letter-spacing: 0.32em; text-indent: 0.32em; + color: var(--ink); opacity: 0; transform: translateY(-3px); transition: opacity 240ms ease, transform 240ms ease; pointer-events: none; } + .hall-top.named::before { opacity: 1; } + .hall-top.named .hall-name { opacity: 1; transform: none; } + @media (prefers-reduced-motion: reduce) { .hall-top::before, .hall-name { transition: none; } } .hall-back { background: none; border: 0; font: inherit; font-size: 13px; letter-spacing: 0.2em; color: var(--ink-soft); cursor: pointer; padding: 8px; } - .hall-body { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 0 20px 40px; } + .hall-body { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; padding: 0 20px 40px; } + .hall-body > :not(.hall-ink) { position: relative; z-index: 1; } + /* 走近:進殿不是換頁,是往裡走兩步 */ + @keyframes hall-arrive { from { opacity: 0; transform: translateY(18px) scale(0.965); } to { opacity: 1; transform: none; } } + #s-hall.on .hall-body { animation: hall-arrive 560ms cubic-bezier(0.2, 0.7, 0.2, 1); transform-origin: 50% 30%; } + /* 殿內的骨:樑、柱、神幔、一對燈——三殿同一份(equality);神不露形 */ + .hall-ink { position: absolute; z-index: 0; left: 50%; top: -6px; width: min(100vw, 600px); height: 600px; + transform: translateX(-50%); pointer-events: none; + -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 62%, transparent 100%); mask-image: linear-gradient(180deg, #000 0%, #000 62%, transparent 100%); } + .hall-ink svg { display: block; width: 100%; height: 100%; } + #s-hall.reading .hall-ink { -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 26%, transparent 50%); mask-image: linear-gradient(180deg, #000 0%, #000 26%, transparent 50%); } + @media (min-width: 700px) { /* 寬螢幕:樑的兩端化進紙裡,不是一個浮在中間的框 */ + .hall-ink { width: 680px; } + .hall-ink svg { -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 7%, #000 93%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0%, #000 7%, #000 93%, transparent 100%); } + } + .hall-ink .hl { transform-box: fill-box; transform-origin: 50% 0%; animation: lantern-sway 8.5s ease-in-out infinite; } + .hall-ink .hl.b { animation-duration: 10s; animation-delay: -4s; } + .hall-ink .glow { animation: hearth 7s ease-in-out infinite; } + @media (prefers-reduced-motion: reduce) { + #s-hall.on .hall-body, .hall-ink .hl, .hall-ink .glow { animation: none; } + } /* 聖號:殿內唯一的不對稱——比誰都大,位於上方 */ .tablet { margin-top: 2px; @@ -737,11 +504,11 @@ letter-spacing: 0.28em; line-height: 1.05; color: var(--ink); - border: 2px solid var(--rule); - border-top: 6px solid var(--rule); + border: 2px solid rgba(38, 33, 25, 0.88); + border-top: 6px solid rgba(38, 33, 25, 0.9); background: var(--paper); padding: 26px 12px 30px; - box-shadow: 0 2px 3px rgba(38, 33, 25, 0.2); + box-shadow: 0 3px 10px rgba(38, 33, 25, 0.22), 0 0 46px 10px rgba(214, 160, 92, 0.16); } .hall-sub { margin-top: 12px; @@ -750,6 +517,31 @@ } /* 案前小香爐:爐裡有灰、枝插得不齊、一縷極輕的煙——剛有人來過 */ .censer { position: relative; width: 54px; height: 58px; margin-top: 22px; pointer-events: none; } + /* 供桌上的東西(隨香爐同現同隱):一對燭、兩盤柑——有人拜,才有這些 */ + .censer .candle { position: absolute; bottom: 0; width: 5px; height: 26px; border-radius: 1px; + background: linear-gradient(90deg, rgba(176, 70, 48, 0.9), rgba(150, 56, 40, 0.9)); } + .censer .candle.l { left: -34px; } .censer .candle.r { right: -34px; } + .censer .candle::before { /* 火 */ + content: ""; position: absolute; left: -1.5px; top: -11px; width: 8px; height: 11px; + background: radial-gradient(50% 60% at 50% 62%, #f3c477 0 38%, rgba(226, 150, 70, 0.85) 60%, transparent 76%); + border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%; + transform-origin: 50% 100%; animation: flame 2.6s ease-in-out infinite; + } + .censer .candle.r::before { animation-duration: 3.1s; animation-delay: -1.2s; } + .censer .candle::after { /* 光暈:光是活的,不焊在背景上 */ + content: ""; position: absolute; left: -37px; top: -44px; width: 80px; height: 80px; border-radius: 50%; + background: radial-gradient(closest-side, rgba(232, 172, 96, 0.26), transparent); + animation: hearth 5.5s ease-in-out infinite; + } + @keyframes flame { 0%, 100% { transform: scale(1, 1) rotate(-2deg); } 35% { transform: scale(0.92, 1.12) rotate(3deg); } 70% { transform: scale(1.05, 0.94) rotate(-1deg); } } + .censer .plate { position: absolute; bottom: 0; width: 30px; height: 20px; + background: + radial-gradient(circle 5.5px at 9px 9px, rgba(206, 118, 44, 0.95) 0 96%, transparent), + radial-gradient(circle 5.5px at 21px 9px, rgba(206, 118, 44, 0.95) 0 96%, transparent), + radial-gradient(circle 5.5px at 15px 5.5px, rgba(214, 130, 52, 0.96) 0 96%, transparent), + linear-gradient(rgba(38, 33, 25, 0.75), rgba(38, 33, 25, 0.75)) 50% 100% / 30px 2.5px no-repeat; } + .censer .plate.l { left: -84px; } .censer .plate.r { right: -84px; } + @media (prefers-reduced-motion: reduce) { .censer .candle::before, .censer .candle::after { animation: none; } } .censer .bowl { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 44px; height: 19px; @@ -783,23 +575,11 @@ @media (prefers-reduced-motion: reduce) { .censer .smoke { animation: none; opacity: 0.3; } } .hall-desk { width: 100%; max-width: 340px; margin-top: 30px; - border-top: 1px solid rgba(74, 66, 52, 0.42); - padding-top: 16px; + border-top: 4px solid rgba(38, 33, 25, 0.8); /* 案緣=一筆濃墨:問題是放在案上的 */ + border-radius: 2px 3px 0 0; + padding-top: 14px; display: grid; gap: 8px; } - /* 儀式不得沉到摺線下(Crystal iPhone 實測:天上聖母籤筒整支在畫面外)—— - 小視窗收斂殿內節奏,讓籤筒上緣進畫面;聖號仍是殿內最大的字 */ - @media (max-height: 720px) { - .hall-top { padding-top: calc(6px + env(safe-area-inset-top)); } - .tablet { --tablet-fs: clamp(42px, 13vw, 52px); padding: 10px 10px 12px; } - .hall-sub { margin-top: 6px; } - .censer { margin-top: 8px; } - .hall-desk { margin-top: 12px; padding-top: 10px; } - .tube-stage { margin-top: 8px; } - .tube-wrap { height: 246px; } /* 削籤枝上升的留白 headroom,筒身圖形要進畫面 */ - .tube-hint { order: -1; margin: 0 0 10px; } /* 提示上移:筒半沉摺線下時,規則不能跟著沉 */ - .stick { bottom: 32px; } /* 底緣維持 214px(246−32)=拉的視覺幾何不變;PULL_DIST 不動 */ - } .present-label { font-size: 11px; letter-spacing: 0.26em; color: var(--ink-soft); } .present-q { font-size: 15px; line-height: 1.8; font-family: "Noto Serif TC", serif; } .present-q.empty { color: var(--ink-soft); font-family: "Noto Sans TC", sans-serif; font-size: 13px; } @@ -817,14 +597,26 @@ border: 1px solid rgba(74, 66, 52, 0.55); border-radius: 10px 10px 3px 3px; } - .tube { - position: absolute; left: 0; bottom: 0; - width: 110px; height: 150px; - background: var(--paper); - border: 1.5px solid var(--rule); - border-radius: 6px 6px 10px 10px; - box-shadow: inset 0 10px 14px -10px rgba(38, 33, 25, 0.5); - } + .tube { /* 竹籤筒:竹色淡染的圓筒,口沿一筆濃墨,筒身兩道竹節 */ + position: absolute; left: 4px; bottom: 0; + width: 102px; height: 150px; + background: + linear-gradient(rgba(38, 33, 25, 0.55), rgba(38, 33, 25, 0.55)) 0 46px / 100% 1.5px no-repeat, + linear-gradient(rgba(38, 33, 25, 0.45), rgba(38, 33, 25, 0.45)) 0 106px / 100% 1.5px no-repeat, + linear-gradient(90deg, #a8946a 0%, #cdbb92 22%, #e2d4b0 46%, #cbb98f 72%, #9f8b62 100%); + border: 2px solid rgba(38, 33, 25, 0.86); + border-top-width: 4px; + border-radius: 7px 7px 12px 12px; + box-shadow: inset 0 12px 14px -10px rgba(38, 33, 25, 0.55), 0 8px 12px -7px rgba(38, 33, 25, 0.4); + } + /* 筒裡其他的籤:你抽的是其中一支,不是唯一的一支。按住時它們輕輕晃一下 */ + .tube-sticks { position: absolute; left: 12px; right: 12px; bottom: 122px; height: 62px; pointer-events: none; + transform-origin: 50% 100%; } + .tube-sticks i { position: absolute; bottom: 0; width: 7px; border-radius: 4px 4px 0 0; + background: linear-gradient(90deg, #dccda8, #cbb98f 55%, #b7a479); border: 1px solid rgba(74, 66, 52, 0.55); border-bottom: 0; } + @keyframes rattle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-2.4deg); } 60% { transform: rotate(1.8deg); } 82% { transform: rotate(-0.8deg); } } + .tube-wrap:active .tube-sticks { animation: rattle 520ms ease-out; } + @media (prefers-reduced-motion: reduce) { .tube-wrap:active .tube-sticks { animation: none; } } .tube::after { content: "籤"; position: absolute; inset: 0; display: grid; place-items: center; @@ -832,6 +624,20 @@ color: rgba(38, 33, 25, 0.7); } .tube-hint { margin-top: 20px; font-size: 12.5px; letter-spacing: 0.14em; color: var(--ink-soft); } + /* (這一段必須排在 .tube-* 與 .stick 的基礎規則之後——同權重,後者勝;先前排在前面,短高規則其實沒有生效) + 儀式不得沉到摺線下(Crystal iPhone 實測:天上聖母籤筒整支在畫面外)—— + 小視窗收斂殿內節奏,讓籤筒上緣進畫面;聖號仍是殿內最大的字 */ + @media (max-height: 720px) { + .hall-top { padding-top: calc(6px + env(safe-area-inset-top)); } + .tablet { --tablet-fs: clamp(42px, 13vw, 52px); padding: 10px 10px 12px; } + .hall-sub { margin-top: 6px; } + .censer { margin-top: 8px; } + .hall-desk { margin-top: 12px; padding-top: 10px; } + .tube-stage { margin-top: 8px; } + .tube-wrap { height: 246px; } /* 削籤枝上升的留白 headroom,筒身圖形要進畫面 */ + .tube-hint { order: -1; margin: 0 0 10px; } /* 提示上移:筒半沉摺線下時,規則不能跟著沉 */ + .stick { bottom: 32px; } /* 底緣維持 214px(246−32)=拉的視覺幾何不變;PULL_DIST 不動 */ + } .stick-stage { margin-top: 34px; display: none; flex-direction: column; align-items: center; gap: 30px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; @@ -960,10 +766,42 @@ + +
+
+ +

一事一籤,不重問

@@ -986,7 +824,7 @@
-
+
@@ -1007,9 +845,14 @@
+
+
@@ -1017,6 +860,8 @@ + +
@@ -1026,6 +871,7 @@
+
@@ -1666,129 +1512,293 @@

籤簿

const DEVDRAW = new URLSearchParams(location.search).get("devdraw") === "1"; /* ------------------------------------------------------------------ - 屋頂模板(Move 1 roof silhouette):三殿同一份 SVG=equality。 - 元素:r-face 屋面(斜坡量體)/r-tiles 瓦壟(極淡,工班圖面感)/ - r-ridge 曲線正脊(兩端燕尾上翹、尾端分岔收勢)/r-eave 簷口厚度/ - r-eaveline 瓦口細線/r-curl 簷角起翹。 - 曲率與比例是 Draw One 的 roof grammar hypothesis(漢式宮廟語彙), - 不是任何一座歷史建築的量測值。 + 墨筆模板(2026-11 ink pass;v2 筆路):整座廟只有一套筆。 + v2 的修正來自 Crystal 的一句話:「線條要有力不軟,跟濃淡比較無關」。 + v1 的線是等寬筆畫+抖動濾鏡——軟。v2 的每一筆是一個有提按的形: + INKPEN.stroke(中鋒線, { w 筆寬, shape 筆勢, dry 飛白, seed }) + → 起筆、行筆、收筆寬度不同;飛白是沿筆勢的細縫(evenodd 真透明),不是雜點。 + 力道在走勢與收放,不在加粗加黑;染(#ink-wash)退到最薄,只托住結構。 + 殿面三殿同一份 HALL_INK_SVG=equality(seed 固定,生成一次、三殿共用同一字串);class 語意: + k-brush 筆(結構線)/k-wash 墨染/k-solid 實塊/k-life 有人在用的東西(門、光、燈、獅) + k-plan 放樣線(平常不顯示;未落成之殿只顯示這一層的虛線)。 + 骨架語彙(燕尾脊、出簷、額枋、四柱三開間、台基、階)讀自王保原手稿的 + 立面圖——曲率與比例是 Draw One 的 roof grammar hypothesis, + 不是任何一座歷史建築的量測值,也不代表所有台灣宮廟。 ------------------------------------------------------------------ */ - const ROOF_SVG = ``; - - /* ------------------------------------------------------------------ - Round 4 sacred presence 模板(三殿同一份=equality;月老全隱藏)。 - 石獅:地方宮廟尺度、只做大輪廓;供奉軸:門內一瞥(神龕輪廓+案桌+ - 爐+燭+花+果),神不露全身——被感知,不被展示;插角:王保原式 - 草仔曲線,一個 motif 鏡射重複(木骨+佛頭青彩飾線)。 - ------------------------------------------------------------------ */ - /* 閩南獅語法(參考《臺灣石獅全圖錄》):頭大身瘦、正面看人、 - 眼大如銅鈴、鼻短如蒜、咧嘴、鬃毛成圈;頸掛紅布條(在地日常)。 */ - const LION_SVG = `

籤簿

function buildCourt() { STATIONS = buildStations(); voidIndex = STATIONS.findIndex((s) => s.void); - const vw = view.clientWidth || Math.min(430, innerWidth); - stationW = Math.round(vw * 0.68); + const vw = view.clientWidth || Math.min(1040, innerWidth); + // 站寬:手機 0.72(殿大一點、鄰殿仍露出可點的一角);寬螢幕 0.68。三殿同一個數字。 + stationW = Math.round(vw * (vw < 700 ? 0.72 : 0.68)); pad0 = Math.round((vw - stationW) / 2); + // 殿面固定長寬比(8:9):寬不過站、高不過畫面高的 49%——手機直幅與桌機橫幅是同一張臉, + // 不拉伸、不裁切門與柱。三殿共用同一組數字(equality)。 + sizeHalls(); stageStrip.innerHTML = ""; const lastHall = store.get(LASTHALL_KEY, null); @@ -1889,24 +1903,17 @@

籤簿

const f = document.createElement("div"); f.className = "facade"; f.dataset.hall = s.id; - // 疊序=建築邏輯:牆身→退縮明間→堵→台基階→門→供奉軸→石獅→柱→插角→屋頂(簷壓柱頭)→簷影 - for (const cls of ["body", "recess", "frieze", "panel panel-l", "panel panel-r", - "podium", "steps", "doorway", "altar", - "col col-ol", "col col-or", "col col-il", "col col-ir", "carve", - "lion lion-l", "lion lion-r", - "roof", "eave-shadow"]) { - const el = document.createElement("div"); - el.className = cls; - if (cls === "roof") el.innerHTML = ROOF_SVG; - else if (cls === "altar") el.innerHTML = ALTAR_SVG; - else if (cls === "carve") el.innerHTML = CARVE_SVG; - else if (cls.startsWith("lion")) el.innerHTML = LION_SVG; - f.appendChild(el); - } + // 殿面=一份墨筆立面(三殿同一模板)+掛在額枋上的聖名匾。 + // 門扇、門內的光、燈籠是模板裡各自成層的活物(CSS 驅動),不焊在畫上。 + const hallEl = document.createElement("div"); + hallEl.className = "ink-hall"; + hallEl.innerHTML = HALL_INK_SVG; const plq = document.createElement("div"); plq.className = "plaque2"; plq.textContent = s.deity; - f.appendChild(plq); + plq.style.setProperty("--chars", String(Math.max(3, s.deity.length))); // 字隨匾:依字數不依身分(同殿內聖號牌的做法) + hallEl.appendChild(plq); + f.appendChild(hallEl); if (s.hypothetical) { const bm = document.createElement("div"); bm.className = "build-mark2"; @@ -1928,12 +1935,6 @@

籤簿

cu.style.transform = `rotate(${((si * 29) % 7) - 3}deg)`; st.appendChild(cu); } - // 中軸右一站的台基角補過(positional;補修是維護,不是位階) - if (si === voidIndex + 1) { - const pp = document.createElement("div"); - pp.className = "lived podpatch"; - st.appendChild(pp); - } } stageStrip.appendChild(st); } @@ -1954,48 +1955,55 @@

籤簿

stageStrip.appendChild(el); return el; }; - // ── Round 5:埕的生活(普通的下午)── + const sprite = (name, x, style) => { + const [w, h, svg] = INK[name]; + const el = put("sprite", x, { width: w + "px", height: h + "px", ...style }); + el.innerHTML = svg; + return el; + }; + // ── 埕的生活(普通的下午)── // 老樹在埕的西端,早於三殿;?halls=4 時仍在工地更外側,永不擋殿。 - // 樹蔭先鋪(物件坐在影子上);人間長在兩側,走向神前的路留在中央。 + // 樹蔭先鋪(物件坐在影子上);人間長在兩側與站界,走向神前的路留在中央。 const tx = -0.25 * stationW; - treeSoundX = tx + 0.2 * stationW; // 葉聲來自樹冠質心(冠幅 tx-0.45W..tx+0.85W),不是樹幹 + treeSoundX = -0.3 * stationW; // 葉聲來自樹冠質心(第一站西側),不是樹幹 put("tree-shade", tx - 0.3 * stationW, { width: Math.round(2.35 * stationW) + "px" }); - put("tree-shade-wall", tx - 0.15 * stationW, { width: Math.round(0.9 * stationW) + "px" }); - put("leafbits", tx + 0.5 * stationW); - put("leafbits", tx + 1.05 * stationW, { top: "82%", width: "50px" }); - // 磚砌矮台兩座:樹蔭下一座(乘涼),遠處一座小的。 - // 錨在站界(殿門中心=strip (i+0.5)W;站界=iW)——永不落在任何殿的正前方 - put("bench-brick", voidIndex * stationW - 0.12 * stationW - 50, { width: "100px", height: "36px", bottom: "36.6%" }); - put("bench-brick", (voidIndex + 2) * stationW + 0.08 * stationW - 35, { width: "70px", height: "26px", bottom: "40%" }); - // 誰的腳踏車靠在牆邊(站界旁;成人車尺度) - put("bike", (voidIndex + 1) * stationW - 62).innerHTML = BIKE_SVG; // 停在站界牆前,離殿身淨空 - // 樹身與樹冠(最後畫:樹在建築之前) - put("tree-trunk", tx - 23).innerHTML = TRUNK_SVG; - put("tree-canopy", tx - 0.45 * stationW, { width: Math.round(1.3 * stationW) + "px" }).innerHTML = CANOPY_SVG; - // 今晨有人掃過:帚靠牆、葉掃攏一小堆(中軸左一站的外緣) - put("broom", (voidIndex - 1 + 0.06) * stationW); - put("leaves", (voidIndex - 1 + 0.045) * stationW + 15); - // 座位角:長凳在用、塑膠凳疊起來收著;旁邊一塊補過的牆 - put("bench", voidIndex * stationW - 34); - put("stools", voidIndex * stationW - 64); - put("wallpatch", voidIndex * stationW - 118); - // 公告牆:現在貼的一張+撕掉那張留下的痕 - put("notice", (voidIndex + 1) * stationW + 8); - put("ghost", (voidIndex + 1) * stationW + 33); - // 雨水管:右二站交界的牆面(附屬構件,不是裝飾) - put("downspout", (voidIndex + 2) * stationW - 3); - // 後勤角(右端牆尾):配電箱+電管線、水龍頭+水桶、滅火器——有人在管 - const endX = (STATIONS.length - 1 + 0.88) * stationW; - put("conduit", endX + 32); - put("utilbox", endX + 25); - put("tap", endX + 52); - put("bucket", endX + 47); - put("extinguisher", endX + 4); - // 增建中的殿旁:一小堆砌石料(工班的真實,不是 disabled 標籤) + // 站界=殿與殿之間的牆前(殿門中心在站中央)——小景永不落在任何殿的正前方, + // 中軸空段的中央也不放東西(治理留白)。 + const B = (i) => i * stationW; // 第 i 站的左界 + // 小景擺在「埕面上、靠你這一側」的前景帶(near=大一點、低一點),不貼牆: + // 手機上殿與殿幾乎相接,牆前沒有空位;前景帶同時把空埕變成有人待的地方。 + const NEAR = { bottom: "30.5%", transform: "scale(1.16)", transformOrigin: "50% 100%" }; + // 樹下:一條長凳、一盆萬年青、一隻麻雀(坐的地方) + sprite("bench", B(voidIndex) - 58, NEAR); + sprite("pot", B(voidIndex) + 34, { ...NEAR, bottom: "33%" }); + put("sparrow", B(voidIndex) + 8, { bottom: "24%" }).innerHTML = INK.sparrow[2]; + // 茶水桌:柑、花、茶壺、電扇、兩張紅塑膠凳——有人顧的地方 + sprite("table", B(voidIndex + 1) - Math.min(96, 0.3 * stationW), { ...NEAR, transform: "scale(1.02)" }); // 窄螢幕也不進中軸中央 + // 誰的腳踏車、竹掃帚、水桶(停的、掃的) + sprite("bike", B(voidIndex + 2) - 62, { ...NEAR, transform: "scale(1.16) rotate(-4deg)" }); + sprite("broom", B(voidIndex + 2) + 44, { ...NEAR, bottom: "33.5%", transform: "rotate(9deg)" }); + sprite("bucket", B(voidIndex + 2) + 30, { ...NEAR, bottom: "27.5%" }); + // 剛掃過:幾道掃痕、一小堆葉(牛牛:少量落葉或掃痕——時間有人在顧) + sprite("sweep", B(voidIndex + 2) - 104, { bottom: "22%" }); + // 樹下落了幾片,還沒掃到(只落在樹這一側;中軸空段中央不落) + [[-0.06, "31%", -20], [0.1, "25%", 34], [0.22, "35.5%", 8], [0.3, "21%", -40]].forEach(([fx, bottom, rot], i) => { + put("leaf", fx * stationW, { bottom, transform: `rotate(${rot}deg)`, opacity: String(0.85 - i * 0.08) }); + }); + // 牆尾(最後一殿之外):金爐,一縷很輕的煙(燒的);旁邊再一盆 + const endX = STATIONS.length * stationW + 10; + sprite("burner", endX); + put("burner-smoke", endX + 27); + sprite("pot", endX + 70, { bottom: "45.2%", transform: "scale(0.86)" }); + // 增建中的殿旁:一條長凳先擺著(工班也要坐) const hyp = STATIONS.findIndex((s) => s.hypothetical); - if (hyp >= 0) put("stones", (hyp + 0.86) * stationW); + if (hyp >= 0) sprite("bench", (hyp + 1) * stationW - 52, { ...NEAR, transform: "scale(1.16) rotate(2deg)" }); + // 樹(最後畫:樹在建築之前) + // 樹高=畫面的六成(老樹比殿高);樹冠最遠只伸到第一站的簷角邊(+0.06W): + // 不替任何一殿遮蔭——樹是埕的,不是誰的。 + const treeW = Math.round((view.clientHeight || Math.max(140, innerHeight - 136)) * 0.62 * 1.3); + put("tree", 0.06 * stationW - treeW, { width: treeW + "px" }).innerHTML = TREE_INK_SVG; // 燈籠列:頭頂一條、小而疏;位置永遠落在半站點——中軸正上方必為空檔 - const vw2 = view.clientWidth || Math.min(430, innerWidth); + const vw2 = view.clientWidth || Math.min(1040, innerWidth); const rope = document.createElement("div"); rope.className = "lived lantern-rope"; rope.style.left = (-vw2) + "px"; @@ -2027,12 +2035,25 @@

籤簿

applyFrame(); } + let hallSizedFor = ""; + function sizeHalls() { + // 埕隱藏時量不到高度:先以「視窗高−案」估,顯示後 applyFrame 會以實測值校正一次。 + const vh = view.clientHeight || Math.max(140, innerHeight - 136); + const key = vh + "x" + stationW; + if (key === hallSizedFor) return; + hallSizedFor = key; + const hallH = Math.round(Math.min(vh * 0.49, stationW * 0.98 * 1.125)); + stageStrip.style.setProperty("--hall-h", hallH + "px"); + stageStrip.style.setProperty("--hall-w", Math.round(hallH / 1.125) + "px"); + } + function applyFrame() { + sizeHalls(); // overflow:hidden 容器仍可能被瀏覽器 focus/click 自動捲動——每幀歸零 if (view.scrollLeft) view.scrollLeft = 0; const app = document.getElementById("app"); if (app.scrollLeft) app.scrollLeft = 0; - const vw = view.clientWidth || Math.min(430, innerWidth); + const vw = view.clientWidth || Math.min(1040, innerWidth); stageStrip.style.transform = `translateX(${pad0 - scroll}px)`; farStrip.style.transform = `translateX(${-scroll * 0.35}px)`; groundJoints.style.transform = `translateX(${(pad0 - scroll) * 0.9}px)`; @@ -2206,13 +2227,23 @@

籤簿

// 聲音與 400ms 轉場同步收窄。月老 fail-closed 同構:增建中無殿內聲態, // 埕的空氣照常經過工地(guard 同 renderHall 的 fail-closed 謂詞,非身分分支)。 if (!hall.hypothetical && hall.corpusId) window.ARRIVAL_SOUND?.space("hall"); + // 推門:正對的那一殿門扇打開、門內的光亮起來,然後才走進去(presentation only; + // 以站的 data-hall 取元素,無身分分支——三殿同一個動作) + const facadeEl = stageStrip.querySelector(`[data-hall="${hall.id}"]`); + facadeEl?.classList.add("opening"); + // 有門可推才有門檻的光(未落成之殿沒有門;reduced motion 不做轉場) + const veil = (!reduceMotion && facadeEl && !hall.hypothetical) ? $("threshold") : null; + if (veil) { veil.classList.remove("leaving"); veil.classList.add("on"); } const court = $("s-court"); + court.style.transformOrigin = "50% 44%"; court.style.transform = "scale(1.5)"; court.style.opacity = "0"; setTimeout(() => { court.style.transform = ""; court.style.opacity = ""; + facadeEl?.classList.remove("opening"); renderHall(hall, { boundEntry }); show("hall"); + if (veil) requestAnimationFrame(() => { veil.classList.add("leaving"); veil.classList.remove("on"); }); }, reduceMotion ? 0 : 400); } @@ -2251,7 +2282,10 @@

籤簿

}); function renderHall(hall, { boundEntry } = {}) { + $("s-hall").classList.remove("reading"); $("tablet").textContent = hall.deity; + $("hallName").textContent = hall.deity; // 聖號捲出畫面時頂上那行小字(同一個字串,不另寫) + nameBar(); // 匾同規格,字隨匾:聖號字數多則字級收斂,匾高(=儀式的位置)不因誰而沉。 // 依字數不依身分(typography, not identity)——四字匾曾把籤筒推出手機畫面。 $("tablet").style.fontSize = hall.deity.length > 3 @@ -2318,6 +2352,14 @@

籤簿

}, reduceMotion ? 0 : 650); } + /* 聖號是否還看得見:看不見(被頂列蓋到或捲出)就讓頂列帶名 */ + function nameBar() { + const top = document.querySelector(".hall-top"), t = $("tablet").getBoundingClientRect(); + top.classList.toggle("named", t.height > 0 && t.top < top.getBoundingClientRect().bottom - 10); + } + $("s-hall").addEventListener("scroll", nameBar, { passive: true }); + window.addEventListener("resize", nameBar); + /* ---------- 拖抽 ---------- */ const PULL_DIST = 130; let pulling = false, startY = 0, ticked = false; @@ -2390,6 +2432,7 @@

籤簿

$("tubeStage").style.display = "none"; $("stickStage").style.display = "none"; $("slipStage").style.display = "flex"; + $("s-hall").classList.add("reading"); // 紙是主角:殿內的柱與樑退到紙的上方,不壓在紙邊 $("slipStage").scrollIntoView({ behavior: reduceMotion ? "auto" : "smooth", block: "start" }); // 紙登場=紙在眼前 const mount = $("slipMount"); mount.innerHTML = ""; diff --git a/research/oracle-corpus-study-03-liushijiazi-full/data/attestation.jsonl b/research/oracle-corpus-study-03-liushijiazi-full/data/attestation.jsonl index dc1b6ad..4e6b254 100644 --- a/research/oracle-corpus-study-03-liushijiazi-full/data/attestation.jsonl +++ b/research/oracle-corpus-study-03-liushijiazi-full/data/attestation.jsonl @@ -7,7 +7,7 @@ {"attestation_id": "att-bg-007", "slip_id": "slip-lsjz-007", "item_id": "item-bg-007", "family_id": "ed-beigang-chaotiangong", "source_text": "雲開月出見分明\n不須進退問前途\n婚姻皆由天註定\n和合清吉萬事成", "numbering_in_source": "乙丑", "title_in_source": "不須進退問前途", "fortune_in_source": "屬金利秋天 宜其西方;不須進退問前途", "commentary_layers": [{"layer_name": "五行方位", "text": "屬金利秋天 宜其西方", "verbatim": true}, {"layer_name": "卦頭", "text": "不須進退問前途", "verbatim": true}, {"layer_name": "聖意(討海/作塭/魚苗等)", "text": "|訂婚|作水|魚苗月中有吉|耕作有收|經商吉者大|月令|", "verbatim": true}], "transcription_method": "ocr", "transcription_by": "agent(autoglm image recognition)", "transcribed_at": "2026-08-15", "text_status": "verbatim_confirmed", "notes": "OCR 逐字轉錄官方圖檔+Crystal 2026-08-15 目視官方圖檔確認 observed transcription(human review;slip-level claim 狀態見 cl-text,divergence 保留)"} {"attestation_id": "att-bg-008", "slip_id": "slip-lsjz-008", "item_id": "item-bg-008", "family_id": "ed-beigang-chaotiangong", "source_text": "禾稻看看結成完\n此事必定兩相全\n回到家中寬心坐\n妻兒鼓舞樂團圓", "numbering_in_source": "乙卯", "title_in_source": "此事必定兩相全", "fortune_in_source": "屬水利冬天 宜其北方;此事必定兩相全", "commentary_layers": [{"layer_name": "五行方位", "text": "屬水利冬天 宜其北方", "verbatim": true}, {"layer_name": "卦頭", "text": "此事必定兩相全", "verbatim": true}, {"layer_name": "聖意(討海/作塭/魚苗等)", "text": "│討海好│六甲│病室居│作事│/│作塭允收│女得賢│移居大吉│功名二運得│/│魚苗大利│婚姻兩成大吉│墳墓地運有官事│明天二缺│", "verbatim": true}], "transcription_method": "ocr", "transcription_by": "agent(autoglm image recognition)", "transcribed_at": "2026-08-15", "text_status": "uncertain", "notes": "OCR 逐字轉錄官方圖檔,未改字;詩文層跨 carrier 交叉一致為佐證;五行/卦頭/聖意層個別欄位疑 OCR 誤讀待人工複核——不因不通順而猜改"} {"attestation_id": "att-bg-009", "slip_id": "slip-lsjz-009", "item_id": "item-bg-009", "family_id": "ed-beigang-chaotiangong", "source_text": "龍虎相隨在深山\n君爾何須背後看\n不知此去相愛悞\n他日與我卻無干", "numbering_in_source": "乙巳", "title_in_source": "君爾何須背後看", "fortune_in_source": "屬火利夏天 宜其南方;君爾何須背後看", "commentary_layers": [{"layer_name": "五行方位", "text": "屬火利夏天 宜其南方", "verbatim": true}, {"layer_name": "卦頭", "text": "君爾何須背後看", "verbatim": true}, {"layer_name": "聖意(討海/作塭/魚苗等)", "text": "討海張有犯/魚苗了戕", "verbatim": true}], "transcription_method": "ocr", "transcription_by": "agent(autoglm image recognition)", "transcribed_at": "2026-08-15", "text_status": "uncertain", "notes": "OCR 逐字轉錄官方圖檔,未改字;詩文層跨 carrier 交叉一致為佐證;五行/卦頭/聖意層個別欄位疑 OCR 誤讀待人工複核——不因不通順而猜改"} -{"attestation_id": "att-bg-010", "slip_id": "slip-lsjz-010", "item_id": "item-bg-010", "family_id": "ed-beigang-chaotiangong", "source_text": "右上角籤首資料\n花開結子一半枯\n可惜今年爾虛度\n漸漸日落西山去", "numbering_in_source": "乙未", "title_in_source": "可惜今年爾虛度", "fortune_in_source": "屬金利秋天;可惜今年爾虛度", "commentary_layers": [{"layer_name": "五行方位", "text": "屬金利秋天", "verbatim": true}, {"layer_name": "卦頭", "text": "可惜今年爾虛度", "verbatim": true}, {"layer_name": "聖意(討海/作塭/魚苗等)", "text": "***第一欄(討海):**/魚苗", "verbatim": true}], "transcription_method": "ocr", "transcription_by": "agent(autoglm image recognition)", "transcribed_at": "2026-08-15", "text_status": "uncertain", "notes": "OCR 逐字轉錄官方圖檔,未改字;詩文層跨 carrier 交叉一致為佐證;五行/卦頭/聖意層個別欄位疑 OCR 誤讀待人工複核——不因不通順而猜改"} +{"attestation_id": "att-bg-010", "slip_id": "slip-lsjz-010", "item_id": "item-bg-010", "family_id": "ed-beigang-chaotiangong", "source_text": "花開結子一半枯\n可惜今年爾虛度\n漸漸日落西山去\n勸君不用向前途", "numbering_in_source": "乙未", "title_in_source": "可惜今年爾虛度", "fortune_in_source": "屬金利秋天;可惜今年爾虛度", "commentary_layers": [{"layer_name": "五行方位", "text": "屬金利秋天", "verbatim": true}, {"layer_name": "卦頭", "text": "可惜今年爾虛度", "verbatim": true}, {"layer_name": "聖意(討海/作塭/魚苗等)", "text": "***第一欄(討海):**/魚苗", "verbatim": true}], "transcription_method": "ocr", "transcription_by": "agent(autoglm image recognition)", "transcribed_at": "2026-08-15", "text_status": "uncertain", "notes": "原始 2026-08-15 註記(歷史轉錄聲明,非本次核驗結論):「OCR 逐字轉錄官方圖檔,未改字;詩文層跨 carrier 交叉一致為佐證;五行/卦頭/聖意層個別欄位疑 OCR 誤讀待人工複核——不因不通順而猜改」;2026-11-14 agent 目視核對同版官方原圖,僅修正詩文四句;非 human confirmation,其他欄位與狀態未升級;原 OCR/逐句修復與影像 SHA-256 見 poem-corrections.json#att-bg-010"} {"attestation_id": "att-bg-011", "slip_id": "slip-lsjz-011", "item_id": "item-bg-011", "family_id": "ed-beigang-chaotiangong", "source_text": "靈雞漸漸見分明\n凡事且看子丑寅\n雲開月出照天下\n郎君即便見太平", "numbering_in_source": "乙酉", "title_in_source": "凡事且看子丑寅", "fortune_in_source": "屬水利冬天;凡事且看子丑寅", "commentary_layers": [{"layer_name": "五行方位", "text": "屬水利冬天", "verbatim": true}, {"layer_name": "卦頭", "text": "凡事且看子丑寅", "verbatim": true}, {"layer_name": "聖意(討海/作塭/魚苗等)", "text": "討海微前多復/魚苗小利", "verbatim": true}], "transcription_method": "ocr", "transcription_by": "agent(autoglm image recognition)", "transcribed_at": "2026-08-15", "text_status": "uncertain", "notes": "OCR 逐字轉錄官方圖檔,未改字;詩文層跨 carrier 交叉一致為佐證;五行/卦頭/聖意層個別欄位疑 OCR 誤讀待人工複核——不因不通順而猜改"} {"attestation_id": "att-bg-012", "slip_id": "slip-lsjz-012", "item_id": "item-bg-012", "family_id": "ed-beigang-chaotiangong", "source_text": "長江風浪漸漸靜\n于今得進可安寧\n必有貴人相扶助\n凶事脫出見太平", "numbering_in_source": "乙亥", "title_in_source": "于今得進可安寧", "fortune_in_source": "屬火利夏天 宜其南方;于今得進可安寧", "commentary_layers": [{"layer_name": "五行方位", "text": "屬火利夏天 宜其南方", "verbatim": true}, {"layer_name": "卦頭", "text": "于今得進可安寧", "verbatim": true}, {"layer_name": "聖意(討海/作塭/魚苗等)", "text": "|魚苗中利家|婚姻者吉成|墳墓地勢官||", "verbatim": true}], "transcription_method": "ocr", "transcription_by": "agent(autoglm image recognition)", "transcribed_at": "2026-08-15", "text_status": "uncertain", "notes": "OCR 逐字轉錄官方圖檔,未改字;詩文層跨 carrier 交叉一致為佐證;五行/卦頭/聖意層個別欄位疑 OCR 誤讀待人工複核——不因不通順而猜改"} {"attestation_id": "att-bg-013", "slip_id": "slip-lsjz-013", "item_id": "item-bg-013", "family_id": "ed-beigang-chaotiangong", "source_text": "命內正逢羅孛關\n用盡心機總未休\n作福問神難得過\n恰是行舟上高灘", "numbering_in_source": "丙子", "title_in_source": "用盡心機總未休", "fortune_in_source": "屬水利冬天;用盡心機總未休", "commentary_layers": [{"layer_name": "五行方位", "text": "屬水利冬天", "verbatim": true}, {"layer_name": "卦頭", "text": "用盡心機總未休", "verbatim": true}, {"layer_name": "聖意(討海/作塭/魚苗等)", "text": "|討海不好|作運防風水|命內逢羅字關|耕作小收|經商失運|月令|/|財失利|婚姻難成|魚苗待養可|奉人難望|送信沉音冥|好上半年|", "verbatim": true}], "transcription_method": "ocr", "transcription_by": "agent(autoglm image recognition)", "transcribed_at": "2026-08-15", "text_status": "uncertain", "notes": "OCR 逐字轉錄官方圖檔,未改字;詩文層跨 carrier 交叉一致為佐證;五行/卦頭/聖意層個別欄位疑 OCR 誤讀待人工複核——不因不通順而猜改"} @@ -25,7 +25,7 @@ {"attestation_id": "att-bg-025", "slip_id": "slip-lsjz-025", "item_id": "item-bg-025", "family_id": "ed-beigang-chaotiangong", "source_text": "總是前途莫心勞\n求神問聖枉是多\n但看雞犬日過後\n不須作福事如何", "numbering_in_source": "戊子", "title_in_source": "求神問聖枉是多", "fortune_in_source": "屬火利夏天 宜其南方;求神問聖枉是多", "commentary_layers": [{"layer_name": "五行方位", "text": "屬火利夏天 宜其南方", "verbatim": true}, {"layer_name": "卦頭", "text": "求神問聖枉是多", "verbatim": true}, {"layer_name": "聖意(討海/作塭/魚苗等)", "text": "|討海|不知好歹|/|作塭|只利求微|/|魚苗|小利|", "verbatim": true}], "transcription_method": "ocr", "transcription_by": "agent(autoglm image recognition)", "transcribed_at": "2026-08-15", "text_status": "uncertain", "notes": "OCR 逐字轉錄官方圖檔,未改字;詩文層跨 carrier 交叉一致為佐證;五行/卦頭/聖意層個別欄位疑 OCR 誤讀待人工複核——不因不通順而猜改"} {"attestation_id": "att-bg-026", "slip_id": "slip-lsjz-026", "item_id": "item-bg-026", "family_id": "ed-beigang-chaotiangong", "source_text": "選出牡丹第一枝\n勸君折取莫遲疑\n世間若問相知處\n萬事逢春正及時", "numbering_in_source": "戊寅", "title_in_source": "勸君折取莫遲疑", "fortune_in_source": "勸君折取莫遲疑;|討海春冬|求財愈磨天|耕作下半年冬好|經商進春好|月令春吉|/|魚苗三月吉|失物在東方|尋人月消尋|送信采源頭|六畜可飼|/|作塭外遇剋刑|探病早平好|出外逢平安就|凡事多吉|治病遇春好|", "commentary_layers": [{"layer_name": "卦頭", "text": "勸君折取莫遲疑", "verbatim": true}, {"layer_name": "聖意(討海/作塭/魚苗等)", "text": "|討海春冬|求財愈磨天|耕作下半年冬好|經商進春好|月令春吉|/|魚苗三月吉|失物在東方|尋人月消尋|送信采源頭|六畜可飼|/|作塭外遇剋刑|探病早平好|出外逢平安就|凡事多吉|治病遇春好|", "verbatim": true}], "transcription_method": "ocr", "transcription_by": "agent(autoglm image recognition)", "transcribed_at": "2026-08-15", "text_status": "uncertain", "notes": "OCR 逐字轉錄官方圖檔,未改字;詩文層跨 carrier 交叉一致為佐證;五行/卦頭/聖意層個別欄位疑 OCR 誤讀待人工複核——不因不通順而猜改"} {"attestation_id": "att-bg-027", "slip_id": "slip-lsjz-027", "item_id": "item-bg-027", "family_id": "ed-beigang-chaotiangong", "source_text": "君爾寬心且自由\n門庭清吉家無憂\n財寶自然終吉利\n凡事無傷不用求", "numbering_in_source": "戊辰", "title_in_source": "門庭清吉家無憂", "fortune_in_source": "屬木利春天 宜其東方;門庭清吉家無憂", "commentary_layers": [{"layer_name": "五行方位", "text": "屬木利春天 宜其東方", "verbatim": true}, {"layer_name": "卦頭", "text": "門庭清吉家無憂", "verbatim": true}, {"layer_name": "聖意(討海/作塭/魚苗等)", "text": "封海先無儀作運有利益魚苗有無微求財得無極", "verbatim": true}], "transcription_method": "ocr", "transcription_by": "agent(autoglm image recognition)", "transcribed_at": "2026-08-15", "text_status": "uncertain", "notes": "OCR 逐字轉錄官方圖檔,未改字;詩文層跨 carrier 交叉一致為佐證;五行/卦頭/聖意層個別欄位疑 OCR 誤讀待人工複核——不因不通順而猜改"} -{"attestation_id": "att-bg-028", "slip_id": "slip-lsjz-028", "item_id": "item-bg-028", "family_id": "ed-beigang-chaotiangong", "source_text": "右上籤號與卦象\n於今莫作此當時\n虎落平陽被犬欺\n世間凡事何難定", "numbering_in_source": "戊午", "title_in_source": "虎落平陽被犬欺", "fortune_in_source": "屬火利夏天 宜其南方;虎落平陽被犬欺", "commentary_layers": [{"layer_name": "五行方位", "text": "屬火利夏天 宜其南方", "verbatim": true}, {"layer_name": "卦頭", "text": "虎落平陽被犬欺", "verbatim": true}, {"layer_name": "聖意(討海/作塭/魚苗等)", "text": "|討海|無利|/|魚苗|不利|", "verbatim": true}], "transcription_method": "ocr", "transcription_by": "agent(autoglm image recognition)", "transcribed_at": "2026-08-15", "text_status": "uncertain", "notes": "OCR 逐字轉錄官方圖檔,未改字;詩文層跨 carrier 交叉一致為佐證;五行/卦頭/聖意層個別欄位疑 OCR 誤讀待人工複核——不因不通順而猜改"} +{"attestation_id": "att-bg-028", "slip_id": "slip-lsjz-028", "item_id": "item-bg-028", "family_id": "ed-beigang-chaotiangong", "source_text": "於今莫作此當時\n虎落平陽被犬欺\n世間凡事何難定\n千山萬水也遲疑", "numbering_in_source": "戊午", "title_in_source": "虎落平陽被犬欺", "fortune_in_source": "屬火利夏天 宜其南方;虎落平陽被犬欺", "commentary_layers": [{"layer_name": "五行方位", "text": "屬火利夏天 宜其南方", "verbatim": true}, {"layer_name": "卦頭", "text": "虎落平陽被犬欺", "verbatim": true}, {"layer_name": "聖意(討海/作塭/魚苗等)", "text": "|討海|無利|/|魚苗|不利|", "verbatim": true}], "transcription_method": "ocr", "transcription_by": "agent(autoglm image recognition)", "transcribed_at": "2026-08-15", "text_status": "uncertain", "notes": "原始 2026-08-15 註記(歷史轉錄聲明,非本次核驗結論):「OCR 逐字轉錄官方圖檔,未改字;詩文層跨 carrier 交叉一致為佐證;五行/卦頭/聖意層個別欄位疑 OCR 誤讀待人工複核——不因不通順而猜改」;2026-11-14 agent 目視核對同版官方原圖,僅修正詩文四句;非 human confirmation,其他欄位與狀態未升級;原 OCR/逐句修復與影像 SHA-256 見 poem-corrections.json#att-bg-028"} {"attestation_id": "att-bg-029", "slip_id": "slip-lsjz-029", "item_id": "item-bg-029", "family_id": "ed-beigang-chaotiangong", "source_text": "枯木可惜未逢春\n如今還在暗中藏\n寬心且守風霜退\n還君依舊作乾坤", "numbering_in_source": "戊申", "title_in_source": "如今還在暗中藏", "fortune_in_source": "如今還在暗中藏;|討海|逐不利|新依舊吉|/|**魚苗**|夏天有利||", "commentary_layers": [{"layer_name": "卦頭", "text": "如今還在暗中藏", "verbatim": true}, {"layer_name": "聖意(討海/作塭/魚苗等)", "text": "|討海|逐不利|新依舊吉|/|**魚苗**|夏天有利||", "verbatim": true}], "transcription_method": "ocr", "transcription_by": "agent(autoglm image recognition)", "transcribed_at": "2026-08-15", "text_status": "uncertain", "notes": "OCR 逐字轉錄官方圖檔,未改字;詩文層跨 carrier 交叉一致為佐證;五行/卦頭/聖意層個別欄位疑 OCR 誤讀待人工複核——不因不通順而猜改"} {"attestation_id": "att-bg-030", "slip_id": "slip-lsjz-030", "item_id": "item-bg-030", "family_id": "ed-beigang-chaotiangong", "source_text": "漸漸看此月中和\n過後須妨未得高\n改變顏色前途去\n凡事必定見重勞", "numbering_in_source": "戊戍", "title_in_source": "過後須妨未得高", "fortune_in_source": "屬木利春天 宜其東方;過後須妨未得高", "commentary_layers": [{"layer_name": "五行方位", "text": "屬木利春天 宜其東方", "verbatim": true}, {"layer_name": "卦頭", "text": "過後須妨未得高", "verbatim": true}], "transcription_method": "ocr", "transcription_by": "agent(autoglm image recognition)", "transcribed_at": "2026-08-15", "text_status": "uncertain", "notes": "OCR 逐字轉錄官方圖檔,未改字;詩文層跨 carrier 交叉一致為佐證;五行/卦頭/聖意層個別欄位疑 OCR 誤讀待人工複核——不因不通順而猜改"} {"attestation_id": "att-bg-031", "slip_id": "slip-lsjz-031", "item_id": "item-bg-031", "family_id": "ed-beigang-chaotiangong", "source_text": "綠柳蒼蒼正當時\n任君此去作乾坤\n花葉結實無殘謝\n福祿自有慶家門", "numbering_in_source": "己丑", "title_in_source": "任君此去作乾坤", "fortune_in_source": "屬火利夏天 宜其南方;任君此去作乾坤", "commentary_layers": [{"layer_name": "五行方位", "text": "屬火利夏天 宜其南方", "verbatim": true}, {"layer_name": "卦頭", "text": "任君此去作乾坤", "verbatim": true}, {"layer_name": "聖意(討海/作塭/魚苗等)", "text": "|討海財務高|作塭貴客高|魚苗見喜可|求财春好夏|", "verbatim": true}], "transcription_method": "ocr", "transcription_by": "agent(autoglm image recognition)", "transcribed_at": "2026-08-15", "text_status": "uncertain", "notes": "OCR 逐字轉錄官方圖檔,未改字;詩文層跨 carrier 交叉一致為佐證;五行/卦頭/聖意層個別欄位疑 OCR 誤讀待人工複核——不因不通順而猜改"} diff --git a/research/oracle-corpus-study-03-liushijiazi-full/generate_ingest.py b/research/oracle-corpus-study-03-liushijiazi-full/generate_ingest.py index 88fb3d8..4c50ea6 100644 --- a/research/oracle-corpus-study-03-liushijiazi-full/generate_ingest.py +++ b/research/oracle-corpus-study-03-liushijiazi-full/generate_ingest.py @@ -5,6 +5,7 @@ Output: data/*.jsonl + eligibility_report.json (self-contained package) """ import json, re, os, hashlib, glob, sys +from poem_corrections import apply_corrections BASE = os.path.dirname(os.path.abspath(__file__)) # 依賴注入:STUDY03_TMP 指向 OCR/acquisition 產物目錄(北港 ocr/NN.txt、新港 ocr/hsk_NN.txt、fs60_full.json 等)。 @@ -512,6 +513,7 @@ def shengyi_of(txt): "supersedes": None}) # ---------- write ---------- +apply_corrections(attestation) files = {"corpus": corpus, "edition_family": edition_family, "source_record": source_record, "independence_group": independence_group, "concrete_item": concrete_item, "slip": slip, "attestation": attestation, "variant_group": variant_group, "temple_adoption": temple_adoption, diff --git a/research/oracle-corpus-study-03-liushijiazi-full/poem-corrections.json b/research/oracle-corpus-study-03-liushijiazi-full/poem-corrections.json new file mode 100644 index 0000000..41fef1f --- /dev/null +++ b/research/oracle-corpus-study-03-liushijiazi-full/poem-corrections.json @@ -0,0 +1,37 @@ +{ + "schema_version": 1, + "corrections": [ + { + "attestation_id": "att-bg-010", + "slip_number": 10, + "ganzhi": "乙未", + "source_url": "https://www.matsu.org.tw/upload_files/web/uploadfile/2024080515/original/240805152108670080.jpg", + "source_sha256": "000fc7f956b242f456b68bd220c8e3c646cd3544d7d5b80e64d877555e28acfc", + "source_edition": "北港朝天宮官方圖檔;2024-08-05 URL 批次;本次下載與 2026-08-15 concrete_item SHA-256 相同", + "observed_at": "2026-11-14", + "observation_method": "agent_visual_image_review", + "human_confirmation": false, + "scope": "僅右上詩文四句;未重核其他註解、其他 carrier 或其餘 58 籤", + "before": "右上角籤首資料\n花開結子一半枯\n可惜今年爾虛度\n漸漸日落西山去", + "after": "花開結子一半枯\n可惜今年爾虛度\n漸漸日落西山去\n勸君不用向前途", + "reason": "七字 OCR 欄位標題誤納為詩句,原詩前三句保留、第四句遭截斷;依原圖直書右至左逐句修復,非異文替換", + "legacy_notes": "OCR 逐字轉錄官方圖檔,未改字;詩文層跨 carrier 交叉一致為佐證;五行/卦頭/聖意層個別欄位疑 OCR 誤讀待人工複核——不因不通順而猜改" + }, + { + "attestation_id": "att-bg-028", + "slip_number": 28, + "ganzhi": "戊午", + "source_url": "https://www.matsu.org.tw/upload_files/web/uploadfile/2024080515/original/240805152118799412.jpg", + "source_sha256": "65f2c11da401006caea1168cb987e85ccaf94d23c4ba41abe8657eaf977f0a0f", + "source_edition": "北港朝天宮官方圖檔;2024-08-05 URL 批次;本次下載與 2026-08-15 concrete_item SHA-256 相同", + "observed_at": "2026-11-14", + "observation_method": "agent_visual_image_review", + "human_confirmation": false, + "scope": "僅右上詩文四句;未重核其他註解、其他 carrier 或其餘 58 籤", + "before": "右上籤號與卦象\n於今莫作此當時\n虎落平陽被犬欺\n世間凡事何難定", + "after": "於今莫作此當時\n虎落平陽被犬欺\n世間凡事何難定\n千山萬水也遲疑", + "reason": "七字 OCR 欄位標題誤納為詩句,原詩前三句保留、第四句遭截斷;依原圖直書右至左逐句修復,非異文替換", + "legacy_notes": "OCR 逐字轉錄官方圖檔,未改字;詩文層跨 carrier 交叉一致為佐證;五行/卦頭/聖意層個別欄位疑 OCR 誤讀待人工複核——不因不通順而猜改" + } + ] +} diff --git a/research/oracle-corpus-study-03-liushijiazi-full/poem_corrections.py b/research/oracle-corpus-study-03-liushijiazi-full/poem_corrections.py new file mode 100644 index 0000000..cffe198 --- /dev/null +++ b/research/oracle-corpus-study-03-liushijiazi-full/poem_corrections.py @@ -0,0 +1,42 @@ +"""Evidence-backed poem repairs; original OCR stays in the correction journal. + +This is agent image review, not human approval or authenticity/license upgrade. +Only the named Beigang attestations are corrected; other carriers stay intact. +""" +import json +from pathlib import Path + +CORRECTIONS = json.loads(Path(__file__).with_name("poem-corrections.json").read_text(encoding="utf-8"))["corrections"] + + +def apply_corrections(rows): + for correction in CORRECTIONS: + matches = [r for r in rows if r["attestation_id"] == correction["attestation_id"]] + if len(matches) != 1: + raise ValueError(f"Missing/duplicate correction target: {correction['attestation_id']}") + row = matches[0] + if row["numbering_in_source"] != correction["ganzhi"]: + raise ValueError("Correction target edition/numbering mismatch") + if row["source_text"] not in (correction["before"], correction["after"]): + raise ValueError(f"Unexpected transcription; review before overriding {row['attestation_id']}") + row["source_text"] = correction["after"] + note = (f"2026-11-14 agent 目視核對同版官方原圖,僅修正詩文四句;" + f"非 human confirmation,其他欄位與狀態未升級;" + f"原 OCR/逐句修復與影像 SHA-256 見 poem-corrections.json#{row['attestation_id']}") + row["notes"] = ("原始 2026-08-15 註記(歷史轉錄聲明,非本次核驗結論):「" + + correction["legacy_notes"] + "」;" + note) + return rows + + +def validate_corrections(rows): + for correction in CORRECTIONS: + matches = [r for r in rows if r["attestation_id"] == correction["attestation_id"]] + if len(matches) != 1 or matches[0]["source_text"] != correction["after"]: + raise ValueError(f"Stale/unreviewed poem: {correction['attestation_id']}; apply poem-corrections.json first") + + +if __name__ == "__main__": + path = Path(__file__).parent / "data/attestation.jsonl" + rows = [json.loads(line) for line in path.read_text(encoding="utf-8").splitlines()] + apply_corrections(rows) + path.write_text("".join(json.dumps(row, ensure_ascii=False) + "\n" for row in rows), encoding="utf-8") diff --git a/scripts/build-draw-pool.mjs b/scripts/build-draw-pool.mjs index 2a4c0b6..d4d332c 100644 --- a/scripts/build-draw-pool.mjs +++ b/scripts/build-draw-pool.mjs @@ -154,6 +154,9 @@ for (const spec of MANIFEST) { for (const s of slips) { const id = `${spec.corpus_id}#${s.slip_number}`; s.poem_text = decodeCharRefs(s.poem_text ?? "", decoded); + if (/右上角籤首資料|右上籤號與卦象/.test(s.poem_text)) { + gate(`${id}/no-ocr-heading`, false, "known OCR annotation in poem_text; repair source transcription first"); + } s.original_slip_label = decodeCharRefs(s.original_slip_label ?? "", decoded); if (RESIDUAL_ENTITY.test(s.poem_text) || RESIDUAL_ENTITY.test(s.original_slip_label)) { gate(`${id}/no-residual-entities`, false, `undecodable entity remains in text`); diff --git a/scripts/build-liushijiazi-texts.py b/scripts/build-liushijiazi-texts.py new file mode 100644 index 0000000..f0080fb --- /dev/null +++ b/scripts/build-liushijiazi-texts.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python3 +"""Sync reference poems into the curated identity export, CSV and review workbook. + +Preserves identity/edition/status metadata. Requires openpyxl for the existing +review workbook; no runtime/browser storage is accessed. Run after corpus build. +""" +import csv +import io +import json +from pathlib import Path +from openpyxl import load_workbook + +ROOT = Path(__file__).resolve().parents[1] +CORPUS = ROOT / "data/corpora/liushijiazi" + + +def main(): + refs = json.loads((CORPUS / "slips.json").read_text(encoding="utf-8")) + identity_path = CORPUS / "slip_texts.json" + identity_source = identity_path.read_text(encoding="utf-8") + identity = json.loads(identity_source) + by_number = {row["slip_number"]: row for row in refs} + if len(by_number) != 60 or len(identity["slips"]) != 60: + raise ValueError("Expected 60 unique reference and identity records") + for row in identity["slips"]: + ref = by_number[row["slip_number"]] + if row["edition_id"] != ref["reference_edition_id"] or row["original_slip_label"] != ref["ganzhi"]["beigang_official_list"]: + raise ValueError("Reference identity changed; review required") + row["poem_text"] = ref["reference_text"] + + csv_path = CORPUS / "slip_texts.csv" + with csv_path.open(encoding="utf-8", newline="") as handle: + reader = csv.DictReader(handle) + fields, csv_rows = reader.fieldnames, list(reader) + poems = {row["slip_number"]: row["poem_text"] for row in identity["slips"]} + if len(csv_rows) != 60 or {int(row["slip_number"]) for row in csv_rows} != set(poems): + raise ValueError("CSV identity mismatch") + for row in csv_rows: + row["poem_text"] = poems[int(row["slip_number"])].replace("\n", ";") + + workbook_path = CORPUS / "slip_texts_review.xlsx" + workbook = load_workbook(workbook_path) + sheet = workbook["slip_texts"] + columns = {cell.value: cell.column for cell in sheet[1]} + if sheet.max_row != 61: + raise ValueError("Review workbook record count mismatch") + changed = False + seen = set() + for index in range(2, sheet.max_row + 1): + number = int(sheet.cell(index, columns["slip_number"]).value) + seen.add(number) + cell = sheet.cell(index, columns["poem_text"]) + value = poems[number].replace("\n", ";") + if cell.value != value: + cell.value = value + changed = True + if seen != set(poems): + raise ValueError("Review workbook identity mismatch") + + identity_path.write_text(json.dumps(identity, ensure_ascii=False, indent=2) + ("\n" if identity_source.endswith("\n") else ""), encoding="utf-8") + output = io.StringIO(newline="") + writer = csv.DictWriter(output, fieldnames=fields) + writer.writeheader() + writer.writerows(csv_rows) + csv_path.write_bytes(output.getvalue().encode("utf-8")) + if changed: + workbook.save(workbook_path) + print("Synced 60 reference poems into JSON/CSV/XLSX; identity/status metadata preserved") + + +if __name__ == "__main__": + main() diff --git a/scripts/test-arrival-ink-e2e.mjs b/scripts/test-arrival-ink-e2e.mjs new file mode 100644 index 0000000..221a12d --- /dev/null +++ b/scripts/test-arrival-ink-e2e.mjs @@ -0,0 +1,169 @@ +#!/usr/bin/env node +/** + * test-arrival-ink-e2e.mjs — 入廟體驗 ink pass 的 runtime 驗收(手機+桌機裁切、三殿相等、可動層)。 + * + * Run: node scripts/test-arrival-ink-e2e.mjs + * Needs playwright-core + a local Chromium/Chrome; without them it SKIPs (exit 0). + * PW_CORE=/path/to/node_modules/playwright-core CHROMIUM=/path/to/chrome SHOTS=/dir(另存截圖) + * + * 點擊位置一律由 DOM 算(不寫死座標)——版面改了,測試不該跟著卡住。 + */ +import { existsSync, mkdirSync } from "node:fs"; +import { dirname, join } from "node:path"; +import { fileURLToPath, pathToFileURL } from "node:url"; + +const ROOT = join(dirname(fileURLToPath(import.meta.url)), ".."); +let chromium; +for (const p of [process.env.PW_CORE, "/opt/npm-tools/node_modules/playwright-core"].filter(Boolean)) { + try { ({ chromium } = await import(pathToFileURL(join(p, "index.mjs")).href)); break; } catch {} +} +if (!chromium) { try { ({ chromium } = await import("playwright-core")); } catch {} } +if (!chromium) { console.log("SKIP: playwright-core not available — runtime assertions not run here."); process.exit(0); } +const executablePath = [process.env.CHROMIUM, "/usr/bin/google-chrome", "/usr/bin/chromium", "/usr/bin/chromium-browser", + "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"].filter(Boolean).find((p) => existsSync(p)); +if (!executablePath) { console.log("SKIP: no local Chromium found — set CHROMIUM=/path/to/binary."); process.exit(0); } + +let passed = 0, failed = 0; +const check = (name, ok, detail = "") => { if (ok) { passed++; console.log(` ✓ ${name}`); } else { failed++; console.error(` ✗ ${name}${detail ? " — " + detail : ""}`); } }; +const SHOTS = process.env.SHOTS || null; if (SHOTS) mkdirSync(SHOTS, { recursive: true }); +const browser = await chromium.launch({ executablePath, args: ["--no-sandbox", "--autoplay-policy=no-user-gesture-required"] }); +const pageURL = (q = "") => pathToFileURL(join(ROOT, "paper", "arrival.html")).href + q; + +// 站的可點位置(畫面內、該站可見部分的中點);faced=正對與否;box=殿面在畫面上的框 +const station = (page, hallId) => page.evaluate((id) => { + const f = document.querySelector(`[data-hall="${id}"]`); const v = document.getElementById("courtView").getBoundingClientRect(); + const r = f.getBoundingClientRect(); const h = f.querySelector(".ink-hall").getBoundingClientRect(); + const x0 = Math.max(r.left, v.left) + 3, x1 = Math.min(r.right, v.right) - 3; + return { x: (x0 + x1) / 2, y: v.top + v.height * 0.36, visible: x1 > x0, + box: { l: h.left, r: h.right, t: h.top, b: h.bottom, w: h.width, h: h.height }, view: { l: v.left, r: v.right, t: v.top, b: v.bottom, w: v.width } }; +}, hallId); +const settled = (page) => page.waitForFunction(() => { + const a = document.getElementById("stageStrip").style.transform; window.__t = window.__t === a ? window.__t : (window.__n = 0, a); + return (window.__n = (window.__n || 0) + 1) > 12; }, null, { polling: 50, timeout: 8000 }); +const on = (page, id) => page.$eval("#" + id, (el) => el.classList.contains("on")); + +const VIEWPORTS = [["手機直 390×844", 390, 844, true], ["小手機 360×640", 360, 640, true], ["手機橫 844×390", 844, 390, true], + ["平板 1024×768", 1024, 768, false], ["桌機 1440×900", 1440, 900, false]]; +const HALLS = ["guanyin", "mazu", "guandi"]; + +for (const [label, w, h, touch] of VIEWPORTS) { + console.log(`▍${label}`); + const ctx = await browser.newContext({ viewport: { width: w, height: h }, hasTouch: touch }); + const page = await ctx.newPage(); + const errs = [], reqs = []; + page.on("pageerror", (e) => errs.push(String(e))); + page.on("console", (m) => { if (m.type() === "error" && !/fonts\.(googleapis|gstatic)|ERR_|Failed to load resource/.test(m.text())) errs.push(m.text()); }); + page.on("request", (r) => reqs.push(r.url())); + await page.goto(pageURL("?devdraw=1")); + check("山門:規矩與入內都在畫面內", await page.evaluate(() => { const r = document.getElementById("enterBtn").getBoundingClientRect(); return r.top > 0 && r.bottom < innerHeight; })); + await page.click("#enterBtn"); await page.waitForTimeout(700); + const facing0 = await page.evaluate(() => document.getElementById("walkHint").textContent); + check("入內落在埕、面向中軸空段(不預選任何一殿)", (await on(page, "s-court")) && facing0.includes("左右轉身")); + // 中軸留白:空段中央 ±15% 站寬內沒有任何小景 + const voidClear = await page.evaluate(() => { + const v = document.querySelector(".void-station").getBoundingClientRect(); const cx = v.left + v.width / 2, half = v.width * 0.15; + return [...document.querySelectorAll(".lived.sprite, .lived.sparrow")].every((el) => { const r = el.getBoundingClientRect(); return r.right < cx - half || r.left > cx + half; }); + }); + check("中軸空段中央不放東西", voidClear); + if (SHOTS) await page.screenshot({ path: join(SHOTS, `${w}x${h}-void.png`) }); + + const boxes = {}; + for (const id of HALLS) { + // 轉到正對:非正對的點擊只轉身(可能要兩次:先轉到鄰站) + for (let i = 0; i < 4; i++) { + const s = await station(page, id); + const centered = Math.abs((s.box.l + s.box.r) / 2 - (s.view.l + s.view.r) / 2) < 3; + if (centered) break; + if (s.visible) { await page.mouse.click(s.x, s.y); } + else { const dir = s.box.l > s.view.r ? 1 : -1; const v = s.view; await page.mouse.move((v.l + v.r) / 2, v.t + 60); await page.mouse.down(); + await page.mouse.move((v.l + v.r) / 2 - dir * v.w * 0.5, v.t + 60, { steps: 6 }); await page.mouse.up(); } + await settled(page); + check(`${id}:轉身不會直接進殿`, await on(page, "s-court")); + } + const s = await station(page, id); boxes[id] = s.box; + check(`${id}:正對時殿面完整在畫面內(脊、柱、門、階都不被裁)`, s.box.l >= s.view.l - 1 && s.box.r <= s.view.r + 1 && s.box.t >= s.view.t - 1 && s.box.b <= s.view.b + 1, + JSON.stringify(s.box)); + if (SHOTS && id === "guanyin") await page.screenshot({ path: join(SHOTS, `${w}x${h}-faced.png`) }); + } + const eq = (a, b) => Math.abs(a - b) < 0.6; + check("三殿正對時尺寸與位置完全相同(透視不是位階)", HALLS.every((id) => eq(boxes[id].w, boxes.guanyin.w) && eq(boxes[id].h, boxes.guanyin.h) && eq(boxes[id].t, boxes.guanyin.t) && eq(boxes[id].l, boxes.guanyin.l))); + check("殿面不拉伸(8:9 固定長寬比)", eq(boxes.guanyin.h / boxes.guanyin.w, 1.125) || Math.abs(boxes.guanyin.h / boxes.guanyin.w - 1.125) < 0.01); + const same = await page.evaluate(() => { const strip = (el) => el.querySelector("svg").outerHTML; const a = [...document.querySelectorAll(".station:not(.hypothetical) .ink-hall")].map(strip); return a.length === 3 && a.every((x) => x === a[0]); }); + check("三殿是同一份墨筆模板(逐字相同)", same); + + // 推門 → 進殿 → 走近籤筒 + const g = await station(page, "guandi"); + await page.mouse.click(g.x, g.y); + const opening = await page.evaluate(() => document.querySelector('[data-hall="guandi"]').classList.contains("opening") && [...document.querySelectorAll(".facade.opening")].length === 1); + check("正對後再點:只有這一殿的門打開", opening); + await page.waitForTimeout(1700); + check("門開之後才進殿", await on(page, "s-hall")); + const tube = await page.evaluate(() => { const r = document.getElementById("tubeWrap").getBoundingClientRect(); return { t: r.top, b: r.bottom, vh: innerHeight, shown: getComputedStyle(document.getElementById("tubeStage")).display !== "none" }; }); + check("走近:籤筒被帶進畫面", tube.shown && tube.b <= tube.vh + 2 && tube.b > 80, JSON.stringify(tube)); + if (SHOTS) await page.screenshot({ path: join(SHOTS, `${w}x${h}-hall.png`) }); + const moving = await page.evaluate(() => ({ stick: !!document.getElementById("tubeStick"), candles: document.querySelectorAll(".censer .candle").length, lamps: document.querySelectorAll(".hall-ink .hl").length, + anims: document.getAnimations().length })); + check("殿內活物各自成層(籤枝、一對燭、一對燈;有在動)", moving.stick && moving.candles === 2 && moving.lamps === 2 && moving.anims > 0); + await page.click("#tubeWrap"); await page.waitForTimeout(250); await page.click("#takeBtn"); await page.waitForTimeout(500); + const slip = await page.evaluate(() => ({ paper: !!document.querySelector("#slipMount .slip"), book: JSON.parse(localStorage.getItem("drawone.book.v1") || "[]").length })); + check("抽籤照舊:原籤紙元件、紙落定入簿", slip.paper && slip.book === 1); + if (SHOTS) await page.screenshot({ path: join(SHOTS, `${w}x${h}-slip.png`) }); + await page.click("#backBtn"); await page.waitForTimeout(700); + check("回埕:門已掩上、朝向留在剛才那殿(session 內)", (await on(page, "s-court")) && (await page.evaluate(() => document.querySelectorAll(".facade.opening").length === 0))); + await page.reload(); await page.waitForTimeout(600); + const backToVoid = await page.evaluate(() => { const v = document.querySelector(".void-station").getBoundingClientRect(), c = document.getElementById("courtView").getBoundingClientRect(); + return Math.abs((v.left + v.right) / 2 - (c.left + c.right) / 2) < 3; }); + check("reload:回到中軸空段(朝向不持久化)", (await on(page, "s-court")) && backToVoid); + check("沒有對外請求(字型除外)", reqs.every((u) => u.startsWith("file:") || /^https:\/\/fonts\.(googleapis|gstatic)\.com\//.test(u) || u.startsWith("data:")), reqs.filter((u) => !u.startsWith("file:") && !u.startsWith("data:") && !/fonts\./.test(u)).join(" ")); + check("console 乾淨", errs.length === 0, errs.join(" | ")); + await ctx.close(); +} + +console.log("▍短視窗進殿:聖號認得出、回埕找得到、籤筒能操作(Astra/牛牛 2026-11-14 重現的裁切)"); +for (const [w, h, id, touch] of [[360, 601, "mazu", true], [390, 601, "mazu", true], [1024, 601, "mazu", false], [1024, 768, "guanyin", false], [844, 390, "mazu", true], [390, 844, "guandi", true]]) { + const ctx = await browser.newContext({ viewport: { width: w, height: h }, hasTouch: touch }); + const page = await ctx.newPage(); + await page.goto(pageURL()); await page.click("#enterBtn"); await page.waitForTimeout(700); + for (let i = 0; i < 4; i++) { + const s = await station(page, id); + if (Math.abs((s.box.l + s.box.r) / 2 - (s.view.l + s.view.r) / 2) < 3) break; + if (s.visible) await page.mouse.click(s.x, s.y); + else { const dir = s.box.l > s.view.r ? 1 : -1; const v = s.view; await page.mouse.move((v.l + v.r) / 2, v.t + 60); await page.mouse.down(); + await page.mouse.move((v.l + v.r) / 2 - dir * v.w * 0.5, v.t + 60, { steps: 6 }); await page.mouse.up(); } + await settled(page); + } + const g = await station(page, id); await page.mouse.click(g.x, g.y); await page.waitForTimeout(2800); + const m = await page.evaluate(() => { + const inView = (r) => r.top >= -0.5 && r.bottom <= innerHeight + 0.5 && r.height > 0; + const sh = document.getElementById("s-hall"), t = document.getElementById("tablet").getBoundingClientRect(), n = document.getElementById("hallName"); + const bar = document.querySelector(".hall-top").getBoundingClientRect(); + const tabletWhole = t.top >= bar.bottom - 10 && t.bottom <= innerHeight; + const named = inView(n.getBoundingClientRect()) && Number(getComputedStyle(n).opacity) > 0.9 && n.textContent === document.getElementById("tablet").textContent; + return { on: sh.classList.contains("on"), scrollTop: Math.round(sh.scrollTop), tabletWhole, named, back: inView(document.getElementById("backBtn").getBoundingClientRect()), + tube: inView(document.getElementById("tubeWrap").getBoundingClientRect()), hint: inView(document.querySelector(".tube-hint").getBoundingClientRect()), + tubeH: Math.round(document.getElementById("tubeWrap").getBoundingClientRect().height) }; + }); + if (SHOTS) await page.screenshot({ path: join(SHOTS, `tablet-${w}x${h}.png`) }); + check(`${w}×${h} ${id}:進殿落定`, m.on, JSON.stringify(m)); + check(`${w}×${h} ${id}:完整聖號認得出(牌整塊在畫面內,或頂列帶完整聖號)`, m.tabletWhole || m.named, JSON.stringify(m)); + check(`${w}×${h} ${id}:回埕在畫面內`, m.back, JSON.stringify(m)); + check(`${w}×${h} ${id}:籤筒整支在畫面內、提示看得到`, m.tube && m.hint, JSON.stringify(m)); + if (h <= 720) check(`${w}×${h}:短高規則真的生效(筒 246px)`, m.tubeH === 246, String(m.tubeH)); + await ctx.close(); +} + +console.log("▍增建殿(?halls=4)與 reduced motion"); +{ + const ctx = await browser.newContext({ viewport: { width: 390, height: 844 }, hasTouch: true, reducedMotion: "reduce" }); + const page = await ctx.newPage(); + await page.goto(pageURL("?halls=4")); await page.click("#enterBtn"); await page.waitForTimeout(400); + const hyp = await page.evaluate(() => { const st = document.querySelector(".station.hypothetical"); const cs = (sel) => [...st.querySelectorAll(sel)].map((e) => getComputedStyle(e).display); + return { life: cs(".k-life").every((d) => d === "none"), wash: cs(".k-wash").every((d) => d === "none"), brush: cs(".k-brush").every((d) => d === "none"), lines: cs(".k-plan").length > 0 && cs(".k-plan").every((d) => d !== "none"), mark: st.textContent.includes("增建中") }; }); + check("月老:同一份模板只剩放樣虛線——無門、無光、無獅、無墨染", hyp.life && hyp.wash && hyp.brush && hyp.lines && hyp.mark); + const running = await page.evaluate(() => document.getAnimations().filter((a) => a.playState === "running").length); + check("prefers-reduced-motion:沒有任何持續動畫", running === 0, String(running)); + await ctx.close(); +} +await browser.close(); +console.log(`\n${passed} passed, ${failed} failed`); +process.exit(failed ? 1 : 0); diff --git a/scripts/test-arrival.mjs b/scripts/test-arrival.mjs index 174795c..572bbf3 100644 --- a/scripts/test-arrival.mjs +++ b/scripts/test-arrival.mjs @@ -149,5 +149,26 @@ check("bound-strip click refuses hall entry mid-animation", /strip\.addEventList const releaseBlockR8 = script.slice(script.indexOf("const release ="), script.indexOf('view.addEventListener("pointerup"')); check("release grammar untouched(facedNow gate 仍是唯一進殿判準)", /facedNow[\s\S]{0,80}enterHall/.test(releaseBlockR8)); +console.log("R9 ink pass(2026-11)— 一套筆、三殿同一份立面、活物不焊死、紙不動"); +const hallTpl = script.slice(script.indexOf("const HALL_INK_SVG"), script.indexOf("const TREE_INK_SVG")); +check("殿面只有一份模板、只在一處掛上", hallTpl.length > 0 && (script.match(/innerHTML = HALL_INK_SVG/g) ?? []).length === 1); +check("殿面固定長寬比(模板不帶 preserveAspectRatio=none)", !/preserveAspectRatio="none"/.test(hallTpl)); +check("殿面尺寸一組數字給三殿(--hall-w/h 設在 stageStrip,不在個別站)", (script.match(/setProperty\("--hall-[wh]"/g) ?? []).length === 2 + && /stageStrip\.style\.setProperty\("--hall-h"/.test(script) && !/st\.style\.setProperty|f\.style\.setProperty/.test(script)); +check("門扇、門內的光、燈籠各自成層(k-life),由 CSS 驅動", /class="k-life door-l"/.test(hallTpl) && /class="k-life door-r"/.test(hallTpl) + && /class="k-life hearth"/.test(hallTpl) && /class="k-life hl/.test(hallTpl) && /\.facade\.opening \.door-l/.test(html)); +const enterBlock = script.slice(script.indexOf("function enterHall"), script.indexOf('$("backBtn")')); +check("推門以 data-hall 取元素(無身分分支),進殿後復位", /querySelector\(`\[data-hall="\$\{hall\.id\}"\]`\)/.test(enterBlock) && /classList\.add\("opening"\)/.test(enterBlock) && /classList\.remove\("opening"\)/.test(enterBlock)); +check("未落成之殿沿用同一模板,只留虛線放樣", /\.station\.hypothetical \.ink-hall \.k-life \{ display: none; \}/.test(html) && /\.station\.hypothetical \.ink-hall \.k-plan \{ display: block; \}/.test(html) && /\.ink-hall \.k-plan \{ display: none;[^}]*stroke-dasharray/.test(html)); +check("筆路:結構線是有提按的形(INKPEN),三殿共用同一份字串;飛白是 evenodd 的縫", /const INKPEN = /.test(script) && /fill-rule="evenodd"/.test(script) && (script.match(/HALL_INK_SVG = /g) ?? []).length === 1); +check("推門有門檻的光,reduced motion 不做", /id="threshold"/.test(html) && /!reduceMotion && facadeEl && !hall\.hypothetical/.test(script)); +const dress = script.slice(script.indexOf("function dressCourt"), script.indexOf("groundJoints.innerHTML")); +check("小景只錨在站界 B(i) 或牆尾/樹,不以殿的身分擺放", /const B = \(i\) => i \* stationW/.test(dress) && !/guanyin|guandi|mazu|deity/.test(dress)); +check("殿內的骨只有一份(三殿共用)", (html.match(/class="hall-ink"/g) ?? []).length === 1); +check("新增的動畫都有 reduced-motion 出口", ["lantern-sway", "hearth", "canopy-sway", "sparrow-hop", "shade-drift", "court-arrive", "hall-arrive", "flame", "rattle"] + .every((k) => html.includes(`@keyframes ${k}`)) && (html.match(/prefers-reduced-motion: reduce/g) ?? []).length >= 9); +check("學術限制寫在模板旁:不是任何真廟的量測、不代表所有台灣宮廟", /不是任何一座歷史建築的量測值/.test(script) && /不代表所有台灣宮廟/.test(script)); +check("籤紙沒有被這一輪碰到(slip.css/slip-render.js 無 ink 相依)", !/#ink-|xuan-grain/.test(readFileSync(join(ROOT, "assets", "slip.css"), "utf8") + readFileSync(join(ROOT, "assets", "slip-render.js"), "utf8"))); + console.log(`\n${passed} passed, ${failed} failed`); process.exit(failed === 0 ? 0 : 1); diff --git a/scripts/test-liushijiazi-book-compat.mjs b/scripts/test-liushijiazi-book-compat.mjs new file mode 100644 index 0000000..0f58845 --- /dev/null +++ b/scripts/test-liushijiazi-book-compat.mjs @@ -0,0 +1,69 @@ +// Offline VM regression only: no browser profile or real localStorage touched. +import assert from 'node:assert/strict'; +import { readFileSync } from 'node:fs'; +import { execFileSync } from 'node:child_process'; +import vm from 'node:vm'; +import { fileURLToPath } from 'node:url'; +const root = fileURLToPath(new URL('../', import.meta.url)); +const read = path => readFileSync(root + path, 'utf8'); +function poolFrom(source) { + const context = { window: {} }; + vm.runInNewContext(source, context); + return context.window.DRAW_POOL; +} +const before = poolFrom(execFileSync('git', ['show', '7ae87f6:assets/oracles.draw-pool.js'], {cwd: root, encoding: 'utf8'})); +const after = poolFrom(read('assets/oracles.draw-pool.js')); +assert.equal(before.schema, after.schema); +assert.notEqual(before.content_version, after.content_version); +assert.deepEqual(Array.from(before.entries, e => e.id), Array.from(after.entries, e => e.id)); +for (const old of before.entries) { + const entry = after.entries.find(e => e.id === old.id); + const changes = Object.keys(old).filter(key => JSON.stringify(old[key]) !== JSON.stringify(entry[key])); + assert.deepEqual(changes, ['liushijiazi-010', 'liushijiazi-028'].includes(old.id) ? ['historical_text'] : []); +} + +// Seed old-version fictional book + bindings. Resolve a repeated normalized +// question from another hall; then run the actual showSlip function over a DOM +// stub to verify note restoration and the newly sourced poem for the SAME id. +const html = read('paper/arrival.html'); +const showSlip = html.slice(html.indexOf(' function showSlip('), html.indexOf(' // 解曰 摺頁')); +assert.ok(showSlip.startsWith(' function showSlip(')); +// 入廟 ink/PR #32 整合後:showSlip 會呼叫 ensureBookEntry(紙落定即入簿)。舊紀錄已在簿中時它不得新增或改寫 +// 籤簿與 bindings;唯一允許的寫入是「上次走進哪一殿」的標記(LASTHALL)。主線(無此函式)則維持零寫入。 +const eb0 = html.indexOf(' function ensureBookEntry('); +const ensureBookEntry = eb0 < 0 ? '' : html.slice(eb0, html.indexOf('\n }\n', eb0) + 5); +for (const number of [10, 28]) { + const id = `liushijiazi-${String(number).padStart(3, '0')}`; + const question = `虛構相容性測試 ${number}`; + const record = {entryId:id, corpusId:'liushijiazi', question, note:`虛構私人筆記 ${number}`, ts:'2026-08-20T00:00:00.000Z'}; + const book = JSON.stringify([record]); + const storage = new Map([['drawone.book.v1', book]]); + const storageAPI = {getItem:key => storage.get(key) ?? null, setItem:() => {throw Error('Unexpected storage write');}}; + const window = {localStorage:storageAPI, sessionStorage:storageAPI}; + vm.runInNewContext(read('assets/draw-policy.js'), {window}); + const key = window.DRAW_POLICY.questionKey(question); + storage.set('drawone.bindings.v2', JSON.stringify({[key]:[{entry_id:id, corpus_id:'liushijiazi', question_normalized:question, bound_at:record.ts}]})); + const frozen = JSON.stringify([...storage]); + const binding = window.DRAW_POLICY.resolveDraw({question:` ${question} `, corpusId:'guandi', drawFn:() => {throw Error('Must not redraw');}}); + assert.equal(binding.entryId, id); + assert.equal(binding.boundCorpusId, 'liushijiazi'); + assert.equal(binding.repeated, true); + const nodes = {}; + const $ = id => nodes[id] ??= {style:{}, scrollIntoView(){}, appendChild(){}, classList:{add(){}, remove(){}, toggle(){}, contains(){return false;}}}; // classList:入廟 ink 分支的 showSlip 會切殿內 reading 狀態(僅樣式) + $('question').value = question; + let mounted; + window.SLIP_RENDER = {mountSlip:(_, entry) => {mounted = entry.historical_text.poem_text;}}; + const writes = []; + const context = {window, $, store:{get:(key, fallback) => JSON.parse(storage.get(key) ?? 'null') ?? fallback, set:(key) => { writes.push(key); }}, BOOK_KEY:'drawone.book.v1', LASTHALL_KEY:'__lasthall__', currentHall:{id:'mazu'}, cnNum:String, Date, reduceMotion:true, renderJieyue(){}, currentTakeawayTs:null, currentResolved:null}; + vm.createContext(context); + vm.runInContext(ensureBookEntry + '\n' + showSlip + '\nthis.showSlip = showSlip;', context); + context.showSlip(after.entries.find(e => e.id === id), {repeated:true}); + assert.equal($('noteInput').value, record.note); + assert.equal(context.currentTakeawayTs, record.ts); + assert.equal(context.currentResolved.entryId, id); + assert.equal($('takeawayZone').hidden, false); + assert.equal(mounted, after.entries.find(e => e.id === id).historical_text.poem_text); + assert.equal(JSON.stringify([...storage]), frozen); + assert.ok(writes.every(k => k === '__lasthall__'), 'only the last-hall marker may be written: ' + writes.join()); +} +console.log('PASS: all 260 ids stable; only two poem payloads changed; old fictional books/notes/bindings restore, cross-hall repeat never redraws, zero storage writes (offline VM scope)'); diff --git a/scripts/test-liushijiazi-poem-repair.py b/scripts/test-liushijiazi-poem-repair.py new file mode 100644 index 0000000..75f4963 --- /dev/null +++ b/scripts/test-liushijiazi-poem-repair.py @@ -0,0 +1,146 @@ +#!/usr/bin/env python3 +"""Scoped regression: corrected witness, exports, unchanged records, fail-closed.""" +import copy +import ast +import csv +import io +import json +import re +from pathlib import Path +import shutil +import subprocess +import sys +import tempfile +from openpyxl import load_workbook + +ROOT = Path(__file__).resolve().parents[1] +BASE = "7ae87f6e45526a7dc8ef6f47c24c16d50a444a8d" +STUDY = ROOT / "research/oracle-corpus-study-03-liushijiazi-full" +sys.path.insert(0, str(STUDY)) +from poem_corrections import CORRECTIONS, apply_corrections, validate_corrections + + +def original(path): + return subprocess.check_output(["git", "show", f"{BASE}:{path}"], cwd=ROOT) + + +def load(path): + return json.loads((ROOT / path).read_text(encoding="utf-8")) + + +def rejects(fn): + try: + fn() + except ValueError: + return + raise AssertionError("Expected fail-closed rejection") + + +corrections = {row["slip_number"]: row for row in CORRECTIONS} +targets = {10, 28} +assert set(corrections) == targets +# Reproduce the seven-CJK-heading trap in the legacy fallback parser without +# importing/running acquisition code or inventing missing historical inputs. +tree = ast.parse((STUDY / "generate_ingest.py").read_text()) +functions = [node for node in tree.body if isinstance(node, ast.FunctionDef) and node.name in {"cjk_only", "poem_lines"}] +parser_scope = {"re": re} +exec(compile(ast.Module(body=functions, type_ignores=[]), "legacy-parser", "exec"), parser_scope) +for correction in CORRECTIONS: + sample = correction["before"].splitlines()[0] + "\n" + correction["after"] + assert parser_scope["poem_lines"](sample) == correction["before"].splitlines() +assert "apply_corrections(attestation)" in (STUDY / "generate_ingest.py").read_text() +for n, row in corrections.items(): + assert len(row["after"].splitlines()) == 4 + assert all(len(line) == 7 for line in row["after"].splitlines()) + assert row["before"].splitlines()[1:] == row["after"].splitlines()[:3] + assert row["human_confirmation"] is False +items = [json.loads(line) for line in (STUDY / "data/concrete_item.jsonl").read_text().splitlines()] +comparison = {row["slip_number"]: row for row in load(str(STUDY.relative_to(ROOT) / "Liushijiazi-Corpus-Comparison-v0.1.json"))["slips"]} +for n, row in corrections.items(): + item = next(item for item in items if item["item_id"] == f"item-bg-{n:03}") + assert item["url"] == row["source_url"] and item["digital_checksum"] == row["source_sha256"] + assert comparison[n]["poem_beigang_aligned"] == row["after"].splitlines() + +att_path = "research/oracle-corpus-study-03-liushijiazi-full/data/attestation.jsonl" +before = [json.loads(line) for line in original(att_path).decode().splitlines()] +after = [json.loads(line) for line in (ROOT / att_path).read_text().splitlines()] +validate_corrections(after) +assert apply_corrections(copy.deepcopy(before)) == after +assert apply_corrections(copy.deepcopy(after)) == after +rejects(lambda: validate_corrections(before)) +unexpected = copy.deepcopy(before) +next(row for row in unexpected if row["attestation_id"] == "att-bg-010")["source_text"] = "unexpected upstream change" +rejects(lambda: apply_corrections(unexpected)) +rejects(lambda: apply_corrections(after + [after[9]])) +rejects(lambda: apply_corrections([row for row in after if row["attestation_id"] != "att-bg-010"])) +for old, new in zip(before, after): + allowed = {"source_text", "notes"} if old["attestation_id"] in {"att-bg-010", "att-bg-028"} else set() + assert {key for key in old if old[key] != new[key]} <= allowed + +for filename, key, field in [("slips.json", "slip_number", "reference_text"), + ("attestations.json", "attestation_id", "text")]: + path = "data/corpora/liushijiazi/" + filename + old_rows = json.loads(original(path)) + new_rows = load(path) + assert len(old_rows) == len(new_rows) + for old, new in zip(old_rows, new_rows): + affected = old[key] in (targets if key == "slip_number" else {"att-bg-010", "att-bg-028"}) + if affected: + assert new[field] == corrections[new["slip_number"]]["after"] + assert {k for k in old if old[k] != new[k]} <= {field, "notes"} + else: + assert old == new + +path = "data/corpora/liushijiazi/slip_texts.json" +old_identity, new_identity = json.loads(original(path)), load(path) +for old, new in zip(old_identity["slips"], new_identity["slips"]): + n = old["slip_number"] + if n in targets: + assert new["poem_text"] == corrections[n]["after"] + assert {key for key in old if old[key] != new[key]} == {"poem_text"} + else: + assert old == new +for n in targets: + assert load("data/corpora/liushijiazi/source_texts.json")[str(n)]["poem"] == corrections[n]["after"] + +csv_path = "data/corpora/liushijiazi/slip_texts.csv" +csv_before = list(csv.DictReader(io.StringIO(original(csv_path).decode()))) +csv_after = list(csv.DictReader((ROOT / csv_path).open(encoding="utf-8", newline=""))) +for old, new in zip(csv_before, csv_after): + n = int(new["slip_number"]) + assert {key for key in old if old[key] != new[key]} == ({"poem_text"} if n in targets else set()) + if n in targets: + assert new["poem_text"] == corrections[n]["after"].replace("\n", ";") +xlsx_path = "data/corpora/liushijiazi/slip_texts_review.xlsx" +wb_old = load_workbook(io.BytesIO(original(xlsx_path))) +wb_new = load_workbook(ROOT / xlsx_path) +changed_cells = [] +for old_row, new_row in zip(wb_old.active, wb_new.active): + for old, new in zip(old_row, new_row): + if old.value != new.value: + changed_cells.append(new.coordinate) +assert changed_cells == ["E11", "E29"], changed_cells + +# Actual builder regression: a known seven-character OCR heading must fail and +# remove an old pool, not quietly pass the four-lines/seven-characters checks. +with tempfile.TemporaryDirectory(prefix="draw-one-ocr-gate-") as temporary: + sandbox = Path(temporary) + (sandbox / "scripts").mkdir() + shutil.copy(ROOT / "scripts/build-draw-pool.mjs", sandbox / "scripts") + for corpus in ["guanyin", "guandi", "liushijiazi"]: + destination = sandbox / "data/corpora" / corpus + destination.mkdir(parents=True) + shutil.copy(ROOT / "data/corpora" / corpus / "slip_texts.json", destination) + for n in targets: + source = sandbox / path + dirty = copy.deepcopy(new_identity) + dirty["slips"][n - 1]["poem_text"] = corrections[n]["before"] + source.write_text(json.dumps(dirty, ensure_ascii=False)) + (sandbox / "assets").mkdir(exist_ok=True) + pool = sandbox / "assets/oracles.draw-pool.js" + pool.write_text("stale artifact") + result = subprocess.run(["node", str(sandbox / "scripts/build-draw-pool.mjs")], capture_output=True, text=True) + assert result.returncode == 1 and "no-ocr-heading" in result.stderr + assert not pool.exists() + +print("PASS: two same-edition source repairs; non-target records/statuses unchanged; JSON/CSV/XLSX agree; stale/unknown transcriptions rejected; both OCR-heading mutations fail closed")