Skip to content

Backfill test coverage for 15 existing capability-src crates - #306

Merged
enricopiovesan merged 15 commits into
mainfrom
claude/issue-301-backfill-capability-coverage
Aug 22, 2026
Merged

Backfill test coverage for 15 existing capability-src crates#306
enricopiovesan merged 15 commits into
mainfrom
claude/issue-301-backfill-capability-coverage

Conversation

@enricopiovesan

Copy link
Copy Markdown
Contributor

Summary

  • Backfills test coverage for all 15 existing capability-src/ crates tracked in Backfill test coverage for 15 existing under-tested capability-src crates #301, each now meeting the same bar spec 018 requires of new publishes: functions == 100%, lines >= 95%, regions >= 95% (measured via cargo llvm-cov --summary-only --json).
  • core-notify-stakeholders, core-normalize-participants, and core-evaluate-completion-quality also had genuinely-dead helper functions (never called from evaluate(), confirmed via cargo test "never used" warnings) removed rather than tested for their own sake.
  • core-select-items-for-followup had one truly-unreachable branch (the last_activity/no-signal skip path, provably dead because pressure < min_pressure already returns above it) simplified away along with its now-orphaned approaching_due/days_between date-math dependents, rather than adding tests that exercise nothing.
  • No production behavior changes elsewhere — every other crate's evaluate()/process()/authorize() logic is untouched; only #[cfg(test)] test modules gained coverage.

Governing Spec

  • 018-capability-test-coverage

Project Item

Definition of Done

  • Each of the 15 crates reaches functions=100%, lines>=95%, regions>=95% via added #[test] coverage
  • cargo test passes cleanly for each (verified individually per crate)
  • Verified via cargo llvm-cov --summary-only --json, not assumed

Validation

Per-crate cargo llvm-cov --manifest-path capability-src/<crate>/Cargo.toml --summary-only --json results (all PASS against functions==100%, lines>=95%, regions>=95%):

Crate functions lines regions
core-notify-stakeholders 100.00% 98.06% 97.41%
core-normalize-participants 100.00% 95.74% 96.16%
core-select-items-for-followup 100.00% 97.73% 97.27%
core-evaluate-completion-quality 100.00% 95.18% 95.60%
core-process-comment 100.00% 98.31% 98.47%
core-transition-action-status 100.00% 95.31% 97.49%
core-extract-action-items 100.00% 96.45% 96.92%
core-validate-action-item 100.00% 95.52% 96.57%
core-assign-ownership 100.00% 97.08% 96.89%
core-authorize 100.00% 95.82% 96.26%
core-generate-nudge-message 100.00% 96.14% 97.59%
core-calculate-price 100.00% 95.91% 96.56%
core-aggregate-team-action-health 100.00% 96.69% 96.65%
validate-email 100.00% 100.00% 100.00%
score-password-strength 100.00% 100.00% 99.36%

This PR touches only capability-src/, so scripts/ci/pre_pr_check.sh (the capabilities//personas/ gate) isn't applicable — confirmed no files under capabilities/ or personas/ changed (git diff main --stat).

enricopiovesan and others added 15 commits August 21, 2026 22:11
Removed unreachable helper functions (never called from evaluate() or
anywhere else: extract_i32, parse_i32, parse_number_millis, write_i32,
ascii_lower, eq_ignore_case, normalize_email, trim_ascii, parse_ymd_days,
format_score_millis) and added tests for the remaining branches, per
registry#301.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Removed unreachable helper functions and added tests for the remaining
branches (invalid input, id/name/email fallback matching, malformed
array elements), per registry#301.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Added tests for quiet-hours (both wrap and non-wrap), snooze, budget,
pressure, escalation, and array-scanning branches. Removed the
last_activity/no-signal skip path and its approaching_due/days_between
date-math dependents: pressure < min_pressure already returns above,
so pressure >= min_pressure always holds by the time that code ran,
making it genuinely unreachable, per registry#301.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…/96%

Removed unreachable helper functions and added tests for the verdict
branches (fail vs needs_evidence under low/high pressure), multi-gap
array output, and parser edge cases, per registry#301.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Added tests for the deny paths (missing input, unknown action, delete
own_only/hard-delete), successful edit/reply flows, multi-mention/link
output, and the low-level JSON parser helpers, per registry#301.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Added tests for missing config, unknown status, owner_only=false, and
missing/empty allowed_transitions branches, plus the low-level parser
helpers, per registry#301.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Added tests for missing text, empty-sentence skipping, confidence
threshold branches (below both, below min only), capitalized-name
matching, multi-item comma joining, due-date resolution, and the
low-level parser helpers, per registry#301.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Added tests for missing fields, empty title, missing due date,
owner/due-omitted ok output, malformed duplicate-check array
elements, and the low-level parser helpers, per registry#301.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Added tests for missing config, default fallback, fallback=creator
branches (missing creator_id, active-member match, direct accept
without require_active), and the low-level parser helpers, per
registry#301.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Added tests for missing rules key, default_effect=allow fallback,
role/attribute/condition non-match branches, and the low-level parser
helpers, per registry#301.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Added tests for missing fields, invalid intensity, owner/due-omitted
message variants for each intensity level, tone default, and the
low-level parser helpers, per registry#301.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Added tests for missing config/quantity, discount SKU/tax-code
mismatch continue branches, fixed-discount capping, unparseable tax
rates, the inclusive-tax branch, and the low-level parser helpers,
per registry#301.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…%/97%

Added tests for missing config, empty items, closed-status skipping,
overloaded owners, top-2 pressure selection with a tie-break, malformed
array elements, and the low-level parser helpers, per registry#301.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Added tests for invalid local/domain characters and exercised the
max_length input path through handle(), the last uncovered branches,
per registry#301.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Exercised the min_length input path through handle(), the last
uncovered branch, per registry#301.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@enricopiovesan
enricopiovesan enabled auto-merge (squash) August 22, 2026 04:32
@enricopiovesan
enricopiovesan merged commit 18ef17b into main Aug 22, 2026
9 checks passed
@enricopiovesan
enricopiovesan deleted the claude/issue-301-backfill-capability-coverage branch August 22, 2026 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backfill test coverage for 15 existing under-tested capability-src crates

1 participant