Sourcing phase 1 (S1): Feeds and Relay move into Sources; relay switches; sources_v2; change log old → new; migrate commands #71
All Vouch review confidence checks passed
Residual risk 0.61 = Change Risk (0.80) × (1 − Review Confidence (0.23)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.80 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 34% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Sensitive Paths
sensitive_paths
0.080
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #71"
general
weight: 0.35
chatgpt-codex-connector[bot]
Sourcing restructure, phase 1, site part (S1), as the owner approved on 25 Oct 2026 (plan:
Claude outputs/sourcing-restructure-plan-2026-10-25.md, §2–§5.2, §8 S1, §9).Merge order: the workers PR merges first: wugweb-git/animal-writes-workers#19 (W1). S1 only adds blocks that W1 reads, and every v1 key stays. Nothing changes for the workers until
wp aw-sourcing migrate --phase=1runs on live.What changes
WP_List_Table,form-table, core notices and buttons, help tabs; no CSS or JS added):- Sources list (
AW_Sourcing_Publishers_Table):- New Feeds column (how many, how many on, how many read by code).
- New Relay column (the switch and its last result).
- New views: With feeds, Read by code, Relay, plus links to the Feeds and Relay log screens.
- Row and bulk actions: Relay on / off (once migrated), and Delete for a source with no items, feeds or press search (core's
showNotice.warn()first).- Rows also cover a relay-only site (record
kind=relay) and a site only feeds come from.- Source edit: "Fetch through this site (relay)" with its last result, then that site's feeds (the feeds list filtered to it) with Add New Feed.
- Feeds (
AW_Sourcing_Sources_Table, reused):- A Publisher column.
- A Publisher field on the feed form. A Google News search limited to one site belongs to that site (owner's decision 2); an open-web search belongs to news.google.com.
- Delete for feeds. Sources read by code are only turned off.
- Relay log:
AW_Sourcing_Simple_Table, searchable.- The old
tab=feeds,library,opportunitiesandrelayaddresses 301 to Sources. A feed'sedit=becomesfeed=.- The explanation paragraphs moved into Help tabs (Overview, Feeds, Relay, Columns).
- Once
aw_sourcing_phase >= 1,aw_relay_hosts()is the hosts whose switch is on (aw_publishers[host].relay, subdomains included). Before migration, and after a rollback, it is the list of before.- The ingest gate makes a relay-only site a publisher on its first item.
-
kits_sourcing_log( $tab, $what, $old = null, $new = null )keeps the newest 1,000 entries (was 300).- The Change log tab gets an Old → new column.
- Every add, edit and delete in Sources, Feeds and Relay logs its old and new values. Bulk actions log in one write.
- Old tab names show as Sources (feeds / Library feeds / Opportunity feeds / relay).
-
config.category_namesis always sent.- Once migrated,
config.schema {sources: 2}andconfig.sources_v2(each v1 source plushost,relay,read_by,check) are sent.- Every v1 key (
publishers,relevance,config.,relay_hosts) is unchanged.wp aw-sourcing backup | migrate [--dry-run] | verify | rollback [--restore-all] --phase=1. Details are in "After merge" below.aw_match_term()(includes/sources-model.php) is the workers' matcher.aw_has_termunderstands a trailing. It is not used for matching yet; phase 2 switches it on withmatch: "word".-
plugins/aw-sourcing/tests/run.phpchecks the sharedmatch_cases.json(the same file as W1) and the Sources model against the live shapes of 25 Oct (tests/fixtures/phase1_live_sample.json, read-onlywp option get).- The Deploy check now runs it.
What the migration does on live (computed from the live options, 25 Oct)
| | Before | After |
|---|---|---|
|
aw_sources.sources| 20 | 20, same ids and order; each gainshost|| Site-limited Google News searches |
court-news-animals,court-news-barandbench,court-news-scobserver,pib-releases| feeds of livelaw.in, barandbench.com, scobserver.in, pib.gov.in (all four already have publisher records) || Publishers | 359 | 360 (+
ccsea.gov.in,kind=relay) || Relay hosts | substack.com, zoomtventertainment.com, awbi.gov.in, ccsea.gov.in, egazette.gov.in | peopleforanimals.substack.com, zoomtventertainment.com, awbi.gov.in, egazette.gov.in, ccsea.gov.in (switches on 4 publishers plus the relay-only record) |
| Relay log (48 rows) | PFA Substack 43, Zoom TV (www.) 1, CCSEA 1, refused tests 4 | every host relayed before is still allowed; substack.com is narrowed to PFA only (owner's decision 8) |
After merge (owner): live steps
Run from
~/domains/animalwrites.in/public_html, after the W1 merge and the S1 deploy:1.
wp aw-sourcing backup --phase=1: prints the counts and the sha256 of each option. Check that the file size is not 0.2.
wp aw-sourcing migrate --phase=1 --dry-run: read the report. It should show 20 → 20 sources, publishers 359 → 360, relay hosts 5 → 5 with the substack.com narrowing, and 0 conflicts.3.
wp aw-sourcing migrate --phase=14.
wp aw-sourcing verify --phase=1: should print0 differences apart from the planned changes.5. Round trip: open Sources → Edit on PFA Substack and press Update without changing anything; then a feed's Edit → Update. Then
wp option get kits_sourcing_log --format=json | head -c 600should show no new entry from those saves.6. Check the next Sourcing run:
relay: … read through the sitefor peopleforanimals.substack.com,lists: from the site (… sources, sources_v2), andsources=the same as before.7. If anything is wrong:
wp aw-sourcing rollback --phase=1(or--restore-allto put back the backed-up options exactly).Review
php -lon every changed file: clean.php plugins/aw-sourcing/tests/run.php: OK, 98 checks.python3 tools/ci/phpcs_delta.py origin/wordpress-dev HEADwith WPCS 3: no new findings in 10 changed files.- A stale Relay form could have replaced all of
aw_sources. It is now a no-op, and unknown tabs keep the stored option.- The feed form pinned the old host when only the address changed.
- Rollback removed hosts set by hand. It now removes only the hosts the migration added.
- A backup taken after the migration could be used for rollback. It is now refused, the migration records which backup it used, and rollback clears the pointer.
- A typo in Publisher cleared the host.
- A relay-only record given a status (quick add, one-click block, bulk) stayed "relay only".
- Other Substack hosts in the relay log blocked the planned narrowing.
- Change log entries are now written in one update per bulk action.
- The relay log is indexed once per screen.
- verify's relay check compared a value with itself. It now checks the migration's starting list.
- A pre-existing issue was also fixed: an unchanged Source edit save rewrote the record in a new key order.
- Capability
AW_SRC_CAPand theaw_sourcingnonce on every new action. The new row actions are buttons inside the existing nonce'd form.- Every new output is escaped.
- No new
$_GET/$_POSTread without sanitising.- No direct SQL.
- The backup folder has
.htaccessdeny andindex.php.- WP-CLI code loads only under
WP_CLI.wp option get aw_sources | aw_publishers | aw_relay_log, andwp term list category, to build the fixture and the table above.Not in this PR: the audit doc and the Notion "Workers" page updates (after the live check), and phases 2–4.
Wugweb