Class SkillUsageStore
java.lang.Object
io.agentscope.harness.agent.skill.curator.SkillUsageStore
Sidecar telemetry store for per-skill usage and provenance.
Persists SkillUsageRecord instances (one per skill). The default backend stores all
records in a single JSON file at <workspace>/skills/.usage.json; when constructed with
a BaseStore, each skill is stored under ["skills", "usage"] with CAS updates.
Provenance gate: counter mutators (bumpView/bumpUse/bumpPatch) silently skip skills
that are not agent-created. This avoids polluting telemetry for bundled / hub-installed /
user-authored skills, matching the hermes-agent skill_usage._mutate behavior.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault workspace-relative path for the filesystem sidecar. -
Constructor Summary
ConstructorsConstructorDescriptionSkillUsageStore(AbstractFilesystem filesystem) SkillUsageStore(AbstractFilesystem filesystem, String relativePath) -
Method Summary
Modifier and TypeMethodDescriptionAll records whosecreatedByis non-null (i.e. agent-authored, draft or live).static SkillUsageStoreCreates a store backed by a distributedBaseStore(one key per skill).voidvoidvoidvoidDrop the record entirely.Read a single record by name.load()Load the entire sidecar map.voidmarkAgentCreated(String name, String reviewerId, List<String> environments) Mark a skill as a fully agent-created (i.e. promoted from draft).voidmarkAgentDraft(String name, String sessionId) Tag a freshly-created agent draft (called fromSkillManageTool.create).voidsave(Map<String, SkillUsageRecord> data) Persist the entire sidecar map.voidvoidsetState(String name, SkillUsageRecord.State newState)
-
Field Details
-
DEFAULT_RELATIVE_PATH
Default workspace-relative path for the filesystem sidecar.- See Also:
-
-
Constructor Details
-
SkillUsageStore
-
SkillUsageStore
-
-
Method Details
-
baseStore
Creates a store backed by a distributedBaseStore(one key per skill). -
load
Load the entire sidecar map. Returns an empty map on missing / unreadable / corrupt. -
save
Persist the entire sidecar map. Best-effort on failure. -
get
Read a single record by name. -
bumpView
-
bumpUse
-
bumpPatch
-
markAgentDraft
Tag a freshly-created agent draft (called fromSkillManageTool.create). -
markAgentCreated
Mark a skill as a fully agent-created (i.e. promoted from draft). Used bySkillManageToolwhenautoPromote=true(no staging) and by the future promotion gate. -
setState
-
setPinned
-
forget
Drop the record entirely. Called when a skill is archived / deleted permanently. -
agentCreatedReport
All records whosecreatedByis non-null (i.e. agent-authored, draft or live).
-