open-swe/Makefile
Adam Moussa dfdd41879c
feat(infra): upstream-sync triage ledger, cherry-pick hooks, and git cp (#118)
* docs(upstream-sync): add triage ledger + cherry-pick hook plan

Seeds the upstream triage ledger (52 diverged commits from langchain-ai/open-swe
categorized: landed/won't-merge/deferred/untriaged) and the design plan for a
git-hook mechanism to keep it in sync during cherry-picks.

* feat(upstream-sync): jsonl-backed triage ledger + generator CLI

triage.jsonl is now the source of truth (52 rows migrated from triage.md);
triage.md is generated with a do-not-edit banner. scripts/triage.py provides
migrate/generate/reconcile/lookup/check-reject/set; make triage-render/check/reconcile
added (triage-check is CI-safe staleness gate). Stdlib-only so git hooks can call it.

* feat(upstream-sync): cherry-pick triage git hooks + git cp wrapper

post-commit journals each -x pick to an untracked .git-local journal; prepare-commit-msg
hard-blocks known-reject picks (commit-msg is a secondary backstop — clean picks skip it on
git 2.50.1), overridable via git cp --force / SH_CHERRYPICK_ALLOW_REJECT=1 /
sh.cherrypick.blockRejects=false. git-cp is the pre-apply guard + auto-reconcile. pre-push is
a SHIM that re-execs the global Sea Haven security pre-push so core.hooksPath=.githooks does
not shadow it; install-hooks.sh verifies that shim FIRST and refuses if it is missing.

* docs(upstream-sync): correct hook plan + git cp runbook

Record the verified git 2.50.1 finding that clean cherry-picks skip commit-msg, so the block
lives in prepare-commit-msg; note the locked HARD-BLOCK-by-default reject policy. CHERRYPICK.md
now leads with make install-hooks + git cp and explains the generated-md ledger.

* chore(upstream-sync): mark #1651 landed (Bedrock family fix on gateway-routing)

* docs(upstream-sync): rewrite CHERRYPICK.md as a repo-specific runbook

* feat(upstream-sync): add triage.py sync + make triage-sync

Discovers commits on dev..upstream/main not yet in the ledger and appends them
as untriaged (PR # and subject parsed from each commit), then bumps _meta
'last synced' to the upstream tip and regenerates triage.md. Closes the
discovery side of the workflow: triage-sync to pull in new work, git cp to land it.

* docs(upstream-sync): move cherry-pick runbook to PR1 branch as cherry-pick-runbook.md
2026-07-03 11:46:00 -04:00

93 lines
2.5 KiB
Makefile

.PHONY: all format format-check lint test tests integration_tests help run dev \
install-hooks triage-sync triage-reconcile triage-render triage-check
# Default target executed when no arguments are given to make.
all: help
######################
# DEVELOPMENT
######################
dev:
uv run langgraph dev
run:
uv run uvicorn agent.webapp:app --reload --port 8000
install:
uv pip install -e .
######################
# TESTING
######################
TEST_FILE ?= tests/
test tests:
@if [ -d "$(TEST_FILE)" ] || [ -f "$(TEST_FILE)" ]; then \
uv run pytest -vvv $(TEST_FILE); \
else \
echo "Skipping tests: path not found: $(TEST_FILE)"; \
fi
integration_tests:
@if [ -d "tests/integration_tests/" ] || [ -f "tests/integration_tests/" ]; then \
uv run pytest -vvv tests/integration_tests/; \
else \
echo "Skipping integration tests: path not found: tests/integration_tests/"; \
fi
######################
# LINTING AND FORMATTING
######################
PYTHON_FILES=.
lint:
uv run ruff check $(PYTHON_FILES)
uv run ruff format $(PYTHON_FILES) --diff
format:
uv run ruff format $(PYTHON_FILES)
uv run ruff check --fix $(PYTHON_FILES)
format-check:
uv run ruff format $(PYTHON_FILES) --check
######################
# UPSTREAM SYNC / CHERRY-PICK TRIAGE
######################
install-hooks:
bash scripts/install-hooks.sh
triage-sync:
python3 scripts/triage.py sync
triage-reconcile:
python3 scripts/triage.py reconcile
triage-render:
python3 scripts/triage.py generate
triage-check:
python3 scripts/triage.py generate --check
######################
# HELP
######################
help:
@echo '----'
@echo 'dev - run LangGraph dev server'
@echo 'run - run webhook server'
@echo 'install - install dependencies'
@echo 'format - run code formatters'
@echo 'lint - run linters'
@echo 'test - run unit tests'
@echo 'integration_tests - run integration tests'
@echo 'install-hooks - install cherry-pick triage git hooks (per clone)'
@echo 'triage-sync - fetch upstream + add new dev..upstream/main commits as untriaged'
@echo 'triage-reconcile - drain cherry-pick journal into the triage ledger'
@echo 'triage-render - regenerate docs/upstream-sync/triage.md'
@echo 'triage-check - fail if triage.md is stale vs triage.jsonl (CI)'