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
67 changes: 0 additions & 67 deletions apps/desktop/src-tauri/src/contracts/fixtures.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,52 +237,6 @@
"cancel-issue-validation": {
"type": "cancel-issue-validation",
"runId": "run-iv1"
},
"start-council": {
"type": "start-council",
"runId": "run-council1",
"presetId": "research",
"objective": "Recommend a caching strategy for the session store.",
"projectPath": "/proj"
},
"kill-council": {
"type": "kill-council",
"runId": "run-council1"
},
"resolve-council-converge": {
"type": "resolve-council-converge",
"runId": "run-council1",
"decision": "accept",
"seatId": "proposer-opus",
"note": "Clearest migration plan with the least dual-write risk."
},
"set-council-routing": {
"type": "set-council-routing",
"runId": "run-council1",
"edges": [
{
"from": "proposer-opus",
"to": "critic-opus"
},
{
"from": "proposer-sonnet",
"to": "critic-opus"
}
]
},
"send-council-human-input": {
"type": "send-council-human-input",
"runId": "run-council1",
"mode": "direct",
"seatId": "critic-opus",
"message": "Weigh the dual-write rollback path before you settle."
},
"resolve-worktree-op": {
"type": "resolve-worktree-op",
"requestId": "wt-1",
"worktreePath": "/proj/.nightcore/worktrees/council-run-1",
"gauntletPassed": true,
"gauntletSummary": "Structure-Lock gauntlet passed (2 check(s))."
}
},
"queries": {
Expand Down Expand Up @@ -1181,27 +1135,6 @@
"issueNumber": 128,
"taskId": "task-42"
},
"debate-entry": {
"type": "debate-entry",
"runId": "council-run-1",
"entry": {
"stage": "debate",
"seatId": "proposer-1",
"role": "critic",
"kind": "delivery",
"seq": 3,
"content": "Seat proposer-1 said: \"consider the isolated-worktree path\"",
"broadcastId": "bc-1",
"at": 1718900000000,
"injectionFlags": []
}
},
"worktree-op-required": {
"type": "worktree-op-required",
"requestId": "wt-1",
"op": "allocate",
"councilRunId": "council-run-1"
},
"query-result": {
"type": "query-result",
"requestId": "q-1",
Expand Down
147 changes: 0 additions & 147 deletions apps/desktop/src-tauri/src/contracts/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ pub enum SurfaceCommand {
sandbox_writes: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
images: Option<Vec<WireImage>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
council: Option<bool>,
},
#[serde(rename_all = "camelCase")]
SendInput { session_id: u64, text: String },
Expand Down Expand Up @@ -196,50 +194,6 @@ pub enum SurfaceCommand {
},
#[serde(rename_all = "camelCase")]
CancelIssueValidation { run_id: String },
#[serde(rename_all = "camelCase")]
StartCouncil {
run_id: String,
preset_id: CouncilPresetId,
objective: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
project_path: Option<String>,
},
#[serde(rename_all = "camelCase")]
KillCouncil { run_id: String },
#[serde(rename_all = "camelCase")]
ResolveCouncilConverge {
run_id: String,
decision: CouncilConvergeDecision,
#[serde(default, skip_serializing_if = "Option::is_none")]
seat_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
note: Option<String>,
},
#[serde(rename_all = "camelCase")]
SetCouncilRouting {
run_id: String,
edges: Vec<CouncilRoutingEdge>,
},
#[serde(rename_all = "camelCase")]
SendCouncilHumanInput {
run_id: String,
mode: CouncilHumanInputMode,
#[serde(default, skip_serializing_if = "Option::is_none")]
seat_id: Option<String>,
message: String,
},
#[serde(rename_all = "camelCase")]
ResolveWorktreeOp {
request_id: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
worktree_path: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
gauntlet_passed: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
gauntlet_summary: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
error: Option<String>,
},
}

// === Surface → engine queries (Rust SERIALIZES these; replies arrive as the
Expand Down Expand Up @@ -354,8 +308,6 @@ pub enum NightcoreEvent {
model: String,
permission_mode: PermissionMode,
#[serde(default, skip_serializing_if = "Option::is_none")]
council: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
containment: Option<SessionStartedContainment>,
},
#[serde(rename_all = "camelCase")]
Expand Down Expand Up @@ -446,8 +398,6 @@ pub enum NightcoreEvent {
message: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
detail: Option<ErrorDetail>,
#[serde(default, skip_serializing_if = "Option::is_none")]
council: Option<bool>,
},
#[serde(rename_all = "camelCase")]
SessionStatus {
Expand Down Expand Up @@ -751,17 +701,6 @@ pub enum NightcoreEvent {
issue_number: u64,
task_id: String,
},
#[serde(rename_all = "camelCase")]
DebateEntry {
run_id: String,
entry: DebateTranscriptEntry,
},
#[serde(rename_all = "camelCase")]
WorktreeOpRequired {
request_id: String,
op: WorktreeOpRequiredOpEnum,
council_run_id: String,
},
}

