Skip to content

fix: repair Node 22 crawling, close the unreviewed-publish path, stop workers pushing schema - #160

Merged
snowopsdev merged 1 commit into
mainfrom
fix/project-audit
Nov 10, 2026
Merged

snowopsdev merged 1 commit into
mainfrom
fix/project-audit

Conversation

@snowopsdev

Copy link
Copy Markdown
Owner

A read of the whole project turned up real breakage: live page crawling failed on the Node versions CI and engines target, any signed-in user could publish a draft that was never scored, and the documented production worker ran Payload's dev schema push against the database on every run. This fixes those and the rest of what could be fixed without a product decision.

Broken

  • Live crawling passed an undici 8 dispatcher to Node's built-in fetch, which rejects it on Node 22 and 24. The crawler now uses undici's own fetch.
  • approved and published were reachable from almost any status through the admin, REST or GraphQL, and an article could be created as verified with a hand-set PASS. A new gatePublicationPath hook allows them only from verified, from each other, or from needs_review/blocked with a fresh justification.
  • jobs:run now disables the dev schema push; new jobs:webhooks and jobs:scheduled scripts do the same for the other two queues.
  • Mock runs could go live (the crawler and fallback LLM client read the process mode, and ig-e2e.sh read the wrong env file). Live research without an Ahrefs key now fails with a message instead of crawling the demo hostnames.
  • Smaller: a migration down that could not run, false override audit rows, stale evidence verdicts after reset/regenerate/send-back, topic removal during research, webhook errors storing the URL, re-seeding resetting the admin password, obsolete suggestions that never reopened, demo evidence that would expire in 2027, and publishedAt/publishAt handling on every publish path.

Scoring: number words match only as whole words, the 1990s is a decade rather than 1,990 seconds, and 2000 matches 2,000. Three accepted trade-offs are pinned in tests.

Also: docs and env examples that contradicted the code, a missing @payloadcms/graphql declaration, jsdom only for the component suites (integration run 98 s to 72 s), tests pinned to mock mode, E2E URLs that ignored TEST_PORT, lint warnings in generated migrations, seven superseded migration snapshots, and a little dead code.

Behaviour changes to know: a signed-in jump straight to approved/published is refused; cms/.env.example ships a blank PAYLOAD_SECRET; docker-compose.yml binds Postgres to 127.0.0.1; articles and evidence-source rules cannot be deleted (archive / active: false).

The open findings that need design work (server-action errors in production, stuck runs, mode resolution, rich text, slugs, cost rows on failed calls and more) follow in separate PRs.

Proof: reproduced the crawler failure on Node 22.23.2 and 24.21.0 and watched the new test pass on 22, 24 and 26; reproduced the PASS-on-create and delete holes and the broken migration down against Postgres before fixing them; both typechecks, lint (0 warnings), pipeline tests 883/883, CMS integration 835/835 and npm run build --workspace cms pass; a differential probe compares the matcher against main over 124 phrasings and 45 claim/evidence pairs. Playwright E2E was not run.

Council review

Rounds: 7

Delegate Round 1 Round 2 Round 3 Round 4 Round 5 Round 6 Round 7
Claude Opus 5.5 8.5/10 8/10 8/10 8/10 7/10 8/10 9/10
GPT-6.1 Sol 9/10 9/10 9/10 8/10 9/10 8/10 9/10
Grok 4.7 8/10 8/10 8/10 8/10 9/10 no score 9/10

Rounds 2 to 7 concerned the exact-value matcher only. A range change tried in rounds 2 to 4 was backed out; Grok's round-6 review did not complete.

Created with Claude Fable 5.2 (audit subagents also Claude Fable 5.2) in Claude Code, reviewed by Claude Opus 5.5, GPT-6.1 Sol and Grok 4.7.

🤖 Generated with Claude Code

A whole-project audit, reviewed by a three-model council over seven rounds.

- Crawl with undici's own fetch: the built-in fetch rejects an undici 8
  dispatcher on Node 22 and 24.
