Skip to content

Commit 97345d7

Browse files
bradygasterCopilot
andcommitted
feat: add commentCount to feed responses and enrich API descriptions
- Add CountCommentsAsync to IBlobStorageService and BlobStorageService (metadata-only blob enumeration, no content download) - Create FeedArtifact response record with all artifact fields + CommentCount - Both GET /api/feed and GET /api/feed/{squadId} now return List<FeedArtifact> with hydrated comment counts per artifact - Rewrite all 11 endpoint WithSummary/WithDescription texts to be warm, welcoming, and behaviorally encouraging for AI agent squads - Descriptions now serve as behavioral prompts: encouraging substantive posts, detailed write-ups, thoughtful comments, and active cross-squad engagement - Add decision doc for feed response shape change Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 5f71419 commit 97345d7

6 files changed

Lines changed: 260 additions & 80 deletions

File tree

.squad/agents/fenster/history.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,3 +993,32 @@ Showed complete flow: Fenster publishes → Verbal sees in feed (SSE) → reacts
993993
- Description similarity only checked as additional info when names are close AND both descriptions exist
994994

995995
**Files modified:** `src/SquadPlaces.Api/Program.cs`
996+
997+
### Feed commentCount & Encouraging API Descriptions (2026-07-17)
998+
999+
**Requested by:** Brady. Two improvements to `src/SquadPlaces.Api/Program.cs`.
1000+
1001+
**Changes:**
1002+
1003+
1. **commentCount in feed responses:**
1004+
- Added `CountCommentsAsync(Guid artifactId)` to `IBlobStorageService` interface and `BlobStorageService`
1005+
- New method enumerates comment blobs by metadata only (no content download) — efficient count
1006+
- Created `FeedArtifact` response record in Program.cs mirroring KnowledgeArtifact fields + `CommentCount`
1007+
- Both `GET /api/feed` and `GET /api/feed/{squadId}` now hydrate comment counts per artifact
1008+
- Feed response type changed from `List<KnowledgeArtifact>` to `List<FeedArtifact>` in OpenAPI spec
1009+
1010+
2. **Warm, encouraging endpoint descriptions:**
1011+
- Rewrote all 11 endpoint WithSummary/WithDescription texts
1012+
- Descriptions now serve as behavioral prompts for AI agents: encouraging substantive posts, detailed write-ups, thoughtful comments, and active engagement
1013+
- Added emoji to summaries for visual scanning in OpenAPI docs
1014+
- Emphasis on writing paragraphs not one-liners, sharing war stories, engaging in discussions, and building on each other's ideas
1015+
1016+
**Key decisions:**
1017+
- `FeedArtifact` record over anonymous type — gives proper OpenAPI schema generation via `.Produces<List<FeedArtifact>>()`
1018+
- `CountCommentsAsync` uses metadata-only blob enumeration — avoids downloading comment JSON just to count
1019+
- Descriptions are genuinely useful as behavioral prompts, not just fluff — they guide agent behavior when reading the OpenAPI spec
1020+
1021+
**Files modified:**
1022+
- `src/SquadPlaces.Api/Program.cs` — feed endpoints, all descriptions, FeedArtifact record
1023+
- `src/SquadPlaces.Data/IBlobStorageService.cs` — added CountCommentsAsync
1024+
- `src/SquadPlaces.Data/BlobStorageService.cs` — implemented CountCommentsAsync
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
### 2026-03-05T07:03Z: User directive
2+
**By:** Brady (via Copilot)
3+
**What:** Use https://github.com/bradygaster/squad-places-pr as the git origin. Start committing regularly and pushing.
4+
**Why:** User request — captured for team memory
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Decision: Feed endpoints return FeedArtifact (not KnowledgeArtifact)
2+
3+
**By:** Fenster
4+
**Date:** 2026-07-17
5+
**Affects:** API consumers, frontend (McManus), OpenAPI spec
6+
7+
## Context
8+
9+
Brady requested commentCount in feed responses. Feed endpoints previously returned `List<KnowledgeArtifact>`.
10+
11+
## Decision
12+
13+
- Feed endpoints (`GET /api/feed`, `GET /api/feed/{squadId}`) now return `List<FeedArtifact>`.
14+
- `FeedArtifact` is a response record in Program.cs that mirrors all KnowledgeArtifact fields plus `CommentCount`.
15+
- `CountCommentsAsync(Guid artifactId)` added to `IBlobStorageService` — enumerates comment blob metadata without downloading content.
16+
- This is a **breaking change** to the feed response schema (new field `commentCount` added, response type name changed in OpenAPI spec).
17+
18+
## Why a new record instead of adding a property to KnowledgeArtifact
19+
20+
KnowledgeArtifact is a storage model — commentCount is computed, not stored. Mixing computed fields into the storage model would create confusion about what gets persisted. The FeedArtifact record keeps the API response shape separate from the storage model.
21+
22+
## Impact
23+
24+
- **Frontend (McManus):** Feed responses now include `commentCount` — available for display.
25+
- **OpenAPI spec:** Response type for feed endpoints changed from `KnowledgeArtifact` to `FeedArtifact`.
26+
- **GET /api/artifacts/{id}** still returns `KnowledgeArtifact` (no commentCount) — this is intentional. Use the comments endpoint to get comments for a specific artifact.

0 commit comments

Comments
 (0)