Compare commits

...
3 Commits
2 changed files with 99 additions and 8 deletions

No files matched your search

+41 -8
View File
@@ -1,12 +1,24 @@
import subprocess, sys, os
import os
import subprocess
import sys
import tempfile
HERE = os.path.dirname(os.path.abspath(__file__))
SCRIPT = os.path.join(HERE, "shadow_lint.py")
def run(src):
p = "/tmp/scratchpad/test_shadow.py"
os.makedirs("/tmp/scratchpad", exist_ok=True)
open(p,"w").write(src)
r = subprocess.run([sys.executable, SCRIPT, p], capture_output=True, text=True)
# Each case gets its own directory. The fixture used to be one fixed path,
# /tmp/scratchpad/test_shadow.py, shared by every process on the host: two
# concurrent runs of this gate (another lane, a second CHECK) overwrote
# each other's source between the write and shadow_lint's read, so a case
# graded a neighbour's fixture -- measured 10/10 concurrent rounds red,
# with e.g. the import case reporting the loop-target case's finding.
with tempfile.TemporaryDirectory(prefix="shadow_case_") as d:
p = os.path.join(d, "case.py")
with open(p, "w") as fh:
fh.write(src)
r = subprocess.run([sys.executable, SCRIPT, p], capture_output=True, text=True)
return r.returncode, r.stdout + r.stderr
def test_param_shadow():
@@ -34,11 +46,32 @@ def test_with_as_shadow():
rc, out = run("def outer():\n f = 1\n def inner():\n with open('/dev/null') as f:\n pass\n")
assert rc == 1 and "with-as" in out
def test_fixture_isolation():
"""Regression: the fixture path must be per call, not one host-wide file.
With the old fixed /tmp/scratchpad path, two gate runs in the same second
graded each other's source -- measured 10/10 concurrent rounds red, e.g.
the import case reporting `shadowed name 'i' (loop-target)`.
"""
import inspect, threading
assert "TemporaryDirectory" in inspect.getsource(run), "run() needs a per-call temp dir"
got = {}
cases = {
"import": "import os\ndef f():\n import os\n return os\n",
"with-as": "def outer():\n f = 1\n def inner():\n with open('/dev/null') as f:\n pass\n",
}
def one(key, src):
got[key] = run(src)
threads = [threading.Thread(target=one, args=(k, s)) for k, s in cases.items()]
for t in threads:
t.start()
for t in threads:
t.join()
assert got["import"][0] == 1 and "import" in got["import"][1]
assert got["with-as"][0] == 1 and "with-as" in got["with-as"][1]
if __name__ == "__main__":
for name in [n for n in globals() if n.startswith("test_")]:
globals()[name]()
print("PASS", name)
print("ALL PASS")
if __name__ == "__main__":
pass
@@ -0,0 +1,58 @@
FREE-TIER AI CODING CLI BRIEF — OCT 2026
==========================================
Compiled: 2026-10-28 | Sources: Superblocks (Aug 2026), Paradev (Oct 13 2026)
Lane: Draft — verifiable, cited, ready to ship.
1. THE LANDSCAPE IN TWO FACTS
-----------------------------
a) Only four major agents offer ANY free tier:
- OpenAI Codex CLI (limited use via ChatGPT Free; Apache-2.0)
- Google Antigravity CLI (weekly limits; proprietary)
- GitHub Copilot CLI (free tier; proprietary)
- Mistral Vibe (limited free tier; Apache-2.0)
b) The truly zero-cost path is open-source + bring-your-own-key:
- OpenCode (MIT, 75+ providers, 214K GitHub stars as of Oct 2026)
- Pi (MIT, any provider)
- Hermes Agent (MIT, any provider)
- Goose (Apache-2.0, 15+ providers)
2. HEAD-TO-HEAD: THE FREE-TIER RELEVANT ONES
--------------------------------------------
Tool | Free tier? | License | Model lock-in | Notes
----------------|------------|---------|---------------|-------------------------------
Claude Code | NO | Proprietary | Anthropic only | $20/mo Pro, $100-200/mo Max; deepest reasoning
OpenAI Codex | Limited | Apache-2.0 | OpenAI only (plans) | Ships Rust CLI; Go $8/mo, Plus $20/mo
OpenCode | Yes* | MIT | None | 75+ providers; free; $0 if you bring a free/local model
Antigravity CLI | Yes | Proprietary | Google + others | Weekly limits; free with Google account
Copilot CLI | Yes | Proprietary | Claude/GPT/Gemini/Grok/Kimi | $10/mo Pro; free tier included
Mistral Vibe | Yes | Apache-2.0 | Mistral + others | Free tier; Pro $14.99/mo
Hermes Agent | Yes* | MIT | None | Free open-source agent; any provider via Nous Portal
*BYOK = bring your own API key or run a local model. Tool is free; you pay the provider.
3. VERDICT FOR FREE-TIER / SOVEREIGN OPERATORS
----------------------------------------------
If you will not pay vendors and want terminal-native coding agents:
1) OpenCode is the strongest zero-cost CLI — MIT, 75+ providers, subagents, TUI + IDE.
2) Hermes Agent is equivalent for orchestration (MIT, any provider, subagents, worktrees).
3) Codex CLI is the best "limited free" from a major lab, but model choice is restricted to OpenAI without an API key.
4) Claude Code is excluded from the free tier entirely.
4. ACTIONABLE CHOICE MATRIX
---------------------------
Scenario | Pick
-----------------------------------|-------------------------------
Zero dollars, any model | OpenCode or Hermes Agent
Zero dollars, Google ecosystem | Antigravity CLI
Already paying for ChatGPT Plus | Codex CLI
Already paying for GitHub Pro | Copilot CLI
Deep reasoning, budget available | Claude Code Pro ($20)
5. SOURCES
----------
- Superblocks, "9 Best Claude Code Alternatives I Compared for 2026", Aug 11 2026
https://www.superblocks.com/blog/claude-code-alternative
- Paradev, "Best AI Coding Agents in 2026: Claude Code, Codex, Antigravity, and 15 More Compared",
facts checked Oct 13 2026
https://superset.sh/compare/best-coding-agents