Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

test: pin that a future quality snapshot branch stays untouched (#8038)

[._.]/ Adam Eivyba65149c0690
diff --git a/server/services/appQualitySnapshotFile.test.js b/server/services/appQualitySnapshotFile.test.js
index cd5a7e991e..583a7419ae 100644
--- a/server/services/appQualitySnapshotFile.test.js
+++ b/server/services/appQualitySnapshotFile.test.js
@@ -297,6 +297,25 @@ it('rewrites a v1 snapshot to canonical v2 and leaves a semantically identical v
expect(identical.addWorktree).not.toHaveBeenCalled();
});
+it('does not replace a future snapshot already on the publish branch', async () => {
+ const future = JSON.stringify({ schemaVersion: 3, repository: 'a'.repeat(64) });
+ const deps = testDeps({
+ git: gitDouble({
+ execGit: vi.fn(async (args) => {
+ if (args[0] === 'show' && String(args[1]).includes(`${QUALITY_SNAPSHOT_BRANCH}:`)) {
+ return { exitCode: 0, stdout: future, stderr: '' };
+ }
+ return missingShow;
+ }),
+ }),
+ });
+ expect(await publishAppQualitySnapshot(app, deps)).toEqual({
+ published: false, reason: 'unsupported-format', path: '.quality.json',
+ });
+ expect(deps.writeFile).not.toHaveBeenCalled();
+ expect(deps.addWorktree).not.toHaveBeenCalled();
+});
+
it('leaves a future, unrecognized, or unreadable snapshot in place', async () => {
const future = testDeps({
git: gitDouble({ execGit: showFiles({ '.quality.json': JSON.stringify({ schemaVersion: 3, repository: 'a'.repeat(64) }) }) }),