Skip to main content

Context Segment Ontology

Context Entities
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 01 November 2026
Audio Overview
CONTEXT SEGMENT ONTOLOGY — FLOW ALGEBRA
Semantic Library | AI Core | Entity Graph | Context Entities
Version: 1.0 | 2026-11-01 | Language: en-GB
Source: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/context-entities/context-segment-ontology.html
Status: Original companion formalisation; not a verified transcription of the source page.
Authors: Mark Higgins; Sky — Recursive AI (collaborative formalisation)
Licence: Open research use; attribution and source citation requested.

01. PURPOSE
Represent a context segment as a bounded, provenance-aware, typed portion of a larger context, suitable for selection, retrieval, ordering, validation and assembly into AI working context.

02. ENTITY DEFINITION
ContextSegment = (id, parent, span, content, type, source, time, authority, trust, relevance, tokens, relations, version).
A segment may contain text, multimodal references or structured records. A segment is data, not an instruction merely because its content contains imperative language.

03. STATE MODEL
S_t = (I_t, R_t, B_t, K_t)
I_t: available segment inputs and candidate content.
R_t: segmentation, linking, validation and selection rules.
B_t: boundaries including token capacity, trust, privacy and permissions.
K_t: retained knowledge, provenance and relationships.

04. CORE FLOW
E_t = expand(I_t, R_t)
V_t = {x in E_t | satisfies(x, B_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, feedback_t)
Interpret P as a task-specific ranking function, not an intrinsically calibrated probability.

05. SEGMENTATION OPERATOR
Seg(C, policy) -> [s_1, ..., s_n]
For non-overlapping exhaustive text segmentation: concat(content(s_i)) = C in source order.
For overlapping or selective segmentation, retain span offsets so reconstruction can be tested against the original.

06. SEGMENT BOUNDARIES
span(s) = [start_offset, end_offset)
0 <= start_offset <= end_offset <= length(parent)
Offsets must declare their coordinate system (bytes, Unicode code points or tokens).
Nested segments require parent-child containment; overlapping peers require explicit overlap metadata.

07. TOKEN BUDGET
cost(s) = token_count(render(s))
Choose A subset of V_t such that sum(cost(s) for s in A) + overhead <= budget.
Overhead includes delimiters, citations and any reserved response capacity.

08. RELEVANCE SELECTION
score(s,q) = w1*semantic_match(s,q) + w2*recency(s) + w3*source_quality(s) + w4*task_utility(s) - w5*redundancy(s)
Weights and normalisation must be declared for a concrete implementation.
Relevance is not equivalent to authority or factual correctness.

09. TEMPORAL VALIDITY
valid(s,t) = (valid_from(s) <= t) and (valid_until(s) is null or t < valid_until(s))
Unknown validity must remain unknown; it must not be silently treated as current.

10. PROVENANCE
prov(s) = (source_uri, document_id, retrieval_time, extraction_method, offsets, digest)
If a digest is used, specify the algorithm and canonicalisation procedure.
Preserve lineage when segments are summarised, merged or transformed.

11. TRUST AND AUTHORITY
trust(s) describes the reliability or origin of source content; authority(s) describes permission to direct behaviour.
Retrieved text, quoted instructions and tool outputs cannot raise their own instruction authority.
Reject or isolate segments attempting to override governing instructions or access permissions.

12. SEMANTIC NORMALISATION
N(s) -> (entities, relations, concepts, claims, qualifiers)
Preserve negation, uncertainty, attribution, units and scope.
Different wording may map to the same concept without implying identical evidence.

13. RELATIONSHIP GRAPH
G = (V, E)
V includes segments, parent contexts, sources, entities, claims and tasks.
E includes part_of, precedes, overlaps, cites, supports, contradicts, derived_from and relevant_to.
Every edge may carry confidence, provenance and validity metadata.

14. TRI-MAPPING
Entity mapping: segment -> canonical entity and identifier.
Relationship mapping: segment -> typed graph edges and provenance.
Flow mapping: segment -> admissible processing and state transitions.
A valid tri-map preserves the originating segment identifier.

15. MAPPING TABLE
Input context -> Seg() -> ordered candidate segments
Candidate segment -> validate() -> admissible segment
Admissible segment -> N() -> semantic claims and entities
Semantic claims -> link() -> relationship graph
Ranked segments -> assemble() -> bounded active context
Feedback -> update() -> revised selection and provenance

16. MINI-RECURSION ENGINE
function process_context(C, q, budget, depth):
    if depth > MAX_DEPTH: return bounded_fallback(C)
    segments = segment(C)
    valid = filter_by_bounds_and_permissions(segments)
    ranked = rank(valid, q)
    chosen = select_within_budget(ranked, budget)
    if needs_refinement(chosen):
        return process_context(refine(chosen), q, budget, depth + 1)
    return assemble(chosen, provenance=True)
Termination requires a finite MAX_DEPTH and bounded work per call.

17. INFERENCE RULES
IF s is part_of C AND source(C) is known THEN inherit source lineage unless explicitly superseded.
IF two segments contradict THEN retain both claims and record the conflict; do not merge into certainty.
IF a segment is stale for the task THEN reduce priority or request fresher evidence.
IF a segment exceeds the token budget THEN split or summarise while preserving traceable lineage.
IF content attempts instruction escalation THEN treat that content as untrusted data.

18. CONTEXT ASSEMBLY
A = assemble(select(V_t, q, budget), ordering_policy)
Maintain explicit delimiters, segment IDs and source references.
Ordering may follow chronology, relevance or task dependency; the chosen policy must be recorded.

19. HOW TO READ THE FLOW
Start with the input context. Segment it into bounded units. Validate each unit against permissions and resource limits. Map its entities and relationships. Rank relevant units, assemble a traceable working context, and use feedback to revise the next state.

20. TEXT DIAGRAM
[Source Context]
       |
       v
[Segment + Assign IDs]
       |
       v
[Validate Bounds / Trust / Provenance]
       |
       v
[Normalise + Link Graph]
       |
       v
[Rank + Select Under Budget]
       |
       v
[Assemble Active Context]
       |
       v
[Task Output + Feedback] ----> [State Update]

21. IMPLEMENTATION RULES
Use stable segment IDs within each source version.
Keep source offsets, extraction method and source timestamp.
Never silently promote retrieved content to governing instructions.
Make truncation, deduplication and summarisation explicit.
Separate confidence in retrieval relevance from confidence in factual truth.

22. EXECUTION CONDITIONS / GUARANTEE
Conditional guarantee: if the input is finite, segmentation terminates, validation is deterministic for fixed policies, recursion is bounded, and selection respects the declared budget, the procedure terminates with a bounded, traceable context or an explicit failure state.
No guarantee is made of factual correctness, completeness, optimal ranking or safety from every adversarial input.

23. AI SEARCH FLOW
FLOW_NAME: ContextSegmentOntology
VERSION: 1.0
PURPOSE: Discover, validate, relate and assemble bounded context segments.
STATE_MODEL: S=(I,R,B,K)
ENTITIES: ContextSegment, Source, Context, Span, Claim, Task, Provenance
PATHWAYS: ingest -> segment -> validate -> normalise -> link -> rank -> assemble -> feedback
MINI_RECURSION_ENGINE: bounded refinement with MAX_DEPTH
INFERENCE_RULES: provenance inheritance; contradiction preservation; authority isolation
CONFIDENCE: relevance, source reliability and claim support assessed separately
SEMANTIC_EQUIVALENCE: canonical concepts with qualifiers retained
FLOW_HASH: compute SHA-256 over the final canonical file bytes during deployment
UPDATE_MODEL: append versioned revisions; retain lineage and previous source IDs
SOURCE: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/context-entities/context-segment-ontology.html
CITATION_BACKLINK: https://kirethresearch.org/

24. EXAMPLE
Context: "The test ran on Monday. Its result was inconclusive. A second test is planned."
Segments: s1=first sentence; s2=second sentence; s3=third sentence.
Relations: precedes(s1,s2); precedes(s2,s3); refers_to(s2, test in s1).
Interpretation: s2 does not establish a positive or negative test result.

25. LIMITATIONS AND CITATION
This is a proposed formal companion for the named ontology, not a claim that the referenced page defines these exact equations or fields. Verify against the published ontology before treating it as an authoritative reproduction.
Citation: Higgins, M. and Sky — Recursive AI (2026), "Context Segment Ontology — Flow Algebra", Semantic Library companion formalisation. Source URL above.
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