@defrex/autobuild 1.18.0 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,14 +9,15 @@ import release6 from './1.15.0.json'
9
9
  import release7 from './1.16.0.json'
10
10
  import release8 from './1.17.0.json'
11
11
  import release9 from './1.18.0.json'
12
- import release10 from './1.2.0.json'
13
- import release11 from './1.3.0.json'
14
- import release12 from './1.4.0.json'
15
- import release13 from './1.5.0.json'
16
- import release14 from './1.6.0.json'
17
- import release15 from './1.7.0.json'
18
- import release16 from './1.8.0.json'
19
- import release17 from './1.9.0.json'
12
+ import release10 from './1.19.0.json'
13
+ import release11 from './1.2.0.json'
14
+ import release12 from './1.3.0.json'
15
+ import release13 from './1.4.0.json'
16
+ import release14 from './1.5.0.json'
17
+ import release15 from './1.6.0.json'
18
+ import release16 from './1.7.0.json'
19
+ import release17 from './1.8.0.json'
20
+ import release18 from './1.9.0.json'
20
21
  import type { ReducerValueCatalog } from '../../reducer-value-validation'
21
22
  export interface ReleasedReducerValues extends ReducerValueCatalog {
22
23
  versions: Record<string, number>
@@ -32,12 +33,13 @@ export const RELEASED_REDUCER_VALUES: Readonly<Record<string, ReleasedReducerVal
32
33
  '1.16.0.json': release7,
33
34
  '1.17.0.json': release8,
34
35
  '1.18.0.json': release9,
35
- '1.2.0.json': release10,
36
- '1.3.0.json': release11,
37
- '1.4.0.json': release12,
38
- '1.5.0.json': release13,
39
- '1.6.0.json': release14,
40
- '1.7.0.json': release15,
41
- '1.8.0.json': release16,
42
- '1.9.0.json': release17,
36
+ '1.19.0.json': release10,
37
+ '1.2.0.json': release11,
38
+ '1.3.0.json': release12,
39
+ '1.4.0.json': release13,
40
+ '1.5.0.json': release14,
41
+ '1.6.0.json': release15,
42
+ '1.7.0.json': release16,
43
+ '1.8.0.json': release17,
44
+ '1.9.0.json': release18,
43
45
  }
