Skip to content

Commit f71f7bd

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-ktw7m9
2 parents 150df00 + 1013ef1 commit f71f7bd

37 files changed

Lines changed: 2682 additions & 989 deletions
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@objectstack/objectql': patch
3+
'@objectstack/spec': patch
4+
---
5+
6+
refactor(objectql): the private docblocks of the last 28 hand-series stubs in `engine.ts` move into their hand modules, onto the functions that hold their bodies; no behaviour or public declaration changes
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
- The second and last slice of the `engine.ts` codemod's `--hand-docs` pass: 10 hand modules, 858 docblock lines. With the first slice, every private hand-series stub that had a docblock now keeps it beside its body; public and protected docblocks stay on the class. `engine.ts` goes from 12,618 to 11,752 lines.
12+
- The liveness ledger's `query.groupBy` row now cites `engine-delete-and-aggregate.ts#aggregate`, where the body lives, because `engine.ts` no longer names the key.
13+
- Nothing to do on upgrade: the exported names, the public `.d.ts` surface and what every method does are the same.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/i18n': patch
4+
---
5+
6+
feat(app-shell): Studio adds an action to an installed app's object, saved in the base's customization package (#30088)
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
On a read-only (installed or code-shipped) package that has, or can get, its paired customization package (`<base>.custom`), the Data pillar's Actions view of the base's object now offers New. Before, it listed the vendor's actions with no New, so an operations person could not add a button such as "Mark qualified" to an installed app's leads, although the platform accepts the result.
12+
13+
- New offers the same presets and the same action editor as on a writable package. The action is saved as its own `action` item in the pair, bound to the object by `objectName`, as a draft (the first write asks the ensure door for the pair). The base's object is never written.
14+
- The vendor's actions stay read-only in the list. The added action is listed after them with the "added" customization mark, its edits autosave into its draft in the pair, and Delete removes its draft and its published item from the pair. An added action keeps the name it was created with: a rename is held with a line saying how to save.
15+
- The action publishes with the pair's other drafts from Pending changes, and the Actions list's "only customizations" counts it and narrows the list to the pair's actions.
16+
17+
A writable package's action editing is unchanged: its actions are still written into the object draft. No spec, server or metadata-type change.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
---
4+
5+
fix(app-shell): in Studio Interfaces, a draft-only object's nav entry opens the object's drafted default list view, not a non-existent "Default view"
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
An object that is still only a draft in the package is absent from the shell's published metadata, so a nav entry for it with no `viewName` used to open `<object>.default`, a view that does not exist. The view switcher listed that "Default view" beside the view the author had drafted as the default, and the first edit in the panel created a second default list view in the package. The entry's default list view is now resolved against the published views and the package's drafted list views together, so it opens the drafted default view, the switcher lists only the views that exist, and an edit writes to that view. Until the package's drafts have been read, a default view that no published view flags is not loaded or listed, so no edit can be made against the wrong view. A published object with no default list view still opens `<object>.default`, created by the first edit, as before.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@object-ui/auth': patch
3+
---
4+
5+
fix(auth): the sign-in page reads the sign-in methods the server has now, not the ones it had when the tab was opened (#30299)
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The auth client kept the first `/auth/config` answer for the life of the page. An administrator who turned email and password off on the Authentication settings page (with another way in configured) and then signed out was shown the email and password form on the sign-in page, from the copy read while signed in, although the server refuses that form. The client now forgets the cached config whenever the tab is left without a session: on sign-out, and when a session read finds none (an expired session reaches the sign-in page without a sign-out). Readers on one page still share one request, and nothing changes while a session lasts.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
---
4+
5+
fix(metadata-protocol): duplicating a package copies a permission set that grants on an optional plugin's object not installed here, as the permission-set clone door does
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
- **Now.** `duplicatePackage` saves a copied permission set with the grant keys of its SOURCE row as stored passed as `inheritedGrantObjects`, so the save door's unknown-object refusal does not judge them (#30255's rule for the clone door). A platform set granting on `sys_comment` / `sys_activity` on a deployment without `@objectstack/plugin-audit` is copied; before, it was left in `failed[]` with the 422 finding and the duplicate answered `success: false`.
11+
- **Still refused.** A grant the copy's rewrite renames onto the copy's own object (`SOURCE_NS_x` → `TARGET_NS_x`) is not the source's key and is judged as before: when that object did not copy, the set lands in `failed[]` naming that grant alone. The keys come from the stored row, never from the request.
12+
- **Unchanged, by ruling.** `importUnmanagedPackage` still refuses such a set `422 INVALID_METADATA` and rolls the import back: the package is the request's body, not a stored row, so its permission sets are new writes and every grant is judged.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/cloud-connection': patch
3+
'@objectstack/metadata-core': patch
4+
---
5+
6+
feat(cloud-connection,metadata-core): an install the protocol handshake admitted without checking says so in its answer, not only in the server log
7+
8+
Clause-②: yes (widening)
9+
Metadata-protocol: none
10+
11+
- **`@objectstack/cloud-connection`: `POST /api/v1/marketplace/install-local` answers `data.protocolCheckSkipped`** when the ADR-0087 handshake admitted the package without checking it: `{ reason, packageId, protocolVersion, message }`, plus `requiredRange` and `rangeSource` for `reason: 'unparsed-range'`. `reason` is the handshake's own verdict: `no-range` (the package declares no `engines.protocol`) or `unparsed-range` (it declares a range the handshake cannot read). `protocolVersion` is the protocol the package was installed under unchecked, and `message` says so in plain words for the person who pressed Install. It is on all three success answers (managed, `unmanaged`, and a paired customization package), and omitted, not nulled, when the range was checked, so that answer's key set is unchanged. The `warn` log line stays as it was.
12+
- **`@objectstack/metadata-core`: `assertProtocolCompat` returns the verdict it admitted the package under** (new exported type `ProtocolCompatAdmitted`; it returned `void`), and the `no-range` and `unparsed-range` verdicts of `checkProtocolCompat` carry `protocolVersion`, the version they were judged against. A door that answers a caller reads the skipped check from the handshake itself instead of judging the range a second time.

‎packages/cloud-connection/src/marketplace-install-local-customization-pair-install.test.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
2727
import { mkdtempSync, rmSync } from 'node:fs';
2828
import { join } from 'node:path';
2929
import { tmpdir } from 'node:os';
30+
import { PROTOCOL_MAJOR, PROTOCOL_VERSION } from '@objectstack/spec/kernel';
3031
// The runtime binder the door's step 1d loads lazily — paid here, at module
3132
// top, never inside a clocked `it` (`scripts/check-test-source-alias.mjs`).
3233
import '@objectstack/runtime';
@@ -368,3 +369,21 @@ describe('install-local — a pair install refused before any write', () => {
368369
expectNoCodeInstall(h);
369370
});
370371
});
372+
373+
describe('[#30326] a pair install the handshake admitted unchecked says so in its answer', () => {
374+
it('a pair export with no engines.protocol answers `protocolCheckSkipped` reason `no-range`', async () => {
375+
const h = await mount(dir);
376+
const res = await h.install(exportedPair());
377+
expect(res.status, JSON.stringify(res.payload)).toBe(200);
378+
const { message, ...machine } = res.payload.data.protocolCheckSkipped;
379+
expect(machine).toEqual({ reason: 'no-range', packageId: PAIR, protocolVersion: PROTOCOL_VERSION });
380+
expect(message).toContain(`'${PAIR}'`);
381+
});
382+
383+
it(`control: a pair export that declares ^${PROTOCOL_MAJOR} answers no \`protocolCheckSkipped\` key`, async () => {
384+
const h = await mount(dir);
385+
const res = await h.install(exportedPair({ engines: { protocol: `^${PROTOCOL_MAJOR}` } }));
386+
expect(res.status, JSON.stringify(res.payload)).toBe(200);
387+
expect(Object.keys(res.payload.data)).not.toContain('protocolCheckSkipped');
388+
});
389+
});

