Skip to content

feat(todo): Notes/Todo split — final integration pass (C5)#2033

Open
hognek wants to merge 8 commits into
jaylfc:devfrom
hognek:feat/1923-c5-integration
Open

feat(todo): Notes/Todo split — final integration pass (C5)#2033
hognek wants to merge 8 commits into
jaylfc:devfrom
hognek:feat/1923-c5-integration

Conversation

@hognek

@hognek hognek commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Closes #1923.

What this does

Completes the Notes/Todo split with the final integration pass:

  • TodoApp — Dedicated checklist component with create/complete/reorder/due-date/per-item persistence
  • TodoStore — SQLite store (tinyagentos/todo/) with list+item tables and ownership checks
  • /api/todo routes — Full REST API (CRUD lists, CRUD items, reorder) with CSRF protection
  • NotesApp — Cleaned to notes-only (todos live in TodoApp), shares the SharedDocsStore
  • App registry — Both notes (launchpadOrder 16.8) and todo (16.85) registered

C5 checklist

  • Both apps register in app-registry.ts
  • Todo tests — create, complete, reorder, persistence (9 vitest + 18 pytest)
  • Notes tests — create, edit, persistence, share (9 vitest + 27 pytest)
  • No kind branching remains in shared code
  • Desktop build (tsc + vite) passes clean
  • CSRF dependency on todo_router (was missing — fixed in C5)

Commits

  • ad96c709 feat(todo): TodoStore + /api/todo routes
  • b929f6f2 feat(todo): TodoApp component
  • a6260f01 fix(todo): Kilo review fixes
  • 4002cf77 fix(todo): reorder + validate
  • e26bade0 fix(todo): duplicate submissions, toggle serialization
  • 90141ac8 fix(todo): CSRF dependency on todo_router

Summary by CodeRabbit

  • New Features

    • Notes and Todo are now separate apps with dedicated interfaces.
    • Todo lists support creating lists, adding and editing tasks, completion tracking, deletion, due dates, and reordering.
    • Todo task reordering now validates the full list and preserves consistent ordering.
  • Bug Fixes

    • Opening the Todo app now loads the correct Todo interface.
    • Invalid task reorder requests return a clear error instead of being partially applied.
    • Todo requests now receive standard security protection.

@hognek
hognek marked this pull request as ready for review July 19, 2026 09:08
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@hognek, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 23 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 61c41682-fa85-4039-b055-a6e9b5f09f3e

📥 Commits

Reviewing files that changed from the base of the PR and between de07336 and 7c2daee.

📒 Files selected for processing (12)
  • desktop/src/apps/NotesApp.test.tsx
  • desktop/src/apps/NotesApp.tsx
  • desktop/src/apps/TodoApp.test.tsx
  • desktop/src/apps/TodoApp.tsx
  • desktop/src/apps/__tests__/NotesApp.test.tsx
  • desktop/src/registry/app-registry.ts
  • docs/design/notes-todo-split.md
  • tests/notes/test_notes_routes.py
  • tinyagentos/notes/shared_docs_store.py
  • tinyagentos/routes/notes.py
  • tinyagentos/routes/todo.py
  • tinyagentos/todo/todo_store.py
📝 Walkthrough

Walkthrough

Changes

The PR separates the Notes and Todo desktop experiences. Notes now supports notes only, while Todo has its own UI, tests, registry import, validated reorder persistence, and CSRF-protected routing. A design document describes the broader storage, API, migration, and collaboration split.

Notes and Todo separation

