Skip to content

docs(specs): land canonical skill auto-synthesis spec (#887) - #1732

Merged
kovtcharov merged 1 commit into
amd:mainfrom
alexey-tyurin:skill-auto-synthesis-spec
Jun 18, 2026
Merged

kovtcharov merged 1 commit into
amd:mainfrom
alexey-tyurin:skill-auto-synthesis-spec

Conversation

@alexey-tyurin

Copy link
Copy Markdown
Contributor

Why this matters

PR #606 shipped three of CoALA's four memory tiers (working / episodic / semantic) and left the procedural tier — distilling recurring successful tool sequences into reusable skills — as a follow-up (#887). The issue's own design notes predate #691 locking and the current code, so a contributor building straight from them would rebuild against a stale picture — exactly how #688's spec drifted across four unmerged PRs. This lands one canonical, code-accurate spec at docs/plans/skill-synthesis.mdx, grounded line-by-line on the merged memory layer and reconciled against the format it emits (#691) and the tool-loader that consumes it (#1451), so design and implementation can't diverge before the first line is written.

Linked issue

Refs #887

Changes

  • Separate procedures table + additive v2→v3 migration — procedural memory diverges from knowledge on every lifecycle axis (empirical track-record vs belief-strength, multi-step body vs one sentence, its own goal-trigger embedding index); sharing the table would NULL every procedure-only column on existing rows and pollute the recall index.
  • recall_skill is an internal method, not a sixth @tool — the planner calls it programmatically at turn start, so the agent gains the capability without enlarging the five-tool memory registry it must reason about.
  • Emits the locked SKILL.md format specification with native Agent UI dashboard support #691 format by reference (the emit/inject split) — the LLM emits only the fields it derives; Skill.parse() injects the fixed constants (license, version) and maps to metadata.gaia.tools_required, so synthesized files validate against the format instead of re-inventing it.
  • Fail-loud off-states + content-trust boundary — Lemonade-down / malformed-output / embedder-fail each skip-and-log or re-raise (no silent smaller-model swap, per CLAUDE.md); injected bodies are internal-corpus-only, capped at MAX_RECALL_BODY_CHARS, never auto-exported.
  • Corrects the issue's drifted framing — re-pins the synthesis hook to the real _run_memory_post_init, config to the existing memory_settings.json, and retracts the "new tool" / intermediate-frontmatter-on-disk framing the pre-SKILL.md format specification with native Agent UI dashboard support #691 pseudocode implied.

Test plan

  • python -c "import json; json.load(open('docs/docs.json'))" — nav JSON valid
  • New page plans/skill-synthesis registered under Ecosystem in docs.json
  • Mintlify preview renders docs/plans/skill-synthesis.mdx — tables, <Info>/<Note>/<Warning>, the <AccordionGroup> examples, and all internal anchor links resolve
  • Maintainer sign-off on the design direction before implementation begins (the five items under Open questions are explicitly left as PR-time confirmations, not blockers)

@github-actions github-actions Bot added the documentation Documentation changes label Jun 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Summary

Approve. This is a documentation-only PR — one new design spec (docs/plans/skill-synthesis.mdx, 785 lines) plus its docs.json nav entry — and it's an unusually well-grounded one. The PR's headline claim ("code-accurate, grounded line-by-line") holds up under spot-checking: every code reference I sampled is exact, all internal anchors resolve, the nav JSON is valid, and the sibling-doc contracts it cites are real rather than invented. The single most useful thing to know is that nothing here is a code change — the substantive decisions (separate procedures table, recall_skill as an internal method vs. a sixth @tool, config surface) are design calls for the maintainer to ratify, and the PR correctly defers them via its five Open questions rather than presenting them as settled.

Verification performed:

  • Grounding accuracy — tool_history columns match the doc's enumeration exactly (memory_store.py:240); _run_memory_post_init is at memory.py:1206, _compose_system_prompt at agent.py:591, _select_tools_for_turn at agent.py:786, GAIA_MEMORY_DISABLED at memory.py:332, memory_settings.json at memory.py:57, EMBEDDING_MODEL/EMBEDDING_DIM at memory.py:148/151, "skill" in VALID_CATEGORIES at memory_store.py:97 — all as cited.
  • Internal links — all 13 same-page anchor links resolve to real headings (0 broken).
  • Cross-doc contract — tool-loader.mdx:358 does state recall_skill(goal) is "a vector search over procedures.embedding"; skill-format.mdx rows for description/license/version/tools_required sit exactly where the doc pins them.
  • Nav — docs.json is valid JSON; plans/skill-synthesis is registered under Ecosystem next to skill-format, consistent with the sibling.

No prompt-injection content detected in the diff — the "an implementer must not…" passages are legitimate spec directives aimed at future implementers, not at the reviewer.

Issues Found

🟢 Line-number pins into sibling prose docs will rot (skill-synthesis.mdx, many lines)
References into the codebase (memory.py:1206) are stable and worth keeping. References into sibling MDX docs — skill-format.mdx:151, tool-loader.mdx:358, agent-skills.mdx:193, etc. — are a maintainability hazard: prose reflows and renumbers far more readily than code, and there's no test guarding these the way tests/unit/test_amd_gaia_urls.py guards URL prefixes. They're all accurate today, so this is non-blocking, but they'll silently drift the first time those specs are edited. Consider dropping the :NNN suffix on cross-doc links and relying on the section anchor instead, which you already use elsewhere (e.g. [Skill Format](/plans/skill-format)):

[skill-format.mdx:151](…/skill-format.mdx) → [the description field](/plans/skill-format#frontmatter)

Code file:line pins can stay — they're the valuable part of the grounding.

Strengths

  • Grounding discipline is the standout. Marking every unwritten symbol PROPOSED, separating "exists today" from "not written yet" in the opening <Info>, and the Current state of the code table with a verified-absent row for the greenfield symbols — this is exactly how a design spec should distinguish reality from proposal, and it survives verification.
  • Actively reconciles against drift. The Correcting the original framing table and <Warning> retractions (re-pinning the hook to the real _run_memory_post_init, retracting the "new tool" and on-disk-when_to_use framing) directly target the failure mode the PR description names — a contributor building against stale issue notes.
  • Respects GAIA conventions it isn't even implementing yet — the fail-loud off-states table cites CLAUDE.md's no-silent-fallback rule (no smaller-model swap), and the emit/inject split keeps license/version as injected constants so synthesized files validate against the locked SKILL.md format specification with native Agent UI dashboard support #691 format rather than re-inventing it.

Verdict

Approve. No blocking issues. The one 🟢 nit (cross-doc line pins) is a forward-looking maintainability suggestion, not a merge gate. As the PR itself states, this lands the canonical design for maintainer sign-off — the five Open questions are the right things to settle at PR time, and @kovtcharov-amd is already the requested reviewer for that design call.

@kovtcharov
kovtcharov added this pull request to the merge queue Jun 18, 2026
Merged via the queue into amd:main with commit aa1b430 Jun 18, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants