Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 15 additions & 14 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
---
name: Hata Bildirimi (Bug Report)
about: FocusFlow'da karşılaştığınız bir hatayı bildirin
name: Bug Report
about: Report a defect in FocusFlow CLI or Desktop HUD
title: '[BUG] '
labels: bug
assignees: ''
---

**Hatanın Tanımı**
Hatanın ne olduğunu açık ve net bir şekilde açıklayın.
**Description**
A concise description of the issue encountered.

**Tekrarlama Adımları**
1. Şu ekranı açın '...'
2. Şuraya tıklayın '...'
3. Hatayı görün
**Steps to Reproduce**
1. Run command or open HUD tab '...'
2. Perform action '...'
3. Observe error '...'

**Beklenen Davranış**
Ne olması gerektiğini açıklayın.
**Expected Behavior**
Describe what should have happened instead.

**Sistem Bilgileri:**
- İşletim Sistemi: [Windows 10 / 11]
- Python Sürümü: [3.10+]
- FocusFlow Sürümü: [1.0.0]
**Environment**
- OS: [Windows 11 / Ubuntu 24.04 / macOS]
- Go Version: [1.23+]
- Python Version: [3.10+]
- FocusFlow Version: [2.1.0]
38 changes: 23 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
push:
branches: [main]
branches: [main, 'feat/**']
pull_request:
branches: [main]
workflow_dispatch:
Expand All @@ -12,8 +12,10 @@ permissions:

jobs:
test-go:
name: Go Test (${{ matrix.os }} - Go ${{ matrix.go-version }})
name: Go (${{ matrix.os }} - Go ${{ matrix.go-version }})
runs-on: ${{ matrix.os }}
env:
CGO_ENABLED: '0'
strategy:
fail-fast: false
matrix:
Expand All @@ -33,24 +35,30 @@ jobs:
- name: Go Vet
run: go vet ./...

- name: Run Tests
- name: Go Test
run: go test -v ./...

