Skip to content

test(plugin): guard scoped OpenCode context injection#1034

Merged
kunickiaj merged 1 commit into
mainfrom
05-04-test_plugin_guard_scoped_opencode_context_injection
May 5, 2026
Merged

test(plugin): guard scoped OpenCode context injection#1034
kunickiaj merged 1 commit into
mainfrom
05-04-test_plugin_guard_scoped_opencode_context_injection

Conversation

@kunickiaj
Copy link
Copy Markdown
Owner

@kunickiaj kunickiaj commented May 5, 2026

Description

Adds tests proving the OpenCode plugin's `experimental.chat.system.transform` injection path cannot serve cross-scope memories. Two coverage paths:

  1. Plugin-level: each transform call recomputes (no in-process cache that could leak stale cross-scope content) and threads scope identity through to the CLI pack helper.
  2. Real CLI pack transform: the actual binary path is exercised so injected system prompt is verified to contain only memories from the resolving scope.

Plugin tests resolve `@codemem/core` to workspace source via a vitest config alias so the test runs against the real implementation.

Decomposed from codemem-ov4g.5.3 → ov4g.5.9.

Type of Change

  • 🧪 Testing (test-only changes)

Testing

  • Relevant checks pass locally (`pnpm run tsc`, `pnpm run lint`, `pnpm run test`)
  • Added/updated tests for changes
  • Manually verified changes work as expected

Checklist

  • Code follows project style (`pnpm run lint` passes for touched files)
  • Self-review completed
  • Documentation updated (if needed)
  • No new warnings introduced

@kunickiaj kunickiaj marked this pull request as ready for review May 5, 2026 05:24
@kunickiaj kunickiaj force-pushed the 05-04-fix_core_harden_memory_pack_scope_assembly branch from deff6d4 to f24f6e3 Compare May 5, 2026 14:36
@kunickiaj kunickiaj force-pushed the 05-04-test_plugin_guard_scoped_opencode_context_injection branch 2 times, most recently from 4db68bf to cbfb119 Compare May 5, 2026 14:46
@kunickiaj kunickiaj force-pushed the 05-04-fix_core_harden_memory_pack_scope_assembly branch from f24f6e3 to 443ac60 Compare May 5, 2026 14:46
Copy link
Copy Markdown
Owner Author

kunickiaj commented May 5, 2026

Merge activity

  • May 5, 2:59 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • May 5, 3:09 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 5, 3:10 PM UTC: @kunickiaj merged this pull request with Graphite.

@kunickiaj kunickiaj changed the base branch from 05-04-fix_core_harden_memory_pack_scope_assembly to graphite-base/1034 May 5, 2026 15:05
@kunickiaj kunickiaj changed the base branch from graphite-base/1034 to main May 5, 2026 15:07
@kunickiaj kunickiaj force-pushed the 05-04-test_plugin_guard_scoped_opencode_context_injection branch from cbfb119 to ba54040 Compare May 5, 2026 15:08
@kunickiaj kunickiaj merged commit b511b6d into main May 5, 2026
8 checks passed
@kunickiaj kunickiaj deleted the 05-04-test_plugin_guard_scoped_opencode_context_injection branch May 5, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant