The vault-manifest turn→intent map for one session (the stored `turn` is `turn_count + 1` at creation, so subtract one for the ledger's 0-indexed turn number — mirrors the vault's own resolution).
(repo: &Repository, session_id: &str, turn_number: u32)
| 674 | /// `turn_count + 1` at creation, so subtract one for the ledger's 0-indexed |
| 675 | /// turn number — mirrors the vault's own resolution). |
| 676 | fn vault_turn_intent(repo: &Repository, session_id: &str, turn_number: u32) -> Option<String> { |
| 677 | let manifest = repo.vault_manifest().ok()?; |
| 678 | for (key, summary) in &manifest.intents { |
| 679 | if summary.session.as_deref() != Some(session_id) { |
| 680 | continue; |
| 681 | } |
| 682 | if summary.turn.and_then(|t| t.checked_sub(1)) == Some(turn_number) { |
| 683 | return Some(if summary.human_key.is_empty() { |
| 684 | key.clone() |
| 685 | } else { |
| 686 | summary.human_key.clone() |
| 687 | }); |
| 688 | } |
| 689 | } |
| 690 | None |
| 691 | } |
| 692 | |
| 693 | /// Map a stored session turn to the wire shape (the fields the ledger owns: |
| 694 | /// turn number, provenance hash, and the turn timestamp). |
no test coverage detected