repo stringlengths 6 65 | file_url stringlengths 81 311 | file_path stringlengths 6 227 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:31:58 2026-01-04 20:25:31 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/resolver/src/graph.rs | crates/resolver/src/graph.rs | //! Dependency graph types and operations
use sps2_types::{Version, VersionSpec};
use std::fmt;
use std::path::PathBuf;
/// Package identifier (name + version)
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct PackageId {
pub name: String,
pub version: Version,
}
impl PackageId {
/// Create new pac... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/resolver/src/execution.rs | crates/resolver/src/execution.rs | // src/execution.rs
//! Planning and metadata for *parallel* package installation/build.
//!
//! Public API is **unchanged**, but the internals are optimised
use crate::{graph::DependencyGraph, NodeAction, PackageId};
use std::collections::{HashMap, VecDeque};
use std::sync::atomic::{AtomicUsize, Ordering};
use std::s... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/resolver/src/sat/solver.rs | crates/resolver/src/sat/solver.rs | //! DPLL-based SAT solver with CDCL optimizations
use super::conflict_analysis::VariableActivity;
use super::types::TruthValue;
use super::{
Assignment, Clause, ClauseRef, ConflictAnalysis, ConflictExplanation, DependencyProblem,
Literal, Variable,
};
use crate::sat::clause::clause_ref;
use sps2_errors::{Error... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/resolver/src/sat/types.rs | crates/resolver/src/sat/types.rs | //! Basic types for SAT solving
use std::collections::HashMap;
use std::fmt;
/// A boolean variable in the SAT problem
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct Variable(pub u32);
impl Variable {
/// Create new variable with given index
#[must_use]
pub const fn new(in... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/resolver/src/sat/clause.rs | crates/resolver/src/sat/clause.rs | //! SAT clause representation with two-watched literal optimization
use super::types::TruthValue;
use super::{Assignment, Literal, Variable};
use std::fmt;
use std::sync::Arc;
/// A clause in CNF (Conjunctive Normal Form)
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Clause {
/// Literals in the clause
li... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/resolver/src/sat/mod.rs | crates/resolver/src/sat/mod.rs | //! SAT solver for dependency resolution
//!
//! This module implements a DPLL-based SAT solver optimized for package
//! dependency resolution. It supports:
//! - Version constraint clauses
//! - Conflict-driven clause learning
//! - Two-watched literal optimization
//! - VSIDS variable ordering heuristic
use semver:... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/resolver/src/sat/variable_map.rs | crates/resolver/src/sat/variable_map.rs | //! Mapping between package versions and SAT variables
use super::{PackageVersion, Variable};
use std::collections::HashMap;
/// Maps package versions to SAT variables
#[derive(Debug, Clone)]
pub struct VariableMap {
/// Next variable index to allocate
next_var: u32,
/// Map from package version to variab... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/resolver/src/sat/conflict_analysis.rs | crates/resolver/src/sat/conflict_analysis.rs | //! Conflict analysis and learning for SAT solver
use super::{Assignment, Clause, ClauseRef, DependencyProblem, Literal, Variable};
use crate::sat::ConflictExplanation;
use std::collections::{HashMap, HashSet, VecDeque};
/// Conflict analysis data
#[derive(Debug, Clone)]
pub struct ConflictAnalysis {
/// Implicat... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/types/src/recipe.rs | crates/types/src/recipe.rs | //! YAML recipe format for sps2
//!
//! This module provides a declarative YAML-based recipe format that replaces
//! the Starlark-based system with proper staged execution.
use serde::de::{self, IgnoredAny, MapAccess, Unexpected, Visitor};
use serde::{Deserialize, Serialize};
use std::{collections::HashMap, fmt};
//... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/types/src/lib.rs | crates/types/src/lib.rs | #![warn(mismatched_lifetime_syntaxes)]
#![deny(clippy::pedantic, unsafe_code)]
#![allow(clippy::module_name_repetitions)]
//! Core type definitions for the sps2 package manager
//!
//! This crate provides fundamental types used throughout the system,
//! including version specifications, package information, and commo... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/types/src/version.rs | crates/types/src/version.rs | //! Version specification and constraint parsing
//!
//! Implements Python-style version constraints:
//! - `==1.2.3` - Exact version
//! - `>=1.2.0` - Minimum version
//! - `<=2.0.0` - Maximum version
//! - `~=1.2.0` - Compatible release (>=1.2.0,<1.3.0)
//! - `!=1.5.0` - Exclude version
//! - Multiple constraints: `>... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/types/src/manifest.rs | crates/types/src/manifest.rs | #![allow(clippy::module_name_repetitions)]
//! Package manifest handling types for sps2
//!
//! This module defines the `manifest.toml` format and provides
//! serialization/deserialization and validation for package metadata.
use crate::{package::PackageSpec, Arch, PackageFormatVersion, PythonPackageMetadata, Versio... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/types/src/state.rs | crates/types/src/state.rs | //! State management type definitions
use crate::Version;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use std::fmt;
use uuid::Uuid;
/// State identifier
pub type StateId = Uuid;
/// Information about a system state
#[derive(Debug, Clone, Serialize, Deserialize)]
pub st... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/types/src/reports.rs | crates/types/src/reports.rs | //! Report type definitions for operations
use crate::Version;
use serde::{Deserialize, Serialize};
use std::path::PathBuf;
use uuid::Uuid;
/// Installation report
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct InstallReport {
/// Packages that were installed
pub installed: Vec<PackageChange>,
... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/types/src/format.rs | crates/types/src/format.rs | //! Package format versioning for sps2 package evolution
//!
//! This module provides comprehensive versioning support for the .sp package format,
//! enabling safe evolution and migration of the package format over time.
use serde::{Deserialize, Serialize};
use std::fmt;
/// Package format version using semantic ver... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/types/src/package.rs | crates/types/src/package.rs | //! Package-related type definitions
use crate::{Arch, Version, VersionSpec};
use serde::{Deserialize, Serialize};
use std::fmt;
/// Unique identifier for a package
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct PackageId {
pub name: String,
pub version: Version,
}
impl Packa... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/events/src/lib.rs | crates/events/src/lib.rs | #![warn(mismatched_lifetime_syntaxes)]
#![deny(clippy::pedantic, unsafe_code)]
#![allow(clippy::module_name_repetitions)]
//! Event system for async communication in sps2
//!
//! This crate provides a domain-driven event system with sophisticated
//! progress tracking, tracing integration, and clean separation of conc... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/events/src/meta.rs | crates/events/src/meta.rs | use std::borrow::Cow;
use std::collections::BTreeMap;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use tracing::Level;
use uuid::Uuid;
/// Structured metadata that accompanies every event emission.
///
/// This wrapper gives consumers enough context to correlate events across
/// domains, attach ... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/events/src/progress/config.rs | crates/events/src/progress/config.rs | //! Configuration and core types for progress tracking
use serde::{Deserialize, Serialize};
use std::time::Duration;
/// Configuration for progress tracking algorithms
#[derive(Debug, Clone)]
pub struct ProgressConfig {
/// Number of samples for moving average (default: 10)
pub speed_window_size: usize,
/... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/events/src/progress/update.rs | crates/events/src/progress/update.rs | //! Progress update and formatting utilities
use super::config::TrendDirection;
use std::time::Duration;
/// Result of a progress update with calculated metrics
#[derive(Debug, Clone)]
pub struct ProgressUpdate {
/// Tracker ID
pub id: String,
/// Current progress
pub progress: u64,
/// Total amou... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/events/src/progress/tracker.rs | crates/events/src/progress/tracker.rs | //! Core progress tracking with sophisticated ETA calculations
use super::config::{ProgressConfig, ProgressPhase, TrendDirection};
use super::speed::{SpeedBuffer, SpeedSample};
use super::update::ProgressUpdate;
use std::time::{Duration, Instant};
use uuid::Uuid;
/// Core progress tracker with sophisticated algorithm... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/events/src/progress/manager.rs | crates/events/src/progress/manager.rs | //! Thread-safe progress management with event integration
use super::config::ProgressPhase;
use super::tracker::ProgressTracker;
use super::update::ProgressUpdate;
use crate::{AppEvent, EventEmitter, EventLevel, EventMeta, ProgressEvent};
use std::sync::{Arc, Mutex};
use std::time::Duration;
/// Thread-safe progress... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/events/src/progress/speed.rs | crates/events/src/progress/speed.rs | //! Speed calculation algorithms with smoothing and outlier detection
use super::config::TrendDirection;
use std::collections::VecDeque;
use std::time::{Duration, Instant};
/// Sample point for speed calculation
#[derive(Debug, Clone, Copy)]
#[allow(dead_code)] // Fields used for potential future analytics
pub(crate)... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/events/src/progress/mod.rs | crates/events/src/progress/mod.rs | #![deny(clippy::pedantic, unsafe_code)]
#![allow(
clippy::module_name_repetitions,
clippy::cast_precision_loss, // Mathematical calculations require f64
clippy::cast_possible_truncation, // Intentional for progress calculations
clippy::cast_sign_loss, // Weights are always positive
... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/events/src/events/general.rs | crates/events/src/events/general.rs | use serde::{Deserialize, Serialize};
use std::collections::HashMap;
/// General utility events for warnings, errors, and operations
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "type")]
pub enum GeneralEvent {
/// Generic warning message with optional context
Warning {
message: String,... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/events/src/events/qa.rs | crates/events/src/events/qa.rs | use serde::{Deserialize, Serialize};
use sps2_types::Version;
use std::path::PathBuf;
use super::FailureContext;
/// Target package being evaluated by QA.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct QaTarget {
pub package: String,
pub version: Version,
}
/// QA level applied to the pipeline.
#... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/events/src/events/guard.rs | crates/events/src/events/guard.rs | use serde::{Deserialize, Serialize};
/// Scope covered by a guard operation.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "kind", rename_all = "snake_case")]
pub enum GuardScope {
System,
Package {
name: String,
#[serde(skip_serializing_if = "Option::is_none")]
version:... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/events/src/events/platform.rs | crates/events/src/events/platform.rs | use serde::{Deserialize, Serialize};
use std::path::PathBuf;
use super::FailureContext;
/// High-level category for a platform operation.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum PlatformOperationKind {
Binary,
Filesystem,
Process,
ToolDiscovery,
}
... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/events/src/events/state.rs | crates/events/src/events/state.rs | use serde::{Deserialize, Serialize};
use sps2_types::StateId;
use super::FailureContext;
/// Context describing a state transition.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StateTransitionContext {
pub operation: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub source: Optio... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/events/src/events/lifecycle.rs | crates/events/src/events/lifecycle.rs | use serde::{Deserialize, Serialize};
use sps2_types::Version;
use std::time::Duration;
use super::FailureContext;
/// Generic lifecycle stages for simple operations
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
pub enum LifecycleStage {
Started,
Completed,
... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/events/src/events/build.rs | crates/events/src/events/build.rs | use serde::{Deserialize, Serialize};
use sps2_types::Version;
use std::path::PathBuf;
/// Build system types supported by sps2
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum BuildSystem {
Autotools,
CMake,
Cargo,
Make,
Ninja,
Custom,
}
/// Build ph... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/events/src/events/progress.rs | crates/events/src/events/progress.rs | use serde::{Deserialize, Serialize};
use std::time::Duration;
// Use the unified progress phase type from the progress module
use crate::progress::config::ProgressPhase;
/// Progress tracking events with sophisticated algorithms
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "type")]
pub enum ProgressEv... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/events/src/events/mod.rs | crates/events/src/events/mod.rs | use serde::{Deserialize, Serialize};
use crate::EventSource;
use sps2_errors::UserFacingError;
/// Structured failure information shared across domains.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FailureContext {
/// Optional stable error code once taxonomy lands.
#[serde(skip_serializing_if =... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/events/src/events/package.rs | crates/events/src/events/package.rs | use serde::{Deserialize, Serialize};
use super::FailureContext;
/// Named package operations surfaced to consumers.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum PackageOperation {
List,
Search,
HealthCheck,
SelfUpdate,
Cleanup,
}
/// Outcome payload... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/guard/src/lib.rs | crates/guard/src/lib.rs | #![warn(mismatched_lifetime_syntaxes)]
//! Lightweight state guard utilities for verifying and healing package installations.
mod refcount;
mod store;
mod verifier;
pub use refcount::sync_refcounts_to_active_state;
pub use store::{StoreVerificationConfig, StoreVerificationStats, StoreVerifier};
pub use verifier::{Dis... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/guard/src/store.rs | crates/guard/src/store.rs | use sps2_errors::Error;
use sps2_events::{
AppEvent, EventEmitter, GuardEvent, GuardLevel, GuardScope, GuardTargetSummary,
GuardVerificationMetrics,
};
use sps2_hash::Hash;
use sps2_state::{queries, StateManager};
use sps2_store::FileStore;
use std::sync::Arc;
use std::time::{Duration, Instant};
use uuid::Uuid;... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/guard/src/verifier.rs | crates/guard/src/verifier.rs | use crate::refcount::sync_refcounts_to_active_state;
use sps2_errors::{Error, OpsError};
use sps2_events::{
AppEvent, EventEmitter, EventSender, GuardDiscrepancy, GuardEvent, GuardLevel, GuardScope,
GuardSeverity, GuardTargetSummary, GuardVerificationMetrics,
};
use sps2_hash::Hash;
use sps2_platform::PlatformM... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/guard/src/refcount.rs | crates/guard/src/refcount.rs | use sps2_errors::Error;
use sps2_state::StateManager;
/// Synchronize store and file-object refcounts to match the active state.
///
/// Returns the number of updated store rows and file rows respectively.
pub async fn sync_refcounts_to_active_state(state: &StateManager) -> Result<(usize, usize), Error> {
let stat... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/config/src/resources_limits.rs | crates/config/src/resources_limits.rs | //! Resource limit configuration and availability tracking
//!
//! This module defines resource limits and provides utilities for tracking
//! resource availability across concurrent operations.
use serde::{Deserialize, Serialize};
/// Resource limit configuration
///
/// This structure holds configuration for variou... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/config/src/guard.rs | crates/config/src/guard.rs | //! Guard configuration for verification and integrity checking
use serde::{Deserialize, Serialize};
use std::path::PathBuf;
/// Symlink handling policy for guard operations
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum SymlinkPolicyConfig {
/// ... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/config/src/builder.rs | crates/config/src/builder.rs | //! Builder configuration for package building and compilation
use serde::{de::IgnoredAny, Deserialize, Serialize};
use sps2_errors::{ConfigError, Error};
use std::path::{Path, PathBuf};
use tokio::fs;
/// Complete builder configuration
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct BuilderConfig... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/config/src/lib.rs | crates/config/src/lib.rs | #![warn(mismatched_lifetime_syntaxes)]
#![deny(clippy::pedantic, unsafe_code)]
#![allow(clippy::module_name_repetitions)]
//! Configuration management for sps2
//!
//! This crate handles loading and merging configuration from:
//! - Default values (hard-coded)
//! - Configuration file (~/.config/sps2/config.toml)
//! ... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/config/src/core.rs | crates/config/src/core.rs | //! Core configuration types and utilities shared across all crates
use super::repository::Repositories;
use serde::{Deserialize, Serialize};
use sps2_types::{ColorChoice, OutputFormat};
use std::path::PathBuf;
/// General application configuration
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GeneralCon... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/config/src/resources_semaphore.rs | crates/config/src/resources_semaphore.rs | //! Semaphore utilities for resource management
//!
//! This module provides helper functions for managing semaphores with
//! consistent error handling across the sps2 package manager.
use sps2_errors::{Error, InstallError};
use std::sync::Arc;
use tokio::sync::{OwnedSemaphorePermit, Semaphore};
/// Acquire a semaph... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/config/src/constants.rs | crates/config/src/constants.rs | //! Centralized, non-configurable filesystem paths for sps2
//!
//! These paths are deliberately not exposed via TOML configuration to keep the
//! installation prefix stable. Packages are built against this fixed prefix.
pub const PREFIX: &str = "/opt/pm";
pub const STORE_DIR: &str = "/opt/pm/store";
pub const STATE... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/config/src/resources_manager.rs | crates/config/src/resources_manager.rs | //! Resource manager for coordinating concurrent operations
//!
//! This module provides the main `ResourceManager` struct that coordinates
//! semaphores and resource limits for concurrent operations.
use crate::resources_limits::{ResourceAvailability, ResourceLimits};
use crate::resources_semaphore::{
acquire_se... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/config/src/repository.rs | crates/config/src/repository.rs | use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RepositoryConfig {
pub url: String,
#[serde(default = "default_priority")]
pub priority: u32,
#[serde(default = "default_algorithm")]
pub algorithm: String, // "minisign" | "openpgp" (future)
#[serde... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/platform/src/lib.rs | crates/platform/src/lib.rs | #![warn(mismatched_lifetime_syntaxes)]
//! Platform abstraction layer for macOS ARM64 package manager operations.
//!
//! This crate provides a unified interface for platform-specific operations including:
//! - Binary operations (install_name_tool, otool, codesign)
//! - Filesystem operations (APFS clonefile, atomic o... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/platform/src/fs.rs | crates/platform/src/fs.rs | #![allow(clippy::module_name_repetitions, unused_variables)]
//! Filesystem convenience helpers backed by the platform abstraction.
//!
//! These functions provide a stable API returning `sps2_errors::Error` while
//! internally leveraging the platform's `FilesystemOperations` implementation.
use crate::PlatformManag... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/platform/src/process/mod.rs | crates/platform/src/process/mod.rs | //! Process execution operations for macOS platform
use async_trait::async_trait;
use sps2_errors::Error;
use std::collections::HashMap;
use std::path::PathBuf;
use std::process::ExitStatus;
use crate::core::PlatformContext;
/// Platform-specific command builder and execution
pub struct PlatformCommand {
program... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/platform/src/filesystem/mod.rs | crates/platform/src/filesystem/mod.rs | //! Filesystem operations for macOS platform (APFS clonefile, atomic operations)
use async_trait::async_trait;
use sps2_errors::PlatformError;
use std::path::Path;
use crate::core::PlatformContext;
/// Trait for filesystem operations specific to macOS
#[async_trait]
pub trait FilesystemOperations: Send + Sync {
... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/platform/src/binary/mod.rs | crates/platform/src/binary/mod.rs | //! Binary operations for macOS platform (install_name_tool, otool, codesign)
use async_trait::async_trait;
use sps2_errors::PlatformError;
use std::path::Path;
use crate::core::PlatformContext;
/// Trait for binary manipulation operations specific to macOS
#[async_trait]
pub trait BinaryOperations: Send + Sync {
... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/platform/src/core/mod.rs | crates/platform/src/core/mod.rs | //! Core platform abstractions and context management
use crate::binary::BinaryOperations;
use crate::filesystem::FilesystemOperations;
use crate::process::ProcessOperations;
use serde::{Deserialize, Serialize};
use sps2_errors::PlatformError;
use sps2_events::{
events::{
FailureContext, PlatformEvent, Pla... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | true |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/platform/src/implementations/mod.rs | crates/platform/src/implementations/mod.rs | //! Platform-specific implementations
pub mod macos;
| rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/platform/src/implementations/macos/process.rs | crates/platform/src/implementations/macos/process.rs | //! macOS process operations implementation
//!
//! This module wraps the existing proven process execution patterns from the codebase
//! with the platform abstraction layer, adding event emission and proper error handling.
use async_trait::async_trait;
use sps2_errors::{Error, PlatformError};
use sps2_events::{
... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/platform/src/implementations/macos/filesystem.rs | crates/platform/src/implementations/macos/filesystem.rs | //! macOS filesystem operations implementation
//!
//! This module wraps the existing proven filesystem operations from the root crate
//! with the platform abstraction layer, adding event emission and proper error handling.
use async_trait::async_trait;
use sps2_errors::PlatformError;
use sps2_events::{
events::{... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/platform/src/implementations/macos/mod.rs | crates/platform/src/implementations/macos/mod.rs | //! macOS-specific platform implementation
pub mod binary;
pub mod filesystem;
pub mod process;
/// macOS platform implementation
pub struct MacOSPlatform;
impl MacOSPlatform {
/// Create a new macOS platform instance
#[allow(clippy::new_ret_no_self)]
pub fn new() -> crate::core::Platform {
use b... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/platform/src/implementations/macos/binary.rs | crates/platform/src/implementations/macos/binary.rs | //! macOS binary operations implementation
//!
//! This module wraps the existing proven binary operations from RPathPatcher and CodeSigner
//! with the platform abstraction layer, adding event emission and proper error handling.
use async_trait::async_trait;
use sps2_errors::PlatformError;
use sps2_events::{
even... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/ops/src/uninstall.rs | crates/ops/src/uninstall.rs | //! Uninstall command implementation
//!
//! Handles package removal with dependency checking.
//! Delegates to `sps2_install` crate for the actual uninstall logic.
use crate::{InstallReport, OpsCtx};
use sps2_errors::{Error, OpsError};
use sps2_events::{
patterns::UninstallProgressConfig, AppEvent, EventEmitter, ... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/ops/src/lib.rs | crates/ops/src/lib.rs | #![warn(mismatched_lifetime_syntaxes)]
#![deny(clippy::pedantic, unsafe_code)]
#![allow(clippy::module_name_repetitions)]
//! High-level operations orchestration for sps2
//!
//! This crate serves as the orchestration layer between the CLI and
//! specialized crates. Small operations are implemented here, while
//! la... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/ops/src/update.rs | crates/ops/src/update.rs | //! Update and upgrade command implementations
//!
//! - `update`: Respects version constraints (e.g., `~=1.2.0`)
//! - `upgrade`: Ignores upper bounds to get latest versions
//!
//! Both delegate to `sps2_install` crate for the actual update logic.
use crate::{InstallReport, OpsCtx};
use sps2_errors::Error;
use sps2_... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/ops/src/pack.rs | crates/ops/src/pack.rs | //! Pack command implementation
//!
//! Provides standalone packaging functionality without requiring a full rebuild.
//! Always runs post-processing steps and QA pipeline by default, matching build command behavior.
use crate::OpsCtx;
use sps2_builder::{
artifact_qa::run_quality_pipeline, create_and_sign_package,... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/ops/src/small_ops.rs | crates/ops/src/small_ops.rs | //! Small operations implemented in the ops crate
//!
//! This module serves as a public API facade that re-exports operations
//! from specialized modules. All function signatures are preserved for
//! backward compatibility.
// Import all the modularized operations
use crate::health;
use crate::maintenance;
use crat... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/ops/src/self_update.rs | crates/ops/src/self_update.rs | //! Self-Update Functionality
use crate::OpsCtx;
use sps2_errors::{Error, OpsError};
use sps2_events::{
events::{PackageOperation, PackageOutcome},
AppEvent, EventEmitter, FailureContext, PackageEvent,
};
use std::path::Path;
use std::time::Instant;
/// Update sps2 to the latest version
///
/// # Errors
///
/... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/ops/src/install.rs | crates/ops/src/install.rs | //! Install command implementation
//!
//! Handles package installation with support for both local .sp files and remote packages.
//! Delegates to `sps2_install` crate for the actual installation logic.
use crate::{InstallReport, InstallRequest, OpsCtx};
use sps2_errors::{Error, OpsError};
use sps2_events::{
AppE... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/ops/src/build.rs | crates/ops/src/build.rs | //! Build command implementation
//!
//! Handles package building from recipes.
//! Delegates to `sps2_builder` crate for the actual build logic.
use crate::{BuildReport, OpsCtx};
use sps2_builder::{parse_yaml_recipe, BuildContext};
use sps2_errors::{Error, OpsError};
use sps2_events::{AppEvent, BuildEvent, BuildSessi... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/ops/src/types.rs | crates/ops/src/types.rs | //! Types for operations and results
use serde::{Deserialize, Serialize};
use sps2_events::HealthStatus;
use sps2_types::{OpChange, PackageSpec};
use std::collections::HashMap;
use std::path::PathBuf;
// No longer needed - uuid::Uuid imported from sps2_types
/// Operation report for complex operations
#[derive(Clone,... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/ops/src/health.rs | crates/ops/src/health.rs | //! System Health and Diagnostics Operations
use crate::{ComponentHealth, HealthCheck, HealthIssue, IssueSeverity, OpsCtx};
use sps2_errors::Error;
use sps2_events::{
events::{HealthStatus, PackageOperation, PackageOutcome},
AppEvent, EventEmitter, PackageEvent,
};
use sps2_guard::{StoreVerificationConfig, Sto... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/ops/src/maintenance.rs | crates/ops/src/maintenance.rs | //! System Cleanup and State Management Operations
use crate::{ChangeType, OpChange, OpsCtx, StateInfo};
use sps2_errors::{Error, OpsError};
use sps2_events::{
events::{PackageOperation, PackageOutcome},
AppEvent, EventEmitter, GeneralEvent, PackageEvent, RollbackContext, RollbackSummary,
StateEvent,
};
us... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/ops/src/query.rs | crates/ops/src/query.rs | //! Package Information and Search Operations
use crate::{OpsCtx, PackageInfo, PackageStatus, SearchResult};
use sps2_errors::{Error, OpsError};
use sps2_events::{
events::{PackageOperation, PackageOutcome},
AppEvent, EventEmitter, PackageEvent,
};
use sps2_hash::Hash;
use sps2_store::StoredPackage;
/// List ... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/ops/src/context.rs | crates/ops/src/context.rs | //! Operations context for dependency injection
use sps2_builder::Builder;
use sps2_config::Config;
use sps2_events::{EventEmitter, EventSender};
use sps2_index::IndexManager;
use sps2_net::NetClient;
use sps2_resolver::Resolver;
use sps2_state::StateManager;
use sps2_store::PackageStore;
use std::cell::RefCell;
use s... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/ops/src/keys.rs | crates/ops/src/keys.rs | //! Key management utilities for signature verification
use crate::OpsCtx;
use base64::{engine::general_purpose, Engine as _};
use hex;
use minisign_verify::{PublicKey, Signature};
use serde::{Deserialize, Serialize};
use sps2_errors::Error;
use std::collections::HashMap;
use std::path::{Path, PathBuf};
use tokio::fs;... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/ops/src/repository.rs | crates/ops/src/repository.rs | //! Repository and Index Management Operations
use crate::keys;
use crate::{keys::KeyManager, OpsCtx};
use dialoguer::{theme::ColorfulTheme, Confirm};
use sps2_config::{Config, RepositoryConfig};
use sps2_errors::{ConfigError, Error, OpsError, SigningError};
use sps2_events::{AppEvent, EventEmitter, FailureContext, Ge... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/install/src/installer.rs | crates/install/src/installer.rs | //! Main installer implementation
use crate::{
InstallConfig, InstallContext, InstallOperation, InstallResult, StateInfo, UninstallContext,
UninstallOperation, UpdateContext, UpdateOperation,
};
use sps2_errors::{Error, InstallError};
// EventSender not used directly in this module but imported for potential f... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/install/src/lib.rs | crates/install/src/lib.rs | #![warn(clippy::pedantic)]
#![deny(clippy::all)]
//! Package installation with atomic updates for sps2
//!
//! This crate handles the installation of packages with atomic
//! state transitions, rollback capabilities, and parallel execution.
#[macro_use]
mod macros;
mod api;
mod atomic;
mod installer;
mod operations;
... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/install/src/operations.rs | crates/install/src/operations.rs | //! High-level installation operations
use crate::SecurityPolicy;
use crate::{
AtomicInstaller, ExecutionContext, InstallContext, InstallResult, ParallelExecutor,
UninstallContext, UpdateContext,
};
use sps2_errors::{Error, InstallError};
use sps2_events::events::GeneralEvent;
use sps2_events::{AppEvent, Event... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/install/src/macros.rs | crates/install/src/macros.rs | //! Macros for context builder helpers
#[macro_export]
macro_rules! context_add_package_method {
($name:ident, $pkg_type:ty) => {
impl $name {
/// Add package to the context
#[must_use]
pub fn add_package(mut self, package: $pkg_type) -> Self {
self.packa... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/install/src/api/config.rs | crates/install/src/api/config.rs | /// Installer configuration
#[derive(Clone, Debug)]
pub struct InstallConfig {
/// Maximum concurrent downloads
pub max_concurrency: usize,
/// Download timeout in seconds
pub download_timeout: u64,
/// Enable APFS optimizations
pub enable_apfs: bool,
/// State retention policy (number of st... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/install/src/api/types.rs | crates/install/src/api/types.rs | use sps2_hash::Hash;
use std::path::PathBuf;
/// Prepared package data passed from `ParallelExecutor` to `AtomicInstaller`
///
/// This structure contains all the information needed by `AtomicInstaller`
/// to install a package without having to look up `package_map` or perform
/// additional database queries.
#[deriv... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/install/src/api/result.rs | crates/install/src/api/result.rs | use chrono::{DateTime, Utc};
use sps2_resolver::PackageId;
use uuid::Uuid;
/// Installation result
#[derive(Debug)]
pub struct InstallResult {
/// State ID after installation
pub state_id: Uuid,
/// Packages that were installed
pub installed_packages: Vec<PackageId>,
/// Packages that were updated
... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/install/src/api/mod.rs | crates/install/src/api/mod.rs | pub mod config;
pub mod context;
pub mod result;
pub mod types;
| rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/install/src/api/context.rs | crates/install/src/api/context.rs | use sps2_events::EventSender;
use sps2_types::PackageSpec;
use std::path::PathBuf;
/// Installation context
#[derive(Clone, Debug)]
pub struct InstallContext {
/// Package specifications to install
pub packages: Vec<PackageSpec>,
/// Local package files to install
pub local_files: Vec<PathBuf>,
///... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/install/src/atomic/installer.rs | crates/install/src/atomic/installer.rs | //! Atomic installer implementation using slot-based staging.
use crate::atomic::{package, transition::StateTransition};
// Removed Python venv handling - Python packages are now handled like regular packages
use crate::{InstallContext, InstallResult, PreparedPackage};
use sps2_errors::{Error, InstallError};
use sps2_... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/install/src/atomic/fs.rs | crates/install/src/atomic/fs.rs | //! Filesystem operations for atomic installation
use crate::atomic::transition::StateTransition;
use sps2_errors::{Error, InstallError};
use sps2_events::{AppEvent, EventEmitter, GeneralEvent};
use sps2_hash::FileHashResult;
use sps2_resolver::PackageId;
use sps2_store::StoredPackage;
use std::path::Path;
/// Link p... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/install/src/atomic/transition.rs | crates/install/src/atomic/transition.rs | //! State transition management for atomic installations
use sps2_events::EventSender;
use sps2_hash::FileHashResult;
use sps2_state::{FileReference, PackageRef, StateManager};
use sps2_types::state::SlotId;
use std::path::PathBuf;
use uuid::Uuid;
/// State transition for atomic operations
///
/// This is now a simpl... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/install/src/atomic/mod.rs | crates/install/src/atomic/mod.rs | //! Atomic installation operations using APFS clonefile and state transitions
//!
//! This module provides atomic installation capabilities with:
//! - APFS-optimized file operations for instant, space-efficient copies
//! - Hard link creation for efficient package linking
//! - State transitions with rollback support
... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/install/src/atomic/package.rs | crates/install/src/atomic/package.rs | //! Package management operations for atomic installation
//!
//! This module handles:
//! - Carrying forward packages from parent states
//! - Syncing staging slots with parent state
//! - Installing packages to staging
//! - Removing packages from staging
use crate::atomic::fs;
use crate::atomic::transition::StateTr... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/install/src/prepare/worker.rs | crates/install/src/prepare/worker.rs | //! Worker functions for package processing
use crate::PreparedPackage;
use dashmap::DashMap;
use sps2_errors::{Error, InstallError};
use sps2_events::events::{LifecycleAcquisitionSource, LifecycleEvent};
use sps2_events::{AppEvent, EventEmitter, FailureContext, GeneralEvent};
use sps2_net::{PackageDownloadConfig, Pac... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/install/src/prepare/executor.rs | crates/install/src/prepare/executor.rs | //! Parallel executor for package operations
use crate::PreparedPackage;
use crossbeam::queue::SegQueue;
use dashmap::DashMap;
use sps2_config::ResourceManager;
use sps2_errors::{Error, InstallError};
use sps2_events::{AppEvent, EventEmitter, GeneralEvent};
use sps2_resolver::{ExecutionPlan, NodeAction, PackageId, Res... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/install/src/prepare/mod.rs | crates/install/src/prepare/mod.rs | pub mod context;
pub mod executor;
pub mod worker;
pub use context::ExecutionContext;
pub use executor::ParallelExecutor;
| rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
alexykn/sps2 | https://github.com/alexykn/sps2/blob/a357a9ae7317314ef1605ce29b66f064bd6eb510/crates/install/src/prepare/context.rs | crates/install/src/prepare/context.rs | //! Execution context for parallel operations
use crate::SecurityPolicy;
use sps2_events::{EventEmitter, EventSender};
/// Execution context for parallel operations
#[derive(Clone)]
pub struct ExecutionContext {
/// Event sender for progress reporting
event_sender: Option<EventSender>,
/// Optional securi... | rust | BSD-3-Clause | a357a9ae7317314ef1605ce29b66f064bd6eb510 | 2026-01-04T20:17:02.345249Z | false |
etbcor/nasin-nanpa | https://github.com/etbcor/nasin-nanpa/blob/e5ab7a391aa703cd7beef3656c9c86045aeef485/font-forge-tool/src/ffir.rs | font-forge-tool/src/ffir.rs | use std::borrow::Cow;
use itertools::Itertools;
use crate::NasinNanpaVariation;
/// An encoding position (either a number, or `None` which prints `-1`)
#[derive(Default, Clone)]
pub enum EncPos {
Pos(usize),
#[default]
None,
}
impl EncPos {
fn inc(&mut self) {
*self = match self {
... | rust | MIT | e5ab7a391aa703cd7beef3656c9c86045aeef485 | 2026-01-04T20:18:26.798176Z | false |
etbcor/nasin-nanpa | https://github.com/etbcor/nasin-nanpa/blob/e5ab7a391aa703cd7beef3656c9c86045aeef485/font-forge-tool/src/main.rs | font-forge-tool/src/main.rs | use ffir::*;
use glyph_blocks::{base::*, ctrl::*, inner::*, lower::*, outer::*, *};
use itertools::Itertools;
use std::{collections::HashSet, fs::File, io::Write};
mod ffir;
mod glyph_blocks;
#[derive(PartialEq, Eq, Clone, Copy)]
enum NasinNanpaVariation {
Main,
Ucsur,
}
fn gen_nasin_nanpa(variation: NasinNa... | rust | MIT | e5ab7a391aa703cd7beef3656c9c86045aeef485 | 2026-01-04T20:18:26.798176Z | false |
etbcor/nasin-nanpa | https://github.com/etbcor/nasin-nanpa/blob/e5ab7a391aa703cd7beef3656c9c86045aeef485/font-forge-tool/src/glyph_blocks/base.rs | font-forge-tool/src/glyph_blocks/base.rs | use crate::GlyphDescriptor;
//MARK: BASE
pub const BASE_COR: [GlyphDescriptor; 137] = [
GlyphDescriptor::new(
"a",
r#"
500 50 m 0
555 50 600 95 600 150 c 0
600 205 555 250 500 250 c 0
445 250 400 205 400 150 c 0
400 95 445 50 500 50 c 0
800 0 m 0
800 -26 780 -50 750 -50 c 0
729 -50 710 -37 70... | rust | MIT | e5ab7a391aa703cd7beef3656c9c86045aeef485 | 2026-01-04T20:18:26.798176Z | true |
etbcor/nasin-nanpa | https://github.com/etbcor/nasin-nanpa/blob/e5ab7a391aa703cd7beef3656c9c86045aeef485/font-forge-tool/src/glyph_blocks/ctrl.rs | font-forge-tool/src/glyph_blocks/ctrl.rs | use std::borrow::Cow;
use crate::*;
pub const CTRL: [GlyphEnc; 36] = [
GlyphEnc::from_parts(EncPos::Pos(0x0000), "NUL", 0, Rep::const_dflt()),
GlyphEnc::from_parts(EncPos::Pos(0x200B), "ZWSP", 0, Rep::const_dflt()),
GlyphEnc::from_parts(EncPos::Pos(0x200C), "ZWNJ", 0, Rep::const_dflt()),
GlyphEnc::fro... | rust | MIT | e5ab7a391aa703cd7beef3656c9c86045aeef485 | 2026-01-04T20:18:26.798176Z | true |
etbcor/nasin-nanpa | https://github.com/etbcor/nasin-nanpa/blob/e5ab7a391aa703cd7beef3656c9c86045aeef485/font-forge-tool/src/glyph_blocks/inner.rs | font-forge-tool/src/glyph_blocks/inner.rs | use crate::{GlyphDescriptor, Anchor, AnchorType};
//MARK: INNER
pub const INNER_COR: [GlyphDescriptor; 136] = [
GlyphDescriptor::new_with_anchor("a", Anchor::new_scale(AnchorType::Mark, (-500, 400)),
r#"
-507 305 m 0
-507 324 -522 340 -542 340 c 0
-561 340 -577 324 -577 305 c 0
-577 286 -561 270 -542 270 c 0
-523 ... | rust | MIT | e5ab7a391aa703cd7beef3656c9c86045aeef485 | 2026-01-04T20:18:26.798176Z | true |
etbcor/nasin-nanpa | https://github.com/etbcor/nasin-nanpa/blob/e5ab7a391aa703cd7beef3656c9c86045aeef485/font-forge-tool/src/glyph_blocks/outer.rs | font-forge-tool/src/glyph_blocks/outer.rs | use crate::{GlyphDescriptor, Anchor, AnchorType};
//MARK: OUTER
pub const OUTER_COR: [GlyphDescriptor; 62] = [
GlyphDescriptor::new_with_anchor("akesi", Anchor::new_scale(AnchorType::Base, (500, 310)),
r#"
675 740 m 0
634 740 600 774 600 815 c 0
600 856 634 890 675 890 c 0
716 890 750 856 750 815 c 0
750 774 716 7... | rust | MIT | e5ab7a391aa703cd7beef3656c9c86045aeef485 | 2026-01-04T20:18:26.798176Z | true |
etbcor/nasin-nanpa | https://github.com/etbcor/nasin-nanpa/blob/e5ab7a391aa703cd7beef3656c9c86045aeef485/font-forge-tool/src/glyph_blocks/lower.rs | font-forge-tool/src/glyph_blocks/lower.rs | use crate::{GlyphDescriptor, Anchor, AnchorType};
//MARK: LOWER
pub const LOWER_COR: [GlyphDescriptor; 137] = [
GlyphDescriptor::new_with_anchor("a", Anchor::new_stack(AnchorType::Base),
r#"
550 340 m 2
550 240 l 2
550 212 528 190 500 190 c 0
472 190 450 212 450 240 c 2
450 340 l 2
450 368 472 390 500 390 c 0
52... | rust | MIT | e5ab7a391aa703cd7beef3656c9c86045aeef485 | 2026-01-04T20:18:26.798176Z | true |
etbcor/nasin-nanpa | https://github.com/etbcor/nasin-nanpa/blob/e5ab7a391aa703cd7beef3656c9c86045aeef485/font-forge-tool/src/glyph_blocks/mod.rs | font-forge-tool/src/glyph_blocks/mod.rs | #![cfg_attr(rustfmt, rustfmt_skip)]
pub mod ctrl;
pub mod base;
pub mod outer;
pub mod inner;
pub mod lower;
//MARK: HEADERS
pub const HEADER: &str = r#"SplineFontDB: 3.2
FontName: nasin-nanpa
FullName: nasin-nanpa
FamilyName: nasin-nanpa
Weight: Regular
Copyright: jan Itan li mama. jan mute a li pona e pali ona.
"#;... | rust | MIT | e5ab7a391aa703cd7beef3656c9c86045aeef485 | 2026-01-04T20:18:26.798176Z | false |
xnorpx/blue-onyx | https://github.com/xnorpx/blue-onyx/blob/dc00f8bd73857e721a73e0ea804da436fef3ebed/build.rs | build.rs | use std::{env, fs::File, path::Path, process::Command};
use zip::ZipArchive;
const ONNX_SOURCE: (&str, &str) = (
"onnxruntime-1.22.0",
"https://github.com/microsoft/onnxruntime/archive/refs/tags/v1.22.0.zip",
);
const DIRECTML_SOURCE: (&str, &str) = (
"Microsoft.AI.DirectML.1.15.4",
"https://www.nuget... | rust | MIT | dc00f8bd73857e721a73e0ea804da436fef3ebed | 2026-01-04T20:24:46.035395Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.