feat(#3297): add boost-common types/permissions and boost-node service ref
Scaffold the two foundation packages for the boost workspace:
boost-common (common-library):
- AgenticProvider, ProviderDescriptor, ProviderCapabilities interfaces
- NormalizedStreamEvent discriminated union (19 event types)
- ConversationSummary, ConversationDetails, InputItem types
- ChatRequest, ChatResponse, ResponseUsage types
- 16 resource permissions (10 agent + 5 tool + 1 kagenti-infra)
- 5 functional permissions (chat.read/create, documents/mcp/config)
- Resource types: boost-agent, boost-tool
- Conditional rule constants: IS_OWNER, IS_NOT_CREATOR, HAS_LIFECYCLE_STAGE
- No dependency on @backstage/backend-plugin-api (browser-safe)
boost-node (node-library):
- boostAiProviderServiceRef via createServiceRef (id: boost.ai-provider)
- Depends on @backstage/backend-plugin-api (backend-only)
- Depends on boost-common for the AgenticProvider type parameter
The serviceRef lives in boost-node (not boost-common) to avoid pulling @backstage/backend-plugin-api into browser bundles, per PR #3396 review feedback and Backstage convention (plugin-catalog-common + plugin-catalog-node).
Closes #3297
Post-script verification
- [x] Branch is not main/master (
agent/3297-boost-common-node) - [x] Secret scan passed (gitleaks โ
6c4b03802b506c2f86b0c210d0d622b3053c073f..HEAD) - [x] Pre-commit hooks passed (authoritative run on runner)
- [x] Tests ran inside sandbox
Missing Changesets
The following package(s) are changed by this PR but do not have a changeset:
- @red-hat-developer-hub/backstage-plugin-boost-common
- @red-hat-developer-hub/backstage-plugin-boost-node
See CONTRIBUTING.md for more information about how to add changesets.
Changed Packages
| Package Name | Package Path | Changeset Bump | Current Version |
|---|---|---|---|
| @red-hat-developer-hub/backstage-plugin-boost-common | workspaces/boost/plugins/boost-common | none | v0.1.1 |
| @red-hat-developer-hub/backstage-plugin-boost-node | workspaces/boost/plugins/boost-node | none | v0.1.0 |
:warning: JUnit XML file not found
The CLI was unable to find any JUnit XML files to upload. For more help, visit our troubleshooting guide.
๐ค Finished Review ยท โ
Success ยท Started 8:27 PM UTC ยท Completed 8:41 PM UTC
Commit: 6c4b038 ยท View workflow run โ
Review
Findings
Medium
- [Overly Broad Permission]
workspaces/boost/plugins/boost-common/src/permissions.ts:347โboostAgentConfigurePermissionis defined as aBasicPermission(non-resource-scoped) with actionupdate, granting blanket permission to configure ANY agent. All other agent mutation permissions (promote, approve, demote, publish, unpublish, withdraw, delete) are resource-scoped toboost-agent, enabling conditional rules likeIS_OWNERto restrict access per-resource. The test at line 808 explicitly asserts it has noresourceType. Remediation: Change toResourcePermission<'boost-agent'>withresourceType: RESOURCE_TYPE_BOOST_AGENTso conditional rules can be applied at enforcement time.
Low
- [edge case]
workspaces/boost/plugins/boost-common/src/types.ts:224โConversationDetails.statusis typed asstringwhileConversationSummary.statusis a narrower union'completed' | 'failed' | 'in_progress'. Consider defining a sharedConversationStatustype alias for consistency and exhaustiveness checking. - [test adequacy]
workspaces/boost/plugins/boost-common/src/index.test.ts:174โ TheNormalizedStreamEventtype test validates only 5 of the 19 event types. Adding the remaining 14 would catch incorrect discriminant string literals that survive compilation but break switch/case consumers. - [off-by-one / count mismatch]
workspaces/boost/plugins/boost-common/src/permissions.ts:393โboostPermissionsproduces 21 total permissions while the spec mentions 16. The code is internally consistent (test asserts 21) but the spec may need updating. - [Least Privilege / Permission Granularity]
workspaces/boost/plugins/boost-common/src/permissions.ts:307โboostKagentiAdminPermissionbundles namespace management, build pipelines, sandbox, and platform links into one permission. Consider splitting if these have different trust levels. - [Re-export pattern]
workspaces/boost/plugins/boost-common/src/index.ts:33โ Uses explicit named re-exports instead of barrel re-exports. Both patterns exist in this repo (augment-common uses named, lightspeed-common uses barrel). Named exports add maintenance burden but provide better API surface control. - [API shape pattern]
workspaces/boost/plugins/boost-common/src/permissions.ts:395โ Permission aggregation arrays useas constwhile lightspeed-common and orchestrator-common use plain arrays. Consider aligning with sibling packages unless the tuple type is intentional. - [Comment style]
workspaces/boost/plugins/boost-common/src/permissions.ts:19โ Heavy ASCII section separator comments (// ====...) in permissions.ts and types.ts are unusual for common-library packages in this repo. - [JSDoc comment style]
workspaces/boost/plugins/boost-common/src/permissions.ts:53โ JSDocConditional rules:annotations are useful but not found in other permission files. Consider consistency.
Info
- [Permission Design]
workspaces/boost/plugins/boost-common/src/permissions.ts:280โIS_NOT_CREATORseparation-of-duties rule is documented in JSDoc but enforcement is deferred to boost-backend. Verify enforcement when backend code is submitted. - [Naming convention]
workspaces/boost/plugins/boost-common/src/types.ts:168โResponseUsageuses snake_case to mirror the OpenAI API format. Consistent with augment-common's identical type.
Previous run
Review
Findings
Medium
-
[stale-doc]
workspaces/boost/AGENTS.md:76โ The package structure table statesboostAiProviderServiceRefbelongs inboost-common, but this PR correctly places it in the newboost-nodepackage (per Backstage convention to keep@backstage/backend-plugin-apiout of browser bundles). Additionally,boost-nodeis not listed in the table at all. Update the table to add aboost-noderow and move the service ref description there. -
[stale-doc]
workspaces/boost/README.md:31โ The directory structure diagram statesplugins/ # Plugin packages (not yet created)butboost-commonalready exists on main andboost-nodeis being added by this PR. The Plugins table (lines 42-44) still shows only_coming soon_. Update both to reflect the actual packages.
Low
-
[scope-exceeded]
workspaces/boost/plugins/boost-common/src/permissions.tsโ The linked issue (#3297) security task 1.1 specifies 16 permissions, but the PR defines 21 (10 agent + 5 tool + 1 infra + 5 functional). The 5 additional functional permissions (chat.read, chat.create, documents.manage, mcp.manage, config.manage) appear necessary for a complete authorization model but exceed the stated authorization. -
[naming-convention]
workspaces/boost/plugins/boost-common/src/types.tsโ Types mix snake_case and camelCase property naming:ResponseUsageusesinput_tokens/output_tokens/total_tokens,InputItemusescall_id, andConversationDetailsoutput items usecall_id/server_label/file_id, while streaming event interfaces use camelCase (callId,responseId,serverLabel). This appears to be a deliberate wire-format compatibility choice (matching OpenAI-style API responses) but should be documented with a comment explaining the convention split. -
[test-inadequate]
workspaces/boost/plugins/boost-common/src/index.test.tsโ TheNormalizedStreamEventtype test exercises only 5 of 19 event variants (stream.started,stream.text.delta,stream.text.done,stream.error,stream.completed). While TypeScript compilation catches type-level errors, adding instances of all 19 variants would provide stronger regression coverage. -
[pattern-inconsistency]
workspaces/boost/plugins/boost-common/src/index.tsโboost-commonuses explicit named re-exports (export { x, y } from/export type { a, b } from) while sibling common packages (lightspeed-common,orchestrator-common) use barrel re-exports (export * from). Explicit exports are arguably better for API surface control but deviate from the established codebase pattern.
Info
-
[pattern-inconsistency]
workspaces/boost/plugins/boost-common/src/permissions.tsโ ASCII-art section separators (// =====...=====) are used throughoutpermissions.tsandtypes.tsbut not in sibling packages. Consistent within this PR. -
[doc-style]
workspaces/boost/plugins/boost-common/src/types.tsโ Streaming event interfaces use single-line JSDoc with inline@publicwhile provider types use multi-line JSDoc with@publicon its own line. Minor inconsistency within the file. -
[sub-agent-failure] The security sub-agent could not access PR branch files and produced findings based on the base branch only. Manual verification of the diff confirms no security concerns: the PR contains only TypeScript type definitions and Backstage permission constants with no runtime security surface.
Previous run (2)
Review
Findings
Low
-
[logic-error]
workspaces/boost/plugins/boost-common/src/permissions.ts:362โ TheboostResourcePermissionsarray name suggests all 16 entries are resource-scoped, but 4 (boostAgentListPermission,boostAgentRegisterPermission,boostAgentConfigurePermission,boostKagentiAdminPermission) areBasicPermissionwithout aresourceType. The JSDoc already clarifies the actual composition ("10 agent + 5 tool + 1 kagenti-infra") and theas consttuple type provides compile-time safety, so runtime risk is low. Consider renaming toboostLifecyclePermissionsor updating the JSDoc to avoid the term "resource permissions." -
[edge-case]
workspaces/boost/plugins/boost-common/src/types.ts:350โStreamToolCompletedEventhas an optionalerrorfield whileStreamToolFailedEventhas a requirederrorfield. A tool finishing with an error could be represented as either event type. Consumers with exhaustive switch matching ontypemay handle errors instream.tool.failedbut miss error cases instream.tool.completed. Consider documenting the semantic distinction (e.g., partial success vs. total failure) so future consumers know to checkerroron completed events.
Info
-
[test-adequacy]
workspaces/boost/plugins/boost-node/src/index.test.ts:20โ The boost-node test suite verifies onlyidandscope. Consider adding a compile-time type assertion for theAgenticProvidertype parameter. -
[sub-agent-failure]
N/Aโ The intent-coherence, style-conventions, cross-repo-contracts, and docs-currency sub-agents did not return findings: modelclaude-sonnet-4-5@20250929unavailable on vertex deployment. These are sonnet-tier dimensions; the safety-critical opus-tier dimensions (correctness, security) completed successfully.
Previous run (3)
Review
Findings
Medium
-
[api-contract]
workspaces/boost/plugins/boost-common/src/types.ts:283โConversationSummary.createdAtandConversationDetails.createdAt(line 309) are typed asDate, but these interfaces describe data that will cross JSON serialization boundaries.JSON.stringify(new Date())produces a string, andJSON.parsedoes not revive it back to aDateobject. Any consumer callingDatemethods (e.g.,.getTime(),.toLocaleDateString()) on the deserialized value will get a runtimeTypeError. Remediation: ChangecreatedAt: DatetocreatedAt: string(ISO 8601) in both interfaces, or document that consumers must revive the field. -
[rbac-violation]
workspaces/boost/plugins/boost-common/src/permissions.ts:169โboostAgentConfigurePermissionis a basic (non-resource-scoped) permission despite controlling per-agent configuration. WithoutresourceType, conditional rules likeIS_OWNERcannot be applied. Any user granted this permission can configure ALL agents, which is inconsistent with the other 7 agent mutation permissions that are all scoped toRESOURCE_TYPE_BOOST_AGENT. Remediation: AddresourceType: RESOURCE_TYPE_BOOST_AGENTand type asResourcePermission<'boost-agent'>to enable ownership-based conditional rules.
Low
-
[api-contract]
workspaces/boost/plugins/boost-common/src/permissions.ts:361โboostResourcePermissionsis documented as "16 resource permissions" but 4 of its entries areBasicPermission(noresourceType). Theas consttuple type preserves element types so this is a naming/documentation inaccuracy rather than a type-safety bug. Consider renaming toboostLifecyclePermissionsor fixing the JSDoc. -
[forward-compatibility]
workspaces/boost/plugins/boost-common/src/types.ts:32โProviderCapabilitieshas 12 required boolean fields. Adding a new capability requires all implementations to update. Acceptable for a v0.1.0 scaffold but worth noting for future evolution. -
[forward-compatibility]
workspaces/boost/plugins/boost-common/src/types.ts:506โStreamFormField,StreamFormDescriptor,StreamSecretDemand, andStreamCitationReferenceuse open index signatures[key: string]: unknownwhile other interfaces are strictly shaped. This appears intentional for extensible external data but is worth documenting. -
[api-shape]
workspaces/boost/plugins/boost-common/src/types.ts:260โResponseUsageusessnake_case(input_tokens,output_tokens,total_tokens) while every other interface usescamelCase. Likely mirrors upstream LLM API conventions but inconsistent with the file's own patterns. -
[api-shape]
workspaces/boost/plugins/boost-common/src/types.ts:155โlistModels()return type usessnake_case(owned_by,model_type), same inconsistency asResponseUsage. -
[forward-compatibility]
workspaces/boost/plugins/boost-common/src/types.ts:70โProviderConfigField.typeis a closed union. Adding new field types (e.g.,'textarea','password') would require consumers with exhaustive switches to update. -
[spec_deviation]
workspaces/boost/plugins/boost-node/src/services.ts:34โ AGENTS.md documentsboostAiProviderServiceRefas living inboost-common, but the implementation correctly places it inboost-nodeto avoid pulling@backstage/backend-plugin-apiinto browser bundles. AGENTS.md should be updated. -
[rbac-violation]
workspaces/boost/plugins/boost-common/src/permissions.ts:257โboostKagentiAdminPermissionuses action'update'which is shared with many other boost permissions. Backstage RBAC matches on permission name, so this is an informational note about policy configuration. -
[api-design]
workspaces/boost/plugins/boost-common/src/types.ts:155โlistModels()andtestModel()return inline anonymous object types. Consumers cannot reference these return types by name. Consider extracting into named interfaces.
Info
-
[rbac-violation]
workspaces/boost/plugins/boost-common/src/permissions.ts:336โ Conditional rule constants (IS_OWNER,IS_NOT_CREATOR,HAS_LIFECYCLE_STAGE) are string constants with no compile-time binding to their corresponding permissions. Enforcement depends entirely on the boost-backend implementation. -
[data-exposure]
workspaces/boost/plugins/boost-common/src/types.ts:519โStreamAuthRequiredEventexposes auth details including OAuth URLs and secret demands. Backend implementations must sanitize before sending to clients.
/fs-fix CI fails because report.api.md is missing for the new boost-common plugin. Run yarn build:api-reports from the boost workspace root and commit the generated plugins/boost-common/report.api.md. See how other workspaces do it: workspaces/lightspeed/plugins/lightspeed-common/report.api.md. If further CI steps fail after that (prettier, lint, tsc), run yarn chores from the workspace root to fix the full cascade in one pass.
๐ค Finished Fix ยท โ
Success ยท Started 9:24 PM UTC ยท Completed 9:53 PM UTC
Commit: 6c4b038 ยท View workflow run โ
๐ง Fix agent โ iteration 1 (human-triggered)
Generated missing API reports for boost-common and boost-node plugins. Fixed TSDoc escape warnings in permissions.ts that were blocking report generation. All tests pass (32/32), linting clean, prettier clean, tsc clean.
Fixed (3):
- missing report.api.md for boost-common plugin (
workspaces/boost/plugins/boost-common/report.api.md): Regenerated report.api.md with full API surface after fixing TSDoc escape warnings in permissions.ts - missing report.api.md for boost-node plugin (
workspaces/boost/plugins/boost-node/report.api.md): Generated new report.api.md for boost-node package via yarn build:api-reports - tsdoc-escape-greater-than warnings blocking API report generation (
workspaces/boost/plugins/boost-common/src/permissions.ts): Escaped '>' as '>' in TSDoc comments for boostAgentPromotePermission (line 70) and boostAgentApprovePermission (line 84) to fix tsdoc-escape-greater-than warnings
Tests: passed
Updated by fullsend fix agent
๐ค Finished Review ยท โ
Success ยท Started 9:54 PM UTC ยท Completed 10:03 PM UTC
Commit: 6c4b038 ยท View workflow run โ
/fs-fix please act upon review comment #3402 (comment) and reorganize boostResourcePermissions as boostAgentPermissions, boostToolPermissions, and boostInfraPermissions
๐ค Finished Fix ยท โ
Success ยท Started 10:04 PM UTC ยท Completed 10:34 PM UTC
Commit: daa1e8b ยท View workflow run โ
๐ง Fix agent โ iteration 2 (human-triggered)
Reorganized boostResourcePermissions into boostAgentPermissions, boostToolPermissions, and boostInfraPermissions per human instruction. All 32 tests pass.
Fixed (1):
- boostResourcePermissions name is misleading โ contains mix of BasicPermission and ResourcePermission (
workspaces/boost/plugins/boost-common/src/permissions.ts): Split boostResourcePermissions into three focused arrays: boostAgentPermissions (10 agent permissions), boostToolPermissions (5 tool permissions), and boostInfraPermissions (1 kagenti infra permission). Updated boostPermissions to spread all three. Updated exports in index.ts, tests in index.test.ts, and API report.
Tests: passed
Updated by fullsend fix agent
๐ค Review ยท Started 10:35 PM UTC
Commit: daa1e8b ยท View workflow run โ
๐ค Finished Review ยท โ
Success ยท Started 10:35 PM UTC ยท Completed 10:47 PM UTC
Commit: daa1e8b ยท View workflow run โ
/fs-fix so PR #3401 has merged, and it has updates to the openspec files that serve as input to issue #3297 ; rebase this pull request's branch in order to pull in the changes from #3401 and then see if the new code from the fullsend code agent , plus our prior fix, need additional changes
๐ค Finished Fix ยท โ Failure ยท Started 3:24 PM UTC ยท Completed 3:52 PM UTC
Commit: c01e852 ยท View workflow run โ
๐ค Review ยท Started 3:56 PM UTC
Commit: 5ab88af ยท View workflow run โ
CI Feedback ๐ง
(Feedback updated until commit https://github.com/redhat-developer/rhdh-plugins/commit/49687121e8a9875ea30597460c42721a259032cf)
A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
Action: check all required jobs |
|
Failed stage: Run exit 1 [โ] |
|
Failed test name: "" |
|
Failure summary: The action failed because a workflow step explicitly executed |
Relevant error logs:
|
๐ค Finished Review ยท โ
Success ยท Started 3:56 PM UTC ยท Completed 4:07 PM UTC
Commit: 5ab88af ยท View workflow run โ
/fs-fix so PR https://github.com/redhat-developer/rhdh-plugins/pull/3401 has merged, and it has updates to the openspec files that serve as input to issue https://github.com/redhat-developer/rhdh-plugins/issues/3297 ; rebase this pull request's branch in order to pull in the changes from https://github.com/redhat-developer/rhdh-plugins/pull/3401 and then see if the new code from the fullsend code agent , plus our prior fix, need additional changes
