feat: label Psyche-launched sessions - #180
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR adds durable provenance for Psyche-launched sessions by propagating a launch-source indicator into the initial external-session registration payload sent to the Coven daemon, enabling Psyche to filter sessions it initiated across restarts.
Changes:
- Add
COVEN_SESSION_SOURCEenv-var mapping to a stablesource:psyche-buildlabel during initial session registration. - Extend
RegisterExternalSessionJSON payload with an optionallabelsfield (omitted when empty) and update serialization tests accordingly. - Add unit tests to ensure only the exact Psyche source string is mapped to the label.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src-rust/crates/core/src/coven_ledger.rs | Adds source-to-label mapping and sends labels during external session registration; includes unit tests for exact-match behavior. |
| src-rust/crates/core/src/coven_daemon.rs | Extends the external-session registration payload with optional labels and strengthens JSON serialization tests. |
Suppressed comments (1)
src-rust/crates/core/src/coven_ledger.rs:63
- The unit test hardcodes both the source value and label value; if the constants change, the test could pass/ fail for the wrong reason. Reuse the constants in the assertion so the test verifies the mapping rather than specific string literals.
assert_eq!(
registration_labels(Some("psyche-build")),
vec!["source:psyche-build".to_string()]
);
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const PSYCHE_SESSION_SOURCE: &str = "psyche-build"; | ||
| const PSYCHE_SOURCE_LABEL: &str = "source:psyche-build"; |
There was a problem hiding this comment.
Fixed in ce96c75: the emitted label is now derived from PSYCHE_SESSION_SOURCE, and the mapping test reuses the same source constant. Full workspace tests, clippy with warnings denied, formatting, and diff checks pass.
Summary
source:psyche-buildin Coven external-session labelsWhy
Psyche needs durable daemon provenance so its native rail can show only active sessions it initiated, including after application restart.
Validation
cargo fmt --manifest-path src-rust/Cargo.toml --all --checkGIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=commit.gpgsign GIT_CONFIG_VALUE_0=false cargo test --manifest-path src-rust/Cargo.toml --workspacecargo clippy --manifest-path src-rust/Cargo.toml --workspace --all-targets -- -D warnings