Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
864 changes: 434 additions & 430 deletions .github/feature-test-timings.json

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions .github/feature-test-timings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Feature shard weights

`feature-test-timings.json` contains balancing hints in seconds. It does not select or exclude tests. The shard verifier still requires every discovered feature file exactly once, and each backend retains its existing process limit and required coverage reports. Reports that contain only declared backend skips receive a positive scheduling floor of 0.001 seconds.

The November 17 refresh uses the per-file JUnit timings from accepted main [build 44004967899](https://github.com/durable-workflow/workflow/actions/runs/44004967899) at `7b2e41eedd17137e6acdbeb83292e73b100f7fc4`. PostgreSQL entries with a complete newer report use [build 44017266532](https://github.com/durable-workflow/workflow/actions/runs/44017266532) at `569eb03bb385c490b80d1614b53cdd5433dfa346` instead. Its PostgreSQL shard 5 reached the 20-minute limit without a complete JUnit report, so those existing files retain the accepted-main measurements.

The new Order billing-period class measured **284.935660 seconds on MySQL** in build 44017266532. Its **427.403490-second PostgreSQL weight is a provisional estimate**, 1.5 times that MySQL measurement, pending a complete PostgreSQL report. It replaces the one-second unprofiled-file fallback; it is not a measured PostgreSQL duration. Refresh that entry from the next successful PostgreSQL report.
16 changes: 16 additions & 0 deletions examples/configured-state-machines/providers/Journal.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,22 @@ public function timedLookup(Request $request): TimedObservation
});
}

/**
* Admission of the optional timing capability; reads schema metadata without observing a business operation.
*/
public function requireEffectTimeSupport(): void
{
if (! $this->captureEffectTimes) {
throw new LogicException('The provider did not admit original effect timestamps.');
}
$this->transaction(function (): void {
$this->query(
'SELECT operation_id, fingerprint, effect_id, confirmed_at FROM provider_effect_times LIMIT 0',
[]
);
});
}

/**
* Explicit optional provider support; install() keeps the original four-table fixtures unchanged.
*/
Expand Down
5 changes: 5 additions & 0 deletions examples/provider-state-machines/Authority.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
{
public CartPolicy $cart;

public OrderPeriodPolicy $periods;

/**
* @param list<string> $subjects Canonical OrderTerms::subjectKey() grants.
*/
Expand All @@ -32,6 +34,7 @@ public function __construct(
private array $subjects,
private array $recipes = [],
array $cartPurchases = [],
array $orderPeriods = [],
) {
PortableDescriptor::identifier($principal, 'authenticated principal');
if (! array_is_list($subjects)) {
Expand Down Expand Up @@ -59,6 +62,7 @@ public function __construct(
}
}
$this->cart = new CartPolicy($this, $cartPurchases);
$this->periods = new OrderPeriodPolicy($this, $orderPeriods);
}

public function recipe(string $key): string
Expand All @@ -76,6 +80,7 @@ public function grantFor(string $key, string $role): string
return hash(
'sha256',
BindingPlan::versionFor($this->recipe($key)) . ($this->cart->selected($key) ? '.cart-v1' : '')
. $this->periods->version($key)
. ':' . $this->profile($key, $role)->fingerprint()
);
}
Expand Down
27 changes: 23 additions & 4 deletions examples/provider-state-machines/MachineStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,13 @@
public function __construct(
public Authority $authority,
private ?IncomingPaymentProvider $incoming = null,
private ?CodPaymentProvider $cod = null
private ?CodPaymentProvider $cod = null,
private ?OrderBillingPeriodStore $periods = null,
) {
if (($authority->periods->grants() !== [] && $periods === null)
|| ($periods !== null && $periods->authority !== $authority)) {
throw new LogicException('Order-period workers must retain their original policy and admission assembly.');
}
}

public static function configure(
Expand All @@ -53,8 +58,12 @@ public static function configure(
'Native COD requires the same original provider and atomic physical carrier contract.'
);
}
$store = new self($authority, $incoming, $cod);
$periods = $authority->periods->grants() === [] ? null : new OrderBillingPeriodStore($authority, $provider);
$store = new self($authority, $incoming, $cod, $periods);
$app->instance(self::class, $store);
if ($periods !== null) {
$app->instance(OrderBillingPeriodStore::class, $periods);
}
$app->instance(CartStore::class, new CartStore($authority, $provider, $incoming));
$app->instance(AssessmentStore::class, new AssessmentStore($authority, $provider));
$financial = new FinancialAuthority($authority);
Expand Down Expand Up @@ -166,6 +175,7 @@ public function seed(OrderTerms $terms, ?CartPlan $cart = null): void
'root_run' => null,
]);
$this->createSubject($key, 'order', false);
$this->periods?->seedRow($terms);
if ($cart !== null) {
app(CartStore::class)->seedRow($terms, $cart, hash('sha256', $payload));
}
Expand All @@ -187,6 +197,7 @@ public function initialize(WorkflowRun $actual, array $arguments): array
throw new LogicException('The native initialization has no authorized business subject.');
}
$this->authority->authorize($key, $this->authority->principal);
$this->periods?->assertActor($actual, $key);
[$assignment, $terms] = $this->authority->assignment($key);
$root = $this->authority->subject($key, 'order');
$plan = $role === 'order' ? $this->rootPlan($actual, $args, $key, $assignment, $terms)
Expand Down Expand Up @@ -383,6 +394,7 @@ private function handlers(
$authority = $this->authority;
$incoming = $this->incoming;
$cod = $this->cod;
$periods = $this->periods;
$handlers = [
'provider.owner' => [
'1' => new OwnerOperation($authority),
Expand All @@ -391,20 +403,27 @@ private function handlers(
'1' => new RetainedOperation($provider, static function (
OperationContext $context,
string $operation,
) use ($authority, $funding): void {
) use ($authority, $funding, $periods): void {
$key = explode('.', $context->scope->key)[0];
if (FundingCatalogue::selected($authority->recipe($key))) {
$funding->effect($context, $operation);
} else {
$authority->authorizeOperation($context, $operation);
}
$periods?->authorizeEffect($context, $operation);
}),
],
'provider.cart' => [
'1' => new CartLeaseOperation($provider, app(CartStore::class)->operation(...)),
],
'provider.shipment.full' => [
'1' => new ShipmentOperation($provider, $physical->operation(...)),
'1' => new ShipmentOperation($provider, static function (
OperationContext $context,
string $mode,
) use ($physical, $periods): void {
$physical->operation($context, $mode);
$periods?->authorizeEffect($context, $mode);
}),
],
];
if ($incoming !== null) {
Expand Down
Loading
Loading