OpenViking icon indicating copy to clipboard operation
OpenViking copied to clipboard

Skill vectorization aborts when a generated .abstract.md carries a privacy reference

Open pperezrubio opened this issue 1 month ago • 1 comments

Summary. Skill vectorization aborts when a generated .abstract.md carries a privacy reference. body_for_preview() returns legacy (frontmatter-free) sidecars verbatim, and SemanticProcessor._vectorize_directory runs yaml.safe_load() on that text without a guard. A YAML node whose value starts with { is a flow mapping, so a single {{ov_privacy:…}} reference in leading position raises and the whole job dies.

Impact. The skill never gets vectors or an overview; every retry fails identically, so it stays invisible to semantic search until the stored metadata is rewritten by hand. We hit this on five skills after upgrading.

Error

ERROR openviking.storage.queuefs.semantic_executor - Failed to schedule vectorization for
viking://user/default/skills/<skill>: while parsing a block mapping
  ... skill/<name>#/values/<field>}}ment
expected <block end>, but found '<scalar>'
  in "<unicode string>", line 15, column 100

Repro

# .abstract.md of a skill (frontmatter-free, i.e. "legacy")
name: securing-helm-chart-{{ov_privacy:alice:viking://~/privacy/skill/x#/values/y}}ments
description: Secures Helm charts
tags:
- helm
- {{ov_privacy:alice:viking://~/privacy/skill/x#/values/y}}ment

yaml.safe_load(body_for_preview(raw)) → ParserError: while parsing a block mapping; the same text with the two brace-leading scalars quoted parses. End-to-end: POST /api/v1/content/reindex {"uri": "viking://user/default/skills/<skill>", "force": true} logs the error and the skill gets no vector entry.

Where. openviking/storage/queuefs/semantic_processor.py (parsed = yaml.safe_load(body_for_preview(abstract))), openviking/storage/abstract_overview.py (parse_abstract_overview legacy branch returns the raw text).

Suggested fix. For legacy previews, single-quote mapping values and sequence items whose value starts with {{ (touch nothing else: already-quoted values and folded-scalar continuation lines carrying a reference mid-string must stay byte-identical). Optional hardening: treat a still-unparsable preview as "no skill_meta" instead of failing the job. PR to follow with tests.

Version. Reproduced on v0.5.1.1 (c2dea800) and on main today.

pperezrubio avatar Oct 22 '26 15:10 pperezrubio

Same parser, additional trigger and blast radius — cross-referencing #6909 which I just filed.

We hit the same YAML failure on v0.5.2.1, but in a different shape than the legacy-preview case described here:

  • The sidecar that breaks is frontmatter-bearing, not legacy: directory: {{ov_privacy:<user>:viking://~/privacy/skill/<first>#/values/target_uri}}/<second>/ (generated by SkillProcessor, trigger: skill_ingest).
  • The privacy reference exists because the skill privacy extractor put it there: prompt skill.privacy_extraction treats target_uri="viking://agent/skills" as a user-maintained config value. A resource URI is being recorded as a secret.
  • Blast radius beyond vectorization: the skill keeps no abstract, GET /api/v1/skills returns description: "", and the session-start <available-skills> catalog lists it name-only. Search still finds it (81%), so the degradation is silent. One Semantic-queue error per affected skill.
  • Substitutions also reached stored memory text (an Experience and an Events memory were written with placeholders instead of the path they described).

Repro is deterministic (two installs, same root) and the workaround is verified: delete the false-positive field via DELETE /api/v1/privacy-configs/{category}/{target_key}/field?field=..., then install an identical skill into the same root — description and abstract come back and the warning stops. Removing a skill does not clean its privacy config, so the field has to go first.

Since your fix is parser-side (quote brace-leading scalars in legacy previews), it would cover the crash here too, but not the reason the reference appears, nor the fact that generated metadata is sanitized at all. Details and suggested fixes in #6909 — happy to consolidate if you prefer one issue.

timacek avatar Nov 02 '26 08:11 timacek