Repository navigation
feat: reproducible compile for the quickstart tutorial bundle - #2881
Conversation
compile_recording takes an opt-in reproducible_seed. With it, the identity-template salt and the layout-fingerprint landmark salt are derived from the seed (HMAC-SHA256, same 16-byte hex format), created_at is fixed, and recording_id is derived from the seed. Without it, salts stay fresh and random. OPENADAPT_FLOW_IDENTITY_SALT still wins. openadapt quickstart passes a constant seed for its bundled synthetic MockMed tutorial, so every run of a release compiles the same bundle and OpenAdapt Cloud can pin its content digest. Older compilers without the keyword compile as before.
…; qualify the digest note
Independent adversarial review: APPROVEFrom: Grok I reviewed this exact head. I am not merging or pushing. The change is an opt-in No real recording gets a seeded, linkable salt on the default pathWithout a seed, There is no mechanical "synthetic recordings only" guard on the keyword itself. A later caller could pass a seed for a real recording. That is a footgun, not a default-path leak, and I am not treating it as a blocker.
|
Independent adversarial review: REQUEST CHANGESFrom: Grok I re-reviewed this exact head (R2 after my APPROVE at The only code change since that APPROVE is one line in Blocker: this PR's own compile tests fail under default at rest
I reproduced both locally with This is not a missing fingerprint. These tests already existed at Generality gate
Tests I ran
CI at this headGreen: GTK, freerdp, |
Independent adversarial review: APPROVEFrom: Grok I re-reviewed this exact head (R3 after REQUEST CHANGES at The only code change since that REQUEST CHANGES is in I ran The product questions I already approved at CIAt this head, required package jobs are green (30 success, 24 skipped). The only failures are Generality gateNo engine source change in this commit. The earlier generality result still applies. |
What
openadapt quickstartnow compiles its bundled synthetic MockMed tutorial to the same program bundle on every run, so OpenAdapt Cloud can pin its content digest inRECEIPT_GALLERY_SAMPLE_BUNDLE_DIGESTS.Before this change, two runs of 1.26.0 gave different digests (
07135270…and310ba370…). The only differences were the workflow'screated_atandrecording_id, the identity-template salt and every hash derived from it, and the layout fingerprint'sscale_landmarks.saltand its hashes.How
compile_recording(..., reproducible_seed: bytes | None = None). This is an opt-in for synthetic recordings. With a seed, both per-bundle salts come fromHMAC-SHA256(seed, domain + purpose), truncated to the same 16-byte hex format, andcreated_atis fixed to1970-01-01T00:00:00+00:00.recording_idis derived from the seed in the recorder's 32-hex format.OPENADAPT_FLOW_IDENTITY_SALTstill takes precedence over a seed.compute_content_digestand what it covers are unchanged.recording_idis not a join key. Nothing looks a recording up by it: it is used forwf_<id>names in authoring and handoff, a teach prefix and a codegen constant. Deriving it in the compiler leaves the recorder andmeta.jsonalone. As a result, every quickstart bundle of a release shares onerecording_id, and so onewf_<id>.TUTORIAL_REPRODUCIBLE_SEED). It first checks that the installed compiler accepts the keyword, so an older openadapt-flow compiles as before.check_engine_generality.pypasses.Evidence
Headless
openadapt quickstartruns from this branch on macOS:content_digestOPENADAPT_BUNDLE_KEY0415ae8cad2b953670f77c15e7cba42d556475af3f0c12ecf5fdcdf84a2a26b6OPENADAPT_ENCRYPT_AT_REST=00b408250a5e5a95763323dc81563eda1c19ee06fc82321ac9dff3ab29e321a59The two paths differ because
encryptedis part of the program. The digest does not depend on the key.In each run, every report carries the manifest digest as
bundle_content_digest: run-1 (the checked run) and the three restart reports, including the run killed mid-batch. The public card (receipt.card.json) carries the same value aspredicate.program.version_sha256and as itsbundlesubject.program.idisprog-7f5b6f0dccd7811ein all runs.Cloud note
The pinned digest belongs to a release. It changes whenever the tutorial app, the demonstration or the compiler output changes, so any release that changes it needs its new digest added. This is noted in
packages/flow/docs/TUTORIAL.md.Not covered
--watch) run uses a different Chromium build, and another OS renders fonts differently. Either can change template PNG bytes and so the digest. Cloud may need one pinned digest per platform.openadapt-flow tutorialanddemostill use random salts. Induction (phi_free_program_identity) is not given the seed.Tests
packages/flow/tests/test_reproducible_compile.pyandtests/test_quickstart_reproducible.py.test_layout_drift.py::test_real_render[kw3-font_size_changed]fails the same way onorigin/mainon this machine, because it depends on local font rendering.