From e6cade752b9f1959bef27ce4e916bb94f19787dc Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Fri, 2 Oct 2026 18:19:47 +0900 Subject: [PATCH] test(core): preserve exact international limitation byte bounds --- CHANGELOG.md | 1 + .../release_limitation_utf8_exact_bounds.rs | 43 +++++++++++++++++++ docs/TEST_STRATEGY.md | 2 + 3 files changed, 46 insertions(+) create mode 100644 crates/originweave-core/tests/release_limitation_utf8_exact_bounds.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index f747adeae..23e82c7d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to OriginWeave are documented in this file. The format follo - Refreshed the product-gap queue to 126 open pull requests (54 ready, 72 draft) after #190, #188, #185, #192, #182, #184, #115, #181, #116, #117, #118, #183, #114, #127, #112, #109, #186, #110, #108, #111, #174, and #113 were merged into their immediate stacked prerequisites. PRs #147, #146, #145, #144, #143, #142, #141, #139, #136, #132, #129, and #128 moved to ready after exact-head checks and thread review; these are queue-consolidation results, not protected-main shipment. ### Added +- Added international UTF-8 release-limitation regressions that preserve exact 1024-byte claim and consequence text and reject adjacent 1025-byte inputs with exact errors. Independent literal boundaries and isolated mutations verify test sensitivity; production validation and release authority are unchanged. - Corrected the 2026-08-26 product-gap snapshot with current #229 presentation-identity evidence, stacked-only #205 integration evidence, current base/head pairs, the 126-PR queue count, explicit root-versus-child merge ordering, and the active GitHub counted-approval gate. - Refreshed the product and technical gap baseline onto the 2026-08-26 live inventory: 126 open pull requests (54 ready, 72 draft), protected-main promotion of #168/#194/#196/#216/#151, a verified maintenance-loop record (supersession closure of #153, conflict reconciliations on #37/#149/#152/#173/#175, issue #212 option-(b) authorization on #43, Strix vuln-0001 homoglyph remediation on #124), provider-rerun outcome evidence, an organization review-pipeline congestion record, and refreshed merge-order queue guidance. Documentation evidence contracts were aligned to the same snapshot so the baseline, its dated markers, and the pinned exact-head rows cannot silently diverge. diff --git a/crates/originweave-core/tests/release_limitation_utf8_exact_bounds.rs b/crates/originweave-core/tests/release_limitation_utf8_exact_bounds.rs new file mode 100644 index 000000000..5f5cd4947 --- /dev/null +++ b/crates/originweave-core/tests/release_limitation_utf8_exact_bounds.rs @@ -0,0 +1,43 @@ +use originweave_core::release_acceptance::{ + DeclaredLimitation, MAX_RELEASE_LIMITATION_TEXT_BYTES, ReleaseDecisionError, +}; + +#[test] +fn international_claim_preserves_exact_1024_bytes_and_rejects_1025() +-> Result<(), ReleaseDecisionError> { + assert_eq!(MAX_RELEASE_LIMITATION_TEXT_BYTES, 1024); + let exact = format!("{}x", "가".repeat(341)); + assert_eq!(exact.len(), 1024); + let consequence = "지원 범위를 설명하는 구매자 안내"; + let limitation = DeclaredLimitation::new(&exact, consequence)?; + assert_eq!(limitation.unsupported_claim(), exact); + assert_eq!(limitation.buyer_consequence(), consequence); + + let oversized = format!("{exact}x"); + assert_eq!(oversized.len(), 1025); + assert_eq!( + DeclaredLimitation::new(&oversized, consequence), + Err(ReleaseDecisionError::LimitationClaimTooLong), + ); + Ok(()) +} + +#[test] +fn international_consequence_preserves_exact_1024_bytes_and_rejects_1025() +-> Result<(), ReleaseDecisionError> { + assert_eq!(MAX_RELEASE_LIMITATION_TEXT_BYTES, 1024); + let exact = format!("{}x", "가".repeat(341)); + assert_eq!(exact.len(), 1024); + let claim = "bounded_claim"; + let limitation = DeclaredLimitation::new(claim, &exact)?; + assert_eq!(limitation.unsupported_claim(), claim); + assert_eq!(limitation.buyer_consequence(), exact); + + let oversized = format!("{exact}x"); + assert_eq!(oversized.len(), 1025); + assert_eq!( + DeclaredLimitation::new(claim, &oversized), + Err(ReleaseDecisionError::LimitationConsequenceTooLong), + ); + Ok(()) +} diff --git a/docs/TEST_STRATEGY.md b/docs/TEST_STRATEGY.md index ba3c31624..b53148dc4 100644 --- a/docs/TEST_STRATEGY.md +++ b/docs/TEST_STRATEGY.md @@ -172,6 +172,8 @@ Hostile classes include: A hostile test must assert the safe failure/result, not merely that the process does not crash. +International release-limitation regressions use independently constructed UTF-8 inputs of exactly 1024 and 1025 bytes for both the unsupported claim and buyer consequence. Accepted text must be retained byte-for-byte, and each oversized field must return its exact length-error variant. The tests assert the fixed 1024-byte contract independently of the production constant and preserve existing ASCII and canonical-text tests. Isolated international boundary mutations must fail these regressions. This verifies already-correct limitation metadata validation, not benchmark execution or release authorization. + ## 6. Prompt-injection and LLM tests Model behavior is nondeterministic evidence and must be surrounded by deterministic assertions.