Skip to content

OpenCode coverage: remaining follow-ups (live-verify parser, SQLite layout, plugin/hook audit) #117

Closed

Description

@sandstream

Tracks the known-remaining OpenCode items after the parity work landed in #109 (detection + array-form MCP), #115 (memory parser), and #116 (debounced auto-index sweep).

1. Verify the memory parser against a live OpenCode install

src/memory/opencode.ts (#115) is fixture-tested against the documented flat-JSON layout, not a real ~/.local/share/opencode. It is defensive (unrecognized shapes → no-op, never garbage), but should be smoke-tested against an actual OpenCode session before we rely on it:

  • Run kit memory index against a real OpenCode install; confirm sessions/messages land with correct role, content (text parts only), project/cwd, and timestamps.
  • Confirm the part-grouping-by-messageID assumption holds on real data.

2. Support the newer SQLite-backed OpenCode layout

Recent OpenCode (sst/opencode message-v2) persists messages/parts to SQLite (MessageTable, session.sql.ts) rather than flat storage/*.json. On such installs the current parser is a safe no-op (indexes nothing).

  • Detect a SQLite-backed install and read messages/parts from the DB.
  • Keep the flat-JSON path for older installs; pick the right reader per install.

3. Audit OpenCode's own plugin/hook system

kit audits git hooks and Claude's command/agent/skill/plugin surfaces (#94), and OpenCode's mcp server block (#87/#109), but not OpenCode's own plugin/hook mechanism (distinct from git hooks). An OpenCode plugin can run code on agent lifecycle events — same class of exec surface kit already flags elsewhere.

  • Identify where OpenCode declares plugins/hooks (config keys + on-disk location).
  • Run the existing malware/secret analyzers over them.

Notes

  • Items 1–2 are about memory coverage; item 3 is about security audit coverage.
  • All three are low-priority hardening, not regressions — current behavior on unsupported layouts is a safe no-op.

🤖 Generated with Claude Code

https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg

Activity

  1. added
    enhancement
    on Jun 24, 2026
  2. sandstream commented on Jun 27, 2026

    @sandstream
    OwnerAuthor

    Closing — all three follow-ups are now done and on main, verified against a real OpenCode install (opencode-ai@1.17.11), not just docs:

    1. Live-verify the memory parser ✅ — ran kit's parser against a real opencode.db; queries resolve clean against the actual schema.
    2. SQLite-backed layout ✅ (feat(opencode): SQLite memory parser + install-gate plugin (verified against opencode-ai@1.17.x) #156) — current OpenCode dropped the flat-JSON storage/ tree entirely and moved to SQLite (~/.local/share/opencode/opencode.db, tables session/message/part with JSON data blobs). Added a read-only SQLite path (session.directory=cwd, role from message.data, text from part.data), preferring it with flat-JSON fallback for older installs.
    3. Plugin/hook audit ✅ (feat(agent-audit): scan OpenCode plugins for malware shapes + secrets #154) — agent-audit now scans .opencode/plugin/*.{js,ts} for malware shapes + plaintext secrets.

    Bonus from the same verification: the OpenCode install-gate now ships too (#156) — a generated .opencode/plugin/kit-install-gate.js that hooks the verified tool.execute.before contract and throws to block, routing through kit gate-bash. Confirmed end-to-end in CI (the dogfood-scan job).


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions