AS AgentScopeAPI 手册 / API Reference

SkillAuditLog

public class SkillAuditLog
源码Source io/agentscope/harness/agent/skill/curator/SkillAuditLog.java:48–209

技能 Audit 日志,让智能体以受控方式调用外部能力。位于 io.agentscope.harness.agent.skill.curator 包。核心成员包括 append、query、manageEntry、promoteEntry、SkillAuditLog、AUDIT_DIR。

Append-only audit log for the skill self-learning loop. Every skill_manage write, promotion decision, and curator transition lands as one JSON line in workspace/skills/.audit/YYYY-MM-DD.jsonl.

This is intentionally separate from OTel / trace spans (which other code paths emit concurrently). The on-disk JSONL is the recovery / forensic copy: it survives OTel collector outages and gives operators a queryable record without standing up a metrics stack. agent.queryAudit(predicate) reads back every entry from the latest day file.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
Entry记录record
承载条目数据的记录类型。
A single audit row.

字段摘要Field Summary

字段Field类型Type说明Description
AUDIT_DIR
staticfinal
String
AUDIT 目录字段。
The AUDIT DIR field.

构造器摘要Constructor Summary

构造器Constructor说明Description
public SkillAuditLog(AbstractFilesystem filesystem, WorkspaceManager workspaceManager)
初始化 `SkillAuditLog` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public void append(Entry entry)
设置追加。
Append a new entry.
public List<Entry> query(String dayUtc, Predicate<Entry> filter)
执行查询相关操作。
Read the audit log for a given day, parse every line into `Entry`, then filter via the predicate.
public static Entry manageEntry(String actor, String name, String action, String draftOrMain, String verdict)
static
执行 `manageEntry` 方法。
Convenience builder for the common `skill_manage` entry shape.
public static Entry promoteEntry(String reviewer, String name, String decision, String scanVerdict, List<String> environments)
static
执行 `promoteEntry` 方法。
Convenience builder for the `promote` audit entry.

字段详情Field Detail

AUDIT_DIR

public static final String AUDIT_DIR
staticfinal

AUDIT 目录字段。声明为 public static final String AUDIT_DIR。

The AUDIT DIR field.

源码Source io/agentscope/harness/agent/skill/curator/SkillAuditLog.java:52

构造器详情Constructor Detail

SkillAuditLog

public SkillAuditLog(AbstractFilesystem filesystem, WorkspaceManager workspaceManager)

初始化 SkillAuditLog 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
filesystemAbstractFilesystem文件系统(类型 `AbstractFilesystem`)。The filesystem.
workspaceManagerWorkspaceManager工作区管理器(类型 `WorkspaceManager`)。The workspace manager.
源码Source io/agentscope/harness/agent/skill/curator/SkillAuditLog.java:67–70

方法详情Method Detail

append

public void append(Entry entry)

设置追加。

Append a new entry.

参数Parameters
名称Name类型Type说明Description
entryEntry条目(类型 `Entry`)。The entry.
源码Source io/agentscope/harness/agent/skill/curator/SkillAuditLog.java:87–138

query

public List<Entry> query(String dayUtc, Predicate<Entry> filter)

执行查询相关操作。

Read the audit log for a given day, parse every line into Entry, then filter via the predicate.

参数Parameters
名称Name类型Type说明Description
dayUtcStringday Utc(类型 `String`)。The day utc.
filterPredicate<Entry>过滤条件(类型 `Predicate`)。The filter.
返回Returns List<Entry>
返回列出。Returns list.
源码Source io/agentscope/harness/agent/skill/curator/SkillAuditLog.java:144–175

manageEntry

public static Entry manageEntry(String actor, String name, String action, String draftOrMain, String verdict)
static

执行 manageEntry 方法。

Convenience builder for the common skill_manage entry shape.

参数Parameters
名称Name类型Type说明Description
actorStringactor(类型 `String`)。The actor.
nameString名称(类型 `String`)。The name.
actionString动作(类型 `String`)。The action.
draftOrMainStringdraft 或主(类型 `String`)。The draft or main.
verdictStringverdict(类型 `String`)。The verdict.
返回Returns Entry
返回条目。Returns entry.
源码Source io/agentscope/harness/agent/skill/curator/SkillAuditLog.java:178–184

promoteEntry

public static Entry promoteEntry(String reviewer, String name, String decision, String scanVerdict, List<String> environments)
static

执行 promoteEntry 方法。

Convenience builder for the promote audit entry.

参数Parameters
名称Name类型Type说明Description
reviewerStringreviewer(类型 `String`)。The reviewer.
nameString名称(类型 `String`)。The name.
decisionString决策(类型 `String`)。The decision.
scanVerdictStringscan Verdict(类型 `String`)。The scan verdict.
environmentsList<String>环境(类型 `List`)。The environments.
返回Returns Entry
返回条目。Returns entry.
源码Source io/agentscope/harness/agent/skill/curator/SkillAuditLog.java:187–208

嵌套类详情Nested Class Detail

Entry

@JsonInclude(JsonInclude.Include.NON_NULL) public record Entry( Instant ts, String actor, String op, String target, String decision, String scanVerdict, String beforeHash, String afterHash, Map<String, String> ctx, Map<String, Object> extra)

承载条目数据的记录类型。位于 io.agentscope.harness.agent.skill.curator 包。核心成员包括 ts、actor、op、target、decision、scanVerdict。

A single audit row.

基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.