Repository navigation
[Spec 2045] The Tower page's right panel as a Site view - #2059
Open
waleedkadous wants to merge 109 commits into
Open
waleedkadous wants to merge 109 commits into
waleedkadous wants to merge 109 commits into
Conversation
… workspaces with open decisions
…and image rulings
…e, and the report's decisions fields
…ant, loud short answers, cold timings
… facts, and the report's owner field - GET /api/site/agents (SiteAgentsReport): every known workspace and each running one's architects and builders, from the overview's own code (listWorkspaceBuilders, live-agents.ts), titles and drafts from OverviewCache.peekForgeFacts, never a forge call; one build shared across callers for 1 s (SharedBuilds, extracted from OverviewCache); IDE availability per request. - OverviewBuilder.pr from the last pr_history entry; discoverBuilders can report an unreadable .builders/ as the workspace's error in the site read. - SiteAgent.spawnedByArchitect (R12) on /api/site and afx site --json. - Tower's broadcast hook renamed dropSharedBuilds(); drops both shared builds.
…nly builders fail, tab id doc, IDE reason tests - An unreadable .builders/ is the workspace's error but no longer hides its live architects. - SiteArchitectRow.tabId documented as the dashboard's rule (first listed is 'architect'). - ideAvailabilityWithReason: reasons, no connect locally, exactly one loopback connect via the tunnel.
…for 10 s (R13 amended) The architect's ruling on the phase 3 review: R13's 'no network call' means no call off this machine; one loopback check of the IDE's port is allowed for tunneled requests only, its answer held about 10 s so a dead port costs its 1 s timeout at most once per period. - HeldPortCheck and siteIdeAvailability (the route's IDE field); /api/status keeps its unheld check. - Tests: the held check's rules, and the full tunneled report path over a real socket. - Spec R13 and plan phase 3 amended; rebuttal recorded.
…ock complete, held check guards both paths
… in the shipped skill history The afx skill's afx site paragraph now names the open-decisions fields, so codev update must know this version as one Codev shipped (generate-skill-hashes).
…als fake the way Tower does Found by the Windows workflow: the fake keyed each workspace's terminals by its raw path, while the read asks under workspaceKey(), which on Windows expands the runner's 8.3 temp folder (RUNNER~1) to its long name. Every running workspace then carried 'no terminals entry' and 10 of 15 tests failed. Tower's own map writes and reads under workspaceKey(), so the product was right.
…nt list, its Peers place and the Launch form From Claude's phase 9 review: - afx workspace remove said a removed workspace 'leaves Recent', the Home tab's list that is gone: it is no longer listed. In its dry-run output, both agent-farm.md copies, all four afx skill copies (shipped skill history regenerated) and the removal module's comment. - agent-farm.md (both trees): Peers is on the landing page's Machine tab. - testing-guide.md's example filled the removed Launch form on port 4100 and named a script that does not exist: it now starts a stopped workspace from the Site view, on a throwaway Tower. - spec-2045-site-view matches the real Tower's stopped group by pattern, as spec-2041-parity does, so a workspace an earlier suite left behind does not fail it on a count.
…spaces under Tower's own spelling The Windows rerun (47044722733) left 4 of 15 failing: the test's temp folder kept the runner's 8.3 short name (RUNNER~1), so the builders rows it wrote carried worktree paths that the read, which lists builders under the canonical long name, did not match (owners read as null, worktree paths spelled differently). Tower registers workspaces under normalizeWorkspacePath(), so the test now creates its folder that way, as the repo's other Windows-run tests do. The product is unchanged.
…ns and the review's doc fixes
…er; arch.md places Peers on the Machine tab Claude's iteration 2 nits: the four-width shots now use the default fixture (air-2044 working, docs-site's main asking), with the asking builder as its own 700 px shot; the Spec 1967 block in arch.md names the landing page's Machine tab.
Contributor
Author
|
Re-dispatched on this PR's head (2294615), since commits after the earlier green runs touch CSS, docs, a dry-run string and an e2e fixture:
Results will be posted here when they finish. |
… as <img>, through the workspace route (R19a) The sanitizer keeps attributes that make the browser fetch a URL by itself: <picture>'s and a medium's <source>, <video poster>, <audio>/<track src>, <table background>, SVG <image href>, <input type=image src>, and inline styles with url(). decisionsHtml now drops them on every element but <img> and <a>, and drops a style that holds a CSS function or escape. Shared with the dashboard's Decisions tab, which had the same gap. Also a stray blank line at the end of SiteTreeView.test.tsx.
… R11 checked on the real workbench, one image-route test per element kind
…hat markdown writes (R19a) The architect's ruling, after two review rounds each found a hole in a list of things to strip (round 2: <style> elements, HTML's and SVG's, survive the renderer's sanitizer). DecisionsMarkdown now runs DOMPurify a second time with ALLOWED_TAGS/ALLOWED_ATTR naming only what markdown writes, so <img src> is the only attribute left that fetches and the image route rule is the whole rule. Agreed before cutting: tabindex, s, ol start and h3-h6 kept; table alignment carried as align; data-line, data-row and id cut. The iteration-1 strip lists are gone. dompurify declared in workspace-views (the same 3.4.8). One test per refused kind, an unknown element and attribute dropped, and everything markdown writes kept; leaks() now reads text too.
…he Decisions tab loads them; the allow list), review and lessons
…Windows checkout passes Adjacent fix for the pre-review lists merged from main (PR #2058). A Windows checkout writes the shipped Markdown with CRLF and porch carries it through the included list into the prompt, while the test's expected text is LF: all 30 of its exact-text checks failed on the Windows runner (run 47052758797). The test now reads the list files and the rendered prompt as LF. Test only: porch's rendering and the files' line endings are unchanged. Checked locally with every protocol Markdown file converted to CRLF: 85 of 85 pass.
…, a code block's language Claude's round-3 note: with class allowed on any element, an item could take one of the page's own classes (the dashboard's fixed, full-screen confirm-dialog backdrop) and dress up as the page. Markdown writes one class, language-* on <code>; any other is dropped after the allow-list pass.
…view's final figures
Contributor
Author
|
CI on the final head 04b2279, at the
The branch is up to date with |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The Tower landing page's right panel becomes a Site tab, built for a programmer running several workspaces:
POST …/api/decisions/rule, so there is no second ruling path. Porch gates and agents' questions are not rows here.Tree). Each row has a state glyph and word, a gate chip, a PR chip and two open icons: Dashboard, and Codev IDE (a builder's IDE icon opens its worktree). The tree also has a filter, expansion remembered per browser, and live updates that keep what is open, the scroll position and focus.Home's cards, Stop, Restart, New Shell, copy path, the Launch form and Recent are gone; the routes and
afxcommands stay. The Site Manager pane offers only Start, and only while it is not running.Closes #2045
Changes
packages/types,packages/sdk):SiteAgentsReport,SiteDecisionsReport, R12 fields onSiteStatus(decisionsFile,openDecisions,decisionsReason,spawnedByArchitect). New helperssiteActivityState(a gated builder's own activity, read from the raw facts),isSiteFinishedBuilder,formatAgeWords.packages/codev/src/agent-farm/servers):GET /api/site/agentsruns the overview's own discovery, builders table, served state and live architects. It never calls the forge, and its builds are shared per burst as in the overview cache fix of Sidebar refetches and redraws on every agent tool call; the web IDE shows a permanent refresh spinner #2036.GET /api/site/decisionsreads through a parse cache keyed by mtime, size and inode./api/site's counts use the same cache./pane/*files (pane-assets.ts).live-agents.tsandshared-builds.tsare extracted so the overview and the Site read share one copy.packages/workspace-views):DecisionCard,DecisionsMarkdown,HeldDrafts,useRulingStateandcreateDecisionsHostare exported.?tab=decisions&item=<id>.apps/web/src/site/, in the pane bundle):tower.html:codevSiteManagerPane.site.#site-hatch) when the script is missing or the view fails.overview-changedevent no longer toasts.arch.md, bothagent-farm.md, the afx skill's four copies,testing-guide.md.For the architect
/api/statusand the mint, so no pane bundle or terminal socket loaded.ideTargetUrlopened this builder's worktree in the Codev IDE workbench. The window is titledaspir-2045 — Codev, the Explorer lists the worktree, and the Codev sidebar reads Connected.<img>loads as the Decisions tab loads it today (images in decision items, Decisions tab: show images from the workspace inline in decision items #1938). The tradeoff: on the local page the browser fetches the third-party URL, while under Codev Cloudimg-src 'self'refuses it. The item's author is the person's own agent.{openIde, startWorkspace, selectTab, showFallback}, andsite.unmount()is new. React render failures reach the hatch throughonUncaughtError. An error thrown inside a React event handler does not: the view stays usable, and that one action fails with a console error./pane/*now answersContent-Encoding: gzip, so the proxy must pass the body as it is, without compressing it again.blob:inimg-srcsince 3 Dec (staging and production), so decision images load there now. Under a policy withoutblob:, the card shows its "Image not loaded" note and the item can still be ruled; the e2e test covers that case against the stand-in'simg-src 'self' data:.Deviations from the plan
SiteAgentsReport.ide), not from/api/statusthroughupdate(). That keeps one source, read on the rows' own cadence, and R13 agrees.MachineLineView.tsxandSiteTreeView.tsx, becauseMachineLine.tsxwould differ frommachineLine.tsonly in case, which macOS treats as one file.PaneAssetsis kept in a module-level map, not a newRouteContextfield.describeNeedsInput's words, per your ruling of 3 Dec.Adjacent fixes:
updatethrew stopped the rest ofmountPanes(); that first update now goes through the guarded path.afx workspace remove's dry-run said a workspace "leaves Recent"; it now says it "is no longer listed".testing-guide.md's example drove the removed Launch form on port 4100.<style>elements, SVG,<picture>/<source>, media,<table background>,<input type=image>andstyleattributes.<img src>is the only attribute that fetches.tabindex,s,ol startandh3–h6kept; table alignment carried asalign;data-line,data-rowandidcut.language-*, so an item cannot take one of the page's own classes, such as the dashboard's confirm-dialog backdrop.Bundle size (accepted in planning)
It is still one script and one stylesheet, with no
eval, nonew Function, nodata:font and nothing loaded from another host. React Aria Components 1.23.0 and lucide-react 1.86.0 are pinned exactly, and Lucide icons are imported one at a time.Testing
apps/web: the site model, reads, shape checks, components, pane API and fallback.
workspace-views: the shared Decisions pieces, held drafts, the anchor.
packages/codev: both reads, the parse cache, the held IDE check, pane assets, template tests of the page.
sdk: the site helpers.
Budget at 50 known and 15 running workspaces:
/api/site/decisions/api/site/agents/api/sitewith the R12 fieldsspec-2045-site-view(17 passed, plus 1 screenshot test that runs only when asked):status.yaml.tower-integrationanddashboard-bugs, which a worktree cannot run.Screenshots (kept local, as the spec requires; not attached)
A fixture Tower with four running workspaces and three stopped ones, at 1440, 1024, 700 and 360 px. Each shot shows:
codevwithmainworking,reviewidle and the stopped owneride;Three more shots: two at 1440 px with the filter (
mobile, which matches a workspace's own name, and2044, which matches a builder), and one at 700 px where an asking builder's prompt wraps.Flaky Tests
These existed before this branch, fail sometimes for reasons unrelated to it, and were left running:
tunnel-edge-cases.test.ts, "handles 10 rapid connect/disconnect cycles without resource leaks":ERR_INTERNAL_ASSERTIONinClientHttp2Session.destroy, raised as an unhandled error while every test passes.bugfix-2021-codex-isolation.test.ts, "runs the bundled CLI through its launcher": 5 s timeout under the full suite.spec-2041-workspace-remove.test.ts, "in a submodule" and "git stash list failing counts as unsaved, and removal is refused without --force": 5 s timeouts under load near 28. The file passes 53/53 when run alone.Spec
codev/specs/2045-tower-page-redesign-the-right-.md
Review
codev/reviews/2045-tower-page-redesign-the-right-.md