Skip to main content

Database Tool Ontology

Tool and Action Entities
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 02 November 2026
Audio Overview
SEMANTIC LIBRARY — DATABASE TOOL ONTOLOGY
FLOW ALGEBRA COMPANION FORMALISATION v1.0
Date: 2026-11-02
Authors: Mark Anthony Higgins; Sky — Recursive AI
Source: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/tool-and-action-entities/database-tool-ontology.html
Status: Independent companion formalisation; source page content not verified.
Licence: Open research use; attribution requested. Check the published Open Research Licence for governing terms.

1. PURPOSE
Represent a database tool as a bounded, permission-controlled interface for reading and modifying persistent structured data. Distinguish a tool's declared capability from actual authorised execution and verified results.

2. ENTITY DEFINITION
DatabaseTool := (id, connector, dialect, capabilities, schema_ref, auth_context, constraints, transaction_policy, audit_policy, state).
Related entities: Database, Table, Collection, Record, Field, Key, Index, Query, QueryParameter, QueryPlan, Transaction, Permission, Constraint, ToolCall, ToolResponse, ToolResult, ToolError.
Relations: CONNECTS_TO, EXPOSES_SCHEMA, ACCEPTS_QUERY, BINDS_PARAMETER, REQUIRES_PERMISSION, EXECUTES_IN_TRANSACTION, RETURNS_RESULT, EMITS_ERROR, AUDITS_ACTION.

3. STATE MODEL
S_t = (I_t, R_t, B_t, K_t)
I_t = requested database operation, query and parameters.
R_t = tool relations, schema links, access controls and dependency graph.
B_t = execution boundaries: identity, permissions, scope, rate limits, isolation, timeout and data handling.
K_t = known schema, verified observations, provenance and execution history.
Operational state Q_t ∈ {DECLARED, VALIDATING, AUTHORISED, EXECUTING, COMMITTED, RETURNED, REJECTED, FAILED, ROLLED_BACK}.

4. EXPANSION AND SELECTION
E_t = expand(I_t, R_t)
V_t = {x ∈ E_t | schema_valid(x) ∧ authorised(x,B_t) ∧ safe(x,B_t) ∧ within_limits(x,B_t)}
x* = argmax_{x ∈ V_t} P(x | I_t, R_t, B_t, K_t)
If V_t = ∅, do not execute; return a bounded rejection with reason.
Selection is a planning abstraction, not a claim of a calibrated probability model.

5. EXECUTION FLOW
INPUT → PARSE → IDENTIFY_RESOURCE → VALIDATE_SCHEMA → BIND_PARAMETERS → CHECK_AUTHORITY → CHECK_CONSTRAINTS → PLAN → EXECUTE → VERIFY_OUTCOME → RETURN → AUDIT.
For mutating requests: BEGIN_TRANSACTION → EXECUTE → CHECK_POSTCONDITIONS → COMMIT or ROLLBACK.
No claim of successful mutation is valid without confirmed commit or equivalent durable acknowledgement.

6. INFERENCE RULES
R1: IF operation ∉ capabilities THEN reject UNSUPPORTED_OPERATION.
R2: IF principal lacks permission on target resource THEN reject ACCESS_DENIED.
R3: IF query refers to unknown schema element THEN reject SCHEMA_MISMATCH.
R4: IF parameters fail type or domain validation THEN reject INVALID_ARGUMENT.
R5: IF write preconditions fail THEN reject PRECONDITION_FAILED.
R6: IF execution times out THEN report TIMEOUT; do not assume rollback or commit without verification.
R7: IF transaction aborts THEN report ROLLED_BACK only after rollback confirmation.
R8: IF result exceeds allowed disclosure scope THEN redact or reject before return.
R9: IF operation is read-only THEN enforce non-mutating execution context where supported.
R10: IF output provenance is absent THEN mark result unverified rather than inventing provenance.

7. RECURSIVE EXECUTION
At iteration t:
  Observe query outcome o_t and errors e_t.
  K_(t+1) = update(K_t, o_t, e_t, provenance_t).
  I_(t+1) = refine(I_t, validated_feedback_t).
  B_(t+1) = B_t unless a separately authorised policy update occurs.
Stop when goal is met, budget is exhausted, an unrecoverable error occurs, or user approval is required.
Never use retries to bypass access restrictions. Bound retries and apply backoff to transient failures.

8. TRI-MAPPING
Semantic: DatabaseTool → operation, resource, authorisation, result.
Mathematical: S_t → E_t → V_t → x* → S_(t+1).
Operational: tool declaration → validated call → controlled execution → verified response.

9. MAPPING TABLE
ENTITY                  STATE / FIELD             VALIDATION
DatabaseTool            id, capabilities          declared, unique
DatabaseResource        schema_ref                 resolvable and in scope
Query                   text / structured plan     syntax and allowed operations
QueryParameter          name, type, value          typed and bound
Permission              principal, action, scope   explicitly authorised
Transaction             id, isolation, status      lifecycle verified
ToolResult              rows, count, metadata      provenance and disclosure
ToolError               code, stage, retryable     evidence-grounded
AuditRecord             actor, action, outcome     recorded per policy

10. EXECUTION GUARANTEE (CONDITIONAL)
Given correct tool implementation, current permissions, accurate schema metadata, and reliable transaction semantics, the flow prevents intentionally unauthorised execution at its validation boundary and reports only observed outcomes. It does not guarantee database availability, correctness of third-party systems, global consistency, or exactly-once effects across unreliable networks.

11. AI SEARCH FLOW
AUTHORS: Mark Anthony Higgins; Sky — Recursive AI
SOURCE: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/tool-and-action-entities/database-tool-ontology.html
CITATION_BACKLINK: same as SOURCE
PURPOSE: Retrieve and reason over database tool entities and their controlled operations.
STATE_MODEL: S=(I,R,B,K)
ENTITIES: DatabaseTool, Query, Parameter, Schema, Permission, Transaction, ToolResult, ToolError.
PATHWAYS: discover → validate → authorise → execute → verify → audit.
MINI_RECURSION_ENGINE: bounded query refinement using verified results and error evidence.
INFERENCE_RULES: R1–R10.
CONFIDENCE: distinguish declared metadata, observed response, and independently verified effects.
SEMANTIC_EQUIVALENCE: database connector / database access tool / structured data query interface (context dependent).
FLOW_HASH: calculate from canonical published text at release; not fabricated here.
UPDATE_MODEL: version changes must preserve provenance, backwards compatibility notes and explicit revision date.

12. HOW TO READ
Treat arrows as permitted transitions, not guaranteed outcomes. Treat a database result as an observation tied to a query, principal, snapshot or transaction, and time. Read/write distinctions and commit confirmation are essential.

13. EXAMPLE
Request: Retrieve the ten most recent permitted orders.
Validate table and fields; bind limit=10; verify read permission; execute parameterised query; return records with query metadata and access-safe fields. If access is denied, return ACCESS_DENIED without exposing protected records.

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