Files
ironclaw/tests
Emil Bogomolov a34bba249e resolve an issue with shared skills (#2086)
* resolve an issue with shared skills

* fix(engine): non-breaking default for list_memory_docs_by_owner:

* address comments

* fix given github copilot comments

* fix project_id and user_id are not stored in the frontmatter

* fix(skills): address review feedback on shared-skill visibility

- Add caller-level regression test driving handle_list_skills end-to-end
  so a future revert to project-scoped listing fails at the call site, not
  just the helper (per .claude/rules/testing.md).
- Drop the redundant sort in list_skills_global — callers sort/dedupe the
  merged result anyway; keep only dedup-by-DocId within the shared set.
- Document the N+1 caveat on the default list_memory_docs_by_owner impl
  so production Store impls know they must override with a flat query.
- Log a debug! when deserialize_knowledge_doc falls back to nil project_id
  or "legacy" user_id, so stale on-disk frontmatter is traceable instead
  of silently invisible to scoped queries.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(skills): address remaining review comments

- Escape user_id, title, and tag strings before embedding in YAML
  frontmatter. A user_id containing a quote, backslash, or newline
  (e.g., an OIDC sub with unexpected characters) would otherwise
  produce unparsable YAML and make the doc unloadable.
- Clarify the comment in handle_list_skills: the initial call loads
  all doc types for the user, not just skills — skill filtering
  happens later in the filter pass.
- Add list_memory_docs_by_owner stubs to the three non-overriding
  TestStore impls (tests/engine_v2_gate_integration.rs,
  tests/engine_v2_skill_codeact.rs, src/bridge/router.rs) so the
  default-impl fallback into list_all_projects (which errors) can't
  silently swallow shared-skill visibility in integration tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix migrate_legacy_user_ids to preserve __shared__ ownership for Skill docs instead of stamping them with owner_id

* add nil-project pass to migrate_legacy_user_ids, and tests

---------

Co-authored-by: Emil Bogomolov <emil.bogomolov@near.ai>
Co-authored-by: Illia Polosukhin <ilblackdragon@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 15:36:42 +03:00
..