Skip to content

fix: default automation post author to the network bot account (#207)#421

Merged
chubes4 merged 1 commit into
mainfrom
honest-authorship-dme
Jul 6, 2026
Merged

fix: default automation post author to the network bot account (#207)#421
chubes4 merged 1 commit into
mainfrom
honest-authorship-dme

Conversation

@chubes4

@chubes4 chubes4 commented Jul 5, 2026

Copy link
Copy Markdown
Member

Part of honest content authorship at the source — extrachill-events#207 (Phase 2).

Problem

EventUpsert::resolvePostAuthor() fell through to WordPressSettingsResolver::getPostAuthor(), whose last-resort fallback is getFirstAdministratorId()uid 1 (Chris). That's how ~3k automated events (blog 7) and 153 wire posts (blog 11) ended up authored under a human account — the misattribution the heatmap/points engines can't ignore.

Fix

Automation (no submission context, no explicit author config) now resolves to the network bot account via ec_get_network_bot_user_id() (extrachill-users) instead of the first-admin fallback.

Resolution order:

  1. submission['user_id'] — human submitter (logged-in or Phase 1 anon-resolved). Unchanged.
  2. Explicit config — system default_author_id, then per-handler post_author. Respected when set.
  3. Network bot account via ec_get_network_bot_user_id() — the honest default. ← NEW
  4. WordPressSettingsResolver (logged-in user / first admin) — last resort, only if the helper is unavailable.

Why this layer

data-machine-events is the EC integration layer, so it owns the EC bot-id default. This is layer-pure: the generic data-machine resolver is untouched, and the bot id is config-driven (no magic 32) via the helper in extrachill-users.

Behavior notes

  • Existing per-flow post_author=32 handler configs keep working (explicit config still wins).
  • This hardens the no-config case (15 event flows currently have post_author=0) so automation can never again default to a human admin.
  • Forward-looking: NEW automated posts land on the bot; NEW submissions land on the submitter (Phase 1).

Verified

  • php -l clean.
  • No existing EventUpsertTest cases exercise resolvePostAuthor (verified); isolated private method.
  • Composer/vendor not installed in the worktree, so the full PHPUnit suite wasn't run locally — recommend CI.

Sibling PRs (merge together)

Conventional commits. No CHANGELOG / version bumps.

Phase 2 of honest content authorship (extrachill-events#207).

EventUpsert::resolvePostAuthor() now resolves genuine automation (no
submission context, no explicit author config) to the network bot account
via ec_get_network_bot_user_id() instead of falling through to
WordPressSettingsResolver's first-administrator fallback — the fallback that
historically misattributed ~3k automated events (and 153 wire posts) to uid 1.

Resolution order:
  1. submission user_id (human submitter, incl. Phase 1 anon-resolved) — highest
  2. explicit config (system default_author_id, then per-handler post_author)
  3. network bot account via ec_get_network_bot_user_id() — the honest default
  4. WordPressSettingsResolver (last resort, only if the helper is unavailable)

This is config-driven (no magic 32 literal) and layer-pure: data-machine-events
is the EC integration layer, so it owns the EC bot-id default rather than
punting the decision into the generic data-machine resolver. The existing
extrachill/create-user helper lives in extrachill-users (sibling PR).

Existing per-flow post_author=32 handler configs continue to work (explicit
config still wins); this hardens the no-config case so automation can never
again default to a human admin.

Backfill of the existing ~3k uid-1 event rows + 153 wire rows is handled by
the extrachill-events backfill-authorship CLI (Phase 3).
@homeboy-ci

homeboy-ci Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Homeboy Results — data-machine-events

Review audit

review audit — passed

  • audit — 7 finding(s)
  • Total: 7 finding(s)

Deep dive: homeboy review audit data-machine-events --changed-since 3360e72

Artifacts and drill-down
  • CI results artifact: homeboy-ci-results-data-machine-events-review-audit-homeboy-Linux-node24 contains immediate command JSON for this action invocation.
  • Observation artifact: homeboy-observations-data-machine-events-review-audit-homeboy-Linux-node24 contains exported Homeboy run history for deeper queries.
  • Drill-down: download the observation artifact, then run homeboy runs import <dir>, homeboy runs list, and homeboy runs findings <run-id>.
  • Artifacts are attached to the workflow run: https://github.com/Extra-Chill/data-machine-events/actions/runs/28756029695
Tooling versions
  • Homeboy CLI: homeboy 0.281.10+bb840a5b550b+f22ddb3
  • Extension: wordpress from https://github.com/Extra-Chill/homeboy-extensions
  • Extension revision: 68d84557
  • Action: Extra-Chill/homeboy-action@v2

@chubes4 chubes4 merged commit 28859c9 into main Jul 6, 2026
1 check passed
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