Skip to content

fix(adt-flow): expose ownership divergence path - #217

Merged
ThePlenkov merged 1 commit into
abapify:mainfrom
theplenkov-forks:fix/flow-ownership-diagnostics
Sep 23, 2026
Merged

ThePlenkov merged 1 commit into
abapify:mainfrom
theplenkov-forks:fix/flow-ownership-diagnostics

Conversation

@ThePlenkov

@ThePlenkov ThePlenkov commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

User description

Summary

  • Include the first divergent owned-file path in working_tree_diverged diagnostics.
  • Preserve the existing boolean ownership verifier for fast-path validation.
  • Add a regression test for an edited indexed source file.

Verification

  • bunx vitest run --config packages/adt-flow/vitest.config.ts packages/adt-flow/tests/service.test.ts --testNamePattern "fails before source reads when an indexed file was edited locally"
  • NX_DAEMON=false bunx nx run adt-flow:test --output-style=static
  • NX_DAEMON=false bunx nx run adt-flow:build --output-style=static

No checkout, materialization, or recovery behavior changes; this is diagnostic-only.


Summary by cubic

Exposes the first diverged owned-file path in working_tree_diverged errors so callers can identify which file broke ownership. The existing boolean verification contract is kept for fast-path validation, and a regression test covers an edited indexed source file. No checkout, materialization, or recovery behavior changes.

Written for commit d6f5483. Summary will update on new commits.

Review in cubic


CodeAnt-AI Description

Show which indexed file caused a working-tree divergence

What Changed

  • Checkout divergence errors now identify the first owned file whose contents differ from the recorded version
  • Checkout still stops before reading sources and leaves the locally edited file unchanged
  • Existing ownership validation continues to return a simple pass/fail result where detailed diagnostics are not needed

Impact

✅ Clearer checkout divergence errors
✅ Faster diagnosis of locally edited files
✅ Preserved local changes during failed checkout

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Summary by CodeRabbit

  • Bug Fixes
    • When indexed files have changed locally, the resulting error now identifies the affected object and file path, making it easier to locate the divergence.
    • Validation continues to leave local edits intact and avoids reading source files in this situation.

Keep the existing hash-verification boolean contract for fast paths, while including the first divergent owned-file path in working_tree_diverged diagnostics.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@codeant-ai

codeant-ai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR d6f5483 Sep 23, 2026 · 20:11 20:13

@netlify

netlify Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for adt-cli canceled.

Name Link
🔨 Latest commit d6f5483
🔍 Latest deploy log https://app.netlify.com/projects/adt-cli/deploys/6ab4325aebca07000802300c

@codeant-ai

codeant-ai Bot commented Sep 23, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@baz-reviewer

baz-reviewer Bot commented Sep 23, 2026

Copy link
Copy Markdown

Review this PR on Baz

Merger

Waiting for CI and review to complete.

@codeant-ai codeant-ai Bot added the size:S This PR changes 10-29 lines, ignoring generated files label Sep 23, 2026
@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 3d78a446-90d2-479f-8249-07538fe14133

📥 Commits

Reviewing files that changed from the base of the PR and between c49723d and d6f5483.

📒 Files selected for processing (3)
  • packages/adt-flow/src/repository.ts
  • packages/adt-flow/src/service.ts
  • packages/adt-flow/tests/service.test.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds a helper that identifies the first missing or hash-mismatched owned file. Indexed ownership errors now include that file’s path, and the service test checks the error details.

Changes

Indexed ownership divergence reporting

Layer / File(s) Summary
Find the first divergent owned path
packages/adt-flow/src/repository.ts
The new findDivergedOwnedPath helper returns the first missing or hash-mismatched path. verifyOwnedHashes delegates to it and retains its existing behavior.
Add the path to ownership errors
packages/adt-flow/src/service.ts, packages/adt-flow/tests/service.test.ts
validateIndexedOwnership adds the divergent path to working_tree_diverged error details. The test checks the object identifier and edited source path.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to d6f54

The change adds the divergent file path to ownership errors without an identified regression; it is ready to merge after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: exposing the path of the first ownership divergence in diagnostics.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

@amazon-q-developer amazon-q-developer 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.

This diagnostic improvement enhances error reporting by exposing the specific divergent file path in working_tree_diverged errors. The refactoring is well-structured: findDivergedOwnedPath provides the detailed path information, while verifyOwnedHashes remains as a boolean convenience wrapper. The test coverage validates the new diagnostic information is correctly included in error details. No blocking issues identified.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@gitar-bot

gitar-bot Bot commented Sep 23, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

@ThePlenkov
ThePlenkov marked this pull request as draft September 23, 2026 20:12
@sonarqubecloud

Copy link
Copy Markdown

@codeant-ai

codeant-ai Bot commented Sep 23, 2026

Copy link
Copy Markdown

CodeAnt Nitpicks

1 code suggestion

1. A local edit after this scan can be missed, then later planning and applying writes can overwrite that edit with fetched content.

Race condition · packages/adt-flow/src/service.ts:1208

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 416 complexity · 52 duplication

Metric Results
Complexity 416
Duplication 52

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@ThePlenkov
ThePlenkov marked this pull request as ready for review September 23, 2026 20:17
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@ThePlenkov
ThePlenkov merged commit 42e780f into abapify:main Sep 23, 2026
24 checks passed
@ThePlenkov
ThePlenkov deleted the fix/flow-ownership-diagnostics branch September 23, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant