Files
geo/task_plan.brand-description-prompt.md
T
root b6858d2605 docs(plan): record planning artifacts for recent work streams
Add task_plan/findings/progress notes for knowledge fact fidelity,
brand description context, media supply favorites, and the workspace
sync-to-39 deployment.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-10 20:45:03 +08:00

3.1 KiB

Task Plan: Brand Description Prompt Context

Goal

Include the current brand description in every article-generation prompt while bounding prompt growth and preserving factual/numeric details from long descriptions.

Current Phase

Complete

Phases

Phase 1: Trace and Budget

  • Trace brand persistence and current-brand loading
  • Inventory all article-generation entry points and prompt assembly seams
  • Identify existing prompt/token/character budgets and snapshot behavior

Phase 2: Contract and Regression Tests

  • Define short-description passthrough and long-description compaction rules
  • Add failing tests for every generation path and maximum prompt growth
  • Protect numeric facts from being dropped or rewritten during compaction

Phase 3: Implementation

  • Add one shared brand-context builder
  • Inject the same context into template, custom, imitation, and KOL generation
  • Preserve queued-task reproducibility through snapshots where needed

Phase 4: Verification and Cleanup

  • Run focused, package, and full relevant tests
  • Review prompt output and scoped diff
  • Confirm no temporary instrumentation remains

Decisions

Decision Rationale
Use task-specific planning files Shared plan files are owned by a concurrent long-running task.
Centralize brand context assembly Prevents inconsistent truncation and missing paths.
Budget by runes/tokens before prompt assembly A database field length is not a safe model-context budget.
Cap rendered description at 2000 runes Current production max is 1195; this preserves all current data while bounding future growth to about 2000 estimated input tokens.
Brand profile facts outrank conflicting RAG facts The directly edited brand profile is the canonical source for the brand's own base identity.
Reuse the existing typed fact guard Brand-description dates/year counts should receive the same pre-persistence validation as RAG facts.
Snapshot a structured brand prompt context Supports stable retries and lets old queued tasks fall back to a scoped read.

Errors

Error Attempt Resolution
First production-stat command failed during local JavaScript string parsing 1 Reissued with a single-quoted remote command; no remote command ran on the failed attempt.
Broad config context search returned a sensitive adjacent config line internally 1 Do not repeat or record the value; use exact-key queries without context for future config inspection.
Tenant app test compilation was interrupted by concurrent media-favorites work referencing DeleteFavoriteResourceFromGroup before its implementation existed 1 Preserve unrelated work; use isolated test compilation for the brand regression, then retry normal package tests after the concurrent edit settles.
A second tenant app compile attempt observed the same concurrent feature between interface and implementation edits 2 Stopped retrying until the external file stabilized; the focused, package, and full-repository tests later passed normally.