brent.edwards
26de6bb7de
fix(project): persist project to database during creation ( #591 )
...
## Summary
Fix `agents project create` not persisting projects to the database. `NamespacedProjectRepository.create()` called `session.flush()` but never `session.commit()`, so projects were invisible to subsequent `agents project list` invocations that open a separate session.
## Changes
**Production fix** (`src/cleveragents/infrastructure/database/repositories.py`):
- Replace `session.flush()` with `session.commit()` in `NamespacedProjectRepository.create()`
- Add `finally: session.close()` guard for proper session lifecycle
**Tests & benchmarks**:
- 4 Behave BDD regression scenarios (`features/project_create_persist.feature`)
- Robot Framework integration smoke tests (`robot/project_create_persist.robot`)
- ASV benchmarks for create-then-list round-trip (`benchmarks/project_create_persist_bench.py`)
## Review feedback addressed
- **H3**: Added `finally: session.close()` to `create()` method
- **M1**: Removed redundant `session.flush()` before `session.commit()`
- **M2**: Updated stale TDD "expected to fail" comments — this PR includes the fix
- **M4**: Rewrote CHANGELOG entry to describe the fix, not just tests
- **F1**: Updated Robot documentation (Suite Setup/Teardown kept — needed for `${PYTHON}`)
- **F2**: Fixed bare assertion `"my-app"` to `"local/my-app"` in namespace scenario
- **F3**: Removed redundant `Base.metadata.create_all()` from `_make_fresh_repo()`
## Process
- Single squashed commit, rebased onto `master` (no merge commits)
- Prescribed commit message from issue #589 metadata
ISSUES CLOSED : #589
Reviewed-on: cleveragents/cleveragents-core#591
Reviewed-by: Rui Hu <rui.hu@cleverthis.com >
Co-authored-by: Brent E. Edwards <brent.edwards@cleverthis.com >
Co-committed-by: Brent E. Edwards <brent.edwards@cleverthis.com >
2026-03-09 06:59:15 +00:00
..
2026-03-02 22:05:53 +00:00
2026-03-06 18:16:47 +00:00
2026-03-09 06:59:15 +00: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-03-02 22:45:55 -05:00
2026-02-14 12:16:39 -05:00
2026-02-14 12:16:39 -05:00
2026-02-14 12:16:39 -05:00
2026-02-14 12:16:39 -05:00
2026-02-17 20:25:12 +00:00
2026-02-13 09:41:28 -05:00
2026-02-12 20:19:42 +00:00
2026-02-08 11:33:30 -05:00
2026-02-24 19:12:01 +00:00
2026-02-12 22:58:15 -05:00
2026-03-02 08:17:21 +00:00
2026-02-20 20:24:10 +00:00
2026-02-12 22:01:51 +00:00
2026-02-08 11:33:30 -05:00
2026-02-25 10:30:42 +00:00
2025-12-19 12:35:56 -05:00
2026-02-26 09:10:35 +00:00
2025-12-10 16:46:55 -05:00
2026-02-25 10:01:57 +00:00
2026-02-12 20:19:42 +00:00
2026-03-04 23:47:20 +00:00
2025-12-22 11:18:57 -05:00
2025-12-23 20:57:14 -05:00
2026-02-12 20:19:42 +00:00
2026-02-20 08:50:06 -05:00
2026-02-20 15:57:21 +00:00
2026-02-28 22:06:57 +00:00
2026-03-01 03:09:51 +00:00
2026-02-26 02:47:14 +00:00
2026-02-27 13:47:42 -05:00
2026-03-01 03:09:51 +00:00
2026-03-02 10:18:14 +00:00
2026-02-12 22:01:51 +00:00
2026-02-22 00:43:08 -05:00
2026-02-22 00:43:08 -05:00
2026-03-03 14:55:58 -05:00
2026-02-16 23:50:59 -05:00
2026-02-24 20:11:42 +00:00
2026-03-07 19:36:09 +00:00
2026-02-20 15:57:21 +00:00
2026-02-19 22:44:34 +00:00
2026-02-22 00:43:08 -05:00
2026-02-14 13:51:12 -05:00
2025-12-23 17:12:16 -05:00
2026-03-02 02:01:27 +00:00
2026-01-17 12:54:03 -05:00
2026-02-18 12:18:03 +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-03-02 15:05:20 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 17:44:18 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-03-02 14:56:13 +00:00
2026-02-12 22:58:15 -05:00
2026-02-12 22:01:51 +00:00
2026-03-03 23:36:15 +00:00
2026-03-05 14:11:23 +00:00
2026-02-12 22:58:15 -05:00
2026-02-12 22:01:51 +00:00
2025-12-16 17:20:37 -05: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-08 11:33:30 -05:00
2026-02-24 12:19:04 -05:00
2026-02-25 12:08:01 -05:00
2026-02-16 16:46:54 -05:00
2025-12-23 17:12:16 -05:00
2026-02-13 18:54:15 +00:00
2026-03-04 21:20:47 +00:00
2026-03-02 14:32:31 +00:00
2025-12-19 12:35:56 -05:00
2026-02-16 21:35:54 +00:00
2026-02-13 20:34:57 +00:00
2026-02-24 12:19:04 -05:00
2026-02-22 15:29:41 -05:00
2026-02-22 00:43:08 -05:00
2025-12-19 12:35:56 -05:00
2026-02-27 02:33:42 +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-06 23:14:30 +00:00
2026-03-02 22:09:37 -05:00
2026-03-06 20:07:03 +00:00
2026-03-06 20:07:03 +00:00
2026-02-13 20:34:57 +00:00
2026-03-05 01:28:50 +00:00
2026-02-25 10:05:10 +00:00
2026-02-25 10:07:09 +00:00
2026-03-02 11:54:53 +00:00
2026-03-03 14:48:55 -05:00
2026-02-19 13:46:48 +00:00
2026-02-21 16:30:33 +00:00
2026-02-16 21:35:54 +00:00
2026-02-14 04:01:20 +00:00
2026-03-04 15:36:34 +00:00
2026-02-22 15:29:41 -05:00
2026-03-04 20:26:42 +00:00
2026-03-03 21:44:20 +00:00
2026-02-17 00:38:33 +00:00
2026-03-03 17:04:17 -05:00
2026-02-27 13:47:42 -05:00
2026-02-22 15:29:41 -05:00
2026-03-06 18:16:47 +00:00
2026-02-25 04:50:43 +00:00
2026-02-25 22:09:26 +00:00
2026-02-26 02:01:47 +00:00
2026-03-03 23:36:15 +00:00
2026-02-25 13:17:26 +00: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-03 14:55:58 -05:00
2026-02-21 10:23:33 -05:00
2026-02-28 20:21:18 +00:00
2026-02-20 00:28:15 +00:00
2026-02-23 10:45:01 +00:00
2026-02-21 10:18:26 -05:00
2026-03-01 03:09:51 +00:00
2026-02-24 12:19:04 -05:00
2026-02-25 19:38:43 -05:00
2026-02-16 21:35:54 +00:00
2026-02-27 13:47:42 -05:00
2026-02-14 13:42:02 -05:00
2026-02-12 22:58:15 -05:00
2026-03-01 03:09:51 +00:00
2026-03-02 02:01:27 +00:00
2026-02-22 15:29:41 -05:00
2026-02-08 11:33:30 -05:00
2026-03-08 23:28:05 +00:00
2026-02-22 00:43:08 -05:00
2026-02-21 10:23:33 -05:00
2026-02-27 13:47:42 -05:00
2026-03-01 03:09:51 +00:00
2026-02-22 15:29:41 -05:00
2026-03-03 12:10:25 +00:00
2026-03-03 12:10:25 +00:00
2025-12-10 20:25:11 -05:00
2025-12-16 17:20:37 -05:00
2026-02-12 20:19:42 +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-15 00:12:07 -05:00
2026-03-02 02:01:27 +00:00
2026-02-15 06:16:19 +00:00
2026-03-08 22:31:40 +00:00
2026-02-15 08:29:31 +00:00
2026-02-25 14:00:04 -05:00
2026-01-14 17:35:09 -05:00
2026-03-02 02:01:27 +00:00
2026-03-02 08:17:21 +00:00
2026-03-06 20:07:03 +00:00
2026-03-08 21:53:21 -04: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-02-17 14:40:16 +00:00
2026-03-03 23:36:15 +00:00
2026-03-09 06:59:15 +00:00
2026-02-16 16:46:54 -05:00
2026-02-15 11:04:18 -05:00
2026-03-08 22:19:40 +00:00
2026-02-27 09:47:10 -05:00
2026-02-08 11:33:30 -05:00
2026-02-24 12:19:04 -05:00
2026-02-23 03:11:12 +00:00
2026-02-17 00:37:53 +00:00
2026-02-27 13:47:42 -05:00
2026-02-17 22:59:16 -05:00
2026-03-01 03:09:51 +00:00
2026-02-22 00:43:08 -05:00
2026-02-18 03:27:00 +00:00
2026-02-18 00:10:15 +00:00
2026-02-18 03:27:00 +00:00
2026-02-16 16:46:54 -05:00
2026-02-20 08:48:33 -05:00
2026-03-07 19:36:09 +00:00
2026-02-18 03:27:00 +00:00
2026-02-16 16:46:54 -05:00
2026-02-18 03:27:00 +00:00
2026-02-17 21:07:54 +00:00
2026-02-16 21:35:54 +00:00
2026-03-07 19:36:09 +00:00
2026-03-07 19:36:09 +00:00
2026-02-18 03:27:00 +00:00
2026-02-18 03:27:00 +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-02-12 20:19:42 +00:00
2026-02-12 20:19:42 +00:00
2026-03-06 00:49:33 +00:00
2026-02-26 14:30:43 +00:00
2026-02-19 20:10:56 +00:00
2026-02-13 19:24:24 +00:00
2026-02-25 10:06:59 +00:00
2026-03-04 12:18:51 -05:00
2026-03-02 22:05:53 +00:00
2026-02-28 17:46:54 +00:00
2026-03-02 09:47:40 -05:00
2025-12-16 17:20:37 -05:00
2026-02-22 00:43:08 -05:00
2026-02-20 01:10:19 +00:00
2026-02-18 00:10:15 +00:00
2026-03-05 21:38:55 +00:00
2026-03-08 02:57:44 +00:00
2026-02-25 19:38:43 -05: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-21 10:23:33 -05:00
2026-02-20 08:50:08 -05:00
2026-03-02 14:56:13 +00:00
2026-02-27 20:09:26 +00:00
2026-02-21 16:30:40 +00:00
2026-02-21 16:30:40 +00:00
2026-02-16 19:52:47 +05:30
2026-02-21 10:23:33 -05:00
2026-03-01 09:07:06 +00:00
2026-03-02 09:41:25 -05:00
2026-03-08 21:53:21 -04: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-22 00:43:08 -05:00
2026-02-20 08:49:30 -05:00
2026-02-14 18:55:48 +00:00
2026-02-17 20:28:20 +00:00
2026-02-21 10:23:33 -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-06 23:14:30 +00:00
2026-03-05 21:38:55 +00:00
2026-02-15 09:04:17 +00:00
2026-02-22 00:43:08 -05:00
2026-02-25 10:03:57 +00:00
2026-02-12 20:19:42 +00:00
2026-02-12 22:58:15 -05:00