Skip to content

feat(entity,storage): rework speculation tree model and store#231

Draft
behinddwalls wants to merge 1 commit into
preetam/ext/speculation-rfcfrom
preetam/ext/speculation-store
Draft

feat(entity,storage): rework speculation tree model and store#231
behinddwalls wants to merge 1 commit into
preetam/ext/speculation-rfcfrom
preetam/ext/speculation-store

Conversation

@behinddwalls

@behinddwalls behinddwalls commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Reshape the speculation tree data model around the Base/Head path that the build stage actually consumes, and align its store.

entity: SpeculationPath{Base, Head} becomes the unit; SpeculationPathInfo carries the path plus its enumerator Score, controller-owned Status (candidate/selected/building/passed/failed/cancelled), and BuildID. Adds SpeculationPathAction and SpeculationPathDecision for the selector seam. SpeculationTree.Speculations becomes Paths. The Build entity drops its own local SpeculationPathInfo and uses the shared SpeculationPath (Head = the batch under verification), with the build controller updated to match.

storage: SpeculationTreeStore.UpdateSpeculations(batchID, []SpeculationInfo) becomes Update(ctx, SpeculationTree) — symmetric with Create, keyed by tree.BatchID. MySQL impl and mock updated.

Test Plan

Issues

Stack

  1. docs(rfc): add speculation design #230
  2. @ feat(entity,storage): rework speculation tree model and store #231
  3. feat(speculation): add enumerator and selector extensions #232

Reshape the speculation tree data model around the Base/Head path that the build stage actually consumes, and align its store.

entity: SpeculationPath{Base, Head} becomes the unit; SpeculationPathInfo carries the path plus its enumerator Score, controller-owned Status (candidate/selected/building/passed/failed/cancelled), and BuildID. Adds SpeculationPathAction and SpeculationPathDecision for the selector seam. SpeculationTree.Speculations becomes Paths. The Build entity drops its own local SpeculationPathInfo and uses the shared SpeculationPath (Head = the batch under verification), with the build controller updated to match.

storage: SpeculationTreeStore.UpdateSpeculations(batchID, []SpeculationInfo) becomes Update(ctx, SpeculationTree) — symmetric with Create, keyed by tree.BatchID. MySQL impl and mock updated.
@behinddwalls behinddwalls force-pushed the preetam/ext/speculation-store branch from 927e240 to 6bc8426 Compare June 10, 2026 03:45
@behinddwalls behinddwalls force-pushed the preetam/ext/speculation-rfc branch from 380f0b1 to 3eddc3d Compare June 10, 2026 03:45
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