Repository navigation
fix(flow): never reuse the active 00000 source version - #240
Conversation
SAP exposes the active, still-changing source of an object in an unreleased transport as the pseudo-version 00000 with a stable URI. Matching that locator against an indexed descriptor made checkout reuse stale source and metadata through the indexed-components and exact-head fast paths, so a later task of the same parent request produced an empty delta. Selections with versionId 00000 no longer match indexed descriptors, and the exact-head fast path is skipped for objects that carry one, so source and metadata are re-read from SAP and only content-hash changes are written. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviewer's GuideThe PR treats the Flow diagram for mutable 00000 source version handlingflowchart TD
A[Checkout requested for object] --> B{Selection version is 00000?}
B -->|Yes| C[Skip indexed reuse]
B -->|No| D{Descriptor selection matches?}
D -->|Yes| E[Reuse indexed source]
D -->|No| C
C --> F[Re-read source and metadata]
F --> G[Compare content hash]
G --> H[Return changed paths only]
A --> I{Exact-head fast path eligible?}
I -->|00000 present| F
I -->|No mutable selection| J[Use exact-head result]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
🤖 CodeAnt AI — Review Status
|
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
✅ Deploy Preview for adt-cli canceled.
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 52 minutes. View limit details
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. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| Secrets | Oct 22, 2026 6:23p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
There was a problem hiding this comment.
The fix is correct and well-targeted. The three-part guard (isMutableVersion helper, early-return in descriptorSelectionMatches, and the exactHeadFastPath selection check) consistently prevents stale 00000 active-source reuse across all code paths. The two new integration tests cover both previously broken paths (indexed-components and exact-head), and the rest of the suite (52 tests) continues to pass.
No blocking defects identified. The change is safe to merge.
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.
|
View your CI Pipeline Execution ↗ for commit 05114f4
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 5 |
| Duplication | 4 |
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.
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="packages/adt-flow/src/service.ts" line_range="247-249" />
<code_context>
+const ACTIVE_VERSION_ID = '00000';
+
+function isMutableVersion(versionId: string): boolean {
+ return versionId === ACTIVE_VERSION_ID;
+}
+
function descriptorSelectionMatches(
</code_context>
<issue_to_address>
**Older refresh overwrites newer source**
When two checkouts of the same workspace overlap, and the checkout that read the older active source applies last, concurrent checkouts of the same workspace can read different contents from the mutable `00000` source; the older checkout can reach `applyRepositoryPlan` after the newer one and overwrite its source and descriptor, leaving the workspace stale until another checkout.
Serialize checkout/index operations per workspace, or validate the active-source snapshot before applying a plan.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 1 finding to address first, and if 00000 is not actually mutable, bypassing the cached descriptor can make checkout write an unintended SAP source version into local files. Those file changes survive a code revert, but are bounded and can be restored or corrected with another checkout.
Blocking findings: packages/adt-flow/src/service.ts:249
CodeAnt Nitpicks1 code suggestion1. For objects with multiple source components, this forces independent reads of mutable URIs; an edit between reads can produce a checkout combining different source revisions.Race condition · |
CodeAnt PR Risk: Low Risk
Assessed commit: |
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
[Medium impact] The PR appears safe to merge.
|



User description
Problem
An unreleased transport exposes only the pseudo-version
00000in the ADT versions feed. Its URI is stable, but its content is the mutable active source and keeps changing while developers work on the object under the parent request.adt-flowtreated a00000selection like an immutable version:exact-headfast path skipped all SAP calls when the indexed head matched the requested descriptors;indexed-componentspath reused the indexed source when the descriptor selection matched.So a later checkout of the same transport (for example, after another task was released) returned the stale source captured at the first checkout. Downstream consumers then saw an empty diff even though the active code had changed.
Fix
isMutableVersion()marks00000as the active, mutable version.descriptorSelectionMatches()never matches a mutable selection, so indexed reuse is skipped and the source plus metadata are re-read.exactHeadFastPath()gives up when any object selection carries00000.Tests
re-reads an indexed active 00000 head instead of reusing itdoes not repeat an active 00000 head through the exact-head fast pathBoth failed before the fix (
indexed-components/exact-head).packages/adt-flowtests pass after it: 52/52. Prettier is clean.Note:
tsconpackages/adt-flowshows pre-existing@abapify/adktype mismatches (inventory,repositoryObject) from a stale local build. These are unrelated to this change.🤖 Generated with Claude Code
Summary by Sourcery
Ensure active
00000source versions are always refreshed instead of being treated as immutable indexed versions.Bug Fixes:
00000source version so subsequent checkouts observe current source changes.Tests:
00000sources through indexed and exact-head checkout paths.Summary by cubic
Fixes stale checkouts of unreleased transports by never reusing the active
00000source version. Previously,adt-flowtreated00000as an immutable version, so the indexed-components and exact-head fast paths served the source captured at the first checkout, producing empty diffs when the active code had changed. Now00000selections skip indexed reuse and re-read source and metadata from SAP; the re-read still goes through the normal content-hash comparison, so unchanged sources yield no changed paths.Written for commit 05114f4. Summary will update on new commits.
CodeAnt-AI Description
Refresh active source versions on every checkout
What Changed
00000versions now fetch the latest source and metadata instead of reusing an earlier snapshot.Impact
✅ Current active source on every checkout✅ Changes between tasks appear in checkout✅ No false empty diffs for updated source💡 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:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
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:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
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.