TDD: JSON/YAML envelope messages field is an empty dict {} instead of spec-required list of {level, text} objects #1880

Open
opened 2026-04-03 00:04:49 +00:00 by freemo · 2 comments
Owner

Metadata

  • Branch: tdd/m5-json-yaml-messages-field-empty-dict
  • Commit Message: test(output): add TDD issue-capture test for messages field being empty dict instead of list
  • Milestone: v3.5.0
  • Parent Epic: #936

Background

This is the TDD issue-capture test for bug issue #1879.

Per the project's Bug Fix Workflow, before the bug is fixed a test must be written that captures the buggy behavior. This test is tagged @tdd_issue, @tdd_issue_1879, and @tdd_expected_fail so that it passes CI while the bug is still present.

Deliverable

A single Behave scenario (and/or Robot Framework test) that:

  1. Exercises JsonMaterializer and YamlMaterializer via OutputSession
  2. Asserts that the messages field in the output envelope is a list of {level, text} objects
  3. Is tagged with @tdd_issue, @tdd_issue_1879, and @tdd_expected_fail

Example Scenario

@tdd_issue @tdd_issue_1879 @tdd_expected_fail
Scenario: Bug #1879 - JSON envelope messages field is a list of {level, text} objects
  Given an OutputSession using JsonMaterializer with command "test"
  When a status message with level "ok" and text "All good" is added and the session is closed
  Then the output envelope messages field should be a list
  And each message in the list should have a "level" key and a "text" key

Subtasks

  • Add Behave feature scenario tagged @tdd_issue @tdd_issue_1879 @tdd_expected_fail that asserts messages is a list of {level, text} objects for JsonMaterializer
  • Add Behave feature scenario tagged @tdd_issue @tdd_issue_1879 @tdd_expected_fail that asserts messages is a list of {level, text} objects for YamlMaterializer
  • Implement step definitions for the new scenarios
  • Verify the test fails (i.e., the @tdd_expected_fail inversion causes it to pass CI) confirming the bug exists
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • The TDD test scenarios are committed to the tdd/m5-json-yaml-messages-field-empty-dict branch with the correct tags (@tdd_issue, @tdd_issue_1879, @tdd_expected_fail).
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass (the @tdd_expected_fail tag ensures CI passes despite the underlying assertion failing).
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `tdd/m5-json-yaml-messages-field-empty-dict` - **Commit Message**: `test(output): add TDD issue-capture test for messages field being empty dict instead of list` - **Milestone**: v3.5.0 - **Parent Epic**: #936 ## Background This is the TDD issue-capture test for bug issue #1879. Per the project's Bug Fix Workflow, before the bug is fixed a test must be written that captures the buggy behavior. This test is tagged `@tdd_issue`, `@tdd_issue_1879`, and `@tdd_expected_fail` so that it passes CI while the bug is still present. ## Deliverable A single Behave scenario (and/or Robot Framework test) that: 1. Exercises `JsonMaterializer` and `YamlMaterializer` via `OutputSession` 2. Asserts that the `messages` field in the output envelope is a **list** of `{level, text}` objects 3. Is tagged with `@tdd_issue`, `@tdd_issue_1879`, and `@tdd_expected_fail` ### Example Scenario ```gherkin @tdd_issue @tdd_issue_1879 @tdd_expected_fail Scenario: Bug #1879 - JSON envelope messages field is a list of {level, text} objects Given an OutputSession using JsonMaterializer with command "test" When a status message with level "ok" and text "All good" is added and the session is closed Then the output envelope messages field should be a list And each message in the list should have a "level" key and a "text" key ``` ## Subtasks - [ ] Add Behave feature scenario tagged `@tdd_issue @tdd_issue_1879 @tdd_expected_fail` that asserts `messages` is a list of `{level, text}` objects for `JsonMaterializer` - [ ] Add Behave feature scenario tagged `@tdd_issue @tdd_issue_1879 @tdd_expected_fail` that asserts `messages` is a list of `{level, text}` objects for `YamlMaterializer` - [ ] Implement step definitions for the new scenarios - [ ] Verify the test **fails** (i.e., the `@tdd_expected_fail` inversion causes it to pass CI) confirming the bug exists - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - The TDD test scenarios are committed to the `tdd/m5-json-yaml-messages-field-empty-dict` branch with the correct tags (`@tdd_issue`, `@tdd_issue_1879`, `@tdd_expected_fail`). - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass (the `@tdd_expected_fail` tag ensures CI passes despite the underlying assertion failing). - Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.5.0 milestone 2026-04-03 00:05:47 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • MoSCoW: MoSCoW/Should Have — bug or error handling improvement.

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **MoSCoW**: MoSCoW/Should Have — bug or error handling improvement. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Author
Owner

⚠️ Potential duplicate notice: This issue (#1880 TDD) describes the same bug as #1879 (UAT: JSON/YAML envelope messages field is an empty dict). Both report that the messages field returns {} instead of the spec-required list of {level, text} objects.

Please review both issues and consider closing one as a duplicate. The UAT issue (#1879) may be the canonical one.


Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: ca-backlog-groomer

⚠️ **Potential duplicate notice**: This issue (#1880 TDD) describes the same bug as #1879 (UAT: JSON/YAML envelope `messages` field is an empty dict). Both report that the `messages` field returns `{}` instead of the spec-required list of `{level, text}` objects. Please review both issues and consider closing one as a duplicate. The UAT issue (#1879) may be the canonical one. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: ca-backlog-groomer
Sign in to join this conversation.
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.

Reference
cleveragents/cleveragents-core#1880
No description provided.