feat: preview-site skill; serve prints the preview URL #247
No reviewers
Labels
No labels
bug
enhancement
needs-triage
ready-for-agent
ready-for-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/deckle!247
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/245"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #245
Engine
internal/supervisor: addsSupervisor.Ready(), a channel closed exactly once on the first transition torunning. The supervisor owns the state and serve only waits on the channel.harness servenow prints a second stdout line,site preview ready at <hugo.previewUrl>, after the listening line. It prints once per process: not again after a crash and restart, and never when Hugo fails before it first runs. The tests arecmd/harness/serve_test.go, including a real supervisor that serves, crashes and comes back, and newReadytests ininternal/supervisor.servebullet describes them. The "Scaffolding" skill list now names previewing.Scaffold
preview-sitewith the six steps from the issue. It uses POSIXshblocks: a detachednohupstart with the PID and log in the git-ignored.harness/, reuse of this site's recorded run, a fallback to--addr 127.0.0.1:0when 8090 is foreign, a bounded wait on/api/status, and on failure the error with no link. It also covers handing over the links, restart and stop, and the Publish caveat.AGENTS.md:preview-site./api/statusfields, the single list of changes that need a restart, and what Save and Publish do locally.add-backend-layoutandsetup-sitenow point at that list.verify-site,redo-theme(plusreferences/showcase-page.md),setup-site(its report ends with both links),edit-contentandmigrate-sitelink topreview-siteinstead of starting serve inline.verify-site's/api/pagecurl uses the reported port.scaffold/skills_test.go:expectedSkillsincludespreview-site.TestAgentsDocNamesSkillschecks for it.TestOnlyPreviewSiteStartsServefails if any other skill containsserve --site.CLAUDE.md's list of skill tasks names previewing.Decisions on the issue's assumptions
/api/sitecarries no site directory, and title plus languages can collide. The skill reuses only a run it recorded for this site: the PID is alive and the logged address answers/api/site, with a title sanity check. Any other listener on 8090 is treated as foreign, and the skill moves to a free port and says so. No server change.hugo.previewUrl, notpreviewURLas the issue spells it.Verification
go vet ./...andgo test ./...are green.shblocks were run as written, from a shell with noharnesson PATH and the binary at~/.deckle/harness/harness:hugobinerror and no link.lastBuildErrorfrom the status payload and no link.ADDR=127.0.0.1:0works.Left alone (out of scope)
--preview-base-urlbullet still mentions a postMessage origin, which may be stale after #242.scaffold/site/content/_index.mdsays "Runharness serve".🤖 Generated with Claude Code
[autoland] verdict: pass
Verdict: CONCERNS (non-blocking). Approve only, not merged.
Signal: CI never started (build-and-test stayed "Waiting to run", so no runner picked it up). Instead I ran the CI job's own steps locally on
c76f6c5: webnpm ci && npm run build && npm test(115 files, 2828 tests passed),go vet ./..., andgo test ./.... All of them passed.Conventions: the Conventional Commits title is fine and
Closes #245is present. The diff matches the issue. AGENTS.md, the affected skills, CLAUDE.md and the README all move together. Readiness has one owner:Supervisor.setStateclosesReady(), and serve only waits on it.Concern:
mainor detached. When the checkout is on any other branch, the harness runs in branch mode (README "Branch mode"). Every save then commits on that branch and pushes it. So a developer or agent previewing from a feature branch, or from theeditorbranch that setup-site says never to push, gets their saves committed and pushed while the skill tells them to "save freely". Fix: state the condition, or name branch mode, in the AGENTS.md fact. The skill then inherits the fix through its pointer.Nits (not blocking):
"Previewing locally" below, but the section is above it, at line 137..harness/as only the thumbnail cache. It now also holds preview.pid and preview.log.Addressed the review concern and the three nits in
8e8d81a.Concern (AGENTS.md "Saving and Publish"): the fact now states the condition. With HEAD on
main, detached, or in no repository the harness is in WIP mode and a save writes files only, commits to no branch and pushes nothing. With HEAD on any other branch it is in branch mode: that branch is the draft branch, and every save is committed on it and pushed at once. It tells the reader to checkgit branch --show-currentbefore starting a local editor, warns about feature branches and the deckle-hostededitorbranch (pointing atsetup-site), namesGET /api/git/stateas the way to read the running mode, and limits "save freely" to WIP mode. Publish is described as pushingmainin both modes.preview-sitestep 6 inherits the fix through its pointer: it now says to rungit branch --show-currentbefore step 2 and to say in the hand-over when saves will be committed and pushed.Nits: "Previewing locally" is now referenced as above the element procedure; the scaffold
.gitignorecomment names the preview run (PID and log) in.harness/; the README skill-list paragraph is re-wrapped.go vet ./...andgo test ./...are green (web built first for the embed).