-
Notifications
You must be signed in to change notification settings - Fork 0
feat(workflow): H2→preview server auto-launch + /pf:preview slash command (Phase 2) #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
09f66b5
feat(scripts): start-preview-server.sh — profile-aware preview server…
sgwannabe 89200f3
feat(commands): /pf:preview slash command (Phase 2)
sgwannabe 109ce4f
docs(agents,commands): explicit H2→preview auto-launch imperative (Ph…
sgwannabe b914de0
fix(preview-server): apply PR #104 review feedback (codex + coderabbit)
sgwannabe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| --- | ||
| description: Launch the local preview server for a frozen run (post-H2 or manual re-open) | ||
| --- | ||
|
|
||
| # /pf:preview — Launch the local preview server for a frozen run | ||
|
|
||
| **Layer-0 정책**: Pro/Max 기본 포함. 별도 API 키 불필요. | ||
|
|
||
| ## Usage | ||
|
|
||
| ``` | ||
| /pf:preview [run_id] | ||
| /pf:preview stop [run_id] | ||
| /pf:preview status [run_id] | ||
| ``` | ||
|
|
||
| ## 인자 | ||
|
|
||
| - `run_id` (optional): 특정 run. 생략 시 가장 최근 run (`ls -t runs/r-* | head -1`). | ||
|
|
||
| ## 동작 | ||
|
|
||
| `bash scripts/start-preview-server.sh runs/<id>/` 호출. `runs/<id>/` 의 내용으로 profile 자동 감지: | ||
|
|
||
| 1. `docker-compose.yml` 존재 (pro/max) → `docker compose up -d` + 첫 published port → 브라우저 자동 오픈. | ||
| 2. `apps/api/package.json` + `apps/web/package.json` 존재 (standard) → 의존성 설치 → 18080부터 free port 자동 탐색 → `pnpm dev` 백그라운드 spawn → web TCP accept 대기 (≤60s) → 브라우저 자동 오픈. | ||
| 3. 둘 다 없음 → exit 2 (TestDD freeze 미완료). | ||
|
|
||
| 본 명령은 H2 승인 직후 M3가 자동으로 한 번 호출하므로 수동 실행은 보통 **재오픈** 또는 **재기동** 용도다 (서버를 stop 했거나 머신을 재부팅한 경우). | ||
|
|
||
| ## Idempotency | ||
|
|
||
| 이미 살아있는 PID 가 `<run_dir>/.preview-server.pid` 에 있으면 재기동 없이 URL 만 다시 연다. 두 번 spawn 되지 않는다. | ||
|
|
||
| ## 종료 | ||
|
|
||
| - `/pf:preview stop <run_id>` — SIGTERM → 5s 대기 → SIGKILL fallback. docker 프로필은 `docker compose down`. | ||
| - `/pf:preview status <run_id>` — 살아있으면 stdout 에 URL + exit 0, 아니면 exit 1. | ||
|
|
||
| ## 관련 | ||
|
|
||
| - 본 명령은 plugin `preview-forge`의 일부입니다. | ||
| - 스크립트: `scripts/start-preview-server.sh` (CI 테스트용 `PF_PREVIEW_DRY_RUN=1` 지원). | ||
| - Gap B 배경: DEMO-STORYBOARD.md L1:50–2:00 의 자동 localhost:18080 약속. | ||
| - 상세 스펙: [preview-forge-proposal.html](../../../preview-forge-proposal.html) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.