feat(daily-brief): deviation ingestion SDK#274
Merged
Conversation
Adds a reusable SDK for posting skill deviations to OrgX when a skill
fires locally (pre-PR, pre-commit, pre-chat) against a file edit,
commit, PR, chat turn, or task output.
- src/deviations-sdk.ts
- computeDedupeKey(): sha1(skill_id | evidence_kind | evidence_ref |
floor(epoch/600)) — matches server's UNIQUE (workspace_id, dedupe_key)
constraint. 10-minute bucketing handles save-happy editors.
- postDeviation(): POST /api/v1/skills/{id}/deviations with Bearer auth,
structured error handling (no throw on HTTP failure), optional
AbortController timeout.
- postDeviationBatch(): parallel fan-out.
- src/deviations-sdk.test.ts — 7 tests covering dedupe stability across
bucket boundaries, POST shape, dedup echo, 4xx handling, network failure.
Sister SDK for other plugin runtimes can either port this file directly
(Node/TypeScript) or reimplement the same 5-field sha1 dedupe key in
their language of choice.
Companion server contract: orgx/docs/api-contracts/daily-brief-schema.md §04
Initiative a3b9a125-4078-4f24-9e10-088c6c6dd005.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a reusable SDK for posting skill deviations to OrgX when a skill fires locally in the plugin runtime.
Companion contracts
Next
Sister SDKs for `orgx-claude-code-plugin`, `orgx-codex-plugin`, `cursor-plugin` follow the same 5-field dedupe key contract.
Test plan
🤖 Generated with Claude Code