Skip to content

Commit 70fe76c

Browse files
committed
fix(dogfood): the wall /packages case's operator package declares the CRM dependency its view binds
The case "/packages: each of the thirteen write doors refuses A ..." saved a draft list view bound to crm_lead into a package created with no dependencies. Since the save door judges a package's list view against the package's closure, publish-drafts refuses that view (200, success: false, publishedCount: 0) and the case read 0 commits three lines later. The operator's package now declares com.example.crm, the package that ships crm_lead, and the publish line asserts the receipt (success, outcome published, publishedCount 1), so a refused publish fails where it breaks, naming its cause. Claude-Session: https://claude.ai/code/session_01LmjU2x1faLZ39DVTFyVca6 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1c1144f commit 70fe76c

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

‎packages/qa/dogfood/test/wall-environment-metadata-refusal.dogfood.test.ts‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ function packageBody(id: string, version: string, objects: unknown[] = []) {
8484

8585
const META_AUTHOR = 'em_meta_author';
8686
const CATALOG_PKG = 'com.em.catalog';
87+
/** The package that ships `crm_lead` (`examples/app-crm/objectstack.config.ts`, `manifest.id`). */
88+
const CRM_PKG = 'com.example.crm';
8789

8890
interface Harness {
8991
stack: VerifyStack;
@@ -234,9 +236,21 @@ for (const posture of ['isolated', 'group'] as const) {
234236
it("/packages: each of the thirteen write doors refuses A 403 PERMISSION_DENIED, and B reads the operator's package unchanged", async () => {
235237
const pkg = `com.em.${p}.op`;
236238
const pv = `crm_lead.em_${p}_pv`;
237-
await ok(await h.stack.apiAs(h.operator, 'POST', '/packages', { id: pkg, name: 'op', version: '1.0.0', type: 'app' }), 201);
239+
// The operator's package DECLARES the CRM package as a dependency: a
240+
// package's draft publish judges a list view against the package's
241+
// closure and refuses a binding outside it
242+
// (`list-view-object-outside-closure`, #24563), and `crm_lead` is the
243+
// CRM package's object.
244+
await ok(await h.stack.apiAs(h.operator, 'POST', '/packages',
245+
{ id: pkg, name: 'op', version: '1.0.0', type: 'app', dependencies: { [CRM_PKG]: '*' } }), 201);
238246
await ok(await h.stack.apiAs(h.operator, 'PUT', `/meta/view/${pv}?package=${pkg}&mode=draft`, view(pv, 'c1')));
239-
await ok(await h.stack.apiAs(h.operator, 'POST', `/packages/${pkg}/publish-drafts`, {}));
247+
// A 200 is not a publish: a refused batch answers 200 with `success: false`
248+
// in `data`, so the receipt is read here, where a refusal names its cause.
249+
const published = await h.stack.apiAs(h.operator, 'POST', `/packages/${pkg}/publish-drafts`, {});
250+
await ok(published);
251+
const receipt = ((await published.json()) as { data?: Record<string, unknown> }).data;
252+
expect({ success: receipt?.success, outcome: receipt?.outcome, publishedCount: receipt?.publishedCount }, JSON.stringify(receipt?.failed))
253+
.toEqual({ success: true, outcome: 'published', publishedCount: 1 });
240254
const commits = (((await (await h.stack.apiAs(h.operator, 'GET', `/packages/${pkg}/commits`)).json()) as any).data?.commits ?? [])
241255
.map((c: { id: string }) => c.id);
242256
expect(commits.length).toBeGreaterThan(0);

0 commit comments

Comments
 (0)