Repository navigation
fix(extract-conventions): switch event handler detection from interface to decorator - #283
Conversation
…ace to decorator (#271) Change extraction to read subscribedEvents from class property instead of generic type args. Switch ESLint rule trigger from implements EventHandlerDef to @EventHandlerContainer decorator. Fix dev-workflow-v2 plugin compatibility with updated agentic-workflow-builder API. Co-Authored-By: Claude Haiku 4.5 <[email protected]>
…s, not any literals hasLiteralArrayValue() accepted non-string literals like [42, true] but the error message promised "array of string literals". Added hasStringLiteralArrayValue() that checks typeof element.value === 'string' and switched the event-handler rule to use it. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…cement - Replace type guard functions with in-operator narrowing on typed unions (SD-019) - Strengthen ESLint rule test assertion from toBeDefined to toHaveProperty (TS-003) - Add hasStringLiteralArrayValue predicate that rejects non-string literals (RFC-008) - Switch event-handler rule to use string-specific validation Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…heck Remove hasLiteralValue and hasLiteralArrayValue (dead exports superseded by hasStringLiteralArrayValue). Accept ComponentRule | undefined in test assertion helpers to satisfy TypeScript index access. Added edge case test for mixed string/number array rejection. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Test said "6 required component types" but there are 7 (api, useCase, domainOp, event, eventHandler, eventPublisher, ui). Also added missing 'glob' key to the requiredKeys assertion array. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
📝 WalkthroughWalkthroughExtraction and linting for event handlers were switched from interface-based detection to decorator/property-based detection: extraction reads Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 OpenGrep (1.17.0)tools/dev-workflow-v2/.claude-plugin/plugin.json┌──────────────┐ �[32m✔�[39m �[1mOpengrep OSS�[0m �[1m Loading rules from local config...�[0m tools/dev-workflow-v2/src/features/workflow/infra/external-clients/github/get-pr-feedback.ts┌──────────────┐ �[32m✔�[39m �[1mOpengrep OSS�[0m �[1m Loading rules from local config...�[0m tools/dev-workflow-v2/src/features/workflow/infra/external-clients/github/get-pr-feedback.spec.ts┌──────────────┐ �[32m✔�[39m �[1mOpengrep OSS�[0m �[1m Loading rules from local config...�[0m Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying living-architecture with
|
| Latest commit: |
e4cad2c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b5e7b129.living-architecture.pages.dev |
| Branch Preview URL: | https://issue-271-golden-path-conven.living-architecture.pages.dev |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@packages/riviere-extract-conventions/src/eslint/interface-ast-predicates.cjs`:
- Around line 17-24: hasDecorator currently only detects identifier-form
decorators and misses call-form decorators (e.g., `@EventHandlerContainer`()),
causing latent failures; update function hasDecorator to extract the decorator
name the same way getDecoratorName does in require-component-decorator.cjs:
handle both d.expression.type === 'Identifier' (use d.expression.name) and
d.expression.type === 'CallExpression' with callee as an Identifier (use
d.expression.callee.name), include safe null/undefined checks for nested
properties, and then compare the extracted name to decoratorName so both
identifier and call forms are recognized.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: bb4b3ae1-b8ca-4fd4-b217-85390acc2f8d
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (8)
packages/riviere-extract-conventions/src/default-config.spec.tspackages/riviere-extract-conventions/src/default-extraction.config.jsonpackages/riviere-extract-conventions/src/eslint/event-handler-requires-subscribed-events.cjspackages/riviere-extract-conventions/src/eslint/event-handler-requires-subscribed-events.spec.tspackages/riviere-extract-conventions/src/eslint/interface-ast-predicates.cjstools/dev-workflow-v2/.claude-plugin/plugin.jsontools/dev-workflow-v2/commands/workflow.mdtools/dev-workflow-v2/src/shell/cli.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@tools/dev-workflow-v2/src/features/workflow/infra/external-clients/github/get-pr-feedback.ts`:
- Line 26: The graphqlResponseSchema definition is a single extremely long line
and should be reformatted for readability: break the nested z.object call into
multiple lines and indent each level (top-level data, repository, pullRequest,
reviewThreads, nodes) so the schema hierarchy is clear; reference
graphqlResponseSchema and graphqlThreadNodeSchema when restructuring so you keep
nodes: z.array(graphqlThreadNodeSchema) intact and preserve the exact shape and
types while only changing whitespace and line breaks.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 90efedf9-f5b1-4b89-8619-6d678489cadf
📒 Files selected for processing (3)
tools/dev-workflow-v2/.claude-plugin/plugin.jsontools/dev-workflow-v2/src/features/workflow/infra/external-clients/github/get-pr-feedback.spec.tstools/dev-workflow-v2/src/features/workflow/infra/external-clients/github/get-pr-feedback.ts
|



Summary
implementsInterface('EventHandlerDef')tohasDecorator('EventHandlerContainer')— the golden path now requires only a decorator, no interfacesfromGenericArg(readingIEventHandler<T>) tofromProperty(readingsubscribedEventsinstance property directly)hasStringLiteralArrayValuepredicate that rejects non-string literals like[42, true](the oldhasLiteralArrayValueaccepted any literal type)hasLiteralValue,hasLiteralArrayValue) that had no consumersin-operator narrowing on typed unions (SD-019)Closes #271
Test plan
pnpm verifypasses (lint, typecheck, build, test, knip, depcruise)🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Chores