test-rust:
name: Rust Check & Test
runs-on: windows-latest
continue-on-error: true
test-python:
name: Python (${{ matrix.os }} - Python ${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['3.11', '3.12', '3.13', '3.14']

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- name: Cargo Check
run: cargo check --verbose
continue-on-error: true
- name: Install pytest
run: python -m pip install --upgrade pip pytest

- name: Cargo Test
run: cargo test --verbose
continue-on-error: true
- name: Run pytest suite
run: python -m pytest -v
61 changes: 48 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ permissions:

jobs:
build-and-release:
name: Build & Release FocusFlow
name: Verify, Build & Release FocusFlow
runs-on: ubuntu-latest
env:
CGO_ENABLED: '0'
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -25,50 +27,83 @@ jobs:
go-version: '1.24.x'
check-latest: false

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'

- name: Verify Go vet & unit tests
run: |
go vet ./...
go test -v ./...

- name: Verify Python pytest suite
run: |
python -m pip install --upgrade pip pytest
python -m pytest -v

- name: Install packaging tools
run: sudo apt-get update && sudo apt-get install -y zip

- name: Build cross-platform binaries
run: |
mkdir -p dist

if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
VERSION="${GITHUB_REF_NAME#v}"
else
VERSION="2.1.0"
fi
LDFLAGS="-s -w -X main.Version=${VERSION}"

# Windows amd64
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o dist/focusflow-windows-amd64.exe ./cmd/focusflow
GOOS=windows GOARCH=amd64 go build -trimpath -ldflags="${LDFLAGS}" -o dist/focusflow-windows-amd64.exe ./cmd/focusflow
(cd dist && zip focusflow-windows-amd64.zip focusflow-windows-amd64.exe)


# Windows arm64
GOOS=windows GOARCH=arm64 go build -trimpath -ldflags="${LDFLAGS}" -o dist/focusflow-windows-arm64.exe ./cmd/focusflow
(cd dist && zip focusflow-windows-arm64.zip focusflow-windows-arm64.exe)

# Linux amd64
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o dist/focusflow-linux-amd64 ./cmd/focusflow
GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="${LDFLAGS}" -o dist/focusflow-linux-amd64 ./cmd/focusflow
tar -czvf dist/focusflow-linux-amd64.tar.gz -C dist focusflow-linux-amd64

# Linux arm64
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -trimpath -ldflags="-s -w" -o dist/focusflow-linux-arm64 ./cmd/focusflow
GOOS=linux GOARCH=arm64 go build -trimpath -ldflags="${LDFLAGS}" -o dist/focusflow-linux-arm64 ./cmd/focusflow
tar -czvf dist/focusflow-linux-arm64.tar.gz -C dist focusflow-linux-arm64

# macOS amd64
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o dist/focusflow-darwin-amd64 ./cmd/focusflow
GOOS=darwin GOARCH=amd64 go build -trimpath -ldflags="${LDFLAGS}" -o dist/focusflow-darwin-amd64 ./cmd/focusflow
tar -czvf dist/focusflow-darwin-amd64.tar.gz -C dist focusflow-darwin-amd64

# macOS arm64
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -trimpath -ldflags="-s -w" -o dist/focusflow-darwin-arm64 ./cmd/focusflow
GOOS=darwin GOARCH=arm64 go build -trimpath -ldflags="${LDFLAGS}" -o dist/focusflow-darwin-arm64 ./cmd/focusflow
tar -czvf dist/focusflow-darwin-arm64.tar.gz -C dist focusflow-darwin-arm64

- name: Generate SHA-256 Checksums
run: |
cd dist
sha256sum focusflow-windows-amd64.zip focusflow-linux-amd64.tar.gz focusflow-linux-arm64.tar.gz focusflow-darwin-amd64.tar.gz focusflow-darwin-arm64.tar.gz > checksums.txt
sha256sum \
focusflow-windows-amd64.zip \
focusflow-windows-arm64.zip \
focusflow-linux-amd64.tar.gz \
focusflow-linux-arm64.tar.gz \
focusflow-darwin-amd64.tar.gz \
focusflow-darwin-arm64.tar.gz > checksums.txt
cat checksums.txt

- name: Publish GitHub Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: |
dist/focusflow-windows-amd64.zip
dist/focusflow-windows-arm64.zip
dist/focusflow-linux-amd64.tar.gz
dist/focusflow-linux-arm64.tar.gz
dist/focusflow-darwin-amd64.tar.gz
dist/focusflow-darwin-arm64.tar.gz
dist/checksums.txt
name: ${{ github.ref_name }} - Deep Work & Distraction Firewall CLI
name: ${{ github.ref_name }} - FocusFlow Deep Work & Distraction Shield
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ marimo/_lsp/
__marimo__/

# Executables and builds
focusflow
focusflow.exe
.focusflow/
target/
*.tmp
*.bak
38 changes: 31 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,36 @@
# Changelog

FocusFlow projesine yapılan tüm önemli değişiklikler bu dosyada listelenir.
All notable changes to FocusFlow are documented in this file.

## [2.1.0] - 2026-11-10

### Added
- Unified standard-library Python core package (`focusflow_core/`) shared with `FocusFlowGUI.py` and 100% interoperable with the Go CLI (`config.json`, `sessions.json`, `hosts.focusflow.journal.json`).
- Crash-safe write-ahead rollback journal (`hosts.focusflow.journal.json`) and automatic startup orphan recovery (`RecoverIfOrphaned`) across both Go CLI and Python HUD.
- Dual-stack IPv4 (`0.0.0.0`) + IPv6 (`::`) `hosts` sinkholing with expanded Anti-DoH endpoints (`dns.adguard-dns.com`, `dns.nextdns.io`, `doh.cleanbrowsing.org`, `doh.dns.sb`, `freedns.controld.com`) and mid-session tamper verification.
- Zero-dependency Python Win32 process supervisor using `ctypes` `CreateToolhelp32Snapshot` (`Process32FirstW`/`Process32NextW`) and `TerminateProcess`.
- Critical protected process and PID denylist across Go and Python (`csrss.exe`, `lsass.exe`, `svchost.exe`, `explorer.exe`, `python.exe`, `focusflow.exe`, `wt.exe`, etc.), plus `SystemInformer.exe` in hardcore `AntiCheatGuard`.
- New CLI commands and flags: `focusflow doctor`, `focusflow recover`, `focusflow export [--format json|csv] [--out <file>]`, `--elevate`, `stats --days`, and `--json` output on `status`, `list`, `stats`, `doctor`, and `recover`.
- Non-pasteable 16-character alphanumeric Friction Challenge in strict mode, `PER_MONITOR_AWARE_V2` High-DPI scaling, `[ELEVATE ADMIN]` UAC action, and JSON/CSV/PNG telemetry exports in the desktop HUD.
- Hermetic Go and Python (`pytest`) test suites and multi-OS CI matrix (`Go 1.23.x`/`1.24.x` and `Python 3.11`–`3.14`), plus `windows/arm64` release artifacts.

### Changed
- Replaced drifted sleep countdowns with `time.monotonic()` phase deadlines and paused modal transitions so break timers never burn in the background while dialogs are open.
- Preserved Windows `hosts` DACLs via `ReplaceFileW` and POSIX permissions with `fsync` and 5x/40ms sharing-violation retries.
- Fixed Linux `/proc` process scanning so `ps` is never spawned on zero-match ticks and 15-byte `TASK_COMM_LEN` truncated names resolve via `/proc/<pid>/exe` and `/proc/<pid>/cmdline`.
- Purged seeded placeholder stats in favor of live telemetry computed from `sessions.json`.
- Standardized CLI and HUD on a strict zero-emoji Catppuccin Mocha systems aesthetic.

### Removed
- Retired duplicate unmaintained Rust prototype (`Cargo.toml`, `src/`) and legacy V1 script (`legacy/FocusFlowV1.py`).

## [2.0.0] - 2026-11-08

### Added
- Native Go CLI (`cmd/focusflow`, `pkg/engine`, `pkg/profile`, `pkg/storage`, `pkg/tui`) and Catppuccin Mocha Tkinter desktop GUI (`FocusFlowGUI.py`).
- Built-in `study`, `dev`, and `hardcore` focus profiles and cross-platform release workflow.

## [1.0.0] - 2026-11-05

### Eklendi
- Pomodoro odaklanma zamanlayıcısı ve esnek modlar.
- Gelişmiş Win32 proses denetleyicisi ile dikkat dağıtıcı oyun ve uygulamaları otomatik sonlandırma.
- Anti-DoH korumalı DNS ve hosts engelleme motoru.
- Günlük ve haftalık çalışma istatistikleri ve grafik raporlama.
- GitHub Actions CI/CD otomatik derleme ve test entegrasyonu.
### Added
- Initial Pomodoro focus timer, process blocker, DNS/hosts blocking prototype, and weekly statistics view.
42 changes: 26 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,38 @@
# FocusFlow'a Katkıda Bulunma Rehberi
# Contributing to FocusFlow

FocusFlow açık kaynaklı bir topluluk projesidir. Hata bildirimleri, yeni özellik önerileri ve katkılarınızı memnuniyetle kabul ediyoruz!
FocusFlow is an open-source deep work systems utility built on a unified **Go CLI** + **zero-dependency Python Desktop HUD** architecture. Bug reports, security hardening improvements, and pull requests are welcome.

## Geliştirme Ortamı
## Development Prerequisites

### Gereksinimler
- **Python 3.10+**
- Git
- **Go 1.23+** (`CGO_ENABLED=0` standard-library build)
- **Python 3.10+** (standard library only at runtime; `pytest` for running tests)
- **Git**

## Setup

### Kurulum
```bash
git clone https://github.com/aloneangel45/FocusFlow.git
cd FocusFlow
pip install -r requirements.txt
python -m pip install -e ".[dev]"
```

### Testleri Çalıştırma
## Running the Hermetic Test Suites

All tests isolate filesystem state via `FOCUSFLOW_HOME` and `FOCUSFLOW_HOSTS_PATH` temporary directories and must never modify real `%APPDATA%` or the host OS `hosts` file:

```bash
pytest tests/
# Go static analysis and unit tests
CGO_ENABLED=0 go vet ./...
CGO_ENABLED=0 go test -v ./...

# Python unit and cross-runtime interop tests
python -m pytest -v
```

### Katkı Süreci
1. Projeyi Fork'layın.
2. Yeni bir dal (branch) açın: `git checkout -b feat/yeni-ozellik`
3. Değişikliklerinizi yapın ve test edin.
4. Conventional Commits formatında commit atın (`feat:`, `fix:`, `docs:`).
5. Pull Request gönderin.
## Contribution Guidelines

1. Fork the repository and create a topic branch (`git checkout -b feat/your-feature`).
2. Keep Go (`pkg/*`, `cmd/focusflow`) and Python (`focusflow_core/*`, `FocusFlowGUI.py`) schemas and behavior aligned whenever modifying state files (`config.json`, `sessions.json`, `hosts.focusflow.journal.json`) or `hosts` block markers.
3. Follow the zero-emoji minimal systems aesthetic across code, CLI tags, GUI labels, and documentation.
4. Ensure both `go test -v ./...` and `python -m pytest -v` pass cleanly.
5. Format commit messages according to Conventional Commits (`feat:`, `fix:`, `docs:`, `test:`, `ci:`, `chore:`) and open a Pull Request.
Loading
Loading