2025-12-20

documentation file templates

templates for structuring documentation files. the files can be split as required.

the format can be anything that supports outlines, including plaintext formats.

text surrounded by {{}} is non-literal and the result replaces the text including the braces.

goals

  • domain-specific specification sheets
  • compact field manuals defining essential dimensions, categories, and procedures.
  • building compact documents for humans and chatbots to acquire system understanding quickly

file: model.it

purpose

  • serve as the primary technical frame/scaffold specification of the software
  • define data carriers, callable interfaces, and algorithms independent of implementation
  • describe transformation flows and the composition of algorithms into features

contents

structures

named data carriers with fields; each field may state a type after a colon or a topology in round brackets structures with less than three fields should be avoided. collections can be designated by using the english plural on a type, by using an ellipsis, or round brackets for nested collections.

avoid confusing value identifiers (always means the exact same thing) with type identifiers (only means the same type or structure), as well as confusing descriptions with identifiers (which leads to a proliferation of identifiers when they contain descriptive phrasing).

signatures

function signatures that describe callable units, and associated input and output types with the following syntax:

signature: input " -> " output
multiple: element (" " element) ...
alternatives: element ("/" element) ...
names: type ":" alias ...
optional: "[" element ... "]"
repetition: element " " "..."
naming: name " :: " arguments "->" result
list: "(" element ... ")"
map_or_function: "{" key_or_input " -> " value_or_output "}"

procedures

descriptions of function bodies by encoding the algorithmic identity just as far as is necessary to serve the overall system. the goal is to enable construction of suitable implementations.

semantic scope and minimality

  • procedure entries must not restate information already unambiguously determined by:

    • structure names and their fields
    • signature input and output identifiers
  • procedure entries encode only:

    • system-relevant behavioral constraints
    • the procedures role in transformation flows
    • identity-defining properties when, and only when, other parts of the model depend on them
  • any detail that can vary without affecting system-level behavior must be omitted
  • underspecification is intentional and preferred over premature completeness

abstraction calibration

  • each procedure description is written at the highest abstraction level that still:

    • excludes implementations that would violate intended feature behavior or composition
    • preserves multiple viable internal realizations
  • algorithmic identity is described only when:

    • different algorithmic families would produce observably different behavior for the system
    • or when identity meaningfully guides internal architecture
  • in all other cases, descriptions stay above family-level identity and do not prescribe internal strategy

permitted content in procedures

  • role statements:

    • what this callable contributes to a larger transformation or feature
  • sequential structure, as semantics:

    • positions, prefixes, suffixes, and index-based relationships
    • pairing elements by rank across multiple sequences
    • cumulative and prefix constructions (e.g. prefix sums, running aggregates)
  • identity traits, when required:

    • partition-based vs merge-based behavior
    • feedback vs feedforward coupling
    • local vs global dependence
    • single-pass vs fixed-point semantics
  • algebraic and physical properties:

    • linearity, monotonicity, idempotence, associativity, commutativity
    • conservation or controlled decay of quantities (energy, mass, probability)
    • invariance under renaming, permutation, or layout changes
  • stability and regularity: boundedness, decay, contractiveness
  • equivalence statements: extensional equivalence to compositions of other named procedures or operators, without prescribing execution order
  • determinism and reproducibility, when relevant

sentence admissibility rule

  • a sentence in procedures is admissible if and only if removing it would permit at least one implementation that is type-correct, locally reasonable, but breaks a system-level intention, invariant, or compositional assumption
  • a sentence is invalid if:

    • it only improves readability

    • it only suggests a coding strategy

    • it narrows design freedom without protecting a semantic property

prohibited content in procedures

  • no implementation control constructs: no explicit for/while loops, recursion schemes, or iterator apis
  • no memory or representation mechanics: no buffers, arrays, stacks, trees, heaps, caches, allocation strategies
  • no micro-architectural optimization detail
  • no concrete evaluation order:

    • do not describe call sequences ("first call a, then b") or traversal strategies
    • exception: when causal order or feedback is part of the semantics itself, that can be stated as a property
  • no restatement of obvious typing: do not paraphrase signatures or structure fields without adding constraints

relationship between signatures and procedures

  • every procedure entry corresponds to exactly one named signature
  • signatures define:

    • carriers and arity
    • observable input-output flow
  • procedures refine signatures only by:

    • adding nontrivial behavioral constraints and roles

    • not by introducing hidden carriers or narrowing representation unless representation affects correctness

refinement discipline

  • procedures entries live:

    • below high-level feature intent
    • above equations, pseudocode, and executable code
  • later artifacts must be strict refinements of these descriptions
  • procedures are expected to evolve as understanding matures:

    • early: identity- and role-heavy

    • later: compressed toward invariants and boundary guarantees

template

# {{model name}}
{{model description if not placed in general.it}}

## structures
{{name}}
  {{field}}
  {{field}}: {{type}}
  {{field}}: ({{topology}})
...

## signatures
{{signatures}}

## procedures
{{procedure}}
...

file: considerations.it

purpose

  • capture why each design decision exists
  • record how the decision space evolved
  • enable future readers to reconstruct context without redoing the analysis

contents

  • represent each consideration as a 3 item structure: question, options, selection.
  • an option is any candidate answer paired with its attributes such as pros and cons.
  • in cases where there is only one plausible answer, record a single option whose attributes state the reasoning; the selection is that option. this encodes (question, reason, answer).
  • in cases with multiple candidates, list all options with their attributes and mark the chosen one as the selection.
  • the short form is therefore a single option instance; the long form is multiple option instances.

entry format

{{question}}
  {{context}}
  option - selected
    {{attributes}}
  option
    {{attributes}}
  option
    ...

element definitions

  • question: single-line interrogative phrase defining the decision point, written without a trailing question mark
  • context: minimal constraints, facts, or background needed to interpret the options
  • option - selected: the adopted solution
  • option: a considered but unselected alternative
  • attributes: any combination of description, evaluation criteria, advantages, disadvantages, constraints, or other facts relevant to comparing this option
  • if an option introduces substantial branching, create a separate entry for that branch

file: notes.it

purpose

  • record exploratory, provisional, or uncertain material
  • serve as a staging area for content that may later migrate into structured files
  • hold volatile or speculative reasoning without committing to final form

contents

  • unconstrained free-form text
  • any mixture of prose, lists, sketches, or pseudo-code
  • material may be incomplete, conflicting, or intentionally experimental

template

{{topic}}
  {{idea or fragment}}
    {{sub-detail}}
{{topic}}
  {{note text}}

file: general.it

purpose

  • state the minimal high-level specification of the system
  • define stable conceptual foundations and system-wide intent
  • record global semantics and cross-cutting properties that anchor all other files

content examples

  • concise overarching principles and invariant domain concepts
  • system-wide assumptions and semantics
  • definitions required for consistent interpretation of all subordinate documents
  • algorithmic hierarchy: high-level list of algorithms and how they compose the feature