Layer / File(s) Summary
Split architecture design
docs/design/notes-todo-split.md
Defines separate Notes and Todo storage, APIs, frontend trees, migration phases, registry wiring, and collaboration responsibilities.
Notes-only application contract
desktop/src/apps/NotesApp.tsx, desktop/src/apps/NotesApp.test.tsx, desktop/src/apps/__tests__/NotesApp.test.tsx, tinyagentos/notes/shared_docs_store.py, tinyagentos/routes/notes.py
Narrows NotesApp to note documents, removes Todo configuration and exports, updates sharing accessibility text, and removes mixed Notes/Todo tests and documentation.
Dedicated Todo application
desktop/src/apps/TodoApp.tsx, desktop/src/registry/app-registry.ts
Adds list and task views with creation, editing, deletion, completion, due dates, optimistic updates, and reordering, then loads TodoApp through the Todo registry entry.
Todo interaction coverage
desktop/src/apps/TodoApp.test.tsx
Tests Todo list rendering and creation, task display and mutations, due dates, reordering, and inline editing with mocked API responses.
Validated Todo reordering
tinyagentos/todo/todo_store.py, tinyagentos/routes/todo.py, tinyagentos/routes/__init__.py
Validates complete contiguous reorder payloads, applies updates transactionally with rollback handling, returns invalid payloads as HTTP 400 responses, and adds CSRF dependencies to the Todo router.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant TodoApp
  participant TodoDetailPane
  participant TodoAPI
  participant TodoStore
  User->>TodoApp: select list or create list
  TodoApp->>TodoAPI: request lists
  TodoAPI-->>TodoApp: return lists
  TodoApp->>TodoDetailPane: open selected list
  TodoDetailPane->>TodoAPI: request or mutate items
  TodoAPI->>TodoStore: validate and persist changes
  TodoStore-->>TodoAPI: return updated state
  TodoAPI-->>TodoDetailPane: return item response
  TodoDetailPane-->>User: render updated tasks
Loading

Possibly related PRs

  • jaylfc/taOS#1946: Covers the same Notes/Todo frontend split, dedicated TodoApp, tests, and registry import.
  • jaylfc/taOS#1944: Covers the TodoStore reorder validation and Todo route behavior.
  • jaylfc/taOS#1935: Adds the same Notes/Todo split design document.

Suggested reviewers: jaylfc

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The split is implemented, but the PR only documents migration; it doesn't show actual migration of existing kind=list docs into the Todo model required by #1923. Add code to migrate existing kind=list docs into the Todo store/model, or include the migration path in the backend changes.
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the Notes/Todo split and final integration pass, and it's concise.
Out of Scope Changes check ✅ Passed The changes stay focused on separating Notes and Todo, plus supporting tests, routing, and docs for that split.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gitar-bot

gitar-bot Bot commented Jul 19, 2026

Copy link
Copy Markdown

Gitar is working

Gitar

await self._db.execute("DELETE FROM todo_items WHERE id = ?", (item_id,))
await self._db.commit()

async def reorder_items(self, list_id: str, items: list[dict]) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: reorder_items applies each UPDATE in a separate statement with no transaction and no validation.

The design doc for #1923 explicitly promises that "partial or invalid payloads (missing items, duplicate positions, unknown ids) are rejected with 400 Bad Request and make no changes." Here a payload that omits items, duplicates positions, or contains unknown ids is applied silently (and non-atomically — an error mid-loop leaves the list partially reordered). Consider wrapping the loop in a single transaction (BEGIN/COMMIT) and validating that every item id belongs to list_id and that the position set is complete and unique before applying.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

if err:
return err

items = [{"id": e.id, "position": e.position} for e in body.items]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: The reorder payload is forwarded straight to the store without verifying it represents the full, current item set.

