-
Notifications
You must be signed in to change notification settings - Fork 1
Runtime Invariants
Upstream's configurable assertion registry and Edge's platform-specific invariant contracts.
Upstream reference: Runtime Invariants
The package provides — a configurable registry where each workspace package publishes runtime checks under its npm name. Key design points:
-
Scope: checks examine authoritative event streams or mutable data, never whether services or methods exist.
- Selection: toggle + / regex patterns. Blocklist wins.
- Isolation: each installer runs in a dedicated cordis child fiber. Failures produce attributed to the violating package.
- Convention: every workspace package provides a companion plugin, verified by toolchain.
is present in the standalone dependency closure (transitive via other upstream packages) but not explicitly installed as a plugin. No call exists. Upstream companion invariant plugins are not registered.
Edge defines its own invariant contracts in (lines 30–39), enforced by code review and CI rather than by the runtime registry. These cover platform-specific guarantees that upstream's package-scoped assertion model doesn't address:
| Invariant | Enforcement |
|---|---|
| No correlated subqueries on request paths — DO SQL queries must use materialized tables, never per-row scans against unbounded event tables | Code review + |
| Credential safety — never log , bearer tokens, or owner cookies. Provider credentials are per-call resolved, never cached across requests or written to session events | design + code review |
| Projection delivery ordering — projections for seq N arrive after their backing frame and after flush | Sync capture + seq-matched drain in |
| DO SQL atomicity — event batches and summary updates commit in a single | transaction boundary |
| Single upstream version — all standalone dependencies pin one exact version | CI + |
| Gzip budget — direct mode Worker must stay below 921,600 bytes gzip | Build script budget check |
| Patch discipline — every retained upstream patch has a version-bound filename, failing-without-it test, rationale, and removal condition | Code review + patch verification script |
| cordis sub-registry provide — + must be paired when another plugin uses | Code review (learned from ) |
- Upstream's package API, type, and companion plugin convention
- Session event ordering and append-only guarantees (upstream class)
- Flush/checkpoint contracts (upstream interface)
| Component | Category | Notes |
|---|---|---|
| registry | Available | In dependency closure but not installed as plugin |
| AGENTS.md contracts | Edge-specific | 8 platform invariants enforced by review + CI |
| DO SQL constraints | Edge-specific | tables, constraints, |
Key observation: Upstream's invariant system is a runtime assertion registry scoped to package-level checks. Edge's invariants are platform-level contracts (SQL atomicity, credential safety, projection ordering) that operate at a different layer. The two are complementary — upstream's registry could be installed to add per-package runtime checks without conflicting with Edge's structural invariants.
- Home
- Architecture
- Core & Scope
- Session & Persistence
- Model & Context
-
Execution & Tools
- Tools
- Bash
- Subprocess 🚫
- PTY Session 🚫
- Background Jobs 🚫
- Filesystem
- LSP Navigation 🚫
- Code Runtime 🚫
-
Web Access
⚠️ -
Skills
⚠️ - Workflow 🚫
- Subagent 🚫
-
Policy & Interaction
- Goal
- Approval 🚫
- Permission Presets 🚫
-
Sandbox
⚠️ - Plan Mode 🚫
- User Interaction 🚫
- Commands 🚫
- Schedule 🚫
- Message Feedback 🚫
- Platform & Access
- Development
- 首页
- 架构
- 核心与作用域
- 会话与持久化
- 模型与上下文
- 执行与工具
- 策略与交互
- 平台与接入
- 开发