Repository navigation
0.6.0
Two PRD §29 / §54 polish items that were left as TODO REVIEW during
the v0.3 → v0.5 functional rollout:
Added
- [new] Visual condition builder for rules. Two new Vue components,
components/rules/ConditionRow.vue(single field/op/value leaf) and
components/rules/ConditionGroup.vue(recursive AND/OR group with
arbitrary nesting). The Rules edit screen now defaults to the
builder; a Builder/JSON toggle keeps the raw textarea around for
power users who want to paste a tree from another rule. Switching
modes round-trips through the same JSON shape the
ConditionEvaluatoraccepts, so no transform layer was added
between the UI and the engine. - [new] Failure classification for rule actions. New
FailureClassifier::classifyException(Throwable): stringmaps caught
throws to the eight PRD §12.5 categories (network / timeout / auth /
client / server / payload / configuration / internal). Recognised:
InvalidArgumentException,TypeError,ValueError,
JsonException,Illuminate\Validation\ValidationException→
payload;QueryException,ModelNotFoundException,
BindingResolutionException→configuration;
Auth/Authorisation exceptions →auth; HTTP client connection /
request exceptions →network. Everything else falls back to
internal. - [new]
error_typesurfaced in rule execution metadata.
ActionExecutornow classifies caught exceptions via the new
classifier method and tags failedExecutionResult.datawith
{ handle, error_type, exception }. CleanExecutionResult::fail()
returns from a handler that didn't tagerror_typeitself default
topayload(the canonical "missing required config field" path).
RuleEngine::evaluateOneliftserror_typeandhandleto the top
of each per-action entry inExecutionResult.data['actions']so the
CP test panel can render them as distinct badges. - [new] Dangling library template handles are no longer silent.
HttpRequestFactory::buildBodynow writes a structured
SystemLogger::warning('configuration_error_dangling_template', …)
entry whenever an outbound hook'spayload_template_handle
references a non-existent or empty template. Delivery still
proceeds against the inline-or-default fallback so a misconfigured
hook doesn't drop traffic, but operators reviewing the CP logs see
exactly which hook references which missing template.
Changed
Rules\ActionExecutorconstructor takes theFailureClassifieras
a second dependency. The container injects automatically; this is a
backwards-compatible change for external callers (no public surface
changes).Services\Http\HttpRequestFactoryconstructor takes the
Services\Logging\SystemLoggeras a fourth dependency for the
configuration-error log emission. Same: container-injected, no
public surface changes.
Tests
tests/Unit/Services/FailureClassifierTest.phpextended with six
new cases forclassifyException:InvalidArgumentException,
TypeError,ValueError,JsonException, defaultRuntimeException
/LogicException→internal.tests/Unit/Rules/RuleEngineTest.phpextended: unknown-handle path
assertserror_type = configurationand the resolved handle echoes
back; clean-fail handler path (create_entrywith nocollection)
assertserror_type = payloadandhandle = create_entry.tests/Feature/OutboundUsesLibraryTemplateTest.phpextended with
a dangling-template assertion that checks the new
configuration_error_dangling_templatelog row is written with the
right level/context/error_type.
TODO: REVIEW (still)
- Per-handler form generators in the Rules action list (it's still a
JSON array — the visual builder is conditions-only). Reasonable v2
candidate once handler-config schemas are formalised. - The
error_typeis shown in the rule test panel but is not yet
surfaced as a filter on the Logs / Deliveries listings. Filter UI is
cheap to add once we know which categories operators actually
filter by.