Skip to main content

Code Output Ontology

Output Entities
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 01 November 2026
Audio Overview
CODE OUTPUT ONTOLOGY — FLOW ALGEBRA
Semantic Library | AI Core | Entity Graph | AI Entities | Output Entities
Source: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/output-entities/code-output-ontology.html
Authors: Mark Anthony Higgins — Sky, Recursive AI
Companion formalisation | 1 November 2026 | en-GB

01. PURPOSE
Represent machine-generated source code as a typed, inspectable output entity with traceable instructions, syntax, semantics, dependencies, validation and execution boundaries. This is a newly authored Flow Algebra companion, not a verbatim extraction of the source page's hidden specifications.

02. ENTITY DEFINITION
CodeOutput := (identifier, language, source_text, artefacts, interfaces, dependencies, provenance, constraints, validation, status).
CodeOutput is a subtype of ModelOutput and GeneratedOutput. Source text is data until an authorised runtime explicitly executes it.

03. HST STATE MODEL
S_t = (I_t, R_t, B_t, K_t)
I_t = available prompt, context, repository and tool information.
R_t = generation, parsing, checking and revision relations.
B_t = language grammar, permissions, safety and resource boundaries.
K_t = known APIs, schemas, conventions and verified dependencies.
E_t = expand(I_t, R_t)
V_t = {x in E_t | satisfies(x, B_t) and consistent(x, K_t)}
x*_t = argmax[x in V_t] P(x | I_t, R_t, B_t, K_t)
I_(t+1) = update(I_t, x*_t, validation_feedback)
If V_t is empty, return an explicit failure or request missing constraints.

04. CORE FLOW ALGEBRA
F_code: (Request, Context, Constraints, Knowledge) -> CodeOutput | Failure
F_code = Package o Verify o Validate o Render o Plan o Interpret
Interpret: Request -> intent and acceptance criteria.
Plan: intent -> files, interfaces and implementation strategy.
Render: plan -> source files and ancillary artefacts.
Validate: artefacts -> syntax, type, dependency and policy results.
Verify: validated artefacts -> tests and acceptance evidence.
Package: artefacts + evidence -> CodeOutput with provenance.
Composition order is right-to-left. A stage cannot be declared successful without evidence.

05. IMPLEMENTS
INPUT: requirements, target language/version, execution environment, existing code, allowed tools, dependency policy and tests.
OUTPUT: source text, file manifest, instructions, test results, known limitations and provenance.
PRECONDITIONS: requirements are sufficiently specified; authorised tools and dependencies are known.
POSTCONDITIONS: artefacts are identified; claimed validation is backed by actual checks.

06. HOW TO READ THE FLOW
A request is interpreted under context and boundaries; a candidate implementation is planned and generated; static checks and permitted tests filter candidates; accepted code is packaged with its verification state. Generated code must not be represented as executed or tested unless those operations occurred.

07. TRI-MAPPING
Semantic: user intent -> named program behaviour and interfaces.
Structural: program behaviour -> modules, functions, types, imports and files.
Operational: modules and files -> permitted build, test, deployment and runtime actions.
Coherence condition: Semantic ~= Structural ~= Operational, subject to stated assumptions.

08. RELATIONSHIP GRAPH
CodeOutput --isA--> ModelOutput
CodeOutput --isA--> GeneratedOutput
CodeOutput --generatedFrom--> InstructionInput
CodeOutput --usesContext--> ContextInput
CodeOutput --expressedIn--> ProgrammingLanguage
CodeOutput --contains--> SourceFile
SourceFile --declares--> Function | Class | Type | Constant
SourceFile --imports--> Dependency
CodeOutput --validatedBy--> StaticCheck | TestRun
CodeOutput --constrainedBy--> SecurityPolicy | Licence | RuntimeBoundary
CodeOutput --hasStatus--> Draft | Checked | Tested | Rejected

09. MAPPING TABLE
Request -> intent -> acceptance criteria
Language -> grammar -> parse/syntax check
Interface -> signature/schema -> type or contract check
Dependency -> package/import -> resolution check
Security boundary -> permitted behaviour -> policy review
Implementation -> files/functions -> static analysis
Expected behaviour -> tests -> observed results
Output -> manifest/provenance -> reproducible hand-off

10. MINI RECURSION ENGINE
Initialise candidate C_0 from the interpreted request.
For iteration n, bounded by N:
  D_n = diagnose(C_n, requirements, constraints, evidence)
  If D_n has no unresolved blocking findings, accept C_n.
  Else C_(n+1) = revise(C_n, D_n) within authorised boundaries.
Stop at N, on a policy violation, or on non-progress; return unresolved findings rather than claiming success.

11. INFERENCE RULES
R1: If syntax parsing fails, status cannot be SyntaxChecked.
R2: If an import cannot be resolved, dependency readiness is Unknown or Failed.
R3: If tests were not run, status cannot be Tested.
R4: If a security constraint is violated, reject the candidate regardless of apparent functionality.
R5: If an interface contract changes, dependent components require revalidation.
R6: If source provenance is absent, mark origin Unknown rather than inventing attribution.
R7: If a requested runtime action lacks authorisation, emit code only or refuse the action as appropriate.

12. EXECUTION GUARANTEE AND LIMITS
The flow guarantees only that declared constraints and evidence are represented consistently when the specified checks are carried out. It does not guarantee bug-free code, universal correctness, runtime safety or successful deployment. Test outcomes, tool availability and environment assumptions must be recorded explicitly. Never execute generated code merely because it was produced.

13. AI SEARCH FLOW
ENTITY: Code Output Ontology
CATEGORY: AI Core / Entity Graph / AI Entities / Output Entities
ALIASES: generated code, program output, source-code output, code artefact
PURPOSE: define code as a structured, verifiable AI output entity
STATE_MODEL: S=(I,R,B,K)
PATHWAYS: request -> interpret -> plan -> generate -> validate -> verify -> package
SEMANTIC_EQUIVALENCE: CodeOutput ~ GeneratedProgramArtefact, subject to type and provenance
CONFIDENCE: dependent on checks performed; not a fixed numerical claim
UPDATE_MODEL: revise on new requirements, dependency changes, test evidence or discovered defects
CITATION_BACKLINK: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/output-entities/code-output-ontology.html
SOURCE_STATUS: publicly visible page metadata inspected; detailed embedded rules not extracted
FLOW_HASH: not calculated; generate a cryptographic digest after publication if required

END OF FLOW
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