docs← Back to article

Markdown for LLMs

LDC-E8304 — Decision shape the engine does not support

The source Markdown for this article. Copy it into your assistant or download it as a text file.

Download this articlePlain text ↗
# LDC-E8304 — Decision shape the engine does not support

## What it means

A decision table row must produce a value the table can actually
compare and return: the output type has to match the declared return
type of the decision, and the guard language covers only the
comparisons the engine can prove things about. When a row returns a
value of the wrong kind — money where a quantity was declared, for
instance — or asks for reasoning the engine does not implement, the
compiler stops at the row instead of guessing.

Aligning the row outputs with the declared return type is the usual
fix; a guard the engine cannot prove needs rewriting in simpler terms.

## Example

```law
language "law.core" version "0.2";
package demo.diag version "0.1.0";
namespace "urn:law:demo:diag";

decision Wrong(staff: Integer) -> Quantity {
  table hit unique { when staff >= 10 => 500 KZT; otherwise => 0 kg; }
}
```

## Fix

```law
language "law.core" version "0.2";
package demo.diag version "0.1.0";
namespace "urn:law:demo:diag";

decision Load(staff: Integer) -> Quantity {
  table hit unique { when staff >= 10 => 500 kg; otherwise => 0 kg; }
}
```

## Engine message

The engine reports this in its own wording:

```text
example.law:6:42: error LDC-E8304: decision "Wrong": invalid hit policy configuration: row output has type Money, but decision return type is Quantity
```

## Related

- [LDC-E8301](/diagnostics/LDC-E8301/) — hit policies and row guards.