Repository navigation
Closed
1 / 11 of 1 issue completedClosed
1 / 11 of 1 issue completed
Copy link
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Description
Machine-Readable Contract
contract_schema_version: v1
issue_kind: implementation
parent_issue: "#571"
goal_ref: "GitHub Pages main URL と PR Preview URL の production bundle が同一 source of truth から base path を解決し、#571 の deferred verification を再開できる前提を整える"
change_kind: mixedParent Issue
Parent Goal Ref
- Goal: GitHub Pages/PR Preview 上で人間プレイテスト証跡を自動採取し、PR/Issue に貼れる YAML/Markdown と画像として出力する
- Desired Destination: GitHub Pages main URL
https://squne121.github.io/loop-protocol/?playtest_evidence=1と PR Preview URLhttps://squne121.github.io/loop-protocol/pr-<PR番号>/?playtest_evidence=1の両方で、production bundle が正しい base path を解決したうえで Evidence Panel を描画できる
Current Validated Scope
vite.config.tsを env-driven (VITE_BASE_PATH) の source of truth として導入し、default/と fail-fast validation を定義する.github/workflows/deploy-pages.ymlで main deploy / PR preview deploy ごとのVITE_BASE_PATHを 1 回だけ解決し、pnpm buildと build artifact verification の両方で同じ値を使うdist/index.htmlの asset path を決定論的に検査し、root/assets/...regression と PR preview 向け base path drift を fail-fast で検出できるようにするdocs/playtest/manual-playtest-runbook.mdに local preview URL と GitHub Pages runtime revalidation URL の差分、および Pages source / publish trigger 切り分けルールを明記する
Remaining Parent Gaps
-
app_under_test.commitを browser-side YAML へ注入する workflow 対応は別 Issue - GitHub Pages 上での canonical evidence 再採取と
deferred_condition更新は本 Issue 完了後に 実装: GitHub Pages/PR Preview に人間プレイテスト証跡エクスポートパネルを追加する #571 で再実施 - base path 修正後も hosted runtime が更新されない場合の Pages source / publish trigger 切り分けは別 Issue で扱う
Outcome
GitHub Pages main URL と PR Preview URL 向け build が VITE_BASE_PATH を単一 source of truth として解決し、local preview を壊さずに dist/index.html と preview asset reachability の drift を決定論的に検出できる状態。
In Scope
vite.config.tsの新設または更新によりprocess.env.VITE_BASE_PATHを正規化してbaseへ供給する.github/workflows/deploy-pages.ymlに base path resolve step と build artifact verification / preview asset verification を追加または更新するpnpm build -- --base=...の inline 指定を撤去し、workflow 側の source of truth をVITE_BASE_PATHへ一本化するdocs/playtest/manual-playtest-runbook.mdに GitHub Pages main / PR preview / local preview の検証経路差分を反映する
Out of Scope
- Evidence Panel の UI/UX 変更
app_under_test.commitの browser-side 注入- playtest evidence schema の拡張
- 実装: GitHub Pages/PR Preview に人間プレイテスト証跡エクスポートパネルを追加する #571 canonical evidence comment の
satisfied化そのもの - GitHub repository Settings -> Pages の手動設定変更や、base path 以外の hosted runtime fault の根治
Acceptance Criteria
- AC1:
vite.config.tsがprocess.env.VITE_BASE_PATHを読み、default/を返し、/始まりでない値を fail-fast する - AC2:
.github/workflows/deploy-pages.ymlにVITE_BASE_PATHを 1 回だけ解決する step があり、main deploy / PR preview deploy の両方でその値をGITHUB_ENVまたは同等の単一 source of truth として共有する - AC3:
.github/workflows/deploy-pages.ymlの build step は barepnpm buildとなり、--base=/loop-protocol/...の inline 指定を持たない - AC4: main deploy 向け build artifact verification が
dist/index.htmlに/loop-protocol/assets/を要求し、root/assets/参照を fail-fast する - AC5: PR preview 向け build artifact verification が
/loop-protocol/pr-<PR番号>/assets/を要求し、preview base path drift を fail-fast する - AC6:
docs/playtest/manual-playtest-runbook.mdにhttp://localhost:4173と GitHub Pages main / PR preview の?playtest_evidence=1URL を分離した再検証経路が明記される - AC7: PR preview の live check は HTML 200 のみを成功条件にせず、build で解決した asset URL または同等の asset-level reachability を検査する
- AC8:
docs/playtest/manual-playtest-runbook.mdに「base path 修正だけでは 実装: GitHub Pages/PR Preview に人間プレイテスト証跡エクスポートパネルを追加する #571 の deferred verification 完了を意味しない」ことと、Pages source / publish trigger fault を別問題として切り分けるルールが明記される - AC9:
pnpm typecheck/pnpm lint/pnpm test/pnpm buildが PASS する
Verification Commands
# AC1
$ rg -n "process\.env\.VITE_BASE_PATH|function normalizeBase|base: normalizeBase" .# AC2
$ rg -n "Resolve Vite base path|VITE_BASE_PATH=.*GITHUB_ENV|VITE_BASE_PATH=.*GITHUB_OUTPUT" .github/workflows/deploy-pages.yml# AC3
$ rg -n "^[[:space:]]*- run: pnpm build$" .github/workflows/deploy-pages.yml# AC4
$ rg -n "Verify main build asset base path|/loop-protocol/assets/|src=\"/assets/|href=\"/assets/" .github/workflows/deploy-pages.yml# AC5
$ rg -n "Verify PR preview build asset base path|/loop-protocol/pr-\$\{\{ github\.event\.number \}\}/assets/" .github/workflows/deploy-pages.yml# AC6
$ rg -n "## Base Path Revalidation URLs" docs/playtest/manual-playtest-runbook.md# AC7
$ rg -n "Verify preview assets are live|asset-level reachability|dist/index.html" .github/workflows/deploy-pages.yml docs/playtest/manual-playtest-runbook.md# AC8
$ rg -n "base path 修正だけでは #571 の deferred verification 完了を意味しない|Pages source / publish trigger fault は別問題" docs/playtest/manual-playtest-runbook.md# AC9
$ pnpm typecheck
$ pnpm lint
$ pnpm test
$ pnpm buildAllowed Paths
- vite.config.ts
- .github/workflows/deploy-pages.yml
- docs/playtest/manual-playtest-runbook.md
Stop Conditions
- Allowed Paths 外の変更が必要と判明した場合
- In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
- 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
- 後続 Phase / 別スコープへの波及が判明した場合
- nested SubAgent delegation が必要になった場合
- 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
- GitHub Pages の hosted runtime fault が base path ではなく Pages source / publish trigger / 別の production-only fault と判明した場合
- GitHub repository Settings -> Pages の手動変更や別 Issue 切り分けなしでは 実装: GitHub Pages/PR Preview に人間プレイテスト証跡エクスポートパネルを追加する #571 の deferred verification を再開できないと判明した場合
Runtime Verification Applicability
- decision: deferred
- reason: 本 Issue は
vite.config.ts/ workflow / runbook の整備であり、実装完了判定は build artifact と docs の決定論的検査で行う。一方で GitHub Pages main URL 上の最終 runtime 確認は merge 後 deploy・Pages source 状態・実装: GitHub Pages/PR Preview に人間プレイテスト証跡エクスポートパネルを追加する #571 の canonical evidence 再採取に依存するため、本 Issue 単体では完結しない - deferred_destination:
- destination_type: issue
- destination_ref: "実装: GitHub Pages/PR Preview に人間プレイテスト証跡エクスポートパネルを追加する #571"
- deferred_verification_condition:
VITE_BASE_PATHの source of truth 一元化が merge 済みで、GitHub Pages main URL / PR Preview URL が deploy された状態で?playtest_evidence=1の canonical evidence を 実装: GitHub Pages/PR Preview に人間プレイテスト証跡エクスポートパネルを追加する #571 に再採取できること
Required Skills
- Vite / GitHub Pages deploy
- GitHub Actions workflow
- TypeScript / frontend build pipeline
Scope Delta(任意)
N/A
Sub-issues
Collapse Sub-issuesSub-issues
Loading 1 sub-issues
Metadata
Metadata
Assignees
Labels
agent/implementerAI implementer agentenhancementNew feature or requestphase/implementationImplementation phase
Activity
squne121 commentedon Jun 3, 2026
判定: REQUEST_CHANGES 相当
#614 の方向性は正しいです。ただし、素朴に
vite.config.tsにbase: "/loop-protocol/"を固定するだけだと、ローカルpnpm build && pnpm preview動線、PR Preview 動線、将来の repo rename / Pages source 問題を壊す可能性があります。#614 は #571 の deferred runtime verification を再開するための前提Issueであり、単なる設定整理ではなく「main URL と PR preview の production bundle が正しい base path で app shell と Evidence Panel を描画できる状態」を要求しています。([GitHub]1)ブロッカー 1: 現行 workflow は既に
--baseを手書きしており、#614 の本質は「追加」ではなく「drift 排除」現行
.github/workflows/deploy-pages.ymlは main deploy でpnpm build -- --base=/loop-protocol/、PR preview でpnpm build -- --base=/loop-protocol/pr-${{ github.event.number }}/を使っています。つまり現象の原因は「base 指定が全くない」ではなく、source of truth が workflow 内の手書き2箇所に分散しており、vite.config.tsも存在しない点です。#614 の AC2 も main / PR preview の base path が同じ source of truth から解決されることを要求しています。([GitHub]2) ([GitHub]1)要求修正:
vite.config.tsはprocess.env.VITE_BASE_PATHを読む設計にし、workflow 側は 1 step でPAGES_BASE_PATH/VITE_BASE_PATHを算出して main と PR build の両方で使うべきです。Vite 公式は nested public path ではbaseを指定すれば HTML/CSS/JS import asset path を rewrite すると明記しており、CLI のvite build --base=/my/public/path/も正規の手段です。([vitejs]3)workflow 側は概念的にはこうです。
ブロッカー 2:
pnpm buildの default base を/loop-protocol/に固定するとローカル検証動線を壊す#571/#604 の deferred verification は
pnpm build && pnpm preview後に?playtest_evidence=1を付けてブラウザ確認する運用です。PR #604 本文もその手順を deferred runtime verification として明記しています。([GitHub]4)そのため
vite.config.tsの default を常に/loop-protocol/にすると、ローカル preview を/で開く既存 runbook とズレます。現行 runbook はpnpm build→pnpm preview -- --host 127.0.0.1 --port 4173 --strictPort→http://localhost:4173で確認する手順です。([GitHub]5)要求修正:
default は
/にし、Pages deploy 時だけVITE_BASE_PATH=/loop-protocol/または/loop-protocol/pr-<PR>/を注入してください。docs には Pages runtime 検証と local runtime 検証の URL 差分を明記する必要があります。ブロッカー 3: live check が HTTP 200 だけだと今回の障害を検出できない
現行 PR preview コメント生成 step は preview URL に対して
curl ... 200を確認していますが、これはindex.htmlが 200 を返すことしか見ません。今回の failure mode は「HTML は返るが bundle asset が/assets/...を向いて runtime が死ぬ」なので、200 check では false positive になります。現行 workflow の live check はその形です。([GitHub]2)要求修正:
build 後に
dist/index.htmlの asset path を deterministic に検査してください。#614 AC3/AC4 も root/assets/参照を含まないこと、PR preview では/loop-protocol/pr-<PR番号>/assets/を参照できることを要求しています。([GitHub]1)さらに Pages URL の live check は最低限
index.htmlだけでなく、dist/index.htmlから抽出した JS/CSS asset をcurl -fsSLする検査に変更すべきです。Vite は HTML 内 asset references もbaseに従って書き換えるため、ここを検査すると今回の regression を直接捕捉できます。([vitejs]3)ブロッカー 4: GitHub Pages source /
GITHUB_TOKENdeploy 問題を切り分けないと、base 修正後も runtime 復旧と誤認するGitHub Docs は、branch publishing source は任意 branch の root または
/docsを source にできる一方、GITHUB_TOKENによる push は Pages build を trigger しない、と明記しています。現行 workflow はgh-pagesbranch に push する設計で、PR #604 の bot comment も「publish requested / live URL 未検証 / Pages source 設定後に有効化」と表示していました。([GitHub Docs]6) ([GitHub]4)これは #614 の Stop Condition「壊れ方が base path ではなく別 production-only runtime fault と判明した場合」に直結します。base path 修正後も Pages が更新されないなら、#614 内で深追いせず「Pages publish trigger / source 設定」の別Issueに切るべきです。([GitHub]1)
ブロッカー 5:
keep_files: trueは stale asset 温存リスクがあるPR preview deploy は
peaceiris/actions-gh-pages@v4にkeep_files: trueとdestination_dir: pr-${{ github.event.number }}を指定しています。peaceiris の docs は、keep_filesは既存ファイルを残す設定であり、通常は再考すべき option と説明しています。([GitHub]2) ([GitHub]7)今回の scope では PR preview directory を維持する目的があるので
keep_files: true自体は理解できますが、asset hash が変わったときに古いファイルが残ることを許容します。Vite 側は新しいindex.htmlが新 hash を参照するので直ちに壊れるとは限りませんが、証跡ページの canonicality を考えると「現行 preview directory 内だけは replace、他 PR directory は preserve」が望ましいです。要求修正:
可能なら PR preview も main と同様に worktree +
rsync --delete dist/ /tmp/gh-pages/pr-${PR}/へ寄せ、pr-*全体を残しつつ対象 PR directory だけ deterministic に置換してください。これで stale preview artifact を減らせます。#614 の Acceptance Criteria 修正案
現行 AC は方向性としては妥当ですが、false positive を潰すには次を追加すべきです。
GitHub に貼るレビューコメント案
結論として、#614 は 実装してよいが、naive な固定 base 実装は不可 です。最小合格ラインは「workflow で base を一度だけ算出」「Vite config は env-driven」「
dist/index.htmlの/assets/regression を fail-fast」「local preview 手順を壊さない」です。[-]実装: GitHub Pages base path を固定し Evidence Panel の main URL runtime を復旧する[/-][+]実装: GitHub Pages / PR Preview の Vite base path source of truth を一元化し Evidence Panel runtime 再検証前提を整える[/+]squne121 commentedon Jun 3, 2026
Contract Snapshot (2026-06-03T06:03:34Z)
VITE_BASE_PATHを単一 source of truth として解決し、local preview を壊さずにdist/index.htmlと preview asset reachability の drift を決定論的に検出できる状態。vite.config.ts,.github/workflows/deploy-pages.yml,docs/playtest/manual-playtest-runbook.md.claude/worktrees/issue-614-github-pages-base-path-source-of-truthworktree-issue-614-github-pages-base-path-source-of-truthsqune121 commentedon Jun 3, 2026
Contract Snapshot (2026-06-03T06:25:46Z)
VITE_BASE_PATHを単一 source of truth として解決し、local preview を壊さずにdist/index.htmlと preview asset reachability の drift を決定論的に検出できる状態。vite.config.ts,.github/workflows/deploy-pages.yml,docs/playtest/manual-playtest-runbook.md.claude/worktrees/issue-614-github-pages-base-path-source-of-truthworktree-issue-614-github-pages-base-path-source-of-truthsqune121 commentedon Jun 3, 2026
implement-issue: 実装完了 (2026-06-03T06:31:00Z)
.claude/worktrees/issue-614-github-pages-base-path-source-of-truthworktree-issue-614-github-pages-base-path-source-of-truthrtk pnpm typecheck: PASSrtk pnpm lint: PASSrtk pnpm test: PASSrtk pnpm build: PASSVITE_BASE_PATH=/loop-protocol/build artifact smoke: PASSVITE_BASE_PATH=/loop-protocol/pr-614/build artifact smoke: PASSfix(#614): live check から hosted remote index を使うよう修正し normalizeBase の…
squne121 commentedon Jun 3, 2026
impl-review-loop iteration 2 — Step 1 修正完了
対応した REQUEST_CHANGES
B1 blocker 修正:
deploy-pages.ymlのVerify preview assets are livestep がdist/index.html(ローカル)ではなく/tmp/preview-index.html(リモート hosted index)から asset path を抽出するよう修正しました。追加修正:
${base}assets/が存在し root/assets/がないことを検査する行を追加case分岐で検査するよう追加vite.config.ts:normalizeBaseが//...(protocol-relative) を拒否するよう修正PR body の preview smoke 件: PR body の
pr-614smoke はフックにより更新できませんでした。コードコメントとして: これは任意 path での build 形状確認 smoke であり、実際の PR Preview live check は workflow 側の${GITHUB_SHA}?cache_bust+/tmp/preview-index.htmlで行われます。VC 確認結果 (iteration 2)
pnpm typecheck/pnpm lint/pnpm test/pnpm build: PASS2574101fix: unify pages base path source of truth (#614) (#623)
squne121 commentedon Jun 3, 2026
post-merge-cleanup 完了
worktree・ブランチ削除完了。follow-up は下記の通り全スキップです。
//follow-up: 同上、修正済み親 Issue #571 は child #609 が OPEN のため keep_open を維持します。
squne121 commentedon Jun 6, 2026
全 child issue (#706) のマージが完了し、AC6/AC8 の退行が解消されました。post-merge-cleanup により自動クローズ。