Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a9e0b40
Use the keygen default key when no other secret is given
mohanenm Nov 26, 2026
db9cac6
Keep answers to questions and words that only look like fillers in co…
mohanenm Nov 26, 2026
71d0cd0
Reject unknown config keys
mohanenm Nov 26, 2026
210ed40
Describe compression and the placeholder guarantee as the code does
mohanenm Nov 26, 2026
6f45578
Report malformed mapping headers as mapping errors
mohanenm Nov 26, 2026
9d50e49
Escape only ASCII-digit placeholder look-alikes
mohanenm Nov 26, 2026
e5e623f
Check the output before writing the mapping
mohanenm Nov 26, 2026
72475ae
Draw placeholder numbers at random and refuse answers that do not fit…
mohanenm Nov 26, 2026
3d2414d
Keep words next to a fuzzy deny-list match out of its placeholder
mohanenm Nov 26, 2026
101b827
Write nothing when restore --strict fails
mohanenm Nov 26, 2026
68f6b1c
Describe what restore --assume-mapping does
mohanenm Nov 26, 2026
8a32869
Bound regex repeats that went quadratic on long runs
mohanenm Nov 26, 2026
c56e916
Close leaks through combining marks, slashes, function-word names and…
mohanenm Nov 26, 2026
ecebf83
Merge branch 'worktree-agent-a9d7325fd6337d0c3' into review-fixes
mohanenm Nov 26, 2026
69a0426
Merge branch 'worktree-agent-a105a3a63cc2fc0ec' into review-fixes
mohanenm Nov 26, 2026
59dc045
Merge branch 'worktree-agent-ae5b9b37fe51a7a69' into review-fixes
mohanenm Nov 26, 2026
986b8d5
Test strict restore with a headed answer
mohanenm Nov 26, 2026
7e18307
Describe random placeholder numbers and the stricter restore in the docs
mohanenm Nov 26, 2026
d17c4e1
Ask for the passphrase when the default key meets a passphrase mapping
mohanenm Nov 26, 2026
f908868
Add Tier 0 recall and precision floor test
mohanenm Nov 26, 2026
a7e4033
Report text-only precision, redacted business context and a no-deny-l…
mohanenm Nov 26, 2026
cbb96eb
Add the Earnings-21 and ai4privacy scorers so their figures can be re…
mohanenm Nov 26, 2026
4641ae1
Fix the next release check's targets before its sealed set exists
mohanenm Nov 26, 2026
4daec7e
Ship the complete SCOWL copyright notice
mohanenm Nov 26, 2026
02d80a2
Add a script that rebuilds the SCOWL word lists exactly
mohanenm Nov 26, 2026
9ed3e2b
Add lock files for the ner and llm extras
mohanenm Nov 26, 2026
12d8745
ci: add a Tier 1 job and audit the locked extras
mohanenm Nov 26, 2026
1b68e2e
Document the score floors, the Tier 1 job and the extras locks
mohanenm Nov 26, 2026
3b49919
Support an encrypted sealed set and score the spent one as validation2
mohanenm Nov 26, 2026
36f4023
Merge branch 'worktree-agent-ad222223b717ac66a' into review-fixes
mohanenm Nov 26, 2026
2999ac3
Merge branch 'worktree-agent-a9085367f9d128e5e' into review-fixes
mohanenm Nov 26, 2026
50dbe86
Add the next sealed set, encrypted, and guard it in CI
mohanenm Nov 26, 2026
e705f52
Describe the encrypted sealed set and validation2
mohanenm Nov 26, 2026
2b8d5f1
Lead the README and site with the harder sets and current numbers
mohanenm Nov 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 40 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,39 @@ jobs:
/tmp/floor/bin/pip install pytest -c requirements/dev-py310.lock
cd tests && /tmp/floor/bin/python -m pytest -q -p no:cacheprovider test_netguard.py test_no_network.py

