
Product
PHP and Composer Support Is Now in Beta
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.
ark-runtime-kernel
Advanced tools
Architectural Runtime Kernel — governance for Hexagonal + Event-Driven + DDD systems
Make your architecture a machine-readable, enforceable contract —
respected by AI agents at write time, CI at merge time, and the runtime itself.
Zero runtime dependencies · TypeScript-first · Hexagonal + Event-Driven + DDD governance kernel
Quick Start · The Three Gates · AI Write Gate · CI Gate · Docs
flowchart LR
A["✍️ Write Time<br/>AI Agents"] -->|ark-mcp + validate_code| B["🚫 Blocked"]
A -->|valid| C["💾 Disk"]
D["🔀 Merge Time<br/>CI / PRs"] -->|ark-check| E["❌ Fail"]
D -->|valid| F["✅ Merge"]
G["⚙️ Runtime<br/>In-process"] -->|createArkKernel<br/>strict defaults| H["🛡️ Enforce<br/>contracts + layers"]
G --> I["📊 Observability<br/>+ Manifest"]
style A fill:#e0f2fe,color:#0c4a6e
style D fill:#fef3c7,color:#92400e
style G fill:#dcfce7,color:#166534
One config. Three enforcement moments.
| Gate | Tool | When it runs | What it enforces |
|---|---|---|---|
| Write | ark-mcp | Agent PreToolUse (Write/Edit) | Layer rules, unknown intents, forbidden patterns |
| Merge | ark-check | CI (GitHub Actions etc.) | Cross-layer imports + intent references (real TS resolver) |
| Runtime | createArkKernel() | Running process | Intent registry, event contracts, observed layer flow, policies |
npm install -D ark-runtime-kernel typescript
npx ark-check --init # detects your folders and writes ark.config.json
npx ark-check --root . --config ark.config.json --strict-config
npx ark-mcp --root . --config ark.config.json
Bind --hook mode to your agent's PreToolUse for Write/Edit (see full docs below).
The same
ark.config.jsonpowers all three gates.
Ark turns architecture from diagrams + good intentions into executable contracts.
Domain.Order.OrderPlaced, Application.PlaceOrder) with declared produces/dependsOn relationships.'hard' | 'soft' | 'off') of actual producer → event flows against your layer rules.ark.manifest().toJSON() → complete machine-readable contract for agents and tools.ark-check (deep) + ark-mcp + ESLint plugin.Hard at runtime (governed paths only):
hard)CI (with ark-check):
publish() callssource on strict publishesEverything else is out of scope unless you route it through Ark or cover it with config + CI.
import { createArkKernel } from 'ark-runtime-kernel';
const ark = createArkKernel(); // or createStrictArkKernel()
// 1. Define intents
const OrderPlaced = ark.registry.define<
'Domain.Order.OrderPlaced',
{ orderId: string; amount: number }
>('Domain.Order.OrderPlaced');
ark.registry.define<'Application.PlaceOrder', { orderId: string }>(
'Application.PlaceOrder',
{ produces: ['Domain.Order.OrderPlaced'] }
);
// 2. Register contracts (optional but powerful)
ark.eventContracts.register({
intent: 'Domain.Order.OrderPlaced',
version: '1',
allowAdditionalFields: false,
schema: {
orderId: { type: 'string', required: true },
amount: { type: 'number', required: true },
},
});
// 3. Projections (read models)
ark.projections.register({
name: 'OrderIds',
sourceIntents: ['Domain.Order.OrderPlaced'],
initialState: { ids: [] as string[] },
project: (event, state) => ({
ids: [...state.ids, event.payload.orderId as string],
}),
});
// 4. Publish through source-bound publisher (recommended)
const publisher = ark.publisher('Application.PlaceOrder');
await publisher.publish(OrderPlaced, { orderId: 'o1', amount: 129 }, {
eventVersion: '1',
correlationId: 'corr-xyz',
});
console.log(await ark.projections.getState('OrderIds'));
console.log(ark.observability.report());
console.log(JSON.stringify(ark.manifest().toJSON(), null, 2));
See examples/basic/ for a runnable version.
ark-mcp)The killer feature for agentic coding.
In Claude Code (.claude/settings.json):
{
"hooks": {
"PreToolUse": [{
"matcher": "Write|Edit|MultiEdit",
"hooks": [{
"type": "command",
"command": "npx ark-mcp --hook --root \"$CLAUDE_PROJECT_DIR\""
}]
}]
}
}
When blocked, the agent gets the violations back as feedback and can fix + retry.
npx ark-mcp --root . --config ark.config.json
Exposes:
ark://manifestvalidate_code(source, layer?, filePath?)Register in .mcp.json.
ark-check — The CI Gate# Basic
npx ark-check --root . --config ark.config.json
# Fail on coverage gaps too
npx ark-check --root . --config ark.config.json --strict-config
# JSON for tools
npx ark-check --json
What it catches (via real TypeScript resolution):
--init generates a real config from the directories that actually exist in your project.
// eslint.config.js
import ark from 'ark-runtime-kernel/eslint';
export default [
ark.configs.recommended,
];
Rules:
ark/no-domain-infra-importsark/no-raw-event-publishark/require-publish-source| ✅ Ark is | ❌ Ark is not |
|---|---|
| Runtime + CI + AI governance kernel | Database or queue |
| Enforceable architectural contract | Full distributed workflow engine |
| Machine-readable manifest for agents | Replacement for your domain logic |
| Zero-dependency TypeScript library | Complete semantic / type analyzer |
| Observable drift + history | OpenTelemetry implementation |
| Focused, explicit, pluggable | Magic that covers code you never route |
The built-in profile + ark.config.json give you a sane default taxonomy:
DomainModel → ApplicationOrchestration → PersistenceAdapters → ... (and 8 more)
You can customize freely. Rules are deny-by-default except for a few explicitly allowed flows.
All stores (Audit, Outbox, Projections, Workflow) default to in-memory.
See docs/production-hardening.md for the interface contracts you must implement for durability.
ark-mcp into Claude Code, Cursor, and other agent runtimesAuditStore, OutboxStore, …)ark.config.json starting pointexamples/basic/ (kernel tour) and examples/publish-smoke/ (consumer smoke test)npm install
npm run typecheck
npm run check:architecture
npm test
npm run build
Release process (already scripted):
npm run release:npm # full verify + publish
npm run release:npm -- --dry # dry run
The release script:
MIT © Pedro Knigge
Ark doesn't generate architecture. It protects the architecture you already have — at the exact moments it matters most.
Built for teams that use AI heavily and refuse to let entropy win.
FAQs
Architecture co-pilot for AI TypeScript: write gate, CI gate, plan/loop (package name ark-runtime-kernel is historical)
The npm package ark-runtime-kernel receives a total of 71 weekly downloads. As such, ark-runtime-kernel popularity was classified as not popular.
We found that ark-runtime-kernel demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Product
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.

Product
Socket is bringing experimental protection to Firefox, scanning 97,000+ extensions in Mozilla's official directory for malware and risky updates.

Research
/Security News
Three compromised Rust crates pulled in a malicious dependency that downloaded and executed cross-platform malware during Cargo builds.