# centralization

> 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-centralization

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_runtime_agnostic_adapter_boundary["Runtime-Agnostic Adapter Boundary"]
n_operation_mode_gating["Operation Mode Gating"]
n_capability_disclosure["Capability Disclosure"]
n_pattern_classification["Pattern Classification"]
n_refactor_intent_classification["Refactor Intent Classification"]
n_research_guidance["Research Guidance"]
n_iterative_variation_discovery["Iterative Variation Discovery"]
n_detection_registry["Detection Registry"]
n_canonical_variation_selection["Canonical Variation Selection"]
n_architecture_compliance_targeting["Architecture Compliance Targeting"]
n_existing_solution_conflict["Existing Solution Conflict"]
n_migration_action_mapping["Migration Action Mapping"]
n_atomic_refactor_phase["Atomic Refactor Phase"]
n_replacement_refactor["Replacement Refactor"]
n_additive_debt_gate["Additive Debt Gate"]
n_rollback_centered_execution["Rollback-Centered Execution"]
n_pattern_specific_validation["Pattern-Specific Validation"]
n_zero_duplication_verification["Zero-Duplication Verification"]
n_validation_score["Validation Score"]
n_developer_decision_gate["Developer Decision Gate"]
n_completion_truthfulness["Completion Truthfulness"]
n_centralization_report["Centralization Report"]
n_centralization_kernel["Centralization Kernel"]
n_centralization_concern["<Centralization Concern>"]
n_canonical_variation_selection --> n_detection_registry
n_migration_action_mapping --> n_detection_registry
n_centralization_kernel --> n_pattern_classification
n_centralization_kernel --> n_research_guidance
n_centralization_kernel --> n_runtime_agnostic_adapter_boundary
n_centralization_kernel --> n_canonical_variation_selection
n_centralization_kernel --> n_operation_mode_gating
n_centralization_kernel --> n_migration_action_mapping
n_centralization_kernel --> n_replacement_refactor
n_centralization_kernel --> n_zero_duplication_verification
n_centralization_kernel --> n_centralization_report
n_centralization_kernel --> n_completion_truthfulness
```

### Runtime-Agnostic Adapter Boundary

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

Details

Intent
Express all workflow operations as semantic verbs, delegate runtime-specific mechanics to adapters, and prohibit repository-, shell-, framework-, model-, or path-specific logic from entering the core contract.

Invariant
Portable architecture separates intent from execution substrate.

Flow

```text
SemanticOperation → AdapterMapping → ConcreteExecution → EvidenceResult
```

Productions

```bnf
AdapterBoundary ::= <SemanticOperation> "->" <AdapterMapping> "->" <RuntimeAction> "->" <Result>
SemanticOperation ::= "DISCOVER_RESOURCES" | "READ_RESOURCE" | "SEARCH_CONTENT" | "APPLY_MIGRATION" | "VALIDATE_ARTIFACT" | "REPORT_RESULT"
AdapterMapping ::= <CapabilityStatus> "," <RuntimeConstraint> "," <FallbackPolicy>
```

Composes
none

Named in the derivation of
[Centralization Kernel](https://banes-lab.com/records/algo/centralization-kernel.md)

Forces
[modularity](https://banes-lab.com/records/force/modularity.md), [contract_compatibility](https://banes-lab.com/records/force/contract-compatibility.md), [semantic_consistency](https://banes-lab.com/records/force/semantic-consistency.md), [model_governance](https://banes-lab.com/records/force/model-governance.md)

Grounds
none

Before

```text
Centralization logic hardcodes a repo path and shell command, so it runs on one setup only.
```

After

```text
semantic op{DISCOVER/READ/SEARCH/APPLY_MIGRATION/VALIDATE} → adapter maps to the runtime → core carries no repo/shell/path/model
```

### Operation Mode Gating

- 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 requested operation mode, bind permitted capabilities, reject source mutation outside execution mode, and emit only artifacts valid for the current mode.

Invariant
Analysis, planning, execution, and validation are distinct contracts.

Flow

```text
DetectMode → BindPermissions → EnforceMutationPolicy → ExecuteModeScope → EmitModeArtifact
```

Productions

```bnf
MutationMode ::= "analysis_only" | "analysis_and_plan" | "execute_migration" | "validation_only"
ModeGate ::= <MutationMode> "->" <PermissionSet> "->" <ForbiddenActionSet> "->" <AllowedOutput>
ForbiddenActionSet ::= "NoSourceMutationUnlessExecuteMigration"
```

Composes
none

Named in the derivation of
[Centralization Kernel](https://banes-lab.com/records/algo/centralization-kernel.md)

Forces
[contract_compatibility](https://banes-lab.com/records/force/contract-compatibility.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 analysis run silently migrates source; a plan run also executes.
```

