From e8127d2a464d0fef874246d25b495e87807fdbc2 Mon Sep 17 00:00:00 2001 From: Codex PR QC Date: Tue, 30 Jun 2026 14:47:37 +0800 Subject: [PATCH] docs(openspec): archive uninstall ghost state fix --- .../.openspec.yaml | 0 .../design.md | 0 .../proposal.md | 0 .../specs/agent-update/spec.md | 0 .../tasks.md | 0 openspec/specs/agent-update/spec.md | 23 +++++++++++++++++++ 6 files changed, 23 insertions(+) rename openspec/changes/{fix-uninstall-ghost-state => archive/2026-06-30-fix-uninstall-ghost-state}/.openspec.yaml (100%) rename openspec/changes/{fix-uninstall-ghost-state => archive/2026-06-30-fix-uninstall-ghost-state}/design.md (100%) rename openspec/changes/{fix-uninstall-ghost-state => archive/2026-06-30-fix-uninstall-ghost-state}/proposal.md (100%) rename openspec/changes/{fix-uninstall-ghost-state => archive/2026-06-30-fix-uninstall-ghost-state}/specs/agent-update/spec.md (100%) rename openspec/changes/{fix-uninstall-ghost-state => archive/2026-06-30-fix-uninstall-ghost-state}/tasks.md (100%) diff --git a/openspec/changes/fix-uninstall-ghost-state/.openspec.yaml b/openspec/changes/archive/2026-06-30-fix-uninstall-ghost-state/.openspec.yaml similarity index 100% rename from openspec/changes/fix-uninstall-ghost-state/.openspec.yaml rename to openspec/changes/archive/2026-06-30-fix-uninstall-ghost-state/.openspec.yaml diff --git a/openspec/changes/fix-uninstall-ghost-state/design.md b/openspec/changes/archive/2026-06-30-fix-uninstall-ghost-state/design.md similarity index 100% rename from openspec/changes/fix-uninstall-ghost-state/design.md rename to openspec/changes/archive/2026-06-30-fix-uninstall-ghost-state/design.md diff --git a/openspec/changes/fix-uninstall-ghost-state/proposal.md b/openspec/changes/archive/2026-06-30-fix-uninstall-ghost-state/proposal.md similarity index 100% rename from openspec/changes/fix-uninstall-ghost-state/proposal.md rename to openspec/changes/archive/2026-06-30-fix-uninstall-ghost-state/proposal.md diff --git a/openspec/changes/fix-uninstall-ghost-state/specs/agent-update/spec.md b/openspec/changes/archive/2026-06-30-fix-uninstall-ghost-state/specs/agent-update/spec.md similarity index 100% rename from openspec/changes/fix-uninstall-ghost-state/specs/agent-update/spec.md rename to openspec/changes/archive/2026-06-30-fix-uninstall-ghost-state/specs/agent-update/spec.md diff --git a/openspec/changes/fix-uninstall-ghost-state/tasks.md b/openspec/changes/archive/2026-06-30-fix-uninstall-ghost-state/tasks.md similarity index 100% rename from openspec/changes/fix-uninstall-ghost-state/tasks.md rename to openspec/changes/archive/2026-06-30-fix-uninstall-ghost-state/tasks.md diff --git a/openspec/specs/agent-update/spec.md b/openspec/specs/agent-update/spec.md index 6b7cd10..3a4849f 100644 --- a/openspec/specs/agent-update/spec.md +++ b/openspec/specs/agent-update/spec.md @@ -423,6 +423,29 @@ When an agent is recorded with install type `script` or `binary`, Quantex SHALL - **THEN** Quantex removes the installed-agent state entry - **AND** the uninstall command reports success +### Requirement: Uninstall MUST recover ghost managed install state + +When a managed package is no longer installed but Quantex still records install state, uninstall SHALL clear the stale state entry after confirming package absence through the recorded installer. + +#### Scenario: Retrying uninstall after package removal succeeded but state persistence failed + +- **GIVEN** an agent has recorded managed install state +- **AND** the managed package is no longer installed on the system +- **AND** the recorded package manager is available and can confirm absence +- **WHEN** the user runs `quantex uninstall ` +- **AND** the managed package-manager uninstall command reports failure +- **THEN** Quantex removes the installed-agent state entry +- **AND** the uninstall command reports success + +#### Scenario: Ghost recovery does not run when the package manager is unavailable + +- **GIVEN** an agent has recorded managed install state +- **AND** the recorded package manager is unavailable +- **WHEN** the user runs `quantex uninstall ` +- **AND** the managed package-manager uninstall command reports failure +- **THEN** Quantex does not remove the installed-agent state entry +- **AND** the uninstall command reports failure + ### Requirement: Exec and shortcut install flows MUST honor global timeout during managed install When `quantex exec` or shortcut `quantex ` runs with `--timeout` and must install a missing agent before launch, Quantex SHALL apply the configured timeout to the install phase. After the deadline fires, Quantex SHALL wait up to `min(timeoutMs, 250)` for managed install work to finish before cancelling managed installer subprocesses.