hardening: mergeOverlay has no defense against malformed remote blocks
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 84/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
Direzione di ricerca
Inizia da mergeOverlay in packages/opencode/src/memory/prompt.ts:69-80 e dai casi con prefisso FINDING in packages/opencode/test/skill/release-v0.9.7-adversarial.test.ts. Riproduci il comportamento attuale con questi test, quindi rendi deterministico l’input remoto malformato: gli id remoti duplicati non devono sopravvivere entrambi e l’assenza di updated non deve generare un errore. Il lavoro è completato quando gli adversarial tests possono essere aggiornati per verificare il comportamento irrobustito.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Found while writing v0.9.7 release adversarial tests (packages/opencode/test/skill/release-v0.9.7-adversarial.test.ts).
mergeOverlay (packages/opencode/src/memory/prompt.ts:69-80) has two narrow fragilities, both currently unreachable via the production hydrate/refresh path (which always supplies well-formed RemoteMemoryBlocks via toBlock()), but present in the exported function itself:
- Duplicate ids within the remote list are not deduplicated against each other. The dedup check only compares new remote entries against local keys (
localKeys.has(...)); it never checks a remote entry against remote entries already pushed from the same list. Two remote records sharing one non-sibling scope+id (a corrupted or duplicated overlay fetch) both survive into the merged output. - A remote block missing
updatedthrows a TypeError out of the final sort (b.updated.localeCompare(a.updated)) instead of degrading gracefully.toBlock()always guaranteesupdatedvia a fallback chain ending innew Date().toISOString(), so this isn't reachable today — but a future caller buildingRemoteMemoryBlockby hand, or a corrupted overlay cache, would hit it. The memory-read tool's outer try/catch happens to downgrade this to an error response rather than crashing the process, but that's accidental defense-in-depth one layer up, not a property ofmergeOverlayitself.
Both are pinned by FINDING:-prefixed tests in the adversarial test file (documenting current behavior, not asserting it's correct). Deferred from v0.9.7 because neither is reachable via the real production path today — worth a hardening pass regardless, since mergeOverlay is exported and its contract implicitly promises a 'deterministic, non-crashing merge' that doesn't fully hold for malformed input.
- Lingua principale
- TypeScript
- Stelle
- 813
- Fork
- 134
- Merge medio
- 2g 5h
- PR unite (30g)
- 62
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di AltimateAI/altimate-code
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
AltimateAI/altimate-code#1323 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
AltimateAI/altimate-code#1288 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
AltimateAI/altimate-code#1285 ·
-
privacy: Altimate Base consent dialog no longer discloses persistent per-installation identifier Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
AltimateAI/altimate-code#1284 ·
-
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 72/100
AltimateAI/altimate-code#1283 ·
Tutte le issue di AltimateAI/altimate-code
Issue simili
-
comp/desktop P3 type/bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
NousResearch/hermes-agent#118866 ·
-
Browser Waiting for: Product Owner
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
getsentry/sentry-javascript#24577 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
agilepathway/label-checker#640 ·
-
Plugin stuck at "loading" on DSH 0.1.6-alpha.2 — turnTail list slot registration missing options.id Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Add 2021 Cup data to website Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
chrisparsons83/flexspotff#153 ·