stale_work_audit
Audit Git repositories for idle merge requests, inactive branches, and unprotected default branches. Get counts and thresholds to resolve hygiene gaps.
Instructions
[READ] Long-open MRs/PRs, inactive branches, protection config gaps.
The flagship hygiene audit: flags open merge/pull requests idle past stale_mr_days, non-default branches with no commit for stale_branch_days, a default branch without protection, and protection rules that allow force-push. Every flag carries its numbers. Pass injected rows for pure analysis, or a project to pull live.
Args: project: Project id or full path (required unless rows are injected). stale_mr_days: Days an open MR may idle before flagging (default 14). stale_branch_days: Days a branch may idle before flagging (default 90). merge_requests: Injected rows {id, title, state, updatedAt, draft}. branches: Injected rows {name, default, protected, lastCommitAt}. protections: Injected rows {branch, allowForcePush}. default_branch: Default-branch name (pulled live when omitted). target: Server target name from config; omit for the default.
Returns dict: {staleMergeRequests, staleBranches, protectionGaps, counts, thresholds, note}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No | ||
| project | No | ||
| branches | No | ||
| protections | No | ||
| stale_mr_days | No | ||
| default_branch | No | ||
| merge_requests | No | ||
| stale_branch_days | No |