diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-01 14:16:15 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-01 14:16:15 -0500 |
| commit | 19e39aeefb138e623d80566d7ef9b60f01b58822 (patch) | |
| tree | 2e98dde9b8cfd92054b36bcaa66de8b8f726f9ad /scripts/tests/install-ai.bats | |
| parent | 225c60df3ffe4d2163d8d42975d4cb74fe5ada39 (diff) | |
| download | rulesets-19e39aeefb138e623d80566d7ef9b60f01b58822.tar.gz rulesets-19e39aeefb138e623d80566d7ef9b60f01b58822.zip | |
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.
Diffstat (limited to 'scripts/tests/install-ai.bats')
| -rw-r--r-- | scripts/tests/install-ai.bats | 27 |
1 files changed, 27 insertions, 0 deletions
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" { |
