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-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-22 00:43:08 -05:00
2026-03-02 02:01:27 +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-25 10:30:42 +00:00
2026-02-22 08:31:45 +00:00
2026-02-25 10:30:42 +00:00
2026-02-26 09:10:35 +00: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-27 09:47:10 -05:00
2026-03-02 17:44:18 +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-27 13:47:42 -05:00
2026-03-01 03:09:51 +00:00
2026-02-21 16:27:40 +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-22 00:43:08 -05:00
2026-02-22 00:43:08 -05:00
2026-03-03 17:04:17 -05:00
2026-02-24 20:11:42 +00:00
2026-03-06 20:28:37 +00:00
2026-02-22 00:43:08 -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-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-27 09:47:10 -05: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-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-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-24 00:41:01 +00:00
2026-03-02 02:01:27 +00:00
2026-02-25 10:06:59 +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
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
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-21 18:11:31 +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-03-03 21:44:20 +00:00
2026-03-03 21:44:20 +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-03-08 23:28:05 +00:00
2026-03-08 23:28:05 +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
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
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-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-27 13:47:42 -05:00
2026-02-25 19:38:43 -05:00
2026-02-25 19:38:43 -05:00
2026-03-08 23:28:05 +00:00
2026-03-07 19:36:09 +00:00
2026-03-08 23:28:05 +00: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-08 23:28:05 +00:00
2026-03-03 12:10:25 +00:00
2026-02-27 09:47:10 -05:00
2026-02-27 09:47:10 -05:00
2026-03-05 21:38:55 +00:00
2026-03-01 03:09:51 +00:00
2026-02-25 19:38:43 -05:00
2026-02-25 14:00:04 -05:00
2026-02-24 12:19:04 -05:00
2026-02-25 19:38:43 -05:00
2026-02-22 00:43:08 -05:00
2026-03-02 02:01:27 +00:00
2026-03-08 22:31:40 +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-03-08 21:53:21 -04:00
2026-03-05 21:38:55 +00:00
2026-03-03 23:36:15 +00:00
2026-03-09 06:59:15 +00:00
2026-03-08 22:19:40 +00:00
2026-02-27 09:47:10 -05:00
2026-02-24 12:19:04 -05:00
2026-02-23 03:11:12 +00:00
2026-02-27 13:47:42 -05:00
2026-03-09 06:59:15 +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-24 12:19:04 -05:00
2026-02-23 22:20:44 +00:00
2026-03-07 19:36:09 +00:00
2026-03-06 20:44:36 +00:00
2026-03-07 19:36:09 +00:00
2026-03-02 02:01:27 +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-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-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-03-02 02:01:27 +00:00
2026-02-22 00:43:08 -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-24 17:57:18 +00:00
2026-02-21 10:23:33 -05:00
2026-02-24 17:57:18 +00: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-21 10:23:33 -05:00
2026-03-08 22:19:40 +00:00
2026-02-21 16:32:03 +00:00
2026-03-02 02:01:27 +00:00
2026-03-02 09:41:25 -05:00
2026-02-22 00:43:08 -05:00
2026-03-08 21:53:21 -04:00
2026-03-08 22:11:49 +00:00
2026-02-22 00:43:08 -05:00
2026-02-25 10:03:57 +00:00
2026-02-22 00:43:08 -05: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-04 22:40:34 +00:00
2026-03-05 21:38:55 +00:00
2026-02-25 10:03:21 +00:00
2026-02-22 00:43:08 -05:00
2026-03-02 02:01:27 +00:00
2026-02-25 10:03:57 +00:00