TDD: Pure-graph edge evaluator does not implement content_not_contains, causing mutually-exclusive branch conditions to both fire #96

Closed
opened 2026-08-03 21:49:12 +00:00 by CoreRasurae · 0 comments
Member

Metadata

  • Commit Message: test(langgraph): capture content_not_contains edge condition regression (#95)
  • Branch: tdd/m1-pure-graph-content-not-contains

Background and context

Companion TDD issue-capture test for bug #95: PureLangGraph._evaluate_edge_condition()
in src/cleveractors/langgraph/pure_graph.py has no case for
type: content_not_contains, so it falls through to the "unknown condition
type" branch and always returns True, violating the Actor Configuration
Standard §5.4 (content_not_contains semantics) and diverging from the
correct implementations already present in nodes.py, bridge.py, and
reactive/stream_router.py.

This issue delivers a failing-first Behave regression test that proves
the bug exists. The actual fix is delivered by issue #95 on a bugfix/
branch.

Current behavior

No test asserts that a pure-graph edge condition content_not_contains
evaluates based on actual message content. The defect can regress
undetected, and the accompanying sibling-edge exclusivity guarantee (only one
of a content_contains/content_not_contains pair should ever match) is
unverified.

Expected behavior

A Behave scenario exists that:

  • Builds a pure-graph route with two sibling edges from the same source node:
    one content_contains: NO_FIXES, one content_not_contains: NO_FIXES.
  • Drives the source node's output to contain NO_FIXES.
  • Asserts that exactly one next-node is selected (the content_contains
    target), not both.
  • Fails (via AssertionError) while the bug is present, and passes once the
    fix lands.

Acceptance criteria

  • A Behave scenario reproduces the bug: with the sibling-edge pattern
    above and message content containing NO_FIXES, exactly one next-node
    is expected; the assertion fails while the bug is present (both
    next-nodes are currently returned).
  • The scenario carries all three tags: @tdd_issue, @tdd_issue_95,
    @tdd_expected_fail.
  • The "bug still present" signal uses AssertionError only
    (assert ... / raise AssertionError(...)) — never ValueError,
    RuntimeError, OSError, or any other exception type.
  • With @tdd_expected_fail present, nox -s unit_tests is green (the
    hook inverts the failing assertion).
  • The TDD branch is named tdd/m1-pure-graph-content-not-contains (same
    suffix as the companion bugfix/ branch).

Supporting information

  • Bug captured: issue #95.
  • Spec: docs/index.md §5.4, §5.4.1.
  • TDD tag/assertion rules per the cleveractors-contributing workflow: the
    TDD hook only inverts AssertionError; the three tags are mandatory; only
    @tdd_expected_fail is removed by the bug-fix developer, @tdd_issue and
    @tdd_issue_95 remain forever as regression guards.

Subtasks

  • Add a Behave feature scenario under features/ reproducing the
    content_not_contains defect via the sibling-edge pattern, tagged
    @tdd_issue @tdd_issue_95 @tdd_expected_fail.
  • Implement the step definitions (fully — no placeholder steps),
    signalling "bug still present" only via AssertionError.
  • Confirm the assertion actually fails when run without
    @tdd_expected_fail, and that nox -s unit_tests is green with the
    tag present.
  • Verify coverage >= 97% via nox -s coverage_report.
  • Run nox (all default sessions), fix any errors.

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line matches the Commit Message in
    Metadata exactly.
  • The commit is pushed to the branch matching the Branch in Metadata exactly.
  • The TDD PR is submitted to master, reviewed (test quality, correct
    tagging, AssertionError usage), and merged.
## Metadata - **Commit Message:** `test(langgraph): capture content_not_contains edge condition regression (#95)` - **Branch:** `tdd/m1-pure-graph-content-not-contains` ## Background and context Companion TDD issue-capture test for bug #95: `PureLangGraph._evaluate_edge_condition()` in `src/cleveractors/langgraph/pure_graph.py` has no case for `type: content_not_contains`, so it falls through to the "unknown condition type" branch and always returns `True`, violating the Actor Configuration Standard §5.4 (`content_not_contains` semantics) and diverging from the correct implementations already present in `nodes.py`, `bridge.py`, and `reactive/stream_router.py`. This issue delivers a **failing-first** Behave regression test that proves the bug exists. The actual fix is delivered by issue #95 on a `bugfix/` branch. ## Current behavior No test asserts that a pure-graph edge condition `content_not_contains` evaluates based on actual message content. The defect can regress undetected, and the accompanying sibling-edge exclusivity guarantee (only one of a `content_contains`/`content_not_contains` pair should ever match) is unverified. ## Expected behavior A Behave scenario exists that: - Builds a pure-graph route with two sibling edges from the same source node: one `content_contains: NO_FIXES`, one `content_not_contains: NO_FIXES`. - Drives the source node's output to contain `NO_FIXES`. - Asserts that exactly one next-node is selected (the `content_contains` target), not both. - Fails (via `AssertionError`) while the bug is present, and passes once the fix lands. ## Acceptance criteria - [ ] A Behave scenario reproduces the bug: with the sibling-edge pattern above and message content containing `NO_FIXES`, exactly one next-node is expected; the assertion fails while the bug is present (both next-nodes are currently returned). - [ ] The scenario carries all three tags: `@tdd_issue`, `@tdd_issue_95`, `@tdd_expected_fail`. - [ ] The "bug still present" signal uses `AssertionError` only (`assert ...` / `raise AssertionError(...)`) — never `ValueError`, `RuntimeError`, `OSError`, or any other exception type. - [ ] With `@tdd_expected_fail` present, `nox -s unit_tests` is green (the hook inverts the failing assertion). - [ ] The TDD branch is named `tdd/m1-pure-graph-content-not-contains` (same suffix as the companion `bugfix/` branch). ## Supporting information - Bug captured: issue #95. - Spec: `docs/index.md` §5.4, §5.4.1. - TDD tag/assertion rules per the `cleveractors-contributing` workflow: the TDD hook only inverts `AssertionError`; the three tags are mandatory; only `@tdd_expected_fail` is removed by the bug-fix developer, `@tdd_issue` and `@tdd_issue_95` remain forever as regression guards. ## Subtasks - [ ] Add a Behave feature scenario under `features/` reproducing the `content_not_contains` defect via the sibling-edge pattern, tagged `@tdd_issue @tdd_issue_95 @tdd_expected_fail`. - [ ] Implement the step definitions (fully — no placeholder steps), signalling "bug still present" only via `AssertionError`. - [ ] Confirm the assertion actually fails when run without `@tdd_expected_fail`, and that `nox -s unit_tests` is green with the tag present. - [ ] Verify coverage >= 97% via `nox -s coverage_report`. - [ ] Run `nox` (all default sessions), fix any errors. ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the first line matches the Commit Message in Metadata exactly. - The commit is pushed to the branch matching the Branch in Metadata exactly. - The TDD PR is submitted to `master`, reviewed (test quality, correct tagging, `AssertionError` usage), and merged.
CoreRasurae added this to the v2.1.0 milestone 2026-08-03 21:49:12 +00:00
CoreRasurae added the
State
Unverified
Type
Testing
Priority
Critical
labels 2026-08-03 21:49:14 +00:00
CoreRasurae added
State
Verified
and removed
State
Unverified
labels 2026-08-03 21:54:29 +00:00
CoreRasurae added
State
In Review
and removed
State
Verified
labels 2026-08-03 22:28:27 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: cleveragents/cleveractors-core#96