Skip to content

Commit 65fc33f

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-g9042w
2 parents 9907636 + 8dbb4a1 commit 65fc33f

51 files changed

Lines changed: 3470 additions & 316 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/cli': patch
3+
---
4+
5+
feat(cli): `os validate --target <environment URL>` fetches the target environment's restriction profile
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`os validate --target` now also takes an environment's `http://` or `https://` URL. The command fetches `GET /api/v1/discovery/restriction-profile` at that URL's origin (the route a hosted environment publishes its profile at), reads the `{ success, data }` body and parses `data` with `RestrictionProfileSchema`, the same parse the file form uses, so a fetched profile judges the stack exactly as the same profile saved to a file.
11+
12+
Every failure is refused and names the URL fetched: an environment that cannot be reached or does not answer within 15 seconds, any non-2xx answer (a `404 RESOURCE_NOT_FOUND` means no environment is served at that host), a body that is not JSON or not the `{ success: true, data }` envelope, and a profile the schema rejects. None of them is ever judged as "no restriction". A URL with any other scheme is refused before anything is fetched. The file form is unchanged.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@objectstack/service-automation': patch
3+
---
4+
5+
feat(service-automation)!: the flow index and the activation ledger consult on (package, name), through the one package-scoped resolver (ADR-0150 D3/D4)
6+
7+
Clause-②: no (narrowing) — a `subflow` or `map` node inside a packaged flow names its child by a bare name, and that name now resolves from the package that ships the flow (ADR-0150 D3): its own flow, else the one holder in its declared dependency closure (plus `sys`), else a refusal naming every candidate. Three cases that run today are refused: a name only an environment-authored flow holds (D3 (a)); a name only a package outside the caller's declared closure holds (D3 step 3); and a flow name two packages hold, which only a deployment sealed with a clash that predates phase 1 reaches (#31677 Q1, ruled A). No door, request or response shape, error code or status changes. One answer moves the other way, in a sealed clash only: an activation row of package Q, which still holds the flow name beside package P, no longer switches off P's same-named flow (below).
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped, and no export of the package root is removed or retyped; one type (FlowNameResolver) and one engine method (setFlowNameResolver) are added. The refusal is a run result naming the candidates, with no stored shape for a migration to rewrite and no tombstone. -->
11+
12+
**BREAKING** for a packaged flow whose `subflow` or `map` node names a flow its package cannot reach: one authored in the environment, or one shipped by a package it does not declare a dependency on. Measured first-party: 0 (every `subflow` / `map` `flowName` in this repository names a flow of its own package).
13+
14+
- **Before.** The engine looked the child up by its bare name alone, whoever held it.
15+
- **Now.** The child resolves from the calling flow's package through `resolvePackageScopedName` (`@objectstack/objectql`). A refused call fails the node with the resolver's sentence, which names every holder and the remedy; the child never runs.
16+
- **Unchanged.** A child the calling package holds, or that one package in its declared closure holds, runs as before. A door, a trigger or any caller outside a run resolves environment-wide, so every bare name with one holder answers as before. A flow the registry knows nothing of (registered straight into the engine) has one holder and runs as before. An engine with no ObjectQL registry answers as before.
17+
- **Also.** The activation ledger's projection is keyed by `(package, name)`. The row of the package that ships the name decides for it, in either state. A row of another package that still holds a flow of that name keys only that package's flow, so it no longer switches the shipping package's flow off; only a deployment sealed with a pre-phase-1 clash has two such holders. A stale row, one whose package no longer holds the name, still switches the name off as before, and the engine now warns once naming both packages and the remedy: switch the flow again, which writes the shipping package's own row. A row that names no package, or any row when the engine cannot tell which package ships the name, switches the name off as before.
18+
- **Also, a name two packages hold.** It is refused at registration, naming both, instead of arming the lexicographically first package's flow, and a run of it is refused the same way. Phase 1 refuses a second holder at install, so only a deployment that held the clash before phase 1 reaches this: its cold boot still seals with a warning (`BARE_NAME_COLD_BOOT_MODE = 'warn'`), and now neither flow is armed; the boot log names both. Measured first-party: 0 (across every boot of the dogfood battery, the cold boot's bare-name warning names one flow, the QA fixture's `qa_shared_flow`). The remedy is the warning's: rename one of the two flows.
19+
20+
**The remedy.** Declare a dependency on the package that ships the child (ADR-0141), or ship the child in the calling package. For an environment-authored child, move it into a package the caller depends on.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/objectql': patch
3+
'@objectstack/runtime': patch
4+
---
5+
6+
feat(objectql, runtime): the action engine keeps each package's handler under one object and action name (ADR-0150 D4)
7+
8+
Clause-②: no (narrowing)
9+
Metadata-protocol: none
10+
11+
<!-- adr-0087: not-required (no-migration-prescription) nothing is retired or renamed and no stored or authored shape changes: the new package-keyed resolution is reached only by a caller that names its package, which no door does yet, so there is nothing for `objectstack migrate meta` to rewrite -->
12+
13+
Two packages can now each register a handler for the same object and action name, and both are kept. `ObjectQL#executeAction(objectName, actionName, ctx, { packageId })` runs that package's own handler. With no `packageId` it runs exactly what it ran before: the last registration under `OBJECT:NAME`, with the replacement still warned and naming both packages.
14+
15+
The router (`resolveRouteActionDeclaration`) takes an optional `callerPackageId`. Given one, it resolves the bare action name through the package-scoped resolver (ADR-0150 D3) over the `action` items that belong to the routed object: the caller's own declaration first, then the one holder in its declared closure. Two holders in the closure, or a holder outside it (another package, or an environment-authored action), is refused with every candidate named, and the `/actions` door answers 409 `RESOURCE_CONFLICT`. No door passes a caller's package yet, so every request today resolves and runs exactly as before.
16+
17+
New exports from `@objectstack/objectql`: `resolveActionByPackage`, `actionOwnerScopedRegistry`, `actionHolderCoordinate`, `actionHandlerCoordinate`, `ENVIRONMENT_ACTION_COORDINATE`, and the types `ActionPackageQuery` and `ExecuteActionOptions`.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/objectql': patch
3+
'@objectstack/driver-sql': patch
4+
'@objectstack/cli': patch
5+
---
6+
7+
fix(objectql): a server boot's schema sync takes the same schema-migration lock as `os migrate apply`, so replicas starting together create each table once
8+
9+
Clause-②: no
10+
Metadata-protocol: none
11+
12+
Several servers booting against one Postgres or MySQL database at the same time (replicas of one deployment, or several `OS_MIGRATE_AND_EXIT=1` jobs) each read the same missing tables and each created them. Postgres then refused one of the duplicate `CREATE TABLE` statements with a `pg_type` unique-key collision, and the boot that lost logged `Schema sync FAILED` for that object while still exiting 0. The boot's schema sync now takes the schema-migration lock that `os migrate apply` takes (one name, `objectstack:schema-migrate`, and one Postgres key), on the default datasource's database, and releases it as soon as the sync is done. It is never held while the server runs. A boot that finds another migration running prints one line saying it waits, then finds the tables already there.
13+
14+
On a single node nothing changes: the lock is uncontended and prints nothing, and SQLite (with Turso and WASM SQLite) takes no lock at all: the lock reads the dialect from the driver's `dialectName` and never asks a SQLite-dialect driver for its Knex, so a remote Turso transport, which refuses to hand its Knex out, boots as before. A boot with `skipSchemaSync` / `OS_SKIP_SCHEMA_SYNC=1` takes none either, since it runs no DDL. A waiting boot gives up after half of the engine plugin's start budget (60 s by default), changes nothing and fails the boot with a message naming the lock; start it again once the other migration has finished.
15+
16+
The lock now lives in `@objectstack/objectql` (`acquireSchemaMigrationLock`, `SCHEMA_MIGRATION_LOCK_NAME`), so the engine's boot can take it; `@objectstack/cli` keeps importing it from there. `SqlDriver` gains a read-only `schemaDdlDeferred` getter, which tells the engine's boot that `os migrate plan` / `apply` is holding the driver's DDL back and will take the lock itself.

