Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:AMAP ML SkillClaw ValidationStore

From Leeroopedia
Knowledge Sources
Domains Distributed_Storage, Job_Queue
Last Updated 2026-10-22 00:00 GMT

Overview

Concrete tool for persisting validation jobs, results, and decisions in shared object storage, provided by the SkillClaw client package.

Description

The ValidationStore class manages the storage lifecycle of distributed validation data. It stores job definitions (with candidate skill and replay cases) at `{prefix}validation_jobs/`, individual client results at `{prefix}validation_results/{job_id}/{user_alias}.json`, and final decisions at `{prefix}validation_decisions/`. The `list_open_jobs` method filters out jobs that already have a decision or have already been submitted by the given user.

Usage

Import and use when you need to:

  • Stage validation jobs for distributed clients
  • Submit and retrieve validation results from multiple clients
  • Record final publish/reject decisions for validation jobs
  • Query open jobs for a specific client

Code Reference

Source Location

  • Repository: SkillClaw
  • File: `skillclaw/validation_store.py:L28-191`

Signature

class ValidationStore:
    """Persist validation jobs/results/decisions in shared storage."""

    def __init__(
        self,
        *,
        backend: str,
        endpoint: str,
        bucket: str,
        access_key_id: str,
        secret_access_key: str,
        region: str = "",
        session_token: str = "",
        local_root: str = "",
        group_id: str = "default",
    ) -> None:

    @classmethod
    def from_config(cls, config) -> "ValidationStore":
        """Build from SkillClawConfig (uses object storage, not Nacos)."""

    def make_job_id(self, skill_name: str) -> str:
        """Generate a unique job ID from skill name + timestamp + UUID."""

    def save_job(self, job: dict[str, Any]) -> None:
        """Save a validation job and its candidate SKILL.md to storage."""

    def load_job(self, job_id: str) -> Optional[dict[str, Any]]:
        """Load a validation job by ID."""

    def list_jobs(self) -> list[dict[str, Any]]:
        """List all validation jobs."""

    def save_result(self, job_id: str, user_alias: str, result: dict[str, Any]) -> None:
        """Save a validation result from a specific client."""

    def load_result(self, job_id: str, user_alias: str) -> Optional[dict[str, Any]]:
        """Load a specific client's result for a job."""

    def list_results(self, job_id: str) -> list[dict[str, Any]]:
        """List all results for a job from all clients."""

    def save_decision(self, job_id: str, decision: dict[str, Any]) -> None:
        """Save the final decision (published/rejected) for a job."""

    def load_decision(self, job_id: str) -> Optional[dict[str, Any]]:
        """Load the decision for a job, if any."""

    def list_open_jobs(self, *, user_alias: str = "") -> list[dict[str, Any]]:
        """List jobs without a decision, excluding already-submitted by user."""

Import

from skillclaw.validation_store import ValidationStore

I/O Contract

Inputs

Name Type Required Description
backend str Yes Storage backend ("local", "s3", "oss")
bucket str Yes Storage bucket name
group_id str No Namespace prefix (default "default")
job dict Yes (save_job) Job with job_id, candidate_skill, replay_cases
job_id str Yes Job identifier
user_alias str Yes (save_result) Submitting client's alias
result dict Yes (save_result) Validation result with decision, score

Outputs

Name Type Description
save_job() writes Files Job JSON + candidate SKILL.md in shared storage
list_jobs() returns list[dict] All validation jobs
list_open_jobs() returns list[dict] Jobs without decision, not yet submitted by user
list_results() returns list[dict] All results for a job from all clients

Usage Examples

Server Stages Job

from skillclaw.validation_store import ValidationStore

store = ValidationStore(
    backend="s3",
    bucket="skillclaw-shared",
    access_key_id="AKIA...",
    secret_access_key="...",
    group_id="my-team",
)

job_id = store.make_job_id("python_deployment")
store.save_job({
    "job_id": job_id,
    "candidate_skill": {"name": "python_deployment", "content": "..."},
    "current_skill": {"name": "python_deployment", "content": "old..."},
    "replay_cases": [{"instruction": "How to deploy?"}],
    "min_score": 0.75,
})

Client Picks Up and Submits

# Client finds open jobs
jobs = store.list_open_jobs(user_alias="alice")

# After validation...
store.save_result(job_id, "alice", {
    "decision": "accept",
    "score": 0.85,
    "replay_summary": {...},
})

Server Finalizes

# Check all results for a job
results = store.list_results(job_id)
approvals = [r for r in results if r.get("decision") == "accept"]

if len(approvals) >= 2:
    store.save_decision(job_id, {"decision": "published", ...})

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment