housebroken-cli 0.2.3__tar.gz → 0.2.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. {housebroken_cli-0.2.3 → housebroken_cli-0.2.5}/PKG-INFO +1 -1
  2. {housebroken_cli-0.2.3 → housebroken_cli-0.2.5}/pyproject.toml +1 -1
  3. {housebroken_cli-0.2.3 → housebroken_cli-0.2.5}/scripts/inbox.sh +27 -20
  4. {housebroken_cli-0.2.3 → housebroken_cli-0.2.5}/skills/housebroken/SKILL.md +12 -5
  5. {housebroken_cli-0.2.3 → housebroken_cli-0.2.5}/.gitignore +0 -0
  6. {housebroken_cli-0.2.3 → housebroken_cli-0.2.5}/LICENSE +0 -0
  7. {housebroken_cli-0.2.3 → housebroken_cli-0.2.5}/README.md +0 -0
  8. {housebroken_cli-0.2.3 → housebroken_cli-0.2.5}/bin/housebroken +0 -0
  9. {housebroken_cli-0.2.3 → housebroken_cli-0.2.5}/hatch_build.py +0 -0
  10. {housebroken_cli-0.2.3 → housebroken_cli-0.2.5}/scripts/check-ai-policy.sh +0 -0
  11. {housebroken_cli-0.2.3 → housebroken_cli-0.2.5}/scripts/comment-census.sh +0 -0
  12. {housebroken_cli-0.2.3 → housebroken_cli-0.2.5}/scripts/diff-defaults.sh +0 -0
  13. {housebroken_cli-0.2.3 → housebroken_cli-0.2.5}/scripts/distinct-outside.sh +0 -0
  14. {housebroken_cli-0.2.3 → housebroken_cli-0.2.5}/scripts/file-pr.sh +0 -0
  15. {housebroken_cli-0.2.3 → housebroken_cli-0.2.5}/scripts/fork-hygiene.sh +0 -0
  16. {housebroken_cli-0.2.3 → housebroken_cli-0.2.5}/scripts/notes.sh +0 -0
  17. {housebroken_cli-0.2.3 → housebroken_cli-0.2.5}/scripts/pr-sweep.sh +0 -0
  18. {housebroken_cli-0.2.3 → housebroken_cli-0.2.5}/scripts/prior-art.sh +0 -0
  19. {housebroken_cli-0.2.3 → housebroken_cli-0.2.5}/scripts/verify-filed-pr.sh +0 -0
  20. {housebroken_cli-0.2.3 → housebroken_cli-0.2.5}/src/housebroken/__init__.py +0 -0
  21. {housebroken_cli-0.2.3 → housebroken_cli-0.2.5}/src/housebroken/cli.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: housebroken-cli
3
- Version: 0.2.3
3
+ Version: 0.2.5
4
4
  Summary: Agent-written pull requests that do not make a mess in someone else's house.
5
5
  Project-URL: Repository, https://github.com/lenamonj/housebroken
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "housebroken-cli"
7
- version = "0.2.3"
7
+ version = "0.2.5"
8
8
  description = "Agent-written pull requests that do not make a mess in someone else's house."
9
9
  dynamic = ["readme"]
10
10
  license = "MIT"
@@ -64,7 +64,7 @@ if [ -z "$since" ]; then
64
64
  if [ -s "$cursor_file" ]; then since="$(head -1 "$cursor_file")"; else since="$(date -u -d '24 hours ago' +%Y-%m-%dT%H:%M:%SZ 2>/dev/null || date -u -v-24H +%Y-%m-%dT%H:%M:%SZ)"; fi
65
65
  fi
66
66
 
67
- is_bot() { case "$1" in *"[bot]"|copilot-pull-request-reviewer|codecov-commenter|coveralls|CLAassistant|meta-cla*|vercel*|coderabbitai*|copy-pr-bot*|oracle-contributor-agreement*|dependabot*|github-actions*|sonarcloud*|netlify*) return 0 ;; *) return 1 ;; esac; }
67
+ is_bot() { case "$1" in *"[bot]"|Copilot|copilot*|codecov-commenter|coveralls|CLAassistant|meta-cla*|vercel*|coderabbitai*|copy-pr-bot*|oracle-contributor-agreement*|dependabot*|github-actions*|sonarcloud*|netlify*) return 0 ;; *) return 1 ;; esac; }
68
68
 
69
69
  echo "== inbox for $user since $since (now $now) =="
70
70
  if ! feed="$(gh api "notifications?all=true&since=$since&per_page=100" --paginate 2>/dev/null)"; then
@@ -85,27 +85,34 @@ while IFS= read -r t; do
85
85
  echo
86
86
  echo "--- $repo#$num [$reason, $at] $state"
87
87
  echo " $title"
