Skip to content

docs: update Claude docs from PR review analysis - #804

Open
claude[bot] wants to merge 1 commit into
mainfrom
claude-docs-update/2026-10-05
Open

claude[bot] wants to merge 1 commit into
mainfrom
claude-docs-update/2026-10-05

Conversation

@claude

@claude claude Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Weekly analysis of PR comments (2026-09-28 -> 2026-10-05).
Analyzed 16 PRs with resolved review threads. Found 3 actionable insights.

Changes

agent_docs/conventions.md

  • Validate-before-mutate rule — Always run all guard checks before mutating any shared object. Mutating state before the guard fires means that when validation fails and throws, the mutation has already applied to any shared reference, corrupting objects reused by callers or test fixtures. Additionally, shallow copies via { ...obj } share nested object references — when a nested object needs to be mutated, create an explicit shallow copy of it.
    Source: PR feat(data-fabric): federated update deltas — replaceSourceJoins + updateExternalConnection #783 — reviewer caught that isPrimarySource was written to every source's externalObjectDetail before the not-found check fired. Because { ...s } is a shallow copy, the nested externalObjectDetail was the same object reference as the one in the shared test fixture federatedRaw, so failed validation was polluting subsequent tests. Resolution: validate first with .some(), then copy-on-write the nested object: { ...detail, isPrimarySource }.

  • @odata.context must be destructured out of OData responses — OData getById responses include @odata.context (and sometimes other @odata.* keys) that must be destructured and discarded before returning. Documents the existing pattern already used in src/services/orchestrator/attachments/attachments.ts.
    Source: PR feat(folders): add getByKey lookup on odata/Folders #753 — reviewer noted @odata.context was leaking into the FolderGetResponse return value. The fix was to destructure it out before applying pascalToCamelCaseKeys. This pattern is used by attachments but was undocumented.

agent_docs/rules.md

No changes

  • CLAUDE.md — no relevant insights found
  • Agents.md — no relevant insights found
  • agent_docs/architecture.md — no relevant insights found

PRs Analyzed

PR Title Comments
#783 feat(data-fabric): federated update deltas — replaceSourceJoins + updateExternalConnection 7 threads
#775 ci: run only the integration suites a pull request can affect APPS-37918 6 threads
#782 feat(core): honour the coded-function context's folder key and base URL origin [SW-31977] 4 threads
#780 feat(core): add trace() markers and the @trace method decorator 3 threads
#778 feat(ci): build changed sample apps on pull requests [APPS-37913] 3 threads
#768 test(data-fabric): share one fixture entity across sqlType default/fixed-limit assertions 2 threads
#747 test(integration): run the Data Fabric schema DDL suite in its own sequential group 0 threads
#745 test(maestro): fix two Maestro integration flakes 0 threads
#753 feat(folders): add getByKey lookup on odata/Folders 18 threads
#722 fix(core): reject a config carrying both auth methods at construction [APPS-37257] 3 threads
#769 docs(ai-app-builders): point the walkthroughs at the official channel 0 threads
#754 feat(agenthub): add chat completions via LLM gateway 12 threads
#752 feat(du-validation): add validation start and result poll service 15 threads
#767 fix(auth): refresh access tokens ahead of expiry [APPS-37340] 7 threads
#714 feat(entities): apply resource overrides on all byName paths 6 threads
#718 docs: update Claude docs from PR review analysis (skipped — prior run)

@claude
claude Bot requested a review from a team October 5, 2026 09:14
@claude claude Bot added the claude-docs-update Automated Claude docs enhancement label Oct 5, 2026
@claude
claude Bot requested a review from ninja-shreyash October 5, 2026 09:14
Comment thread agent_docs/conventions.md
const { '@odata.context': _ctx, ...data } = response.data as Record<string, unknown>;
return pascalToCamelCaseKeys(data) as EntityGetResponse;
```
Reference implementation: `src/services/orchestrator/attachments/attachments.ts`.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The cited reference doesn't match this rule. attachments.ts never strips @odata.context in its getById method — only in create, and there it's done after all transforms (not before, as the code example shows). The actual implementation from PR #753 that prompted this rule is src/services/orchestrator/folders/folders.ts:

const camelCased = pascalToCamelCaseKeys(response.data) as FolderGetResponse & { '@odata.context'?: string };
const { '@odata.context': _odataContext, ...folder } = camelCased;
return folder;

Note that folders.ts also strips after pascalToCamelCaseKeys (not before as the code example shows). Since @odata.context starts with @ and isn't touched by case conversion, the order is functionally equivalent — but the code example and reference should agree.

Suggest either:

  • Change the reference to src/services/orchestrator/folders/folders.ts, or
  • Update the code example to show the after-case-conversion pattern that both existing implementations use.

@sonarqubecloud

sonarqubecloud Bot commented Oct 5, 2026

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-docs-update Automated Claude docs enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant