Class: Textus::Read::ValidateAll

Inherits:
Object
  • Object
show all
Extended by:
Contract::DSL
Defined in:
lib/textus/read/validate_all.rb

Overview

Store-wide schema + role-authority validation: walks every entry and runs the Validator over it. Consumed internally by ‘doctor`’s schema_violations check and exposed as a Ruby store method (‘store.validate_all`).

Ruby-only, like ‘Read::Freshness`: it declares a contract (so it round-trips through the routing<->contract bijection, ADR 0105) but omits `surfaces`, so it gets no CLI or MCP projection. The public `validate-all` CLI verb was removed in v0.5 (`doctor –check=schema_violations` replaces it).

Instance Method Summary collapse

Methods included from Contract::DSL

arg, around, cli, cli_stdin, contract, contract?, summary, surfaces, verb, view

Constructor Details

#initialize(container:, call:) ⇒ ValidateAll

Returns a new instance of ValidateAll.



18
19
20
21
22
23
24
# File 'lib/textus/read/validate_all.rb', line 18

def initialize(container:, call:)
  @container = container
  @call      = call
  @manifest  = container.manifest
  @schemas   = container.schemas
  @audit_log = container.audit_log
end

Instance Method Details

#callObject



26
27
28
29
30
31
32
33
# File 'lib/textus/read/validate_all.rb', line 26

def call
  Validator.new(
    reader: Get.new(container: @container, call: @call),
    manifest: @manifest,
    audit_log: @audit_log,
    schema_for: ->(name) { @schemas.fetch_or_nil(name) },
  ).call
end