A Byte Cap and Secret Gate Before You Send an OSS Patch to a Free Model
Описание и применение
Скрипт ctxpack.py создает ограниченный по размеру и очищенный от секретов пакет контекста, который отправляется модели для обзора, предотвращая утечку данных и перегрузку модели.
Задача
Maintainers receive large, noisy, or secret‑containing context bundles that prevent effective model review.
Результат
The bundle is bounded, redacted, and fails closed if secrets persist, preventing accidental leakage and ensuring the model receives a concise, relevant context.
Рабочий процесс
- 1. Run ctxpack.py with repo path, output path, max_bytes, and test_log arguments.
- 2. ctxpack.py collects repo state, unified diff, and tail of test log.
- 3. It applies regex patterns to redact secrets and rejects the bundle if high‑confidence secrets remain.
- 4. It truncates the bundle to the specified byte limit.
- 5. The resulting bundle is sent to the model for review.
Доказательства
A byte cap and a secret gate catch all three before any network call. Both run locally. Both fail closed.
ctxpack.py collects repo state, a unified diff, and the tail of a test log. It redacts known secret shapes. It refuses to write a bundle if a high‑confidence secret pattern survives. It then truncates to an exact byte limit.
- Дата записи: 2026-10-18T08:41:24.148Z