Skip to content

feat: positronick blog read commands (list/show) - #26

Closed
nsollazzo wants to merge 2 commits into
feat/research-whats-newfrom
feat/blog-read-commands
Closed

feat: positronick blog read commands (list/show)#26
nsollazzo wants to merge 2 commits into
feat/research-whats-newfrom
feat/blog-read-commands

Conversation

@nsollazzo

@nsollazzo nsollazzo commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Public, read-only blog reader over the product blog endpoints — the same pattern as the soul/listing reads and the shipped research command.

What

  • internal/api/types.goPostCard/Post wire types mirroring PostMeta/Post in src/lib/types.ts field-for-field (nullable TS fields → Go pointers). Reuses PostKinds.
  • internal/api/blog.goPosts(ctx, kind), Post(ctx, slug), PostMarkdown(ctx, slug) over GET /api/blog(?kind=), /api/blog/{slug}, /api/blog/{slug}.md. Unauthenticated, read-only.
  • internal/cli/blog.gopositronick blog list (--kind, validated before any network call) and blog show <slug> (--raw), with soul-style did-you-mean hints (exit 3) on a missing slug.
  • internal/mockapi — serves the three endpoints over a frozen Posts fixture (one per kind, varied nullable fields).
  • Goldens — new blog-list.json, blog-show.json, blog-show.txt; regenerated agent-docs.json/.txt (the blog commands self-register).

Design note: blog show --raw reads the .md endpoint

soul show --raw deliberately avoids the soul .md endpoint because it bumps the install counter, so it prints the JSON detail's body instead. The blog .md endpoint never bumps viewCount (counting stays exclusive to the HTML page view), so blog --raw reads it directly — which keeps PostMarkdown live (no dead code) and returns the true raw markdown file (frontmatter + body). The mock's .md output is intentionally distinct from the JSON content (body-only) so the test proves --raw hit the .md endpoint.

Contract changes (per AGENTS.md)

New golden files pin the --json/human output; agent-docs goldens change because the command tree gained blog/blog list/blog show. No existing goldens changed.

Stacking

Built on feat/research-whats-new (#24) to reuse PostKinds and avoid a duplicate-definition conflict — base is feat/research-whats-new, not main. Merge after #24 (or retarget to main once #24 lands).

Verification

go test ./... -race, go vet ./..., and golangci-lint run ./... all green. No auth/admin surface.

🤖 Generated with Claude Code

nsollazzo and others added 2 commits June 29, 2026 18:35
Add a public, read-only `research` command over GET /api/research: published
blog posts, mirrored GitHub releases, and mirrored news links, newest first,
so agents avoid stale knowledge.

- Filter with --kind (article/release/link), --category, --tag, or a free-text
  query; poll just the delta with --since <iso>. The printed `latest` timestamp
  is the value to pass back next time (high-water mark within the same filter,
  ignoring --since, so polling converges).
- Unauthenticated, like the soul/listing reads. Flags validated before any
  network call; --json and exit codes follow the existing contract.
- ResearchItem mirrors src/lib/types.ts field-for-field; mockapi serves
  /api/research with the documented filter/latest semantics so goldens pin it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Public, read-only blog reader over the product blog endpoints, mirroring
the soul/listing reads and the `research` feed:

- api: PostCard/Post wire types (mirror PostMeta/Post in src/lib/types.ts);
  Posts(kind)/Post(slug)/PostMarkdown(slug) over GET /api/blog,
  /api/blog/{slug}, and /api/blog/{slug}.md.
- cli: `blog list` (--kind) and `blog show <slug>` (--raw), with did-you-mean
  hints (exit 3) on a missing slug. --raw reads the .md endpoint, which —
  unlike soul .md — never bumps a counter.
- mockapi: serves the three endpoints over a frozen Posts fixture.
- goldens: blog-list/blog-show (.json/.txt) + regenerated agent-docs.

Reuses PostKinds from the research branch (#24); stacked on it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@nsollazzo
nsollazzo force-pushed the feat/research-whats-new branch from 7a8acd1 to c898e58 Compare July 8, 2026 13:42
@nsollazzo
nsollazzo deleted the branch feat/research-whats-new July 8, 2026 13:42
@nsollazzo nsollazzo closed this Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant