Skip to content

[2901 by Claude Opus 5.5] Project creator attribution onto goals, plans, automations and to-dos - #2934

Merged
propr-dev[bot] merged 2 commits into
2888-epic-task-assignment-1m4from
2901/claude-opus-5-5-project-creator-attributi-20261009-1406-dlv
Oct 9, 2026
Merged

propr-dev[bot] merged 2 commits into
2888-epic-task-assignment-1m4from
2901/claude-opus-5-5-project-creator-attributi-20261009-1406-dlv

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #2901

Branch: 2901/claude-opus-5-5-project-creator-attributi-20261009-1406-dlv
Commits: ✅ Changes committed (2b9472a)


AI Processing Completed

Execution Details:

Summary:
The wider test run is still going in the background (55 test files that touch goals, planner, automations, to-dos and auth). I'll report once it finishes. So far:

  • Type check passes for core and api.
  • Lint is clean on every file I touched.
  • gen:openapi:check and check:client-contract both pass. None of these four responses has a documented OpenAPI schema, so there was nothing to regenerate.
  • The new creatorProjection.test.ts passes all 13 tests.
  • The existing tests for automations, goal projection, demo mode and the planner pass (73 tests).

There are no preview images because this change only touches the API; showing the creator in the UI is the next task.

Detailed Logs:

  • Conversation: 128 messages
  • Session: ec080467-0ca1-4b31-b1c8-0ef93b78b9a4

Log files stored at:

  • conversation: /tmp/claude-logs/issue-2901-2026-10-09T14-16-10-419Z-conversation.json
  • output: /tmp/claude-logs/issue-2901-2026-10-09T14-16-10-419Z-output.txt
Latest Conversation Messages
ASSISTANT: [content unavailable]

ASSISTANT: The wider test run is still going in the background (55 test files that touch goals, planner, automations, to-dos and auth). I'll report once it finishes. So far:

- **Type check** passes for `core` a...


This PR was created automatically by ProPR after processing issue #2901.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!

…at touch goals, planner, automations, to-dos and auth). I'll report once it finishes. So far:

- Type check passes for `core` and `api`.
- Lint is clean on every file I touched.
- `gen:openapi:check` and `check:client-contract` both pass. None of these four responses has a documented OpenAPI schema, so there was nothing to regenerate.
- The new `creatorProjection.test.ts` passes all 13 tests.
- The existing tests for automations, goal projection, demo mode and the planner pass (73 tests).

There are no preview images because this change only touches the API; showing the creator in the UI is the next task.
@propr-dev

propr-dev Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

/ultrafix
Triggered automatically by the requested execution settings.

@propr-dev propr-dev Bot added the ultrafix label Oct 9, 2026
@propr-dev

propr-dev Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 10)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

⏳ Ultrafix is waiting for CI before the next /review.

These blocking checks on 2b9472a are holding the loop back:

  • Classify changed surfaces — not finished
  • Classify changed surfaces — not finished
  • Select PR check runners — not finished
  • Select PR check runners — not finished
  • Select PR check runners — not finished
  • Classify changed surfaces — not finished
  • Classify changed surfaces — not finished
  • Classify changed surfaces — not finished

Checks matching this repository's non-blocking checks never gate Ultrafix. The loop continues automatically once the blocking checks pass; if they have not settled within 2 hours, Ultrafix stops.

@propr-dev

propr-dev Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

This PR adds cached creator attribution to goals, plans, automations, and to-dos. The approach is focused, but one incorrect-attribution path needs correction before merge.

✅ Batched profile lookup — List projections resolve creators together, with tests asserting one profile query for representative pages.

✅ Graceful cache fallback — Cache reads and writes handle storage failures; goals preserve attribution through their stored owner login.

The supplied current-head checks show 20 passed and no failures or pending checks. This review used static analysis only; no commands were run.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F1: 🔴 To-do updates can attribute another owner's records to the caller

  • Required behavior: Creator attribution must identify the record’s creator, rather than the user requesting an update.

  • Evidence: packages/api/routes/repoTodoRoutes.ts:withCreator, updateCategoryHandler, and updateTodoHandler.

    1. User B requests an update using an existing category or to-do ID belonging to user A.
    2. The core update filters the write by B’s user ID, so no row changes. However, its subsequent read filters only by the record ID and returns A’s record.
    3. The changed route passes that returned object and B’s ID to withCreator.
    4. The successful response now identifies B as the creator of A’s record when B has a cached profile; otherwise, it incorrectly reports an unknown creator.

    The existing ownership predicate protects the write but not the returned record. The route’s null check therefore does not prevent this sequence. The new tests check foreign-owner detail reads, but not foreign-owner updates.

    static trace: Verified against both changed update handlers and the supplied repoTodosService.ts implementations at lines 50–59 and 138–150. The underlying cross-owner response is pre-existing; assigning that response the caller’s creator identity is newly introduced.

  • Minimum fix: Scope both core update readbacks by record ID and user ID, returning null for foreign records so the existing route returns 404. Cover both category and to-do update responses with regression tests.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Consistent planner mutation responses

Planner list and detail responses now include created_by, but creation and other draft-returning mutations still omit it. Consider sharing an attributed draft projection so future consumers can retain attribution when replacing local state with mutation responses. This is optional because the supplied scope does not establish that every planner mutation must return attribution, and the UI work is deferred.

Score

The implementation has useful batching and focused coverage, and current checks pass. A localized correction is required to prevent false creator attribution in two update paths.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 22s
  • Tokens: 58,479 (57,703 in / 776 out)
  • Cost: $0.51

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F1 S1

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit b4e98fb

Addressed 1 AI review comment (IDs: 6083063045)

Addressed finding F1

Summary of Changes

I fixed F1: when someone tries to update another user's to-do or category, the API now returns 404 instead of sending back that record with the caller named as its creator.

Cause: both updateCategory and updateTodo in packages/core/src/services/repoTodosService.ts only changed rows owned by the caller. But they then re-read the record by ID alone, so they returned the other user's record. The route then labelled it with the caller as creator.

Fix: both re-reads now also filter on the caller's user ID. A record belonging to someone else comes back as null, and the route's existing check turns that into a 404. Updating your own records works as before.

Other callers: the only other code that uses these two functions is in the CLI, and it goes through the HTTP API, so there was nothing else to change.

Regression test: I added a test to packages/api/test/creatorProjection.test.ts. A user whose profile is cached tries to update another owner's to-do and category: both requests get 404 and no creator. Then the owner updates both, and the responses show the new values with the owner as creator.

Verification: with the fix, all 14 tests in creatorProjection.test.ts pass after rebuilding @propr/core. With the old service code, the new test fails and the other 13 still pass.

ESLint skipped both changed files ("no matching configuration" when run from the repo root), so they weren't actually linted. I didn't run the type check or the wider test suite.

No previews, since this change only affects the API.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 3m 33s
  • Tokens: 419,996 (416,297 in / 3,699 out)
  • Cost: $0.33
  • Subscription usage: Session +1%, Weekly +1%

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…do or category, the API now returns 404 instead of sending back that record with the caller named as its creator.

I fixed F1: when someone tries to update another user's to-do or category, the API now returns 404 instead of sending back that record with the caller named as its creator.

**Cause:** both `updateCategory` and `updateTodo` in `packages/core/src/services/repoTodosService.ts` only changed rows owned by the caller. But they then re-read the record by ID alone, so they returned the other user's record. The route then labelled it with the caller as creator.

**Fix:** both re-reads now also filter on the caller's user ID. A record belonging to someone else comes back as null, and the route's existing check turns that into a 404. Updating your own records works as before.

**Other callers:** the only other code that uses these two functions is in the CLI, and it goes through the HTTP API, so there was nothing else to change.

**Regression test:** I added a test to `packages/api/test/creatorProjection.test.ts`. A user whose profile is cached tries to update another owner's to-do and category: both requests get 404 and no creator. Then the owner updates both, and the responses show the new values with the owner as creator.

**Verification:** with the fix, all 14 tests in `creatorProjection.test.ts` pass after rebuilding `@propr/core`. With the old service code, the new test fails and the other 13 still pass.

ESLint skipped both changed files ("no matching configuration" when run from the repo root), so they weren't actually linted. I didn't run the type check or the wider test suite.

No previews, since this change only affects the API.

PR: #2934
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

⏳ Ultrafix is waiting for CI before the next /review.

These blocking checks on b4e98fb are holding the loop back:

  • Windows Connect Discovery (ordinary user, Node 22) — not finished
  • Connect Discovery and Darwin ACL (Node 22) — not finished
  • Validate Changes — not finished
  • Full Test Suite Shard 2/4 — not finished
  • Full Test Suite Shard 4/4 — not finished
  • Full Test Suite Shard 1/4 — not finished
  • Full Test Suite Shard 3/4 — not finished

Checks matching this repository's non-blocking checks never gate Ultrafix. The loop continues automatically once the blocking checks pass; if they have not settled within 2 hours, Ultrafix stops.

@propr-dev

propr-dev Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

Ready to merge within the API attribution scope. The implementation consistently resolves creators from stored ownership and reuses the existing profile cache.

✅ Batched attribution — List handlers load creator profiles together, with tests checking one profile query for representative pages.

✅ Owner isolation — To-do and category updates now scope both the update and subsequent read to the caller, preventing foreign records from being returned.

✅ Graceful cache fallback — Cache reads and writes tolerate database errors; missing profiles produce null attribution, while goals retain their stored-login fallback.

This review used static tracing of the supplied code; no commands or tests were run. The authoritative checks report 20 passed, none failed, and none pending.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S2: 🟢 Test mixed-owner demo attribution

Add a demo-mode test with two numeric owner IDs and distinct cached profiles. Existing demo tests verify cross-owner visibility and ordering, but their nonnumeric IDs do not exercise successful creator resolution. This would strengthen coverage that attribution follows each record’s owner; the implementation already does so.

S3: 🟢 Align planner mutation responses

Consider including created_by in planner create, update, and reset responses. List and detail responses now include it, while these mutation responses do not. Consistency would simplify future UI integration, but no supplied consumer demonstrates a current failure, so this is optional.

Score

The change is focused, preserves ownership boundaries, and includes meaningful attribution and query-count coverage. All current required checks are passing, and no merge blocker was verified.

Score: 9/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 10s
  • Tokens: 57,324 (56,856 in / 468 out)
  • Cost: $0.48

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S2 S3

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Oct 9, 2026
@propr-dev
propr-dev Bot merged commit 0fecd57 into 2888-epic-task-assignment-1m4 Oct 9, 2026
42 checks passed
@propr-dev
propr-dev Bot deleted the 2901/claude-opus-5-5-project-creator-attributi-20261009-1406-dlv branch October 9, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants