Repository navigation
Lock ActiveJob adapter inputs and pin clock-name comparisons - #396
Conversation
284km
left a comment
There was a problem hiding this comment.
Reviewed exact head c524447 against its current parent/base ade719e (#395), with current main 856e61b as context. No actionable finding in this tooling/dependency update. The opt-in policy is narrowly source-pinned, preserves endpoint offsets and Range/type forms, keeps raw identities and refuses ambiguous or incomplete pairings. The new aliases are used consistently by classification, strict all_pass, summaries and before/after comparisons; paired assertion failures remain RED. Existing literal and opaque policies retain their behavior.
Independent validation: all 43 framework checks pass, including the new negative source-pin, offset, ambiguity, incomplete-inventory, failure and strict comparison controls. I fetched argument_serialization_test.rb from the exact locked Rails commit through GitHub and independently confirmed SHA-256 6ab0a13d10a0c5a881a66bf37908a0381ed507ae8dc99b5b3e4093575b128a2c. The lock-manifest checks pass, and the base/head diff is confined to the eight tooling, dependency and record files. I did not reinstall the added native dependencies or rerun complete Rails components/resource comparisons here; those reported measurements remain author evidence. The AMQP loader failure/33 missing cases remain a failed/incomplete observation, not acceptance.
No merge: parent #395 is still open, this PR currently targets its feature branch, and hold_all_merges/new_failure_review_required remains active. Merge the validated parent through its PR into main first and only then retarget/reassess this child. COMMENT because the authenticated account owns the PR.
284km
left a comment
There was a problem hiding this comment.
Review of c524447 (stacked on #395). Scope: the new Gemfile / Gemfile.lock / archives.lock.json entries, the rails-argument-descriptions identity policy in run.py, and the new check.py cases.
Summary: the supply-chain side looks clean. The lock is enforced for input drift. One Minor finding: the clock policy pairs names without looking at the clock values at all, so a real difference in date arithmetic or Time/DateTime rendering would be hidden. One Suggestion about check.py's lock test (pre-existing gap).
Supply chain (checked)
- All seven new gems (amq-protocol 2.8.0, bunny 2.24.0, rbtree 0.4.6, serverengine 2.0.7, sigdump 0.2.5, sneakers 2.11.0, sorted_set 1.1.0) have exactly the versions and dependency lines in Rails v8.1.4.1's own Gemfile.lock (fetched from rails/rails at the tag).
- Every new sha256, in both Gemfile.lock CHECKSUMS and archives.lock.json, equals the rubygems.org API
shafor platformruby. None is yanked. - The only source is
https://rubygems.org/. No GIT or PATH sections were added. - Licenses: MIT (amq-protocol, bunny, rbtree, sigdump, sneakers), Apache-2.0 (serverengine), BSD-2-Clause (sorted_set). All are permissive.
- For awareness: rbtree is a C extension, so installing it runs its extconf.rb on both sides. sneakers 2.11.0 (2019) and serverengine 2.0.7 (2018) are old. Both are the versions Rails itself pins, and no worker is started.
- The
inputsdigests in archives.lock.json match the Gemfile and Gemfile.lock at this head. Across all packages, the two files list the same set of gems with the same sha256 values.
Lock enforcement (checked by running mutations on a copy)
- Appending a gem line to Gemfile:
run.lock()raiseschanged locked input: Gemfile, so check.py fails. Good. - Removing sneakers from archives.lock.json: check.py fails. Good.
- Suggestion (pre-existing, not caused by this PR):
test_lock_matches_gemfile_and_rails_tagonly checks that each CHECKSUMS line has a package with the same file name. It passes when (a) only an archives.lock.json sha256 changes, (b) a CHECKSUMS sha256 changes and the input digest is refreshed, or (c) archives.lock.json gains a package that Gemfile.lock does not list. Install time still fails closed:restore()checks downloads against archives.lock.json, and Bundler checks CHECKSUMS. So this is about keeping the two files consistent in review, not a hole. Comparing the two maps for equality (names and sha256) would close it in a few lines.
run.py / check.py
- check.py at this head: 43 tests pass. The 37 tests from #395's check.py also pass against this run.py, so
literalandopaque-class-addresseskeep their behavior. - Callers that pass no
source_sha256get the old behavior.compare()uses the digest only when both records agree. - Pinning to the source digest is right: I fetched
activejob/test/cases/argument_serialization_test.rbat v8.1.4.1 and its SHA-256 isARGUMENT_SOURCE_SHA256. The three names come from10.days.ago..Date.today,10.hours.ago..Time.currentand(DateTime.current - 4.weeks)..DateTime.current, interpolated withinspectinto the test name. - I also checked a UTC host. Ruby prints
Time.nowunderTZ=UTCas+0000, notUTC, so the patterns still match there.
Finding
- Minor: the policy hides differences in the clock values (inline comment on run.py).
Local results posted by the author
Yes. 43 framework checks, the seven archive digests against RubyGems, corpus/VM corpus at the unchanged runtime, related core files against main, and the three targeted ActiveJob files on both engines.
Not checked
- I did not install the gems or run the ActiveJob files. I did not reproduce the AMQP /
Symbol#indexloader failure. - I did not reproduce the activejob-test-inputs.json record.
Merge order
This PR's base is codex-rails1-activejob-runtime. It can merge only after #395 merges and the base is changed to main.
CI at c524447: Small pure Ruby gem suites, NKF Wasm engine, Linux build dependency controls and Rails measurement harness passed. Rake was running, and CI, Gem suites, Additional gem suites, Delegation/URI and Runtime load path controls were queued, when I posted.
| if match: | ||
| # Preserve each endpoint's UTC offset. Only the clock's | ||
| # date/time text is volatile, not the test's type or form. | ||
| return (('rails-clock', kind, *match.groups()),), [], True |
There was a problem hiding this comment.
Minor. This shape key keeps only the kind and the two UTC offsets. The dates, the clock values and the weekday never take part. So any Mere output of the right syntax pairs with the reference.
I ran classify(..., 'rails-argument-descriptions', ARGUMENT_SOURCE_SHA256) on a copy of the check.py fixture, with these Mere names:
2023-01-01_00:00:00_+0900..#<Date:_2026-11-28_...>(a10.days.agothat is almost four years off),2026-11-20_15:13:20.123456789_+0900..2026-11-28_01:13:20_+0900(8 days apart instead of 10 hours, and different subsecond digits),Mon,_31_Oct_2026_...(31 Oct 2026 is a Saturday).
All three came back MATCH.
The tests only assert the round trip. In this file, these names are the only place where the output of 10.days.ago, Time#inspect and DateTime#inspect (the ActiveSupport format) is observed. With this alias, a regression there turns into MATCH instead of MISSING/EXTRA.
Suggestion: keep the clock out of the identity, but check the shape of the values. For example:
- parse both endpoints on each side and require the same spacing (10 days, allowing the day boundary, for the Date case; 10 hours and 4 weeks for the other two, with a few seconds of tolerance for the clock moving),
- require the weekday to agree with the date,
- optionally require each side's endpoints to fall within that side's run window.
The subsecond digit count can legitimately differ (Ruby drops trailing zeros: 02:22:54.05432), so leaving (?:\.\d+)? open is fine.
There was a problem hiding this comment.
Fixed in cba5070 (policy code a9b46e4). Both endpoints are parsed and independently checked for the expected 10-day/calendar, 10-hour or 28-day interval, valid dates/offsets, matching DateTime weekdays and Date Julian days, with two seconds of clock-read tolerance. Invalid values remain literal; fractional precision, DST and midnight crossing stay valid. All48 framework checks pass on Python3.12 and3.9, including12 malformed-value controls. Real argument_serialization_test is53MATCH/0other on evaluator and VM, COMPLETE/unbounded. All36 previous raw focused/RSS records retain their counts under reclassification. Code and complete review evidence were batched in one push. Please re-review this exact head.
284km
left a comment
There was a problem hiding this comment.
Re-reviewed c524447b..cba50706 against the clock-policy Minor.
Fixed. argument_clock_values_valid now has to accept each side's name on its own before it is paired:
- days-ago-to-date: the dates are 10 apart, allowing 9 or 11 only when a read lands within 2 s of midnight. The Date's Julian day also has to agree with its ISO date.
- hours-ago-to-time: within 2 s of 10 hours.
- weeks-ago-to-datetime: within 2 s of 28 days, and the weekday has to agree with the date (Python's
weekday()order matches the Mon..Sun tuple). - An invalid offset or calendar value, or any parse error, returns False, so the name stays literal and an unpaired difference still shows.
The examples from my earlier review (dates ~4 years off, 8 days instead of 10 hours, wrong weekday) all fail these checks now. The author's record adds controls for them.
No further findings from me. Order: #395 first, then this PR with its base changed to main. Both also wait for the automated reviewer.
There was a problem hiding this comment.
Re-reviewed exact head cba507064e6a5ad50beaba57162cfa5689959a09 against parent ade719e39cd7600b5989c966dde8ece03c58c9c1, including the earlier reviews and responses. The previous Minor at discussion_r4725088134 is fixed. Each side now validates its own interval and rendered calendar before an alias is accepted; invalid arithmetic, weekday, Julian day and offsets retain literal identities. The source pin, unique COMPLETE inventories, raw identities and failed-assertion verdicts remain intact. No new actionable findings.
Independent checks: all 48 framework tests pass on Python 3.12.5 and 3.9.6. Replaying the three original wrong-year/wrong-duration/wrong-weekday examples against the old and updated modules produces MATCH before, MISSING plus EXTRA after. The suite also verifies valid fractional precision, DST offset changes, midnight crossing, source-pin/incomplete-inventory refusal and strict all_pass/compare behavior. The follow-up changes only five policy/test/documentation/evidence files; dependency locks are unchanged since the prior supply-chain review. No interpreter, C API, library or build source changes relative to the parent.
Dependency assessment: the added test-only closure remains sneakers 2.11.0, bunny 2.24.0, amq-protocol 2.8.0, sorted_set 1.1.0, rbtree 0.4.6, serverengine 2.0.7 and sigdump 0.2.5. The lock checks pass and exact-version GitHub Advisory Database queries returned no advisories for these seven packages. This is not proof of absence of vulnerabilities. Native-extension installation remains an execution/compatibility risk (not independently rerun here); the earlier checksum/version review and author installation evidence remain distinct from my policy checks. No worker/service was started.
I inspected the new policy evidence, including the explicitly reused installation and runtime measurements; I did not independently rerun real Rails files, native installs, full corpus or resource acceptance. No merge: #395 remains an unmerged prerequisite and the base is still its feature branch. The recorded hold_all_merges/new_failure_review_required also remains active; current CI completion does not waive the preserved main Module timeout or prerequisite/integration checks. COMMENT because the authenticated reviewer owns the PR. The specific clock-policy finding is cleared.
Hosted CI status at posting: Additional upstream gem tests / ubuntu-24.04 has actually failed (run 46107343238, job 140862937202); Linux CI build remains in progress, macOS/reference work remains queued. This is an additional merge blocker, not covered by the runner-queue exception. The completed job log identifies method_copy_memory_check.py: reference post-GC peak/initial 1.08253 (healthy), Mere 2.16719 (unhealthy). That job used compiler 408b03d9, while my review tests cover the Python policy; no causal attribution to this policy update or a passing memory claim is made.
|
AdditionalGem CI investigation: the hosted failure is still open. The original unchanged Method-copy checker reported a post-GC peak/initial ratio of2.16719 (limit2.0), reference1.08253, without an outer time/memory limit. CI used compiler408b03d9 on Ubuntu x86; this failure is retained. I built the pre-fix main491cc5ca and runtime42e57da3 with the same compiler408b03d9 and ran three alternating pairs using the original21-sample checker, normalGC and unchanged600s/2GiB/2.0 bounds:
All six completed healthy; these controls ran on native macOS arm64, so they do not establish a hosted Ubuntu x86 pass. Earlier compiler9dec controls are also retained: main4911.90302, runtime422.05639 (unhealthy), reflection61831.90251, one run each. There is no threshold change and no claim that the Python comparison policy caused or resolved this runtime memory failure. The other stream's Method snapshot/release work in#398 is kept separate. Hosted CI and the owner merge hold remain unresolved. |
|
Parent #395 is now at55f519ede231dc13f423f94bf723c3c6d0bfdba4 in one code+evidence push. Runtime42e57da3 is unchanged. This fixes the additional396 corpus job failure in clean reference Ruby4.0.10 ISeq#disasm by constructing the identical Unicode-named subclass dynamically. Original/new runtime output is identical; all8 evaluator/VM × Hash × GC32 comparisons pass. Whole-file ISeq1031/1031same with zero skips/differences/format/errors. Corpus--both1031/1031; VM1031/0fallback/0FAIL/0list differences;12gates and changed-record hygiene pass. A fresh9dec C emission is byte-identical to the reused O2 binary's recorded C. Full provenance and earlier wrapper refusals are retained in the new record. The policy head of#396 remains cba5070; the updated parent requires exact-head re-review on#395. This fixes only the reference-disassembly corpus failure. The preserved hosted Module timeouts,396 Method-copy memory failure and global owner hold remain open; no merge or passing hosted-CI claim. |
|
Additional hosted observation, kept separate from this PR's original failure: parent #395 head55f519ed integrated with main8657f5b2 (Actions source23f7be6c) passed Additional-gems Ubuntu job140916341265, compiler408b03d9. I downloaded its original log and method-copy artifact15254939326. The current check reports reference median1.00061, Mere median1.01593, all three runs healthy; Mere samples0.98928/1.04285/1.01593. The metric changed on main: this artifact uses check SHAb8fc309d73a3f678bb881387a5149386a0e67426de3dc5d8d73693b0d9c5b11d,30batches, three runs, second-half/first-half limit1.3. The preserved cba5070 failure used the older check ad9966… and post-GC peak/initial limit2.0. These are different checks; the later success is not a replay or erasure of the earlier2.16719 failure. No threshold was changed by this tooling PR. Original later hosted job. This observation belongs to the #395+new-main integration, not unchanged #396 cba5070; the parent merge, subsequent child integration/exact-head validation and owner hold clearance remain required. |
ActiveJob exceptions_test eagerly loads SneakersAdapter even when testing a built-in adapter. Lock Rails' real seven-gem dependency closure and document the adapters needed to execute the full files.
The opt-in rails-argument-descriptions policy pairs the three clock-generated Range descriptions only in the exact pinned Rails source. Before pairing, both sides must independently have valid timestamps/offsets, the expected 10-day / 10-hour / 28-day interval, consistent DateTime weekdays and Date Julian days. Separate clock reads have a two-second tolerance, including a Date midnight boundary. Variable subsecond precision remains valid. Source changes, ambiguous/incomplete inventories and invalid values keep literal identities; failed assertions remain RED. Default/literal and opaque policies retain their behavior.
Stacked on #395. Policy source a9b46e4; publication cba5070 adds only review evidence. The Minor at discussion_r4725088134 is implemented and ready for exact-head re-review.
Local validation:
Reference: clean Ruby4.0.10 via tools/ref_ruby.sh, revision a704b7cd95a42cc0cf5f307137bf3aac0285b915, Prism1.8.2, no extras. Compiler9dec2ff6 / mgz661a01d8, ordinary O2.
The unchanged-runtime core/RSS evidence is in #395: related Range/Array/Hash/Eval/Module before/after inventories retain the Array resource limit, Module VM Timeout and eval skip; they are not all-pass claims. JSON encoding158, three alternating pairs, normal GC/seed12345:
These are the original runtime-change measurements, not fresh policy-only RSS runs. Ranges overlap; no stable memory improvement is claimed.
Records: loop/2026-11-28-codex-rails1-activejob-framework-inputs.md and railstest/framework/records/activejob-test-inputs.json (original evidence plus policy_review_fix). The earlier33MISSING AMQP observation remains historical; #399 fixes its interpreter cause and independently reports313MATCH on both engines.
Merge #395 first, then retarget this PR to main. Owner controls the global merge hold and waits for a review of the exact final head; no self-merge.
Hosted AdditionalGem CI reported an actual failure in the original Method-copy memory checker: Mere2.16719 versus the unchanged2.0 bound; reference1.08253, no outer limit. Three alternating same-compiler408b source-control pairs on macOS arm64 were healthy on both main491 and runtime42, but that differs from the hosted Ubuntu x86 platform. Earlier unhealthy observations are retained. Full investigation and ratios. No threshold changes, causal attribution to the Python policy, or passing hosted-CI claim. The owner merge hold remains.