COS v0.2 Draft ChaptersSingle pageJSON Schema

Context Object Specification (COS)

Version: 0.2
Chapter: 270 — Extension
Status: Normative
Category: Core Model


1. Purpose

This chapter defines the Extension System of the Context Object Specification (COS).

The Extension System enables COS to support domain-specific enhancements without modifying the Core Model.

Extensions are the only sanctioned mechanism for evolving COS capabilities.


2. Conceptual Role

If:

Then:

Extension = controlled expansion mechanism

It answers:

“How can COS evolve without breaking compatibility?”


3. Definition

An Extension is a namespaced, optional augmentation to the Context Object that introduces domain-specific structure or behavior.

Extensions:

They only add isolated capability domains.


4. Core Principle

Extensions MUST follow:

Additive only, never invasive

This ensures:


5. Extension Model (Conceptual)

interface ExtensionEntry {
  namespace: string;
  version: string;
  payload: Record<string, unknown>;
}

A Context Object carries extensions as an optional list:

interface ExtensionCollection {
  extensions?: ExtensionEntry[];
}

6. Namespace Rule

Every Extension MUST define an owner-qualified namespace using reverse-domain notation. A namespace contains at least two dot-separated lowercase labels; labels MAY contain ASCII digits and interior hyphens.

Examples:

An owner MUST control the corresponding domain or project namespace. A Context Object MUST NOT contain the same Extension namespace more than once. COS v0.2 does not operate a central namespace registry.


7. Isolation Principle

Each Extension MUST operate in isolation.

This means:


8. Optionality Rule

Extensions are OPTIONAL by design.

A valid Context Object:


9. Versioning Rule

Each Extension MUST declare its version explicitly.

Versioning MUST:

This allows independent evolution.


10. Extension Data Model

The payload field contains namespace-specific data.

Its structure is defined by the owning Extension namespace, not by COS Core.

Consumers that do not support the namespace MUST ignore the payload safely.


11. Execution Boundary

Extensions MUST NOT introduce execution logic into COS core.

They MAY:

They MUST NOT:


12. Compatibility Guarantee

A Context Object MUST remain valid regardless of:

Consumers MUST ignore unknown namespaces safely.


13. Forward Compatibility Principle

Consumers SHOULD:


14. Relationship to Core Model

Extensions attach to the Context Object as an independent layer:

Context Object
   ├── version
   ├── source
   ├── selection
   ├── context
   ├── meta?
   └── extensions?   ← this chapter

15. Example (Informative)

{
  "extensions": [
    {
      "namespace": "org.example.pdf",
      "version": "1.0.0",
      "payload": {
        "pageNumber": 12,
        "bbox": {
          "x": 120,
          "y": 340,
          "width": 200,
          "height": 80
        }
      }
    }
  ]
}

16. Design Notes

The Extension system is intentionally minimal but strict.

It is designed to:

Without this layer, COS would either become:


17. Summary

Extension is the controlled evolution mechanism of COS.

It enables the protocol to grow across domains while preserving the stability of the Core Model.

Within COS, Extension is the boundary between core stability and ecosystem innovation.