Skip to content

feat(index): auto-ship + protect the mandatory escurel meta-skill#116

Merged
jrosskopf merged 1 commit into
mainfrom
index/meta-skill-autoship
May 30, 2026
Merged

feat(index): auto-ship + protect the mandatory escurel meta-skill#116
jrosskopf merged 1 commit into
mainfrom
index/meta-skill-autoship

Conversation

@jrosskopf
Copy link
Copy Markdown
Contributor

Summary

Closes audit finding #1 (spec→impl): the mandatory escurel
meta-skill — the agent's in-corpus documentation of the tool surface,
discovery policy and navigation model (locked decision 3,
docs/contract/agent-interface.md) — was never seeded into tenants and
was unprotected from removal.

  • Embed the canonical meta-skill markdown (meta_skill.md) and the
    protection rules (meta_skill.rs).
  • Auto-ship via Indexer::ensure_meta_skill() — idempotent, wired
    at indexer open (binary boot through config.rs and the test
    harness) so every served tenant exposes it. No-op when the tenant
    already carries an escurel skill, so operators may ship their own
    extended version (e.g. the crm-demo's CRM-specific one).
  • Protect on write: update_page on the meta-skill page rejects a
    rewrite that drops the skill identity (id: escurel, type: skill)
    or removes a section the established meta-skill already carries —
    operators append, never remove. MCP and gRPC return the contract
    {ok:false, issues:[{code:"meta_skill_protected"}]} shape rather than
    a transport error.

Design note: the guard's protected baseline is whatever sections the
established meta-skill has
(empty on first write), not a hardcoded
canonical list — so a tenant that legitimately ships a customized
meta-skill (the crm-demo) keeps its own sections protected. create
on the admin TenantStore stays "empty at create time"; the meta-skill
is guaranteed at first serve, which keeps tenant export/import
deterministic.

Test plan

  • crates/escurel-index/src/meta_skill.rs unit tests — section
    retention, identity, first-write establishment, append accepted.
  • crates/escurel-server/tests/meta_skill.rs (new, no-mock) — a fresh
    tenant ships the meta-skill and its body is expandable; removing a
    standard section is rejected with a meta_skill_protected issue;
    appending tenant guidance is accepted.
  • Updated existing skill-count / page-count assertions across the suite
    for the +1 (grpc_read_tools, mcp, client_roundtrip,
    grpc_admin_streaming rebuild, facade).
  • Local gate green: cargo fmt --check, cargo clippy --workspace --all-targets -D warnings, cargo test --workspace --all-targets,
    cargo build --workspace --release.

🤖 Generated with Claude Code

Every tenant must ship the `escurel` meta-skill — the agent's in-corpus
documentation of the tool surface and navigation model (locked decision
3, docs/contract/agent-interface.md). The audit found it was never
seeded and was unprotected.

- Embed the canonical meta-skill markdown (meta_skill.md) + protection
  rules (meta_skill.rs).
- `Indexer::ensure_meta_skill()` idempotently writes + indexes it; wired
  at indexer open (binary boot via config.rs and the test harness) so
  every served tenant exposes it. No-op when the tenant already carries
  an `escurel` skill (operators may ship their own extended version).
- Protect it on write: `update_page` on the meta-skill page rejects a
  rewrite that drops the skill identity or removes an established
  section (operators append, never remove). MCP + gRPC return the
  `{ok:false, issues:[meta_skill_protected]}` contract shape.

Test plan:
- crates/escurel-index/src/meta_skill.rs unit tests (section retention,
  identity, first-write establishment).
- crates/escurel-server/tests/meta_skill.rs: fresh tenant ships it;
  removing a section is rejected; appending guidance is accepted.
- Updated existing skill-count assertions across the suite for the +1.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jrosskopf jrosskopf merged commit c4548f9 into main May 30, 2026
1 check passed
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