housebroken-cli 0.18.0__tar.gz → 0.20.0__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.
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/PKG-INFO +3 -3
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/README.md +2 -2
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/pyproject.toml +1 -1
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/branch-check.sh +8 -4
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/common.sh +40 -3
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/edit-pr.sh +2 -2
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/file-pr.sh +8 -4
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/proof.sh +28 -4
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/skills/housebroken/SKILL.md +15 -7
- housebroken_cli-0.20.0/src/housebroken/__init__.py +1 -0
- housebroken_cli-0.18.0/src/housebroken/__init__.py +0 -1
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/.gitignore +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/LICENSE +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/bin/housebroken +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/hatch_build.py +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/check-ai-policy.sh +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/ci-legs.sh +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/claim-check.sh +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/close.sh +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/comment-census.sh +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/comment-check.sh +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/declare.sh +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/diff-defaults.sh +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/distinct-outside.sh +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/file-issue.sh +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/fork-hygiene.sh +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/gate-hook.sh +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/inbox.sh +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/notes.sh +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/pr-sweep.sh +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/prior-art.sh +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/push.sh +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/ref-check.sh +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/refuse.sh +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/reply.sh +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/review.sh +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/scripts/verify-filed-pr.sh +0 -0
- {housebroken_cli-0.18.0 → housebroken_cli-0.20.0}/src/housebroken/cli.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: housebroken-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.20.0
|
|
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
|
|
@@ -61,7 +61,7 @@ A pull request passes through the door in order, and stops at the first rule it
|
|
|
61
61
|
A change that rejects an input the project tolerated, changes a default, or narrows what the project publishes is the maintainer's call. It is sent with the call stated in the body: what breaks for existing users, and an offer to narrow or close it. A finding whose only evidence is a measurement is a hold, not a pull request.
|
|
62
62
|
|
|
63
63
|
**4. Prove it red first, and prove the proof.**
|
|
64
|
-
On a fresh clone of the upstream default branch, the new test fails; with the patch, it passes. Every arm of the experiment prints evidence that its precondition held, files are swapped by content and checked by hash, and two arms that agree exactly have not tested the variable. `proof.sh` runs the experiment itself: the test on the head, then on the head with every changed non-test file swapped back to its content at the merge base, then the head restored and checked by hash, and it stamps the head only when the base arm fails and the head arm passes. A change with nothing to show red says so, with the reason, and the filing prints it.
|
|
64
|
+
On a fresh clone of the upstream default branch, the new test fails; with the patch, it passes. Every arm of the experiment prints evidence that its precondition held, files are swapped by content and checked by hash, and two arms that agree exactly have not tested the variable. `proof.sh` runs the experiment itself: the test on the head, then on the head with every changed non-test file swapped back to its content at the merge base, then the head restored and checked by hash, and it stamps the head only when the base arm fails and the head arm passes. Both arms run with `HTTP_PROXY`, `HTTPS_PROXY` and `ALL_PROXY` at local port 9 and `NO_PROXY` at loopback only, so a test whose client honors them fails instead of reaching the network, and an arm whose output carries a client's failure at that port is not stamped. A change with nothing to show red says so, with the reason, and the filing prints it.
|
|
65
65
|
|
|
66
66
|
**5. Run their CI, not yours.**
|
|
67
67
|
The project's own test target on the fresh clone, and every gate its pull request workflow runs: lint, format, mutation, API check. A gate not run is a red check the maintainer sees first.
|
|
@@ -78,7 +78,7 @@ A memory-safety, remote-abort, injection or path-escape finding goes by the proj
|
|
|
78
78
|
**9. File through the gate.**
|
|
79
79
|
`branch-check.sh` refuses a dirty working tree, a file whose mode disagrees with its siblings, a file the repository's own `.gitignore` excludes, a working artifact, a commit carrying a tool trailer, a session link or a tool identity, a sign-off naming a username, a branch not on top of its base (with `--rework <pull request URL>`, a rework behind its base passes when that open pull request's pushed head is in this one, its branch names match, GitHub says it merges cleanly, and the commits on top of its pushed head touch no file the base changed since the branch point), any comment added to code, a warning suppression that does not name what it hides or that no build log shows firing, reflection added to a .NET project that declares AOT or trim support without an AOT publish log of it, a credential or a path under your own home in any commit of the branch, not only the final diff, a lockfile, generated file or binary nobody named, an agent's working file, and a file rewritten for its line endings; it notes a base the upstream has moved past, a user path that may be a fixture and every absolute claim in added prose, and stamps the head it passed.
|
|
80
80
|
`review.sh` names the adversarial reviewer: a different model from the one that wrote the change, one tier down, never below Sonnet. Before it runs, the author writes a declaration (`declare.sh`): what the change was not tested against, and every assumption with what breaks if it is wrong and how it was checked. "Nothing" is refused as an answer. The review reads the declaration as one of its texts and attacks each line. The reviewer gets a fresh context, hard read-only limits, and before it reads the diff it writes its own fix from the bug alone, so it is not anchored on ours; the report names that fix as a diff and the gate refuses one that does not, a POST AS IS over an open BLOCKING or SHOULD FIX finding, and a POST AS IS over items the reviewer skipped. Its attack list starts with every claim the prose makes and includes the form of the code: the reviewer writes the changed block the way the strongest engineer in that language would, in the repository's own idioms, and a smaller or clearer version is a finding; every finding carries evidence it produced itself, and its report is bound to the head and the text it read. A fix is a new head and gets a new review.
|
|
81
|
-
`file-pr.sh` is the only way a pull request is opened. It refuses without a prior-art printout under a day old that searched every file the branch changes, a policy printout under a day old that reads neither BAN nor UNREAD, with a recorded reading and its call on disclosure if it reads DISCLOSE or MENTION, a body that discloses when the reading says a disclosure is owed, keeps the project's template and runs to at most 120 words of its own beside it (the answer to the template's AI question counted apart, at most 50), a branch stamp for the exact head whose base the upstream has not since changed under the branch's files, a proof stamp for that head, a declaration that passes, a POST AS IS review of that head, that body and that declaration, fewer than three open pull requests of yours on the repository, and ten minutes since the last filing there.
|
|
81
|
+
`file-pr.sh` is the only way a pull request is opened. It refuses without a prior-art printout under a day old that searched every file the branch changes, a policy printout under a day old that reads neither BAN nor UNREAD, with a recorded reading and its call on disclosure if it reads DISCLOSE or MENTION, a body that discloses when the reading says a disclosure is owed, keeps the project's template and every checkbox line of it, ticked or not (the boxes a template says to delete when they do not apply excepted), and runs to at most 120 words of its own beside it (the answer to the template's AI question counted apart, at most 50), a branch stamp for the exact head whose base the upstream has not since changed under the branch's files, a proof stamp for that head, a declaration that passes, a POST AS IS review of that head, that body and that declaration, fewer than three open pull requests of yours on the repository, and ten minutes since the last filing there.
|
|
82
82
|
`file-issue.sh` is the only way an issue is opened. It refuses without the same prior-art and policy printouts, refuses the same footers, trailers and dashes, keeps the same ten minutes, and refuses a body that offers or describes a fix without a link to that work, a branch or commit outside the repository, a comparison across forks or a filed pull request, so work that exists is attributable to whoever did it.
|
|
83
83
|
|
|
84
84
|
**10. Watch it land.**
|
|
@@ -49,7 +49,7 @@ A pull request passes through the door in order, and stops at the first rule it
|
|
|
49
49
|
A change that rejects an input the project tolerated, changes a default, or narrows what the project publishes is the maintainer's call. It is sent with the call stated in the body: what breaks for existing users, and an offer to narrow or close it. A finding whose only evidence is a measurement is a hold, not a pull request.
|
|
50
50
|
|
|
51
51
|
**4. Prove it red first, and prove the proof.**
|
|
52
|
-
On a fresh clone of the upstream default branch, the new test fails; with the patch, it passes. Every arm of the experiment prints evidence that its precondition held, files are swapped by content and checked by hash, and two arms that agree exactly have not tested the variable. `proof.sh` runs the experiment itself: the test on the head, then on the head with every changed non-test file swapped back to its content at the merge base, then the head restored and checked by hash, and it stamps the head only when the base arm fails and the head arm passes. A change with nothing to show red says so, with the reason, and the filing prints it.
|
|
52
|
+
On a fresh clone of the upstream default branch, the new test fails; with the patch, it passes. Every arm of the experiment prints evidence that its precondition held, files are swapped by content and checked by hash, and two arms that agree exactly have not tested the variable. `proof.sh` runs the experiment itself: the test on the head, then on the head with every changed non-test file swapped back to its content at the merge base, then the head restored and checked by hash, and it stamps the head only when the base arm fails and the head arm passes. Both arms run with `HTTP_PROXY`, `HTTPS_PROXY` and `ALL_PROXY` at local port 9 and `NO_PROXY` at loopback only, so a test whose client honors them fails instead of reaching the network, and an arm whose output carries a client's failure at that port is not stamped. A change with nothing to show red says so, with the reason, and the filing prints it.
|
|
53
53
|
|
|
54
54
|
**5. Run their CI, not yours.**
|
|
55
55
|
The project's own test target on the fresh clone, and every gate its pull request workflow runs: lint, format, mutation, API check. A gate not run is a red check the maintainer sees first.
|
|
@@ -66,7 +66,7 @@ A memory-safety, remote-abort, injection or path-escape finding goes by the proj
|
|
|
66
66
|
**9. File through the gate.**
|
|
67
67
|
`branch-check.sh` refuses a dirty working tree, a file whose mode disagrees with its siblings, a file the repository's own `.gitignore` excludes, a working artifact, a commit carrying a tool trailer, a session link or a tool identity, a sign-off naming a username, a branch not on top of its base (with `--rework <pull request URL>`, a rework behind its base passes when that open pull request's pushed head is in this one, its branch names match, GitHub says it merges cleanly, and the commits on top of its pushed head touch no file the base changed since the branch point), any comment added to code, a warning suppression that does not name what it hides or that no build log shows firing, reflection added to a .NET project that declares AOT or trim support without an AOT publish log of it, a credential or a path under your own home in any commit of the branch, not only the final diff, a lockfile, generated file or binary nobody named, an agent's working file, and a file rewritten for its line endings; it notes a base the upstream has moved past, a user path that may be a fixture and every absolute claim in added prose, and stamps the head it passed.
|
|
68
68
|
`review.sh` names the adversarial reviewer: a different model from the one that wrote the change, one tier down, never below Sonnet. Before it runs, the author writes a declaration (`declare.sh`): what the change was not tested against, and every assumption with what breaks if it is wrong and how it was checked. "Nothing" is refused as an answer. The review reads the declaration as one of its texts and attacks each line. The reviewer gets a fresh context, hard read-only limits, and before it reads the diff it writes its own fix from the bug alone, so it is not anchored on ours; the report names that fix as a diff and the gate refuses one that does not, a POST AS IS over an open BLOCKING or SHOULD FIX finding, and a POST AS IS over items the reviewer skipped. Its attack list starts with every claim the prose makes and includes the form of the code: the reviewer writes the changed block the way the strongest engineer in that language would, in the repository's own idioms, and a smaller or clearer version is a finding; every finding carries evidence it produced itself, and its report is bound to the head and the text it read. A fix is a new head and gets a new review.
|
|
69
|
-
`file-pr.sh` is the only way a pull request is opened. It refuses without a prior-art printout under a day old that searched every file the branch changes, a policy printout under a day old that reads neither BAN nor UNREAD, with a recorded reading and its call on disclosure if it reads DISCLOSE or MENTION, a body that discloses when the reading says a disclosure is owed, keeps the project's template and runs to at most 120 words of its own beside it (the answer to the template's AI question counted apart, at most 50), a branch stamp for the exact head whose base the upstream has not since changed under the branch's files, a proof stamp for that head, a declaration that passes, a POST AS IS review of that head, that body and that declaration, fewer than three open pull requests of yours on the repository, and ten minutes since the last filing there.
|
|
69
|
+
`file-pr.sh` is the only way a pull request is opened. It refuses without a prior-art printout under a day old that searched every file the branch changes, a policy printout under a day old that reads neither BAN nor UNREAD, with a recorded reading and its call on disclosure if it reads DISCLOSE or MENTION, a body that discloses when the reading says a disclosure is owed, keeps the project's template and every checkbox line of it, ticked or not (the boxes a template says to delete when they do not apply excepted), and runs to at most 120 words of its own beside it (the answer to the template's AI question counted apart, at most 50), a branch stamp for the exact head whose base the upstream has not since changed under the branch's files, a proof stamp for that head, a declaration that passes, a POST AS IS review of that head, that body and that declaration, fewer than three open pull requests of yours on the repository, and ten minutes since the last filing there.
|
|
70
70
|
`file-issue.sh` is the only way an issue is opened. It refuses without the same prior-art and policy printouts, refuses the same footers, trailers and dashes, keeps the same ten minutes, and refuses a body that offers or describes a fix without a link to that work, a branch or commit outside the repository, a comparison across forks or a filed pull request, so work that exists is attributable to whoever did it.
|
|
71
71
|
|
|
72
72
|
**10. Watch it land.**
|
|
@@ -116,10 +116,10 @@ fi
|
|
|
116
116
|
[ -n "$base" ] || { refused branch-check-no-base-resolved "no base ref resolved - pass --base REF" >&2; exit 2; }
|
|
117
117
|
git rev-parse --verify -q "$base" >/dev/null 2>&1 || { refused branch-check-base-unresolvable "base $base does not resolve" >&2; exit 2; }
|
|
118
118
|
# What the branch changed, read from where it left the base. Two unrelated
|
|
119
|
-
# histories have no merge base: that is refused below,
|
|
120
|
-
#
|
|
119
|
+
# histories have no merge base: that is refused below, before any scan reads
|
|
120
|
+
# an unrelated tree as the branch's change.
|
|
121
121
|
shared=1
|
|
122
|
-
mb=$(git merge-base "$base" HEAD 2>/dev/null) ||
|
|
122
|
+
mb=$(git merge-base "$base" HEAD 2>/dev/null) || shared=0
|
|
123
123
|
|
|
124
124
|
blocked=0
|
|
125
125
|
block() { refused "$1" "$2"; blocked=1; }
|
|
@@ -158,11 +158,15 @@ esac
|
|
|
158
158
|
# since the branch point.
|
|
159
159
|
if [ "$shared" -eq 0 ]; then
|
|
160
160
|
block branch-check-no-shared-history "HEAD shares no history with $base, so it was not branched from it"
|
|
161
|
+
echo
|
|
162
|
+
echo "branch-check: refused. Fix the causes above; a refusal is a result."
|
|
163
|
+
exit 1
|
|
161
164
|
elif ! git merge-base --is-ancestor "$base" HEAD 2>/dev/null; then
|
|
162
165
|
if [ -z "$rework" ]; then
|
|
163
166
|
block branch-check-not-on-base "HEAD is not on top of $base - rebase before filing"
|
|
164
167
|
elif ! fields=$(gh pr view "$rework" --json state,mergeable,headRefName,baseRefName,headRefOid 2>/dev/null \
|
|
165
|
-
| jq -r '[.state, .mergeable, .headRefName, .baseRefName, .headRefOid]
|
|
168
|
+
| jq -r '[.state, .mergeable, .headRefName, .baseRefName, .headRefOid]
|
|
169
|
+
| select(all(.[]; type == "string" and . != "")) | @tsv' 2>/dev/null | tr -d '\r') || [ -z "$fields" ]; then
|
|
166
170
|
block branch-check-rework-pr-unreadable "cannot read $rework, so whether it merges cleanly is unknown"
|
|
167
171
|
else
|
|
168
172
|
IFS=$'\t' read -r pr_state pr_merge pr_head pr_base pr_oid <<< "$fields"
|
|
@@ -141,10 +141,11 @@ check_text() {
|
|
|
141
141
|
# as its unticked line, are left out before the words are counted. The
|
|
142
142
|
# answer written after or under a template line that asks about AI is the
|
|
143
143
|
# project's requirement, not ours: it is counted on its own and held to 50
|
|
144
|
-
# words. A body that keeps none of the template has dropped it
|
|
145
|
-
#
|
|
144
|
+
# words. A body that keeps none of the template has dropped it, and a body
|
|
145
|
+
# that drops one of its checkbox lines has dropped a question (dropped_boxes).
|
|
146
|
+
# Sets template, for the disclosure check that follows.
|
|
146
147
|
prose_gate() { # repo body-file home
|
|
147
|
-
local repo="$1" bodyfile="$2" words ai_words kept wanted
|
|
148
|
+
local repo="$1" bodyfile="$2" words ai_words kept wanted missing
|
|
148
149
|
template="$3/policy/template-${repo%%/*}-${repo##*/}.md"
|
|
149
150
|
[ -f "$template" ] || template=/dev/null
|
|
150
151
|
read -r words ai_words kept wanted < <(awk -v T="$template" '
|
|
@@ -170,10 +171,16 @@ prose_gate() { # repo body-file home
|
|
|
170
171
|
if (section_ai) { ai += split(l, w); next }
|
|
171
172
|
ours += split(l, w) }
|
|
172
173
|
END { print ours + 0, ai + 0, kept + 0, wanted + 0 }' "$bodyfile")
|
|
174
|
+
missing=$(dropped_boxes "$template" "$bodyfile")
|
|
173
175
|
if [ "$wanted" -gt 0 ] && [ "$kept" -eq 0 ]; then
|
|
174
176
|
refused common-template-dropped "the body keeps none of $repo's pull request template ($template) - fill it in rather than replacing it" >&2
|
|
175
177
|
exit 2
|
|
176
178
|
fi
|
|
179
|
+
if [ -n "$missing" ]; then
|
|
180
|
+
refused common-template-checkbox-missing "the body drops checkbox lines of $repo's pull request template ($template) - keep each one, ticked or not:" >&2
|
|
181
|
+
printf '%s\n' "$missing" | sed 's/^/ /' >&2
|
|
182
|
+
exit 2
|
|
183
|
+
fi
|
|
177
184
|
if [ "$words" -gt 120 ]; then
|
|
178
185
|
refused common-body-too-long "the body is $words words outside the project's template - say what was wrong, what the change does and how it was verified in 120 or fewer" >&2
|
|
179
186
|
exit 2
|
|
@@ -184,6 +191,36 @@ prose_gate() { # repo body-file home
|
|
|
184
191
|
fi
|
|
185
192
|
}
|
|
186
193
|
|
|
194
|
+
# Prints each checkbox line of the template the body does not keep, once per
|
|
195
|
+
# copy the template carries. HTML comments are cut out of both before reading,
|
|
196
|
+
# so a box with a comment on its line is still a box and a box kept only inside
|
|
197
|
+
# a comment is not kept. A box is kept ticked or not, alone or with its answer
|
|
198
|
+
# after a space. Boxes the template says to delete when they do not apply
|
|
199
|
+
# (after such a line, up to the next heading) are not required.
|
|
200
|
+
dropped_boxes() { # template-file body-file
|
|
201
|
+
awk -v T="$1" '
|
|
202
|
+
function norm(s) { gsub(/\[[xX]\]/, "[ ]", s); gsub(/^[[:space:]]+|[[:space:]]+$/, "", s); return s }
|
|
203
|
+
function uncomment(s, out, i) {
|
|
204
|
+
out = ""
|
|
205
|
+
while (s != "") {
|
|
206
|
+
if (cs) { i = index(s, "-->"); if (!i) return out; s = substr(s, i + 3); cs = 0 }
|
|
207
|
+
else { i = index(s, "<!--"); if (!i) return out s; out = out substr(s, 1, i - 1); s = substr(s, i + 4); cs = 1 }
|
|
208
|
+
}
|
|
209
|
+
return out
|
|
210
|
+
}
|
|
211
|
+
BEGIN { while ((getline l < T) > 0) {
|
|
212
|
+
if (l ~ /^[[:space:]]*#/) optional = 0
|
|
213
|
+
if (tolower(l) ~ /(delete|remove)[^.]*(relevant|applicable|apply)/) optional = 1
|
|
214
|
+
b = norm(uncomment(l))
|
|
215
|
+
if (!optional && b ~ /^([-*+]|[0-9]+[.)])[[:space:]]+\[ \]/) { need[b]++; order[++boxes] = b }
|
|
216
|
+
}
|
|
217
|
+
cs = 0 }
|
|
218
|
+
{ l = norm(uncomment($0)); best = ""
|
|
219
|
+
for (k in need) if ((l == k || index(l, k " ") == 1) && length(k) > length(best)) best = k
|
|
220
|
+
if (best != "") have[best]++ }
|
|
221
|
+
END { for (i = 1; i <= boxes; i++) { k = order[i]; if (have[k] > 0) have[k]--; else print k } }' "$2"
|
|
222
|
+
}
|
|
223
|
+
|
|
187
224
|
# Whether a body says AI was used, in its own words: a ticked box naming it, or
|
|
188
225
|
# a line that is not the project's template. An unanswered template question
|
|
189
226
|
# says nothing, and "Home Assistant" names no tool.
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
# check reads it. This is that gate. The new text passes what a filing
|
|
8
8
|
# passes: the policy printout is read and is not BAN or UNREAD, the prose
|
|
9
9
|
# carries no footer, trailer or typographic dash, the project's template is
|
|
10
|
-
# kept and the body holds to 120 words of its
|
|
11
|
-
# in it, and every reference it names exists. The pull request is open and
|
|
10
|
+
# kept with each of its checkbox lines and the body holds to 120 words of its
|
|
11
|
+
# own, the policy's disclosure is in it, and every reference it names exists. The pull request is open and
|
|
12
12
|
# yours, edits to one repository are ten minutes apart, and the copy
|
|
13
13
|
# verify-filed-pr.sh compares GitHub's body against is replaced, with the
|
|
14
14
|
# text it replaced kept beside it.
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
# this exact head and this exact body file and said POST AS IS. An inline
|
|
16
16
|
# --body is refused, because a review cannot be bound to text that was never a
|
|
17
17
|
# file. Around them: every file the branch changes was searched for prior art,
|
|
18
|
-
# a body keeps the project's template and
|
|
19
|
-
# reference exists, the base has not moved
|
|
20
|
-
# and a declaration exist for the head,
|
|
21
|
-
# ten minutes since the last filing.
|
|
18
|
+
# a body keeps the project's template and each of its checkbox lines and holds
|
|
19
|
+
# to 120 words of its own, every reference exists, the base has not moved
|
|
20
|
+
# under the branch's files, a proof and a declaration exist for the head,
|
|
21
|
+
# three open pull requests at most, and ten minutes since the last filing.
|
|
22
22
|
#
|
|
23
23
|
# Usage:
|
|
24
24
|
# bash file-pr.sh owner/repo <gh pr create args...>
|
|
@@ -59,6 +59,10 @@ gates:
|
|
|
59
59
|
en dash, in any case, in the --body-file or the --title; a
|
|
60
60
|
body of at most 120 words of its own, the answer to the
|
|
61
61
|
template's AI question counted apart and held to 50
|
|
62
|
+
template when the project ships a pull request template, the body
|
|
63
|
+
keeps some of it and every checkbox line of it, ticked or
|
|
64
|
+
not, except boxes the template says to delete when they do
|
|
65
|
+
not apply
|
|
62
66
|
branch $HOUSEBROKEN_HOME/branch-checks/<head> must exist, written by
|
|
63
67
|
branch-check.sh when this head passed, against the branch this
|
|
64
68
|
files into (--base, or the repository's default branch)
|
|
@@ -16,6 +16,19 @@
|
|
|
16
16
|
# can tell that from the bug. A run that does not show the fix removes any stamp
|
|
17
17
|
# an earlier run left for this head.
|
|
18
18
|
#
|
|
19
|
+
# Both arms run with HTTP_PROXY, HTTPS_PROXY and ALL_PROXY (and their lower
|
|
20
|
+
# case) at local port 9, where nothing normally listens, and NO_PROXY set to
|
|
21
|
+
# loopback only, so a test's own local server is still reached: the red arm
|
|
22
|
+
# of the test filed on teslamotors/vehicle-command #479 sent a real POST to
|
|
23
|
+
# the vendor's production API. A client that honors them fails instead of
|
|
24
|
+
# sending, and an arm whose output carries a client's failure at that port
|
|
25
|
+
# (Go and curl naming 127.0.0.1:9, requests' "Unable to connect to proxy",
|
|
26
|
+
# curl's "over proxy 127.0.0.1" or "via 127.0.0.1") is not stamped; a line naming a proxy variable is not read as
|
|
27
|
+
# one. A client that ignores the variables (Java, Node's fetch, a raw socket)
|
|
28
|
+
# is not held; one that fails without naming the proxy (urllib, httpx,
|
|
29
|
+
# reqwest) is held but not reported, and a base arm red only for that is
|
|
30
|
+
# still stamped. Fetch dependencies before the run.
|
|
31
|
+
#
|
|
19
32
|
# A change with nothing to prove red, a documentation fix or a refactor
|
|
20
33
|
# whose behaviour the existing suite already pins, says so with --none and a
|
|
21
34
|
# reason; the stamp records the reason and the filing prints it.
|
|
@@ -135,8 +148,15 @@ echo "proof: taking away ${#fixes[@]} file(s): ${fixes[*]}${kept[0]:+; keeping $
|
|
|
135
148
|
|
|
136
149
|
hash_of() { if [ -f "$1" ]; then git hash-object -- "$1"; else echo absent; fi; }
|
|
137
150
|
hashes() { local f; for f in "${fixes[@]}"; do printf '%s %s\n' "$(hash_of "$f")" "$f"; done; }
|
|
138
|
-
|
|
139
|
-
|
|
151
|
+
blackhole=http://127.0.0.1:9
|
|
152
|
+
loopback=localhost,127.0.0.1,::1
|
|
153
|
+
run_arm() { # label -> rc in arm_rc, output tail in arm_out, a line showing a reach for the network in arm_net
|
|
154
|
+
arm_out=$(HTTP_PROXY=$blackhole HTTPS_PROXY=$blackhole ALL_PROXY=$blackhole \
|
|
155
|
+
http_proxy=$blackhole https_proxy=$blackhole all_proxy=$blackhole \
|
|
156
|
+
NO_PROXY=$loopback no_proxy=$loopback \
|
|
157
|
+
bash -c "$cmd" 2>&1); arm_rc=$?
|
|
158
|
+
arm_net=$(printf '%s\n' "$arm_out" | grep -v -E '_PROXY|_proxy' |
|
|
159
|
+
grep -m1 -E '127\.0\.0\.1(:| port )9([^0-9]|$)|Unable to connect to proxy|(over proxy|via) 127\.0\.0\.1( |$)' | cut -c1-200)
|
|
140
160
|
arm_out=$(printf '%s\n' "$arm_out" | tail -15)
|
|
141
161
|
echo "== $1 arm: exit $arm_rc"
|
|
142
162
|
printf '%s\n' "$arm_out" | sed 's/^/ /'
|
|
@@ -144,7 +164,7 @@ run_arm() { # label -> rc in arm_rc, output tail in arm_out
|
|
|
144
164
|
|
|
145
165
|
head_hashes=$(hashes)
|
|
146
166
|
run_arm head
|
|
147
|
-
head_rc=$arm_rc; head_out=$arm_out
|
|
167
|
+
head_rc=$arm_rc; head_out=$arm_out; head_net=$arm_net
|
|
148
168
|
|
|
149
169
|
# The base arm: each fix file by its content at the merge base, through the
|
|
150
170
|
# clone's own filters so line endings are what a checkout gives, or gone
|
|
@@ -176,7 +196,7 @@ for f in "${fixes[@]}"; do
|
|
|
176
196
|
done
|
|
177
197
|
base_hashes=$(hashes)
|
|
178
198
|
run_arm base
|
|
179
|
-
base_rc=$arm_rc; base_out=$arm_out
|
|
199
|
+
base_rc=$arm_rc; base_out=$arm_out; base_net=$arm_net
|
|
180
200
|
restore
|
|
181
201
|
trap - EXIT
|
|
182
202
|
|
|
@@ -201,6 +221,10 @@ case "$base_rc" in
|
|
|
201
221
|
0) failed="${failed:+$failed; }the test passes without the fix, so it does not show the bug${kept[0]:+ (or the fix is in a kept file: ${kept[*]})}" ;;
|
|
202
222
|
esac
|
|
203
223
|
[ "$head_rc" -eq 0 ] || failed="${failed:+$failed; }the test fails with the fix"
|
|
224
|
+
for arm in base head; do
|
|
225
|
+
if [ "$arm" = base ]; then net=$base_net; else net=$head_net; fi
|
|
226
|
+
[ -z "$net" ] || failed="${failed:+$failed; }the $arm arm reached for the network through the blocked proxy ($net); stub the client the way the neighbouring tests do, and fetch dependencies before the run"
|
|
227
|
+
done
|
|
204
228
|
if [ -n "$failed" ]; then
|
|
205
229
|
echo "proof: not shown - $failed"
|
|
206
230
|
exit 1
|
|
@@ -107,10 +107,13 @@ report it in one line and do not proceed to the next step.
|
|
|
107
107
|
the bug in, write the test that fails. Run it and keep the failing output.
|
|
108
108
|
Apply the patch. Run it again. Both results go into the pull request as
|
|
109
109
|
the test itself; the body states the fact in one sentence.
|
|
110
|
-
Run
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
110
|
+
Run both arms with egress blocked. `housebroken proof` sets `HTTP_PROXY`,
|
|
111
|
+
`HTTPS_PROXY` and `ALL_PROXY` to local port 9 and `NO_PROXY` to loopback
|
|
112
|
+
only, and a test whose output then carries a client's failure at that
|
|
113
|
+
port is not stamped. A client that ignores those variables (Java, Node's
|
|
114
|
+
fetch, a raw socket, a proxy set in git or Cargo config) is not held by
|
|
115
|
+
that, so block it the language's way. A test that reaches the network is rewritten to stub the
|
|
116
|
+
client the way its neighbours do; fetch dependencies before the run.
|
|
114
117
|
Ask what each step would print if it did nothing, and make that answer
|
|
115
118
|
different from success: revert by content and compare hashes rather than
|
|
116
119
|
trusting a command's exit code, check the clone's line endings before the
|
|
@@ -187,7 +190,9 @@ report it in one line and do not proceed to the next step.
|
|
|
187
190
|
root>` lists default arguments and one-line wrappers added to keep call
|
|
188
191
|
sites untouched; a maintainer asks why they are there, so have the answer.
|
|
189
192
|
The body is at most 120 words,
|
|
190
|
-
in the project's template if it has one
|
|
193
|
+
in the project's template if it has one, every checkbox line of it kept,
|
|
194
|
+
ticked or not, unless the template says to delete the ones that do not
|
|
195
|
+
apply (the answer to the template's
|
|
191
196
|
own AI question is counted apart, at most 50 words), and says what was wrong, what the
|
|
192
197
|
change does, and how it was verified; every sentence in it is something
|
|
193
198
|
you reproduced on the fresh clone in this session, never a line carried
|
|
@@ -285,7 +290,8 @@ report it in one line and do not proceed to the next step.
|
|
|
285
290
|
call on disclosure, when the
|
|
286
291
|
reading says a disclosure is owed and the body does not disclose in its own words (an unticked
|
|
287
292
|
template box says nothing), when the body carries a footer, a trailer or a
|
|
288
|
-
dash character, keeps none of the project's template,
|
|
293
|
+
dash character, keeps none of the project's template, drops one of its
|
|
294
|
+
checkbox lines (ticked or not, each stays), runs past
|
|
289
295
|
120 words of its own beside it, or names an issue,
|
|
290
296
|
link, test, file or commit that does not exist, when `housebroken branch`
|
|
291
297
|
has not stamped the exact head against the branch it is filed into
|
|
@@ -347,7 +353,9 @@ report it in one line and do not proceed to the next step.
|
|
|
347
353
|
contributor or a first-timer is anyone who can type, and the inbox says
|
|
348
354
|
so. Answer every maintainer comment the same day,
|
|
349
355
|
in the user's voice, and run `housebroken claims` over the reply before
|
|
350
|
-
it is posted. A
|
|
356
|
+
it is posted. A reproduction a maintainer asks for is the shipped command
|
|
357
|
+
line or an exported function of a public package, run on a fresh clone,
|
|
358
|
+
with its real output pasted; a call into an internal package is not one. A voice with no role is read, never answered on your own:
|
|
351
359
|
report what they said and answer only when the user says to, with
|
|
352
360
|
`--outsider`, at most once, on the facts. A reply that concedes a point, disagrees, or rides on
|
|
353
361
|
a code change goes through the adversarial review of step 9 first, with
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.20.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.18.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|