Skip to content
abdullah.

Case study / Contract-bound repository maintenance

RepoDiet.

Repository maintenance for JS/TS codebases: evidence-gated triage, a signed change contract, bounded changes on an isolated branch, and a signed verification receipt.

Role
Full-stack engineer
Type
Repository maintenance automation
Stack
Next.js 15 · GitHub App · Vercel Sandbox
Core idea
Signed contract, separate verifier role
Origin
OKX.AI Genesis Hackathon
RepoDiet repository maintenance and verification interface

Product interface from the working public build.

  1. 1
    Classified findings

    Each finding is labelled safe, review-first, or protected before anything changes.

  2. 2
    Five-stage pipeline

    Analyze, contract, execute, verify, deliver — every stage is visible.

  3. 3
    Locked contract

    Scope, change budget, and protected paths such as auth and migrations are fixed up front.

  4. 4
    Bounded execution

    Changes happen on an isolated branch and are checked against the budget before delivery.

01Context

Problem and constraints

RepoDiet was built for the OKX.AI Genesis Hackathon (Software Utility track). AI-assisted codebases accumulate dead code, duplication, and unclear boundaries; RepoDiet is designed around the maintenance workflow — evidence, scope, verification, and review — rather than patch generation.

The product needed to make a technically dense workflow understandable without hiding the states a user must evaluate. The public build and source repository are linked above; no private client metrics are claimed.

02Role

Role and scope

Muhammad Abdullah worked on RepoDiet as a full-stack engineer. Origin: OKX.AI Genesis Hackathon — Software Utility track.

  1. ProductMaintenance workflow and review experience
  2. InterfaceFindings, pipeline, and contract views
  3. EngineeringGitHub App, sandbox, and verifier flow
  4. ReleaseDeployed public build and repository
03Build

What was built

Triage runs Knip, jscpd, and Madge behind an evidence gate with a counter-evidence search, classifying each finding as safe_candidate, review_first, or protected. A repodiet.contract/v1 pins the source commit and lists finding IDs, allowed and protected paths, seven allowed operations, change budgets, and a verification policy, identified by a canonical JSON digest. Changes run in a sandbox with a secret firewall on an isolated branch — never a direct push to main, never an auto-merge. A separate verifier role compares baseline and patched runs with the required GitHub checks, then issues an RSA-SHA256 receipt as an in-toto Statement in a DSSE envelope, signed with its own attestation key against a pinned public trust root.

  • Evidence-gated triage (Knip, jscpd, Madge)
  • Signed, commit-pinned change contracts
  • Separate verifier role and signing key
  • in-toto / DSSE signed receipts
04System map

Architecture and workflow

Next.js 15 and React 19 with Tailwind, Radix UI, and Zod; a GitHub App through Octokit and simple-git; Vercel Sandbox and Vercel Workflow for execution; Upstash Redis for state; an A2A task state machine; and an x402 Quick Triage endpoint on X Layer (OKX x402, OpenClaw). Workers run on Express and Docker via Fly.io and GitHub Actions, with Sentry and Playwright.

System map
  1. 01AnalyzeEvidence-gated, commit-pinned triage
  2. 02ContractPaths, 7 operations, budgets
  3. Isolated branch03ExecuteBounded changes only
  4. 04VerifySeparate verifier role and key✕ fails: to 07 Out of contract
  5. 05DeliverReview-ready pull request
  6. 06Signed receiptin-toto / DSSE, RSA-SHA256
  7. 07Out of contractStopped, not merged
  • Maintenance path
  • Stopped change
  • Isolated branch

Implementation and verification are separate steps; the reviewer receives evidence, not just a diff.

  • Next.js 15
  • React 19
  • TypeScript
  • Tailwind
  • Radix UI
  • Zod
  • GitHub App / Octokit
  • Knip
  • jscpd
  • Madge
  • simple-git
  • Vercel Sandbox
  • Vercel Workflow
  • Upstash Redis
  • OKX x402
  • X Layer
  • OpenClaw
  • Express
  • Docker
  • Fly.io
  • GitHub Actions
  • Sentry
  • Playwright
05Decisions

Selected technical decisions

  1. 01
    Lock scope in a signed, commit-pinned contract before any change.

    Allowed paths, protected paths, operations, and budgets are fixed against a pinned commit, and path traversal or null bytes are rejected.

  2. 02
    Give verification its own role and signing boundary.

    The verifier compares baseline and patched runs and signs with its own attestation key — a separate role with its own verification and signing boundary, inside the same service rather than on independent infrastructure.

  3. 03
    Never push to main or merge automatically.

    A human reviewer decides. The tool delivers a pull request and evidence, never a merge.

06Constraints

Environment and limitations

What this build does not claim, stated plainly.

  1. 01
    Supported repositories

    Public JavaScript/TypeScript repositories only. Private repositories and other languages are not supported.

  2. 02
    Verifier boundary

    The verifier is a separate role with its own verification and signing boundary, but it runs inside the same service — it is not independent infrastructure.

  3. 03
    No usage claims

    Demo runs and demo test counts are demonstrations, not customer usage. No customers, paid usage, revenue, accuracy rates, or security audit are claimed.

07Evidence

Testing and public evidence

Everything here can be checked without taking my word for it.

  • Live product walkthrough
  • Public source repository
  • Receipts checkable against a pinned trust root

PROJECT INQUIRY

Discuss the workflow you want to automate.

Share the goal, current state, constraints, and useful links. I’ll help identify the most useful path forward.