Final design
Which tests verify concurrency protection and forecast-run completion in the overall architecture?
The final step uses the complete topology from step 6. Inside the boundary: interface → forecast API → time-series revisions, run manifests and comparison versions. Forecast computation reads durable work from this datastore. The measurement source is external. Processing exchanges the domain messages described in the main flow; results reach the interface through the API. The evidence plan for P-33 covers concurrency, retries, boundaries and terminal completion. The table contains expected results of tests yet to be executed.
Starting point Correction permissions are scoped to facilities.
Assumptions for the example case
A fictional example design for a generation facility using fixed 15-minute intervals and separate forecast and measurement versions. Each interval spans 900 seconds, inclusive at the start and exclusive at the end; a measurement at exactly 900 seconds belongs to the next interval. All figures and test targets are illustrative assumptions.
Overall architecture with checks and review loops
Runtime topology
- 1 · Measurement source → Measurement ingestion
- 2 · Measurement ingestion → Time-series datastore
- 3 · Time-series datastore → Forecast computation
- 4 · Forecast computation → Metadata datastore
- 5 · Metadata datastore → Comparison path
- 6 · Comparison path → Energy balance team
Forecasting and comparison system
Each comparison binds forecast version, measurement revision and the same interval.
Test plan for the complete design
| Component | Test and expected result | Return to an earlier step |
|---|---|---|
| Forecast API | Measurement revisions 4 and 5 arrive in both orders. The current actual-value view remains at revision 5; the comparison using revision 4 remains available in history. | Steps 3 and 5 |
| Command journal | Identical retries take effect once; changed content produces a conflict. | Steps 4 and 7 |
| Domain boundary check | Test 899, 900 and 901 seconds. Expected result: an interval spans 900 seconds, inclusive at the start and exclusive at the end; a measurement at exactly 900 seconds starts the next interval. | Step 2 |
| Time-series revisions, run manifests and comparison versions | A new correction to actual measurements does not alter a completed forecast run; it creates a new comparison revision with provenance. | Steps 5 and 9 |
| Forecast computation | Accept a new measurement revision durably, then start a new comparison calculation. A late job using an older measurement revision may update the current comparison reference only after a version check; otherwise its result remains historical. | Steps 6 and 7 |
Forecast API
- Test and expected result
- Measurement revisions 4 and 5 arrive in both orders. The current actual-value view remains at revision 5; the comparison using revision 4 remains available in history.
- Return to an earlier step
- Steps 3 and 5
Command journal
- Test and expected result
- Identical retries take effect once; changed content produces a conflict.
- Return to an earlier step
- Steps 4 and 7
Domain boundary check
- Test and expected result
- Test 899, 900 and 901 seconds. Expected result: an interval spans 900 seconds, inclusive at the start and exclusive at the end; a measurement at exactly 900 seconds starts the next interval.
- Return to an earlier step
- Step 2
Time-series revisions, run manifests and comparison versions
- Test and expected result
- A new correction to actual measurements does not alter a completed forecast run; it creates a new comparison revision with provenance.
- Return to an earlier step
- Steps 5 and 9
Forecast computation
- Test and expected result
- Accept a new measurement revision durably, then start a new comparison calculation. A late job using an older measurement revision may update the current comparison reference only after a version check; otherwise its result remains historical.
- Return to an earlier step
- Steps 6 and 7
First end-to-end test and outstanding evidence
- End-to-end path
- Test an actual-measurement correction after approval end to end. Accept a new measurement revision durably, then start a new comparison calculation. A late job using an older measurement revision may update the current comparison reference only after a version check; otherwise its result remains historical.
- Clarify before extending the scope
- Agree the real measurement-source contract, retention periods, recovery targets and assigned roles. Every limit here is a design assumption. The evidence table describes tests to execute; technical integration, browser checks and comprehension checks with readers follow separately.
Test an actual measurement correction after approval end to end
Test an actual measurement correction after approval end to end.
A corrected measurement arrives after a forecast is finalised. The comparison reflects the correction while preserving the original forecast. Completion requires technical and business evidence.
Measurement revisions 4 and 5 arrive in both orders. The current actual-value view remains at revision 5; the comparison using revision 4 remains available in history. The exercise specifies the input and expected result.
- Alternative considered
- An initial end-to-end path limited to lists and forms postpones the critical state checks.
- Trade-off
- The first end-to-end path needs controlled concurrency and failure points.
- Reassess
- Passing the counterexample tests and checks with readers provides grounds for extending the case.
Try it yourself
Choose two architectural decisions: concurrency protection and evidence-backed completion. For each, name the test, expected result and step to revisit.
A hint for your attempt
Link the markers of the overall architecture with the associated design steps.
Compare with a possible solution
- Concurrency control
- Measurement revisions 4 and 5 arrive in both orders. The current actual-value view remains at revision 5; the comparison using revision 4 remains available in history. Expected invariant: Each comparison identifies the forecast version, measurement revision and matching time interval; later actual measurements do not change historical forecasts. A deviation leads back to step 5 and the command contract in step 4.
- Test completion and retries
- Start with a completed run that has an approved forecast version and a confirmed actual-value comparison. Submit an evidenced new actual revision for the same UTC interval and repeat the correction identically. Expected result: exactly one new comparison revision with provenance; the original forecast and historical completion comparison remain unchanged. Replay returns the same correction record without creating another comparison. Revisit step 9 for responsibility and step 7 for the failure sequence if results differ.
Apply to your project
Which two counterexample tests will you run first in your own end-to-end implementation?
Start your own design
Choose a small case from your project. The template collects the ten design tasks and leaves space for your sketches, decisions, and open assumptions. You can edit it in your text editor or note-taking app.
Download design template (.md)Compare the ten tasks with the example case
Purpose and boundary
Which evidence for a forecast run would originate outside the application in your own project?
In the example: Forecasts and actual measurements retain separate versions. A fictional analysis of a generation facility in fixed 15-minute intervals, with separate forecast and measurement versions.
Requirements
Which rule of your project remains binding even with slow processing?
In the example: Check the time interval and unit before comparison. An interval spans 900 seconds, inclusive at the start and exclusive at the end; a measurement at exactly 900 seconds starts the next interval.
Scale estimates
Which single entity concentrates load more than the daily average when comparing generation and forecasts?
In the example: Interval corrections need a separate load profile. An average of 1.11111 events/s says little about 96 interval corrections for one day at the same facility.
Interfaces
Which input fields make two change intentions different in your project?
In the example: Approval binds the model and input version. The interval, model version, input hash and forecast energy must remain identical on replay.
Data and states
Which states must remain protected in your model against late replay?
In the example: Corrections extend the comparison history. A new correction to actual measurements does not alter a completed forecast run; it creates a new comparison revision with provenance.
Overall architecture
Which planned service boundary would distribute a currently local guarantee across the network?
In the example: Computation jobs use frozen manifests. Time-series revisions, run manifests and comparison versions must express the same valid state.
Critical flow
What feedback could be missing even though the underlying action has already taken place?
In the example: Older jobs must not overwrite current measurement revisions. Each comparison identifies the forecast version, measurement revision and matching time interval; later actual measurements do not change historical forecasts.
Bottlenecks and trade-offs
Which similar display could have two different causes in your project?
In the example: Investigate data gaps before model quality. Large forecast deviations may result from model errors or missing measurement intervals. Completeness, input age and forecast error are considered separately.
Operations and security
Which open state in your project needs a domain specialist as well as technical operations?
In the example: Correction permissions are scoped to facilities. A new correction to actual measurements does not alter a completed forecast run; it creates a new comparison revision with provenance.
Final design
Which two counterexample tests will you run first in your own end-to-end implementation?
In the example: Test an actual measurement correction after approval end to end. Measurement revisions 4 and 5 arrive in both orders. The current actual-value view remains at revision 5; the comparison using revision 4 remains available in history.