‎.github/workflows/ci.yml‎

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,8 +1041,24 @@ jobs:
10411041
# simply never created. The literal after `||` is the full roster, read
10421042
# when the plan job published nothing (it died or timed out), and the gate
10431043
# reads this same expression, so the two cannot count different rosters.
1044+
#
1045+
# ⭐ FAIL-FAST IN THE MERGE QUEUE ONLY (#31517, ruling record 6730013883).
1046+
# On a `merge_group` run the first shard to go red cancels its siblings,
1047+
# so `Test Core` reads red when that shard ends instead of when the
1048+
# slowest shard ends, and the queue ejects the entry and rebuilds the
1049+
# entries behind it that much sooner. On every other event the
1050+
# expression is false and every shard runs to its end: the pull_request
1051+
# run is where an author reads every red shard in one round (#23177
1052+
# ruling B, item A1, comment 6139629628), and push and schedule runs stay
1053+
# complete. The queue is the exception because its job is a fast
1054+
# mergeable-or-not answer, and the PR run of the same diff already
1055+
# showed every red. It is the matrix's own `fail-fast`, ⛔ never a
1056+
# run-level cancel: a real red dominates the matrix result (`failure`,
1057+
# never `cancelled`, measured on run 30271824408, a fail-fast matrix),
1058+
# and `Test Core` reads `failure` as a veto, whereas a matrix cancelled
1059+
# with zero attestations passes its aggregate (#3668).
10441060
strategy:
1045-
fail-fast: false
1061+
fail-fast: ${{ github.event_name == 'merge_group' }}
10461062
matrix:
10471063
shard: ${{ fromJSON(needs.test-plan.outputs.shards || '[1, 2, 3, 4, 5, 6, 7, 8]') }}
10481064