// === Referenced enums and nested structs ===
Expand Down Expand Up @@ -918,37 +857,6 @@ pub enum CostTelemetry {
None,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum CouncilConvergeDecision {
Accept,
Reject,
Judge,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum CouncilHumanInputMode {
Broadcast,
Direct,
Steer,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum CouncilPresetId {
Research,
UiBug,
Coding,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CouncilRoutingEdge {
pub from: String,
pub to: String,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum CoverageStatus {
Expand All @@ -957,52 +865,6 @@ pub enum CoverageStatus {
Unenforced,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum DebateEntryKind {
Broadcast,
Message,
Delivery,
Note,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum DebateSeatRole {
Proposer,
Critic,
Judge,
Conductor,
Human,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum DebateStage {
Frame,
Propose,
Debate,
Converge,
Build,
Review,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DebateTranscriptEntry {
pub stage: DebateStage,
pub seat_id: String,
pub role: DebateSeatRole,
pub kind: DebateEntryKind,
pub seq: u64,
pub content: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub broadcast_id: Option<String>,
pub at: u64,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub injection_flags: Option<Vec<String>>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DeepScanConfig {
Expand Down Expand Up @@ -1908,14 +1770,6 @@ pub enum WorkspaceTool {
Unknown,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum WorktreeOpRequiredOpEnum {
Allocate,
Commit,
Gauntlet,
}

// === Event channel registry (nc:*) — single-sourced from `CHANNELS`; the
// conformance test in `contracts/mod.rs` ties every `*_EVENT` const to it ===

Expand All @@ -1925,7 +1779,6 @@ pub enum WorktreeOpRequiredOpEnum {
/// entry here, so a channel renamed/added/removed on either tier fails
/// `cargo test` (and a rename in the zod source also reds `codegen-drift`).
pub const NIGHTCORE_CHANNELS: &[(&str, &str)] = &[
("debate", "nc:debate"),
("harness", "nc:harness"),
("insight", "nc:insight"),
("issueTriage", "nc:issue-triage"),
Expand Down
11 changes: 4 additions & 7 deletions apps/desktop/src-tauri/src/contracts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ mod tests {
.expect("fixtures.commands is an object");
assert_eq!(
commands.len(),
23,
"all 23 SurfaceCommand variants must have a fixture"
17,
"all 17 SurfaceCommand variants must have a fixture"
);
for (tag, wire) in commands {
let cmd: SurfaceCommand = serde_json::from_value(wire.clone())
Expand Down Expand Up @@ -166,8 +166,8 @@ mod tests {
.expect("fixtures.events is an object");
assert_eq!(
events.len(),
47,
"all 47 NightcoreEvent variants must have a fixture"
45,
"all 45 NightcoreEvent variants must have a fixture"
);
for (tag, wire) in events {
let event: NightcoreEvent = serde_json::from_value(wire.clone())
Expand Down Expand Up @@ -205,7 +205,6 @@ mod tests {
ledger_path: None,
sandbox_writes: None,
images: None,
council: None,
};
let wire = serde_json::to_value(&cmd).expect("serializes");
let obj = wire.as_object().expect("an object");
Expand All @@ -229,7 +228,6 @@ mod tests {
"ledgerPath",
"sandboxWrites",
"images",
"council",
] {
assert!(
!obj.contains_key(absent),
Expand Down Expand Up @@ -526,7 +524,6 @@ mod tests {
("loop", crate::orchestration::coordinator::LOOP_EVENT),
("prFix", crate::workflow::pr_fix::PRFIX_EVENT),
("usage", crate::usage::USAGE_EVENT),
("debate", crate::sidecar::DEBATE_EVENT),
]
.into_iter()
.collect();
Expand Down
24 changes: 0 additions & 24 deletions apps/desktop/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,6 @@ pub fn run() {
// forgets the entries but never the work (the auto-commit survives
// on the PR branch in its checkout).
app.manage(workflow::pr_fix::PrFixRegistry::default());
// The Council run registry (issue #383): the host-trusted `councilRunId →
// project root` binding the write-capable worktree seam derives every path
// from. In-memory, populated at `start_council` — the engine can never supply a
// path, only name a run the host recorded.
app.manage(sidecar::CouncilRunRegistry::default());
// The per-provider model catalog cache (issue #80): DERIVED, in-memory —
// never persisted. A restart starts cold and `list_models` re-fetches; the
// `(provider, auth-state)` key self-invalidates across provider/auth changes.
Expand Down Expand Up @@ -315,25 +310,6 @@ pub fn run() {
sidecar::send_input,
sidecar::respond_permission,
sidecar::answer_question,
// Council debate run lifecycle (issue #350): start / kill a governed
// multi-agent debate. Both dispatch a `runId`-keyed SurfaceCommand to the
// engine's Conductor (the sole bus writer). The canvas + transcript stream
// are #352; these are the run-control surface.
sidecar::start_council,
sidecar::kill_council,
// The human Converge gavel (issue #353, safety #7): the terminal human
// verdict that resolves a parked run. Routes through the engine's Conductor
// (the sole bus writer) → append-only transcript, never a direct store write.
sidecar::resolve_council_converge,
// The editable canvas edges (issue #371): rewire a live run's routing policy.
// A CONDUCTOR DIRECTIVE, not a direct seat write — the Conductor filters which
// mediated, quoted peers inform a seat next Debate round (safety #1 intact).
sidecar::set_council_routing,
// Conductor-mediated human input (issue #361): broadcast-all / DM-one /
// steer-stage. NOT `send_input` — the message enters via the Conductor, which
// quotes + injection-scans it into the target seats' next mediated turn, so a
// surface never gains direct-to-seat write authority (safety #1/#2).
sidecar::send_council_human_input,
sidecar::list_task_sessions,
sidecar::get_task_session_messages,
sidecar::resume_session,
Expand Down
Loading
Loading