calldecl

package
v0.2.48 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package calldecl is the declaration of an ENTRY a call may name: a stack says, in one small YAML file under the reserved CALLS/ subtree, where a call enters it, what the call must carry and what the answer will carry.

OPS/app/_orient/CALLS/orient.yaml

description: Compile the context needed for a job.
entry: 100
timeout: 20000
input:
  job:
    description: the job record
    required: true
  text:
    description: the message to answer
output:
  prompt:
    description: the compiled prompt
    required: true
  sources:
    description: the documents it drew on

A rule names the entry when it calls: `EXEC "call://app/_orient" WITH entry = "orient"`. The chassis enters the stack at the declared scope, bounds the call by the declared timeout when that is shorter, refuses a call that lacks a required input before the callee runs (txco_call_invalid_input) and an answer that lacks a required output after it ends (txco_call_invalid_output). Nothing else is checked: the shape of a field is the stacks' business. A call that names no entry is what it was before declarations existed.

The shape is the capability declaration's (chassis/capdecl), so a stack that answers callers inside the tenant and callers outside it writes the same thing twice with different names. The file deploys with `txco apply` as a stack_files row, beside CAPS/, and is validated at apply.

This file is the leaf layer: the reserved-path vocabulary, with no dependency on stores, so the CLI, the admin producer and the processor can import it cheaply.

Index

Constants

View Source
const (
	Dir     = "CALLS"
	DeclExt = ".yaml"
)

Reserved top-level directory and the declaration extension.

Variables

View Source
var ErrNotDeclared = errors.New("call: not declared")

ErrNotDeclared: the stack's active version has no CALLS/<name>.yaml.

Functions

func CheckEntry

func CheckEntry(d *Decl, scopes map[int]bool) error

CheckEntry reports whether the declaration's entry names a scope the stack has.

func DeclPath

func DeclPath(name string) string

DeclPath is the stack_files path of an entry's declaration.

func IsCallPath

func IsCallPath(p string) bool

IsCallPath reports whether a stack_files path lives under CALLS/.

func Name

func Name(p string) string

Name returns the entry a declaration path belongs to: "CALLS/orient.yaml" → "orient". It returns "" when the path is not under CALLS/, is nested, has the wrong extension, or names an invalid entry — the same shape validateStackFilePath enforces at upload.

func ValidName

func ValidName(s string) bool

ValidName reports whether s may name an entry.

Types

type Decl

type Decl = capdecl.Decl

Decl is one CALLS/<name>.yaml: the capability declaration's shape.

func ParseDecl

func ParseDecl(data []byte) (*Decl, error)

ParseDecl strictly decodes and validates a declaration body.

type Field

type Field = capdecl.Field

Field is one input an entry takes, or one output it answers with.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL