Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2083bbbd78
commit
4e549dedde
2 files changed
+5
-8
No files matched your search
+4
-7
@@ -128,13 +128,10 @@ def report(sid, cwd):
|
||||
|
||||
|
||||
def rulebook(cwd):
|
||||
"""The rulebook the work ran under: the loaded core file and the project's rules, as a hash, size and rule count."""
|
||||
try:
|
||||
proj = rules.path(rules.PROJECT, cwd)
|
||||
text = store.read(store.data("generated", "core.md")) + ((store.regular(proj, True)[1] or b"").decode("utf-8", "replace") if proj else "")
|
||||
return {"hash": hashlib.sha256(text.encode("utf-8", "replace")).hexdigest()[:12], "chars": len(text), "lines": len(rules._parse(text))}
|
||||
except Exception:
|
||||
return {"hash": "", "chars": 0, "lines": 0}
|
||||
"""The rulebook the work ran under: hash, size and rule count of the loaded core file and the project's rules."""
|
||||
p = rules.path(rules.PROJECT, cwd)
|
||||
t = store.read(store.data("generated", "core.md")) + ((p and store.regular(p, True)[1] or b"").decode("utf-8", "replace"))
|
||||
return {"hash": hashlib.sha256(t.encode()).hexdigest()[:12], "chars": len(t), "lines": len(rules._parse(t))}
|
||||
|
||||
|
||||
def record(s, cwd, opt, sid=None):
|
||||
|
||||
Reference in new issue
Block a user