Skip to content

Commit 26e2548

Browse files
committed
Merge origin/main into claude/project-thread-3giljf
Claude-Session: https://claude.ai/code/session_01QSeKYm8sWjp2Pk76warN7w Co-authored-by: Claude <noreply@anthropic.com>
2 parents 248d471 + 7d82b2d commit 26e2548

39 files changed

Lines changed: 2044 additions & 126 deletions
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/runtime': patch
3+
---
4+
5+
fix(runtime)!: `dispatchAction` places its call the way the REST door places a scoped request, and its `ai` posture answers the type refusal with the AI door's own sentence
6+
7+
Clause-②: no (narrowing) — on a multi-kernel host whose `kernel-resolver` throws, `dispatchAction` used to run the call on the host kernel and answer what that kernel answered; it now refuses the call with the resolver's status, as the REST door's scoped path does. No host in this repository registers a `kernel-resolver`, so no in-repo composition's answer moves.
8+
Metadata-protocol: none
9+
Skills-docs: none — `skills/**` never teaches `dispatchAction`, its posture or a `kernel-resolver`; `content/docs/ui/actions.mdx` states both changes.
10+
11+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema, no export and no stored shape changes: the host door now runs the dispatcher's own environment-and-kernel step, and one refusal's sentence changes under the ai posture. There is nothing for a migration to rewrite and no tombstone. -->
12+
13+
**BREAKING** only for a multi-kernel host that calls `dispatchAction` and whose `kernel-resolver` can throw: that call is now refused with the resolver's status instead of running on the host kernel. Fix: none needed on the caller's side; a resolver that should place the call must answer the environment's kernel, as it must for `POST /environments/:id/actions/...`.
14+
15+
- **Kernel scope.** `dispatchAction(kernel, { environmentId, … })` now runs the dispatcher's own placement step (the `kernel-resolver` call and scope touch `resolveRequestScope` runs), asked what the scoped request `POST /environments/:environmentId/actions/...` asks: `environmentId` reaches the resolver as the scoped-URL hint, and the resolver, not the host door, writes the environment, as at the REST door. On a multi-kernel host the call therefore runs on the environment's own kernel, exactly as the REST request does. A resolver that throws now refuses the call with the status it carries, instead of the call running on the host kernel. A resolver that reads only a pre-written `environmentId` no longer places host-door calls, as it never placed REST ones. A call the resolver places in no environment runs in the kernel's default environment, as the REST door's does. The route path the host door builds cannot be steered by an object, namespace or action name: no environment hint is derived from it, and each segment is encoded. Pass the kernel your HTTP door is served from (on a multi-kernel host, the one that registers `kernel-resolver`). The host door still runs neither the ADR-0069 authentication-policy gate nor the environment-membership gate, and uses `executionContext` as given: those stay the host's. A host with no `kernel-resolver` answers exactly as before: the call runs on that kernel in the environment `environmentId` names (the scope of its service lookups), or in the default environment when none is named.
16+
- **`ai` posture.** A client-side action or an off-origin `type: 'api'` action is still refused `400` at the same point, but under `posture: 'ai'` (and through MCP `run_action`) the sentence is the AI door's — `Action 'NAME' (type='TYPE') cannot be invoked via MCP` — instead of the REST caller's prescription, which named the action's `target` ("Call TARGET directly"). The `rest` posture and the REST door keep the prescription.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@objectstack/service-job': patch
4+
'@objectstack/runtime': patch
5+
'@objectstack/service-automation': patch
6+
---
7+
8+
feat(sync-in): a pull's run record names the job run that drove it, and why that run started (ADR-0153 D7)
9+
10+
Clause-②: yes (widening)
11+
Metadata-protocol: none
12+
Skills-docs: none — no published skill teaches `JobHandler`'s context, `pullConnectorSource` or `sys_sync_run` today (`git grep` over `skills/` finds none); the hand-written guide this change made incomplete, `content/docs/automation/jobs.mdx` ("Pulling a mapping"), is corrected in the same change
13+
14+
A job's handler is now told which run it is executing, and a sync-in pull keeps that on its `sys_sync_run` row.
15+
16+
- **`JobHandler`'s context** (`@objectstack/spec/contracts`) gains two optional members: `runId`, the job service's run-history id of the attempt, and `trigger`, why the run started — `schedule` for a timer's fire, `manual` for `trigger()` (and `replay()`, which runs through it). The new `JobRunTrigger` type spells the two values. Both are optional: a handler that reads neither, and a job service that sends neither, are unchanged.
17+
- **The shipped job adapters send them** (`@objectstack/service-job`). `CronJobAdapter` and `IntervalJobAdapter` say `schedule` on a scheduled fire and `manual` on `trigger()`. `DbJobAdapter` adds the id of the `sys_job_run` row it wrote for the attempt, so a retried run hands each attempt its own id; with `recordRuns: false` it writes no row and sends no id.
18+
- **A pull job forwards them** (`@objectstack/runtime`): the job binder hands `pullConnectorSource` the run id as `jobRunId` and the trigger, each only as the contract spells it.
19+
- **`ConnectorSourcePullRequest`** (`@objectstack/spec/contracts`) gains optional `jobRunId` and `trigger`.
20+
- **`sys_sync_run` keeps them** (`@objectstack/service-automation`): `job_run_id`, text and not a lookup, so the job ledger's own retention never reaches a pull's history, and `trigger` (`schedule` / `manual`), both written when the run opens, so a pull refused before it reads keeps them too. Both are empty for a pull no job drove. `@objectstack/service-automation` exports the `SyncRunOrigin` type; `SyncRunLedger.open` takes it as an optional third argument.

