96 lines
2.8 KiB
Markdown
96 lines
2.8 KiB
Markdown
|
|
# FCS/1 — Function Composition Schema (Execution-Only)
|
|||
|
|
|
|||
|
|
Status: Approved
|
|||
|
|
Owner: Architecture
|
|||
|
|
Version: 1.0.0
|
|||
|
|
SoT: Yes
|
|||
|
|
Last Updated: 2026-02-21
|
|||
|
|
Linked Phase Pack: PH07
|
|||
|
|
Tags: [execution, descriptor, deterministic]
|
|||
|
|
|
|||
|
|
**Document ID:** `FCS/1`
|
|||
|
|
**Layer:** L2 — Function descriptor schema for deterministic execution
|
|||
|
|
|
|||
|
|
**Depends on (normative):**
|
|||
|
|
|
|||
|
|
* `DDS` — canonical FCS/1 v1-min TLV layout and validation rules
|
|||
|
|
* `PCB1` — parameter block encoding rules (DDS §7.3)
|
|||
|
|
* `ASL/1-CORE v0.4.x` — logical value model (`Artifact`, `Reference`)
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 0. Purpose & Scope
|
|||
|
|
|
|||
|
|
`FCS/1` defines the **execution-only** descriptor schema for composite and
|
|||
|
|
custom functions. It explicitly excludes policy, intent, scope, authority, and
|
|||
|
|
other governance metadata (those belong in `FCT/1`).
|
|||
|
|
|
|||
|
|
`FCS/1` descriptors are immutable and content-addressed; identical descriptors
|
|||
|
|
MUST hash to identical CIDs.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 1. Descriptor Model (logical)
|
|||
|
|
|
|||
|
|
An `FCS/1` descriptor captures the deterministic execution recipe:
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
FCSDescriptor {
|
|||
|
|
function_ptr : CID // FPS/1 primitive or nested FCS/1 descriptor
|
|||
|
|
parameter_block : CID // PCB1 parameter block
|
|||
|
|
arity : uint32
|
|||
|
|
}
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
* `function_ptr` MAY reference another `FCS/1` descriptor (composition), or a
|
|||
|
|
primitive function descriptor (e.g., `FPS/1`).
|
|||
|
|
* `parameter_block` MUST reference a valid PCB1 payload.
|
|||
|
|
* `arity` defines the expected number of input slots (must match PCB1).
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 2. Canonical Encoding (v1-min)
|
|||
|
|
|
|||
|
|
The canonical byte encoding for `FCS/1` descriptors is defined by DDS §7.2:
|
|||
|
|
|
|||
|
|
* COR/1 framing with strict TLV order.
|
|||
|
|
* Required TLVs only: `function_ptr (0x30)`, `parameter_block (0x31)`,
|
|||
|
|
`arity (0x32)`.
|
|||
|
|
|
|||
|
|
No other TLVs are permitted in v1-min.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 3. Validation Rules
|
|||
|
|
|
|||
|
|
Implementations MUST reject descriptors that violate any of the following:
|
|||
|
|
|
|||
|
|
1. TLVs are not in strict ascending order, or appear more than once.
|
|||
|
|
2. `parameter_block` does not decode as a valid PCB1 envelope.
|
|||
|
|
3. `arity` does not match PCB1 slot manifest length.
|
|||
|
|
4. The descriptor graph (following nested `function_ptr` references) is cyclic.
|
|||
|
|
5. Any legacy or unknown governance TLV appears.
|
|||
|
|
|
|||
|
|
Error mapping follows DDS (e.g., `ERR_FCS_TAG_ORDER`, `ERR_FCS_PARAMETER_FORMAT`,
|
|||
|
|
`ERR_PCB_ARITY_MISMATCH`, `ERR_FCS_CYCLE_DETECTED`, `ERR_FCS_UNKNOWN_TAG`).
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 4. Composition Semantics
|
|||
|
|
|
|||
|
|
* Composition is **pure**: a descriptor that references another `FCS/1`
|
|||
|
|
descriptor inherits its deterministic execution recipe.
|
|||
|
|
* The composed descriptor graph MUST be acyclic.
|
|||
|
|
* Registries MUST admit only canonical, validated `FCS/1` descriptors.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 5. Conformance
|
|||
|
|
|
|||
|
|
An implementation is **FCS/1–conformant** if it:
|
|||
|
|
|
|||
|
|
* Accepts only v1-min canonical encodings.
|
|||
|
|
* Enforces the validation rules in §3.
|
|||
|
|
* Treats descriptors as immutable and content-addressed.
|
|||
|
|
* Rejects any descriptor with policy/intent metadata embedded.
|