Move harness profiles between host and Docker and stop silent draft retargeting

Native installs left Docker-era harness profiles in harnesses.json, so every
authoring launch failed trying to reach a Docker service, and a retained draft
bound to the old Docker server was silently projected onto the configured one.

- harness: add Profile.Mode and VerifyDockerLink as the single mode/verification
  helpers. `harness setup --host` configures or converts a host profile and
  clears docker_directory; reconfiguring a Docker-linked profile re-verifies the
  recorded directory still owns compose.yaml and fails naming it instead of
  saving a link that cannot launch. Setup's summary and `harness list` (via the
  new List/ListView shape) report the resulting mode and, for Docker, the
  directory, without changing the stored Config schema.
- setup-native.py: after build/install-skill it writes host (no docker_directory)
  profiles for the detected harnesses, defaulting to the detected OpenCode profile
  rather than a stale pi default, taking models from --model or the existing valid
  profile and never inventing one; it clears a stale Docker link and preserves
  unrelated keys/profiles. Detection-only: no harness install, upgrade or download.
- draft: add Draft.Resolve, the shared mismatch helper, which projects a draft
  onto the configured server and returns a dual-URL notice. CLI validate/submit
  and the TUI draft browser use it so a foreign draft is never silently
  retargeted; the TUI pre-wraps the notice to the panel width.
- Tests cover the Docker->host and host->host transitions, the missing-directory
  failure, installer write/migration (Python), and the CLI/TUI notice, using the
  real config file path in a temp dir.
- Update help text, README, docs and the packaged authoring skill reference to
  describe host as the default and the Docker-linked case.
This commit is contained in:
2026-10-15 19:53:10 +01:00
parent d00bd37833
commit 914345cb31
21 changed files with 732 additions and 141 deletions
+6 -3
View File
@@ -72,8 +72,9 @@ pipelines new "release notes" "Summarize changes and notify my phone"
pipelines new "Text summary" --template summary
```
`new` opens the configured harness (Pi or OpenCode; Docker-linked by default)
immediately when its name/request is omitted. The skill asks only for missing
`new` opens the configured harness (Pi or OpenCode; host by default, or
Docker-linked when a checkout is linked) immediately when its name/request is
omitted. The skill asks only for missing
decisions and records the chosen name in draft metadata. `edit` accepts an exact
name or ID, with names taking precedence over numeric IDs. Both retain private
drafts and launch the harness once with a short `@pipelines` reference and
@@ -144,7 +145,9 @@ the existing draft, `v` for server validation, and `s` for submission confirmati
server you are connected to. Same-server submissions preserve create-only/version
guards. A different destination imports the draft as a new pipeline, ignoring
the origin's version number and refusing an existing destination name; the
confirmation shows the destination. Retained source and origin metadata stay
confirmation shows the destination, and opening, validating or submitting a draft
whose recorded server differs from the configured one prints a notice naming both
URLs so it is never silently retargeted. Retained source and origin metadata stay
unchanged. For an edit draft, CLI `submit --expected-version N` can explicitly
approve an update against version N on the destination (or `--force` can explicitly
skip that version check). For unnamed drafts, submission asks you to
+11
View File
@@ -41,6 +41,17 @@ host OpenCode/Pi and never installs, upgrades or downloads them, and
reconfiguration never falls back to host harness execution.
Container credentials and accounts are separate from host credentials and are
reused on reinstall/reconfigure.
Profiles live in XDG config home's `pipelines/harnesses.json` and record their
launch mode: a host profile launches the executable directly, while a
Docker-linked profile records the checkout directory and launches through
`docker compose exec`. `harness setup <opencode|pi> --host` configures (or
converts) a host profile and clears any Docker link; without `--host`,
reconfiguring a Docker-linked profile re-verifies that the recorded directory
still has `compose.yaml` and fails naming it instead of saving a link that cannot
launch. Setup's summary and `harness list` report the resulting mode (and, for
Docker, the directory) so a profile never silently stays Docker-linked. The
native installer writes host profiles for the harnesses it detects and clears a
stale Docker link rather than leaving the config Docker-linked.
Defaults affect only new drafts/starters, not existing immutable versions.
OpenCode uses `mini --model` to avoid changing unrelated host/project defaults.
Pi stage execution requires its profile on the server; interactive host and
+9
View File
@@ -36,6 +36,15 @@ manifest is what `scripts/manage.py` and the Go CLI load. Provider/model default
are never invented: your existing host OpenCode configuration is reused (an
explicit `--model` is recorded if supplied), and setup never starts a picker.
The native install also writes **host** harness profiles for the harnesses it
detects into XDG config home's `pipelines/harnesses.json` (no
`docker_directory`), defaulting to the detected OpenCode profile rather than a
stale `pi` default and taking models from `--model` or the existing valid profile.
When migrating a Docker install it clears the recorded Docker link instead of
leaving the config Docker-linked. It never installs, upgrades or downloads a
harness. If no valid model can be resolved it writes nothing and points you at
`pipelines harness setup <opencode|pi> --host`.
ntfy is built from source with no Homebrew or package manager. Setup resolves the
exact stable `binwiederhier/ntfy` tag (never the moving `latest` tag and never an
older fallback), then compiles the server from the pinned `heckel.io/ntfy/v2` Go