Skip to content

feat: label Psyche-launched sessions - #180

Merged
BunsDev merged 2 commits into
mainfrom
feat/psyche-session-source
Aug 12, 2026
Merged

feat: label Psyche-launched sessions#180
BunsDev merged 2 commits into
mainfrom
feat/psyche-session-source

Conversation

@BunsDev

@BunsDev BunsDev commented Aug 12, 2026

Copy link
Copy Markdown
Member

Summary

  • propagate the exact Psyche launch source into initial daemon registration
  • persist source:psyche-build in Coven external-session labels
  • keep attach/resume paths label-neutral

Why

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 --check
  • GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=commit.gpgsign GIT_CONFIG_VALUE_0=false cargo test --manifest-path src-rust/Cargo.toml --workspace
  • cargo clippy --manifest-path src-rust/Cargo.toml --workspace --all-targets -- -D warnings
  • packaged Psyche restart/rehydration acceptance with isolated Coven home

Copilot AI lite review requested due to automatic review settings August 12, 2026 03:18
@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 12, 2026 3:28am

Request Review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_SOURCE env-var mapping to a stable source:psyche-build label during initial session registration.
  • Extend RegisterExternalSession JSON payload with an optional labels field (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.

Comment on lines +7 to +8
const PSYCHE_SESSION_SOURCE: &str = "psyche-build";
const PSYCHE_SOURCE_LABEL: &str = "source:psyche-build";

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@BunsDev
BunsDev merged commit a0381ae into main Aug 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants