Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/pre-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: pre-merge

on:
pull_request:
branches: [main, master]
workflow_dispatch:

jobs:
pre-merge:
if: github.actor == 'justinmoon'
runs-on: blacksmith-16vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4

- uses: useblacksmith/stickydisk@v1
with:
key: ${{ github.repository }}-nix-v1-${{ runner.os }}
path: /nix
- name: Fix /nix ownership
run: |
if [ -d /nix ] && [ "$(stat -c %u /nix)" != "$(id -u)" ]; then
sudo chown -R "$(id -u):$(id -g)" /nix
fi
- uses: nixbuild/nix-quick-install-action@v30

- uses: useblacksmith/stickydisk@v1
with:
key: ${{ github.repository }}-cargo-home-v1-${{ runner.os }}
path: ~/.cargo
- uses: useblacksmith/stickydisk@v1
with:
key: ${{ github.repository }}-cargo-target-v1-${{ runner.os }}
path: target

- run: nix develop .#default -c just pre-merge
35 changes: 35 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name = "rally"
version = "0.1.0"
edition = "2024"

[workspace]
members = [
"crates/rally-core",
"crates/rally-workflow-plan",
"crates/rally-workflow-build",
]

[dependencies]
anyhow = "1.0"
chrono = { version = "0.4", features = ["serde", "clock"] }
Expand All @@ -11,3 +18,6 @@ dirs = "6.0"
fs2 = "0.4"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
rally-core = { path = "crates/rally-core" }
rally-workflow-build = { path = "crates/rally-workflow-build" }
rally-workflow-plan = { path = "crates/rally-workflow-plan" }
9 changes: 9 additions & 0 deletions crates/rally-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "rally-core"
version = "0.1.0"
edition = "2024"

[dependencies]
chrono = { version = "0.4", features = ["serde", "clock"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
69 changes: 69 additions & 0 deletions crates/rally-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
use std::collections::BTreeMap;

use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use serde_json::Value;

#[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum SessionType {
Plan,
Implement,
Workflow,
}

#[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum SessionPhase {
Registration,
Proposal,
Analysis,
Negotiation,
FinalizationWrite,
FinalizationReview,
Implement,
Review,
Done,
}

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Config {
pub expected_agents: u32,
pub max_rounds: u32,
pub turn_timeout_secs: u64,
pub review_timeout_secs: u64,
}

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct AgentState {
pub name: String,
pub joined_at: DateTime<Utc>,
pub last_seen: DateTime<Utc>,
pub phase_status: String,
pub rounds: u32,
}

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct SessionState {
pub name: String,
pub session_type: SessionType,
pub phase: SessionPhase,
pub created_at: DateTime<Utc>,
pub config: Config,
pub agents: BTreeMap<String, AgentState>,
pub topic: Option<String>,
pub todo_path: Option<String>,
pub workspace: Option<String>,
#[serde(default)]
pub workflow_id: Option<String>,
#[serde(default)]
pub workflow_source: Option<String>,
#[serde(default)]
pub workflow_version: Option<String>,
#[serde(default)]
pub workflow_state: Option<Value>,
}

pub fn now() -> DateTime<Utc> {
Utc::now()
}
11 changes: 11 additions & 0 deletions crates/rally-workflow-build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "rally-workflow-build"
version = "0.1.0"
edition = "2024"

[dependencies]
anyhow = "1.0"
chrono = { version = "0.4", features = ["serde", "clock"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
rally-core = { path = "../rally-core" }
Loading