Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

CrossWorkFlowCI-Factory

CrossWorkFlowCI-Factory is an automated mining, zero-invalid-task ("零错题") synthesis, and offline environment compilation framework for high-difficulty, pure-Linux-container-reproducible GitHub Actions CI/CD repair benchmarks built on Harbor (schema_version = "1.4").

This repository includes:

  1. End-to-End Hard-Only Real-CI Collection & Compilation Pipeline (cwci/, configs/, scripts/, tests/): Declarative multi-path GitHub Actions mining (Path A PR/feature-branch single & cascading first-fail streaks, Path B fix(ci)/build/docker/workflow PRs, Path C cross-workflow seesaws) targeting high-star industrial repositories (>= 1000★; curated systems/compiler kernels >= 500★), extensible 13+ category registry & two-axis quota-aware priority scoring, citation-verified Gemini 4 Neon causal review with Hard-Only RUBRIC & no_piggyback_feature filtering, multi-workflow offline Docker compilation (Warm-Snapshot offline caches for Node/Corepack/Yarn Berry/pnpm, Go, Rust, Python/uv, PHP, Java, Make, plus 10 digest-pinned service backends incl. MinIO & Kafka), two-phase official_tests.tar + 3-layer anti-cheat + runtime .db/.sqlite* sandbox cleanup + static cwci lint-tasks hygiene gate, 3-control Harbor admission (nop=0, oracle=1, developer=1), and TTL-bounded /dind-ram resource GC.
  2. 11 QA-Verified Real GitHub Actions CI Tasks (harbor_tasks/): Pure real upstream CI failures (new_upstream_actions, zero synthetic/constructed backports) across 10 public repositories, each verified under network_mode = "no-network" and passing cwci lint-tasks with 0 errors.
  3. Archived Legacy Collector (old/): Previous repository snapshot preserved untouched for reference.

Key Properties

  • 100% Real-CI Hard-Only Industrial Acquisition (cwci/miner.py, cwci/auditor.py):
    • High-Star Industrial Floor: Real GitHub stargazers_count resolved O(1) from upstream/ metadata (min_stars >= 1000 default; >= 500 exclusively for curated systems/compiler/DB kernel seed repos) with hard excluded_low_stars intake routing.
    • Substantive Hard-Only Gates: Enforces minimum_non_test_files >= 2, minimum_non_test_lines >= 25, and minimum_developer_effective_lines >= 25 (with a narrow single-file deep-core exception at >= 60L and causal chain >= 3 hops). Upgraded RUBRIC explicitly rejects compiler-guided interface forwarding, 1–10L local nil guards, pure type narrowing, and lint refactors (no-nested-ternary).
    • First-Fail Cascading Streaks & Multi-Workflow Seesaws: Prefers first_fail_sha -> pass_sha (path_b_streak_span) over last-hop pairs, plus fix(ci)/build/docker PRs (Path B) and cross-workflow seesaws (Path C). Synthetic Tier-2 backports are disabled by default (exclude_tier2_backport: true).
  • 3-Tier Funnel for New Requirements (cwci/auditor.py, cwci/packager.py, cwci/linter.py):
    1. Tier 1 (no_piggyback_feature): Rejects candidates that tack unrelated new features or brittle white-box internal mocks (e.g. redis.multi().exec()) onto an unrelated CI failure.
    2. Tier 2 (Private-Symbol Static Ban): Scans official_tests.tar diffs and blocks tests binding newly added unexported/private helpers (Go lowercase funcs, Python _helper, Rust non-pub fn, TS non-export, Java private).
    3. Tier 3 (Zero-Spoiler ## Behavioral Requirements): When same-root-cause black-box invariants are stated in instruction.md, strictly enforces the zero-spoiler rule (no file paths, no internal function names, no implementation/library hints, no repair steps; optional bare exported identifier declarations only).
  • Repository-Wide Multi-Workflow Offline Compilation (cwci/compiler.py, cwci/runtimes.py):
    • Compiles all applicable .github/workflows/*.yml into deterministic Linux execution plans with @sha256: pinned runtime digests, 10 offline PRoot/compose service backends, and Warm-Snapshot offline caches (Corepack + Yarn v1/Berry YARN_GLOBAL_FOLDER, pnpm fetch && install, uv managed Python UV_PYTHON_INSTALL_DIR, make <install/deps>, Go/Rust build caches).
  • Two-Phase official_tests.tar + 3-Layer Anti-Cheat & Sandbox Cleanup (cwci/packager.py, cwci/linter.py, cwci/publisher.py):
    • Phase 1 runs full multi-job offline CI on /app (after _cwci_clean_runtime_artifacts strips agent self-test .db/.sqlite*/.wal/.shm/.pid debris without touching warm caches or baseline fixtures); anti-tamper guards verify protected-zone.sha256, git diff HEAD, assertion floors, and zero-test probes; Phase 2 overlays authoritative tests/official_tests.tar and re-runs the suite (gated by _plan_executes_tests() against compile-only bypasses).
    • cwci lint-tasks enforces self-contained Dockerfile ADD/COPY context files (e.g. source.tar), non-empty tests/historical-tracked.z, zero-spoiler instruction.md, and secret hygiene; cwci/publisher.py force-tracks all required task archives.
  • Mandatory 3-Control Admission Gate & Bounded /dind-ram GC (cwci/packager.py, cwci/gc.py):
    • Every accepted task passes nop == 0 (exact failing step + guarded historical diagnostic matching with strict OFFLINE_ENV_ERROR_RE rejection), oracle == 1, and developer == 1 offline.
    • Automatic campaign stop at HARDCI_TARGET_ACCEPTED plus cwci/gc.py with TTL-bounded protected_hardci_env_tags() and 55% BuildKit cache pruning to prevent /dind-ram ENOSPC.

