vieforge 0.4.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. vieforge-0.4.1/.env.example +32 -0
  2. vieforge-0.4.1/.github/FUNDING.yml +2 -0
  3. vieforge-0.4.1/.github/ISSUE_TEMPLATE/bug_report.md +20 -0
  4. vieforge-0.4.1/.github/ISSUE_TEMPLATE/feature_request.md +17 -0
  5. vieforge-0.4.1/.github/pull_request_template.md +10 -0
  6. vieforge-0.4.1/.github/workflows/ci.yml +74 -0
  7. vieforge-0.4.1/.github/workflows/publish.yml +92 -0
  8. vieforge-0.4.1/.gitignore +36 -0
  9. vieforge-0.4.1/AGENTS.md +18 -0
  10. vieforge-0.4.1/AGENT_INSTALL.md +26 -0
  11. vieforge-0.4.1/CHANGELOG.md +72 -0
  12. vieforge-0.4.1/CONTRIBUTING.md +27 -0
  13. vieforge-0.4.1/LEGAL_AND_COMPLIANCE.md +22 -0
  14. vieforge-0.4.1/LICENSE +21 -0
  15. vieforge-0.4.1/PKG-INFO +223 -0
  16. vieforge-0.4.1/README.md +194 -0
  17. vieforge-0.4.1/README.vi.md +116 -0
  18. vieforge-0.4.1/SECURITY.md +21 -0
  19. vieforge-0.4.1/config/budget_limits.json +8 -0
  20. vieforge-0.4.1/config/pricing.example.json +41 -0
  21. vieforge-0.4.1/config/qa_error_codes.json +50 -0
  22. vieforge-0.4.1/core/__init__.py +99 -0
  23. vieforge-0.4.1/core/cdp_bridge.py +506 -0
  24. vieforge-0.4.1/core/concurrency.py +189 -0
  25. vieforge-0.4.1/core/cost_tracker.py +385 -0
  26. vieforge-0.4.1/core/extension_bridge.py +593 -0
  27. vieforge-0.4.1/core/license_audit.py +153 -0
  28. vieforge-0.4.1/core/llm_router.py +309 -0
  29. vieforge-0.4.1/core/output_trimmer.py +215 -0
  30. vieforge-0.4.1/core/paths.py +44 -0
  31. vieforge-0.4.1/core/pipeline_runner.py +98 -0
  32. vieforge-0.4.1/core/qa_logger.py +106 -0
  33. vieforge-0.4.1/core/state_db.py +367 -0
  34. vieforge-0.4.1/core/step_auditor.py +550 -0
  35. vieforge-0.4.1/core/subprocess_runner.py +157 -0
  36. vieforge-0.4.1/core/vram_manager.py +298 -0
  37. vieforge-0.4.1/docs/CROSS_OS_QUALITY_GATE.md +38 -0
  38. vieforge-0.4.1/docs/RELEASE_NOTES_v0.4.1.md +26 -0
  39. vieforge-0.4.1/examples/01_batch_doc_processor/run_demo.py +177 -0
  40. vieforge-0.4.1/examples/02_hybrid_media_pipeline/run_skeleton.py +79 -0
  41. vieforge-0.4.1/examples/03_ci_log_triage/README.md +19 -0
  42. vieforge-0.4.1/examples/03_ci_log_triage/run_ci_triage.py +203 -0
  43. vieforge-0.4.1/extensions/tierforge-bridge/README.md +28 -0
  44. vieforge-0.4.1/extensions/tierforge-bridge/SECURITY.md +14 -0
  45. vieforge-0.4.1/extensions/tierforge-bridge/background.js +288 -0
  46. vieforge-0.4.1/extensions/tierforge-bridge/content_bridge.js +193 -0
  47. vieforge-0.4.1/extensions/tierforge-bridge/manifest.json +32 -0
  48. vieforge-0.4.1/extensions/tierforge-bridge/popup.html +59 -0
  49. vieforge-0.4.1/extensions/tierforge-bridge/popup.js +90 -0
  50. vieforge-0.4.1/mcp/mcp_config.example.json +14 -0
  51. vieforge-0.4.1/mcp/worker_mcp_server.py +339 -0
  52. vieforge-0.4.1/pyproject.toml +83 -0
  53. vieforge-0.4.1/scripts/__init__.py +1 -0
  54. vieforge-0.4.1/scripts/audit_step.py +38 -0
  55. vieforge-0.4.1/scripts/benchmark_token_savings.py +383 -0
  56. vieforge-0.4.1/scripts/browser_bridge.py +85 -0
  57. vieforge-0.4.1/scripts/cli.py +76 -0
  58. vieforge-0.4.1/scripts/extension_bridge_server.py +101 -0
  59. vieforge-0.4.1/scripts/install_skill.py +184 -0
  60. vieforge-0.4.1/scripts/preflight_check.py +401 -0
  61. vieforge-0.4.1/scripts/quick_setup.py +128 -0
  62. vieforge-0.4.1/scripts/start_tierforge_bridge.bat +8 -0
  63. vieforge-0.4.1/scripts/verify_cross_os.py +360 -0
  64. vieforge-0.4.1/skills/three-tier-orchestrator/SKILL.md +30 -0
  65. vieforge-0.4.1/skills/three-tier-orchestrator/references/hardware-profiles.md +21 -0
  66. vieforge-0.4.1/skills/three-tier-orchestrator/references/routing-matrix.md +32 -0
  67. vieforge-0.4.1/tests/test_benchmark.py +18 -0
  68. vieforge-0.4.1/tests/test_checkpoint_resume.py +99 -0
  69. vieforge-0.4.1/tests/test_concurrency.py +89 -0
  70. vieforge-0.4.1/tests/test_core_harness.py +333 -0
  71. vieforge-0.4.1/tests/test_cost_guard.py +78 -0
  72. vieforge-0.4.1/tests/test_cross_os_verification.py +100 -0
  73. vieforge-0.4.1/tests/test_example_03_ci_triage.py +47 -0
  74. vieforge-0.4.1/tests/test_llm_router.py +168 -0
  75. vieforge-0.4.1/tests/test_mcp_and_installer.py +102 -0
  76. vieforge-0.4.1/tests/test_output_trimmer.py +44 -0
  77. vieforge-0.4.1/tests/test_tier3_and_extension_hardening.py +137 -0
  78. vieforge-0.4.1/tests/test_v0_4_upgrades.py +185 -0
  79. vieforge-0.4.1/uv.lock +1305 -0
  80. vieforge-0.4.1/website/404.html +70 -0
  81. vieforge-0.4.1/website/_headers +10 -0
  82. vieforge-0.4.1/website/assets/favicon.svg +20 -0
  83. vieforge-0.4.1/website/assets/logo.svg +17 -0
  84. vieforge-0.4.1/website/assets/og-card.png +0 -0
  85. vieforge-0.4.1/website/assets/vietqr.png +0 -0
  86. vieforge-0.4.1/website/index.html +1975 -0
  87. vieforge-0.4.1/website/robots.txt +4 -0
  88. vieforge-0.4.1/website/sitemap.xml +9 -0
  89. vieforge-0.4.1/wrangler.jsonc +7 -0
