CLI: lint inert preferences and defeater-polarity mistakes #23

Open
opened 2026-07-16 06:36:54 +00:00 by anuna-02 · 0 comments
anuna-02 commented 2026-07-16 06:36:54 +00:00 (Migrated from codeberg.org)

Summary

Add an SPL semantic lint/advisory command that identifies inert preferences,
unexpected defeater polarity, missing labels, and rules that cannot participate in
the current conflict graph.

Motivation from the grounded runs

Two modeling errors were syntactically valid but operationally misleading:

  1. Defeaters intended to block q were initially written with head q instead of
    (not q). They were inert or attacked the opposite side and later had to be
    retracted. Issue #17 corrects the documentation, but the CLI still accepts the
    mistake silently.
  2. (prefer r-zoo-not-lab r-lab-not-zoo) looked like a meaningful hypothesis
    ordering, but the rule heads were not complements and therefore did not resolve an
    actual conflict. Narrow preferences between a defeater and the directly competing
    support rule did participate.

Proposed CLI

For example:

elephant lint -t rootclaim-grounded
elephant lint statement '(prefer r-zoo-not-lab r-lab-not-zoo)' -t rootclaim-grounded
elephant assert --advice '(except d condition q)' -t rootclaim-grounded

Advisories should be non-blocking by default and machine-readable.

Candidate diagnostics

  • preference references an unknown, inactive, or non-rule label;
  • preferred rules cannot oppose one another because their heads are not complements;
  • an applicable except has no complementary support rule to attack in the theory;
  • a defeater's current polarity means it attacks the complement of what its name or
    supplied --intended-to-block literal says;
  • a rule/preference is closure-neutral in the current theory, with the reason stated;
  • duplicate labels map to incompatible rule forms.

The linter should describe actual semantics rather than infer intent when intent is
unknowable. An optional --intended-to-block <literal> makes the polarity check
explicit.

Acceptance criteria

  • Detect the inert preference and wrong-polarity fixtures above.
  • Do not claim that a defeater proves its head; explain that it only attacks the
    complement.
  • Include involved labels, heads, and conflict relation in JSON.
  • Exit behavior distinguishes lint findings from parser/runtime failure.
  • Provide an opt-in advisory on assert, without changing admission or reasoning.

Related: #17 fixes documentation; #12 improves post-hoc ambiguity explanation. This
issue catches semantic near-misses before or immediately after assertion.

Environment / evidence

Observed with Elephant 0.1.2 across the FLF two-agent runs. Corrected real-machine
corpus:
github.com/anuna-cooperative/flf-elephant-experiment@96ca63675e/corpus/rootclaim-grounded.spl

### Summary Add an SPL semantic lint/advisory command that identifies inert preferences, unexpected defeater polarity, missing labels, and rules that cannot participate in the current conflict graph. ### Motivation from the grounded runs Two modeling errors were syntactically valid but operationally misleading: 1. Defeaters intended to block `q` were initially written with head `q` instead of `(not q)`. They were inert or attacked the opposite side and later had to be retracted. Issue #17 corrects the documentation, but the CLI still accepts the mistake silently. 2. `(prefer r-zoo-not-lab r-lab-not-zoo)` looked like a meaningful hypothesis ordering, but the rule heads were not complements and therefore did not resolve an actual conflict. Narrow preferences between a defeater and the directly competing support rule did participate. ### Proposed CLI For example: ```console elephant lint -t rootclaim-grounded elephant lint statement '(prefer r-zoo-not-lab r-lab-not-zoo)' -t rootclaim-grounded elephant assert --advice '(except d condition q)' -t rootclaim-grounded ``` Advisories should be non-blocking by default and machine-readable. ### Candidate diagnostics - preference references an unknown, inactive, or non-rule label; - preferred rules cannot oppose one another because their heads are not complements; - an applicable `except` has no complementary support rule to attack in the theory; - a defeater's current polarity means it attacks the complement of what its name or supplied `--intended-to-block` literal says; - a rule/preference is closure-neutral in the current theory, with the reason stated; - duplicate labels map to incompatible rule forms. The linter should describe actual semantics rather than infer intent when intent is unknowable. An optional `--intended-to-block <literal>` makes the polarity check explicit. ### Acceptance criteria - Detect the inert preference and wrong-polarity fixtures above. - Do not claim that a defeater proves its head; explain that it only attacks the complement. - Include involved labels, heads, and conflict relation in JSON. - Exit behavior distinguishes lint findings from parser/runtime failure. - Provide an opt-in advisory on `assert`, without changing admission or reasoning. Related: #17 fixes documentation; #12 improves post-hoc ambiguity explanation. This issue catches semantic near-misses before or immediately after assertion. ### Environment / evidence Observed with Elephant 0.1.2 across the FLF two-agent runs. Corrected real-machine corpus: https://github.com/anuna-cooperative/flf-elephant-experiment/blob/96ca63675edd88cf4982449c5f78b9441c320a39/corpus/rootclaim-grounded.spl
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
anuna-research/elephant#23
No description provided.