feat: add make cleanup target
Some checks failed
tamq-ci / test (push) Failing after 6s

Assistant: codex
Assistant-Model: gpt-5.6-sol
Assistant-Session: 01a03397-4d51-7fd1-8ff2-946eb22ea2bc
This commit is contained in:
tegwick 2026-08-25 22:25:54 +02:00
parent cd73b954e9
commit 72f22a13f7
5 changed files with 38 additions and 1 deletions

View file

@ -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

View file

@ -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.

View file

@ -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 |

View file

@ -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"

View file

@ -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.