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
+104 -104
View File
@@ -95,110 +95,110 @@ func (k keyMap) ShortHelp() []key.Binding {
func (k keyMap) FullHelp() [][]key.Binding { return [][]key.Binding{k.ShortHelp()} }
type Model struct {
editorCheckGeneration uint64
editorChecking bool
statusOpen bool
statusTop int
statusRequest, statusError string
systemStatus *protocol.SystemStatus
usage *protocol.UsageStats
draftOpen bool
draftItems []draft.Draft
draftIndex, draftTop int
draftError, draftSource string
ctx context.Context
url string
conn *websocket.Conn
status string
nextID uint64
lines []string
width int
height int
help help.Model
keys keyMap
pipelines []protocol.PipelineSummary
loaded bool
notificationEndpoints []protocol.NotificationEndpoint
logSeen []bool
unread int
logOpen bool
logTop int
logPan int
paletteOpen bool
commandInput textinput.Model
commandIndex int
homeTop int
searchOpen bool
detail *protocol.PipelineDetail
detailRequest string
detailLoading bool
detailError string
pipelineTop int
graphPan int
versionsOpen bool
versionIndex int
confirmOpen bool
actionConfirm *protocol.Message
actionConfirmTop int
actionApproved bool
defaultModel string
defaultHarness string
editorDebugRunID int64
mutationTitle string
mutationCommand func() tea.Cmd
mutationTop int
pendingDraft *editedMsg
draftNameInput textinput.Model
submitID string
submitNotice string
stageIndex int
stageTop int
stageFocus bool
stageConfigExpanded bool
reconnecting bool
requestedPipelineID int64
requestedVersion int
runs []protocol.RunSummary
runDetail *protocol.RunDetail
runOpen bool
runForm int
runInput textinput.Model
runPrompt textarea.Model
runWorkspace string
cliRun, cliStarted, runPicker bool
cliOptions RunOptions
runPickerIndex int
runPickerInput textinput.Model
runTask string
runPaths []string
runIndex, runTop int
requestedRunID int64
runStartRequest string
runStepIndex int
runDetailFocus bool
runCollapsed map[string]bool
runError string
runPipelineID int64
runFailedOnly bool
runSearch textinput.Model
runSearchOpen bool
runGraphFocus bool
runGraphTop int
runGraphPan int
editorOpen bool
editorInput textinput.Model
editorIndex int
editorDraft *editedMsg
draftDeletingPath string
draftDeletingTop int
runSpinner spinner.Model
templates []protocol.Template
templateOpen, templateRaw bool
templateGraphFocus, templateConfirm bool
templateGraphTop, templateGraphPan int
templateIndex, templateTop int
templateLines []string
templateRequest, templateError string
editorCheckGeneration uint64
editorChecking bool
statusOpen bool
statusTop int
statusRequest, statusError string
systemStatus *protocol.SystemStatus
usage *protocol.UsageStats
draftOpen bool
draftItems []draft.Draft
draftIndex, draftTop int
draftError, draftSource, draftNotice string
ctx context.Context
url string
conn *websocket.Conn
status string
nextID uint64
lines []string
width int
height int
help help.Model
keys keyMap
pipelines []protocol.PipelineSummary
loaded bool
notificationEndpoints []protocol.NotificationEndpoint
logSeen []bool
unread int
logOpen bool
logTop int
logPan int
paletteOpen bool
commandInput textinput.Model
commandIndex int
homeTop int
searchOpen bool
detail *protocol.PipelineDetail
detailRequest string
detailLoading bool
detailError string
pipelineTop int
graphPan int
versionsOpen bool
versionIndex int
confirmOpen bool
actionConfirm *protocol.Message
actionConfirmTop int
actionApproved bool
defaultModel string
defaultHarness string
editorDebugRunID int64
mutationTitle string
mutationCommand func() tea.Cmd
mutationTop int
pendingDraft *editedMsg
draftNameInput textinput.Model
submitID string
submitNotice string
stageIndex int
stageTop int
stageFocus bool
stageConfigExpanded bool
reconnecting bool
requestedPipelineID int64
requestedVersion int
runs []protocol.RunSummary
runDetail *protocol.RunDetail
runOpen bool
runForm int
runInput textinput.Model
runPrompt textarea.Model
runWorkspace string
cliRun, cliStarted, runPicker bool
cliOptions RunOptions
runPickerIndex int
runPickerInput textinput.Model
runTask string
runPaths []string
runIndex, runTop int
requestedRunID int64
runStartRequest string
runStepIndex int
runDetailFocus bool
runCollapsed map[string]bool
runError string
runPipelineID int64
runFailedOnly bool
runSearch textinput.Model
runSearchOpen bool
runGraphFocus bool
runGraphTop int
runGraphPan int
editorOpen bool
editorInput textinput.Model
editorIndex int
editorDraft *editedMsg
draftDeletingPath string
draftDeletingTop int
runSpinner spinner.Model
templates []protocol.Template
templateOpen, templateRaw bool
templateGraphFocus, templateConfirm bool
templateGraphTop, templateGraphPan int
templateIndex, templateTop int
templateLines []string
templateRequest, templateError string
}
func New(ctx context.Context, url string) Model {