Shopify Lane Closeout + Expansion — Consolidation Build Report (2026-08-27)

Status: LANDED ON main. Correction 2026-09-02 (FINISH_IT_STATUS_2026-09-02 §P-2.3): the original status line below read "local-only, NOT PUSHED", which was stale — the tree wins over the doc (.claude/rules/01). Measured landing commit of the W1–W6 code: git log --diff-filter=A -1 origin/main -- services/net-yield/returns_adjustment.py → 8e63d0dac (2026-09-02), whose auto-merge subject names the branch claude/mem-superseded-key-r2 — a branch name that does not describe its contents, so ancestry-by-name misleads and only content settles it. Verify per flag on main: RETURNS_ADJUSTED_NCM, INVENTORY_SPEND_GATE, RETENTION_COHORTS, CREATIVE_FATIGUE, KLAVIYO_FEED all default-OFF by source literal.

Original status line (historical, now corrected): Consolidated on claude/shopify-closeout-expansion-v1.0, local-only, NOT PUSHED. All gates below are green except one pre-existing, unrelated red inherited from origin/main.

Consolidated tip: 51cbb7a6 (branch claude/shopify-closeout-expansion-v1.0, worktree wt-w1, fast-forwarded onto the consolidation branch tip after all merges below).


1. Per-workstream detail

W1 — Returns-Adjusted Net Yield

W2 — Inventory Spend Gating

W3+W4 — Retention Cohorts + Creative Fatigue

W5+W6 — Klaviyo Value Feed + Onboarding Pack

Step 0 fix (independent of W1–W6, already on origin/main at 97e591d4)

While consolidating, origin/main was found to be 5 commits ahead of the branch point used for W1/W2/W5W6, including 97e591d4 ("fix(shopify-closeout): pin PIXEL_EVENTS_ENABLED source literal; correct stale ghost-bid claim") — an independent verification session's fix for exactly the same gap W5+W6 had also patched (a missing source-literal test on PIXEL_EVENTS_ENABLED in services/intent-shopify-extender/test_pixel_events.py). The duplicate was real: after merging origin/main into the consolidation branch, both fixes landed in the same file (git's merge algorithm combined them without a textual conflict, since they touched different line ranges), producing two PixelEventsFlagLiteralTests classes with the same name — the second silently shadowed the first, quietly dropping test coverage. Resolved: kept origin/main's AST-based version (already reviewed, has a full verification report docs/reports/SHOPIFY_CLOSEOUT_VERIFY_2026-08-27.md backing it) and removed W5+W6's regex-based duplicate (including the now-unused import re). Also merged in the origin commit's other fix (docs/product/FEATURE_COVERAGE_MATRIX_v1.md rows 2.7/G-03, ghost bids PROPOSED→PARTIAL (DARK)) — no conflict with W5+W6's own row 4.8 addition to the same file (different rows).


2. Consolidation mechanics and defects found/fixed en route

Consolidation worked branch-by-branch (git merge --no-ff) into a fresh worktree, in order W1 (base) → W2 → W3+W4 → origin/main (5 commits) → W5+W6, landing at tip 51cbb7a6. No code files overlapped between W1–W5+W6 — every real conflict was in the memory system (.claude/memory/index.json, manifest.json, CLAUDE.md), which each workstream's own local memory rollover had touched independently.


3. Consolidated gate results (fresh venv, wt-w1 @ 51cbb7a6)

Fresh venv built from the union of every touched service's requirements.txt plus pip install -e contracts (rule 01: never trust a reused venv).

Suite Result R3/register baseline Note
services/measurement-rails 443 passed, 2 warnings, 7 subtests 396
tests/connectors 340 passed — (part of gateway+connectors 220)
services/service-marketing-connectors 162 passed — combined w/ above = 502 vs. 220 baseline
services/intent-shopify-extender 41 passed 20 incl. the reconciled PixelEventsFlagLiteralTests
services/net-yield 173 passed — (new W1 suite)
tests/governance all green, exit 0, 100% (no F/E marks) — new W2/W3/W4 tests included
tests/remediation 305 passed, 1 failed — see below — pre-existing, unrelated

The one failure — tests/remediation/test_contracts_hardening.py::test_domain_covers_all_six_platform_domains — is PRE-EXISTING on origin/main and unrelated to this work. Reproduced directly against origin/main's own contracts/ and test file (checked out in isolation, same failure): Domain enum carries an extra 'calibration' member the test's hardcoded six-domain set doesn't expect. Not touched or introduced by any W1–W6 workstream. Per .claude/rules/01-verification-discipline.md ("reproduce a claimed pre-existing failure against the base branch before accepting it as pre-existing") — reproduced, confirmed, out of scope here.

Canon / skill / governance checks — all green

