SkillAuditLog
public class SkillAuditLog
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_DIRstaticfinal | 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
AUDIT 目录字段。声明为 public static final String AUDIT_DIR。
The AUDIT DIR field.
io/agentscope/harness/agent/skill/curator/SkillAuditLog.java:52构造器详情Constructor Detail
SkillAuditLog
public SkillAuditLog(AbstractFilesystem filesystem, WorkspaceManager workspaceManager)
初始化 SkillAuditLog 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
filesystem | AbstractFilesystem | 文件系统(类型 `AbstractFilesystem`)。The filesystem. |
workspaceManager | WorkspaceManager | 工作区管理器(类型 `WorkspaceManager`)。The workspace manager. |
io/agentscope/harness/agent/skill/curator/SkillAuditLog.java:67–70方法详情Method Detail
append
public void append(Entry entry)
设置追加。
Append a new entry.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
entry | Entry | 条目(类型 `Entry`)。The entry. |
io/agentscope/harness/agent/skill/curator/SkillAuditLog.java:87–138query
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.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
dayUtc | String | day Utc(类型 `String`)。The day utc. |
filter | Predicate<Entry> | 过滤条件(类型 `Predicate`)。The filter. |
List<Entry>io/agentscope/harness/agent/skill/curator/SkillAuditLog.java:144–175manageEntry
public static Entry manageEntry(String actor, String name, String action, String draftOrMain, String verdict)
执行 manageEntry 方法。
Convenience builder for the common skill_manage entry shape.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
actor | String | actor(类型 `String`)。The actor. |
name | String | 名称(类型 `String`)。The name. |
action | String | 动作(类型 `String`)。The action. |
draftOrMain | String | draft 或主(类型 `String`)。The draft or main. |
verdict | String | verdict(类型 `String`)。The verdict. |
Entryio/agentscope/harness/agent/skill/curator/SkillAuditLog.java:178–184promoteEntry
public static Entry promoteEntry(String reviewer, String name, String decision, String scanVerdict, List<String> environments)
执行 promoteEntry 方法。
Convenience builder for the promote audit entry.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
reviewer | String | reviewer(类型 `String`)。The reviewer. |
name | String | 名称(类型 `String`)。The name. |
decision | String | 决策(类型 `String`)。The decision. |
scanVerdict | String | scan Verdict(类型 `String`)。The scan verdict. |
environments | List<String> | 环境(类型 `List`)。The environments. |
Entryio/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.