debug(policy): add SHA-256 trace logs at sign / use / attach#41
Merged
Conversation
To diagnose remaining "Policy signature could not be verified" failures, emit matching trace lines so the operator can compare byte-for-byte: - [PolicyTrace SIGN] server/routes.ts at commit — DataToVerify, signature, and composed-policy hashes when the row is written. - [PolicyTrace USE] server/routes.ts at getForSshUser — section-0 and section-1 hashes of what the server ships to the client. - [PolicyTrace ATTACH] client/src/lib/tideSsh.ts before addPolicy() — hashes of the policy as parsed by the client just before it goes into the BasicCustomRequest. If dtv_sha is identical at SIGN, USE, and ATTACH, the bytes are intact end-to-end and the verify failure lives downstream (heimdall iframe / ORK side). If any of the three differ, that hop is the corruption point.
This was referenced May 20, 2026
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
Adds three matching trace log lines so we can compare the policy bytes byte-for-byte across the sign → store → use → attach hops, to pin down where (if anywhere) the bytes are diverging when Sign #2 still fails with "Policy signature could not be verified".
[PolicyTrace SIGN]server/routes.ts(commit endpoint)[PolicyTrace USE]server/routes.ts(getForSshUser endpoint)[PolicyTrace ATTACH]client/src/lib/tideSsh.ts(just beforeaddPolicy())How to read the logs
dtv_shais identical at SIGN, USE, and ATTACH → bytes are intact end-to-end. The failure lives downstream (heimdall iframe, BasicCustomRequest re-encoding, or ORK side).dtv_shavalues differs from SIGN, the corruption is at that hop.Test plan
[PolicyTrace SIGN]line in server log[PolicyTrace USE]line in server log AND[PolicyTrace ATTACH]line in browser consoledtv_shavalues — should be byte-identicalPure-logging change, no behavior impact.