# context-verification

> Every algorithm contract in this domain is listed with its position on the derivation loop, its intent and invariant, the flow it walks, its productions as a…

Page: Ontology · Algorithms
Canonical: https://banes-lab.com/ontology/algorithms#algo-domain-context-verification

Every algorithm contract in this domain is listed with its position on the derivation loop, its intent and invariant, the flow it walks, its productions as a grammar, what it composes and is composed by, which forces and principles it answers to, what grounds it and what it grounds, and an exemplar where the record carries one. The diagram shows what composes what inside the domain.

Relations diagram

What composes what inside this domain.

```mermaid
flowchart LR
n_phase_separated_execution["Phase-Separated Execution"]
n_evidence_gated_claim_verification["Evidence-Gated Claim Verification"]
n_validation_gate["Validation Gate"]
n_file_modification_recovery["File Modification Recovery"]
n_trust_anchor_declaration["Trust Anchor Declaration"]
n_environment_capability_verification["Environment Capability Verification"]
n_tool_calibration["Tool Calibration"]
n_behavioral_self_test["Behavioral Self-Test"]
n_adversarial_input_testing["Adversarial Input Testing"]
n_defensive_string_normalization["Defensive String Normalization"]
n_safe_arithmetic_contract["Safe Arithmetic Contract"]
n_recursion_control["Recursion Control"]
n_recursive_self_verification["Recursive Self-Verification"]
n_advanced_tool_escalation["Advanced Tool Escalation"]
n_investigation_report["Investigation Report"]
n_action_log["Action Log"]
n_contract_based_verification_kernel["Contract-Based Verification Kernel"]
n_context_verification_concern["<Context Verification Concern>"]
n_contract_based_verification_kernel --> n_tool_calibration
n_contract_based_verification_kernel --> n_behavioral_self_test
n_contract_based_verification_kernel --> n_validation_gate
n_contract_based_verification_kernel --> n_trust_anchor_declaration
n_contract_based_verification_kernel --> n_advanced_tool_escalation
n_contract_based_verification_kernel --> n_phase_separated_execution
n_contract_based_verification_kernel --> n_evidence_gated_claim_verification
n_contract_based_verification_kernel --> n_investigation_report
n_context_verification_concern --> n_validation_gate
```

### Phase-Separated Execution

