Files
zeekay 10e6fec4c0 debrand: the brand token is INSIGHTS_, and a wrong one stops the container
The rule table mapped HOG_ -> FN_ ahead of any POSTHOG rule, so POSTHOG_FOO
split into POST + HOG_ and came out POSTFN_FOO. Nothing sets that. The live
pods set INSIGHTS_SKIP_MIGRATION_CHECKS, which bin/migrate-check reads on the
container entrypoint, so the misspelling does not degrade a feature -- it runs
migrate --check against a database whose history this tree does not share and
the container never starts.

Both replacements are measured against the shipped tree rather than chosen:
every HOG_ name with a counterpart there is spelled INSIGHTS_ (HOG_QL ->
INSIGHTS_QL, HOG_FUNCTION_TEMPLATES -> INSIGHTS_FUNCTION_TEMPLATES, 12 of 12
determinate cases), and FN_ appears in it nowhere. Upstream carries 95 HOG_
tokens and zero FN_ ones, so repairing FN_ back out is exactly the inverse of
the bad rule and cannot collide with an upstream name.

The rule is fixed for the next convergence, and the tree it already produced is
repaired in the same commit -- the codemod is idempotent against its own output,
so it cannot undo this itself.
2026-08-01 17:42:28 -07:00

52 lines
2.0 KiB
Makefile

.PHONY: help new-user returning-user check-loading test test-integration mcp-server clean
PYTHON ?= uv run python
help:
@echo "traffic-sim — verify Insights instrumentation by driving a real browser"
@echo ""
@echo "Targets:"
@echo " make new-user URL=... Run new-user scenario (override VISITS, INTERVAL)"
@echo " make returning-user URL=... Run returning-user scenario (override PAGE_VIEWS, INTERVAL)"
@echo " make check-loading URL=... Inspect how Insights loads on URL(s)"
@echo " make test Run unit tests (no network)"
@echo " make test-integration Run integration test (spawns local fixture page)"
@echo " make mcp-server Start the MCP server in stdio mode"
@echo " make clean Remove results/ directory"
@echo ""
@echo "Variables:"
@echo " URL=https://example.com Required for the three scenarios"
@echo " VISITS=10 Override new-user visit count"
@echo " PAGE_VIEWS=5 Override returning-user page-view count"
@echo " INTERVAL=60 Override seconds between visits"
@echo " INSIGHTS_HOST=https://... Override Insights ingestion host"
VISITS ?= 3
PAGE_VIEWS ?= 3
INTERVAL ?= 5
INSIGHTS_HOST ?= https://us.i.hanzo.ai
new-user:
@if [ -z "$(URL)" ]; then echo "URL=... is required"; exit 1; fi
$(PYTHON) cli.py new-user --url "$(URL)" --visits $(VISITS) --interval $(INTERVAL) --insights-host "$(INSIGHTS_HOST)"
returning-user:
@if [ -z "$(URL)" ]; then echo "URL=... is required"; exit 1; fi
$(PYTHON) cli.py returning-user --url "$(URL)" --page-views $(PAGE_VIEWS) --interval $(INTERVAL) --insights-host "$(INSIGHTS_HOST)"
check-loading:
@if [ -z "$(URL)" ]; then echo "URL=... is required (or pass --urls-file ...)"; exit 1; fi
$(PYTHON) cli.py check-loading --url "$(URL)" --insights-host "$(INSIGHTS_HOST)"
test:
$(PYTHON) -m pytest tests/test_cli.py -q
test-integration:
$(PYTHON) -m pytest tests/test_integration.py -q
mcp-server:
$(PYTHON) mcp_server.py
clean:
rm -rf results/