88
- if [ -n "$latest" ]; then
89
- if c="$(gh api "$latest" 2>/dev/null)"; then
90
- who=$(jq -r '.user.login // "?"' <<<"$c"); when=$(jq -r '.created_at // .submitted_at // ""' <<<"$c"); where=$(jq -r 'if .path then " on " + .path + ":" + ((.line // .original_line // 0)|tostring) else "" end' <<<"$c"); rstate=$(jq -r '.state // ""' <<<"$c")
91
- if [ "$who" = "$user" ]; then
92
- echo " latest: yours, $when"
93
- elif is_bot "$who"; then
94
- echo " latest: $who (bot), $when$where"
95
- else
96
- human=$((human + 1))
97
- echo " latest: $who, $when$where${rstate:+ [$rstate]}"
98
- jq -r '.body // ""' <<<"$c" | sed 's/^/ | /'
99
- fi
100
- else
101
- echo " latest comment could not be fetched: $latest"
102
- fi
88
+ ic="$(gh api "repos/$repo/issues/$num/comments?since=$since&per_page=100" 2>/dev/null || echo '[]')"
89
+ if [ "$type" = "PullRequest" ]; then
90
+ rc="$(gh api "repos/$repo/pulls/$num/comments?since=$since&per_page=100" 2>/dev/null || echo '[]')"
91
+ rv="$(gh api "repos/$repo/pulls/$num/reviews?per_page=100" 2>/dev/null || echo '[]')"
103
92
  else
104
- echo " (no comment attached: a review, a merge, a close, a mention or a review request; see the state above)"
105
- if [ "$type" = "PullRequest" ]; then
106
- gh api "repos/$repo/pulls/$num/reviews?per_page=100" --jq --arg since "$since" --arg me "$user" '.[] | select(.submitted_at > $since and .user.login != $me) | " review " + .state + " by " + .user.login + ", " + .submitted_at + (if (.body // "") != "" then "\n | " + (.body | gsub("\r\n"; "\n | ")) else "" end)' 2>/dev/null
107
- fi
93
+ rc='[]'; rv='[]'
108
94
  fi
95
+ events="$(jq -nc --argjson ic "$ic" --argjson rc "$rc" --argjson rv "$rv" --arg since "$since" '
96
+ [ ($ic[] | {t: .created_at, who: (.user.login // "?"), kind: "comment", where: "", rst: "", body: (.body // "")}),
97
+ ($rc[] | {t: .created_at, who: (.user.login // "?"), kind: "inline", where: (" on " + .path + ":" + ((.line // .original_line // 0) | tostring)), rst: "", body: (.body // "")}),
98
+ ($rv[] | select((.submitted_at // "") > $since) | {t: .submitted_at, who: (.user.login // "?"), kind: "review", where: "", rst: (.state // ""), body: (.body // "")}) ]
99
+ | sort_by(.t) | .[]' 2>/dev/null)"
100
+ shown=0
101
+ while IFS= read -r e; do
102
+ [ -n "$e" ] || continue
103
+ who=$(jq -r .who <<<"$e"); when=$(jq -r .t <<<"$e"); kind=$(jq -r .kind <<<"$e"); where=$(jq -r .where <<<"$e"); rst=$(jq -r .rst <<<"$e")
104
+ shown=$((shown + 1))
105
+ if [ "$who" = "$user" ]; then
106
+ echo " $when yours: $kind$where"
107
+ elif is_bot "$who"; then
108
+ echo " $when $who (bot): $kind$where${rst:+ [$rst]}"
109
+ else
110
+ human=$((human + 1))
111
+ echo " $when $who: $kind$where${rst:+ [$rst]}"
112
+ jq -r .body <<<"$e" | tr -d '\r' | sed 's/^/ | /'
113
+ fi
114
+ done <<<"$events"
115
+ [ "$shown" -gt 0 ] || echo " (no comment or review since the cursor: a merge, a close, a push, a mention or a review request; see the state above)"
109
116
  done <<<"$threads"
110
117
 
111
118
  if [ "$do_ci" -eq 1 ]; then
@@ -55,11 +55,18 @@ report it in one line and do not proceed to the next step.
55
55
  exists.
56
56
 
57
57
  3. **Is it a fix or an opinion?**
58
- A change that rejects an input the project tolerated, or changes a
59
- default, is a breaking change on a stable major, however wrong the old
60
- behavior looks. It becomes an issue that describes the behavior and offers
61
- the patch, never a pull request. Classify every patch before writing a
62
- test for it. A finding whose only red evidence is a measurement, such
58
+ A change that rejects an input the project tolerated, changes a default,
59
+ or narrows what the project publishes is the maintainer's call, not
60
+ yours, however wrong the old behavior looks. Send the pull request
61
+ anyway, and put the call in the body: one paragraph naming exactly what
62
+ breaks for existing users, and a sentence offering to narrow it or close
63
+ it if they would rather not. Never send that change silently, and never
64
+ sit on it. Two exceptions take the issue route instead: a policy that
65
+ says behavior changes need discussion first, and a runtime behavior
66
+ change on a stable major that the project's own compatibility promise
67
+ forbids. Even then the patch is pushed to a branch and linked from the
68
+ issue, so the work is attributable to whoever did it. Classify every
69
+ patch before writing a test for it. A finding whose only red evidence is a measurement, such
63
70
  as peak memory or elapsed time, is a hold: a pull request needs a test
64
71
  that fails on the default branch for a wrong value, a crash or an
65
72
  out-of-bounds access, and "less memory" is not that test.
File without changes