2285c578
project: add /api/v1/projects aggregation; sessions: add ?cwd= filter
- session.ListFilter gains Cwd *string; List appends working_dir = ?
clause between Host and Since in fixed order (parameterised, column
name is a literal)
- session.Handler reads ?cwd= and threads it to filter.Cwd; empty
string treated as absent, consistent with other optional filters
- new package internal/domain/project:
- Repository.List groups sessions by non-NULL working_dir in a single
SQL round-trip; correlated subquery picks top_tool with tie-broken
by tool ASC; Hosts/Tools deduped and sorted in Go after
GROUP_CONCAT
- Handler mounts GET /projects; resolveScope/clampLimit/clampOffset
duplicated from session handler; ?owner= admin gating identical
- server.Server gains Projects *project.Handler inject field; mounted
in /api/v1 Route block
- main.go and e2e test register projectRepo + projectHnd with steward
Eugene Blikh <bigbes@gmail.com> — 2026-04-26 05:12:38 UTC
Commit 2285c578382ca35a2f4dbdf16ea45ccb7c108849 —
view raw patch
Parent(s):
62dbaf9f
| File | Status | + | − |
|---|---|---|---|
cmd/lethe/main.go
|
M | +6 | -1 |
cmd/lethe/main_e2e_test.go
|
M | +3 | |
internal/domain/project/handler.go
|
A | +145 | |
internal/domain/project/handler_test.go
|
A | +161 | |
internal/domain/project/repository.go
|
A | +192 | |
internal/domain/project/repository_test.go
|
A | +326 | |
internal/domain/session/handler.go
|
M | +3 | |
internal/domain/session/repository.go
|
M | +5 | |
internal/domain/session/repository_test.go
|
M | +40 | |
internal/server/server.go
|
M | +3 |