test(integration): workflow example 13 — custom automation profile with semantic escalation #949

Closed
brent.edwards wants to merge 1 commits from test/int-wf13-custom-profile into master
Member

Summary

Integration test for Specification Workflow Example 13: Custom Automation Profile with Semantic Escalation. Exercises custom profile YAML creation, project configuration, invariant-driven escalation, decision explanation, and plan prompt/resume lifecycle under mock AI providers.

Test Cases (5)

Test Case Description
WF13 Custom Profile YAML Creation Create a custom automation profile YAML and verify actor add succeeds
WF13 Project With Custom Profile Create a project configured with the custom profile, verify project show reflects it
WF13 Invariant Escalation Add invariants, create plan, verify invariant-driven escalation triggers plan pausing
WF13 Decision Explanation Seed decisions, invoke plan explain, verify rationale and alternatives in output
WF13 Plan Prompt Resume Test plan prompt and resume lifecycle (descoped — command not yet implemented)

Changes to Existing Files

File Change Rationale
robot/cli_core.robot Timeout increased to 120s, added on_timeout=kill Prevents SIGTERM (-15) failures under CI parallel load
robot/scientific_paper_basic.robot Removed Require OpenAI Key skip guard Tests now use CLEVERAGENTS_TESTING_USE_MOCK_AI=true — no real API key needed; skip guards provided false coverage signal
robot/scientific_paper_e2e_test.robot Removed skip guard, hardened assertions Under mock AI, outputs are deterministic — conditional checks replaced with mandatory assertions

Quality Gates

Session Result
nox -s lint PASS
nox -s typecheck PASS (0 errors)
nox -s unit_tests PASS
nox -s integration_tests PASS
nox -s coverage_report 98% (>= 97%)

Closes #777

## Summary Integration test for Specification Workflow Example 13: Custom Automation Profile with Semantic Escalation. Exercises custom profile YAML creation, project configuration, invariant-driven escalation, decision explanation, and plan prompt/resume lifecycle under mock AI providers. ### Test Cases (5) | Test Case | Description | |-----------|-------------| | WF13 Custom Profile YAML Creation | Create a custom automation profile YAML and verify actor add succeeds | | WF13 Project With Custom Profile | Create a project configured with the custom profile, verify project show reflects it | | WF13 Invariant Escalation | Add invariants, create plan, verify invariant-driven escalation triggers plan pausing | | WF13 Decision Explanation | Seed decisions, invoke plan explain, verify rationale and alternatives in output | | WF13 Plan Prompt Resume | Test plan prompt and resume lifecycle (descoped — command not yet implemented) | ### Changes to Existing Files | File | Change | Rationale | |------|--------|-----------| | `robot/cli_core.robot` | Timeout increased to 120s, added `on_timeout=kill` | Prevents SIGTERM (-15) failures under CI parallel load | | `robot/scientific_paper_basic.robot` | Removed `Require OpenAI Key` skip guard | Tests now use `CLEVERAGENTS_TESTING_USE_MOCK_AI=true` — no real API key needed; skip guards provided false coverage signal | | `robot/scientific_paper_e2e_test.robot` | Removed skip guard, hardened assertions | Under mock AI, outputs are deterministic — conditional checks replaced with mandatory assertions | ### Quality Gates | Session | Result | |---------|--------| | `nox -s lint` | PASS | | `nox -s typecheck` | PASS (0 errors) | | `nox -s unit_tests` | PASS | | `nox -s integration_tests` | PASS | | `nox -s coverage_report` | 98% (>= 97%) | Closes #777
brent.edwards added the
Type
Testing
label 2026-03-14 04:01:44 +00:00
brent.edwards added this to the v3.2.0 milestone 2026-03-14 04:01:45 +00:00
freemo added the
Priority
Medium
State
In Review
labels 2026-03-14 04:34:28 +00:00
Owner

PM Review — Day 34

Status: Mergeable, 0 reviews, M3 (v3.2.0)
Closes: #777 | Author: @brent.edwards

Process Violation: Empty PR Body

The PR body is completely empty. This is a clear CONTRIBUTING.md violation. The commit message (e872049) contains a thorough description, but the PR body must independently describe the change for reviewer context. This is especially important because this PR also modifies 3 existing test files beyond the WF13 test addition.

Review Summary

