Skip to main content

CalWarning

Enum CalWarning 

Source
pub enum CalWarning {
Show 15 variants UnknownRelation { relation: String, span: Option<Span>, }, DomainFieldWithoutTag { field: String, span: Option<Span>, }, UnknownDomainPrefix { prefix: String, span: Option<Span>, }, UnknownExtensionOption { option: String, span: Option<Span>, }, DuplicateSetField { field: String, span: Option<Span>, }, UnusedQueryParam { name: String, query: String, span: Option<Span>, }, DeprecatedPipeOperator { span: Option<Span>, }, IsCategoryOnNonRelation { field: String, category: String, span: Option<Span>, }, AssembleUnscopedSource { labels: Vec<String>, span: Option<Span>, }, UnrecognizedWhereField { field: String, span: Option<Span>, }, EachIterationCapped { rendered: usize, total: usize, max: usize, }, ContradictionScanBounded { scanned: usize, }, WithOptionInert { option: &'static str, statement: &'static str, why: &'static str, }, ScanBounded { stage: String, scanned: usize, }, PipelineStageInert { stage: String, payload: &'static str, why: &'static str, },
}
Expand description

Non-fatal CAL warnings emitted during parsing or execution.

Variants§

§

UnknownRelation

CAL-W001 — The relation name in a Fact grain is not one of the well-known OMS relations.

Fields

§relation: String
§span: Option<Span>
§

DomainFieldWithoutTag

CAL-W002 — A domain-prefixed field was used without a corresponding @tag on the query.

Fields

§field: String
§span: Option<Span>
§

UnknownDomainPrefix

CAL-W003 — A domain prefix was not recognised.

Fields

§prefix: String
§span: Option<Span>
§

UnknownExtensionOption

CAL-W004 — An extension option in a WITH clause was not recognised and will be ignored.

Fields

§option: String
§span: Option<Span>
§

DuplicateSetField

CAL-W005 — A SET field name was specified more than once in the same statement; only the last value is used.

Fields

§field: String
§span: Option<Span>
§

UnusedQueryParam

CAL-W006 — A parameter was supplied at the RUN call site but is not referenced in the saved query body.

Fields

§name: String
§query: String
§span: Option<Span>
§

DeprecatedPipeOperator

CAL-W007 — The bare pipe operator | before pipeline stages is deprecated (removed in CAL 1.1). Use direct clause syntax instead (e.g. RECALL facts ORDER BY confidence DESC LIMIT 10).

Fields

§span: Option<Span>
§

IsCategoryOnNonRelation

CAL-W008 — IS CATEGORY used on a non-relation field. The IS CATEGORY check is only meaningful on the relation field; using it on other fields silently produces no matches.

Fields

§field: String
§category: String
§span: Option<Span>
§

AssembleUnscopedSource

CAL-W009 — ASSEMBLE sources have inconsistent subject scoping. Some sources filter by subject while others don’t, which may return data from unrelated subjects.

Fields

§labels: Vec<String>
§span: Option<Span>
§

UnrecognizedWhereField

CAL-W010 — A WHERE field on an untyped (RECALL all) query is not a recognized field on any grain type. The filter is still applied per grain (matching only grains that carry the field — likely none), so this usually signals a misspelled field name. On a typed recall the same situation is a hard CAL-E060 instead (#91: a filter that cannot be honoured refuses rather than widening).

Fields

§field: String
§span: Option<Span>
§

EachIterationCapped

CAL-W011 — A {{#each}} block hit the OMS CAL §10.8 iteration cap, so the rendered output covers only the first max grains. The result set itself is complete; only this rendering is short.

Fields

§rendered: usize
§total: usize
§max: usize
§

ContradictionScanBounded

CAL-W012 — A CONTRADICTIONS query’s candidate scan hit the executor’s max_limit, so grains past it were never examined for fork status.

This exists because the useful answer to CONTRADICTIONS is often the empty one, and an agent may act on it. “Nothing is contested” and “nothing among the first N is contested” are different claims; without this warning the second would be indistinguishable from the first.

Fields

§scanned: usize
§

WithOptionInert

CAL-W014 — A WITH option parsed and ran, but does nothing on the statement it was attached to.

§5 promises that an option needing an unavailable backend “returns an honest error rather than silently degrading”. Several did neither: they parsed, ran, and returned output byte-identical to the same query without them. A hard error would break callers who have been passing these since 1.0, so the honest form is a warning that names the option and the surface — silence was the actual defect.

Fields

§option: &'static str
§statement: &'static str
§why: &'static str
§

ScanBounded

CAL-W015 — A post-retrieval stage (ORDER BY, a type-specific WHERE filter, COUNT) widened its scan to the executor’s max_limit and still filled it, so it ranked/filtered/counted a bounded window rather than the whole matching set.

The sibling of ContradictionScanBounded, generalized. ORDER BY sorts the grains a statement already returned; without widening, that is a page of default_limit rows, so ORDER BY priority DESC LIMIT 5 returned the top 5 of the newest 50 and looked exactly like the top 5 overall. Widening fixes every corpus up to max_limit; past that the only honest thing left is to say so, because the answer is still a well-formed list that happens to be wrong.

Fields

§stage: String

What forced the wide scan — “ORDER BY priority”, “WHERE tool_name”, “COUNT”.

§scanned: usize
§

PipelineStageInert

CAL-W016 — A pipeline stage was attached to a payload it cannot act on (e.g. ORDER BY on a multi-source ASSEMBLE, which returns an assembled section list rather than a flat grain list).

These used to hit a catch-all passthrough arm and vanish with no error and no warning, which contradicts docs/cal-reference.md §5: silence means the option did something. Ordering an assembly is exactly the case a host reaches for when rendering authored instruction blocks in an intended order — and it was the one case that silently did nothing.

Fields

§stage: String
§payload: &'static str
§why: &'static str

Implementations§

Source§

impl CalWarning

Source

pub fn code(&self) -> &'static str

Return the CAL spec warning code.

Source

pub fn span(&self) -> Option<Span>

Return the source span, if one was recorded.

Trait Implementations§

Source§

impl Clone for CalWarning

Source§

fn clone(&self) -> CalWarning

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CalWarning

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for CalWarning

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for CalWarning

Source§

fn eq(&self, other: &CalWarning) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CalWarning

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Sync + Send>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Fruit for T
where T: Send + Downcast,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more