Version 1.0
CodeAnvil / CodeAnvil Kernel / CKIMS / X-CodeAnvil
CodeAnvil 将声明转化为受治理的运行状态;X-CodeAnvil 将未知可能性转化为受治理的 X。
CodeAnvil Model Charter
Version: 1.0
Status: active foundation model
Date: 2026-07-21
System Thesis
CodeAnvil 将声明转化为受治理的运行状态。X-CodeAnvil 将未知可能性转化为受治理的 X。
CodeAnvil turns declarations into governed runtime state. X-CodeAnvil turns unknown possibilities into governed X.
Canonical Judgment
CodeAnvil, CodeAnvil Kernel, CKIMS, and X-CodeAnvil are not four peer products.
The stable model is:
1. CodeAnvil is the programmable infrastructure and execution system.
2. CodeAnvil Kernel is the deterministic execution kernel inside CodeAnvil.
3. CKIMS is the Human + Agent control plane for operating CodeAnvil.
4. X-CodeAnvil is the external X forge and operation system built on top of CodeAnvil.
5. In CKIMS, created systems are called `instances`; in world narrative and brand language, the created thing is called `X`.
Layer Order
Human / Codex / External Systems / Unknown Intent
|
v
X-CodeAnvil
|
v
CodeAnvil
|
+-- CKIMS
+-- Platform Services
+-- State, Event, Policy, Artifact, Release, Domain Ledgers
|
v
CodeAnvil Kernel
|
v
Cloudflare Application Ecosystem
Non-Negotiable Invariants
1. CodeAnvil can run without X-CodeAnvil.
2. X-CodeAnvil obtains digital runtime capability through CodeAnvil.
3. CodeAnvil Kernel is an internal deterministic kernel, not the public product name.
4. CKIMS is a control plane, not a public entity interface.
5. X-CodeAnvil must not bypass CodeAnvil to mutate Cloudflare resources.
6. Kernel must not own X business meaning, value judgment, or governance semantics.
7. Every state change has principal, plan, authorization, execution, verification, and evidence.
8. Cloudflare is the current runtime substrate, not the domain identity of CodeAnvil.
9. Codex is the current primary Agent Operator, not the only possible agent.
10. Conversation is never the final source of truth; it is compiled into model, plan, decision, ledger, or evidence.
11. CKIMS object vocabulary uses `instance`; public/world vocabulary uses `X`.
12. `x-codeanvil.io` is the X-CodeAnvil brand IO and must be governed as a CodeAnvil foundation domain asset.
Source Of Truth
The CodeAnvil Model document system is the upper document authority. CKIMS and Kernel ledgers are the runtime authority. Local Work files are temporary intake material only.
Naming And Terminology
Official Names
| Name | Role | Chinese Definition |
| CodeAnvil | Infrastructure and execution system | 用于部署、运行、治理和观察数字系统的可编程基础设施与执行系统 |
| CodeAnvil Kernel | Deterministic execution kernel | CodeAnvil 内部负责验证、计划、执行、协调、记录和校准基础设施状态变更的确定性执行内核 |
| CKIMS | Control plane | CodeAnvil Kernel & Infrastructure Management System,Human + Agent 操作 CodeAnvil 的控制面 |
| X-CodeAnvil | X forge system | 锻造未知事物的接口;X 的定义、锻造、部署、运行与演化基础设施 |
| X | World narrative object | CodeAnvil 在 CKIMS 上创建的世界叙事对象;在系统治理、资源分配和运行时账本中映射为 `instance` |
| Instance | System object | CKIMS 中被申请、计划、分配资源、部署、运行和审计的系统对象;对外叙事可表现为 X |
| X-CodeAnvil IO | Brand IO | `x-codeanvil.io`,X-CodeAnvil 的品牌 IO 与 CodeAnvil 模型/仪表盘/操作系统入口域 |
Boundary Rules
Required Object Vocabulary
| Term | Meaning |
| Principal | Human, Agent, service, or X identity that can be authenticated and authorized |
| Workseat | Scoped operating role used by Human or Agent |
| Desired State | Declared target state |
| Actual State | Provider-observed runtime state |
| Plan | Ordered, explainable transition from actual to desired state |
| Approval | Explicit authorization bound to a target |
| Execution | A concrete attempt to apply an approved plan |
| Evidence | Machine-readable proof of source, action, verification, or result |
| X Manifest | Canonical root specification for a governed X entity |
| X Runtime Instance | CKIMS instance created from an X Manifest and governed by CodeAnvil Kernel |
Forbidden Naming Patterns
System Architecture
CodeAnvil
CodeAnvil accepts declarations, policies, artifacts, approvals, and operating commands. It returns governed runtime state, deployment evidence, resource state, audit history, and reconciliation signals.
Core planes:
CodeAnvil Kernel
Kernel standard loop:
Declare -> Validate -> Diff -> Plan -> Authorize -> Apply
^ |
| v
Reconcile <- Observe <- Record <- Verify <---------
Kernel is deliberately narrow. It receives authorized state changes, produces plans, applies provider operations through controlled drivers, verifies results, records evidence, and reconciles drift.
CKIMS
CKIMS exposes the same governed fact surface to Human and Agent operators:
CKIMS does not replace Cloudflare Dashboard. It defines which provider actions are allowed, why they are allowed, who approved them, what evidence exists, and how any future operator continues.
X-CodeAnvil
X-CodeAnvil turns unknown inputs into X Manifest and governed X:
Unknown -> Candidate X -> Specified X -> Forgeable X -> Commissioned X -> Operational X -> Evolved X
The digital runtime portion of X is compiled into CodeAnvil deployment specifications and becomes a CKIMS `instance` when approved. X meaning, business logic, governance, metrics, and evolution remain in X-CodeAnvil.
Contract Between X-CodeAnvil And CodeAnvil
| Contract | Direction | Meaning |
| Capability Catalog | CodeAnvil -> X-CodeAnvil | Current infrastructure capability and constraints |
| Deployment Specification | X-CodeAnvil -> CodeAnvil | Compiled runtime request |
| Plan And Risk Report | CodeAnvil -> X-CodeAnvil | Diff, cost, risk, approval requirements |
| Authorization Decision | Human/X-CodeAnvil -> CodeAnvil | Approval, rejection, or conditions |
| Runtime State | CodeAnvil -> X-CodeAnvil | Health, version, cost, resource, deployment state |
| X Context | X-CodeAnvil -> CodeAnvil | X identity, budget, owner, lifecycle boundary; CKIMS stores runtime governance as an instance |
Cloudflare Provider Model
Cloudflare is the current CodeAnvil runtime substrate. CodeAnvil should be Cloudflare-native first, while keeping its domain model independent from Cloudflare product names.
Provider Planes
| CodeAnvil Plane | Cloudflare Capabilities | CodeAnvil Use |
| Domain Entry | Registrar, DNS, Proxy, Routes | Brand domains, endpoint routing, actual-domain vs child-record governance |
| Performance And Availability | Cache, CDN, Smart Routing, Load Balancing | Traffic posture and production readiness |
| Security | WAF, Rate Limiting, API Shield, Turnstile | Edge and API protection policy |
| Runtime | Workers, Pages, Containers, Workers for Platforms | APIs, consoles, future hosted instances |
| Data And State | D1, R2, KV, Durable Objects, Hyperdrive | Ledgers, objects, config, coordination, external DB acceleration |
| Automation | Queues, Workflows, Cron Triggers | Async work, durable multi-step execution, retries |
| AI | Workers AI, AI Gateway, Vectorize, AI Search, Agents | Optional acceleration and model mediation |
| Zero Trust | Access, Tunnel, SWG, DLP, RBI, CASB | Human/Agent access, private connectivity, future VPN-like posture |
Current CKIMS Interpretation
Binding Rule
When running inside Workers or Pages Functions, Cloudflare bindings are preferred over REST API calls for bound resources. REST API access remains a provider administration path used by local owner-deploy scripts and must be governed by provider contracts and LocalOnly secrets.
Provider Execution Policy
Provider-side create, change, delete, or route mutation requires:
1. Resource plan.
2. Owner approval.
3. Active provider execution policy.
4. Active runbook.
5. Rollback or compensation evidence.
6. Deployment ledger record.
7. Route smoke and inventory audit.
8. Audit log.
Security, Governance, And Audit
Principal Model
Human, Codex, autonomous agents, services, and X entities are principals. They operate through scoped workseats or service contracts.
Core Rules
Risk Scale
| Risk | Meaning | Default |
| R0 | Read-only | Automated allowed |
| R1 | Reversible development change | Fast review or policy auto-approval |
| R2 | Production reversible change | Plan and explicit approval |
| R3 | Data, deletion, cost, or access impact | Owner approval plus backup/rollback |
| R4 | Irreversible, legal, capital, entity termination | Human Principal only |
Evidence Chain
Intent
-> Plan
-> Approval
-> Provider Execution Policy
-> Runbook
-> Deployment / Change Record
-> Verification
-> Audit
-> Continuation State
Identity Mapping
Cloudflare Access identity must be mapped into CKIMS workseats through `identity_mappings`. Owner capability is never inferred from email alone unless the mapping is active and audited.
Break-Glass
Emergency access must include:
Implementation Roadmap
Phase 0: Constitution
Deliver:
Exit condition: any Codex entering CodeAnvil can read the model, understand the hierarchy, and continue without guessing.
Phase 1: CodeAnvil Spine
Deliver:
Exit condition: a governed Cloudflare surface can be planned, approved, deployed, verified, audited, and rolled back.
Phase 2: Governed Operations
Deliver:
Exit condition: routine operations no longer depend on ad hoc Codex reasoning.
Phase 3: X Forge
Deliver:
Exit condition: X-CodeAnvil can define an X and ask CodeAnvil to produce its governed runtime.
Phase 4: X Operations
Deliver:
Exit condition: X operational meaning and CodeAnvil infrastructure facts are connected but not confused.
Phase 5: Evolution And Portfolio
Deliver:
Exit condition: multiple X entities can evolve while preserving model, evidence, and audit.
Domain And Surface Registry
Brand Domain
`x-codeanvil.io` is the planned X-CodeAnvil brand IO and the governed parent domain for public or semi-public CodeAnvil model surfaces.
This domain is a CodeAnvil foundation asset. Its subdomains are created through CKIMS resource plans and domain records, not ad hoc dashboard edits.
Planned Subdomains
| Host | Role | Surface |
| `www.x-codeanvil.io` | X-CodeAnvil brand front | Public X narrative front |
| `docs.x-codeanvil.io` | CodeAnvil document system | Model, standards, runbooks |
| `model.x-codeanvil.io` | CodeAnvil Model canonical entry | Model index and architecture docs |
| `ckims.x-codeanvil.io` | CKIMS controlled entry | Access-protected control plane |
| `os.x-codeanvil.io` | CKIMS Governance OS | Access-protected operating console |
| `dashboard.x-codeanvil.io` | Dashboards | Future governed dashboard surfaces |
| `visual.x-codeanvil.io` | Visualization assets | Future governed visualization registry |
| `api.x-codeanvil.io` | API entry | Future provider-routed API entry |
X / Instance Rule
Public language uses X. CKIMS system language uses `instance`.
An X becomes operational only when CKIMS has an instance request, resource plan, security profile, allocation records, deployment evidence, and audit trail. Domains and subdomains are assigned by CKIMS to infrastructure or instances; no X receives ad hoc DNS or storage.
Actual Domain Rule
Actual domain count comes from CKIMS foundation assets with `asset_type=domain` only.
DNS records, Pages URLs, Worker default domains, Access application domains, aliases, routes, and deployment URLs are child records/evidence.
Creation Rule
No subdomain becomes official until it has:
1. Domain asset or parent domain record.
2. Resource plan.
3. Surface record.
4. Owner approval when public or production.
5. Deployment or route record.
6. Audit entry.