Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { localizedCapabilityFieldCopy } from "./capability-localization.ts";
import { taskSessionStatus } from "./goal-activity.ts";
import "./monitor-readback.test.mjs";

const source = (name) => readFileSync(new URL(name, import.meta.url), "utf8");
const source = (name) => readFileSync(new URL(name, import.meta.url), "utf8").replace(/\r\n/g, "\n");
const projectionAgent = { agentId: "status-only", adapterKind: "status_projection", available: true, label: "Status" };
const missingAgent = { agentId: "codex", available: false, label: "Codex" };
const availableAgent = { agentId: "claude", available: true, label: "Claude" };
Expand Down Expand Up @@ -118,7 +118,8 @@ assert.doesNotMatch(page.match(/function operationProposalFields[\s\S]*?\n\}/)?.
assert.match(page, /t\("proposal\.primary\.operationGroup"\)/, "Operation confirmation routes users to the bound group");
assert.match(chatData, /result_delivery:/, "Dashboard retains operation result-delivery readback");
assert.match(chatData, /return_delivery\??:/, "Chat messages retain manager return-delivery readback");
assert.match(dashboard, /reconcileConversationReturns\(/, "Manager return polling uses the shared conversation-return read model");
assert.match(dashboard, /readConversationReturns\(/, "Manager return polling uses the shared conversation-return observation");
assert.match(dashboard, /reconcileConversationHistory\(/, "Manager return polling reconciles the shared conversation history");
assert.match(conversationReturns, /source\.return_delivery \?\? row\.returnDelivery/, "Manager return polling refreshes delivery state after the message arrives");
assert.match(timeline + page, /ReturnDeliveryStatus/, "Both manager conversation surfaces render return delivery state");
for (const state of ["delivered", "verification_required", "explicit_unverified"]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
.goal-report-reviews :is([data-result-catalog], [data-result-reader]):focus { outline: 2px solid var(--pw-blue-ink); outline-offset: 4px; }
.report-review-tools, .report-review-tools > button, .goal-report-reviews .result-catalog-return { display: inline-flex; align-items: center; gap: 8px; }
.report-review-reader { min-width: 0; margin-top: 8px; }
.report-review-masthead { padding: 8px 0; border-bottom: 1px solid var(--pw-border); }
.report-review-masthead { padding: 8px 0; border-bottom: 1px solid var(--pw-line); }
.report-review-masthead h2 { margin: 8px 0; font-size: var(--text-title); line-height: var(--leading-title); overflow-wrap: anywhere; }
.report-review-masthead time, .report-review-masthead span { font-size: var(--text-caption); line-height: var(--leading-caption); color: var(--pw-muted); }
.report-review-actions { display: flex; flex-wrap: wrap; align-items: start; gap: 8px; padding: 8px 0 16px; }
.report-review-actions .personal-decision-bar { flex: 1; }
.report-review-actions .personal-compact-menu { flex: 0 0 auto; }
.report-review-reader iframe { display: block; width: 100%; height: min(1000px, 80vh); min-height: 560px; border: 1px solid var(--pw-border); border-radius: 6px; background: var(--pw-surface); }
.report-review-reader iframe { display: block; width: 100%; height: min(1000px, 80vh); min-height: 560px; border: 1px solid var(--pw-line); border-radius: 6px; background: var(--pw-card); }
.report-review-prose { font-size: var(--text-lead); line-height: var(--leading-prose); }
.report-review-reader > details { padding: 16px 0; overflow-wrap: anywhere; }
@media (max-width: 640px) { .report-review-masthead > div { flex-wrap: wrap; } .report-review-reader iframe { min-height: 640px; } .report-review-actions .personal-decision-bar { flex-basis: 100%; } }
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions loopx/canary/module_metric_baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@
"dict_any_count": 0
},
"loopx/control_plane/goals/goal_frontier/terminal.py": {
"any_count": 22,
"any_count": 15,
"dict_any_count": 0
},
"loopx/control_plane/work_items/interaction_contract.py": {
"any_count": 107,
"any_count": 85,
"dict_any_count": 0
},
"loopx/extensions/lark/goal_topic_runtime.py": {
Expand All @@ -93,7 +93,7 @@
"dict_any_count": 0
},
"loopx/pr_review.py": {
"any_count": 50,
"any_count": 49,
"dict_any_count": 0
},
"loopx/presentation/renderers/status_markdown.py": {
Expand All @@ -106,7 +106,7 @@
"lines": 1999
},
"loopx/slash_command_install.py": {
"any_count": 12,
"any_count": 11,
"dict_any_count": 0
},
"loopx/state_refresh.py": {
Expand Down
22 changes: 11 additions & 11 deletions loopx/control_plane/goals/goal_frontier/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def _terminal_todo_source_state(
done = summary.get("done_count")
deferred = summary.get("deferred_count")
watch_only = summary.get("watch_only_monitor_count", 0)
monitor_open_items = summary.get("monitor_open_items")
if not (
type(total) is int
and total >= 0
Expand All @@ -42,8 +43,8 @@ def _terminal_todo_source_state(
and done + watch_only == total
and _strict_zero(summary.get("convergence_open_count", summary.get("open_count")))
and _strict_zero(deferred)
and isinstance(summary.get("monitor_open_items"), list)
and len(cast(list[Any], summary.get("monitor_open_items"))) == watch_only
and isinstance(monitor_open_items, list)
and len(monitor_open_items) == watch_only
):
return "invalid", False
intent = summary.get("closure_intent")
Expand All @@ -67,14 +68,14 @@ def _projection_has_empty_terminal_frontier(projection: dict[str, Any] | None) -
frontier = projection.get("remaining_advancement_frontier")
monitors = projection.get("monitor_only_lanes")
successors = projection.get("deferred_successors")
if not all(isinstance(value, dict) for value in (normalized, frontier, monitors, successors)):
if not (
isinstance(normalized, dict)
and isinstance(frontier, dict)
and isinstance(monitors, dict)
and isinstance(successors, dict)
):
return False

normalized = cast(dict[str, Any], normalized)
frontier = cast(dict[str, Any], frontier)
monitors = cast(dict[str, Any], monitors)
successors = cast(dict[str, Any], successors)

required_keys = (
(normalized, {"user_open_count", "agent_open_count", "agent_advancement_open_count", "agent_monitor_open_count", "agent_monitor_due_count"}),
(frontier, {"current_agent_claimed_advancement_count", "unclaimed_advancement_count", "other_agent_claimed_advancement_count"}),
Expand Down Expand Up @@ -114,7 +115,7 @@ def _terminal_todo_source_contract(
) -> tuple[dict[str, Any], bool]:
user_status, user_intent = _terminal_todo_source_state(user_todo_summary, role="user")
agent_status, agent_intent = _terminal_todo_source_state(agent_todo_summary, role="agent")
source_completeness: dict[str, Any] = {
source_completeness: dict[str, object] = {
"schema_version": GOAL_TERMINAL_SOURCE_COMPLETENESS_SCHEMA_VERSION,
"user_todos": user_status,
"agent_todos": agent_status,
Expand Down Expand Up @@ -180,9 +181,8 @@ def _terminal_no_followup_resolves_vision_checkpoint(


def goal_frontier_is_terminal_no_followup(*, projection: dict[str, Any] | None) -> bool:
if not _projection_has_empty_terminal_frontier(projection):
if projection is None or not _projection_has_empty_terminal_frontier(projection):
return False
projection = cast(dict[str, Any], projection)
terminal_state = projection.get("terminal_state")
completeness = projection.get("source_completeness")
return bool(
Expand Down
Loading
Loading