fail-to-pass 0.1.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.
- fail_to_pass-0.1.0/.github/dependabot.yml +10 -0
- fail_to_pass-0.1.0/.github/workflows/ci.yml +33 -0
- fail_to_pass-0.1.0/.github/workflows/public-text.yml +11 -0
- fail_to_pass-0.1.0/.github/workflows/release.yml +51 -0
- fail_to_pass-0.1.0/.github/workflows/security.yml +32 -0
- fail_to_pass-0.1.0/CHANGELOG.md +8 -0
- fail_to_pass-0.1.0/CONTRIBUTING.md +19 -0
- fail_to_pass-0.1.0/LICENSE +202 -0
- fail_to_pass-0.1.0/MANIFEST.in +4 -0
- fail_to_pass-0.1.0/PKG-INFO +88 -0
- fail_to_pass-0.1.0/README.md +78 -0
- fail_to_pass-0.1.0/SECURITY.md +17 -0
- fail_to_pass-0.1.0/action.yml +31 -0
- fail_to_pass-0.1.0/docs/architecture.md +25 -0
- fail_to_pass-0.1.0/docs/usage.md +83 -0
- fail_to_pass-0.1.0/pyproject.toml +18 -0
- fail_to_pass-0.1.0/requirements-ci.in +5 -0
- fail_to_pass-0.1.0/requirements-ci.txt +24 -0
- fail_to_pass-0.1.0/setup.cfg +4 -0
- fail_to_pass-0.1.0/src/fail_to_pass/__init__.py +7 -0
- fail_to_pass-0.1.0/src/fail_to_pass/__main__.py +110 -0
- fail_to_pass-0.1.0/src/fail_to_pass/adapters.py +135 -0
- fail_to_pass-0.1.0/src/fail_to_pass/check.py +30 -0
- fail_to_pass-0.1.0/src/fail_to_pass/core.py +94 -0
- fail_to_pass-0.1.0/src/fail_to_pass/git_tree.py +80 -0
- fail_to_pass-0.1.0/src/fail_to_pass/model.py +72 -0
- fail_to_pass-0.1.0/src/fail_to_pass/prepared.py +40 -0
- fail_to_pass-0.1.0/src/fail_to_pass.egg-info/PKG-INFO +88 -0
- fail_to_pass-0.1.0/src/fail_to_pass.egg-info/SOURCES.txt +37 -0
- fail_to_pass-0.1.0/src/fail_to_pass.egg-info/dependency_links.txt +1 -0
- fail_to_pass-0.1.0/src/fail_to_pass.egg-info/entry_points.txt +2 -0
- fail_to_pass-0.1.0/src/fail_to_pass.egg-info/top_level.txt +1 -0
- fail_to_pass-0.1.0/tests/fixtures/go.jsonl +8 -0
- fail_to_pass-0.1.0/tests/fixtures/recorded-go.jsonl +7 -0
- fail_to_pass-0.1.0/tests/fixtures/recorded-vitest.json +23 -0
- fail_to_pass-0.1.0/tests/fixtures/vitest.json +24 -0
- fail_to_pass-0.1.0/tests/test_check.py +199 -0
- fail_to_pass-0.1.0/tests/test_core.py +354 -0
- fail_to_pass-0.1.0/tests/test_policy.py +23 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [main]
|
|
5
|
+
pull_request:
|
|
6
|
+
permissions: {}
|
|
7
|
+
jobs:
|
|
8
|
+
test:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python: ['3.11', '3.12', '3.13', '3.14']
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
|
|
17
|
+
with:
|
|
18
|
+
persist-credentials: false
|
|
19
|
+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
|
|
20
|
+
with:
|
|
21
|
+
python-version: ${{ matrix.python }}
|
|
22
|
+
- name: Install live reporter fixture
|
|
23
|
+
run: npm install --prefix "$RUNNER_TEMP/reporter" --ignore-scripts --no-audit --no-fund vitest@4.1.10
|
|
24
|
+
- run: python -m pip install --require-hashes -r requirements-ci.txt
|
|
25
|
+
- run: PYTHONPATH=src python -m unittest discover -s tests -v
|
|
26
|
+
env:
|
|
27
|
+
FAIL_TO_PASS_VITEST_MODULE: ${{ runner.temp }}/reporter/node_modules/vitest/dist/index.js
|
|
28
|
+
GOPROXY: 'off'
|
|
29
|
+
GOSUMDB: 'off'
|
|
30
|
+
GOTOOLCHAIN: local
|
|
31
|
+
- run: python -m build --no-isolation
|
|
32
|
+
- run: python -m pip install --no-deps dist/*.whl
|
|
33
|
+
- run: cd "$RUNNER_TEMP" && fail-to-pass --help && fail-to-pass measure --help
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
name: Public text and DCO
|
|
2
|
+
on:
|
|
3
|
+
pull_request:
|
|
4
|
+
types: [opened, synchronize, reopened, edited]
|
|
5
|
+
permissions:
|
|
6
|
+
contents: read
|
|
7
|
+
jobs:
|
|
8
|
+
public-text:
|
|
9
|
+
uses: citrustudio/.github/.github/workflows/public-text.yml@5369d44a131cce817c94a8e7f2bb80d705cf3559
|
|
10
|
+
secrets:
|
|
11
|
+
PUBLIC_TEXT_DENY: ${{ secrets.PUBLIC_TEXT_DENY }}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
tags: ['v*']
|
|
5
|
+
permissions: {}
|
|
6
|
+
jobs:
|
|
7
|
+
build:
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
|
|
13
|
+
with:
|
|
14
|
+
persist-credentials: false
|
|
15
|
+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
|
|
16
|
+
with:
|
|
17
|
+
python-version: '3.13'
|
|
18
|
+
- name: Require the release tag to match package metadata
|
|
19
|
+
run: |
|
|
20
|
+
python - <<'PY'
|
|
21
|
+
import os, tomllib
|
|
22
|
+
with open('pyproject.toml', 'rb') as f:
|
|
23
|
+
version = tomllib.load(f)['project']['version']
|
|
24
|
+
if os.environ['GITHUB_REF_NAME'] != 'v' + version:
|
|
25
|
+
raise SystemExit('release tag does not match package version')
|
|
26
|
+
PY
|
|
27
|
+
- run: python -m pip install --require-hashes -r requirements-ci.txt
|
|
28
|
+
- run: PYTHONPATH=src python -m unittest discover -s tests -v
|
|
29
|
+
env:
|
|
30
|
+
GOPROXY: 'off'
|
|
31
|
+
GOSUMDB: 'off'
|
|
32
|
+
GOTOOLCHAIN: local
|
|
33
|
+
- run: python -m build --no-isolation
|
|
34
|
+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
|
|
35
|
+
with:
|
|
36
|
+
name: distributions
|
|
37
|
+
path: dist/*
|
|
38
|
+
publish:
|
|
39
|
+
needs: build
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
environment: release
|
|
42
|
+
permissions:
|
|
43
|
+
id-token: write
|
|
44
|
+
steps:
|
|
45
|
+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
|
|
46
|
+
with:
|
|
47
|
+
name: distributions
|
|
48
|
+
path: dist
|
|
49
|
+
- uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086
|
|
50
|
+
with:
|
|
51
|
+
attestations: true
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Security
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [main]
|
|
5
|
+
pull_request:
|
|
6
|
+
schedule:
|
|
7
|
+
- cron: '17 4 * * 1'
|
|
8
|
+
permissions: {}
|
|
9
|
+
jobs:
|
|
10
|
+
dependency-review:
|
|
11
|
+
if: github.event_name == 'pull_request'
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
|
|
17
|
+
with:
|
|
18
|
+
persist-credentials: false
|
|
19
|
+
- uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48
|
|
20
|
+
codeql:
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
permissions:
|
|
23
|
+
contents: read
|
|
24
|
+
security-events: write
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
|
|
27
|
+
with:
|
|
28
|
+
persist-credentials: false
|
|
29
|
+
- uses: github/codeql-action/init@9418214df1f2c4b8128c770156c409013b07d6b9
|
|
30
|
+
with:
|
|
31
|
+
languages: python
|
|
32
|
+
- uses: github/codeql-action/analyze@9418214df1f2c4b8128c770156c409013b07d6b9
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
- Per-test outcome classes for Go and Vitest structured reporters with bounded confirmations.
|
|
6
|
+
- Committed Git snapshots, explicit executable-test globs, configuration and JSON evidence.
|
|
7
|
+
- Explicit p2p guard policy and external guard execution for test-source subjects.
|
|
8
|
+
- Prepared-tree library and CLI, composite Action, build CI and trusted-publishing workflow.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Use Python 3.11+ and Git on a POSIX host. The runtime uses only the standard library.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
PYTHONPATH=src python -m unittest discover -s tests -v
|
|
7
|
+
python -m pip install --require-hashes -r requirements-ci.txt
|
|
8
|
+
python -m build --no-isolation
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Go integration tests run when Go is on PATH, without module downloads. Live Vitest coverage runs
|
|
12
|
+
when `FAIL_TO_PASS_VITEST_MODULE` points to a local `vitest/dist/index.js`; otherwise that optional
|
|
13
|
+
probe skips. Recorded neutral reports and malformed-report controls always run.
|
|
14
|
+
Add a negative control for changes to evidence or policy. A malformed report, missing test,
|
|
15
|
+
compile-only red, or test that always passes must not become assertion-level regression evidence.
|
|
16
|
+
Keep execution and classification separate. New adapters need reporter fixtures, contradictory
|
|
17
|
+
exit controls, identity tests and live reporter coverage. Do not include secrets or personal paths
|
|
18
|
+
in reports or fixtures. Describe the problem, changed behavior and focused test result in a pull
|
|
19
|
+
request. Release setup and first publication are maintainer operations.
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fail-to-pass
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Per-test transition classification with bounded rerun confirmation
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
Requires-Python: >=3.11
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Dynamic: license-file
|
|
10
|
+
|
|
11
|
+
# fail-to-pass
|
|
12
|
+
|
|
13
|
+
Does a test detect the fix it accompanies? Run the head's executable tests against committed
|
|
14
|
+
base and head snapshots, then classify each test from repeated structured results.
|
|
15
|
+
Python 3.11+, Git and POSIX process groups are required. No runtime Python dependencies.
|
|
16
|
+
Go test JSON and Vitest JSON are supported. This tool runs code; use an isolated runner for
|
|
17
|
+
untrusted changes. It provides evidence, not a security sandbox.
|
|
18
|
+
|
|
19
|
+
## Quick start
|
|
20
|
+
|
|
21
|
+
From a source checkout:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
python -m pip install .
|
|
25
|
+
fail-to-pass --base main --runner go-json --test-glob '*_test.go' -- \
|
|
26
|
+
go test -json -count=1 ./...
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The base is the merge base of the requested comparison ref and committed head. Dirty and
|
|
30
|
+
untracked files are ignored and left untouched. Only files matching `--test-glob` receive head
|
|
31
|
+
content on the base side. Use narrow globs for the tests you intend to execute. The command runs
|
|
32
|
+
in each exported snapshot; dependencies must already be available through the toolchain or an
|
|
33
|
+
explicit setup wrapper. Snapshots contain tracked regular files, without `.git` or installed packages.
|
|
34
|
+
Links and submodules are rejected.
|
|
35
|
+
|
|
36
|
+
Exit 0 means every selected test has confirmed assertion-level `fail-to-pass` evidence and head
|
|
37
|
+
reports no failures or parser errors. Exit 1 means evidence did not satisfy policy; exit 2 means
|
|
38
|
+
configuration or preparation failed. With no selection file, all reported head tests are selected.
|
|
39
|
+
Use a focused command, or `--selection` to name the tests required to prove this change.
|
|
40
|
+
|
|
41
|
+
## Guards and test-source subjects
|
|
42
|
+
|
|
43
|
+
A new guard can correctly pass on the base. Declare `--allow-pass-to-pass` for such a change;
|
|
44
|
+
output still says `p2p`, so this does not claim regression detection. Keep the default policy for
|
|
45
|
+
regression fixes: a test that always passes must be rejected.
|
|
46
|
+
|
|
47
|
+
A guard may inspect other test files. Overlay only the executable guard, and optionally declare
|
|
48
|
+
`--subject-glob` patterns to reject accidental runner/subject overlap. For a guard inspecting its
|
|
49
|
+
own tracked source, execute a head copy outside the measured trees:
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
fail-to-pass --base main --runner vitest-json --test-glob 'checks/guard.py' \
|
|
53
|
+
--subject-glob 'checks/*.py' --external-tests -- python '{tests}'
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Here `guard.py` is a wrapper emitting Vitest-shaped JSON on stdout, with the matching exit status.
|
|
57
|
+
`{tests}` must be a separate argument. It expands into relative runner paths in overlay mode,
|
|
58
|
+
or absolute external copies in external mode. The command's working directory remains the
|
|
59
|
+
measured snapshot, so the external guard must read subjects relative to that directory.
|
|
60
|
+
|
|
61
|
+
See [usage](docs/usage.md), [architecture](docs/architecture.md),
|
|
62
|
+
[contributing](CONTRIBUTING.md), [security](SECURITY.md) and [changes](CHANGELOG.md).
|
|
63
|
+
Licensed under [Apache-2.0](LICENSE).
|
|
64
|
+
|
|
65
|
+
## GitHub Action
|
|
66
|
+
|
|
67
|
+
The repository root is a composite Action, usable by release tag (or preferably an immutable
|
|
68
|
+
commit). Replace `YOUR_ORG` with the publishing organization after release:
|
|
69
|
+
|
|
70
|
+
```yaml
|
|
71
|
+
permissions:
|
|
72
|
+
contents: read
|
|
73
|
+
steps:
|
|
74
|
+
- uses: actions/checkout@v4
|
|
75
|
+
with:
|
|
76
|
+
fetch-depth: 0
|
|
77
|
+
persist-credentials: false
|
|
78
|
+
- uses: actions/setup-python@v5
|
|
79
|
+
with:
|
|
80
|
+
python-version: '3.13'
|
|
81
|
+
- uses: YOUR_ORG/fail-to-pass@v0.1.0
|
|
82
|
+
with:
|
|
83
|
+
base: origin/main
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Set up the project's Go/Node dependencies first. Store command and test globs in
|
|
87
|
+
`.fail-to-pass.toml`. Use isolated pull-request jobs without secrets; never execute a contributor's
|
|
88
|
+
code from a privileged `pull_request_target` workflow.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# fail-to-pass
|
|
2
|
+
|
|
3
|
+
Does a test detect the fix it accompanies? Run the head's executable tests against committed
|
|
4
|
+
base and head snapshots, then classify each test from repeated structured results.
|
|
5
|
+
Python 3.11+, Git and POSIX process groups are required. No runtime Python dependencies.
|
|
6
|
+
Go test JSON and Vitest JSON are supported. This tool runs code; use an isolated runner for
|
|
7
|
+
untrusted changes. It provides evidence, not a security sandbox.
|
|
8
|
+
|
|
9
|
+
## Quick start
|
|
10
|
+
|
|
11
|
+
From a source checkout:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
python -m pip install .
|
|
15
|
+
fail-to-pass --base main --runner go-json --test-glob '*_test.go' -- \
|
|
16
|
+
go test -json -count=1 ./...
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The base is the merge base of the requested comparison ref and committed head. Dirty and
|
|
20
|
+
untracked files are ignored and left untouched. Only files matching `--test-glob` receive head
|
|
21
|
+
content on the base side. Use narrow globs for the tests you intend to execute. The command runs
|
|
22
|
+
in each exported snapshot; dependencies must already be available through the toolchain or an
|
|
23
|
+
explicit setup wrapper. Snapshots contain tracked regular files, without `.git` or installed packages.
|
|
24
|
+
Links and submodules are rejected.
|
|
25
|
+
|
|
26
|
+
Exit 0 means every selected test has confirmed assertion-level `fail-to-pass` evidence and head
|
|
27
|
+
reports no failures or parser errors. Exit 1 means evidence did not satisfy policy; exit 2 means
|
|
28
|
+
configuration or preparation failed. With no selection file, all reported head tests are selected.
|
|
29
|
+
Use a focused command, or `--selection` to name the tests required to prove this change.
|
|
30
|
+
|
|
31
|
+
## Guards and test-source subjects
|
|
32
|
+
|
|
33
|
+
A new guard can correctly pass on the base. Declare `--allow-pass-to-pass` for such a change;
|
|
34
|
+
output still says `p2p`, so this does not claim regression detection. Keep the default policy for
|
|
35
|
+
regression fixes: a test that always passes must be rejected.
|
|
36
|
+
|
|
37
|
+
A guard may inspect other test files. Overlay only the executable guard, and optionally declare
|
|
38
|
+
`--subject-glob` patterns to reject accidental runner/subject overlap. For a guard inspecting its
|
|
39
|
+
own tracked source, execute a head copy outside the measured trees:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
fail-to-pass --base main --runner vitest-json --test-glob 'checks/guard.py' \
|
|
43
|
+
--subject-glob 'checks/*.py' --external-tests -- python '{tests}'
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Here `guard.py` is a wrapper emitting Vitest-shaped JSON on stdout, with the matching exit status.
|
|
47
|
+
`{tests}` must be a separate argument. It expands into relative runner paths in overlay mode,
|
|
48
|
+
or absolute external copies in external mode. The command's working directory remains the
|
|
49
|
+
measured snapshot, so the external guard must read subjects relative to that directory.
|
|
50
|
+
|
|
51
|
+
See [usage](docs/usage.md), [architecture](docs/architecture.md),
|
|
52
|
+
[contributing](CONTRIBUTING.md), [security](SECURITY.md) and [changes](CHANGELOG.md).
|
|
53
|
+
Licensed under [Apache-2.0](LICENSE).
|
|
54
|
+
|
|
55
|
+
## GitHub Action
|
|
56
|
+
|
|
57
|
+
The repository root is a composite Action, usable by release tag (or preferably an immutable
|
|
58
|
+
commit). Replace `YOUR_ORG` with the publishing organization after release:
|
|
59
|
+
|
|
60
|
+
```yaml
|
|
61
|
+
permissions:
|
|
62
|
+
contents: read
|
|
63
|
+
steps:
|
|
64
|
+
- uses: actions/checkout@v4
|
|
65
|
+
with:
|
|
66
|
+
fetch-depth: 0
|
|
67
|
+
persist-credentials: false
|
|
68
|
+
- uses: actions/setup-python@v5
|
|
69
|
+
with:
|
|
70
|
+
python-version: '3.13'
|
|
71
|
+
- uses: YOUR_ORG/fail-to-pass@v0.1.0
|
|
72
|
+
with:
|
|
73
|
+
base: origin/main
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Set up the project's Go/Node dependencies first. Store command and test globs in
|
|
77
|
+
`.fail-to-pass.toml`. Use isolated pull-request jobs without secrets; never execute a contributor's
|
|
78
|
+
code from a privileged `pull_request_target` workflow.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
This tool executes the command you supply against code from Git commits. Code, dependency scripts,
|
|
4
|
+
wrappers and tests can access the runner's filesystem, network, environment and credentials.
|
|
5
|
+
The tool is not a sandbox. Run untrusted changes in an isolated disposable environment without
|
|
6
|
+
secrets or write credentials. Do not execute contributor code in `pull_request_target` jobs.
|
|
7
|
+
|
|
8
|
+
Timeouts kill POSIX process groups, but cannot contain a process that deliberately escapes its
|
|
9
|
+
group. Structured reports can be fabricated by hostile code; this is a test-quality check for
|
|
10
|
+
cooperative workflows, not a proof against adversarial authors. Finite reruns cannot rule out all
|
|
11
|
+
flakes. Absolute report paths outside the measured directory are rejected. Exported snapshots
|
|
12
|
+
reject links and submodules. Temporary trees are removed on normal completion and exceptions;
|
|
13
|
+
an abrupt host termination can leave temporary files for the host to clean.
|
|
14
|
+
|
|
15
|
+
Report a vulnerability privately using the publishing repository's Security Advisories page.
|
|
16
|
+
If private reporting is not enabled yet, contact the maintainer through their public profile
|
|
17
|
+
before sharing exploit details. Version 0.1 is the initial supported release series.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: fail-to-pass
|
|
2
|
+
description: Classify tests against a committed base and head
|
|
3
|
+
inputs:
|
|
4
|
+
base:
|
|
5
|
+
description: Comparison ref available in the checked-out repository
|
|
6
|
+
required: true
|
|
7
|
+
repository:
|
|
8
|
+
description: Local checkout directory with complete history
|
|
9
|
+
default: '.'
|
|
10
|
+
config:
|
|
11
|
+
description: Optional config path relative to the workflow working directory
|
|
12
|
+
default: ''
|
|
13
|
+
runs:
|
|
14
|
+
using: composite
|
|
15
|
+
steps:
|
|
16
|
+
- name: Install fail-to-pass from the Action release
|
|
17
|
+
shell: bash
|
|
18
|
+
run: python -m pip install --disable-pip-version-check "$GITHUB_ACTION_PATH"
|
|
19
|
+
- name: Measure transitions
|
|
20
|
+
shell: bash
|
|
21
|
+
env:
|
|
22
|
+
INPUT_BASE: ${{ inputs.base }}
|
|
23
|
+
INPUT_REPOSITORY: ${{ inputs.repository }}
|
|
24
|
+
INPUT_CONFIG: ${{ inputs.config }}
|
|
25
|
+
run: |
|
|
26
|
+
set -euo pipefail
|
|
27
|
+
args=(--repo "$INPUT_REPOSITORY" --base "$INPUT_BASE")
|
|
28
|
+
if [[ -n "$INPUT_CONFIG" ]]; then
|
|
29
|
+
args+=(--config "$INPUT_CONFIG")
|
|
30
|
+
fi
|
|
31
|
+
python -m fail_to_pass "${args[@]}"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Architecture
|
|
2
|
+
|
|
3
|
+
The classifier is independent of Git, execution policy and CI. Structured adapters produce
|
|
4
|
+
suite/name test identities, terminal statuses, build failures and parser errors. `classify`
|
|
5
|
+
assigns one outcome per identity. The executor bounds each invocation and kills its POSIX process
|
|
6
|
+
group on timeout.
|
|
7
|
+
|
|
8
|
+
The Git CLI resolves immutable commit IDs, finds their merge base, and exports regular tracked
|
|
9
|
+
files into temporary directories. It never checks out or restores the user's tree. Only declared
|
|
10
|
+
executable test files are copied from head into base. Files a guard inspects, including test
|
|
11
|
+
sources, therefore retain their base versions. External mode copies executables into a third
|
|
12
|
+
directory; the two measured trees remain complete unmodified snapshots. This supports guards
|
|
13
|
+
that scan their own tracked source. Snapshot preparation refuses links and submodules rather than
|
|
14
|
+
silently following files outside the measurement. Commands run without a `.git` directory.
|
|
15
|
+
|
|
16
|
+
Head is run twice for automatic selection; base runs once, with three additional confirmations
|
|
17
|
+
when any selected status is assertion or compile red. Explicit selection uses the library's
|
|
18
|
+
base-first measurement order. Every selected test must satisfy the chosen policy. P2p acceptance
|
|
19
|
+
is explicit and does not rewrite evidence into fail-to-pass. All reported head failures and parser
|
|
20
|
+
errors remain rejecting, even outside the selection.
|
|
21
|
+
|
|
22
|
+
The composite Action installs the package from its own release tree and runs the same CLI. Build
|
|
23
|
+
and publish are separate jobs. Only the release publish job obtains an OIDC token, behind the
|
|
24
|
+
release environment. No repository-specific tracker, agent hook, credential helper or deployment
|
|
25
|
+
logic is included.
|