Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
24dd34b
chore: normalize line endings to LF + add .gitattributes (L8 hygiene)
fyaz05 Sep 6, 2026
3066f3d
feat(P1): pinned deps + pyproject + quality CI gates + repo hygiene (…
fyaz05 Sep 6, 2026
245dec6
fix(H9): shell-free, non-destructive self-update
fyaz05 Sep 6, 2026
094ae68
feat(P2-P5): implement the FileToLink improvement plan (H2-H10, M1-M1…
fyaz05 Sep 6, 2026
0c4a2c6
test(H2, L9): pytest scaffolding + unit tier (103 tests) + integratio…
fyaz05 Sep 6, 2026
6fcff3a
refactor(H4): finish FloodWait migration (force_channel, clients) — 9…
fyaz05 Sep 6, 2026
d3dda05
recheck: close audit gaps — real fixes + permanent gates
fyaz05 Sep 6, 2026
11c75c6
audit: fix 30+ verified defects from 8-agent branch review
fyaz05 Sep 6, 2026
2dcda94
fix(security): resolve CodeQL alerts on PR diff
fyaz05 Sep 6, 2026
5c5d311
fix(security): percent-encode activation token in t.me redirect
fyaz05 Sep 6, 2026
8f9fea7
fix(security): constant-prefix concat for activate redirect
fyaz05 Sep 6, 2026
2db0c3b
audit: 8-agent second-pass fixes — verified defects + leanness
fyaz05 Sep 6, 2026
88815ff
fix(critical): naive/aware datetime crash on token activation + malfo…
fyaz05 Sep 6, 2026
855b775
fix(major): review findings across self-heal, gates, breaker, boot an…
fyaz05 Sep 6, 2026
42fd3a8
fix(infra): Makefile tabs, hash-pinned Docker install, CI sync gates …
fyaz05 Sep 6, 2026
43914ee
test: preflight chain, env-layer precedence, self-heal + transport re…
fyaz05 Sep 6, 2026
b5e83fb
fix(data): TTL backfill via supported _id-paged batches + lifecycle i…
fyaz05 Sep 6, 2026
78c02e5
fix(security): close raw-path access-log sink, drop capability-hash l…
fyaz05 Sep 6, 2026
4126b07
refactor(lean): finish dead-code sweep from the recheck pass
fyaz05 Sep 6, 2026
52e54cf
chore(infra/docs): hermetic test tier, CI lint scope, Makefile consis…
fyaz05 Sep 6, 2026
398e395
fix(security): single-pass path pseudonymization + regression tests
fyaz05 Sep 6, 2026
9ff46b1
build: enable mypy check_untyped_defs; fix the 5 latent defects it finds
fyaz05 Sep 6, 2026
1927e6b
docs: document the anonymous-sender deny rule (TOKEN/PRIVATE modes)
fyaz05 Sep 6, 2026
5a2cc09
style: lean comments branch-wide
fyaz05 Sep 6, 2026
d0449ea
fix(resilience): make bounded FloodWait handling actually reachable
fyaz05 Sep 7, 2026
c0815a6
fix(security): redact the bare legacy URL shape (capability-hash leak)
fyaz05 Sep 7, 2026
f5a7ff4
fix(data): converging TTL backfill + hardened index ensures + touch d…
fyaz05 Sep 7, 2026
3f83f89
fix(server): 503 on Mongo brownout, constant 503 bodies, deduped ladders
fyaz05 Sep 7, 2026
5d1fb36
fix(bot): owner guard, safe deletes, accurate batch summary, misc dea…
fyaz05 Sep 7, 2026
d4dac03
build(deps): drop the dead shortener-cf extra; correct floors and com…
fyaz05 Sep 7, 2026
211ac39
fix(infra): PR smoke builds, SHA-pinned actions, pinned uv, gate parity
fyaz05 Sep 7, 2026
63d0716
fix(review): apply branch review + leanness audit findings
fyaz05 Sep 17, 2026
05fa722
docs(template): ThunderGo player UX port + doc truth sweep
fyaz05 Sep 17, 2026
9277806
fix(gates): owner bypasses everything, including force-sub
fyaz05 Sep 18, 2026
dbcdb12
feat(bot): ThunderGo message takes (8 items)
fyaz05 Sep 18, 2026
b94bd6c
feat(http): disposition split, error-header uniformity, broadcast res…
fyaz05 Sep 18, 2026
1ee74bd
feat(admin): listauth pagination, image attestations
fyaz05 Sep 18, 2026
4c47619
test(player): pin cinema UI JS contract
fyaz05 Sep 18, 2026
3b4b9a3
style: trim comments to load-bearing lines
fyaz05 Sep 18, 2026
9b1591a
feat(safe-batch): embeds, tuning docs, deploy manifests, property/lea…
fyaz05 Sep 18, 2026
90e6451
fix(tokens): fail closed on legacy/corrupt expires_at, no migration n…
fyaz05 Sep 18, 2026
886b5aa
fix(ci): satisfy locked mypy 2.3.1 (InlineKeyboardButtonBuy, bytes data)
fyaz05 Sep 18, 2026
d0e70ae
fix(ci): drop provenance/sbom attestations, docker driver rejects them
fyaz05 Sep 18, 2026
3c94f92
fix: apply independent branch-audit findings (resilience, redaction, …
audit-bot Sep 18, 2026
7f714cf
style(comments): lean pass over branch changes
super-z Sep 18, 2026
ce32bda
docs: sync dep count to 7 after speedup-extra consolidation
fyaz05 Sep 18, 2026
c9d1bd5
fix(review): crash, race, XSS and consistency fixes from full-branch …
fyaz05 Sep 18, 2026
ea6203b
chore: untrack personal TODO list (stays local, not for merge)
fyaz05 Sep 18, 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
25 changes: 25 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.git
.gitignore
.gitattributes
.github
.venv
.vscode
__pycache__
*.py[cod]
.pytest_cache
.ruff_cache
.mypy_cache
*.session*
logs/
tests/
htmlcov/
.coverage
README.md
CONTRIBUTING.md
SECURITY.md
Makefile
config.env
config.env.local
AGENTS.md
uv.lock
requirements.txt
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Normalize all text files to LF in the repository and working tree.
* text=auto eol=lf

# Binary assets
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.docx binary
*.session binary
20 changes: 20 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependabot cannot regenerate uv.lock: after each pip PR, run `uv lock` and
# push the updated lockfile to the PR branch, or CI's `uv lock --check` fails.
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: weekly
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
- package-ecosystem: docker
directory: "/"
schedule:
interval: weekly
- package-ecosystem: pre-commit
directory: "/"
schedule:
interval: weekly
26 changes: 0 additions & 26 deletions .github/workflows/dockerize.yml

This file was deleted.

138 changes: 138 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
name: Quality Gates

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: quality-${{ github.ref }}
cancel-in-progress: true

jobs:
quality:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0

- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.13"

# pinned: lock/export output format and gate semantics must not drift
# between commits (dependabot bumps this like any other dependency)
- name: Install uv
run: python -m pip install "uv==0.12.5"

# Install the hash-pinned lockfile (runtime + dev) so CI tests and audits
# the exact dependency graph that ships, not a fresh pip resolution.
- name: Install dependencies (locked, hash-pinned)
run: uv sync --frozen --group dev

- name: Lockfile is current with pyproject (uv.lock must never drift)
run: uv lock --check

- name: requirements.txt is in sync with pyproject (two sources of truth must agree)
run: |
uv run --locked python - <<'PY'
import sys, tomllib
deps = {d.strip() for d in tomllib.load(open("pyproject.toml", "rb"))["project"]["dependencies"]}
listed = {l.strip() for l in open("requirements.txt") if l.strip() and not l.startswith("#")}
if deps != listed:
print("pyproject:", sorted(deps))
print("requirements.txt:", sorted(listed))
sys.exit("requirements.txt drifted from pyproject [project.dependencies]")
PY

- name: requirements.lock is in sync with uv.lock (Docker consumes this)
run: |
uv export --frozen --no-dev --hashes -o /tmp/requirements.lock.check
# uv embeds the export command in the header; compare content only
diff -u <(grep -v '^#' requirements.lock) <(grep -v '^#' /tmp/requirements.lock.check)

- name: Ruff (lint + format check)
run: |
uv run ruff check Thunder/ update.py tests/
uv run ruff format --check Thunder/ update.py tests/

- name: Mypy (blocking)
run: uv run mypy Thunder update.py

- name: Unit tests
run: uv run pytest --cov=Thunder --cov-report=term-missing --cov-fail-under=35

# Audit the locked env: `-r requirements.txt` (direct pins only) never covered transitives.
- name: pip-audit (locked environment incl. transitives)
run: uv run pip-audit

- name: Bandit (high-only severity)
run: uv run bandit -c pyproject.toml -r Thunder update.py -ll --skip B101

- name: Vulture (dead-code gate)
run: uv run vulture Thunder update.py --min-confidence 80

- name: Dependency count gate (leanness is permanent)
run: |
COUNT=$(grep -cE '^[a-zA-Z0-9_-]+==' requirements.txt)
echo "Direct runtime deps: $COUNT"
if [ "$COUNT" -gt 7 ]; then
echo "::error::Direct dependency count increased beyond the agreed 7; justify in the PR or remove."
exit 1
fi

docker:
# Smoke-build on PRs (no secrets); publish only from main pushes so a
# feature branch can never overwrite fyaz05/thunder:latest.
if: github.repository == 'fyaz05/FileToLink' && (github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main'))
needs: quality
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0

- name: Login to Docker Hub
if: github.event_name == 'push'
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
username: fyaz05
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and Push
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
with:
context: .
push: ${{ github.event_name == 'push' }}
# Attestations stay off: the default docker driver rejects them even
# on no-push smoke builds; revisit with a containerd-backed builder.
tags: |
fyaz05/thunder:latest
fyaz05/thunder:${{ github.sha }}

integration:
# token CAS / ingest-claim atomicity is only provable against a real
# MongoDB, and this tier never ran in CI before
needs: quality
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0

- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.13"

- name: Install uv
run: python -m pip install "uv==0.12.5"

- name: Install dependencies (locked, incl. testcontainers)
run: uv sync --frozen --group dev

- name: Integration tests (real MongoDB via testcontainers)
run: uv run pytest -m integration
env:
TEST_INTEGRATION: "1"
66 changes: 38 additions & 28 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,38 @@
*.py[cod]
*$py.class
*.so
.venv/
.Python
config.env
log.text
.vscode/
**/__pycache__/
*.session
*.session-journal
*.session-shm
*.session-wal
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
*.py[cod]
*$py.class
*.so
.venv/
.Python
config.env
config.env.local
.coverage
htmlcov/
.pytest_cache/
.ruff_cache/
.mypy_cache/
log.txt
config.env.tmp
config.env.bak
*.tmp
Thunder/logs/
.vscode/
**/__pycache__/
*.session
*.session-journal
*.session-shm
*.session-wal
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.16.6
hooks:
- id: ruff-check
args: [--fix]
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
Loading
Loading