Skip to content

feat(discovery): register reddit + granola writeback discovery - #164

Merged
khaliqgant merged 3 commits into
mainfrom
fix/discovery-reddit-fathom-granola
Jun 10, 2026
Merged

feat(discovery): register reddit + granola writeback discovery#164
khaliqgant merged 3 commits into
mainfrom
fix/discovery-reddit-fathom-granola

Conversation

@khaliqgant

Copy link
Copy Markdown
Member

Summary

reddit and granola had writeable resources in resources.ts but no discovery registration — they couldn't pass writeback discovery verification, and reddit's published package wouldn't have shipped discovery files at all.

  • Registered reddit (subreddits, subreddits/{subreddit}/posts) and granola (notes, folders) in scripts/writeback-discovery-data.mjs; field definitions derive from the actual zod inputs / record types (reddit post fields mirror cloud's create-post.ts action), nothing invented.
  • Added idPatternFor cases in the normalizer so generated docs match each adapter's runtime idPattern regexes.
  • Generated .adapter.md + .schema.json + .create.example.json for all four endpoints.
  • packages/reddit/package.json: files now includes "discovery".

fathom intentionally excluded: it's read-only by design (empty resources export with an explicit comment, LAYOUT.md states no writeback schemas, listed in adapters-without-writeback-paths.generated.json). Registering it would fail verification and contradict the design.

Note: the discovery generator's renderer is stale vs. several hand-tuned resources.ts files (dropbox/hubspot/linear drift); hand-maintained resources.ts files were restored after generation — only discovery assets kept.

Verification

test:writeback-discovery passes ("Verified 86 writeback discovery endpoints", was 82); turbo build/test/typecheck for reddit/granola/fathom/core green; catalog check in sync; publish-targets / internal-dependencies / digest-contracts checks pass.

⚠️ Merge-order note: this PR and # both touch scripts/writeback-discovery-data.mjs — merge one, regenerate, then merge the other.

🤖 Generated with Claude Code

Reddit and granola declare writeable resources in resources.ts and their
LAYOUT.md prompts advertise discovery schemas, but the discovery/ assets
were never authored and neither adapter was registered in
scripts/writeback-discovery-data.mjs, so verify-writeback-discovery.mjs
never covered them and published packages shipped no schema files.

- register reddit (track subreddit, create post) and granola (create
  note, create folder) in writeback-discovery-data.mjs; post fields
  mirror the reddit-composio-relay create-post action input, note and
  folder fields mirror the adapter record types
- add reddit/granola id-pattern cases to the discovery normalizer so
  generated .adapter.md ID patterns match the runtime idPattern regexes
  in each adapter's resources.ts
- generate discovery/<provider>/.adapter.md, .schema.json, and
  .create.example.json for both adapters
- ship discovery/ in @relayfile/adapter-reddit package files

Fathom is intentionally unregistered: its resources.ts exports an empty
resource list and /fathom/LAYOUT.md documents the mount as read-only
with no file-native writeback contract.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@agent-relay-code[bot], we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 18 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 58f595b3-c529-4bd1-9c58-4570d8115c5a

📥 Commits

Reviewing files that changed from the base of the PR and between 5739843 and aba7e0a.

📒 Files selected for processing (14)
  • docs/writeback-spec-coverage.md
  • packages/granola/discovery/granola/.adapter.md
  • packages/granola/discovery/granola/folders/.create.example.json
  • packages/granola/discovery/granola/folders/.schema.json
  • packages/granola/discovery/granola/notes/.create.example.json
  • packages/granola/discovery/granola/notes/.schema.json
  • packages/reddit/discovery/reddit/.adapter.md
  • packages/reddit/discovery/reddit/subreddits/.create.example.json
  • packages/reddit/discovery/reddit/subreddits/.schema.json
  • packages/reddit/discovery/reddit/subreddits/{subreddit}/posts/.create.example.json
  • packages/reddit/discovery/reddit/subreddits/{subreddit}/posts/.schema.json
  • packages/reddit/package.json
  • scripts/writeback-discovery-data.mjs
  • scripts/writeback-discovery-normalizer.mjs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/discovery-reddit-fathom-granola

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@khaliqgant

Copy link
Copy Markdown
Member Author

The merge-order note refers to #165 — both PRs touch scripts/writeback-discovery-data.mjs; merge one, regenerate discovery, then merge the other.

@agent-relay-code

Copy link
Copy Markdown
Contributor

Reviewed PR #164 and made one scoped fix: Reddit post writeback discovery no longer uses the reserved system url field for link-post input. It now advertises link_url, while the full record schema keeps url as read-only provider metadata.

Fixed in:

Addressed comments

  • No bot/reviewer comment artifacts were present in .workforce; I validated the current checkout against the PR diff and fixed the demonstrated discovery-contract issue found during review.

Advisory Notes

None.

Verification

Passed locally:

  • npm run test:writeback-discovery
  • npm run build -- --concurrency=1
  • npm run typecheck -- --concurrency=1
  • npm test -- --concurrency=1

Note: the default concurrent npm run build was killed by the sandbox with exit 137; the same Turbo build target passed when serialized.

@agent-relay-code

Copy link
Copy Markdown
Contributor

Reviewed PR #164 and fixed one demonstrated gap: docs/writeback-spec-coverage.md now tracks the new Granola and Reddit inline writeback discovery schemas at lines 25 and 35.

I also validated the PR’s generated discovery assets, Reddit package publishing metadata, and generator declarations. I reverted broad generator fallout from an exploratory regeneration because it touched unrelated adapter resources and broke Linear tests.

Addressed comments

  • No bot or reviewer comments were present in the provided .workforce artifacts, so there were no external review threads to apply or reject.
  • Repository contract finding: writeback tracking doc was missing Granola and Reddit entries; fixed in docs/writeback-spec-coverage.md:25 and docs/writeback-spec-coverage.md:35.

Verification

  • npm ci
  • npm run test:publish-targets
  • npm run test:internal-dependencies
  • npm run test:writeback-discovery
  • npm run test:digest-contracts
  • npx turbo build --concurrency=1
  • npx turbo test --concurrency=1
  • npx turbo typecheck --concurrency=1

I used low Turbo concurrency because the default parallel build was killed with exit 137 in this sandbox.

@khaliqgant
khaliqgant merged commit a8cb41b into main Jun 10, 2026
3 checks passed
@khaliqgant
khaliqgant deleted the fix/discovery-reddit-fathom-granola branch June 10, 2026 19:26
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