@yasaswy.nagavolu/agents 0.17.0 → 0.17.3
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.
- package/bin/cli.js +6 -0
- package/content/agents/idea-agent/council_fanout.py +34 -7
- package/content/agents/idea-agent/test_council_fanout.py +33 -3
- package/content/agents/plan-agent/plan_council_fanout.py +40 -9
- package/content/agents/plan-agent/test_plan_council_fanout.py +72 -2
- package/content/agents/review-agent/review_council_fanout.py +31 -7
- package/content/agents/review-agent/test_review_council_fanout.py +37 -3
- package/content/agents/scribe-agent/scribe_runner.py +2 -2
- package/content/global/CLAUDE.md +14 -18
- package/content/global/rules/ui-spacing.md +29 -0
- package/content/manifest.json +119 -10
- package/content/proxy/README.md +47 -4
- package/content/proxy/artifact_mocker_gate.py +1 -1
- package/content/proxy/credential_mutation_guard.py +1 -1
- package/content/proxy/execution_worker_review_gate.py +117 -8
- package/content/proxy/git_shell_parse.py +868 -0
- package/content/proxy/litellm/config.yaml +92 -16
- package/content/proxy/litellm/docker-compose.yml +1 -0
- package/content/proxy/portal/README.md +33 -0
- package/content/proxy/portal/register-autostart.ps1 +76 -0
- package/content/proxy/portal/supervise_portal_hidden.vbs +21 -0
- package/content/proxy/route_lock.py +103 -1
- package/content/proxy/shared_worktree_revert_guard.py +795 -0
- package/content/skills/html-mocker/annotate.js +15 -4
- package/content/skills/publish-article/SKILL.md +13 -9
- package/content/skills/publish-article/bundle_skill.py +10 -11
- package/content/skills/publish-article/publish_article.py +27 -7
- package/content/skills/publish-article/tests/test_publish_article.py +28 -8
- package/content/skills/session-trace/SKILL.md +1 -0
- package/content/skills/session-trace/test_trace.py +148 -0
- package/content/skills/session-trace/trace.py +38 -1
- package/content/statusline/statusline-command.ps1 +78 -56
- package/content/statusline/statusline-command.py +168 -0
- package/content/statusline/subagent-statusline-command.ps1 +105 -0
- package/content/statusline/subagent-statusline-command.py +89 -0
- package/lib/claims.js +57 -0
- package/lib/install.js +1 -1
- package/lib/selfProfile.js +9 -3
- package/lib/uninstall.js +45 -1
- package/lib/update.js +25 -2
- package/lib/wiring.js +184 -57
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -624,6 +624,12 @@ async function runUninstall(argv) {
|
|
|
624
624
|
`${result.filesKeptUserEdited.join(', ')}`
|
|
625
625
|
);
|
|
626
626
|
}
|
|
627
|
+
if (result.filesKeptShared.length > 0) {
|
|
628
|
+
console.log(
|
|
629
|
+
` Kept ${result.filesKeptShared.length} shared file(s) still claimed by other installed bundles: ` +
|
|
630
|
+
`${result.filesKeptShared.map((f) => `${f.file} (now owned by ${f.owner})`).join(', ')}`
|
|
631
|
+
);
|
|
632
|
+
}
|
|
627
633
|
if (result.mcpKeptUserEdited.length > 0) {
|
|
628
634
|
console.log(
|
|
629
635
|
` Kept ${result.mcpKeptUserEdited.length} MCP server entry(ies) edited since install: ` +
|
|
@@ -84,7 +84,25 @@ def build_prompt(goal, context):
|
|
|
84
84
|
return PANEL_PROMPT_NO_CONTEXT.format(goal=goal)
|
|
85
85
|
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
# DeepSeek-only addendum: the shared "No length limit" instruction above causes
|
|
88
|
+
# DeepSeek specifically to reliably fill the entire max_tokens budget regardless
|
|
89
|
+
# of prompt scope (confirmed via real calls on 2026-08-25 — it maxed out both a
|
|
90
|
+
# 16000 and a 24000 cap on both a broad and a narrow prompt), which reads as a
|
|
91
|
+
# truncation error in the call log every round. Gemini/Qwen/GLM don't show this
|
|
92
|
+
# behavior, so only DeepSeek's prompt gets this addendum — the other panels keep
|
|
93
|
+
# the unmodified "no length limit" instruction.
|
|
94
|
+
DEEPSEEK_BUDGET_ADDENDUM = """
|
|
95
|
+
|
|
96
|
+
Budget your answer to conclude cleanly within roughly 16,000-20,000 tokens. \
|
|
97
|
+
Prioritize depth on the highest-leverage points over exhaustive coverage of every \
|
|
98
|
+
possible angle — a focused, complete answer beats a broader one cut off mid-thought."""
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def build_deepseek_prompt(prompt):
|
|
102
|
+
return prompt + DEEPSEEK_BUDGET_ADDENDUM
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def call_litellm(prompt, key, model, max_tokens=4000, timeout=90):
|
|
88
106
|
url = "http://127.0.0.1:4000/chat/completions"
|
|
89
107
|
body = json.dumps({
|
|
90
108
|
"model": model,
|
|
@@ -98,7 +116,7 @@ def call_litellm(prompt, key, model, max_tokens=4000):
|
|
|
98
116
|
})
|
|
99
117
|
start = time.monotonic()
|
|
100
118
|
try:
|
|
101
|
-
with urllib.request.urlopen(req, timeout=
|
|
119
|
+
with urllib.request.urlopen(req, timeout=timeout) as r:
|
|
102
120
|
d = json.load(r)
|
|
103
121
|
choice = d["choices"][0]
|
|
104
122
|
msg = choice["message"]
|
|
@@ -120,7 +138,7 @@ def call_litellm(prompt, key, model, max_tokens=4000):
|
|
|
120
138
|
return PanelResult.failure(model, e, time.monotonic() - start)
|
|
121
139
|
|
|
122
140
|
|
|
123
|
-
def call_litellm_stream(prompt, key, model, max_tokens=4000):
|
|
141
|
+
def call_litellm_stream(prompt, key, model, max_tokens=4000, timeout=90):
|
|
124
142
|
"""Streaming variant required by models whose upstream rejects non-streaming
|
|
125
143
|
(e.g. litellm_qwen via Together AI). Accumulates delta.content chunks."""
|
|
126
144
|
url = "http://127.0.0.1:4000/chat/completions"
|
|
@@ -139,7 +157,7 @@ def call_litellm_stream(prompt, key, model, max_tokens=4000):
|
|
|
139
157
|
parts = []
|
|
140
158
|
truncated = False
|
|
141
159
|
try:
|
|
142
|
-
with urllib.request.urlopen(req, timeout=
|
|
160
|
+
with urllib.request.urlopen(req, timeout=timeout) as r:
|
|
143
161
|
for raw_line in r:
|
|
144
162
|
line = raw_line.decode("utf-8", "ignore").strip()
|
|
145
163
|
if not line or not line.startswith("data: "):
|
|
@@ -185,7 +203,7 @@ def main():
|
|
|
185
203
|
usage_msg="Usage: council_fanout.py 'raw goal' ['context']")
|
|
186
204
|
|
|
187
205
|
# Fail fast: if the proxy itself is unreachable, every panel below will fail
|
|
188
|
-
# the same way after its own (
|
|
206
|
+
# the same way after its own (90-240s) timeout. Detect that in ~1 request.
|
|
189
207
|
down_reason = preflight_proxy(or_key, caller="idea-council")
|
|
190
208
|
if down_reason:
|
|
191
209
|
render_and_exit([
|
|
@@ -193,9 +211,18 @@ def main():
|
|
|
193
211
|
for m in (GEMINI_MODEL, DEEPSEEK_MODEL, QWEN_MODEL, GLM_MODEL)
|
|
194
212
|
])
|
|
195
213
|
|
|
214
|
+
# Gemini and DeepSeek get raised max_tokens + timeout: Gemini's synthesis
|
|
215
|
+
# routinely runs 7-8k completion tokens (was hitting the old 8000 cap —
|
|
216
|
+
# observed truncation at 7669 and 7996 tokens on 2026-08-25), and DeepSeek
|
|
217
|
+
# is a reasoning model whose answers on multi-part goals regularly exceed
|
|
218
|
+
# the old 90s non-streaming request window AND the old 12000-token cap
|
|
219
|
+
# (observed a hard timeout at 90.02s and a max_tokens truncation at 95.62s
|
|
220
|
+
# the same day; a real 2026-08-25 proof call still truncated at 16000
|
|
221
|
+
# tokens after 164.91s, confirming 16000 is also too tight). Qwen and GLM
|
|
222
|
+
# have shown no timeout/truncation failures at their current limits.
|
|
196
223
|
with concurrent.futures.ThreadPoolExecutor(max_workers=4) as ex:
|
|
197
|
-
f_gemini = ex.submit(call_litellm, prompt, or_key, GEMINI_MODEL,
|
|
198
|
-
f_deepseek = ex.submit(call_litellm, prompt, or_key, DEEPSEEK_MODEL,
|
|
224
|
+
f_gemini = ex.submit(call_litellm, prompt, or_key, GEMINI_MODEL, 16000, 150)
|
|
225
|
+
f_deepseek = ex.submit(call_litellm, build_deepseek_prompt(prompt), or_key, DEEPSEEK_MODEL, 24000, 350)
|
|
199
226
|
f_qwen = ex.submit(call_litellm_stream, prompt, or_key, QWEN_MODEL, 8000)
|
|
200
227
|
f_glm = ex.submit(call_litellm, prompt, or_key, GLM_MODEL, 8000)
|
|
201
228
|
|
|
@@ -51,12 +51,12 @@ def test_one_panel_errors_others_succeed_exits_two(monkeypatch, capsys):
|
|
|
51
51
|
fails while the rest succeed — partial failure, not total, not silent."""
|
|
52
52
|
monkeypatch.setattr(m, "preflight_proxy", lambda key, timeout=5, caller=None: None)
|
|
53
53
|
|
|
54
|
-
def fake_call_litellm(prompt, key, model, max_tokens=2000):
|
|
54
|
+
def fake_call_litellm(prompt, key, model, max_tokens=2000, timeout=90):
|
|
55
55
|
if model == m.GLM_MODEL:
|
|
56
56
|
return m.PanelResult.failure(model, "HTTP 503: upstream error")
|
|
57
57
|
return m.PanelResult.success(model, f"analysis from {model}")
|
|
58
58
|
|
|
59
|
-
def fake_call_stream(prompt, key, model, max_tokens=2000):
|
|
59
|
+
def fake_call_stream(prompt, key, model, max_tokens=2000, timeout=90):
|
|
60
60
|
return m.PanelResult.success(model, f"analysis from {model}")
|
|
61
61
|
|
|
62
62
|
monkeypatch.setattr(m, "call_litellm", fake_call_litellm)
|
|
@@ -73,7 +73,7 @@ def test_one_panel_errors_others_succeed_exits_two(monkeypatch, capsys):
|
|
|
73
73
|
def test_all_panels_succeed_exits_zero(monkeypatch, capsys):
|
|
74
74
|
monkeypatch.setattr(m, "preflight_proxy", lambda key, timeout=5, caller=None: None)
|
|
75
75
|
|
|
76
|
-
def fake_call(prompt, key, model, max_tokens=2000):
|
|
76
|
+
def fake_call(prompt, key, model, max_tokens=2000, timeout=90):
|
|
77
77
|
return m.PanelResult.success(model, f"analysis from {model}")
|
|
78
78
|
|
|
79
79
|
monkeypatch.setattr(m, "call_litellm", fake_call)
|
|
@@ -84,3 +84,33 @@ def test_all_panels_succeed_exits_zero(monkeypatch, capsys):
|
|
|
84
84
|
captured = capsys.readouterr()
|
|
85
85
|
assert "PANEL FAILED" not in captured.out
|
|
86
86
|
assert captured.err == ""
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def test_deepseek_and_gemini_get_raised_limits(monkeypatch, capsys):
|
|
90
|
+
"""Regression guard for the 2026-08-25 timeout/truncation incident: DeepSeek
|
|
91
|
+
(reasoning model) and Gemini (long synthesis, was hitting its max_tokens cap)
|
|
92
|
+
must be fanned out with a higher max_tokens and timeout than the plain
|
|
93
|
+
4000/90 defaults, or they will fail again under real load."""
|
|
94
|
+
monkeypatch.setattr(m, "preflight_proxy", lambda key, timeout=5, caller=None: None)
|
|
95
|
+
calls = {}
|
|
96
|
+
|
|
97
|
+
def fake_call(prompt, key, model, max_tokens=4000, timeout=90):
|
|
98
|
+
calls[model] = (max_tokens, timeout)
|
|
99
|
+
return m.PanelResult.success(model, f"analysis from {model}")
|
|
100
|
+
|
|
101
|
+
def fake_call_stream(prompt, key, model, max_tokens=4000, timeout=90):
|
|
102
|
+
calls[model] = (max_tokens, timeout)
|
|
103
|
+
return m.PanelResult.success(model, f"analysis from {model}")
|
|
104
|
+
|
|
105
|
+
monkeypatch.setattr(m, "call_litellm", fake_call)
|
|
106
|
+
monkeypatch.setattr(m, "call_litellm_stream", fake_call_stream)
|
|
107
|
+
|
|
108
|
+
code = _run_main(monkeypatch, ["council_fanout.py", "goal"])
|
|
109
|
+
assert code == 0
|
|
110
|
+
|
|
111
|
+
deepseek_max_tokens, deepseek_timeout = calls[m.DEEPSEEK_MODEL]
|
|
112
|
+
gemini_max_tokens, gemini_timeout = calls[m.GEMINI_MODEL]
|
|
113
|
+
assert deepseek_max_tokens > 12000
|
|
114
|
+
assert deepseek_timeout > 90
|
|
115
|
+
assert gemini_max_tokens > 8000
|
|
116
|
+
assert gemini_timeout >= 90
|
|
@@ -88,7 +88,24 @@ def build_prompt(goal, context):
|
|
|
88
88
|
return PANEL_PROMPT_NO_CONTEXT.format(goal=goal)
|
|
89
89
|
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
# DeepSeek-only addendum: the shared "No length limit" instruction above causes
|
|
92
|
+
# DeepSeek specifically to reliably fill the entire max_tokens budget regardless
|
|
93
|
+
# of prompt scope (confirmed via real calls against idea-council's identical
|
|
94
|
+
# prompt trait on 2026-08-25), which reads as a truncation error in the call log
|
|
95
|
+
# every round. Gemini/Qwen/GLM don't show this behavior, so only DeepSeek's
|
|
96
|
+
# prompt gets this addendum — the other panels keep the unmodified instruction.
|
|
97
|
+
DEEPSEEK_BUDGET_ADDENDUM = """
|
|
98
|
+
|
|
99
|
+
Budget your answer to conclude cleanly within roughly 16,000-20,000 tokens. \
|
|
100
|
+
Prioritize depth on the highest-leverage points over exhaustive coverage of every \
|
|
101
|
+
possible angle — a focused, complete answer beats a broader one cut off mid-thought."""
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def build_deepseek_prompt(prompt):
|
|
105
|
+
return prompt + DEEPSEEK_BUDGET_ADDENDUM
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def call_litellm(prompt, key, model, max_tokens=6000, timeout=90):
|
|
92
109
|
url = "http://127.0.0.1:4000/chat/completions"
|
|
93
110
|
body = json.dumps({
|
|
94
111
|
"model": model,
|
|
@@ -103,9 +120,10 @@ def call_litellm(prompt, key, model, max_tokens=6000):
|
|
|
103
120
|
})
|
|
104
121
|
start = time.monotonic()
|
|
105
122
|
try:
|
|
106
|
-
with urllib.request.urlopen(req, timeout=
|
|
123
|
+
with urllib.request.urlopen(req, timeout=timeout) as r:
|
|
107
124
|
chunks = []
|
|
108
125
|
usage = None
|
|
126
|
+
truncated = False
|
|
109
127
|
for line in r:
|
|
110
128
|
line = line.decode("utf-8").strip()
|
|
111
129
|
if not line or not line.startswith("data: "):
|
|
@@ -116,7 +134,10 @@ def call_litellm(prompt, key, model, max_tokens=6000):
|
|
|
116
134
|
try:
|
|
117
135
|
d = json.loads(payload)
|
|
118
136
|
if "choices" in d and d["choices"]:
|
|
119
|
-
|
|
137
|
+
choice = d["choices"][0]
|
|
138
|
+
if choice.get("finish_reason") == "length":
|
|
139
|
+
truncated = True
|
|
140
|
+
delta = choice.get("delta", {})
|
|
120
141
|
text_chunk = delta.get("content") or delta.get("reasoning_content") or delta.get("reasoning") or ""
|
|
121
142
|
if text_chunk:
|
|
122
143
|
chunks.append(text_chunk)
|
|
@@ -124,9 +145,12 @@ def call_litellm(prompt, key, model, max_tokens=6000):
|
|
|
124
145
|
usage = d["usage"]
|
|
125
146
|
except json.JSONDecodeError:
|
|
126
147
|
continue
|
|
127
|
-
text = "".join(chunks)
|
|
128
|
-
_log_panel_call(model, time.monotonic() - start, usage
|
|
129
|
-
|
|
148
|
+
text = "".join(chunks).strip()
|
|
149
|
+
_log_panel_call(model, time.monotonic() - start, usage,
|
|
150
|
+
error="truncated: hit max_tokens" if truncated else None)
|
|
151
|
+
if truncated:
|
|
152
|
+
text += "\n\n[response truncated — hit max_tokens cap]"
|
|
153
|
+
return PanelResult.success(model, text, time.monotonic() - start)
|
|
130
154
|
except urllib.error.HTTPError as e:
|
|
131
155
|
detail = e.read().decode()[:300]
|
|
132
156
|
error = f"HTTP {e.code}: {detail}"
|
|
@@ -152,7 +176,7 @@ def main():
|
|
|
152
176
|
usage_msg="Usage: plan_council_fanout.py 'raw goal' ['context']")
|
|
153
177
|
|
|
154
178
|
# Fail fast: if the proxy itself is unreachable, every panel below will fail
|
|
155
|
-
# the same way after its own
|
|
179
|
+
# the same way after its own (90-350s) timeout. Detect that in ~1 request.
|
|
156
180
|
down_reason = preflight_proxy(or_key, caller="plan-council")
|
|
157
181
|
if down_reason:
|
|
158
182
|
render_and_exit([
|
|
@@ -160,9 +184,16 @@ def main():
|
|
|
160
184
|
for m in (GEMINI_MODEL, DEEPSEEK_MODEL, QWEN_MODEL, GLM_MODEL)
|
|
161
185
|
])
|
|
162
186
|
|
|
187
|
+
# Gemini and DeepSeek get raised max_tokens + timeout — mirrors the fix
|
|
188
|
+
# proven against idea-council on 2026-08-25 (same "No length limit" prompt
|
|
189
|
+
# trait, same models, same proxy): Gemini's synthesis runs 7-8k completion
|
|
190
|
+
# tokens (old 6000 cap was even tighter than idea-council's old 8000), and
|
|
191
|
+
# DeepSeek is a reasoning model whose answers regularly exceed the old 90s
|
|
192
|
+
# window and the old 8000-token cap. Qwen and GLM keep their defaults —
|
|
193
|
+
# no failures reported for them.
|
|
163
194
|
with concurrent.futures.ThreadPoolExecutor(max_workers=4) as ex:
|
|
164
|
-
f_gemini = ex.submit(call_litellm, prompt, or_key, GEMINI_MODEL,
|
|
165
|
-
f_deepseek = ex.submit(call_litellm, prompt, or_key, DEEPSEEK_MODEL,
|
|
195
|
+
f_gemini = ex.submit(call_litellm, prompt, or_key, GEMINI_MODEL, 16000, 150)
|
|
196
|
+
f_deepseek = ex.submit(call_litellm, build_deepseek_prompt(prompt), or_key, DEEPSEEK_MODEL, 24000, 350)
|
|
166
197
|
f_qwen = ex.submit(call_litellm, prompt, or_key, QWEN_MODEL, 6000)
|
|
167
198
|
f_glm = ex.submit(call_litellm, prompt, or_key, GLM_MODEL, 6000)
|
|
168
199
|
|
|
@@ -49,7 +49,7 @@ def test_proxy_fully_down_exits_one_not_zero(monkeypatch, capsys):
|
|
|
49
49
|
def test_one_panel_errors_others_succeed_exits_two(monkeypatch, capsys):
|
|
50
50
|
monkeypatch.setattr(m, "preflight_proxy", lambda key, timeout=5, caller=None: None)
|
|
51
51
|
|
|
52
|
-
def fake_call_litellm(prompt, key, model, max_tokens=3000):
|
|
52
|
+
def fake_call_litellm(prompt, key, model, max_tokens=3000, timeout=90):
|
|
53
53
|
if model == m.QWEN_MODEL:
|
|
54
54
|
return m.PanelResult.failure(model, "HTTP 503: upstream error")
|
|
55
55
|
return m.PanelResult.success(model, f"plan from {model}")
|
|
@@ -67,7 +67,7 @@ def test_one_panel_errors_others_succeed_exits_two(monkeypatch, capsys):
|
|
|
67
67
|
def test_all_panels_succeed_exits_zero(monkeypatch, capsys):
|
|
68
68
|
monkeypatch.setattr(m, "preflight_proxy", lambda key, timeout=5, caller=None: None)
|
|
69
69
|
monkeypatch.setattr(m, "call_litellm",
|
|
70
|
-
lambda prompt, key, model, max_tokens=3000:
|
|
70
|
+
lambda prompt, key, model, max_tokens=3000, timeout=90:
|
|
71
71
|
m.PanelResult.success(model, f"plan from {model}"))
|
|
72
72
|
|
|
73
73
|
code = _run_main(monkeypatch, ["plan_council_fanout.py", "goal"])
|
|
@@ -75,3 +75,73 @@ def test_all_panels_succeed_exits_zero(monkeypatch, capsys):
|
|
|
75
75
|
captured = capsys.readouterr()
|
|
76
76
|
assert "PANEL FAILED" not in captured.out
|
|
77
77
|
assert captured.err == ""
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
class _FakeStreamResponse:
|
|
81
|
+
"""Minimal stand-in for the urlopen(...) context manager, iterable over
|
|
82
|
+
raw SSE bytes lines the way call_litellm()'s `for line in r:` expects."""
|
|
83
|
+
def __init__(self, lines):
|
|
84
|
+
self._lines = lines
|
|
85
|
+
|
|
86
|
+
def __enter__(self):
|
|
87
|
+
return self
|
|
88
|
+
|
|
89
|
+
def __exit__(self, *a):
|
|
90
|
+
return False
|
|
91
|
+
|
|
92
|
+
def __iter__(self):
|
|
93
|
+
return iter(self._lines)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def test_call_litellm_marks_truncation_on_finish_reason_length(monkeypatch):
|
|
97
|
+
"""Regression guard: plan-council's call_litellm() previously never checked
|
|
98
|
+
finish_reason=="length" at all (unlike idea/review-council), so a
|
|
99
|
+
max_tokens truncation passed completely silently — no log entry, no marker
|
|
100
|
+
in the text, no way to distinguish it from a genuinely complete answer.
|
|
101
|
+
Mirrors idea-council's truncation-marker handling."""
|
|
102
|
+
lines = [
|
|
103
|
+
b'data: {"choices":[{"delta":{"content":"partial plan"},"finish_reason":null}]}\n',
|
|
104
|
+
b'data: {"choices":[{"delta":{},"finish_reason":"length"}],"usage":{"completion_tokens":6000}}\n',
|
|
105
|
+
b'data: [DONE]\n',
|
|
106
|
+
]
|
|
107
|
+
monkeypatch.setattr(m.urllib.request, "urlopen",
|
|
108
|
+
lambda req, timeout=90: _FakeStreamResponse(lines))
|
|
109
|
+
logged = {}
|
|
110
|
+
monkeypatch.setattr(m, "_log_panel_call",
|
|
111
|
+
lambda model, duration, usage, error=None: logged.update(error=error))
|
|
112
|
+
|
|
113
|
+
result = m.call_litellm("prompt", "key", m.DEEPSEEK_MODEL)
|
|
114
|
+
|
|
115
|
+
assert result.ok
|
|
116
|
+
assert "partial plan" in result.text
|
|
117
|
+
assert "[response truncated" in result.text
|
|
118
|
+
assert logged["error"] == "truncated: hit max_tokens"
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def test_deepseek_and_gemini_get_raised_limits(monkeypatch, capsys):
|
|
122
|
+
"""Regression guard mirroring idea-council's 2026-08-25 fix: DeepSeek
|
|
123
|
+
(reasoning model) and Gemini (long synthesis) must be fanned out with a
|
|
124
|
+
higher max_tokens and timeout than the plain 6000/90 defaults, or they
|
|
125
|
+
will fail again under real load. DeepSeek must also receive the budget
|
|
126
|
+
addendum, since it shares the "No length limit" prompt trait that made it
|
|
127
|
+
reliably fill any max_tokens budget."""
|
|
128
|
+
monkeypatch.setattr(m, "preflight_proxy", lambda key, timeout=5, caller=None: None)
|
|
129
|
+
calls = {}
|
|
130
|
+
|
|
131
|
+
def fake_call(prompt, key, model, max_tokens=6000, timeout=90):
|
|
132
|
+
calls[model] = (prompt, max_tokens, timeout)
|
|
133
|
+
return m.PanelResult.success(model, f"plan from {model}")
|
|
134
|
+
|
|
135
|
+
monkeypatch.setattr(m, "call_litellm", fake_call)
|
|
136
|
+
|
|
137
|
+
code = _run_main(monkeypatch, ["plan_council_fanout.py", "goal"])
|
|
138
|
+
assert code == 0
|
|
139
|
+
|
|
140
|
+
deepseek_prompt, deepseek_max_tokens, deepseek_timeout = calls[m.DEEPSEEK_MODEL]
|
|
141
|
+
gemini_prompt, gemini_max_tokens, gemini_timeout = calls[m.GEMINI_MODEL]
|
|
142
|
+
assert deepseek_max_tokens > 8000
|
|
143
|
+
assert deepseek_timeout > 90
|
|
144
|
+
assert gemini_max_tokens > 6000
|
|
145
|
+
assert gemini_timeout >= 90
|
|
146
|
+
assert "Budget your answer" in deepseek_prompt
|
|
147
|
+
assert "Budget your answer" not in gemini_prompt
|
|
@@ -88,7 +88,24 @@ def build_prompt(goal, diff):
|
|
|
88
88
|
return PANEL_PROMPT.format(goal=goal, diff=diff)
|
|
89
89
|
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
# DeepSeek-only addendum: the shared "No length limit" instruction above causes
|
|
92
|
+
# DeepSeek specifically to reliably fill the entire max_tokens budget regardless
|
|
93
|
+
# of prompt scope (confirmed via real calls against idea-council's identical
|
|
94
|
+
# prompt trait on 2026-08-25), which reads as a truncation error in the call log
|
|
95
|
+
# every round. Gemini/Qwen/GLM don't show this behavior, so only DeepSeek's
|
|
96
|
+
# prompt gets this addendum — the other panels keep the unmodified instruction.
|
|
97
|
+
DEEPSEEK_BUDGET_ADDENDUM = """
|
|
98
|
+
|
|
99
|
+
Budget your answer to conclude cleanly within roughly 16,000-20,000 tokens. \
|
|
100
|
+
Prioritize depth on the highest-leverage points over exhaustive coverage of every \
|
|
101
|
+
possible angle — a focused, complete answer beats a broader one cut off mid-thought."""
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def build_deepseek_prompt(prompt):
|
|
105
|
+
return prompt + DEEPSEEK_BUDGET_ADDENDUM
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def call_litellm(prompt, key, model, max_tokens=6000, timeout=120):
|
|
92
109
|
url = "http://127.0.0.1:4000/chat/completions"
|
|
93
110
|
body = json.dumps({
|
|
94
111
|
"model": model,
|
|
@@ -102,7 +119,7 @@ def call_litellm(prompt, key, model, max_tokens=6000):
|
|
|
102
119
|
})
|
|
103
120
|
start = time.monotonic()
|
|
104
121
|
try:
|
|
105
|
-
with urllib.request.urlopen(req, timeout=
|
|
122
|
+
with urllib.request.urlopen(req, timeout=timeout) as r:
|
|
106
123
|
d = json.load(r)
|
|
107
124
|
msg = d["choices"][0]["message"]
|
|
108
125
|
text = msg.get("content") or msg.get("reasoning_content") or msg.get("reasoning") or ""
|
|
@@ -118,7 +135,7 @@ def call_litellm(prompt, key, model, max_tokens=6000):
|
|
|
118
135
|
return PanelResult.failure(model, e, time.monotonic() - start)
|
|
119
136
|
|
|
120
137
|
|
|
121
|
-
def call_litellm_stream(prompt, key, model, max_tokens=6000):
|
|
138
|
+
def call_litellm_stream(prompt, key, model, max_tokens=6000, timeout=90):
|
|
122
139
|
"""Streaming variant required by litellm_qwen (Together AI backend rejects
|
|
123
140
|
non-streaming requests for this model). Only collects delta.content —
|
|
124
141
|
reasoning_content (chain-of-thought) is intentionally discarded."""
|
|
@@ -138,7 +155,7 @@ def call_litellm_stream(prompt, key, model, max_tokens=6000):
|
|
|
138
155
|
parts = []
|
|
139
156
|
usage = None
|
|
140
157
|
try:
|
|
141
|
-
with urllib.request.urlopen(req, timeout=
|
|
158
|
+
with urllib.request.urlopen(req, timeout=timeout) as r:
|
|
142
159
|
for raw_line in r:
|
|
143
160
|
line = raw_line.decode("utf-8", "ignore").strip()
|
|
144
161
|
if not line or not line.startswith("data: "):
|
|
@@ -195,7 +212,7 @@ def main():
|
|
|
195
212
|
usage_msg="Usage: review_council_fanout.py 'review goal' 'path/to/diff_file'")
|
|
196
213
|
|
|
197
214
|
# Fail fast: if the proxy itself is unreachable, every panel below will fail
|
|
198
|
-
# the same way after its own (90-
|
|
215
|
+
# the same way after its own (90-350s) timeout. Detect that in ~1 request.
|
|
199
216
|
down_reason = preflight_proxy(litellm_key, caller="review-council")
|
|
200
217
|
if down_reason:
|
|
201
218
|
render_and_exit([
|
|
@@ -203,9 +220,16 @@ def main():
|
|
|
203
220
|
for m in (GEMINI_MODEL, DEEPSEEK_MODEL, QWEN_MODEL, GLM_MODEL)
|
|
204
221
|
])
|
|
205
222
|
|
|
223
|
+
# Gemini and DeepSeek get raised max_tokens + timeout — mirrors the fix
|
|
224
|
+
# proven against idea-council on 2026-08-25 (same "No length limit" prompt
|
|
225
|
+
# trait, same models, same proxy): Gemini's synthesis runs 7-8k completion
|
|
226
|
+
# tokens (old 6000 cap was even tighter than idea-council's old 8000), and
|
|
227
|
+
# DeepSeek is a reasoning model whose answers regularly exceed the old
|
|
228
|
+
# 120s window and the old 8000-token cap. Qwen and GLM keep their
|
|
229
|
+
# defaults — no failures reported for them.
|
|
206
230
|
with concurrent.futures.ThreadPoolExecutor(max_workers=4) as ex:
|
|
207
|
-
f_gemini = ex.submit(call_litellm, prompt, litellm_key, GEMINI_MODEL,
|
|
208
|
-
f_deepseek = ex.submit(call_litellm, prompt, litellm_key, DEEPSEEK_MODEL,
|
|
231
|
+
f_gemini = ex.submit(call_litellm, prompt, litellm_key, GEMINI_MODEL, 16000, 150)
|
|
232
|
+
f_deepseek = ex.submit(call_litellm, build_deepseek_prompt(prompt), litellm_key, DEEPSEEK_MODEL, 24000, 350)
|
|
209
233
|
f_qwen = ex.submit(call_litellm_stream, prompt, litellm_key, QWEN_MODEL, 6000)
|
|
210
234
|
f_glm = ex.submit(call_litellm, prompt, litellm_key, GLM_MODEL, 6000)
|
|
211
235
|
|
|
@@ -62,12 +62,12 @@ def test_proxy_fully_down_exits_one_not_zero(monkeypatch, capsys, tmp_path):
|
|
|
62
62
|
def test_one_panel_errors_others_succeed_exits_two(monkeypatch, capsys, tmp_path):
|
|
63
63
|
monkeypatch.setattr(m, "preflight_proxy", lambda key, timeout=5, caller=None: None)
|
|
64
64
|
|
|
65
|
-
def fake_call_litellm(prompt, key, model, max_tokens=3000):
|
|
65
|
+
def fake_call_litellm(prompt, key, model, max_tokens=3000, timeout=120):
|
|
66
66
|
if model == m.DEEPSEEK_MODEL:
|
|
67
67
|
return m.PanelResult.failure(model, "HTTP 500: internal error")
|
|
68
68
|
return m.PanelResult.success(model, f"review from {model}")
|
|
69
69
|
|
|
70
|
-
def fake_call_stream(prompt, key, model, max_tokens=2000):
|
|
70
|
+
def fake_call_stream(prompt, key, model, max_tokens=2000, timeout=90):
|
|
71
71
|
return m.PanelResult.success(model, f"review from {model}")
|
|
72
72
|
|
|
73
73
|
monkeypatch.setattr(m, "call_litellm", fake_call_litellm)
|
|
@@ -84,7 +84,7 @@ def test_one_panel_errors_others_succeed_exits_two(monkeypatch, capsys, tmp_path
|
|
|
84
84
|
def test_all_panels_succeed_exits_zero(monkeypatch, capsys, tmp_path):
|
|
85
85
|
monkeypatch.setattr(m, "preflight_proxy", lambda key, timeout=5, caller=None: None)
|
|
86
86
|
|
|
87
|
-
def fake_call(prompt, key, model, max_tokens=3000):
|
|
87
|
+
def fake_call(prompt, key, model, max_tokens=3000, timeout=90):
|
|
88
88
|
return m.PanelResult.success(model, f"review from {model}")
|
|
89
89
|
|
|
90
90
|
monkeypatch.setattr(m, "call_litellm", fake_call)
|
|
@@ -95,3 +95,37 @@ def test_all_panels_succeed_exits_zero(monkeypatch, capsys, tmp_path):
|
|
|
95
95
|
captured = capsys.readouterr()
|
|
96
96
|
assert "PANEL FAILED" not in captured.out
|
|
97
97
|
assert captured.err == ""
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def test_deepseek_and_gemini_get_raised_limits(monkeypatch, capsys, tmp_path):
|
|
101
|
+
"""Regression guard mirroring idea-council's 2026-08-25 fix: DeepSeek
|
|
102
|
+
(reasoning model) and Gemini (long synthesis) must be fanned out with a
|
|
103
|
+
higher max_tokens and timeout than the plain 6000/120 defaults, or they
|
|
104
|
+
will fail again under real load. DeepSeek must also receive the budget
|
|
105
|
+
addendum, since it shares the "No length limit" prompt trait that made it
|
|
106
|
+
reliably fill any max_tokens budget."""
|
|
107
|
+
monkeypatch.setattr(m, "preflight_proxy", lambda key, timeout=5, caller=None: None)
|
|
108
|
+
calls = {}
|
|
109
|
+
|
|
110
|
+
def fake_call(prompt, key, model, max_tokens=6000, timeout=120):
|
|
111
|
+
calls[model] = (prompt, max_tokens, timeout)
|
|
112
|
+
return m.PanelResult.success(model, f"review from {model}")
|
|
113
|
+
|
|
114
|
+
def fake_call_stream(prompt, key, model, max_tokens=6000, timeout=90):
|
|
115
|
+
calls[model] = (prompt, max_tokens, timeout)
|
|
116
|
+
return m.PanelResult.success(model, f"review from {model}")
|
|
117
|
+
|
|
118
|
+
monkeypatch.setattr(m, "call_litellm", fake_call)
|
|
119
|
+
monkeypatch.setattr(m, "call_litellm_stream", fake_call_stream)
|
|
120
|
+
|
|
121
|
+
code = _run_main(monkeypatch, ["review_council_fanout.py", "goal", _diff_file(tmp_path)])
|
|
122
|
+
assert code == 0
|
|
123
|
+
|
|
124
|
+
deepseek_prompt, deepseek_max_tokens, deepseek_timeout = calls[m.DEEPSEEK_MODEL]
|
|
125
|
+
gemini_prompt, gemini_max_tokens, gemini_timeout = calls[m.GEMINI_MODEL]
|
|
126
|
+
assert deepseek_max_tokens > 8000
|
|
127
|
+
assert deepseek_timeout > 120
|
|
128
|
+
assert gemini_max_tokens > 6000
|
|
129
|
+
assert gemini_timeout >= 120
|
|
130
|
+
assert "Budget your answer" in deepseek_prompt
|
|
131
|
+
assert "Budget your answer" not in gemini_prompt
|
|
@@ -382,7 +382,7 @@ def build_reference_description(concept_ref: str, scene_name: str, deviations_js
|
|
|
382
382
|
|
|
383
383
|
def read_item(item_id: str, items_path: str) -> dict:
|
|
384
384
|
result = subprocess.run(
|
|
385
|
-
[
|
|
385
|
+
[sys.executable, str(_AGENT_DIR / "scribe_item_read.py"), item_id, "--items", items_path],
|
|
386
386
|
capture_output=True, text=True
|
|
387
387
|
)
|
|
388
388
|
if result.returncode != 0:
|
|
@@ -468,7 +468,7 @@ def build_rich_comment(meta: dict, dispatch: dict, item_json: dict,
|
|
|
468
468
|
|
|
469
469
|
def write_item(item_id: str, sha: str, items_path: str,
|
|
470
470
|
issue_iid: int | None = None, issue_url: str | None = None):
|
|
471
|
-
args = [
|
|
471
|
+
args = [sys.executable, str(_AGENT_DIR / "scribe_item_write.py"), item_id, "--sha", sha, "--items", items_path]
|
|
472
472
|
if issue_iid is not None:
|
|
473
473
|
args += ["--issue-iid", str(issue_iid)]
|
|
474
474
|
if issue_url:
|
package/content/global/CLAUDE.md
CHANGED
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
When making technical decisions, do not give much weight to development cost. Instead, prefer quality, simplicity, robustness, scalability, and long term maintainability.
|
|
4
4
|
When doing bug fixes, always start with reproducing the bug in an E2E setting as closely aligned with how an end user would experience it as possible. This makes sure you find the real problem so your fix will actually solve it.
|
|
5
|
-
If user has custom agent and other models in their custom agents respect them and launch with what was instructed. This takes higher priority.
|
|
6
5
|
Use git CLI for GitLab access, never glab — we use GitLab, not GitHub.
|
|
7
|
-
Always state all pending, open, or blocked items upfront and in full at the top of a response — never trail a reply with "one more thing pending" or drip-feed open items across later turns.
|
|
6
|
+
Always state all pending, open, or blocked items upfront and in full at the top of a response — never trail a reply with "one more thing pending" or drip-feed open items across later turns; an item surfaced later (e.g. mid-grill) gets flagged the moment it's found, not held to the end.
|
|
8
7
|
Always track multi-step work with TaskCreate/TaskList/TaskUpdate (persistent across sessions), falling back to TodoWrite only if Task tools are unavailable — never printed markdown checklists.
|
|
9
8
|
When planning or modifying work, start a wayfinder map for anything too big for one session, and always mirror the TODO items in that work's PRD/issue ticket so it stays current.
|
|
9
|
+
Never `taskkill /F` or force-stop a shared daemon or another session's process — it can be serving other concurrent chats too (confirmed incident: killing the shared router mid-session broke every other active chat); restart it gracefully via its own scheduled task instead.
|
|
10
|
+
Grill the operator once per new goal to lock scope and shared understanding; once scope is locked, execute autonomously end-to-end without re-confirming each step — grilling gates scope, not execution.
|
|
11
|
+
A new finding or one-off issue surfaced mid-task gets its own PRD/issue tracked separately — do not solve it inline in the same session; nudge the operator to open a new ticket instead.
|
|
12
|
+
Default to plain, simple technical English (ASD-STE100 style) and concise bullets/tables/ASCII diagrams over prose paragraphs.
|
|
13
|
+
In any report to the user, state each result once — never repeat an item already covered earlier in the same response or session.
|
|
10
14
|
|
|
11
15
|
## Model Routing (HARD RULE)
|
|
12
16
|
|
|
@@ -14,19 +18,15 @@ The main-loop model (Fable/Opus) is a scarce planning resource; burn Sonnet, not
|
|
|
14
18
|
|
|
15
19
|
| Work | Who does it |
|
|
16
20
|
|---|---|
|
|
17
|
-
| Grilling, requirements, decisions, ADR judgments | Fable/Opus, main loop |
|
|
18
|
-
|
|
|
19
|
-
| Adversarial review of subagent output | Fable/Opus, main loop |
|
|
20
|
-
| Writing code / HTML / docs / mocks / configs / scripts | Sonnet subagent (`generic-purpose-subagent` / `execution-worker-subagent`, `model: "claude-sonnet-5[1m]"`) |
|
|
21
|
-
| Running + fixing tests, bulk edits, research gathering | Sonnet subagent (`generic-purpose-subagent` / `execution-worker-subagent`, `model: "claude-sonnet-5[1m]"`) |
|
|
21
|
+
| Grilling, requirements, decisions, ADR judgments; architecture/planning/scaffolding/orchestration; adversarial review of subagent output | Fable/Opus, main loop |
|
|
22
|
+
| Writing code/HTML/docs/mocks/configs/scripts; running+fixing tests; bulk edits; research gathering | Sonnet subagent (`generic-purpose-subagent` / `execution-worker-subagent`, `model: "claude-sonnet-5[1m]"`) |
|
|
22
23
|
|
|
23
24
|
Standalone non-Claude subagents (an agent whose entire multi-turn loop runs as a LiteLLM-routed model, e.g. old `litellm_glm`/`litellm_deepseek_flash` workers) are retired — see `docs/pure-claude-mode.md`. The only legitimate non-Claude LLM calls left are one-shot, Claude-wrapped: the idea/plan/review councils and the scribe's synthesis fallback shell out from Python to LiteLLM for a single completion, with Claude (main loop or the council subagent) driving the call and synthesizing the result — never a subagent whose own reasoning loop is a non-Claude model.
|
|
24
25
|
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
- Custom agents that specify their own model override this
|
|
26
|
+
- Fan-out is the standing default, never a per-request instruction: anything not already in context (a new error, screenshot, log, file, ticket, git/AWS state) is looked up by a subagent that returns conclusions and saves them to one-brain; the main loop opens nothing itself except the one line a decision needs.
|
|
27
|
+
- Dispatch threshold: if the deliverable is > ~30 lines of file content, or > 2 mechanical steps (or any step whose raw output isn't needed verbatim for a decision), it goes to a worker subagent that returns conclusions only, never raw file dumps. Main loop holds only: reads needed for decisions, dispatch, review, and small edits to decision docs.
|
|
28
|
+
- On Agent/Task dispatch without a custom agent, always pass `model: "sonnet"` explicitly. The bare `model:` tool parameter is schema-restricted to `sonnet`/`opus`/`haiku`/`fable` for unregistered dispatch types (`Explore`, `general-purpose`, `claude`) — they have no agent-definition file for the harness to read a model from, so any non-Claude slug there fails tool-schema validation (confirmed in production 2026-07-05). To actually get GLM-5.2 (or another LiteLLM-routed model) running a generic-purpose-shaped dispatch, use a REGISTERED project-specific agent whose own frontmatter names that model (e.g. `generic-purpose-subagent`) — that path reads the model server-side from the agent file, not from this parameter. Custom agents that specify their own model override this table.
|
|
28
29
|
- Loop shape: Fable plans → a worker subagent executes → Fable adversarially reviews → return to user or re-instruct subagents.
|
|
29
|
-
- Context preservation (every chat, any task type): any step whose raw output isn't needed verbatim for a decision → subagent returning conclusions only, never file dumps. Main loop holds only decisions, dispatch, and review.
|
|
30
30
|
|
|
31
31
|
## Memory-First (every session)
|
|
32
32
|
|
|
@@ -45,10 +45,7 @@ Prefer code over natural-language rules. Mechanical constraints (paths, formats,
|
|
|
45
45
|
- Describe WHAT (goal, signals, exit codes, return shape); put HOW in scripts.
|
|
46
46
|
- Triggers, classification tables, dispatch blocks, retry rules must be machine-parseable (YAML/JSON-shaped) so a validator can lint them.
|
|
47
47
|
- If a behavior is critical for correctness (ordering, schema, retry caps, gate enforcement), write a hook/script that enforces it. Do not rely on the LLM reading prose and obeying — prose drifts, code doesn't.
|
|
48
|
-
|
|
49
|
-
## Autonomous Subagents
|
|
50
|
-
|
|
51
|
-
When dispatching a subagent, pass WHAT (goal, task, context) — never HOW. The caller scopes the work; the subagent owns execution (tool choice, order, approach). HOW lives inside the subagent's own agent file, not in dispatch blocks.
|
|
48
|
+
- Same split applies to dispatch: pass WHAT (goal, task, context), never HOW. The caller scopes the work; the subagent owns execution (tool choice, order, approach) via its own agent file, not the dispatch prompt.
|
|
52
49
|
|
|
53
50
|
## Web Search Routing
|
|
54
51
|
|
|
@@ -63,6 +60,5 @@ When writing a memory file under `~/.claude/projects/*/memory/*.md`, also call `
|
|
|
63
60
|
Whenever a session adds, edits, or removes an agent (`.agent.md`), a skill (`SKILL.md`), or a hook file, do all of the following without being asked:
|
|
64
61
|
|
|
65
62
|
1. **GitLab issue.** Post an update to the relevant issue. Check for an existing on-topic thread first (e.g. a project's own "Agent Flow"-style issue) and append there; only open a new issue if the change is a genuinely distinct thread, not a continuation of ongoing work.
|
|
66
|
-
2. **
|
|
67
|
-
3. **
|
|
68
|
-
4. **Global vs. local — check my-agents.** `C:/dev/my-agents` is the canonical SOURCE for hooks/agents deployed to `~/.claude/` (e.g. `my-agents/proxy/*.py` → `~/.claude/proxy/*.py`, `my-agents/agents/*.md` → `~/.claude/agents/*.md`) — confirmed by direct diff on 2026-07-05 that these can silently diverge (an entire session's worth of global hook fixes existed only in the deployed copy, never propagated to source, which would be lost on a future reinstall). If the change touched anything under `~/.claude/` (not a project-local `.claude/` directory), it is GLOBAL/shared — the same fix must also land in the matching my-agents source file, or flag explicitly why it doesn't apply there. This is a judgment call (is this change global-shared-infra vs. project-local?), not something a hook can auto-detect — always ask "did I just edit something under `~/.claude/`?" and if yes, check my-agents.
|
|
63
|
+
2. **Docs.** Update any project docs (README roster tables, architecture docs) the change affects, so they don't silently go stale relative to the actual code.
|
|
64
|
+
3. **Global vs. local — check my-agents.** `C:/dev/my-agents` is the canonical SOURCE for hooks/agents deployed to `~/.claude/` (e.g. `my-agents/proxy/*.py` → `~/.claude/proxy/*.py`, `my-agents/agents/*.md` → `~/.claude/agents/*.md`) — confirmed by direct diff on 2026-07-05 that these can silently diverge (an entire session's worth of global hook fixes existed only in the deployed copy, never propagated to source, which would be lost on a future reinstall). If the change touched anything under `~/.claude/` (not a project-local `.claude/` directory), it is GLOBAL/shared — the same fix must also land in the matching my-agents source file, or flag explicitly why it doesn't apply there. This is a judgment call (is this change global-shared-infra vs. project-local?), not something a hook can auto-detect — always ask "did I just edit something under `~/.claude/`?" and if yes, check my-agents.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# UI Spacing — Never Compact Without Design Intent
|
|
2
|
+
|
|
3
|
+
Whitespace and vertical rhythm are design, not padding to trim. Applies to every
|
|
4
|
+
project when building, restoring, merging, or moving UI.
|
|
5
|
+
|
|
6
|
+
**Founder rule (verbatim, 2026-09-05):** "maintain the line gaps do not squeeze
|
|
7
|
+
them in without a taste" + "this has to be a universal rule."
|
|
8
|
+
|
|
9
|
+
## The rule
|
|
10
|
+
|
|
11
|
+
Never reduce a spacing/rhythm value — padding, margin, gap, `rowGap`,
|
|
12
|
+
`columnGap`, `lineHeight`, or a row/chip's `minHeight`/`height` — as a side
|
|
13
|
+
effect of an unrelated change. Any decrease must be a deliberate, named design
|
|
14
|
+
decision, not a squeeze-to-fit.
|
|
15
|
+
|
|
16
|
+
## What counts as a violation
|
|
17
|
+
|
|
18
|
+
- A merge or restore that silently drops a spacing value to make content fit.
|
|
19
|
+
- Copying a component into a denser context and shrinking its gaps to match.
|
|
20
|
+
- "Tightening" a layout during a refactor with no design rationale on record.
|
|
21
|
+
|
|
22
|
+
## What a compliant change looks like
|
|
23
|
+
|
|
24
|
+
- Cite the source spacing token(s) being kept (e.g. `theme.spacing.md`,
|
|
25
|
+
`styles.row.gap`) and preserve their values across the change.
|
|
26
|
+
- If a decrease is genuinely intended, name it explicitly in the commit
|
|
27
|
+
message / task and cite the design decision that authorized it.
|
|
28
|
+
- When restoring or merging UI, snapshot or assert the spacing values in a
|
|
29
|
+
test so a future accidental compaction fails loudly instead of shipping.
|