Skip to content

refactor(ata): move fixed-form greedy assembly ownership to Rust - #747

Closed
seonghobae wants to merge 1 commit into
mainfrom
refactor/test-form-assembly-rust-main-20260811
Closed

refactor(ata): move fixed-form greedy assembly ownership to Rust#747
seonghobae wants to merge 1 commit into
mainfrom
refactor/test-form-assembly-rust-main-20260811

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

Buyer-visible architecture gap

Issue #629 is now partially integrated: protected main owns CAT item information and final next-item selection through Rust/PyO3, while assemble_test_form() still performs result-affecting score ordering, exclusion filtering, per-content min/max enforcement and look-ahead feasibility in Python.

This clean current-main Draft starts the remaining fixed-form assembly port test-first.

Intentional RED

The first commit adds only tests/test_test_form_rust_ownership.py. It replaces the proposed compiled owner _core.assemble_test_form_greedy with a sentinel valid form and requires the public API to return that exact result without mutating caller information/content/exclusion arrays. Current Python-owned greedy logic should therefore fail the delegation assertion while the rest of the suite remains unchanged.

Valid RED must build/import the installed Rust/PyO3 package and reach this public selection boundary; setup/import/fixture/changelog failures are not acceptance evidence.

Minimum GREEN

  • move descending finite-information ordering, excluded-item handling, deterministic tie/order policy, content minima/maxima and look-ahead feasibility into one bounded mlsirm-core kernel;
  • expose thin PyO3 marshalling; Python validates shapes/types/control values, maps content labels into a bounded canonical representation and transports the result only;
  • preserve exact current deterministic behavior and stable infeasibility semantics before considering any stronger ATA/MILP/shadow-test optimizer;
  • bound item count, content-class count, form length, integer conversions and selection work before allocation/sorting; reject malformed/impossible controls before partial output;
  • missing/incompatible compiled capability fails closed rather than silently executing an independent Python assembly algorithm;
  • add Rust/public field/index parity, ordinary/adversarial constraint fixtures, tie/exclusion/non-finite/resource-bound tests, caller-input immutability, complete rustdoc/docstrings and realistic CPU/memory benchmark evidence;
  • keep CPU execution unless profiling shows a material GPU case;
  • after GREEN update authoritative architecture: move CAT item information and test-assembly selection into Rust #629 doctoring/changelog and the sole canonical docs: establish canonical product and architecture baseline #604/docs: close canonical documentation fitness gaps without parallel authority #621 architecture line through its current writer, never a competing docs PR;
  • require one unchanged final head with focused/full Python 3.12/3.14, Rust/PyO3, package/reinstall, existing GPU/fuzz, Security/SAST, exact coverage/docstrings and current-head review/governance gates.

No CAT ability/item-information semantics, hosted state, provider, dependency/workflow, version/release or new exact ATA optimizer belongs in this slice. Advances #629.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4a9a02d8-b9dc-4986-bebc-c17b3d197916

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Contributor Author

Superseded by clean current-main Draft #750. Fresh compare proved #747 head 8191f9b9fc357ddd10ec3ef988c566e34a46b93b is three protected-main commits behind and has exactly one unique path, tests/test_test_form_rust_ownership.py. #750 recreates that exact fail-first contract from protected main cd9e55f7f1735e9d73e73c11f5790d3c8e2f2b55 on head ba9685b965c64a170ff5ca566f750d3ae4225769. No predecessor checks/reviews/approval transfer; #750 must earn fresh RED→GREEN/live-base evidence.

@seonghobae seonghobae closed this Aug 11, 2026
seonghobae added a commit that referenced this pull request Aug 11, 2026
* refactor(ata): own fixed-form greedy assembly in Rust

Public assemble_test_form validates and marshals only; ordering, exclusion,
and content-feasibility decisions move to assemble_test_form_greedy with
ownership sentinel tests, changelog fragment, and APA doctoring.

Supersedes draft #747 once green.

* test(ata): fail first on reflected content labels

* fix(ata): omit caller content labels from constraint errors

Fail closed on non-negative content counts without reflecting
caller-controlled label strings in ValueError messages.

* fix(ata): restore content-label key lookup in constraint validation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant