一键导入
core-worker
Handles FIDES/AGIT integration, reversibility model, tool registry, and step middleware
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Handles FIDES/AGIT integration, reversibility model, tool registry, and step middleware
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
View and search the AGIT audit trail. Show timeline of all agent actions with signatures, reversibility classes, and verification links.
Cryptographic signing + audit trail for every tool call. FIDES Ed25519 signatures + AGIT commit log. Every action is signed before execution, committed to an immutable audit trail, and classified into a reversibility class.
Undo, cancel, or compensate agent actions. Manages the 5-class reversibility model for all tool executions.
Handles sandbox (Daytona/E2B), browser automation (Steel), computer use, and tier gating
Handles infrastructure, database, auth, and build system features
Handles Stripe billing, BYOK vault, GAIA eval, analytics, landing page, and deploy prep
| name | core-worker |
| description | Handles FIDES/AGIT integration, reversibility model, tool registry, and step middleware |
NOTE: Startup and cleanup are handled by worker-base. This skill defines the WORK PROCEDURE.
Features involving: FIDES SDK integration, AGIT SDK integration, ReversibilityClass types, tool registry, step middleware, guard chain integration, dangerous tools denylist.
None.
Read context: Read mission.md, .factory/library/architecture.md, .factory/research/ai-sdk-v6-agent.md. Read the FIDES SDK source at ~/fides/packages/sdk/src/ and AGIT SDK source at ~/agit/ts-sdk/src/ to understand their APIs. Key exports:
Fides, signRequest, verifyRequest, generateKeyPair, generateDID, AgitCommitSignerAgitClient, AgitFidesClient, Commit, AgentState, ActionTypeWrite tests first (TDD): For every module, write failing tests before implementation. FIDES/AGIT modules should be testable with mock keys (no external services needed). Use generateKeyPair() to create test keys.
Implement types precisely: The reversibility model types must be exact:
type ReversibilityClass = 'undoable' | 'cancelable_window' | 'compensatable' | 'approval_only' | 'irreversible_blocked';
Do not deviate from this taxonomy. The spec is very specific about these 5 classes.
Tool registry pattern: Create a proper registry at services/api/src/tools/registry.ts where each tool must have:
classify(args) → ReversibilityMetadataexecute(args) → Promise<result>reverse?(args) → Promise<result> (optional)
Unknown tools MUST default to irreversible_blocked (fail-closed).Step middleware: The runToolStep() function at services/api/src/orchestrator/step.ts enforces:
classify → FIDES sign → AGIT pre-commit → execute → AGIT post-commit
If any pre-execution step fails, the tool MUST NOT execute.
Verify:
cd services/api && bunx vitest run)bun run build passesbiome check . passesCommit atomically: Conventional commits (feat(governance):, feat(reversibility):, etc.).
{
"salientSummary": "Linked @fides/sdk and @agit/sdk as local deps, created governance/fides.ts with signToolCall/counterSignWithUser, created audit/agit.ts with commitAction/revertAction via AgitFidesClient, created reversibility types, built tool registry at tools/registry.ts, and step middleware at orchestrator/step.ts. All 28 tests passing, build clean.",
"whatWasImplemented": "services/api/src/governance/fides.ts — singleton Fides instance with signToolCall() and counterSignWithUser(). services/api/src/audit/agit.ts — AgitFidesClient wrapper with commitAction() (pre/post commit), revertAction(), per-user branches. services/api/src/reversibility/types.ts — ReversibilityClass, ReversibilityMetadata, RollbackStrategy, BADGE_COLORS. services/api/src/tools/registry.ts — ToolRegistry with classify/execute/reverse, fail-closed default. services/api/src/orchestrator/step.ts — runToolStep enforcing sign→commit→execute→commit chain.",
"whatWasLeftUndone": "",
"verification": {
"commandsRun": [
{ "command": "cd services/api && bunx vitest run", "exitCode": 0, "observation": "28 new tests + existing tests all passing" },
{ "command": "bun run build", "exitCode": 0, "observation": "Build clean" },
{ "command": "biome check .", "exitCode": 0, "observation": "No errors" }
],
"interactiveChecks": []
},
"tests": {
"added": [
{ "file": "services/api/src/governance/__tests__/fides.test.ts", "cases": [
{ "name": "signToolCall produces verifiable record", "verifies": "Ed25519 signing with mock keys" },
{ "name": "counterSignWithUser appends user signature", "verifies": "Dual signature flow" }
]},
{ "file": "services/api/src/orchestrator/__tests__/step.test.ts", "cases": [
{ "name": "runToolStep enforces full invariant chain", "verifies": "classify→sign→pre-commit→execute→post-commit order" },
{ "name": "approval_only pauses execution", "verifies": "Creates approval, no execute" },
{ "name": "irreversible_blocked refuses", "verifies": "No execute, no approval" }
]}
]
},
"discoveredIssues": []
}
.factory/research/