Macleodglba
Brand and packaging design
Your bloated packaging portfolio isn't scaling your brand—it's silently eroding every margin as sustainability rules tighten. Nobody admits the quiet embarrassment of pitching "green" upgrades to the board that end up costing 4x more in materials, with zero shelf punch. Relief hits when you redesign the whole thing upfront: costs drop, compliance locks in, sales velocity climbs without the usual fights. We've cracked this at Macleodglba with Strategic Packaging Architecture Programs—portfolios rebuilt at concept stage for brand power, savings, and real ESG wins. What's the one packaging trade-off keeping you up lately?
What do you think? Share your thoughts!
25/03/2026
My Daily Live Update — March 25, 2026
Today I killed a critical bug: every time a user refreshed their schedule page, their post quota number drifted — it could double, inflate, or show a phantom number that didn't match the dashboard. For a subscription product where quota accuracy is the billing truth and users need 97%+ publish success, this was unacceptable.
What Actually Happened (The Engineering)
The system had **two competing calculators** for the same number — "how many posts do I have left?"
Legacy | Read `user.remainingPosts` column directly | Schedule page stats, orchestrator generation cap, Ledger | Compute `maxPosts - COUNT(publish_events success)` | Dashboard quota, QuotaBadge, `/api/me`
These two paths diverged silently because:
1. Admin bypass skipped the `remainingPosts` decrement but still recorded publish events
2. Monthly quota resets wrote `remainingPosts = maxPosts` without clearing the publish event ledger
3. The legacy `deductQuota()` method had no idempotency guard
The result: the schedule page showed one number, the dashboard showed another.
The Fix (24 Lines, 2 Files), and a couple of hours swallowed.
One principle: every endpoint now calls `getBrandScopedQuota()` — the same immutable formula: `remaining = maxPosts - COUNT(publish_events WHERE status='success' AND createdAt >= periodStart)`.
1. `QuotaCountersCalculator.ts` — the canonical counter engine now derives `postRemaining` and `postUsedThisPeriod` from the ledger, not the mutable column.
2. `smart-schedule-orchestrated.ts` — the schedule generation orchestrator — now caps post creation using the ledger-derived remaining quota, not the legacy column. All four schedule page data sources are now provably identical:
Zero AI drift by construction. Not by hope, not by testing, but by mathematical identity, every path computes the same SQL query.
The Proof
48 out of 48 contract tests pass across 6 quota-related invariant files:
- `qy-inv-quota-single-truth` — verifies single source of truth
- `qy-inv-quota-never-negative` — quota floor enforcement
- `qy-inv-calculator-brand-isolation` — brand-scoped correctness
- `qy-inv-quota-video-reserve-at-kickoff-ledgered` — video quota ledger integrity
- `qy-inv-brand-isolation-publish` — publish isolation
- `qy-inv-publish-approved-idempotent` — no double-deduction
qy will be the guardrails for my hunter claw which I am building with a claw of helpers. https://opencalw.ai
META App Review: Received a standard rejection today — a delay to overcome tomorrow.
My locked CANONICAL CONTRACT flagged the single-authority rule for quota, QY_INVARIANT tests caught the dual-truth drift pattern in code review, Sentinel self-healing ensures publish events are always recorded (the ledger never lies), CI gates enforce that no code ships without the invariant suite passing.
Every one of these layers turned a potential production incident into a permanent improvement, with logic steps to agentic closed loop system.
https://app.theagencyiq.ai. Play for free
Click here to claim your Sponsored Listing.