Phase 11: decisions from the numbers only, outside rules measured in the shadow
ci / test (postgres) (push) Successful in 5m56s
ci / test (sqlite) (push) Successful in 5m5s
ci / test (postgres) (pull_request) Successful in 5m36s
ci / test (sqlite) (pull_request) Successful in 4m52s
ci / image (push) Successful in 2m6s
ci / image (pull_request) Successful in 52s
ci / test (postgres) (push) Successful in 5m56s
ci / test (sqlite) (push) Successful in 5m5s
ci / test (postgres) (pull_request) Successful in 5m36s
ci / test (sqlite) (pull_request) Successful in 4m52s
ci / image (push) Successful in 2m6s
ci / image (pull_request) Successful in 52s
News, the economic calendar and earnings dates no longer change any decision by default (ADR 0023). A new switch, decisions.external_rules, chooses between "misurate" (default) and "attive" (the Phase 7 behaviour); ADR 0027 records every choice. - Engine: with "misurate" nothing is held, postponed or kept, no diary or note is written and equity_meanrev gets no earnings dates. The gate is still asked, per rule and with all rows on, to write one shadow case per rule, strategy, instrument and day. The switch is read once per decision; the one-step check and the release of a planned order read it as it was when the decision ran. - Shadow: five rules measured with the existing improvement machinery, 99% interval, "too early" under six months, the ADR 0023 criterion; the earnings exit is measured by relabelling with the report date. Shown in the Laboratorio and in the quarterly review beside the historical restriction balance. - Model: the seven outside clues stay out of training; a champion that uses one is set aside at once, without an alarm, and Sunday trains one without them. - Settings: the switch changes only from the settings form, with the protections of the five rows; the API refuses it; each change writes one diary line. The first start of this version records "attive" until then on an installation that had already decided. - Screens, demo and manual follow "misurate". Two independent review rounds; their confirmed findings are fixed and tested. SQLite, PostgreSQL and the image with the guard drill are green. refs #116, refs #117 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ed22d1c8b5
commit
501c9be70e
47 files changed
+1743
-169
No files matched your search
@@ -17,9 +17,26 @@ public sealed class DatabaseTests
|
||||
{
|
||||
var test = await TestDb.CreateAsync().ConfigureAwait(false);
|
||||
await Migrations.MigrateAsync(test.Db, _clock, null, CancellationToken.None).ConfigureAwait(false);
|
||||
|
||||
// The rules of the news act in the tests of Phase 7 (ADR 0027 point 3): set here, without a change in the log. A
|
||||
// test of «misurate» asks for it.
|
||||
await test.Db.WriteAsync(s => s.ExecuteAsync("INSERT INTO config (id, key, value, created_at, updated_at) VALUES (@id, @k, @v, @t, @t)", CancellationToken.None,
|
||||
("id", Ids.NewId(_clock)), ("k", News.ExternalRules.Setting.Key), ("v", new DbJson(System.Text.Json.JsonSerializer.Serialize(News.ExternalRules.Active))), ("t", _clock.UtcNow)))
|
||||
.ConfigureAwait(false);
|
||||
return test;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Puts the rules of the news back to the default of ADR 0023, «misurate», in a database of <see cref="MigratedAsync"/>;
|
||||
/// <paramref name="since"/> is when the switch was written, as on a new installation.
|
||||
/// </summary>
|
||||
internal static Task MeasuredAsync(Database db, DateTimeOffset? since = null) =>
|
||||
db.WriteAsync(s => since is { } at
|
||||
? s.ExecuteAsync("UPDATE config SET value = @v, created_at = @t, updated_at = @t WHERE key = @k", CancellationToken.None,
|
||||
("k", News.ExternalRules.Setting.Key), ("v", new DbJson(System.Text.Json.JsonSerializer.Serialize(News.ExternalRules.Measured))), ("t", at))
|
||||
: s.ExecuteAsync("UPDATE config SET value = @v WHERE key = @k", CancellationToken.None,
|
||||
("k", News.ExternalRules.Setting.Key), ("v", new DbJson(System.Text.Json.JsonSerializer.Serialize(News.ExternalRules.Measured)))));
|
||||
|
||||
[TestMethod]
|
||||
[TestCategory(Category.Integration)]
|
||||
public async Task MigrationsCreateTheSchemaAndRunOnce()
|
||||
|
||||
Reference in new issue
Block a user