Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions model/description/function.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"brief": "Function",
"operations": [
{
"name": "Function execution",
"brief": "The execution of a function or a set of instructions that isn't covered by a more specific operation.",
"ops": ["function"],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The system lacks validation to ensure that ops referenced in name/description files (e.g., function.json) actually exist, creating a risk of future inconsistencies if ops are modified.
Severity: LOW

Suggested Fix

Enhance the test suite (test/name.test.ts and test/description.test.ts) to validate that all strings listed in the ops array of name and description files correspond to an existing operation defined in one of the model/op/*.json category files. This will enforce referential integrity and prevent future breakages.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: model/description/function.json#L7

Potential issue: The schemas for name and description files, `name.schema.json` and
`description.schema.json`, define the `ops` field as an array of strings without any
validation that these strings correspond to actual operations defined in `model/op/`.
While the `function` op referenced in the new files does exist in
`model/op/general.json`, the system lacks a test to enforce this referential integrity.
This creates a potential for future inconsistencies, where an op could be renamed or
removed from the `model/op/` files, but the corresponding name/description files would
not be flagged as invalid by the test suite, leading to broken behavior for those
operations.

Also affects:

  • model/name/function.json:8

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. will address in a follow-up!

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The new generic "function" naming rules will unintentionally apply to more specific sub-ops like "function.gcp" and "function.nextjs" due to prefix matching.
Severity: LOW

Suggested Fix

To prevent unintended inheritance, consider adding specific (even if empty) naming and description rules for each of the function.* sub-ops. Alternatively, if this fallback behavior is desired, document this interaction in the PR description to confirm it is intentional.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: model/description/function.json#L7

Potential issue: The new generic naming and description rules for the `"function"`
operation will be inherited by more specific sub-operations like `"function.gcp"`,
`"function.aws"`, and `"function.nextjs"`. This is due to a prefix-matching mechanism
where specific ops inherit rules from their parent if no specific rules exist for them.
The pull request does not acknowledge this inheritance, suggesting it may be an
unintended side effect. This could lead to these more specific function spans receiving
generic names instead of potentially more appropriate, specific ones.

Also affects:

  • model/name/function.json:8

"templates": ["{{code.function.name}}"],
"examples": ["server_request", "handleSubmit"]
}
]
}
13 changes: 13 additions & 0 deletions model/name/function.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"brief": "Function",
"operations": [
{
"name": "Function execution",
"brief": "The execution of a function or a set of instructions that isn't covered by a more specific operation.",
"is_in_otel": false,
"ops": ["function"],
"templates": ["{{code.function.name}}", "Function execution"],
"examples": ["server_request", "handleSubmit", "Function execution"]
}
]
}
Loading