Skip to content

feat(action-center): ship the V1 definition library — all 62 definitions - #839

Merged
gkhngyk merged 1 commit into
mainfrom
feature/action-definition-library
Sep 26, 2026
Merged

gkhngyk merged 1 commit into
mainfrom
feature/action-definition-library

Conversation

@gkhngyk

@gkhngyk gkhngyk commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Delivers the V1 definition library from the Action Engine and Task Library
specifications: 62 action definitions, 62 task primitives, and the
detectors to trigger them.

The seven phases of #818 built the engine and stopped at 8 definitions and 24
tasks, on a decision — "add definitions as their detectors land" — that was
never put to the person who wrote the specification, and then reported the
work as done. It was not. This is the library.

Definitions — 62 registered, 58 enabled

family spec registered enabled
Growth 19 19 17
Protect 10 10 10
Recover 11 11 11
Fix 13 13 11
Compete 9 9 9

Each carries its specification code (G01…C09), signal mapping, required and
optional sources, and the task plan the Task Library specification gives it.

Four stay registered but off, each stating which data it waits for — the
registry test requires the reason:

  • G11 brand associations and F08 brand-information consistency need
    attribute extraction from answers, which the product does not do; the
    specification rules out an LLM judging what is true.
  • G13 organic-page expansion needs page-level Search Console data; the
    sync stores queries only.
  • F07 broken citation targets need URL health checks, which do not exist.

Detectors — 47 new signal kinds, 12 families

Each family reads a compact summary through a new ae_* Postgres function
(00091) instead of scanning rows from the server — the shape that took the
nightly pass down twice (#829, #834). Every read was measured on the largest
brand before shipping:

read time
ae_prompt_stats 0.53s
ae_competitor_prompt_stats 0.53s
ae_dimension_stats 0.17s
ae_citation_sources 1.6s (was 15s as a naive join)
ae_owned_citations 0.95s (was 6.1s)
ae_fanout_gaps 0.49s
ae_gsc_queries 0.63s
ae_ai_traffic_pages 0.24s

Families are isolated. A failed read costs that family's signals for the
night and reports its kinds as unread, so the recorder does not resolve every
open signal of those kinds on the strength of a timeout. Transient timeouts
are retried, as the pulse has done since #687.

Three conditions I said in phase 3b had no data do: fan-out queries are
stored on every result, entity signals are Site Audit checks, and Search
Console queries are synced.

Thresholds are new and deliberately conservative, and say so in the config:
they were set, not calibrated. A per-kind cap (5 per brand per night) bounds
the worst case while a few clean nights accumulate.

Tasks — the specification's 62 primitives

In the specification's vocabulary: modes SYSTEM / AGENT / HUMAN /
HUMAN_OR_AGENT, permissions READ / WRITE / EXECUTE, WRITE and EXECUTE
requiring approval. Dependencies follow §10. The planner follows §7 and the
Task Library acceptance tests, each now a test:

  • 1–2 no Search Console task without Search Console; one with it
  • 3–4 an existing page is optimised; a missing one is briefed and
    drafted — never both
  • 5 publishing falls to a person when no publishing tool exists; the
    action is not blocked
  • 12 one task per primitive, however many entries imply it

The 23 tasks raised before the library remain resolvable and runnable. No
definition may plan them.

Titles name their targets

Actions, tasks and signals alike, per §5 and §11: Recover lost citations on
7 prompts
, Analyze citations across 11 sources. An action raised before
the library has no targets on its payload and gets its title without a count
rather than "0 prompts".

What it does, measured before any write

Dry run across the 23 brands tracked in the last two days:

  • 267 definitions have a finding
  • 110 actions open tonight — five per brand, the specification's daily
    limit
  • the rest queue, and open as slots free, highest priority first

On the largest brand: 12 definitions ready, 5 open tonight (lost citations on
7 prompts, a competitor visibility gap, citations lost on 11 owned pages,
momentum on 15 prompts, 50 competitor-won fan-out queries), 7 queued.

Two things done carefully

  • signals.category has a check constraint, and one rejected insert throws a
    brand's whole pass. The library first used a content category the
    constraint does not allow; a test now pins the categories to it.
  • The task vocabulary migration (00093) was applied before this code is
    deployed, which would have made the live server's inserts fail. 00094 keeps
    the old values valid during the transition; a follow-up drops them once
    this has run a night.

Related issue

Refs #818

Type of change

  • feat — New feature

How to test

cd server && yarn test     # 836 tests
cd web && yarn test && yarn typecheck && yarn lint && yarn build   # 354 tests

Migrations 00091–00095 are applied to the hosted database.

Checklist

  • Branch follows the naming convention (feature/)
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

🤖 Generated with Claude Code

https://claude.ai/code/session_01SQ2H6mSd9JDpmqonk2VWBj

The V1 specification asks for 62 action definitions (19 Growth, 10 Protect,
11 Recover, 13 Fix, 9 Compete) and a shared library of 62 task primitives.
The seven phases of #818 built the engine and stopped at 8 definitions and 24
tasks, on a decision — add definitions as their detectors land — that was
never put to the person who wrote the specification. This delivers the
library.

Definitions. All 62 are registered, with the specification's stable codes
(G01…C09), signal mappings, required and optional sources, and the task plan
the Task Library specification gives each. 58 are enabled. Four stay
registered but off, each saying which data it is waiting for: brand
associations and brand-information consistency need attribute extraction the
product does not do (and the specification rules out an LLM judging truth);
organic-page expansion needs page-level Search Console data, which the sync
does not store; broken citation targets need URL health checks, which do not
exist.

Detectors. 47 new signal kinds across twelve families, each reading a
compact summary through a new `ae_*` Postgres function rather than scanning
from the server — the shape that took the nightly pass down twice (#829,
#834). Every read was measured on the largest brand; the slowest runs in
1.6s. Each family is isolated: a failed read costs that family's signals for
the night, and its kinds are reported unread so the recorder does not take
the silence for recovery. Three conditions I earlier said had no data do:
fan-out queries are stored on every result, entity signals are Site Audit
checks, and Search Console queries are synced.

Tasks. The 62 primitives, in the specification's vocabulary — SYSTEM, AGENT,
HUMAN, HUMAN_OR_AGENT; READ, WRITE, EXECUTE — with its dependency rules and
structured outputs. Plans branch the way the specification says: an existing
page is optimised, a missing one is briefed and drafted, never both.
Publishing falls to a person when no publishing tool exists, rather than
blocking the action. The 23 tasks raised before the library remain resolvable
and runnable; no definition may plan them.

Titles name their targets throughout — actions, tasks and signals — per the
specification: "Recover lost citations on 7 prompts", not "Recover
citations".

Dry run across the 23 brands tracked in the last two days, before any write:
267 definitions have a finding, and tonight opens 110 actions, five per brand
— the specification's daily limit. The rest queue and open as slots free.

Two things done carefully. The signal categories are pinned to the database
check constraint by a test, because one rejected insert throws a brand's
whole pass. And the task vocabulary migration was applied before this code
is deployed, so a transition migration keeps the old values valid until it
is; a follow-up drops them.

Refs #818

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SQ2H6mSd9JDpmqonk2VWBj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-migration Adds or edits a migration — apply it to the hosted database

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant