NewsStoryReviseRequest news.story-revise-request@1

Generated at from openvibe-contracts v0.53.0 and openvibe-sdk v0.11.0.

Version
1.0.0
Owner
news
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/news/story-revise-request.v1.json

news.story-revise-request@1: bodies of news.story.revise on OpenVibe.News (editors; a service acts for the editor in X-OV-Subject). POST /api/v1/stories/:id/revisions { expected_revision, headline?, body? | paragraphs?, topic?, noindex?, message? } saves a new immutable revision snapshotting the source table, timeline and perspectives (expected_revision is required once a revision exists: 428 revision.expected_required, 412 revision.conflict on a stale one; every paragraph must cite an attached source: 422 story.claim_unsourced / story.unknown_source; 409 story.retracted). With X-OV-Origin: ai the revision is AI-generated and carries authorship { workflow: { id: news.summarize_story | news.compare_perspectives, run_id } } and gaps. POST /api/v1/stories/:id/ai-drafts { workflow? } asks OpenVibe.AI for a draft (default news.summarize_story; 503 ai.not_configured, 422 story.unsourced, 422 story.too_few_sources). POST /api/v1/stories/:id/flags { kind, note } adds a correction or update note published with the next publication.

Fields

This schema has no named fields.

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: ai-draft
{
  "workflow": "news.compare_perspectives"
}
Valid: flag
{
  "kind": "correction",
  "note": "An earlier version gave the wrong day for the closure."
}
Valid: revision
{
  "expected_revision": 1,
  "headline": "Harbour bridge closes for two weeks",
  "paragraphs": [
    {
      "text": "The council expects the inspection to take two weeks.",
      "sources": [
        2,
        "nsi_01JAB2Z7Y6X5W4V3T2S1R0QPNM"
      ]
    }
  ],
  "message": "Adds the council estimate"
}
Rejected: wrong-kinds
{
  "expected_revision": "head",
  "workflow": "news.write_story",
  "kind": "retraction",
  "note": "x"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('news.story-revise-request@1', value);   // { valid, errors: [{ path, message }] }