@@ -5988,8 +5988,40 @@ export async function headPathsLandingReadBudget(opts: {
5988
5988
  * after the first warm-up: exactly one `pr.checks-failed` is recorded and
5989
5989
  * an unchanged red head then costs the poll no extra store request. */
5990
5990
  failingChecks?: { set: (checks: import('../ports/types').HeadChecks) => void }
5991
+ /** Seeds an ended execution: `quiet` closed every session, `session` left
5992
+ * a finished verify session open. Warm-up settles that session in place
5993
+ * exactly once; afterwards both cost the poll the same. */
5994
+ endedExecution?: 'quiet' | 'session'
5991
5995
  }) {
5992
5996
  const { store, repo, slug } = opts
5997
+ if (opts.endedExecution) {
5998
+ const execution = { provider: 'fake', workspaceRef: 'budget', instance: 'budget-runner' }
5999
+ await store.append(slug, { actor: DISPATCHER, type: 'execution.started', payload: execution })
6000
+ if (opts.endedExecution === 'session')
6001
+ await store.append(slug, {
6002
+ actor: KERNEL,
6003
+ type: 'session.started',
6004
+ payload: {
6005
+ session: 'budget-verify',
6006
+ role: 'verify-e2e',
6007
+ runner: 'scripted',
6008
+ phase: 'verify:e2e',
6009
+ round: 1,
6010
+ },
6011
+ })
6012
+ await store.append(slug, {
6013
+ actor: DISPATCHER,
6014
+ type: 'execution.ended',
6015
+ payload: { instance: 'budget-runner', workspaceRef: 'budget', outcome: 'completed' },
6016
+ })
6017
+ }
6018
+ const settledSessions = async () =>
6019
+ (await store.getEvents(slug)).filter(
6020
+ (event) =>
6021
+ event.type === 'session.ended' &&
6022
+ 'outcome' in event.payload &&
6023
+ event.payload.session === 'budget-verify',
6024
+ ).length
5993
6025
  const ciFailures = async () =>
5994
6026
  (await store.getEvents(slug)).filter((event) => event.type === 'pr.checks-failed').length
5995
6027
  /** The commands that derive a head's path facts. */
@@ -6030,6 +6062,10 @@ export async function headPathsLandingReadBudget(opts: {
6030
6062
  }
6031
6063
  expect(await ciFailures()).toBe(1)
6032
6064
  }
6065
+ if (opts.endedExecution) {
6066
+ expect(await settledSessions()).toBe(opts.endedExecution === 'session' ? 1 : 0)
6067
+ expect((await readBuildFacts(store, slug)).value.state.sessions.open).toEqual([])
6068
+ }
6033
6069
  if (opts.warm) {
6034
6070
  const landing = (await store.getEvents(slug)).filter(
6035
6071
  (event) => event.type === 'landing.decided' || event.type === 'landing.deferred',
@@ -185,7 +185,8 @@ spec → plan ⇄ plan-review → implement ⇄ code-review → verify:* → fin
185
185
  - **`verify:*`** — ordered stages, each containing one or more step phases.
186
186
  Members run concurrently and the next stage waits for every pass or skip.
187
187
  Normal transitions drain agent session settlement before stage-local shutdown;
188
- parent shutdown and session budgets remain active.
188
+ parent shutdown and session budgets remain active. A member's session is
189
+ ended once its step has an outcome, before the next stage or finalize.
189
190
  A failed stage sends every failed report to `implement` after its siblings
190
191
  settle; an optional `failFast` failure cancels unfinished siblings.
191
192
  - **`finalize`** — the agent writes the PR description; the kernel opens the
@@ -1065,7 +1066,9 @@ relaunch cost but prevent cancelled descendants from writing during implement.
1065
1066
  Restart reruns only members without outcomes, keeping the same attempt and every
1066
1067
  recorded outcome. One failed cycle spends one verify-attempt unit.
1067
1068
  On normal transitions, terminal-reached agent turns finish their trailing artifacts,
1068
- transcript and session settlement before stage-local interruption. Fail-fast and
1069
+ transcript and session settlement before stage-local interruption. A member's
1070
+ session is ended once its step has an outcome, before the next stage or finalize
1071
+ starts — `reclaimed` when the adapter yields no transcript. Fail-fast and
1069
1072
  actual execution shutdown still interrupt promptly; session budgets remain enforced.
1070
1073
 
1071
1074
  `verify.stage-failed` is the decisive full-feedback receipt. The legacy
@@ -3520,12 +3523,23 @@ Recovery retries an unaccepted attempt using its inherited handle. Suspended
3520
3523
  sessions reject old credentials permanently. `session.resume-fallback` records
3521
3524
  why native continuation could not be used (including remote workspaces), then
3522
3525
  ordinary fresh-session recovery applies. Unrelated open sessions are reclaimed
3523
- without inventing transcripts. A running, unblocked, unpaused build with no live
3524
- execution or lease and an eligible open bracket is actionable cleanup even when
3525
- the engine waits on a PR. The next admitted sweep attaches through ordinary
3526
- reclamation; live provider executions, intentionally suspended sessions and idle
3527
- collecting nodes are excluded. Ended healthy workspaces are reused; lost ones
3528
- follow fenced recovery. Detection reads reduced facts, never historical events.
3526
+ without inventing transcripts. An execution that ends never leaves its sessions
3527
+ open: with no execution open and no live lease, the dispatcher settles every
3528
+ open session in place at its next sweep or janitor visit, without a runner,
3529
+ including on a paused, blocked or aborted build. A done or aborted build, or
3530
+ one with an abort pending, resumes nothing, so every such session is ended
3531
+ `reclaimed`. Otherwise an unfinished occurrence with a native
3532
+ handle — the one the engine runs next, or one with no terminal yet while a
3533
+ pause or escalation holds the build — is suspended (`shutdown`, naming the
3534
+ ended execution) and resumes as a runner loss; every other open session is
3535
+ ended `reclaimed`. A session left
3536
+ open by an ended execution therefore never holds a landing decision. A running,
3537
+ unblocked, unpaused build with an open bracket and no recorded execution is
3538
+ still actionable cleanup even when the engine waits on a PR: the next admitted
3539
+ sweep attaches through ordinary reclamation. Live provider executions,
3540
+ intentionally suspended sessions and idle collecting nodes are excluded. Ended
3541
+ healthy workspaces are reused; lost ones follow fenced recovery. Detection reads
3542
+ reduced facts, never historical events.
3529
3543
  Dashboard history shows suspended and resumed
3530
3544
  segments separately, with their individual transcript refs and usage.
3531
3545
 
@@ -3943,8 +3957,8 @@ status, lease health, routing, or recovery.
3943
3957
  | Lease | Meaning |
3944
3958
  |---|---|
3945
3959
  | `held` | A runner holds an unexpired lease. The runner is live; inspect `PROGRESS` to see when it last wrote a durable fact. |
3946
- | `expired` | The lease ran out; ownership is stale. A provider-proved live execution is left alone. `running` + `expired` is the **stale** case: the status is not lying, it simply has no "runner died" fact to record. Re-attachment depends on the current engine decision: the lease sweep re-attaches actionable runner work, including eligible orphaned open-session cleanup on an engine wait, while a merged or closed PR awaits repository-level completion with no runner re-attachment pending. |
3947
- | `no-lease` | **Not necessarily dead.** A build that has not yet claimed its first lease reads this way, and the lease sweep deliberately grants an absent lease a first-claim grace window before acting. Proved-ended executions with pending engine work or eligible orphaned bracket cleanup bypass that grace; live leases still win. A freshly launched build is the common case — read it together with progress, not alone. |
3960
+ | `expired` | The lease ran out; ownership is stale. A provider-proved live execution is left alone. `running` + `expired` is the **stale** case: the status is not lying, it simply has no "runner died" fact to record. Re-attachment depends on the current engine decision: the lease sweep re-attaches actionable runner work, while open sessions of an ended execution are settled in place without a runner, and a merged or closed PR awaits repository-level completion with no runner re-attachment pending. |
3961
+ | `no-lease` | **Not necessarily dead.** A build that has not yet claimed its first lease reads this way, and the lease sweep deliberately grants an absent lease a first-claim grace window before acting. Proved-ended executions with pending engine work or open sessions bypass that grace, and those sessions are settled in place; live leases still win. A freshly launched build is the common case — read it together with progress, not alone. |
3948
3962
 
3949
3963
  So `running` + `held` confirms liveness, while its progress age says whether
3950
3964
  the durable log is moving. For `running` + `expired`, inspect the build detail
@@ -4,8 +4,8 @@
4
4
  "build": "ab-hosted-service-build"
5
5
  },
6
6
  "dependencies": {
7
- "@defrex/autobuild-hosted-store-service": "1.18.0",
8
- "@defrex/autobuild": "1.18.0",
7
+ "@defrex/autobuild-hosted-store-service": "1.19.0",
8
+ "@defrex/autobuild": "1.19.0",
9
9
  "next": "16.1.6",
10
10
  "react": "19.2.4",
11
11
  "react-dom": "19.2.4"