Two new files following the established helper pattern:

  • robot/wf13_custom_profile.robot — 79 lines, 5 test cases
  • robot/helper_wf13_custom_profile.py — 479 lines (under 500 limit)

Plus modifications to 3 existing files:

  • robot/cli_core.robot — 4 lines changed
  • robot/scientific_paper_basic.robotRequire OpenAI Key skip guard removed
  • robot/scientific_paper_e2e_test.robot — conditional assertions replaced with hard assertions, skip guard removed

Issues Found

[BLOCKING] Empty PR body — Must be populated with a proper description including: WF13 test summary, rationale for existing test file changes, explanation of why OpenAI key skip guards were removed.

[RISK] Removed OpenAI Key skip guards — Both scientific_paper_*.robot files had Require OpenAI Key keywords deleted. Previously tests would Skip gracefully when OPENAI_API_KEY was unset. Now they'll hard-fail. Is CI guaranteed to have this key? Or are these tests now using mocked providers? This needs clarification.

[RISK] Scientific paper assertion tightening — Conditional checks (e.g., IF ${has_latex}) replaced with mandatory Should Contain ... \\documentclass. If these tests were conditional due to flakiness, this could reintroduce failures.

[MINOR] Consider separating the WF13 test addition from the scientific paper fixes into distinct commits for cleaner review history.

Action Items

Who Action Deadline
@brent.edwards BLOCKING: Populate PR body with full description Day 35
@brent.edwards Explain rationale for removing OpenAI key skip guards Day 35
@CoreRasurae Peer review this PR (Python/integration test expertise) Day 36

Labels Applied This Session

  • Priority/Medium, State/In Review added (were missing)
## PM Review — Day 34 **Status**: Mergeable, 0 reviews, M3 (v3.2.0) **Closes**: #777 | **Author**: @brent.edwards ### Process Violation: Empty PR Body The PR body is completely empty. This is a **clear CONTRIBUTING.md violation**. The commit message (`e872049`) contains a thorough description, but the PR body must independently describe the change for reviewer context. This is especially important because this PR also modifies **3 existing test files** beyond the WF13 test addition. ### Review Summary Two new files following the established helper pattern: - `robot/wf13_custom_profile.robot` — 79 lines, 5 test cases - `robot/helper_wf13_custom_profile.py` — 479 lines (under 500 limit) Plus modifications to 3 existing files: - `robot/cli_core.robot` — 4 lines changed - `robot/scientific_paper_basic.robot` — `Require OpenAI Key` skip guard **removed** - `robot/scientific_paper_e2e_test.robot` — conditional assertions replaced with hard assertions, skip guard removed ### Issues Found **[BLOCKING] Empty PR body** — Must be populated with a proper description including: WF13 test summary, rationale for existing test file changes, explanation of why OpenAI key skip guards were removed. **[RISK] Removed OpenAI Key skip guards** — Both `scientific_paper_*.robot` files had `Require OpenAI Key` keywords deleted. Previously tests would `Skip` gracefully when `OPENAI_API_KEY` was unset. Now they'll hard-fail. Is CI guaranteed to have this key? Or are these tests now using mocked providers? This needs clarification. **[RISK] Scientific paper assertion tightening** — Conditional checks (e.g., `IF ${has_latex}`) replaced with mandatory `Should Contain ... \\documentclass`. If these tests were conditional due to flakiness, this could reintroduce failures. **[MINOR]** Consider separating the WF13 test addition from the scientific paper fixes into distinct commits for cleaner review history. ### Action Items | Who | Action | Deadline | |-----|--------|----------| | @brent.edwards | **BLOCKING**: Populate PR body with full description | Day 35 | | @brent.edwards | Explain rationale for removing OpenAI key skip guards | Day 35 | | @CoreRasurae | **Peer review** this PR (Python/integration test expertise) | Day 36 | ### Labels Applied This Session - Priority/Medium, State/In Review added (were missing)
brent.edwards reviewed 2026-03-14 19:50:45 +00:00
brent.edwards left a comment
Author
Member

Self-Review — PR #949

Reviewer: @brent.edwards (author self-review)
Review method: 4 parallel threads + 2 fresh-eyes passes

Findings

P1:must-fix — # type: ignore[assignment] in _rejoin()

robot/helper_wf13_custom_profile.py:119

lines, out = text.split("\n"), []  # type: ignore[assignment]

This violates the project rule "Never use # type: ignore." PR #951 (WF15) solves the same pattern correctly with explicit annotations. Fix: replace with separate declarations.

P1:must-fix — Missing reset_global_state() in dispatch

Same issue as PR #944. Helpers WF16/17/18 reset DI singletons; this helper does not.

P1:must-fix — Test case names missing WF13 prefix

robot/wf13_custom_profile.robot

All 5 test cases lack the WF13 prefix that other workflow tests use (WF03, WF12, WF16, WF17, WF18 all prefix). This breaks filtering by workflow number.

P2:should-fix — Duplicate pre-existing fixes will conflict with PRs #951-#955

This PR modifies cli_core.robot and scientific_paper_* tests. The same fixes appear in PRs #951-#955. These PRs must be merged in sequence with rebasing between each to avoid conflicts.

Verdict

3 P1, 1 P2. P1s must be fixed before merge.

# Self-Review — PR #949 **Reviewer:** @brent.edwards (author self-review) **Review method:** 4 parallel threads + 2 fresh-eyes passes ## Findings ### P1:must-fix — `# type: ignore[assignment]` in `_rejoin()` `robot/helper_wf13_custom_profile.py:119` ```python lines, out = text.split("\n"), [] # type: ignore[assignment] ``` This violates the project rule "Never use `# type: ignore`." PR #951 (WF15) solves the same pattern correctly with explicit annotations. Fix: replace with separate declarations. ### P1:must-fix — Missing `reset_global_state()` in dispatch Same issue as PR #944. Helpers WF16/17/18 reset DI singletons; this helper does not. ### P1:must-fix — Test case names missing `WF13` prefix `robot/wf13_custom_profile.robot` All 5 test cases lack the `WF13` prefix that other workflow tests use (WF03, WF12, WF16, WF17, WF18 all prefix). This breaks filtering by workflow number. ### P2:should-fix — Duplicate pre-existing fixes will conflict with PRs #951-#955 This PR modifies `cli_core.robot` and `scientific_paper_*` tests. The same fixes appear in PRs #951-#955. These PRs must be merged in sequence with rebasing between each to avoid conflicts. ## Verdict **3 P1, 1 P2.** P1s must be fixed before merge.
freemo added the
MoSCoW
Must have
Points
3
labels 2026-03-14 22:11:37 +00:00
brent.edwards force-pushed test/int-wf13-custom-profile from e8720490be to 07d57bcd9a 2026-03-15 04:31:37 +00:00 Compare
Author
Member

Response to Self-Review P1s and PM Blocking Items

Self-Review P1s

P1 — # type: ignore[assignment] in _rejoin()
Will fix by using separate variable declarations instead of tuple assignment.

P1 — Missing reset_global_state() in dispatch
Will add reset_global_state() call in the main dispatch function.

P1 — Test case names missing WF13 prefix
Will add WF13 prefix to all 5 test case names in wf13_custom_profile.robot.

P2 — Duplicate pre-existing fixes across PRs
Acknowledged. These PRs must be merged in sequence with rebasing. Will coordinate.

PM Blocking Items

Empty PR body
Will populate with a proper description including: WF13 test summary, rationale for existing test file changes, explanation of OpenAI key skip guard removal.

Removed OpenAI Key skip guards rationale
The skip guards were removed because they caused tests to silently pass in CI without actually running, providing false coverage signal. The scientific_paper tests now use CLEVERAGENTS_TESTING_USE_MOCK_AI=true which provides deterministic mocked LLM responses, so OPENAI_API_KEY is not needed. Tests should fail honestly when something is wrong rather than silently skipping.

Scientific paper assertion tightening
The conditional checks were replaced with hard assertions because under mock AI, the outputs should be deterministic. If the test was conditional due to flakiness, the root cause was non-deterministic LLM output — mock AI eliminates that.

Working on all fixes now.

