Skip to content

feat(ios): add independent Prepared group lifecycle - #40

Merged
1395490241lhj-code merged 1 commit into
mainfrom
codex/km-pr3-slice1
Oct 29, 2026
Merged

1395490241lhj-code merged 1 commit into
mainfrom
codex/km-pr3-slice1

Conversation

@1395490241lhj-code

Copy link
Copy Markdown
Owner

A user can split one 200g portion from an 800g/four-portion Prepared source, thaw and cook that group, then consume it while the other 600g stays frozen. Each action keeps the selected group/source identity and original recorded allocation; cooking does not invent a measured yield or deduct Inventory.

This PR contains the owner-accepted PR3 Slices 1–5. It targets the merged PR2 baseline ef23d688c8e72107b60acff0c2e7755289994bd0 and is for source review only. Merge, deployment and iOS publication require separate authorization.

Source: 3c03285 · Acceptance index. Exact committed scope: 56 files (50 source/test/fixture/runner files and all six specification/review/checklist/acceptance documents).

Implementation

  1. Pure lifecycle model: optional group-owned lifecycle v1, separate from existing preparation (prepped/cooked) and storage (refrigerated/frozen). Its five keys and nullable timestamps encode explicitly and decode strictly. Begin thaw, complete thaw and mark cooked use a deterministic transition matrix, reviewed advisory expiry and stable confirmed event time/calendar on unchanged retry. No automatic completion, reverse transition, refreezing or direct-from-frozen cooking.
  2. Additive persistence and genuine upgrades: nullable lifecycleData on the existing Prepared record; existing shared 18-model factory and store location retained. Genuine pre-PR2 and merged-PR2 layouts are qualified independently, opened only on copies, compared across all 18 record types, then exercised through lifecycle Store writes and distinct-process reopen. Original grouping blobs, UUIDs, ordering and exact/rounded allocations are preserved. The pre-PR2 fixture remains inherited from the baseline; the genuine PR2 fixture and producer/layout/hash provenance are included here.
  3. Coherent Store and Backup v3 activation: exact expected-row and durable-snapshot checks, complete-collection validation, persistence before one publication, rollback and lossless mapped reads. Legacy count-only/nil-lifecycle editing remains ordinary until a successful explicit opt-in; every measured group stays protected. Active-thaw splits inherit lifecycle/expiry exactly. New exports/recovery copies use v3 with an explicit lifecycle: null or complete object on every Prepared row. Original v1/v2 lifecycle keys and original v3 missing keys reject before decoding/preview normalization/writes; valid historical imports remain supported and retain original provenance.
  4. Per-group meal availability and native UI: frozen/actively thawing Prepared groups are excluded before source selection while eligible siblings survive. Quick Meal and Component Meal retain independent policies. Actual usage callbacks carry the complete displayed expected row to the sole guarded immediate-meal decrement. Management/future-use records remain visible; Inventory convenience-food eligibility is unchanged. Contextual native review sheets show group/count/original mass/current/proposed facts and editable reviewed expiry, retaining drafts for failed saves and requiring renewed stale recheck.
  5. Final integration acceptance: qualified DEBUG process harness with a named PR3 suite, strict independent host oracles and complete loaded-code artifact binding. Existing PR2 default operation path and --restore-only remain. Hooks/fixtures are excluded from unsigned Release configuration. Specification, design/plan reviews, checklist and final acceptance index are included.

Recovery-copy ownership correction: normal import owns its newly prepared copy and may resolve it after proven compensation. Explicit recovery reuses an older outstanding copy A; if recovery fails and compensation restores current kitchen B, A must remain byte-identical and outstanding. A later successful explicit retry restores A and resolves it. Unsafe compensation/reread retains recovery assets. Existing seven-domain order, publication and outcome classification remain; no global transaction/write fence was added.

Verified local evidence

