# 260522-9zk — Haiku bootstrap fix: key project-block on cwd, not file existence

## Trigger

Followup to debug session `.planning/debug/sentinel-bootstrap-gap.md` (Self-side
rule fixed in v1.11.2, commit aedfdea). Re-evaluation found the Psyche-haiku
side of the bootstrap loop is still broken because the haiku-prompt builder
gates `CURRENT_PROJECT_CONTEXT` emission on file-existence, not on
cwd_project resolution.

## Problem

`build_current_context_blocks` (`src/owl/echo_commune.rs:388-406`) omits the
`CURRENT_PROJECT_CONTEXT:` block whenever the project file is missing — even
when `derive_current_repo_names()` resolves a cwd_project. The haiku then
follows `psyche.md` rule 2 ("no block → omit `<project-context>`"), so
`route_project_slot` never receives a project slice on first commune in a
fresh tracked project, and the file never gets created. Loop.

## Fix

Mirror the existing live-side first-commune fallback pattern:

- When cwd_project resolves but `projects/<name>/<id>.md` is missing, emit
  `CURRENT_PROJECT_CONTEXT:\n(none — first commune in project)\n`.
- When cwd_project does NOT resolve (cwd outside any git repo AND outside
  Claude project root), still omit the block entirely.

Update psyche.md rule 2 + echo_commune prompt strings to clarify that
`CURRENT_PROJECT_CONTEXT` block presence (with first-commune literal OR with
prior body) signals "in-project → emit `<project-context>`". Block absence
signals "no cwd_project → omit `<project-context>`".

## Files touched

- `src/owl/echo_commune.rs` — builder + test update (existing test
  asserts old behavior; flip to new behavior with explicit first-commune
  literal assertion). Prompt string clarification.
- `psyche.md` — rule 2 wording + companion `<init_signoff>` line 269 +
  `<context_save>` line 354.
- (NO change to `src/live/context.rs` sentinel guard — its new role as
  "secondary prior-content indicator" per v1.11.2 docs is satisfied by
  the existing file-exists guard.)
- (NO change to `plugin/spt/skills/*` — Self-side detection rule is already
  correct per v1.11.2 commit aedfdea.)

## Verification

1. `cargo test build_current_context_blocks` + new `prompt_emits_project_block_with_first_commune_literal_when_file_absent` regression test.
2. `cargo build --release`.
3. Manual: in todlando's psyche on next commune cycle (after redeploy), verify
   `projects/claude_skill_owl/todlando.md` gets created.

## Out of scope

- Tests for v1.11.2 Self-side detection (Self reads `psyche-download` output
  in skill prose; no Rust seam to test).
- Backfill of existing agents' project files (deliberate — they will populate
  naturally on next commune).