After

```text
detect mode{analysis | plan | execute-migration | validation} → bind permissions → source mutation only in execute mode → mode-legal artifact
```

### Capability Disclosure

- 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 required capabilities, probe or emulate each capability, mark unavailable capabilities explicitly, and downgrade confidence where capability gaps affect evidence quality.

Invariant
A workflow cannot silently rely on unavailable infrastructure.

Flow

```text
RequiredCapability → Probe → Available|Unavailable|Emulated → ConfidenceImpact
```

Productions

```bnf
CapabilityModel ::= <CapabilitySet> "->" <CapabilityStatusSet> "->" <CapabilityVerdict>
CapabilityStatus ::= "available" | "unavailable" | "emulated"
CapabilityVerdict ::= "full" | "degraded" | "blocked"
```

Composes
none

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

Grounds
none

Before

```text
Centralization assumes it can search and write, failing silently when it can't.
```

After

```text
required capabilities → probe/emulate → {available | unavailable | emulated} → confidence downgraded on a gap
```

### Pattern Classification

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

Details

Intent
Extract the target pattern description, classify it into a known centralization category, select a search strategy, select a validation strategy, and request the developer's decision only when classification remains ambiguous.

Invariant
Search must be shaped by pattern type before broad discovery begins.

Flow

```text
PatternDescription → ClassificationEvidence → PatternType → StrategySet
```

Productions

```bnf
PatternClassification ::= <PatternDescription> "->" <PatternType> "->" <SearchStrategy> "->" <ValidationStrategy>
PatternType ::= "STYLE_PATTERN" | "UTILITY" | "CONSTANT" | "CONFIGURATION" | "STRUCTURAL_CODE" | "CROSS_RESOURCE_DEPENDENCY" | "UNKNOWN"
StrategySet ::= <SearchStrategy> "," <RefactorApproach> "," <ValidationStrategy>
```

Composes
none

