Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions submissions/mcp-hackathon/morax-bountyproof/RIGHTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Submission rights declaration

Project: `BountyProof`
Submission slug: `morax-bountyproof`
Submitter: `Yixuan Cheng`
Date: `2026-09-08`

The submitter confirms that they own, or have sufficient authorization for, the source
code, service configuration, project documentation, and other project-specific materials
submitted in this pull request.

Subject to the official program terms, the submitter authorizes X-Agent to retain,
reproduce, audit, test, archive, and publish the submitted program artifact for judging,
fraud prevention, dispute handling, ecosystem submission, and post-award accountability.
Closing the pull request, deleting a fork, or deleting an external repository does not
revoke the official archive rights attached to an accepted and rewarded entry.

Third-party components and their licenses:

- Node.js runtime — MIT and bundled third-party notices.
- TypeScript — Apache-2.0.
- Vitest and tsx — MIT.
- `@types/node` — MIT.
- Debian Bookworm Slim image packages — their respective Debian package licenses.
- GitHub public API responses — used at runtime subject to GitHub's applicable terms;
they are not redistributed as part of the source package except for the small captured
public verification fixture.

Exceptions or restrictions: None for the submitted MIT-licensed project source. Each
third-party component remains governed by its own license, and live service operation
remains the submitter's responsibility.

This declaration follows the repository's operational template and is not a substitute
for event terms reviewed by qualified counsel.
97 changes: 97 additions & 0 deletions submissions/mcp-hackathon/morax-bountyproof/SUBMISSION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# BountyProof

## Capability

- **One-line description:** Preflight a public GitHub bounty issue against current
repository, assignment, competition, reward-advertisement, maintenance, and
prompt-injection evidence before an agent invests implementation time.
- **Who it helps:** Coding agents, their operators, and contributors screening noisy or
adversarial bounty feeds.
- **Capability boundary:** BountyProof reads public GitHub metadata and returns `STOP`,
`HOLD`, or `PROCEED_TO_MAINTAINER_CONFIRMATION` with evidence URLs. It does not clone or
execute code, follow issue instructions, claim work, verify escrow, promise payment,
or replace maintainer/platform confirmation.

## Live API

- **API base URL:** https://bountyproof.89-58-17-36.sslip.io/v1
- **Health-check URL:** https://bountyproof.89-58-17-36.sslip.io/health
- **Authentication:** None. The public deployment intentionally uses GitHub's
unauthenticated public API and does not expose or store a GitHub token.
- **Rate limits / known limits:** OpenResty allows 30 requests per minute per source IP
with a burst of 10; identical checks are cached for five minutes. The shared GitHub
unauthenticated allowance is normally 60 requests per hour and each uncached check uses
three requests. GitHub calls time out after eight seconds and the proxy after fifteen.
Request bodies are capped at 16 KiB.
- **API contract:** Live OpenAPI 3.1 at
https://bountyproof.89-58-17-36.sslip.io/openapi.json; implementation and response
types are included in `source/src/`.

## Source and reproducibility

- **Source repository:** https://github.com/fzlzjerry/bountyproof
- **Review commit:** `8f8fafc37ff8495839b3a54658cb0ea23c52e7da`
- **Source submitted in this PR:** `source/`
- **Run tests:** `npm ci --ignore-scripts && npm run check && npm audit --audit-level=low`
- **Run locally:** `REVIEW_COMMIT=development npm start` after `npm run build`
- **Deploy:** Set `REVIEW_COMMIT=8f8fafc37ff8495839b3a54658cb0ea23c52e7da`
in an uncommitted environment file, run
`docker compose --env-file .env.production -f compose.production.yml up -d --build`,
install `deploy/bountyproof.nginx.conf`, obtain the named Let's Encrypt certificate,
validate OpenResty syntax, and reload. Exact topology and verification commands are in
`source/README.md`.
- **Version binding:** The same review commit is a container environment value and OCI
image revision label. Both health and same-origin well-known endpoints return it, and
health also emits it as `x-source-commit`.

The live responses are:

```json
{"status":"ok","service":"bountyproof","version":"0.1.0","commit":"8f8fafc37ff8495839b3a54658cb0ea23c52e7da","checkedAt":"<current ISO timestamp>"}
```

```json
{"schemaVersion":1,"slug":"morax-bountyproof","commit":"8f8fafc37ff8495839b3a54658cb0ea23c52e7da"}
```

## Verification

The reproducible calls and captured live responses are in `verification/README.md` and
the adjacent JSON fixtures.

- **Health-check result:** HTTP 200, `status: ok`, exact 40-character review commit, and
matching `x-source-commit` header.
- **Capability call:** `POST /v1/check` with a canonical public GitHub issue URL and
optional expected reward/platform. The captured Dasharo #1153 check currently returns
`HOLD`, discovers the real open OSFV #1276 pull request, and reports that no amount or
recognized platform appears in current issue metadata.
- **Expected error behavior:** Non-canonical URLs return HTTP 400 with
`INVALID_ISSUE_URL`; unsupported content types return 415; oversized bodies return 413;
upstream not-found, rate-limit, and availability errors map to 404, 429, and 502.

## Security and data handling

- **Data collected:** Request `issueUrl`, optional `expectedRewardUsd` and
`expectedPlatform`; proxy logs also contain source IP, request path, user agent, status,
and response size. Request bodies and matched issue text are not logged or returned.
- **Purpose and retention:** Inputs are used only for the requested preflight. Identical
result objects are cached in process memory for five minutes and disappear on restart.
OpenResty access-log retention follows host-operator rotation and is not represented as
a fixed application guarantee.
- **Third parties / outbound network calls:** Public `api.github.com` repository, issue,
and timeline endpoints. Runtime has no other outbound service.
- **Secrets:** No secrets are committed. Review access is not required. A future operator
can add a fine-grained read-only GitHub token outside Git, but the submitted deployment
has none.
- **Known risks / restrictions:** GitHub state may change immediately; private or
unlinked work is invisible; issue labels and money strings do not prove funding; regex
safety flags are conservative and can have false positives/negatives. Callers must
inspect the returned evidence and confirm scope/payout themselves.

## Support

- **Team / builder:** Yixuan Cheng (Morax)
- **Contact:** https://github.com/fzlzjerry/bountyproof/issues
- **License / rights:** MIT. The submitter owns the project-specific source and can
authorize review, archival, publication, deployment, and the rights stated in
`RIGHTS.md`; third-party components retain their own licenses.
10 changes: 10 additions & 0 deletions submissions/mcp-hackathon/morax-bountyproof/source/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.git
.github
node_modules
dist
coverage
.env
.env.*
tests
deploy
*.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PORT=8787
HOST=127.0.0.1
REVIEW_COMMIT=development
SOURCE_REPOSITORY=https://github.com/fzlzjerry/bountyproof
# Optional: a fine-grained, read-only token raises the GitHub API rate limit.
# GITHUB_API_TOKEN is never required for the public demo and must not be committed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

jobs:
verify:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24.18.0
cache: npm
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Test and compile
run: npm run check
- name: Audit dependencies
run: npm audit --audit-level=low
- name: Build container
run: docker build --build-arg VCS_REF="$GITHUB_SHA" --tag bountyproof:test .
- name: Smoke-test version proof
run: |
docker run --detach --rm --name bountyproof-test \
--publish 127.0.0.1:18787:8787 \
--env REVIEW_COMMIT="$GITHUB_SHA" \
bountyproof:test
trap 'docker stop bountyproof-test >/dev/null 2>&1 || true' EXIT
for attempt in $(seq 1 20); do
if curl --fail --silent http://127.0.0.1:18787/health > health.json; then break; fi
sleep 1
done
node --input-type=module --eval '
import fs from "node:fs";
const health = JSON.parse(fs.readFileSync("health.json", "utf8"));
if (health.status !== "ok" || health.commit !== process.env.GITHUB_SHA) process.exit(1);
'
curl --fail --silent http://127.0.0.1:18787/.well-known/xagent-verification.json > proof.json
node --input-type=module --eval '
import fs from "node:fs";
const proof = JSON.parse(fs.readFileSync("proof.json", "utf8"));
if (proof.slug !== "morax-bountyproof" || proof.commit !== process.env.GITHUB_SHA) process.exit(1);
'
7 changes: 7 additions & 0 deletions submissions/mcp-hackathon/morax-bountyproof/source/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/
dist/
coverage/
.env
.env.*
!.env.example
*.log
30 changes: 30 additions & 0 deletions submissions/mcp-hackathon/morax-bountyproof/source/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM node:24.18.0-bookworm-slim@sha256:6f7b03f7c2c8e2e784dcf9295400527b9b1270fd37b7e9a7285cf83b6951452d AS build

WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --ignore-scripts
COPY tsconfig.json tsconfig.build.json ./
COPY src ./src
RUN npm run build

FROM node:24.18.0-bookworm-slim@sha256:6f7b03f7c2c8e2e784dcf9295400527b9b1270fd37b7e9a7285cf83b6951452d AS runtime

ARG VCS_REF=unknown
LABEL org.opencontainers.image.title="BountyProof" \
org.opencontainers.image.description="Evidence-first GitHub bounty preflight API" \
org.opencontainers.image.source="https://github.com/fzlzjerry/bountyproof" \
org.opencontainers.image.revision="$VCS_REF" \
org.opencontainers.image.licenses="MIT"

ENV NODE_ENV=production \
HOST=0.0.0.0 \
PORT=8787 \
SOURCE_REPOSITORY=https://github.com/fzlzjerry/bountyproof

WORKDIR /app
COPY --from=build --chown=node:node /app/dist ./dist
USER node
EXPOSE 8787
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD ["node", "--eval", "fetch('http://127.0.0.1:8787/health').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))"]
CMD ["node", "dist/server.js"]
21 changes: 21 additions & 0 deletions submissions/mcp-hackathon/morax-bountyproof/source/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Yixuan Cheng

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
133 changes: 133 additions & 0 deletions submissions/mcp-hackathon/morax-bountyproof/source/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# BountyProof

BountyProof is an evidence-first GitHub bounty preflight API for humans and agents. It
checks the current issue, repository, assignment, open cross-referenced pull requests,
maintenance freshness, advertised reward signals, and suspicious instruction patterns
before anyone invests implementation time.

**Live API:** `https://bountyproof.89-58-17-36.sslip.io`

## What it decides

The API returns one deliberately conservative verdict:

- `STOP` — a hard current-state blocker such as a closed issue or archived repository.
- `HOLD` — resolve assignment, competition, authenticity, safety, staleness, or payout
warnings before implementation.
- `PROCEED_TO_MAINTAINER_CONFIRMATION` — no visible blocker was found, but the maintainer
must still confirm scope, acceptance, assignment, and the payout route.

It never calls an issue “guaranteed,” and every reward signal is reported as
`ADVERTISED_ONLY` unless a separate platform-specific verification exists.

## Call the capability

```bash
curl --fail --silent --show-error \
--request POST https://bountyproof.89-58-17-36.sslip.io/v1/check \
--header 'content-type: application/json' \
--data '{
"issueUrl":"https://github.com/Dasharo/dasharo-issues/issues/1153"
}' | jq
```

The current example returns `HOLD` because it discovers an open cross-referenced pull
request and no amount/platform signal in live issue metadata. The response includes the
PR URL and explains that payout still needs separate verification.

Optional checks catch stale claims:

```json
{
"issueUrl": "https://github.com/owner/repository/issues/123",
"expectedRewardUsd": 100,
"expectedPlatform": "Algora"
}
```

See the live OpenAPI document at
[`/openapi.json`](https://bountyproof.89-58-17-36.sslip.io/openapi.json).

## Agent-facing verification

```bash
curl --fail --silent --show-error https://bountyproof.89-58-17-36.sslip.io/health
curl --fail --silent --show-error \
https://bountyproof.89-58-17-36.sslip.io/.well-known/xagent-verification.json
```

Both endpoints expose the exact deployed source commit. The well-known response uses
submission slug `morax-bountyproof` and schema version 1.

## Analysis pipeline

```text
canonical GitHub issue URL
│ strict parsing; fixed api.github.com host
repo + issue + timeline requests (parallel, bounded timeout)
├─ repository authenticity / archived / disabled / push age
├─ issue open / locked / assignment state
├─ open cross-referenced pull requests
├─ advertised fiat, token, and platform signals
└─ untrusted-instruction safety flags (matched text is never returned)
STOP | HOLD | PROCEED_TO_MAINTAINER_CONFIRMATION
└─ evidence URLs, reasons, next actions, limitations, rate-limit state
```

## Local development

Requires Node.js 24.18 or newer.

```bash
npm ci --ignore-scripts
npm test
npm run build
REVIEW_COMMIT=development npm start
```

The server listens on `127.0.0.1:8787` by default. Set `HOST`, `PORT`,
`REVIEW_COMMIT`, and `SOURCE_REPOSITORY` as shown in `.env.example`.

## Verified checks

```bash
npm run check
npm audit --audit-level=low
docker build --build-arg VCS_REF="$REVIEW_COMMIT" -t bountyproof .
```

- 22 unit/service tests cover URL boundaries, money/platform parsing, prompt-injection
flags, competition extraction, verdicts, cache expiry/eviction, version proof,
structured errors, and request-size limits.
- The dependency audit currently reports zero vulnerabilities.
- The production image pins Node 24.18.0 Bookworm slim by digest and runs as UID 1000 on
a read-only, capability-free container.

## Production layout

```text
Internet :443
→ OpenResty TLS + 16 KiB body cap + per-IP request limit
→ 127.0.0.1:18789
→ non-root BountyProof container :8787
→ public api.github.com metadata only
```

`compose.production.yml` binds loopback only. `deploy/bountyproof.nginx.conf` is the exact
public reverse-proxy configuration, and `deploy/certbot-renew-hook.sh` installs renewed
certificates into the mounted 1Panel/OpenResty site directory after validating syntax.

## Security, privacy, and limitations

Read [`SECURITY.md`](SECURITY.md). BountyProof does not execute or echo issue bodies,
authenticate to GitHub in the public deployment, or store caller data. GitHub state may
change immediately after a response, private/unlinked work is not visible, and a label or
dollar amount does not establish funding.

## License

[MIT](LICENSE)
Loading