You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: inherit service JSDoc from ServiceModel instead of duplicating (#594)
Service classes already implement their {Entity}ServiceModel interface, so
TypeScript inherits the interface's JSDoc onto each method's IDE hover when
the class method has no JSDoc of its own. The class-side JSDoc was a
duplicate that had already drifted out of sync across many methods.
Removes the duplicated class-side method JSDoc (170 methods across 28
files); docs now live only on the ServiceModel interfaces. Also fixes 7
interface docs that were thinner than the class copy (reordered
@experimental below the summary on agent-memory/governance methods; added
missing summaries to Cases/MaestroProcesses getAll), and updates rules.md.
Consumer hover is unchanged (summary + params + returns + example),
verified via the TS language service on source and the built .d.ts.
typecheck + lint clean; 2059 unit tests pass.
Generated with Claude Code
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: agent_docs/rules.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ JSDoc comments in `src/models/{domain}/*.models.ts` are the **source of truth fo
59
59
- Use `<paramName>` placeholder convention for IDs in examples.
60
60
- Use camelCase in examples, matching SDK response format. **NEVER** use PascalCase in JSDoc examples — users will write broken code.
61
61
- Keep JSDoc in sync with method names.
62
-
-**Keep JSDoc on service class methods in sync with `{Entity}ServiceModel`** — both the models file and the service implementation file must have identical JSDoc for each public method. `ServiceModel` is the source of truth for docs, but the service class copy aids developer navigation and IDE tooltips. When updating JSDoc on one, update the other.
62
+
-**Do NOT duplicate JSDoc on service class methods** — service classes `implements {Entity}ServiceModel`, and TypeScript inherits the interface's JSDoc onto the implementing method's IDE hover when the class method has no JSDoc of its own. Write method JSDoc **only** on `{Entity}ServiceModel`; leave the service class method bare (keep the `@track` decorator and body). This makes the interface the single source of truth for both the docs site (TypeDoc renders the interface) and IDE tooltips (inherited via `implements`), so the two can't drift. A partial JSDoc comment on the class method silently disables inheritance — so class methods must carry **no** method JSDoc at all. Methods not declared on the interface keep their own JSDoc (nothing to inherit).
63
63
-**When a method supports `expand`**, show multiple expandable entities in the `@example` (e.g., `expand: 'Robot,Machine,Release'`) so users see the comma-separated pattern.
64
64
-**Add a one-line description of what the response includes** beyond the method signature (e.g., "Returns the full job details including state, timing, and input/output arguments. Use `expand` to include related entities like Robot, Machine, or Release").
65
65
-**NEVER** reference unrelated parameters in JSDoc examples — keep examples focused on the method being documented. If `getOutput()` doesn't accept `folderId`, don't show `folderId` in its example.
0 commit comments