## Response to Self-Review P1s and PM Blocking Items ### Self-Review P1s **P1 — `# type: ignore[assignment]` in `_rejoin()`** Will fix by using separate variable declarations instead of tuple assignment. **P1 — Missing `reset_global_state()` in dispatch** Will add `reset_global_state()` call in the main dispatch function. **P1 — Test case names missing `WF13` prefix** Will add `WF13` prefix to all 5 test case names in `wf13_custom_profile.robot`. **P2 — Duplicate pre-existing fixes across PRs** Acknowledged. These PRs must be merged in sequence with rebasing. Will coordinate. ### PM Blocking Items **Empty PR body** Will populate with a proper description including: WF13 test summary, rationale for existing test file changes, explanation of OpenAI key skip guard removal. **Removed OpenAI Key skip guards rationale** The skip guards were removed because they caused tests to silently pass in CI without actually running, providing false coverage signal. The scientific_paper tests now use `CLEVERAGENTS_TESTING_USE_MOCK_AI=true` which provides deterministic mocked LLM responses, so `OPENAI_API_KEY` is not needed. Tests should fail honestly when something is wrong rather than silently skipping. **Scientific paper assertion tightening** The conditional checks were replaced with hard assertions because under mock AI, the outputs should be deterministic. If the test was conditional due to flakiness, the root cause was non-deterministic LLM output — mock AI eliminates that. Working on all fixes now.
brent.edwards force-pushed test/int-wf13-custom-profile from 07d57bcd9a to 3ae4948c90 2026-03-15 19:40:45 +00:00 Compare
freemo added a new dependency 2026-03-16 02:42:21 +00:00
freemo added a new dependency 2026-03-16 02:42:21 +00:00
Owner

PM Status — Day 36 (2026-03-16)

@brent.edwards — Thank you for the self-review response (Day 35). Acknowledged the P1 fixes plan.

Blocking item from Day 34 still open: The PR body is still empty. This is a CONTRIBUTING.md violation that must be fixed before review can proceed. Please add a proper PR description per CONTRIBUTING.md §PR format.

Reviewer: @hamza.khyari — review after Brent addresses the empty body and pushes P1 fixes. Target: Day 38 EOD.

Who Action Deadline
@brent.edwards Fix empty PR body, push P1 fixes Day 37 EOD
@hamza.khyari Review Day 38 EOD
## PM Status — Day 36 (2026-03-16) @brent.edwards — Thank you for the self-review response (Day 35). Acknowledged the P1 fixes plan. **Blocking item from Day 34 still open**: The PR body is still empty. This is a CONTRIBUTING.md violation that must be fixed before review can proceed. Please add a proper PR description per CONTRIBUTING.md §PR format. **Reviewer**: @hamza.khyari — review after Brent addresses the empty body and pushes P1 fixes. Target: Day 38 EOD. | Who | Action | Deadline | |-----|--------|----------| | @brent.edwards | Fix empty PR body, push P1 fixes | Day 37 EOD | | @hamza.khyari | Review | Day 38 EOD |
Author
Member

Status Update — Day 37

@freemoPR body has been populated with a full description per CONTRIBUTING.md, including:

  • WF13 test case summary (5 tests)
  • Changes to existing files table with rationale
  • Explanation of OpenAI key skip guard removal
  • Quality gates table

The self-review P1 fixes (type:ignore removal, reset_global_state, WF13 test name prefix) were addressed in earlier commits. Master has been merged in. Branch is up to date and ready for review.

Regarding the scientific paper assertion changes: the tests now use CLEVERAGENTS_TESTING_USE_MOCK_AI=true which provides deterministic mocked LLM responses, eliminating the need for OPENAI_API_KEY and justifying the hard assertions.

## Status Update — Day 37 @freemo — **PR body has been populated** with a full description per CONTRIBUTING.md, including: - WF13 test case summary (5 tests) - Changes to existing files table with rationale - Explanation of OpenAI key skip guard removal - Quality gates table The self-review P1 fixes (type:ignore removal, reset_global_state, WF13 test name prefix) were addressed in earlier commits. Master has been merged in. Branch is up to date and ready for review. Regarding the scientific paper assertion changes: the tests now use `CLEVERAGENTS_TESTING_USE_MOCK_AI=true` which provides deterministic mocked LLM responses, eliminating the need for `OPENAI_API_KEY` and justifying the hard assertions.
freemo requested review from freemo 2026-03-17 18:23:56 +00:00
freemo requested review from CoreRasurae 2026-03-17 18:23:56 +00:00
brent.edwards force-pushed test/int-wf13-custom-profile from 722eef3cee to 9725900217 2026-03-19 00:03:23 +00:00 Compare
Author
Member

Self-Review P1 Fixes Applied — Commit 97259002

Branch squash-rebased onto origin/master. All merge commits eliminated. Self-review findings verified/fixed:

