Move agent_import.rs read-back verification into agent_import_verification.rs - #484
Merged
Merged
Conversation
…ation.rs Moves the import read-back verification family, `parse_import_vouchers` through `render_proof_markdown` (18 functions, 606 lines), out of `src-tauri/src/agent_import.rs` into `agent_import_verification.rs`, declared as `agent_import::verification`. Regenerated on 2481ed0 by script, so it carries #482's effective-date verification. Only two kinds of edit are made to the moved code: `pub(super)` on the 17 functions reached from outside the module, and its two `super::` paths rewritten to `super::super::`. With those undone and both sides run through rustfmt, the block is byte-identical to master's. Unformatted, the only other difference is rustfmt rewrapping `parse_import_vouchers` and `verify_batch`, whose signatures the prefix pushed past 100 columns. `effective_date_not_observed`, `VerificationCandidates` and `VerificationFingerprint` stay private. The parent imports the functions explicitly: - 13 reached from production code: 8 from Server methods in agent_import.rs (build, verify, persist, pre-import mark), 4 of which the posting path (agent_import_post.rs) also calls; 5 from the amendment compare-and-swap (agent_import_amend.rs). - 4 reached only from sibling test modules, under `#[cfg(test)]`: batch_duplicate_sets, duplicates, observed_fingerprint, observed_voucher_identity. The new file is pinned in the compatibility surface (267 -> 268 pins) and MAX_SURFACE_FILES rises by one with a named reason. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
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.
Outcome
src-tauri/src/agent_import.rsloses its import read-back verification family:parse_import_vouchersthroughrender_proof_markdown, 18 functions, 606 lines. They now live insrc-tauri/src/agent_import_verification.rs, declared asagent_import::verification. No behaviour change.This family decides whether an imported voucher is reported
posted_verified. It parses the verification collection, corroborates the window, attributes vouchers by narration marker or fingerprint, finds duplicates and renders the proof. Before #482, 11 of the 14 commits touchingagent_import.rsnever touched it (a crude hunk-header measure).The move is regenerated by script on 2481ed0, not rebased. It supersedes the reviewed but never-PR'd branch
refactor/agent-import-verification(3d9fc91, old base 07fc1f7). Master had since changed the moved code (#482: effective-date verification). Because the cut is by function name, that code moves with the rest.What changed in the moved code
pub(super)on the 17 functions reached from outside the module.effective_date_not_observed(added by Verify the effective date Bridge writes on Payment, Receipt and Contra #482),VerificationCandidatesandVerificationFingerprintstay private.super::paths (parse_import_verification_rows,validate_agent_envelope, both inagentscope) becomesuper::super::.parse_import_vouchersandverify_batch, whose signatures the prefix pushed past 100 columns.The parent imports explicitly, with no glob, following the owner's idiom:
agent_import.rs:build_import_xml,verify_import_with_dispatch,persist_import_verificationandpre_import_mark.agent_import_post.rs.agent_import_amend.rs.#[cfg(test)]:batch_duplicate_sets,duplicates,observed_fingerprintandobserved_voucher_identity. Word-grep putobserved_fingerprintin the production list because a struct field shares its name. Clippy's unused-import error corrected it.Scope, reuse, and impact
verify_batch(187 lines), whose steps share about a dozen mutable locals (seedocs/rust-module-conventions.md).lib.rs: +6/−1.MAX_SURFACE_FILESis 268 with a named reason. Digests changed foragent_import.rsandtools/bridge-tally-compatibility/src/lib.rs. Every other production collaborator (agent_import_post.rs,_amend.rs,_ledger.rs,_cash_bank.rs,_identity.rs,_persistence.rs) was already pinned._schema.rsstays exempt, as already recorded.Validation and evidence
d0d62313cargo fmtandcargo clippy --locked -p bridge --lib --tests -- -D warnings -A clippy::pedantic: clean, on rustc 1.96.0.cargo test --locked --lib: 982 passed, 0 failed, 6 ignored.cargo test --lib -- --listgives 988 names, identical on 2481ed0 and on the candidate (sorted diff empty).node --test scripts/*.test.mjs: 250/250 pass.cargo test -p bridge-tally-compatibility: pass.scripts/reseal.sh --pins-changed, then--verify: current. An independent check found every pinned file's sha256 equal to its surface entry, matrixcompatibility_surface_sha256== surfacemanifest_sha256, pins added vs master = only the new file, and cap == 268 == pin count.include_str!/readFileofagent_import.rsin.rs/.mjs/.ts, and no script names a moved function.docs/agent/GOAL*briefs cite historicalagent_import.rs:<line>locations and are left as history.super::super::paths (no glob shadowing), the 18/17/13/4 and 8/4/5 counts, and the surface delta. Its one wording note ("byte-identical" needs "after rustfmt") is fixed in the commit message and above.Conventions checklist (
docs/rust-module-conventions.md), measuredagent_import_*_tests.rs.narration_markersand the twoagent-scope parsers above.agent_import.rsnever touched the family (crude hunk-header measure). Verify the effective date Bridge writes on Payment, Receipt and Contra #482 touched both.git diff --color-moved.git statusclean? Yes.Coordination: announced in the merge queue. It takes over the parked slot of a thread that is no longer reachable, and the queue is otherwise empty.
🤖 Generated with Claude Code