@@ -0,0 +1,32 @@
1
+ # TierForge Hybrid AI Agent Harness — Environment Configuration
2
+ # Copy to .env and adjust for your local workstation.
3
+
4
+ # --- Tier 2: Local LLM (Ollama or OpenAI-compatible endpoint) ---
5
+ # Ollama default: http://127.0.0.1:11434
6
+ # LM Studio: http://127.0.0.1:1234/v1
7
+ # llama.cpp: http://127.0.0.1:8080/v1
8
+ # vLLM: http://127.0.0.1:8000/v1
9
+ TIERFORGE_LLM_BASE_URL=http://127.0.0.1:11434
10
+ # auto | ollama | openai (auto selects openai for non-11434 /v1 endpoints)
11
+ TIERFORGE_LLM_API_STYLE=auto
12
+ TIERFORGE_LLM_API_KEY=ollama
13
+ TIERFORGE_LLM_MODEL=qwen2.5:7b
14
+ # Force immediate VRAM unload after each request (0 = unload immediately)
15
+ TIERFORGE_OLLAMA_KEEP_ALIVE=0
16
+ TIERFORGE_LLM_TIMEOUT_SEC=120
17
+
18
+ # --- State & Checkpointing (SQLite) ---
19
+ TIERFORGE_STATE_DB=data/tierforge_state.db
20
+ TIERFORGE_LOG_DIR=logs
21
+ TIERFORGE_QA_LOG=logs/qa_feedback.jsonl
22
+
23
+ # --- Budget & Pricing Guardrails ---
24
+ TIERFORGE_PRICING_CONFIG=config/pricing.example.json
25
+ TIERFORGE_BUDGET_CONFIG=config/budget_limits.json
26
+ TIERFORGE_MAX_JOB_USD=5.00
27
+ TIERFORGE_DAILY_USD_CAP=20.00
28
+ TIERFORGE_MAX_RETRY_PER_ITEM=2
29
+
30
+ # --- Tier 3: Optional Hardware / VRAM Guard ---
31
+ # Minimum free VRAM (MB) required before launching a GPU subprocess
32
+ TIERFORGE_MIN_FREE_VRAM_MB=4096
@@ -0,0 +1,2 @@
1
+ # GitHub Sponsor button configuration (renders a subtle ♡ Sponsor button on the repo)
2
+ ko_fi: aivieforge
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Bug report
3
+ about: Report a reproducible issue in VieForge core, MCP server, or scripts
4
+ title: "[bug] "
5
+ labels: bug
6
+ ---
7
+
8
+ ## Describe the bug
9
+ A clear and concise description of what happened.
10
+
11
+ ## Reproduction steps
12
+ 1. Command or script executed:
13
+ 2. Expected behavior:
14
+ 3. Actual behavior (paste trimmed traceback):
15
+
16
+ ## Environment
17
+ - OS: (Windows / macOS / Linux)
18
+ - Python version:
19
+ - Local LLM backend: (Ollama / LM Studio / llama.cpp / vLLM / `--mock-llm`)
20
+ - Output of `python scripts/preflight_check.py --json`:
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an improvement aligned with VieForge's 3-Tier clean-room philosophy
4
+ title: "[feat] "
5
+ labels: enhancement
6
+ ---
7
+
8
+ ## Problem / Use Case
9
+ What workflow burns too many Cloud Agent tokens or needs better local guardrails?
10
+
11
+ ## Proposed Solution
12
+ Describe the proposed API, MCP tool, provider, or example.
13
+
14
+ ## Guardrail Checklist
15
+ - [ ] Keeps `core/` 100% Python stdlib (no third-party dependencies in `core/`)
16
+ - [ ] Zero OS-Mutation (no Registry, OS services, network stack, or pagefile edits)
17
+ - [ ] Clean-room MIT compatible (no AGPL, BUSL, or NC dependencies)
@@ -0,0 +1,10 @@
1
+ ## Summary
2
+ Briefly explain what this PR changes and why.
3
+
4
+ ## Verification Checklist
5
+ - [ ] `pytest -v` passes with zero failures
6
+ - [ ] `ruff check .` passes with zero warnings
7
+ - [ ] `python -m core.license_audit` passes (`core/` remains 100% Python stdlib, MIT clean-room)
8
+ - [ ] `python scripts/audit_step.py --step pr_check` passes (`local_score == 100.0`)
9
+ - [ ] Zero OS-Mutation: no scripts modify OS services, Registry, network stack, or pagefiles
10
+ - [ ] No private workspace data, secrets, or hardcoded user paths committed
@@ -0,0 +1,74 @@
1
+ name: VieForge CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test-and-audit:
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ os: [ubuntu-latest, macos-latest, windows-latest]
15
+ python-version: ["3.10", "3.12"]
16
+
17
+ runs-on: ${{ matrix.os }}
18
+
19
+ steps:
20
+ - name: Checkout repository
21
+ uses: actions/checkout@v4
22
+
23
+ - name: Set up Python ${{ matrix.python-version }}
24
+ uses: actions/setup-python@v5
25
+ with:
26
+ python-version: ${{ matrix.python-version }}
27
+
28
+ - name: Install dev dependencies & build backend
29
+ run: python -m pip install --upgrade pip && pip install hatchling && pip install -e ".[dev]"
30
+
31
+ - name: Lint with Ruff
32
+ run: ruff check .
33
+
34
+ - name: Commercial License Clean-Room Audit
35
+ run: python -m core.license_audit
36
+
37
+ - name: Run Unit Test Suite (pytest)
38
+ run: pytest -v
39
+
40
+ - name: Run 2-Axis Cross-OS Verification (Core Gate + Clean Wheel E2E + OS Lock)
41
+ run: python scripts/verify_cross_os.py run --step "ci_${{ matrix.os }}_py${{ matrix.python-version }}" --os-label "${{ matrix.os }}-py${{ matrix.python-version }}" --out "data/os_report_${{ matrix.os }}_py${{ matrix.python-version }}.json"
42
+
43
+ - name: Upload OS Verification Report Artifact
44
+ if: always()
45
+ uses: actions/upload-artifact@v4
46
+ with:
47
+ name: os-report-${{ matrix.os }}-py${{ matrix.python-version }}
48
+ path: data/os_report_${{ matrix.os }}_py${{ matrix.python-version }}.json
49
+
50
+ cross-os-parity-gate:
51
+ needs: test-and-audit
52
+ runs-on: ubuntu-latest
53
+
54
+ steps:
55
+ - name: Checkout repository
56
+ uses: actions/checkout@v4
57
+
58
+ - name: Set up Python 3.12
59
+ uses: actions/setup-python@v5
60
+ with:
61
+ python-version: "3.12"
62
+
63
+ - name: Download All 3-OS Verification Reports
64
+ uses: actions/download-artifact@v4
65
+ with:
66
+ path: ci_reports
67
+ pattern: os-report-*
68
+ merge-multiple: true
69
+
70
+ - name: Cross-Verify 3-OS Behavioral Parity & Publish Scorecard
71
+ run: |
72
+ python scripts/verify_cross_os.py compare ci_reports/os_report_*.json \
73
+ --markdown-out ci_reports/parity_scorecard.md
74
+ cat ci_reports/parity_scorecard.md >> "$GITHUB_STEP_SUMMARY"
@@ -0,0 +1,92 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch:
7
+ inputs:
8
+ repository:
9
+ description: "Target package index"
10
+ required: true
11
+ default: "testpypi"
12
+ type: choice
13
+ options:
14
+ - testpypi
15
+ - pypi
16
+
17
+ permissions:
18
+ contents: read
19
+
20
+ jobs:
21
+ build-and-verify:
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - name: Checkout repository
25
+ uses: actions/checkout@v4
26
+
27
+ - name: Set up Python 3.12
28
+ uses: actions/setup-python@v5
29
+ with:
30
+ python-version: "3.12"
31
+
32
+ - name: Install build & verification tools
33
+ run: python -m pip install --upgrade pip && pip install hatchling build twine
34
+
35
+ - name: Build wheel and sdist
36
+ run: python -m build
37
+
38
+ - name: Check distribution metadata
39
+ run: twine check dist/*
40
+
41
+ - name: Verify clean wheel install & CLI smoke test
42
+ run: |
43
+ python -m venv /tmp/wheel-venv
44
+ /tmp/wheel-venv/bin/pip install dist/*.whl
45
+ /tmp/wheel-venv/bin/vieforge --help
46
+ /tmp/wheel-venv/bin/python -W error -m core.license_audit
47
+
48
+ - name: Upload dist artifacts
49
+ uses: actions/upload-artifact@v4
50
+ with:
51
+ name: vieforge-dist
52
+ path: dist/*
53
+
54
+ publish-pypi:
55
+ needs: build-and-verify
56
+ if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.repository == 'pypi')
57
+ runs-on: ubuntu-latest
58
+ environment:
59
+ name: pypi
60
+ url: https://pypi.org/p/vieforge
61
+ permissions:
62
+ id-token: write
63
+ steps:
64
+ - name: Download dist artifacts
65
+ uses: actions/download-artifact@v4
66
+ with:
67
+ name: vieforge-dist
68
+ path: dist
69
+
70
+ - name: Publish package to PyPI (Trusted Publishing)
71
+ uses: pypa/gh-action-pypi-publish@release/v1
72
+
73
+ publish-testpypi:
74
+ needs: build-and-verify
75
+ if: github.event_name == 'workflow_dispatch' && inputs.repository == 'testpypi'
76
+ runs-on: ubuntu-latest
77
+ environment:
78
+ name: testpypi
79
+ url: https://test.pypi.org/p/vieforge
80
+ permissions:
81
+ id-token: write
82
+ steps:
83
+ - name: Download dist artifacts
84
+ uses: actions/download-artifact@v4
85
+ with:
86
+ name: vieforge-dist
87
+ path: dist
88
+
89
+ - name: Publish package to TestPyPI (Trusted Publishing)
90
+ uses: pypa/gh-action-pypi-publish@release/v1
91
+ with:
92
+ repository-url: https://test.pypi.org/legacy/
@@ -0,0 +1,36 @@
1
+ # Environment & secrets
2
+ .env
3
+ .env.local
4
+ .env.*.local
5
+
6
+ # Runtime state, databases, and logs
7
+ *.db
8
+ *.db-shm
9
+ *.db-wal
10
+ *.sqlite
11
+ *.sqlite3
12
+ data/
13
+ logs/
14
+ qa_feedback.jsonl
15
+
16
+ # Python artifacts & virtual environments
17
+ .venv/
18
+ venv/
19
+ __pycache__/
20
+ *.py[cod]
21
+ *$py.class
22
+ *.egg-info/
23
+ .eggs/
24
+ dist/
25
+ build/
26
+ .pytest_cache/
27
+ .ruff_cache/
28
+ .mypy_cache/
29
+ .coverage
30
+ htmlcov/
31
+
32
+ # OS & editor clutter
33
+ .DS_Store
34
+ Thumbs.db
35
+ .vscode/
36
+ .idea/
@@ -0,0 +1,18 @@
1
+ # AGENTS.md — TierForge Harness Instructions
2
+
3
+ This repository implements **TierForge** (*Code First, Local LLM Second, Cloud Last*): a 3-Tier Hybrid AI Agent Harness designed to cut Cloud Agent token burn and API spend by 70–90%.
4
+
5
+ ## Operating Rules for AI Agents (Antigravity, Claude Code, Cursor, Windsurf, Codex CLI)
6
+
7
+ 1. **Delegate Bulk Work Off Cloud Context:**
8
+ - **Tier 1 (You / Cloud Brain):** Architecture, code edits, reviews, Approval Gates, root-cause debugging.
9
+ - **Tier 2 (Local Backbone — `$0`):** Deterministic Python + SQLite checkpoints (`core/state_db.py`) + Ollama local LLM (`core/llm_router.py`).
10
+ - **Tier 3 (Isolated Muscle):** Heavy local GPU jobs in child subprocesses (`core/subprocess_runner.py`, `exclusive_gpu=True`) and paid external APIs guarded by `--dry-run`, `MAX_RETRY_PER_ITEM <= 2`, `MAX_JOB_USD`, and `DAILY_USD_CAP` (`core/cost_tracker.py`).
11
+ 2. **Multi-Project Concurrency Safety:**
12
+ - When running multiple workspaces concurrently on one machine, pass `project_id` to `tool_run_local_batch` / `scoped_job_id()`, use `LLMRouter.batch_session()` (ref-counted Ollama VRAM lease), and `exclusive_gpu=True` for heavy Tier 3 GPU subprocesses.
13
+ 3. **Non-Negotiable Guardrails:**
14
+ - **Zero OS-Mutation:** Never edit OS services, Windows Registry, network stacks, or pagefiles.
15
+ - **Clean-Room MIT Licensing:** `core/` stays 100% Python stdlib. Never embed `BUSL-1.1` (`rtk-engine`), `AGPL-3.0`, or `CC-BY-NC`.
16
+ - **Verify Before Reporting Done:** Run `uv run --extra dev pytest -v` and `uv run python scripts/audit_step.py --step <name>`.
17
+ 4. **If a Beginner User Asks You to Install TierForge:**
18
+ - Read and follow [AGENT_INSTALL.md](AGENT_INSTALL.md) directly — run `python scripts/quick_setup.py` and explain the result in plain language.
@@ -0,0 +1,26 @@
1
+ # AGENT_INSTALL.md — Zero-Knowledge Playbook for AI Agents
2
+
3
+ > **Purpose:** If a user who does not know Git, Python, or MCP asks you (Antigravity, Claude Code, Cursor, Windsurf, or Codex CLI) to *"install TierForge / the 3-tier token-saving repo and set it up for me"*, follow these exact steps on their behalf and explain everything in simple, non-technical language.
4
+
5
+ ## Automated Setup Steps (Execute Sequentially)
6
+
7
+ 1. **Clone or locate the repository** (if not already in the workspace):
8
+ ```bash
9
+ git clone https://github.com/vieforge/vieforge.git
10
+ cd vieforge
11
+ ```
12
+ 2. **Run the 1-command zero-knowledge setup** (100% Python stdlib, zero OS mutations):
13
+ ```bash
14
+ python scripts/quick_setup.py
15
+ ```
16
+ This automatically:
17
+ - Checks Python (>= 3.10), SQLite WAL, GPU/VRAM, and Ollama.
18
+ - Installs the `three-tier-orchestrator` skill for every AI agent detected on the user's machine.
19
+ - Generates absolute-path MCP config files at `data/mcp_config.generated.json` (Antigravity / Claude Code / Cursor / Windsurf) and `data/codex_mcp.generated.toml` (Codex CLI).
20
+ - Runs the 5-minute `$0` batch demo (automatically falling back to `--mock-llm` if Ollama is not installed yet) and displays a **Savings Receipt**.
21
+ 3. **Optional — Enable Real Local LLM (`$0`):**
22
+ - If `quick_setup.py` reported Ollama is not running, tell the user in 1 sentence how to install Ollama from https://ollama.com and pull the hardware-recommended model (e.g., `ollama pull qwen2.5:3b` for CPU-only, `ollama pull qwen2.5:7b` for 8–16 GB VRAM).
23
+ 4. **Optional — Connect MCP Server:**
24
+ - Install the optional MCP SDK (`pip install "mcp>=1.2.0"` or `uv sync --extra mcp`) and help the user paste the generated snippet from `data/mcp_config.generated.json` (or `data/codex_mcp.generated.toml` for Codex CLI) into their IDE's MCP settings.
25
+ 5. **Report Back in Plain Language:**
26
+ - Summarize: (a) what hardware profile was detected, (b) which AI agents received the skill, (c) the Savings Receipt from the demo, and (d) one example sentence the user can type next to start saving tokens.
@@ -0,0 +1,72 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [0.4.1] - 2026-11-27
6
+
7
+ ### Fixed
8
+ - **Tier 3 VRAM Profiler Crash (`core/vram_manager.py`):** Accepted `job_id=` alongside backwards-compatible `episode_id=` in `vram_phase_profiler()`, fixing `TypeError` when running `run_isolated(..., profile_vram=True)` and full `examples/02_hybrid_media_pipeline/run_skeleton.py`.
9
+ - **Eliminated 2–5s Inter-Stage Flush Stall (`core/vram_manager.py`):** Only probe ComfyUI `/free` when `COMFYUI_BASE_URL` or explicit `base_url` is set.
10
+ - **Portable Windows Bridge Launcher & Wheel Bundling (`scripts/start_tierforge_bridge.bat`, `scripts/cli.py`, `pyproject.toml`):** Replaced hardcoded path with `%~dp0..`, added `vieforge bridge <serve|status|token|send|path>`, and bundled `extensions/tierforge-bridge/` inside the wheel.
11
+ - **MV3 Extension Reliability & Security (`extensions/tierforge-bridge/`, `core/extension_bridge.py`):** Added `chrome.runtime.onStartup` alarm recovery, 12s SPA input wait + native `execCommand("insertText")` editor input, immediate `LOGIN_OR_CAPTCHA_REQUIRED` halt, XSS-safe DOM popup logs, port-19876 warning, and default `redact_secrets=True` on `ExtensionBridgeClient.dispatch_prompt()`.
12
+
13
+ ## [0.4.0] - 2026-11-26
14
+
15
+ ### Added
16
+ - **Direct Disk-Input MCP Batching (`mcp/worker_mcp_server.py`):** `tool_run_local_batch` now supports `input_path` (directory, `.jsonl`, `.json`, `.csv`, or single text file) and `input_glob` (e.g. `"docs/*.md"`) so Tier 2 reads files locally from disk with zero Cloud token payload transfer.
17
+ - **Secret Redaction & Smart Error Retention (`core/output_trimmer.py`):** Automatically redacts API keys, GitHub/AWS/Google/Slack tokens, Bearer headers, and secret env assignments before returning logs to Tier 1 (`redact_secrets=True`), and retains high-signal error lines (`FAILED`, `ERROR`, `AssertionError`, `FATAL`) even when truncating huge log middles.
18
+ - **Unified `vieforge` CLI (`scripts/cli.py`):** Added single `vieforge <setup|check|bench|mcp|audit|verify-os|install-skill>` command (keeping all 5 legacy `vieforge-*` aliases intact) plus `vieforge --version`.
19
+ - **OpenAI-Compatible Preflight Detection (`scripts/preflight_check.py`):** `check_ollama()` now probes `/v1/models` for LM Studio, llama.cpp, and vLLM endpoints in addition to native Ollama `/api/tags`.
20
+ - **Flagship Website Overhaul (`https://vieforge.dev`):** Rebuilt Desktop & Mobile UI with interactive 3-tab Hero demo, asymmetrical Bento Grid, Calculator presets, 56px mobile drawer, bilingual FAQ + `FAQPage` JSON-LD, Cloudflare security `_headers`, custom `404.html`, and `hreflang`.
21
+
22
+ ### Fixed
23
+ - **Windows UTF-8 Subprocess Safety (`core/subprocess_runner.py`, `scripts/preflight_check.py`):** Enforced explicit `encoding="utf-8", errors="replace"` and `PYTHONUTF8=1` on child processes to prevent `UnicodeDecodeError` on Unicode/Vietnamese output.
24
+
25
+ ## [0.3.0] - 2026-11-26
26
+
27
+ ### Added
28
+ - **2-Axis Cross-OS Quality Gate (`core/step_auditor.py`, `scripts/verify_cross_os.py`, `docs/CROSS_OS_QUALITY_GATE.md`):**
29
+ - Separates **Axis A — 5 Mandatory Core Capability Contracts** (`C1_token_efficiency`, `C2_durability_resume`, `C3_budget_and_safety`, `C4_cross_os_portability`, `C5_pytest_and_hygiene`) from **Axis B — Performance (50 pts) & Developer Experience (50 pts)**.
30
+ - Added static **Cross-Platform Portability AST Scanner** catching personal Windows paths, unguarded `msvcrt`/`fcntl`/`winreg` imports, and missing `encoding="utf-8"` text I/O.
31
+ - Added **3-OS Parity CI Gate** in `.github/workflows/ci.yml`: builds a real `.whl`, installs offline into an isolated venv outside the repo, tests all CLI commands + interrupt/resume + real multi-process OS locks (`fcntl` / `msvcrt`) on Ubuntu, macOS, and Windows, and cross-verifies behavioral parity across all runners.
32
+ - **Clean Wheel Packaging (`core/paths.py` + `pyproject.toml`):**
33
+ - Bundles `config/`, `skills/`, `AGENTS.md`, and `run_demo.py` into `core/_bundled_assets/` so `pip install` works cleanly from any directory on Linux, macOS, and Windows.
34
+
35
+ ### Performance & Reliability Fixes
36
+ - **44x `StateDB` Bulk Registration Speedup (`core/state_db.py`):** Refactored `register_items()` into a single SQLite transaction (`executemany`) and added `mark_done_batch()`, reducing 1,000-item checkpoint + resume latency from ~1,242 ms to ~28 ms.
37
+ - **Zero-Warning Lazy Package Exports (`core/__init__.py`):** Adopted PEP 562 lazy `__getattr__`, speeding up CLI cold-start and eliminating Python `runpy` `RuntimeWarning` when running `python -m core.license_audit`.
38
+ - **Cross-OS Loopback HTTP Fix (`core/extension_bridge.py`):** Always drain POST request body before early `401`/`403`/`200` responses to prevent TCP RST (`WinError 10053` / `ConnectionResetError`).
39
+ - **Repository Hygiene:** Moved internal pre-launch notes out of public `docs/`, tightened Ruff lint (`C4`, `SIM`), and synced `examples/02_hybrid_media_pipeline/run_skeleton.py` to `default_data_dir()`.
40
+
41
+ ## [0.2.0] - 2026-11-26
42
+
43
+ ### Added
44
+ - **True OpenAI-Compatible Local LLM Support (`core/llm_router.py`):**
45
+ - Added `api_style="auto"|"ollama"|"openai"` (`TIERFORGE_LLM_API_STYLE`) supporting LM Studio (`:1234/v1`), llama.cpp (`:8080/v1`), vLLM (`:8000/v1`), and OpenRouter via `/v1/chat/completions` + `Authorization: Bearer` header, with automatic fallback when servers reject `response_format={"type":"json_object"}`.
46
+ - Preserved native Ollama `/api/chat` + `keep_alive=0` lease-managed VRAM hygiene for Ollama endpoints (`:11434`).
47
+ - **Reproducible `$0` Token Savings Benchmark (`scripts/benchmark_token_savings.py` + `tests/test_benchmark.py`):**
48
+ - Verifies exact Cloud token burn across 100-doc batch (`118.3x`, `-99.2%`), 390-line CI log compression (`11.2x`, `-91.0%`), and 50-item crash/resume (`39.2x`, `-97.4%`) — **16.9x net reduction (`-94.1%`)** including the 1,459-token one-time session overhead.
49
+ - **Bilingual Website (`https://vieforge.dev`) + SEO & Open Graph:**
50
+ - Interactive EN/VI savings calculator, verified benchmark charts, honest break-even scope, Ko-fi + VietQR community support modal, Cloudflare Workers Static Assets deploy (`wrangler.jsonc`), `1200x630` Open Graph card (`website/assets/og-card.png`), Twitter Card, JSON-LD `SoftwareApplication`, `robots.txt`, and `sitemap.xml`.
51
+ - **Developer Experience, CLI Entrypoints & CI Hardening:**
52
+ - Added `[project.scripts]` console entrypoints (`vieforge-setup`, `vieforge-preflight`, `vieforge-bench`, `vieforge-mcp`, `vieforge-audit`).
53
+ - Expanded GitHub Actions CI matrix to verify `mcp/worker_mcp_server.py --check`, `benchmark_token_savings.py --json`, and `run_demo.py --dry-run`.
54
+ - Added real localhost `http.server` tests for both Ollama and OpenAI-compatible routing (`tests/test_llm_router.py`), plus GitHub Issue & PR templates (`.github/`).
55
+
56
+ ## [0.1.0] - 2026-11-26
57
+
58
+ ### Added
59
+ - **3-Tier Hybrid Core (`core/`, 100% Python stdlib, MIT):**
60
+ - `state_db.py`: SQLite WAL per-item checkpointing, SHA-256 deduplication, and `scoped_job_id()` for multi-project isolation.
61
+ - `llm_router.py`: Ollama / OpenAI-compatible router with `batch_session()` VRAM lease hygiene, JSON auto-repair retries (`<= 2`), and offline `--mock-llm` mode.
62
+ - `concurrency.py`: Cross-process locks (`msvcrt`/`fcntl`), atomic JSON writes, ref-counted `OllamaLeaseManager`, and `exclusive_gpu_lock`.
63
+ - `cost_tracker.py`: External `pricing.json` loader, `--dry-run` cost estimator, `MAX_JOB_USD` & `DAILY_USD_CAP` guards, and `SavingsReceipt`.
64
+ - `output_trimmer.py`: Clean-room ANSI/progress-bar/traceback compressor with exact character reduction telemetry.
65
+ - `subprocess_runner.py`, `vram_manager.py`, `pipeline_runner.py`, `qa_logger.py`, `license_audit.py`, `step_auditor.py`.
66
+ - **Multi-Agent Ecosystem & Zero-Knowledge Onboarding:**
67
+ - `mcp/worker_mcp_server.py` (5 compact MCP tools), `AGENTS.md`, `AGENT_INSTALL.md`, `scripts/quick_setup.py`, and `scripts/install_skill.py` supporting Antigravity, Claude Code, Cursor, Windsurf, and Codex CLI (JSON + TOML).
68
+ - **Examples & Optional BYOA Bridge:**
69
+ - `examples/01_batch_doc_processor/run_demo.py` (5-min `$0` interrupt/resume demo) and `examples/02_hybrid_media_pipeline/run_skeleton.py`.
70
+ - Optional Manifest V3 localhost bridge (`extensions/tierforge-bridge/`) with bilingual EN/VI setup wizard and `LEGAL_AND_COMPLIANCE.md`.
71
+ - **CI & Localization:**
72
+ - Cross-platform GitHub Actions CI (Windows / macOS / Linux) and bilingual `README.md` (EN) + `README.vi.md` (VI).
@@ -0,0 +1,27 @@
1
+ # Contributing to TierForge Harness
2
+
3
+ Thank you for helping make local-first AI agent orchestration faster, safer, and more accessible!
4
+
5
+ ## Non-Negotiable Engineering Rules
6
+ All pull requests must pass automated CI (`pytest`, `ruff check`, `core/license_audit.py`, and `scripts/audit_step.py`) and strictly respect these 4 rules:
7
+
8
+ 1. **100% Python Stdlib in `core/`:** Do not introduce mandatory third-party runtime dependencies in `core/`. Optional extras (like `mcp`) belong in `pyproject.toml` under `[project.optional-dependencies]`.
9
+ 2. **Clean-Room MIT Licensing:** Never embed, vendor, or depend on `BUSL-1.1` (e.g., standard `rtk-engine`/`rtk-proxy`), `AGPL-3.0`, or `CC-BY-NC` code or weights.
10
+ 3. **Zero OS-Mutation Policy:** Never add scripts that edit Windows Registry, OS services, system pagefiles, or network stacks.
11
+ 4. **Cross-Platform & Domain-Agnostic:** Code must work cleanly on Windows, macOS, and Linux with zero hardcoded personal paths or private business logic.
12
+
13
+ ## Local Development Workflow
14
+
15
+ ```bash
16
+ # Install dev tools (pytest + ruff)
17
+ uv sync --extra dev
18
+
19
+ # Run tests, linter, and automated step audit
20
+ uv run --extra dev ruff check .
21
+ uv run --extra dev pytest -v
22
+ uv run --extra dev python scripts/audit_step.py --step pr_check
23
+ ```
24
+
25
+ ## Documentation & Localization
26
+ - Default documentation is in international English (`README.md`).
27
+ - Vietnamese localization is maintained in `README.vi.md`; additional community translations (`README.<lang>.md`) are warmly welcomed.
@@ -0,0 +1,22 @@
1
+ # TierForge Harness — Legal, Licensing & Commercial Compliance
2
+
3
+ ## 1. Open-Source License Hygiene (100% Commercial-Safe)
4
+ - **Core (`core/`):** 100% Python Standard Library (`stdlib_pure = true`), zero third-party runtime dependencies.
5
+ - **Strictly Banned Dependencies:** Automated `core/license_audit.py` blocks any AGPL, CC-BY-NC, or BUSL-1.1 packages (`DepthFlow`, `InsightFace`/`buffalo_l`, `Depth Anything V2 Base/Large`, `rtk`).
6
+ - **Automated Enforcement:** Every step/release is gated by `scripts/audit_step.py` (`license_passed = true` required).
7
+
8
+ ## 2. Web AI Platform Terms & BYOA (Bring Your Own Account)
9
+ - **User-Owned Sessions Only:** TierForge is a **local productivity harness**. Users authenticate with their own accounts on their own machines. TierForge **never** resells API access, pools/shares accounts, or distributes credentials.
10
+ - **No Anti-Bot / CAPTCHA Bypass:** TierForge strictly prohibits bypassing CAPTCHAs, proof-of-work challenges, rate limits, or access controls. If a platform presents a verification prompt, execution pauses for the user.
11
+ - **Respect Platform Limits:** Users remain responsible for complying with the Terms of Service of the third-party AI services they connect to (Google Gemini, OpenAI ChatGPT, Anthropic Claude, etc.). For high-volume commercial workloads, official paid API keys are recommended via Tier-0/API adapters.
12
+
13
+ ## 3. Browser Extension Store Compliance (Chrome Web Store / Edge Add-ons / Firefox AMO)
14
+ - **Single Purpose:** Connects the user's local TierForge harness (`127.0.0.1:19876`) to the user's own AI web tabs.
15
+ - **Data Privacy (Zero Data Collected):**
16
+ - Zero cloud servers, zero analytics, zero third-party telemetry.
17
+ - Strictly scoped `host_permissions`: `http://127.0.0.1:19876/*` and the 4 supported AI web apps only (never `<all_urls>`, `cookies`, `history`, or `webRequest`).
18
+ - **Security Controls:**
19
+ - Localhost-only binding (`127.0.0.1`).
20
+ - TOFU (Trust-On-First-Use) Origin Pinning blocks websites and rogue extensions with `HTTP 403`.
21
+ - Visible `RUN` badge, local Activity Log, and 1-click **Pause Bridge** kill switch.
22
+ - 100% unminified, human-auditable JavaScript source.
vieforge-0.4.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 VieForge Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.