If the client sends a partial/buggy list (or an attacker omits items from another list that happen to exist), items can be left with stale position values and the AND list_id = ? guard only makes cross-list ids a silent no-op. It would be safer to cross-check body.items against the list's actual items (all ids present, exactly once, contiguous positions) and return 400 otherwise — matching the contract described in the design doc.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Comment thread desktop/src/apps/TodoApp.tsx Outdated
if (!newText.trim() || !doc || adding) return;
setAdding(true);
try {
const r = await fetch(`/api/todo/${doc.id}/items`, {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: The mutating requests in this file (POST/PUT/PATCH/DELETE to /api/todo) use raw fetch instead of the withCsrf helper (desktop/src/lib/csrf.ts) or taos-fetch wrapper.

Per taos-fetch.ts, new code is expected to use withCsrf from day one (it attaches the X-CSRF-Token header and reports backend version). This mirrors the existing NotesApp.tsx pattern, so it is not a new regression, but for truly new code it is cleaner and more robust to route mutations through withCsrf/createTaosFetch so you don't have to hand-maintain the CSRF header and you get version-change detection for free.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Jul 19, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No New Issues Found | Recommendation: Merge

All previously flagged findings have been verified resolved in the current HEAD (7c2daee7). The incremental changes since the last review (commits 8491017d, 7c2daee7) addressed every outstanding item, and a full re-review of the changed production code surfaced no new issues.

Resolved (from prior review)

File Line Previous Resolution
tinyagentos/todo/todo_store.py 242 WARNING: reorder applied non-atomically, no validation Fixed — reorder_items now validates full item set + unique/contiguous positions and wraps writes in an explicit BEGIN/COMMIT with ROLLBACK on error (lines 242-286)
tinyagentos/routes/todo.py 310 SUGGESTION: reorder payload forwarded without verification Fixed — store-layer validation rejects partial/duplicate/unknown payloads with 400
desktop/src/apps/TodoApp.tsx N/A SUGGESTION: raw fetch instead of withCsrf Fixed — all mutating requests (add/delete/edit/toggle/reorder/create list) route through withCsrf; GETs use raw fetch (acceptable)
desktop/src/apps/TodoApp.tsx 323 SUGGESTION: stale error banner never clears Fixed — setError(null) added to all success paths (lines 315, 346, 363, 421, 477)
tinyagentos/routes/notes.py 9 SUGGESTION: kind still exposed on notes API Fixed — CreateDocIn no longer carries kind; create_doc hardcodes "note" (line 132)
tests/test_routes_github.py 360 WARNING: mock_config lacked github_app_private_key, making App-token tests vacuous Fixed — private key now sourced from SecretsStore (github-app-private-key"fake-private-key", lines 351-352); config no longer carries the key after #2009, so the App-token path is genuinely exercised

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 0
Files Reviewed (this pass)
  • tinyagentos/todo/todo_store.py
  • tinyagentos/routes/todo.py
  • tinyagentos/routes/notes.py
  • tinyagentos/todo/migration.py
  • tinyagentos/notes/shared_docs_store.py
  • tests/test_routes_github.py
  • desktop/src/apps/TodoApp.tsx
  • desktop/src/apps/NotesApp.tsx
  • desktop/src/registry/app-registry.ts
  • tests/notes/test_notes_routes.py
  • desktop/src/apps/TodoApp.test.tsx
  • desktop/src/apps/NotesApp.test.tsx
  • desktop/src/apps/__tests__/NotesApp.test.tsx
  • docs/design/notes-todo-split.md
Previous Review Summaries (6 snapshots, latest commit 590f5bf)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 590f5bf)

Status: No New Issues Found | Recommendation: Merge

All previously flagged findings have been resolved in the current HEAD (590f5bf2). Incremental changes since the last review were verified against current code.

Resolved (from prior review)

File Line Previous Resolution
tinyagentos/todo/todo_store.py 235 WARNING: reorder applied non-atomically, no validation Fixed — reorder_items now validates full item set + unique/contiguous positions and wraps writes in an explicit transaction with rollback
tinyagentos/routes/todo.py 293 SUGGESTION: reorder payload forwarded without verification Fixed — store-layer validation rejects partial/duplicate/unknown payloads with 400
desktop/src/apps/TodoApp.tsx N/A SUGGESTION: raw fetch instead of withCsrf Fixed — all mutating requests now use withCsrf
desktop/src/apps/TodoApp.tsx 323 SUGGESTION: stale error banner never clears Fixed — setError(null) added to all success paths
tinyagentos/routes/notes.py 9 SUGGESTION: kind still exposed on notes API Fixed — CreateDocIn no longer carries kind; create_doc hardcodes note kind
tests/test_routes_github.py 359 WARNING: mock_config lacked github_app_private_key, making App-token tests vacuous Fixed — mock_config.github_app_private_key = "fake-private-key" set (line 360) and SecretsStore returns the key

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 0
Files Reviewed (this pass)
  • tinyagentos/routes/todo.py
  • tinyagentos/todo/todo_store.py
  • tinyagentos/routes/notes.py
  • tinyagentos/notes/shared_docs_store.py
  • tests/test_routes_github.py
  • desktop/src/apps/TodoApp.tsx
  • desktop/src/registry/app-registry.ts
  • tests/notes/test_notes_routes.py

Previous review (commit 27d90f5)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
tests/test_routes_github.py 359 mock_config sets github_app_id but not github_app_private_key. _get_app_installation_token (github.py:91) requires both to be truthy before calling get_installation_token. Without github_app_private_key, the App-token path short-circuits, so test_repo_endpoint_still_uses_app_token returns 401 (fails), and the three assert_not_called() tests are vacuous. Fix: set mock_config.github_app_private_key = "fake-private-key".
Files Reviewed (1 file)
  • tests/test_routes_github.py - 1 issue (incremental only)

Fix these issues in Kilo Cloud

Previous review (commit 1432fc7)

Status: No Issues Found | Recommendation: Merge

Incremental review since de07336ea4f0bc33fa1f4eb4a3842bfcb8d0c7b2 (3 files, 18 lines changed). All previously reported findings remain resolved; the new changes introduce no issues.

Incremental changes verified

  • desktop/src/apps/TodoApp.tsx — Added setError(null) after successful load/add/delete/toggle/reorder. This correctly clears stale error banners on success; failure paths still set the error. No logic regressions.
  • tinyagentos/routes/notes.py — Removed the kind request field from CreateDocIn and hardcodes "note" in create_doc. NotesApp is now notes-only, and create_doc validates kind in DOC_KINDS, so "note" is valid. Safe.
  • tests/notes/test_notes_routes.py — Deleted the obsolete test_invalid_kind_returns_400 test, consistent with the removal of kind validation at the API layer.
Files Reviewed (3 incremental files)
  • desktop/src/apps/TodoApp.tsx
  • tinyagentos/routes/notes.py
  • tests/notes/test_notes_routes.py

Previous review (commit de07336)

Status: No Issues Found | Recommendation: Merge

All three prior findings are resolved by the incremental commits since bbb497652:

  • tinyagentos/todo/todo_store.py:219 (WARNING: non-atomic reorder) — resolved: reorder_items now runs inside a BEGIN/COMMIT transaction with ROLLBACK on error, and validates payload completeness (ownership), unique positions, and contiguous positions (0..n-1) before any write.
  • tinyagentos/routes/todo.py:277 (SUGGESTION: unvalidated reorder payload) — resolved at the store layer: partial, duplicate-position, non-contiguous, or cross-list payloads now raise ValueError before writes, and the route catches it and returns 400.
  • desktop/src/apps/TodoApp.tsx (SUGGESTION: raw fetch bypassing CSRF) — already fixed in an earlier commit (all mutating calls use withCsrf), confirmed unchanged in this incremental diff.

The incremental diff (2 files, 10 lines) introduces no new issues.

Files Reviewed (2 incremental files)
  • tinyagentos/routes/todo.py
  • tinyagentos/todo/todo_store.py

Previous review (commit bbb4976)

Status: No Issues Found | Recommendation: Merge

All three prior findings from the previous review are resolved by commits added since 61e6b289:

  • tinyagentos/todo/todo_store.py (WARNING: non-atomic reorder) — fixed: reorder_items now runs inside a BEGIN/COMMIT transaction with ROLLBACK on error, and validates that the payload contains exactly every item in the list (ownership + completeness) and that positions are unique before any write.
  • tinyagentos/routes/todo.py (SUGGESTION: unvalidated reorder payload) — mitigated at the store layer: partial, duplicate-position, or cross-list payloads now raise ValueError before writes, so the silent no-op / stale-position risk is closed.
  • desktop/src/apps/TodoApp.tsx (SUGGESTION: raw fetch bypassing CSRF) — fixed: all mutating calls now use withCsrf(...).

No new issues introduced in the incremental diff.

Files Reviewed (11 files)
  • desktop/src/apps/NotesApp.test.tsx
  • desktop/src/apps/NotesApp.tsx
  • desktop/src/apps/TodoApp.test.tsx
  • desktop/src/apps/TodoApp.tsx
  • desktop/src/apps/__tests__/NotesApp.test.tsx
  • desktop/src/registry/app-registry.ts
  • docs/design/notes-todo-split.md
  • tinyagentos/notes/shared_docs_store.py
  • tinyagentos/routes/__init__.py
  • tinyagentos/routes/todo.py
  • tinyagentos/todo/todo_store.py

Previous review (commit 61e6b28)

Status: 3 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 2
Issue Details (click to expand)

CRITICAL

File Line Issue
None

WARNING

File Line Issue
tinyagentos/todo/todo_store.py 219 reorder_items applies per-item UPDATEs with no transaction and no validation; partial/invalid payloads are silently applied (design promised 400 + atomicity)

SUGGESTION

File Line Issue
tinyagentos/routes/todo.py 268 Reorder payload forwarded without verifying it represents the full/valid item set
desktop/src/apps/TodoApp.tsx 332 Mutating fetches bypass withCsrf/taos-fetch (mirrors NotesApp, but new code should adopt the helper)
Files Reviewed (13 files)
  • desktop/src/apps/NotesApp.test.tsx
  • desktop/src/apps/NotesApp.tsx
  • desktop/src/apps/TodoApp.test.tsx
  • desktop/src/apps/TodoApp.tsx
  • desktop/src/apps/__tests__/NotesApp.test.tsx
  • desktop/src/registry/app-registry.ts
  • docs/design/notes-todo-split.md
  • tests/todo/__init__.py
  • tests/todo/test_todo_routes.py
  • tinyagentos/app.py
  • tinyagentos/notes/shared_docs_store.py
  • tinyagentos/routes/__init__.py
  • tinyagentos/routes/todo.py
  • tinyagentos/todo/__init__.py
  • tinyagentos/todo/todo_store.py

Fix these issues in Kilo Cloud


Reviewed by hy3:free · Input: 94.7K · Output: 5.7K · Cached: 872.5K

@hognek
hognek force-pushed the feat/1923-c5-integration branch from 39ff419 to bbb4976 Compare July 19, 2026 09:53

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@desktop/src/apps/TodoApp.tsx`:
- Around line 303-320: Clear the stale error state in the successful path of
loadDoc after the latest request is confirmed current, and apply the same reset
to successful addItem, deleteItem, toggleDone, and moveItem mutation paths.
Preserve existing stale-request guards and failure messages while ensuring any
successful operation removes the error banner.

In `@tinyagentos/routes/notes.py`:
- Around line 1-9: Remove the kind field from CreateDocIn and stop passing
body.kind to store.create_doc in the notes route; ensure note creation uses only
the remaining request fields and no longer exposes kind through this API.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3f966cce-79ed-435f-b678-c75cbe61b535

📥 Commits

Reviewing files that changed from the base of the PR and between 91af53e and de07336.

📒 Files selected for processing (12)
  • desktop/src/apps/NotesApp.test.tsx
  • desktop/src/apps/NotesApp.tsx
  • desktop/src/apps/TodoApp.test.tsx
  • desktop/src/apps/TodoApp.tsx
  • desktop/src/apps/__tests__/NotesApp.test.tsx
  • desktop/src/registry/app-registry.ts
  • docs/design/notes-todo-split.md
  • tinyagentos/notes/shared_docs_store.py
  • tinyagentos/routes/__init__.py
  • tinyagentos/routes/notes.py
  • tinyagentos/routes/todo.py
  • tinyagentos/todo/todo_store.py

Comment thread desktop/src/apps/TodoApp.tsx
Comment thread tinyagentos/routes/notes.py
hognek added a commit to hognek/tinyagentos that referenced this pull request Jul 19, 2026
- TodoApp.tsx: clear error state on success in loadDoc, addItem, deleteItem,
  toggleDone, and moveItem so error banner doesn't persist after recovery
- notes.py: remove kind field from CreateDocIn model, hardcode note kind
  in create_doc since the notes API only creates note-type docs
- Remove obsolete test_invalid_kind_returns_400 (kind no longer API-visible)

CodeRabbit findings on PR jaylfc#2033

# App config
mock_config = MagicMock()
mock_config.github_app_id = "123456"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: mock_config sets github_app_id but not github_app_private_key.

tinyagentos/routes/github.py:91 requires BOTH cfg.github_app_id AND cfg.github_app_private_key to be truthy before _get_app_installation_token ever calls get_installation_token. With github_app_private_key unset, the App-token path short-circuits and returns None immediately — so get_installation_token is never reached.

Consequences for these new tests:

  • test_repo_endpoint_still_uses_app_token will FAIL: _get_token returns None (App path skipped, gh CLI raises FileNotFoundError), so /api/github/repo/bob/myrepo returns 401 instead of 200.
  • The three assert_not_called() tests (test_starred_uses_gh_cli..., test_notifications_use_gh_cli..., test_auth_status_false_when_only_app_token_available) pass trivially — they never actually exercise the App-token mint path, so they do not verify that user-scoped endpoints skip the App token. The central assertion is vacuous.

Fix: set mock_config.github_app_private_key = "fake-private-key" (the secrets key is already mocked for github-app-private-key), so the App-token path is genuinely reached. Then test_repo_endpoint_still_uses_app_token will exercise the patched get_installation_token, and the assert_not_called() tests will meaningfully assert the App token is skipped for user-scoped endpoints.

Suggested change
mock_config.github_app_id = "123456"
mock_config.github_app_id = "123456"
mock_config.github_app_private_key = "fake-private-key"

hognek added a commit to hognek/tinyagentos that referenced this pull request Jul 19, 2026
- TodoApp.tsx: clear error state on success in loadDoc, addItem, deleteItem,
  toggleDone, and moveItem so error banner doesn't persist after recovery
- notes.py: remove kind field from CreateDocIn model, hardcode note kind
  in create_doc since the notes API only creates note-type docs
- Remove obsolete test_invalid_kind_returns_400 (kind no longer API-visible)

CodeRabbit findings on PR jaylfc#2033
@hognek
hognek force-pushed the feat/1923-c5-integration branch from 27d90f5 to 590f5bf Compare July 19, 2026 22:03
hognek added 8 commits July 20, 2026 00:19
…r, due dates

- New TodoApp.tsx: checklist UI with checkboxes, optimistic toggle,
  move-up/down reorder buttons, due date display with overdue
  highlighting, inline add/edit, Pico CSS responsive layout
- Hits /api/todo endpoints (C1 backend) instead of shared /api/notes
- Splits incomplete/complete items into separate sections
- Move-up/down reorder sends PUT /api/todo/{id}/items/reorder
- Optimistic toggle for complete with revert on failure
- Defensive against missing items array in API responses

- Update app-registry: todo now lazy-loads from TodoApp.tsx directly
- Refactor NotesApp.tsx: remove TODO_CONFIG and TodoApp export,
  keep Notes-only config
- Update NotesApp tests: remove TodoApp import and Todo-specific tests
- Add TodoApp.test.tsx: 12 Vitest tests covering lists, items,
  toggle, delete, reorder, due dates, overdue, inline edit

Part of jaylfc#1923 (C2 — frontend split)
- Change error guard from (error || !doc) to (!doc) so transient
  action errors show inline banner instead of blanking the pane
- Reset creating=false on success in CreateTodoForm
- Move-up/down uses full-list positions correctly; items share
  a single position space regardless of visual section split
- Kilo WARNING: reorder items within their visible section (incomplete/complete)
  instead of the full list, fixing cross-boundary swap bug and incorrect
  move-up/move-down disabled checks
- Kilo SUGGESTION: validate doc.items as array before setDoc in loadDoc
  to guard against missing/non-array items from the API

Desktop tests: 12/12 pass. TypeScript: clean.
…ror handling

- Guard addItem/create against duplicate Enter submissions while request pending
- Serialize toggleDone PATCH per itemId to prevent overlapping completion updates
- Show load error instead of 'No lists yet' when list fetch fails
- Keep mobile back-navigation available during detail load errors
- Fix test: assert actual completed fixture (Already done, not Pick up laundry)
Remove the last 'note | list' union types from NotesApp, SharedDocsStore,
and notes routes. All docs are now 'note' only — todo lists live in their
own dedicated TodoStore at /api/todo.

- NotesApp.tsx: kind: 'note' (was 'note' | 'list')
- NotesApp.test.tsx: drop 'renders only notes, filtering out lists' test
- shared_docs_store.py: update docstring from 'notes and lists' to 'notes'
- routes/notes.py: update docstring, add cross-ref to /api/todo
- docs/design/notes-todo-split.md: add design document for jaylfc#1923
- Wrap all mutating fetch calls (POST/PATCH/DELETE/PUT) with withCsrf()
  so the X-CSRF-Token header is sent now that todo_router has CSRF
  protection
- Wrap reorder_items in a BEGIN/COMMIT transaction with rollback
- Validate reorder payload: all items must belong to target list,
  positions must be unique — rejects partial/invalid payloads with
  ValueError before any writes
Docs-Reviewed: Todo app already listed in README.md bundled apps section
- TodoApp.tsx: clear error state on success in loadDoc, addItem, deleteItem,
  toggleDone, and moveItem so error banner doesn't persist after recovery
- notes.py: remove kind field from CreateDocIn model, hardcode note kind
  in create_doc since the notes API only creates note-type docs
- Remove obsolete test_invalid_kind_returns_400 (kind no longer API-visible)

CodeRabbit findings on PR jaylfc#2033
@hognek
hognek force-pushed the feat/1923-c5-integration branch from 590f5bf to 7c2daee Compare July 19, 2026 22:20
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