Harness name from the tool's own env var; offered_hours default

store.harness() returns the first canon/harnesses.json entry whose
'here' env var is set (claude: CLAUDE_CODE_ENTRYPOINT), as name-value,
else 'unknown'. Adds offered_hours: 24 to DEFAULTS.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Haiku 5.5 committed 2026-12-03 07:35:29 -07:00
1 parent 3a349a3859
commit f1dbc535a5
2 files changed
+16 -2

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
[
{"name": "claude", "detect": "~/.claude", "env": "CLAUDE_CONFIG_DIR", "rules": "CLAUDE.md", "import": true, "hooks": {"file": "settings.json", "tick": "SessionStart", "prompt": "UserPromptSubmit", "watch": "PreToolUse", "gate": "Stop"}, "limits": "The built-in Explore and Plan subagents do not load CLAUDE.md."},
{"name": "claude", "detect": "~/.claude", "env": "CLAUDE_CONFIG_DIR", "here": "CLAUDE_CODE_ENTRYPOINT","rules": "CLAUDE.md", "import": true, "hooks": {"file": "settings.json", "tick": "SessionStart", "prompt": "UserPromptSubmit", "watch": "PreToolUse", "gate": "Stop"}, "limits": "The built-in Explore and Plan subagents do not load CLAUDE.md."},
{"name": "codex", "detect": "~/.codex", "env": "CODEX_HOME", "rules": "AGENTS.md", "hooks": {"file": "hooks.json", "tick": "SessionStart", "prompt": "UserPromptSubmit", "watch": "PreToolUse", "gate": "Stop"}, "limits": "Hooks run only after the person trusts them once in Codex's /hooks; AGENTS.override.md shadows the rulebook; hosted web search is not metered."},
{"name": "qwen", "detect": "~/.qwen", "rules": "QWEN.md", "hooks": {"file": "settings.json", "tick": "SessionStart", "prompt": "UserPromptSubmit", "watch": "PreToolUse", "gate": "Stop"}, "limits": "A tool Qwen names differently from canon/tools.json is not metered."},
{"name": "grok", "detect": "~/.grok", "rules": "AGENTS.md", "limits": "Grok already runs the hooks in ~/.claude/settings.json; its session-start and prompt output is discarded, though it reads the project's AGENTS.md note."},
+15 -1
View File
@@ -26,7 +26,8 @@ GIT_ERROR = "" # why the last git call that failed did: the first line of its s
DEFAULTS = {"gate": True, "meter": True, "direct_calls": 8, "direct_extension": 8,
"rules_lines": 30, "rules_chars": 4000, "organize_after": 8, "audit_after": 12, "research_days": 3, "shell_workers": False, "enforce": True,
"worker_minutes": 90, "retro_minutes": 5, "disk_free_percent": 20, "disk_drop_percent": 5, "checkouts": 8,
"auto_update": True, "update_hours": 24, "update_url": "https://github.com/swaits/sisi"}
"auto_update": True, "update_hours": 24, "update_url": "https://github.com/swaits/sisi",
"offered_hours": 24}
def config():
cfg = dict(DEFAULTS)
@@ -38,6 +39,19 @@ def config():
return cfg
def harness():
"""Name of the tool running this: the first canon entry whose "here" env var is set, else unknown."""
try:
table = json.loads(read(os.path.join(ROOT, "canon", "harnesses.json")) or "[]")
except ValueError:
table = []
for h in table:
value = os.environ.get(h.get("here") or "")
if value:
return re.sub(r"[^a-z0-9._-]+", "-", (h["name"] + "-" + value).lower())[:60]
return "unknown"
def data(*parts):
path = os.path.join(DATA, *parts)
os.makedirs(os.path.dirname(path), exist_ok=True)