A cognitive runtime that keeps coding agents from caving in
It exists because RLHF-trained coding models tend to collapse into blind obedience and self-similar loops, and someone needed to hook the runtime to make them push back.

What it does
Tianshu is a TypeScript agent runtime that shares one kernel between a pure-ANSI terminal TUI and a Tauri desktop GUI. It runs multi-step coding tasks through DeepSeek V4 (with claimed 95–99% prefix-cache hit rates in long sessions) and orchestrates multiple agent modes—read-only /scout, parallel /team, deliberative /council, and deep /galaxy. Project memory lives in a local JSONL file, and old context is recalled explicitly rather than stuffed automatically into every prompt.
The interesting bit
The maintainers treat model degradation as a systems problem, not a weights problem. Their Cognitive Virtual Machine (CVM) layers 72 runtime hooks across five stages to trap what they call “surrender protocols” and “causal collapse”—behavioral tics they attribute to RLHF and transformer attention mechanics. An A/B test documented in the repo claims the same DeepSeek-V4-Flash model went from 0 to 3 active objections and 1 to 4 intent-over-literal executions when the CVM switch was flipped, with zero added inference cost.
Key highlights
- Terminal and desktop share the exact same agent kernel; you switch interfaces without losing state.
- Prefix caching is engineered as a first-class concern—frozen prefixes, incremental appendices, and boundary compression—to keep long-session costs down.
- Memory governance is strict: only constraint-class knowledge auto-injects; everything else waits for an explicit recall signal.
- The test suite is nearly as large as the source (roughly 0.99:1 lines of test to code, per the README’s metrics table).
- Star-domain “cognitive postures” split planning and execution across separate sessions so planners don’t drown in implementation detail.
Caveats
- Linux Wayland support is unverified, and voice input is unavailable on Linux due to missing upstream Whisper builds.
- Windows users need WebView2 Runtime ≥ 120; older versions cause scrolling stutter, and the installer now carries an offline repair tool for locked-down environments.
Verdict
Worth a look if you want a deeply opinionated, hook-heavy agent runtime that treats model alignment drift as an engineering bug rather than a prompt-engineering puzzle. Skip it if you need a mature, batteries-included IDE integration or if cross-platform desktop parity is non-negotiable today.
Frequently asked
- What is huiliyi37/Tianshu-harness?
- It exists because RLHF-trained coding models tend to collapse into blind obedience and self-similar loops, and someone needed to hook the runtime to make them push back.
- Is Tianshu-harness open source?
- Yes — huiliyi37/Tianshu-harness is open source, released under the Apache-2.0 license.
- What language is Tianshu-harness written in?
- huiliyi37/Tianshu-harness is primarily written in TypeScript.
- How popular is Tianshu-harness?
- huiliyi37/Tianshu-harness has 1.2k stars on GitHub and is currently accelerating.
- Where can I find Tianshu-harness?
- huiliyi37/Tianshu-harness is on GitHub at https://github.com/huiliyi37/Tianshu-harness.