Finding Status
P1: # type: ignore[assignment] in _rejoin() Already clean — separate type annotations
P1: Missing reset_global_state() Already present in dispatcher
P1: Missing WF13 prefix on test names Already prefixed
Force Tags missing custom-profile Fixed
timeout=120s on_timeout=kill Fixed — all 5 Run Process calls
CHANGELOG entry for #777 Fixed
  • nox -s lintPASS
  • nox -s typecheckPASS (0 errors)
  • Helper: 482 lines (under 500)
## Self-Review P1 Fixes Applied — Commit `97259002` Branch squash-rebased onto `origin/master`. All merge commits eliminated. Self-review findings verified/fixed: | Finding | Status | |---------|--------| | **P1**: `# type: ignore[assignment]` in `_rejoin()` | Already clean — separate type annotations | | **P1**: Missing `reset_global_state()` | Already present in dispatcher | | **P1**: Missing WF13 prefix on test names | Already prefixed | | Force Tags missing `custom-profile` | **Fixed** | | `timeout=120s on_timeout=kill` | **Fixed** — all 5 Run Process calls | | CHANGELOG entry for #777 | **Fixed** | - `nox -s lint` — **PASS** - `nox -s typecheck` — **PASS** (0 errors) - Helper: 482 lines (under 500)
freemo approved these changes 2026-03-19 04:57:33 +00:00
Dismissed
freemo left a comment
Owner

Code Review — PR #949

Well-structured integration test for WF13. Proper labels, milestone, and issue linkage. Approved.

## Code Review — PR #949 Well-structured integration test for WF13. Proper labels, milestone, and issue linkage. **Approved.**
freemo requested review from freemo 2026-03-19 05:19:12 +00:00
freemo requested review from hamza.khyari 2026-03-19 05:19:12 +00:00
brent.edwards force-pushed test/int-wf13-custom-profile from 9725900217 to ecc3d8ecd0 2026-03-20 00:01:50 +00:00 Compare
brent.edwards dismissed freemo's review 2026-03-20 00:01:51 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

Author
Member

Rebased onto origin/master (79b0a2c5). CHANGELOG conflict resolved (kept master, re-added PR entry). nox -s lint PASS, nox -s typecheck PASS (0 errors). Commit ecc3d8ec.

Rebased onto `origin/master` (`79b0a2c5`). CHANGELOG conflict resolved (kept master, re-added PR entry). `nox -s lint` PASS, `nox -s typecheck` PASS (0 errors). Commit `ecc3d8ec`.
brent.edwards force-pushed test/int-wf13-custom-profile from 2d85b950c1 to 0cbf049c93 2026-03-26 20:03:02 +00:00 Compare
freemo self-assigned this 2026-04-02 06:15:21 +00:00
Owner

🤖 Backlog Groomer (groomer-1): Closing as duplicate of #777.

Issue #777 (test(integration): workflow example 13 — custom automation profile with semantic context) is the canonical version with full labels (MoSCoW/Must have, Priority/Medium, State/In Review, Type/Testing) and milestone v3.2.0. This issue is an exact title duplicate.

🤖 **Backlog Groomer (groomer-1):** Closing as duplicate of #777. Issue #777 (`test(integration): workflow example 13 — custom automation profile with semantic context`) is the canonical version with full labels (`MoSCoW/Must have`, `Priority/Medium`, `State/In Review`, `Type/Testing`) and milestone `v3.2.0`. This issue is an exact title duplicate.
freemo closed this pull request 2026-04-02 17:32:00 +00:00
All checks were successful
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 33s
Required
Details
CI / lint (pull_request) Successful in 5m37s
Required
Details
CI / typecheck (pull_request) Successful in 5m40s
Required
Details
CI / security (pull_request) Successful in 8m30s
Required
Details
CI / quality (pull_request) Successful in 8m38s
Required
Details
CI / unit_tests (pull_request) Successful in 11m23s
Required
Details
CI / docker (pull_request) Successful in 1m13s
Required
Details
CI / integration_tests (pull_request) Successful in 13m11s
Required
Details
CI / e2e_tests (pull_request) Successful in 15m38s
CI / coverage (pull_request) Successful in 11m28s
Required
Details
CI / status-check (pull_request) Successful in 2s
CI / benchmark-regression (pull_request) Successful in 1h7m43s

Pull request closed

Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Reference: cleveragents/cleveragents-core#949