truth-firewall 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.
- truth_firewall-0.1.0/CONTRIBUTING.md +19 -0
- truth_firewall-0.1.0/LICENSE +21 -0
- truth_firewall-0.1.0/MANIFEST.in +11 -0
- truth_firewall-0.1.0/PILOT_FEEDBACK.md +14 -0
- truth_firewall-0.1.0/PKG-INFO +141 -0
- truth_firewall-0.1.0/QUICKSTART.md +107 -0
- truth_firewall-0.1.0/README.md +116 -0
- truth_firewall-0.1.0/docs/PUBLISHING.md +166 -0
- truth_firewall-0.1.0/pyproject.toml +53 -0
- truth_firewall-0.1.0/setup.cfg +4 -0
- truth_firewall-0.1.0/src/truth_firewall/__init__.py +7 -0
- truth_firewall-0.1.0/src/truth_firewall/__main__.py +4 -0
- truth_firewall-0.1.0/src/truth_firewall/audit.py +30 -0
- truth_firewall-0.1.0/src/truth_firewall/claims/__init__.py +6 -0
- truth_firewall-0.1.0/src/truth_firewall/claims/coverage.py +40 -0
- truth_firewall-0.1.0/src/truth_firewall/claims/deterministic.py +822 -0
- truth_firewall-0.1.0/src/truth_firewall/claims/extractor.py +22 -0
- truth_firewall-0.1.0/src/truth_firewall/claims/normalization.py +426 -0
- truth_firewall-0.1.0/src/truth_firewall/claims/prompts.py +47 -0
- truth_firewall-0.1.0/src/truth_firewall/claims/proposition.py +324 -0
- truth_firewall-0.1.0/src/truth_firewall/claims/semantic.py +76 -0
- truth_firewall-0.1.0/src/truth_firewall/cli.py +204 -0
- truth_firewall-0.1.0/src/truth_firewall/codex_worker.py +75 -0
- truth_firewall-0.1.0/src/truth_firewall/completion.py +229 -0
- truth_firewall-0.1.0/src/truth_firewall/constants.py +40 -0
- truth_firewall-0.1.0/src/truth_firewall/contract_coverage.py +278 -0
- truth_firewall-0.1.0/src/truth_firewall/coverage_authority.py +379 -0
- truth_firewall-0.1.0/src/truth_firewall/demo.py +107 -0
- truth_firewall-0.1.0/src/truth_firewall/errors.py +29 -0
- truth_firewall-0.1.0/src/truth_firewall/evidence/__init__.py +5 -0
- truth_firewall-0.1.0/src/truth_firewall/evidence/collectors/__init__.py +15 -0
- truth_firewall-0.1.0/src/truth_firewall/evidence/collectors/filesystem.py +218 -0
- truth_firewall-0.1.0/src/truth_firewall/evidence/collectors/git.py +98 -0
- truth_firewall-0.1.0/src/truth_firewall/evidence/collectors/process.py +117 -0
- truth_firewall-0.1.0/src/truth_firewall/evidence/collectors/runtime.py +42 -0
- truth_firewall-0.1.0/src/truth_firewall/evidence/collectors/structure.py +131 -0
- truth_firewall-0.1.0/src/truth_firewall/evidence/collectors/test_runner.py +610 -0
- truth_firewall-0.1.0/src/truth_firewall/evidence/executable_identity.py +168 -0
- truth_firewall-0.1.0/src/truth_firewall/evidence/execution_environment.py +82 -0
- truth_firewall-0.1.0/src/truth_firewall/evidence/git_identity.py +80 -0
- truth_firewall-0.1.0/src/truth_firewall/evidence/io.py +123 -0
- truth_firewall-0.1.0/src/truth_firewall/evidence/ledger.py +66 -0
- truth_firewall-0.1.0/src/truth_firewall/evidence/local.py +47 -0
- truth_firewall-0.1.0/src/truth_firewall/evidence/provenance.py +264 -0
- truth_firewall-0.1.0/src/truth_firewall/evidence/pytest_result.py +112 -0
- truth_firewall-0.1.0/src/truth_firewall/evidence/retriever.py +113 -0
- truth_firewall-0.1.0/src/truth_firewall/evidence_requirements.py +63 -0
- truth_firewall-0.1.0/src/truth_firewall/fixtures/demo/contradicted.json +30 -0
- truth_firewall-0.1.0/src/truth_firewall/fixtures/demo/legitimate_hypothesis.json +20 -0
- truth_firewall-0.1.0/src/truth_firewall/fixtures/demo/mixed.json +38 -0
- truth_firewall-0.1.0/src/truth_firewall/fixtures/demo/overclaimed_completion.json +40 -0
- truth_firewall-0.1.0/src/truth_firewall/fixtures/demo/scoped_absence.json +37 -0
- truth_firewall-0.1.0/src/truth_firewall/fixtures/demo/supported_factual.json +28 -0
- truth_firewall-0.1.0/src/truth_firewall/fixtures/demo/unsupported_causal.json +33 -0
- truth_firewall-0.1.0/src/truth_firewall/generic_completion.py +467 -0
- truth_firewall-0.1.0/src/truth_firewall/integrations/__init__.py +5 -0
- truth_firewall-0.1.0/src/truth_firewall/integrations/codex.py +371 -0
- truth_firewall-0.1.0/src/truth_firewall/integrations/cursor.py +366 -0
- truth_firewall-0.1.0/src/truth_firewall/integrations/local_test_results.py +117 -0
- truth_firewall-0.1.0/src/truth_firewall/lifecycle.py +298 -0
- truth_firewall-0.1.0/src/truth_firewall/onboarding.py +133 -0
- truth_firewall-0.1.0/src/truth_firewall/pilot.py +261 -0
- truth_firewall-0.1.0/src/truth_firewall/pipeline.py +432 -0
- truth_firewall-0.1.0/src/truth_firewall/policy/__init__.py +5 -0
- truth_firewall-0.1.0/src/truth_firewall/policy/engine.py +41 -0
- truth_firewall-0.1.0/src/truth_firewall/providers/__init__.py +6 -0
- truth_firewall-0.1.0/src/truth_firewall/providers/base.py +18 -0
- truth_firewall-0.1.0/src/truth_firewall/providers/config.py +40 -0
- truth_firewall-0.1.0/src/truth_firewall/providers/fake.py +52 -0
- truth_firewall-0.1.0/src/truth_firewall/providers/openai_compatible.py +133 -0
- truth_firewall-0.1.0/src/truth_firewall/py.typed +0 -0
- truth_firewall-0.1.0/src/truth_firewall/redaction.py +36 -0
- truth_firewall-0.1.0/src/truth_firewall/rewrite/__init__.py +5 -0
- truth_firewall-0.1.0/src/truth_firewall/rewrite/rewriter.py +151 -0
- truth_firewall-0.1.0/src/truth_firewall/safety.py +69 -0
- truth_firewall-0.1.0/src/truth_firewall/schemas.py +606 -0
- truth_firewall-0.1.0/src/truth_firewall/storage.py +139 -0
- truth_firewall-0.1.0/src/truth_firewall/supervised_worker.py +333 -0
- truth_firewall-0.1.0/src/truth_firewall/verification/__init__.py +5 -0
- truth_firewall-0.1.0/src/truth_firewall/verification/contracts.py +40 -0
- truth_firewall-0.1.0/src/truth_firewall/verification/entailment.py +357 -0
- truth_firewall-0.1.0/src/truth_firewall/verification/rules.py +971 -0
- truth_firewall-0.1.0/src/truth_firewall/verification/verifier.py +99 -0
- truth_firewall-0.1.0/src/truth_firewall/workspace.py +90 -0
- truth_firewall-0.1.0/src/truth_firewall.egg-info/PKG-INFO +141 -0
- truth_firewall-0.1.0/src/truth_firewall.egg-info/SOURCES.txt +104 -0
- truth_firewall-0.1.0/src/truth_firewall.egg-info/dependency_links.txt +1 -0
- truth_firewall-0.1.0/src/truth_firewall.egg-info/entry_points.txt +2 -0
- truth_firewall-0.1.0/src/truth_firewall.egg-info/requires.txt +4 -0
- truth_firewall-0.1.0/src/truth_firewall.egg-info/top_level.txt +1 -0
- truth_firewall-0.1.0/tests/__init__.py +1 -0
- truth_firewall-0.1.0/tests/conftest.py +119 -0
- truth_firewall-0.1.0/tests/test_contract_coverage_remediation.py +149 -0
- truth_firewall-0.1.0/tests/test_core.py +181 -0
- truth_firewall-0.1.0/tests/test_coverage_authority.py +188 -0
- truth_firewall-0.1.0/tests/test_lifecycle.py +100 -0
- truth_firewall-0.1.0/tests/test_onboarding.py +150 -0
- truth_firewall-0.1.0/tests/test_onboarding_release_guard.py +240 -0
- truth_firewall-0.1.0/tests/test_output_parser.py +132 -0
- truth_firewall-0.1.0/tests/test_pilot.py +118 -0
- truth_firewall-0.1.0/tests/test_regression.py +221 -0
- truth_firewall-0.1.0/tests/test_supervised_worker.py +362 -0
- truth_firewall-0.1.0/tests/test_task_completion.py +106 -0
- truth_firewall-0.1.0/tools/check_dist.py +87 -0
- truth_firewall-0.1.0/tools/check_pipx.py +90 -0
- truth_firewall-0.1.0/tools/smoke_installed.py +123 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Truth Firewall is an early Windows pilot for bounded local Python tasks. Keep original task requirements, acceptance checks, evidence, and final verdicts distinct. Add a regression test when changing verification behavior. Do not treat worker prose or passing worker-owned tests as completion authority.
|
|
4
|
+
|
|
5
|
+
## Local checks
|
|
6
|
+
|
|
7
|
+
For development, clone the source and use a virtual environment. Normal users can use the pipx source/artifact installation described in [QUICKSTART.md](QUICKSTART.md); the PyPI command remains planned until publication and public verification.
|
|
8
|
+
|
|
9
|
+
```powershell
|
|
10
|
+
git clone https://github.com/aldi949/truth-firewall.git
|
|
11
|
+
cd truth-firewall
|
|
12
|
+
python -m venv .venv
|
|
13
|
+
.\.venv\Scripts\python.exe -m pip install -e ".[dev]"
|
|
14
|
+
.\.venv\Scripts\python.exe -m pytest
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
When reporting a problem, include the command, Python version, platform, and a small reproduction. Redact task text, source, private paths, credentials, and local invocation logs before sharing. Do not commit `.env` files, virtual environments, or `.truth-firewall\runs`.
|
|
18
|
+
|
|
19
|
+
For release checks, build with `python -m build`, validate with `python -m twine check --strict dist/*` and `python tools/check_dist.py dist`, then run `tools/check_pipx.py` against the wheel from a new temporary directory. See [docs/PUBLISHING.md](docs/PUBLISHING.md). These commands do not publish.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Truth Firewall Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
include LICENSE README.md QUICKSTART.md CONTRIBUTING.md PILOT_FEEDBACK.md
|
|
2
|
+
recursive-include docs *.md
|
|
3
|
+
recursive-include tools *.py
|
|
4
|
+
recursive-include tests *.py
|
|
5
|
+
recursive-include src/truth_firewall *.py *.json py.typed
|
|
6
|
+
global-exclude *.py[cod] .env .env.* *.pem *.key *.pfx
|
|
7
|
+
prune .github
|
|
8
|
+
prune .pytest_cache
|
|
9
|
+
prune build
|
|
10
|
+
prune dist
|
|
11
|
+
prune artifacts
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Truth Firewall pilot feedback
|
|
2
|
+
|
|
3
|
+
Please answer briefly. Do not include API keys, private source code, or confidential task text.
|
|
4
|
+
|
|
5
|
+
1. What task did you give your agent?
|
|
6
|
+
2. Would you normally have watched or checked it manually?
|
|
7
|
+
3. Did Truth Firewall let you leave it alone?
|
|
8
|
+
4. Was the final decision correct?
|
|
9
|
+
5. Did it block a premature DONE?
|
|
10
|
+
6. Did it block something that was actually complete?
|
|
11
|
+
7. What confused or annoyed you?
|
|
12
|
+
8. Would you use this again? Why?
|
|
13
|
+
9. Would you install it on another repo?
|
|
14
|
+
10. What would make this a must-have?
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: truth-firewall
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Independently verify bounded local Python coding tasks completed by Codex.
|
|
5
|
+
Author: Truth Firewall Contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/aldi949/truth-firewall
|
|
8
|
+
Project-URL: Repository, https://github.com/aldi949/truth-firewall
|
|
9
|
+
Project-URL: Issues, https://github.com/aldi949/truth-firewall/issues
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
13
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Requires-Python: >=3.11
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Provides-Extra: dev
|
|
22
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
23
|
+
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
|
|
26
|
+
# Your coding agent says “DONE”. That doesn’t mean the job is done.
|
|
27
|
+
|
|
28
|
+
**Truth Firewall won’t accept `DONE` until the work is independently verified.**
|
|
29
|
+
|
|
30
|
+
Your coding agent says:
|
|
31
|
+
|
|
32
|
+
> “Done. Tests pass.”
|
|
33
|
+
|
|
34
|
+
Maybe it is.
|
|
35
|
+
|
|
36
|
+
Maybe it skipped a requirement.\
|
|
37
|
+
Maybe an edge case is broken.\
|
|
38
|
+
Maybe it changed something it shouldn’t have.
|
|
39
|
+
|
|
40
|
+
And then **you** have to check everything anyway.
|
|
41
|
+
|
|
42
|
+
That defeats the whole point of having an agent.
|
|
43
|
+
|
|
44
|
+
# Truth Firewall stops that.
|
|
45
|
+
|
|
46
|
+
**The agent does the work.**\
|
|
47
|
+
**Truth Firewall decides whether `DONE` is actually earned.**
|
|
48
|
+
|
|
49
|
+
Give Codex the task.
|
|
50
|
+
|
|
51
|
+
Walk away.
|
|
52
|
+
```text
|
|
53
|
+
Codex works
|
|
54
|
+
↓
|
|
55
|
+
Codex says DONE
|
|
56
|
+
↓
|
|
57
|
+
Truth Firewall verifies the required work
|
|
58
|
+
↓
|
|
59
|
+
┌──────────────────┬──────────────────┬──────────────────┐
|
|
60
|
+
↓ ↓ ↓
|
|
61
|
+
VERIFIED_DONE REJECT_DONE HUMAN_REQUIRED
|
|
62
|
+
↓
|
|
63
|
+
Codex keeps working
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Install the package
|
|
67
|
+
|
|
68
|
+
**Planned PyPI command — not published or verified from PyPI yet:**
|
|
69
|
+
|
|
70
|
+
```powershell
|
|
71
|
+
pipx install truth-firewall
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Have **Python 3.11+ and pipx** installed first. On Windows, you can install pipx with `py -3.11 -m pip install --user pipx`, run `py -3.11 -m pipx ensurepath`, and reopen PowerShell. Use an installed supported Python version in those commands. Installing Truth Firewall does not install Python, pipx, Node.js, or Codex, and does not sign you into Codex.
|
|
75
|
+
|
|
76
|
+
Until PyPI publication, use Git plus the reviewed GitHub revision, or install a locally built wheel:
|
|
77
|
+
|
|
78
|
+
```powershell
|
|
79
|
+
pipx install "git+https://github.com/aldi949/truth-firewall.git@95d0fc00de59134527af979de6f07eda1bd65d8a"
|
|
80
|
+
# Local release candidate, after building/downloading the actual artifact:
|
|
81
|
+
pipx install .\truth_firewall-0.1.0-py3-none-any.whl
|
|
82
|
+
truth-firewall --help
|
|
83
|
+
truth-firewall --version
|
|
84
|
+
truth-firewall demo
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The offline demo needs no Codex account and explicitly labels its fixtures as demonstrations, not live accuracy. Package installation is isolated by pipx; the real task runner is currently a **Windows pilot**. See [QUICKSTART.md](QUICKSTART.md) for setup and [publication gates](docs/PUBLISHING.md) for the unpublished candidate. Do not use the planned PyPI command until a release has been published and verified to belong to this repository.
|
|
88
|
+
|
|
89
|
+
## First-time Codex setup
|
|
90
|
+
|
|
91
|
+
Real tasks require Node.js and an installed, authenticated Codex CLI for the same Windows user. Install those separately using the [Codex CLI instructions](https://developers.openai.com/codex/cli). Verify `node --version`, `codex --version`, and `codex login status`; sign in with `codex login` if necessary. Truth Firewall's pilot expects the npm Codex JavaScript entry point under the current user's `%APPDATA%\npm\node_modules\@openai\codex\bin\codex.js`. Nonstandard installations can set `TRUTH_FIREWALL_CODEX_JS` to their actual `codex.js` path. Codex may require an eligible account or API billing; pipx installation does not provide authentication or credits.
|
|
92
|
+
|
|
93
|
+
## Run a bounded Python task
|
|
94
|
+
|
|
95
|
+
Open PowerShell in the Python repository you want Truth Firewall to work on, then run:
|
|
96
|
+
|
|
97
|
+
```powershell
|
|
98
|
+
truth-firewall init
|
|
99
|
+
notepad .\.truth-firewall\task.json
|
|
100
|
+
truth-firewall activate
|
|
101
|
+
truth-firewall run
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
`init` asks for your task text and an optional required output file. It runs locally without an LLM and validates `.truth-firewall/task.json` using the same spec loader as `run`. A supplied file creates only a file-existence starter check; leaving it blank creates a clearly marked editable template. Both remain unreviewed and cannot authorize completion. Review the file and add checks for **every mandatory requirement**, replacing any `EDIT_ME` placeholder, then explicitly confirm with `truth-firewall activate`. An unreviewed spec stops before Codex starts. Truth Firewall cannot infer omitted requirements or guarantee that review makes the checks complete. Existing task files are preserved unless you explicitly use `truth-firewall init --overwrite`. Existing manually authored `--spec` contracts remain supported; an `EDIT_ME` placeholder always blocks completion. The verifier cannot infer from arbitrary task prose that a check targets the intended source file, so inspect paths carefully. See [QUICKSTART.md](QUICKSTART.md) for examples and PATH troubleshooting; clone/venv development setup is in [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
105
|
+
|
|
106
|
+
Activation records a SHA-256 digest of the reviewed task and checks. If you edit the task or checks afterward, `run` returns `HUMAN_REQUIRED` before Codex starts; review the changed contract and run `truth-firewall activate` again. The digest detects ordinary edits, not deliberate rewriting of both the contract and its digest by someone with access to your files.
|
|
107
|
+
|
|
108
|
+
Legacy manually authored specs remain accepted without review metadata. If both `acceptance_review` and `onboarding_note` are removed from a generated concrete starter, it becomes indistinguishable from a legacy spec; keep those fields and use `activate` after reviewing the checks.
|
|
109
|
+
|
|
110
|
+
The supported checks are `file_exists` (a repository-relative path exists or does not exist), `python_function` (a top-level function has the exact parameter list), and `black_box` (JSON argument lists produce expected return values). Give each condition a unique `id`. Every listed condition is mandatory, and requirements missing from `task.json` cannot be verified.
|
|
111
|
+
|
|
112
|
+
## What the decisions mean
|
|
113
|
+
|
|
114
|
+
- `VERIFIED_DONE`: all listed mandatory checks passed for the observed final repository state. The terminal shows the original task, check summary, and attempts used.
|
|
115
|
+
- `REJECT_DONE`: a worker completion claim failed at least one mandatory check. This is an intermediate decision; Truth Firewall sends actionable failures back to Codex and continues within the three-attempt limit.
|
|
116
|
+
- `HUMAN_REQUIRED`: completion could not be proven, including when attempts are exhausted or a mandatory condition cannot be checked. Review the named requirements and decide what to do next.
|
|
117
|
+
- `ERROR`: the worker, verifier, or runtime could not complete the run. This is an execution problem, not a verdict that the task failed.
|
|
118
|
+
|
|
119
|
+
## Why this exists
|
|
120
|
+
|
|
121
|
+
A worker saying “done,” code existing, or worker-owned tests passing does not establish that your original requirements were met. Truth Firewall checks the acceptance conditions you supplied after each attempt and blocks an unsupported completion claim. It can continue Codex automatically when a check fails, so you do not have to watch each turn.
|
|
122
|
+
|
|
123
|
+
## What `VERIFIED_DONE` actually means
|
|
124
|
+
|
|
125
|
+
It means the listed mandatory checks passed on the final observed workspace state. It does **not** prove that an omitted requirement was met, that the checks themselves are complete, or that all possible behavior is correct. Author the checks to cover the task before you start; if the supported checks cannot establish completion, treat the outcome as requiring human judgment.
|
|
126
|
+
|
|
127
|
+
## Current pilot scope
|
|
128
|
+
|
|
129
|
+
This first release supports local repositories, bounded Python coding tasks, a Codex CLI worker, deterministic file/API/input-output checks, and at most three worker attempts. A small local run summary is written under `.truth-firewall\runs\<run-id>\summary.json`; it records the decision and attempt counts without task text or source code.
|
|
130
|
+
|
|
131
|
+
## Limitations
|
|
132
|
+
|
|
133
|
+
This is not a hostile-worker security boundary or a claim of universal correctness. Codex runs as your normal user and can access files available to that account, including the task specification. Use disposable or nonsensitive repositories for the pilot. Subjective quality, UI behavior, deployment, external services, broad repository work, and requirements that cannot be observed with the supported checks are outside this pilot.
|
|
134
|
+
|
|
135
|
+
## Privacy
|
|
136
|
+
|
|
137
|
+
Truth Firewall does not automatically upload telemetry, source code, or task text. Codex sends task instructions and the context it reads to its configured service under your account settings. Detailed local invocation logs are stored in the operating system's temporary directory and may contain the task prompt and worker output. Review those settings before using private code.
|
|
138
|
+
|
|
139
|
+
## Feedback and license
|
|
140
|
+
|
|
141
|
+
Trying Truth Firewall on a real task? Please use [PILOT_FEEDBACK.md](PILOT_FEEDBACK.md). Contribution guidance and local test commands are in [CONTRIBUTING.md](CONTRIBUTING.md). Truth Firewall is [MIT licensed](LICENSE).
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Quickstart: local Python task with Codex
|
|
2
|
+
|
|
3
|
+
Use **Windows PowerShell** for real tasks. Package installation and Codex setup are separate.
|
|
4
|
+
|
|
5
|
+
## Package installation
|
|
6
|
+
|
|
7
|
+
**Planned command after PyPI publication — not currently a verified public PyPI install:**
|
|
8
|
+
|
|
9
|
+
```powershell
|
|
10
|
+
pipx install truth-firewall
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Prerequisites: Python 3.11+ and pipx on PATH. Installing the package supplies neither Python nor pipx. If needed, install pipx with `py -3.11 -m pip install --user pipx`, run `py -3.11 -m pipx ensurepath`, and reopen PowerShell. Substitute your installed supported Python version. Check `pipx --version` before continuing.
|
|
14
|
+
|
|
15
|
+
Before publication, the available GitHub installation requires Git and uses the reviewed published commit:
|
|
16
|
+
|
|
17
|
+
```powershell
|
|
18
|
+
pipx install "git+https://github.com/aldi949/truth-firewall.git@95d0fc00de59134527af979de6f07eda1bd65d8a"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
For a locally built candidate wheel instead, use `pipx install .\truth_firewall-0.1.0-py3-none-any.whl`. These are actual source/artifact installs, not proof that `pipx install truth-firewall` resolves to this project on PyPI. Publication instructions and gates are in [docs/PUBLISHING.md](docs/PUBLISHING.md).
|
|
22
|
+
|
|
23
|
+
From any working directory, check the installed executable:
|
|
24
|
+
|
|
25
|
+
```powershell
|
|
26
|
+
truth-firewall --help
|
|
27
|
+
truth-firewall --version
|
|
28
|
+
truth-firewall demo
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The offline demo uses bundled fixtures and labels them **NOT LIVE PRODUCT ACCURACY**. It needs no Node.js or Codex authentication. pipx upgrade and uninstall commands after publication are `pipx upgrade truth-firewall` and `pipx uninstall truth-firewall`. For a newer local wheel, use `pipx install --force .\path\to\new.whl`; `pipx upgrade` of a wheel-pinned installation does not switch it to PyPI.
|
|
32
|
+
|
|
33
|
+
## First-time Codex setup
|
|
34
|
+
|
|
35
|
+
Install Node.js and Codex CLI separately for the current Windows user, following the [official Codex CLI instructions](https://developers.openai.com/codex/cli). Confirm `node --version` and `codex --version`, then run `codex login` and check `codex login status`. You need valid Codex authentication; installing Truth Firewall does not configure an account, provide credits, install Node.js, or install Codex.
|
|
36
|
+
|
|
37
|
+
The pilot expects the npm Codex entry point at `%APPDATA%\npm\node_modules\@openai\codex\bin\codex.js`. For another installation layout, set `TRUTH_FIREWALL_CODEX_JS` to the real `codex.js` path. If Node.js or that entry point is missing, a reviewed task reports a setup `ERROR`; an unreviewed contract still blocks before attempting a worker. Runtime support beyond Windows is not claimed by this pilot.
|
|
38
|
+
|
|
39
|
+
Open PowerShell in the Python repository you want Truth Firewall to work on, then run:
|
|
40
|
+
|
|
41
|
+
```powershell
|
|
42
|
+
truth-firewall init
|
|
43
|
+
notepad .\.truth-firewall\task.json
|
|
44
|
+
truth-firewall activate
|
|
45
|
+
truth-firewall run
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Prepare the task
|
|
49
|
+
|
|
50
|
+
Run `init` from the root of a disposable or nonsensitive local Python repository. It asks for your task text and optionally a repository-relative output file that your task must create. It is deterministic, local, and needs no LLM or API key. It validates the generated JSON through the existing task/spec loader before reporting success.
|
|
51
|
+
|
|
52
|
+
A supplied path creates a `file_exists` starter check only. Leaving the path blank creates a valid, explicitly marked editable template with `EDIT_ME_required_output.py` as a placeholder. **Replace that placeholder before activation.** Both starter forms are unreviewed and cannot authorize completion. Neither option infers behavior or guarantees full coverage. Open the contract to review and extend it before activation:
|
|
53
|
+
|
|
54
|
+
```powershell
|
|
55
|
+
notepad .\.truth-firewall\task.json
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Keep `task` as your bounded request. Edit `conditions` to check **every mandatory requirement**. The `onboarding_note` is an editing reminder, not an acceptance check. Each condition has a unique `id` and a repository-relative `path`:
|
|
59
|
+
|
|
60
|
+
- `file_exists`: `path` and `exists` (`true` or `false`).
|
|
61
|
+
- `python_function`: `path`, top-level `symbol`, and exact `parameters` list.
|
|
62
|
+
- `black_box`: `path`, top-level `symbol`, and one or more `cases` with JSON `args` and `expected` return value.
|
|
63
|
+
|
|
64
|
+
For example, if your task is specifically to implement `add_one(value)` in `app.py`, you could use these conditions (adapt them to your actual request):
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
[
|
|
68
|
+
{"id": "file", "kind": "file_exists", "path": "app.py", "exists": true},
|
|
69
|
+
{"id": "api", "kind": "python_function", "path": "app.py", "symbol": "add_one", "parameters": ["value"]},
|
|
70
|
+
{"id": "behavior", "kind": "black_box", "path": "app.py", "symbol": "add_one", "cases": [{"args": [1], "expected": 2}]}
|
|
71
|
+
]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
All listed conditions are mandatory. Truth Firewall cannot infer requirements omitted from the file, and explicit review does not guarantee complete task coverage. If the supported checks cannot establish your task's requirements, do not treat the result as proof of completion. Check that every condition points to the intended file: the verifier cannot soundly match paths against arbitrary natural-language task text. `init` refuses to overwrite an existing contract; use `truth-firewall init --overwrite` only when you intend to replace it.
|
|
75
|
+
|
|
76
|
+
## Run
|
|
77
|
+
|
|
78
|
+
From the task repository after reviewing and editing the contract, confirm the displayed task and checks, then run:
|
|
79
|
+
|
|
80
|
+
```powershell
|
|
81
|
+
truth-firewall activate
|
|
82
|
+
truth-firewall run
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The default spec is `.truth-firewall/task.json`. For a generated contract at another path, use `truth-firewall activate --spec path\to\task.json`. Existing manually authored contracts remain usable with `truth-firewall run --spec path\to\task.json`; generated contracts require activation. An unreviewed starter returns `HUMAN_REQUIRED` before launching Codex, even if its file-existence check would pass. An `EDIT_ME` placeholder cannot authorize `VERIFIED_DONE`.
|
|
86
|
+
|
|
87
|
+
Activation stores a digest of the task and acceptance checks you reviewed. After changing either, review the file and run `truth-firewall activate` again before `run`; a changed reviewed contract returns `HUMAN_REQUIRED` without launching Codex. This detects ordinary edits, but the digest is not an authenticated signature against someone who can rewrite both it and the contract.
|
|
88
|
+
|
|
89
|
+
Keep the generated `acceptance_review` and `onboarding_note` fields. Removing both from a concrete starter makes it indistinguishable from an older manually authored spec, which remains accepted for compatibility. Review and activate the generated contract instead.
|
|
90
|
+
|
|
91
|
+
Truth Firewall runs Codex, verifies the checks after each attempt, and automatically continues after `REJECT_DONE`, up to three attempts. The final result is:
|
|
92
|
+
|
|
93
|
+
- `VERIFIED_DONE`: all listed checks passed on the observed final state; the terminal shows the original task, checks, evidence summary, and attempts used.
|
|
94
|
+
- `HUMAN_REQUIRED`: completion remains unproven; the terminal names unresolved or failed checks and asks you to review them.
|
|
95
|
+
- `ERROR`: execution or setup failed; the terminal gives the runtime reason. This is not a task-failure verdict.
|
|
96
|
+
|
|
97
|
+
A minimal local run summary is saved in `.truth-firewall\runs\<run-id>\summary.json`. It does not include task text or source. Detailed local invocation logs are stored in the operating system's temporary directory and may contain the task prompt and Codex output.
|
|
98
|
+
|
|
99
|
+
## Supported scope
|
|
100
|
+
|
|
101
|
+
This Windows pilot uses a local Python repository, Codex CLI, bounded tasks, and deterministic acceptance checks. Codex runs as your normal user. The pilot does not isolate a hostile worker, prove unlisted requirements, or cover subjective review, UI behavior, deployment, and external services. Truth Firewall does not upload telemetry; Codex service data handling follows your Codex account settings.
|
|
102
|
+
|
|
103
|
+
## If the command is not found
|
|
104
|
+
|
|
105
|
+
Run `pipx ensurepath`, reopen PowerShell, and check `pipx list`. pipx installs the CLI in its own environment; your system `py -m truth_firewall` is not expected to see a pipx-installed package. If multiple Python versions are installed, use `pipx install --python 3.11 ...` (or another supported version) to choose one. Developer clone/venv instructions are in [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
106
|
+
|
|
107
|
+
On Windows Python 3.11, pipx's own shared-library storage can fail in a non-ASCII path (`UnicodeEncodeError` or `No module named pip`). Before installation, set `$env:PIPX_HOME` to a new writable ASCII-only absolute path and `$env:PYTHONUTF8 = "1"`, then retry. Keep that `PIPX_HOME` setting for subsequent pipx lifecycle commands. The hosted Python 3.11 checks use ASCII pipx storage and non-ASCII project directories; they do not establish support for non-ASCII pipx storage. These settings do not change Truth Firewall's acceptance checks.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Your coding agent says “DONE”. That doesn’t mean the job is done.
|
|
2
|
+
|
|
3
|
+
**Truth Firewall won’t accept `DONE` until the work is independently verified.**
|
|
4
|
+
|
|
5
|
+
Your coding agent says:
|
|
6
|
+
|
|
7
|
+
> “Done. Tests pass.”
|
|
8
|
+
|
|
9
|
+
Maybe it is.
|
|
10
|
+
|
|
11
|
+
Maybe it skipped a requirement.\
|
|
12
|
+
Maybe an edge case is broken.\
|
|
13
|
+
Maybe it changed something it shouldn’t have.
|
|
14
|
+
|
|
15
|
+
And then **you** have to check everything anyway.
|
|
16
|
+
|
|
17
|
+
That defeats the whole point of having an agent.
|
|
18
|
+
|
|
19
|
+
# Truth Firewall stops that.
|
|
20
|
+
|
|
21
|
+
**The agent does the work.**\
|
|
22
|
+
**Truth Firewall decides whether `DONE` is actually earned.**
|
|
23
|
+
|
|
24
|
+
Give Codex the task.
|
|
25
|
+
|
|
26
|
+
Walk away.
|
|
27
|
+
```text
|
|
28
|
+
Codex works
|
|
29
|
+
↓
|
|
30
|
+
Codex says DONE
|
|
31
|
+
↓
|
|
32
|
+
Truth Firewall verifies the required work
|
|
33
|
+
↓
|
|
34
|
+
┌──────────────────┬──────────────────┬──────────────────┐
|
|
35
|
+
↓ ↓ ↓
|
|
36
|
+
VERIFIED_DONE REJECT_DONE HUMAN_REQUIRED
|
|
37
|
+
↓
|
|
38
|
+
Codex keeps working
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Install the package
|
|
42
|
+
|
|
43
|
+
**Planned PyPI command — not published or verified from PyPI yet:**
|
|
44
|
+
|
|
45
|
+
```powershell
|
|
46
|
+
pipx install truth-firewall
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Have **Python 3.11+ and pipx** installed first. On Windows, you can install pipx with `py -3.11 -m pip install --user pipx`, run `py -3.11 -m pipx ensurepath`, and reopen PowerShell. Use an installed supported Python version in those commands. Installing Truth Firewall does not install Python, pipx, Node.js, or Codex, and does not sign you into Codex.
|
|
50
|
+
|
|
51
|
+
Until PyPI publication, use Git plus the reviewed GitHub revision, or install a locally built wheel:
|
|
52
|
+
|
|
53
|
+
```powershell
|
|
54
|
+
pipx install "git+https://github.com/aldi949/truth-firewall.git@95d0fc00de59134527af979de6f07eda1bd65d8a"
|
|
55
|
+
# Local release candidate, after building/downloading the actual artifact:
|
|
56
|
+
pipx install .\truth_firewall-0.1.0-py3-none-any.whl
|
|
57
|
+
truth-firewall --help
|
|
58
|
+
truth-firewall --version
|
|
59
|
+
truth-firewall demo
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The offline demo needs no Codex account and explicitly labels its fixtures as demonstrations, not live accuracy. Package installation is isolated by pipx; the real task runner is currently a **Windows pilot**. See [QUICKSTART.md](QUICKSTART.md) for setup and [publication gates](docs/PUBLISHING.md) for the unpublished candidate. Do not use the planned PyPI command until a release has been published and verified to belong to this repository.
|
|
63
|
+
|
|
64
|
+
## First-time Codex setup
|
|
65
|
+
|
|
66
|
+
Real tasks require Node.js and an installed, authenticated Codex CLI for the same Windows user. Install those separately using the [Codex CLI instructions](https://developers.openai.com/codex/cli). Verify `node --version`, `codex --version`, and `codex login status`; sign in with `codex login` if necessary. Truth Firewall's pilot expects the npm Codex JavaScript entry point under the current user's `%APPDATA%\npm\node_modules\@openai\codex\bin\codex.js`. Nonstandard installations can set `TRUTH_FIREWALL_CODEX_JS` to their actual `codex.js` path. Codex may require an eligible account or API billing; pipx installation does not provide authentication or credits.
|
|
67
|
+
|
|
68
|
+
## Run a bounded Python task
|
|
69
|
+
|
|
70
|
+
Open PowerShell in the Python repository you want Truth Firewall to work on, then run:
|
|
71
|
+
|
|
72
|
+
```powershell
|
|
73
|
+
truth-firewall init
|
|
74
|
+
notepad .\.truth-firewall\task.json
|
|
75
|
+
truth-firewall activate
|
|
76
|
+
truth-firewall run
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
`init` asks for your task text and an optional required output file. It runs locally without an LLM and validates `.truth-firewall/task.json` using the same spec loader as `run`. A supplied file creates only a file-existence starter check; leaving it blank creates a clearly marked editable template. Both remain unreviewed and cannot authorize completion. Review the file and add checks for **every mandatory requirement**, replacing any `EDIT_ME` placeholder, then explicitly confirm with `truth-firewall activate`. An unreviewed spec stops before Codex starts. Truth Firewall cannot infer omitted requirements or guarantee that review makes the checks complete. Existing task files are preserved unless you explicitly use `truth-firewall init --overwrite`. Existing manually authored `--spec` contracts remain supported; an `EDIT_ME` placeholder always blocks completion. The verifier cannot infer from arbitrary task prose that a check targets the intended source file, so inspect paths carefully. See [QUICKSTART.md](QUICKSTART.md) for examples and PATH troubleshooting; clone/venv development setup is in [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
80
|
+
|
|
81
|
+
Activation records a SHA-256 digest of the reviewed task and checks. If you edit the task or checks afterward, `run` returns `HUMAN_REQUIRED` before Codex starts; review the changed contract and run `truth-firewall activate` again. The digest detects ordinary edits, not deliberate rewriting of both the contract and its digest by someone with access to your files.
|
|
82
|
+
|
|
83
|
+
Legacy manually authored specs remain accepted without review metadata. If both `acceptance_review` and `onboarding_note` are removed from a generated concrete starter, it becomes indistinguishable from a legacy spec; keep those fields and use `activate` after reviewing the checks.
|
|
84
|
+
|
|
85
|
+
The supported checks are `file_exists` (a repository-relative path exists or does not exist), `python_function` (a top-level function has the exact parameter list), and `black_box` (JSON argument lists produce expected return values). Give each condition a unique `id`. Every listed condition is mandatory, and requirements missing from `task.json` cannot be verified.
|
|
86
|
+
|
|
87
|
+
## What the decisions mean
|
|
88
|
+
|
|
89
|
+
- `VERIFIED_DONE`: all listed mandatory checks passed for the observed final repository state. The terminal shows the original task, check summary, and attempts used.
|
|
90
|
+
- `REJECT_DONE`: a worker completion claim failed at least one mandatory check. This is an intermediate decision; Truth Firewall sends actionable failures back to Codex and continues within the three-attempt limit.
|
|
91
|
+
- `HUMAN_REQUIRED`: completion could not be proven, including when attempts are exhausted or a mandatory condition cannot be checked. Review the named requirements and decide what to do next.
|
|
92
|
+
- `ERROR`: the worker, verifier, or runtime could not complete the run. This is an execution problem, not a verdict that the task failed.
|
|
93
|
+
|
|
94
|
+
## Why this exists
|
|
95
|
+
|
|
96
|
+
A worker saying “done,” code existing, or worker-owned tests passing does not establish that your original requirements were met. Truth Firewall checks the acceptance conditions you supplied after each attempt and blocks an unsupported completion claim. It can continue Codex automatically when a check fails, so you do not have to watch each turn.
|
|
97
|
+
|
|
98
|
+
## What `VERIFIED_DONE` actually means
|
|
99
|
+
|
|
100
|
+
It means the listed mandatory checks passed on the final observed workspace state. It does **not** prove that an omitted requirement was met, that the checks themselves are complete, or that all possible behavior is correct. Author the checks to cover the task before you start; if the supported checks cannot establish completion, treat the outcome as requiring human judgment.
|
|
101
|
+
|
|
102
|
+
## Current pilot scope
|
|
103
|
+
|
|
104
|
+
This first release supports local repositories, bounded Python coding tasks, a Codex CLI worker, deterministic file/API/input-output checks, and at most three worker attempts. A small local run summary is written under `.truth-firewall\runs\<run-id>\summary.json`; it records the decision and attempt counts without task text or source code.
|
|
105
|
+
|
|
106
|
+
## Limitations
|
|
107
|
+
|
|
108
|
+
This is not a hostile-worker security boundary or a claim of universal correctness. Codex runs as your normal user and can access files available to that account, including the task specification. Use disposable or nonsensitive repositories for the pilot. Subjective quality, UI behavior, deployment, external services, broad repository work, and requirements that cannot be observed with the supported checks are outside this pilot.
|
|
109
|
+
|
|
110
|
+
## Privacy
|
|
111
|
+
|
|
112
|
+
Truth Firewall does not automatically upload telemetry, source code, or task text. Codex sends task instructions and the context it reads to its configured service under your account settings. Detailed local invocation logs are stored in the operating system's temporary directory and may contain the task prompt and worker output. Review those settings before using private code.
|
|
113
|
+
|
|
114
|
+
## Feedback and license
|
|
115
|
+
|
|
116
|
+
Trying Truth Firewall on a real task? Please use [PILOT_FEEDBACK.md](PILOT_FEEDBACK.md). Contribution guidance and local test commands are in [CONTRIBUTING.md](CONTRIBUTING.md). Truth Firewall is [MIT licensed](LICENSE).
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# Publication checklist (manual publication only)
|
|
2
|
+
|
|
3
|
+
The initial candidate is `truth-firewall` version `0.1.0`, from
|
|
4
|
+
`https://github.com/aldi949/truth-firewall`. The reviewed packaging baseline
|
|
5
|
+
is `5536cc7fa451354fb1e8fa53f341da6932ac22fa`. Packaging changes must be reviewed
|
|
6
|
+
before they are committed, pushed, tagged, or published. None of those actions is
|
|
7
|
+
authorized by running the local checks.
|
|
8
|
+
|
|
9
|
+
On 2026-10-13, `https://pypi.org/pypi/truth-firewall/json` returned HTTP 404.
|
|
10
|
+
No existing project was visible. This does not reserve the name or establish that
|
|
11
|
+
PyPI will accept it. Recheck immediately before publication. If another publisher
|
|
12
|
+
owns the name, stop: do not install or upload an unrelated package. Choose a new
|
|
13
|
+
distribution name with the owner and update metadata/docs/tests together.
|
|
14
|
+
|
|
15
|
+
## Build and inspect
|
|
16
|
+
|
|
17
|
+
Use Python 3.11+ in a development environment. The product has no runtime
|
|
18
|
+
dependencies. Build, test, pipx and upload-validation tools are development tools:
|
|
19
|
+
|
|
20
|
+
```powershell
|
|
21
|
+
python -m pip install build==1.6.1 twine==7.0.0 pipx==1.17.14 pytest==9.1.1
|
|
22
|
+
python -m pytest
|
|
23
|
+
python -m build
|
|
24
|
+
python -m twine check --strict dist/*
|
|
25
|
+
python tools/check_dist.py dist
|
|
26
|
+
$wheel = (Get-ChildItem dist/*.whl).FullName
|
|
27
|
+
python tools/check_pipx.py --wheel "$wheel" --work "$env:TEMP\TF candidate check"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The check directory must be new. `check_pipx.py` uses private pipx paths, launches
|
|
31
|
+
the installed executable outside the repository, checks all seven bundled demo
|
|
32
|
+
fixtures, completion controls, review invalidation, and missing-runtime errors,
|
|
33
|
+
then tests reinstall, same-artifact upgrade, and uninstall. It does not modify
|
|
34
|
+
the user's normal pipx installation or PATH. Hosted checks keep pipx storage ASCII
|
|
35
|
+
because pipx's shared-library path handling on Windows Python 3.11 failed in a
|
|
36
|
+
non-ASCII storage path; installed CLI checks still run in non-ASCII project paths.
|
|
37
|
+
See QUICKSTART for the explicit storage workaround. An optional `--upgrade-wheel` can
|
|
38
|
+
test a later locally built version via a local-only package resolver. Such a
|
|
39
|
+
test-only version must never be published as the release candidate.
|
|
40
|
+
|
|
41
|
+
Rebuild the sdist into a wheel in a fresh directory and install that wheel too.
|
|
42
|
+
Record archive contents and SHA-256 hashes. Check that version `0.1.0` in
|
|
43
|
+
`pyproject.toml`, `truth_firewall.__version__`, and wheel metadata agree. Update
|
|
44
|
+
both version declarations deliberately for a later release; never overwrite a
|
|
45
|
+
version already uploaded to PyPI. The `package-checks.yml` workflow runs tests,
|
|
46
|
+
builds, archive checks, pipx checks and sdist installation on Windows and Linux
|
|
47
|
+
with Python 3.11 and 3.14, and uploads downloadable artifacts. It has only
|
|
48
|
+
`contents: read`, no OIDC permission, no publishing step, and no credentials
|
|
49
|
+
persisted in its checkout. New hosted CI results remain NOT_RUN until the changes
|
|
50
|
+
are explicitly approved and pushed; local Windows execution is separate evidence.
|
|
51
|
+
|
|
52
|
+
For a bounded real integration check, run `tools/smoke_installed.py --exe ...
|
|
53
|
+
--python ... --work ... --real-codex` against the actual installed executable and
|
|
54
|
+
its pipx interpreter. This requires separately installed Node.js, Codex CLI, and
|
|
55
|
+
valid Codex authentication. Without the flag, the positive/negative controls call
|
|
56
|
+
the installed verifier directly and are **not** a real end-to-end Codex run.
|
|
57
|
+
|
|
58
|
+
## Deliberate Trusted Publishing setup
|
|
59
|
+
|
|
60
|
+
The prepared `.github/workflows/publish-pypi.yml` has only a manual dispatch
|
|
61
|
+
trigger; adding or merging it does not publish a package. Before enabling it on
|
|
62
|
+
main, verify the `pypi` environment's branch restriction and the manual-only trigger.
|
|
63
|
+
Pending-publisher setup requires the PyPI owner's authenticated account. No PyPI
|
|
64
|
+
publisher configuration is implied by the presence of this workflow.
|
|
65
|
+
|
|
66
|
+
After explicit setup approval, and before a separately authorized publication:
|
|
67
|
+
|
|
68
|
+
1. Recheck the name and the exact approved source revision and artifacts. Require
|
|
69
|
+
all local gates and hosted Windows checks for that revision to pass.
|
|
70
|
+
2. Create a GitHub environment named `pypi`, restricted to the `main` branch only
|
|
71
|
+
(not tags). The sole maintainer explicitly chose no required reviewers and no
|
|
72
|
+
self-review prevention. Verify the exact branch policy. This configuration has
|
|
73
|
+
no GitHub deployment approval gate: the operator must obtain the owner's
|
|
74
|
+
separate explicit publication approval before manually dispatching a release.
|
|
75
|
+
3. In the PyPI owner's account, add a **pending Trusted Publisher** with project
|
|
76
|
+
`truth-firewall`, owner `aldi949`, repository `truth-firewall`, workflow filename
|
|
77
|
+
`publish-pypi.yml`, and environment `pypi`. A pending publisher does not reserve
|
|
78
|
+
the name. Do not put an API token in this repository.
|
|
79
|
+
4. Only after setup authorization and verified environment restriction, merge the
|
|
80
|
+
prepared `.github/workflows/publish-pypi.yml`. Keep it manual-only.
|
|
81
|
+
Do not add push, tag, release, or pull-request publication triggers.
|
|
82
|
+
|
|
83
|
+
The prepared workflow uses the following official actions pinned to revisions
|
|
84
|
+
inspected during preparation. Review those revisions again before publication:
|
|
85
|
+
|
|
86
|
+
```yaml
|
|
87
|
+
name: Deliberate PyPI publication
|
|
88
|
+
on:
|
|
89
|
+
workflow_dispatch:
|
|
90
|
+
inputs:
|
|
91
|
+
version:
|
|
92
|
+
description: Approved version (must match pyproject.toml)
|
|
93
|
+
required: true
|
|
94
|
+
type: string
|
|
95
|
+
permissions:
|
|
96
|
+
contents: read
|
|
97
|
+
jobs:
|
|
98
|
+
build:
|
|
99
|
+
if: github.ref == 'refs/heads/main'
|
|
100
|
+
runs-on: ubuntu-latest
|
|
101
|
+
steps:
|
|
102
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
|
|
103
|
+
with:
|
|
104
|
+
persist-credentials: false
|
|
105
|
+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
|
|
106
|
+
with:
|
|
107
|
+
python-version: '3.11'
|
|
108
|
+
- run: python -m pip install build==1.6.1 twine==7.0.0 pytest==9.1.1
|
|
109
|
+
- name: Confirm approved version
|
|
110
|
+
env:
|
|
111
|
+
APPROVED_VERSION: ${{ inputs.version }}
|
|
112
|
+
run: python -c "import os,tomllib; assert tomllib.load(open('pyproject.toml','rb'))['project']['version'] == os.environ['APPROVED_VERSION']"
|
|
113
|
+
- run: python -m pytest
|
|
114
|
+
- run: python -m build
|
|
115
|
+
- run: python -m twine check --strict dist/*
|
|
116
|
+
- run: python tools/check_dist.py dist
|
|
117
|
+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
|
|
118
|
+
with:
|
|
119
|
+
name: approved-pypi-artifacts
|
|
120
|
+
path: dist/*
|
|
121
|
+
if-no-files-found: error
|
|
122
|
+
publish:
|
|
123
|
+
needs: build
|
|
124
|
+
runs-on: ubuntu-latest
|
|
125
|
+
environment: pypi
|
|
126
|
+
permissions:
|
|
127
|
+
id-token: write
|
|
128
|
+
steps:
|
|
129
|
+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
|
|
130
|
+
with:
|
|
131
|
+
name: approved-pypi-artifacts
|
|
132
|
+
path: dist
|
|
133
|
+
- uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Do not dispatch the workflow until publication is explicitly authorized. Obtain
|
|
137
|
+
the owner's approval of the exact source commit and version first. Manual-only
|
|
138
|
+
dispatch does not technically prevent a repository user with sufficient access
|
|
139
|
+
from initiating publication; the environment restricts the deployment ref only. See
|
|
140
|
+
[PyPI's pending-publisher instructions](https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/)
|
|
141
|
+
and [environment restrictions](https://docs.pypi.org/trusted-publishers/adding-a-publisher/).
|
|
142
|
+
|
|
143
|
+
## Public verification after publication (G12)
|
|
144
|
+
|
|
145
|
+
Before publication, G12 and `PUBLIC_PYPI_INSTALL` must remain **NOT_RUN**. Local
|
|
146
|
+
wheels and GitHub installs cannot satisfy this gate.
|
|
147
|
+
|
|
148
|
+
After approval and upload, use a new environment and the real public index:
|
|
149
|
+
|
|
150
|
+
```powershell
|
|
151
|
+
pipx install truth-firewall
|
|
152
|
+
pipx list
|
|
153
|
+
truth-firewall --version
|
|
154
|
+
truth-firewall --help
|
|
155
|
+
truth-firewall demo
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Confirm the installed distribution identity, version, dependencies and bundled
|
|
159
|
+
fixtures against the approved artifact; then repeat unreviewed blocking, activation,
|
|
160
|
+
review invalidation and a bounded real task. Independently download the PyPI wheel
|
|
161
|
+
and compare its SHA-256 to the approved upload. Only then remove the planned-command
|
|
162
|
+
label from README/QUICKSTART and claim verified public PyPI installation.
|
|
163
|
+
|
|
164
|
+
Review and hashing do not solve omitted natural-language requirements, stale-target
|
|
165
|
+
or incomplete acceptance checks, malicious same-user rewriting of contract/digest,
|
|
166
|
+
or legacy metadata-removal ambiguity. Preserve those existing limitations.
|