ebe79ebed0
Run detail gains a Findings tab (open-count badge) listing the server's findings ledger with status and minimum-severity filters and expandable event history; visit grants show as an Extra visits summary fact. The resume retry prompt can grant 1-5 extra visits to the exhausted stage or a chosen graph stage (never sent on restart), suggested when the run failed on a visit limit. A loop-exhaustion decision waiting on a model stage is now decidable from its recorded options, with readable labels, targets and the visit count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
40 lines
1.7 KiB
Dart
40 lines
1.7 KiB
Dart
import 'package:flutter/widgets.dart';
|
|
|
|
import '../domain/run_decisions.dart';
|
|
|
|
/// The browser client's decision wording, kept verbatim.
|
|
const decisionWaitingTitle = 'Waiting for your decision';
|
|
const decisionActionLabel = 'Decide';
|
|
const decisionFeedbackLabel = 'Feedback (optional)';
|
|
const decisionCancelLabel = 'Cancel';
|
|
const decisionConfirmLabel = 'Confirm decision';
|
|
const decisionSendingLabel = 'Sending…';
|
|
|
|
/// Stable test/semantics keys shared by the action and its prompt.
|
|
const decisionActionKey = ValueKey<String>('human-decision-action');
|
|
const decisionFeedbackKey = ValueKey<String>('human-decision-feedback');
|
|
const decisionErrorKey = ValueKey<String>('human-decision-error');
|
|
const decisionExhaustedKey = ValueKey<String>('human-decision-exhausted');
|
|
|
|
/// `{stage} · run {id} · {label}`, as the web decision card shows it.
|
|
String decisionMeta(PendingDecision decision) =>
|
|
'${decision.stageKey} · run ${decision.runId} · ${decision.runLabel}';
|
|
|
|
/// For a loop that exhausted its visits: `review used visit 3 of 3`, or the
|
|
/// part the server recorded; "" for a declared human decision.
|
|
String decisionExhaustedText(PendingDecision decision) {
|
|
final loop = decision.exhausted;
|
|
if (loop == null) return '';
|
|
final stage = loop.stage.isEmpty ? decision.stageKey : loop.stage;
|
|
final visit = loop.visit;
|
|
final max = loop.maxVisits;
|
|
if (visit == null) return '$stage reached its visit limit';
|
|
return max == null
|
|
? '$stage reached its visit limit at visit $visit'
|
|
: '$stage reached its visit limit: visit $visit of $max';
|
|
}
|
|
|
|
/// The option's target line, `→ {target}`, or "" when no target was declared.
|
|
String decisionTargetText(String target) =>
|
|
target.trim().isEmpty ? '' : '→ $target';
|