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 the reconciler's deliberate divergence from the Issues tab's tracker gate (#3767)

[._.]/ Adam Eivy7e632d011bec
diff --git a/server/services/issueReconcile.js b/server/services/issueReconcile.js
index 2c67250351..1655f144a7 100644
--- a/server/services/issueReconcile.js
+++ b/server/services/issueReconcile.js
@@ -400,6 +400,17 @@ async function getGitlabState(repoPath, fullName) {
* exactly as it is listed there. Without the app (a bare-`repoPath` caller, e.g.
* a direct `reconcile()` on the PortOS checkout) there is no pin to honor and
* host detection alone decides.
+ *
+ * Only the resolved TARGET is used, deliberately — this scan does NOT adopt the
+ * Issues tab's extra `tracker === target.forge` gate, and a plan/jira-tracked app
+ * on a forge origin is still scanned. The two answer different questions: the tab
+ * must show exactly what its Claim button would act on, so listing the other forge
+ * would be a lie, whereas a zombie (open + in-progress, PR/MR merged, no live
+ * claim) is a fact about the repo's ACTUAL forge no matter where the app's claims
+ * are filed — and refusing to scan would silently park a scheduled task that
+ * reconciles fine today. The pin only ever ADDS reach here (a custom host that
+ * host detection alone can't classify); it never redirects the scan away from the
+ * origin's own forge.
* @param {string} repoPath
* @param {object|null} [app] - managed app record supplying the forge pin
* @returns {Promise<object|null>}
diff --git a/server/services/issueReconcile.test.js b/server/services/issueReconcile.test.js
index dbb0392b52..3fb5468638 100644
--- a/server/services/issueReconcile.test.js
+++ b/server/services/issueReconcile.test.js
@@ -332,6 +332,20 @@ describe('reconcile', () => {
expect(execGlab.mock.calls[0][1]).toBe('/repo');
});
+ it('still scans a plan-tracked app on a forge origin (a zombie is a fact about the repo, not about where claims are filed)', async () => {
+ // Deliberately NOT the Issues tab's gate: the tab must show only what its
+ // Claim button acts on, but refusing to scan here would park a scheduled
+ // issue-reconcile task that reconciles this repo fine today.
+ mockGh({
+ issues: [{ number: 42, title: 't', labels: [{ name: 'in-progress' }], assignees: [], url: 'u' }],
+ merged: [{ number: 50, headRefName: 'x', body: 'Refs #42' }],
+ open: [],
+ });
+ const result = await reconcile('/repo', { app: { repoPath: '/repo', workTracker: 'plan' } });
+ expect(result.forge).toBe('github');
+ expect(result.zombies.map((z) => z.number)).toEqual([42]);
+ });
+
it('returns null (transient) when the issue list query fails', async () => {
execGh.mockImplementation(async (argv) => {
if (argv[0] === 'issue') return null; // load-bearing query failed