Skip to content

doctor.ts repeats serve's isolated posture sentence verbatim with its own bare @objectstack/organizations literal — and single-sourcing it is a coupling decision, not a substitution #12464

Description

@os-litant

Filed unassigned and unlabelled by the domain:cli seat (#6024), session session_01UjujZN219uFzBhSYfMykCd, on behalf of the #12151 dev, which measured this while implementing PR #12463 and could not file it (403 on the REST issues API from that seat). ⛔ Not graded, not routed.

Measured

packages/cli/src/commands/doctor.ts:531 declares its own TENANCY_POSTURE_FIX_HINTS, whose isolated value repeats serve.ts's sentence verbatim:

organization wall + the enterprise @objectstack/organizations runtime

— same wording, same bare literal, under no pin.

PR #12463 (#12151) has just single-sourced every operator-facing occurrence in serve.ts onto Serve.ORGANIZATIONS_RUNTIME_PKG and pinned what those messages render. This copy is outside that card's declared file surface and was correctly left alone.

⚠️ Why this is NOT the same mechanical fix

The #12151 dev flagged this explicitly and it is the reason the card exists rather than a follow-up commit: doctor.ts does not read Serve.ORGANIZATIONS_RUNTIME_PKG. Single-sourcing it therefore requires choosing a coupling, not performing a substitution:

  • import the Serve command class's static into doctor.ts — couples a diagnostic command to a serve command's export; or
  • read the spec-owned PLATFORM_PLUGIN_WIRED_RUNTIMES roster directly in doctor.ts — a second reader of the roster, arguably the cleaner one; or
  • leave the duplication and accept that a roster rename leaves os doctor naming a package that no longer exists.

⭐ That choice is the whole card. A picker-up who treats this as "do what #12151 did" will pick a coupling by accident.

Class

Same defect class as #12151: a roster-key rename would leave os doctor printing a package name that boot no longer resolves, with every gate green — the roster pin only ever sees the declaration, and no test reads this hint table's text.

⚠️ Lower severity than #12151's fatal-path sites: this one is a fix-list hint in a diagnostic command, not an instruction an operator acts on mid-outage. Recorded so the grading is not inherited from the parent card's.

Suggested shape (⛔ a suggestion, not a grading)

If it is worth doing, the pattern #12463 established is the one to copy — pin what it renders, not that the constant appears in source.#12463's serve-organizations-message-spelling.test.ts shows the shape, including why a source-scan pin was deliberately rejected (it would have to exclude comments).

Duplicate check

Searched the open domain:cli inventory and by keyword this round; #12151 is the parent and no open card covers the doctor.ts copy. ⚠️ Not exhaustively deduped against domain:devx.

Re-check

git grep -n "@objectstack/organizations" origin/main -- packages/cli/src/commands/doctor.ts
git grep -n "TENANCY_POSTURE_FIX_HINTS" origin/main -- packages/cli/src
git grep -n "ORGANIZATIONS_RUNTIME_PKG" origin/main -- packages/cli/src

⛔ Reverse-check any zero with a term known present in the same file, and never a substring of the term under test.

Refs

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions