Skip to content

Leave history-only resources out of saves without history - #4970

Merged
timon-schelling merged 1 commit into
masterfrom
fix-save-without-history-resources
Nov 17, 2026
Merged

timon-schelling merged 1 commit into
masterfrom
fix-save-without-history-resources

Conversation

@timon-schelling

Copy link
Copy Markdown
Member

No description provided.

@github-actions

Copy link
Copy Markdown

This PR's title needs revising to follow the project's conventions:

  • It should begin with an imperative verb like "Add" or "Fix", rather than past tense ("Added"), third person ("Adds"), or a noun phrase.
  • It's too vague to tell what the change does.

Suggested titles:

Fix saves without history including resources that only history still references
Exclude history-only resources from exports without history

Editing the title reviews it again.

@cubic-dev-ai cubic-dev-ai 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.

1 issue found across 2 files

Confidence score: 4/5

  • open_create.rs doesn’t verify that the reopened no-history registry has no tombstone for the removed resource. Retain the removed ID and assert there’s no matching removed_resources entry.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="document/format/tests/open_create.rs">

<violation number="1" location="document/format/tests/open_create.rs:621">
P2: This regression test does not verify that the no-history registry is free of the removed resource's tombstone. Retain the removed ID and assert the reopened registry has no corresponding `removed_resources` entry, so a persisted history-only tombstone cannot regress unnoticed.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

.await
.unwrap_or_else(|error| panic!("reopen failed: {error:?}"));
assert!(reopened.has_resource(&kept_hash).await, "bytes the registry names should travel with the export");
assert!(!reopened.has_resource(&removed_hash).await, "history-only bytes should stay behind");

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.

P2: This regression test does not verify that the no-history registry is free of the removed resource's tombstone. Retain the removed ID and assert the reopened registry has no corresponding removed_resources entry, so a persisted history-only tombstone cannot regress unnoticed.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At document/format/tests/open_create.rs, line 621:

<comment>This regression test does not verify that the no-history registry is free of the removed resource's tombstone. Retain the removed ID and assert the reopened registry has no corresponding `removed_resources` entry, so a persisted history-only tombstone cannot regress unnoticed.</comment>

<file context>
@@ -578,6 +578,50 @@ fn export_with_history_carries_history_only_resources() {
+			.await
+			.unwrap_or_else(|error| panic!("reopen failed: {error:?}"));
+		assert!(reopened.has_resource(&kept_hash).await, "bytes the registry names should travel with the export");
+		assert!(!reopened.has_resource(&removed_hash).await, "history-only bytes should stay behind");
+	});
+}
</file context>

@timon-schelling
timon-schelling added this pull request to the merge queue Nov 17, 2026
Merged via the queue into master with commit a102519 Nov 17, 2026
14 of 15 checks passed
@timon-schelling
timon-schelling deleted the fix-save-without-history-resources branch November 17, 2026 21:53

This branch was successfully deployed

1 active deployment
graphite-dev (Preview) — b3ddb31c Deployed Nov 17, 2026 by github-actions[bot]
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.

2 participants