Skip to content

Declare publish_live, derived from Maximum status - #19

Merged
henry-mosh merged 4 commits into
mainfrom
feat/publish-live-capability-a76282
Nov 19, 2026
Merged

henry-mosh merged 4 commits into
mainfrom
feat/publish-live-capability-a76282

Conversation

@henry-mosh

Copy link
Copy Markdown
Collaborator

What

The connect claim now sends publish_live. It is true only when Maximum status (ingest_post_status) is Published. Draft and Pending send false. The CiteCue app reads it to default Calendar pushes to status: publish instead of a draft. Until now no plugin declared it, so every post landed as a draft.

There is no new checkbox. The flag is derived from the existing setting, so one control decides both, and the flag can never claim more than the ingest endpoint enforces. The cap still has the final say on every push.

Reconnect prompt

publish_live joins active_delivery_capabilities(), the set compared against capabilities_reported. Raising or lowering Maximum status after connecting therefore trips needs_seo_head_reconnect(), and the next claim re-reports the flag.

Without a further change, that drift would have shown the existing capabilities message ("this version can place CiteCue page enhancements…"). That message is wrong here, and the reason's own docblock warns against exactly that. So:

  • seo_head_reconnect_reason() returns a new publish_live reason when it is the only stale name. If a delivery capability is stale too, capabilities wins, and one reconnect fixes both.
  • The admin notice gets publish-specific wording for both directions, raised and lowered.
  • On the status card, the flag shows on the Content pushes row. Page enhancements no longer flags drift that is only about publishing.

Citecue_Connect::claim() needed no change. It already merges declared_capabilities() into the body as flat booleans and records active_delivery_capabilities() after a successful claim.

Docs and version

Tests

New cases in test-settings.php, test-connect.php, test-admin-notices.php and test-admin-screen.php:

  • the flag is true for publish and false for draft/pending (data provider), and a fresh install doesn't declare it;
  • the claim body includes it as a boolean in both states, and capabilities_reported records it;
  • raising and then lowering Maximum status after a connect each make the active set differ from capabilities_reported, with reason publish_live, and the reconnect between them clears it;
  • precedence when a delivery capability is stale too, and the never-reported (null) upgrade path;
  • the notice and status-card wording.

Run locally against a throwaway MariaDB 12:

  • composer test: core, WooCommerce stub and multisite each 395 tests, OK (19 / 12 / 18 skipped, all pre-existing)
  • composer lint: clean
  • composer phpcs (WPCS + PHPCompatibilityWP 7.4): clean, 42 files
  • bin/build-plugin-zip.sh HEAD: builds

Not changed

The permanent "Dismiss" on the reconnect notice is still one key (seo_head_reconnect). An administrator who dismissed an earlier capabilities prompt won't see the publish one as a notice. The status card still shows it.

🤖 Generated with Claude Code

The app reads a `publish_live` connect capability to default Calendar
pushes to `status: publish`, and no plugin declared it, so every post
arrived as a draft until a customer flipped the app's switch and raised
Maximum status too.

The flag is derived from Maximum status (`ingest_post_status`) rather
than given a checkbox of its own: one control, so it can never claim
more than the ingest endpoint enforces. True only for Published.

It joins the set the reconnect prompt compares, so raising or lowering
the cap after connecting asks for a reconnect. When it is the only stale
name, the prompt and the status card say it is about publishing. The
generic "capabilities" message talks about page enhancements, which
have not changed.

Cut as 1.3.0, as earlier feature PRs did; nothing is tagged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@henry-mosh
henry-mosh marked this pull request as ready for review November 18, 2026 08:33
@qodo-code-review

qodo-code-review Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Report live-publishing capability from Maximum status

🐞 Bug fix ✨ Enhancement 🕐 20-40 Minutes

Grey Divider

AI Description

• Declare publish_live from Maximum status so CiteCue can default eligible Calendar pushes to
 published posts.
• Prompt for reconnection when that status changes, with publishing-specific notices and status-card
 messaging.
• Document the claim contract, add regression tests, and bump the plugin version to 1.3.0.
Merge Risk 🟡 Medium

Blast radius 🟡 Medium 💥 2 capabilities

  • 2 affected capabilities within one bounded functional scope: CiteCue content-push integration.
  • The settings layer derives the flag, the connect claim sends it and the Calendar uses it for its default status.
  • These are producer, contract and consumer hops of one delivery behavior.
  • The notice and the Content pushes row report the same drift within the same integration.
  • They are hops of one administrator outcome.
  • A missed prompt can leave the remote default stale.
  • This is the same delivery behavior as the first scenario.
Behavioral complexity 🟡 Medium 🧩 Compatibility cases, Interacting branches

  • Before: the capability set described page delivery only.
  • After: it includes publish_live, a boolean that follows the local status setting and is consumed remotely.
  • New correctness conditions: the flag must handle every status value, tolerate missing historical values and never exceed the local cap.
  • This is a direct boolean derivation using existing infrastructure.
Potential damage 🟡 Medium 🩹 Recoverable

  • Eligible posts can arrive as drafts and need manual publication or a re-push.
  • The local cap stops over-publishing.
  • Code rollback restores the claim.
  • Already-created drafts need manual publication or a re-push.
  • No automatic repair is established.
Assessed commit de2b7dd
Diagram

graph TD
  Status["Maximum status"] --> Settings["Capability settings"] --> Claim["Connect claim"] --> App["CiteCue app"] --> Calendar["Calendar pushes"] --> Cap{"Ingest cap"}
  Settings --> Drift{"Capability drift"} --> Admin["Admin prompt"] --> Claim
Loading
High-Level Assessment

Deriving the flag from the enforced Maximum status and reusing the existing claim and capability-drift mechanisms is the best fit. A separate publishing checkbox could disagree with the ingest cap and misrepresent what the site permits.

Files changed (10) +333 / -17

Enhancement (1) +20 / -2
class-citecue-admin.phpShow publishing-specific reconnect guidance +20/-2

Show publishing-specific reconnect guidance

• Adds notice wording for both raising and lowering Maximum status. Places publish-only drift on the Content pushes row without incorrectly flagging Page enhancements.

includes/class-citecue-admin.php

Bug fix (1) +39 / -9
class-citecue-settings.phpDerive and track the live-publishing capability +39/-9

Derive and track the live-publishing capability

• Declares 'publish_live' only when Maximum status is Published and includes it in reconnect comparisons. Returns a dedicated reason when it is the sole stale capability, preserving delivery-capability precedence.

includes/class-citecue-settings.php

Tests (4) +241 / -0
test-admin-notices.phpTest publish-specific reconnect notice +24/-0

Test publish-specific reconnect notice

• Checks that a stale publishing flag produces Maximum status guidance rather than the page-enhancements message.

tests/cases/test-admin-notices.php

test-admin-screen.phpTest publishing drift on the status card +25/-0

Test publishing drift on the status card

• Verifies that publish-only drift appears under Content pushes while Page enhancements retains its normal status.

tests/cases/test-admin-screen.php

test-connect.phpTest claim reporting and reconnect precedence +132/-0

Test claim reporting and reconnect precedence

• Covers true and false claim booleans, recorded capability sets, reconnects after raising or lowering Maximum status, and precedence when other capabilities are stale. Includes connections that predate named capability reporting.

tests/cases/test-connect.php

test-settings.phpTest capability derivation across status caps +60/-0

Test capability derivation across status caps

• Checks Published, Draft, Pending, and fresh-install behavior. Verifies that 'publish_live' participates in reconnect comparisons independently of page-metadata injection.

tests/cases/test-settings.php

Documentation (3) +31 / -4
README.mdDocument claim capabilities and publishing behavior +16/-2

Document claim capabilities and publishing behavior

• Lists the flat connect-claim capabilities, their governing settings, and reconnect behavior. Clarifies how 'publish_live' relates to the push API’s capped 'status' field.

README.md

connect-handshake.mdShow publish_live in the connect claim +7/-1

Show publish_live in the connect claim

• Expands the sample request with all five capability booleans and explains when 'publish_live' is true and how CiteCue uses it.

docs/connect-handshake.md

readme.txtAdd 1.3.0 release and upgrade notes +8/-1

Add 1.3.0 release and upgrade notes

• Updates the stable tag and explains the publishing capability, status-change reconnect prompt, and one-time reconnect needed for already-published sites.

readme.txt

Other (1) +2 / -2
citecue.phpBump plugin version to 1.3.0 +2/-2

Bump plugin version to 1.3.0

• Updates the plugin header and 'CITECUE_VERSION' constant for the feature release.

citecue.php

@qodo-code-review

qodo-code-review Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

Nice, no open findings for this group


Remediation recommended

Nice, no open findings for this group


Informational

Nice, no open findings for this group

Grey Divider

Resolved findings

1. Live posts misreported as drafts ✓ Resolved Medium

Resolving commit: 25cc466

Resolution reason
Added a code comment noting the flag only sets CiteCue's default and the Calendar's per-post
"Publish live" switch still overrides it. Rewrote the 'publish' branch notice to say posts "will
default to drafts unless you switch them to publish live there," removing the unconditional draft
claim. Also rewrote the other branches to describe defaults ("CiteCue will default posts you
schedule to published"), and added test assertions for the new wording. This matches the finding's
requested remediation of describing the stale capability as affecting the default landing rather
than every post, though it is worded differently from the suggested fix.
Description
The raised-status branch of seo_head_reconnect_notice() says CiteCue will keep sending scheduled
posts as drafts until reconnecting, but citecue_app lets an administrator explicitly set the
Calendar landing to publish, overriding a stale publish_live: false capability. If Maximum
status is now Published, that explicit request passes the plugin’s status cap and the post goes live
despite the notice.

2. Publishing drift disappears from the status card ✓ Resolved Medium

Resolving commit: d3840f7

Resolution reason
The status card row now uses a new Citecue_Settings::publish_live_is_stale() method that checks
publish_live drift independently of seo_head_reconnect_reason(), so a stale publishing flag still
shows beside another reason. The method also returns false while pushes are off.
Description
The Content pushes row checks only whether seo_head_reconnect_reason() equals publish_live,
although that method prioritizes other reconnect reasons when settings drift together. If Maximum
status changes alongside a page-enhancement capability or the metadata setting, the card shows no
publishing warning even though CiteCue's recorded publishing flag is stale.

3. Pending posts are described as drafts ✓ Resolved Medium

Resolving commit: d3840f7

Resolution reason
The switch in seo_head_reconnect_notice-related code in class-citecue-admin.php now separates
'publish', 'pending', and default cases. The 'pending' case gives its own message saying posts will
arrive pending review, and only the default (draft) case still says drafts. This fixes the
misstatement for Pending, though via a switch with a separate Pending message rather than a generic
non-draft wording; a Pending-cap test was also added in test-admin-notices.php.
Description
The lowered-status branch of seo_head_reconnect_notice() says posts will arrive as drafts for
every status other than Published. When Maximum status is Pending and CiteCue still requests
publish, the ingest cap produces pending posts instead, so the reconnect notice misstates what
happens to scheduled content.

View resolved (1)
4. Sites with pushes off get false warnings ✓ Resolved Medium

Resolving commit: d3840f7

Resolution reason
Added publish_live_is_stale(), which returns false when the site is not connected or ingest_enabled
is off. seo_head_reconnect_reason() now returns 'publish_live' only if that check passes, so the
reconnect prompt is suppressed while pushes are off. The Content pushes status-card row now gates on
publish_live_is_stale() instead of the reason string. The publish_live message was also split by
status so the pending case no longer says drafts. Tests were added asserting no notice while pushes
are off.
Description
The new publish_live notice and Content pushes warning describe posts being sent or published
without checking ingest_enabled. A connected site with content pushes off can change Maximum
status and receive those warnings beside “Not accepted,” although the ingest endpoint rejects every
push before applying the status cap.

Grey Divider

Context sources
✅ Linked PRs:
  🌐 PR #13
  🌐 PR #17
✅ Cross-repo context — repo relationships
  Explored: repo: henry-mosh/citecue_app (sha: 90561a09) — View relationship
Review mode: Auto: 🚀 Fast: Localized admin status wording with contained branching; no high-risk behavior.

Grey Divider

Tip of the day
💡 Did you know, you can describe a rule in plain language on the Rules page and Qodo drafts it for you

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit de2b7dd

Results up to commit f4e45bd ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required

Nice, no open findings for this group


Remediation recommended

Nice, no open findings for this group


Informational

Nice, no open findings for this group

Resolved findings

1. Publishing drift disappears from the status card ✓ Resolved Medium

Resolving commit: d3840f7

Resolution reason
The status card row now uses a new Citecue_Settings::publish_live_is_stale() method that checks
publish_live drift independently of seo_head_reconnect_reason(), so a stale publishing flag still
shows beside another reason. The method also returns false while pushes are off.
Description
The Content pushes row checks only whether seo_head_reconnect_reason() equals publish_live,
although that method prioritizes other reconnect reasons when settings drift together. If Maximum
status changes alongside a page-enhancement capability or the metadata setting, the card shows no
publishing warning even though CiteCue's recorded publishing flag is stale.

2. Pending posts are described as drafts ✓ Resolved Medium

Resolving commit: d3840f7

Resolution reason
The switch in seo_head_reconnect_notice-related code in class-citecue-admin.php now separates
'publish', 'pending', and default cases. The 'pending' case gives its own message saying posts will
arrive pending review, and only the default (draft) case still says drafts. This fixes the
misstatement for Pending, though via a switch with a separate Pending message rather than a generic
non-draft wording; a Pending-cap test was also added in test-admin-notices.php.
Description
The lowered-status branch of seo_head_reconnect_notice() says posts will arrive as drafts for
every status other than Published. When Maximum status is Pending and CiteCue still requests
publish, the ingest cap produces pending posts instead, so the reconnect notice misstates what
happens to scheduled content.

3. Sites with pushes off get false warnings ✓ Resolved Medium

Resolving commit: d3840f7

Resolution reason
Added publish_live_is_stale(), which returns false when the site is not connected or ingest_enabled
is off. seo_head_reconnect_reason() now returns 'publish_live' only if that check passes, so the
reconnect prompt is suppressed while pushes are off. The Content pushes status-card row now gates on
publish_live_is_stale() instead of the reason string. The publish_live message was also split by
status so the pending case no longer says drafts. Tests were added asserting no notice while pushes
are off.
Description
The new publish_live notice and Content pushes warning describe posts being sent or published
without checking ingest_enabled. A connected site with content pushes off can change Maximum
status and receive those warnings beside “Not accepted,” although the ingest endpoint rejects every
push before applying the status cap.

Results up to commit d3840f7 ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required

Nice, no open findings for this group


Remediation recommended

Nice, no open findings for this group


Informational

Nice, no open findings for this group

Resolved findings

1. Live posts misreported as drafts ✓ Resolved Medium

Resolving commit: 25cc466

Resolution reason
Added a code comment noting the flag only sets CiteCue's default and the Calendar's per-post
"Publish live" switch still overrides it. Rewrote the 'publish' branch notice to say posts "will
default to drafts unless you switch them to publish live there," removing the unconditional draft
claim. Also rewrote the other branches to describe defaults ("CiteCue will default posts you
schedule to published"), and added test assertions for the new wording. This matches the finding's
requested remediation of describing the stale capability as affecting the default landing rather
than every post, though it is worded differently from the suggested fix.
Description
The raised-status branch of seo_head_reconnect_notice() says CiteCue will keep sending scheduled
posts as drafts until reconnecting, but citecue_app lets an administrator explicitly set the
Calendar landing to publish, overriding a stale publish_live: false capability. If Maximum
status is now Published, that explicit request passes the plugin’s status cap and the post goes live
despite the notice.

Grey Divider

Qodo Logo

Comment thread includes/class-citecue-admin.php Resolved
Comment thread includes/class-citecue-admin.php Resolved
Comment thread includes/class-citecue-admin.php Resolved
@qodo-code-review

Copy link
Copy Markdown

Qodo Fixer

No findings are within the configured fix scope. To change which findings are fixed, adjust the setting on your Qodo configuration page.

Review follow-ups on the publish_live reconnect prompt:

- Lowered to Pending, a post CiteCue asks to publish arrives pending
  review, not as a draft. The notice now says which.
- The status card asked for the notice's one leading reason, so a stale
  publish flag vanished from "Content pushes" whenever page enhancements
  were stale too. It now asks publish_live_is_stale() directly.
- A site that accepts no pushes is sent no posts, so publish drift there
  is no reason to reconnect. The flag is still reported as Maximum
  status says; the prompt waits until pushes are switched on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread includes/class-citecue-admin.php Resolved
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit d3840f7

The Calendar's own "Publish live" switch overrides CiteCue's default per
post, so a stale publish_live changes only what a scheduled post
defaults to. The notice said every post would arrive as a draft (raised)
or that CiteCue would always ask to publish (lowered). Both now name the
default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 25cc466

The "Content pushes" row said "Accepted (as drafts, unless raised below)"
whatever the setting, so on a site set to Published it sat just above
the line saying the site now publishes live. It now states the cap:
saved as drafts, held for review, or may be published live.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit de2b7dd

@henry-mosh
henry-mosh merged commit 588e7c3 into main Nov 19, 2026
8 checks passed
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