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
2 changes: 1 addition & 1 deletion crates/memory/src/eventlog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub async fn cmd(m: &Memory, op: LogOp) -> Fallible {
LogOp::Materialize { domain } => {
let done = m.materialize(domain.as_deref()).await?;
for id in &done.behind {
eprintln!("memory: {id} is not at the version the log names");
eprintln!("amem: {id} is not at the version the log names");
}
crate::json(&done)
}
Expand Down
10 changes: 5 additions & 5 deletions crates/memory/src/gofannon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ pub async fn cmd(root: &Path, op: GofannonOp) -> Fallible {
poll: Duration::from_secs(poll_seconds.max(1)),
};
let done = work(&m, &plan).await?;
eprintln!("memory: gofannon worked {done} tasks");
eprintln!("amem: gofannon worked {done} tasks");
Ok(())
}
}
Expand All @@ -129,7 +129,7 @@ pub async fn work(m: &Arc<Memory>, plan: &Plan) -> Result<usize, Box<dyn std::er
return Ok(n);
};
eprintln!(
"memory: claimed {}: {} for gofannon {}",
"amem: claimed {}: {} for gofannon {}",
task.id, task.title, plan.agent
);
m.set_held_task(&task.id);
Expand All @@ -152,7 +152,7 @@ fn keep_lease(client: Arc<MemoryClient>, id: String, lease: i64) -> tokio::task:
loop {
tick.tick().await;
if let Err(e) = client.heartbeat(&id, lease).await {
eprintln!("memory: heartbeat on {id}: {e}");
eprintln!("amem: heartbeat on {id}: {e}");
return;
}
}
Expand Down Expand Up @@ -235,10 +235,10 @@ async fn settle(
.await?;
if done {
client.complete(&task.id, &handoff).await?;
eprintln!("memory: {} completed, handoff {handoff}", task.id);
eprintln!("amem: {} completed, handoff {handoff}", task.id);
} else {
client.release(&task.id, Some(&handoff)).await?;
eprintln!("memory: {} released, handoff {handoff}", task.id);
eprintln!("amem: {} released, handoff {handoff}", task.id);
}
Ok(())
}
Expand Down
4 changes: 2 additions & 2 deletions crates/memory/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub fn unpack(root: &Path, image: &str) -> Fallible<PathBuf> {
std::fs::remove_dir_all(&fresh)?;
}
std::fs::create_dir_all(&fresh)?;
eprintln!("memory: exporting {image} from {rt}");
eprintln!("amem: exporting {image} from {rt}");
let id = run(rt, &["create", image, "true"])?;
let id = id.lines().last().unwrap_or_default().trim().to_string();
let result = (|| -> Fallible<()> {
Expand Down Expand Up @@ -99,7 +99,7 @@ pub fn unpack(root: &Path, image: &str) -> Fallible<PathBuf> {
}
std::fs::rename(&fresh, &rootfs)?;
std::fs::write(rootfs.with_extension("source"), format!("{image}\n"))?;
eprintln!("memory: unpacked into {}", rootfs.display());
eprintln!("amem: unpacked into {}", rootfs.display());
Ok(rootfs)
}

Expand Down
30 changes: 15 additions & 15 deletions crates/memory/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1283,10 +1283,10 @@ fn main() {
match outbox {
Some(outbox) => {
if let Err(e) = hooks::run(&outbox, harness) {
eprintln!("memory hook: {e}");
eprintln!("amem: hook: {e}");
}
}
None => eprintln!("memory hook: no MEMORY_OUTBOX and no HOME"),
None => eprintln!("amem: hook: no MEMORY_OUTBOX and no HOME"),
}
std::process::exit(0);
}
Expand Down Expand Up @@ -1749,7 +1749,7 @@ fn route_for(
)?;
if var == "GH_TOKEN" {
eprintln!(
"memory: copilot holds your GitHub login's token, which reaches every \
"amem: copilot holds your GitHub login's token, which reaches every \
repository the login can; a token with only the Copilot Requests \
permission, as COPILOT_GITHUB_TOKEN, keeps that out of the sandbox"
);
Expand Down Expand Up @@ -2022,12 +2022,12 @@ fn record_reported_usage(p: &Prepared) {
.telemetry()
.record_reported(p.memory.session_id(), &p.provider, usage)
{
eprintln!("memory: could not record reported usage: {e}");
eprintln!("amem: could not record reported usage: {e}");
}
}
if let Some((pct, window)) = reported.plan_used_percent {
eprintln!(
"memory: the harness reports {pct:.1}% of its plan's {}-hour window used",
"amem: the harness reports {pct:.1}% of its plan's {}-hour window used",
window / 60
);
}
Expand Down Expand Up @@ -2080,7 +2080,7 @@ fn report_usage(egress: &Egress) {
if rows.is_empty() {
return;
}
eprintln!("memory: usage this root, by destination and model:");
eprintln!("amem: usage this root, by destination and model:");
for r in rows {
eprintln!(
" {:<10} {:<26} {:<8} calls {:>4} in {:>8} out {:>8} cache {:>8}",
Expand Down Expand Up @@ -2187,14 +2187,14 @@ fn live_mount(p: &Prepared, harness: Harness) -> Option<dm_mount::Mounted> {
match dm_mount::mount(p.memory.clone(), &p.projection, &at) {
Ok(m) => {
eprintln!(
"memory: the projection at {} is a live mount: every open of an entry is a get",
"amem: the projection at {} is a live mount: every open of an entry is a get",
dm_sandbox::INSIDE_PROJECTION
);
Some(m)
}
Err(e) => {
eprintln!(
"memory: the projection at {} is a render: {e}",
"amem: the projection at {} is a render: {e}",
dm_sandbox::INSIDE_PROJECTION
);
None
Expand Down Expand Up @@ -2406,7 +2406,7 @@ async fn golden_suite(
.ok_or_else(|| {
format!("the platform holds no verified eval artifact named {name}")
})?;
eprintln!("memory: the suite is the platform's {}", a.entry);
eprintln!("amem: the suite is the platform's {}", a.entry);
golden::Suite::parse(&a.text)
}
(None, None) => Err("name a suite, or --platform".into()),
Expand Down Expand Up @@ -3229,7 +3229,7 @@ fn empty_record(root: &Path) -> Result<PathBuf, Box<dyn std::error::Error>> {
));
std::fs::create_dir_all(&dir)?;
Memory::init(&dir, &grants.owner, &domain)?;
eprintln!("memory: empty memory at {}", dir.display());
eprintln!("amem: empty memory at {}", dir.display());
Ok(dir)
}

Expand Down Expand Up @@ -3407,7 +3407,7 @@ fn announce(runner: &Runner, p: &Prepared, harness: Harness, workdir: &Path) {
_ => workdir.to_path_buf(),
};
eprintln!(
"memory: {} {how} {} · model calls via {} at ceiling {} · session {}",
"amem: {} {how} {} · model calls via {} at ceiling {} · session {}",
harness.binary(),
shown.display(),
p.ceiling_of,
Expand Down Expand Up @@ -3450,7 +3450,7 @@ async fn platform_model(memory: &Memory, harness: Harness) -> Option<String> {
.flatten()?;
let v: serde_json::Value = serde_json::from_str(&a.text).ok()?;
let model = v.get("model")?.as_str()?.to_string();
eprintln!("memory: model {model} from the platform's {}", a.entry);
eprintln!("amem: model {model} from the platform's {}", a.entry);
Some(model)
}

Expand Down Expand Up @@ -3667,7 +3667,7 @@ impl Session {
via: MineVia,
) -> Result<Vec<String>, Box<dyn std::error::Error>> {
let Some(t) = mine::newest_transcript(&self.p.home) else {
eprintln!("memory: nothing to mine; no transcript under the private home");
eprintln!("amem: nothing to mine; no transcript under the private home");
return Ok(Vec::new());
};
let model = model::resolve(&self.p.egress, &self.p.server.provider, model).await;
Expand All @@ -3689,7 +3689,7 @@ impl Session {
)
.await?
};
eprintln!("memory: mined {} entries from {}", ids.len(), t.display());
eprintln!("amem: mined {} entries from {}", ids.len(), t.display());
client.close().await.ok();
Ok(ids)
}
Expand Down Expand Up @@ -3811,7 +3811,7 @@ impl Session {
at: String::new(),
};
if let Err(e) = self.p.egress.telemetry().record_run(&run) {
eprintln!("memory: the run's resources were not kept: {e}");
eprintln!("amem: the run's resources were not kept: {e}");
}
Ok((code, out))
}
Expand Down
2 changes: 1 addition & 1 deletion crates/memory/src/mine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pub async fn write_proposals(
domain: None,
})
.await?;
eprintln!("memory: mined {} {id}: {}", p.kind, p.title);
eprintln!("amem: mined {} {id}: {}", p.kind, p.title);
ids.push(id);
}
Ok(ids)
Expand Down
6 changes: 3 additions & 3 deletions crates/memory/src/reenact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ fn checkout(repo: &Path, commit: &str, run: &str) -> Fallibly<PathBuf> {

fn remove_checkout(into: &Path) {
if std::fs::remove_dir_all(into).is_err() {
eprintln!("memory: the checkout at {} was left", into.display());
eprintln!("amem: the checkout at {} was left", into.display());
}
}

Expand Down Expand Up @@ -498,7 +498,7 @@ async fn run_once(
session.memory().set_playback(play.clone());
session.memory().disable_read_log();
eprintln!(
"memory: re-enacting {} ({} calls on its tape) as {}",
"amem: re-enacting {} ({} calls on its tape) as {}",
args.session,
play.played().tape_calls,
session.memory().session_id()
Expand Down Expand Up @@ -540,7 +540,7 @@ fn tree_for(
if let Some(c) = commit {
return Ok((checkout(repo, c, &format!("{session}-{run}"))?, None));
}
eprintln!("memory: {session} recorded no commit; the re-run works in an empty directory");
eprintln!("amem: {session} recorded no commit; the re-run works in an empty directory");
// as an empty record is made for an evaluation's baseline
let d = std::env::temp_dir().join(format!("amem-reenact-{}-{run}", std::process::id()));
std::fs::create_dir_all(&d)?;
Expand Down
2 changes: 1 addition & 1 deletion crates/memory/src/sources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub async fn cmd(m: &Memory, op: SourceOp) -> Fallible {
let id = id.strip_prefix(dm_server::sources::CITATION).unwrap_or(&id);
let s = m.release_source(id).await?;
eprintln!(
"memory: {} released; it carries {}",
"amem: {} released; it carries {}",
s.id,
if s.findings.is_empty() {
"nothing the scan found".to_string()
Expand Down
2 changes: 1 addition & 1 deletion crates/memory/src/stops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ fn say(signal: i32) -> bool {
2 => "SIGINT",
_ => "SIGTERM",
};
let line = format!("memory: {name}: ending the run and cleaning up\n");
let line = format!("amem: {name}: ending the run and cleaning up\n");
std::io::stderr().write_all(line.as_bytes()).is_ok()
}

Expand Down
6 changes: 3 additions & 3 deletions crates/memory/src/taps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub async fn run(
.and_then(|var| crate::present(std::env::var(var).ok()));
if grant.credential.is_some() && credential.is_none() {
eprintln!(
"memory: {} is not set; the tap runs without a credential",
"amem: {} is not set; the tap runs without a credential",
grant.credential.as_deref().unwrap_or_default()
);
}
Expand All @@ -94,12 +94,12 @@ pub async fn run(
(Ok(outcome), _) => println!("{}", serde_json::to_string_pretty(&outcome)?),
(Err(e), None) => return Err(e.into()),
// on a schedule, one failed pull is reported and the next one still comes
(Err(e), Some(_)) => eprintln!("memory: tap {name}: {e}"),
(Err(e), Some(_)) => eprintln!("amem: tap {name}: {e}"),
}
let Some(secs) = every else {
return Ok(());
};
eprintln!("memory: tap {name} runs again in {secs}s");
eprintln!("amem: tap {name} runs again in {secs}s");
tokio::time::sleep(std::time::Duration::from_secs(secs.max(1))).await;
}
}
Expand Down
16 changes: 8 additions & 8 deletions crates/memory/src/transcripts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,21 @@ pub async fn sweep(m: &Memory) -> Result<Vec<Swept>, Box<dyn std::error::Error>>
let swept = m.sweep_transcripts(now).await?;
// decision contexts run on the same clock, and go whole: no entry cites them
for session in m.sweep_contexts(now).await? {
eprintln!("memory: decision contexts of {session} expired and were dropped");
eprintln!("amem: decision contexts of {session} expired and were dropped");
}
// and the tapes a re-run is answered from, unless pinned for a benchmark
for session in m.sweep_tapes(now).await? {
// and the reports of its re-runs, which quote what the runs wrote and said
crate::reenact::forget_runs(m.root(), &session);
eprintln!("memory: the tape of {session} expired and was dropped, with its re-runs");
eprintln!("amem: the tape of {session} expired and was dropped, with its re-runs");
}
// and so do the sources tools brought in, except what a live entry cites
for id in m.sweep_sources(now).await? {
eprintln!("memory: source {id} expired, uncited, and was dropped");
eprintln!("amem: source {id} expired, uncited, and was dropped");
}
for s in &swept {
eprintln!(
"memory: transcript {} expired: {} turns kept as {} excerpts, {} dropped",
"amem: transcript {} expired: {} turns kept as {} excerpts, {} dropped",
s.session,
s.kept.len(),
s.excerpts,
Expand Down Expand Up @@ -147,7 +147,7 @@ pub async fn keep_newest(
match keep_file(memory, harness, domain, Some(home), &path).await {
Ok(k) => {
eprintln!(
"memory: transcript kept as source {} in {}: {} turns, {}, until {}",
"amem: transcript kept as source {} in {}: {} turns, {}, until {}",
k.session,
k.domain,
k.turns,
Expand All @@ -158,7 +158,7 @@ pub async fn keep_newest(
}
Err(e) => {
eprintln!(
"memory: the transcript at {} was not kept: {e}",
"amem: the transcript at {} was not kept: {e}",
path.display()
);
None
Expand All @@ -175,7 +175,7 @@ pub async fn remove_kept(memory: &Memory, home: &Path) -> Vec<std::path::PathBuf
let origins = match memory.kept_origins().await {
Ok(o) => o,
Err(e) => {
eprintln!("memory: the harness's transcripts were left in its home: {e}");
eprintln!("amem: the harness's transcripts were left in its home: {e}");
return Vec::new();
}
};
Expand All @@ -188,7 +188,7 @@ pub async fn remove_kept(memory: &Memory, home: &Path) -> Vec<std::path::PathBuf
continue;
};
if std::fs::remove_file(&path).is_ok() {
eprintln!("memory: the harness's copy of {origin} removed; the record keeps it");
eprintln!("amem: the harness's copy of {origin} removed; the record keeps it");
removed.push(path);
}
}
Expand Down
Loading
Loading