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
4 changes: 2 additions & 2 deletions scripts/check-codex-skill-discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import subprocess
import sys
import time
from datetime import datetime, timezone
from datetime import UTC, datetime
from pathlib import Path


Expand Down Expand Up @@ -319,7 +319,7 @@ def run_observation(args):
evidence = {"version": "rune-native-skill-evidence/v1", "harness_version": harness_version,
"model_route": model_route, "cwd": cwd, "inventory_digest": inventory["inventory_digest"],
"configuration_digest": inventory["configuration_digest"], "session_id": session_id,
"observed_at": datetime.now(timezone.utc).isoformat(), "catalog": catalog,
"observed_at": datetime.now(UTC).isoformat(), "catalog": catalog,
"accesses": [{key: event[key] for key in ["skill_path", "companion_path", "content_sha256"]} | {"tool_event_id": event["event_id"]} for event in normalized if event["type"] == "tool_access"],
"checks": checks, "transcript_sha256": sha256(transcript), "raw_transcript_sha256": sha256(raw)}
(output / "evidence.json").write_text(json.dumps(evidence, indent=2) + "\n")
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-artifact-checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def state(root, manifest, options):

def utc_stamp(seconds):
return (
datetime.datetime.fromtimestamp(seconds, datetime.timezone.utc)
datetime.datetime.fromtimestamp(seconds, datetime.UTC)
.isoformat(timespec="microseconds")
.replace("+00:00", "Z")
)
Expand Down
6 changes: 3 additions & 3 deletions src/assemble/pipeline_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ fn multi_provider_produces_separate_outputs() {

let (results, errors) = pipeline::assemble_module(&sources, &providers, &tool_mappings, &[]);

assert!(errors.is_empty());
assert_eq!(errors, [] as [String; 0]);
assert_eq!(results.len(), 2);

let paths: Vec<&str> = results.iter().map(|r| r.output_path.as_str()).collect();
Expand Down Expand Up @@ -174,7 +174,7 @@ fn unknown_rule_collected_as_error() {

let (results, errors) = pipeline::assemble_module(&sources, &providers, &tool_mappings, &[]);

assert!(!errors.is_empty());
assert_ne!(errors, [] as [String; 0]);
assert!(errors[0].contains("unknown assembly rule"));
// Files still assembled (unknown rule skipped, valid rules applied)
assert_eq!(results.len(), 1);
Expand All @@ -191,5 +191,5 @@ fn empty_sources_produces_empty_results() {
let (results, errors) = pipeline::assemble_module(&sources, &providers, &tool_mappings, &[]);

assert!(results.is_empty());
assert!(errors.is_empty());
assert_eq!(errors, [] as [String; 0]);
}
2 changes: 1 addition & 1 deletion src/assemble/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ fn extract_returns_urls() {
#[test]
fn extract_returns_empty_for_no_refs() {
let urls = references::extract("No refs here.");
assert!(urls.is_empty());
assert_eq!(urls, [] as [String; 0]);
}

const REFS_MNEMONIC: &str = fixture!("refs-mnemonic.md");
Expand Down
2 changes: 1 addition & 1 deletion src/cli/adopt/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ fn review_session_records_pending_blocks_and_refuses_double_start() {
let blocks = record["review"]["predicate"]["blocks"]
.as_sequence()
.expect("blocks");
assert!(!blocks.is_empty());
assert_ne!(blocks.as_slice(), [] as [serde_yaml::Value; 0]);
assert!(
blocks
.iter()
Expand Down
2 changes: 1 addition & 1 deletion src/cli/assemble/sources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ mod skill_symlink_tests {
.find(|source| source.relative_path.ends_with("/Alias.md"))
.unwrap();
assert!(alias.passthrough);
assert!(alias.content.is_empty());
assert_eq!(alias.content, "");
assert!(alias.content_bytes.is_none());
}

Expand Down
4 changes: 2 additions & 2 deletions src/cli/bench/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ fn second_run_reuses_every_prior_result() {
match &record.result {
Some(RecordResult::Reused(reused)) => {
assert!(reused.reused);
assert!(!reused.source_file.is_empty());
assert_ne!(reused.source_file, "");
}
other => panic!("expected reused result, got {other:?}"),
}
Expand Down Expand Up @@ -993,6 +993,6 @@ fn regenerate_reports_nothing_when_cache_is_empty() {
let root = tempfile::tempdir().expect("tempdir");
let rebuilt = regenerate_from_cache(&echo_options(&suite, &models, root.path(), None, None))
.expect("regenerates");
assert!(rebuilt.model_ids.is_empty());
assert_eq!(rebuilt.model_ids, [] as [String; 0]);
assert!(rebuilt.records.is_empty());
}
2 changes: 1 addition & 1 deletion src/cli/closure/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ fn a_missing_change_is_an_error_that_names_it() {
fn declared_capabilities_reads_only_the_section() {
let text = "## What Changes\n\n### New Capabilities\n\n- `a-b-c`: x\n- plain item\n- `d-e-f`: y\n\n### Modified Capabilities\n\n- `g-h-i`: z\n";
assert_eq!(declared_capabilities(text), ["a-b-c", "d-e-f"]);
assert!(declared_capabilities("# No section\n").is_empty());
assert_eq!(declared_capabilities("# No section\n"), [] as [String; 0]);
}

#[test]
Expand Down
6 changes: 3 additions & 3 deletions src/cli/config/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ fn load_merged_config_succeeds_on_missing_defaults() {
let temp_directory = TempDir::new().unwrap();
let result = load_merged_config(temp_directory.path());
assert!(result.is_ok());
assert!(result.unwrap().is_empty());
assert_eq!(result.unwrap(), "");
}

#[test]
fn load_merged_config_succeeds_on_empty_defaults() {
let temp_directory = TempDir::new().unwrap();
std::fs::write(temp_directory.path().join("defaults.yaml"), "").unwrap();
let result = load_merged_config(temp_directory.path()).unwrap();
assert!(result.is_empty());
assert_eq!(result, "");
assert!(load_providers(&result).is_ok());
}

Expand Down Expand Up @@ -145,7 +145,7 @@ fn load_models_returns_embedded_defaults() {
fn load_source_uri_returns_empty_for_missing_module_yaml() {
let temp_directory = TempDir::new().unwrap();
let result = load_source_uri(temp_directory.path());
assert!(result.is_empty());
assert_eq!(result, "");
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/cli/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,6 @@ mod tests {

assert!(!codex.deployed);
assert_eq!(codex.deployment_state, DeploymentState::NotInstalled);
assert!(warnings.is_empty());
assert_eq!(warnings, [] as [String; 0]);
}
}
4 changes: 2 additions & 2 deletions src/cli/copy/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ fn execute_sidecar_round_trips_typed() {
);
assert_eq!(sidecar.provenance.subject.len(), 1);
assert_eq!(sidecar.provenance.subject[0].name, "rules/Roundtrip.md");
assert!(!sidecar.provenance.subject[0].digest.sha256.is_empty());
assert_ne!(sidecar.provenance.subject[0].digest.sha256, "");

let build = &sidecar.provenance.predicate.build_definition;
assert!(build.build_type.ends_with("/copy/v1"));
Expand All @@ -457,5 +457,5 @@ fn execute_sidecar_round_trips_typed() {
let runner = &sidecar.provenance.predicate.run_details;
assert_eq!(runner.builder.id, env!("CARGO_PKG_REPOSITORY"));
assert_eq!(runner.builder.version.rune, env!("CARGO_PKG_VERSION"));
assert!(!runner.metadata.started_on.is_empty());
assert_ne!(runner.metadata.started_on, "");
}
2 changes: 1 addition & 1 deletion src/cli/deploy/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn collect_files_recursive_finds_nested_files() {
fn collect_files_recursive_empty_directory() {
let temp_directory = TempDir::new().unwrap();
let files = collect_files_recursive(temp_directory.path()).unwrap();
assert!(files.is_empty());
assert_eq!(files, [] as [std::path::PathBuf; 0]);
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/cli/doctor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ mod tests {
assert_eq!(findings[0].status, IntegrityStatus::Orphan);

let reports = draft_reports(root.path()).unwrap();
assert!(reports.is_empty());
assert_eq!(reports, [] as [crate::cli::doctor::DraftReport; 0]);

fs::write(
root.path().join(".drafts"),
Expand Down
8 changes: 4 additions & 4 deletions src/cli/dotrune/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ fn parse_minimal_happy_path() {
assert_eq!(local.to_string_lossy(), "../rune-core");
assert!(path.is_none());
assert_eq!(manifest.runes["rune-core"].skills, vec!["BuildSkill"]);
assert!(manifest.runes["rune-core"].agents.is_empty());
assert!(manifest.runes["rune-core"].rules.is_empty());
assert_eq!(manifest.runes["rune-core"].agents, [] as [String; 0]);
assert_eq!(manifest.runes["rune-core"].rules, [] as [String; 0]);
}

#[test]
Expand Down Expand Up @@ -371,8 +371,8 @@ runes:
rules: [OnlyRule]
";
let manifest = parse(content).unwrap();
assert!(manifest.runes["a"].skills.is_empty());
assert!(manifest.runes["a"].agents.is_empty());
assert_eq!(manifest.runes["a"].skills, [] as [String; 0]);
assert_eq!(manifest.runes["a"].agents, [] as [String; 0]);
assert_eq!(manifest.runes["a"].rules, vec!["OnlyRule"]);
}

Expand Down
4 changes: 2 additions & 2 deletions src/cli/drift/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fn split_parts_separates_frontmatter_and_body() {
fn split_parts_returns_full_content_as_body_without_frontmatter() {
let content = "No frontmatter here.";
let (frontmatter, body) = split_parts(content);
assert!(frontmatter.is_empty());
assert_eq!(frontmatter, "");
assert_eq!(body, content);
}

Expand All @@ -78,7 +78,7 @@ fn diff_frontmatter_keys_detects_added_key() {
fn diff_frontmatter_keys_returns_empty_when_identical() {
let yaml = "name: test\nversion: 0.1.0\n";
let changed = diff_frontmatter_keys(yaml, yaml);
assert!(changed.is_empty());
assert_eq!(changed, [] as [String; 0]);
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/cli/exec/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ fn output_schema_bad_payload_fails_validation() {
panic!("expected completed exec");
};
assert_eq!(result.exit_code, 1);
assert!(!result.validation_errors.is_empty());
assert_ne!(result.validation_errors, [] as [String; 0]);
}

#[test]
Expand Down
5 changes: 4 additions & 1 deletion src/cli/graph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,9 @@ mod tests {
);
let scalar = "---\nchange: one-change\n---\n";
assert_eq!(list_values(scalar, "change"), vec!["one-change"]);
assert!(list_values("---\nchange: []\n---\n", "change").is_empty());
assert_eq!(
list_values("---\nchange: []\n---\n", "change"),
[] as [String; 0]
);
}
}
7 changes: 3 additions & 4 deletions src/cli/install/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,9 @@ fn commitless_repository_has_no_freshness_warning() {
.unwrap();

assert!(detect_stale_source(module.path()).unwrap().is_none());
assert!(
warn_or_block_stale_source(module.path(), false, "rune install --allow-stale")
.unwrap()
.is_empty()
assert_eq!(
warn_or_block_stale_source(module.path(), false, "rune install --allow-stale").unwrap(),
[] as [String; 0]
);
}

Expand Down
10 changes: 8 additions & 2 deletions src/cli/launch/check/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ fn plan_without_a_base_url_has_nothing_to_check() {
env(&[("ANTHROPIC_MODEL", "kimi-k3")]),
Some("kimi-k3"),
);
assert!(plan_checks(&launch, None).is_empty());
assert_eq!(
plan_checks(&launch, None),
[] as [crate::cli::launch::check::EndpointCheck; 0]
);
let report = run_checks(&launch, None);
assert_eq!(report.exit_code, EXIT_SERVED);
assert!(format_report(&report).contains("nothing to check"));
Expand Down Expand Up @@ -231,7 +234,10 @@ fn a_tool_with_a_configured_base_url_key_uses_it() {
#[test]
fn a_tool_without_any_base_url_has_nothing_to_check() {
let launch = resolved("ollama", env(&[]), Some("llama3"));
assert!(plan_checks(&launch, None).is_empty());
assert_eq!(
plan_checks(&launch, None),
[] as [crate::cli::launch::check::EndpointCheck; 0]
);
}

#[test]
Expand Down
15 changes: 9 additions & 6 deletions src/cli/launch/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@ fn wrapped_launch_does_not_apply_env_to_wrapper_process() {
.expect("compose");
let tool = resolve_tool("claude", &Launch::default());

assert!(process_env(&tool, &plan).is_empty());
assert_eq!(
process_env(&tool, &plan),
[] as [(std::ffi::OsString, std::ffi::OsString); 0]
);
}

#[test]
Expand Down Expand Up @@ -550,8 +553,8 @@ fn direct_flag_disables_profile_middleware() {
)
.expect("direct profile launch");

assert!(resolved.pre.is_empty());
assert!(resolved.wrap.is_empty());
assert_eq!(resolved.pre, [] as [crate::cli::launch::PreStep; 0]);
assert_eq!(resolved.wrap, [] as [Vec<std::ffi::OsString>; 0]);
}

#[test]
Expand Down Expand Up @@ -679,7 +682,7 @@ fn check_flag_parses_like_dry_run() {
.expect("parse");
assert!(parsed.check);
assert!(parsed.dry_run);
assert!(parsed.args.is_empty());
assert_eq!(parsed.args, [] as [std::ffi::OsString; 0]);
}

#[test]
Expand Down Expand Up @@ -849,6 +852,6 @@ fn direct_mode_omits_profile_middleware() {
)
.expect("direct launch");

assert!(resolved.wrap.is_empty());
assert!(resolved.pre.is_empty());
assert_eq!(resolved.wrap, [] as [Vec<std::ffi::OsString>; 0]);
assert_eq!(resolved.pre, [] as [crate::cli::launch::PreStep; 0]);
}
14 changes: 6 additions & 8 deletions src/cli/promote/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ fn promote_moves_the_draft_and_writes_the_change_stub() {
);
assert!(!draft_file.exists(), "the provider copy is gone");
assert!(!consumer.path().join(".claude/skills/ReviewSpec").exists());
assert!(
assert_eq!(
Register::load(consumer.path())
.unwrap()
.by_name("ReviewSpec")
.is_empty()
.by_name("ReviewSpec"),
[] as [&rune::manifest::drafts::Draft; 0]
);
assert_eq!(done.removed, vec![".claude/skills/ReviewSpec/SKILL.md"]);

Expand Down Expand Up @@ -153,11 +153,9 @@ fn promote_keeps_the_draft_when_the_stub_cannot_be_written() {
consumer.path().join(".claude/rules/Terse.md").exists(),
"the draft stays"
);
assert!(
!Register::load(consumer.path())
.unwrap()
.by_name("Terse")
.is_empty()
assert_ne!(
Register::load(consumer.path()).unwrap().by_name("Terse"),
[] as [&rune::manifest::drafts::Draft; 0]
);
assert!(
!deck.path().join("runes/core/rules/Terse.md").exists(),
Expand Down
2 changes: 1 addition & 1 deletion src/cli/proof/fence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ mod tests {
assert!(two[0].expected.ends_with("..."));
assert_eq!(two[1].argv, ["printf", "a b", "c", "--flag"]);
assert_eq!(two[1].command_lines.len(), 2);
assert!(scenes[2].steps.is_empty());
assert_eq!(scenes[2].steps, [] as [crate::cli::proof::fence::Step; 0]);
}

#[test]
Expand Down
4 changes: 2 additions & 2 deletions src/cli/provenance/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ mod tests {

let (by_source, orphans) = collect(target.path());

assert!(orphans.is_empty());
assert_eq!(orphans, [] as [String; 0]);
let (verified, total) = by_source["https://example.test/upstream"];
assert_eq!(total, 1);
assert_eq!(verified, 1);
Expand All @@ -623,7 +623,7 @@ mod tests {
by_source.is_empty(),
"dotfile and stray .yaml must not appear"
);
assert!(orphans.is_empty());
assert_eq!(orphans, [] as [String; 0]);
}

#[test]
Expand Down
4 changes: 2 additions & 2 deletions src/cli/repair/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ fn modified_file_is_reported_and_never_repaired() {
assert!(remaining[0].findings.iter().any(|finding| {
finding.status == IntegrityStatus::Modified && finding.path == "skills/Alpha/SKILL.md"
}));
assert!(repairs.is_empty());
assert_eq!(repairs, [] as [crate::cli::repair::RepairAction; 0]);
}

#[test]
Expand Down Expand Up @@ -125,7 +125,7 @@ fn repair_does_not_restore_source_with_wrong_digest() {
.iter()
.any(|finding| finding.status == IntegrityStatus::Missing)
);
assert!(repairs.is_empty());
assert_eq!(repairs, [] as [crate::cli::repair::RepairAction; 0]);
}

#[test]
Expand Down
5 changes: 4 additions & 1 deletion src/cli/sign/queue/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ fn store_round_trips_requests_and_removes_them() {
assert_eq!(store.load("one").expect("load"), request);
assert_eq!(store.load_all().expect("all").len(), 1);
store.remove("one").expect("remove");
assert!(store.load_all().expect("all").is_empty());
assert_eq!(
store.load_all().expect("all"),
[] as [crate::cli::sign::queue::store::Request; 0]
);
}

#[test]
Expand Down
Loading
Loading