- Stage: [constrain](https://banes-lab.com/records/stage/constrain.md)
- Axis: [teleology](https://banes-lab.com/records/reason/axis-teleology.md)
- Math type: [optimisation](https://banes-lab.com/records/reason/math-type-optimisation.md)
- Yields: boolean | ranking

Details

Intent
Detect the current workflow phase, bind allowed operations to that phase, reject operations outside the phase contract, and emit only the artifact valid for that phase.

Invariant
A system must separate discovery from mutation so that analysis cannot accidentally remediate and remediation cannot silently expand scope.

Flow

```text
DetectPhase → BindCapabilities → EnforceMode → ExecuteAllowedOnly → EmitPhaseArtifact
```

Productions

```bnf
PhaseExecution ::= <PhaseDetect> "->" <CapabilityBinding> "->" <ModeEnforcement> "->" <AllowedExecution> "->" <PhaseOutput>
PhaseDetect ::= "INVESTIGATE" | "ACTION"
AllowedExecution ::= <InvestigationOnly> | <ActionOnly>
InvestigationOnly ::= "Discover" "Test" "Document" "NoModify"
ActionOnly ::= "FixKnownGap" "Modify" "Version" "NoDiscovery"
```

Composes
none

Composed by
[Governed Autonomous Plan Loop](https://banes-lab.com/records/algo/governed-autonomous-plan-loop.md)

Named in the derivation of
[Contract-Based Verification Kernel](https://banes-lab.com/records/algo/contract-based-verification-kernel.md)

Forces
[contract_compatibility](https://banes-lab.com/records/force/contract-compatibility.md), [runtime_extensibility](https://banes-lab.com/records/force/runtime-extensibility.md), [state_transaction](https://banes-lab.com/records/force/state-transaction.md), [correctness_verification](https://banes-lab.com/records/force/correctness-verification.md)

Grounds
none

Before

```text
An investigation starts fixing gaps and a fix expands its scope, with neither reported.
```

After

```text
detect phase{INVESTIGATE | ACTION} → bind allowed ops → INVESTIGATE{discover, test, document, no-modify} | ACTION{fix known gap, version, no-discovery}
```

### Evidence-Gated Claim Verification

- Stage: [verify](https://banes-lab.com/records/stage/verify.md)
- Axis: [verification](https://banes-lab.com/records/reason/axis-verification.md)
- Math type: [logic](https://banes-lab.com/records/reason/math-type-logic.md)
- Yields: boolean

Details

Intent
Extract claims, resolve each claim into observable evidence requirements, collect direct implementation evidence, classify each claim as verified, contradicted, or unverified, and report discrepancies.

Invariant
No architectural claim is trusted until mapped to implementation evidence.

Flow

```text
Claim → EvidenceRequirement → Observation → Classification → Report
```

Productions

```bnf
ClaimVerification ::= <ClaimSet> "->" <EvidenceMap> "->" <ObservationSet> "->" <VerdictSet> "->" <Report>
ClaimSet ::= <Claim> | <Claim> "," <ClaimSet>
VerdictSet ::= "verified" | "contradicted" | "unverified"
```

Composes
none

Composed by
[Plan Phase Verification](https://banes-lab.com/records/algo/plan-phase-verification.md)

Named in the derivation of
[Contract-Based Verification Kernel](https://banes-lab.com/records/algo/contract-based-verification-kernel.md)

Forces
[correctness_verification](https://banes-lab.com/records/force/correctness-verification.md), [observability_traceability](https://banes-lab.com/records/force/observability-traceability.md)

Grounds
[ver-evidence](https://banes-lab.com/records/reason/node-ver-evidence.md)

Before

```text
'The core has no infra imports' trusted because it sounds right.
```

After

```text
claims → map each to an observable evidence requirement → collect implementation evidence → verdict{verified | contradicted | unverified}
```

### Validation Gate

- Stage: [terminate](https://banes-lab.com/records/stage/terminate.md)
- Axis: [termination](https://banes-lab.com/records/reason/axis-termination.md)
- Math type: [optimisation](https://banes-lab.com/records/reason/math-type-optimisation.md)
- Yields: boolean | ranking

Details

Intent
After each critical stage, evaluate declared success criteria, block downstream progression when critical criteria fail, and carry warning-state forward when noncritical criteria fail.

Invariant
Complex workflows require explicit checkpoints that convert hidden uncertainty into visible control flow.

Flow

```text
Stage → Criteria → Evaluate → Pass|Warn|Block → Continue|Abort
```

Productions

```bnf
ValidationGate ::= <Stage> "->" <CriteriaSet> "->" <GateResult>
GateResult ::= "PASS" | "WARN" | "BLOCK"
CriteriaSet ::= <Criterion> | <Criterion> "," <CriteriaSet>
Criterion ::= <Condition> ":" <PriorityRank>
PriorityRank ::= "critical" | "high" | "medium" | "low"
```

Composes
none

Composed by
[<Workflow Orchestration Concern>](https://banes-lab.com/records/algo/workflow-orchestration-concern.md), [Contract-Based Verification Kernel](https://banes-lab.com/records/algo/contract-based-verification-kernel.md), [<Context Verification Concern>](https://banes-lab.com/records/algo/context-verification-concern.md), [Phase Close Gate](https://banes-lab.com/records/algo/phase-close-gate.md)

Named in the derivation of
[Contract-Based Verification Kernel](https://banes-lab.com/records/algo/contract-based-verification-kernel.md)

Forces
[correctness_verification](https://banes-lab.com/records/force/correctness-verification.md)

Grounds
[ter-stop](https://banes-lab.com/records/reason/node-ter-stop.md)

Before

```text
A stage's uncertainty stays hidden and flows silently downstream.
```

After

```text
stage → criteria{critical | noncritical} → {PASS | WARN | BLOCK} → block downstream on a critical failure
```

### File Modification Recovery

- Stage: [act](https://banes-lab.com/records/stage/act.md)
- Axis: [formalisation](https://banes-lab.com/records/reason/axis-formalisation.md)
- Math type: [computation](https://banes-lab.com/records/reason/math-type-computation.md)
- Yields: procedure

Details

Intent
When a file mutation fails because state changed between read and edit, reread the current file, merge the intended delta into the current content, write the complete new version, and verify persistence.

Invariant
Treat stale-write failures as state synchronization failures, not as patch failures.

Flow

```text
EditFail → ReRead → MergeDelta → WriteFullState → Verify
```

Productions

```bnf
FileRecovery ::= "ModificationError" "->" <ReadCurrent> "->" <Merge> "->" <WriteComplete> "->" <VerifyWrite>
Merge ::= <CurrentContent> "+" <RequiredChange> "->" <NewContent>
VerifyWrite ::= "Exists" "&" "ContentMatches"
```

Composes
none

Forces
[state_transaction](https://banes-lab.com/records/force/state-transaction.md), [correctness_verification](https://banes-lab.com/records/force/correctness-verification.md), [resilience_recovery](https://banes-lab.com/records/force/resilience-recovery.md)

Grounds
none

Before

```text
A stale-write failure re-patches the old content, corrupting state.
```

After

```text
edit fail → re-read current → merge the delta into full state → write complete version → verify{exists & content matches}
```

### Trust Anchor Declaration

- Stage: [orient](https://banes-lab.com/records/stage/orient.md)
- Axis: [ontology](https://banes-lab.com/records/reason/axis-ontology.md)
- Math type: [set-theory](https://banes-lab.com/records/reason/math-type-set-theory.md)
- Yields: set | boolean

Details

Intent
Declare the minimum assumptions required for the system to verify anything, bind all verification logic to those assumptions, and disclose the verification boundary.

Invariant
Every axiom a verifier rests on is declared explicitly.

Flow

```text
MinimalAssumptions → Boundary → VerificationScope → Disclosure
```

Productions

```bnf
TrustAnchor ::= <AssumptionSet> "->" <TrustBoundary> "->" <Scope>
AssumptionSet ::= <Assumption> | <Assumption> "," <AssumptionSet>
Assumption ::= "RuntimeWorks" | "FilesystemWorks" | "CommandExecutionWorks" | "ToolIOWorks"
TrustBoundary ::= "CannotVerifyVerifierWithoutExternalReference"
```

Composes
none

Named in the derivation of
[Contract-Based Verification Kernel](https://banes-lab.com/records/algo/contract-based-verification-kernel.md)

Forces
[modularity](https://banes-lab.com/records/force/modularity.md), [correctness_verification](https://banes-lab.com/records/force/correctness-verification.md)

Grounds
none

Before

```text
The verifier's own axioms are hidden, so its boundary is unknowable.
```

After

```text
declare minimal assumptions{runtime, filesystem, execution, tool IO} → boundary{cannot verify the verifier} → disclosed, not verified
```

### Environment Capability Verification

- Stage: [verify](https://banes-lab.com/records/stage/verify.md)
- Axis: [verification](https://banes-lab.com/records/reason/axis-verification.md)
- Math type: [logic](https://banes-lab.com/records/reason/math-type-logic.md)
- Yields: boolean

Details

Intent
Before executing advanced behavior, probe required runtime dependencies, classify each dependency failure by severity, and degrade or block capability based on criticality.

Invariant
Runtime capability must be measured before the workflow relies on it.

Flow

```text
Requirement → Probe → Status → Severity → CapabilityMode
```

Productions

```bnf
EnvironmentVerification ::= <RequirementSet> "->" <ProbeSet> "->" <StatusSet> "->" <CapabilityVerdict>
CapabilityVerdict ::= "full" | "degraded" | "blocked"
Status ::= "passed" | "failed"
Requirement ::= "runtime" | "packageManager" | "writePermission" | "filesystem"
```

Composes
none

Forces
[correctness_verification](https://banes-lab.com/records/force/correctness-verification.md)

Grounds
[ver-evidence](https://banes-lab.com/records/reason/node-ver-evidence.md)

Before

```text
Advanced analysis relied on before checking the runtime can run it.
```

After

```text
requirements{runtime, package manager, write, filesystem} → probe each → classify by severity → mode{full | degraded | blocked}
```

### Tool Calibration

- Stage: [see](https://banes-lab.com/records/stage/see.md)
- Axis: [analysis](https://banes-lab.com/records/reason/axis-analysis.md)
- Math type: [probability](https://banes-lab.com/records/reason/math-type-probability.md)
- Yields: number[0,1]

Details

Intent
Create known-good and known-bad fixtures, run the verification tool against both, detect false positives and false negatives, and mark the tool reliable only if both controls pass.

Invariant
Verification tools must be tested against controls before their results are trusted.

Flow

```text
KnownGood + KnownBad → RunTool → CompareExpected → CalibrateReliability
```

Productions

```bnf
ToolCalibration ::= <FixtureSet> "->" <ToolRun> "->" <ExpectedComparison> "->" <ReliabilityVerdict>
FixtureSet ::= <KnownGood> "," <KnownBad>
ReliabilityVerdict ::= "reliable" | "false_positive_risk" | "false_negative_risk" | "unreliable"
```

Composes
none

Composed by
[Contract-Based Verification Kernel](https://banes-lab.com/records/algo/contract-based-verification-kernel.md)

Named in the derivation of
[Contract-Based Verification Kernel](https://banes-lab.com/records/algo/contract-based-verification-kernel.md)

Forces
[correctness_verification](https://banes-lab.com/records/force/correctness-verification.md)

Grounds
none

Before

```text
A detector's match trusted with no control test.
```

After

```text
known-good + known-bad fixtures → run tool → detect false-positive AND false-negative → reliable only if both controls pass
```

### Behavioral Self-Test

- Stage: [verify](https://banes-lab.com/records/stage/verify.md)
- Axis: [verification](https://banes-lab.com/records/reason/axis-verification.md)
- Math type: [logic](https://banes-lab.com/records/reason/math-type-logic.md)
- Yields: boolean

Details

Intent
Execute the system’s claimed behaviors against simple positive and negative cases, compare actual output to expected output, and treat mismatch as implementation evidence failure.

Invariant
A capability counts only once its behavior matches a testable contract.

Flow

```text
ClaimedBehavior → PositiveCase + NegativeCase → Execute → Compare → Verdict
```

Productions

```bnf
BehavioralSelfTest ::= <BehaviorClaim> "->" <TestCasePair> "->" <ExecutionResult> "->" <BehaviorVerdict>
TestCasePair ::= <PositiveCase> "," <NegativeCase>
BehaviorVerdict ::= "matches_contract" | "false_positive" | "false_negative" | "failed"
```

Composes
none

Composed by
[Contract-Based Verification Kernel](https://banes-lab.com/records/algo/contract-based-verification-kernel.md)

Forces
[contract_compatibility](https://banes-lab.com/records/force/contract-compatibility.md)

Grounds
none

Before

```text
A claimed capability trusted without ever running it on a case.
```

After

```text
claimed behavior → positive + negative case → execute → compare → {matches contract | false-positive | false-negative | failed}
```

### Adversarial Input Testing

- Stage: [verify](https://banes-lab.com/records/stage/verify.md)
- Axis: [verification](https://banes-lab.com/records/reason/axis-verification.md)
- Math type: [logic](https://banes-lab.com/records/reason/math-type-logic.md)
- Yields: boolean

Details

Intent
Generate malicious, malformed, ambiguous, and deceptive inputs, execute the detection logic against them, and classify whether the system resists or accepts invalid patterns.

Invariant
Verification logic must be tested against hostile inputs, not only ordinary examples.

Flow

```text
AttackInput → ExecuteDetector → ExpectedReject|ExpectedIgnore → VulnerabilityVerdict
```

Productions

```bnf
AdversarialTesting ::= <AttackSet> "->" <DetectorExecution> "->" <SecurityVerdict>
AttackSet ::= <Attack> | <Attack> "," <AttackSet>
Attack ::= "pathTraversal" | "nullByte" | "unicodeHomoglyph" | "commentFalsePositive" | "patternSpoof"
SecurityVerdict ::= "blocked" | "ignored" | "vulnerable"
```

Composes
none

Forces
[correctness_verification](https://banes-lab.com/records/force/correctness-verification.md)

Grounds
none

Before

```text
A detector accepted after ordinary examples pass, never tested hostilely.
```

After

```text
attacks{pathTraversal, nullByte, unicodeHomoglyph, commentFalsePositive, patternSpoof} → run detector → {blocked | ignored | vulnerable}
```

### Defensive String Normalization

- Stage: [act](https://banes-lab.com/records/stage/act.md)
- Axis: [formalisation](https://banes-lab.com/records/reason/axis-formalisation.md)
- Math type: [computation](https://banes-lab.com/records/reason/math-type-computation.md)
- Yields: procedure

Details

Intent
Reject null input, remove dangerous path/control patterns, normalize Unicode representation, and only pass sanitized strings to filesystem, parser, or command boundaries.

Invariant
All external strings must be converted from hostile representation into bounded representation before use.

Flow

```text
RawString → NullGuard → StripDanger → Normalize → SafeString
```

Productions

```bnf
StringNormalization ::= <RawString> "->" <NullGuard> "->" <DangerRemoval> "->" <UnicodeNormalize> "->" <SafeString>
NullGuard ::= "reject(null|undefined)"
DangerRemoval ::= "remove('../')" | "remove('..\\')" | "remove(NULL_BYTE)"
UnicodeNormalize ::= "NFC"
```

Composes
none

Forces
[modularity](https://banes-lab.com/records/force/modularity.md), [semantic_consistency](https://banes-lab.com/records/force/semantic-consistency.md)

Grounds
none

Before

```text
A raw external string passed straight to a filesystem or command boundary.
```

After

```text
raw string → null-guard → strip{'../', null byte} → Unicode NFC → only the sanitized string crosses a boundary
```

### Safe Arithmetic Contract

- Stage: [act](https://banes-lab.com/records/stage/act.md)
- Axis: [formalisation](https://banes-lab.com/records/reason/axis-formalisation.md)
- Math type: [logic](https://banes-lab.com/records/reason/math-type-logic.md)
- Yields: boolean

Details

Intent
Check operands before calculation, reject division by zero, reject non-finite results, enforce bounds, and return nullable or typed failure instead of unsafe numeric state.

Invariant
Arithmetic output is only valid if the operation and result both satisfy the numeric contract.

Flow

```text
Operands → PreconditionCheck → Compute → FiniteCheck → BoundsCheck → Result|Failure
```

Productions

```bnf
SafeArithmetic ::= <Operands> "->" <Preconditions> "->" <Computation> "->" <Postconditions> "->" <NumericOutput>
Preconditions ::= "denominator != 0" | "operands finite"
Postconditions ::= "isFinite(result)" | "withinBounds(result)"
NumericOutput ::= <Number> | "null" | <TypedFailure>
```

Composes
none

Forces
[contract_compatibility](https://banes-lab.com/records/force/contract-compatibility.md)

Grounds
none

Before

```text
A division runs unchecked and returns NaN or Infinity into a decision.
```

After

```text
operands → preconditions{denominator != 0, finite} → compute → postconditions{isFinite, within bounds} → number | null | typed failure
```

### Recursion Control

- Stage: [act](https://banes-lab.com/records/stage/act.md)
- Axis: [formalisation](https://banes-lab.com/records/reason/axis-formalisation.md)
- Math type: [dynamical-systems](https://banes-lab.com/records/reason/math-type-dynamical-systems.md)
- Yields: boolean | counter

Details

Intent
Increment depth on recursive entry, compare against maximum depth, reject excessive recursion, and unwind depth on completion.

Invariant
Recursive systems require explicit depth governance to prevent runaway self-reference.

Flow

```text
Enter → IncrementDepth → CheckLimit → Continue|Reject → Exit
```

Productions

```bnf
RecursionControl ::= <EnterRecursiveCall> "->" <DepthIncrement> "->" <LimitCheck> "->" <Decision> "->" <Exit>
Decision ::= "continue" | "reject_max_depth_exceeded"
LimitCheck ::= "currentDepth <= maxDepth"
```

Composes
none

Composed by
[Boundary Reconciliation](https://banes-lab.com/records/algo/boundary-reconciliation.md), [Plan Phase Verification](https://banes-lab.com/records/algo/plan-phase-verification.md), [Quality Governance Loop](https://banes-lab.com/records/algo/quality-governance-loop.md)

Forces
[security_governance](https://banes-lab.com/records/force/security-governance.md)

Grounds
none

Before

```text
A recursive self-reference runs away with no depth bound.
```

After

```text
enter → increment depth → depth <= max? → {continue | reject max-depth} → unwind on exit
```

### Recursive Self-Verification

- Stage: [verify](https://banes-lab.com/records/stage/verify.md)
- Axis: [verification](https://banes-lab.com/records/reason/axis-verification.md)
- Math type: [probability](https://banes-lab.com/records/reason/math-type-probability.md)
- Yields: number[0,1]

Details

Intent
Load the system’s own definition, extract self-claims, search for implementation evidence of each claim, classify discrepancies, and downgrade confidence when self-description exceeds implemented behavior.

Invariant
A verifier should apply its verification rules to itself.

Flow

```text
SelfDefinition → ExtractClaims → VerifyClaims → DetectDiscrepancies → ConfidenceAdjustment
```

Productions

```bnf
SelfVerification ::= <SelfDefinition> "->" <SelfClaimSet> "->" <EvidenceSearch> "->" <DiscrepancySet> "->" <ConfidenceState>
ConfidenceState ::= "confirmed" | "partially_confirmed" | "overclaimed" | "invalid"
```

Composes
none

Forces
[correctness_verification](https://banes-lab.com/records/force/correctness-verification.md)

Grounds
[ver-evidence](https://banes-lab.com/records/reason/node-ver-evidence.md)

Before

```text
The verifier exempts itself from its own rules and overclaims.
```

After

```text
self definition → extract self-claims → search implementation evidence → discrepancies → confidence{confirmed | overclaimed | invalid}
```

### Advanced Tool Escalation

- Stage: [act](https://banes-lab.com/records/stage/act.md)
- Axis: [formalisation](https://banes-lab.com/records/reason/axis-formalisation.md)
- Math type: [computation](https://banes-lab.com/records/reason/math-type-computation.md)
- Yields: procedure

Details

Intent
When direct tools cannot answer a verification question, synthesize a specialized analyzer, execute it against the target, parse its output, and integrate the result as evidence.

Invariant
Missing capability should trigger controlled tool construction rather than unsupported inference.

Flow

```text
Need → CapabilityGap → GenerateTool → ExecuteTool → ParseEvidence → Integrate
```

Productions

```bnf
ToolEscalation ::= <AnalysisNeed> "->" <CapabilityCheck> "->" <ToolConstruction> "->" <ToolExecution> "->" <EvidenceIntegration>
CapabilityCheck ::= "direct_capability_available" | "requires_generated_tool"
ToolConstruction ::= "write_script" "->" "execute_script" "->" "parse_results"
```

Composes
none

Named in the derivation of
[Contract-Based Verification Kernel](https://banes-lab.com/records/algo/contract-based-verification-kernel.md)

Forces
[correctness_verification](https://banes-lab.com/records/force/correctness-verification.md), [model_governance](https://banes-lab.com/records/force/model-governance.md), [object_creation](https://banes-lab.com/records/force/object-creation.md)

Grounds
none

Before

```text
A capability gap filled by inference instead of evidence.
```

After

```text
analysis need → capability gap → write script → execute → parse → integrate the result as evidence
```

### Investigation Report

- Stage: [commit](https://banes-lab.com/records/stage/commit.md)
- Axis: [representation](https://banes-lab.com/records/reason/axis-representation.md)
- Math type: [information-theory](https://banes-lab.com/records/reason/math-type-information-theory.md)
- Yields: hash | novelty-score

Details

Intent
Collect verified findings, failed checks, warnings, discrepancies, environmental limits, adversarial results, and confidence level into a structured report without performing remediation.

Invariant
Investigation produces evidence, not fixes.

Flow

```text
EvidenceSet → FindingSet → RiskSet → Confidence → Report
```

Productions

```bnf
InvestigationReport ::= <EvidenceSet> "->" <Findings> "->" <Risks> "->" <Confidence> "->" <Report>
Findings ::= <VerifiedFinding> | <Discrepancy> | <UnverifiedClaim>
Report ::= "investigation_report"
```

Composes
none

Named in the derivation of
[Contract-Based Verification Kernel](https://banes-lab.com/records/algo/contract-based-verification-kernel.md)

Forces
[correctness_verification](https://banes-lab.com/records/force/correctness-verification.md)

Grounds
none

Before

```text
An investigation that also 'quickly fixes' what it found.
```

After

```text
evidence → findings + risks + adversarial results + confidence → one investigation report, no remediation
```

### Action Log

- Stage: [commit](https://banes-lab.com/records/stage/commit.md)
- Axis: [representation](https://banes-lab.com/records/reason/axis-representation.md)
- Math type: [information-theory](https://banes-lab.com/records/reason/math-type-information-theory.md)
- Yields: hash | novelty-score

Details

Intent
Accept only documented gaps as input, apply bounded changes, version the modified artifact, verify the write, and emit an action log without discovering new scope.

Invariant
Remediation operates only on known evidence.

Flow

```text
DocumentedGap → BoundedFix → Version → Verify → ActionLog
```

Productions

```bnf
ActionLog ::= <DocumentedGapSet> "->" <FixSet> "->" <VersionedArtifact> "->" <Verification> "->" <Log>
DocumentedGapSet ::= <Gap> | <Gap> "," <DocumentedGapSet>
FixSet ::= <Fix> | <Fix> "," <FixSet>
Log ::= "action_log"
```

Composes
none

Forces
[correctness_verification](https://banes-lab.com/records/force/correctness-verification.md)

Grounds
none

Before

```text
A fix run against a gap that was never documented, discovering new scope mid-flight.
```

After

```text
documented gaps only → bounded fix → version → verify write → action log; discovers nothing new
```

### Contract-Based Verification Kernel

- Math type: [computation](https://banes-lab.com/records/reason/math-type-computation.md)
- Yields: procedure

Details

Intent
Declare assumptions, detect phase, verify environment, calibrate tools, execute phase-legal behavior, test adversarially, enforce validation gates, self-verify claims, and emit a typed artifact.

Invariant
A reusable verification kernel is a gated state machine whose transitions are evidence-bound and phase-constrained.

Flow

```text
Assumptions → Phase → Environment → Calibration → Execution → AdversarialTest → SelfVerify → TypedOutput
```

Productions

```bnf
VerificationKernel ::= <TrustAnchor> "->" <PhaseExecution> "->" <EnvironmentVerification> "->" <ToolCalibration> "->" <BehavioralSelfTest> "->" <AdversarialTesting> "->" <ValidationGate> "->" <SelfVerification> "->" <TypedOutput>
TypedOutput ::= "investigation_report" | "action_log" | "blocked_execution_report"
```

Composes
[Tool Calibration](https://banes-lab.com/records/algo/tool-calibration.md), [Behavioral Self-Test](https://banes-lab.com/records/algo/behavioral-self-test.md), [Validation Gate](https://banes-lab.com/records/algo/validation-gate.md)

Forces
[contract_compatibility](https://banes-lab.com/records/force/contract-compatibility.md), [correctness_verification](https://banes-lab.com/records/force/correctness-verification.md)

Grounds
[derivation-loop](https://banes-lab.com/ontology/reasoning/reason-loop-derivation-loop.md)

Derivation map

orient
[Trust Anchor Declaration](https://banes-lab.com/records/algo/trust-anchor-declaration.md)

see
[Tool Calibration](https://banes-lab.com/records/algo/tool-calibration.md)

act
[Advanced Tool Escalation](https://banes-lab.com/records/algo/advanced-tool-escalation.md)

constrain
[Phase-Separated Execution](https://banes-lab.com/records/algo/phase-separated-execution.md)

verify
[Evidence-Gated Claim Verification](https://banes-lab.com/records/algo/evidence-gated-claim-verification.md)

commit
[Investigation Report](https://banes-lab.com/records/algo/investigation-report.md)

terminate
[Validation Gate](https://banes-lab.com/records/algo/validation-gate.md)

Before

```text
Behavior trusted because it looks right, with no phase, calibration, or self-check.
```

After

```text
declare assumptions → detect phase → verify environment → calibrate tools → phase-legal execution → adversarial test → validation gate → self-verify → typed artifact
```

### <Context Verification Concern>

- Meta record

Details

Intent
<Detect required contract> → <Bind allowed capability> → <Execute bounded operation> → <Validate evidence> → <Emit typed result>

Invariant
<Any system behavior should be treated as a contract-bound transition whose legitimacy depends on phase, evidence, and postcondition verification.>

Flow

```text
Contract → Capability → Operation → Gate → Artifact
```

Productions

```bnf
ConcernAlgorithm ::= <PhaseContract> "->" <CapabilityBinding> "->" <Operation> "->" <ValidationGate> "->" <TypedArtifact>
PhaseContract ::= <Precondition> "," <AllowedActionSet> "," <ForbiddenActionSet> "," <Postcondition>
TypedArtifact ::= <Report> | <Log> | <Failure>
```

Composes
[Validation Gate](https://banes-lab.com/records/algo/validation-gate.md)

Forces
[contract_compatibility](https://banes-lab.com/records/force/contract-compatibility.md), [correctness_verification](https://banes-lab.com/records/force/correctness-verification.md)

Grounds
none

## Links to

- [Constrain](https://banes-lab.com/records/stage/constrain.md)
- [Teleology](https://banes-lab.com/records/reason/axis-teleology.md)
- [Optimisation](https://banes-lab.com/records/reason/math-type-optimisation.md)
- [Governed Autonomous Plan Loop](https://banes-lab.com/records/algo/governed-autonomous-plan-loop.md)
- [Contract-Based Verification Kernel](https://banes-lab.com/records/algo/contract-based-verification-kernel.md)
- [contract_compatibility](https://banes-lab.com/records/force/contract-compatibility.md)
- [runtime_extensibility](https://banes-lab.com/records/force/runtime-extensibility.md)
- [state_transaction](https://banes-lab.com/records/force/state-transaction.md)
- [correctness_verification](https://banes-lab.com/records/force/correctness-verification.md)
- [Verify](https://banes-lab.com/records/stage/verify.md)
- [Verification](https://banes-lab.com/records/reason/axis-verification.md)
- [Logic](https://banes-lab.com/records/reason/math-type-logic.md)
- [Plan Phase Verification](https://banes-lab.com/records/algo/plan-phase-verification.md)
- [observability_traceability](https://banes-lab.com/records/force/observability-traceability.md)
- [Ver Evidence](https://banes-lab.com/records/reason/node-ver-evidence.md)
- [Terminate](https://banes-lab.com/records/stage/terminate.md)
- [Termination](https://banes-lab.com/records/reason/axis-termination.md)
- [<Workflow Orchestration Concern>](https://banes-lab.com/records/algo/workflow-orchestration-concern.md)
- [<Context Verification Concern>](https://banes-lab.com/records/algo/context-verification-concern.md)
- [Phase Close Gate](https://banes-lab.com/records/algo/phase-close-gate.md)
- [Ter Stop](https://banes-lab.com/records/reason/node-ter-stop.md)
- [Act](https://banes-lab.com/records/stage/act.md)
- [Formalisation](https://banes-lab.com/records/reason/axis-formalisation.md)
- [Computation](https://banes-lab.com/records/reason/math-type-computation.md)
- [resilience_recovery](https://banes-lab.com/records/force/resilience-recovery.md)
- [Orient](https://banes-lab.com/records/stage/orient.md)
- [Ontology](https://banes-lab.com/records/reason/axis-ontology.md)
- [Set Theory](https://banes-lab.com/records/reason/math-type-set-theory.md)
- [modularity](https://banes-lab.com/records/force/modularity.md)
- [See](https://banes-lab.com/records/stage/see.md)
- [Analysis](https://banes-lab.com/records/reason/axis-analysis.md)
- [Probability](https://banes-lab.com/records/reason/math-type-probability.md)
- [semantic_consistency](https://banes-lab.com/records/force/semantic-consistency.md)
- [Dynamical Systems](https://banes-lab.com/records/reason/math-type-dynamical-systems.md)
- [Boundary Reconciliation](https://banes-lab.com/records/algo/boundary-reconciliation.md)
- [Quality Governance Loop](https://banes-lab.com/records/algo/quality-governance-loop.md)
- [security_governance](https://banes-lab.com/records/force/security-governance.md)
- [model_governance](https://banes-lab.com/records/force/model-governance.md)
- [object_creation](https://banes-lab.com/records/force/object-creation.md)
- [Commit](https://banes-lab.com/records/stage/commit.md)
- [Representation](https://banes-lab.com/records/reason/axis-representation.md)
- [Information Theory](https://banes-lab.com/records/reason/math-type-information-theory.md)
- [Tool Calibration](https://banes-lab.com/records/algo/tool-calibration.md)
- [Behavioral Self-Test](https://banes-lab.com/records/algo/behavioral-self-test.md)
- [Validation Gate](https://banes-lab.com/records/algo/validation-gate.md)
- [The derivation loop](https://banes-lab.com/ontology/reasoning/reason-loop-derivation-loop.md)
- [Trust Anchor Declaration](https://banes-lab.com/records/algo/trust-anchor-declaration.md)
- [Advanced Tool Escalation](https://banes-lab.com/records/algo/advanced-tool-escalation.md)
- [Phase-Separated Execution](https://banes-lab.com/records/algo/phase-separated-execution.md)
- [Evidence-Gated Claim Verification](https://banes-lab.com/records/algo/evidence-gated-claim-verification.md)
- [Investigation Report](https://banes-lab.com/records/algo/investigation-report.md)
