Skip to content

feat(atlas): weekly data-integrity sweep into the data-integrity issues - #365

Merged
UgaTheDev merged 1 commit into
mainfrom
atlas-integrity-sweep
Dec 3, 2026
Merged

UgaTheDev merged 1 commit into
mainfrom
atlas-integrity-sweep

Conversation

@UgaTheDev

Copy link
Copy Markdown
Contributor

What

A fully automatic weekly sweep that keeps the data-integrity issues (#338–#348) current.

  • GET /api/ops/integrity: gated by DIGEST_TOKEN (constant-time bearer compare), read-only, all orgs. Returns {projectCount, findings: [{cause, projectId, field, problem}]}.
  • atlas/lib/integrity.ts: pure, deterministic, certain-only rules, with vitest tests on fictional data. problem is always a fixed sentence and never includes a stored value, so no names, emails or handles can reach the public issues.
    • roles (per run: PM/TPM/EIR/advisors/program lead/class instructors): placeholders (N/A, TBD, "no EIR", bare role labels via cleanPersonName), role labels glued to a name, two people joined with and/&/slash, GitHub handles (in parentheses or as @handle), emails
    • contact_in_text / blurb_text: the PD sync-hold codes from pd-check (email, logistics, template text, duplicated text) on the blurb, contact bleed in the tech note, and an email in client_desc
    • tech_note: any text that cleanTechNote would strip (template prompts, "/ Design System", TBD lines, comment anchors, meeting notes)
    • credentials (new, goes to the catch-all issue): connection strings with a password, provider key prefixes, private keys, and password: followed by a secret-like value
    • tech: the same tool listed twice or under two spellings, placeholder or template tags, and Tableau + Power BI taken from the template's "e.g." line
    • urls: repo_url that is not a URL, or points at a branch/file/issue/PR, or ends in .git; pd_url that is a Drive folder or not a URL; drive_url that is not a Drive link
    • runs: malformed or missing term, an unknown course (internships excluded), discipline vs course mismatch (checkDisciplines), and two runs with the same term and course
  • scripts/integrity-sweep/sweep.mjs (--self-check, --dry-run): maps each cause to its issue in one table. Causes with no issue go to one catch-all issue, which the script creates once (label data-integrity, marker <!-- atlas-integrity:other -->). How it edits issues:
    • It appends - [ ] \id` (field): problem ` and ticks its own lines once the finding is gone.
    • It never deletes a line. It never touches a line a human ticked or edited (KEY is a hash of the line's text).
    • It is idempotent.
    • Lines from the manual sweep are never ticked automatically. A new finding is not appended while an open human line names the same project.
    • It fails closed if the response is malformed or if it read zero projects. It reopens a closed issue only when it appends new lines to it.
  • .github/workflows/integrity-sweep.yml: runs Mondays at 14:00 UTC, and can be dispatched by hand with a dry_run input. Permissions are contents: read and issues: write. Secrets reach the script through env: only, and the self-check runs before anything else.

Small change: pd-check.ts now exports EMAIL_RE, HOLD_BLURB and HOLD_TECH so the sweep reuses the same rules.

Setup needed

  • New repository secret INTEGRITY_URL, e.g. https://atlas.buspark.io/api/ops/integrity.
  • DIGEST_TOKEN already exists. Prod deploys are manual, so the route has to be deployed to the Worker before the first run.
  • Do the first run with dry_run: true.

Tests

  • npx tsc --noEmit passes
  • npx vitest run: 236 passed
  • node scripts/integrity-sweep/sweep.mjs --self-check passes

🤖 Generated with Claude Code

https://claude.ai/code/session_0152aazG7AAEF6rWPWCedVgY

GET /api/ops/integrity (DIGEST_TOKEN-gated, read-only, all orgs) runs
deterministic certain-only rules (lib/integrity.ts, reusing pd-check sync
holds, cleanTechNote, cleanPersonName, checkDisciplines). A weekly Action
reconciles the findings into issues #338-#348 plus one catch-all: appends
new lines, ticks gone ones, never deletes or edits human-touched lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0152aazG7AAEF6rWPWCedVgY
@coderabbitai

coderabbitai Bot commented Dec 3, 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: f6a1765d-0ded-4ba2-85b5-0f8bbda8d650
  • 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

@UgaTheDev
UgaTheDev merged commit 56ea530 into main Dec 3, 2026
4 checks passed
@UgaTheDev
UgaTheDev deleted the atlas-integrity-sweep branch December 3, 2026 21:35
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