Skip to content

fix(backend): refresh task intelligence desktop owner paths after #12607 - #12788

Merged
undivisible merged 1 commit into
mainfrom
fix/desktop-manual-stale-owner-paths
Sep 5, 2026
Merged

undivisible merged 1 commit into
mainfrom
fix/desktop-manual-stale-owner-paths

Conversation

@undivisible

@undivisible undivisible commented Sep 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Unblocks Backend unit suite red on main (test_task_intelligence_contract_freeze missing-owner-path).

Product invariants affected

  • INV-TASK-2

Test plan

  • BACKEND_UNIT_TEST_FILE_LIST=… bash test.sh for tests/unit/test_task_intelligence_contract_freeze.py — 29 passed locally

Failure-Class: none

Review in cubic


Note

Low Risk
Config-only changes to task intelligence ownership metadata; no runtime task or goal logic is modified.

Overview
Updates task_intelligence_sources_v1.json so the task-intelligence contract freeze matches the current desktop codebase after #12607.

For desktop_manual, it removes owner paths for deleted dashboard files (WhatMattersNowSection.swift, DashboardPage.swift) and drops discovered writer anchors on DesktopAutomationActivationActions.swift for client.createTask / client.deleteTask that no longer belong there.

For goal_manual_api, it adds DashboardViewModel.swift as an owner and registers its client.createGoal, deleteGoal, updateGoal, and updateGoalProgress writers so goal mutations from the dashboard stay covered by the manifest.

The rest of the diff is JSON formatting (multi-line writer_anchors / owner_paths); behavior of those entries is unchanged aside from the edits above. This unblocks test_task_intelligence_contract_freeze failures for missing owner paths and unowned writers on main.

Reviewed by Cursor Bugbot for commit 830bc7d. Configure here.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-05T12:19:09.343220Z 830bc7d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cursor

cursor Bot commented Sep 5, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_99d2de8c-c338-4656-8f25-4b6be613226a)



#12607 removed WhatMattersNowSection.swift and DashboardPage.swift; the
desktop_manual source still listed those owner paths and stale
createTask/deleteTask anchors on DesktopAutomationActivationActions.
Register DashboardViewModel goal writers under goal_manual_api so the
contract freeze matches the one-chat-shell layout.
@undivisible
undivisible force-pushed the fix/desktop-manual-stale-owner-paths branch from 830bc7d to e4f66fd Compare September 5, 2026 12:16
@undivisible
undivisible merged commit e02d56d into main Sep 5, 2026
38 checks passed
@undivisible
undivisible deleted the fix/desktop-manual-stale-owner-paths branch September 5, 2026 12:38
undivisible added a commit that referenced this pull request Sep 7, 2026
🎯 **What:** The vulnerability fixed was the use of `ast.literal_eval` to
parse `state_data_str` when retrieving OAuth state data from Redis.
⚠️ **Risk:** While safer than `eval()`, `ast.literal_eval` can still
cause a denial-of-service (crashing the process) if provided deeply
nested structures.
🛡️ **Solution:** Changed the serialization of `state_data` to use
`json.dumps` and deserialization to use `json.loads`. Also updated the
mocked `redis` payloads in tests to match the new `json.dumps` format.
In-flight pre-migration `str(dict)` payloads (single quotes, 10-minute
TTL) are still accepted by mapping them to JSON.

Failure-Class: none

**Rebase note (2026-09-07):** the branch was rebased onto current
`main`; the former head commit `99d2c4cbca` (desktop_manual config sync)
was dropped because it was fully superseded by #12788 (`e02d56da68`,
same intent + newer dashboard paths).

**Verification:** rebased-branch unit tests: `70 passed`
(`test_task_integrations_oauth_atomic`, `test_merge_validation`,
`test_batch_upload_storage`).

---
*PR created automatically by Jules for task
[5719183998940294315](https://jules.google.com/task/5719183998940294315)
started by @undivisible*

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches OAuth CSRF state parsing on the task-integrations callback
path; behavior change is mostly format-safe with a brittle legacy
fallback, so mis-parsed state could reject valid in-flight logins
briefly.
> 
> **Overview**
> Task integration OAuth CSRF state in Redis is now written with
**`json.dumps`** and read with **`json.loads`**, replacing
**`str(dict)`** plus **`ast.literal_eval`**. That removes a DoS class
from maliciously nested literal structures while keeping the existing
atomic **`GETDEL`** consume path.
> 
> **`validate_and_consume_oauth_state`** also rejects non-dict payloads
and, for a short migration window, still accepts legacy single-quote
**`str(dict)`** values by normalizing quotes before **`json.loads`** (no
**`ast`**).
> 
> Unit tests were updated: OAuth atomic tests use JSON fixtures;
merge/batch upload import stubs set **`PROJECTION_FAMILY_FIELDS`** on
the mocked **`models.client_processing`** module.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
f767a71. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

## Product invariants affected
- INV-TASK-2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant