freemo
d3cc7d30d7
fix(tool): persist tool registration to database after add
...
ToolRegistryRepository.create(), .update(), and .delete() called
session.flush() but never session.commit(). The CLI factory creates a
raw sessionmaker without a UnitOfWork wrapper, so the transaction was
never committed and SQLAlchemy performed an implicit rollback when the
session was garbage-collected.
The same bug existed in ValidationAttachmentRepository.attach() and
.detach().
Changes:
- Add session.commit() after session.flush() in all five mutating
methods across ToolRegistryRepository and
ValidationAttachmentRepository.
- Add finally: session.close() to guarantee session cleanup regardless
of success or failure.
- Update class docstrings to reflect the new commit-on-write semantics.
- Add Behave BDD feature (tool_add_persist.feature) with scenarios for
single-tool round-trip, multi-tool persistence, and duplicate
rejection, using file-based SQLite to reproduce the cross-session
issue.
- Add Robot Framework integration test (tool_add_persist.robot) with
add-then-list and fresh-list-empty scenarios.
- Add ASV benchmark (tool_add_persist_bench.py) with
track_list_after_add_count metric.
Key decisions:
- File-based SQLite (not in-memory) is used in tests because the bug
only manifests when the session/engine is fully disposed between add
and list, simulating separate CLI invocations.
- Step patterns are prefixed with "tool-persist" to avoid AmbiguousStep
collisions with existing tool_registry_steps.py.
- The commit-in-repository approach was chosen over adding a UnitOfWork
to the CLI factory because the CLI commands are simple CRUD operations
that should auto-persist without requiring callers to remember to
commit.
ISSUES CLOSED : #621
2026-03-08 22:11:49 +00:00
..
2025-12-10 14:42:09 -05:00
2026-03-03 03:29:31 +00:00
2026-03-05 15:13:19 +00:00
2026-03-05 10:27:36 -05:00
2026-03-07 14:53:18 +00:00
2026-03-05 01:28:50 +00:00
2026-02-22 17:22:52 +00:00
2026-03-02 22:45:55 -05:00
2026-02-08 11:33:30 -05:00
2026-02-14 12:16:39 -05:00
2026-02-18 23:55:05 +00:00
2026-02-14 12:16:39 -05:00
2026-02-22 00:43:08 -05:00
2026-02-13 09:41:28 -05:00
2026-02-13 09:41:28 -05:00
2026-03-02 02:01:27 +00:00
2026-02-20 15:57:21 +00:00
2026-02-13 09:41:28 -05:00
2026-02-13 19:01:55 +05:30
2026-02-10 16:04:17 +00:00
2026-02-12 05:44:57 +00:00
2026-02-24 19:12:01 +00:00
2026-02-24 17:57:18 +00:00
2026-02-24 17:57:18 +00:00
2026-02-12 22:01:51 +00:00
2026-02-16 14:21:06 -05:00
2026-02-18 12:18:37 +00:00
2026-02-25 10:30:42 +00:00
2026-02-20 20:24:10 +00:00
2026-02-20 08:48:33 -05:00
2026-02-12 22:01:51 +00:00
2026-02-20 08:48:33 -05:00
2026-02-20 08:48:33 -05:00
2026-02-22 08:31:45 +00:00
2026-02-25 10:30:42 +00:00
2025-12-19 12:35:56 -05:00
2026-02-13 05:01:27 +00:00
2026-02-02 18:46:33 -05:00
2026-02-26 09:10:35 +00:00
2026-01-27 21:55:06 -05:00
2025-11-24 20:04:18 -05:00
2025-11-28 23:52:23 -05:00
2025-12-08 23:02:29 -05:00
2026-02-25 10:01:57 +00:00
2026-02-25 10:05:57 +00:00
2026-03-04 23:47:20 +00:00
2026-02-13 21:54:31 +00:00
2025-12-22 11:18:57 -05:00
2026-02-27 09:47:10 -05:00
2026-02-20 15:57:21 +00:00
2026-02-20 08:50:06 -05:00
2026-03-02 17:44:18 +00:00
2026-02-18 03:27:00 +00:00
2026-02-20 15:57:21 +00:00
2026-03-02 17:44:18 +00:00
2026-02-22 10:19:43 +00:00
2026-02-28 22:06:57 +00:00
2026-02-18 03:27:00 +00:00
2026-02-18 03:27:00 +00:00
2026-02-27 13:47:42 -05:00
2026-03-01 03:09:51 +00:00
2026-02-21 16:27:40 +00:00
2026-02-18 03:27:00 +00:00
2026-02-27 23:08:55 +00:00
2026-02-27 23:08:55 +00:00
2026-03-01 03:09:51 +00:00
2026-03-02 10:18:14 +00:00
2026-02-16 14:21:06 -05:00
2026-02-22 00:43:08 -05:00
2026-02-22 00:43:08 -05:00
2026-02-07 23:02:50 -05:00
2026-03-03 17:04:17 -05:00
2026-02-18 12:18:03 +00:00
2026-02-24 20:11:42 +00:00
2026-03-06 20:28:37 +00:00
2026-02-20 15:57:21 +00:00
2026-02-20 20:34:29 +00:00
2025-11-16 20:38:02 -05:00
2026-02-22 00:43:08 -05:00
2026-02-20 15:57:21 +00:00
2026-02-18 03:27:00 +00:00
2026-02-18 03:27:00 +00:00
2026-01-17 12:54:03 -05:00
2026-03-02 02:01:27 +00:00
2026-03-07 11:49:14 -05:00
2026-02-25 10:48:05 -05:00
2026-03-01 04:38:30 +00:00
2026-03-01 04:38:30 +00:00
2026-03-01 04:38:30 +00:00
2026-01-27 21:55:06 -05:00
2026-03-02 15:05:20 +00:00
2026-02-23 10:44:58 +00:00
2026-03-02 09:47:40 -05:00
2026-02-10 16:04:17 +00:00
2026-02-27 09:47:10 -05:00
2026-02-10 16:04:17 +00:00
2026-02-27 09:47:10 -05:00
2026-02-27 09:47:10 -05:00
2026-03-03 23:36:15 +00:00
2026-03-05 14:11:23 +00:00
2026-02-08 11:33:30 -05:00
2025-12-05 21:00:46 -05:00
2026-02-27 09:47:10 -05:00
2026-02-27 09:47:10 -05:00
2026-03-02 02:01:27 +00:00
2026-03-05 12:58:57 +00:00
2026-03-05 22:00:15 +00:00
2026-03-03 17:01:57 +00:00
2026-02-13 00:15:58 +00:00
2025-12-11 13:55:55 -05:00
2026-02-14 04:01:20 +00:00
2026-02-22 17:15:51 +00:00
2026-02-22 17:56:18 +00:00
2026-02-25 19:38:43 -05:00
2026-02-24 12:19:04 -05:00
2026-02-22 16:15:49 -05:00
2026-02-25 12:08:01 -05:00
2026-02-16 16:46:54 -05:00
2026-02-24 00:41:01 +00:00
2026-03-02 02:01:27 +00:00
2026-02-25 10:06:59 +00:00
2026-02-13 22:25:16 +00:00
2026-02-13 18:54:15 +00:00
2026-02-16 21:35:54 +00:00
2026-03-04 21:20:47 +00:00
2026-03-04 21:20:47 +00:00
2026-03-02 14:32:31 +00:00
2025-11-24 20:04:18 -05:00
2025-12-19 12:35:56 -05:00
2026-02-20 15:57:21 +00:00
2026-02-20 15:57:21 +00:00
2026-02-24 12:19:04 -05:00
2026-02-22 16:15:49 -05:00
2026-02-22 00:43:08 -05:00
2026-03-04 23:47:20 +00:00
2026-02-23 22:20:03 +00:00
2026-02-26 16:13:44 +00:00
2026-02-26 16:13:44 +00:00
2026-03-03 12:53:28 +00:00
2026-03-03 12:53:28 +00:00
2026-03-03 21:44:20 +00:00
2026-02-25 10:04:31 +00:00
2026-03-05 15:42:20 +00:00
2026-03-02 22:09:37 -05:00
2026-02-25 10:02:38 +00:00
2026-03-06 20:07:03 +00:00
2025-12-06 00:23:48 -05:00
2026-02-13 20:34:57 +00:00
2026-02-12 02:26:03 +00:00
2026-02-25 10:05:10 +00:00
2026-02-25 10:07:09 +00:00
2026-03-03 15:42:53 +00:00
2026-03-03 14:48:55 -05:00
2026-02-19 14:20:16 +00:00
2026-02-19 14:20:16 +00:00
2026-02-21 18:11:31 +00:00
2026-02-16 21:35:54 +00:00
2026-02-14 04:01:20 +00:00
2026-02-12 02:26:03 +00:00
2026-03-04 15:36:34 +00:00
2026-02-22 16:15:49 -05:00
2026-02-22 09:23:35 +00:00
2026-03-04 20:26:42 +00:00
2026-02-12 02:26:03 +00:00
2026-01-27 21:55:06 -05:00
2026-01-27 21:55:06 -05:00
2026-01-27 21:55:06 -05:00
2026-02-12 04:47:02 +00:00
2026-02-12 04:47:02 +00:00
2026-02-12 04:47:02 +00:00
2026-01-27 21:55:06 -05:00
2026-01-27 21:55:06 -05:00
2025-12-11 13:55:55 -05:00
2026-03-03 21:44:20 +00:00
2026-03-03 21:44:20 +00:00
2025-11-13 18:25:24 -05:00
2026-02-20 15:57:21 +00:00
2026-03-03 17:04:17 -05:00
2026-02-27 13:47:42 -05:00
2026-02-22 16:15:49 -05:00
2026-02-22 10:15:25 +00:00
2026-03-06 18:16:47 +00:00
2026-02-25 04:50:43 +00:00
2026-02-25 04:13:55 +00:00
2026-02-26 01:13:16 +00:00
2026-02-26 02:01:47 +00:00
2026-03-03 23:36:15 +00:00
2026-02-27 22:33:47 +00:00
2026-03-02 17:44:18 +00:00
2026-03-02 02:01:27 +00:00
2026-02-25 14:17:34 +00:00
2025-11-30 17:36:52 -05:00
2026-02-12 22:01:51 +00:00
2025-12-23 17:12:16 -05:00
2026-02-25 19:38:43 -05:00
2026-02-25 19:38:43 -05:00
2026-02-25 19:38:43 -05:00
2026-03-02 02:01:27 +00:00
2025-11-24 20:04:18 -05:00
2026-03-03 14:55:58 -05:00
2026-02-13 21:54:31 +00:00
2026-02-12 20:19:42 +00:00
2026-02-12 02:26:03 +00:00
2026-02-12 02:26:03 +00:00
2026-02-21 10:23:33 -05:00
2026-02-28 20:21:18 +00:00
2026-02-20 20:34:29 +00:00
2026-02-23 09:47:00 -05:00
2026-02-21 10:23:33 -05:00
2026-03-01 03:09:51 +00:00
2026-02-27 13:47:42 -05:00
2026-02-24 12:19:04 -05:00
2026-02-25 19:38:43 -05:00
2026-02-20 15:57:21 +00:00
2026-02-27 13:47:42 -05:00
2026-02-25 19:38:43 -05:00
2026-02-20 15:57:21 +00:00
2026-02-25 19:38:43 -05:00
2026-02-13 05:01:27 +00:00
2026-03-01 03:09:51 +00:00
2026-03-07 19:36:09 +00:00
2026-02-10 16:04:17 +00:00
2026-02-21 10:23:33 -05:00
2026-02-22 00:43:08 -05:00
2026-02-22 15:13:43 +00:00
2026-02-27 13:47:42 -05:00
2026-03-01 03:09:51 +00:00
2026-02-22 16:15:49 -05:00
2026-03-03 12:53:28 +00:00
2026-03-03 12:10:25 +00:00
2026-02-12 02:26:03 +00:00
2026-02-27 09:47:10 -05:00
2026-02-27 09:47:10 -05:00
2026-02-13 20:34:57 +00:00
2026-03-05 21:38:55 +00:00
2026-02-20 15:57:21 +00:00
2026-03-01 03:09:51 +00:00
2026-02-25 19:38:43 -05:00
2026-02-17 00:37:53 +00:00
2026-02-25 14:00:04 -05:00
2026-02-24 12:19:04 -05:00
2026-02-15 00:12:07 -05:00
2026-02-25 19:38:43 -05:00
2026-02-15 00:12:07 -05:00
2026-02-20 15:57:21 +00:00
2026-02-22 00:43:08 -05:00
2026-03-02 02:01:27 +00:00
2026-02-15 06:16:19 +00:00
2026-02-20 15:57:21 +00:00
2026-02-25 14:00:04 -05:00
2026-03-02 02:01:27 +00:00
2026-02-22 00:43:08 -05:00
2026-03-03 14:40:37 +00:00
2026-02-17 16:40:18 +00:00
2026-02-18 03:27:00 +00:00
2026-02-16 23:56:55 -05:00
2026-03-05 21:38:55 +00:00
2026-03-03 23:36:15 +00:00
2026-02-18 03:27:00 +00:00
2026-02-17 02:24:35 +00:00
2026-02-12 05:23:29 +00:00
2026-02-15 11:04:18 -05:00
2026-02-27 09:47:10 -05:00
2025-12-10 12:39:07 -05:00
2025-12-24 18:50:34 -05:00
2026-01-28 13:33:45 -05:00
2026-02-12 23:35:53 -05:00
2026-02-12 20:19:42 +00:00
2026-02-10 16:04:17 +00:00
2026-01-27 21:55:06 -05:00
2026-02-24 12:19:04 -05:00
2026-02-23 03:11:12 +00:00
2026-02-20 15:57:21 +00:00
2026-02-27 13:47:42 -05:00
2026-03-02 17:44:18 +00:00
2026-03-01 03:09:51 +00:00
2026-03-06 03:22:45 +00:00
2026-03-02 17:44:18 +00:00
2026-02-20 15:57:21 +00:00
2026-02-18 23:55:05 +00:00
2026-02-18 23:55:05 +00:00
2026-02-20 08:48:33 -05:00
2026-02-18 03:27:00 +00:00
2026-02-24 12:19:04 -05:00
2026-02-23 22:20:44 +00:00
2026-03-07 19:36:09 +00:00
2026-02-13 21:54:31 +00:00
2026-02-18 03:27:00 +00:00
2026-02-17 21:07:54 +00:00
2026-02-20 08:49:30 -05:00
2026-03-06 20:44:36 +00:00
2026-03-07 19:36:09 +00:00
2026-02-15 10:44:14 -05:00
2026-02-18 03:27:00 +00:00
2026-02-15 15:19:09 +00:00
2026-03-02 02:01:27 +00:00
2026-02-20 20:38:53 +00:00
2026-01-27 21:55:06 -05:00
2026-01-27 21:55:06 -05:00
2026-01-27 21:55:06 -05:00
2026-02-10 16:04:17 +00:00
2026-03-03 22:21:14 +00:00
2026-03-03 22:21:14 +00:00
2026-03-04 15:59:15 +00:00
2026-03-02 10:18:14 +00:00
2026-02-27 13:47:42 -05:00
2026-02-14 04:01:20 +00:00
2026-02-16 14:21:06 -05:00
2026-02-12 20:19:42 +00:00
2026-02-20 03:31:43 +00:00
2026-03-06 00:49:33 +00:00
2026-03-06 00:49:33 +00:00
2026-03-05 21:38:55 +00:00
2026-02-25 04:50:43 +00:00
2026-02-21 16:32:03 +00:00
2026-02-25 10:05:57 +00:00
2026-02-26 20:33:20 +00:00
2026-02-13 19:24:24 +00:00
2026-02-19 11:15:18 +00:00
2026-02-25 10:06:27 +00:00
2026-03-04 12:18:51 -05:00
2026-02-28 17:46:54 +00:00
2026-03-02 22:05:53 +00:00
2026-03-02 09:47:40 -05:00
2026-02-18 03:27:00 +00:00
2026-03-02 02:01:27 +00:00
2026-02-20 01:10:19 +00:00
2026-02-22 00:43:08 -05:00
2026-02-20 15:57:21 +00:00
2026-02-20 15:57:21 +00:00
2026-02-18 00:10:15 +00:00
2025-12-10 12:39:07 -05:00
2026-03-05 21:38:55 +00:00
2026-03-08 02:57:44 +00:00
2026-02-26 10:57:07 +00:00
2026-02-27 13:47:42 -05:00
2026-02-24 12:19:04 -05:00
2026-02-26 10:57:07 +00:00
2026-02-20 08:50:08 -05:00
2026-02-24 17:57:18 +00:00
2026-02-21 10:23:33 -05:00
2026-02-24 17:57:18 +00:00
2026-02-20 08:50:08 -05:00
2026-02-20 08:50:08 -05:00
2026-02-20 08:50:08 -05:00
2026-03-02 02:01:27 +00:00
2026-02-27 20:09:26 +00:00
2026-02-25 10:03:57 +00:00
2026-02-21 16:30:40 +00:00
2026-02-17 19:58:15 +00:00
2026-02-17 10:13:19 +00:00
2026-02-21 10:23:33 -05:00
2026-01-27 21:55:06 -05:00
2026-02-12 20:19:42 +00:00
2026-02-02 18:46:33 -05:00
2026-02-08 11:33:30 -05:00
2026-02-12 20:19:42 +00:00
2026-02-12 20:19:42 +00:00
2026-02-12 20:19:42 +00:00
2026-02-21 16:32:03 +00:00
2026-03-02 02:01:27 +00:00
2026-02-20 20:34:29 +00:00
2026-03-02 09:41:25 -05:00
2026-02-22 00:43:08 -05:00
2026-02-20 15:57:21 +00:00
2026-03-08 22:11:49 +00:00
2026-02-14 14:03:28 -05:00
2026-02-20 08:49:30 -05:00
2026-02-20 08:49:30 -05:00
2026-02-22 00:43:08 -05:00
2026-02-16 21:35:54 +00:00
2026-02-14 18:55:48 +00:00
2026-02-17 21:14:46 +00:00
2026-02-17 22:59:16 -05:00
2026-02-25 10:03:57 +00:00
2026-02-22 00:43:08 -05:00
2026-02-17 20:28:20 +00:00
2026-02-21 10:23:33 -05:00
2026-02-14 13:46:10 -05:00
2026-03-04 18:21:19 +00:00
2026-03-05 19:20:39 +00:00
2026-03-06 23:14:30 +00:00
2026-03-04 22:40:34 +00:00
2026-03-05 21:38:55 +00:00
2026-02-20 15:57:21 +00:00
2026-02-25 10:03:21 +00:00
2026-02-22 00:43:08 -05:00
2026-02-20 02:54:08 +00:00
2026-03-02 02:01:27 +00:00
2026-02-25 10:03:57 +00:00
2026-02-12 20:19:42 +00:00
2026-02-10 16:04:17 +00:00
2026-02-12 22:01:51 +00:00
2026-02-16 14:21:06 -05:00