diff --git a/Makefile b/Makefile index 65465d5..8cf266e 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ .DEFAULT_GOAL := help -.PHONY: help install uninstall test check +.PHONY: help install uninstall cleanup test check help: ## List available targets @awk 'BEGIN {FS = ":.*## "} /^[a-zA-Z0-9_-]+:.*## / {printf " %-12s %s\n", $$1, $$2}' $(MAKEFILE_LIST) @@ -13,6 +13,9 @@ install: ## Install or refresh tamq as a user-level uv tool uninstall: ## Uninstall the user-level tamq tool uv tool uninstall tmux-amq +cleanup: ## Stop tamq and remove tamq-owned runtime files (preserves history) + uv run tamq cleanup --yes + test: ## Run the test suite uv run pytest diff --git a/README.md b/README.md index 02ec9ba..62a3f36 100644 --- a/README.md +++ b/README.md @@ -223,6 +223,7 @@ terminal outside the managed session. It is a dry run unless `--yes` is given: ```bash tamq cleanup tamq cleanup --yes +make cleanup ``` Confirmed cleanup stops only the verified tamq broker, closes only a tmux @@ -231,6 +232,7 @@ clears leases and line counters, removes the configured socket/PID/lock files, deletes only tamq-generated protocol absorbers (including legacy `@repo` shims), and removes owned stale `tamq-*` tmux sockets. Durable message history and unrelated tmux sessions or files are preserved. +`make cleanup` is the convenient confirmed form and preserves that same scope. The command is idempotent; an ownership mismatch is reported instead of being removed. diff --git a/WORK-RECORDS.md b/WORK-RECORDS.md index 1a5a07d..aa8a0c3 100644 --- a/WORK-RECORDS.md +++ b/WORK-RECORDS.md @@ -28,6 +28,7 @@ | task | TAMQ-WP-ADHOC-2026-08-25-T01 | done | — | workplans/ADHOC-2026-08-25.md | | task | TAMQ-WP-ADHOC-2026-08-25-T02 | done | — | workplans/ADHOC-2026-08-25.md | | task | TAMQ-WP-ADHOC-2026-08-25-T03 | done | — | workplans/ADHOC-2026-08-25.md | +| task | TAMQ-WP-ADHOC-2026-08-25-T04 | done | — | workplans/ADHOC-2026-08-25.md | | task | TAMQ-WP-0001-T01 | done | — | workplans/TAMQ-WP-0001-statehub-bootstrap.md | | task | TAMQ-WP-0001-T02 | done | — | workplans/TAMQ-WP-0001-statehub-bootstrap.md | | task | TAMQ-WP-0001-T03 | done | — | workplans/TAMQ-WP-0001-statehub-bootstrap.md | diff --git a/tests/test_makefile.py b/tests/test_makefile.py index 51785c1..da586f0 100644 --- a/tests/test_makefile.py +++ b/tests/test_makefile.py @@ -16,6 +16,20 @@ def test_plain_make_lists_available_targets(): " help List available targets", " install Install or refresh tamq as a user-level uv tool", " uninstall Uninstall the user-level tamq tool", + " cleanup Stop tamq and remove tamq-owned runtime files (preserves history)", " test Run the test suite", " check Run tests and repository consistency checks", ] + + +def test_cleanup_target_requires_confirmed_tamq_cleanup_without_running_it(): + project = Path(__file__).resolve().parents[1] + result = subprocess.run( + ["make", "--no-print-directory", "-n", "cleanup"], + cwd=project, + text=True, + capture_output=True, + check=True, + ) + + assert result.stdout.strip() == "uv run tamq cleanup --yes" diff --git a/workplans/ADHOC-2026-08-25.md b/workplans/ADHOC-2026-08-25.md index e591db1..7d88196 100644 --- a/workplans/ADHOC-2026-08-25.md +++ b/workplans/ADHOC-2026-08-25.md @@ -90,3 +90,20 @@ worker content behind a presentation gutter. - A real tmux/PTY integration fixture emits a cursor-positioned, mixed-case, bullet-framed worker message. It is durably attributed as `worker_output` while the operator echo is suppressed. + +## Make cleanup convenience target + +```task +id: TAMQ-WP-ADHOC-2026-08-25-T04 +status: done +priority: medium +``` + +Add a discoverable `make cleanup` target that performs the confirmed tamq-owned +runtime cleanup while retaining durable message history. + +### Evidence + +- Plain `make` lists the cleanup target and its history-preservation contract. +- A dry-run make invocation proves that the recipe delegates exactly to + `uv run tamq cleanup --yes`; verification does not close an operator session.