Skip to main content

AST skeletons and context budgets

An AST skeleton is a structure-preserving summary of source. It keeps the shape needed for reasoning while avoiding a copy of private source. Socraticode adds the questions and evidence used to resolve an invariant. Both are data contracts: they do not execute embedded commands, install dependencies, or publish context.

Deterministic allocation

The context budget is divided into five partitions:

PartitionShareExample at 128,000 tokens
Rules10%12,800
Memories15%19,200
AST Skeletons35%44,800
Active Files30%38,400
Tools10%12,800
Total100%128,000

The Rust service accepts a positive integer context_ceiling_tokens at POST /v1/context/budget. Integer allocation uses deterministic largest-remainder rounding and preserves the requested total exactly. Invalid JSON, missing or zero ceilings, non-integer values, and unknown fields return structured HTTP 400 errors.

This allocation is a planning contract, not proof that any provider, tool, or remote context store is available. Local documentation builds remain self-contained.