Skip to content
Merged
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
19 changes: 14 additions & 5 deletions .github/workflows/trigger-integration.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Trigger Integration Tests

on:
pull_request:
branches: [main]
release:
types: [published]

Expand All @@ -10,9 +12,16 @@ jobs:
steps:
- name: Trigger integration tests
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.INTEGRATION_TOKEN }}
run: |
gh api repos/xPyD-hub/xPyD-integration/dispatches \
-f event_type=release-check \
-f "client_payload[repo]=xPyD-sim" \
-f "client_payload[version]=${{ github.event.release.tag_name }}"
if [ "${{ github.event_name }}" = "pull_request" ]; then
gh api repos/xPyD-hub/xPyD-integration/dispatches \
-f event_type=pr-check \
-f "client_payload[repo]=xPyD-sim" \
-f "client_payload[ref]=${{ github.head_ref }}"
else
gh api repos/xPyD-hub/xPyD-integration/dispatches \
-f event_type=release-check \
-f "client_payload[repo]=xPyD-sim" \
-f "client_payload[version]=${{ github.event.release.tag_name }}"
fi
47 changes: 47 additions & 0 deletions bot/AUTHOR_POLICY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!-- CRITICAL: DO NOT SUMMARIZE OR COMPRESS THIS FILE -->
<!-- This file contains precise rules that must be read in full. -->

# Author Policy — xPyD-sim

Rules for the bot that writes code and submits PRs.

## Identity
| Role | GitHub Account |
|------|---------------|
| Author | `hlin99` |

## Before Coding
1. Pull latest main: `git pull origin main`
2. Create branch: `git checkout -b <type>/<short-description>`
3. Read [DESIGN_PRINCIPLES.md](DESIGN_PRINCIPLES.md) for architecture constraints.

## Code Quality
- Run pre-commit: `pre-commit run --all-files`
- Run lint: `ruff check xpyd_sim tests`
- Run tests: `pytest tests/ -q`
- All must pass locally before pushing.

## PR Submission
1. One PR per task. Don't bundle unrelated changes.
2. Descriptive title: `type: short description`
3. PR body: what changed, why, test coverage, breaking changes. Reference issues (`closes #N`).
4. All CI must pass before requesting review.

## Responding to Review
1. Address ALL `REQUEST_CHANGES` feedback before requesting re-review.
2. Always push new commits — never amend or force-push.
3. Reply to each review comment with fix commit ref (e.g. "Fixed in `abc1234`").
4. Re-request review after pushing fixes (don't wait for reviewer to notice).
5. If reviewer is wrong, explain with evidence (link to source, docs, spec).


## Documentation Updates
Every PR must update relevant documentation:

| Change Type | Update |
|---|---|
| New feature / CLI argument | `docs/guide.md` |
| Architecture change | `docs/architecture.md` |
| Design decision | `docs/design.md` |
| Quick Start affected | `README.md` (keep one screen, link to guide.md) |

49 changes: 49 additions & 0 deletions bot/BOT_POLICY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!-- CRITICAL: DO NOT SUMMARIZE OR COMPRESS THIS FILE -->
<!-- This file contains precise rules that must be read in full. -->

# Bot Policy — xPyD-sim

## Language
- **English only** — all code, docs, issues, PRs, comments on GitHub must be in English. No Chinese characters.

## Branch Rules
- **Never push directly to main.** All changes go through PR.
- **Never force push.** If branch is too messy, close PR and open new one.
- Branch from latest main. Keep branch up-to-date by merging main into it.
- Each PR must be independent — no stacking PRs or branching off feature branches.

## Commit Rules
- **Commit identity**: `git -c user.name="hlin99" -c user.email="tony.lin@intel.com" commit -s`
- Always use `tony.lin@intel.com` as commit email. Never use noreply address.
- Always include `Signed-off-by` trailer (`-s` flag) for DCO compliance.
- Never add `Co-authored-by` trailers.
- Follow conventional commits: `<type>: <short description>` (fix, feat, test, docs, refactor, chore, ci).

## Before Pushing
1. Run pre-commit: `pre-commit run --all-files`
2. Run lint: `ruff check xpyd_sim tests`
3. Run tests: `pytest tests/ -q`
4. All three must pass locally before pushing.

## Merge Policy
- **Bots must NEVER merge a PR.** All merges done by human maintainer.
- **Bots must NEVER close a PR.** Only human maintainer closes.
- Non-negotiable. Do not call merge or close API under any circumstances.

## CI
- CI must be 100% green before merge. No skips allowed.
- No test may be skipped. If a test can't run, fix it or remove it.

## Testing
- Unit tests in `tests/` — pure bench logic, no external dependencies.
- Integration tests in [xPyD-integration](https://github.com/xPyD-hub/xPyD-integration).

## Secrets
- Never hardcode tokens or credentials in code, PR descriptions, or bot prompts.

## Freshness
- **Always pull latest main and re-read BOT_POLICY.md before starting any work.** This is a living document. Never rely on cached copies.

## Architecture
- OpenAI-compatible LLM inference simulator.
- Follow vLLM bench CLI compatibility (see [DESIGN_PRINCIPLES.md](DESIGN_PRINCIPLES.md)).
File renamed without changes.
15 changes: 15 additions & 0 deletions bot/ENTRY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- CRITICAL: DO NOT SUMMARIZE OR COMPRESS THIS FILE -->
<!-- This file contains precise rules that must be read in full. -->
<!-- Skipping or abbreviating any section may cause policy violations. -->

# Bot Entry Point

Read this file first when starting any automated task on this repo.

## Required Reading (in order)

1. **[BOT_POLICY.md](BOT_POLICY.md)** — Hard rules. Must follow.
2. **[AUTHOR_POLICY.md](AUTHOR_POLICY.md)** — Rules for writing code and submitting PRs.
3. **[REVIEW_POLICY.md](REVIEW_POLICY.md)** — Rules for reviewing PRs.
4. **[DESIGN_PRINCIPLES.md](DESIGN_PRINCIPLES.md)** — Architecture constraints and design rules.
Files 1-4 are mandatory. No DEV_LOOP in this repo (non-loop mode).
55 changes: 55 additions & 0 deletions bot/REVIEW_POLICY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!-- CRITICAL: DO NOT SUMMARIZE OR COMPRESS THIS FILE -->
<!-- This file contains precise rules that must be read in full. -->

# Review Policy — xPyD-sim

## Roles
| Role | GitHub Account | Action |
|------|---------------|--------|
| Implementer | `hlin99` | Write code, submit PRs |
| Reviewer 1 | `hlin99-Review-Bot` | Review PRs |
| Reviewer 2 | `hlin99-Review-BotX` | Review PRs |

Each reviewer uses its own dedicated token. Never use author's token for reviews.

## Reviewer Schedule
| Condition | Check Frequency |
|-----------|----------------|
| Open PRs exist | every 5 minutes |
| No open PRs | every 15 minutes |

## What to Review
1. Skip draft PRs.
2. Skip already-reviewed commits (only APPROVE counts as reviewed).
3. Re-requested reviews take priority — always perform fresh review.
4. One review per PR per commit SHA — never submit multiple reviews for same commit.

## Review Process

Review every non-draft PR with proxy-level strict standards. Every line examined.

## Review Checklist
For each non-draft PR with a new commit:

| Area | Check |
|---|---|
| CI | Must be fully green before APPROVE. May submit REQUEST_CHANGES or COMMENT while pending. |
| Merge conflicts | If mergeable == false, REQUEST_CHANGES. |
| Logic errors | Incorrect conditions, off-by-one, unhandled edge cases. |
| Type safety | Mismatched types, missing None checks. |
| Concurrency | Race conditions, missing locks, shared mutable state. |
| Exception handling | Bare except, swallowed exceptions, resource leaks. |
| Security | Injection risks, hardcoded secrets, unsanitized input. |
| Code style | Unused imports, shadowed variables, unclear naming. |
| Test coverage | New logic must have corresponding tests. |
| Design conformance | Implementation must match the linked GitHub Issue design. |

## Verdicts
- **APPROVE** — code correct, CI green, no issues.
- **REQUEST_CHANGES** — any issue found. Use inline comments.
- **COMMENT** — CI pending or noting something without blocking.

## Merge Policy
- **Bots must NEVER merge a PR.** Human maintainer only.
- **Bots must NEVER close a PR.** Human maintainer only.
- At least 1 approval required before human can merge.
Loading