Evidence Actual result and boundary
Final complete native unit suite 2,844 passed, 0 failed, 5 hosted-credential skips, 2,849 total, using local xcodebuild and the reserved simulator.
Controlled process interruption 14 genuine SIGSTOP→SIGKILL cases, 72 distinct launches, 36 fresh-process probes. Ten Prepared cuts cover before-save/after-durable-save-before-publication. Four restore cuts cover normal v3 import, explicit v3 recovery and outstanding v1/v2 recovery after Prepared/before special plans. Full ordered values, unchanged siblings/copy bytes, blocked new import, explicit recovery and no replay verified.
Accepted focused UI 13/13 passed in the stabilized Slice 4 run; actual Light/Dark/normal/Accessibility XXXL PNGs inspected. Relevant UI inputs remain unchanged.
Actual synthetic backup routes Normal system fileImporter → handlePickedFile → preview → destructive confirmation → fresh-process reread for original v1/v2/v3; malformed v3 rejected before preview/writes. Separate v3 recovery export physically saved while original v2 bytes remained unchanged; later explicit recovery/restart passed.
Genuine migration origins Pre-PR2 cdcae1424fafba7ffbe82ccdb6c339a6d695f599 and PR2 ef23d688c8e72107b60acff0c2e7755289994bd0; old layouts verified to lack lifecycle, all 18 model types/old values preserved. Fresh parity is separately tested.
Release exclusion Unsigned generic-iOS Release build passed; fixture/hook tokens are present in the actual Debug dylib positive control and absent in Release code/symbols. No archive/upload/distribution.
Independent review Full-branch FR-01–FR-14/A01–A14 source/evidence review GO; 0 open Critical / Important / Minor findings.

Evidence integrity: the initial full-unit run failed one stale legacy frozen-food usage fixture (2,843 passed/1 failed/5 skipped). A bounded test-only correction preserved its label/no-mass assertions and added frozen exclusion; focused tests and one full revalidation passed. An initial artifact checker inspected only the Debug launcher; the host binding was corrected to include the actual Debug/preview dylibs and all 14 process cases were rerun. Original failures and superseded receipts are preserved. These are not presented as successful first attempts.

All 468 native inputs / 445 Swift files match the accepted final manifest. Canonical sorted-manifest SHA256: 3b52528b05a7569751b1a8d998f794ff6a4307471e427a380c6934ed4e53f0f4. Creating this commit did not change native inputs, so accepted local native evidence was reused rather than rerunning the full suite. Automatic PR checks are separate evidence; this branch does not automatically run the GitHub native simulator workflow.

The complete xcresults, raw SQLite/sidecars, process snapshots/signals, original failures, rendered PNGs and manual picker receipts remain in the owner's external local evidence archive. They are not GitHub-hosted PR artifacts and are not downloadable through this PR. This body is the portable summary. The repository acceptance index includes summaries/hashes and local verification-machine pointers, which are not public artifact links.

Acceptance and retained limits

  • A01–A12 and A14: PASS within documented local/synthetic/controlled-process boundaries.
  • A13 spoken VoiceOver/focus: HOLD. Screenshots, labels and AX queries do not establish actual spoken/focus behavior.
  • Small-phone Light: UNVERIFIED. Inherited editor-frame warning remains unresolved.
  • No arbitrary power-loss/fsync guarantee, older-binary upgraded-live-store downgrade, real-user/production restore or unrestricted iOS release readiness.
  • Restore remains seven sequential domain writes with existing compensation. Process death after Prepared can leave mixed domains; outcome is process-local. An outstanding copy blocks a new import, not all ordinary mutations. No whole-kitchen atomicity or global write fence.
  • No Inventory deduction/linkage, PR4, auth/sync/server work, production-data operation or CI/signing/entitlement configuration change. No merge or deployment authorization.

Review documents: specs/007-prepared-group-lifecycle/{spec.md,review.md,checklists/requirements.md,plan.md,plan-review.md,acceptance.md}. Genuine fixture/provenance files are under KitchenManagerTests/Fixtures/PreparedPrePR2 and PreparedPR2 in the native project.

Add guarded thaw and cooking transitions, lossless Backup v3 and per-group meal availability with native review controls. Preserve recovery-copy ownership and qualify genuine disk upgrades and controlled process interruptions.
@1395490241lhj-code
1395490241lhj-code merged commit 0096f75 into main Oct 29, 2026
6 checks passed
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