Repository navigation
impl(011): increment 1, the crate, the manifest and the synthetic encoder - #437
Conversation
006e8b6 to
a2e9c0c
Compare
AI review (no-findings)Reviewing the PR carefully: it introduces the bundle.rs The symlink-refusal loop in Beyond that, the size check ordering is correct: declared total checked first, then individual files read at manifest.rs
The No bounds check on head.rs / synthetic.rs
spec.md / release-set.json Removing Cargo.lock The self-reference under No concrete functional defect is supported by the available evidence. {"head": "a2e9c0ccb628dda07f94fe3e314e0880303fb5be", "verdict": "no-findings", "findings": []}Subject: 09c3c1b...a2e9c0c, diff digest b325ade1176bd10ebc0eff51493b44e06d42f4219f2aa75fe28aa273eccee025, 1 call(s). An AI comment is not an approval. |
a2e9c0c to
9bc1b8e
Compare
AI review (findings)Review of PR 9bc1b8eThis PR introduces bundle.rs — TOCTOU race between symlink check and open
The spec explicitly requires "refusing a symbolic link anywhere on the relative path" (bundle.rs line comment, 3.7.1). The current check fails to enforce this atomically. The correct remedy is Location: Everything else reviewed without findings
{"head": "9bc1b8e987ecbfddd70073cc2b84601d94f4fa30", "verdict": "findings", "findings": [{"path": "backends/rustev-backend-embed-linear/src/bundle.rs", "line": 200, "summary": "TOCTOU race: each path component is checked for symlinks via symlink_metadata in a loop, but fs::File::open (which follows symlinks) is called afterward, so a symlink atomically swapped in during the race window bypasses the check and allows reads of arbitrary regular files outside the bundle directory."}]}Subject: 09c3c1b...9bc1b8e, diff digest 36a28ac218cbe65c0189c8c4cbe0c1c00f4a585d0ff295ceacfc58f3e6e59b25, 1 call(s). An AI comment is not an approval. |
…oder Spec 011 increment 1: establish backends/rustev-backend-embed-linear with the parts that need no real artifact (Decision 18). The feasibility gate (3.2) has not passed for any platform, so no ort, ONNX Runtime or tokenizers dependency is added (3.2.3). - manifest: rustev.embed-linear/1 with every 3.4.2 member, the 3.4.3 consistency checks and the artifact identity (3.5.1). - bundle: verify_bundle reads an absolute directory, refuses symbolic links, bounds reads by declared length, checks the 150 MiB bound, each file's length and SHA-256 and the expected ArtifactId, and parses head weights (3.7.2 bundle and head codes). - The derived descriptor (logits, tolerance, no rank) and cost bound (3.10.1 to 3.10.3); mean_masked pooling and the f64 head product (3.9). - synthetic (feature): the SplitMix64 encoder and head formula (3.19). - The crate is publish = false and excluded from the release set until spec 031 admits it. - Spec 011: the directory is no longer planned; an extends edge on tools/rustev-release/ (031); the implementation record lists the planned increments, the gate status and increment 1. No network access, download, checkpoint, runtime library or provider call is made anywhere in this change.
9bc1b8e to
3651d2d
Compare
AI review (no-findings)After reviewing the diff — a new Security review (bundle.rs)
Manifest validation (manifest.rs)
Spec / governance
Cargo
{"head": "3651d2d09e34a0c4357fea7ccbb0d21fb966763b", "verdict": "no-findings", "findings": []}Subject: 09c3c1b...3651d2d, diff digest 9f9f5734deb6d719a3a828828ed6ef42b4940cd34213e4ba9f9a0f9b96eef830, 1 call(s). An AI comment is not an approval. |
Summary
Spec 011, increment 1: the
rustev-backend-embed-linearcrate with therustev.embed-linear/1manifest, bundle verification and the synthetic encoder. Only the parts that need no real artifact (Decision 18).ort, ONNX Runtime ortokenizersdependency is added (3.2.3). The crate depends only onrustev-contract,serde,serde_jsonandsha2.src/manifest.rs: every member of 3.4.2 withdeny_unknown_fields, parsed with the contract's bounded parser;checkrefuses each 3.4.3 case (options not unique, proposition options other than["false", "true"], zero threads,max_tokensabove 512, an ONNX graph whosesourceis not a checkpoint file with its SHA-256), plus path, size and syntax bounds and tolerance bounds other than those of 3.3.artifact_idis the contract's tagged digest of the canonical bytes (3.5.1).src/bundle.rs:verify_bundlereads an absolute bundle directory, refuses a symbolic link on any path component, bounds each read by its declared length, checks the 150 MiB bundle bound, each file's length and SHA-256, and the expectedArtifactId, then parses the head weights. Setup codes reached:bundle_missing,bundle_too_large,manifest_invalid,digest_mismatch,artifact_mismatch,head_invalid; the others are declared for later increments.src/lib.rs: the descriptor derived from the manifest (3.10.1 to 3.10.3):logitsper operation in the orderclassify,proposition,rubric, determinismtolerance, norank; the cost boundunits_per_call + units_per_token * max_tokens.src/head.rs:mean_maskedpooling in f32 token order with optional L2 normalization, and the head productb_i + sum_j W_ij e_jin f64 (3.9.2, 3.9.3).src/synthetic.rs(featuresynthetic): the SplitMix64 synthetic encoder and the seed formula for synthetic head weights (3.19.1, 3.19.2), documented in the module.tools/rustev-release/release-set.json: the crate is excluded (publish = false) until spec 031 admits it.Spec: 011's directory is no longer
planned; anextendsedge ontools/rustev-release/(031) for the exclusion; the implementation record lists the planned increments, states the gate status, and records increment 1.No network access, download, checkpoint, runtime library or provider call anywhere in this change.
Verification
cargo test -p rustev-backend-embed-linear --locked(tests/bundle.rs, synthetic bundles in a temporary directory),cargo test -p rustev-release --locked,cargo run -p rustev-boundaries.-D warningsonrustev-backend-embed-linear(all targets);cargo fmt --all --check,make gate,scripts/check-authored-content.sh,spec-spine couple.