FormaSL — H1 Query Capability Contract
Status: STABLE / NORMATIVE DESIGN / OWNER-RATIFIED
Authority: DOWNSTREAM NORMATIVE DESIGN — QUERY CAPABILITY OWNER
Amends/specializes: COMPUTATIONAL-REGIME-BOUNDARIES.md §5 for the H1 Query capability envelope
Consumes: LANGUAGE-DEFINITION-FOUNDATIONS.md, SITUATED-RESULT-CONTRACT.md, EXECUTABLE-SEMANTIC-INTERFACE-CONTRACT.md, ARCHITECTURE.md
Acceptance rule: WHOLE-LANGUAGE-CAPABILITY-ADEQUACY-AMENDMENT.md
Ratification evidence: ../QUERY-CAPABILITY-HARDENING-4-TERMINAL-REAUDIT.md, ../QUERY-CAPABILITY-COMPOSITION-WITNESS-1.md
Date: 2026-08-22
Purpose: close the H1 Query capability envelope at a functionally competent contemporary floor while preserving FormaSL semantic jurisdiction, native semantic structure and compositional Semantic Continuity.
Current bounded execution-completion amendment: ../contracts/query-execution-completion-v0.1/CONTRACT.md
Amendment status: owner-ratified / frozen / acceptance-hardening AH1
Amendment scope: executable completion only; this H1 Query capability contract remains the semantic capability owner. For the exact execution-completion locus, implementation and acceptance must satisfy the bounded amendment.
1. Owner decision
The owner ratifies the Query capability envelope that survived the Query adequacy campaign and terminal re-audit.
QUERY_CONSTITUTIVE_SEMANTIC_FLOOR = PASS
QUERY_CONTEMPORARY_FUNCTIONAL_BASELINE = PASS
QUERY_FORMASL_NATIVE_CAPABILITY_EXPLOITATION = PASS
QUERY_CAPABILITY_COMPOSITION_STRESS = PASS
QUERY_SEMANTIC_CONTINUITY_AT_CAPABILITY_LEVEL = PASS
QUERY_CAPABILITY_ADEQUACY = PASS
This contract supersedes the earlier H1 Query minimum as a sufficiency boundary. Existing CB-L3 Query laws remain valid unless explicitly refined here.
SEMANTIC CLOSURE
!= CAPABILITY ADEQUACY
!= SURFACE CLOSURE
This contract closes capability meaning, not final syntax, parser, AST, IR, optimizer, runtime or storage representation.
2. Preserved Query jurisdiction
Query remains declarative and basis-relative.
QueryAnswer != Truth
QueryAnswer != Claim
QueryAnswer != SemanticConsequence
Query != Analysis
Query != Reasoning
Query != SemanticTransformation
EvaluatorAlgorithm != QueryDenotation
GraphMembership != Truth
ViewMembership != Truth
QueryAnswer standing is introduced only by satisfaction of an admitted QueryContract over its exact/reconstructible InterpretationBasis.
QuerySatisfies(Q, Basis, Answer)
-> Standing(Answer, QueryAnswer(Q))
No capability below authorizes Query to mint authoritative domain identity, create a Claim, establish Truth, publish authoritative .fsl state or silently introduce Analysis/Reasoning/Transformation standing.
3. H1 functional capability envelope
H1 Query must support semantic capability sufficient for:
mandatory typed pattern matching
solution bindings / witnesses
conjunction / joins
alternatives / disjunction
optional / outer matching
correlated EXISTS / NOT EXISTS
presence-aware partial bindings
typed pure filters with explicit definedness
projection / computed expressions
nested / reusable Query expressions
aggregation / grouping over partial values
post-aggregation filtering
distinct / deduplication with lineage preservation
explicit ordering
ordered offset / slice / limit
explicit AnyK selection
top-k with declared tie/completion semantics
multi-hop traversal
variable-length / recursive traversal
compositional heterogeneous path expressions
bounded and admissible unbounded repetition
empty path where contracted
path and repeated-group bindings
path-local predicates and summaries
metagraph-native path reuse policies
shortest-family selectors
basis-relative non-match / absence tests
graph / subgraph Query views
QueryGraphView re-queryability
staged / nested Query composition
native typed querying of FormaSL semantic coordinates
This is a capability contract, not a keyword checklist.
DIFFERENT SYNTAX -/-> CAPABILITY GAP
DIFFERENT MECHANISM -/-> CAPABILITY GAP
4. Query solution and binding contract
4.1 Partial binding environment
A Query solution uses a partial environment:
BindingEnvironment : QueryVariable ⇀ QueryValue
A variable absent from the binding domain is query-locally unbound.
UNBOUND
!= semantic NULL
!= Unknown
!= Hidden
!= Unobserved
!= Nonexistent
!= NotApplicable
4.2 Static binding presence
Query extends the CB-L1 static kernel with an operation-specific presence effect:
QueryBindingJudgment(?x)
= SemanticType(?x)
+ BindingPresence(?x)
H1 requires at least:
DEFINITELY_BOUND
MAY_BE_UNBOUND
BindingPresence is static formation metadata, not a semantic/domain type.
BindingPresence != SemanticType
MAY_BE_UNBOUND -/-> SemanticOptional<T>
Minimum propagation laws:
mandatory introduction -> DEFINITELY_BOUND
optional-only introduction -> MAY_BE_UNBOUND
alternative branches:
bound in every surviving branch -> DEFINITELY_BOUND
otherwise, if post-branch visible -> MAY_BE_UNBOUND
projection/subquery export -> preserves declared presence effect
A later mandatory subexpression may bind a currently unbound in-scope variable. If every surviving output solution binds it, its output presence becomes DEFINITELY_BOUND.
MAY_BE_UNBOUND
+ mandatory binding for every surviving solution
-> DEFINITELY_BOUND
Optional absence is therefore not a sticky NULL state.
4.3 Binding compatibility and merge
For binding environments b1 and b2:
Compatible(b1,b2)
iff
for every variable v bound in both domains,
QueryValueCompatible(b1(v), b2(v))
Absence from one domain does not create a conflict.
Compatible environments merge by union, preserving the compatible shared value.
For semantic references, compatibility is grounded in resolved referent identity under a compatible basis, not in situated co-reference Claims.
5. Query expression definedness
A pure Query expression has an outcome:
QueryValueOutcome<T>
= Q-VALUE(T)
| Q-UNBOUND
| Q-UNDEFINED(reason)
where:
Q-UNBOUND = a required variable has no binding in this solution
Q-UNDEFINED = the pure expression is not defined for the present bound inputs
Neither is a semantic domain value or epistemic Unknown.
Boolean predicate outcomes are:
Q-TRUE
Q-FALSE
Q-UNDEFINED(reason)
with deterministic strong partial-Boolean semantics sufficient to ensure, for example:
Q-FALSE AND X = Q-FALSE
Q-TRUE OR X = Q-TRUE
NOT Q-UNDEFINED = Q-UNDEFINED
A normal filter retains only Q-TRUE solutions.
H1 requires a total pure boundness test equivalent to IsBound(?x).
5.1 Projection
Default partial projection preserves the solution:
Q-VALUE(v) -> bind target = v
Q-UNBOUND -> target remains unbound
Q-UNDEFINED(r) -> target remains unbound; reason remains diagnosable where material
An explicitly total projection may instead fail/reject under its QueryContract. It may not invent a domain NULL/default.
Explicit default/coalesce is permitted only as authored pure Query semantics.
6. Optional, correlated existence and completion
6.1 Existence judgment
For a Query expression E under exact correlated bindings and basis, H1 distinguishes:
MATCH_FOUND
NO_MATCH_COMPLETE
EXISTENCE_UNRESOLVED
NO_MATCH_COMPLETE requires the applicable Query completion contract to establish that no compatible satisfying solution exists under the exact criterion and basis.
NO MATCH OBSERVED SO FAR
-/-> NO_MATCH_COMPLETE
EXISTENCE_UNRESOLVED includes cases such as materially incomplete input, unresolved basis/source condition, resource exhaustion before closure or an unfinished streaming horizon.
6.2 Exists / NotExists
Exists(E):
MATCH_FOUND -> Q-TRUE
NO_MATCH_COMPLETE -> Q-FALSE
EXISTENCE_UNRESOLVED -> Q-UNDEFINED(INCOMPLETE_EXISTENCE)
NotExists(E):
MATCH_FOUND -> Q-FALSE
NO_MATCH_COMPLETE -> Q-TRUE
EXISTENCE_UNRESOLVED -> Q-UNDEFINED(INCOMPLETE_EXISTENCE)
This is Query evaluation definedness, not world-level epistemic truth.
6.3 Optional / outer matching
For outer solution s and optional expression O:
- compatible extensions yield compatible joined solutions;
- only
NO_MATCH_COMPLETEpermits the completed no-extension alternativesto be emitted with variables introduced only byOunbound; EXISTENCE_UNRESOLVEDmust preserve unresolved/incomplete completion rather than pretending that no extension exists.
EXISTENCE_UNRESOLVED
-/-> OPTIONAL_NO_EXTENSION_COMPLETE
Provisional emit/retract semantics require a separately declared continuous-query contract; they are not ordinary H1 Query semantics.
6.4 Basis-relative negative conditions
Ordinary Query non-match/negative existence requires NO_MATCH_COMPLETE unless an explicitly different provisional/possible-world contract says otherwise.
OUT_OF_GAS
INCOMPLETE STREAM
UNRESOLVED BASIS
-/-> successful negative Query condition
7. Aggregation, grouping and distinct under partial bindings
H1 distinguishes at least:
COUNT_SOLUTIONS
COUNT_BOUND(expr)
COUNT_DISTINCT_BOUND(expr)
COUNT_BOUND counts only Q-VALUE; Q-UNBOUND and Q-UNDEFINED are non-values.
Other reducers declare an AggregateInputPolicy sufficient to determine treatment of non-values, including at least:
SKIP_NONVALUE
REJECT_NONVALUE
EXPLICIT_DEFAULT(value)
Grouping contracts define treatment of non-value keys; H1 supports at least explicit rejection or grouping by a Query-local definedness/absence class. Such a grouping token is not a semantic NULL/domain entity.
Aggregate completion inherits the completion requirements of its entire input solution family unless an explicit partial-result policy says otherwise.
Distinct equivalence over projected partial bindings distinguishes bound from unbound and preserves materially relevant witness/lineage information.
DistinctCollapse != ProvenanceDiscard
8. Ordering, slicing and selection
Physical iteration order is non-semantic by default.
PhysicalIterationOrder != QueryResultOrder
An explicit OrderContract closes, where material:
typed order-key expressions
comparison/collation contract
direction
unbound-key treatment
tie policy
No universal cross-type total order is assumed.
A deterministic offset/slice/limit requires an order sufficient to determine the promised slice.
OrderedSelection != PhysicalPrefix
Unordered arbitrary selection is only admitted through an explicit nondeterministic selector equivalent to AnyK(k).
For AnyK(k):
FOUND_K -> may satisfy AnyK completion
FOUND_LESS_THAN_K -/-> complete without closure/exhaustion evidence
Top-k must distinguish at least semantic policies equivalent to:
EXACT_K_UNDER_DETERMINING_ORDER
WITH_BOUNDARY_TIES
EXPLICIT_NONDETERMINISTIC_K_AMONG_TIES
For ordered top-k, completion requires enough evidence that no unseen admissible candidate can alter the selected answer under the declared order/tie contract.
SEEN_K_RESULTS -/-> TOP_K_COMPLETE
9. Metagraph-native PathContract
9.1 Semantic path step
A Query path is defined over typed role-incidence traversal, not physical graph edges.
An atomic step traverses an admitted local role-to-role connection through one semantic relation instance under its relation/role contract and may constrain/bind, as applicable:
source semantic referent
relation instance
source role
source participation occurrence witness / referable participation
target role
target participation occurrence witness / referable participation
target semantic referent
material binding-local qualifications
Relations or other semantic artifacts may themselves participate when admitted, preserving higher-order traversal.
9.2 ParticipationOccurrenceWitness
A ParticipationOccurrenceWitness is a Query/result-local witness of a role occupancy/participation occurrence as distinguished by the applicable relation/role participation-correlation, multiplicity and qualification semantics under the exact evaluated basis.
ParticipationOccurrenceWitness
!= SemanticParticipationIdentity
!= StructuralBindingKey
!= PhysicalBindingRecord
It does not force every participation to become a durable semantic entity.
If participation correlation is materially unresolved, Query preserves that unresolved standing rather than inventing an occurrence merge/split.
9.3 TraversalOccurrence and PathWitness
A TraversalOccurrence is one ordered position in a PathWitness and preserves/references enough contract-level information to reconstruct the semantic traversal.
TraversalOccurrence
!= ParticipationOccurrenceWitness
!= SemanticParticipationIdentity
PathWitness preserves the ordered sequence of traversal occurrences required by the PathContract.
Keep distinct:
PathContentEquivalence
!= PathResultArtifactIdentity
!= QueryMatchDerivationIdentity
!= StoragePathIdentity
PathContentEquivalence is representation-invariant and grounded only in semantic distinctions required by the PathContract.
9.4 Compositional path expression
H1 supports denotational capability equivalent to:
AtomicStep
Sequence
Alternative
Repeat(min,max-or-unbounded)
Group
Zero repetition may produce an explicit empty path witness where contracted.
EMPTY PATH
!= missing path
!= failed match
Repeated/grouped bindings are accessible through typed ordered group/path values or a semantically equivalent facility.
9.5 Alternative multiplicity
When material, a PathContract chooses an alternative multiplicity policy including at least semantic capability equivalent to:
SET_ALTERNATIVE
MULTISET_ALTERNATIVE
Set-style collapse uses PathContentEquivalence; it does not indiscriminately merge result artifact identity or typed query lineage.
10. Path reuse, restrictors, filters and selectors
10.1 Path reuse policy
H1 supports explicit semantic reuse policies including at least:
REPEATABLE
NO_REPEAT_RELATION_INSTANCE
NO_REPEAT_SEMANTIC_REFERENT
NO_REPEAT_PARTICIPATION_OCCURRENCE
A raw physical/storage/serialization key is never Query semantic authority for reuse.
10.2 Occurrence comparison
When comparing participation occurrences, H1 distinguishes:
SAME_OCCURRENCE
DISTINCT_OCCURRENCE
OCCURRENCE_RELATION_UNRESOLVED
Reuse evaluation correspondingly distinguishes:
REUSE_ALLOWED
REUSE_REJECTED
REUSE_UNRESOLVED
Ordinary H1 Query may not coerce REUSE_UNRESOLVED into either acceptance or rejection.
REUSE_UNRESOLVED -/-> REUSE_ALLOWED
REUSE_UNRESOLVED -/-> REUSE_REJECTED
10.3 Candidate/admissible/selected/postfiltered ordering
The denotation preserves:
CandidatePaths
-> PathLocalPredicates + Reuse/RestrictorContract
-> AdmissiblePaths
-> PathSelector
-> selected paths
-> outer Query postfilter
Therefore:
PATH PREFILTER + SHORTEST
!= SHORTEST + OUTER POSTFILTER
10.4 Path-local predicates and summaries
Path predicates can inspect admitted path/group bindings, including as applicable:
semantic referents
relation instances
roles / participation occurrence witnesses
qualifications
temporal/context/frame coordinates
query-visible dependence coordinates
H1 permits typed pure comparisons across path positions/repetition groups and pure summaries sufficient for length, count and compatible min/max/sum-like operations.
A pure Query-local path measure does not independently create Analysis standing.
PURE PATH MEASURE != AnalysisResult
If a computation requires an AnalysisContract or introduces analytical standing, it is a material Analysis stage even when consumed by Query.
10.5 Path selectors and completion
H1 supports selectors sufficient for:
ALL admissible paths where finite/streaming semantics permit
ANY admissible path
one/any shortest
all shortest
counted/grouped shortest-family selection where contracted
Default path length, where used, counts semantic atomic PathStep occurrences, not physical storage edges.
A selector may claim ordinary complete shortest semantics only when membership of the relevant admissible path space is sufficiently determined. Material unresolved reuse/admissibility propagates incomplete/unresolved status.
UNRESOLVED CANDIDATE ADMISSIBILITY
-/-> CompleteUnder(OrdinaryShortestPath,...)
11. QueryGraphView
11.1 Query view standing
A Query graph/subgraph answer is a Query-local view selecting/restricting already-admitted semantic structure.
It may contain/reference:
existing semantic referents
existing relation instances
query-local incidence/participation occurrence witnesses
result-local scalar/value organization
It may not invent new independently meaningful semantic target content.
NEW INDEPENDENT SEMANTIC TARGET CONTENT
-> SemanticTransformation
11.2 View membership contract
A QueryGraphView preserves/references at least:
underlying source/revision basis
ViewMembershipContract
semantic member identities
relation-instance membership
role/incidence witness structure required for the view
material interpretation/dependence basis
view completion/closure policy
identity-preservation policy
omission semantics
11.3 Re-queryability
H1 requires a QueryGraphView to be admissible as an explicit restricted basis/view for a subsequent Query.
Source
-> QueryGraphView1
-> QueryGraphView2
A Query over a view cannot access omitted source items merely because a provider/storage can see them.
ProviderCanSee(x) -/-> QueryBasisContains(x)
Re-queryability does not make the view authoritative source state.
QueryGraphView
!= AuthoritativeSourceState
!= Truth
!= SourcePublication
!= SemanticTransformation
View composition preserves enough source/view/basis correspondence to reconstruct the composed restriction and material lineage.
12. FormaSL-native Queryability
When a semantic distinction:
- exists under an applicable semantic contract;
- is material to the Query;
- is admitted/visible in the exact Query basis; and
- is either semantically referable or representable as a Query-local structural witness without inventing semantic identity,
H1 Query must provide typed capability to bind/test/navigate it.
This covers, as applicable:
N-ary relation instances
typed roles
participation/occupancy witnesses
higher-order semantic referents
Claim / Observation / Assessment / SemanticConsequence / QueryAnswer standing
issuer / producer distinctions
authority / normative basis
context / frame / scope / jurisdiction / perspective
temporal semantic roles
plural/conflicting semantic artifacts
provenance / derivation / support / causation / runtime-trace distinctions
hypothetical dependence
source-state / revision basis
QUERYABLE
!= DURABLY SEMANTICALLY REFERABLE
QUERYABLE SEMANTIC COORDINATE
!= UNIVERSAL METADATA FIELD
Native higher-order semantic referents must be queryable through typed semantic structure without forcing storage-specific reification ceremony.
Visibility remains basis-controlled; provider knowledge outside the basis cannot influence ordinary Query answers.
13. Staged and nested Query composition
H1 supports nested/staged Query subexpressions sufficient to compose pattern/path matching, optional/existence logic, projection, grouping/aggregation, ordering/selection and final projection/view construction.
These remain inside one QueryContract by default.
QuerySubexpression
!= MaterialQueryStage
!= QueryAnswer
A separate material Query stage exists only under the general CB-L3 material-stage criterion: a distinct Query contract/result/basis is material to downstream interpretation, validation, provenance, composition or accountability.
Subquery export preserves the declared variable type/presence, witness/lineage dependencies and basis compatibility needed downstream.
Unexported local binders leave lexical scope without licensing erasure of material lineage.
Correlated subqueries use natural partial-binding compatibility:
outer bound variable -> fixed compatible input
outer unbound variable -> nested Query may bind it
Different-basis nesting requires an explicit compatible basis transition/correspondence; no implicit retargeting is allowed.
14. Completion, failure and partiality
Every QueryContract closes all materially relevant policies for:
multiplicity / duplicate semantics
ordering / nondeterminism
binding-presence behavior
expression definedness
path restrictor / reuse / selector semantics
finite / streaming semantics
aggregation/grouping semantics
view closure/membership
absence/existence semantics
partial-result policy
Preserve:
SemanticCompleteness != RunTermination
OUT_OF_GAS != EMPTY
OUT_OF_GAS != NO_MATCH_COMPLETE
STREAM PREFIX != COMPLETE QUERY ANSWER
Q-UNDEFINED != epistemic Unknown
CompleteUnder(QueryCriterion, Basis) is criterion- and basis-relative. It does not assert complete knowledge of reality.
15. Deliberate H1 exclusions
The following are not universal core H1 Query requirements:
arbitrary stateful / Turing-complete traversal programs
Query-side authoritative writes
one universal weighted/cheapest-path calculus
remote federation / SERVICE-like discovery
continuous/windowed Query
one exhaustive scalar/geospatial function catalog
These exclusions do not authorize capability waiver by provider hook.
- Arbitrary stateful traversal would collapse Query with broader computation and adjacent regimes.
- Authoritative writes belong to explicit transformation/lifecycle/source-authority contracts.
- Typed pure path measures remain extensible; one universal weighted-path calculus is not required by current H1 evidence.
- Federation and continuous Query remain separate capability questions and must be explicitly added if later included.
- Function catalogs may live in admitted language/core/stdlib contracts, but provider-only capability does not count as language capability.
CAPABILITY ADEQUACY != MAXIMAL GENERALITY
16. CB-L1 / CB-L2 / CB-L5 synchronization
16.1 CB-L1 static contract
No new semantic type constructor is required.
This contract exercises CB-L1’s already-authorized rule:
CB-L1 STATIC KERNEL
+ OPERATION-SPECIFIC STATIC RULES
= COMPLETE P2 STATIC SEMANTICS
The operation-specific Query static extension is BindingPresence plus definedness-aware formation for Query expressions over MAY_BE_UNBOUND values.
16.2 CB-L2 result contract
No new semantic standing is introduced by:
Q-UNBOUND
Q-UNDEFINED
MATCH_FOUND
NO_MATCH_COMPLETE
EXISTENCE_UNRESOLVED
REUSE_ALLOWED / REUSE_REJECTED / REUSE_UNRESOLVED
These are Query binding/evaluation/completion judgments inside the exact Query ResultContract and CB-L2 completion/partiality discipline.
QueryDefinednessState != EpistemicStanding
16.3 CB-L5 composition contract
Query-to-Query composition is admitted when producer output/basis and consumer Query input/basis contracts are compatible.
For QueryGraphView, compatibility must preserve/reconstruct the view membership restriction and its source/revision/interpretation basis chain.
QueryOverView
!= QueryOverAmbientStorage
No new universal composition operator is introduced.
17. Semantic Continuity obligations
Across Query operations and executable realization, preserve/reconstruct as material:
semantic referent and relation-instance identity
participation occurrence distinguishability without forced identity
Query binding identity and presence state
source/revision/interpretation basis
context/frame/time/visibility restrictions
path witness and PathContentEquivalence semantics
query lineage / dependence roles
conflict/plurality
view membership and omission semantics
absence/existence completion status
partial/streaming completion status
ordering/selector contract
Authorized Query operations may intentionally erase information only where their contract says so, e.g. projection, aggregation, distinct, selection or view restriction.
Any additional material loss is ACCIDENTALLY-LOST.
18. Acceptance and downstream state
This owner ratification closes Query capability adequacy for H1.
QUERY_CAPABILITY_ADEQUACY = PASS
QUERY_DURABLE_SEMANTIC_OWNER = CLOSED
QUERY_CAPABILITY_BLOCKING_UNKNOWN = NONE AT THIS HORIZON
QUERY_ACCIDENTALLY_LOST = NONE DEMONSTRATED
It does not close whole-language capability adequacy.
H1_CAPABILITY_ADEQUACY = NOT PASS
P3_CHANGE_IMPACT_REVALIDATION_FOR_QUERY = REQUIRED
P3L_MATCH_SURFACE = NOT YET CLOSED
P3L_NORMATIVE_FREEZE = PAUSED
P4_RE-RUN = NOT AUTHORIZED
P5+ = NOT AUTHORIZED
IMPLEMENTATION = NOT AUTHORIZED
The next required Query-local work is P1 trace synchronization, Semantic Continuity/composition recheck against this ratified owner and P3 executable correspondence revalidation. The next whole-language capability target after that is Analysis / Prediction.