@@ -1580,6 +1596,11 @@ jobs:
15801596
# non-zero exit, and the step exits with it, so the shard is red
15811597
# exactly when it was before — and now names every red package of the
15821598
# shard in one run instead of the first one turbo reached.
1599+
# A1 holds inside a shard on every event. Across shards the merge
1600+
# queue is the exception (#31517, ruling record 6730013883): there
1601+
# the matrix is fail-fast, so the first red shard cancels the
1602+
# others, and the queue run names that shard's reds only. The
1603+
# pull_request run of the same diff names every shard's.
15831604
#
15841605
# Measured before this was written: a three-package probe (turbo
15851606
# 2.11.5, `a#test` exits 1, `c` depends on `a`) ran `b` and `c` to
@@ -2716,8 +2737,13 @@ jobs:
27162737
timeout-minutes: 30
27172738
permissions:
27182739
contents: read
2740+
# Fail-fast on `merge_group` only, as on Test Core (#31517, ruling record
2741+
# 6730013883; the reasons are on the `test` job's strategy). Push and
2742+
# schedule, the other events this matrix runs on, run all three shards to
2743+
# their end. A red shard dominates the matrix result over the siblings it
2744+
# cancels, and `Dogfood Regression Gate` reads `failure` as a veto.
27192745
strategy:
2720-
fail-fast: false
2746+
fail-fast: ${{ github.event_name == 'merge_group' }}
27212747
matrix:
27222748
shard: [1, 2, 3]
27232749

@@ -3083,7 +3109,11 @@ jobs:
30833109
# 30271824408, a fail-fast matrix with one real failure + one cancelled
30843110
# sibling): a real shard failure DOMINATES the aggregate — it reads
30853111
# "failure", never "cancelled" — so passing `cancelled` masks no
3086-
# regression. That dominance is what does NOT hold for `abandoned`, which
3112+
# regression. That run is the merge queue's own shape since #31517: the
3113+
# dogfood matrix is fail-fast on `merge_group`, and the sibling a red
3114+
# shard cancels records "The strategy configuration was canceled
3115+
# because …" on its check run, which the cause read classifies as no
3116+
# supersession: a partially attested matrix it cut short reads red. That dominance is what does NOT hold for `abandoned`, which
30873117
# is why `abandoned` gets counting rather than a place in a word list.
30883118
name: Dogfood Regression Gate
30893119
needs: [dogfood, dogfood-verify, filter, queue-verdict]
@@ -4147,8 +4177,15 @@ jobs:
41474177
timeout-minutes: 30
41484178
permissions:
41494179
contents: read
4180+
# Fail-fast on `merge_group` only, as on Test Core (#31517, ruling record
4181+
# 6730013883; the reasons are on the `test` job's strategy). Every other
4182+
# event runs all sixteen shards to their end. The `Test UI` aggregate
4183+
# passes only `success` or a skip `filter` explains, so the matrix of a
4184+
# red shard and the siblings it cancelled reads red there. A fail-fast queue run is red, so a push never
4185+
# borrows it: `queue-verdict` takes only a `success` queue run, and
4186+
# `ui_full_green` counts only shards that concluded `success`.
41504187
strategy:
4151-
fail-fast: false
4188+
fail-fast: ${{ github.event_name == 'merge_group' }}
41524189
matrix:
41534190
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
41544191

@@ -4373,7 +4410,9 @@ jobs:
43734410
# That is #4928's skipped-only-when-filter-succeeded guard, and it makes a
43744411
# queue build or PR that touches no ui path read green here the way Lint
43754412
# UI and Build & E2E UI read `skipped` there. Everything else is red:
4376-
# `failure`; `cancelled`, which is also what a shard killed by its own
4413+
# `failure`, which is also what the matrix reads when a red shard on a
4414+
# `merge_group` run cancelled its siblings by fail-fast (#31517);
4415+
# `cancelled`, which is also what a shard killed by its own
43774416
# `timeout-minutes` reads (on a superseded push this paints the OLD sha
43784417
# red, which no required check reads); a `skipped` that `filter` does not
43794418
# explain; and any lifecycle value such as the `abandoned` test-gate met

0 commit comments

Comments
 (0)