Repository Structure

CrossWorkFlowCI-Factory/
├── pyproject.toml                   # Package metadata & unified `cwci` CLI entrypoint
├── requirements.txt                 # Minimal Python dependencies (PyYAML, Jinja2)
├── run.sh                           # Multi-worker Harbor pipeline supervisor
├── README.md                        # Overview, architecture & quickstart
├── SKILL.md                         # Operational agent skill (also mirrored in .agents/skills/cwci-mine/)
├── cwci/                            # Unified Python package (14 modules)
│   ├── cli.py                       # Unified CLI (`cwci <subcommand>` / `python3 -m cwci`)
│   ├── config.py                    # Declarative config, category registry & two-axis scoring
│   ├── core.py                      # State, GitHub API, patch/range checks, runner classifier & signatures
│   ├── miner.py                     # Real GitHub Actions multi-workflow scanner (Path A / B / C)
│   ├── auditor.py                   # Quota-aware router, citations & agy+Neon causal reviewer
│   ├── runtimes.py                  # Multiarch Linux, PHP, WASM/musl & 10 service backends (incl. MinIO/Kafka)
│   ├── compiler.py                  # Multi-workflow scope analyzer, sibling cap & Dockerfile synthesizer
│   ├── packager.py                  # Zero-spoiler Harbor 1.4 packager, 3-layer anti-cheat & 3-control eval
│   ├── linter.py                    # Post-packaging static compliance & anti-leak linter (`cwci lint-tasks`)
│   ├── publisher.py                 # Immediate GitHub auto-publisher for accepted real-CI tasks
│   ├── backport.py                  # Legacy optional Tier-2 PR backport module (disabled by default)
│   └── gc.py                        # Adaptive container, git-fetch & BuildKit cache GC daemon
├── configs/
│   ├── mining.default.json          # Default high-star (>=1000★) mining pool, filters & scoring weights
│   ├── mining.systems_60d.json      # 60-day deep systems/DB/compiler preset (>=500★ seed repos)
│   ├── categories.json              # Extensible 13+ hard-category registry & quota targets
│   └── policy.json                  # Hard-Only intake policy (>=1000★, >=2 non-test files, >=25L, score >=10)
├── scripts/
│   ├── start_harbor_pipeline.sh     # End-to-end collection & evaluation daemon launcher
│   ├── start_resource_gc.sh         # Low-CPU/IO container & BuildKit garbage collector daemon
│   ├── start_auto_publish.sh        # Continuous GitHub auto-publisher for newly accepted real-CI tasks
│   ├── build_harbor_images.sh       # Rebuilds `hardci-env:<hash>` base images from task recipes
│   ├── verify_harbor_tasks.sh       # Runs mandatory Harbor `nop=0` & `oracle=1` verification
│   ├── egress_bridge_override.yaml  # Docker 20.10.x Harbor egress-sidecar bridge compatibility override
│   └── eval_agent_allowlist.sh      # Live agent evaluation wrapper (allowlist + verifier no-network)
├── templates/harbor/                # Jinja2 zero-spoiler Harbor instruction templates
├── tests/                           # 7 domain test suites (151 unit tests)
├── harbor_tasks/                    # 11 QA-verified pure real-CI offline Harbor 1.4 tasks
├── docs/
│   ├── MINING_CRITERIA.md           # Acquisition rules, hard categories & anti-flake gates
│   ├── HARBOR_PACKAGING_AND_EVAL.md # Multi-workflow compiler, anti-cheat, egress & 3-control spec
│   └── BENCHMARK_CATALOG.md         # Catalog of all accepted real-CI Harbor tasks
└── old/                             # Archived legacy version of CrossWorkFlowCI-Factory

Quickstart

1. Setup & Unit Tests

