Skip to content

Remove the log_feedback tool from agami-core - #92

Merged
ashwin-agami merged 1 commit into
mainfrom
remove-log-feedback-tool
Jul 7, 2026
Merged

ashwin-agami merged 1 commit into
mainfrom
remove-log-feedback-tool

Conversation

@ashwin-agami

Copy link
Copy Markdown
Contributor

What

Subtractive refactor of the MCP tool surface — removes the log_feedback tool and everything wired to it:

  • tools.pytool_log_feedback, the log_feedback entry in the TOOLS registry, _record_feedback, and the FEEDBACK_LOG constant.
  • contracts.pyLogFeedbackRequest, LogFeedbackResult, FeedbackRecord.
  • model_store.pyDbActivitySink.record_feedback.
  • ports.py / oss_adapters.py / store.py / curate.py — the ActivitySink.record_feedback member, the FileActivitySink feedback path/param, and stray references, so no dangling symbol or import remains.

The MCP surface is now the 4 product tools (list_datasources, get_datasource_schema, get_prompt_examples, execute_sql).

Left intentionally in place

  • The feedback tablemigrations/core/002_runtime.sql is untouched; the table is still created (empty, unused). Dropping it is destructive and out of scope. test_schema.py still asserts it exists.
  • query_executions and its sink — unchanged.

Not touched (different feature — flagging to avoid confusion)

The /agami-model dashboard's "Generate feedback for Claude" back-channel (parsed by parse_model_feedback.py) is a separate feature that happens to share the word "feedback." Its tests (test_model_feedback.py) and its docs (usage.md, trust-layer.md) are deliberately left as-is.

Verification

  • rg -i "feedback" packages/agami-core/src -> zero hits.
  • TOOLS no longer contains log_feedback; imports resolve clean.
  • Full suite: 1312 passed; ruff check + format clean; gitleaks clean.
  • Diff is subtractive: 29 insertions / 219 deletions across 18 files.

Copilot AI review requested due to automatic review settings July 7, 2026 10:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Removes the log_feedback MCP tool and its supporting contracts/ports/adapters so agami-core’s MCP surface is limited to the four product tools (list_datasources, get_datasource_schema, get_prompt_examples, execute_sql). This simplifies the runtime activity logging surface area while keeping the existing DB schema (including the feedback table) intact.

Changes:

  • Deleted the log_feedback tool implementation and removed it from the shared TOOLS registry.
  • Removed feedback-related contracts and ActivitySink/sink implementations for recording feedback.
  • Updated tests and documentation to reflect the 4-tool MCP surface and the updated runtime log formats.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/test_tools_registry.py Updates the expected tool surface to 4 tools and moves log_feedback into dropped-tools assertions.
tests/test_ports.py Updates FileActivitySink test coverage to remove feedback logging expectations.
tests/test_oauth_server.py Updates expected tools/list results to remove log_feedback.
tests/test_mcp_http.py Updates HTTP transport tool-surface expectations to 4 tools.
tests/test_mcp_harness.py Updates stdio transport tool-surface expectations to remove log_feedback.
tests/test_db_activity_sink.py Removes DB-path tests for log_feedback and adjusts module description accordingly.
tests/test_contracts.py Removes roundtrip tests for feedback-related contracts and sink record shapes.
tests/test_admin_activity.py Updates tool iteration to exclude log_feedback when checking common schema properties.
packages/agami-core/src/tools.py Removes tool_log_feedback, feedback logging helpers/constants, and the log_feedback registry entry.
packages/agami-core/src/store.py Updates module docstring to reflect query logging only (no feedback logging).
packages/agami-core/src/semantic_model/curate.py Updates comment wording to avoid referring to a “feedback generator” in this context.
packages/agami-core/src/ports.py Removes record_feedback from the ActivitySink protocol and updates docs accordingly.
packages/agami-core/src/oss_adapters.py Simplifies FileActivitySink to only log query executions; removes feedback path handling.
packages/agami-core/src/model_store.py Removes DbActivitySink.record_feedback and updates class docstring.
packages/agami-core/src/contracts.py Removes LogFeedback* and FeedbackRecord contracts; updates top-level module docs to “4 product tools”.
docs/mcp-server.md Removes log_feedback from the documented tool list.
docs/format-spec.md Removes feedback from the documented query_log.jsonl record format.
docs/credentials.md Updates the BigQuery credential example key name to service_account_path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/mcp-server.md
Comment on lines 28 to 30
| `get_datasource_schema` | Return the semantic model: the subject-area index, full per-table detail for requested `dataset_names`, plus `ORGANIZATION.md` / `USER_MEMORY.md`. |
| `get_prompt_examples` | Return the curated `examples.yaml` few-shot library. |
| `execute_sql` | Run **one read-only** `SELECT` / `WITH...SELECT` locally and return `{columns, rows, row_count, ...}`. DML/DDL/multi-statement are rejected. |

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed — the intro now reads "Four tools" (this was a spelled-out "Five" my count-sweep missed). Pushed.

Comment thread tests/test_mcp_harness.py
Comment on lines 233 to 237
tools = {t["name"] for t in by_id[2]["result"]["tools"]}
assert tools == {
"list_datasources", "get_datasource_schema",
"get_prompt_examples", "execute_sql", "log_feedback",
"get_prompt_examples", "execute_sql",
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Already addressed — the comment now reads "4 product tools" (fixed in the review pass before this Copilot run landed).

Comment on lines 402 to 407
assert names == {
"list_datasources",
"get_datasource_schema",
"get_prompt_examples",
"execute_sql",
"log_feedback",
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Already addressed — the comment now reads "4 product tools" (fixed in the earlier review pass).

Comment thread tests/test_mcp_http.py
Comment on lines 20 to 25
PRODUCT_TOOLS = {
"list_datasources",
"get_datasource_schema",
"get_prompt_examples",
"execute_sql",
"log_feedback",
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch — the docstring was already updated to "4", and I have now also renamed the test test_http_tools_list_is_the_same_five..._same_four. Pushed.

@ashwin-agami
ashwin-agami force-pushed the remove-log-feedback-tool branch from 8ee56ac to 67087bd Compare July 7, 2026 10:14
Subtractive refactor of the MCP tool surface: drops the log_feedback tool, its
FeedbackRecord / LogFeedbackResult contracts, the DbActivitySink.record_feedback
sink, and the port / adapter / file-sink wiring, so no dangling symbol remains.
The runtime feedback table is left in place (unused). Tests and the MCP + format
docs are updated to match; the model-review 'Generate feedback for Claude'
back-channel is a separate feature and is untouched.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated no new comments.

@ashwin-agami
ashwin-agami merged commit 7b02cec into main Jul 7, 2026
7 checks passed
@ashwin-agami
ashwin-agami deleted the remove-log-feedback-tool branch July 7, 2026 10:28
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants