Skip to content

[ENH](foundation-api): harden wiki apply-patch and trajectory writes#7441

Open
rescrv wants to merge 1 commit into
rescrv/foundation-api-atomic-wiki-apply-patchfrom
rescrv/foundation-api-bug-fixes
Open

[ENH](foundation-api): harden wiki apply-patch and trajectory writes#7441
rescrv wants to merge 1 commit into
rescrv/foundation-api-atomic-wiki-apply-patchfrom
rescrv/foundation-api-bug-fixes

Conversation

@rescrv

@rescrv rescrv commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Description of changes

Self-review pass on the atomic wiki apply-patch flow:

  • Allow the empty root slug in read-page requests and cover it in
    citation, file round-trip, and open-trajectory append tests.

  • Keep page-chunk reads within the Chroma Cloud Get limit of 300.
    Detect oversized existing pages with a follow-up one-row read at the
    overflow offset instead of requesting limit=301.

  • Map wrapped Chroma client errors to precise ErrorCodes in
    TrajectoryError, translating conditional-write conflicts to
    FailedPrecondition and validation errors to InvalidArgument.

  • Log apply-patch and upsert-page failures with tenant, slug, and
    error code, and instrument the run helpers for tracing.

Test plan

CI + local ingest passed

Migration plan

N/A

Observability plan

N/A

Documentation Changes

N/A

Co-authored-by: AI

Self-review pass on the atomic wiki apply-patch flow:

- Allow the empty root slug in read-page requests and cover it in
  citation, file round-trip, and open-trajectory append tests.

- Keep page-chunk reads within the Chroma Cloud Get limit of 300.
  Detect oversized existing pages with a follow-up one-row read at the
  overflow offset instead of requesting limit=301.

- Map wrapped Chroma client errors to precise ErrorCodes in
  TrajectoryError, translating conditional-write conflicts to
  FailedPrecondition and validation errors to InvalidArgument.

- Log apply-patch and upsert-page failures with tenant, slug, and
  error code, and instrument the run helpers for tracing.

Co-authored-by: AI

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@github-actions

Copy link
Copy Markdown

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@blacksmith-sh

blacksmith-sh Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
test_sync_and_async_count_functions_can_share_one_input_collection View Logs

Fix in Cursor

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