fix(docs): bind workflow delivery history to commit roles and file pins

Co-authored-by: multica <multica@users.noreply.github.com>
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
leefer
2026-11-02 06:06:57 +08:00
co-authored by multica multica-agent
parent 0e3e7b071f
commit 3696f2e0a9
80 changed files with 490954 additions and 55 deletions
@@ -1,3 +1,5 @@
历史归因勘误:本目录原0e3e7b总账曾把后批基线误配成交付,已被HEL-893退回;原JSON/CSV/中文及日志保留,不作为正确历史定位。更正版及逐行差集见`../history-attribution-correction/README.md`,原快照SHA见其`prior175-sha256.json`。本目录audit.py已委托新的角色/文件/pin闭包规则,禁止旧全文SHA/最新评论匹配。
本目录是第175批只读闭环盘点,基线为`c73d76527593707121cf4b137c4d594eeecd8230`。产品模块边界依据仓库README的工作流说明及`comfyui/library.py`、`fixed_document.py`、`library_cli.py`和既有审计脚本;没有新增依赖、产品测试、执行入口或界面修改。
先看`进度说明与下一阶段建议.md`,再按`ledger.json`、全列`ledger.csv`或`逐文件总账与剩余条件.md`查155份目标。`summary.json`给实际计数;`remaining-work.json`按每份文件保留准确身份声明、未验证实例、原边界和最小后续条件。状态仅代表本轮新隔离库,不代表线上库或目标安装。
+18 -55
View File
@@ -18,6 +18,7 @@ OUTPUT = LOCAL / sys.argv[1]
BASE = "c73d76527593707121cf4b137c4d594eeecd8230"
RESOURCE = "calliope-backend/src/calliope/comfyui/source_reviews.json"
sys.path.insert(0, str(ROOT / "calliope-backend/src"))
sys.path.insert(0, str(ROOT / "docs/hel-892/history-attribution-correction"))
def sha(raw):
@@ -116,9 +117,17 @@ def main():
for source, pin in json.loads(p.read_bytes()).items():
if DEFINITIONS.get(source) == pin:
pinfiles[source] = p
from attribution import Attributor
messages = history()
write("historical-comment-texts.json", messages)
instruction = json.loads((LOCAL / "instruction.json").read_bytes())
attributor = Attributor(
ROOT,
messages,
BASE,
{"current_section": instruction["description"].split("\n---\n", 1)[0]},
)
write(
"current-instruction.json",
{
@@ -368,57 +377,12 @@ def main():
.decode()
.strip()
)
matches = (
[
m
for m in messages
if m["author_id"] == "4846a27a-ba87-49c9-939d-7275f63efcc7"
and (commit in m["content"] or commit[:7] in m["content"])
]
if commit
else []
attribution_result = attributor.select(path, DEFINITIONS[path])
delivery = next(
(m for m in messages if m["id"] == attribution_result["delivery_comment_id"]),
None,
)
delivery = max(matches, key=lambda m: m["created_at"]) if matches else None
relays = [
m
for m in messages
if delivery
and m.get("parent_id") == delivery["id"]
and m["author_id"] == "bbcc1179-3a55-48e7-a72e-c84cf79f41cb"
and ("审核通过" in m["content"] or "审查通过" in m["content"] or "接受" in m["content"])
]
relay = max(relays, key=lambda m: m["created_at"]) if relays else None
reviewbasis = (
dict(kind="chief_relay", comment_id=relay["id"], quote=relay["content"])
if relay
else dict(
kind="unknown",
reason="no exact matching acceptance comment in "
"bounded own-card threads; do "
"not infer from coverage",
)
)
if not relay and delivery:
progress = [
m
for m in messages
if m.get("parent_id") == delivery["id"]
and m["author_id"] == "bbcc1179-3a55-48e7-a72e-c84cf79f41cb"
]
if progress:
latest = max(progress, key=lambda m: m["created_at"])
reviewbasis["latest_chief_progress"] = {
k: latest[k] for k in ("id", "content", "created_at")
}
if path.endswith("MiniMax-H3-Turbo-R2V-Extend-2Refs1Vid_API.json"):
reviewbasis = dict(
kind="current_issue_chief_relay",
issue_id=instruction["id"],
updated_at=instruction["updated_at"],
evidence="current-instruction.json#/current_section",
quote=instruction["description"].splitlines()[2],
limitation="HEL-893独立报告本轮未重开,不把总管转述当本轮独立复核",
)
reviewbasis = attribution_result["review_basis"]
source_records = []
for i, s in enumerate(b["sources"]):
local = s.get("local_file")
@@ -584,11 +548,10 @@ def main():
latest_pin_record_commit=commit or "unknown",
delivery_comment_id=delivery["id"] if delivery else "unknown",
review_basis=reviewbasis,
delivery_lookup_rule="latest commit touching matching pinned "
"evidence file, exact "
"commit/7-char search in bounded "
"own-card delivery text; not a claim "
"about every later collateral edit",
delivery_lookup_rule=attribution_result["selection_rule"],
definition_pin_introductions=attribution_result["definition_pin_introductions"],
delivery_head=attribution_result.get("delivery_head", "unknown"),
tested_implementation=attribution_result.get("tested_implementation", "unknown"),
saved_fields=len(pointers),
saved_json_types=dict(ftypes),
saved_count_rule="len(actual fixed block.fields); each "
@@ -0,0 +1,31 @@
第175批历史归因窄修,受审基线`0e3e7b071f4c293642900849db8b1ead997417b8`。原175的原值/注释/身份/来源字节/资格等独立核对结果不变;本轮只重算历史定位,不启动服务或目标连接、不重做导入/构建/浏览/产品测试,不实施两份试点或推进176。
原缺陷是全文出现某提交或7位前缀就算交付候选,再取最新评论。新`attribution.py`要求:Git中唯一解析为commit、明确的提交角色、该原文件的当前pin在代码拥有白名单中的真实引入/更改、原件Git blob与冻结文件一致、评论实际交付范围。单图以唯一pin变更证明;多图还需明确文件名或与Git闭包数量一致的多图范围文字。记录文件最后触碰、定义pin起点、交付主head、明确受测实现、后继记录、基线/旧版/依赖各自分列。受测与head合并声明保留联合角色;没有明确受测提交则unknown,不把交付head自动当受测声明。
短SHA只在既有Git对象中唯一且是commit时使用。归因要求唯一因果pin起点及唯一符合闭包的交付评论,不按时间排名;多候选或缺证明保留unknown。Git证据为已有仓库内的代码AST字面常量、代码blob/SHA、父提交pin差集及原件blob,不执行历史模块或原件表达式,也不取新源码。
审核只取正确交付父评论下的明确肯定审核语句;“接受”、仅进度、否定/条件/问句、上一批或覆盖数字均不能认证当前文件。既有任务指令的准确提交审核转述单列`historical_issue_instruction_relay`,不冒充主卡回执或本轮独立复核;主卡本轮拒绝报告附原文。不会为填满总账批量拉其它卡历史。
入口与证据:
- `ledger.json`、全列`ledger.csv`、`逐文件总账与剩余条件.md`:155行更正总账。`latest_pin_record_commit`保留原记录含义,`definition_pin_introduction_commit`才是Git证明的当前pin起点;`delivery_head`与`tested_implementation`分开。`file_pin_implementation_commit`只表示闭包所用实现提交。
- `candidate-matrix.json`:每行准确候选原评论ID、原文片段和字符位置、UTF-8 SHA、角色、Git解析、文件/pin/原件闭包、接受与拒绝理由,含旧选择及新选择。数组引用使用`#/索引`;原评论全文在`prior175/historical-comment-texts.json`,按唯一id定位。
- `historical-resource-bindings.json`:进一步读取所选交付head/闭包实现中的实际source_reviews说明块,核原路径、SHA1/SHA256及canonical pin,避免仅凭代码声明。只读既有Git,不重跑上游或已通过的原值套件。
- `comment-role-records.json`、`git-facts.json`:角色与既有Git的可回读事实;“代码文件在某提交不存在”也明确记录,不借共享pins文件推断范围。
- `row-field-differences.json`、`verification.json`:每行/字段原值与新值、原/新JSON/CSV SHA;原SHA、155pin、10761值/类型、287注释、身份/资格及原剩余条件不变。
- `prior175/`及`prior175-sha256.json`:原错误账/CSV/中文/summary/remaining/工具/历史输入和原SHA。原175日志与全闭包仍在原Git提交及已有551成员ZIP,本轮核准旧ZIP/bundle,不重复上传整个旧闭包。原目录README明确勘误,原JSON等保留。
- `remaining-work.json`:仅追加历史依据定位,原分层阻碍逐项不动。`summary.base`沿用原c73d765数据来源,`attribution_correction.base`明确本次受审账0e3e7b,不更改已验数据的来源。
- `test_contract.py`:两个真实误配/正确候选及基线、依赖/旧版、短前缀歧义、共享记录范围、多图、联合角色和否定/进度/覆盖语句的有界离线契约。规则不含那两个评论ID,ID只在对照测试中。
复现(只读Git/既有离线材料,不读取目标或线上库):
```bash
PYTHONDONTWRITEBYTECODE=1 python3 docs/hel-892/history-attribution-correction/test_contract.py
PYTHONDONTWRITEBYTECODE=1 python3 docs/hel-892/history-attribution-correction/rebuild.py new-review-attempt
```
输出在本轮自有`.local-evidence/history-attribution-correction/`下的全新参数目录,`mkdir`和`x/xb`拒绝同名;已存在的final/attempt/log键均不能重用。`run.py`独占记录每个实际命令、退出码、stdout/stderr/SHA。原175目录的audit.py也委托新规则;只需重算历史器,不必重跑旧全量原值审计。
本轮前几次重算是规则修整的中间结果:第一次未识别粗体head、描述性多图及倒装审核句,第二次尚未识别“受测与最终head均为”等联合角色,均留独占输出而未当最终交付;之后区分“闭包实现”与“明确受测”,避免新推断。首次lint仅一条自写说明字符串长行失败,拆行修正,原日志保留。最终结果按实际summary重新统计,不以原46份为门槛。
原175四次结构误读、CSV/EOF/收录失败和171日志覆盖事故、19已归档恢复与未归档字节/mtime未知保持;不改旧时间、日志或用途索引。174/175构建、浏览和原值/注释/资格复现仅继承原提交结果,不计本轮新检查;155最终定稿、新增可靠转换和真实生成仍均0。完成交HEL-893一次独立复审,不合并部署或关闭主卡,当前无需新增素材或机器窗口。
@@ -0,0 +1,468 @@
"""Bounded offline provenance, with explicit roles and file/pin Git closure.
No date-based candidate ranking. No original workflow or upstream code execution.
"""
import ast
import hashlib
import re
import subprocess
from pathlib import Path
AUTHOR = "4846a27a-ba87-49c9-939d-7275f63efcc7"
CHIEF = "bbcc1179-3a55-48e7-a72e-c84cf79f41cb"
CODE = "calliope-backend/src/calliope/comfyui/fixed_document.py"
HEX = re.compile(r"(?<![0-9a-fA-F])([0-9a-fA-F]{7,40})(?![0-9a-fA-F])")
def sha(raw):
return hashlib.sha256(raw).hexdigest()
def literal(node, env):
"""Only own code's literal constants; never eval/import historical modules."""
if isinstance(node, ast.Constant):
return node.value
if isinstance(node, ast.Name) and node.id in env:
return env[node.id]
if isinstance(node, ast.Dict):
return {literal(k, env): literal(v, env) for k, v in zip(node.keys, node.values)}
if isinstance(node, ast.BinOp) and isinstance(node.op, ast.Add):
left, right = literal(node.left, env), literal(node.right, env)
if isinstance(left, str) and isinstance(right, str):
return left + right
raise ValueError("not a supported literal")
class GitFacts:
def __init__(self, root):
self.root = Path(root)
self.resolutions = {}
self.code = {}
self.parent_cache = {}
self.origin_cache = {}
self.blobs = {}
def git(self, *args):
return subprocess.check_output(["git", *args], cwd=self.root).decode().strip()
def resolve(self, token):
if token not in self.resolutions:
matches = self.git("rev-parse", "--disambiguate=" + token).splitlines()
status = "ambiguous" if len(matches) > 1 else "missing"
full = None
if len(matches) == 1:
status = (
"unique_commit"
if self.git("cat-file", "-t", matches[0]) == "commit"
else "not_commit"
)
full = matches[0] if status == "unique_commit" else None
self.resolutions[token] = dict(
token=token, status=status, commit=full, object_matches=matches
)
return self.resolutions[token]
def definitions(self, commit):
if commit not in self.code:
present = self.git("ls-tree", commit, "--", CODE)
if not present:
self.code[commit] = dict(definitions={}, state="code_file_absent")
else:
raw = subprocess.check_output(["git", "show", commit + ":" + CODE], cwd=self.root)
env = {}
for node in ast.parse(raw).body:
if isinstance(node, ast.Assign) and len(node.targets) == 1:
target = node.targets[0]
if isinstance(target, ast.Name):
try:
env[target.id] = literal(node.value, env)
except ValueError:
pass
definitions = env.get("DEFINITIONS", {})
assert isinstance(definitions, dict)
self.code[commit] = dict(
definitions=definitions,
state="literal_AST",
path=CODE,
git_blob=self.git("rev-parse", commit + ":" + CODE),
sha256=sha(raw),
)
return self.code[commit]["definitions"]
def parents(self, commit):
if commit not in self.parent_cache:
self.parent_cache[commit] = self.git(
"rev-list", "--parents", "-n", "1", commit
).split()[1:]
return self.parent_cache[commit]
def changes(self, commit):
current = self.definitions(commit)
previous = [self.definitions(p) for p in self.parents(commit)]
return {p: pin for p, pin in current.items() if all(old.get(p) != pin for old in previous)}
def origins(self, path, pin):
key = path + "#" + pin
if key not in self.origin_cache:
commits = self.git("log", "--format=%H", "-S", pin, "--", CODE).splitlines()
self.origin_cache[key] = [c for c in commits if self.changes(c).get(path) == pin]
return self.origin_cache[key]
def blob(self, commit, path):
key = commit + ":" + path
if key not in self.blobs:
data = self.git("ls-tree", "-z", commit, "--", path)
self.blobs[key] = data.split()[2] if data else None
return self.blobs[key]
def ancestor(self, earlier, later):
result = subprocess.run(
["git", "merge-base", "--is-ancestor", earlier, later],
cwd=self.root,
capture_output=True,
)
assert result.returncode in (0, 1)
return result.returncode == 0
def role(content, start, end):
before = content[max(0, start - 80) : start]
after = content[end : end + 32]
gap = r"[\s`*::=((]*$"
if re.search(r"受测(?:实现)?(?:与|及)最终\s*(?:head)?(?:均为)?" + gap, before, re.I):
return "delivery_and_tested"
if re.search(r"最终" + gap, before) and re.search(
r"(?:实现|提交|head)[^。;;\n]{0,70}", before, re.I
):
return "delivery_head"
if re.search(r"(?:基线|基点)[^\n;;。`]{0,16}" + gap, before):
return "baseline"
if re.search(r"(?:旧版|旧代码|回退)[^\n;;。`]{0,16}" + gap, before):
return "rollback_or_old"
patterns = [
("tested_implementation", r"(?:受测[^\n;;。`]{0,24}|实现(?:提交)?)"),
("baseline", r"(?:基线(?:提交)?|增量基点|基点|baseline|BASE)"),
("dependency_or_source", r"(?:依赖(?:提交)?|源码(?:提交)?|来源提交)"),
("rollback_or_old", r"(?:回退(?:提交)?|旧(?:版|提交|head|代码)|原提交)"),
("successor_record", r"(?:后继(?:提交|head)?|记录后继)"),
("delivery_head", r"(?:提交已推送|已提交并推送|已提交推送|已推送|推送|提交|head|commit)"),
]
if re.search(r"原提交" + gap, before) and re.match(r"[`\s]*已(?:普通)?推送", after):
return "delivery_transport_recovery"
for name, pattern in patterns:
if re.search(pattern + gap, before, re.I):
return name
if re.match(r"[`\s]*(?:旧代码|旧版|基线|为.*中间提交)", after):
return "rollback_or_old"
return "unclassified_reference"
def references(message, git):
content = message["content"]
rows = []
for m in HEX.finditer(content):
begin = content.rfind("\n", 0, m.start()) + 1
end = content.find("\n", m.end())
if end == -1:
end = len(content)
rows.append(
dict(
token=m[1],
role=role(content, m.start(), m.end()),
resolution=git.resolve(m[1]),
excerpt=content[begin:end],
span=[m.start(), m.end()],
)
)
return rows
def explicit_multi_scope(content, count):
numbers = {
"两": 2,
"二": 2,
"三": 3,
"四": 4,
"五": 5,
"六": 6,
"七": 7,
"八": 8,
"九": 9,
"十": 10,
"十一": 11,
}
for m in re.finditer(
r"(?<!\d)(\d+|十一|十|[两二三四五六七八九])(?:张)?[\u4e00-\u9fff]{0,8}?(?:图|份|个文件)",
content,
):
actual = int(m[1]) if m[1].isdigit() else numbers[m[1]]
if actual == count:
return m[0]
return None
def scope_proof(path, pin, commit, message, git, base):
if git.definitions(commit).get(path) != pin:
return dict(ok=False, reason="head_file_pin_does_not_match")
changes = git.changes(commit)
if changes.get(path) != pin:
return dict(ok=False, reason="pin_inherited_not_changed_for_this_file")
basename = Path(path).name
explicit_file = path in message["content"] or basename in message["content"]
count_claim = explicit_multi_scope(message["content"], len(changes))
if len(changes) != 1 and not explicit_file and not count_claim:
return dict(ok=False, reason="multi_file_delta_without_explicit_delivery_scope")
blob = git.blob(commit, path)
if not blob or blob != git.blob(base, path):
return dict(ok=False, reason="original_source_blob_not_bound_to_frozen_file")
return dict(
ok=True,
reason="file_pin_introduced_or_changed_in_declared_commit",
implementation_commit=commit,
code_path=CODE,
pin=pin,
original_git_blob=blob,
frozen_base=base,
exact_file_in_text=explicit_file,
explicit_multi_file_claim=count_claim,
code_pin_delta=changes,
code_byte_evidence={k: v for k, v in git.code[commit].items() if k != "definitions"},
)
def candidate(path, pin, message, refs, git, base):
heads = [
r
for r in refs
if r["role"] in ("delivery_head", "delivery_transport_recovery", "delivery_and_tested")
and r["resolution"]["status"] == "unique_commit"
]
tested = [
r
for r in refs
if r["role"] in ("tested_implementation", "delivery_and_tested")
and r["resolution"]["status"] == "unique_commit"
]
accepted, rejected = [], []
for head in heads:
commit = head["resolution"]["commit"]
direct = scope_proof(path, pin, commit, message, git, base)
linked = []
if not direct["ok"]:
for test in tested:
earlier = test["resolution"]["commit"]
proof = scope_proof(path, pin, earlier, message, git, base)
if (
proof["ok"]
and git.definitions(commit).get(path) == pin
and git.ancestor(earlier, commit)
):
linked.append(proof)
local_failure = "本地提交" in head["excerpt"] and bool(
re.search(r"推送[^。\n]{0,30}(?:失败|均报)", message["content"])
)
if local_failure:
rejected.append(dict(head=commit, reason="explicit_local_only_push_failure"))
elif direct["ok"] or len(linked) == 1:
chosen = direct if direct["ok"] else linked[0]
tested_commits = {
t["resolution"]["commit"]
for t in tested
if t["resolution"]["commit"] == chosen["implementation_commit"]
}
accepted.append(
dict(
delivery_head=commit,
head_role=head["role"],
head_excerpt=head["excerpt"],
implementation_proof=chosen,
explicit_tested_implementation=next(iter(tested_commits))
if len(tested_commits) == 1
else "unknown",
successor_record=commit != chosen["implementation_commit"],
)
)
else:
rejected.append(dict(head=commit, reason=direct["reason"], tested_links=len(linked)))
unique = {a["delivery_head"]: a for a in accepted}
return dict(
comment_id=message["id"],
content_utf8_sha256=sha(message["content"].encode()),
candidate_accepted=len(unique) == 1,
head_proofs=list(unique.values()),
rejected_heads=rejected,
references=refs,
reason="unique_explicit_head_with_file_pin_closure"
if len(unique) == 1
else "ambiguous_multiple_heads"
if len(unique) > 1
else "no_explicit_delivery_head_with_file_pin_closure",
)
def review_language(content):
"""Accept only affirmative audit clauses about this batch; progress is unknown."""
affirmative, negative = [], []
for clause in re.split(r"[。!!\n]", content):
if re.search(
r"(?:审核|审查|复核).{0,6}(?:未|不|暂未|尚未)通过|未通过(?:审核|审查|复核)", clause
):
negative.append(clause)
continue
if re.search(
r"(?:审核|审查|复核)(?:已)?通过|通过(?:独立)?(?:功能与界面)?(?:审核|审查|复核)", clause
):
if re.search(
r"(?:未|不|没|尚未|暂未|没有|不能|待|等待|拟|若|如|要求)[^,,;;。]{0,12}(?:审核|审查|复核|通过)",
clause,
):
negative.append(clause)
elif re.search(r"(?:上[一]?批|前批|旧批|上一份|据说|可能|假设|[??])", clause):
negative.append(clause)
elif re.search(r"^(?:目前|现有|累计|覆盖|全部\d+)", clause.strip()):
continue
else:
affirmative.append(clause)
if affirmative and not negative:
return dict(status="affirmative_audit_relay", clauses=affirmative)
return dict(
status="unknown", affirmative_clauses=affirmative, rejected_or_negative_clauses=negative
)
class Attributor:
def __init__(self, root, messages, base, instruction=None):
self.git = GitFacts(root)
self.messages = messages
self.base = base
self.instruction = instruction
self.own = [m for m in messages if m["author_id"] == AUTHOR and not m.get("parent_id")]
self.refs = {m["id"]: references(m, self.git) for m in self.own}
def select(self, path, pin, prior_comment=None):
origins = self.git.origins(path, pin)
matrix = []
for message in self.own:
refs = self.refs[message["id"]]
mention = path in message["content"] or Path(path).name in message["content"]
pin_mention = any(
pin.startswith(m[1])
for m in re.finditer(
r"(?<![0-9a-f])([0-9a-f]{8,64})(?![0-9a-f])", message["content"]
)
)
origin_mention = any(r["resolution"]["commit"] in origins for r in refs)
changed_head = any(
r["role"]
in (
"delivery_head",
"delivery_transport_recovery",
"tested_implementation",
"delivery_and_tested",
)
and r["resolution"]["status"] == "unique_commit"
and self.git.changes(r["resolution"]["commit"]).get(path) == pin
for r in refs
)
if (
mention
or pin_mention
or origin_mention
or changed_head
or message["id"] == prior_comment
):
row = candidate(path, pin, message, refs, self.git, self.base)
row["candidate_inclusion"] = dict(
file_mention=mention,
pin_mention=pin_mention,
origin_reference=origin_mention,
changed_head=changed_head,
previously_selected=message["id"] == prior_comment,
)
matrix.append(row)
accepted = [r for r in matrix if r["candidate_accepted"]]
# Require a unique causal pin origin and a unique attributable delivery comment.
selected = accepted[0] if len(accepted) == len(origins) == 1 else None
result = dict(
source_repo_path=path,
pin=pin,
definition_pin_introductions=origins,
delivery_comment_id=selected["comment_id"] if selected else "unknown",
selection_rule=(
"unique causal pin origin and explicit file-scoped delivery; no time ranking"
),
ambiguity="none" if selected else "unknown: no unique origin/delivery evidence",
candidates=matrix,
)
if selected:
proof = selected["head_proofs"][0]
result.update(
delivery_head=proof["delivery_head"],
tested_implementation=proof["explicit_tested_implementation"],
file_pin_implementation_commit=proof["implementation_proof"][
"implementation_commit"
],
successor_record=proof["successor_record"],
)
result["review_basis"] = self.review(path, pin, result)
return result
def review(self, path, pin, result):
selected = result["delivery_comment_id"]
progress = [
m
for m in self.messages
if selected != "unknown" and m.get("parent_id") == selected and m["author_id"] == CHIEF
]
records = [
dict(
comment_id=m["id"],
parent_id=selected,
quote=m["content"],
classification=review_language(m["content"]),
)
for m in progress
]
positive = [
r for r in records if r["classification"]["status"] == "affirmative_audit_relay"
]
rejected = [r for r in records if r["classification"].get("rejected_or_negative_clauses")]
if len(positive) == 1 and not rejected:
return dict(
kind="chief_relay",
delivery_comment_id=selected,
affirmative_record=positive[0],
all_parent_records=records,
independent_report_reopened=False,
)
# An old instruction relay is distinct from a chief comment and from a main-card receipt.
if self.instruction and selected != "unknown" and not rejected:
text = self.instruction["current_section"]
for clause in re.split(r"[。\n]", text):
if review_language(clause)["status"] != "affirmative_audit_relay":
continue
for m in HEX.finditer(clause):
resolved = self.git.resolve(m[1])
commit = resolved["commit"]
if (
commit in result["definition_pin_introductions"]
and self.git.changes(commit).get(path) == pin
):
return dict(
kind="historical_issue_instruction_relay",
quote=clause,
source="prior175/current-instruction.json#/current_section",
source_sha256=sha(text.encode()),
implementation_commit=commit,
delivery_comment_id=selected,
independent_report_reopened=False,
all_parent_records=records,
)
return dict(
kind="unknown",
reason="no unambiguous affirmative audit for the selected delivery",
delivery_comment_id=selected,
all_parent_records=records,
limitation="not a claim that historical audit failed; no main-card history bulk fetch",
)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,80 @@
"""Check selected historical delivery blocks, not just their code-owned pin declarations."""
import hashlib
import json
import re
import subprocess
from pathlib import Path
ROOT = Path(__file__).resolve().parents[3]
HERE = Path(__file__).resolve().parent
RESOURCE = "calliope-backend/src/calliope/comfyui/source_reviews.json"
def git(*args):
return subprocess.check_output(["git", *args], cwd=ROOT)
def main():
rows = json.loads((HERE / "ledger.json").read_bytes())
# Cache only each decoded target entry, not 155 full historical resource objects.
text_blob = None
decoded = None
bindings = []
for row in rows:
if row["delivery_comment_id"] == "unknown":
continue
for commit in dict.fromkeys([row["file_pin_implementation_commit"], row["delivery_head"]]):
blob = git("rev-parse", commit + ":" + RESOURCE).decode().strip()
if blob != text_blob:
decoded = git("cat-file", "blob", blob).decode("utf-8")
text_blob = blob
path = row["source_repo_path"]
patterns = [
r"(?m)^ " + re.escape(json.dumps(path, ensure_ascii=ascii_mode)) + r":\s*"
for ascii_mode in (False, True)
]
match = next((m for pattern in patterns if (m := re.search(pattern, decoded))), None)
if match:
review, _ = json.JSONDecoder().raw_decode(decoded, match.end())
else:
review = json.loads(decoded)[path]
block = review["fixed_version_document"]
canonical = json.dumps(
block, ensure_ascii=False, sort_keys=True, separators=(",", ":")
).encode()
actual_pin = hashlib.sha256(canonical).hexdigest()
assert actual_pin == row["pin"], (path, commit, actual_pin)
assert block["source_path"] == path
assert block["source_sha1"] == row["source_sha1"]
assert block["source_sha256"] == row["source_sha256"]
bindings.append(
dict(
source_repo_path=path,
commit=commit,
delivery_comment_id=row["delivery_comment_id"],
resource_git_blob=blob,
original_source_sha1=row["source_sha1"],
original_source_sha256=row["source_sha256"],
actual_block_pin=actual_pin,
code_pin_and_actual_resource_equal=True,
)
)
with (HERE / "historical-resource-bindings.json").open("x") as f:
json.dump(
dict(
rows=155,
checked_selected_commit_bindings=len(bindings),
bindings=bindings,
new_upstream_sources=0,
),
f,
ensure_ascii=False,
indent=2,
)
f.write("\n")
print("PASS actual historical resource blocks/source SHA/code pin;", len(bindings), "bindings")
if __name__ == "__main__":
main()
@@ -0,0 +1,76 @@
"""Collect this correction's explicit command keys and unmodified raw streams."""
import hashlib
import json
from pathlib import Path
ROOT = Path(__file__).resolve().parents[3]
HERE = Path(__file__).resolve().parent
LOCAL = ROOT / ".local-evidence/history-attribution-correction"
KEYS = [
"preflight",
"contracts-initial",
"rebuild-initial",
"contracts-role-forms",
"rebuild-role-forms",
"contracts-joint-role",
"rebuild-joint-role",
"format-write",
"lint-initial",
"contracts-final",
"rebuild-final",
"verify-publish",
"format-delivery",
"lint-final",
"format-check",
"ast-diff-check",
"historical-resource-check",
"format-resource",
"lint-resource",
"ast-resource",
]
def main():
logs = HERE / "logs"
logs.mkdir(exist_ok=True)
records = []
for key in KEYS:
r = json.loads((LOCAL / "records" / (key + ".json")).read_bytes())
if key != "lint-initial":
assert r["returncode"] == 0
for log in r["logs"]:
raw = (ROOT / log["path"]).read_bytes()
assert len(raw) == log["bytes"]
assert hashlib.sha256(raw).hexdigest() == log["sha256"]
path = logs / Path(log["path"]).name
if path.exists():
assert path.read_bytes() == raw
else:
with path.open("xb") as f:
f.write(raw)
records.append(r)
with (HERE / "completed-log-records.json").open("x") as f:
json.dump(
dict(
explicit_keys=KEYS,
records=records,
failures=[r["key"] for r in records if r["returncode"]],
no_old_glob_or_log_overwrite=True,
),
f,
ensure_ascii=False,
indent=2,
)
f.write("\n")
print(
"PASS",
len(records),
"explicit commands;",
len(records) * 2,
"raw streams; failures retained",
)
if __name__ == "__main__":
main()
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,505 @@
{
"explicit_keys": [
"preflight",
"contracts-initial",
"rebuild-initial",
"contracts-role-forms",
"rebuild-role-forms",
"contracts-joint-role",
"rebuild-joint-role",
"format-write",
"lint-initial",
"contracts-final",
"rebuild-final",
"verify-publish",
"format-delivery",
"lint-final",
"format-check",
"ast-diff-check",
"historical-resource-check",
"format-resource",
"lint-resource",
"ast-resource"
],
"records": [
{
"key": "preflight",
"command": [
"python3",
"docs/hel-892/history-attribution-correction/preflight.py"
],
"cwd": "repository root",
"returncode": 0,
"logs": [
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-preflight.stdout.txt",
"bytes": 111,
"sha256": "a7535293596f97c7db60cb07061ebf63762d4d7925647f6d97974c062d855883"
},
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-preflight.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
]
},
{
"key": "contracts-initial",
"command": [
"env",
"PYTHONDONTWRITEBYTECODE=1",
"python3",
"docs/hel-892/history-attribution-correction/test_contract.py"
],
"cwd": "repository root",
"returncode": 0,
"logs": [
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-contracts-initial.stdout.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
},
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-contracts-initial.stderr.txt",
"bytes": 988,
"sha256": "1cc0f2a44bf10fb16e485cb0e1c05d8bec0c13cbe3c02900e42d316eeff134bd"
}
]
},
{
"key": "rebuild-initial",
"command": [
"env",
"PYTHONDONTWRITEBYTECODE=1",
"python3",
"docs/hel-892/history-attribution-correction/rebuild.py",
"attempt-1"
],
"cwd": "repository root",
"returncode": 0,
"logs": [
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-rebuild-initial.stdout.txt",
"bytes": 343,
"sha256": "a0db989c36a0de42c44d142a9a712728e2086a4d4adcc3801ea4fa0e2e852dc5"
},
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-rebuild-initial.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
]
},
{
"key": "contracts-role-forms",
"command": [
"env",
"PYTHONDONTWRITEBYTECODE=1",
"python3",
"docs/hel-892/history-attribution-correction/test_contract.py"
],
"cwd": "repository root",
"returncode": 0,
"logs": [
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-contracts-role-forms.stdout.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
},
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-contracts-role-forms.stderr.txt",
"bytes": 1174,
"sha256": "f27d8b74aa9de8c3869c84b0f0a1b22f46a08d7b1af98e043e4ed762732951a1"
}
]
},
{
"key": "rebuild-role-forms",
"command": [
"env",
"PYTHONDONTWRITEBYTECODE=1",
"python3",
"docs/hel-892/history-attribution-correction/rebuild.py",
"attempt-2"
],
"cwd": "repository root",
"returncode": 0,
"logs": [
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-rebuild-role-forms.stdout.txt",
"bytes": 342,
"sha256": "24fc4ea9461a525ed8d10c937a4c842d5bc4e2ad35a9cb0f6d2306abc73d880b"
},
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-rebuild-role-forms.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
]
},
{
"key": "contracts-joint-role",
"command": [
"env",
"PYTHONDONTWRITEBYTECODE=1",
"python3",
"docs/hel-892/history-attribution-correction/test_contract.py"
],
"cwd": "repository root",
"returncode": 0,
"logs": [
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-contracts-joint-role.stdout.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
},
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-contracts-joint-role.stderr.txt",
"bytes": 1397,
"sha256": "b3a004e5669cfafa59410cd419aebca6d6844080f8a8c5c200283d9a645b7067"
}
]
},
{
"key": "rebuild-joint-role",
"command": [
"env",
"PYTHONDONTWRITEBYTECODE=1",
"python3",
"docs/hel-892/history-attribution-correction/rebuild.py",
"attempt-3"
],
"cwd": "repository root",
"returncode": 0,
"logs": [
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-rebuild-joint-role.stdout.txt",
"bytes": 341,
"sha256": "440fd55c99cf6577b97cf1cb43dc722399de9c7aab81b1dea93487f98018ff6f"
},
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-rebuild-joint-role.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
]
},
{
"key": "format-write",
"command": [
"calliope-backend/.venv/bin/ruff",
"format",
"--config",
"calliope-backend/pyproject.toml",
"docs/hel-892/history-attribution-correction",
"docs/hel-892/batch175-closure-evidence/audit.py"
],
"cwd": "repository root",
"returncode": 0,
"logs": [
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-format-write.stdout.txt",
"bytes": 44,
"sha256": "f44b53d267035ed67c39d51a75f0904eb2b02d3259125237fb42f0a6b35cb9a0"
},
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-format-write.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
]
},
{
"key": "lint-initial",
"command": [
"calliope-backend/.venv/bin/ruff",
"check",
"--config",
"calliope-backend/pyproject.toml",
"docs/hel-892/history-attribution-correction",
"docs/hel-892/batch175-closure-evidence/audit.py"
],
"cwd": "repository root",
"returncode": 1,
"logs": [
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-lint-initial.stdout.txt",
"bytes": 638,
"sha256": "132a8d35c929f30c64135318023ffd2f47ab153fdce93edb5fd84e1d49e25300"
},
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-lint-initial.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
]
},
{
"key": "contracts-final",
"command": [
"env",
"PYTHONDONTWRITEBYTECODE=1",
"python3",
"docs/hel-892/history-attribution-correction/test_contract.py"
],
"cwd": "repository root",
"returncode": 0,
"logs": [
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-contracts-final.stdout.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
},
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-contracts-final.stderr.txt",
"bytes": 1483,
"sha256": "83a4b50dabffbda2ee37ea188a2731475178ba4a3d212e2977f732db0d29b46b"
}
]
},
{
"key": "rebuild-final",
"command": [
"env",
"PYTHONDONTWRITEBYTECODE=1",
"python3",
"docs/hel-892/history-attribution-correction/rebuild.py",
"final"
],
"cwd": "repository root",
"returncode": 0,
"logs": [
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-rebuild-final.stdout.txt",
"bytes": 341,
"sha256": "7e3c8fc7dd9c5330b4d763e157eaa8c4ca8f9a302854282d0342bc4554982060"
},
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-rebuild-final.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
]
},
{
"key": "verify-publish",
"command": [
"env",
"PYTHONDONTWRITEBYTECODE=1",
"python3",
"docs/hel-892/history-attribution-correction/verify_publish.py"
],
"cwd": "repository root",
"returncode": 0,
"logs": [
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-verify-publish.stdout.txt",
"bytes": 139,
"sha256": "5ad6edd2694b2175502918eae01a9b91742f7f55fd09ee93248b6b1da9ec1ba2"
},
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-verify-publish.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
]
},
{
"key": "format-delivery",
"command": [
"calliope-backend/.venv/bin/ruff",
"format",
"--config",
"calliope-backend/pyproject.toml",
"docs/hel-892/history-attribution-correction",
"docs/hel-892/batch175-closure-evidence/audit.py"
],
"cwd": "repository root",
"returncode": 0,
"logs": [
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-format-delivery.stdout.txt",
"bytes": 45,
"sha256": "d11b1c2647213ea703c5705d5f2e32914bd79eab9267fb6c6f7d2bd5b3ec0012"
},
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-format-delivery.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
]
},
{
"key": "lint-final",
"command": [
"calliope-backend/.venv/bin/ruff",
"check",
"--config",
"calliope-backend/pyproject.toml",
"docs/hel-892/history-attribution-correction",
"docs/hel-892/batch175-closure-evidence/audit.py"
],
"cwd": "repository root",
"returncode": 0,
"logs": [
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-lint-final.stdout.txt",
"bytes": 19,
"sha256": "82b3e6a6c090a57601d22943bd23fca9218d1031dbe5a7b754092f9a156b4f18"
},
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-lint-final.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
]
},
{
"key": "format-check",
"command": [
"calliope-backend/.venv/bin/ruff",
"format",
"--check",
"--config",
"calliope-backend/pyproject.toml",
"docs/hel-892/history-attribution-correction",
"docs/hel-892/batch175-closure-evidence/audit.py"
],
"cwd": "repository root",
"returncode": 0,
"logs": [
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-format-check.stdout.txt",
"bytes": 27,
"sha256": "ff581aaa8f1b2a77e28a682a7cae7b738f926730737e49664d06c810bcd5aa03"
},
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-format-check.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
]
},
{
"key": "ast-diff-check",
"command": [
"python3",
"-c",
"import ast,json,subprocess\nfrom pathlib import Path\nh=Path(\"docs/hel-892/history-attribution-correction\")\nfiles=list(h.rglob(\"*.py\"))+[Path(\"docs/hel-892/batch175-closure-evidence/audit.py\")]\nfor p in files:ast.parse(p.read_text(),filename=str(p))\nlive=files[-1].read_text()\nassert \"attributor.select(path, DEFINITIONS[path])\"in live\nassert \"max(matches\"not in live and \"commit[:7] in m\"not in live\nfor r in json.loads((h/\"prior175-sha256.json\").read_bytes())[\"files\"]:\n import hashlib\n assert hashlib.sha256(Path(r[\"archive_path\"]).read_bytes()).hexdigest()==r[\"sha256\"]\nsubprocess.run([\"git\",\"diff\",\"--cached\",\"--check\",\"--\",str(h),\"docs/hel-892/batch175-closure-evidence/audit.py\",\"docs/hel-892/batch175-closure-evidence/README.md\",\":!\"+str(h)+\"/prior175/**\",\":!\"+str(h)+\"/logs/**\"],check=True)\nprint(\"PASS\",len(files),\"Python AST; legacy unsafe matcher removed; archived original SHA; authored diff whitespace\")\n"
],
"cwd": "repository root",
"returncode": 0,
"logs": [
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-ast-diff-check.stdout.txt",
"bytes": 99,
"sha256": "df09434972642905bad6f8ea2ba238aff09cd39575c43eac30e07069485576d1"
},
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-ast-diff-check.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
]
},
{
"key": "historical-resource-check",
"command": [
"env",
"PYTHONDONTWRITEBYTECODE=1",
"python3",
"docs/hel-892/history-attribution-correction/check_resource_closure.py"
],
"cwd": "repository root",
"returncode": 0,
"logs": [
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-historical-resource-check.stdout.txt",
"bytes": 73,
"sha256": "23ae9cdac2adfd0e31309a5b4e03484e7cefe7230f307e2ba0e2b7902774adc1"
},
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-historical-resource-check.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
]
},
{
"key": "format-resource",
"command": [
"calliope-backend/.venv/bin/ruff",
"format",
"--config",
"calliope-backend/pyproject.toml",
"docs/hel-892/history-attribution-correction",
"docs/hel-892/batch175-closure-evidence/audit.py"
],
"cwd": "repository root",
"returncode": 0,
"logs": [
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-format-resource.stdout.txt",
"bytes": 44,
"sha256": "40640658b813871e544b8664c9e6d2675ef57e021c68246127b1bee8b2893bdf"
},
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-format-resource.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
]
},
{
"key": "lint-resource",
"command": [
"calliope-backend/.venv/bin/ruff",
"check",
"--config",
"calliope-backend/pyproject.toml",
"docs/hel-892/history-attribution-correction",
"docs/hel-892/batch175-closure-evidence/audit.py"
],
"cwd": "repository root",
"returncode": 0,
"logs": [
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-lint-resource.stdout.txt",
"bytes": 19,
"sha256": "82b3e6a6c090a57601d22943bd23fca9218d1031dbe5a7b754092f9a156b4f18"
},
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-lint-resource.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
]
},
{
"key": "ast-resource",
"command": [
"python3",
"-c",
"import ast,json,subprocess\nfrom pathlib import Path\nh=Path(\"docs/hel-892/history-attribution-correction\")\nfiles=list(h.rglob(\"*.py\"))+[Path(\"docs/hel-892/batch175-closure-evidence/audit.py\")]\nfor p in files:ast.parse(p.read_text(),filename=str(p))\nlive=files[-1].read_text()\nassert \"attributor.select(path, DEFINITIONS[path])\"in live\nassert \"max(matches\"not in live and \"commit[:7] in m\"not in live\nfor r in json.loads((h/\"prior175-sha256.json\").read_bytes())[\"files\"]:\n import hashlib\n assert hashlib.sha256(Path(r[\"archive_path\"]).read_bytes()).hexdigest()==r[\"sha256\"]\nsubprocess.run([\"git\",\"diff\",\"--cached\",\"--check\",\"--\",str(h),\"docs/hel-892/batch175-closure-evidence/audit.py\",\"docs/hel-892/batch175-closure-evidence/README.md\",\":!\"+str(h)+\"/prior175/**\",\":!\"+str(h)+\"/logs/**\"],check=True)\nprint(\"PASS\",len(files),\"Python AST; legacy unsafe matcher removed; archived original SHA; authored diff whitespace\")\n"
],
"cwd": "repository root",
"returncode": 0,
"logs": [
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-ast-resource.stdout.txt",
"bytes": 99,
"sha256": "48ed9b3d57d20f2ec6d51a4d415133bf2c074910c69e6daf525ecec79b529ec9"
},
{
"path": ".local-evidence/history-attribution-correction/logs/history-attribution-correction-ast-resource.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
]
}
],
"failures": [
"lint-initial"
],
"no_old_glob_or_log_overwrite": true
}
@@ -0,0 +1,480 @@
{
"base": "0e3e7b071f4c293642900849db8b1ead997417b8",
"self_excluded": true,
"files": [
{
"path": "docs/hel-892/batch175-closure-evidence/README.md",
"bytes": 5217,
"sha256": "aa86da3b3db24a5035e49081041c6826263486e357ca405a4c2261f8d0b7a62d",
"purpose": "历史归因候选/原新总账/逐字段差集/Git闭包/冻结/校验或中文说明"
},
{
"path": "docs/hel-892/batch175-closure-evidence/audit.py",
"bytes": 30925,
"sha256": "54dd6f2368c9b7d4c1475a10a87a9b1a5837d12a4d34b3d83f034618e7a2d621",
"purpose": "移除旧全文SHA/最新评论归因,委托角色与Git文件pin闭包"
},
{
"path": "docs/hel-892/history-attribution-correction/README.md",
"bytes": 5384,
"sha256": "41371a3e8922d4321de8a81e2a0ff32ac70832ec3fc2b6d9ea5340c2589fe3a8",
"purpose": "历史归因候选/原新总账/逐字段差集/Git闭包/冻结/校验或中文说明"
},
{
"path": "docs/hel-892/history-attribution-correction/attribution.py",
"bytes": 19152,
"sha256": "ebaa94653e058e3dae4ff2599bf27c274e9cc7b43148338c37209e9d1e75656f",
"purpose": "历史归因规则/有界负例/重建/核对/发布/运输离线工具"
},
{
"path": "docs/hel-892/history-attribution-correction/baseline-files.json",
"bytes": 4619418,
"sha256": "2f4fdb3b6df7456155daf42b3295776c3e8412381d51d44d8cfcb8c949a983b9",
"purpose": "历史归因候选/原新总账/逐字段差集/Git闭包/冻结/校验或中文说明"
},
{
"path": "docs/hel-892/history-attribution-correction/candidate-matrix.json",
"bytes": 1999109,
"sha256": "a3cef002766e3ae1b5cb854d2dacfe61c2bf4e5ebf6d17e8cbdd6c551c193af6",
"purpose": "历史归因候选/原新总账/逐字段差集/Git闭包/冻结/校验或中文说明"
},
{
"path": "docs/hel-892/history-attribution-correction/check_resource_closure.py",
"bytes": 3067,
"sha256": "88cf828a9d571f040a3675d6bf0f05c2f1cb2c113f09755797b2635c90eb726a",
"purpose": "历史归因规则/有界负例/重建/核对/发布/运输离线工具"
},
{
"path": "docs/hel-892/history-attribution-correction/collect.py",
"bytes": 2051,
"sha256": "8887da8d2ee0fa5a403260ce51528c661275b1cc4e70c6f08b9a52abf1468f46",
"purpose": "历史归因规则/有界负例/重建/核对/发布/运输离线工具"
},
{
"path": "docs/hel-892/history-attribution-correction/comment-role-records.json",
"bytes": 813293,
"sha256": "dbfcf69b12f8b8a484ba30c6f580e0c3c2e272a07819579d2d9367196d9332b3",
"purpose": "历史归因候选/原新总账/逐字段差集/Git闭包/冻结/校验或中文说明"
},
{
"path": "docs/hel-892/history-attribution-correction/completed-log-records.json",
"bytes": 19362,
"sha256": "260f13584e33bd1a1a849f6b7a3a5a06a70f4db6bcde82e9928fd92b48a34f95",
"purpose": "历史归因候选/原新总账/逐字段差集/Git闭包/冻结/校验或中文说明"
},
{
"path": "docs/hel-892/history-attribution-correction/git-facts.json",
"bytes": 3104877,
"sha256": "73bde6932f6bc185c8781d6758cf1e011b7bb7dd1b3b82bd02495a5156dc96f2",
"purpose": "历史归因候选/原新总账/逐字段差集/Git闭包/冻结/校验或中文说明"
},
{
"path": "docs/hel-892/history-attribution-correction/hel893-batch175-review.md",
"bytes": 4395,
"sha256": "513c29ebbb71f5062f6488c3976ec9a3490d16dd5055dbcd2d62205267897065",
"purpose": "历史归因候选/原新总账/逐字段差集/Git闭包/冻结/校验或中文说明"
},
{
"path": "docs/hel-892/history-attribution-correction/historical-resource-bindings.json",
"bytes": 128191,
"sha256": "3833ec808a13ef9ee02b8b3d417bad9bd604b002b29bb0f0767571c3ea012779",
"purpose": "历史归因候选/原新总账/逐字段差集/Git闭包/冻结/校验或中文说明"
},
{
"path": "docs/hel-892/history-attribution-correction/ledger.csv",
"bytes": 622261,
"sha256": "ca92391114c1740dc5a7f8f9a3503133630dc72630a78a99e7098cf7c97d278b",
"purpose": "历史归因候选/原新总账/逐字段差集/Git闭包/冻结/校验或中文说明"
},
{
"path": "docs/hel-892/history-attribution-correction/ledger.json",
"bytes": 926201,
"sha256": "b154154d3f02ca2a8fd8850b16f2883e09ad92e2ad3f131442708f75905ea9e1",
"purpose": "历史归因候选/原新总账/逐字段差集/Git闭包/冻结/校验或中文说明"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-ast-diff-check.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-ast-diff-check.stdout.txt",
"bytes": 99,
"sha256": "df09434972642905bad6f8ea2ba238aff09cd39575c43eac30e07069485576d1",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-ast-resource.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-ast-resource.stdout.txt",
"bytes": 99,
"sha256": "48ed9b3d57d20f2ec6d51a4d415133bf2c074910c69e6daf525ecec79b529ec9",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-contracts-final.stderr.txt",
"bytes": 1483,
"sha256": "83a4b50dabffbda2ee37ea188a2731475178ba4a3d212e2977f732db0d29b46b",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-contracts-final.stdout.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-contracts-initial.stderr.txt",
"bytes": 988,
"sha256": "1cc0f2a44bf10fb16e485cb0e1c05d8bec0c13cbe3c02900e42d316eeff134bd",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-contracts-initial.stdout.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-contracts-joint-role.stderr.txt",
"bytes": 1397,
"sha256": "b3a004e5669cfafa59410cd419aebca6d6844080f8a8c5c200283d9a645b7067",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-contracts-joint-role.stdout.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-contracts-role-forms.stderr.txt",
"bytes": 1174,
"sha256": "f27d8b74aa9de8c3869c84b0f0a1b22f46a08d7b1af98e043e4ed762732951a1",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-contracts-role-forms.stdout.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-format-check.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-format-check.stdout.txt",
"bytes": 27,
"sha256": "ff581aaa8f1b2a77e28a682a7cae7b738f926730737e49664d06c810bcd5aa03",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-format-delivery.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-format-delivery.stdout.txt",
"bytes": 45,
"sha256": "d11b1c2647213ea703c5705d5f2e32914bd79eab9267fb6c6f7d2bd5b3ec0012",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-format-resource.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-format-resource.stdout.txt",
"bytes": 44,
"sha256": "40640658b813871e544b8664c9e6d2675ef57e021c68246127b1bee8b2893bdf",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-format-write.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-format-write.stdout.txt",
"bytes": 44,
"sha256": "f44b53d267035ed67c39d51a75f0904eb2b02d3259125237fb42f0a6b35cb9a0",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-historical-resource-check.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-historical-resource-check.stdout.txt",
"bytes": 73,
"sha256": "23ae9cdac2adfd0e31309a5b4e03484e7cefe7230f307e2ba0e2b7902774adc1",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-lint-final.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-lint-final.stdout.txt",
"bytes": 19,
"sha256": "82b3e6a6c090a57601d22943bd23fca9218d1031dbe5a7b754092f9a156b4f18",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-lint-initial.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-lint-initial.stdout.txt",
"bytes": 638,
"sha256": "132a8d35c929f30c64135318023ffd2f47ab153fdce93edb5fd84e1d49e25300",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-lint-resource.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-lint-resource.stdout.txt",
"bytes": 19,
"sha256": "82b3e6a6c090a57601d22943bd23fca9218d1031dbe5a7b754092f9a156b4f18",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-preflight.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-preflight.stdout.txt",
"bytes": 111,
"sha256": "a7535293596f97c7db60cb07061ebf63762d4d7925647f6d97974c062d855883",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-rebuild-final.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-rebuild-final.stdout.txt",
"bytes": 341,
"sha256": "7e3c8fc7dd9c5330b4d763e157eaa8c4ca8f9a302854282d0342bc4554982060",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-rebuild-initial.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-rebuild-initial.stdout.txt",
"bytes": 343,
"sha256": "a0db989c36a0de42c44d142a9a712728e2086a4d4adcc3801ea4fa0e2e852dc5",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-rebuild-joint-role.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-rebuild-joint-role.stdout.txt",
"bytes": 341,
"sha256": "440fd55c99cf6577b97cf1cb43dc722399de9c7aab81b1dea93487f98018ff6f",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-rebuild-role-forms.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-rebuild-role-forms.stdout.txt",
"bytes": 342,
"sha256": "24fc4ea9461a525ed8d10c937a4c842d5bc4e2ad35a9cb0f6d2306abc73d880b",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-verify-publish.stderr.txt",
"bytes": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/logs/history-attribution-correction-verify-publish.stdout.txt",
"bytes": 139,
"sha256": "5ad6edd2694b2175502918eae01a9b91742f7f55fd09ee93248b6b1da9ec1ba2",
"purpose": "本轮独占命令原stdout/stderr,失败修正均保留"
},
{
"path": "docs/hel-892/history-attribution-correction/package_delivery.py",
"bytes": 5416,
"sha256": "2f7b69d9ced18e52692fc993f58782282a097aeb1e69c5c94d129d266378bf34",
"purpose": "历史归因规则/有界负例/重建/核对/发布/运输离线工具"
},
{
"path": "docs/hel-892/history-attribution-correction/preflight.json",
"bytes": 427,
"sha256": "3cd4098a9f28e881e36e07eca6f9b7b7decbaf1cded38b556fa21dd0bf04932d",
"purpose": "历史归因候选/原新总账/逐字段差集/Git闭包/冻结/校验或中文说明"
},
{
"path": "docs/hel-892/history-attribution-correction/preflight.py",
"bytes": 4258,
"sha256": "e06cac0e883fa8c882021b6a2d984beaa2d3ad71f476023e5360a349581e5a3e",
"purpose": "历史归因规则/有界负例/重建/核对/发布/运输离线工具"
},
{
"path": "docs/hel-892/history-attribution-correction/prior175/README.md",
"bytes": 4824,
"sha256": "0dc2427858deb3362b0cd1dda966aa1b2fed36f2a54bee8fd03e5cdbfb429b95",
"purpose": "0e3e7b原错误账/工具/历史原文快照,按原SHA保留"
},
{
"path": "docs/hel-892/history-attribution-correction/prior175/audit.py",
"bytes": 32477,
"sha256": "9966bce04fdb585643cccde15155ae74f2718ca75686df34a7e213f3451ab647",
"purpose": "0e3e7b原错误账/工具/历史原文快照,按原SHA保留"
},
{
"path": "docs/hel-892/history-attribution-correction/prior175/current-instruction.json",
"bytes": 5837,
"sha256": "661f36a8cf14e4d05416dc20a759b21305869d74b55837121f14b7508ca2dfe4",
"purpose": "0e3e7b原错误账/工具/历史原文快照,按原SHA保留"
},
{
"path": "docs/hel-892/history-attribution-correction/prior175/historical-comment-texts.json",
"bytes": 702261,
"sha256": "bc42e7ad130e46a9ccfe2dbfa0c2fac0c24107813165aecdea4b7ce06663cd3c",
"purpose": "0e3e7b原错误账/工具/历史原文快照,按原SHA保留"
},
{
"path": "docs/hel-892/history-attribution-correction/prior175/ledger.csv",
"bytes": 475875,
"sha256": "ffe4bb438dc170ab471f162e3402221ba0e944516fbe0d3c946253a0ca3889aa",
"purpose": "0e3e7b原错误账/工具/历史原文快照,按原SHA保留"
},
{
"path": "docs/hel-892/history-attribution-correction/prior175/ledger.json",
"bytes": 703533,
"sha256": "bf82b1b38035ec60f24dcbc9b1ea3d41242729063223918351e9778f5d88df5e",
"purpose": "0e3e7b原错误账/工具/历史原文快照,按原SHA保留"
},
{
"path": "docs/hel-892/history-attribution-correction/prior175/remaining-work.json",
"bytes": 5236089,
"sha256": "48cc62ff6b8bc0e72ce378afcb9b7c893c78f84dc69f24385d08518a4826cbc0",
"purpose": "0e3e7b原错误账/工具/历史原文快照,按原SHA保留"
},
{
"path": "docs/hel-892/history-attribution-correction/prior175/summary.json",
"bytes": 1013,
"sha256": "288636fa27dfdd828d21bd36fe918f04f59bc47cf12cb9ca622dfba9fd56a8d7",
"purpose": "0e3e7b原错误账/工具/历史原文快照,按原SHA保留"
},
{
"path": "docs/hel-892/history-attribution-correction/prior175/进度说明与下一阶段建议.md",
"bytes": 4020,
"sha256": "b878fe4528d2122e407d359f025eca11f341234797d6c28dfa4a0a681691db4c",
"purpose": "0e3e7b原错误账/工具/历史原文快照,按原SHA保留"
},
{
"path": "docs/hel-892/history-attribution-correction/prior175/逐文件总账与剩余条件.md",
"bytes": 1243155,
"sha256": "046af53deaefad8817ca575f25e1b70d31139bf7c679e400c248ed6dd192027a",
"purpose": "0e3e7b原错误账/工具/历史原文快照,按原SHA保留"
},
{
"path": "docs/hel-892/history-attribution-correction/prior175-sha256.json",
"bytes": 3407,
"sha256": "3d03d4ac36a4b31276c842ba2e16e4607a1b532f7fdc03d04e3439ac5a026725",
"purpose": "历史归因候选/原新总账/逐字段差集/Git闭包/冻结/校验或中文说明"
},
{
"path": "docs/hel-892/history-attribution-correction/rebuild.py",
"bytes": 9429,
"sha256": "8fd1392d3850454ad6b0d7f734b7f2d58a5cb2f171cd62852cd3b5279319ac49",
"purpose": "历史归因规则/有界负例/重建/核对/发布/运输离线工具"
},
{
"path": "docs/hel-892/history-attribution-correction/remaining-work.json",
"bytes": 5469850,
"sha256": "a33e446f8aa235672deee1b2420443020c143e262afad41aa991cb10c272a63f",
"purpose": "历史归因候选/原新总账/逐字段差集/Git闭包/冻结/校验或中文说明"
},
{
"path": "docs/hel-892/history-attribution-correction/row-field-differences.json",
"bytes": 575799,
"sha256": "bf551cf8942c1338ed86b676507e145d8552d299e04e96e1206e9664971a89f9",
"purpose": "历史归因候选/原新总账/逐字段差集/Git闭包/冻结/校验或中文说明"
},
{
"path": "docs/hel-892/history-attribution-correction/run.py",
"bytes": 1542,
"sha256": "ce4534599db6014ae3ead5b2a950b252985a3f08200d768d2c289b8a33deb5f3",
"purpose": "历史归因规则/有界负例/重建/核对/发布/运输离线工具"
},
{
"path": "docs/hel-892/history-attribution-correction/summary.json",
"bytes": 1379,
"sha256": "c5138782c025075649f3276e56b41d361afe89c0a14c8f66bcb97ca8662bece7",
"purpose": "历史归因候选/原新总账/逐字段差集/Git闭包/冻结/校验或中文说明"
},
{
"path": "docs/hel-892/history-attribution-correction/test_contract.py",
"bytes": 6738,
"sha256": "8c808a4d5b19bd94cd027e4d2d9c48ed81deaa6bf194a59df0ffe5f6b7e83244",
"purpose": "历史归因规则/有界负例/重建/核对/发布/运输离线工具"
},
{
"path": "docs/hel-892/history-attribution-correction/verification.json",
"bytes": 1102,
"sha256": "fb1961bb21f310e82048573e3e97fecf994312ce67fb775e15c2b4de0a4be25b",
"purpose": "历史归因候选/原新总账/逐字段差集/Git闭包/冻结/校验或中文说明"
},
{
"path": "docs/hel-892/history-attribution-correction/verify_publish.py",
"bytes": 5774,
"sha256": "690134912f326b861f15898827de161fec05344245f9805b6b9678bffb4d55f0",
"purpose": "历史归因规则/有界负例/重建/核对/发布/运输离线工具"
},
{
"path": "docs/hel-892/history-attribution-correction/进度说明.md",
"bytes": 1072,
"sha256": "75b6b38b585819a365c7cc36322ed1cdd2ebacc83ee6aa483d7dd07d73a2d0a6",
"purpose": "历史归因候选/原新总账/逐字段差集/Git闭包/冻结/校验或中文说明"
},
{
"path": "docs/hel-892/history-attribution-correction/逐文件总账与剩余条件.md",
"bytes": 1375699,
"sha256": "22523583149edbc927dd697631334473a0257c0e2ce99140a0fb6d005d99185c",
"purpose": "历史归因候选/原新总账/逐字段差集/Git闭包/冻结/校验或中文说明"
}
]
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,24 @@
第175批独立复核需整改:全量数据核对可复现,历史交付归因存在明确误配,总账本轮不通过。退回范围限定为历史定位规则和派生总账,不改产品、原件或固定参考;155份固定参考的既有结论保持。
受审提交0e3e7b071f4c293642900849db8b1ead997417b8,基线c73d76527593707121cf4b137c4d594eeecd8230。PR25仍open/draft、面向main、未合并。
独立验证通过:仅111个新增docs/离线工具文件,18,965个基线文件逐Git blob不变,产品修改0;交付ZIP551成员/550用途逐字节/SHA/CRC及有效分支bundle核准。8个工具Ruff/format通过。使用全新自有隔离库首导155/排除1、保存原离线历史输入后重算,ledger、summary、原值/注释/身份/来源/资格/剩余清单与施工JSON全部一致;全列CSV和中文155段逐项一致。
逐10,761主保存指针的原值及递归JSON类型、287条实际doc.source_notes完整内容相符;10,456条既有来源文本引用均与记录SHA和旧Git字节相符,仅为文本字节证明。8份缺comments键和87份缺node_bindings键保持原态。新隔离库仍16 pending_check/139 needs_conversion,1217具名/3660无具名控件节点/294伴随口径分列;全草稿、停用、unchecked、空定稿/实跑时间,最终定稿/本系列新增可靠转换/真实生成均0。没有读取线上库或目标状态。
阻止通过的定位缺陷在`docs/hel-892/batch175-closure-evidence/audit.py:371`:全文含提交或7位前缀就算候选,再取最新评论,未区分主交付与基线/旧版引用。
| 原文件 | 当前误选 | 已保存的正确交付候选 |
| --- | --- | --- |
| Krea2_t2i_20260818_API.json,pin提交61798dc | 166角色设定表评论01a1987c-f9aa-7781-85d3-5a93331f1627;61798dc0只是基线,主提交282324ab及pin属于另一文件 | 165评论01a1986f-3ac6-721d-bb47-0d97792f86a9;主提交61798dc、pin864ddcc5对应原API |
| video_minimax_h3_r2v_4ref_API.json,提交dcf15f85 | 173五参考评论01a198d9-f8a3-710b-b14d-037a92405368;dcf15f85只是基线,主提交f4e66a09及pin属于五参考 | 172评论01a198cf-78a6-7591-94db-1d129c11c87a;主提交dcf15f85、pin9ee5dcc3对应四参考 |
两例都在175已保存的历史输入内,不需新材料。错误父评论还会污染latest_chief_progress和审核转述的关联,因此“delivery_unresolved=0”和“每份已定位交付依据”当前不能直接接受。46份未定位明确通过回执是有界证据限制,不等于未通过;修正后必须重新统计,不能把46当预期固定值。
要求全155行重核同类归因,按原文件、准确pin、提交角色和该评论实际交付范围关联。记录文件最后触碰、定义pin引入/更改、交付主head/受测实现分别记录;共享pins文件或全文SHA命中均不能单独证明覆盖。明确多图批次可凭准确文件/pin闭包保留,不能一概否定;ControlNet的011b8/11图记录本轮仅要求进一步范围证明,未判为错误。证据不足输出unknown,不猜、不补通过。审核/进度转述必须随正确文件范围重建,不能仅凭“接受”关键字或否定语句放行。
整改需保留原0e3e7b总账及SHA、逐行/字段差集、每个候选的原文与接受/拒绝理由,增加已证两例及基线/依赖/短前缀歧义/共享文件范围/多图正例/否定或仅进度语句的离线对照。仅重跑受影响审计器、渲染、CSV、工具检查和冻结验证;原174的107测试/2791浏览及构建明确继承,不重跑或累计无变化套件。完成后再做一次独立复审,暂不推进176试点。
38个正式命令键/76份stdout、stderr及失败退出码/SHA已核,失败没有计作通过。未重跑前后端构建、浏览器或产品单测;本轮新隔离库未起服务,8247/5173独立拒绝且可绑定。原175四次读取结构失败、工具/CSV/EOF/收录错误及171历史限制保留。独立冻结脚本首次用换行读取Git中文文件名而拒绝,改为NUL分隔后111新增docs及全基线核准,未改产品或冻结条件。
下一步仅第175批历史归因窄修;全量产品、155固定块/10,761项/287注释/资格保持冻结。不需要白栖知补模型素材或机器窗口,不连接目标、执行上游/模型/媒体、取新源码/依赖、写在线库、启用、合并或部署。
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
@@ -0,0 +1 @@
PASS 10 Python AST; legacy unsafe matcher removed; archived original SHA; authored diff whitespace
@@ -0,0 +1 @@
PASS 11 Python AST; legacy unsafe matcher removed; archived original SHA; authored diff whitespace
@@ -0,0 +1,26 @@
test_actual_four_refs_172_rejects_173_baseline (__main__.Contracts) ... ok
test_actual_krea_165_delivery_rejects_166_baseline (__main__.Contracts) ... ok
test_affirmative_with_global_work_remaining (__main__.Contracts) ... ok
test_ambiguous_prefix (__main__.Contracts) ... ok
test_baseline_only (__main__.Contracts) ... ok
test_bold_markdown_head (__main__.Contracts) ... ok
test_conflicting_negative_does_not_become_positive (__main__.Contracts) ... ok
test_dependency_only (__main__.Contracts) ... ok
test_explicit_multi_scope (__main__.Contracts) ... ok
test_explicit_passed_independent_audit (__main__.Contracts) ... ok
test_final_abbreviation_after_explicit_implementation (__main__.Contracts) ... ok
test_joint_tested_and_final_head (__main__.Contracts) ... ok
test_multi_scope_with_descriptive_noun (__main__.Contracts) ... ok
test_negative_audit_not_accepted (__main__.Contracts) ... ok
test_old_only (__main__.Contracts) ... ok
test_progress_or_accept_word_not_certification (__main__.Contracts) ... ok
test_shared_multi_record_with_only_other_file_scope (__main__.Contracts) ... ok
test_shared_record_not_target_delta (__main__.Contracts) ... ok
test_tested_baseline_cannot_supply_implementation_closure (__main__.Contracts) ... ok
test_tested_implementation_and_successor_head_separate (__main__.Contracts) ... ok
test_unscoped_multi_is_unknown (__main__.Contracts) ... ok
----------------------------------------------------------------------
Ran 21 tests in 0.147s
OK
@@ -0,0 +1,19 @@
test_actual_four_refs_172_rejects_173_baseline (__main__.Contracts) ... ok
test_actual_krea_165_delivery_rejects_166_baseline (__main__.Contracts) ... ok
test_affirmative_with_global_work_remaining (__main__.Contracts) ... ok
test_ambiguous_prefix (__main__.Contracts) ... ok
test_baseline_only (__main__.Contracts) ... ok
test_conflicting_negative_does_not_become_positive (__main__.Contracts) ... ok
test_dependency_only (__main__.Contracts) ... ok
test_explicit_multi_scope (__main__.Contracts) ... ok
test_negative_audit_not_accepted (__main__.Contracts) ... ok
test_old_only (__main__.Contracts) ... ok
test_progress_or_accept_word_not_certification (__main__.Contracts) ... ok
test_shared_record_not_target_delta (__main__.Contracts) ... ok
test_tested_implementation_and_successor_head_separate (__main__.Contracts) ... ok
test_unscoped_multi_is_unknown (__main__.Contracts) ... ok
----------------------------------------------------------------------
Ran 14 tests in 0.155s
OK
@@ -0,0 +1,25 @@
test_actual_four_refs_172_rejects_173_baseline (__main__.Contracts) ... ok
test_actual_krea_165_delivery_rejects_166_baseline (__main__.Contracts) ... ok
test_affirmative_with_global_work_remaining (__main__.Contracts) ... ok
test_ambiguous_prefix (__main__.Contracts) ... ok
test_baseline_only (__main__.Contracts) ... ok
test_bold_markdown_head (__main__.Contracts) ... ok
test_conflicting_negative_does_not_become_positive (__main__.Contracts) ... ok
test_dependency_only (__main__.Contracts) ... ok
test_explicit_multi_scope (__main__.Contracts) ... ok
test_explicit_passed_independent_audit (__main__.Contracts) ... ok
test_final_abbreviation_after_explicit_implementation (__main__.Contracts) ... ok
test_joint_tested_and_final_head (__main__.Contracts) ... ok
test_multi_scope_with_descriptive_noun (__main__.Contracts) ... ok
test_negative_audit_not_accepted (__main__.Contracts) ... ok
test_old_only (__main__.Contracts) ... ok
test_progress_or_accept_word_not_certification (__main__.Contracts) ... ok
test_shared_multi_record_with_only_other_file_scope (__main__.Contracts) ... ok
test_shared_record_not_target_delta (__main__.Contracts) ... ok
test_tested_implementation_and_successor_head_separate (__main__.Contracts) ... ok
test_unscoped_multi_is_unknown (__main__.Contracts) ... ok
----------------------------------------------------------------------
Ran 20 tests in 0.160s
OK
@@ -0,0 +1,22 @@
test_actual_four_refs_172_rejects_173_baseline (__main__.Contracts) ... ok
test_actual_krea_165_delivery_rejects_166_baseline (__main__.Contracts) ... ok
test_affirmative_with_global_work_remaining (__main__.Contracts) ... ok
test_ambiguous_prefix (__main__.Contracts) ... ok
test_baseline_only (__main__.Contracts) ... ok
test_bold_markdown_head (__main__.Contracts) ... ok
test_conflicting_negative_does_not_become_positive (__main__.Contracts) ... ok
test_dependency_only (__main__.Contracts) ... ok
test_explicit_multi_scope (__main__.Contracts) ... ok
test_explicit_passed_independent_audit (__main__.Contracts) ... ok
test_multi_scope_with_descriptive_noun (__main__.Contracts) ... ok
test_negative_audit_not_accepted (__main__.Contracts) ... ok
test_old_only (__main__.Contracts) ... ok
test_progress_or_accept_word_not_certification (__main__.Contracts) ... ok
test_shared_record_not_target_delta (__main__.Contracts) ... ok
test_tested_implementation_and_successor_head_separate (__main__.Contracts) ... ok
test_unscoped_multi_is_unknown (__main__.Contracts) ... ok
----------------------------------------------------------------------
Ran 17 tests in 0.145s
OK
@@ -0,0 +1 @@
3 files reformatted, 14 files left unchanged
@@ -0,0 +1 @@
1 file reformatted, 17 files left unchanged
@@ -0,0 +1 @@
6 files reformatted, 5 files left unchanged
@@ -0,0 +1 @@
PASS actual historical resource blocks/source SHA/code pin; 191 bindings
@@ -0,0 +1,12 @@
E501 Line too long (105 > 100)
--> docs/hel-892/history-attribution-correction/attribution.py:392:101
|
390 | definition_pin_introductions=origins,
391 | delivery_comment_id=selected["comment_id"] if selected else "unknown",
392 | selection_rule="unique causal pin origin and explicit file-scoped delivery; no time ranking",
| ^^^^^
393 | ambiguity="none" if selected else "unknown: no unique origin/delivery evidence",
394 | candidates=matrix,
|
Found 1 error.
@@ -0,0 +1 @@
PASS rejected175 transport/551 members/550 purposes/bundle; 19076 baseline blobs; 10 prior snapshots preserved
@@ -0,0 +1,2 @@
{"base": "0e3e7b071f4c293642900849db8b1ead997417b8", "delivery_changed": 99, "unique_pin_origins": 155, "original_review_unknown": 46, "chronology_used_for_selection": false, "main_card_history_bulk_fetched": false, "old_ledger_sha256": "bf82b1b38035ec60f24dcbc9b1ea3d41242729063223918351e9778f5d88df5e"}
unknown delivery 0 unknown audit 35
@@ -0,0 +1,2 @@
{"base": "0e3e7b071f4c293642900849db8b1ead997417b8", "delivery_changed": 118, "unique_pin_origins": 155, "original_review_unknown": 46, "chronology_used_for_selection": false, "main_card_history_bulk_fetched": false, "old_ledger_sha256": "bf82b1b38035ec60f24dcbc9b1ea3d41242729063223918351e9778f5d88df5e"}
unknown delivery 53 unknown audit 84
@@ -0,0 +1,2 @@
{"base": "0e3e7b071f4c293642900849db8b1ead997417b8", "delivery_changed": 99, "unique_pin_origins": 155, "original_review_unknown": 46, "chronology_used_for_selection": false, "main_card_history_bulk_fetched": false, "old_ledger_sha256": "bf82b1b38035ec60f24dcbc9b1ea3d41242729063223918351e9778f5d88df5e"}
unknown delivery 0 unknown audit 34
@@ -0,0 +1,2 @@
{"base": "0e3e7b071f4c293642900849db8b1ead997417b8", "delivery_changed": 100, "unique_pin_origins": 155, "original_review_unknown": 46, "chronology_used_for_selection": false, "main_card_history_bulk_fetched": false, "old_ledger_sha256": "bf82b1b38035ec60f24dcbc9b1ea3d41242729063223918351e9778f5d88df5e"}
unknown delivery 5 unknown audit 39
@@ -0,0 +1 @@
PASS 155 rows/full CSV/Chinese; approved data frozen; 19074 old files unchanged, only2 existing tools/docs changed; ports refused/bindable
@@ -0,0 +1,141 @@
"""Package the narrow provenance correction, never the old transport closure."""
import hashlib
import json
import subprocess
import urllib.request
import zipfile
from pathlib import Path
ROOT = Path(__file__).resolve().parents[3]
HERE = Path(__file__).resolve().parent
LOCAL = ROOT / ".local-evidence/history-attribution-correction"
BASE = "0e3e7b071f4c293642900849db8b1ead997417b8"
def git(*args):
return subprocess.check_output(["git", *args], cwd=ROOT).decode().strip()
def sha(raw):
return hashlib.sha256(raw).hexdigest()
def write(path, obj):
with path.open("x") as f:
json.dump(obj, f, ensure_ascii=False, indent=2)
f.write("\n")
def main():
out = LOCAL / "delivery"
out.mkdir()
assert not git("status", "--porcelain")
head, branch = git("rev-parse", "HEAD"), git("branch", "--show-current")
remote = git("ls-remote", "origin", "refs/heads/" + branch).split()[0]
assert head == remote and branch == "agent/agent/a64a969a6a44"
with urllib.request.urlopen(
"https://gitea.xbay.cc/api/v1/repos/leefer/aigc-home/pulls/25", timeout=45
) as response:
pr = json.load(response)
assert pr["state"] == "open" and pr["head"]["sha"] == head and pr["base"]["ref"] == "main"
index = json.loads((HERE / "file-purpose-sha256.json").read_bytes())
changed = git("diff", "--name-only", "-z", BASE, head).strip("\0").split("\0")
assert set(changed) == {r["path"] for r in index["files"]} | {
(HERE / "file-purpose-sha256.json").relative_to(ROOT).as_posix()
}
for r in index["files"]:
assert sha((ROOT / r["path"]).read_bytes()) == r["sha256"]
facts = json.loads((HERE / "git-facts.json").read_bytes())
for token, r in facts["resolutions"].items():
if r["status"] == "unique_commit":
assert git("rev-parse", "--disambiguate=" + token).splitlines() == [r["commit"]]
with (out / "complete.patch").open("xb") as f:
f.write(subprocess.check_output(["git", "diff", "--binary", BASE, head], cwd=ROOT))
subprocess.run(
["git", "bundle", "create", str(out / "correction.bundle"), branch, "^" + BASE],
cwd=ROOT,
check=True,
)
verified = subprocess.run(
["git", "bundle", "verify", str(out / "correction.bundle")],
cwd=ROOT,
capture_output=True,
check=True,
)
(out / "bundle-verify.stdout.txt").write_bytes(verified.stdout)
(out / "bundle-verify.stderr.txt").write_bytes(verified.stderr)
write(
out / "final-head.json",
dict(
base=BASE,
head=head,
remote_head=remote,
branch=branch,
pr="https://gitea.xbay.cc/leefer/aigc-home/pulls/25",
pr_head=pr["head"]["sha"],
pr_base="main",
pr_state=pr["state"],
clean=True,
product_changes=0,
independent_review="pending HEL-893 re-review",
),
)
files = {name: ROOT / name for name in changed}
for name in [
"complete.patch",
"correction.bundle",
"bundle-verify.stdout.txt",
"bundle-verify.stderr.txt",
"final-head.json",
]:
files[name] = out / name
# Retain the intermediate correction attempts and exact command records in this batch only.
for dirname in ["attempt-1", "attempt-2", "attempt-3", "records"]:
for path in sorted((LOCAL / dirname).iterdir()):
assert path.is_file()
files["run-evidence/" + dirname + "/" + path.name] = path
for name in ["prior-bundle-verify.stdout.txt", "prior-bundle-verify.stderr.txt"]:
files["run-evidence/" + name] = LOCAL / name
files["run-evidence/log-index-before-resource.json"] = LOCAL / "log-index-before-resource.json"
for key in ["commit", "push"]:
record = json.loads((LOCAL / "records" / (key + ".json")).read_bytes())
for r in record["logs"]:
files["delivery-logs/" + Path(r["path"]).name] = ROOT / r["path"]
purposes = [
dict(
path=n,
bytes=p.stat().st_size,
sha256=sha(p.read_bytes()),
purpose="本轮窄修代码/归因矩阵/原账快照/差集/冻结/独占日志或中间输出;不含旧ZIP闭包",
)
for n, p in sorted(files.items())
]
write(
out / "bundle-purpose-sha256.json",
dict(base=BASE, head=head, self_excluded=True, files=purposes),
)
files["bundle-purpose-sha256.json"] = out / "bundle-purpose-sha256.json"
archive = out / "HEL-892-history-attribution-correction-evidence.zip"
with zipfile.ZipFile(archive, "x", zipfile.ZIP_DEFLATED) as z:
for n, p in sorted(files.items()):
z.write(p, n)
with zipfile.ZipFile(archive) as z:
assert z.testzip() is None and set(z.namelist()) == set(files)
for n, p in files.items():
assert z.read(n) == p.read_bytes() and sha(z.read(n)) == sha(p.read_bytes())
write(
out / "archive-verification.json",
dict(
archive=archive.name,
bytes=archive.stat().st_size,
sha256=sha(archive.read_bytes()),
members=len(files),
all_bytes_sha_crc_equal=True,
),
)
print("PASS", head, len(files), "members byte/SHA/CRC; ZIP bytes", archive.stat().st_size)
if __name__ == "__main__":
main()
@@ -0,0 +1,13 @@
{
"base": "0e3e7b071f4c293642900849db8b1ead997417b8",
"directory_existed_before": false,
"original_zip_members_verified": 551,
"original_purpose_rows": 550,
"old_blobs": 19076,
"source_of_review": "HEL-888 current review attachment",
"product_change_allowlist": [],
"existing_tool_allowlist": [
"docs/hel-892/batch175-closure-evidence/audit.py",
"docs/hel-892/batch175-closure-evidence/README.md"
]
}
@@ -0,0 +1,119 @@
"""Preserve the rejected ledger and verify its original transport before correcting."""
import hashlib
import json
import subprocess
import zipfile
from pathlib import Path
ROOT = Path(__file__).resolve().parents[3]
HERE = Path(__file__).resolve().parent
LOCAL = ROOT / ".local-evidence/history-attribution-correction"
BASE = "0e3e7b071f4c293642900849db8b1ead997417b8"
PRIOR = ROOT / "docs/hel-892/batch175-closure-evidence"
def sha(raw):
return hashlib.sha256(raw).hexdigest()
def write(path, obj):
with path.open("x", encoding="utf-8") as f:
json.dump(obj, f, ensure_ascii=False, indent=2)
f.write("\n")
def main():
assert subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=ROOT).decode().strip() == BASE
assert not subprocess.check_output(["git", "diff", "--name-only"], cwd=ROOT)
old = ROOT / ".local-evidence/batch175-closure/delivery"
metadata = json.loads((old / "archive-verification.json").read_bytes())
archive = old / metadata["archive"]
assert sha(archive.read_bytes()) == metadata["sha256"]
assert archive.stat().st_size == metadata["bytes"]
purposes = json.loads((old / "bundle-purpose-sha256.json").read_bytes())
with zipfile.ZipFile(archive) as z:
assert len(z.namelist()) == metadata["members"] == 551 and z.testzip() is None
for r in purposes["files"]:
raw = z.read(r["path"])
assert len(raw) == r["bytes"] and sha(raw) == r["sha256"]
verified = subprocess.run(
["git", "bundle", "verify", str(old / "batch175.bundle")],
cwd=ROOT,
capture_output=True,
check=True,
)
(LOCAL / "prior-bundle-verify.stdout.txt").write_bytes(verified.stdout)
(LOCAL / "prior-bundle-verify.stderr.txt").write_bytes(verified.stderr)
prior = HERE / "prior175"
prior.mkdir()
names = [
"ledger.json",
"ledger.csv",
"summary.json",
"remaining-work.json",
"逐文件总账与剩余条件.md",
"进度说明与下一阶段建议.md",
"README.md",
"audit.py",
"historical-comment-texts.json",
"current-instruction.json",
]
snapshots = []
for name in names:
raw = (PRIOR / name).read_bytes()
with (prior / name).open("xb") as f:
f.write(raw)
snapshots.append(
dict(
original_path=(PRIOR / name).relative_to(ROOT).as_posix(),
archive_path=(prior / name).relative_to(ROOT).as_posix(),
sha256=sha(raw),
bytes=len(raw),
)
)
baseline = []
for item in (
subprocess.check_output(["git", "ls-tree", "-rz", BASE], cwd=ROOT)
.rstrip(b"\0")
.split(b"\0")
):
meta, encoded = item.split(b"\t", 1)
path = encoded.decode()
raw = (ROOT / path).read_bytes()
blob = meta.decode().split()[2]
assert hashlib.sha1(b"blob " + str(len(raw)).encode() + b"\0" + raw).hexdigest() == blob
baseline.append(dict(path=path, git_blob_sha1=blob, sha256=sha(raw)))
write(HERE / "baseline-files.json", dict(base=BASE, files=baseline))
write(
HERE / "prior175-sha256.json",
dict(base=BASE, files=snapshots, original_transport=metadata, originals_remain_in_git=True),
)
write(
HERE / "preflight.json",
dict(
base=BASE,
directory_existed_before=False,
original_zip_members_verified=551,
original_purpose_rows=len(purposes["files"]),
old_blobs=len(baseline),
source_of_review="HEL-888 current review attachment",
product_change_allowlist=[],
existing_tool_allowlist=[
"docs/hel-892/batch175-closure-evidence/audit.py",
"docs/hel-892/batch175-closure-evidence/README.md",
],
),
)
review = LOCAL / "review/hel893-batch175-review.md"
with (HERE / review.name).open("xb") as f:
f.write(review.read_bytes())
print(
"PASS rejected175 transport/551 members/550 purposes/bundle;",
len(baseline),
"baseline blobs; 10 prior snapshots preserved",
)
if __name__ == "__main__":
main()
@@ -0,0 +1,74 @@
{
"base": "0e3e7b071f4c293642900849db8b1ead997417b8",
"files": [
{
"original_path": "docs/hel-892/batch175-closure-evidence/ledger.json",
"archive_path": "docs/hel-892/history-attribution-correction/prior175/ledger.json",
"sha256": "bf82b1b38035ec60f24dcbc9b1ea3d41242729063223918351e9778f5d88df5e",
"bytes": 703533
},
{
"original_path": "docs/hel-892/batch175-closure-evidence/ledger.csv",
"archive_path": "docs/hel-892/history-attribution-correction/prior175/ledger.csv",
"sha256": "ffe4bb438dc170ab471f162e3402221ba0e944516fbe0d3c946253a0ca3889aa",
"bytes": 475875
},
{
"original_path": "docs/hel-892/batch175-closure-evidence/summary.json",
"archive_path": "docs/hel-892/history-attribution-correction/prior175/summary.json",
"sha256": "288636fa27dfdd828d21bd36fe918f04f59bc47cf12cb9ca622dfba9fd56a8d7",
"bytes": 1013
},
{
"original_path": "docs/hel-892/batch175-closure-evidence/remaining-work.json",
"archive_path": "docs/hel-892/history-attribution-correction/prior175/remaining-work.json",
"sha256": "48cc62ff6b8bc0e72ce378afcb9b7c893c78f84dc69f24385d08518a4826cbc0",
"bytes": 5236089
},
{
"original_path": "docs/hel-892/batch175-closure-evidence/逐文件总账与剩余条件.md",
"archive_path": "docs/hel-892/history-attribution-correction/prior175/逐文件总账与剩余条件.md",
"sha256": "046af53deaefad8817ca575f25e1b70d31139bf7c679e400c248ed6dd192027a",
"bytes": 1243155
},
{
"original_path": "docs/hel-892/batch175-closure-evidence/进度说明与下一阶段建议.md",
"archive_path": "docs/hel-892/history-attribution-correction/prior175/进度说明与下一阶段建议.md",
"sha256": "b878fe4528d2122e407d359f025eca11f341234797d6c28dfa4a0a681691db4c",
"bytes": 4020
},
{
"original_path": "docs/hel-892/batch175-closure-evidence/README.md",
"archive_path": "docs/hel-892/history-attribution-correction/prior175/README.md",
"sha256": "0dc2427858deb3362b0cd1dda966aa1b2fed36f2a54bee8fd03e5cdbfb429b95",
"bytes": 4824
},
{
"original_path": "docs/hel-892/batch175-closure-evidence/audit.py",
"archive_path": "docs/hel-892/history-attribution-correction/prior175/audit.py",
"sha256": "9966bce04fdb585643cccde15155ae74f2718ca75686df34a7e213f3451ab647",
"bytes": 32477
},
{
"original_path": "docs/hel-892/batch175-closure-evidence/historical-comment-texts.json",
"archive_path": "docs/hel-892/history-attribution-correction/prior175/historical-comment-texts.json",
"sha256": "bc42e7ad130e46a9ccfe2dbfa0c2fac0c24107813165aecdea4b7ce06663cd3c",
"bytes": 702261
},
{
"original_path": "docs/hel-892/batch175-closure-evidence/current-instruction.json",
"archive_path": "docs/hel-892/history-attribution-correction/prior175/current-instruction.json",
"sha256": "661f36a8cf14e4d05416dc20a759b21305869d74b55837121f14b7508ca2dfe4",
"bytes": 5837
}
],
"original_transport": {
"archive": "HEL-892-batch175-closure-audit-evidence.zip",
"bytes": 22859550,
"sha256": "f60cf147b1e781eaadaaf8cf513eb64243a2b4e4f194af44a37feb12488758f3",
"members": 551,
"all_bytes_sha_crc_equal": true,
"independent_zip": true
},
"originals_remain_in_git": true
}
@@ -0,0 +1,37 @@
本目录是第175批只读闭环盘点,基线为`c73d76527593707121cf4b137c4d594eeecd8230`。产品模块边界依据仓库README的工作流说明及`comfyui/library.py`、`fixed_document.py`、`library_cli.py`和既有审计脚本;没有新增依赖、产品测试、执行入口或界面修改。
先看`进度说明与下一阶段建议.md`,再按`ledger.json`、全列`ledger.csv`或`逐文件总账与剩余条件.md`查155份目标。`summary.json`给实际计数;`remaining-work.json`按每份文件保留准确身份声明、未验证实例、原边界和最小后续条件。状态仅代表本轮新隔离库,不代表线上库或目标安装。
引用约定:`source_reviews.json#/...`与原件`#/nodes/...`使用JSON Pointer;对数组型总账文件,`identity-records.json#example_ComfyUI_workflows/...`等是**按source_repo_path精确相等选择唯一行**的定位约定,不是RFC6901数组指针。每行路径唯一,三种总账均可搜索同一原路径。字段`defaults_units_ranges_basis`中的`*`/大括号表示字段选择规则,逐项可执行指针在`saved-value-proof.json`的block_evidence与pointer里。引用不指向运行时私有文件,也不把路径文本当可下载附件。
证据文件:
- `saved-value-proof.json`:10761原保存指针、JSON类型、递归类型SHA、并行具名值的独立核对;不把103个实际null与缺键混淆。
- `notes-proof.json`:287条实际doc.source_notes完整控件内容;原数组与其中的字符串分别处理,换行和尾白不变。
- `identity-records.json`:原节点声明与固定块绑定记录分开,准确静态绑定/具体未取得或未匹配/无准确身份/仅候选分别记录;87个缺键不补0。
- `source-text-records.json`:10456条来源文本引用的已有Git字节SHA;同一文本不同引用不当独立实现数量,SHA定位不认证身份。
- `qualification-records.json`:实际隔离库逐行状态、依赖和原导入问题。16/139与1217/3660/294各自计数,155定稿/新增可靠转换/真实生成仍0。
- `baseline-files.json`、`preflight.json`、`final-verification.json`:全部18965基线文件冻结,旧174两分包159成员字节/SHA/CRC,以及CSV全列/中文155段/资格核对。
- `inherited-evidence.json`:绑定c73d765的174构建/155定义/全量浏览与GET/旧库保护证据SHA,明确本轮未重跑。
- `historical-comment-texts.json`、`current-instruction.json`:本卡有界逐线程读取的交付/审核转述。46份未匹配明确通过回执,保留unknown;不等于断言未审核通过。
- `completed-log-records.json`及`logs/`:正式执行逐键命令、退出码、stdout/stderr/SHA,含失败修正。完整CLI线程输出和中止产物只在本轮ZIP的`run-evidence/`中保留,不重复放进Git。
本轮实际执行顺序为预检→首导→按线程补交付历史→盘点与修正→展开剩余条件→中文渲染→总账与冻结复核→工具格式/lint/解析→提交推送→补丁/bundle/ZIP。完整准确命令以日志索引为准;文档中旧107测试/2791浏览断言属于174,不计本轮。
复核不需要启动服务或上游:解压本轮ZIP,在基线加本轮补丁的独立checkout核对用途SHA;运行`git bundle verify batch175.bundle`验证有效分支引用及基线前置提交。工具只用标准库、已有产品导入器与原环境Ruff,不安装依赖。要重算,必须在**全新checkout/全新隔离目录**准备输入,禁止覆盖原run目录:保留本包`run-evidence/instruction.json`、`baseline-files.json`、`preflight.json`、`history-reads.json`与`threads/`的原记录作为离线历史输入,再用下面的首导命令建立新库;不再请求历史来源或目标定义。
```bash
PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=calliope-backend/src \
calliope-backend/.venv/bin/python -m calliope.comfyui.library_cli import \
--root example_ComfyUI_workflows \
--db .local-evidence/batch175-closure/library.db \
--source-commit c73d76527593707121cf4b137c4d594eeecd8230 \
--companions docs/hel-892/supplied-api/manifest.json \
--output-dir .local-evidence/batch175-closure/export
PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=calliope-backend/src:calliope-backend \
calliope-backend/.venv/bin/python \
docs/hel-892/batch175-closure-evidence/audit.py audit-review
```
`audit.py`的输出目录参数必须不存在;再次核对时换新参数,不覆盖失败或成功产物。渲染/发布程序的默认目录名绑定本轮最终产物,勿直接对已有交付目录重跑;审核只需比较新audit-review与已交付总账(发布阶段CSV扩为全列,JSON一致)。`run.py`日志键独占,拒绝复用。当前无需白栖知操作、模型素材或机器窗口;不推进176,不合并部署。
@@ -0,0 +1,771 @@
"""Read-only closure ledger. Treat every
workflow string as data, never code."""
import collections
import csv
import hashlib
import json
import os
import sqlite3
import subprocess
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[3]
HERE = Path(__file__).resolve().parent
LOCAL = ROOT / ".local-evidence/batch175-closure"
OUTPUT = LOCAL / sys.argv[1]
BASE = "c73d76527593707121cf4b137c4d594eeecd8230"
RESOURCE = "calliope-backend/src/calliope/comfyui/source_reviews.json"
sys.path.insert(0, str(ROOT / "calliope-backend/src"))
def sha(raw):
return hashlib.sha256(raw).hexdigest()
def canonical(v):
return json.dumps(v, ensure_ascii=False, sort_keys=True, separators=(",", ":")).encode()
def typed(v):
if isinstance(v, dict):
return ["object", [[k, typed(x)] for k, x in sorted(v.items())]]
if isinstance(v, list):
return ["array", [typed(x) for x in v]]
return [type(v).__name__, v]
def ptr(v, pointer):
assert pointer.startswith("/")
for part in pointer[1:].split("/"):
part = part.replace("~1", "/").replace("~0", "~")
v = v[int(part)] if isinstance(v, list) else v[part]
return v
def esc(s):
return str(s).replace("~", "~0").replace("/", "~1")
def write(name, value):
with (OUTPUT / name).open("x", encoding="utf-8") as f:
json.dump(value, f, ensure_ascii=False, indent=2)
f.write("\n")
def history():
rows = []
reads = json.loads((LOCAL / "history-reads.json").read_bytes())
for read in reads:
for r in json.loads((LOCAL / "threads" / (read["root"] + ".json")).read_bytes()):
rows.append(
{
k: r[k]
for k in ("id", "author_id", "content", "created_at", "parent_id")
if k in r
}
)
return rows
def graphs(raw):
yield "root", "", raw
for i, graph in enumerate(raw.get("definitions", {}).get("subgraphs", [])):
yield str(graph["id"]), f"/definitions/subgraphs/{i}", graph
def main():
from calliope.comfyui.delivery_scope import exclusion_for
from calliope.comfyui.fixed_document import DEFINITIONS
from scripts.audit_library_documents import audit
assert OUTPUT.parent == LOCAL
OUTPUT.mkdir()
preflight = json.loads((LOCAL / "preflight.json").read_bytes())
sha_paths = collections.defaultdict(list)
for baseline in json.loads((LOCAL / "baseline-files.json").read_bytes())["files"]:
sha_paths[baseline["sha256"]].append(baseline["path"])
assert preflight["base"] == BASE
reviews = json.loads((ROOT / RESOURCE).read_bytes())
all_paths = {
p.relative_to(ROOT).as_posix()
for p in (ROOT / "example_ComfyUI_workflows").rglob("*")
if p.is_file()
}
excluded = {p for p in all_paths if exclusion_for(p)}
targets = all_paths - excluded
blocks = {
p: r["fixed_version_document"] for p, r in reviews.items() if "fixed_version_document" in r
}
assert len(all_paths) == 156 and len(excluded) == 1
assert targets == set(DEFINITIONS) == set(blocks) and not excluded.intersection(blocks)
with sqlite3.connect(f"file:{LOCAL / 'library.db'}?mode=ro", uri=True) as conn:
conn.row_factory = sqlite3.Row
rows = {r["source_repo_path"]: dict(r) for r in conn.execute("SELECT * FROM workflows")}
assert set(rows) == targets
exported = json.loads((LOCAL / "export/manifest.json").read_bytes())
exports = {r["path"]: r for r in exported}
assert set(exports) == targets and len(exported) == 155
result = audit(ROOT, LOCAL / "export")
write("existing-library-audit.json", result)
pinfiles = {}
for p in (ROOT / "docs/hel-892").rglob("pins.json"):
if HERE in p.parents:
continue
for source, pin in json.loads(p.read_bytes()).items():
if DEFINITIONS.get(source) == pin:
pinfiles[source] = p
messages = history()
write("historical-comment-texts.json", messages)
instruction = json.loads((LOCAL / "instruction.json").read_bytes())
write(
"current-instruction.json",
{
**{k: v for k, v in instruction.items() if k != "description"},
"description_sha256": sha(instruction["description"].encode()),
"current_section": instruction["description"].split("\n---\n", 1)[0],
},
)
ledgers, proofs, notes, identities, sources, remaining = [], [], [], [], [], []
totaltypes = collections.Counter()
for ordinal, path in enumerate(sorted(targets), 1):
rawbytes = (ROOT / path).read_bytes()
raw = json.loads(rawbytes.decode("utf-8-sig"))
b, row = blocks[path], rows[path]
doc = json.loads(row["doc_json"])
fixed = dict(doc["fixed_version"])
assert fixed.pop("matched") is True and typed(fixed) == typed(b), path
assert typed(doc) == typed(
json.loads((LOCAL / "export" / exports[path]["document"]).read_bytes())
)
assert b["source_sha1"] == row["source_sha"] == hashlib.sha1(rawbytes).hexdigest()
assert b["source_sha256"] == sha(rawbytes)
assert b["canonical_sha256"] == sha(canonical(raw))
assert sha(canonical(b)) == DEFINITIONS[path]
assert (
row["is_enabled"] == 0
and row["doc_completed_at"] is None
and row["exec_verified_at"] is None
)
assert doc["status"] == {"doc_done": False, "exec_verified": False, "imported": True}
assert doc["dependencies"]["check_state"] == "unchecked"
assert doc["dependencies"]["checked_at"] is None
evidence = RESOURCE + "#/" + esc(path) + "/fixed_version_document"
pointers, ftypes = [], collections.Counter()
for i, f in enumerate(b["fields"]):
value = ptr(raw, f["pointer"])
assert typed(value) == typed(f["value"]), (path, i, f["pointer"])
assert type(value).__name__ == f["json_type"], (path, i)
named = f.get("named_pointer")
named_is_pointer = isinstance(named, str) and named.startswith("/")
if named_is_pointer:
namedvalue = ptr(raw, named)
if "named_value" in f:
assert typed(namedvalue) == typed(f["named_value"]), (path, i, named)
pointers.append(f["pointer"])
ftypes[type(value).__name__] += 1
proofs.append(
dict(
source_repo_path=path,
field_index=i,
pointer=f["pointer"],
json_type=f["json_type"],
recursive_typed_sha256=sha(canonical(typed(value))),
value_sha256=sha(canonical(value)),
named_pointer=named,
named_value_present="named_value" in f,
named_value_sha256=sha(canonical(ptr(raw, named)))
if named_is_pointer
else None,
named_check=(
"explicit_named_value_equal"
if "named_value" in f
else "independent_original_read_no_parallel_equality_contract"
)
if named_is_pointer
else "unknown/not_a_pointer"
if named
else "not_recorded",
block_evidence=evidence + f"/fields/{i}",
checked_equal=True,
)
)
assert len(pointers) == len(set(pointers)), path
assert len(pointers) == b["counts"]["saved_fields"], path
totaltypes.update(ftypes)
raw_nodes, raw_notes, link_count, subgraphs = [], [], 0, []
for scope, prefix, graph in graphs(raw):
ui = "nodes" in graph
node_items = (
[(prefix + f"/nodes/{i}", n) for i, n in enumerate(graph["nodes"])]
if ui
else [("/" + esc(k), dict(n, id=k)) for k, n in graph.items()]
)
if prefix:
subgraphs.append(
dict(
id=scope,
pointer=prefix,
nodes=len(node_items),
inputs=len(graph.get("inputs", [])),
outputs=len(graph.get("outputs", [])),
edges=len(graph.get("links", [])),
)
)
link_count += (
len(graph.get("links", []))
if ui
else sum(
isinstance(v, list) and len(v) == 2
for _, n in node_items
for v in n["inputs"].values()
)
)
for nodeptr, n in node_items:
cls = n.get("type", n.get("class_type"))
props = n.get("properties", {})
raw_nodes.append(
dict(
node_id=str(n["id"]),
scope=scope,
pointer=nodeptr,
class_type=cls,
declared_properties=props,
declaration_evidence=path + "#" + nodeptr,
raw_version_declaration=props.get("ver"),
raw_provider_declaration=props.get("cnr_id", props.get("aux_id")),
)
)
if cls in ("Note", "MarkdownNote"):
raw_notes.append(
dict(
node_id=str(n["id"]),
scope=scope,
pointer=nodeptr + "/widgets_values",
value=n.get("widgets_values", []),
)
)
# Check doc.source_notes by actual raw node and recursive JSON type, not newer block schema.
docnotes = doc["source_notes"]
for i, n in enumerate(docnotes):
candidates = [
n0
for n0 in raw_notes
if (
n0["node_id"] == n["node_id"]
or n0["scope"] + "/" + n0["node_id"] == n["node_id"]
)
]
assert len(candidates) == 1, (path, n["node_id"])
v = candidates[0]
assert typed(n["content"]) == typed(v["value"]), (path, n["node_id"])
notes.append(
dict(
source_repo_path=path,
doc_note_index=i,
node_id=n["node_id"],
pointer=v["pointer"],
typed_sha256=sha(canonical(typed(v["value"]))),
content=n["content"],
raw_equal=True,
counting_rule="one doc.source_notes entry; not strings/fields",
)
)
commentproof = []
if "comments" in b:
for i, c in enumerate(b["comments"]):
v = ptr(raw, c["pointer"])
rule = "direct_original_value"
if isinstance(v, list) and len(v) == 1 and isinstance(v[0], str):
text = v[0]
rule = "single_string_in_original_widget_array; container is not text"
else:
text = v
assert typed(text) == typed(c["text"]), (path, i, c["pointer"])
commentproof.append(
dict(
index=i,
pointer=c["pointer"],
utf8_sha256=sha(v.encode()) if isinstance(v, str) else None,
recursive_typed_sha256=sha(canonical(typed(v))),
text_sha256=sha(text.encode()) if isinstance(text, str) else None,
comparison_rule=rule,
)
)
bindings = b.get("node_bindings")
bindcounts = collections.Counter()
bindingrecords = []
for i, n in enumerate(bindings or []):
explicit = n.get("implementation_verified")
state = (
"explicit_exact_static_binding"
if explicit is True
else "explicit_unverified"
if explicit is False
else "candidate_reference_only"
if n.get("candidates")
else "unknown"
)
version = n.get("source_version", n.get("version"))
no_identity = (
not version
or "未知" in str(version)
or "unknown" in str(version).lower()
or str(n.get("source_id", "")).startswith("unknown")
)
identity_state = (
"explicit_exact_static_binding"
if explicit is True
else "no_accurate_identity_in_record"
if no_identity
else "specific_declared_implementation_not_obtained_or_matched"
if not n.get("candidates")
else "candidate_static_reference_exact_identity_not_explicitly_certified"
)
bindcounts[state] += 1
bindingrecords.append(
dict(
index=i,
status=state,
identity_state=identity_state,
record=n,
evidence=evidence + f"/node_bindings/{i}",
)
)
identities.append(
dict(
source_repo_path=path,
raw_node_records=raw_nodes,
binding_key_present=bindings is not None,
binding_records=bindingrecords,
missing_binding_policy="unknown; no class-name/source-count "
"inference; candidates are not "
"exact identity",
)
)
pinfile = pinfiles.get(path)
commit = (
subprocess.check_output(
["git", "log", "-1", "--format=%H", "--", str(pinfile.relative_to(ROOT))], cwd=ROOT
)
.decode()
.strip()
if pinfile
else subprocess.check_output(
[
"git",
"log",
"-1",
"--format=%H",
"-S",
DEFINITIONS[path],
"--",
"calliope-backend/src/calliope/comfyui/fixed_document.py",
],
cwd=ROOT,
)
.decode()
.strip()
)
matches = (
[
m
for m in messages
if m["author_id"] == "4846a27a-ba87-49c9-939d-7275f63efcc7"
and (commit in m["content"] or commit[:7] in m["content"])
]
if commit
else []
)
delivery = max(matches, key=lambda m: m["created_at"]) if matches else None
relays = [
m
for m in messages
if delivery
and m.get("parent_id") == delivery["id"]
and m["author_id"] == "bbcc1179-3a55-48e7-a72e-c84cf79f41cb"
and ("审核通过" in m["content"] or "审查通过" in m["content"] or "接受" in m["content"])
]
relay = max(relays, key=lambda m: m["created_at"]) if relays else None
reviewbasis = (
dict(kind="chief_relay", comment_id=relay["id"], quote=relay["content"])
if relay
else dict(
kind="unknown",
reason="no exact matching acceptance comment in "
"bounded own-card threads; do "
"not infer from coverage",
)
)
if not relay and delivery:
progress = [
m
for m in messages
if m.get("parent_id") == delivery["id"]
and m["author_id"] == "bbcc1179-3a55-48e7-a72e-c84cf79f41cb"
]
if progress:
latest = max(progress, key=lambda m: m["created_at"])
reviewbasis["latest_chief_progress"] = {
k: latest[k] for k in ("id", "content", "created_at")
}
if path.endswith("MiniMax-H3-Turbo-R2V-Extend-2Refs1Vid_API.json"):
reviewbasis = dict(
kind="current_issue_chief_relay",
issue_id=instruction["id"],
updated_at=instruction["updated_at"],
evidence="current-instruction.json#/current_section",
quote=instruction["description"].splitlines()[2],
limitation="HEL-893独立报告本轮未重开,不把总管转述当本轮独立复核",
)
source_records = []
for i, s in enumerate(b["sources"]):
local = s.get("local_file")
resolved = (pinfile.parent / local).resolve() if pinfile and local else None
exists = bool(resolved and resolved.is_file() and resolved.is_relative_to(ROOT))
checked_sha = sha(resolved.read_bytes()) if exists else None
resolution_basis = "relative_to_pin_record_directory"
matched_paths = sha_paths.get(s.get("sha256"), [])
if not exists and matched_paths:
resolved = ROOT / matched_paths[0]
exists = True
checked_sha = sha(resolved.read_bytes())
resolution_basis = (
"existing_tracked_SHA256_match_only; not an identity/relative-base inference"
)
state = (
"byte_sha_matches"
if checked_sha and checked_sha == s.get("sha256")
else "unknown_local_resolution"
if not exists
else "byte_sha_differs_record"
)
# A source text is not a provider identity or an acquired declared version.
source_records.append(
dict(
index=i,
id=s.get("id"),
commit=s.get("commit"),
sha256=s.get("sha256"),
file=s.get("file"),
local_file=local,
resolved_repo_path=resolved.relative_to(ROOT).as_posix() if exists else None,
local_byte_status=state,
actual_sha256=checked_sha,
evidence=evidence + f"/sources/{i}",
resolution_basis=resolution_basis,
all_tracked_paths_with_recorded_sha=matched_paths,
acquired_at=s.get("acquisition_time", "unknown"),
reverified_at=s.get("reverified_at", "unknown"),
)
)
sources.append(
dict(
source_repo_path=path, source_text_count=len(source_records), records=source_records
)
)
issues = json.loads(row["import_issues"])
params = doc["params"]
needs = [
dict(
layer="L1-local",
minimum="先读取现有准确source条目、字段evidence及boundary原文,分开"
"记录已证与unknown",
reason="有来源文本不等于本节点准确身份/安装/恢复",
evidence=evidence + "/versions",
)
]
if bindings is None or any(
n["status"] != "explicit_exact_static_binding" for n in bindingrecords
):
needs.append(
dict(
layer="L2-exact-material",
minimum="仅补identity-records本文件未验证实例所声明版本的注册/类"
"/schema/依赖与commit或发布成员绑定;无身份先确定提供方和版本",
reason="候选/同名/宿主版本不能替代准确身份",
evidence="identity-records.json#" + path,
)
)
if row["import_state"] == "needs_conversion":
needs.append(
dict(
layer="L3-mapping",
minimum="本文件逐import_issues定位不支持项,先离线拟定字段/端口/子图"
"/proxy/缓存映射及失败关闭对照;涉及产品语义修正交总管协调具体选择",
reason="当前转换入口未给可直接使用资格",
issues=issues,
evidence="qualification-records.json#" + path,
)
)
else:
needs.append(
dict(
layer="L3-mapping",
minimum="复核现有API或配套逐字段/连线/输入输出映射,必要时取得对应版本真实前端导出",
reason="pending_check只是现有入口资格,不是新增可靠转换或前端恢复认证",
issues=issues,
evidence="qualification-records.json#" + path,
)
)
needs.extend(
[
dict(
layer="L4-target-readonly",
minimum="后续获授权时仅核本文件dependencies中的节点/模型、目录/设备/安装版"
"本与素材许可,先列差异",
reason="当前unchecked,无目标定义/安装和目录事实",
evidence="qualification-records.json#" + path,
),
dict(
layer="L5-authorized-run",
minimum="身份/映射/素材条件齐备后申请本文件代表分支运行,核history、真实输出和前"
"端恢复;计时实测",
reason="exec_verified=false;资源/耗时unknown,不估算或提前填时间",
evidence="qualification-records.json#" + path,
),
]
)
unresolved = [
dict(
node_id=n["record"].get("node_id"),
class_type=n["record"].get("class_type"),
declared_version=n["record"].get(
"source_version", n["record"].get("version", "unknown")
),
source_id=n["record"].get("source_id", "unknown"),
status=n["status"],
identity_state=n["identity_state"],
evidence=n["evidence"],
)
for n in bindingrecords
if n["status"] != "explicit_exact_static_binding"
]
declarations = [
dict(
node_id=n["node_id"],
scope=n["scope"],
class_type=n["class_type"],
declared_version=n["raw_version_declaration"],
declared_provider=n["raw_provider_declaration"],
evidence=n["declaration_evidence"],
)
for n in raw_nodes
]
remaining.append(
dict(
source_repo_path=path,
blockers=needs,
raw_instance_declarations=declarations,
unverified_binding_records=unresolved,
exact_static_bindings=[
n["evidence"]
for n in bindingrecords
if n["status"] == "explicit_exact_static_binding"
],
original_boundaries=b.get("boundaries", "unknown:key_absent"),
field_boundaries=evidence + "/fields",
graph_boundaries=evidence + "/boundaries"
if "boundaries" in b
else "unknown: key absent; consult versions/flow and doc.dependencies",
)
)
ledger = dict(
ordinal=ordinal,
source_repo_path=path,
source_sha1=b["source_sha1"],
source_sha256=b["source_sha256"],
pin=DEFINITIONS[path],
block_evidence=evidence,
pin_evidence=str(pinfile.relative_to(ROOT))
if pinfile
else "fixed_document.py#DEFINITIONS",
latest_pin_record_commit=commit or "unknown",
delivery_comment_id=delivery["id"] if delivery else "unknown",
review_basis=reviewbasis,
delivery_lookup_rule="latest commit touching matching pinned "
"evidence file, exact "
"commit/7-char search in bounded "
"own-card delivery text; not a claim "
"about every later collateral edit",
saved_fields=len(pointers),
saved_json_types=dict(ftypes),
saved_count_rule="len(actual fixed block.fields); each "
"original pointer recursively "
"typed; named parallel pointers "
"separate, not extra fields",
saved_locations_by_shape=dict(
collections.Counter(
"api_named"
if "/inputs/" in f["pointer"]
and not f["pointer"].startswith("/nodes/")
and not f["pointer"].startswith("/definitions/")
else "named_only"
if "widgets_values_named" in f["pointer"]
else "widget_position"
for f in b["fields"]
)
),
doc_source_notes=len(docnotes),
source_note_nodes=len(raw_notes),
note_count_rule="len(actual doc.source_notes), full "
"widget content recursively equal; "
"Note/MarkdownNote source classes "
"independent",
block_comments_key_present="comments" in b,
block_comments_count=len(b["comments"]) if "comments" in b else "unknown:key_absent",
block_comment_proof=commentproof,
original_shape="canvas_with_subgraph_boundaries"
if subgraphs
else "canvas"
if "nodes" in raw
else "API",
root_node_instances=len(raw["nodes"]) if "nodes" in raw else len(raw),
definition_node_records=sum(s["nodes"] for s in subgraphs),
node_class_count=len({n["class_type"] for n in raw_nodes}),
subgraph_boundaries=subgraphs,
original_edge_records=link_count,
binding_key_present=bindings is not None,
binding_record_counts=dict(bindcounts)
if bindings is not None
else "unknown:key_absent",
identity_state_record_counts=dict(
collections.Counter(n["identity_state"] for n in bindingrecords)
)
if bindings is not None
else "unknown:key_absent",
source_text_records=len(source_records),
source_text_count_rule="len(block.sources), NOT unique "
"providers/classes/instances/declared "
"acquired commits",
exact_implementation_status="see explicit per-binding status; absent "
"records unknown; static "
"reference is not target installation",
defaults_units_ranges_basis=evidence
+ "/fields/*/{schema_default,unit,limits,evidence}; source value never "
"presumed schema default",
import_state=row["import_state"],
existing_conversion_qualification="pending_check_existing_API_or_companion"
if row["import_state"] == "pending_check"
else "needs_conversion",
series_new_reliable_conversions=0,
is_enabled=row["is_enabled"],
draft=doc["draft"],
doc_done=doc["status"]["doc_done"],
doc_completed_at=row["doc_completed_at"],
exec_verified=doc["status"]["exec_verified"],
exec_verified_at=row["exec_verified_at"],
dependency_check=doc["dependencies"]["check_state"],
original_named_params=sum(
p.get("value_origin") != "supplied_api_companion" for p in params
),
companion_params=sum(p.get("value_origin") == "supplied_api_companion" for p in params),
unnamed_widget_nodes=len(doc["source_review"]["evidence"]["unnamed_widget_node_ids"]),
remaining_evidence="remaining-work.json#" + path,
)
ledgers.append(ledger)
assert len(ledgers) == 155 and sum(x["saved_fields"] for x in ledgers) == 10761
assert len(notes) == 287
quals = []
for path, row in sorted(rows.items()):
d = json.loads(row["doc_json"])
quals.append(
dict(
source_repo_path=path,
import_state=row["import_state"],
is_enabled=row["is_enabled"],
doc_completed_at=row["doc_completed_at"],
exec_verified_at=row["exec_verified_at"],
status=d["status"],
dependencies=d["dependencies"],
import_issues=json.loads(row["import_issues"]),
output_map=row["output_map"],
output_map_source=row["output_map_source"],
source_sha=row["source_sha"],
source_commit=row["source_commit"],
columns=len(row),
doc_typed_sha256=sha(canonical(typed(d))),
)
)
write("qualification-records.json", quals)
write("ledger.json", ledgers)
write("saved-value-proof.json", proofs)
write("notes-proof.json", notes)
write("identity-records.json", identities)
write("source-text-records.json", sources)
write("remaining-work.json", remaining)
keys = [
"ordinal",
"source_repo_path",
"source_sha1",
"source_sha256",
"pin",
"latest_pin_record_commit",
"delivery_comment_id",
"saved_fields",
"doc_source_notes",
"block_comments_key_present",
"block_comments_count",
"original_shape",
"root_node_instances",
"definition_node_records",
"node_class_count",
"original_edge_records",
"binding_key_present",
"source_text_records",
"import_state",
"existing_conversion_qualification",
"series_new_reliable_conversions",
"is_enabled",
"draft",
"doc_done",
"doc_completed_at",
"exec_verified",
"exec_verified_at",
"dependency_check",
]
with (OUTPUT / "ledger.csv").open("x", encoding="utf-8-sig", newline="") as f:
writer = csv.DictWriter(f, fieldnames=keys)
writer.writeheader()
writer.writerows({k: r[k] for k in keys} for r in ledgers)
totals = dict(
base=BASE,
source_directory_entries=156,
excluded=list(excluded),
targets=155,
definitions=155,
fixed_blocks=155,
actual_library_rows=155,
saved_fields=10761,
source_notes=287,
saved_json_types=dict(totaltypes),
states=dict(collections.Counter(x["import_state"] for x in ledgers)),
original_named_params=sum(x["original_named_params"] for x in ledgers),
unnamed_widget_nodes=sum(x["unnamed_widget_nodes"] for x in ledgers),
companion_params=sum(x["companion_params"] for x in ledgers),
missing_comments_keys=sum(not x["block_comments_key_present"] for x in ledgers),
missing_binding_keys=sum(not x["binding_key_present"] for x in ledgers),
delivery_unresolved=sum(x["delivery_comment_id"] == "unknown" for x in ledgers),
review_basis_unknown=sum(x["review_basis"]["kind"] == "unknown" for x in ledgers),
full_documents=0,
new_reliable_conversions=0,
real_executions=0,
enabled=0,
evidence_scope="fresh isolated offline DB only; online "
"state unknown; not a new "
"browser/build/run certification",
)
assert totals["states"] == {"pending_check": 16, "needs_conversion": 139}
assert (
totals["original_named_params"],
totals["unnamed_widget_nodes"],
totals["companion_params"],
) == (1217, 3660, 294)
write("summary.json", totals)
print(json.dumps(totals, ensure_ascii=False))
if __name__ == "__main__":
os.environ["PYTHONDONTWRITEBYTECODE"] = "1"
main()
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,38 @@
{
"base": "c73d76527593707121cf4b137c4d594eeecd8230",
"source_directory_entries": 156,
"excluded": [
"example_ComfyUI_workflows/5-数字人/Wan2.1_I2V_InfiniteTalk_rCM_数字人对口型多动态(KJ版).json"
],
"targets": 155,
"definitions": 155,
"fixed_blocks": 155,
"actual_library_rows": 155,
"saved_fields": 10761,
"source_notes": 287,
"saved_json_types": {
"str": 5772,
"int": 3405,
"float": 465,
"bool": 889,
"dict": 96,
"NoneType": 103,
"list": 31
},
"states": {
"pending_check": 16,
"needs_conversion": 139
},
"original_named_params": 1217,
"unnamed_widget_nodes": 3660,
"companion_params": 294,
"missing_comments_keys": 8,
"missing_binding_keys": 87,
"delivery_unresolved": 0,
"review_basis_unknown": 46,
"full_documents": 0,
"new_reliable_conversions": 0,
"real_executions": 0,
"enabled": 0,
"evidence_scope": "fresh isolated offline DB only; online state unknown; not a new browser/build/run certification"
}
@@ -0,0 +1,21 @@
155份现在都有可查看的固定参考:可以在现有详情里看中文说明、原件保存值、连线与已有源码依据。它交付的是一份能追溯的参考,不代表155份都能可靠转换,也不代表接上机器就能运行。
第175批在c73d765基线做了只读盘点。原156目录项明确排除rCM后,155目标与155定义、155固定块和新隔离库一致;10761保存位置逐值及递归类型相符,287条实际注释与原文相符。没有新增第156个目标。JSON/CSV及逐文件中文总账给出每份原SHA、pin、交付依据、身份边界与后续条件。
实际资格仍是16份pending_check、139份needs_conversion,155份全停用、未检查;完整说明定稿0、本系列新增可靠转换0、真实生成0。1217具名参数、3660无具名控件节点、294伴随参数沿用各自口径;它们不能与10761相减来计算“还差多少”。线上库和目标机现状本轮没有读取,不能用新隔离库替它们背书。
离可靠转换还差逐实例准确身份、准确schema/端口/缓存/子图/proxy或别名的对照,以及原前端导出/恢复与产品映射的确认。离可运行还差目标安装、模型/目录/设备/素材许可与必要依赖核对。离已实跑还差获授权后的实际history和输出验证;文件名、来源文本数量或“API格式”均不能替代这些证据。
本轮46份在本卡交付线程中未匹配到明确通过回执,逐行保留unknown。这是本轮证据定位的限制,不是断言历史未通过;其余审核依据也标明是总管转述,均不能当本轮HEL-893独立总审核。8份无comments键、87份无node_bindings键没有被补零或改产品。
建议总管按下面四个有终点的包安排下一阶段;本轮只提议,不实施,也不推进176:
1. **先收证据缺口。** 用总账155行逐项定位准确审核记录及身份声明;对缺失逐实例绑定的早期87份,先从已有字段evidence与固定版本文本形成有界映射。验收:每行都有准确记录引用或明确unknown,候选、无身份、声明commit未取得分开;不新增网络材料或改产品。风险是将同名类/宿主版本误绑成提供方。
2. **一次只处理有限的转换族。** 建议先限两份:原API`example_ComfyUI_workflows/Krea2_t2i_20260818_API.json` 与已有case01配套的`example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/ControlNet_aux_常用样例.json`。分别补本文件准确身份/字段证据,以及必要的真实前端恢复对照;不把16份一并放行。对139份needs_conversion只按本文件import_issues拆映射问题,首个子包最多处理一种节点/子图边界。验收:原值/连线/递归类型的差分可复现,未知失败关闭,明确哪些产品映射/修正方案需总管汇总交白栖知拍板。没有具体方案前不泛泛索要“所有材料”。
3. **有条件再申请目标只读核对。** 只列选中文件所需的提供方/版本、模型与素材清单,以及每项为何影响转换/恢复/输出;由总管统一协调最小窗口。验收:目标定义、安装/目录/设备差异逐条记录,不启动/执行工作流。未核状态维持unchecked。风险是版本、动态端口、依赖、许可和设备不一致。
4. **最后安排代表运行,再决定推广。** 每个被选文件身份/映射/素材条件齐备后才拟运行步骤、输出和回退条件,由总管协调授权。验收:真实history、实际媒体输出、前端恢复与耗时记录支持对应结论;只给通过的文件写资格和时间。余下文件不能继承认证。最终155全量审核和统一部署仍由总管/总工收口,本施工不部署。
当前无需白栖知提供模型、素材或机器窗口。每份最小条件和理由在逐文件总账及remaining-work.json;尚无准确依据的耗时/资源、首次取得时刻、运行效果继续unknown。
File diff suppressed because one or more lines are too long
@@ -0,0 +1,205 @@
"""Recompute only provenance fields; preserve approved values, notes and qualifications."""
import copy
import csv
import json
import re
import sys
from pathlib import Path
from attribution import Attributor, sha
ROOT = Path(__file__).resolve().parents[3]
HERE = Path(__file__).resolve().parent
PRIOR = HERE / "prior175"
ORIGINAL = ROOT / "docs/hel-892/batch175-closure-evidence"
LOCAL = ROOT / ".local-evidence/history-attribution-correction"
BASE = "0e3e7b071f4c293642900849db8b1ead997417b8"
HISTORY_KEYS = {"delivery_comment_id", "review_basis", "delivery_lookup_rule"}
def load(path):
return json.loads(path.read_bytes())
def write(out, name, obj):
with (out / name).open("x", encoding="utf-8") as f:
json.dump(obj, f, ensure_ascii=False, indent=2)
f.write("\n")
def text(out, name, value):
with (out / name).open("x", encoding="utf-8") as f:
f.write(value.rstrip() + "\n")
def main():
out = LOCAL / sys.argv[1]
assert out.parent == LOCAL
out.mkdir()
old = load(PRIOR / "ledger.json")
messages = load(PRIOR / "historical-comment-texts.json")
attribution = Attributor(ROOT, messages, BASE, load(PRIOR / "current-instruction.json"))
new, matrix, differences = [], [], []
for i, row in enumerate(old):
path, pin = row["source_repo_path"], row["pin"]
result = attribution.select(path, pin, row["delivery_comment_id"])
matrix.append(result)
updated = copy.deepcopy(row)
updated["delivery_comment_id"] = result["delivery_comment_id"]
updated["review_basis"] = result["review_basis"]
updated["delivery_lookup_rule"] = result["selection_rule"]
updated.update(
pin_record_last_touch_commit=row["latest_pin_record_commit"],
definition_pin_introduction_commit=result["definition_pin_introductions"][0]
if len(result["definition_pin_introductions"]) == 1
else "unknown",
definition_pin_introductions=result["definition_pin_introductions"],
delivery_head=result.get("delivery_head", "unknown"),
tested_implementation=result.get("tested_implementation", "unknown"),
file_pin_implementation_commit=result.get("file_pin_implementation_commit", "unknown"),
successor_record=result.get("successor_record", "unknown"),
historical_attribution_evidence=f"candidate-matrix.json#/{i}",
prior_delivery_comment_id=row["delivery_comment_id"],
)
assert {k: v for k, v in updated.items() if k in row and k not in HISTORY_KEYS} == {
k: v for k, v in row.items() if k not in HISTORY_KEYS
}
changed = {
k: dict(before=row.get(k), after=updated.get(k))
for k in updated
if row.get(k) != updated.get(k) or k not in row
}
differences.append(
dict(
source_repo_path=path,
old_delivery=row["delivery_comment_id"],
new_delivery=updated["delivery_comment_id"],
changed_fields=changed,
approved_non_history_fields_unchanged=True,
)
)
new.append(updated)
assert len(new) == len({r["source_repo_path"] for r in new}) == 155
summary = load(PRIOR / "summary.json")
summary["delivery_unresolved"] = sum(r["delivery_comment_id"] == "unknown" for r in new)
summary["review_basis_unknown"] = sum(r["review_basis"]["kind"] == "unknown" for r in new)
summary["attribution_correction"] = dict(
base=BASE,
delivery_changed=sum(r["old_delivery"] != r["new_delivery"] for r in differences),
unique_pin_origins=sum(len(r["definition_pin_introductions"]) == 1 for r in matrix),
original_review_unknown=load(PRIOR / "summary.json")["review_basis_unknown"],
chronology_used_for_selection=False,
main_card_history_bulk_fetched=False,
old_ledger_sha256=sha((PRIOR / "ledger.json").read_bytes()),
)
oldremaining = load(PRIOR / "remaining-work.json")
remaining = copy.deepcopy(oldremaining)
for i, r in enumerate(remaining):
assert r["source_repo_path"] == new[i]["source_repo_path"]
r["historical_attribution"] = dict(
delivery_comment_id=new[i]["delivery_comment_id"],
review_basis=new[i]["review_basis"],
candidate_matrix=f"candidate-matrix.json#/{i}",
)
assert {k: v for k, v in r.items() if k != "historical_attribution"} == oldremaining[i]
write(out, "ledger.json", new)
write(out, "summary.json", summary)
write(out, "remaining-work.json", remaining)
write(out, "candidate-matrix.json", matrix)
write(out, "row-field-differences.json", differences)
write(
out,
"comment-role-records.json",
[
dict(
comment_id=m["id"],
original_utf8_sha256=sha(m["content"].encode()),
references=attribution.refs[m["id"]],
)
for m in attribution.own
],
)
write(
out,
"git-facts.json",
dict(
resolutions=attribution.git.resolutions,
code=attribution.git.code,
parents=attribution.git.parent_cache,
pin_origins=attribution.git.origin_cache,
original_blobs=attribution.git.blobs,
),
)
with (out / "ledger.csv").open("x", encoding="utf-8-sig", newline="") as f:
writer = csv.DictWriter(f, fieldnames=list(new[0]), lineterminator="\n")
writer.writeheader()
writer.writerows(
{
k: json.dumps(v, ensure_ascii=False) if isinstance(v, (dict, list)) else v
for k, v in r.items()
}
for r in new
)
# Keep the approved descriptive body; replace only delivery/audit paragraphs and the old claim.
original = (PRIOR / "逐文件总账与剩余条件.md").read_text()
parts = re.split(r"(?m)^## (?=\d{3} )", original)
assert len(parts) == 156
intro = parts[0]
intro = re.sub(
r"每份交付按匹配pin证据文件.*?历史未通过。",
"旧175历史归因已被独立审核指出误配。"
"本版按唯一Git pin起点、提交角色与本文件闭包定位;记录文件最后触碰不当定义起点,"
"候选含基线/旧版/依赖引用均保留拒绝理由,歧义留unknown。",
intro,
flags=re.S,
)
intro = intro.replace("46份", str(summary["review_basis_unknown"]) + "份")
sections = [intro.rstrip()]
for oldsection, row in zip(parts[1:], new):
assert "源:`" + row["source_repo_path"] + "`" in oldsection
lines = oldsection.splitlines()
count = 0
for j, line in enumerate(lines):
if line.startswith("交付:"):
lines[j] = (
f"交付:记录文件最后触碰`{row['pin_record_last_touch_commit']}`;"
f"代码定义pin起点`{row['definition_pin_introduction_commit']}`;"
f"主head`{row['delivery_head']}`;明确受测实现`{row['tested_implementation']}`;"
f"评论`{row['delivery_comment_id']}`。逐候选原文/角色/闭包/拒绝理由:"
f"`{row['historical_attribution_evidence']}`。"
)
count += 1
elif line.startswith("审核依据:"):
lines[j] = "审核依据:" + json.dumps(row["review_basis"], ensure_ascii=False) + "。"
count += 1
assert count == 2
sections.append("## " + "\n".join(lines).rstrip())
text(out, "逐文件总账与剩余条件.md", "\n\n".join(sections))
text(
out,
"进度说明.md",
f"第175批历史归因窄修:全155行已重核,交付定位变更"
f"{summary['attribution_correction']['delivery_changed']}行,交付未能唯一确定"
f"{summary['delivery_unresolved']}行,审核依据仍unknown为{summary['review_basis_unknown']}行"
"(旧46不是门槛,unknown不等于未通过)。每行保留记录最后触碰、定义pin起点、"
"主交付、受测实现及基线/依赖/旧版/后继的不同含义,不按最新评论覆盖。\n\n"
"155固定参考、10761保存项、287注释、原SHA/pin、身份/来源字节和资格全部冻结。"
"仍16 pending_check/139 needs_conversion、1217/3660/294分列,全停用、未检查、"
"空定稿/实跑时间;定稿/新增可靠转换/真实生成仍均0。未重跑已通过的原值或构建/浏览套件。\n\n"
"只交本轮归因工具、全表候选矩阵、原/新总账SHA与逐字段差集、格式/负例验证及冻结证据。"
"原错误账和失败历史保存在prior175及原Git提交;174/175旧包仅引用并核SHA。"
"上一轮的两份试点建议暂停,未实施;不推进176、目标连接、转换修改、实跑或部署。"
"当前无需新增模型素材或机器窗口,等待HEL-893独立复审。",
)
print(json.dumps(summary["attribution_correction"], ensure_ascii=False))
print(
"unknown delivery",
summary["delivery_unresolved"],
"unknown audit",
summary["review_basis_unknown"],
)
if __name__ == "__main__":
main()
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,50 @@
"""Exclusive foreground attribution-correction logs; no background work or cross-batch glob."""
import hashlib
import json
import subprocess
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[3]
LOCAL = ROOT / ".local-evidence/history-attribution-correction"
def main():
key, *command = sys.argv[1:]
assert key.replace("-", "").isalnum() and command
paths = [
LOCAL / "logs" / f"history-attribution-correction-{key}.{s}.txt"
for s in ("stdout", "stderr")
]
record = LOCAL / "records" / (key + ".json")
assert not record.exists() and not any(p.exists() for p in paths)
with paths[0].open("xb") as stdout, paths[1].open("xb") as stderr:
result = subprocess.run(command, cwd=ROOT, stdout=stdout, stderr=stderr)
with record.open("x") as f:
json.dump(
dict(
key=key,
command=command,
cwd="repository root",
returncode=result.returncode,
logs=[
dict(
path=str(p.relative_to(ROOT)),
bytes=p.stat().st_size,
sha256=hashlib.sha256(p.read_bytes()).hexdigest(),
)
for p in paths
],
),
f,
ensure_ascii=False,
indent=2,
)
f.write("\n")
print(key, "exit", result.returncode)
raise SystemExit(result.returncode)
if __name__ == "__main__":
main()
@@ -0,0 +1,47 @@
{
"base": "c73d76527593707121cf4b137c4d594eeecd8230",
"source_directory_entries": 156,
"excluded": [
"example_ComfyUI_workflows/5-数字人/Wan2.1_I2V_InfiniteTalk_rCM_数字人对口型多动态(KJ版).json"
],
"targets": 155,
"definitions": 155,
"fixed_blocks": 155,
"actual_library_rows": 155,
"saved_fields": 10761,
"source_notes": 287,
"saved_json_types": {
"str": 5772,
"int": 3405,
"float": 465,
"bool": 889,
"dict": 96,
"NoneType": 103,
"list": 31
},
"states": {
"pending_check": 16,
"needs_conversion": 139
},
"original_named_params": 1217,
"unnamed_widget_nodes": 3660,
"companion_params": 294,
"missing_comments_keys": 8,
"missing_binding_keys": 87,
"delivery_unresolved": 0,
"review_basis_unknown": 35,
"full_documents": 0,
"new_reliable_conversions": 0,
"real_executions": 0,
"enabled": 0,
"evidence_scope": "fresh isolated offline DB only; online state unknown; not a new browser/build/run certification",
"attribution_correction": {
"base": "0e3e7b071f4c293642900849db8b1ead997417b8",
"delivery_changed": 99,
"unique_pin_origins": 155,
"original_review_unknown": 46,
"chronology_used_for_selection": false,
"main_card_history_bulk_fetched": false,
"old_ledger_sha256": "bf82b1b38035ec60f24dcbc9b1ea3d41242729063223918351e9778f5d88df5e"
}
}
@@ -0,0 +1,170 @@
"""Offline provenance contracts, including the two actual rejected attributions."""
import json
import unittest
from pathlib import Path
from attribution import Attributor, candidate, references, review_language
ROOT = Path(__file__).resolve().parents[3]
PRIOR = ROOT / "docs/hel-892/batch175-closure-evidence"
A = "a" * 40
B = "b" * 40
PATH = "example_ComfyUI_workflows/a.json"
OTHER = "example_ComfyUI_workflows/b.json"
PIN = "1" * 64
class FakeGit:
def __init__(self, multiple=False):
self.mapping = {PATH: PIN, **({OTHER: "2" * 64} if multiple else {})}
self.code = {A: dict(sha256="own-code-bytes", definitions=self.mapping)}
def resolve(self, token):
return (
dict(status="ambiguous", commit=None)
if token == "aaaaaaa"
else dict(status="unique_commit", commit=token)
)
def definitions(self, commit):
return self.mapping
def changes(self, commit):
return self.mapping if commit == A else {OTHER: "2" * 64}
def blob(self, commit, path):
return "original-source-blob"
def ancestor(self, earlier, later):
return earlier == A and later == B
def check(content, git=None):
message = dict(id="synthetic", content=content)
git = git or FakeGit()
return candidate(PATH, PIN, message, references(message, git), git, B)
class Contracts(unittest.TestCase):
@classmethod
def setUpClass(cls):
messages = json.loads((PRIOR / "historical-comment-texts.json").read_bytes())
cls.ids = [
"01a1986f-3ac6-721d-bb47-0d97792f86a9",
"01a1987c-f9aa-7781-85d3-5a93331f1627",
"01a198cf-78a6-7591-94db-1d129c11c87a",
"01a198d9-f8a3-710b-b14d-037a92405368",
]
own = [m for m in messages if m["id"] in cls.ids]
assert len(own) == 4
cls.actual = Attributor(ROOT, own, "0e3e7b071f4c293642900849db8b1ead997417b8")
cls.ledger = json.loads((PRIOR / "ledger.json").read_bytes())
def actual_case(self, name, good, bad):
row = next(r for r in self.ledger if r["source_repo_path"].endswith(name))
result = self.actual.select(row["source_repo_path"], row["pin"], bad)
self.assertEqual(result["delivery_comment_id"], good)
rejected = next(c for c in result["candidates"] if c["comment_id"] == bad)
self.assertFalse(rejected["candidate_accepted"])
self.assertTrue(any(r["role"] == "baseline" for r in rejected["references"]))
def test_actual_krea_165_delivery_rejects_166_baseline(self):
self.actual_case("Krea2_t2i_20260818_API.json", self.ids[0], self.ids[1])
def test_actual_four_refs_172_rejects_173_baseline(self):
self.actual_case("video_minimax_h3_r2v_4ref_API.json", self.ids[2], self.ids[3])
def test_baseline_only(self):
self.assertFalse(check("基线`" + A + "`")["candidate_accepted"])
def test_dependency_only(self):
self.assertFalse(check("依赖提交`" + A + "`")["candidate_accepted"])
def test_old_only(self):
self.assertFalse(check("旧提交`" + A + "`")["candidate_accepted"])
def test_tested_baseline_cannot_supply_implementation_closure(self):
self.assertFalse(
check("受测旧代码基线`" + A + "`;最终head`" + B + "`")["candidate_accepted"]
)
def test_ambiguous_prefix(self):
self.assertFalse(check("提交`aaaaaaa`")["candidate_accepted"])
def test_shared_record_not_target_delta(self):
self.assertFalse(check("提交`" + B + "`,改共享pins.json")["candidate_accepted"])
def test_unscoped_multi_is_unknown(self):
self.assertFalse(check("提交`" + A + "`", FakeGit(True))["candidate_accepted"])
def test_explicit_multi_scope(self):
self.assertTrue(
check("提交`" + A + "`,本批2份固定说明", FakeGit(True))["candidate_accepted"]
)
def test_multi_scope_with_descriptive_noun(self):
self.assertTrue(
check("提交`" + A + "`,本批两张宫格图", FakeGit(True))["candidate_accepted"]
)
def test_bold_markdown_head(self):
result = check("提交 **`" + A + "`**")
self.assertTrue(result["candidate_accepted"])
self.assertEqual(result["head_proofs"][0]["explicit_tested_implementation"], "unknown")
def test_joint_tested_and_final_head(self):
self.assertTrue(check("受测实现与最终head均为 **`" + A + "`**")["candidate_accepted"])
def test_final_abbreviation_after_explicit_implementation(self):
self.assertTrue(check("实现`" + A + "`,最终 **`" + B + "`**")["candidate_accepted"])
def test_shared_multi_record_with_only_other_file_scope(self):
self.assertFalse(
check("提交`" + A + "`,只交付" + OTHER, FakeGit(True))["candidate_accepted"]
)
def test_tested_implementation_and_successor_head_separate(self):
result = check("受测实现`" + A + "`;最终head`" + B + "`")
self.assertTrue(result["candidate_accepted"])
self.assertEqual(result["head_proofs"][0]["delivery_head"], B)
self.assertEqual(
result["head_proofs"][0]["implementation_proof"]["implementation_commit"], A
)
def test_negative_audit_not_accepted(self):
for text in ["未审核通过", "审核未通过", "暂未审核通过", "若审核通过再处理", "待审核通过"]:
with self.subTest(text=text):
self.assertEqual(review_language(text)["status"], "unknown")
def test_progress_or_accept_word_not_certification(self):
for text in [
"总工已开始审核",
"已交总工审核,正在运行",
"接受",
"上一批审核通过",
"目前153份参考通过审核",
"据说审核通过",
"审核通过?",
]:
with self.subTest(text=text):
self.assertEqual(review_language(text)["status"], "unknown")
def test_affirmative_with_global_work_remaining(self):
self.assertEqual(
review_language("本批参考说明审核通过。全量未完成,不部署。")["status"],
"affirmative_audit_relay",
)
def test_explicit_passed_independent_audit(self):
self.assertEqual(
review_language("第172批已通过独立审核。全量未完成。")["status"],
"affirmative_audit_relay",
)
def test_conflicting_negative_does_not_become_positive(self):
self.assertEqual(review_language("本批审核通过。复核未通过。")["status"], "unknown")
if __name__ == "__main__":
unittest.main(verbosity=2)
@@ -0,0 +1,31 @@
{
"base": "0e3e7b071f4c293642900849db8b1ead997417b8",
"original_ledger_sha256": "bf82b1b38035ec60f24dcbc9b1ea3d41242729063223918351e9778f5d88df5e",
"corrected_ledger_sha256": "b154154d3f02ca2a8fd8850b16f2883e09ad92e2ad3f131442708f75905ea9e1",
"original_csv_sha256": "ffe4bb438dc170ab471f162e3402221ba0e944516fbe0d3c946253a0ca3889aa",
"corrected_csv_sha256": "ca92391114c1740dc5a7f8f9a3503133630dc72630a78a99e7098cf7c97d278b",
"frozen_baseline_files": 19074,
"changed_existing_tools": [
"docs/hel-892/batch175-closure-evidence/README.md",
"docs/hel-892/batch175-closure-evidence/audit.py"
],
"product_changes": 0,
"rows": 155,
"non_history_row_fields_unchanged": true,
"remaining_non_history_unchanged": true,
"csv_all_columns_equal": true,
"independent_value_note_qualification_checks_rerun": false,
"ports": [
{
"port": 8247,
"refused": true,
"bindable": true
},
{
"port": 5173,
"refused": true,
"bindable": true
}
],
"formal_legacy_rule_removed": "Attributor.select replaces full-text SHA/date matching"
}
@@ -0,0 +1,138 @@
"""Verify provenance-only differences and publish into an exclusively new directory."""
import csv
import json
import socket
from pathlib import Path
from attribution import CODE, sha
from rebuild import HISTORY_KEYS
ROOT = Path(__file__).resolve().parents[3]
HERE = Path(__file__).resolve().parent
LOCAL = ROOT / ".local-evidence/history-attribution-correction"
PRIOR = HERE / "prior175"
NAMES = [
"ledger.json",
"ledger.csv",
"summary.json",
"remaining-work.json",
"candidate-matrix.json",
"row-field-differences.json",
"comment-role-records.json",
"git-facts.json",
"逐文件总账与剩余条件.md",
"进度说明.md",
]
ALLOWED = {
"docs/hel-892/batch175-closure-evidence/audit.py",
"docs/hel-892/batch175-closure-evidence/README.md",
}
def load(path):
return json.loads(path.read_bytes())
def main():
source = LOCAL / "final"
new, old = load(source / "ledger.json"), load(PRIOR / "ledger.json")
matrix = load(source / "candidate-matrix.json")
assert len(new) == len(matrix) == 155
with (source / "ledger.csv").open(encoding="utf-8-sig", newline="") as f:
csvrows = list(csv.DictReader(f))
assert len(csvrows) == 155
for index, (before, after, candidate, csvrow) in enumerate(zip(old, new, matrix, csvrows)):
assert (
before["source_repo_path"] == after["source_repo_path"] == candidate["source_repo_path"]
)
assert {k: v for k, v in after.items() if k in before and k not in HISTORY_KEYS} == {
k: v for k, v in before.items() if k not in HISTORY_KEYS
}
assert set(after) == set(csvrow)
for k, v in after.items():
if isinstance(v, (dict, list)):
assert json.loads(csvrow[k]) == v
else:
assert csvrow[k] == ("" if v is None else str(v))
assert len(candidate["definition_pin_introductions"]) == 1
selected = candidate["delivery_comment_id"]
assert selected == after["delivery_comment_id"]
if selected != "unknown":
accepted = [c for c in candidate["candidates"] if c["candidate_accepted"]]
assert len(accepted) == 1 and accepted[0]["comment_id"] == selected
for parent in after["review_basis"].get("all_parent_records", []):
assert parent["parent_id"] == selected
assert after["historical_attribution_evidence"] == f"candidate-matrix.json#/{index}"
# All old remaining conditions survive byte-for-byte as parsed JSON, with history appended.
for before, after in zip(
load(PRIOR / "remaining-work.json"), load(source / "remaining-work.json")
):
assert {k: v for k, v in after.items() if k != "historical_attribution"} == before
summary = load(source / "summary.json")
previous = load(PRIOR / "summary.json")
for key in previous:
if key not in ("delivery_unresolved", "review_basis_unknown"):
assert summary[key] == previous[key]
assert summary["delivery_unresolved"] == sum(r["delivery_comment_id"] == "unknown" for r in new)
assert summary["review_basis_unknown"] == sum(
r["review_basis"]["kind"] == "unknown" for r in new
)
frozen, changed = [], []
for row in load(HERE / "baseline-files.json")["files"]:
raw = (ROOT / row["path"]).read_bytes()
if row["path"] in ALLOWED:
if sha(raw) != row["sha256"]:
changed.append(row["path"])
else:
assert sha(raw) == row["sha256"], row["path"]
frozen.append(row)
assert set(changed) == ALLOWED
for row in load(HERE / "prior175-sha256.json")["files"]:
assert sha((ROOT / row["archive_path"]).read_bytes()) == row["sha256"]
# Current product allowlist bytes and all original proof files stayed frozen above.
assert any(r["path"] == CODE for r in frozen)
readable = (source / "逐文件总账与剩余条件.md").read_text()
assert readable.count("\n## ") == 155
for row in new:
assert readable.count("源:`" + row["source_repo_path"] + "`") == 1
for name in NAMES:
with (HERE / name).open("xb") as f:
f.write((source / name).read_bytes())
ports = []
for port in [8247, 5173]:
with socket.socket() as sock:
assert sock.connect_ex(("127.0.0.1", port)) != 0
with socket.socket() as sock:
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind(("127.0.0.1", port))
ports.append(dict(port=port, refused=True, bindable=True))
facts = dict(
base="0e3e7b071f4c293642900849db8b1ead997417b8",
original_ledger_sha256=sha((PRIOR / "ledger.json").read_bytes()),
corrected_ledger_sha256=sha((HERE / "ledger.json").read_bytes()),
original_csv_sha256=sha((PRIOR / "ledger.csv").read_bytes()),
corrected_csv_sha256=sha((HERE / "ledger.csv").read_bytes()),
frozen_baseline_files=len(frozen),
changed_existing_tools=sorted(changed),
product_changes=0,
rows=155,
non_history_row_fields_unchanged=True,
remaining_non_history_unchanged=True,
csv_all_columns_equal=True,
independent_value_note_qualification_checks_rerun=False,
ports=ports,
formal_legacy_rule_removed="Attributor.select replaces full-text SHA/date matching",
)
with (HERE / "verification.json").open("x") as f:
json.dump(facts, f, ensure_ascii=False, indent=2)
f.write("\n")
print(
"PASS 155 rows/full CSV/Chinese; approved data frozen;",
len(frozen),
"old files unchanged, only2 existing tools/docs changed; ports refused/bindable",
)
if __name__ == "__main__":
main()
@@ -0,0 +1,5 @@
第175批历史归因窄修:全155行已重核,交付定位变更99行,交付未能唯一确定0行,审核依据仍unknown为35行(旧46不是门槛,unknown不等于未通过)。每行保留记录最后触碰、定义pin起点、主交付、受测实现及基线/依赖/旧版/后继的不同含义,不按最新评论覆盖。
155固定参考、10761保存项、287注释、原SHA/pin、身份/来源字节和资格全部冻结。仍16 pending_check/139 needs_conversion、1217/3660/294分列,全停用、未检查、空定稿/实跑时间;定稿/新增可靠转换/真实生成仍均0。未重跑已通过的原值或构建/浏览套件。
只交本轮归因工具、全表候选矩阵、原/新总账SHA与逐字段差集、格式/负例验证及冻结证据。原错误账和失败历史保存在prior175及原Git提交;174/175旧包仅引用并核SHA。上一轮的两份试点建议暂停,未实施;不推进176、目标连接、转换修改、实跑或部署。当前无需新增模型素材或机器窗口,等待HEL-893独立复审。
File diff suppressed because one or more lines are too long