ithrl 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.
Files changed (117) hide show
  1. ithrl-0.1.0/.gitignore +30 -0
  2. ithrl-0.1.0/CHANGELOG.md +80 -0
  3. ithrl-0.1.0/CONTRIBUTING.md +305 -0
  4. ithrl-0.1.0/LICENSE +201 -0
  5. ithrl-0.1.0/PKG-INFO +118 -0
  6. ithrl-0.1.0/README.md +89 -0
  7. ithrl-0.1.0/docs/cli.md +89 -0
  8. ithrl-0.1.0/docs/index.md +23 -0
  9. ithrl-0.1.0/docs/measurements.md +86 -0
  10. ithrl-0.1.0/docs/native-runs.md +150 -0
  11. ithrl-0.1.0/docs/results.md +105 -0
  12. ithrl-0.1.0/docs/third-party-notices.txt +256 -0
  13. ithrl-0.1.0/docs/troubleshooting.md +73 -0
  14. ithrl-0.1.0/pyproject.toml +192 -0
  15. ithrl-0.1.0/src/ithrl/__init__.py +1 -0
  16. ithrl-0.1.0/src/ithrl/__main__.py +6 -0
  17. ithrl-0.1.0/src/ithrl/adapters/__init__.py +49 -0
  18. ithrl-0.1.0/src/ithrl/adapters/_jsonl.py +266 -0
  19. ithrl-0.1.0/src/ithrl/adapters/codex/__init__.py +5 -0
  20. ithrl-0.1.0/src/ithrl/adapters/codex/context.py +204 -0
  21. ithrl-0.1.0/src/ithrl/adapters/codex/decisions.py +224 -0
  22. ithrl-0.1.0/src/ithrl/adapters/codex/discovery.py +60 -0
  23. ithrl-0.1.0/src/ithrl/adapters/codex/parser.py +191 -0
  24. ithrl-0.1.0/src/ithrl/adapters/contracts.py +106 -0
  25. ithrl-0.1.0/src/ithrl/adapters/copilot/__init__.py +5 -0
  26. ithrl-0.1.0/src/ithrl/adapters/copilot/context.py +182 -0
  27. ithrl-0.1.0/src/ithrl/adapters/copilot/decisions.py +294 -0
  28. ithrl-0.1.0/src/ithrl/adapters/copilot/discovery.py +28 -0
  29. ithrl-0.1.0/src/ithrl/adapters/copilot/parser.py +283 -0
  30. ithrl-0.1.0/src/ithrl/adapters/discovery.py +220 -0
  31. ithrl-0.1.0/src/ithrl/adapters/errors.py +52 -0
  32. ithrl-0.1.0/src/ithrl/adapters/registry.py +433 -0
  33. ithrl-0.1.0/src/ithrl/behavior.py +138 -0
  34. ithrl-0.1.0/src/ithrl/calibration.py +434 -0
  35. ithrl-0.1.0/src/ithrl/case/__init__.py +33 -0
  36. ithrl-0.1.0/src/ithrl/case/contracts.py +88 -0
  37. ithrl-0.1.0/src/ithrl/case/evidence.py +169 -0
  38. ithrl-0.1.0/src/ithrl/case/filesystem.py +340 -0
  39. ithrl-0.1.0/src/ithrl/case/source.py +208 -0
  40. ithrl-0.1.0/src/ithrl/case/source_context.py +119 -0
  41. ithrl-0.1.0/src/ithrl/case/source_storage.py +234 -0
  42. ithrl-0.1.0/src/ithrl/case/storage.py +377 -0
  43. ithrl-0.1.0/src/ithrl/cli/__init__.py +968 -0
  44. ithrl-0.1.0/src/ithrl/cli/extract.py +478 -0
  45. ithrl-0.1.0/src/ithrl/cli/native.py +484 -0
  46. ithrl-0.1.0/src/ithrl/cli/output.py +786 -0
  47. ithrl-0.1.0/src/ithrl/cli/paths.py +24 -0
  48. ithrl-0.1.0/src/ithrl/cli/sampled.py +485 -0
  49. ithrl-0.1.0/src/ithrl/cli/sampled_output.py +472 -0
  50. ithrl-0.1.0/src/ithrl/cli/sampled_reduction.py +1036 -0
  51. ithrl-0.1.0/src/ithrl/cli/sampled_session.py +342 -0
  52. ithrl-0.1.0/src/ithrl/cli/shrink.py +523 -0
  53. ithrl-0.1.0/src/ithrl/context.py +465 -0
  54. ithrl-0.1.0/src/ithrl/decisions.py +271 -0
  55. ithrl-0.1.0/src/ithrl/examples/synthetic-trace.json +46 -0
  56. ithrl-0.1.0/src/ithrl/execution/__init__.py +68 -0
  57. ithrl-0.1.0/src/ithrl/execution/budget.py +146 -0
  58. ithrl-0.1.0/src/ithrl/execution/contracts.py +426 -0
  59. ithrl-0.1.0/src/ithrl/execution/preflight.py +346 -0
  60. ithrl-0.1.0/src/ithrl/experiment.py +453 -0
  61. ithrl-0.1.0/src/ithrl/extraction.py +206 -0
  62. ithrl-0.1.0/src/ithrl/measurement.py +315 -0
  63. ithrl-0.1.0/src/ithrl/observations.py +1148 -0
  64. ithrl-0.1.0/src/ithrl/path_safety.py +100 -0
  65. ithrl-0.1.0/src/ithrl/reduce/__init__.py +53 -0
  66. ithrl-0.1.0/src/ithrl/reduce/contracts.py +508 -0
  67. ithrl-0.1.0/src/ithrl/reduce/engine.py +901 -0
  68. ithrl-0.1.0/src/ithrl/reduce/search.py +178 -0
  69. ithrl-0.1.0/src/ithrl/results/__init__.py +49 -0
  70. ithrl-0.1.0/src/ithrl/results/models.py +294 -0
  71. ithrl-0.1.0/src/ithrl/results/storage.py +485 -0
  72. ithrl-0.1.0/src/ithrl/results/summary.py +420 -0
  73. ithrl-0.1.0/src/ithrl/results/validation.py +611 -0
  74. ithrl-0.1.0/src/ithrl/run_state.py +1135 -0
  75. ithrl-0.1.0/src/ithrl/runner/__init__.py +44 -0
  76. ithrl-0.1.0/src/ithrl/runner/codex/__init__.py +17 -0
  77. ithrl-0.1.0/src/ithrl/runner/codex/capability.py +708 -0
  78. ithrl-0.1.0/src/ithrl/runner/codex/configuration.py +529 -0
  79. ithrl-0.1.0/src/ithrl/runner/codex/isolation.py +396 -0
  80. ithrl-0.1.0/src/ithrl/runner/codex/materialize.py +358 -0
  81. ithrl-0.1.0/src/ithrl/runner/codex/policy.py +67 -0
  82. ithrl-0.1.0/src/ithrl/runner/codex/protocol.py +649 -0
  83. ithrl-0.1.0/src/ithrl/runner/codex/protocol_contracts.py +171 -0
  84. ithrl-0.1.0/src/ithrl/runner/codex/runner.py +533 -0
  85. ithrl-0.1.0/src/ithrl/runner/codex/runtime_configuration.py +264 -0
  86. ithrl-0.1.0/src/ithrl/runner/codex/schema.py +527 -0
  87. ithrl-0.1.0/src/ithrl/runner/codex/transcript.py +130 -0
  88. ithrl-0.1.0/src/ithrl/runner/codex/worker.py +175 -0
  89. ithrl-0.1.0/src/ithrl/runner/contracts.py +419 -0
  90. ithrl-0.1.0/src/ithrl/runner/copilot/__init__.py +18 -0
  91. ithrl-0.1.0/src/ithrl/runner/copilot/capability.py +825 -0
  92. ithrl-0.1.0/src/ithrl/runner/copilot/configuration.py +201 -0
  93. ithrl-0.1.0/src/ithrl/runner/copilot/isolation.py +374 -0
  94. ithrl-0.1.0/src/ithrl/runner/copilot/materialize.py +484 -0
  95. ithrl-0.1.0/src/ithrl/runner/copilot/policy.py +110 -0
  96. ithrl-0.1.0/src/ithrl/runner/copilot/protocol/__init__.py +18 -0
  97. ithrl-0.1.0/src/ithrl/runner/copilot/protocol/contracts.py +74 -0
  98. ithrl-0.1.0/src/ithrl/runner/copilot/protocol/decoding.py +93 -0
  99. ithrl-0.1.0/src/ithrl/runner/copilot/protocol/parser.py +418 -0
  100. ithrl-0.1.0/src/ithrl/runner/copilot/protocol/state.py +130 -0
  101. ithrl-0.1.0/src/ithrl/runner/copilot/runner.py +425 -0
  102. ithrl-0.1.0/src/ithrl/runner/copilot/worker.py +351 -0
  103. ithrl-0.1.0/src/ithrl/runner/evidence.py +345 -0
  104. ithrl-0.1.0/src/ithrl/runner/fake.py +107 -0
  105. ithrl-0.1.0/src/ithrl/runner/registry.py +90 -0
  106. ithrl-0.1.0/src/ithrl/runner/runtime/__init__.py +50 -0
  107. ithrl-0.1.0/src/ithrl/runner/runtime/contracts.py +157 -0
  108. ithrl-0.1.0/src/ithrl/runner/runtime/output.py +184 -0
  109. ithrl-0.1.0/src/ithrl/runner/runtime/process.py +954 -0
  110. ithrl-0.1.0/src/ithrl/runner/runtime/protection.py +562 -0
  111. ithrl-0.1.0/src/ithrl/runner/runtime/state.py +282 -0
  112. ithrl-0.1.0/src/ithrl/runner/validation.py +376 -0
  113. ithrl-0.1.0/src/ithrl/sampling.py +412 -0
  114. ithrl-0.1.0/src/ithrl/statistics.py +276 -0
  115. ithrl-0.1.0/src/ithrl/synthetic.py +511 -0
  116. ithrl-0.1.0/src/ithrl/timestamps.py +26 -0
  117. ithrl-0.1.0/src/ithrl/workflow.py +570 -0
