Skip to content

qa/dogfood: hook-error-format.dogfood.test.ts still states the retired "older clients prepend code to the message" rationale as live #11589

Description

@os-zhuang

Observation, filed unassigned while landing #10345. Nothing is red and no assertion is wrong — this is comment drift in a pin file, which is the kind that misleads the next author into re-deriving a rule that no longer holds.

What the file says

packages/qa/dogfood/test/hook-error-format.dogfood.test.ts, header (~line 12):

…and not a code field an older bundled @objectstack/client would prepend as [ObjectStack] CODE: ….

and at the assertion (~line 118):

// No sandbox debug wrapper, no branding, no code for old clients to prepend.
expect(body.code).toBeUndefined();

Why it is stale

#10345 measured both halves of that rationale as false and retired it from packages/rest/src/error-response.ts, where the same sentence was the stated reason the sandbox unwrap door emitted no code:

What is NOT wrong

The assertion itself stays correct and stays green. The hook it drives throws new Error(BUSINESS_MSG) with no code, so what expect(body.code).toBeUndefined() actually pins is ADR-0112's "nothing is invented for a half-declaration" — which #10345 preserves deliberately. Only the reason attached to it has expired.

The four sibling comments carrying the same sentence inside packages/rest/src/** were rewritten in #10345's PR. This one sits outside that card's declared file surface, so it was left for its own change rather than folded in.

Fix is a comment edit in one file; the natural companion is re-reading the assertion's intent into the comment ("no code because this producer declared none").


Generated by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions