- Built Content Quality Scorer (28 rules, 4 categories, 3 output formats)
- Built Local Gate (YAML policies, SQLite audit trail, approve/reject/hold)
- Deployed quality scorer to Kai-CMO server (
/opt/cmo-analytics/quality/) - Deployed 14 marketing skills to OpenClaw (129 → 143 total)
- Synced 7 missing framework files to server knowledge base
- Gateway integration (
POST /webhooks/quality/score) - 4 gate policies: blog-publish, linkedin-article, cold-email, default
Replace the 3 separate gate scripts with the unified quality scorer.
- Refactor
run_gate()inscripts/harness_cli.pyto callscripts.quality.gate.propose()instead offour_us_score.py+banned_word_check.py+seo_lint.py - Map harness format types to gate policies (blog→blog-publish, linkedin→linkedin-article, email→cold-email, press→press-release, tiktok→tiktok-script, meta-ads→meta-ad, google-ads→google-ad)
- Wire
revise_draft()to use quality scorer violations as fix instructions (rule IDs, line numbers, exact suggestions) - Update
post_for_approval()to include proposal_id + score + grade + approve command - Add policies:
press-release.yaml,tiktok-script.yaml,meta-ad.yaml,google-ad.yaml - Test end-to-end:
kai-harness run --task blog --site kaicalls --keyword "test"
Approved content auto-proposes to Zehrava Gate for delivery.
- On local gate approve (or human approves pending): call
gate_client.propose(policy="blog-publish", destination="blog.publish", payload=draft) - Two gates in series: quality gate (instant, local) → action gate (remote, with delivery)
- Add
--deliverflag:python -m scripts.quality gate article.md --policy blog --deliver - Wire Discord notification for pending proposals (post to channel with approve/reject reactions)
Quality scores feed back into the system automatically.
- Wire
performance_check.pyto run quality scorer on published content retroactively (retro_score_content()) - Correlate quality scores with GSC/GA4 performance (position, CTR, session duration)
-
pattern_extract.pyextracts which quality rules correlate with winners (--correlateflag) - Auto-update policy YAML thresholds when n>=5 winner patterns emerge (
harness_defaults_update.py) - Cron: nightly batch score of all published content →
--batch-scoreflag - Weekly: surface quality summary to Discord →
--weekly-summaryflag
meetkai.xyz/architecture should reflect harness engineering approach.
- Reframe as "harness engineering for marketing" (parallel to OpenAI Codex approach)
- Show 4-layer stack: Runtime → Tooling → Domain Agents → Content Harness
- Feature quality scorer as the core moat (research-as-automated-tooling)
- Show feedback loop diagram: write → score → gate → publish → 30d check → pattern extract → update defaults
- 14 marketing skills grid
- Live quality scorer demo wired to POST /webhooks/quality/score
Address competitive review findings — production-grade code quality.
- Centralized config:
scripts/harness_config.py+config.yaml— all hardcoded paths, IDs, thresholds extracted - API timeouts: 30s timeout on all Gemini API calls (configurable via
api_timeout) - Circuit breaker: fail after 3 consecutive API errors (configurable via
api_max_retries) - Input sanitization:
sanitize_input()strips control chars, truncates, escapes prompt-injection patterns - Replace
os.system()withsubprocess.run()— proper error handling, timeouts, return code checks - MARKETING.md backup:
.bakcreated before every auto-update (policy YAML files too) - Fix GSC pagination:
rowLimit: 1→10with weighted aggregation across rows - Fix duplicate
SHORT_FORMdefinition in harness_cli.py - Remove hardcoded Discord channel fallback — now from
config.yaml - LRU cache for quality scoring — identical content not scored twice
- Structured JSON logging across all scripts (
loggingmodule, not bareprint()) - Test suite: gate module tests (test_gate.py) added to existing AA/GEO/CS/engine/parser tests
Quality scorer as standalone pip package.
- Extract
scripts/quality/into standalone package (no dependency on knowledge_cloner) -
pyproject.tomlwith optional[llm]extra for Four U's - PyPI:
pip install kai-qualityorpip install content-quality-scorer - GitHub Actions CI: run tests on PR
- Contributing guide: how to add new rules
- Pre-built rule packs:
--pack aeo,--pack conversion,--pack technical