Skip to content

ORB-85: Return user id from profile - #453

Open
thomasluizon wants to merge 3 commits into
mainfrom
feature/orb-85-profile-userid
Open

ORB-85: Return user id from profile#453
thomasluizon wants to merge 3 commits into
mainfrom
feature/orb-85-profile-userid

Conversation

@thomasluizon

@thomasluizon thomasluizon commented Aug 7, 2026

Copy link
Copy Markdown
Owner

DEGRADED: same-vendor review

Summary

  • Add userId as the first member of ProfileResponse.
  • Populate it from the authenticated user entity already loaded by GetProfileQueryHandler.
  • Preserve every existing profile field and the missing user failure path.
  • Prove legacy consumers ignore the additive JSON property.

Issue: ORB-85

Verification

  • dotnet build Orbit.slnx: 0 errors
  • dotnet test Orbit.slnx: 5,595 passed, 0 failed
  • Focused application profile tests: 16 passed
  • Focused MCP profile tool tests: 17 passed
  • Dash guard over all changed files: passed
  • Bare narration comment scan over all changed files: passed

Contract evidence

The handler test proves ProfileResponse.UserId equals the caller GUID and that its default string form is lowercase, hyphenated Guid D format. The serializer test confirms the web JSON property is userId and that a consumer model without that property still deserializes the unchanged name and email fields.

The generated OpenAPI document includes userId as a UUID string on ProfileResponse. This worker did not capture a tokenized live GET /api/profile body because the work order explicitly forbids starting or connecting to a development server.

No external CLI or HTTP response field is read by the implementation.

@thomasluizon

Copy link
Copy Markdown
Owner Author

I will add Guid UserId as the first positional member of ProfileResponse and populate it from the already loaded authenticated User.Id in GetProfileQueryHandler. The production change will stay in src/Orbit.Application/Profile/Queries/GetProfileQuery.cs, with the existing MCP test construction updated in tests/Orbit.Infrastructure.Tests/Mcp/ProfileToolsTests.cs.

I will add focused handler unit tests under tests/Orbit.Application.Tests that prove the returned id equals the query id, uses the lowercase hyphenated Guid D string form, preserves every existing response field, and leaves the user not found failure unchanged. I will also add a compatibility test showing a consumer model without userId can deserialize the new JSON response.

This shape reuses the profile query both clients already call and the user entity it already loads. It avoids a second database read, a new endpoint, auth response changes, JWT changes, and all client repository work reserved for ORB-77.

@sonarqubecloud

sonarqubecloud Bot commented Aug 7, 2026

Copy link
Copy Markdown

@thomasluizon
thomasluizon marked this pull request as ready for review August 7, 2026 02:05
@thomasluizon

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 2609e04c2e

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@thomasluizon

Copy link
Copy Markdown
Owner Author

DEGRADED: same-vendor review

Review verdict: clean after round 1. No Blocking or Non-blocking findings against the frozen rubric. This used a fresh Sol xhigh session; same-family bias is not eliminated and its magnitude is unmeasured.

@thomasluizon

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 2609e04c2e

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@thomasluizon

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 2609e04c2e

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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