Skip to content

Commit 22e9d93

Browse files
fix(clone): forecast agentic verified-data as skipped under skip strategy
Verified data FKs a document; with file_strategy=skip no docs land on target, so a dry-run must predict the rows as skipped rather than as creates that the real run silently drops. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011ja9H1rnSXmPUgQtHm8TNS
1 parent 20d27e9 commit 22e9d93

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

src/unstract/clone/phases/agentic_studio.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,11 +729,13 @@ def _plan_children(
729729
result.created += 1
730730
result.created += len(src_schemas)
731731
# Documents move only when the file strategy copies binaries.
732+
# Verified data FKs a document, so skipping files strands it too.
732733
if self.ctx.options.file_strategy == "skip":
733734
result.skipped += len(src_docs)
735+
result.skipped += len(src_verified)
734736
else:
735737
result.created += len(src_docs)
736-
result.created += len(src_verified)
738+
result.created += len(src_verified)
737739

738740
# ----- settings -----
739741

tests/clone/test_agentic_studio_phase.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,3 +674,26 @@ def test_documents_not_copied_under_file_strategy_skip():
674674

675675
assert tgt.uploaded_documents == []
676676
assert result.skipped == 1
677+
678+
679+
def test_dry_run_skip_strategy_counts_docs_and_verified_as_skipped():
680+
# Verified data FKs a document; under skip no docs land on target, so the
681+
# plan must forecast verified as skipped too — not as un-creatable creates.
682+
src = FakeClient(
683+
projects=[_src_project("src-p", "Receipts")],
684+
documents={"src-p": [{"id": "d1", "original_filename": "report.pdf"}]},
685+
document_blobs={"d1": b"%PDF-r"},
686+
verified_data={
687+
"src-p": [{"document_name": "report.pdf", "document": "d1", "data": {}}]
688+
},
689+
)
690+
tgt = FakeClient()
691+
ctx = _ctx(src, tgt, dry_run=True, file_strategy="skip")
692+
693+
result = AgenticStudioPhase(ctx).run(CloneReport())
694+
695+
assert tgt.uploaded_documents == []
696+
assert tgt.created_verified_data == []
697+
# Only the project is a forecast create; doc + verified row both skipped.
698+
assert result.created == 1
699+
assert result.skipped == 2

0 commit comments

Comments
 (0)