Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
3936b70
Register oxa-work crate for issue #333
n0rpan Nov 15, 2026
fb25b36
Add opt-in work task runner with external acceptance checks (#333)
n0rpan Nov 15, 2026
cfd23d3
Merge remote-tracking branch 'origin/main' into agent/333-work-task-r…
n0rpan Nov 15, 2026
779e689
Merge remote-tracking branch 'origin/main' into agent/333-work-continue
n0rpan Nov 15, 2026
cdfab27
Fix sandbox commits and offline issue lookup in work runner
n0rpan Nov 15, 2026
667f3f6
Merge remote-tracking branch 'origin/main' into agent/333-work-task-r…
n0rpan Nov 15, 2026
e6e30c3
Merge branch 'agent/333-work-task-runner' into agent/333-work-continue
n0rpan Nov 15, 2026
c86fa8b
Continue work branches with ordinary base merges (#333)
n0rpan Nov 15, 2026
d053910
Include the current base when resuming an older merge
n0rpan Nov 15, 2026
1e39172
Preserve offline policy and continue work batches after task failures
n0rpan Nov 15, 2026
6915352
Merge remote-tracking branch 'origin/main' into agent/333-work-task-r…
n0rpan Nov 15, 2026
6c24b5f
Merge branch 'agent/333-work-task-runner' into agent/333-work-continue
n0rpan Nov 15, 2026
77100aa
Checkpoint work tasks and save unfinished work as commits (#333)
n0rpan Nov 15, 2026
f6321b0
Keep task ownership throughout saving and detect interrupted status
n0rpan Nov 15, 2026
232eb0e
Publish accepted work and file scrubbed duplicate-checked problem not…
n0rpan Nov 15, 2026
8bf1f38
Preserve execution privacy and finish failed reporting checkpoints
n0rpan Nov 15, 2026
d7ab5cf
Keep prompt parsing stable and retain agent failure causes (#333)
n0rpan Nov 15, 2026
e8952cb
Merge remote-tracking branch 'origin/main' into agent/333-work-task-r…
n0rpan Nov 15, 2026
b7cfc06
Merge branch 'agent/333-work-task-runner' into agent/333-work-continue
n0rpan Nov 15, 2026
8f1e2c0
Merge branch 'agent/333-work-continue' into agent/333-work-state
n0rpan Nov 15, 2026
7bec3a9
Merge main into agent/333-work-state
n0rpan Nov 15, 2026
94fb542
Merge remote-tracking branch 'origin/agent/333-work-state' into agent…
n0rpan Nov 15, 2026
91fc859
Merge branch 'agent/333-work-state' into agent/333-work-publish
n0rpan Nov 15, 2026
2841b35
Require terminal approval for public work actions and retain interrup…
n0rpan Nov 15, 2026
e9feda5
Merge remote-tracking branch 'origin/main' into agent/333-work-publish
n0rpan Nov 15, 2026
8d71af0
merge: compose retained work publication with trusted runner
n0rpan Nov 17, 2026
a8e2efe
fix(work): preserve action and save retries on current checkpoints
n0rpan Nov 17, 2026
494cfff
fix(work): clear completed save outcome before later execution
n0rpan Nov 17, 2026
02d6889
fix(work): authorize only confirmed publication transports
n0rpan Nov 17, 2026
1b9e38a
test(work): expose note privacy and publication metadata regressions
n0rpan Nov 17, 2026
a7db5ec
fix(work): sanitize notes and retain publication host and owner body
n0rpan Nov 17, 2026
ff82d24
test(work): reporting must retain a pending accepted save
n0rpan Nov 17, 2026
2b6a47b
fix(work): preserve pending save through report checkpoints
n0rpan Nov 17, 2026
9650ba9
Merge main preserving publication and native shadow interfaces
n0rpan Nov 17, 2026
6936ee2
test(work): reject publication recovery acceptance bypasses
n0rpan Nov 17, 2026
95c55cb
fix(work): revalidate terminal action checkpoints on explicit rerun
n0rpan Nov 17, 2026
cb7ae1f
Merge main preserving publication alongside native helper queue
n0rpan Nov 17, 2026
dcd4f46
Merge main while retaining work publication and verification
n0rpan Nov 17, 2026
08c2c9b
test(work): expose stale save and publication verification failures
n0rpan Nov 17, 2026
8ac1cc9
Verify committed publication and recovered saves
n0rpan Nov 17, 2026
c3b0b29
Merge main and use its shared report command runner
n0rpan Nov 17, 2026
23eaa74
Merge main and preserve native refill and report routes
n0rpan Nov 17, 2026
adde48e
Merge main and protect publication checkpoint reads
n0rpan Nov 17, 2026
2c1b106
Merge main and carry the canonical report deadline
n0rpan Nov 17, 2026
72025f3
test(work): cover publication subprocess and destination guards
n0rpan Nov 17, 2026
72a5d6e
test(work): assert the confirmed report host is used
n0rpan Nov 17, 2026
373b8bd
Bound publication commands and bind confirmed destinations
n0rpan Nov 17, 2026
41c4b89
Merge main and preserve #1090 PR packets with publication
n0rpan Nov 17, 2026
cb8174d
Merge #1043 and #1099 with publication and action recovery
n0rpan Nov 17, 2026
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
30 changes: 30 additions & 0 deletions oxa/docs/work.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,33 @@ one short line per task.
The [checkpoint integration contract](work-state.md) defines the runner's public
event hook. Event/situation/standing stores and their CLI adapters are a separate
integration; this slice does not infer facts from worker prose or raw logs.
`oxa work tasks.json --publish` pushes the accepted, saved commit to `origin` and
creates or updates its PR through `gh`. Sign in with `gh auth login --hostname HOST`
for the host in `origin`. Publication uses that host's saved login. Red acceptance never pushes; green
acceptance makes the PR ready. Blocked tasks do not create PRs. Drift-only accepted reruns may update an existing PR.
The runner checks existing PR queue membership before every push and refuses a
queued PR; use a new task branch for follow-up work. It refuses branch changes
made after acceptance until `--rerun` checks them. PR bodies include task ID and
acceptance state, without raw prompts, transcripts or failed-check output.
Execution preserves a saved offline restriction across restarts; later explicit
publication uses the current network policy without changing that restriction.
A publication failure keeps a publication checkpoint; another `--publish` retries
without replaying the agent. Offline mode refuses network publication.
Before each push, the runner asks through the controlling terminal for approval
of the accepted commit, branch and PR destination. Piped input cannot approve it.

`--report-problems` independently authorizes filing the task's own structured
problem notes using the `report-issue` workflow. This flag must be launched by the
user outside an agent tool. Each new report or comment shows its exact cleaned
text and requires controlling-terminal confirmation, as `oxa report-issue submit`
does. Without confirmation it stays a local draft. Reports use the user setting `oxa.reportIssue.repo`;
project settings cannot choose a destination. Notes, titles and queries pass
through the existing report scrubber. The runner performs two or three symptom
queries against open issues and PRs and reads the top matches before writing.
It comments only new notes on a matching issue, links an existing fixing PR, or
files a new report with related links. Search failure, offline mode or missing
report configuration keeps a local scrubbed draft and records its path/detail.
A later explicit `--report-problems` retries local reports without replaying the
agent. A draft-write failure records a failed report and finishes the task checkpoint;
`--report-problems` can retry it. Reports contain only scrubbed structured symptom
summaries, without raw assistant output or acceptance logs.
2 changes: 1 addition & 1 deletion oxa/oxa-cli/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ const COMMANDS: &[(&str, &str)] = &[
"Draft a scrubbed ox-llm issue; submit posts it only after you type yes",
),
(
"oxa work <taskfile> | --issue N --model MODEL | --pr N --model MODEL | board --shadow --repo OWNER/REPO --once",
"oxa work <taskfile> [--rerun] [--publish] [--report-problems] | --issue N --model MODEL | --pr N --model MODEL | --status | board --shadow --repo OWNER/REPO --once",
"Run tasks in isolated worktrees with external acceptance checks",
),
(
Expand Down
1 change: 1 addition & 0 deletions oxa/oxa-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ pub use work_board::refill_input;
mod work_checks;
mod work_cmd;
pub mod work_refill;
mod work_reports;

pub use args::{
no_tool_alias, parse_args, usage_text, ApiKey, Args, LoginArgs, ModeArg, RegistryArgs, Subcommand,
Expand Down
5 changes: 4 additions & 1 deletion oxa/oxa-cli/src/report_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,11 +457,14 @@ pub(super) fn submit_with_storage(
/// The real confirmation: the question and the answer go through `/dev/tty` (never stdin, so
/// piped input cannot confirm). `None` without a controlling terminal, or when oxa's own tools
/// run this (`OXA_CODING_AGENT` is set: the model must not confirm for the user).
fn tty_confirm(env: &Env) -> impl FnMut(&str) -> Option<bool> + '_ {
pub(crate) fn tty_confirm(env: &Env) -> impl FnMut(&str) -> Option<bool> + '_ {
move |question: &str| {
if env.get("OXA_CODING_AGENT").is_some() {
return None;
}
// Keep concurrent workers' questions and answers together.
static TERMINAL: std::sync::Mutex<()> = std::sync::Mutex::new(());
let _terminal = TERMINAL.lock().ok()?;
let mut tty = std::fs::OpenOptions::new()
.read(true)
.write(true)
Expand Down
4 changes: 3 additions & 1 deletion oxa/oxa-cli/src/work_checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ git --no-replace-objects commit -m {message}
}
}
if failed {
err.write_all(&diagnostics).map_err(|e| e.to_string())?;
let ctx = crate::report_cmd::ScrubCtx::from_env(env, dirs);
let safe = crate::report_cmd::scrub(&String::from_utf8_lossy(&diagnostics), &ctx);
err.write_all(safe.as_bytes()).map_err(|e| e.to_string())?;
}
Ok(i32::from(failed))
}
Expand Down
126 changes: 108 additions & 18 deletions oxa/oxa-cli/src/work_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,28 @@ pub(crate) fn run(
return Ok(0);
}
}
let rerun = args.last().is_some_and(|arg| arg == "--rerun");
let task_args = if rerun { &args[..args.len() - 1] } else { args };
let (mut rerun, mut publish, mut reports) = (false, false, false);
let mut end = args.len();
while let Some(flag) = args.get(end.wrapping_sub(1)) {
match flag.as_str() {
"--rerun" => rerun = true,
"--publish" => publish = true,
"--report-problems" => reports = true,
_ => break,
}
end -= 1;
}
if (publish || reports)
&& env.pairs().iter().any(|(name, _)| {
matches!(
name.as_str(),
"OXA_CODING_AGENT" | "AI_AGENT" | "OXA_SUBAGENT_DEPTH"
)
})
{
return Err("publishing and problem reporting require the owner outside an agent tool".into());
}
let task_args = &args[..end];
let is_trusted = trusted(&root, env, dirs)?;
let tasks = match task_args {
[file] if !file.starts_with('-') => oxa_work::read_tasks(&cwd.join(file))?,
Expand Down Expand Up @@ -258,7 +278,12 @@ pub(crate) fn run(
// Freeze every task before checkout hooks or a first worker can change
// shared refs. A bad plan remains a per-task error, not a batch abort.
let plans = if is_trusted {
oxa_work::plan_tasks_for_run(&root, &tasks, &policy, rerun)
let planner = if publish || reports {
oxa_work::plan_tasks_for_actions
} else {
oxa_work::plan_tasks_for_run
};
planner(&root, &tasks, &policy, rerun)
} else {
tasks
.iter()
Expand All @@ -274,29 +299,94 @@ pub(crate) fn run(
for task in planned {
let record = match task {
Ok(plan) => {
match oxa_work::run_task_with_observer(
&root,
&binary,
&plan,
&policy,
rerun,
&|_: &oxa_work::Record| Ok(()),
) {
Ok(record) => record,
Err(oxa_work::RunError::Blocked(detail)) => {
let mut record = oxa_work::blocked_record(plan.task(), detail);
record.base_sha = Some(plan.base_sha().to_owned());
record
let cached = if (publish || reports) && !rerun {
oxa_work::action_record(&policy, plan.task())?
} else {
None
};
let mut record = if let Some(record) = cached {
record
} else {
let ctx = crate::report_cmd::ScrubCtx::from_env(env, dirs);
match oxa_work::run_task_with_notes(
&root,
&binary,
&plan,
&policy,
rerun,
&|_: &oxa_work::Record| Ok(()),
&|note| crate::work_reports::scrub_note(note, &ctx),
) {
Ok(record) => record,
Err(oxa_work::RunError::Blocked(detail)) => {
let mut record = oxa_work::blocked_record(plan.task(), detail);
record.base_sha = Some(plan.base_sha().to_owned());
record
}
Err(oxa_work::RunError::Checkpoint(error)) => return Err(error),
}
Err(oxa_work::RunError::Checkpoint(error)) => return Err(error),
};
if publish && !record.worktree.as_os_str().is_empty() {
let gh = crate::netguard::trusted_executable_for(
"gh",
Some(policy.host_path.as_os_str()),
Some(&root),
Some(&dirs.home),
)
.unwrap_or_else(|| PathBuf::from("/unavailable/gh"));
record = oxa_work::publish(
&root,
&binary,
plan.task(),
&policy,
&gh,
&|_: &oxa_work::Record| Ok(()),
&mut crate::report_cmd::tty_confirm(env),
)?;
}
if reports && !record.worktree.as_os_str().is_empty() {
let settings = oxa_config::Settings::load(dirs, &root, false);
let ctx = crate::report_cmd::ScrubCtx::from_env(env, dirs);
record = oxa_work::report_notes(
plan.task(),
&policy,
&|_: &oxa_work::Record| Ok(()),
&mut |note, lock, offline| {
let mut runner = |program: &str, args: &[String]| {
let executable = crate::netguard::trusted_executable_for(
program,
Some(policy.host_path.as_os_str()),
Some(&root),
Some(&dirs.home),
)?;
crate::work_reports::process(
&executable.to_string_lossy(),
args,
&root,
lock,
)
};
crate::work_reports::report(
note,
dirs,
&settings,
&ctx,
offline,
&mut crate::report_cmd::tty_confirm(env),
&mut runner,
)
},
)?;
}
record
}
Err(record) => *record,
};
if matches!(
record.outcome,
oxa_work::Outcome::Red | oxa_work::Outcome::Blocked | oxa_work::Outcome::Interrupted
) {
) || record.reports.iter().any(|report| report.disposition == "failed")
{
code = 1;
}
serde_json::to_writer(&mut *out, &record).map_err(|e| e.to_string())?;
Expand Down
Loading
Loading