Split 2 of 7: episode and campaign data model - #1793
Draft
martien-wdy wants to merge 1 commit into
Draft
Conversation
Adds the on-device episode store, its manifest model and the campaign description that selects what a device records. Nothing imports the package yet; the capture, upload and tooling chunks build on it. Part 2 of 7 in the split of the Wendy Data Platform change.
| if e != nil { | ||
| return e | ||
| } | ||
| defer f.Close() |
Joannis
marked this pull request as draft
August 27, 2026 18:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
See chunk 1 for why pull request #1751 is being split. This is chunk 2 of 7.
Cause
A device that records sensor data needs a durable on-device representation of what it recorded, when, and under what uncertainty, before anything can capture into it or upload out of it.
Solution
Adds the episode and campaign data model:
Managerowns the on-device episode store, including its quota and eviction policy, so a device that records more than its data partition can hold evicts oldest first rather than filling the filesystem.model.goandmodel_io.godefine the episode manifest and its atomic read and write path, including recovery from a manifest interrupted mid write.campaign.godefines the campaign: the description of what a device should record, which sources it resolves to, and the health checks that refuse a campaign naming an unhealthy source rather than silently recording nothing.clock_linux.goandclock_other.gobracket agent receipts onCLOCK_BOOTTIMEand sample the monotonic mapping, using the timeline from chunk 1.Two campaign examples move in with this chunk rather than with the rest of the examples in chunk 7, because the package's tests parse them as fixtures and would otherwise fail here. See the seam note at the end.
Deliberately left to later chunks
Nothing imports this package yet. The agent side DataService that writes into it arrives in chunk 5, the uploader that drains it in chunk 6, and the command line tools that read it in chunk 7.
Depends on
Chunk 1 (
split/1-timeline), which this pull request is based on.Verification
CC=/usr/bin/clang go build ./...succeeds.CC=/usr/bin/clang go test ./go/internal/agent/data/...passes.gofmt -l go/is empty andgo vet ./go/internal/agent/data/...is clean.Seam note
Examples/WendyDataCampaign/campaign.yamlandExamples/WendyDataModelApp/campaign.yamlwere moved forward from chunk 7 into this chunk.campaign_audio_test.goandexample_campaign_test.goread them as fixtures, and four of the five tests incampaign_audio_test.goare ordinary unit tests unrelated to the fixtures. Moving the two small YAML Ain't Markup Language (YAML) files forward keeps all of that coverage in the chunk that owns the code; moving the test files back to chunk 7 instead would have dropped it.