Composed by
[Centralization Kernel](https://banes-lab.com/records/algo/centralization-kernel.md)

Named in the derivation of
[Centralization Kernel](https://banes-lab.com/records/algo/centralization-kernel.md)

Forces
[semantic_consistency](https://banes-lab.com/records/force/semantic-consistency.md), [runtime_extensibility](https://banes-lab.com/records/force/runtime-extensibility.md), [correctness_verification](https://banes-lab.com/records/force/correctness-verification.md)

Grounds
none

Before

```text
Broad discovery launched before knowing what kind of pattern it is.
```

After

```text
pattern description → type{style | utility | constant | config | structural | cross-resource} → search strategy + validation strategy
```

### Refactor Intent Classification

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

Details

Intent
Determine whether the scattered pattern represents a duplication problem, default multiple-occurrence problems to replacement refactor, and require explicit debt justification for additive enhancement.

Invariant
Centralization is replacement, not merely abstraction creation.

Flow

```text
OccurrenceCount + PatternIntent → RefactorType → DebtPolicy
```

Productions

```bnf
RefactorIntent ::= <DuplicationEvidence> "->" <RefactorType> "->" <DebtPolicy>
RefactorType ::= "REPLACEMENT_REFACTOR" | "ADDITIVE_ENHANCEMENT" | "CONFIGURATION_UPDATE" | "DOCUMENTATION_ONLY" | "REQUIRES_ANALYSIS"
DebtPolicy ::= "zero_duplication_required" | "explicit_retained_debt_required" | "documentation_sufficient"
```

Composes
none

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

Grounds
none

Before

```text
A scattered pattern 'centralized' by adding an abstraction beside the old copies.
```

After

```text
occurrences + intent → refactor type{replacement | additive | config | doc} → replacement default; additive needs explicit debt justification
```

### Research Guidance

- 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
Query available external or local guidance, extract best practices and anti-patterns, score research quality, and disclose reduced confidence when current external research is unavailable.

Invariant
Architectural plans must distinguish evidence-backed guidance from local-only inference.

Flow

```text
GuidanceNeed → ExternalOrLocalResearch → ExtractPrinciples → ScoreConfidence → ReportLimitations
```

Productions

```bnf
ResearchGuidance ::= <ResearchQuerySet> "->" <SourceSet> "->" <BestPracticeSet> "->" <AntiPatternSet> "->" <ConfidenceScore>
SourceSet ::= <ExternalCurrentSources> | <LocalKnowledgeSources> | <Unavailable>
ConfidenceScore ::= <SourceCount> "+" <SourceQuality> "+" <Recency> "+" <ArchitectureAlignment>
```

Composes
none

Composed by
[Centralization Kernel](https://banes-lab.com/records/algo/centralization-kernel.md)

Named in the derivation of
[Centralization Kernel](https://banes-lab.com/records/algo/centralization-kernel.md)

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

Grounds
none

Before

```text
A plan built on local inference presented as best practice.
```

After

```text
guidance need → external or local research → best practices + anti-patterns → confidence score → disclose local-only limitation
```

### Iterative Variation Discovery

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

Details

Intent
Search for the primary pattern, inspect match context, infer variants, add new variants to the search set, and repeat until no new variations appear or the iteration cap is reached.

Invariant
Duplicates rarely appear in one exact form; centralization must discover variation families.

Flow

```text
PrimaryPattern → Search → ContextRead → VariationExtract → ExpandedSearch → FixedPoint
```

Productions

```bnf
VariationDiscovery ::= <SearchPatternSet> "->" <MatchSet> "->" <ContextSet> "->" <VariationSet> "->" <SearchPatternSet>
SearchLoop ::= <VariationDiscovery> "until" ("NoNewVariations" | "IterationCapReached")
VariationSet ::= <PrimaryVariation> | <PrimaryVariation> "," <DerivedVariationSet>
```

Composes
none

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

Grounds
none

Before

```text
One exact form of the duplicate found; its variants missed.
```

After

```text
primary pattern → search → read context → infer variants → expand the search set → repeat until no new variations (or cap)
```

### Detection Registry

- 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
For every discovered occurrence, record resource, location, local context, matched pattern, extracted value, occurrence role, variation type, and discovery iteration.

Invariant
Migration correctness depends on a complete occurrence ledger.

Flow

```text
Match → Context → OccurrenceRecord → Registry
```

Productions

```bnf
DetectionRegistry ::= <OccurrenceRecord> | <OccurrenceRecord> "," <DetectionRegistry>
OccurrenceRecord ::= <Resource> "," <Location> "," <Pattern> "," <Snippet> "," <ContextBefore> "," <ContextAfter> "," <Value> "," <OccurrenceRole> "," <VariationType> "," <Iteration>
VariationType ::= "primary" | "variant"
```

Composes
none

Composed by
[Canonical Variation Selection](https://banes-lab.com/records/algo/canonical-variation-selection.md), [Migration Action Mapping](https://banes-lab.com/records/algo/migration-action-mapping.md)

Forces
[runtime_extensibility](https://banes-lab.com/records/force/runtime-extensibility.md), [correctness_verification](https://banes-lab.com/records/force/correctness-verification.md), [architecture_evolution](https://banes-lab.com/records/force/architecture-evolution.md)

Grounds
none

Before

```text
Occurrences half-tracked, so migration misses sites.
```

After

```text
each match + context → occurrence record{resource, location, matched pattern, value, role, variation type, iteration} → complete ledger
```

### Canonical Variation Selection

- Stage: [intent](https://banes-lab.com/records/stage/intent.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
Compare all detected variations by frequency, completeness, architectural fitness, and semantic coverage, then select the canonical implementation from evidence rather than preference.

Invariant
The centralized form must be derived from observed project semantics.

Flow

```text
DetectionRegistry → VariationMetrics → CanonicalCandidate → CanonicalVariation
```

Productions

```bnf
CanonicalSelection ::= <DetectionRegistry> "->" <VariationMetricSet> "->" <CanonicalVariation>
VariationMetricSet ::= "frequency" "," "structural_completeness" "," "semantic_coverage" "," "architecture_fit"
CanonicalVariation ::= <EvidenceDerivedImplementationForm>
```

Composes
[Detection Registry](https://banes-lab.com/records/algo/detection-registry.md)

Named in the derivation of
[Centralization Kernel](https://banes-lab.com/records/algo/centralization-kernel.md)

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

Grounds
none

Before

```text
The centralized form chosen by preference, not by observed project semantics.
```

After

```text
detection registry → metrics{frequency, completeness, semantic coverage, architecture fit} → canonical form derived from evidence
```

### Architecture Compliance Targeting

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

Details

Intent
Load relevant architecture and validation guidance, inspect existing centralized patterns, check naming and capacity constraints, detect conflicts, and select a justified centralization target.

Invariant
A single source of truth must live in the correct architectural boundary.

Flow

```text
PatternType → ArchitectureRules → ExistingPatternScan → ConflictCheck → TargetSelection
```

Productions

```bnf
ArchitectureTargeting ::= <PatternType> "->" <GuidanceSet> "->" <ExistingCentralizationSet> "->" <ComplianceCheckSet> "->" <CentralizationTarget>
ComplianceCheckSet ::= "naming" "," "artifact_size" "," "folder_capacity" "," "dependency_direction" "," "single_responsibility"
CentralizationTarget ::= <Category> "," <LocationPolicy> "," <NamingConvention> "," <ReferenceMethod>
```

Composes
none

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

Grounds
none

Before

```text
A single source of truth placed in the wrong architectural boundary.
```

After

```text
pattern type → guidance → existing centralized patterns → checks{naming, size, capacity, dependency direction, SRP} → justified target
```

### Existing Solution Conflict

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

Details

Intent
Search existing centralized locations for the same or overlapping pattern, classify whether to reuse, extend, create a distinct target, or cancel, and require the developer's decision when conflict resolution is not mechanically safe.

Invariant
Avoid creating a second source of truth while attempting centralization.

Flow

```text
ExistingPatternSearch → ConflictDetected → ResolutionOptions → Decision
```

Productions

```bnf
ConflictResolution ::= <DuplicateCheck> "->" <ConflictState> "->" <Resolution>
ConflictState ::= "none" | "overlap" | "duplicate" | "ambiguous"
Resolution ::= "reuse_existing" | "extend_existing" | "create_distinct_target" | "cancel"
```

Composes
none

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

Grounds
none

Before

```text
A second source of truth created because an existing one was never searched.
```

After

```text
search existing centralized locations → conflict{none | overlap | duplicate | ambiguous} → {reuse | extend | distinct | cancel}
```

### Migration Action Mapping

- Stage: [project](https://banes-lab.com/records/stage/project.md)
- Axis: [reasoning](https://banes-lab.com/records/reason/axis-reasoning.md)
- Math type: [graph](https://banes-lab.com/records/reason/math-type-graph.md)
- Yields: edge-list

Details

Intent
Convert every detection-registry occurrence into an explicit migration action, including old content, replacement strategy, skip policy, and justification requirement.

Invariant
Every occurrence must be migrated or explicitly justified.

Flow

```text
DetectionRegistry → MigrationActionSet → CoverageCheck
```

Productions

```bnf
MigrationMapping ::= <DetectionRegistry> "->" <MigrationActionSet>
MigrationAction ::= <Resource> "," <Location> "," <OccurrenceRole> "," <OldContent> "," <NewContentStrategy> "," <MigrationStatus> "," <SkipJustificationPolicy>
MigrationStatus ::= "pending" | "migrated" | "skipped_with_justification"
```

Composes
[Detection Registry](https://banes-lab.com/records/algo/detection-registry.md)

Named in the derivation of
[Centralization Kernel](https://banes-lab.com/records/algo/centralization-kernel.md)

Forces
[runtime_extensibility](https://banes-lab.com/records/force/runtime-extensibility.md), [architecture_evolution](https://banes-lab.com/records/force/architecture-evolution.md)

Grounds
none

Before

```text
Some occurrences migrated, others silently left behind.
```

After

```text
detection registry → a migration action per occurrence{old content, replacement strategy, skip policy + justification} → every occurrence migrated or justified
```

### Atomic Refactor Phase

- Stage: [project](https://banes-lab.com/records/stage/project.md)
- Axis: [reasoning](https://banes-lab.com/records/reason/axis-reasoning.md)
- Math type: [algebra](https://banes-lab.com/records/reason/math-type-algebra.md)
- Yields: ordered-structure

Details

Intent
Divide the refactor into ordered phases, attach actions, attach verification criteria, attach rollback behavior, and prevent progression until the phase verification passes.

Invariant
Refactoring should advance through verified checkpoints, not broad unverified edits.

Flow

```text
Phase → Actions → Verification → Pass|Rollback → NextPhase
```

Productions

```bnf
RefactorPhase ::= <PhaseNumber> "," <PhaseName> "," <ActionSet> "," <VerificationSet> "," <RollbackStrategy>
PhaseTransition ::= <RefactorPhase> "->" ("NextPhase" | "RollbackAndStop")
VerificationSet ::= <Check> | <Check> "," <VerificationSet>
```

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)

Grounds
none

Before

```text
A broad unverified edit across all sites at once.
```

After

```text
phases → actions + verification + rollback per phase → no progression until the phase verification passes
```

### Replacement Refactor

- 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
Create the centralized implementation, establish reference infrastructure, migrate all occurrences, delete old definitions, verify zero duplication, and run final validation.

Invariant
Zero-debt centralization requires replacement plus deletion plus verification.

Flow

```text
Centralize → Reference → Migrate → DeleteOld → VerifyZeroDuplication → Validate
```

Productions

```bnf
ReplacementRefactor ::= <CreateCentralImplementation> "->" <UpdateReferenceInfrastructure> "->" <MigrateOccurrences> "->" <DeleteOldDefinitions> "->" <ZeroDuplicationCheck> "->" <FinalValidation>
CompletionCondition ::= "all_occurrences_migrated_or_justified" "," "no_unapproved_old_patterns" "," "validation_passed"
```

Composes
none

Named in the derivation of
[Centralization Kernel](https://banes-lab.com/records/algo/centralization-kernel.md)

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

Grounds
none

Before

```text
An abstraction created but the old copies remain — two sources of truth.
```

After

```text
centralize → reference infra → migrate all → delete old definitions → verify zero duplication → final validation
```

### Additive Debt Gate

- 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
When a proposed abstraction leaves old patterns in place, require explicit approval, document retained debt, define deprecation conditions, and prohibit calling the result complete centralization.

Invariant
Additive enhancement is not centralization unless debt is acknowledged and bounded.

Flow

```text
AdditivePlan → DebtDisclosure → Approval → DeprecationPlan → IncompleteOrDebtAcceptedStatus
```

Productions

```bnf
AdditiveDebtGate ::= <AdditiveEnhancement> "->" <DebtRecord> "->" <UserApproval> "->" <DeprecationPlan>
DebtRecord ::= <RetainedPatternSet> "," <Reason> "," <OwnerOrTrigger> "," <ExpirationOrReviewCondition>
CentralizationStatus ::= "not_zero_debt" | "approved_debt" | "cancelled"
```

Composes
none

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

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

Before

```text
'Centralized' declared while the old patterns are still live and unowned.
```

After

```text
additive enhancement → disclose retained debt → approval → deprecation plan → never called complete centralization
```

### Rollback-Centered Execution

- 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
Before each destructive or high-risk phase, create a checkpoint, execute actions, verify results, and roll back immediately on critical action or verification failure.

Invariant
Migration safety requires a recovery path at every phase boundary.

Flow

```text
Checkpoint → ExecutePhase → VerifyPhase → Commit|Rollback
```

Productions

```bnf
RollbackExecution ::= <Checkpoint> "->" <ActionExecution> "->" <Verification> "->" <PhaseOutcome>
PhaseOutcome ::= "commit_phase" | "rollback_and_halt"
RollbackTrigger ::= "action_failure" | "verification_failure" | "critical_invariant_failure"
```

Composes
none

Forces
[modularity](https://banes-lab.com/records/force/modularity.md), [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), [streaming_dataflow](https://banes-lab.com/records/force/streaming-dataflow.md), [architecture_evolution](https://banes-lab.com/records/force/architecture-evolution.md)

Grounds
none

Before

```text
A destructive migration phase runs with no recovery path.
```

After

```text
before each risky phase → checkpoint → execute → verify → commit | rollback on{action | verification | critical-invariant} failure
```

### Pattern-Specific Validation

- 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
Select validation checks by pattern type, execute or mark each unavailable, verify architecture compliance, check all known variations for orphaned duplicates, and compute validation score.

Invariant
Validation must match what was centralized.

Flow

```text
PatternType → ValidationSet → ExecuteChecks → DuplicationScan → Score → Status
```

Productions

```bnf
PatternValidation ::= <PatternType> "->" <ValidationCheckSet> "->" <ValidationResultSet> "->" <RemainingIssueSet> "->" <FinalStatus>
ValidationCheckSet ::= <PrimaryValidation> "," <SecondaryValidationSet> "," <ArchitectureCompliance> "," <ZeroDuplicationCheck>
FinalStatus ::= "complete" | "incomplete"
```

Composes
none

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

Grounds
none

Before

```text
Validation runs generic checks unrelated to what was centralized.
```

After

```text
pattern type → matched validation set → execute → scan every known variation for orphans → validation score
```

### Zero-Duplication 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
Search every known primary and variant pattern outside the approved centralized location, classify remaining matches as approved or orphaned, and require zero unapproved matches for replacement refactors.

Invariant
A single source of truth is invalid if old sources still exist.

Flow

```text
SearchPatterns → ExcludeCentralTarget → RemainingMatches → Approved?|Issue
```

Productions

```bnf
ZeroDuplication ::= <KnownVariationSet> "->" <ProjectSearch> "->" <RemainingMatchSet> "->" <DuplicationVerdict>
ProjectSearch ::= "search_all_modules_except_approved_central_location"
DuplicationVerdict ::= "zero_unapproved_duplication" | "remaining_duplicate_or_orphan"
```

Composes
none

Named in the derivation of
[Centralization Kernel](https://banes-lab.com/records/algo/centralization-kernel.md)

Forces
[semantic_consistency](https://banes-lab.com/records/force/semantic-consistency.md), [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
A single source of truth declared while old sources still exist elsewhere.
```

After

```text
known primary + variant patterns → search all modules except the approved central location → zero unapproved matches required
```

### Validation Score

- 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
Count total validation checks, count passed checks, divide safely, and mark complete only when the score is perfect and no remaining issues exist.

Invariant
Numerical validation is useful only when combined with issue absence.

Flow

```text
Checks → PassedChecks → SafeDivide → Score → Complete|Incomplete
```

Productions

```bnf
ValidationScore ::= <TotalChecks> "," <PassedChecks> "->" <SafeDivide> "->" <ScorePercent>
CompletionRule ::= "ScorePercent == 100" "AND" "RemainingIssues == 0"
Status ::= "complete" | "incomplete"
```

Composes
none

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

Grounds
none

Before

```text
A 90% score reported as complete while issues remain.
```

After

```text
total checks + passed → safe divide → score; complete only when score == 100 AND remaining issues == 0
```

### Developer Decision Gate

- Stage: [intent](https://banes-lab.com/records/stage/intent.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
Request the developer's decision before destructive, ambiguous, conflict-prone, additive-with-debt, or high-risk actions, then bind the selected decision into subsequent plan state.

Invariant
Ambiguity and risk require explicit governance.

Flow

```text
RiskCondition → DecisionOptions → DeveloperDecision → BoundPlanState
```

Productions

```bnf
DeveloperDecisionGate ::= <DecisionTrigger> "->" <OptionSet> "->" <SelectedOption> "->" <PlanUpdate>
DecisionTrigger ::= "ambiguous_classification" | "existing_solution_conflict" | "additive_debt" | "destructive_action" | "high_risk_refactor"
OptionSet ::= <Option> | <Option> "," <OptionSet>
```

Composes
none

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

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

Before

```text
A destructive or ambiguous action taken without governance.
```

After

```text
risk{ambiguous | conflict | additive-debt | destructive | high-risk} → options → developer decision → bound into plan state
```

### Completion Truthfulness

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

Details

Intent
Mark centralization complete only if all critical criteria pass, all old patterns are removed or justified, zero duplication is verified, validation evidence is recorded, and remaining issues are empty.

Invariant
Completion is a verified state, not a narrative claim.

Flow

```text
CriteriaSet → EvidenceSet → RemainingIssuesCheck → Complete|Incomplete
```

Productions

```bnf
CompletionContract ::= <CriticalCriteriaSet> "->" <EvidenceSet> "->" <RemainingIssueSet> "->" <CompletionVerdict>
CompletionVerdict ::= "centralization_complete" | "planned_only" | "incomplete" | "blocked"
CentralizationComplete ::= "single_source_of_truth_verified" "," "zero_unapproved_duplication" "," "validation_passed" "," "limitations_disclosed"
```

Composes
none

Named in the derivation of
[Centralization Kernel](https://banes-lab.com/records/algo/centralization-kernel.md)

Forces
[semantic_consistency](https://banes-lab.com/records/force/semantic-consistency.md), [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
'Done' asserted while duplication and validation evidence are missing.
```

After

```text
critical criteria + old patterns removed/justified + zero duplication + validation evidence + no remaining issues → complete; else planned/incomplete/blocked
```

### Centralization 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
Compose a final report containing classification, research confidence, detection metrics, architecture decision, plan, execution status, validation score, remaining issues, artifact references, and unavailable capabilities.

Invariant
Reporting must preserve the evidence trail and distinguish planned work from executed work.

Flow

```text
WorkflowArtifacts → Metrics → Limitations → Status → UserReport
```

Productions

```bnf
UserReport ::= <ClassificationSummary> "," <ResearchSummary> "," <DetectionSummary> "," <ArchitectureSummary> "," <PlanSummary> "," <ExecutionSummary> "," <ValidationSummary> "," <ArtifactReferences> "," <Limitations>
ExecutionSummary ::= "executed" | "not_executed_planned_only"
```

Composes
none

Named in the derivation of
[Centralization Kernel](https://banes-lab.com/records/algo/centralization-kernel.md)

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

Grounds
none

Before

```text
A report that conflates planned work with executed work.
```

After

```text
artifacts → {classification, research confidence, detection metrics, architecture decision, plan, execution status, validation score, limitations} → planned vs executed distinguished
```

### Centralization Kernel

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

Details

Intent
Initialize runtime context, classify the target pattern, gather research, discover all variations, analyze architecture, build a refactor plan, optionally execute migration, validate zero duplication, and report status.

Invariant
Centralization is a gated evidence machine that transforms scattered implementation into verified single-source-of-truth architecture.

Flow

```text
Init → Classify → Research → DetectVariations → AnalyzeArchitecture → Plan → Execute? → Validate → Report
```

Productions

```bnf
CentralizationKernel ::= <Initialization> "->" <PatternClassification> "->" <ResearchGuidance> "->" <VariationDiscovery> "->" <ArchitectureTargeting> "->" <MigrationMapping> "->" <RefactorPlan> "->" <OptionalExecution> "->" <PatternValidation> "->" <UserReport>
OptionalExecution ::= "skip_unless_execute_migration" | <RollbackExecution>
RefactorPlan ::= <RefactorPhaseSet> "," <MigrationActionSet> "," <VerificationChecklist> "," <RollbackStrategy>
```

Composes
[Pattern Classification](https://banes-lab.com/records/algo/pattern-classification.md), [Research Guidance](https://banes-lab.com/records/algo/research-guidance.md)

Composed by
[Type-Migration Centralization](https://banes-lab.com/records/algo/type-migration-centralization.md), [Canonical Config Resolution](https://banes-lab.com/records/algo/canonical-config-resolution.md)

Forces
[semantic_consistency](https://banes-lab.com/records/force/semantic-consistency.md), [runtime_extensibility](https://banes-lab.com/records/force/runtime-extensibility.md), [correctness_verification](https://banes-lab.com/records/force/correctness-verification.md), [architecture_evolution](https://banes-lab.com/records/force/architecture-evolution.md)

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

Derivation map

orient
[Runtime-Agnostic Adapter Boundary](https://banes-lab.com/records/algo/runtime-agnostic-adapter-boundary.md)

see
[Research Guidance](https://banes-lab.com/records/algo/research-guidance.md)

derive
[Pattern Classification](https://banes-lab.com/records/algo/pattern-classification.md)

intent
[Canonical Variation Selection](https://banes-lab.com/records/algo/canonical-variation-selection.md)

constrain
[Operation Mode Gating](https://banes-lab.com/records/algo/operation-mode-gating.md)

project
[Migration Action Mapping](https://banes-lab.com/records/algo/migration-action-mapping.md)

act
[Replacement Refactor](https://banes-lab.com/records/algo/replacement-refactor.md)

verify
[Zero-Duplication Verification](https://banes-lab.com/records/algo/zero-duplication-verification.md)

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

terminate
[Completion Truthfulness](https://banes-lab.com/records/algo/completion-truthfulness.md)

Before

```text
Scattered code merged by intuition, old copies left, never verified.
```

After

```text
init → classify → research → discover variations → analyze architecture → plan → optional execute → validate zero duplication → report
```

### <Centralization Concern>

- Meta record

Details

Intent
<Detect context> → <Classify pattern> → <Discover all occurrences and variants> → <Choose canonical source> → <Map migration> → <Gate execution> → <Validate zero debt> → <Report evidence>

Invariant
Any scattered implementation pattern can be centralized only by converting every occurrence into an accounted-for migration unit and proving no unapproved duplicate remains.

Flow

```text
Context → Pattern → Registry → Canonical → Plan → ExecutionGate → Validation → Report
```

Productions

```bnf
CentralizationConcern ::= <ContextContract> "->" <PatternContract> "->" <OccurrenceRegistry> "->" <CanonicalSource> "->" <MigrationPlan> "->" <ExecutionPolicy> "->" <ZeroDebtValidation> "->" <EvidenceReport>
ZeroDebtValidation ::= "all_variants_checked" "," "old_patterns_removed_or_justified" "," "single_source_of_truth_verified"
```

Composes
none

Forces
[semantic_consistency](https://banes-lab.com/records/force/semantic-consistency.md), [runtime_extensibility](https://banes-lab.com/records/force/runtime-extensibility.md), [correctness_verification](https://banes-lab.com/records/force/correctness-verification.md), [architecture_evolution](https://banes-lab.com/records/force/architecture-evolution.md)

Grounds
none

## Links to

- [Orient](https://banes-lab.com/records/stage/orient.md)
- [Ontology](https://banes-lab.com/records/reason/axis-ontology.md)
- [Logic](https://banes-lab.com/records/reason/math-type-logic.md)
- [Centralization Kernel](https://banes-lab.com/records/algo/centralization-kernel.md)
- [modularity](https://banes-lab.com/records/force/modularity.md)
- [contract_compatibility](https://banes-lab.com/records/force/contract-compatibility.md)
- [semantic_consistency](https://banes-lab.com/records/force/semantic-consistency.md)
- [model_governance](https://banes-lab.com/records/force/model-governance.md)
- [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)
- [state_transaction](https://banes-lab.com/records/force/state-transaction.md)
- [correctness_verification](https://banes-lab.com/records/force/correctness-verification.md)
- [Set Theory](https://banes-lab.com/records/reason/math-type-set-theory.md)
- [Derive](https://banes-lab.com/records/stage/derive.md)
- [Reasoning](https://banes-lab.com/records/reason/axis-reasoning.md)
- [runtime_extensibility](https://banes-lab.com/records/force/runtime-extensibility.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)
- [Dynamical Systems](https://banes-lab.com/records/reason/math-type-dynamical-systems.md)
- [Canonical Variation Selection](https://banes-lab.com/records/algo/canonical-variation-selection.md)
- [Migration Action Mapping](https://banes-lab.com/records/algo/migration-action-mapping.md)
- [architecture_evolution](https://banes-lab.com/records/force/architecture-evolution.md)
- [Intent](https://banes-lab.com/records/stage/intent.md)
- [Detection Registry](https://banes-lab.com/records/algo/detection-registry.md)
- [Project](https://banes-lab.com/records/stage/project.md)
- [Graph](https://banes-lab.com/records/reason/math-type-graph.md)
- [Algebra](https://banes-lab.com/records/reason/math-type-algebra.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)
- [Verify](https://banes-lab.com/records/stage/verify.md)
- [Verification](https://banes-lab.com/records/reason/axis-verification.md)
- [Ver Evidence](https://banes-lab.com/records/reason/node-ver-evidence.md)
- [resilience_recovery](https://banes-lab.com/records/force/resilience-recovery.md)
- [streaming_dataflow](https://banes-lab.com/records/force/streaming-dataflow.md)
- [security_governance](https://banes-lab.com/records/force/security-governance.md)
- [Tel Priority](https://banes-lab.com/records/reason/node-tel-priority.md)
- [Terminate](https://banes-lab.com/records/stage/terminate.md)
- [Termination](https://banes-lab.com/records/reason/axis-termination.md)
- [Ter Stop](https://banes-lab.com/records/reason/node-ter-stop.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)
- [Pattern Classification](https://banes-lab.com/records/algo/pattern-classification.md)
- [Research Guidance](https://banes-lab.com/records/algo/research-guidance.md)
- [Type-Migration Centralization](https://banes-lab.com/records/algo/type-migration-centralization.md)
- [Canonical Config Resolution](https://banes-lab.com/records/algo/canonical-config-resolution.md)
- [The derivation loop](https://banes-lab.com/ontology/reasoning/reason-loop-derivation-loop.md)
- [Runtime-Agnostic Adapter Boundary](https://banes-lab.com/records/algo/runtime-agnostic-adapter-boundary.md)
- [Operation Mode Gating](https://banes-lab.com/records/algo/operation-mode-gating.md)
- [Replacement Refactor](https://banes-lab.com/records/algo/replacement-refactor.md)
- [Zero-Duplication Verification](https://banes-lab.com/records/algo/zero-duplication-verification.md)
- [Centralization Report](https://banes-lab.com/records/algo/centralization-report.md)
- [Completion Truthfulness](https://banes-lab.com/records/algo/completion-truthfulness.md)
