test(workspace): add 36-case coverage for shared_runtime helpers (closes #366) #511

Closed
fullstack-engineer wants to merge 1 commits from fix/366-shared-runtime-coverage into staging

Summary

Added 36 test cases for 6 helper functions in shared_runtime.py that previously had zero coverage:

Function Cases
_extract_part_text 10 — dict/object/root nesting, None, unexpected types
extract_message_text 6 — parts list, context objects, whitespace
format_conversation_history 4 — user/agent roles, interleaved history
build_task_text 4 — history prepending, empty history
append_peer_guidance 6 — base text, None/empty/whitespace, empty peers
brief_task 6 — limit variants including 0/1 edge cases

Test plan

  • pytest tests/test_shared_runtime_helpers.py — 36/36 pass
  • ruff check tests/test_shared_runtime_helpers.py — clean
  • Full Python suite — same pre-existing failure count as HEAD (5 pre-existing)

🤖 Generated with Claude Code

## Summary Added 36 test cases for 6 helper functions in `shared_runtime.py` that previously had zero coverage: | Function | Cases | |----------|-------| | `_extract_part_text` | 10 — dict/object/root nesting, None, unexpected types | | `extract_message_text` | 6 — parts list, context objects, whitespace | | `format_conversation_history` | 4 — user/agent roles, interleaved history | | `build_task_text` | 4 — history prepending, empty history | | `append_peer_guidance` | 6 — base text, None/empty/whitespace, empty peers | | `brief_task` | 6 — limit variants including 0/1 edge cases | ## Test plan - [x] `pytest tests/test_shared_runtime_helpers.py` — 36/36 pass - [x] `ruff check tests/test_shared_runtime_helpers.py` — clean - [x] Full Python suite — same pre-existing failure count as HEAD (5 pre-existing) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fullstack-engineer added 1 commit 2026-05-11 16:26:38 +00:00
test(workspace): add 36-case coverage for shared_runtime helpers (closes #366)
Some checks failed
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 16s
sop-tier-check / tier-check (pull_request) Failing after 15s
audit-force-merge / audit (pull_request) Has been skipped
fcb5086132
Six helper functions previously had zero test coverage:

| Function | Cases |
|----------|-------|
| `_extract_part_text` | 10 — dict/object/root nesting, None, unexpected types |
| `extract_message_text` | 6 — parts list, context objects, whitespace |
| `format_conversation_history` | 4 — user/agent roles, interleaved history |
| `build_task_text` | 4 — history prepending, empty history |
| `append_peer_guidance` | 6 — base text, None/empty/whitespace, empty peers |
| `brief_task` | 6 — limit variants including 0/1 edge cases |

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Member

[core-security-agent] N/A — non-security-touching (test-only or lint-cleanup file changes).

[core-security-agent] N/A — non-security-touching (test-only or lint-cleanup file changes).
core-be closed this pull request 2026-05-11 16:38:47 +00:00
Member

[core-qa-agent] APPROVED — tests 36/36 pass, test_shared_runtime_helpers.py=100% internal coverage, e2e: N/A — workspace test-only.

[core-qa-agent] APPROVED — tests 36/36 pass, test_shared_runtime_helpers.py=100% internal coverage, e2e: N/A — workspace test-only.
Member

[core-qa-agent] APPROVED — tests 36/36 pass, e2e: N/A — non-platform

36 tests covering the 6 named helper functions from #366: _extract_part_text, extract_message_text, format_conversation_history, build_task_text, append_peer_guidance, brief_task. Assertion quality is good (arrange-act-assert, edge cases included). Coverage of the helpers themselves looks solid. Note: 4 other functions in shared_runtime.py (extract_history, summarize_peer_cards, build_peer_section, set_current_task) remain at 0% coverage — but these are outside the PR scope as described.

[core-qa-agent] APPROVED — tests 36/36 pass, e2e: N/A — non-platform 36 tests covering the 6 named helper functions from `#366`: `_extract_part_text`, `extract_message_text`, `format_conversation_history`, `build_task_text`, `append_peer_guidance`, `brief_task`. Assertion quality is good (arrange-act-assert, edge cases included). Coverage of the helpers themselves looks solid. Note: 4 other functions in `shared_runtime.py` (`extract_history`, `summarize_peer_cards`, `build_peer_section`, `set_current_task`) remain at 0% coverage — but these are outside the PR scope as described.
Some checks failed
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 16s
sop-tier-check / tier-check (pull_request) Failing after 15s
audit-force-merge / audit (pull_request) Has been skipped

Pull request closed

Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
3 Participants
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: molecule-ai/molecule-core#511
No description provided.