refactor: reuse canonical digest and formatter helpers - #1571
Merged
Merged
Conversation
Route one-shot SHA-256 hex encodings through the existing `sha256_hex` / `digest_bytes` helpers, and let the index-freshness, observatory, and memory panels call the code-index, envelope, and UTC-micros formatters that already exist instead of local copies. Line extraction for body, context, and implementation reads now slices the `lines()` iterator directly instead of collecting every line first, implementation method bodies reuse the source file already read for the same path, and non-Rust field/unsafe scans borrow the source instead of cloning it. Removes the unused `ContextScoutDurableRuntimeV1::is_current` wrapper. Digest inputs and all rendered strings are unchanged.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
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.
What
A behavior-preserving simplification pass over the whole codebase, kept to hunks where an existing helper already did the job.
hex::encode(Sha256::digest(..))sites in git-correlation, graph generation, quarantine fingerprints, session-memory relation ids, remote-query control suffixes, session-relation watermarks, and temporal schema admission now calltracedecay_domain::canonical_text::sha256_hex/ the parent module'sdigest_bytes. Inputs are byte-identical, so stored digests and watermarks do not move.IndexFreshnessuses the code-index progress, phase, blocked-reason, duration, and byte formatters already exported fromCodeIndexPipeline.tsxandstorageModel.ts.EvidenceSummariesuses the sharedenvelopePayload. Trust history and the memory oplog useformatMicrosUtc. The local whole-seconds ETA formatter stays so a sub-second ETA still renders as0s.extract_linesandrender_linesslice thelines()iterator instead of collecting every line;collect_method_bodiesreuses a source file already read for the same path; non-Rust field and unsafe scans borrow the source instead of cloning it.ContextScoutDurableRuntimeV1::is_currentwrapper.Review
Fable reviewed the diff: every hash cutover hashes the same bytes as before, the two line extractors matched the previous implementations across a 1,152-case differential run (empty file, start past EOF, end before start, end past EOF, CRLF), the method-body source cache cannot serve another file's source, and the dashboard helper swaps are string-identical for the call-site types. No Critical or Important findings.
Verification
cargo checkon the nine touched crates: clean.cargo fmt --checkon touched files: clean.tsc: the touched files typecheck. The only error in the run wasCannot find module 'three'from a stale sharednode_modules;masterstill declaresthreeindashboard/package.json.Overlap
These same hunks were also swept into the prose commit on #1564 while both were in one checkout. This PR is the standalone, reviewed slice; the punctuation sweep is not in it.