‎.changeset/32062-sync-in-run-record.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ A pull now keeps a record and a read position. Every call of `IAutomationService
1919
- **One log line per pull**, when it ends: `info` with the counts and the committed position, or `warn` with the refusal and the counts so far.
2020
- **A new refusal reason, `run_record_unavailable`** (`SERVICE_UNAVAILABLE`, 503), in four places. Before any read, so nothing is read: the run row cannot be opened, the run cannot be told what the pull reads, or the position the last run committed cannot be read. Or at a window's end: the position reached cannot be stored, so the windows finished before stay written and the next run reads again from the last position stored. A pull with no run store at all — no data engine, or no manifest service to register the object — runs as before, keeps no position, and says so once at `warn`.
2121
- `@objectstack/service-automation` exports `SysSyncRun`, `ObjectStoreSyncRunLedger`, `closeInterruptedSyncRuns`, `SYNC_RUN_OBJECT`, `SYNC_RUN_INTERRUPTED` and the ledger types; `ConnectorPullDeps` takes an optional `runs` ledger. `@objectstack/spec` lists `sys_sync_run` among `service-automation`'s platform objects (`PLATFORM_OBJECTS_BY_PACKAGE`). `@objectstack/cli`'s organization-ownership inventory gives it a fate (attribution, like `sys_connector_connection`).
22-
- Not recorded yet, each with the slice that can fill it: the job run that drove the pull and its trigger (`schedule` / `manual`), and the marked-deleted and NULL-watermark counts (ADR-0153 D3).
22+
- The job run that drove the pull and its trigger are recorded too, in the same release: see its own entry. Not recorded yet, with the slice that can fill them: the marked-deleted and NULL-watermark counts (ADR-0153 D3).
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@objectstack/driver-sql': patch
3+
---
4+
5+
fix(driver-sql): the differ's widening arm keeps, or safely retires, a narrower unique an 18.0 database built in the NULL-safe form, and keeps one a hash shadow carries or whose gained column is not yet physical, instead of offering any of them as an orphan drop (#32164)
6+
7+
Clause-②: no
8+
- The widening arm (the rule that retires a narrower unique key superseded by a declared global key that gained columns), on a narrower an 18.0 database built with its organization key part in the NULL-safe form (`COALESCE(organization_id, '__global__')`, under the same generated name): FROM an orphan, `drop_index` categorized `destructive` TO the widening arm's answer. On a certified table (ADR-0131 D1: the tenant column holds no NULL), the narrower is kept until a partial guard on its columns stands, then offered as the one `replace_unique_index`, categorized `safe`. On a table that is not certified, it is kept and nothing is offered, because the COALESCE form also keeps NULL-organization rows to one, which neither the wider key nor the guard does.
9+
- A plan read before the sync that adds a gained column (`os migrate plan` over an upgraded database): FROM the narrower an orphan, `drop_index` categorized `destructive` TO kept, nothing offered.
10+
- A narrower carried by a #11627 hash shadow (MySQL, MariaDB: a key over a long TEXT column), whose resolved key is exactly the superseded columns, plain or with the organization part NULL-safe: FROM an orphan, `drop_index` categorized `destructive` TO kept, nothing offered, certified or not and with or without the guard. `replace_unique_index` drops the legacy name and retires no shadow, so this arm never offers it.
11+
- A hash-shadow carrier under the superseded key's generated name whose key could not be read (its generation expression did not resolve): FROM an orphan, `drop_index` categorized `destructive` TO kept, nothing offered, certified or not and with or without the guard; read before the sync that adds a gained column, it is kept and nothing is offered: the wider key over a column not yet physical is not expected yet. What it hashes is unknown, so it is never dropped on a guess.
12+
13+
Metadata-protocol: none
14+
15+
<!-- adr-0087: not-required (no-migration-prescription) No key of any authorable schema is added, removed, renamed or re-shaped. The change is in the SQL driver's schema-drift plan: which physical index it keeps or offers to replace. No stored metadata row is rewritten, so there is nothing for `objectstack migrate meta` to rewrite. -->
16+
17+
Part of #32164 (ADR-0150 D8 R1). It lands ahead of the grant key's widening, where the restored 18.0 store's `uniq_sys_user_permission_set_ac248331` is the first narrower in this form. The grant key itself is still `unique: 'organization'`, which the widening arm does not take, so this change alone leaves the grant table's plan as it is. On `main`, 17 first-party declarations are unnamed `unique: true` / `'global'` keys of 2 to 8 fields, the ones this arm reads; it acts on one only where a physical unique stands under the generated name of a narrower subsequence of its fields, which is the activation ledger's `(metadata_type, name)` on an upgraded database (respelled to `(metadata_type, package_id, name)` by ADR-0150). Any other declared global key that gained columns reaches the new answers only in the four shapes above. In each, a destructive offer becomes a kept index, or a safe replace once a guard stands. No answer is added that a sync would apply to drop a key that is still needed.
18+
19+
Unchanged: a plain narrower is matched as before. A narrower whose key parts (read through a hash shadow's resolved key where one carries it) are not the superseded columns is still the orphan arm's. Pinned at the differ with pure functions: no live MySQL or MariaDB has run this arm, and the live suites run on `main` only.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@objectstack/runtime': patch
3+
---
4+
5+
fix(runtime): a job name a package body declares and the artifact's top level carries too is attributed to neither, never to the body (ADR-0150 D3)
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (no-migration-prescription) no metadata shape, schema, stored row or registered node type changes: the change is which package a job's pull runs as when an artifact's top level and one of its package bodies both carry the job name, the stored metadata is read exactly as before, so there is nothing for `objectstack migrate meta` to rewrite -->
11+
12+
**BREAKING** (first-party count 0: no example app or first-party package declares a job `pull`, and the one first-party multi-package artifact, `examples/app-multi-package`, declares no jobs and composes no manifest-less stack). On a JSON-loaded artifact the body's own job of that name is refused too, including where it used to pull correctly as its body: nothing in the artifact tells the body's flattened copy from the residual's job.
13+
14+
`composeStacks(…, { manifest: 'preserve' })` with an input that has no `manifest` writes that input's jobs to the artifact's top level and to no package body (the ADR-0130 residual), beside the flattened copy of every body's jobs. When such a job shares its name with a body's job, an artifact loaded from JSON meets both by name, and the binder attributed the residual's job to the body: its pull ran as that body's package (`callerPackageId`) and read that package's mappings.
15+
16+
Each run of such a job was pulled as the declaring body's package. It is now refused before any call or write, `409 RESOURCE_CONFLICT` (`ambiguous-in-environment`), naming the declaring body and the residual, and the job run records the failure — unless the residual's own package (the body that carries the artifact's id) IS that one declaring body, which answers that package as before. The residual is recognised by count: the artifact carries more jobs of the name than its package bodies declare. A residual job with a name of its own, and a body's job no residual job shares a name with, run as before.
17+
18+
The fix: rename the top-level job, or the package body's, so each job name has one declaring holder.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
'@objectstack/cli': patch
3+
---
4+
5+
fix(cli): `os validate --strict` promotes warnings, never `info` findings
6+
7+
Clause-②: yes (widening) — `os validate --strict` now exits 0 on a stack whose only findings are `info`-severity rule-registry findings; nothing that passed before fails.
8+
Metadata-protocol: none
9+
10+
`os validate --strict` fails the run (exit 1) on warnings and errors only. An `info`-severity finding from the rule registry is still printed — now under a blue `ℹ`, the glyph `os lint` gives the same finding as a `suggestion` — and still rides the `--json` payload's `warnings`, but it no longer fails the run under `--strict`, on either face, and an info-only run prints no `Strict mode: warnings treated as errors` line. This matches `os lint --strict`, which promotes warnings and leaves suggestions advisory.
11+
12+
The findings that stop failing `os validate --strict`, by their rule-id exports from `@objectstack/lint`:
13+
14+
- `SECURITY_PRIVATE_NO_READSCOPE` (`security-private-no-readscope`)
15+
- `SECURITY_ROLLUP_SOURCE_ROW_SCOPED` (`security-rollup-source-row-scoped`)
16+
- `ASSIGNMENT_RULE_QUEUE_UNSTAFFED` (`assignment-rule-queue-unstaffed`)
17+
- `APPROVAL_APPROVERS_MAY_RESOLVE_EMPTY` (`approval-approvers-may-resolve-empty`)
18+
- `APPROVAL_EXPRESSION_NO_EMPTY_POLICY` (`approval-expression-no-empty-policy`)
19+
- `APPROVAL_EXPRESSION_INVALID` (`approval-expression-invalid`) — its `info` arm only, a `resolveAs` on an approver whose type is not `expression`; its `error` arms still fail every run.
20+
21+
Every other advisory keeps gating `--strict` exactly as before: ADR-0087 conversion notices, `warning`-severity registry findings, doc findings, undeclared-key, capability-provider and structural advisories.
22+
23+
A CI step that runs `os validate --strict` and relied on an `info` finding to fail it should gate on the finding instead: read `--json`'s `warnings` for entries with `severity: 'info'` and the rule id it cares about.

‎content/docs/automation/jobs.mdx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,10 @@ export const OrdersPullJob = defineJob({
305305
runner refused completes as `degraded`, with the counts as its reason; retrying
306306
would refuse the same rows. Otherwise the run is `success`, including a pull
307307
that found nothing new. Every pull also leaves one `sys_sync_run` row in the
308-
job's organization: the mapping, where it read from and from which position,
308+
job's organization: the mapping, the job run that drove it (`job_run_id`, the
309+
attempt's `sys_job_run` id, and `trigger`, `schedule` or `manual`; both empty
310+
under a job service that keeps no run history, where only the trigger may be
311+
kept), where it read from and from which position,
309312
the rows read, created, updated and refused, the position it committed, and
310313
how it ended (`completed`, `degraded` or `failed` with the refusal's reason).
311314
A pull still `running` when the server stopped is closed `failed`

‎content/docs/deployment/cli.mdx‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -885,16 +885,26 @@ for the full matrix. Every failing rule is reported in a single run rather than
885885
stopping at the first, so one pass shows the whole hole.
886886
887887
**Options:**
888-
- `--strict` — Treat warnings as errors (exit code 1)
888+
- `--strict` — Treat warnings as errors (exit code 1); `info` findings stay advisory
889889
- `--json` — Output results as JSON
890890
891891
**Warnings checked (advisory, non-blocking unless `--strict`):**
892892
- Missing `manifest.id` (required for deployment)
893893
- Missing `manifest.namespace` (required for multi-app hosting)
894894
- No objects defined
895895
- No apps or plugins defined
896-
- Every advisory the rule registry raised (dangling `stageField` /
897-
`highlightFields` pointers, replay-unsafe seeds, ambiguous flow status, …)
896+
- Every `warning`-severity finding the rule registry raised (dangling
897+
`stageField` / `highlightFields` pointers, replay-unsafe seeds, ambiguous
898+
flow status, …)
899+
- ADR-0087 conversion notices (a deprecated shape converted at load)
900+
901+
**What fails the run under `--strict`.** `--strict` makes a run with one or
902+
more warnings exit 1 exactly as an error does, and says why — `Strict mode:
903+
warnings treated as errors`. An `info`-severity finding from the rule registry
904+
(the same finding `os lint` grades as a `suggestion`) is printed under `ℹ` and
905+
stays in the `--json` payload's `warnings`, but it stays advisory either way:
906+
a run whose only findings are `info` exits 0 under `--strict` and prints no
907+
strict verdict. The `--json` face reaches the same exit status as the text face.
898908
899909
<Callout type="tip">
900910
`os validate`, `os build` and `os lint` share one rule registry, so a config that

0 commit comments

Comments
 (0)