luigidemasi commented on code in PR #27649:
URL: https://github.com/apache/camel/pull/27649#discussion_r4237165393
##########
dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiToolRegistry.java:
##########
@@ -231,17 +231,18 @@ private String callSaveSummary(Map<String, Object> args) {
/** The TUI's own read-only tools; the shared tools add those flagged
read-only in the registry. */
private static final Set<String> READ_ONLY_TUI_TOOLS = Set.of(
- "tui_get_ai_log", "tui_get_diagram", "tui_get_events",
"tui_get_history", "tui_get_mcp_log",
+ "tui_get_audit", "tui_get_ai_log", "tui_get_diagram",
"tui_get_events", "tui_get_history", "tui_get_mcp_log",
"tui_get_ollama", "tui_get_options", "tui_get_processor_detail",
"tui_get_readme", "tui_get_screen",
"tui_get_spans", "tui_http_endpoints",
"tui_get_state", "tui_get_status", "tui_get_table",
"tui_get_themes", "tui_get_topology",
"tui_list_examples", "tui_locate", "tui_wait_for_idle");
/**
- * Tools that only return information and never change the TUI, the
integration or its data. The ACP permission
- * handler approves calls to these without asking; anything else,
including camel_control, tui_send_message and
- * tui_execute_sql, is put in front of the user. camel_eval_expression is
read-only because it evaluates an
- * expression against a scratch exchange and sends nothing through a route.
+ * Tools that inspect information without executing application actions or
editing data. An inspection may select
Review Comment:
Fixed in `fa99d7d1407991cf4c2e0bafbf9ce1e6f146a1aa`. tui_get_audit now
issues an independent runtime query and returns records/evidence directly. It
does not navigate or alter the visible filters, page or selection; a regression
verifies unchanged screen data and no navigation-bridge interaction. Its
arguments are stateless filters, cursor/limit, or eventId alone. I also added a
semantic capability group and conditional tool loading in both core and full AI
modes. Ordinary full mode is back under the original 10,500-token budget; tests
separately bound the added cost for a semantic integration. The documentation
and read-only definition were updated accordingly.
_AI-generated by OpenAI Codex on behalf of @luigidemasi via
/oss-address-review._
##########
components/camel-ai/camel-semantic/src/main/java/org/apache/camel/language/semantic/SemanticLanguage.java:
##########
@@ -672,10 +731,14 @@ private Object evaluate(Exchange exchange, boolean
asPredicate) {
"Unsupported state type for semantic evaluations:
" + names
+ ". Select strings,
maps or lists explicitly");
}
+ exchange.setProperty(SemanticAudit.REFERENCES,
invocations.values().stream()
+
.map(SemanticAudit.Invocation::getEventId).filter(Objects::nonNull).toList());
// Check every group's input before invoking any provider.
for (Group group : current.groups) {
try {
for (var entry : group.evaluations.entrySet()) {
+ active.clear();
+ active.add(invocations.get(entry.getKey()));
Review Comment:
I checked this with a regression in
`fa99d7d1407991cf4c2e0bafbf9ce1e6f146a1aa`: when B rejects input, the provider
invocation count is zero, A is not_executed/evaluation_aborted, and B is
failed/invalid_input. Input validation is preparation, not evaluation
execution. I retained those labels and documented the distinction; including A
in active would instead mark a valid, unexecuted member as failed.
_AI-generated by OpenAI Codex on behalf of @luigidemasi via
/oss-address-review._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]