Repository navigation
MacroscopeApp / Macroscope - Correctness Check
completed
Feb 12, 2026 in 23m 54s
5 issues identified (178 code objects reviewed).
• Merge Base:
5120f7f
• Head:58c10bb
Details
| ✅ | File Path | Comments Posted |
|---|---|---|
| ✅ | AGENTS.md |
0 |
| ✅ | README.md |
0 |
| ✅ | apps/server/src/codexAppServerManager.ts |
0 |
| ✅ | apps/server/src/providerEventNormalizer.ts |
0 |
| ✅ | apps/server/src/providerManager.ts |
0 |
| ❌ | apps/server/src/providerStreamStore.ts |
2 |
| ❌ | apps/server/src/providerStreamSubscriptionManager.ts |
1 |
| ✅ | apps/server/src/wsServer.ts |
0 |
| ✅ | apps/web/src/App.tsx |
0 |
| ✅ | apps/web/src/components/ChatView.tsx |
0 |
| ✅ | apps/web/src/session-logic.ts |
0 |
| ✅ | apps/web/src/store.ts |
0 |
| ✅ | apps/web/src/types.ts |
0 |
| ❌ | apps/web/src/wsNativeApi.ts |
1 |
| ❌ | apps/web/src/wsTransport.ts |
1 |
| ✅ | docs/provider-ws-api.md |
0 |
| ✅ | packages/contracts/src/ipc.ts |
0 |
| ✅ | packages/contracts/src/provider.ts |
0 |
| ✅ | packages/contracts/src/providerStream.ts |
0 |
Filtered Issues Details
apps/server/src/providerEventNormalizer.ts
- line 445: In
ProviderEventNormalizer.normalize, the handler forturn/plan/updated(lines 437-462) assignsraw.iddirectly toactivityId(line 445) without validation. If therawevent object lacks anidproperty,activityIdbecomesundefined. This creates anactivityevent with a missing identifier, which violates the implied contract that activities must be trackable entities. Downstream lookup or rendering logic relying onactivityIdas a key or identifier may fail or behave unpredictably. [ Already posted ]
apps/server/src/providerStreamStore.ts
- line 323: The
pruneReplayLogmethod contains an infinite loop hazard. Thewhileloop checksthis.replayLog.length > 0, but the termination condition inside relies on three boolean flags (overCount,overBytes,tooOld). If the loop enters (because the log is non-empty) but none of those conditions are met (e.g., log is under limits), it returns. However, if any condition is met (e.g.,overCountis true), it shifts one element and continues. The critical flaw is thatthis.replayBytesis decremented byfirst.encodedSize. Iffirst.encodedSizeis 0 or negative (unlikely but possible ifeventSizeBytesreturns 0 for empty JSON),replayBytesmight not decrease effectively. More importantly, ifoverCountis true, it shifts an element. This seems safe. However, there is a subtle issue: the loop logicif (!overCount && !overBytes && !tooOld) { return; }correctly breaks when limits are satisfied. But ifthis.replayLogis somehow empty,firstbecomes undefined. The checkif (!first) { return; }handles this. The logic seems mostly sound for standard execution, but there is no safeguard againstreplayBytesbecoming negative if accounting drifts orencodedSizeis calculated differently on removal than insertion. While not a strict infinite loop in the local logic shown (sinceshift()reduces length),this.replayBytesmanagement is fragile. Actually, looking closer atpruneReplayLog: ifoverCountis true, we shift. This reduces length. IfoverBytesis true, we shift. This reduces bytes. IftooOldis true, we shift. This reduces length. The loop is bounded byreplayLog.length. So it terminates. [ Already posted ]
Loading