python3 scripts/mizoki_canon.py --check              → exit 0
python3 scripts/skill_sync.py --check                → parity OK — 14 skills, derived copies match, registry current
python3 scripts/skills_sync.py --check                → [skills-sync] OK — all skill copies byte-identical, versions in parity
python3 scripts/ontology_skills_sync.py --check       → Ontology-KG Virtuoso parity: OK (8 profiles)
python3 scripts/claude_memory.py check --strict       → [WARN] root-warning-limit only; validation PASS

Rule 03 pre-merge hygiene greps (scoped to files touched by this consolidation)

Flag defaults — all five new flags confirmed OFF at the source literal

Flag File Default
RETURNS_ADJUSTED_NCM services/net-yield/flags.py:27 os.environ.get(..., "false")
INVENTORY_SPEND_GATE services/service-action-runner/execution_adapters/inventory_gate.py:47 INVENTORY_SPEND_GATE_DEFAULT = False
RETENTION_COHORTS src/shared/growth_control/f2_ltv/retention_cohorts_advisory.py:77 RETENTION_COHORTS_DEFAULT = False
CREATIVE_FATIGUE src/shared/creative_aesthetic/fatigue_detection.py:92 CREATIVE_FATIGUE_DEFAULT = False
KLAVIYO_FEED services/measurement-rails/flags.py:52 off, same pattern as every other rail

Every flag also carries its own source-literal (AST or regex) test, per rule 01 ("every safety default carries a test that fails if the default is flipped").

Protected paths and site-visible files

git diff --name-only origin/main HEAD | grep -E '^\.github/|^deployment/terraform/|^deployment/cloudbuild|^CODEOWNERS'   → empty
git diff --name-only origin/main HEAD | grep -iE 'website|homepage|marketing/index|signal\.html|media/index'            → empty

Zero protected-path or site-visible files in the 54-file / 5,831-insertion / 728-deletion diff against origin/main. No conflict markers remain anywhere in the tree (verified with a repo-wide grep after every merge).


4. Rollback plan


5. Operator remainder (nothing in code substitutes for these — from the

Step 0 verification, re-confirmed unchanged by this consolidation)

  1. Shopify app creation (client_id/secret) — no real credential in code or terraform; TokenRefreshError("oauth_client_unconfigured") when absent. (Corrected 2026-09-30: this is the code posture only — the app exists (miz-oki-commerce-link-5, S-4 CLOSED), OAuth is armed since 08-21 and both secrets are populated and mounted since 08-25; the remainder is the first install.)
  2. SHOPIFY_WEBHOOK_SECRET / provider credentials — fail-closed (401 invalid Shopify webhook HMAC) when unset. (Corrected 2026-09-30: set and mounted since 08-25; the verifier's key choice is defect D1, PR #1275.)
  3. Pixel extension artifact / extender URL — SHOPIFY_PIXEL_COLLECT_URL unset by default; activation deferred loudly ("status": "deferred", "reason": "pixel_collect_url_unset"), plus an equivalent deferral for SHOPIFY_PIXEL_INGEST_SECRET.
  4. Reconciliation runner credentials — inert without merchant credentials (register item 6) and a --events-table/RECONCILIATION_EVENTS_TABLE.
  5. KLAVIYO_PRIVATE_API_KEY (new, W5) — klaviyo_feed.health() reports not_configured until set; the value push half stays dark regardless of the KLAVIYO_FEED flag until this lands.
  6. net_yield_costs real values — config/net_yield_costs.yaml (W1) is fail-closed by design: every null cost marks dependent orders economics_complete=false rather than inventing a default.
  7. INVENTORY_SPEND_GATE_CONFIG_PATH roster/velocity declarations — W2's config ships empty by design; a tenant with no usable block gets inventory_spend_gate: not_configured, not an invented demotion.
  8. 10 design partners — P1 exit criterion (docs/roadmap/P1_BUILD_PLAN.md, docs/product/SIGNAL_SHOPIFY_MASTER_v4.md) is owner-recruiting, unaffected by this consolidation; none of W1–W6 changes that count or its mechanism.

None of the above is substituted with code by this consolidation — every fail-closed / defer-loudly path is preserved and, where new, tested.


6. Open owner decisions — unchanged by this consolidation

Per the Step 0 verification (docs/reports/SHOPIFY_CLOSEOUT_VERIFY_2026-08-27.md Item 6), decisions 3, 9, 12, 13, 14, 15, 17 remain genuinely open with zero resolution in any record as of 2026-08-27. (Superseded 2026-09-15: all but 14 are CLOSED by owner ruling — docs/OPEN_ITEMS.md §A; noted 2026-09-30.) Decision 9 (citation sign-off) is unblocked (5/5 PASS) but not formally closed. None of W1–W6 touches or requires any of these. The Article VI cell-count item is resolved (39 registered cells) and not a live open item.


7. What is NOT done by this report

← All docsView source on GitHub →