MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / resolve

Function resolve

libatomic/src/review/incremental.rs:423–456  ·  view source on GitHub ↗

Resolve without mutation, network requests, model invocation or approval. Session context must be supplied explicitly by the invoking client.

(repo: &Repository, args: &IncrementalArgs)

Source from the content-addressed store, hash-verified

421/// Resolve without mutation, network requests, model invocation or approval.
422/// Session context must be supplied explicitly by the invoking client.
423pub fn resolve(repo: &Repository, args: &IncrementalArgs) -> CliResult<IncrementalReport> {
424 let selected = [&args.turn, &args.intent, &args.change, &args.view]
425 .iter()
426 .filter(|value| value.is_some())
427 .count()
428 + usize::from(args.from.is_some() || args.to.is_some());
429 if selected > 1 {
430 return Err(invalid("review selectors are mutually exclusive"));
431 }
432 if args.from.is_some() != args.to.is_some() {
433 return Err(invalid("--from and --to must be supplied together"));
434 }
435 if args
436 .findings
437 .as_ref()
438 .is_some_and(|bytes| bytes.len() > 1024 * 1024)
439 {
440 return Err(invalid("review findings input exceeds 1 MiB"));
441 }
442 if args
443 .risk_profile
444 .as_ref()
445 .is_some_and(|bytes| bytes.len() > 64 * 1024)
446 {
447 return Err(invalid("risk profile exceeds 64 KiB"));
448 }
449 if args.from.is_some() || args.to.is_some() {
450 return super::view_comparison::resolve(repo, args);
451 }
452 if args.view.is_some() {
453 return super::view_snapshot::resolve(repo, args);
454 }
455 resolve_with_session(repo, args, args.session_id.as_deref())
456}
457
458fn resolve_with_session(
459 repo: &Repository,

Callers 6

prepareFunction · 0.70
renderFunction · 0.70
resolve_with_sessionFunction · 0.70
generate_reviewMethod · 0.50
packageRuntimeFunction · 0.50

Calls 6

resolve_with_sessionFunction · 0.85
as_refMethod · 0.80
invalidFunction · 0.70
countMethod · 0.45
iterMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected