Repository navigation
security: untrack .tj/config.toml (removes leaked ingest_secret from repo) - #145
Merged
Merged
Conversation
…repo) `.tj/config.toml` was committed at v0.2.0 (a9173b8) and has been tracked through every release since. The file contains a real `ingest_secret` that is publicly readable in the git repo (not in the PyPI wheel — `packages = ["tokenjam"]` excludes the workspace directory, but the git exposure is the issue). `.gitignore:43` already lists `.tj/` — that rule didn't retroactively untrack the already-committed file. This removes the file from the index while keeping the local working copy so existing installs keep running. ## Blast radius The leaked value is an `ingest_secret`, the bearer token that protects `POST /api/v1/spans` on a local `tj serve`. It's per-install, network-only. Worst case: someone on the same network as a daemon configured with this exact secret could push fabricated spans to that daemon. There's no data-exfil path; the secret doesn't unlock anything beyond span ingest. ## What this PR does - `git rm --cached .tj/config.toml` (file removed from index, kept locally) - Future `git clone` will not carry the file → `tj onboard` works on fresh clones again ## What this PR does NOT do - The secret remains in git history and in published tags (v0.2.0 through v0.3.5). Rewriting that history would invalidate every release tag and break every fork; the cost outweighs the benefit given the limited blast radius above. - This is not a CVE. The secret was the project author's local dev install secret, not a customer credential. ## Action required of anyone who reused this secret If you happened to copy the committed config (unlikely but possible), generate a fresh value: `python3 -c "import secrets; print(secrets.token_hex(32))"` and update your local `~/.config/tj/config.toml` and `.tj/config.toml`. Reported by @ashwmu in #141 (finding #6). Co-Authored-By: ashwmu <[email protected]> Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This was referenced Jun 18, 2026
Merged
HoomanDgtl
pushed a commit
to HoomanDigital/tokenjam
that referenced
this pull request
Jun 20, 2026
Two prevention measures distilled from this week's repeated near-misses: 1. CLAUDE.md gets a new "Working with concurrent agents" section right after Build & Development. It explains the worktree pattern, the collision symptom (a commit on a branch you didn't intend, caused by another agent's HEAD being the checked-out one), and the safe recovery (rebase off, don't force-push). 2. New Critical Rule 20 documenting that `.tj/config.toml` is untracked and must stay that way (live per-install ingest_secret, regenerated at runtime). 3. New CI test `tests/unit/test_no_tracked_dev_secrets.py` that fails loud with a fix command if anyone re-stages `.tj/config.toml`. Cheap guard against the v0.2.0 → v0.3.5 leak (PR Metabuilder-Labs#145 + issue Metabuilder-Labs#141 finding Metabuilder-Labs#6) recurring. Reported by @ashwmu in Metabuilder-Labs#141 finding Metabuilder-Labs#6. The collision pattern surfaced across the Lens UI work, the Reuse analyzer, and the Metabuilder-Labs#141 triage — see the "Working with concurrent agents" section for the recovery playbook. Co-Authored-By: ashwmu <[email protected]> Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
HoomanDgtl
pushed a commit
to HoomanDigital/tokenjam
that referenced
this pull request
Jun 20, 2026
TokenJam v0.4.0 — major release. Significant new product surface beyond the 0.3.x patch cadence: - TokenJam Lens UI rebrand: Overview triage front door, Optimize detail tab, real charts (uPlot, vendored offline), URL-state filters, plan-tier-aware framing on all dollar-bearing surfaces. - Reuse — the 5th analyzer + `tj report --reuse` artifact export (HTML + Markdown skeleton sidecars). - New `core/framing.py` — single source of truth for plan-tier rendering, consumed by both CLI and REST API. - `estimated_recoverable_usd` contract on every savings analyzer (Metabuilder-Labs#111), normalized to a single time basis (Metabuilder-Labs#122) so Overview tiles are directly comparable. - `cache_write_tokens` surfaced through DB → API → CLI → UI (Metabuilder-Labs#149) — fixed the ~91% hidden cost driver on cache-heavy workloads. - Security: `.tj/config.toml` untracked (Metabuilder-Labs#145) + CI guard (`tests/unit/test_no_tracked_dev_secrets.py`). - 17 v0.3.5 post-release findings closed (Metabuilder-Labs#141) + 5 Lens UI bug rounds (Metabuilder-Labs#126-Metabuilder-Labs#136) + onboard `--plan` honored on plain path (Metabuilder-Labs#148). ## Also in this commit **Step 6 in the pre-release checklist** is corrected to match real behavior: `tj report --reuse` with the daemon running exits with the "needs direct database access" hint (workaround: `tj stop`). Long-term fix tracked as Metabuilder-Labs#154 for v0.4.1. **Test outputs committed.** `tests/results/` was gitignored; flipping it so per-release pre-release test logs ship as part of the repo for historical reference. Two v0.4.0 result logs included: the first pass (which surfaced two bugs fixed in PR Metabuilder-Labs#153) and the clean re-run after those fixes landed. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses finding #6 (HIGH, security) in #141.
.tj/config.tomlwas committed at v0.2.0 (commita9173b8) and contains a realingest_secret. The file is publicly readable in the git repo (not in the PyPI wheel, but git is the exposure)..gitignore:43already had.tj/— that rule doesn't retroactively untrack already-committed files.This PR runs
git rm --cached .tj/config.toml(untracks; keeps the local working copy so existing installs keep running). Futuregit clones won't carry the file, sotj onboardworks on fresh clones again.Blast radius
The leaked value is an
ingest_secret— the bearer token protectingPOST /api/v1/spanson a localtj serve. It's per-install, network-only. Worst case: someone on the same network as a daemon configured with this exact secret could push fabricated spans to that daemon. No data exfil. Not a CVE.What this PR does NOT do
security advisory— see blast radius above.Action for anyone who reused the secret
Generate a fresh value:
python3 -c "import secrets; print(secrets.token_hex(32))"and update your local
~/.config/tj/config.tomland.tj/config.toml.Test plan
.tj/config.tomlis no longer in the index post-merge:git ls-files .tj/config.tomlreturns nothing..tj/config.tomlso daemons continue running.Reported by @ashwmu in #141 (finding #6).
🤖 Generated with Claude Code
Co-Authored-By: ashwmu [email protected]