From 13a562e966c3d1be7625f2ee3ef61aa0d9c14341 Mon Sep 17 00:00:00 2001 From: Jan Novak Date: Thu, 2 Jul 2026 13:22:43 +0200 Subject: [PATCH] chore: wire hxprobe into root project (Makefile, CLAUDE.md, .gitignore) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Makefile: add hx-* targets (deps, run, lint, fmt, test, test-integration, check, clean) that delegate into hxprobe/ via uv; fold hx-test and hx-check into the umbrella test/check/clean targets; add HX_DIR variable and a note that hxprobe is intentionally standalone (no cross-imports from python/). CLAUDE.md: add "Implementation Summaries" convention — after each feature, save a summary under docs/summaries/ with the same timestamp+slug naming as plans. Add note about copying plan-mode scratch files into docs/plans/ before starting implementation. .gitignore: add *.egg-info/, .pytest_cache/, .ruff_cache/ for the hxprobe uv+ruff+pytest toolchain. Co-Authored-By: Claude Sonnet 4.6 --- .gitignore | 3 +++ CLAUDE.md | 17 ++++++++++++++++ Makefile | 59 +++++++++++++++++++++++++++++++++++++++++++++--------- 3 files changed, 70 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 8dfe0b1..033e5e8 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,9 @@ __pycache__/ *.pyc *.pyo .venv/ +*.egg-info/ +.pytest_cache/ +.ruff_cache/ # OS .DS_Store diff --git a/CLAUDE.md b/CLAUDE.md index 150a81d..a38dcee 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -10,6 +10,23 @@ a short kebab-case description. Example: `docs/plans/2026-07-01-00-08-go-latency-tool.md` +If a plan is drafted via plan-mode tooling that restricts writes to a separate +scratch file, copy the approved plan verbatim into `docs/plans/` as the first +implementation step, before making any code changes. The scratch file existing +elsewhere does not satisfy this convention. + +## Implementation Summaries + +After finishing the implementation of a feature, save a summary under +`docs/summaries/` with a filename that starts with the **current timestamp in +`yyyy-mm-dd-hh-mm` format** followed by a short kebab-case description (same +convention as plans). The summary covers what was actually built (as opposed +to the plan, which covers what was intended): files added/changed, key design +decisions, any deviations from the plan, notable findings made along the way, +and how it was verified. + +Example: `docs/summaries/2026-07-02-00-29-py-hxprobe-httpx.md` + ## Changelog Every completed feature is appended to `CHANGELOG.md` at the project root with diff --git a/Makefile b/Makefile index c774fec..07c68d6 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,14 @@ -GO_DIR := go -PY_DIR := python -BINARY := latprobe -PYTHON := python3.14 -ARGS ?= -SITES ?= $(PY_DIR)/sites.txt +GO_DIR := go +PY_DIR := python +BINARY := latprobe +PYTHON := python3.14 +ARGS ?= +SITES ?= $(PY_DIR)/sites.txt + +# hxprobe is a fully standalone project (own pyproject.toml, own uv-managed +# venv/lockfile) — it imports nothing from python/latprobe, and could be +# `cp -r`'d into its own repo as-is. +HX_DIR := hxprobe .DEFAULT_GOAL := help @@ -24,10 +29,10 @@ all: check build ## Run checks then build build: go-build ## Build binary (delegates to go-build) .PHONY: test -test: go-test py-test ## Run all tests (Go + Python) +test: go-test py-test hx-test ## Run all tests (Go + Python + hxprobe) .PHONY: check -check: go-check py-check ## Run fmt + vet + test gate (Go + Python) +check: go-check py-check hx-check ## Run fmt + vet + test gate (Go + Python + hxprobe) .PHONY: fmt fmt: go-fmt ## Format source code (delegates to go-fmt) @@ -36,7 +41,7 @@ fmt: go-fmt ## Format source code (delegates to go-fmt) vet: go-vet ## Run go vet (delegates to go-vet) .PHONY: clean -clean: go-clean py-clean ## Remove build and coverage artifacts +clean: go-clean py-clean hx-clean ## Remove build and coverage artifacts # ── Go targets ──────────────────────────────────────────────────────────────── @@ -126,3 +131,39 @@ py-check: py-test ## py: run Python test gate (hermetic only) py-clean: ## py: remove Python bytecode and __pycache__ dirs @find $(PY_DIR) -type d -name '__pycache__' -exec rm -rf {} + 2>/dev/null; \ find $(PY_DIR) -name '*.pyc' -delete 2>/dev/null; true + +# ── hxprobe (standalone httpx-based probe; own pyproject.toml/uv.lock, no +# imports from python/latprobe — see hxprobe/pyproject.toml) ───────────────── + +.PHONY: hx-deps +hx-deps: ## hx: sync hxprobe's uv-managed environment from its lockfile; idempotent + cd $(HX_DIR) && uv sync + +.PHONY: hx-run +hx-run: hx-deps ## hx: run hxprobe (pass flags via ARGS="…") + cd $(HX_DIR) && uv run python -m hxprobe $(ARGS) + +.PHONY: hx-lint +hx-lint: hx-deps ## hx: lint hxprobe with ruff + cd $(HX_DIR) && uv run ruff check . + +.PHONY: hx-fmt +hx-fmt: hx-deps ## hx: format hxprobe with ruff + cd $(HX_DIR) && uv run ruff format . + +.PHONY: hx-test +hx-test: hx-deps ## hx: run hxprobe unit tests (hermetic) + cd $(HX_DIR) && uv run pytest tests -m "not integration" -v $(ARGS) + +.PHONY: hx-test-integration +hx-test-integration: hx-deps ## hx: run hxprobe integration tests against live internet services (HTTP/2, redirects) + cd $(HX_DIR) && uv run pytest tests -m integration -v $(ARGS) + +.PHONY: hx-check +hx-check: hx-lint hx-test ## hx: run hxprobe test gate (lint + hermetic tests) + +.PHONY: hx-clean +hx-clean: ## hx: remove hxprobe bytecode, caches, and egg-info + @find $(HX_DIR) -type d -name '__pycache__' -exec rm -rf {} + 2>/dev/null; \ + find $(HX_DIR) -name '*.pyc' -delete 2>/dev/null; \ + rm -rf $(HX_DIR)/*.egg-info $(HX_DIR)/.pytest_cache $(HX_DIR)/.ruff_cache; true