Requires Linux, Bash, Docker, Git, Python 3.10+, authenticated gh CLI, and harbor CLI.

python3 -m venv .venv
source .venv/bin/activate
pip install -e .
cwci --help

# Run the full 151-test unit test suite
python3 -W error::SyntaxWarning -m unittest discover -s tests -p "test_*.py"

# Lint all packaged Harbor 1.4 tasks
python3 -m cwci lint-tasks harbor_tasks

2. Run the Automated Collection & Synthesis Pipeline

By default, the pipeline collects continuously into HARDCI_STATE_DIR (default ./state) and automatically halts all workers (user-hold.json + campaign-100/target-reached.json) once accepted tasks reach HARDCI_TARGET_ACCEPTED (default 100):

# Launch the full pipeline (stops automatically at 100 accepted tasks)
HARDCI_TARGET_ACCEPTED=100 bash scripts/start_harbor_pipeline.sh

# Launch the low-CPU/IO Docker & temp-directory garbage collector alongside it
bash scripts/start_resource_gc.sh

3. Rebuild Base Images & Verify Packaged Tasks in harbor_tasks/

Each task in harbor_tasks/ ships its complete Harbor 1.4 definition plus environment/base_recipe/ (Dockerfile, warm-wrong.sh, dependency-preflight.sh) so frozen hardci-env:<hash> base images can be reconstructed on any Docker host:

# Rebuild base image(s) from upstream repair commit + reverse reference patch
bash scripts/build_harbor_images.sh <task-slug>

# Verify nop == 0.0 and oracle == 1.0 under Harbor (`network_mode = "no-network"`)
bash scripts/verify_harbor_tasks.sh <task-slug>

Benchmark Tasks Overview (11 Real CI Tasks Across 10 Repositories)

  • Real Upstream GitHub Actions CI Failures (new_upstream_actions): 11 tasks (all synthetic/constructed Tier-2 backport tasks removed; collection continues strictly on real CI episodes)

See docs/BENCHMARK_CATALOG.md for the full catalog:

# Task Slug 仓库 & 架构拓扑 失败 → 修复范围 GitHub Actions 失败 Run & Compare QA (nop/oracle/developer)
1 gravitl-netmaker-091a4a8a-54697ba8-f131da4502-5b72c7f866 gravitl/netmaker
Go 1.26.0 + 3 Jobs
6 files / 109L Fail Run · Compare 0.0 / 1.0 / 1.0
2 infisical-gateway Infisical/infisical
Linux Offline CI
4 files / 21L Fail Run · Compare 0.0 / 1.0 / 1.0
3 jnosql-807 eclipse-jnosql/jnosql
Linux Offline CI
1 files / 16L Fail Run · Compare 0.0 / 1.0 / 1.0
4 linuxfoundation-insights-76481363-e8a7f055-2c7dc34ac2-c1f42506e0 linuxfoundation/insights
Node 24 + 4 Workflows / 4 Jobs
9 files / 57L Fail Run · Compare 0.0 / 1.0 / 1.0
5 openfrontio-openfrontio-2135e26a-4f9d37ff-a80574b822-9946f81a2f openfrontio/OpenFrontIO
Node 24 + 2 Jobs
7 files / 97L Fail Run · Compare 0.0 / 1.0 / 1.0
6 opentofu-opentofu-088ccd28-8e309ee7-c7c2cfadf3-9803a00294 opentofu/opentofu
Go 1.27.1
6 commits / 7 files / 197L Fail Run · Compare 0.0 / 1.0 / 1.0
7 opentofu-opentofu-d54ac27b-b1ee70bf-62bdbbfb04-gha opentofu/opentofu
Runner.Client (Separate-Verifier)
4 files / 115L Fail Run · Compare 0.0 / 1.0 / 1.0
8 sei-protocol-sei-chain-0ada2eba-6d8f4ad5-abaa57bda2-ad4d14144b sei-protocol/sei-chain
Go 1.27.4
5 files / 59L Fail Run · Compare 0.0 / 1.0 / 1.0
9 tencentcloud-cubesandbox-fa21ae21-ff813eef-8ebbf832e3-63927c8754 TencentCloud/CubeSandbox
Node 22 + 2 Workflows / 2 Jobs
13 files / 103L Fail Run · Compare 0.0 / 1.0 / 1.0
10 tornadoweb-tornado-271542a3-a3e5ef67-30a092ade8-36a52c907e tornadoweb/tornado
Python 3.13 + 2 Workflows / 3 Jobs
3 files / 3L Fail Run · Compare 0.0 / 1.0 / 1.0
11 uiua-lang-uiua-2cc8f585-fa6a2565-e51c1919f8-gha uiua-lang/uiua
Runner.Client (Separate-Verifier)
5 files / 119L Fail Run · Compare 0.0 / 1.0 / 1.0

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages