fix(headless): keep Harbor archive ids within ref grammar - #2130
Merged
Conversation
Astro-Han
approved these changes
Aug 4, 2026
Astro-Han
left a comment
Contributor
There was a problem hiding this comment.
Thanks for keeping the Runtime parser as the protocol authority and tightening the Harbor writer at the source. The generated ID stays within the grammar and length bound, while hashing the complete untruncated identity prevents prefix truncation and sanitization collisions. The writer-to-parser regression covers the original failure path well. Ready to merge. Approving.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Harbor's archive writer could produce an artifact id that the Runtime resource parser rejects:
=was allowed by the writer but not the parser, and three independently truncated segments could exceed the parser's 160-character limit.This keeps the Runtime parser as the protocol authority and changes only Harbor's writer:
sessionId,runtimeEventId, andbodySha256;The maximum generated id is 153 characters. Distinct opaque ids that differ only after the readable prefix also remain distinct on disk.
Verification
biome linton both changed filesnpm --workspace @maka/headless run typecheckCloses #2036
简体中文
Harbor 旧 writer 允许
=,并分别截断三个 segment;生成的 artifact id 可能含有 Runtime parser 不接受的字符,也可能达到 217 字符,导致文件已经写入、resource ref 却无法解析。本修复不放宽 Runtime 协议,只收紧 Harbor writer:保留 session/runtime event 的 40 字符可读前缀,并在其后附加基于完整未截断 identity 的 SHA-256。最终长度最多 153 字符;两个只在前缀之后不同的 opaque id 也不会因截断写到同一路径。旧 reader 的兼容校验保持不变。
新增测试通过真实 Harbor writer 归档,再调用真实 Runtime ref builder/parser,分别覆盖
=、超长输入和截断碰撞。