ithrl-0.1.0/.gitignore ADDED
@@ -0,0 +1,30 @@
1
+ # Python environments and caches
2
+ .venv/
3
+ __pycache__/
4
+ *.py[cod]
5
+ .pytest_cache/
6
+ .ruff_cache/
7
+ .hypothesis/
8
+ .pyrefly/
9
+ .coverage
10
+ .coverage.*
11
+ htmlcov/
12
+
13
+ # Build artifacts
14
+ build/
15
+ dist/
16
+ *.egg-info/
17
+
18
+ # Local configuration and secrets
19
+ /.local/
20
+ .env
21
+ .env.*
22
+ !.env.example
23
+
24
+ # Local ithrl evidence and runtime data
25
+ .ithrl/
26
+ *.ithrl
27
+ *.sqlite
28
+ *.sqlite-journal
29
+ *.sqlite-shm
30
+ *.sqlite-wal
@@ -0,0 +1,80 @@
1
+ # CHANGELOG
2
+
3
+ <!-- version list -->
4
+
5
+ ## v0.1.0 (2026-10-17)
6
+
7
+ ### Bug Fixes
8
+
9
+ - **adapters**: Detect saved session formats structurally
10
+ ([`c8256b9`](https://github.com/eberkut/ithrl/commit/c8256b93ce79fb9c3f025e2b92a970f336497218))
11
+
12
+ - **reduce**: Validate native candidates before sampled dispatch
13
+ ([`90d4c0d`](https://github.com/eberkut/ithrl/commit/90d4c0d11a206389d44c6a59991df53c19802514))
14
+
15
+ - **runner**: Clarify Codex isolation prerequisites
16
+ ([`4a409c1`](https://github.com/eberkut/ithrl/commit/4a409c1f37caf301a00cfbd20d3a95cf15844eb9))
17
+
18
+ ### Features
19
+
20
+ - Establish credential-free context reduction core
21
+ ([`c517409`](https://github.com/eberkut/ithrl/commit/c517409c06e40c92b24a8b990685abd4acc9a9ba))
22
+
23
+ - **adapters**: Parse Codex and Copilot session evidence
24
+ ([`3b81c26`](https://github.com/eberkut/ithrl/commit/3b81c2607397d884bcfb1b19dbf995f66ccb0107))
25
+
26
+ - **calibration**: Add bounded sampled runner calibration
27
+ ([`f9db180`](https://github.com/eberkut/ithrl/commit/f9db18012565badc2cf2a3a4a6158487d4c5fb70))
28
+
29
+ - **case**: Preserve immutable native source evidence
30
+ ([`d108b96`](https://github.com/eberkut/ithrl/commit/d108b96487ccb69f6b36642ae331d36272038722))
31
+
32
+ - **cli**: Add an installed example and focused public guides
33
+ ([`1efc2ff`](https://github.com/eberkut/ithrl/commit/1efc2ffb03c734b666b1d1da9b5610ad62970267))
34
+
35
+ - **cli**: Add guarded native calibration
36
+ ([`06d2bfb`](https://github.com/eberkut/ithrl/commit/06d2bfb3f4d34f4dc845d9d6877257e4e79f9120))
37
+
38
+ - **cli**: Integrate sampled reduction and exact resume
39
+ ([`40be766`](https://github.com/eberkut/ithrl/commit/40be7664ba90ac5341d93fb5a725dbfa0efd48d3))
40
+
41
+ - **extract**: Support ordinary Codex and Copilot sessions
42
+ ([`3cd0c10`](https://github.com/eberkut/ithrl/commit/3cd0c1092aeb3669b86fdae07e887d28ba9d685f))
43
+
44
+ - **reduce**: Add sampled contracts and durable progress
45
+ ([`650252d`](https://github.com/eberkut/ithrl/commit/650252d76e8d7d72f3f5715ecaf488e752dc18b1))
46
+
47
+ - **reduce**: Integrate sampled candidate search
48
+ ([`72958d8`](https://github.com/eberkut/ithrl/commit/72958d8d6ae0307ca2d090a2a10d02606bafdea6))
49
+
50
+ - **runner**: Add Codex final-response execution
51
+ ([`ad30a9a`](https://github.com/eberkut/ithrl/commit/ad30a9a17b0e665056eca9b415cbf4e2770a7bf7))
52
+
53
+ - **runner**: Add controlled Copilot execution
54
+ ([`c9d1bb2`](https://github.com/eberkut/ithrl/commit/c9d1bb23bfdd98bb022fd0b62ca9b8a81021fe4b))
55
+
56
+ - **runner**: Add isolated execution runtime
57
+ ([`17d2224`](https://github.com/eberkut/ithrl/commit/17d22240414cdb32d4464f16e7b2621d99729ca0))
58
+
59
+ - **runner**: Add shared execution foundation
60
+ ([`89536e9`](https://github.com/eberkut/ithrl/commit/89536e919730fc0abf680a2928a89761c78339f5))
61
+
62
+ - **runner**: Validate isolated native calibration
63
+ ([`b0cd438`](https://github.com/eberkut/ithrl/commit/b0cd438d1fa280f0ddafa39d23653a7ac926da1b))
64
+
65
+ - **sampling**: Collect bounded fresh-baseline blocks
66
+ ([`16abf30`](https://github.com/eberkut/ithrl/commit/16abf30b964eae299177d1e1dade6f545ffbda31))
67
+
68
+ - **sampling**: Support paced execution and safe overload replacement
69
+ ([`5d70fbd`](https://github.com/eberkut/ithrl/commit/5d70fbd26901a0574883e07fd4055644c8515e80))
70
+
71
+ - **statistics**: Add fixed-sample candidate classification
72
+ ([`fb26fca`](https://github.com/eberkut/ithrl/commit/fb26fcaf7c064f49ac7d63b4e2ceb1ab3d6dcdb5))
73
+
74
+ - **workflow**: Confirm sampled reductions with fresh evidence
75
+ ([`ee291e4`](https://github.com/eberkut/ithrl/commit/ee291e4d906394452da61640989cef594f62caf7))
76
+
77
+ ### Refactoring
78
+
79
+ - Simplify execution paths and avoid redundant context copies
80
+ ([`34ab361`](https://github.com/eberkut/ithrl/commit/34ab36165fed08678a80679b3f1753e6f26f63f8))
@@ -0,0 +1,305 @@
1
+ # Contributing
2
+
3
+ Start with an [issue](https://github.com/eberkut/ithrl/issues) describing the problem or proposed
4
+ change. Pull requests are limited to collaborators; discuss the work before preparing one.
5
+
6
+ For bug reports, include the ithrl version, platform, sanitized error code and steps to reproduce.
7
+ Keep full sessions, cases, proprietary source and credentials out of public reports. Report
8
+ suspected vulnerabilities through [private vulnerability reporting](https://github.com/eberkut/ithrl/security/advisories/new).
9
+
10
+ ## Development setup
11
+
12
+ Use [uv](https://docs.astral.sh/uv/) and Python 3.12, 3.13 or 3.14. Python 3.14 is the primary
13
+ development version. From the repository root:
14
+
15
+ ```bash
16
+ uv sync --locked --all-groups
17
+ uv run ithrl --help
18
+ ```
19
+
20
+ The [bundled example](README.md#try-it) also works from a checkout; prefix `ithrl` commands with
21
+ `uv run`. It does not depend on test fixtures.
22
+
23
+ ## Checks
24
+
25
+ Run the same entry points used by CI:
26
+
27
+ ```bash
28
+ uv lock --check
29
+ uv run ruff check .
30
+ uv run ruff format --check .
31
+ uv run pyrefly check
32
+ uv run pytest --ignore=tests/packaging
33
+ uv run radon cc src/ithrl --min B --show-complexity --total-average
34
+ uv run radon mi src/ithrl --min B --show
35
+ uv build --sdist --wheel --no-sources
36
+ ITHRL_DIST_DIR=dist uv run pytest -o addopts= tests/packaging
37
+ ```
38
+
39
+ Non-packaging tests and the synthetic example need no provider credentials or network requests.
40
+ Packaging checks may download build and runtime dependencies. Radon reports are review signals.
41
+
42
+ CI runs tests, dependency audits and installed-package checks on Python 3.12–3.14. It builds one
43
+ wheel/sdist pair; every Python version tests that wheel and rebuilds and installs a wheel from the
44
+ sdist outside the checkout. Version output must match artifact metadata. To test a local wheel as
45
+ an isolated tool, pass its path to `uv tool install` or `pipx install`.
46
+
47
+ For local matrix runs, set `UV_PYTHON` on every command. Use separate environments, test caches and
48
+ coverage files for parallel runs; otherwise run versions sequentially.
49
+
50
+ ## Workflow and dependency checks
51
+
52
+ For GitHub Actions or Dependabot changes, use the jactionlint release pinned in
53
+ [CI](.github/workflows/ci.yml):
54
+
55
+ ```bash
56
+ jactionlint --no-online --strict-exit
57
+ ```
58
+
59
+ CI uses its default correctness/security profile, with online lookups and automatic fixes disabled.
60
+
61
+ Audit the resolved runtime dependencies and every dependency group, including development, docs
62
+ and audit tooling, from `uv.lock`. Run this in Bash with the locked environment synchronized:
63
+
64
+ ```bash
65
+ set -o pipefail
66
+ uv export --locked --all-groups --no-emit-project --format requirements.txt |
67
+ uv run --locked --group audit pip-audit --strict --disable-pip --require-hashes -r /dev/stdin
68
+ ```
69
+
70
+ The hashed export is temporary pipeline input. The audit queries PyPI's vulnerability service for
71
+ package names and versions without installing those packages, resolving alternatives or applying
72
+ fixes. CI evaluates markers on each supported Python version. This covers locked versions rather
73
+ than every version permitted by package dependency ranges.
74
+
75
+ GitHub's dependency graph and Dependency Review use the inventory GitHub has for each commit.
76
+ Before relying on them for `uv.lock` coverage, compare the hosted package/version inventory with
77
+ the locked export on each supported Python version. The PR dependency-review job rejects newly
78
+ introduced known vulnerabilities at any severity across runtime, development and unknown scopes.
79
+ It uses a read-only token and does not check out or execute PR code. If it reports incomplete
80
+ dependency snapshots, wait for GitHub's graph update and rerun the job. No license allowlist is
81
+ enforced by this check. Keep the lockfile audit above as the full-inventory CI gate; Dependabot
82
+ version updates alone do not establish dependency-graph coverage.
83
+
84
+ CI runs weekly on Monday at 06:17 UTC to detect new advisories. Dependabot checks Python, Actions
85
+ and pre-commit dependencies weekly, groups minor/patch updates and leaves majors individually
86
+ reviewable. Ordinary updates have a seven-day cooldown; security updates have none. Updates are
87
+ never automatically merged. Hosted dependency-graph coverage is a separate verification gate.
88
+
89
+ ## Documentation
90
+
91
+ README owns the quick start; `docs/` owns user guides and reference. Support, security and conduct
92
+ policies live at the repository root. Keep private sessions, cases and credentials out of
93
+ documentation and generated output.
94
+
95
+ The optional `docs` dependency group pins MkDocs and the shadcn theme. Search runs in the browser;
96
+ fonts and scripts are served with the site. GitHub star-count requests and raw Markdown copying
97
+ are disabled. A local hook admits only the packaged theme assets used by this configuration.
98
+ When changing the theme or enabled extensions, check that asset list and the
99
+ [third-party notices](docs/third-party-notices.txt) alongside the rendered site.
100
+ To preview the site locally:
101
+
102
+ ```bash
103
+ uv sync --locked --all-groups
104
+ uv run --group docs mkdocs serve
105
+ ```
106
+
107
+ `mkdocs.yml` admits only the named public files under `docs/`. When adding a page, update its
108
+ navigation and file allowlist, the sdist include list in `pyproject.toml`, and the documentation
109
+ manifests in the documentation and packaging tests. Never set `docs_dir` to the repository root.
110
+
111
+ After changing CLI options or help, regenerate the committed reference with Typer:
112
+
113
+ ```bash
114
+ uv run typer ithrl.cli utils docs --name ithrl --title 'CLI reference' --output docs/cli.md
115
+ ```
116
+
117
+ Generation reads command metadata without invoking the commands. Verify reference drift,
118
+ publication boundaries, issue forms, page links and anchors with:
119
+
120
+ ```bash
121
+ uv run pytest -o addopts= tests/unit/test_documentation.py -q
122
+ uv run --group docs mkdocs build --strict
123
+ ```
124
+
125
+ Build output stays in ignored `.local/site/`. Strict builds validate local documentation links;
126
+ they do not verify remote URL availability.
127
+
128
+ The [documentation workflow](.github/workflows/pages.yml) builds and deploys
129
+ `https://eberkut.github.io/ithrl/` on pushes to `main`, or when a maintainer runs it manually
130
+ from `main`. It checks the documentation before uploading only the generated site. Deployment
131
+ runs in a separate `github-pages` environment job without checking out or executing project code.
132
+ Pull requests receive read-only documentation checks through CI and cannot deploy.
133
+
134
+ Repository administrators must select **Settings → Pages → Source: GitHub Actions** and restrict
135
+ the `github-pages` environment to `main` before the first deployment. No custom domain, separate
136
+ site repository, `gh-pages` branch or personal access token is needed. After a successful
137
+ deployment, check the published pages, navigation and static assets at the URL above.
138
+
139
+ ## Credential-free integration tests
140
+
141
+ The sampled CLI tests exercise calibration, search, fresh confirmation, observations, result
142
+ publication and exact resume with a mock runner:
143
+
144
+ ```bash
145
+ uv run pytest -o addopts= tests/integration/test_sampled_cli.py -q
146
+ ```
147
+
148
+ Mock-native tests exercise the three current native target profiles through isolated mock harness
149
+ processes. They cover context-sensitive reduction, immutable inputs, action denial, cleanup,
150
+ accounting and budget refusal:
151
+
152
+ ```bash
153
+ uv run pytest -o addopts= tests/integration/test_native_calibration.py -q
154
+ ```
155
+
156
+ These tests establish local contracts. Native qualification is recorded in the
157
+ [measurement notes](docs/native-runs.md#compatibility-and-measurements).
158
+
159
+ ## Opt-in native smoke tests
160
+
161
+ Profiles are `codex-final`, `copilot-final` and `copilot-shell`. They are skipped by default and
162
+ refuse opt-in when `CI` or `GITHUB_ACTIONS` is set. Live mode makes real model requests.
163
+
164
+ Use a private evidence parent outside the checkout and existing harness authentication. The
165
+ installed harness and Bubblewrap must pass isolation/capability checks. Never put credentials in
166
+ arguments or case content. Inspect the exact profile, model, provider and limits before execution.
167
+
168
+ Start with structural preflight, which runs bounded local probes with network denied and no model
169
+ turn. The host filesystem and harness executable are read-only; only private disposable state is
170
+ writable:
171
+
172
+ ```bash
173
+ uv run pytest -o addopts= tests/live -m native_smoke -s \
174
+ --native-smoke preflight --native-profile PROFILE \
175
+ --native-model MODEL --native-provider PROVIDER \
176
+ --native-smoke-root /absolute/private/evidence-parent
177
+ ```
178
+
179
+ Inspect the printed plan and private `preflight.json`. To authorize provider execution, use its
180
+ exact capability digest. For Copilot, `PROVIDER` must be `github-copilot`:
181
+
182
+ ```bash
183
+ uv run pytest -o addopts= tests/live -m native_smoke -s \
184
+ --native-smoke run --native-profile PROFILE \
185
+ --native-model MODEL --native-provider PROVIDER \
186
+ --native-smoke-root /absolute/private/evidence-parent \
187
+ --native-capability-digest APPROVED_DIGEST
188
+ ```
189
+
190
+ Every invocation creates fresh private state, harmless session content and an empty original
191
+ workspace. Calibration requires two matching attempts and permits at most two, each bounded at
192
+ 120 seconds plus cancellation grace. Final-response profiles allow up to two provider calls;
193
+ Copilot shell allows up to four, with `pwd` visible but denied.
194
+
195
+ Returned actions never execute. Hosted tools, MCP and tool-side network effects remain forbidden.
196
+ An input-token cap cannot be enforced. Private evidence records known counts and unknown
197
+ acceptance explicitly. Unsupported or unsuccessful profiles fail the test without skipping or retrying.
198
+
199
+ ## Preparing a change
200
+
201
+ Keep changes focused and add tests for changed behavior and failure paths. Update the relevant
202
+ user guide when commands or results change. Use Conventional Commit subjects, such as
203
+ `fix(extract): reject conflicting selectors`.
204
+
205
+ Changes to native protocols, reconstruction, permissions or provider accounting need review of
206
+ the affected safety boundary. Mock tests establish local contracts; claims of native support also
207
+ need capability, isolation, calibration and live-use evidence for the target profile.
208
+
209
+ ## Preparing a release
210
+
211
+ Python Semantic Release, pinned in the `release` dependency group, calculates versions from
212
+ Conventional Commits. `pyproject.toml` is the version source; installed CLI and Codex client
213
+ metadata read that distribution version. The tool generates `CHANGELOG.md` from the full release
214
+ history, omitting routine build, CI, documentation, style and test commits. Do not edit the
215
+ generated changelog by hand; review its contents before approving a release.
216
+
217
+ Use `main` with complete history and all existing release tags available. Preview the next version
218
+ without changing files, the index, commits, tags or remote state:
219
+
220
+ ```bash
221
+ uv run --locked --group release semantic-release --noop version --print
222
+ ```
223
+
224
+ The preparation command below writes **and stages** the version and changelog, even with
225
+ `--no-commit`. Obtain approval for those local staging changes before running it. For worktree-only
226
+ review, run it in a disposable checkout and transfer the reviewed file changes. To prepare:
227
+
228
+ ```bash
229
+ uv run --locked --group release semantic-release version \
230
+ --no-commit --no-tag --no-push --no-vcs-release --skip-build
231
+ uv lock --upgrade-package ithrl
232
+ ```
233
+
234
+ The lock update remains unstaged. Review all generated changes, confirm version consistency and
235
+ public-safe release notes, then run the affected checks before proposing the signed commit.
236
+ Preparation creates no commit, tag or hosted release and uploads no package. Publication requires
237
+ separate approval of the source commit, version, artifacts and destinations.
238
+
239
+ ### Publishing a prepared release
240
+
241
+ The manually dispatched [release workflow](.github/workflows/release.yml) uses the existing CI
242
+ workflow to check the exact source commit, build one release wheel/sdist pair and test installation
243
+ on Python 3.12–3.14. It uploads to TestPyPI, waits for production approval, then promotes those
244
+ same distribution bytes to PyPI and GitHub Releases. Ordinary pushes and pull requests do not
245
+ publish packages. No native harness or model request is part of release automation.
246
+
247
+ Before dispatch, the source must be reviewed and committed on `main`, with successful CI and
248
+ the applicable hosted security checks for that commit. Verify account recovery readiness, package
249
+ ownership and the following repository/index settings:
250
+
251
+ - PyPI and TestPyPI Trusted Publishers bind `eberkut/ithrl`, `release.yml` and their respective
252
+ `pypi` / `testpypi` environments. Publishing uses OIDC, without a stored PyPI API token.
253
+ - Both environments admit only `main`. `pypi` requires the maintainer's approval, permits
254
+ self-review and disallows administrative approval bypass. Environment declarations in YAML
255
+ do not configure these protections; verify the actual settings before dispatch.
256
+ - Release-tag rules permit the maintainer's signed-tag creation and prevent unapproved tag
257
+ replacement or deletion. The workflow never creates a tag.
258
+
259
+ The dispatch gate admits the repository's current maintainer identity and requires the full source
260
+ SHA and exact final `X.Y.Z` version. Replace the placeholders with the reviewed values:
261
+
262
+ ```bash
263
+ gh workflow run release.yml --repo eberkut/ithrl --ref main \
264
+ -f version=X.Y.Z -f source-sha=FULL_APPROVED_COMMIT_SHA
265
+ ```
266
+
267
+ 1. Inspect that run's checks and successful **Publish TestPyPI rehearsal** job. Its summary records
268
+ the source, version, immutable artifact ID and checksum-manifest digest. The production job
269
+ waits at the `pypi` environment. TestPyPI files, logs and artifacts are public.
270
+ 2. Download that run's `release-distributions` artifact into a new review directory. For example:
271
+
272
+ ```bash
273
+ gh run download RUN_ID --repo eberkut/ithrl \
274
+ --name release-distributions --dir /absolute/new/release-review
275
+ ```
276
+
277
+ Match `SHA256SUMS` to the digest in the run summary, then run `sha256sum --check SHA256SUMS`
278
+ from the review directory. Inspect the release notes and confirm TestPyPI serves the same
279
+ distribution hashes. Complete a clean TestPyPI installation/example rehearsal before approval;
280
+ resolve dependencies only from the normal PyPI index, without mixing indexes.
281
+ 3. After the rehearsal passes and tag creation is approved, create and verify the signed tag at
282
+ the frozen source commit, then push only that tag through the permitted tag-rules path:
283
+
284
+ ```bash
285
+ git tag -s vX.Y.Z FULL_APPROVED_COMMIT_SHA -m 'Release vX.Y.Z'
286
+ git verify-tag vX.Y.Z
287
+ git push origin refs/tags/vX.Y.Z
288
+ ```
289
+
290
+ 4. Review and approve the `pypi` deployment on the run's GitHub page. The job verifies the existing
291
+ annotated tag targets the frozen source, rechecks the files, and uploads to PyPI. The final job
292
+ rechecks the tag/files and creates the GitHub Release with those distributions, notes and
293
+ checksums. Signature verification belongs to the preceding maintainer tag check; the workflow
294
+ checks the tag object and target commit.
295
+ 5. Verify the published versions, hashes, attestations and installed example. A successful upload
296
+ alone does not complete release acceptance.
297
+
298
+ Complete review within 30 days: release artifacts are retained for 30 days, and GitHub limits the
299
+ total workflow lifetime, including approval waits. Start only one release at a time; concurrency
300
+ preserves the active run but GitHub may replace an older pending run when another is queued.
301
+ Do not rerun the whole workflow to promote a completed rehearsal or cancel a run during upload.
302
+ For failure or partial publication, inspect the index and existing release first; preserve the
303
+ original files and hashes. Any recovery upload needs explicit approval and must use identical
304
+ missing files. Never rebuild and overwrite a published version or suppress conflicts with
305
+ `skip-existing`.
ithrl-0.1.0/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.