Skip to content

fix(run-result): replace inlined child envelopes with bounded per-child summaries - #3640

Merged
chubes4 merged 1 commit into
mainfrom
fix/issue-3637-data-machine
Oct 17, 2026
Merged

chubes4 merged 1 commit into
mainfrom
fix/issue-3637-data-machine

Conversation

@chubes4

@chubes4 chubes4 commented Oct 17, 2026

Copy link
Copy Markdown
Member

Summary

Parent run_result envelopes no longer inline the full stored run_result of every child job. RunResultEnvelope::fromJobSummary() now emits a bounded per-child summary (job_id, status, counts, outcome class counts) at metadata.datamachine.child_job_summaries, with full child state hydrated by ref via the existing child_run_refs. This keeps fan-out parent engine_data bounded regardless of child count, fixing the engine_data_query_oversize rejections (3.5–4.7 MB parents observed on events.extrachill.com) and reducing multi-MB CAS writes on hot parent rows. Child rows are also fetched once per envelope build instead of twice.

What changed

  • inc/Core/RunResultEnvelope.php: removed childJobEnvelopes(); added childJobSummaries() producing bounded per-child summaries (job_id, status, counts, outcome_class_counts) under metadata.datamachine.child_job_summaries, with an int-only counts filter guaranteeing boundedness
  • inc/Core/RunResultEnvelope.php: fromJobSummary() now fetches child job rows once and shares them between child_run_refs and child_job_summaries (previously two full child-row loads per terminal envelope build)
  • tests/Unit/Core/RunResultEnvelopeChildSummaryTest.php (new): parent with 40 children each holding a ~60KB valid run_result (~2.4MB if inlined) asserts the parent envelope stays within the 163,840-byte validate bound, passes validate(), contains no child_job_envelopes, and carries correct child_run_refs and bounded summaries; runs in the SQLite suite
  • tests/Unit/Abilities/Engine/RunFlowAbilityLifecycleTest.php: updated the parent-completion test to assert bounded child_job_summaries and child_run_refs instead of inlined child_job_envelopes

How to test

  1. Run homeboy review test data-machine; expect passes as recorded by Cook's deterministic gate.

Compatibility

metadata.datamachine.child_job_envelopes is removed from newly built parent envelopes and replaced by child_job_summaries; a repo-wide grep found no other consumers of child_job_envelopes in inc/ or tests besides the updated test. Previously stored envelopes are untouched (existing valid stored run_results are never migrated, per the established rebuild-on-invalid policy). child_run_refs, outputs.child_jobs totals, and all other envelope fields are unchanged. CHANGELOG/versions untouched (release-owned).

Evidence

  • Verified command homeboy review test data-machine: status=succeeded; candidate commit 5ad4cca1d303e651ac7ef98c0e75820891a1259a, tree 67e727e1798e26d7ddd12749b6c7a67f4b4d9aaf, fingerprint cd8a49434dc96299d8327a67c52c2830bf84442ec848bc79965de3aa529b9a1d; durable gate gate-1
  • Base unchanged since verification: main remains at 0f03814.
  • CI expected: Homeboy CI after push
  • Candidate adoption provenance: the candidate was promoted from the recorded Cook task execution.
  • Cook deterministic verification: 1 gate(s) completed green.
  • Durable run execution: Succeeded
  • Reviewer-resolvable evidence from source_refs[0]: fix: parent run_result inlines full child envelopes → multi-MB engine_data rejected as oversize #3637
  • Task objective: fix: parent run_result inlines full child envelopes → multi-MB engine_data rejected as oversize #3637
  • Verified candidate scope: 3 changed file(s): inc/Core/RunResultEnvelope.php, tests/Unit/Abilities/Engine/RunFlowAbilityLifecycleTest.php, tests/Unit/Core/RunResultEnvelopeChildSummaryTest.php.
  • Verified finalization base: main at 0f03814
  • deterministic gate passed: sh -c homeboy review test data-machine (Passed)

AI assistance

@chubes4
chubes4 merged commit 0bc3b64 into main Oct 17, 2026
26 checks passed
@chubes4
chubes4 deleted the fix/issue-3637-data-machine branch October 17, 2026 20:48
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.

fix: parent run_result inlines full child envelopes → multi-MB engine_data rejected as oversize

1 participant