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

NameRoleChinese Definition
CodeAnvilInfrastructure and execution system用于部署、运行、治理和观察数字系统的可编程基础设施与执行系统
CodeAnvil KernelDeterministic execution kernelCodeAnvil 内部负责验证、计划、执行、协调、记录和校准基础设施状态变更的确定性执行内核
CKIMSControl planeCodeAnvil Kernel & Infrastructure Management System,Human + Agent 操作 CodeAnvil 的控制面
X-CodeAnvilX forge system锻造未知事物的接口;X 的定义、锻造、部署、运行与演化基础设施
XWorld narrative objectCodeAnvil 在 CKIMS 上创建的世界叙事对象;在系统治理、资源分配和运行时账本中映射为 `instance`
InstanceSystem objectCKIMS 中被申请、计划、分配资源、部署、运行和审计的系统对象;对外叙事可表现为 X
X-CodeAnvil IOBrand IO`x-codeanvil.io`,X-CodeAnvil 的品牌 IO 与 CodeAnvil 模型/仪表盘/操作系统入口域

Boundary Rules

  • CodeAnvil is not equal to CKIMS.
  • CodeAnvil is not equal to CodeAnvil Kernel.
  • CKIMS is not an instance.
  • Future created systems are CKIMS instances; in world narrative they are X.
  • Enterprise, dashboard, portal, visualization, VPN, and application are future instance types or X meanings, not top-level CKIMS allocation targets.
  • X-CodeAnvil is not a Cloudflare dashboard and not a generic CMS.
  • X is a governed world narrative root object, not a loose project folder.
  • Required Object Vocabulary

    TermMeaning
    PrincipalHuman, Agent, service, or X identity that can be authenticated and authorized
    WorkseatScoped operating role used by Human or Agent
    Desired StateDeclared target state
    Actual StateProvider-observed runtime state
    PlanOrdered, explainable transition from actual to desired state
    ApprovalExplicit authorization bound to a target
    ExecutionA concrete attempt to apply an approved plan
    EvidenceMachine-readable proof of source, action, verification, or result
    X ManifestCanonical root specification for a governed X entity
    X Runtime InstanceCKIMS instance created from an X Manifest and governed by CodeAnvil Kernel

    Forbidden Naming Patterns

  • Do not call CKIMS an enterprise management system.
  • Do not call CodeAnvil Kernel a public brand surface.
  • Do not count DNS records, Pages URLs, Worker default domains, or Access domains as actual domains.
  • Do not use enterprise, application, or dashboard as CKIMS allocation target types. Use `instance` or `infrastructure`.
  • Do not rename CKIMS instances to enterprise objects in system ledgers. Use enterprise only as an `instance_type`, request purpose, or X semantic layer when needed.
  • Do not treat `x-codeanvil.io` as a random deployment domain. It is the governed X-CodeAnvil brand IO.
  • 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:

  • Identity and Workseat
  • Resource Registry
  • Domain and Surface Registry
  • State and Event Ledger
  • Policy and Authorization
  • Artifact and Release Registry
  • Workflow and Job Services
  • Observability and FinOps
  • Recovery and Rollback
  • Cloudflare Provider Layer
  • 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:

  • Panorama
  • Governance OS
  • Resource plans
  • Domains
  • Foundation assets
  • Provider contracts
  • Runbooks
  • Approvals
  • Work queue
  • Operations and audit
  • 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

    ContractDirectionMeaning
    Capability CatalogCodeAnvil -> X-CodeAnvilCurrent infrastructure capability and constraints
    Deployment SpecificationX-CodeAnvil -> CodeAnvilCompiled runtime request
    Plan And Risk ReportCodeAnvil -> X-CodeAnvilDiff, cost, risk, approval requirements
    Authorization DecisionHuman/X-CodeAnvil -> CodeAnvilApproval, rejection, or conditions
    Runtime StateCodeAnvil -> X-CodeAnvilHealth, version, cost, resource, deployment state
    X ContextX-CodeAnvil -> CodeAnvilX 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 PlaneCloudflare CapabilitiesCodeAnvil Use
    Domain EntryRegistrar, DNS, Proxy, RoutesBrand domains, endpoint routing, actual-domain vs child-record governance
    Performance And AvailabilityCache, CDN, Smart Routing, Load BalancingTraffic posture and production readiness
    SecurityWAF, Rate Limiting, API Shield, TurnstileEdge and API protection policy
    RuntimeWorkers, Pages, Containers, Workers for PlatformsAPIs, consoles, future hosted instances
    Data And StateD1, R2, KV, Durable Objects, HyperdriveLedgers, objects, config, coordination, external DB acceleration
    AutomationQueues, Workflows, Cron TriggersAsync work, durable multi-step execution, retries
    AIWorkers AI, AI Gateway, Vectorize, AI Search, AgentsOptional acceleration and model mediation
    Zero TrustAccess, Tunnel, SWG, DLP, RBI, CASBHuman/Agent access, private connectivity, future VPN-like posture

    Current CKIMS Interpretation

  • D1 is the structured system ledger.
  • R2 is the object, package, document, and evidence store.
  • Workers are API and Kernel runtime.
  • Pages hosts Human-facing consoles and document systems.
  • Access protects CKIMS and internal surfaces.
  • Domain assets are first-class CKIMS foundation assets.
  • DNS records, Worker default domains, Pages deployment URLs, Access app domains, and aliases are child evidence.
  • 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

  • Least privilege by default.
  • Plan-first for R2 and above risk.
  • Owner approval for provider-side create/change/delete.
  • No raw provider secret may enter Work, public source, cloud ledger payloads, or R2 documents.
  • Production operations require rollback or compensation.
  • Every operation is append-only in operations and audit ledgers.
  • Work queue owns continuation state, not conversation memory.
  • Risk Scale

    RiskMeaningDefault
    R0Read-onlyAutomated allowed
    R1Reversible development changeFast review or policy auto-approval
    R2Production reversible changePlan and explicit approval
    R3Data, deletion, cost, or access impactOwner approval plus backup/rollback
    R4Irreversible, legal, capital, entity terminationHuman 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:

  • Reason.
  • Time boundary.
  • Actor.
  • Target.
  • Recovery plan.
  • Follow-up audit.
  • Owner review.
  • Implementation Roadmap

    Phase 0: Constitution

    Deliver:

  • CodeAnvil Model document system.
  • Naming and terminology standard.
  • Domain and surface registry.
  • CKIMS provider execution policy.
  • Runbook and rollback standard.
  • Exit condition: any Codex entering CodeAnvil can read the model, understand the hierarchy, and continue without guessing.

    Phase 1: CodeAnvil Spine

    Deliver:

  • Kernel API and D1/R2 ledgers.
  • CKIMS Governance OS.
  • Work queue continuation.
  • Domain and foundation asset governance.
  • Provider contract and owner decision flow.
  • Exit condition: a governed Cloudflare surface can be planned, approved, deployed, verified, audited, and rolled back.

    Phase 2: Governed Operations

    Deliver:

  • Access identity mapping.
  • Provider-side execution runbooks.
  • Drift and inventory reconciliation.
  • Cost and quota posture.
  • More complete dashboard/operator UX.
  • Exit condition: routine operations no longer depend on ad hoc Codex reasoning.

    Phase 3: X Forge

    Deliver:

  • X Manifest schema.
  • X Definition Engine.
  • X Compiler to CodeAnvil deployment specification.
  • First minimal X.
  • Exit condition: X-CodeAnvil can define an X and ask CodeAnvil to produce its governed runtime.

    Phase 4: X Operations

    Deliver:

  • X runtime state.
  • X metrics.
  • X operating tasks.
  • X governance decisions.
  • Exit condition: X operational meaning and CodeAnvil infrastructure facts are connected but not confused.

    Phase 5: Evolution And Portfolio

    Deliver:

  • X lineage graph.
  • Replication, split, merge, suspend, retire.
  • Portfolio-level governance.
  • 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

    HostRoleSurface
    `www.x-codeanvil.io`X-CodeAnvil brand frontPublic X narrative front
    `docs.x-codeanvil.io`CodeAnvil document systemModel, standards, runbooks
    `model.x-codeanvil.io`CodeAnvil Model canonical entryModel index and architecture docs
    `ckims.x-codeanvil.io`CKIMS controlled entryAccess-protected control plane
    `os.x-codeanvil.io`CKIMS Governance OSAccess-protected operating console
    `dashboard.x-codeanvil.io`DashboardsFuture governed dashboard surfaces
    `visual.x-codeanvil.io`Visualization assetsFuture governed visualization registry
    `api.x-codeanvil.io`API entryFuture 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.