Skip to content

Enforce function-level coverage risk in CI - #196

Merged
HemSoft merged 4 commits into
mainfrom
feature/issue-193-function-risk
Sep 10, 2026
Merged

HemSoft merged 4 commits into
mainfrom
feature/issue-193-function-risk

Conversation

@HemSoft

@HemSoft HemSoft commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #193

Summary

  • collect xccov executable-line coverage and pinned SwiftLint 0.65.1 complexity for every production Mac function
  • enforce CRAP 30 for new functions, reviewed ceilings for six current high-risk functions across local and CI environments, and fail closed on missing or malformed evidence
  • publish compact pass/fail reports in the required Build and Test job while preserving the full xcresult when Xcode tests fail
  • document the measurement contract, current Xcode 26.6 local and CI baselines, exclusions, review queue, and bounded follow-up policy

Verification

  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer ./test.sh with a host-only compiler metadata wrapper: 451 tests passed, 0 failures; all smoke scripts passed
  • python3 -m unittest discover -s scripts/tests -p 'test_function_risk.py' -v: 28 tests passed, including malformed aggregate counts, unknown xccov symbols, nullable complexity exceptions, and failure artifacts
  • python3 scripts/function-risk/measure.py --result <fresh-xcresult> --output <output>: passed with 841 scored functions and 0 unmatched declarations
  • local CodexBarMac.app: 13,891 of 22,135 executable lines covered, 62.76%
  • first macos-26 CI run: 13,958 of 22,135 executable lines covered, 63.06%; this exposed and now records the host-dependent LaunchAtLoginManager.init(defaults:) ceiling
  • pinned SwiftLint installer checksum and version validation: passed, including a destination path containing spaces
  • git diff --check: passed

Disposable regression proof

A temporary if false branch in LaunchAtLoginManager.refreshFromSystem() raised its SwiftLint decision count from 8 to 9 and CRAP score from 72 to 90. The real collector exited 1 with Baseline risk increased. The temporary branch was then removed, and the clean collector passed.

Residual risk

The six existing scores above 30 across local and CI environments are explicit ceilings with follow-up requirements in FUNCTION-RISK.md.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-10T00:16:01.703381Z 7c55d87 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@HemSoft

HemSoft commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3bf44b847b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/function-risk/measure.py

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread scripts/function-risk/measure.py Outdated
Comment thread scripts/function-risk/install-swiftlint.sh Outdated
Comment thread scripts/function-risk/measure.py
Comment thread scripts/function-risk/measure.py Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread scripts/function-risk/policy.json
@HemSoft

HemSoft commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 7c55d872c3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@HemSoft
HemSoft merged commit 6d911a8 into main Sep 10, 2026
2 checks passed
@HemSoft
HemSoft deleted the feature/issue-193-function-risk branch September 10, 2026 00:20
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.

Enforce function-level coverage risk in CI

1 participant