27 lines
4.3 KiB
Markdown
27 lines
4.3 KiB
Markdown
# Dormant daily publisher research/directive consumer
|
|
|
|
No cron or active runtime is changed. The actual publisher is agent-driven by `/opt/data/publishers/e4c9b52eb040/cron-prompt.txt` (research line 11, draft/reviews line 13, guarded Admin creation line 17). Its directory and parent batch engine are outside Git. This repository previously contained no matching daily-publisher module. `daily_publisher.run_new` is the versioned integration boundary, not a claim of live enforcement.
|
|
|
|
## Authorized future caller wiring
|
|
|
|
Provision these modules through a reviewed Git/Stage/runtime process, then have the existing owner call `run_new(Consumer(journal, AdminTransport(verified_admin_origin, approved_bearer)), stable_run_id, finding_payload, Content_callback, independent_review_callback, existing_guarded_NEW_create_callback)`.
|
|
|
|
- finding_payload uses the backend CreateFindingDto contract (title, hypothesis, targetKeywords, primaryKeyword, expectedOutcome, optional metric goal). No article is created by the adapter itself.
|
|
- Content callback receives the entire saved/fetched finding, including exact CEO free-text feedback/version. Save immutable draft artifacts; preserve the existing medical/SEO/QA chain.
|
|
- Independent reviewer callback receives finding, draft and both SHA256 digests. A nonempty directive requires reviewer identity, evidence artifact URI/path, exact directiveHash and draftHash. Review must quote the directive and map every request to draft passages or explicit unresolved findings. The adapter verifies binding, not arbitrary semantic obedience or reviewer authenticity; trusted review orchestration remains essential. Empty feedback needs no CEO approval. No Gate1/2 is introduced.
|
|
- Existing create callback must retain publisher_state ownership, fresh inventory/relations/quota checks, nonempty backup, independent exact-hash QA and write-ahead intent. Return confirmed blog UUID only. Never wrap an unguarded HTTP create callback in production.
|
|
- Persist journal outside temporary storage, shared by all invocations, with stable run ID. It records consumed finding and feedback versions, review, draft digest and created identity. A concurrent invocation cannot enter create after a claim transition. Network ambiguity blocks retries. Existing daily quota guard still protects different run IDs and different journal files.
|
|
- `reconcile_link(run_id)` only links the saved confirmed blog, never creates another article. If feedback changed after create, retain the blog and route independent repair. No automatic resave/update.
|
|
|
|
## Atomicity limit (not concealed)
|
|
|
|
Backend PATCH action atomically checks `expectedVersion` AND `feedbackVersion`; conflict prevents the callback. It does **not** participate in the later Blog create transaction. CEO edits after claim and before actual creation can therefore race. The adapter detects changed feedback on post-create link, retains the article identity and blocks linking/recreation, but cannot roll back the article. Full no-stale-publication requires an additional backend transaction/lease contract on the actual Blog creation boundary. Do not claim that consumption acknowledgement guarantees free-text implementation or that this dormant adapter protects current cron publication.
|
|
|
|
## Executed evidence
|
|
|
|
- RED before implementation: unittest import failed because consumer module did not exist.
|
|
- `python -B -m unittest discover -s scripts/content-research -v`: **11 passed**, covering real integration entrypoint with isolated transport/callback fixtures, feedback before/after claim, optional feedback, exact receipt hashes, contention, idempotency, research timeout and publication ambiguity, link-only repair.
|
|
- Existing Git editorial suites: **2 passed, 3 skipped** (root-only ownership fixtures unavailable).
|
|
- Existing untouched runtime `python -B -m unittest discover -s /opt/data/publishers/e4c9b52eb040 -p test_publisher_state.py -v`: **3 passed, 2 errors**. Both existing tests call intent without the now-required independent QA fixture and fail `QA_REQUIRED: current-day independent exact-hash approval`. Runtime/test files were not edited; this is a pre-existing fixture drift, not a green regression claim.
|
|
- No live API request, publication, deployment, push, cron edit or activation. No backend/UI change. Tests establish local callback/API contract only, not live database/network acceptance.
|