From 19e39aeefb138e623d80566d7ef9b60f01b58822 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 1 Jun 2026 14:16:15 -0500 Subject: feat(install-ai): create top-level inbox/ on bootstrap install-ai now creates a top-level inbox/ with a .gitkeep in every project it bootstraps. inbox-send treats a project as a messaging target only when it has both a .ai/ marker and a top-level inbox/, so before this a freshly bootstrapped project couldn't receive cross-project handoffs until the inbox was made by hand. The directory is created in both track and gitignore modes, since inbox/ is a project-root convention independent of whether .ai/ is tracked. The step is idempotent, so a project that already has an inbox keeps its contents. --- scripts/tests/install-ai.bats | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'scripts/tests') diff --git a/scripts/tests/install-ai.bats b/scripts/tests/install-ai.bats index d67a9c6..dca70ea 100644 --- a/scripts/tests/install-ai.bats +++ b/scripts/tests/install-ai.bats @@ -37,6 +37,33 @@ teardown() { [ -f "$TEST_HOME/code/fresh/.ai/protocols.org" ] [ -f "$TEST_HOME/code/fresh/.ai/notes.org" ] grep -qFx ".ai/" "$TEST_HOME/code/fresh/.gitignore" + # Top-level inbox/ is created so the project is an inbox-send target. + [ -d "$TEST_HOME/code/fresh/inbox" ] + [ -f "$TEST_HOME/code/fresh/inbox/.gitkeep" ] +} + +@test "install-ai: creates top-level inbox/ in --track mode too" { + mkdir -p "$TEST_HOME/code/inbox-track" + (cd "$TEST_HOME/code/inbox-track" && git init -q) + + run bash "$INSTALL_AI" --track "$TEST_HOME/code/inbox-track" + + [ "$status" -eq 0 ] + [ -d "$TEST_HOME/code/inbox-track/inbox" ] + [ -f "$TEST_HOME/code/inbox-track/inbox/.gitkeep" ] +} + +@test "install-ai: preserves a pre-existing inbox/ with content" { + mkdir -p "$TEST_HOME/code/has-inbox/inbox" + (cd "$TEST_HOME/code/has-inbox" && git init -q) + echo "handoff" > "$TEST_HOME/code/has-inbox/inbox/2026-06-01-existing.org" + + run bash "$INSTALL_AI" --gitignore "$TEST_HOME/code/has-inbox" + + [ "$status" -eq 0 ] + [ -d "$TEST_HOME/code/has-inbox/inbox" ] + # Existing inbox content is untouched. + [ -f "$TEST_HOME/code/has-inbox/inbox/2026-06-01-existing.org" ] } @test "install-ai --track: lands .gitkeep stubs in empty dirs" { -- cgit v1.2.3