Skip to content

feat(action-center): turn on automatic execution, with a trail people can read - #835

Merged
gkhngyk merged 1 commit into
mainfrom
feature/agent-run-trail
Sep 26, 2026
Merged

gkhngyk merged 1 commit into
mainfrom
feature/agent-run-trail

Conversation

@gkhngyk

@gkhngyk gkhngyk commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Phase 7 shipped the mechanism and left the trigger unpulled. Pulling it needed
one thing first, and it was not a waiting period.

The actual blocker

The runner recorded every attempt in action_task_runs, which has no
interface, and nothing in action_events, which is what the drawer's History
tab shows. So a task the product carried out for itself looked exactly like one
a colleague had done: marked complete, no trail, nobody to ask.

That is worse than not automating it — and it was the real blocker rather than
the two clean nights I had asked for. Both shipped tools only read, so the risk
was never damage; it was a user seeing work they could not account for. I had
the wrong reason for waiting.

Three events, for three things a user needs to know

event shown as
task_ran {task} — carried out automatically ({tool})
task_run_failed {task} — the automatic attempt failed; it needs doing by hand
task_awaiting_approval {task} — waiting for your approval before it reaches outside Ansvisor

A task blocked because no tool implements it yet, or because it waits on
another task, stays out of the trail. That is operational detail, it is already
in the audit table, and it would be noise in a list people read to understand
their own work.

actor_id stays null, which is already how the nightly engine's own events are
recorded: null means the product did this, not a person.

The task is named in the reader's language and the tool by its id — the id is
the audit fact, so it is not translated. A task this build has no copy for is
humanised rather than shown as a key.

A trail that fails to write does not fail a completed run: the audit row is
already there and the task's status is the fact that matters.

With that, the sweep is on

sweepTaskExecution runs nightly, after the signal catch-up so tonight's
actions exist before anything works on them. Bounded at 50 attempts a night
across every brand
: the cost of a misfiring detector here is third-party
requests rather than damage, but it should not become a thousand of them before
anyone is awake.

Sized from what exists — seven brands have analytics connected and an action
carries at most two tool-backed tasks — so a normal night is far under it.
Reaching it is a signal in itself and the sweep logs a warning.

Merging this turns automatic execution on. Fourteen agent-mode tasks still
have no tool, so tonight's sweep will attempt only validate and
measure_traffic_impact.

Also

backfill-signals.js now goes through runSignalPass rather than calling the
recorder and generator itself. Running it by hand this morning recovered a
brand's week of missed signals but wrote no ledger row, so signal_runs
claimed the pass had not run when it had — unreliable at exactly the question
it was added to answer.

Related issue

Refs #818

Type of change

  • feat — New feature

How to test

cd server && yarn test     # 617 tests, 8 new
cd web && yarn test && yarn typecheck && yarn lint && yarn build

After the next nightly run, an action whose validate task ran shows a
carried out automatically entry in its History tab, and action_task_runs
holds the input and output behind it.

No migration.

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

… can read

Phase 7 shipped the mechanism and left the trigger unpulled. Pulling it
needed one thing first, and it was not a waiting period.

The runner recorded every attempt in `action_task_runs`, which has no
interface, and nothing in `action_events`, which is what the drawer's History
tab shows. So a task the product carried out for itself looked exactly like
one a colleague had done: marked complete, no trail, nobody to ask. That is
worse than not automating it, and it was the real blocker rather than the two
clean nights I had asked for — both tools only read, so the risk was never
damage, it was a user seeing work they could not account for.

The runner now writes to both. Three events, for the three things a user
needs to know: it ran and with what, the attempt failed and the step needs
doing by hand, or it is waiting for their approval to reach outside Ansvisor.
A task blocked because no tool implements it yet, or because it waits on
another task, stays out of the trail — that is operational detail, it is in
the audit table, and it would be noise in a list people read to understand
their own work. `actor_id` stays null, which is already how the nightly
engine's own events are recorded: null means the product did it.

With that, the nightly sweep is wired up. Bounded by a ceiling of 50 attempts
a night across every brand: the cost of a misfiring detector here is
third-party requests rather than damage, but it should not become a thousand
of them before anyone is awake. Seven brands have analytics connected and an
action carries at most two tool-backed tasks, so a normal night is far under
it — reaching it is a signal in itself and the sweep says so.

Also: `backfill-signals.js` now goes through `runSignalPass` rather than
calling the recorder and generator itself. Running it by hand this morning
recovered a brand's week of missed signals but wrote no ledger row, so
`signal_runs` claimed the pass had not run when it had — unreliable at exactly
the question it was added to answer.

Refs #818

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01SQ2H6mSd9JDpmqonk2VWBj
@gkhngyk
gkhngyk merged commit ddfed8b into main Sep 26, 2026
6 checks passed
@gkhngyk
gkhngyk deleted the feature/agent-run-trail branch September 26, 2026 09:22
@gkhngyk gkhngyk mentioned this pull request Sep 26, 2026
33 of 37 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant