fix: reconcile documentation guarantees and enforcement (OM-15)

This commit is contained in:
Chris Scott committed 2026-10-02 13:00:09 +00:00
1 parent 6c878ae79a
commit dcb50b7e0f
28 files changed
+461 -128

No files matched your search

@@ -402,6 +402,16 @@ describe('opencode plugin quarantine restore', () => {
await expect(fs.access(`${configPath}.ocm-sandbox-backup`)).resolves.toBeUndefined()
})
it('rejects a restore when the current config root is not an object alongside a legacy backup', async () => {
writeFileSync(configPath, '[]')
writeFileSync(`${configPath}.ocm-sandbox-backup`, JSON.stringify({ removedSections: { plugin: ['my-plugin'] } }))
await expect(restoreQuarantinedOpenCodePlugins(configHome, configPath)).rejects.toThrow(/is not an object/)
expect(JSON.parse(await fs.readFile(configPath, 'utf-8'))).toEqual([])
await expect(fs.access(`${configPath}.ocm-sandbox-backup`)).resolves.toBeUndefined()
})
it('propagates a failed plugin entry restore and leaves the quarantine intact', async () => {
const quarantineDir = path.join(configHome, 'opencode', 'plugin.ocm-quarantine')
mkdirSync(quarantineDir, { recursive: true })