Repository navigation
feat(content): fix metric rollup trigger, add SEO fields, reconcile flow cap - #36
Merged
Merged
Conversation
…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>
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.
Why
Three issues found in the editorial-calendar template's business logic:
publication_rolluptriggered onrecord-after-updatewith aprevious.*condition, but metric snapshots are append-only (record_metric_snapshotinserts 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.What changed
publication_rollup: trigger →record-after-create, dropped the update-only condition. Totals now refresh when a snapshot is recorded.content_piece: addedseo_title,meta_description,primary_keyword(en + zh-CN).Deferred (documented)
Hardening
in_review → approvedagainst 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 ownset_approvedstep. Left as-is with a note rather than risk the working approval gate.Verification
typecheck+objectstack build+ repoformat:checkclean. Build: 9 Objects / 93 Fields.🤖 Generated with Claude Code