Repository navigation
Description
Goal
Support a monorepo with one pv.yml at the repository root that describes multiple independently linked PV Projects. Ordinary single-project pv.yml files continue to work. Workspace members do not need config files in their own directories.
Proposed config
For a repository directory named shop:
primary: web
projects:
web:
path: apps/laravel
php: "8.4"
env:
API_URL: "https://api.shop.test"
api:
path: apps/api
php: "8.5"
env_file: .env.localpv link at the workspace root derives shop.test from the root directory and links the declared member paths. primary: web gives web the shop.test hostname; api gets api.shop.test. These are explicit Project hostnames. Other member keys become corresponding subdomains, without automatically exposing unlisted folders.
A top-level projects: identifies workspace config. Without it, PV parses the file as one normal Project. Each member uses the existing per-Project config fields and validation. Member path values are relative to the workspace root; each member's env_file and document root are relative to that member's path. The member key determines its generated subdomain, so moving a folder does not silently rename its URL.
Project and config ownership
- Treat each member's canonical directory as its Project identity. Record the shared config file and member key with the linked Project so CLI commands and the daemon can find that member's settings.
- Parse the single-project and workspace forms into the same per-Project model for serving, resources, status, and environment rendering.
- Validate a workspace declaration before applying membership changes. A valid removal of a member entry unlinks that Project and removes its route while preserving Project data. An invalid config keeps the last valid working state and reports the error.
- A declared member whose directory is deleted remains linked and is reported missing, following normal linked-Project behavior.
- Continue allowing independently linked nested Projects. Current-directory lookup through SQLite chooses the nearest linked Project.
- From a member directory, Project-aware commands and the PHP shim use that member's settings from the shared file; Composer continues through the PHP shim. At the workspace root, if it is not itself a linked Project, current outside-Project command behavior applies.
- Config-writing commands such as
pv php:useupdate the selected member in the parent file without creating a childpv.ymlor changing sibling settings. Config readers and daemon reconciliation use the same member lookup. - Define
pv unlinkbehavior for a member still declared in the workspace file so the CLI cannot silently leave SQLite and the file in conflict.
Acceptance criteria
- Update
DESIGN.mdand user docs for the two config shapes and workspace lifecycle. - Integration tests cover one-file linking, key-derived hostnames, independent PHP/resource/env settings, nested current-directory resolution, and no child config files.
- Integration tests cover
php:useand PHP/Composer shim selection from member subdirectories, with writes confined to the correct member. - Integration tests cover valid member removal, invalid-config last-valid behavior, missing member directories, and independently linked nested Projects.
Related: #371 owns automatic wildcard subdomains and removal of hostnames:; #372 owns local HTTP proxy projects. This workspace feature can be implemented and verified with existing exact hostnames and PHP serving. The earlier bot implementation-plan comment on this issue describes the pre-split scope; this body supersedes it.
Activity
pullfrog commentedon Sep 26, 2026
Assessment: Actionable, but cross-cutting. The current model reads
pv.ymlonly from each Project root (crates/config/src/discovery.rs), persists oneconfig_pathper Project without a member selector (crates/state/src/database.rs), watches member directories (crates/daemon/src/watcher.rs), and assumes every served Project needs a PHP worker (crates/daemon/src/gateway.rs).DESIGN.mdcurrently specifies explicithostnames:and non-wildcard certificates, so the design contract must change before implementation.Plan
DESIGN.mdfirst. Define strict workspace parsing (primaryplusprojects), member-key/relative-path validation, per-memberProjectConfigreuse, canonical member path identity, and a config-source reference (shared file plus member key). Keep ordinarypv.ymlbehavior. Defineproxy: <port>as a mutually exclusive served mode with PHP serving, and rejecthostnames:in both config shapes. Verify with config integration tests for valid shapes, unknown keys, collisions, path containment, and invalid ports/modes.pv linkat a workspace root validate the complete declaration, derive<root>.testand<member>.<root>.test, then upsert members by canonical path in a transaction, preserving IDs, slugs, and resource data. Only after a fully valid edit should omitted workspace-owned members be unlinked; independently linked nested Projects must remain untouched. Store source membership independently ofconfig_path, keep nearest-path lookup in SQLite, and watch each shared config file once, reconciling its members together. A missing member directory must remain linked and report missing rather than making the declaration invalid; malformed config must not partially unlink or overwrite last-valid state. Verify link/relink, rename/removal, parse-error recovery, missing directories, nested resolution, and rollback-safe migrations (the previous app must still read the database).project:env/list/status, PHP and Composer shims, andphp:usethrough the persisted config-source lookup. Resolve memberenv_fileanddocument_rootagainst its own path, not the workspace root. Update member entries in the shared file atomically while retaining sibling settings and file mode; auditpv initso it never silently creates child config for a linked member. Verify distinct PHP tracks, resources, env output, nested-directory shims, and member-only writes with no child config.hostnames:parsing, selector/state/routing logic, and stale output/help references; retain only schema required for immediate-previous-version rollback perDESIGN.md. Updatedocs/user/README.md, CLI help/snapshots, and the certificate ADR to match the new contract. Run focused config/state/CLI/daemon integration tests, macOS Gateway/TLS tests, formatting and workspace Clippy.Decisions to confirm in the design step: I recommend requiring
primaryto name a declared member rather than silently choosing one, and rejectingpv unlinkfor a still-declared workspace member with instructions to remove its entry (otherwise the next reconciliation would relink it). Also define whetherpv link --hostnameis rejected at a workspace root, since the issue specifies directory-derived hostnames. These do not block planning, but should be settled before implementation.Task list (3/3 completed)
GPT Sol| 𝕏pullfrog commentedon Sep 26, 2026
Run failed. View the logs →
GPT Sol| 𝕏[-]feat: support workspace projects, wildcard subdomains, and local proxy serving[/-][+]feat: support monorepo workspaces in one pv.yml[/+]