# How the ARS Pipeline Is Structured: The 7 Main Stages Explained

> Understand the ARS pipeline structure with this explanation of its 7 main stages. Learn how Integrity checkpoints ensure artifact validation throughout the workflow.

- Repository: [Edward Cheng-I Wu/academic-research-skills](https://github.com/Imbad0202/academic-research-skills)
- Tags: architecture
- Published: 2026-05-13

---

**The ARS pipeline is a deterministic, seven-stage workflow orchestrated by a Pipeline Orchestrator Agent and governed by a formal State Machine, featuring mandatory Integrity checkpoints at stages 2.5 and 4.5 that validate artifacts before permitting progression to finalization.**

The Academic Research Skills (ARS) pipeline provides a deterministic workflow for transforming raw research materials into formatted academic papers. Defined in the `Imbad0202/academic-research-skills` repository, this multi-skill architecture enforces strict checkpoint policies and artifact validation at every transition. Understanding how the ARS pipeline is structured enables developers to integrate its orchestration logic into automated research workflows.

## Core Architecture Components

The ARS pipeline structure relies on two authoritative specifications that define runtime behavior and state transitions.

### Pipeline Orchestrator Agent

The **Pipeline Orchestrator Agent** serves as the runtime "brain" that detects user intent, manages hand-offs between skills, and enforces checkpoint policies. According to the specification in [[`academic-pipeline/agents/pipeline_orchestrator_agent.md`](https://github.com/Imbad0202/academic-research-skills/blob/main/academic-pipeline/agents/pipeline_orchestrator_agent.md)](https://github.com/Imbad0202/academic-research-skills/blob/main/academic-pipeline/agents/pipeline_orchestrator_agent.md), the orchestrator handles entry-point detection, resume mode protocols, and user override commands such as `continue`, `pause`, `adjust`, and `abort`.

### Pipeline State Machine

The **Pipeline State Machine** defines the formal state-transition diagram that lists every legal stage, global pipeline state, and allowed transitions. Located at [[`academic-pipeline/references/pipeline_state_machine.md`](https://github.com/Imbad0202/academic-research-skills/blob/main/academic-pipeline/references/pipeline_state_machine.md)](https://github.com/Imbad0202/academic-research-skills/blob/main/academic-pipeline/references/pipeline_state_machine.md), this document specifies the Material Dependency Matrix, which validates that produced artifacts conform to required schemas before transitions complete.

## The 7 Main Stages of the ARS Pipeline

The ARS pipeline consists of five mandatory stages, two mandatory Integrity checkpoints, and one optional post-processing stage. Each stage produces specific artifacts that feed into subsequent phases.

### Stage 1: RESEARCH

The **RESEARCH** stage conducts deep literature search and generates foundational research materials. This mandatory stage produces three key artifacts: a research-question (RQ) brief, a comprehensive bibliography, and a synthesis report. The `integrity_verification_agent` does not run here, but the output quality determines the validity of all downstream work.

### Stage 2: WRITE

The **WRITE** stage transforms research materials into a structured manuscript, progressing from outline to full draft. This mandatory stage outputs a paper draft in Markdown format. Upon completion, the pipeline automatically triggers the first mandatory checkpoint before allowing progression to review.

### Stage 2.5: INTEGRITY (Pre-review)

The **INTEGRITY (Pre-review)** checkpoint runs the `integrity_verification_agent` to validate citations, data integrity, and originality. This stage is **never skipped** and produces a pre-review integrity report. The pipeline state enters `awaiting_confirmation` until validation passes, ensuring only verified drafts proceed to peer review.

### Stage 3: REVIEW

The **REVIEW** stage submits the verified draft to the `academic-paper-reviewer` system, which engages five reviewers plus a Devil's Advocate. This mandatory stage generates review reports, an editorial decision, and a revision roadmap that dictates the required changes for Stage 4.

### Stage 4: REVISE

The **REVISE** stage applies the revision roadmap, rewrites the draft according to reviewer feedback, and prepares a formal response to reviewers document. This mandatory stage requires both the revised draft and the response document as outputs before triggering the final integrity checkpoint.

### Stage 4.5: INTEGRITY (Final)

The **INTEGRITY (Final)** checkpoint runs the `integrity_verification_agent` again on the revised draft to ensure changes maintain academic standards. Like Stage 2.5, this checkpoint **cannot be skipped** and produces the final integrity report required for Stage 5 entry.

### Stage 5: FINALIZE

The **FINALIZE** stage converts the verified draft into the final output format. This mandatory stage produces formatted papers in PDF, LaTeX, or DOCX formats. After Stage 4.5 validation, the `state_tracker_agent` transitions the global state to `running` for finalization, emitting no further checkpoints upon completion.

### Stage 6: POST-PROCESS (Optional)

The **POST-PROCESS** stage runs the *Collaboration Depth Observer* in non-blocking mode to generate audit artifacts and collaboration-depth reports. This optional stage does not affect the mandatory workflow and can be disabled without impacting paper validity.

## Runtime Flow and State Management

Understanding how the ARS pipeline executes requires examining its adaptive checkpoint system and state transition logic.

### Entry-Point Detection

When invoked via [`scripts/run_pipeline.py`](https://github.com/Imbad0202/academic-research-skills/blob/main/scripts/run_pipeline.py), the orchestrator examines the initial user utterance—searching for keywords, attached files, or a `resume_from_passport` token—to route execution to the appropriate stage. The "Intent Detection" table in the orchestrator specification defines routing rules that map inputs to Stage 1 (fresh start) or intermediate stages (resume operations).

### Adaptive Checkpoint System

After each stage, the orchestrator emits one of three checkpoint types based on runtime conditions:

- **FULL**: Emitted at first stages, after user `pause` commands, or when `ARS_PASSPORT_RESET=1` environment variable is set
- **SLIM**: Emitted after consecutive "continue" responses to minimize storage overhead
- **MANDATORY**: Strictly enforced at Stages 2.5 and 4.5 regardless of user preferences

The checkpoint type determines whether the pipeline emits a passport-reset tag (enabling session resumption via 12-hex hashes) or proceeds immediately.

### Material Hand-Off Validation

Every transition validates produced artifacts against the Material Dependency Matrix defined in the state machine specification. Missing or malformed materials trigger an automatic re-run of the producing stage rather than permitting progression. This validation ensures that Stage 3 never receives an unverified draft from Stage 2.

### Global State Management

The `state_tracker_agent` maintains six global pipeline states: `initializing`, `running`, `awaiting_confirmation`, `paused`, `completed`, and `aborted`. Transitions between these states occur in response to user commands, checkpoint outcomes, or integrity verification failures. When `ARS_PASSPORT_RESET=1`, FULL checkpoints emit passport-reset tags that pause the pipeline until a fresh session issues `resume_from_passport=<hash>`.

## Implementing the ARS Pipeline in Python

The repository provides a thin wrapper at [`scripts/run_pipeline.py`](https://github.com/Imbad0202/academic-research-skills/blob/main/scripts/run_pipeline.py) that loads the orchestrator specification and launches sub-skill agents. Below are implementation patterns for common operational modes.

### Starting a Fresh Pipeline

To initiate a new research workflow from Stage 1:

```python
import subprocess
import pathlib

repo_root = pathlib.Path("/path/to/academic-research-skills")
cmd = [
    "python", str(repo_root / "scripts" / "run_pipeline.py"),
    "--entry-point", "research"  # Forces Stage 1 (RESEARCH)

]
subprocess.run(cmd, check=True)

```

The orchestrator reads the Intent Detection table and launches the deep-research skill, automatically proceeding through the mandatory checkpoint at Stage 2.5.

### Resuming from a Checkpoint

To resume a paused pipeline using a passport hash generated from a previous FULL checkpoint:

```python
import subprocess
import pathlib

repo_root = pathlib.Path("/path/to/academic-research-skills")
resume_hash = "a3f2b7c9d0e1"  # 12-hex hash from previous FULL checkpoint

cmd = [
    "python", str(repo_root / "scripts" / "run_pipeline.py"),
    f"resume_from_passport={resume_hash}"
]
subprocess.run(cmd, check=True)

```

The orchestrator follows the Resume Mode protocol defined in lines 44-94 of [`pipeline_orchestrator_agent.md`](https://github.com/Imbad0202/academic-research-skills/blob/main/pipeline_orchestrator_agent.md), restoring the previous state and material context.

### Overriding Stage Selection

To force execution at a specific stage with modified parameters:

```python
import subprocess
import pathlib

repo_root = pathlib.Path("/path/to/academic-research-skills")
cmd = [
    "python", str(repo_root / "scripts" / "run_pipeline.py"),
    "--override-stage", "4",    # Jump to REVISE

    "--override-mode", "quick"  # Use quick mode for revision

]
subprocess.run(cmd, check=True)

```

The orchestrator records the override in the resume entry according to the *User overrides* section of the specification, bypassing default progression logic while maintaining integrity checkpoint requirements.

## Summary

- The ARS pipeline structure comprises seven stages: Research, Write, Integrity (Pre-review), Review, Revise, Integrity (Final), and Finalize, plus an optional Post-Process stage.
- Two core documents govern execution: the **Pipeline Orchestrator Agent** ([`academic-pipeline/agents/pipeline_orchestrator_agent.md`](https://github.com/Imbad0202/academic-research-skills/blob/main/academic-pipeline/agents/pipeline_orchestrator_agent.md)) and the **Pipeline State Machine** ([`academic-pipeline/references/pipeline_state_machine.md`](https://github.com/Imbad0202/academic-research-skills/blob/main/academic-pipeline/references/pipeline_state_machine.md)).
- **Integrity checkpoints at Stages 2.5 and 4.5** are mandatory and cannot be skipped; they validate citations, data integrity, and originality before permitting progression.
- The system supports **adaptive checkpointing** (FULL, SLIM, MANDATORY) and **passport-reset boundaries** for session resumption via 12-hex hashes.
- Global states (`initializing`, `running`, `awaiting_confirmation`, `paused`, `completed`, `aborted`) are managed by the `state_tracker_agent` in response to user commands and validation outcomes.

## Frequently Asked Questions

### What distinguishes Stage 2.5 from Stage 4.5 in the ARS pipeline?

Both stages run the `integrity_verification_agent`, but **Stage 2.5 (Pre-review)** validates the initial draft before peer review begins, while **Stage 4.5 (Final)** verifies that revisions made in response to reviewer feedback maintain data integrity and citation accuracy. Both are mandatory checkpoints, but they guard different transition points in the workflow.

### How does the ARS pipeline handle interrupted sessions?

The pipeline implements a **passport-reset boundary** system. When the `ARS_PASSPORT_RESET` environment variable is set to `1`, every FULL checkpoint emits a 12-character hexadecimal hash. Users resume execution by passing `resume_from_passport=<hash>` to [`scripts/run_pipeline.py`](https://github.com/Imbad0202/academic-research-skills/blob/main/scripts/run_pipeline.py), which restores the exact state and material context from the checkpoint.

### What triggers a transition between global pipeline states?

The `state_tracker_agent` transitions global states based on three inputs: **user commands** (`continue`, `pause`, `adjust`, `abort`), **checkpoint outcomes** (pass/fail of integrity verification), and **completion events** (stage artifacts passing Material Dependency Matrix validation). States like `awaiting_confirmation` specifically indicate that the pipeline requires user input or successful integrity verification to proceed.

### Is the POST-PROCESS stage required to generate a valid academic paper?

No. **Stage 6 (POST-PROCESS)** is entirely optional. It runs the *Collaboration Depth Observer* to generate audit artifacts and collaboration-depth reports, but the pipeline considers a paper complete after Stage 5 (FINALIZE) produces the formatted PDF, LaTeX, or DOCX output. Skipping Stage 6 does not trigger any validation errors or block workflow completion.