# Tier 1: the [ner] extra with the real pinned models, so the model tests run instead of
# skipping. Tier 2 (a 2.5 GB model) is not run in CI.
tier1:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.12"
- run: python -m pip install -e '.[dev,ner]' -c requirements/dev.lock -c requirements/ner.lock
- name: Locate the model store
id: store
run: python -c "from offrecord.models import models_dir; print(f'dir={models_dir()}')" >> "$GITHUB_OUTPUT"
# Keyed on the manifest that pins each model's revision and SHA-256. Files are verified
# again below and before every load, so a stale or altered cache cannot slip through.
- name: Restore Tier 1 models
id: models
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ steps.store.outputs.dir }}
key: tier1-models-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('src/offrecord/models/__init__.py') }}
- name: Download Tier 1 models (setup is the only command allowed to use the network)
if: steps.models.outputs.cache-hit != 'true'
run: offrecord setup models
- name: Every Tier 1 model present and matching its pinned SHA-256
run: |
python -c "import sys; from offrecord import models as m; sys.exit(not all(m.installed(n, verify=True) for n in m.TIER1_DEFAULT))"
- run: mypy
- run: pytest -q

build:
runs-on: ubuntu-latest
timeout-minutes: 10
Expand Down Expand Up @@ -116,7 +149,11 @@ jobs:
with:
python-version: "3.12"
- run: python -m pip install pip-audit -c requirements/dev.lock
# The lock files pin every transitive dependency, so --no-deps still covers all of them.
# PYSEC-2026-2447: diskcache (via llama-cpp-python) unpickles its cache files and has no
# fixed release; offrecord never enables that cache (docs/security.md, R9).
- name: Known vulnerabilities in pinned dependencies, including the optional extras
run: |
python -c "import tomllib; e = tomllib.load(open('pyproject.toml', 'rb'))['project']['optional-dependencies']; print('\n'.join(e['ner'] + e['llm']))" > /tmp/extras.txt
pip-audit --strict --no-deps --disable-pip -r requirements/dev.lock -r /tmp/extras.txt
run: >-
pip-audit --strict --no-deps --disable-pip
-r requirements/dev.lock -r requirements/ner.lock -r requirements/llm.lock
--ignore-vuln PYSEC-2026-2447
52 changes: 51 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ All notable changes. Format based on Keep a Changelog. Versions are unreleased u
## [Unreleased]

### Added
- `offrecord eval` reports character precision on turn text alone (`prec(text)`; speaker
labels inflated the old figure), the share of business context actually redacted rather
than only flagged, the must-not-redact hit rate, and a `--no-denylist` run, which is what a
new user gets before `init`.
- `scripts/earnings21_eval.py` and `scripts/ai4privacy_eval.py` score the two outside datasets
quoted in the README; `scripts/build_wordlists.py` rebuilds the bundled word lists from SCOWL.
- The next sealed set is stored encrypted (`eval/sealed/`, offrecord's own format) with its key
held outside the repository; `eval --set sealed --final-check --key-file KEY` scores it. The
first sealed set is spent and is now scored as `validation2`. The targets for the next
release check are fixed in `docs/eval-format.md` before that set is written.
- A test fails if Tier 0 PII recall or precision falls below fixed floors, and a CI job runs
the Tier 1 models; lock files now cover the `[ner]` and `[llm]` extras.
- `offrecord review --draft-labels -o FILE` writes a transcript as inline markup pre-filled
with offrecord's redactions, for labelling your own transcripts privately
(`docs/private-eval.md`).
Expand Down Expand Up @@ -46,7 +58,8 @@ All notable changes. Format based on Keep a Changelog. Versions are unreleased u
`--mapping-scope project` / `--mapping-in` to share placeholders across transcripts.
- Encrypted mapping (Fernet; scrypt N=2^17 or key file) in a private per-user store; `restore`
tolerant of LLM-mangled placeholders, with wrong-mapping detection; `keygen`.
- Compression: `light` (default) and `medium`; never drops or alters a placeholder.
- Compression: `light` (default) and `medium`; never alters a placeholder or drops its last
occurrence.
- Opt-in encrypted audit log (`--audit`) and `audit` command; `review` side-by-side view with
missed-label highlighting and deny-list suggestions.
- Evaluation: seeded synthetic generator, tuning set, frozen independently written held-out set,
Expand Down Expand Up @@ -105,7 +118,44 @@ All notable changes. Format based on Keep a Changelog. Versions are unreleased u
sensitive.

### Fixed
- The bundled SCOWL licence was cut off partway; the full notice now ships.
- A mapping made with a passphrase asks for the passphrase even when the default key exists.
- Restore no longer writes wrong names into an LLM's answer. Placeholder numbers are drawn at
random per mapping (`<P417>`, not `<P1>`), a bare token needs three digits (an answer's own
"P1 incident" or "L2 support" stays), and header-less text holding a placeholder the mapping
lacks is refused, so `unpaste` with the most recent mapping cannot fill in another call's
names.
- A titled name ("Mr. Whitfield") no longer takes a speaker's identity, so restore cannot turn a
speaker's husband into the speaker.
- A fuzzy deny-list match no longer swallows the words next to it ("that Glimmerforge pays"
became one placeholder, and restore put the extra words back).
- Leaks closed: names, cards and SSNs with a combining mark on each character, identifiers
written with slashes or underscores (`987/65/4321`, `4111_1111_1111_1111`), function-word
names after an introduction or as a speaker ("my name is Will", "thanks May"), and names in
the `--prompt` instruction, which now reuse the transcript's placeholders.
- "$300 baseline" no longer redacts part of "baseline"; negative token savings read "more".
- The embedding model used by `--compress aggressive` is now checksum-verified before loading,
like the other models.
- A long chain of spoken numbers can no longer make the quantity rules take minutes.
- Compression no longer drops a one-word answer to a question ("Is the budget approved?" /
"Right.") at any level, and no longer deletes words that only look like fillers or
stutters: "ER" and "MM" in capitals, "mm" after a number, a hyphenated prefix such as
"pre-" in "pre- and post-merger", and grammatical doubles such as "that that" and "had had".
- The key written by `offrecord keygen` is now used when no `--key-file`, `OFFRECORD_KEY_FILE`
or `OFFRECORD_PASSPHRASE` is given, as the README's round trip assumed; before, it was
written but never read. offrecord says on stderr when it uses it.
- Unknown config keys, at the top level, in `topics`, `detect` and `models` and in deny-list
entries, are now an error instead of being ignored: `protekt: confidential` used to run
with business context left readable. A near miss of a known key gets a suggestion.
- A mapping or audit file with a malformed header (a non-numeric version, key-derivation
settings that are not a mapping or lack a parameter) now fails with E_MAPPING instead of an
internal error.
- Source text that looks like a placeholder but uses non-ASCII digits (Arabic-Indic, for
example) is no longer escaped, so it comes back unchanged after restore.
- `redact` checks its output destination (an existing file without `--force`, a missing or
read-only directory) before it writes the mapping, and points `last-mapping` at a new
mapping only after the output is written. A refused output used to leave an orphaned
mapping that `unpaste` would then pick.
- `restore --strict` and `unpaste --strict` write nothing (no file, stdout or clipboard) when
they fail; they used to write the partly restored text and then exit 5.
- The README no longer says `restore --assume-mapping` asks for confirmation; it never did.
13 changes: 10 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ python3 -m venv .venv
.venv/bin/pip install -e '.[dev]' -c requirements/dev.lock # Python 3.10: requirements/dev-py310.lock
```

The optional model tiers need `pip install -e '.[ner,llm]'` and `offrecord setup models`
(and `--tier 2` for the LLM). Tests that need real models skip when the models are absent.
The optional model tiers need `pip install -e '.[dev,ner,llm]' -c requirements/dev.lock -c
requirements/ner.lock -c requirements/llm.lock` and `offrecord setup models` (and `--tier 2` for
the LLM). Tests that need real models skip when the models are absent.

## Before every commit

Expand All @@ -20,7 +21,13 @@ The optional model tiers need `pip install -e '.[ner,llm]'` and `offrecord setup
```

CI runs the same checks on every supported Python version, plus a Tier 0 job with no extras
installed and a check that no local-only file is tracked (`scripts/check_hygiene.py`).
installed and a check that no local-only file is tracked (`scripts/check_hygiene.py`). A Tier 1
job installs the `[ner]` extra and the pinned models on Python 3.12 and runs the whole suite, so
the model tests run there instead of skipping. Tier 2 is not run in CI.

`tests/test_recall_floor.py` fails if Tier 0 recall or precision on `tuning` and `validation`
falls below fixed floors (`docs/eval-format.md` lists them). Raise a floor when the scores rise
for good; lowering one needs a reason in the pull request.

Keep commits small, one logical change each, with a short imperative message ("Handle spoken
percent ranges", not "Updated business.py"). Stage files by path, not with `git add -A`.
Expand Down
Loading