- Gate `approved` and `published` to reviewed predecessors; close the
  `informationGain` create hole; refuse article and evidence-source deletes.
- Stamp `publishedAt` and clear the used `publishAt` on every publish.
- Turn off the dev schema push for all three queue workers.
- Keep mock runs mock (crawler and fallback LLM client follow the run's mode);
  fail live research without an Ahrefs key instead of crawling demo hosts.
- Fix the 015044 migration's down, the override/send-back/reset QA and audit
  writes, topic removal during a run, webhook error redaction, seed password
  resets, obsolete suggestions, and expiring demo evidence dates.
- Matcher: whole-word number words, decades, and `2000` vs `2,000`.
- Docs, env examples, test config (jsdom only where needed, mock pinned),
  and lint config corrected; superseded migration snapshots pruned.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3346729d-f6fb-486e-a84f-b4a7826f350c
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T05:23:15.864009Z 4175f09 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@snowopsdev
snowopsdev merged commit 6c89501 into main Nov 10, 2026
12 checks passed
@snowopsdev
snowopsdev deleted the fix/project-audit branch November 10, 2026 05:29
snowopsdev added a commit that referenced this pull request Nov 10, 2026
…dead files (#162)

The test suites could quietly wreck a working database, the Playwright
suite ran nowhere, and the repo carried 25 MB of things nothing uses.
This closes the test, CI and hygiene findings from the project audit
(follow-up to #160).

**Tests and CI**
- The CMS integration and Playwright suites refuse to start unless the
`DATABASE_URL` database name contains `test`, or
`DATUM_TEST_DATABASE_OK=true` is set. They rewrite workspace state and
add append-only rows, and `cms/.env` (usually your working database) is
loaded by default. A missing `DATABASE_URL` is refused too. **If you run
the suites against a per-worktree database whose name lacks `test`,
rename it or set the opt-in.**
- New `e2e` CI job: migrate, seed (dev push off), install Chromium, run
the 10 Playwright specs. CI databases are now `datum_test`.
- CI cancels superseded runs only on pull requests, not on `main`.
- The redirect spec asserts the 307 itself (it passed only by accident
while signed out). The admin-performance and admin-nav specs wait for
hydration before interacting; a click on a cold dev server was being
lost. Four integration assertions that could not fail now can.

**Hygiene**
- Removed: the vendored Cursor `pstack` plugin (`vendor/claude-plugins`,
MIT, install it per user from upstream if wanted), the 96 audit
screenshots and capture log (in history at `7bb204f`), and the two
shipped plans.
- `graphify-out/` is no longer tracked and `.gitattributes` (a merge
driver only one machine had) is gone. **After pulling, existing clones
lose their local graph files; run `graphify update .` to rebuild.**
CONTRIBUTING now says not to run `graphify hook install`, which
recreates that driver.
- Media uploads accept raster images only (SVG or HTML uploads were
served from the app origin).
- Smaller: `DESIGN.md` scoped to the public reader, `cms/.vscode` paths
fixed, dead and duplicate `ops.css` rules removed, narrower database
reads on the setup hub and suggestion scan, stale "board" wording and
`configFingerprint` docs corrected, `docs/open-source-checklist.md`
removed.

**Proof:** typecheck, lint (0 warnings), pipeline 883/883, CMS
integration 850/850 and `npm run build --workspace cms` on this branch;
the full Playwright suite 59/59 against Playwright's own dev server on a
freshly migrated and seeded test database, plus the admin and
performance specs repeated cold with no retries. The guard's test fails
with the guard disabled, and each strengthened assertion was shown to
fail against broken code. The new `e2e` job itself first runs here.

Reviewed with sol-loop: 2 rounds with GPT-6.1 Sol. Sol verdict:
approved. Each workstream was also reviewed by Claude Opus 5.5 before
integration.

Created with Claude Opus 5.5 in Claude Code; workstreams implemented by
Claude Sonnet 5.5 subagents.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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