Skip to content

実装: GitHub Pages / PR Preview の Vite base path source of truth を一元化し Evidence Panel runtime 再検証前提を整える #614

Closed
1 of 1 issue completed

Description

@squne121

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: mixed

Parent Issue

#571

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 URL https://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

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

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 は bare pnpm 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=1 URL を分離した再検証経路が明記される
  • 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 build

Allowed 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

Required Skills

  • Vite / GitHub Pages deploy
  • GitHub Actions workflow
  • TypeScript / frontend build pipeline

Scope Delta(任意)

N/A

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. added
    phase/implementation
    agent/implementer
    enhancement
    triage-required
    on Jun 3, 2026
  2. squne121 commented on Jun 3, 2026

    @squne121
    OwnerAuthor

    判定: 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)

    // vite.config.ts
    import { defineConfig } from 'vite'
    
    function normalizeBase(raw: string | undefined): string {
      if (!raw || raw.trim() === '') return '/'
      const value = raw.trim()
      if (value === './' || value === '') return value
      if (!value.startsWith('/')) {
        throw new Error(`VITE_BASE_PATH must start with "/": ${value}`)
      }
      return value.endsWith('/') ? value : `${value}/`
    }
    
    export default defineConfig({
      base: normalizeBase(process.env.VITE_BASE_PATH),
    })

    workflow 側は概念的にはこうです。

    - name: Resolve Vite base path
      id: vite-base
      shell: bash
      run: |
        set -euo pipefail
        repo_name="${GITHUB_REPOSITORY#*/}"
    
        if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
          base="/${repo_name}/pr-${{ github.event.number }}/"
        else
          base="/${repo_name}/"
        fi
    
        case "$base" in
          /*/) ;;
          *) echo "Invalid Vite base: $base" >&2; exit 1 ;;
        esac
    
        echo "VITE_BASE_PATH=$base" >> "$GITHUB_ENV"
        echo "base=$base" >> "$GITHUB_OUTPUT"
    
    - run: pnpm build

    ブロッカー 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)

    - name: Verify built asset base path
      shell: bash
      run: |
        set -euo pipefail
        base="${{ steps.vite-base.outputs.base }}"
    
        grep -F "${base}assets/" dist/index.html
        ! grep -E 'src="/assets/|href="/assets/' dist/index.html

    さらに 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_TOKEN deploy 問題を切り分けないと、base 修正後も runtime 復旧と誤認する

    GitHub Docs は、branch publishing source は任意 branch の root または /docs を source にできる一方、GITHUB_TOKEN による push は Pages build を trigger しない、と明記しています。現行 workflow は gh-pages branch に 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 を潰すには次を追加すべきです。

    additional_acceptance_criteria:
      - AC7: deploy workflow resolves VITE_BASE_PATH once per job and both build and verification consume that value.
      - AC8: dist/index.html verification fails if src="/assets/ or href="/assets/ remains.
      - AC9: main build verification expects /loop-protocol/assets/ in dist/index.html.
      - AC10: PR preview build verification expects /loop-protocol/pr-<number>/assets/ in dist/index.html.
      - AC11: local pnpm build && pnpm preview remains valid at http://localhost:4173 unless docs explicitly instruct a base-prefixed local URL.
      - AC12: Pages publish/source failure is reported separately from Vite base failure.

    GitHub に貼るレビューコメント案

    ## 判定: REQUEST_CHANGES
    
    #614 は妥当だが、`vite.config.ts` に `base: "/loop-protocol/"` を固定する実装は拒否したいです。#571/#604 の deferred runtime verification は `pnpm build && pnpm preview` のローカル動線を前提にしており、default base を Pages 用に固定すると local preview URL と drift します。
    
    ### Blockers
    
    1. workflow は既に main/PR で `pnpm build -- --base=...` を手書きしているため、修正対象は「base 追加」ではなく「base source-of-truth の一元化」です。
    2. `dist/index.html` の deterministic check が必須です。URL 200 check だけでは `/assets/...` root 参照による runtime failure を検出できません。
    3. `VITE_BASE_PATH` を workflow の resolve step で一度だけ算出し、`pnpm build` と artifact verification の両方で使ってください。
    4. `vite.config.ts` の default は `/` にし、Pages deploy 時だけ `/loop-protocol/` または `/loop-protocol/pr-<PR>/` を注入してください。
    5. base 修正後も Pages が更新されない場合は、GitHub Pages source / GITHUB_TOKEN publish trigger 問題として #614 の Stop Condition に従い別Issue化してください。
    
    ### Required implementation shape
    
    - `vite.config.ts`
      - `base: normalizeBase(process.env.VITE_BASE_PATH)`
      - empty/default は `/`
      - invalid base は fail-fast
    - `.github/workflows/deploy-pages.yml`
      - main: `VITE_BASE_PATH=/loop-protocol/`
      - PR: `VITE_BASE_PATH=/loop-protocol/pr-${{ github.event.number }}/`
      - `pnpm build`
      - `grep -F "${base}assets/" dist/index.html`
      - `! grep -E 'src="/assets/|href="/assets/' dist/index.html`
    - docs
      - main URL: `/loop-protocol/?playtest_evidence=1`
      - PR preview URL: `/loop-protocol/pr-<PR>/?playtest_evidence=1`
      - local preview URL remains distinct from Pages base-path verification

    結論として、#614 は 実装してよいが、naive な固定 base 実装は不可 です。最小合格ラインは「workflow で base を一度だけ算出」「Vite config は env-driven」「dist/index.html の /assets/ regression を fail-fast」「local preview 手順を壊さない」です。

  3. removed
    triage-required
    on Jun 3, 2026
  4. changed the title [-]実装: GitHub Pages base path を固定し Evidence Panel の main URL runtime を復旧する[/-] [+]実装: GitHub Pages / PR Preview の Vite base path source of truth を一元化し Evidence Panel runtime 再検証前提を整える[/+] on Jun 3, 2026
  5. squne121 commented on Jun 3, 2026

    @squne121
    OwnerAuthor

    Contract Snapshot (2026-06-03T06:03:34Z)

    • Outcome: GitHub Pages main URL と PR Preview URL 向け build が VITE_BASE_PATH を単一 source of truth として解決し、local preview を壊さずに dist/index.html と preview asset reachability の drift を決定論的に検出できる状態。
    • Acceptance Criteria: AC1-AC9
    • Verification Commands: AC1-AC8 は baseline fail 想定、AC9 は regression gate
    • Allowed Paths: vite.config.ts, .github/workflows/deploy-pages.yml, docs/playtest/manual-playtest-runbook.md
    • Worktree: .claude/worktrees/issue-614-github-pages-base-path-source-of-truth
    • Branch: worktree-issue-614-github-pages-base-path-source-of-truth
    • VC preflight: baseline fail = 8, 想定外 pass = 0, 実行不可 = 0, regression gate pass = 4
    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: 2026-06-03T06:03:34Z
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/614
      body_sha256: sha256:5ac0643597b2b82056c8acfe200be0fa97c7c396060ca4a6f863746f21a3ecbc
      checks:
        template_compliance: pass
        state_label: ok
        allowed_paths_present: pass
        vc_present: pass
        stop_conditions_complete: pass
        vc_preflight:
          passed: true
          vc_failed_as_expected: 8
          vc_passed_unexpectedly: 0
          vc_unrunnable: 0
          vc_human_judgment: 0
          vc_expected_pass: 4
          vc_skipped: 0
          classifications:
            - ac: AC1
              command: 'rg -n "process\\.env\\.VITE_BASE_PATH|function normalizeBase|base: normalizeBase" .'
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              confidence: high
              scope_class: baseline_fail_expected
              evidence:
                stdout_excerpt: ""
                stderr_excerpt: ""
              decision: go
            - ac: AC2
              command: 'rg -n "Resolve Vite base path|VITE_BASE_PATH=.*GITHUB_ENV|VITE_BASE_PATH=.*GITHUB_OUTPUT" .github/workflows/deploy-pages.yml'
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              confidence: high
              scope_class: baseline_fail_expected
              evidence:
                stdout_excerpt: ""
                stderr_excerpt: ""
              decision: go
            - ac: AC3
              command: 'rg -n "^- run: pnpm build$" .github/workflows/deploy-pages.yml'
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              confidence: high
              scope_class: baseline_fail_expected
              evidence:
                stdout_excerpt: ""
                stderr_excerpt: ""
              decision: go
            - ac: AC4
              command: 'rg -n "Verify main build asset base path|/loop-protocol/assets/|src=\\\"/assets/|href=\\\"/assets/" .github/workflows/deploy-pages.yml'
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              confidence: high
              scope_class: baseline_fail_expected
              evidence:
                stdout_excerpt: ""
                stderr_excerpt: ""
              decision: go
            - ac: AC5
              command: 'rg -n "Verify PR preview build asset base path|/loop-protocol/pr-\$\{\{ github\.event\.number \}\}/assets/" .github/workflows/deploy-pages.yml'
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              confidence: high
              scope_class: baseline_fail_expected
              evidence:
                stdout_excerpt: ""
                stderr_excerpt: ""
              decision: go
            - ac: AC6
              command: 'rg -n "## Base Path Revalidation URLs" docs/playtest/manual-playtest-runbook.md'
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              confidence: high
              scope_class: baseline_fail_expected
              evidence:
                stdout_excerpt: ""
                stderr_excerpt: ""
              decision: go
            - ac: AC7
              command: 'rg -n "Verify preview assets are live|asset-level reachability|dist/index.html" .github/workflows/deploy-pages.yml docs/playtest/manual-playtest-runbook.md'
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              confidence: high
              scope_class: baseline_fail_expected
              evidence:
                stdout_excerpt: ""
                stderr_excerpt: ""
              decision: go
            - ac: AC8
              command: 'rg -n "base path 修正だけでは #571 の deferred verification 完了を意味しない|Pages source / publish trigger fault は別問題" docs/playtest/manual-playtest-runbook.md'
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              confidence: high
              scope_class: baseline_fail_expected
              evidence:
                stdout_excerpt: ""
                stderr_excerpt: ""
              decision: go
            - ac: AC9
              command: "pnpm typecheck"
              exit_code: 0
              classification: expected_pass
              category: regression_gate
              confidence: low
              scope_class: regression_gate
              evidence:
                stdout_excerpt: ""
                stderr_excerpt: "$ tsc --noEmit"
              decision: go
            - ac: AC9
              command: "pnpm lint"
              exit_code: 0
              classification: expected_pass
              category: regression_gate
              confidence: low
              scope_class: regression_gate
              evidence:
                stdout_excerpt: ""
                stderr_excerpt: "$ eslint ."
              decision: go
            - ac: AC9
              command: "pnpm test"
              exit_code: 0
              classification: expected_pass
              category: regression_gate
              confidence: low
              scope_class: regression_gate
              evidence:
                stdout_excerpt: "RUN v4.1.6 /home/squne/projects/LOOP_PROTOCOL Test Files 17 passed (17) Tests 339 passed (339) Start at 15:03:29 Duration 4.01s (transform 2.05s, setup 0ms, import 2.88s, tests 10.51s, environment 2ms)"
                stderr_excerpt: "$ vitest run --exclude 'tests/e2e/**' --exclude '.claude/worktrees/**'"
              decision: go
            - ac: AC9
              command: "pnpm build"
              exit_code: 0
              classification: expected_pass
              category: regression_gate
              confidence: low
              scope_class: regression_gate
              evidence:
                stdout_excerpt: "vite v8.0.13 building client environment for production... transforming... 30 modules transformed. rendering chunks... computing gzip size... dist/index.html 0.46 kB gzip: 0.29 kB dist/assets/index-kaUIgtsl.css 2.63 kB gzip: 1.20 kB dist/assets/index-CMsn9t6Q.js 21.53 kB gzip: 7.81 kB built in 74ms"
                stderr_excerpt: "$ tsc && vite build"
              decision: go
        ac_verifiability: pass
        product_spec_check:
          applicability: not_applicable
          decision: pass
          triggers:
            docs_product_allowed_paths: false
            tasks_md_mentioned: false
            specify_artifact_mentioned: false
            generated_task_mentioned: false
            product_spec_context_present: false
          conditions:
            docs_product_requires_spec_evidence:
              status: pass
              evidence: []
            tasks_md_not_direct_source:
              status: pass
              evidence: []
            specify_not_canonical:
              status: pass
              evidence: []
            diff_first_rationale_present:
              status: pass
              evidence: []
            generated_task_trace_present:
              status: pass
              evidence: []
            task_dependencies_materialized:
              status: pass
              evidence: []
          blocked_reasons: []
        worktree_branch_collision: clear
      next_action: implement_issue
      blocked_reasons: []
      warnings: []
  6. squne121 commented on Jun 3, 2026

    @squne121
    OwnerAuthor

    Contract Snapshot (2026-06-03T06:25:46Z)

    • Outcome: GitHub Pages main URL と PR Preview URL 向け build が VITE_BASE_PATH を単一 source of truth として解決し、local preview を壊さずに dist/index.html と preview asset reachability の drift を決定論的に検出できる状態。
    • Acceptance Criteria: AC1-AC9
    • Verification Commands: AC1-AC8 は baseline fail 想定、AC9 は regression gate
    • Allowed Paths: vite.config.ts, .github/workflows/deploy-pages.yml, docs/playtest/manual-playtest-runbook.md
    • Worktree: .claude/worktrees/issue-614-github-pages-base-path-source-of-truth
    • Branch: worktree-issue-614-github-pages-base-path-source-of-truth
    • VC preflight: baseline fail = 8, 想定外 pass = 0, 実行不可 = 0, regression gate pass = 4
    CONTRACT_REVIEW_RESULT_V1:
      status: go
      generated_at: 2026-06-03T06:25:46Z
      generated_by: issue-contract-review
      issue_url: https://github.com/squne121/loop-protocol/issues/614
      body_sha256: sha256:4c7a04fe6598c3195cb910c0cfa735050929a67fd0e101fbfc827302bf5bebb6
      checks:
        template_compliance: pass
        state_label: ok
        allowed_paths_present: pass
        vc_present: pass
        stop_conditions_complete: pass
        vc_preflight:
          passed: true
          vc_failed_as_expected: 8
          vc_passed_unexpectedly: 0
          vc_unrunnable: 0
          vc_human_judgment: 0
          vc_expected_pass: 4
          vc_skipped: 0
          classifications:
            - ac: AC1
              command: 'rg -n "process\.env\.VITE_BASE_PATH|function normalizeBase|base: normalizeBase" .'
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              confidence: high
              scope_class: baseline_fail_expected
              evidence:
                stdout_excerpt: ""
                stderr_excerpt: ""
              decision: go
            - ac: AC2
              command: 'rg -n "Resolve Vite base path|VITE_BASE_PATH=.*GITHUB_ENV|VITE_BASE_PATH=.*GITHUB_OUTPUT" .github/workflows/deploy-pages.yml'
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              confidence: high
              scope_class: baseline_fail_expected
              evidence:
                stdout_excerpt: ""
                stderr_excerpt: ""
              decision: go
            - ac: AC3
              command: 'rg -n "^[[:space:]]*- run: pnpm build$" .github/workflows/deploy-pages.yml'
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              confidence: high
              scope_class: baseline_fail_expected
              evidence:
                stdout_excerpt: ""
                stderr_excerpt: ""
              decision: go
            - ac: AC4
              command: 'rg -n "Verify main build asset base path|/loop-protocol/assets/|src=\"/assets/|href=\"/assets/" .github/workflows/deploy-pages.yml'
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              confidence: high
              scope_class: baseline_fail_expected
              evidence:
                stdout_excerpt: ""
                stderr_excerpt: ""
              decision: go
            - ac: AC5
              command: 'rg -n "Verify PR preview build asset base path|/loop-protocol/pr-\$\{\{ github\.event\.number \}\}/assets/" .github/workflows/deploy-pages.yml'
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              confidence: high
              scope_class: baseline_fail_expected
              evidence:
                stdout_excerpt: ""
                stderr_excerpt: ""
              decision: go
            - ac: AC6
              command: 'rg -n "## Base Path Revalidation URLs" docs/playtest/manual-playtest-runbook.md'
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              confidence: high
              scope_class: baseline_fail_expected
              evidence:
                stdout_excerpt: ""
                stderr_excerpt: ""
              decision: go
            - ac: AC7
              command: 'rg -n "Verify preview assets are live|asset-level reachability|dist/index.html" .github/workflows/deploy-pages.yml docs/playtest/manual-playtest-runbook.md'
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              confidence: high
              scope_class: baseline_fail_expected
              evidence:
                stdout_excerpt: ""
                stderr_excerpt: ""
              decision: go
            - ac: AC8
              command: 'rg -n "base path 修正だけでは #571 の deferred verification 完了を意味しない|Pages source / publish trigger fault は別問題" docs/playtest/manual-playtest-runbook.md'
              exit_code: 1
              classification: expected_fail
              category: expected_baseline_fail
              confidence: high
              scope_class: baseline_fail_expected
              evidence:
                stdout_excerpt: ""
                stderr_excerpt: ""
              decision: go
            - ac: AC9
              command: "pnpm typecheck"
              exit_code: 0
              classification: expected_pass
              category: regression_gate
              confidence: low
              scope_class: regression_gate
              evidence:
                stdout_excerpt: ""
                stderr_excerpt: "$ tsc --noEmit"
              decision: go
            - ac: AC9
              command: "pnpm lint"
              exit_code: 0
              classification: expected_pass
              category: regression_gate
              confidence: low
              scope_class: regression_gate
              evidence:
                stdout_excerpt: ""
                stderr_excerpt: "$ eslint ."
              decision: go
            - ac: AC9
              command: "pnpm test"
              exit_code: 0
              classification: expected_pass
              category: regression_gate
              confidence: low
              scope_class: regression_gate
              evidence:
                stdout_excerpt: "RUN v4.1.6 /home/squne/projects/LOOP_PROTOCOL Test Files 17 passed (17) Tests 339 passed (339)"
                stderr_excerpt: "$ vitest run --exclude 'tests/e2e/**' --exclude '.claude/worktrees/**'"
              decision: go
            - ac: AC9
              command: "pnpm build"
              exit_code: 0
              classification: expected_pass
              category: regression_gate
              confidence: low
              scope_class: regression_gate
              evidence:
                stdout_excerpt: "vite v8.0.13 building client environment for production... built in 81ms"
                stderr_excerpt: "$ tsc && vite build"
              decision: go
        ac_verifiability: pass
        product_spec_check:
          applicability: not_applicable
          decision: pass
          triggers:
            docs_product_allowed_paths: false
            tasks_md_mentioned: false
            specify_artifact_mentioned: false
            generated_task_mentioned: false
            product_spec_context_present: false
          conditions:
            docs_product_requires_spec_evidence:
              status: pass
              evidence: []
            tasks_md_not_direct_source:
              status: pass
              evidence: []
            specify_not_canonical:
              status: pass
              evidence: []
            diff_first_rationale_present:
              status: pass
              evidence: []
            generated_task_trace_present:
              status: pass
              evidence: []
            task_dependencies_materialized:
              status: pass
              evidence: []
          blocked_reasons: []
        worktree_branch_collision: clear
      next_action: implement_issue
      blocked_reasons: []
      warnings: []
  7. squne121 commented on Jun 3, 2026

    @squne121
    OwnerAuthor

    implement-issue: 実装完了 (2026-06-03T06:31:00Z)

  8. added a commit that references this issue on Jun 3, 2026
  9. squne121 commented on Jun 3, 2026

    @squne121
    OwnerAuthor

    impl-review-loop iteration 2 — Step 1 修正完了

    対応した REQUEST_CHANGES

    B1 blocker 修正: deploy-pages.yml の Verify preview assets are live step が dist/index.html(ローカル)ではなく /tmp/preview-index.html(リモート hosted index)から asset path を抽出するよう修正しました。

    追加修正:

    • remote index に ${base}assets/ が存在し root /assets/ がないことを検査する行を追加
    • 各 asset path が expected base 配下であることを case 分岐で検査するよう追加
    • vite.config.ts: normalizeBase が //... (protocol-relative) を拒否するよう修正

    PR body の preview smoke 件: PR body の pr-614 smoke はフックにより更新できませんでした。コードコメントとして: これは任意 path での build 形状確認 smoke であり、実際の PR Preview live check は workflow 側の ${GITHUB_SHA}?cache_bust + /tmp/preview-index.html で行われます。

    VC 確認結果 (iteration 2)

    • AC1-AC9: すべて PASS
    • pnpm typecheck / pnpm lint / pnpm test / pnpm build: PASS
    • commit: 2574101
  10. squne121 commented on Jun 3, 2026

    @squne121
    OwnerAuthor

    post-merge-cleanup 完了

    worktree・ブランチ削除完了。follow-up は下記の通り全スキップです。

    • B1 blocker follow-up: iteration 2 で修正済み・マージ済みのため不要
    • normalizeBase // follow-up: 同上、修正済み
    • PR body smoke: 既マージ PR の履歴修正、value なし
    • dist/ asset validation: optional enhancement、スコープ外

    親 Issue #571 は child #609 が OPEN のため keep_open を維持します。

  11. squne121 commented on Jun 6, 2026

    @squne121
    OwnerAuthor

    全 child issue (#706) のマージが完了し、AC6/AC8 の退行が解消されました。post-merge-cleanup により自動クローズ。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/implementerenhancementphase/implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions