Skip to content

feat(content): fix metric rollup trigger, add SEO fields, reconcile flow cap - #36

Merged
xuyushun441-sys merged 1 commit into
mainfrom
optimize/content
Jun 14, 2026
Merged

xuyushun441-sys merged 1 commit into
mainfrom
optimize/content

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

Why

Three issues found in the editorial-calendar template's business logic:

  1. Rollups silently stale. publication_rollup triggered on record-after-update with a previous.* condition, but metric snapshots are append-only (record_metric_snapshot inserts a new row each period). So on the real recording path the rollup never fired — publication/piece totals only matched in seed. The ROI dashboard would drift the moment a user recorded their first snapshot.
  2. Missing SEO model. The growth/SEO persona tracks title-tag / meta-description / target-keyword before publishing; none were modeled, so the tool couldn't replace that checklist.
  3. Charter breach. The package ships 5 flows but the charter capped flows at 4.

What changed

  • publication_rollup: trigger → record-after-create, dropped the update-only condition. Totals now refresh when a snapshot is recorded.
  • content_piece: added seo_title, meta_description, primary_keyword (en + zh-CN).
  • CHARTER: flow cap 4→5 to match the five distinct event-driven flows already shipping.

Deferred (documented)

Hardening in_review → approved against manual bypass needs a role-aware field-readonly predicate that no template/spec surface in this repo supports yet; forcing it via the state machine would break the approval flow's own set_approved step. Left as-is with a note rather than risk the working approval gate.

Verification

typecheck + objectstack build + repo format:check clean. Build: 9 Objects / 93 Fields.

🤖 Generated with Claude Code

…low cap

- publication_rollup fired on record-after-update with a previous.* condition,
  but metric snapshots are append-only (record_metric_snapshot inserts a new
  row each period), so the rollup never ran on the real recording path —
  publication/piece totals only matched in seed data. Switch the trigger to
  record-after-create and drop the update-only condition so the ROI and
  editorial-calendar dashboards stay correct once a real snapshot is recorded.

- Add the SEO levers the growth/SEO persona actually tracks before publishing:
  content_piece.seo_title, meta_description, primary_keyword (en + zh-CN).

- CHARTER: raise the flow cap 4→5 to match the five distinct event-driven
  flows that already ship (the package was over its own stated cap); note the
  lifecycle-notifications rename.

Deferred (documented, not changed): hardening the in_review→approved state
transition against manual bypass needs a role-aware field readonly predicate
that no template/spec surface in this repo supports yet; forcing it via the
state machine would break the approval flow's own set_approved step.

typecheck + objectstack build + format:check clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@xuyushun441-sys
xuyushun441-sys merged commit 6fb7fd9 into main Jun 14, 2026
3 checks passed
@xuyushun441-sys
xuyushun441-sys deleted the optimize/content branch June 14, 2026 23:27
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.

2 participants