Skip to content

Make content agent testable for issue #5#54

Open
wangedmund77-cmyk wants to merge 2 commits into
Nexussyn:mainfrom
wangedmund77-cmyk:agent/wangedmund77/issue-5-content-agent-testability
Open

Make content agent testable for issue #5#54
wangedmund77-cmyk wants to merge 2 commits into
Nexussyn:mainfrom
wangedmund77-cmyk:agent/wangedmund77/issue-5-content-agent-testability

Conversation

@wangedmund77-cmyk

Copy link
Copy Markdown

Summary

  • makes the content agent import-safe by moving Supabase client creation behind generateContent
  • guards Deno.serve behind import.meta.main and exposes createContentAgentHandler() for tests
  • adds helpers for bounty context formatting, tweet normalization, and guaranteed five-item thread output
  • validates LLM HTTP responses and Supabase insert errors instead of silently accepting empty/failed output
  • adds focused tests for context formatting, tweet trimming, separator parsing, fallback thread padding, and numbered LLM output

Acceptance criteria

  • generateContent(bounty_id) still returns { tweet, thread, blog_post }
  • tweet output is normalized and capped at 280 characters
  • thread output is guaranteed to contain five entries
  • content storage errors are surfaced
  • tests cover mock content shaping without requiring live LLM credentials

Validation

  • git diff --check
  • Node smoke check confirmed the expected helper exports and guarded handler are present

Environment limits:

  • Deno is not installed locally, so tests/content-agent.test.ts was added but not executed here.
  • Plain tsc cannot resolve this repo’s Deno/JSR import (jsr:@supabase/supabase-js@2) or Deno globals without a Deno type environment.

Closes #5

Payment details can be provided through the repository-approved payout flow after merge.

@wangedmund77-cmyk

Copy link
Copy Markdown
Author

Pushed a focused acceptance follow-up after comparing newer issue #5 content-agent submissions.

What changed:

  • Added generate_content as the issue-specified entry point while keeping the existing generateContent export.
  • Added social_card generation, 160-character normalization, return payload support, and outreach_sent storage.
  • Added tests for social-card normalization and the generate_content compatibility export.

Validation:

  • git diff --check passed.
  • Static content-agent acceptance checks passed for the new export, stored payload, returned payload, and test coverage.
  • deno test tests/content-agent.test.ts could not run in this local environment because deno is not installed.
  • bun test tests/content-agent.test.ts is not a valid substitute here because Bun cannot read the Deno URL import used by the test file.

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.

[AGENT-TASK] Content-generation agent — auto-posts from bounty outcomes

1 participant