tether-sdk 0.2.3__tar.gz → 0.2.4__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 (137) hide show
  1. tether_sdk-0.2.4/.claude/feature-context/active/.gitkeep +0 -0
  2. tether_sdk-0.2.4/.claude/feature-context/active/v0-2-bugs.md +75 -0
  3. tether_sdk-0.2.4/.claude/feature-context/archive/.gitkeep +0 -0
  4. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/AGENTS.md +32 -5
  5. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/PKG-INFO +1 -1
  6. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/architecture.md +1 -1
  7. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/reference/context-and-store.md +1 -1
  8. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/release-notes.md +22 -0
  9. tether_sdk-0.2.4/docs/testing.md +84 -0
  10. tether_sdk-0.2.4/e2e/__init__.py +0 -0
  11. tether_sdk-0.2.4/e2e/conftest.py +159 -0
  12. tether_sdk-0.2.4/e2e/proxy.py +252 -0
  13. tether_sdk-0.2.4/e2e/test_agents.py +86 -0
  14. tether_sdk-0.2.4/e2e/test_defaults.py +89 -0
  15. tether_sdk-0.2.4/e2e/test_faults.py +66 -0
  16. tether_sdk-0.2.4/e2e/test_lifecycle.py +68 -0
  17. tether_sdk-0.2.4/e2e/test_limits.py +44 -0
  18. tether_sdk-0.2.4/e2e/test_quirks.py +127 -0
  19. tether_sdk-0.2.4/e2e/test_sandbox.py +50 -0
  20. tether_sdk-0.2.4/e2e/test_surface.py +159 -0
  21. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/mkdocs.yml +1 -0
  22. tether_sdk-0.2.4/scripts/record_golden.py +42 -0
  23. tether_sdk-0.2.4/tests/golden/coding_edit_failure_modes.json +51 -0
  24. tether_sdk-0.2.4/tests/golden/coding_edit_failure_modes.snap.json +483 -0
  25. tether_sdk-0.2.4/tests/golden/done_nudge.json +45 -0
  26. tether_sdk-0.2.4/tests/golden/done_nudge.snap.json +483 -0
  27. tether_sdk-0.2.4/tests/golden/read_range_pingpong.json +38 -0
  28. tether_sdk-0.2.4/tests/golden/read_range_pingpong.snap.json +258 -0
  29. tether_sdk-0.2.4/tests/golden/research_web.json +41 -0
  30. tether_sdk-0.2.4/tests/golden/research_web.snap.json +256 -0
  31. tether_sdk-0.2.4/tests/golden/waiting_input_resume.json +30 -0
  32. tether_sdk-0.2.4/tests/golden/waiting_input_resume.snap.json +78 -0
  33. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/providers/test_retry.py +50 -0
  34. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/test_agent_interface.py +2 -1
  35. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/test_context.py +7 -0
  36. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/test_edit_tool.py +61 -0
  37. tether_sdk-0.2.4/tests/test_golden.py +102 -0
  38. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/test_harness.py +50 -1
  39. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/test_multiplexer.py +15 -0
  40. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/test_store.py +71 -0
  41. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/test_tether.py +1 -1
  42. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/__init__.py +1 -1
  43. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/context.py +15 -7
  44. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/harness.py +52 -3
  45. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/multiplexer.py +12 -0
  46. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/providers/base.py +14 -6
  47. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/store.py +27 -2
  48. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/tools/edit.py +57 -6
  49. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/.github/workflows/ci.yml +0 -0
  50. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/.github/workflows/delivery.yml +0 -0
  51. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/.github/workflows/docs.yml +0 -0
  52. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/.gitignore +0 -0
  53. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/LICENSE +0 -0
  54. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/README.md +0 -0
  55. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/benchmarks.md +0 -0
  56. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/extending.md +0 -0
  57. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/index.md +0 -0
  58. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/javascripts/mathjax.js +0 -0
  59. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/reference/agent-interface.md +0 -0
  60. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/reference/harness.md +0 -0
  61. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/reference/index.md +0 -0
  62. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/reference/multiplexer-and-decorator.md +0 -0
  63. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/reference/providers.md +0 -0
  64. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/reference/sandbox-and-skills.md +0 -0
  65. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/reference/tools.md +0 -0
  66. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/releasing.md +0 -0
  67. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/troubleshooting.md +0 -0
  68. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/tutorial/agent-interface.md +0 -0
  69. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/tutorial/built-in-tools.md +0 -0
  70. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/tutorial/cli-and-headless.md +0 -0
  71. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/tutorial/index.md +0 -0
  72. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/tutorial/multi-agent.md +0 -0
  73. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/tutorial/sdk-and-custom-tools.md +0 -0
  74. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/tutorial/security-and-sandbox.md +0 -0
  75. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/tutorial/skills.md +0 -0
  76. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/docs/tutorial/workflows-and-telemetry.md +0 -0
  77. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/examples/course/README.md +0 -0
  78. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/examples/course/checks.py +0 -0
  79. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/examples/course/course.yaml +0 -0
  80. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/examples/course/ruff.toml +0 -0
  81. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/examples/course/skills/planner/SKILL.md +0 -0
  82. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/examples/course/skills/searcher/SKILL.md +0 -0
  83. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/examples/course/skills/searcher/tools.py +0 -0
  84. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/examples/course/skills/writer/SKILL.md +0 -0
  85. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/examples/course/skills/writer/tools.py +0 -0
  86. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/pyproject.toml +0 -0
  87. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/skills/researcher/SKILL.md +0 -0
  88. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/__init__.py +0 -0
  89. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/conftest.py +0 -0
  90. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/fixtures/dialects.jsonl +0 -0
  91. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/providers/__init__.py +0 -0
  92. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/providers/test_anthropic.py +0 -0
  93. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/providers/test_base.py +0 -0
  94. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/providers/test_declarative.py +0 -0
  95. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/providers/test_dialects.py +0 -0
  96. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/providers/test_ollama.py +0 -0
  97. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/providers/test_openai.py +0 -0
  98. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/test_cli.py +0 -0
  99. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/test_context_config.py +0 -0
  100. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/test_decorator.py +0 -0
  101. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/test_integration.py +0 -0
  102. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/test_misses.py +0 -0
  103. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/test_pipeline.py +0 -0
  104. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/test_release_hardening.py +0 -0
  105. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/test_retro.py +0 -0
  106. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/test_sandbox.py +0 -0
  107. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/test_security_hardening.py +0 -0
  108. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/test_skills.py +0 -0
  109. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/test_structured_history.py +0 -0
  110. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/tools/__init__.py +0 -0
  111. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/tools/test_agent.py +0 -0
  112. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/tools/test_bash.py +0 -0
  113. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/tools/test_done.py +0 -0
  114. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/tools/test_edit.py +0 -0
  115. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/tools/test_mem.py +0 -0
  116. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tests/tools/test_web.py +0 -0
  117. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/api.py +0 -0
  118. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/cli.py +0 -0
  119. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/decorator.py +0 -0
  120. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/mcp.py +0 -0
  121. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/pipeline.py +0 -0
  122. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/providers/__init__.py +0 -0
  123. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/providers/anthropic.py +0 -0
  124. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/providers/declarative.py +0 -0
  125. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/providers/ollama.py +0 -0
  126. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/providers/openai.py +0 -0
  127. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/retro.py +0 -0
  128. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/sandbox.py +0 -0
  129. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/schema.py +0 -0
  130. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/skills.py +0 -0
  131. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/tools/__init__.py +0 -0
  132. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/tools/agent.py +0 -0
  133. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/tools/bash.py +0 -0
  134. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/tools/done.py +0 -0
  135. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/tools/mem.py +0 -0
  136. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/tether/tools/web.py +0 -0
  137. {tether_sdk-0.2.3 → tether_sdk-0.2.4}/uv.lock +0 -0
@@ -0,0 +1,75 @@
1
+ # v0.2 bugs
2
+ - Slug: v0-2-bugs
3
+ - Status: active
4
+ - Started: 2026-10-20 Updated: 2026-10-20 Closed: —
5
+ - Branches / PRs: branch `claude/keep-feature-context-resume-0ec918` (worktree); base `main` at 125b386 (release v0.2.2)
6
+
7
+ ## Goal
8
+ Track and fix bugs found in Tether v0.2.x. Exact bug list not yet given by PO.
9
+
10
+ ## Requests
11
+ - 2026-10-20: Close v0.2.2 milestone; implement v0.2.3 issues (#40 #39 #33 #24) via swe+tether(GLM), watch tether behavior and report bugs; open v0.2.4 issue for provider docs (YAML + Python, generic example, where providers.yaml lives); review docs overall and report.
12
+ - 2026-10-20: `/keep-feature-context new v0.2 bugs` (start log for v0.2 bugs work)
13
+
14
+ ## Decisions
15
+ - 2026-10-20: PO convention: v0.X.0 = feature releases (many issues OK), v0.X.Y = bug releases (small, 3-4). All 13 features now in single milestone v0.3 (v0.3.1-v0.3.3 deleted). Bug releases v0.2.4-v0.2.8 unchanged.
16
+ - 2026-10-20: PO: max 3-4 issues per release. Bugs by impact -> v0.2.4 (#85 #88 #75 #74), v0.2.5 (#86 #81 #92 #60), v0.2.6 (#76 #93 #27 #77), v0.2.7 (#79 #61 #62 #64), v0.2.8 (#63 #65 #66 docs). Features -> v0.3 (#89 #90 #78 #82), v0.3.1 (#34 #35 #32 #59), v0.3.2 (#7 #9 #8), v0.3.3 (#10 #11). Docs treated as lower-impact bugs; #60 (PO request) pulled to v0.2.5.
17
+ - 2026-10-20: PO approved: prepare release PR for v0.2.3 AND create the GitHub Release (tag v0.2.3, standard message like v0.2.2: title 'v0.2.3 <theme>', intro line, ### Features/### Fixes with (#N), Docs link) after the release PR merges. swe abb3128a53f9716b2 on release/v0.2.3.
18
+ - 2026-10-20: PO approved: after swe fixes reviewer minors on PR #73 (threshold 3x2-gram / 2x3-gram, softer nudge, offenders, tests) and CI is green -> post review comment then squash-merge #73, then start #33.
19
+ - 2026-10-20: PO: keep using GLM (small scoped runs, 1 retry then hand-finish) for #39 etc. to capture every tether issue, over switching to sonnet. #33 waits for #39 (harness.py).
20
+ - 2026-10-20: PO made me act as Team Leader (no product code; dispatch swe/qa/reviewer). swe delegates coding to tether; PO wants it run with GLM and observed for tether bugs.
21
+ - 2026-10-20: #24 -> opt-in kept + load-time warning + docs fix (maintainer lean, PO approved).
22
+ - 2026-10-20: Added `## Dev team specifics` to AGENTS.md (PR per task, hard stop = force push/history rewrite, store in-repo `.claude/feature-context/`).
23
+
24
+ ## Problems
25
+ - 2026-10-20: reviewer agent's own `gh pr review --comment` got blocked ('Unrequested Commit in a Connected App') and its merge condition needs a 'QA: GOOD TO GO' comment; TL posted the review+merge itself on PO instruction, works. Project has no QA layer beyond CI.
26
+ - 2026-10-20 TETHER+GLM BUGS (from swe #40, PR #68, 4 GLM runs, 0% pass, avg 25.5 steps, 2.8 syntax_errors/run): ses_32dbe34d max_steps 40, 102k prompt tokens, 0 changes: ~25 steps re-reading with `sed -n a,bp` (fold after 2 turns made it forget what it read); `bash -c "..."` errors, bare `ls` -> syntax_error+nudge; tried `mem recall` with mem disabled (exit 127). ses_b1816f3f (--fold-after 8 --context-tokens 16384): max_steps 50, 231k prompt tokens, produced mostly-correct edit.py but destructive edit (replaced `from __future__ import annotations` line instead of adding), never wrote tests/docs; 4 syntax_errors on `edit replace` (--help, bare --stdin, stdin after newline in cmd). ses_a8b72e53 ReadTimeout after 2 steps (132s). Loops show as repeated identical-ish `ok` reads, no loop_stall (#39). `tether read --full` invalid flag (docs/agent says it exists). Bash guard in swe worktree refuses compound commands.
27
+ - 2026-10-20 TETHER+GLM BUGS (from swe #24): (a) ses_bde86e86 glm-5.3 with --tools bash,edit: 38 steps/90k prompt tokens, read-loop alternating `sed -n 1,40p` / `40,100p` of same file, never edited; every assistant turn empty text + command only; no nudge/loop_stall recorded (= issue #39, cycle detection needed); ended `ReadTimeout` raised as tool_error/Worker error after ~5 min (httpx timeout not retried/handled). (b) ses_6176f368: without --tools bash,edit GLM had only `done`, spent 38 steps probing "unknown command", then WAITING_INPUT asking for a shell (tether default zero tools; unknown-command loops not nudged; could hint 'enabled tools: done' / tools to enable). (c) 401 shows raw HTTPStatusError, doesn't name NVIDIA_API_KEY. (d) swe worktree guard blocks eval/export/time in bash -> key loading needs a script file.
28
+ - 2026-10-20: swe #40 blocked: tether session ses_29d41cff (nvidia/z-ai/glm-5.3) -> 401 Unauthorized, 0 steps. NVIDIA_API_KEY missing/invalid in tether MCP server env. #24 swe confirmed same (ses_4a589057, 401, 686 ms). Both local branches empty, no PRs. Tether finding: 401 surfaces as raw HTTPStatusError, should name NVIDIA_API_KEY. Needs PO to supply key to MCP server env (not via me).
29
+ (none yet)
30
+
31
+ ## Progress log
32
+ - 2026-10-20: RELEASED v0.2.3: release PR #94 merged (ec32d63), GitHub Release v0.2.3 'Small-Model Robustness', delivery.yml success, PyPI tether-sdk 0.2.3 live, milestone v0.2.3 closed. Next: v0.2.4 (#27 #60 #74-#79 #81-#82 #85-#86 #88-#90 #92-#93) and v0.2.5 docs (#61-#66).
33
+ - 2026-10-20: PR #91 (#71) MERGED after minors fixed. v0.2.3 code-complete (all 8 issues merged). Release v0.2.3 (release: commit, PyPI via delivery.yml) needs PO OK. v0.2.4 open issues next.
34
+ - 2026-10-20: swe #71 -> PR #91 (95% hand; GLM ses_8ab3240d looped 40 steps on edit view ranges, cycle_stall missed). New issues #92 (varied-range view loops evade cycle_stall), #93 (tether query finds no chunks); comment on #76 (no `python` in sandbox). Reviewer on #91 running; standing PO ok: post findings + merge if reviewer clean.
35
+ - 2026-10-20: PR #87 (#70) MERGED. v0.2.3 merged: #24 #40 #39 #33 #69 #72 #70. swe dispatched for #71 (fix/71-clearer-errors) on GLM, last v0.2.3 issue. After it: release v0.2.3 needs PO OK (release commit/PyPI).
36
+ - 2026-10-20: PR #84 (#72) MERGED. #87 (#70) swe asked to merge main in; then review+merge, then dispatch #71 (extend providers/base.py helper; add release-notes bullet only after merging main).
37
+ - 2026-10-20: PO: 'if reviewer already looked, post findings and merge'. PR #83 (#69) MERGED. #84 and #87 now CONFLICTING (release-notes) -> swe #72 merging main into branch first; #87 after #84 merges. Then #71.
38
+ - 2026-10-20: PR #83 re-review CLEAN (CI green); minor: tombstone() duplicates store.py summary format. #84 green+clean. #87 minors being fixed. All three await PO merge yes.
39
+ - 2026-10-20: swe #70 -> PR #87 (post_with_retry + ProviderError; ~5% GLM; ses_2a4d5606 hung RUNNING 15+ min). PR #84 fixes pushed (830f4ca, CI green), PR #83 fixes pushed (re-review running). New issues #88 (total per-call deadline), #89 (tether stop), #90 (print session id to stderr at start). Reviewer on #87 running. #71 starts after #87 merges. PO yes needed for merges of #83/#84/#87 (asked for #84).
40
+ - 2026-10-20: Reviews: PR #83 (#69) BLOCKER (sed -i treated as read, path not normalized, bash writes leave stale reads, no cap on live reads) -> swe fixing. PR #84 (#72) clean + minors (mutually exclusive flags, stdout tests, doc) -> swe fixing. Merge needs PO yes per PR.
41
+ - 2026-10-20: swe #72 -> PR #84 (`tether read --full` alias, CLI default stays full; 100% hand-written, GLM ses_9ed228cd ignored goal for 31 steps). New issues: stale RUNNING after kill, goal-ignored/lost context. Reviewer for #84 next. #70 still running.
42
+ - 2026-10-20: swe #69 -> PR #83 (live_reads keeps latest unedited file read unfolded; mem_enabled hint). GLM ~30% of code. Reviewer dispatched review-only; PO merge OK needed.
43
+ - 2026-10-20: PR #80 (#33) MERGED after PO yes (review comment then squash). v0.2.3 left: #69 (context.py), #70 (providers), #72 (cli.py) in parallel on GLM; #71 after #70 (provider errors overlap).
44
+ - 2026-10-20: swe #33 -> PR #80 (gate_error), 100% hand-written (2 GLM runs: ReadTimeout at step 9 twice, 0 edits; ses_a82f3cb1, ses_458d2900). CI pending, reviewer dispatched (review-only). New issues #81 (context budget not hard limit, 16384 -> ~24k), #82 (gate dry-run, item 3 of #33); comment on #70. PO merge approval so far covered #67/#68/#73 only; ask for #80.
45
+ - 2026-10-20: PR #73 (#39) MERGED. v0.2.3 done: #24 (#67), #40 (#68), #39 (#73). swe dispatched for #33 (fix/33-gate-error-vs-failure) on GLM. Remaining v0.2.3: #33, #69-#72.
46
+ - 2026-10-20: PR #73 (#39 cycle_stall) opened by swe (GLM wrote ~70% of 116 additions; tests/docs partly by hand). CI green. Reviewer dispatched review-only. Issues opened from GLM runs: #74 no-done nudge, #75 max_steps counter 46/40, #76 verify gate can't run uv/ruff in sandbox, #77 stray ':memory:' file, #78 anchor-based edit replace, #79 stats offenders 'cd'/'unknown'; comments on #69, #70. PR #68 merged; AGENTS.md notes dropped per PO (only permanent facts).
47
+ - 2026-10-20: PR #68 (#40) MERGED (squash) after PO had me post the reviewer findings as a PR review comment first; classifier blocks bare merge ('Merge Without Review'). Remote merge fine; local branch delete failed (worktree holds it). Settings.json edit for gh pr review/merge allow rules still blocked (Self-Modification) -> PO to add if wanted.
48
+ - 2026-10-20: swe dispatched for #39 (fix/39-cycle-stall-detection) on GLM, small runs; #68 rebase in flight.
49
+ - 2026-10-20: PO approved squash-merge of #67/#68 (reviewer merges when CI green). #67 MERGED. #68 conflicts (release-notes, troubleshooting) -> swe resumed to merge main in + review nits (grammar, trailing-newline, 3 tests); reviewer re-merges after. Created v0.2.3 issues #69 (folding re-read loops), #70 (ReadTimeout retry), #71 (401/unknown-cmd errors), #72 (read --full mismatch); commented evidence on #39. PO: keep #66 bundled. Next: #39 then #33 (harness.py), model for them undecided (GLM unreliable: 0/4).
50
+ - 2026-10-20: swe #40 -> PR #68, hand-written after 2 GLM attempts; 188 tests pass. Awaiting CI check + review + PO merge OK.
51
+ - 2026-10-20: reviewer on PR #67: CLEAN, CI green (3.12/3.13, 100% cov), not merged (awaiting PO merge OK). Minor: no multi-tool test, 'they' wording, warning could name skill path.
52
+ - 2026-10-20: swe #24 -> PR #67 (c65a221), code written by swe itself after GLM failed twice. CI pending; reviewer dispatched (may merge if green). #40 swe still running.
53
+ - 2026-10-20: Wrapper ~/.tether/mcp-launch.sh + ~/.claude.json tether server repointed (backup ~/.claude.json.bak-tether); MCP reconnect is the PO's. Workaround that works now: swe uses tether CLI via Bash with key eval'd from ~/.profile (smoke test ses_279df4ad OK, GLM 1 step). Re-dispatched swe #40 and #24 on that route.
54
+ - 2026-10-20: PO approved all docs findings; created milestone v0.2.5 + issues #61 (CLI ref), #62 (dedupe providers docs), #63 (README restructure), #64 (llms.txt/index), #65 (tools.py opt-in wording), #66 (polish). Commented on #60. NVIDIA key is in ~/.profile but tether MCP processes lack it; waiting on PO to restart MCP with key.
55
+ - 2026-10-20: GLM id = `nvidia/z-ai/glm-5.3` (from public NVIDIA /v1/models; NVIDIA_API_KEY not in my env). Dispatched swe #40 (fix/40-edit-write-overwrite-summary) and swe #24 (fix/24-skill-tools-optin-warning), both via tether+GLM. Docs review report received (see Next steps for proposed issues). #39/#33 wait (both edit harness.py).
56
+ - 2026-10-20: milestone v0.2.2 closed. Issue #60 created (v0.2.4, provider docs). Docs review agent launched (read-only).
57
+ - 2026-10-20 (backfilled): preflight ran; AGENTS.md section + `.claude/feature-context/{active,archive}` created (uncommitted).
58
+ - Checks: `uv run ruff check . && uv run ruff format --check .`; `uv run mypy tether/`; `uv run pytest`.
59
+
60
+ ## Next steps
61
+ - [x] Release v0.2.3 done
62
+ - [ ] Start v0.2.4: #85 #88 #75 #74
63
+ - [ ] PO OK to merge #73 (post review comment first, then squash merge); then swe #33 (harness.py), then #69-#72, #74-#79 as scheduled
64
+ - [ ] Get GLM model id from PO (not in ~/.tether/providers.yaml; only claude-cli + nvidia entries; no 'glm' anywhere on disk). PO says it was added, maybe in another worktree/host: not found.
65
+ - [ ] Dispatch swe for #40 #39 #33 #24 (own PRs; #39/#33 both touch harness -> sequence), then qa+reviewer
66
+ - [ ] swe for #60 docs
67
+ - [ ] Relay docs review report to PO
68
+ - [ ] PO to list the v0.2 bugs
69
+ - [ ] Commit AGENTS.md + feature-context log on this branch
70
+
71
+ ## Sessions
72
+ | Date | Session note |
73
+ | 2026-10-20 | Current session: created log |
74
+
75
+ - 2026-10-20: PO asked: add Philosophy Gate to AGENTS.md (done, uncommitted; also fixed coverage line: CI enforces 100%). Switch swe tether model to `nvidia/nvidia/nemotron-3-ultra-550b-a55b` (exists on NVIDIA API, smoke test `done pong` passed via tether 0.2.3; no providers.yaml change needed, `nvidia` prefix covers it). Upgraded installed tether 0.2.2 -> 0.2.3 (`uv tool upgrade tether-sdk`). MCP server still on old process: needs reconnect to load 0.2.3 + key wrapper.
@@ -16,6 +16,18 @@ Tether implements the architectural principles from *"LLM-Native Applications as
16
16
  2. **Explicit Context Governance:** Context is treated as a bounded L1 working memory backed by an ACID SQLite store (`.tether/tether.db` in WAL mode)—never an unbounded append-only transcript.
17
17
  3. **First-Class AI Quality Attributes:** Every change must be evaluated against **Token Economy**, **KV-Cache Prefix Immutability**, **Self-Healing Probabilistic Execution**, and **Observability**.
18
18
 
19
+ ### Philosophy Gate (every issue, PR and review is judged against this)
20
+ Tether stays **lightweight, reliable, extensible, model-agnostic, easy to use, resourceful and a token saver**. A change that fails any line below is rejected or reworked, however useful it looks:
21
+ 1. **Lightweight:** no new heavy dependency (Rule 7); prefer stdlib and existing modules over new ones; no code for hypothetical needs.
22
+ 2. **Token saver:** no growth of the static prompt (< 150 tokens, Rule 1/4); new per-turn prompt content must be bounded and justified with a token-budget test.
23
+ 3. **Reliable:** failures self-heal or fail loudly with an actionable message, never hang or crash silently; the deterministic envelope (loop, SQLite, sandbox, `done`) never relies on the LLM.
24
+ 4. **Extensible:** new behaviour comes through providers, skills, `@tool` or config, not hardcoded special cases in the harness core.
25
+ 5. **Model-agnostic:** no behaviour tied to one vendor or model; small local models and frontier models take the same code path.
26
+ 6. **Easy to use:** zero-config defaults, short CLI/SDK surface, errors that say what to do next, docs in the same PR (5.4).
27
+ 7. **Resourceful:** reuse existing primitives (`act`, SQLite store, FTS5 recall) before adding a new one.
28
+
29
+ Reviewers and the Team Leader cite the failing line when they reject a change.
30
+
19
31
  ---
20
32
 
21
33
  ## 2. The Golden Rules (Non-Negotiable Invariants)
@@ -33,10 +45,11 @@ Tether implements the architectural principles from *"LLM-Native Applications as
33
45
  - Sessions do **not** terminate simply because the model emitted a text response without a tool call (small 9B models frequently "think out loud" before acting).
34
46
  - A task only completes when the agent explicitly calls `act("done", stdin="<final deliverable>")` (or `act("done '<short answer>'")`), pauses for human/parent input via `act("done --ask", stdin="<question>")` (transitioning the session to `WAITING_INPUT` and releasing the worker process until resumed via `send`), or hits `max_steps`.
35
47
  - If the model emits plain text without calling `act`, the harness appends a brief deterministic nudge reminding it to either execute a command or call `done`.
48
+ - After 6 consecutive read-only/verification steps following a change, the harness appends a one-shot `[NUDGE]` to that step's observation reminding the model to call `done` if the task is complete (0 static prompt tokens, #74).
36
49
  - When `verify` gate commands are configured (via `Harness(verify=[...])`, CLI `--verify`, or Skill YAML `verify: [...]`), `Harness.execute_session` deterministically executes each command inside the session's `SandboxPolicy` before allowing `done` to transition to `COMPLETED` (consuming 0 static prompt tokens until a gate fails). A gate that errors instead of failing (sandbox violation, exit 124/126/127) ends the session `FAILED` at once as `gate_error` ("gate misconfigured"), without counting toward the consecutive-failure abort.
37
50
 
38
51
  ### Rule 4: Progressive `--help` (JIT Schema Disclosure)
39
- - The system prompt lists at most **1 line per enabled tool namespace** (`<name> : <short summary>`, target **≤ 12 tokens per entry**).
52
+ - The system prompt lists at most **1 line per enabled tool namespace** (`- <name>: <short summary>`, target **≤ 12 tokens per entry**).
40
53
  - Full parameter signatures, defaults, and docstrings are revealed **Just-In-Time (JIT)** when:
41
54
  1. The model explicitly runs `<cmd> --help`, OR
42
55
  2. The model invokes `<cmd>` with missing/invalid arguments (self-healing error response, never an unhandled Python exception).
@@ -49,7 +62,7 @@ Tether implements the architectural principles from *"LLM-Native Applications as
49
62
  ```text
50
63
  [obs_3 folded: `web fetch https://...` (3,420 chars) | use `mem recall obs_3` to expand]
51
64
  ```
52
- - Exception: the latest read of each of the last 4 files (`edit view <p>`, `bash cat/head/tail/sed -n <p>`; paths normalized against the workspace) is not folded until `<p>` is edited (`edit write|replace`, or any other bash command naming it: `sed -i`, `tee`, redirects, `python -c`) or re-read. The 2,400-char head+tail elision still applies, and the hard context budget remains #81. The `mem recall` hint is shown only when `mem` is enabled (else "re-run the command").
65
+ - Exception: the latest read of each of the last 8 files (`edit view <p>`, `bash cat/head/tail/sed -n <p>`; paths normalized against the workspace) is not folded until `<p>` is edited (`edit write|replace`, or any other bash command naming it: `sed -i`, `tee`, redirects, `python -c`) or re-read. The 2,400-char head+tail elision still applies, and the hard context budget remains #81. The `mem recall` hint is shown only when `mem` is enabled (else "re-run the command").
53
66
  - History is replayed as structured `tool_calls` + `tool` results (providers with `structured_history = True`; textual `act('...')` form only as fallback), with `stdin` replayed as a real 400-char prefix, never a `<N chars>` placeholder. A call and its result are trimmed together.
54
67
 
55
68
  ### Rule 6: Deterministic Security Envelope (Never Trust the LLM for Safety)
@@ -115,6 +128,8 @@ tether/
115
128
  - `tether stats [--model <m>] [--skill <s>] [--limit <n>]` aggregates per-model pass rates, cumulative token economy (`total_prompt_tokens + total_completion_tokens`), step latency, and self-healing ACI friction (`nudge`, `loop_stall`, `cycle_stall`, `syntax_error`, `tool_error`, `gate_fail`, `gate_error`), plus a top-offenders breakdown by tool command.
116
129
  - **Post-Mortem Distillation (`tether retro <session_id> [--apply] [--model <m>]`):** offline only (never mutates a live prompt). `store.extract_friction_trace` pulls `inbox` corrections and `loop_stall`/`cycle_stall`/`syntax_error`/`tool_error`/`gate_fail`/`gate_error` turns (+ the fixing command); one bounded LLM pass yields ≤2 rules (≤30 tokens each, deduped against existing rules). Prints a unified diff of `SKILL.md`; `--apply` appends under `## Learned Rules` (or pins to project memory when no skill was used).
117
130
  - **Headless Worker & Live `send` Contract:**
131
+ - `max_steps` is the absolute session ceiling. `send` on a session that used its steps extends it to `step_count + <Harness budget>` (a session paused earlier keeps its remaining budget), so `step_count` never exceeds `max_steps` (#75).
132
+ - `SQLiteStore.get_session`/`list_sessions` reap dead workers: a `RUNNING` session whose stored `pid` is gone becomes `FAILED` with `Worker died (pid N) before finishing` (#85).
118
133
  - `tether run --headless ...` creates the session row in SQLite and spawns `python -m tether.cli _worker <session_id>` via `subprocess.Popen(..., start_new_session=True)`, printing `<session_id>` immediately to stdout.
119
134
  - Before each step, the running worker queries `inbox WHERE session_id = ? AND consumed = 0` and injects any new user/parent messages into the conversation.
120
135
  - If `tether send <session_id> "msg"` (or `agent send`) is called when the session is `WAITING_INPUT`, `COMPLETED`, or `FAILED`, it inserts the message into `inbox`, sets status back to `RUNNING`/`PENDING`, and spawns/resumes the worker from the persisted SQLite state.
@@ -157,7 +172,7 @@ tether/
157
172
  - `ANTHROPIC_API_KEY`, `ANTHROPIC_BASE_URL` (default `https://api.anthropic.com`)
158
173
 
159
174
  ---
160
- - **Timeout/retry (#70):** `providers.yaml` `timeout` applies to every kind; HTTP providers retry timeouts/network errors/429/5xx twice (`post_with_retry` in `providers/base.py`) then raise `ProviderError` naming provider, model and timeout.
175
+ - **Timeout/retry (#70):** `providers.yaml` `timeout` applies to every kind; HTTP providers retry timeouts/network errors/429/5xx twice (`post_with_retry` in `providers/base.py`) then raise `ProviderError` naming provider, model and timeout; each attempt is also bounded by a total `asyncio.wait_for(timeout)` deadline (#88).
161
176
  - **Context config (#54):** `max_context_tokens` / `fold_observations_after` resolve as explicit argument (`--context-tokens` / `--fold-after`, MCP `context_tokens` / `fold_after`) > `providers.yaml` entry keys `context_tokens` / `fold_after` > defaults 8192 / 2.
162
177
 
163
178
  ## 4. Development Workflow & Commands
@@ -189,7 +204,19 @@ uv run mypy tether/
189
204
  2. **Async-First Design:**
190
205
  - All model calls and I/O-bound tool executions must be `async`/`await` native, while seamlessly wrapping synchronous user `@tool` functions.
191
206
  3. **Graceful Degradation on 9B Hallucinations:**
192
- - Small models occasionally emit `cmd` with minor quirks (e.g., leading `$`, wrapping backticks, or calling a tool name directly instead of `act`). The multiplexer must normalize trivial syntax quirks deterministically before failing. This includes unescaping literal `\n`/`\t` in one-line `stdin` for `edit write`/`edit replace` and `done` (never `bash`).
193
- 4. **Documentation Integrity:**
207
+ - Small models occasionally emit `cmd` with minor quirks (e.g., leading `$`, wrapping backticks, or calling a tool name directly instead of `act`). The multiplexer must normalize trivial syntax quirks deterministically before failing. This includes unescaping literal `\n`/`\t` in one-line `stdin` for `edit write`/`edit replace` and `done` (never `bash`), and turning a trailing shell heredoc in `cmd` (`edit write f <<'EOF' ... EOF`) into `stdin` (never for `bash`).
208
+ 4. **Golden traces:** behaviour the model sees (framing, folding, nudges, tool output) is locked by `tests/golden/*.snap.json`. A PR that changes it runs `UPDATE_GOLDEN=1 pytest tests/test_golden.py` and the snapshot diff is part of the review; unrelated traces must not change. See `docs/testing.md`.
209
+ 5. **E2E scenarios:** every feature or bug fix ships with a scenario in `e2e/` (real CLI, real ollama behind a fault-injecting proxy, local only, `TETHER_E2E=1 uv run pytest e2e`). Assert on what tether sends and records, never on the model's skill; script the reply or inject the fault so the test does not depend on model potency. **Before merging any PR, run `TETHER_E2E=1 uv run pytest e2e` locally and put the result in the PR description (CI cannot run it). Every failure must be mitigated before merge: fix the code, or fix a wrong scenario, or record in the PR why it is acceptable and what follows up. A PR is not merged with an unexplained red scenario.** See `docs/testing.md`.
210
+ 6. **Documentation Integrity:**
194
211
  - Keep `README.md` and `AGENTS.md` synchronized whenever architectural interfaces or built-in tool signatures change.
195
212
  - **Always update documentation in the same PR** when introducing a new feature, changing an existing behavior, or altering a CLI/SDK interface. This covers `README.md`, `AGENTS.md`, the MkDocs pages under `docs/` (including `docs/reference/*` for new modules), and a `docs/release-notes.md` entry. A change without matching docs is incomplete.
213
+
214
+ ## Dev team specifics
215
+ - Stack: Python 3.12+, package `tether/`, tests in `tests/`, docs in `docs/` (MkDocs); `uv`, ruff, mypy
216
+ - Checks: lint `uv run ruff check . && uv run ruff format --check .`; types `uv run mypy tether/`; tests `uv run pytest --cov=tether --cov-report=term-missing --cov-fail-under=100` (CI enforces 100% coverage); **e2e `TETHER_E2E=1 uv run pytest e2e` run locally before every merge, result in the PR, failures mitigated** (not in CI)
217
+ - E2E / QA: `e2e/` scenarios (real CLI + ollama behind a fault-injecting proxy, local only); shared resource: the `tether-ollama` container (port 11435)
218
+ - Branches/commits/PRs: Conventional Commits (`feat(scope): ... (#N)`, `release: vX.Y.Z ...`); PR per task, squash-merged to `main`; docs updated in the same PR (see section 5.4)
219
+ - Delivery: PR per task
220
+ - Hard stops (ask first): force push / history rewrite
221
+ - Design docs: `AGENTS.md` sections 1-3, `docs/architecture.md`, `docs/reference/*`
222
+ - feature-context store: .claude/feature-context/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: tether-sdk
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: General-purpose, headless-first LLM-Native micro-harness for small language models
5
5
  Project-URL: Homepage, https://github.com/igormcsouza/tether
6
6
  Project-URL: Repository, https://github.com/igormcsouza/tether
@@ -58,7 +58,7 @@ Tether implements a deterministic three-tier memory hierarchy backed by `.tether
58
58
  ```text
59
59
  [obs_1 folded: `web fetch https://...` (3,420 chars) | use `mem recall obs_1` or `mem search <query>`]
60
60
  ```
61
- Exception (#69): the latest read of each of the last 4 files (`edit view <p>`, `bash cat/head/tail/sed -n <p>`; paths normalized against the workspace) is not folded until `<p>` is edited (`edit write|replace`, or any other bash command naming it: `sed -i`, `tee`, redirects, `python -c`) or re-read. The 2,400-char head+tail elision still applies, and the hard context budget remains #81. The `mem recall` hint is shown only when `mem` is enabled (else "re-run the command").
61
+ Exception (#69): the latest read of each of the last 8 files (`edit view <p>`, `bash cat/head/tail/sed -n <p>`; paths normalized against the workspace) is not folded until `<p>` is edited (`edit write|replace`, or any other bash command naming it: `sed -i`, `tee`, redirects, `python -c`) or re-read. The 2,400-char head+tail elision still applies, and the hard context budget remains #81. The `mem recall` hint is shown only when `mem` is enabled (else "re-run the command").
62
62
  3. **Sub-Millisecond SQLite FTS5 BM25 RAG**: Every raw observation and final deliverable is automatically chunked (~150 tokens per paragraph/section) and indexed into an FTS5 virtual table (`chunks_fts`) so the agent (or a parent agent) can retrieve exact passages via `mem search` or `agent query`.
63
63
 
64
64
  ---
@@ -22,7 +22,7 @@ When the provider sets `structured_history = True` (Ollama, OpenAI-compatible, A
22
22
 
23
23
  Raw tool outputs stay in the prompt for $K=2$ turns, then fold into a one-line tombstone (see [Built-in Tools](../tutorial/built-in-tools.md#mem-pinned-scratchpad-bm25-observation-recall)). For small models this has consequences ([#27](https://github.com/igormcsouza/tether/issues/27)), seen in the [course-builder example](https://github.com/igormcsouza/tether/tree/main/examples/course):
24
24
 
25
- - **Fix (#69).** Folding exception: the latest read of each of the last 4 files (`edit view <p>`, `bash cat/head/tail/sed -n <p>`; paths normalized against the workspace) is not folded until `<p>` is edited (`edit write|replace`, or any other bash command naming it: `sed -i`, `tee`, redirects, `python -c`) or re-read. The 2,400-char head+tail elision still applies, and the hard context budget remains #81. The `mem recall` hint is shown only when `mem` is enabled (else "re-run the command"). (`ContextAssembler(mem_enabled=..., workspace_root=...)`, `MAX_LIVE_READS`).
25
+ - **Fix (#69).** Folding exception: the latest read of each of the last 8 files (`edit view <p>`, `bash cat/head/tail/sed -n <p>`; paths normalized against the workspace) is not folded until `<p>` is edited (`edit write|replace`, or any other bash command naming it: `sed -i`, `tee`, redirects, `python -c`) or re-read. The 2,400-char head+tail elision still applies, and the hard context budget remains #81. The `mem recall` hint is shown only when `mem` is enabled (else "re-run the command"). (`ContextAssembler(mem_enabled=..., workspace_root=...)`, `MAX_LIVE_READS`).
26
26
  - **Re-viewing files loops, then invents data.** The model runs `edit view`, the output folds two turns later, it views again, and eventually writes from memory.
27
27
  - **What worked: one compact joined view, used right before the write, that ends with the exact next call.** The `course-source <module>` tool returns a module's plan and chosen videos in one output and finishes with `NOW WRITE THIS MODULE: act("edit write part-N.md", ...)`, so the data is still in the prompt when the write happens.
28
28
  - **Write long outputs in small pieces.** One big write dropped a whole section. The writer skill writes one `part-N.md` per module with `edit write`, then a `course-build` tool concatenates them into `course.md`.
@@ -1,5 +1,27 @@
1
1
  # Release Notes
2
2
 
3
+ ## v0.2.4 (2026-10-21)
4
+
5
+ Dogfooding fixes: the four milestone bugs (#74 #75 #85 #88) plus the friction found by running Tether on its own backlog with `nvidia/nemotron-3-ultra-550b-a55b` (two of the fixes were first written by Tether itself from scoped briefs), and two new regression layers: golden-trace replay in CI and 54 local end-to-end scenarios.
6
+
7
+ ### Features
8
+
9
+ - Tests: local end-to-end scenarios (`e2e/`, `TETHER_E2E=1 uv run pytest e2e`): the real CLI against a fault-injecting proxy in front of ollama; 54 scenarios cover the Golden Rules, lifecycle and exit codes, gates, faults (429, trickling hang, dead worker, auth), the sandbox, small-model quirks, sub-agents and pipelines, the OpenAI/Anthropic/command providers, MCP, web, skills' own tools, telemetry, `--no-network` and the context budget. Hard assertions are about tether's behaviour, so they hold for any model. See `docs/testing.md`.
10
+ - Tests: golden-trace replay (`tests/golden/`, `tests/test_golden.py`, `scripts/record_golden.py`). Recorded model steps run through the real harness and tools; the exact messages, events, tokens and files are snapshotted, so any behaviour change shows as a reviewable diff. See `docs/testing.md`.
11
+ - Edit: `edit replace <path>` also takes `<<<<<<< SEARCH` / `=======` / `>>>>>>> REPLACE` blocks in `stdin` (the format models know from Aider): exact-text match, each SEARCH must hit exactly once, all blocks apply atomically, no line numbers. A missing final `>>>>>>> REPLACE` is tolerated (models stop after the new text); a truncated block in the middle gets a specific error. Line-numbered `--lines` still works. Motivation: `cat | sed` reads carry no line numbers, so models re-read ranges forever trying to count lines.
12
+ - Harness: deterministic one-shot `[NUDGE]` appended to the observation after 6 consecutive read-only/verification steps following a file change, reminding the model to call `done` if the task is complete (0 static prompt tokens, #74).
13
+
14
+ ### Fixes
15
+
16
+ - Store: a `RUNNING` session whose worker pid no longer exists is flipped to `FAILED` (`Worker died (pid N) before finishing`) when read via `get_session`/`list_sessions`, so `status`, `list`, `wait` and `read` no longer report a killed worker as running forever (#85). A pid owned by another user counts as alive.
17
+ - Providers: `429` retries wait `Retry-After` (else 10s doubling, capped 30s) and get up to 5 attempts instead of 3 quick ones, so rate-limited hosted models (NVIDIA free tier) no longer fail the session after 3 quick attempts.
18
+ - Providers: each `post_with_retry` attempt is now bounded by a total `asyncio.wait_for(timeout)` deadline, so a trickling/stalled response cannot hang past the configured timeout; the deadline is retried like other transient errors and shows as `TimeoutError` (vs `ReadTimeout`) in the final `ProviderError` (#88).
19
+ - Harness: `max_steps` is now the absolute session ceiling. `send` on a session that used its steps extends the ceiling to `step_count + <Harness budget>`, and a session paused earlier keeps its remaining budget, so `status` never shows `step_count` above `max_steps` (e.g. `46/40`) (#75).
20
+ - Context: unfolded reads are tracked per path **and line range**. Viewing `f:55:65` used to evict the live `f:65:120` read, so the model ping-ponged between two ranges forever (found with `nvidia/nemotron-3-ultra-550b-a55b`, #69 follow-up).
21
+ - Context: the unfolded-read window is now the last 8 files (was 4); a model cycling through 5 files evicted each read just before needing it and re-read forever (#69 follow-up).
22
+ - Multiplexer: a trailing heredoc in `cmd` (`edit replace f --lines 1:1 <<'EOF'`) is now passed as `stdin` instead of failing with `requires replacement block in stdin` (never for `bash`). Found dogfooding `nvidia/nemotron-3-ultra-550b-a55b`, which never filled the `stdin` parameter in 150+ steps.
23
+ - Edit: `edit replace|write` on a `.py` file that stops parsing (e.g. a one-line replacement that lost its indentation) now ends the tool result with `WARNING: ... no longer parses: <msg> at line N. Fix it now.` so the model self-heals next step instead of discovering it ten steps later via pytest. 0 prompt tokens.
24
+
3
25
  ## v0.2.3 (2026-10-20)
4
26
 
5
27
  Dogfooding fixes: the issues came from running Tether with a small model (GLM-5.3) on its own backlog.
@@ -0,0 +1,84 @@
1
+ # Testing: golden traces
2
+
3
+ Tether is a deterministic envelope around a random model, so a change to framing, folding,
4
+ nudges, tools or retries can silently change what the model is shown. Golden traces make that
5
+ visible without a model, a network or any judgment.
6
+
7
+ Each `tests/golden/<name>.json` is a scripted session: workspace files, stubbed network
8
+ tools, the model's recorded steps and optional `send` phases. `tests/test_golden.py` replays
9
+ it through the **real** harness, multiplexer, `edit`/`done`/`mem` tools, context assembly and
10
+ folding, and compares everything against `<name>.snap.json`: the exact messages sent at every
11
+ step, event types, token estimates, final status/result and final workspace files.
12
+
13
+ - A PR that changes nothing the model sees keeps every snapshot green. A PR that does shows a
14
+ JSON diff to approve or reject in review.
15
+ - Intended change: `UPDATE_GOLDEN=1 uv run pytest tests/test_golden.py`, then review the diff.
16
+ - Record a real run: `python scripts/record_golden.py <db> <session_id> tests/golden/<name>.json --stub web`
17
+ (trim or sanitise third-party text first).
18
+
19
+ Shipped traces: a real researcher run (web stubbed, plain-text `done` nudges), a synthetic
20
+ coding run covering the edit failure modes seen with small models, and a `done --ask` /
21
+ `send` resume, and a range ping-pong (alternating views of one file; the latest read of each range stays unfolded, older ones fold). Add one for every behaviour that must not regress.
22
+
23
+ ## End-to-end scenarios (local, real processes, real ollama)
24
+
25
+ `e2e/` drives the real `tether` CLI in a throwaway workspace. A small fault-injecting proxy
26
+ (`e2e/proxy.py`) sits between tether and ollama, so a scenario can force the situation instead of
27
+ hoping a model produces it: answer `429`/`503`, trickle a never-ending body, stall, or **script the
28
+ reply** (a fixed tool call, no model). Scenarios assert on what tether sent and recorded (requests,
29
+ events, DB state, exit codes, files), so they hold for any model. Task success with a real model is
30
+ only a *soft* signal (a warning), never a gate.
31
+
32
+ ```bash
33
+ TETHER_E2E=1 uv run pytest e2e # ollama at localhost:11435 by default
34
+ TETHER_E2E_OLLAMA=http://localhost:11434 TETHER_E2E_MODELS=qwen3.5:9b,gemma4:e4b uv run pytest e2e
35
+ ```
36
+
37
+ It is local only (needs ollama, never runs in CI) and skips itself when `TETHER_E2E` is unset or
38
+ ollama does not answer. A scenario tagged *model* runs once per model in `TETHER_E2E_MODELS`;
39
+ *scripted* ones do not use the model at all, so they take a second.
40
+
41
+ | Feature / bug | Scenario | Kind |
42
+ |---|---|---|
43
+ | Zero optional tools by default, single `act` schema (Rule 2) | `test_defaults::no_optional_tools_by_default` | model |
44
+ | One short index line per enabled tool (Rule 4) | `enabled_tools_are_one_short_line_each` | model |
45
+ | Static prefix, KV-cache immutability (Rule 1) | `prefix_is_immutable_across_steps` | model |
46
+ | Static framing within the token budget (Rule 1/4) | `static_framing_fits_the_token_budget` (ollama's own `prompt_eval_count`) | model |
47
+ | Disabled built-in teaches how to enable it; JIT `--help` (Rule 4) | `disabled_builtin_tool_error...`, `missing_args_return_compact_help` | scripted |
48
+ | `done`, `done --ask` + `send`, exit codes 0/2/3/4/5 | `test_lifecycle` | scripted |
49
+ | `max_steps` is an absolute ceiling, resume never overshoots (#75) | `max_steps_exit_4_and_resume...` | scripted |
50
+ | Verify gates: fail + circuit breaker, broken gate = `gate_error` (#33), pass | `gate_*`, `broken_gate_*`, `passing_gate_*` | scripted |
51
+ | `--output-schema` rejects then accepts | `output_schema_rejects_then_accepts` | scripted |
52
+ | Headless run / wait / read / status | `headless_run_wait_read_status` | scripted |
53
+ | `429` retried, honoring `Retry-After` (#98) | `test_faults::429_is_retried...` | model |
54
+ | Persistent 5xx fails loudly, exit 5 (#70) | `persistent_5xx_fails_loudly...` | scripted |
55
+ | Trickling response hits the per-attempt deadline (#88) | `trickling_response_hits_the_per_attempt_deadline` | scripted |
56
+ | Auth error names the variable, never the value (#71) | `auth_error_names_the_variable...` | scripted |
57
+ | Killed worker reported `FAILED`, not `RUNNING` (#85) | `killed_worker_is_reported_failed...` | scripted |
58
+ | Sandbox: no writes outside the workspace, protected files, env scrub, SSRF guard, read-only profile (Rule 6) | `test_sandbox` | scripted |
59
+ | Heredoc in `cmd` becomes `stdin` (#97), bare shell command redirected to `bash`, `$`/backtick wrappers, literal `\n` | `test_quirks` | scripted |
60
+ | Plain-text reply nudged, never completes; loop and cycle stalls (#39) | `plain_text_reply...`, `identical_repeat...`, `two_command_cycle...` | scripted |
61
+ | `.py` parse warning, SEARCH/REPLACE blocks (#100) | `lost_indentation...`, `search_replace_block...` | scripted |
62
+ | One done-nudge after a quiet stretch (#74) | `quiet_stretch_after_a_change...` | scripted |
63
+ | Folding to a recallable tombstone (Rule 5), per-range reads (#99) | `old_observations_fold...`, `two_ranges_of_one_file...` | scripted |
64
+ | `mem` pin/search; skills enable tools without touching the schema | `mem_pins_...`, `skill_enables_its_tools...` | scripted |
65
+ | Sub-agents: spawn is async, `wait` digest is compact, `read --full`, `query`, `send` resumes a finished child | `test_agents::agent_*` | scripted |
66
+ | Child sandbox never wider than its parent | `child_sandbox_is_never_wider_than_the_parent` | scripted |
67
+ | Pipelines: stages in order, upstream digest reaches the next stage, `act` stays the only schema | `pipeline_runs_stages_in_order...` | scripted |
68
+ | OpenAI and Anthropic wire formats, declared `command` provider | `test_surface::*_wire_format`, `declared_command_provider` | scripted |
69
+ | `web search` via `SEARXNG_URL`, `web fetch` (private hosts allowed explicitly) | `web_search_uses_searxng_override`, `web_fetch_reads_a_page...` | scripted |
70
+ | A skill's own `tools.py`: listed tool runs, unlisted stays unknown and warns | `skill_tools_py_runs_when_listed`, `skill_tool_not_listed...` | scripted |
71
+ | `stats` / `events` / `misses`; `retro` never edits a skill without `--apply` | `stats_events_and_misses...`, `retro_proposes_rules...` | scripted |
72
+ | MCP server over stdio runs a session | `mcp_server_runs_a_session_over_stdio` | scripted |
73
+ | `--no-network` cuts what the default allows (with a control), hard context budget trims old history (with a control) | `test_limits::*` | scripted |
74
+
75
+ **Not covered yet** (add a scenario when touching them): the `claude`/`vllm` flavours of the HTTP
76
+ providers beyond the wire format, Anthropic prompt caching, `web fetch` against the real SSRF
77
+ list beyond loopback and metadata, `tether pipeline` verify gates and per-stage model routing,
78
+ `mem pin --project` across sessions, `retro --apply`, and the real-model-only checks that need a
79
+ judge (answer quality).
80
+
81
+ **Merge gate (manual, because CI cannot run it):** before merging a PR run `TETHER_E2E=1 uv run pytest e2e`, paste the summary into the PR, and mitigate every failure: fix the code, fix a wrong scenario, or write down in the PR why it is acceptable and what follows up. No unexplained red scenario is merged.
82
+
83
+ **Rule:** a new feature or bug fix ships with a scenario here. If a model must misbehave to
84
+ trigger it, script the reply; if infrastructure must fail, add a fault to the proxy.
File without changes
@@ -0,0 +1,159 @@
1
+ """e2e fixtures: real tether CLI, real processes, a fault-injecting proxy in front of ollama.
2
+
3
+ Local only (needs a running ollama). Enable with `TETHER_E2E=1`; point at ollama with
4
+ `TETHER_E2E_OLLAMA` (default http://localhost:11435) and pick models with `TETHER_E2E_MODELS`
5
+ (comma separated, default `qwen3.5:9b`). Scenarios marked "scripted" never use the model.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ import json
11
+ import os
12
+ import sqlite3
13
+ import subprocess
14
+ import sys
15
+ import warnings
16
+ from pathlib import Path
17
+ from typing import Any
18
+
19
+ import httpx
20
+ import pytest
21
+ import yaml
22
+
23
+ from e2e.proxy import Chaos
24
+
25
+ OLLAMA = os.environ.get("TETHER_E2E_OLLAMA", "http://localhost:11435")
26
+ MODELS = [m for m in os.environ.get("TETHER_E2E_MODELS", "qwen3.5:9b").split(",") if m]
27
+
28
+
29
+ def pytest_collection_modifyitems(config: pytest.Config, items: list[pytest.Item]) -> None:
30
+ reason = ""
31
+ if not os.environ.get("TETHER_E2E"):
32
+ reason = "e2e is local only: set TETHER_E2E=1"
33
+ else:
34
+ try:
35
+ httpx.get(f"{OLLAMA}/api/tags", timeout=3).raise_for_status()
36
+ except Exception as exc:
37
+ reason = f"ollama not reachable at {OLLAMA}: {exc}"
38
+ for item in items:
39
+ if "e2e" in str(item.fspath) and reason:
40
+ item.add_marker(pytest.mark.skip(reason=reason))
41
+
42
+
43
+ def pytest_generate_tests(metafunc: pytest.Metafunc) -> None:
44
+ if "model" in metafunc.fixturenames:
45
+ metafunc.parametrize("model", MODELS)
46
+
47
+
48
+ @pytest.fixture
49
+ def chaos() -> Any:
50
+ c = Chaos(OLLAMA)
51
+ yield c
52
+ c.close()
53
+
54
+
55
+ def soft(cond: bool, msg: str) -> None:
56
+ """A quality signal, not a gate: weak models may miss it. Shows up as a warning."""
57
+ if not cond:
58
+ warnings.warn(f"soft check missed: {msg}", stacklevel=2)
59
+
60
+
61
+ class Tether:
62
+ """Drive the real CLI in a throwaway workspace whose `e2e/<model>` provider is the proxy."""
63
+
64
+ def __init__(
65
+ self, tmp: Path, chaos: Chaos, model: str = "scripted", timeout: int = 120
66
+ ) -> None:
67
+ self.ws, self.home, self.chaos, self.model = tmp / "ws", tmp / "home", chaos, model
68
+ self.ws.mkdir()
69
+ self.home.mkdir()
70
+ providers = tmp / "providers.yaml"
71
+ providers.write_text(
72
+ yaml.safe_dump(
73
+ {
74
+ "e2e": {"kind": "ollama", "host": chaos.url, "timeout": timeout},
75
+ "e2eauth": {
76
+ "kind": "openai",
77
+ "base_url": f"{chaos.url}/v1",
78
+ "api_key_env": "E2E_KEY",
79
+ },
80
+ "e2eopenai": {
81
+ "kind": "openai",
82
+ "base_url": f"{chaos.url}/openai/v1",
83
+ "api_key_env": "E2E_KEY",
84
+ },
85
+ "e2eanthropic": {
86
+ "kind": "anthropic",
87
+ "base_url": f"{chaos.url}/anthropic",
88
+ "api_key_env": "E2E_KEY",
89
+ },
90
+ "e2ecmd": {
91
+ "kind": "command",
92
+ "argv": [sys.executable, str(tmp / "cmd_model.py")],
93
+ "stdin": "{conversation}",
94
+ "reply": "result",
95
+ "timeout": 30,
96
+ },
97
+ }
98
+ )
99
+ )
100
+ (tmp / "cmd_model.py").write_text(
101
+ "import json,sys\nsys.stdin.read()\n"
102
+ "print(json.dumps({'result': 'act(\"done\", stdin=\"from command\")'}))\n"
103
+ )
104
+ env = {
105
+ k: v for k, v in os.environ.items() if not k.endswith("_API_KEY") and k != "OLLAMA_HOST"
106
+ }
107
+ self.env = env | {
108
+ "HOME": str(self.home),
109
+ "TETHER_PROVIDERS": str(providers),
110
+ "E2E_KEY": "sekret-value-123",
111
+ }
112
+
113
+ def cli(
114
+ self, *args: str, timeout: int = 300, env: dict[str, str] | None = None
115
+ ) -> subprocess.CompletedProcess[str]:
116
+ return subprocess.run(
117
+ [sys.executable, "-m", "tether.cli", *args],
118
+ cwd=self.ws,
119
+ env=self.env | (env or {}),
120
+ capture_output=True,
121
+ text=True,
122
+ timeout=timeout,
123
+ )
124
+
125
+ def run(
126
+ self, goal: str, *flags: str, prefix: str = "e2e", timeout: int = 300
127
+ ) -> dict[str, Any]:
128
+ """`tether run --json`; returns the session dict plus `rc` and `stderr`."""
129
+ p = self.cli(
130
+ "run", "--json", "--model", f"{prefix}/{self.model}", *flags, goal, timeout=timeout
131
+ )
132
+ out = p.stdout.strip().splitlines()
133
+ data = json.loads(out[-1]) if out and out[-1].startswith("{") else {}
134
+ return data | {"rc": p.returncode, "stderr": p.stderr}
135
+
136
+ def send(self, sid: str, msg: str) -> dict[str, Any]:
137
+ p = self.cli("send", "--json", sid, msg)
138
+ out = p.stdout.strip().splitlines()
139
+ return (json.loads(out[-1]) if out and out[-1].startswith("{") else {}) | {
140
+ "rc": p.returncode
141
+ }
142
+
143
+ def turns(self, sid: str) -> list[dict[str, Any]]:
144
+ c = sqlite3.connect(f"file:{self.ws / '.tether' / 'tether.db'}?mode=ro", uri=True)
145
+ c.row_factory = sqlite3.Row
146
+ return [
147
+ dict(r) for r in c.execute("select * from turns where session_id=? order by id", (sid,))
148
+ ]
149
+
150
+ def events(self, sid: str) -> list[str]:
151
+ return [t["event_type"] for t in self.turns(sid) if t["role"] == "assistant"]
152
+
153
+ def tool_outputs(self, sid: str) -> list[str]:
154
+ return [t["content"] for t in self.turns(sid) if t["role"] == "tool"]
155
+
156
+
157
+ @pytest.fixture
158
+ def tether(tmp_path: Path, chaos: Chaos) -> Tether:
159
+ return Tether(tmp_path, chaos)