Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
165e446
Initialize SDLC contract for issue #1973
Apr 24, 2026
3593901
refine(#1973): analysis for changeset-aware `make test`
Apr 24, 2026
fdcd93c
refine(#1973): address reviewer_refine non-blocking nits
Apr 24, 2026
e9dc141
docs: update deploy docs for EGG_HOST_REPO_MAP auto-discovery [doc-up…
james-in-a-box[bot] Apr 24, 2026
c348af4
Fix #1993: default agent cwd to $EGG_REPO_PATH (#1996)
jwbron Apr 24, 2026
78c3826
Fix #1995: thread cursor through BRC wait endpoint to close wait→wait…
jwbron Apr 24, 2026
92f2750
Fix #1994: push via mcp__brc__propose and fix auto-filter ref collisi…
jwbron Apr 24, 2026
9fa926e
refine(#1973): align analysis Open Questions with contract IDs
Apr 24, 2026
4c115f5
Persist statefiles after refine phase
Apr 24, 2026
ca0ae2e
Persist HITL resolution after refine phase gate
Apr 24, 2026
bcaf899
architect: plan analysis for #1973 changeset-aware make test
Apr 24, 2026
7761c1d
plan(#1973): changeset-aware `make test` via grimp + sidecar LKG
Apr 24, 2026
1ae60ca
plan(risk_analyst): risk assessment for issue 1973 (make test changes…
Apr 24, 2026
0aa5634
plan(#1973): address reviewer_plan NACK — 3 blocking + 10 non-blocking
Apr 24, 2026
8da5434
plan(#1973): address reviewer_plan v2 NACK — R1 + R2 + R6/R7/R10/R14/R5
Apr 24, 2026
98f40c9
plan(#1973): adopt reviewer_plan v3 ACK polish items
Apr 24, 2026
be4b124
Persist statefiles after plan phase
Apr 24, 2026
8a2213c
Persist HITL resolution after plan phase gate
Apr 24, 2026
3c4a060
Merge remote-tracking branch 'origin/egg/issue-1973' into egg/issue-1…
Apr 24, 2026
9841857
Merge remote-tracking branch 'origin/egg/issue-1973' into egg/issue-1…
Apr 24, 2026
ea45101
Merge remote-tracking branch 'origin/egg/issue-1973' into egg/issue-1…
Apr 24, 2026
d78f783
implement(#1973): foundation — grimp dev dep + sidecar gitignore
Apr 24, 2026
38a214d
docs(#1973): add testing guide for changeset-aware make test
Apr 24, 2026
30e6ecb
Merge remote-tracking branch 'origin/egg/issue-1973' into egg/issue-1…
Apr 24, 2026
b62ca37
Merge remote-tracking branch 'origin/egg/issue-1973' into egg/issue-1…
Apr 24, 2026
b08de42
implement(#1973): scripts/select_tests.py — changeset-aware test sele…
Apr 24, 2026
172a37f
Merge remote-tracking branch 'origin/egg/issue-1973' into egg/issue-1…
Apr 24, 2026
c2897ef
implement(#1973): Makefile narrow-default + CI full-suite switch
Apr 24, 2026
2d307df
Merge remote-tracking branch 'origin/egg/issue-1973' into egg/issue-1…
Apr 24, 2026
d4e52bb
implement(#1973): address reviewer_contract polish — reverse_closure …
Apr 24, 2026
bb1f1e1
implement(#1973): address reviewer_code NACK — sys.path + PYTEST_ARGS…
Apr 24, 2026
0867696
implement(#1973): thread repo_root through sidecar I/O (tester NACK)
Apr 24, 2026
cfe6bf3
test(#1973): add tests/tools/test_select_tests_*.py for changeset-awa…
Apr 24, 2026
feae6a0
Merge remote-tracking branch 'origin/egg/issue-1973' into egg/issue-1…
Apr 24, 2026
fbad2c0
Persist statefiles after implement phase
Apr 24, 2026
458f5de
Remove ephemeral agent-output handoff artifacts (#1731)
Apr 24, 2026
b65fc4d
Address review feedback: fix tests, restore CI, regenerate lockfile
james-in-a-box[bot] Apr 25, 2026
f0fc437
Fix ImportPathMismatchError: remove shared/tests/__init__.py
james-in-a-box[bot] Apr 25, 2026
ed8e5ed
Fix ImportPathMismatchError: remove gateway/tests and orchestrator/te…
james-in-a-box[bot] Apr 25, 2026
bd20137
Fix gateway.tests collection: set __path__ on loaded gateway module
james-in-a-box[bot] Apr 25, 2026
2925a41
Set __spec__ on loaded gateway module for find_spec compat
james-in-a-box[bot] Apr 25, 2026
2151bdb
Remove silently-ignored import_mode pytest setting (N1)
egg-reviewer[bot] Apr 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,019 changes: 1,019 additions & 0 deletions .egg-state/brc-history/1973-implement.json

Large diffs are not rendered by default.

3,418 changes: 3,418 additions & 0 deletions .egg-state/brc-history/1973-implement.md

Large diffs are not rendered by default.

526 changes: 526 additions & 0 deletions .egg-state/brc-history/1973-plan.json

Large diffs are not rendered by default.

1,582 changes: 1,582 additions & 0 deletions .egg-state/brc-history/1973-plan.md

Large diffs are not rendered by default.

268 changes: 268 additions & 0 deletions .egg-state/brc-history/1973-refine.json

Large diffs are not rendered by default.

482 changes: 482 additions & 0 deletions .egg-state/brc-history/1973-refine.md

Large diffs are not rendered by default.

1,488 changes: 1,488 additions & 0 deletions .egg-state/contracts/issue-1973.json

Large diffs are not rendered by default.

186 changes: 186 additions & 0 deletions .egg-state/drafts/1973-analysis.md

Large diffs are not rendered by default.

1,645 changes: 1,645 additions & 0 deletions .egg-state/drafts/1973-plan.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

- name: Run unit tests
run: |
make test PYTEST_ARGS="--cov=gateway --cov=shared --cov=sandbox --cov-report=term-missing --cov-fail-under=80"
make test-all PYTEST_ARGS="--cov=gateway --cov=shared --cov=sandbox --cov-report=term-missing --cov-fail-under=80"

security:
name: Security Scan
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,12 @@ Thumbs.db

# uv lockfile (commit this for reproducibility)
# uv.lock

# changeset-aware test selection (issue #1973)
# Sidecar Last-Known-Good shas + per-invocation selection logs +
# grimp's on-disk graph cache. Keep .egg-state/ as a whole tracked
# (drafts, contracts, reviews, brc-history, oversight, agent-outputs
# all live there) — only these three subdirectories are ignored.
.egg-state/last-known-good/
.egg-state/selection/
.egg-state/grimp-cache/
7 changes: 6 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ Coverage requirements:

Run tests:
```bash
# All tests
# All tests (full suite — what CI runs)
make test-all

# Changeset-aware (narrows to tests reachable from your diff; the inner-loop default)
make test

# Specific test file
Expand All @@ -86,6 +89,8 @@ make test
.venv/bin/pytest shared/tests/test_egg_harness/ -v
```

See [`docs/guides/testing.md`](docs/guides/testing.md) for changeset-aware test selection, LKG semantics, and fallback triggers.

## Pull Request Process

1. **Create a branch** from main
Expand Down
99 changes: 95 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ EGG_IMAGE_TAG := $(shell git describe --always --dirty 2>/dev/null || echo lates
.PHONY: help \
setup deps venv install-linters check-linters \
lint lint-python lint-shell lint-yaml lint-docker lint-actions lint-custom \
test security \
test test-all test-record-good security \
test-integration test-e2e test-security smoketest-long-poll \
lint-fix lint-python-fix lint-shell-fix lint-yaml-fix \
build \
Expand All @@ -48,7 +48,9 @@ help:
@echo ""
@echo "CI checks (same commands run in GitHub Actions):"
@echo " make lint - Run all linters"
@echo " make test - Run all tests"
@echo " make test - Run unit tests narrowed to the changeset (issue #1973)"
@echo " make test-all - Run full unit-test suite + record LKG on green"
@echo " make test-record-good - Manually record HEAD as Last-Known-Good baseline"
@echo " make security - Run security scan"
@echo ""
@echo "Individual lint targets:"
Expand Down Expand Up @@ -248,10 +250,99 @@ lint-custom:
exit 1; \
fi

## Changeset-aware narrow default (issue #1973).
## `make test` invokes scripts/select_tests.py to compute the
## transitive reverse-import closure of files touched since the
## per-branch Last-Known-Good (LKG) commit (or base branch when no
## LKG sidecar exists), and runs pytest on only that subset. Any
## sign of static-analysis fog (conftest / Makefile / pyproject /
## uv.lock / workflow / shared/tests / non-.py / gateway/*.py /
## dynamic-import / unresolvable-baseline / LKG-not-ancestor /
## canary every-10th invocation) widens to the full suite with an
## explicit trigger string on stderr. See docs/guides/testing.md
## and scripts/select_tests.py for the full design.
##
## CI runs `make test-all` (below) to keep the 80% coverage gate
## enforced; narrowing is a local-inner-loop optimisation only.
##
## After pytest returns, this target invokes
## `select_tests.py --patch-selection-json` to append `pytest_ms`
## to the existing `.egg-state/selection/<head>.json` record so
## the JSON envelope captures both compute_ms and pytest_ms in
## one place. LKG sidecar is NEVER updated by `make test` (Q12);
## only `make test-all` records LKG on green.
test: export PYTHONPATH := shared:gateway:orchestrator
test: venv
@echo "==> Running unit tests..."
$(PYTEST) tests/ gateway/tests/ orchestrator/tests/ shared/tests/ -v -m "not functional" $(PYTEST_ARGS)
@echo "==> Running narrowed unit tests (changeset-aware; see docs/guides/testing.md)..."
@selected_file=$$(mktemp); \
PYTEST_ARGS_RAW="$(PYTEST_ARGS)" \
$(PYTHON) scripts/select_tests.py >"$$selected_file"; \
selector_rc=$$?; \
if [ "$$selector_rc" -ne 0 ]; then \
echo "select-tests: selector exited $$selector_rc; running full suite as fallback"; \
printf '%s\n' tests gateway/tests orchestrator/tests shared/tests >"$$selected_file"; \
fi; \
bypass=0; \
if [ ! -s "$$selected_file" ]; then \
head_sha_check=$$(git rev-parse HEAD 2>/dev/null || echo unknown); \
json_path=".egg-state/selection/$$head_sha_check.json"; \
if [ -f "$$json_path" ] && grep -q '"mode": "bypass"' "$$json_path" 2>/dev/null; then \
bypass=1; \
fi; \
if [ "$$bypass" = "0" ]; then \
echo "select-tests: no tests selected"; \
rm -f "$$selected_file"; \
exit 0; \
fi; \
fi; \
head_sha=$$(git rev-parse HEAD 2>/dev/null || echo unknown); \
t0=$$(date +%s%N); \
if [ "$$bypass" = "1" ]; then \
$(PYTEST) -v -m "not functional" $(PYTEST_ARGS); \
else \
$(PYTEST) $$(cat "$$selected_file") -v -m "not functional" $(PYTEST_ARGS); \
fi; \
pytest_rc=$$?; \
t1=$$(date +%s%N); \
rm -f "$$selected_file"; \
pytest_ms=$$(( (t1 - t0) / 1000000 )); \
$(PYTHON) scripts/select_tests.py --patch-selection-json --head "$$head_sha" --pytest-ms "$$pytest_ms" || true; \
exit $$pytest_rc

## Full-suite escape hatch (issue #1973). Runs the historical
## `pytest tests/ gateway/tests/ orchestrator/tests/ shared/tests/`
## command unconditionally — no narrowing, no fallback evaluation.
## On green exit, atomically writes the LKG sidecar at
## `.egg-state/last-known-good/<branch>.sha` so the next
## `make test` can narrow against it. On red exit, the sidecar
## is NOT updated (Q12) — partial / failing test runs cannot
## become a future LKG baseline.
##
## CI uses this target to keep the 80% coverage gate enforced
## unchanged (decision-d2). Local developers can run it any time
## to refresh their LKG without remembering the script invocation.
test-all: export PYTHONPATH := shared:gateway:orchestrator
test-all: venv ## Run the full unit-test suite + record LKG on green
@echo "==> Running full unit-test suite (issue #1973: this updates LKG on green)..."
@$(PYTEST) tests/ gateway/tests/ orchestrator/tests/ shared/tests/ -v -m "not functional" $(PYTEST_ARGS); \
pytest_rc=$$?; \
if [ "$$pytest_rc" -eq 0 ]; then \
$(PYTHON) scripts/select_tests.py --record-good \
|| echo "select-tests: --record-good failed; LKG not updated"; \
else \
echo "select-tests: pytest failed; LKG not updated"; \
fi; \
exit $$pytest_rc

## Manually record the current HEAD as a Last-Known-Good baseline
## (issue #1973). Use this when you know the suite passed but
## didn't run via `make test-all` (e.g., ran a subset that you
## know is exhaustive for your branch). Validates the sha against
## the object DB and against ancestor-of-HEAD; refuses on bad
## input.
test-record-good:
@echo "==> Recording HEAD as Last-Known-Good baseline (issue #1973)..."
@$(PYTHON) scripts/select_tests.py --record-good

smoketest-long-poll: export PYTHONPATH := shared:gateway:orchestrator
smoketest-long-poll: venv ## Smoke-test the long-poll / event-driven wait infrastructure
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,15 @@ See:
```bash
make setup # Install dev dependencies
make lint # Run all linters
make test # Run all tests
make test # Run tests reachable from your diff (changeset-aware narrow default)
make test-all # Run the full unit-test suite (what CI runs)
make test-integration # Run integration tests (k3s required)
make lint-fix # Auto-fix lint issues
make security # Run security scans
make build # Build Docker images
```

Requires Python >= 3.11. See [CONTRIBUTING.md](CONTRIBUTING.md) for development guidelines.
Requires Python >= 3.11. See [CONTRIBUTING.md](CONTRIBUTING.md) for development guidelines and [docs/guides/testing.md](docs/guides/testing.md) for the changeset-aware test selection model.

## License

Expand Down
Loading
Loading