Pular para o conteúdo

Casa Tech Agent (casa-tech-agent)

Casa Tech Agent

go run . casa-tech-agent (wrapper scripts/daily-casa-tech.sh) publishes editorial articles for the /tecnologia-casa/ section — technology applied to houses across the whole lifecycle, from building (construction tech, 3D printing, pre-fabricated) to cleaning (robot vacuums), through smart home, energy, security and connected appliances.

Each run follows the standard agent pipeline: research → plan → generate → validate → retry → deploy.

  1. Topic rotation — six angles walk the house lifecycle (tech-construcao, tech-casa-inteligente, tech-limpeza, tech-energia, tech-seguranca, tech-eletro), tracked at site/cache/casa-tech/tracker.json. Override the catalog via the admin (save-topics writes site/cache/agent-config/casa-tech-topics.json; agentconfig.LoadCasaTechTopics validates the closed type set).
  2. Research — crawlTopicData runs two pt-BR queries per angle through the searchcrawler provider chain (serper/brave/bing/ddg/crawl4ai). No context → the run aborts (contentquality.IsEmptyContext) rather than generate generic content.
  3. Generate — the shared planner + section-writer orchestrator (prompts/casa_tech_planner.txt + prompts/casa_tech_section_writer.txt) produces the outline and HTML body. The prompts forbid invented numbers: prices, specs and launch dates must come from the crawled context.
  4. Validate — contentquality.DefaultCasaTechRules(): ≥800 words, ≥5 headings, banned-phrase list, current-year timeliness gate; no city gate (it is not a localized page). 3 in-run attempts with error injection, then scheduled retries with backoff (cache/casa-tech/retry.json, 30m → 1h → 2h → 4h, max 3).
  5. Publish — pages at /tecnologia-casa/{slug}/ + section index and archive (/tecnologia-casa/, /tecnologia-casa/arquivo/) rendered by the noticias scoped generator (the theme lives outside /noticias/ via URLPrefix: "tecnologia-casa"), then generate-sitemap and a scoped deploy (tecnologia-casa/…, the post image, sitemap shards, robots.txt) — a handful of mutations, far under the 500 gate.

Why a fresh URL prefix

The 2026-11-01 revenue recovery de-indexed 15 thin per-city topic scopes — including /casa-inteligente/, /energia-solar/, /construir/, /casa-container/ and /manutencao/: 134-word city pages with zero clicks. This section deliberately does not recreate that pattern:

  • fresh prefix tecnologia-casa — not in DeindexedScopePrefixes(), not a redirect alias, not robots-disallowed;
  • substantial single-topic articles (≥800 words, question-shaped headings, grounded in crawled research), never per-city templated pages.

Scheduling

Units are checked in at scripts/systemd-units/ but were not enabled at launch: the section landed during the GSC re-evaluation window (WoW verdict ~Nov 12), and the rollout doctrine keeps new URLs out of the sitemap until the verdict. New URLs are additive — the lastmod content-hash store keeps every existing lastmod stable — but the section launch was still staged post-verdict.

Timer: redecasas-casa-tech.timer, Mon/Wed/Fri 08:47 (after ai-news 08:07 and IBGE 08:27). Retry checker: check-casa-tech-retry.sh via redecasas-casa-tech-retry.timer (run days 08:00–13:00 every 30 min).

Activation (post-verdict checklist)

  1. mkdir -p ~/.config/systemd/user && cp scripts/systemd-units/redecasas-casa-tech*.service scripts/systemd-units/redecasas-casa-tech*.timer ~/.config/systemd/user/
  2. systemctl --user daemon-reload
  3. systemctl --user enable --now redecasas-casa-tech.timer redecasas-casa-tech-retry.timer
  4. First supervised run: scripts/daily-casa-tech.sh (watch the log in logs/daily-casa-tech-*.log), then confirm https://redecasas.com.br/tecnologia-casa/ renders and appears in the sitemap.
  5. Record the launch on the recovery ledger (#198), per the faq-rollout precedent.

Operations

CommandWhat it does
go run . casa-tech-agent --dry-runCrawl + generate locally, no deploy (freeze-gated)
go run . casa-tech-agent --topic tech-limpezaForce one angle instead of the rotation
go run . casa-tech-agent --retryRun only if a scheduled retry is due
scripts/daily-casa-tech.shWrapper: freeze gate, lock, connectivity wait, run, schema check, success marker
scripts/check-casa-tech-retry.shRetry poller (driven by the retry timer)
  • Freeze-gated like every agent: sitefreeze.RequireNotFrozen in the Go command and freeze_skip in the wrapper; the freeze timers list includes the casa-tech units.
  • Per-agent model override: CASA_TECH_LLM_MODEL (same precedence as AI_NEWS_LLM_MODEL).
  • The admin dashboard lists the agent (casa-tech) for trigger-run, pause/resume-timer, clear-retry, save-env, save-topics, load-logs and search-logs.
  • Boot catch-up: scripts/boot-catchup-marker.sh casa-tech re-runs the wrapper after a reboot if it has not succeeded today.
  • Deploying the nav change also needs the edge worker redeploy (worker_html.mjs carries the nav constants) — see docs/src/content/docs/frontend/ for the worker deploy procedure.