‎packages/cloud-connection/src/marketplace-install-local-jobs.test.ts‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import { tmpdir } from 'node:os';
4747
// the plugin reaches the same module through a dynamic `import()`.
4848
import '@objectstack/runtime';
4949
import { SCHEDULED_WORK_ENV } from '@objectstack/types';
50+
import { PROTOCOL_MAJOR } from '@objectstack/spec/kernel';
5051
import { MarketplaceInstallLocalPlugin } from './marketplace-install-local-plugin.js';
5152
import { installerAuthService, withInstallerGrants } from './install-local-principal.fixtures.js';
5253
import { LocalManifestSource } from './local-manifest-source.js';
@@ -66,7 +67,13 @@ const HANDLER_JOB = { name: 'jobs_app_tick_handler', schedule: INTERVAL, handler
6667
/** The compiled-artifact shape `os build` writes and `os package install` sends. */
6768
function artifact(jobs: unknown[] | undefined, id: string = APP_ID) {
6869
return {
69-
manifest: { id, namespace: 'jobs_app', version: '0.1.0', type: 'app', name: 'Jobs App' },
70+
// A range this runtime admits, as a scaffolded app declares one: the
71+
// answer then carries no `protocolCheckSkipped` notice, and the key
72+
// set the jobs-free case pins is the jobs gate's alone.
73+
manifest: {
74+
id, namespace: 'jobs_app', version: '0.1.0', type: 'app', name: 'Jobs App',
75+
engines: { protocol: `^${PROTOCOL_MAJOR}` },
76+
},
7077
objects: [{ name: TICK, label: 'Tick', fields: { name: { type: 'text', label: 'Name' } } }],
7178
...(jobs ? { jobs } : {}),
7279
};

‎packages/cloud-connection/src/marketplace-install-local-plugin.ts‎

Lines changed: 77 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ import { PackageExportManifestSchema, type PackageExportManifest } from '@object
207207
import {
208208
assertProtocolCompat,
209209
checkProtocolCompat,
210+
type ProtocolCompatAdmitted,
210211
// [ADR-0141 D2] The pre-install dependency check: the one predicate and
211212
// the one answer every package-install door gives its refusal.
212213
checkDeclaredDependencies,
@@ -728,6 +729,58 @@ function withheldMapsLogLine(
728729
+ 'environment variables until each map is supplied again where the connector is authored.';
729730
}
730731

732+
/**
733+
* [#30326] What an install answer carries when ADR-0087 D1's handshake
734+
* admitted the package WITHOUT checking it: the person who pressed Install is
735+
* the one who needs to know, and the `warn` line alone reaches only whoever
736+
* reads the server log. Present on a success answer only then; omitted, not
737+
* nulled, for a package whose range was checked, so that answer's key set is
738+
* unchanged.
739+
*
740+
* `reason` is the handshake's own verdict, never a second reading of the
741+
* range: `no-range` (the package declares no `engines.protocol`, nor either
742+
* legacy spelling) or `unparsed-range` (it declares a range the handshake's
743+
* grammar does not read). `protocolVersion` is the protocol the package was
744+
* loaded under unchecked.
745+
*/
746+
export type ProtocolCheckSkipped =
747+
| { reason: 'no-range'; packageId: string; protocolVersion: string; message: string }
748+
| {
749+
reason: 'unparsed-range';
750+
packageId: string;
751+
protocolVersion: string;
752+
requiredRange: string;
753+
rangeSource: string;
754+
message: string;
755+
};
756+
757+
/** [#30326] The notice for a verdict the handshake admitted unchecked; `undefined` for a checked one. */
758+
function protocolCheckSkippedOf(verdict: ProtocolCompatAdmitted, packageId: string): ProtocolCheckSkipped | undefined {
759+
if (verdict.status === 'ok') return undefined;
760+
const consequence = `so it was installed under platform protocol ${verdict.protocolVersion} without a compatibility `
761+
+ 'check and may not work on this platform version. A build of the package that declares the protocol it '
762+
+ 'supports (`engines.protocol`) is checked at install.';
763+
switch (verdict.status) {
764+
case 'no-range':
765+
return {
766+
reason: 'no-range',
767+
packageId,
768+
protocolVersion: verdict.protocolVersion,
769+
message: `Package '${packageId}' does not state which platform protocol it supports, ${consequence}`,
770+
};
771+
case 'unparsed-range':
772+
return {
773+
reason: 'unparsed-range',
774+
packageId,
775+
protocolVersion: verdict.protocolVersion,
776+
requiredRange: verdict.requiredRange,
777+
rangeSource: verdict.source,
778+
message: `Package '${packageId}' states its platform protocol as '${verdict.requiredRange}' `
779+
+ `(${verdict.source}), which this runtime cannot read, ${consequence}`,
780+
};
781+
}
782+
}
783+
731784
/**
732785
* [ADR-0131 D6] The package manifest an install body DECLARES — where each of
733786
* the two single-package shapes this door accepts carries it: a compiled
@@ -1911,8 +1964,14 @@ export class MarketplaceInstallLocalPlugin implements Plugin {
19111964
// hooks with THIS runtime's binder: ADR-0087 D1 checks "before
19121965
// loading a package's metadata". An absent or unrecognised range is
19131966
// admitted with a warning, as at every seam the handshake guards.
1967+
//
1968+
// [#30326] The log line is the operator's; the verdict it admitted
1969+
// the package under is also the answer's: every success answer
1970+
// below carries `protocolCheckSkipped` when the check did not run.
1971+
let protocolCheckSkipped: ProtocolCheckSkipped | undefined;
19141972
try {
1915-
assertProtocolCompat(manifest, undefined, (m) => ctx.logger?.warn?.(`[MarketplaceInstallLocal] ${m}`));
1973+
const admitted = assertProtocolCompat(manifest, undefined, (m) => ctx.logger?.warn?.(`[MarketplaceInstallLocal] ${m}`));
1974+
protocolCheckSkipped = protocolCheckSkippedOf(admitted, manifestId);
19161975
} catch (err) {
19171976
if (!isProtocolIncompatibleError(err)) throw err;
19181977
const refusal = protocolIncompatibleAnswer(err);
@@ -2090,6 +2149,7 @@ export class MarketplaceInstallLocalPlugin implements Plugin {
20902149
versionId: resolvedVersionId,
20912150
userId,
20922151
withheldMaps,
2152+
protocolCheckSkipped,
20932153
});
20942154
}
20952155

@@ -2135,6 +2195,7 @@ export class MarketplaceInstallLocalPlugin implements Plugin {
21352195
versionId: resolvedVersionId,
21362196
userId,
21372197
withheldMaps,
2198+
protocolCheckSkipped,
21382199
});
21392200
}
21402201

@@ -2520,6 +2581,11 @@ export class MarketplaceInstallLocalPlugin implements Plugin {
25202581
// withheld whole, so it arrived absent. Omitted when there are
25212582
// none, so that answer's key set is unchanged.
25222583
...(withheldMaps.length > 0 ? { withheldMaps } : {}),
2584+
// [#30326] The handshake admitted the package without checking
2585+
// it (no `engines.protocol`, or a range it cannot read): the
2586+
// installer is told, not only the server log. Omitted when the
2587+
// range was checked, so that answer's key set is unchanged.
2588+
...(protocolCheckSkipped !== undefined ? { protocolCheckSkipped } : {}),
25232589
upgradedFrom: conflict === 'marketplace' ? 'previous-marketplace-version' : null,
25242590
// [ADR-0146 D2, #28410] Names installed dependents already held,
25252591
// undeclared, that this version now ships (step 2d). Omitted when
@@ -3738,9 +3804,11 @@ export class MarketplaceInstallLocalPlugin implements Plugin {
37383804
manifest: Record<string, any>; manifestId: string; version: string; versionId: string; userId: string | null;
37393805
/** [#28640 ruling ③A] The connector maps the export withheld ({@link judgeWithheldMaps}). */
37403806
withheldMaps: readonly WithheldMap[];
3807+
/** [#30326] The handshake admitted the package unchecked ({@link protocolCheckSkippedOf}). */
3808+
protocolCheckSkipped: ProtocolCheckSkipped | undefined;
37413809
},
37423810
): Promise<Response> => {
3743-
const { manifest, manifestId, version, versionId, userId, withheldMaps } = args;
3811+
const { manifest, manifestId, version, versionId, userId, withheldMaps, protocolCheckSkipped } = args;
37443812
let protocol: UnmanagedImporter | undefined;
37453813
try { protocol = ctx.getService<UnmanagedImporter>('protocol'); } catch { /* no protocol service */ }
37463814
if (!protocol || typeof protocol.importUnmanagedPackage !== 'function') {
@@ -3820,6 +3888,8 @@ export class MarketplaceInstallLocalPlugin implements Plugin {
38203888
// withheld whole, so its copy carries it absent. Omitted when
38213889
// there are none, so that answer's key set is unchanged.
38223890
...(withheldMaps.length > 0 ? { withheldMaps: [...withheldMaps] } : {}),
3891+
// [#30326] Omitted when the handshake checked the package's range.
3892+
...(protocolCheckSkipped !== undefined ? { protocolCheckSkipped } : {}),
38233893
...(declaresSeeds
38243894
? {
38253895
seeded: {
@@ -3891,9 +3961,11 @@ export class MarketplaceInstallLocalPlugin implements Plugin {
38913961
version: string; versionId: string; userId: string | null;
38923962
/** [#28640 ruling ③A] The connector maps the export withheld ({@link judgeWithheldMaps}). */
38933963
withheldMaps: readonly WithheldMap[];
3964+
/** [#30326] The handshake admitted the package unchecked ({@link protocolCheckSkippedOf}). */
3965+
protocolCheckSkipped: ProtocolCheckSkipped | undefined;
38943966
},
38953967
): Promise<Response> => {
3896-
const { manifest, manifestId, baseId, version, versionId, userId, withheldMaps } = args;
3968+
const { manifest, manifestId, baseId, version, versionId, userId, withheldMaps, protocolCheckSkipped } = args;
38973969
const refuse = (status: number, code: string, message: string, details?: Record<string, unknown>) =>
38983970
c.json({ success: false, error: { code, message, ...(details ? { details } : {}) } }, status as any);
38993971

@@ -4054,6 +4126,8 @@ export class MarketplaceInstallLocalPlugin implements Plugin {
40544126
written,
40554127
// [#28640 ruling ③A] Omitted when the export withheld none.
40564128
...(withheldMaps.length > 0 ? { withheldMaps: [...withheldMaps] } : {}),
4129+
// [#30326] Omitted when the handshake checked the package's range.
4130+
...(protocolCheckSkipped !== undefined ? { protocolCheckSkipped } : {}),
40574131
...(plan.carriesSeedData
40584132
? {
40594133
seeded: {

0 commit comments

Comments
 (0)