Metadata-Version: 2.4
Name: acps-academic-writer
Version: 1.0.0
Summary: ACPs-orchestrated multi-agent academic writing studio: a Structure architect turns a research topic into an IMRaD outline, a Citation steward audits APA/MLA/IEEE references and supplies academic phrasing plus paraphrasing, and a Tone reviewer removes colloquialism to enforce an objective scholarly register. Three AIP v2 agents run in parallel on acps-sdk 2.1.0 and merge into one prioritized readiness report for SCI manuscripts, dissertations and study-abroad essays.
Author-email: ACPs Academic Writer Engineering <team@acps-academic-writer.dev>
License-Expression: MIT
Project-URL: Homepage, https://github.com/acps-labs/acps-academic-writer
Project-URL: Repository, https://github.com/acps-labs/acps-academic-writer
Project-URL: Documentation, https://github.com/acps-labs/acps-academic-writer#readme
Project-URL: Changelog, https://github.com/acps-labs/acps-academic-writer/releases
Keywords: acps,acps-sdk,multi-agent,agent-collaboration,academic-writing,academic-editing,sci-paper,imrad,citation-checker,apa,mla,ieee,paraphrasing,academic-tone,essay-review
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Education
Classifier: Topic :: Education :: Computer Aided Instruction (CAI)
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: acps-sdk==2.1.0
Requires-Dist: fastapi>=0.110.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: pydantic>=2.5.0
Requires-Dist: uvicorn>=0.27.0
Provides-Extra: dev
Requires-Dist: build>=1.0.0; extra == "dev"
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: twine>=5.0.0; extra == "dev"
Dynamic: license-file

# ACPs Academic Writer

**Three specialist agents, one manuscript, one readiness report.**
A production-style multi-agent academic editing tool built on
[`acps-sdk`](https://pypi.org/project/acps-sdk/) **2.1.0**.

`acps-academic-writer` turns a single academic draft into three independent,
auditable review products — IMRaD architecture, citation compliance, and
academic register — then merges them into one weighted revision plan. Each
reviewer is a real ACPs agent that publishes its own capability document
(ACS), is discovered through ADP, and is driven through the AIP v2 task
lifecycle over JSON-RPC.

---

## Why the name

| Part | Meaning |
| --- | --- |
| **ACPs** | The agent protocol family the project is built on: **A**gent **C**apability **S**pecification (ACS), **A**gent **D**iscovery **P**rotocol (ADP) and **A**gent **I**nteraction **P**rotocol (AIP). |
| **Academic Writer** | The domain: SCI manuscripts, dissertations, coursework essays and study-abroad reports. |

The name states exactly what it is: *an ACPs-native tool for academic writing*.
The `acps-` prefix keeps it consistent with the SDK ecosystem on PyPI.

---

## Real scenarios

| Scenario | Pain point | Which agent carries it |
| --- | --- | --- |
| SCI / SSCI manuscript submission | Reviewers reject papers for a missing gap statement, Results that over-interpret, or an APA list that does not match the body | Structure + Citation |
| Master's / PhD dissertation chapter | IMRaD sections drift, limitations vanish, citations mix IEEE and APA | Structure + Citation |
| Study-abroad Essay / Report | Clean grammar but colloquial register (`a lot of`, `it's`, `proves`) and unsupported claims | Tone |
| Lab internal pre-submission check | No time for a full language edit; need an auditable checklist | All three |

**Why multi-agent instead of one prompt?**

- **Separation of concerns** — architecture, references and register each get a dedicated rubric and cannot drown each other out.
- **Parallel latency** — the Leader dispatches three AIP tasks with `asyncio.gather`.
- **Auditability** — every dimension has its own score, evidence and task trace.
- **Replaceability** — swap the deterministic engine for an LLM per agent without touching the ACPs wiring.

---

## Architecture

```
                     ADP discovery: filter skills.tags
 ┌───────────────────────────────────────────────────────────────────┐
 │                 Leader  (AcademicWriterSession)                   │
 │  AIC 1.2.156.3088.1.1.34C2.478BDF.00000L.0SEN                     │
 └──────┬────────────────────┬───────────────────────┬───────────────┘
        │ AIP start          │ AIP start             │ AIP start
        ▼                    ▼                       ▼
 ┌───────────────┐    ┌────────────────┐     ┌────────────────┐
 │StructureAgent │    │ CitationAgent  │     │   ToneAgent    │
 │…000001.0SEN   │    │ …000002.0SEN   │     │ …000003.0SEN   │
 │ IMRaD outline │    │ APA/MLA/IEEE   │     │ register &     │
 │ section roles │    │ phrases +      │     │ objectivity    │
 │ move coverage │    │ paraphrasing  │     │ hedging        │
 └──────┬────────┘    └───────┬────────┘     └───────┬────────┘
        │ AIP product         │ AIP product          │ AIP product
        └─────────────────────┴──────────┬───────────┘
                                         ▼
                          weighted synthesis 35 / 30 / 35
                                         ▼
                         ManuscriptReview (one revision plan)
```

Each agent is a FastAPI/uvicorn service on loopback exposing `POST /aip/v2/rpc`.
`LocalAgentMesh` starts all three in background threads, publishes their ACS
into an in-process ADP registry, and lets the Leader discover them by skill tag —
the same path a remote deployment would use.

### AIP task lifecycle

```
start ──► awaiting-completion ──► complete
  │               │
  └── product ────┘   (structure / citation / tone report as StructuredDataItem)
```

Task IDs and final states are embedded in `ManuscriptReview.collaboration`.

---

## Agent roles

| Agent | Skill ID | Input | Output |
| --- | --- | --- | --- |
| **StructureAgent** | `academic-writer.structure` | Full `AcademicDraft` | IMRaD outline with word budgets and sentence prompts, detected section roles, move coverage, missing chapters/moves, structure score |
| **CitationAgent** | `academic-writer.citation` | Full `AcademicDraft` | In-text citation audit, reference-entry conformance, missing/unused references, phrase bank, paraphrases, citation score |
| **ToneAgent** | `academic-writer.tone` | Full `AcademicDraft` | Informal lexis, contractions, subjective stance, vague quantifiers, absolutist claims, replacements, formality score |

Weights: **Structure 35% / Citation 30% / Tone 35%**.

---

## Install

```bash
python -m pip install acps-academic-writer
```

Local development:

```bash
python -m pip install -e ".[dev]"
```

> No API key, network model, or external service is required. The bundled
> engine is deterministic, so the demo and tests produce reproducible output.

---

## One-command demo

```bash
academic-writer demo
# or: python -m academic_writer demo
```

Review your own draft:

```bash
academic-writer review \
  --file examples/sample_draft.txt \
  --references-file examples/sample_references.txt \
  --style APA --venue sci-journal --discipline social-sciences \
  --topic "the effect of short-form video exposure on sustained attention"
```

### What the demo prints (excerpt)

```
[ADP] 通过发现协议解析到以下 ACPs 智能体:
  1. StructureAgent  skill=academic-writer.structure
  2. CitationAgent   skill=academic-writer.citation
  3. ToneAgent       skill=academic-writer.tone
[Leader] 正在通过 AIP v2 并发派发 3 个审校任务（Structure / Citation / Tone）...

[StructureAgent] 论文架构 · IMRaD 大纲与章节覆盖 · 得分 62/100
  缺失章节: Discussion
  P3 [研究结果] 问题: 结果段出现 suggests / proves 等解释性动词，应移到 Discussion

[CitationAgent] 文献引用 · APA 格式审校 · 得分 59/100
  [引用风格不一致] 正文有 1 处引用与 APA 格式不一致："[2]"。
  [正文引用缺条目] 正文引用在参考文献列表中找不到条目：zhang
  [条目未被引用] 参考文献列表中存在正文未引用的条目：wang

[ToneAgent] 学术语气 · 语域与客观性审校 · 得分 50/100
  #1 [口语化用词] "Nowadays" -> "in recent years"
  #4 [口语化用词] "really bad" -> "highly detrimental"
  #6 [绝对化断言] "proves" -> "suggests"

Leader 汇总 · Overall Readiness: 56.9/100
```

---

## Build a wheel

```bash
python -m pip install --upgrade build twine
python -m build
# -> dist/acps_academic_writer-1.0.0-py3-none-any.whl
# -> dist/acps_academic_writer-1.0.0.tar.gz
```

Offline / already-provisioned environments:

```bash
python -m build --no-isolation
```

Validate the artifacts:

```bash
python -m twine check dist/*
```

## Publish to PyPI

```bash
# 1) optional dry run on TestPyPI
python -m twine upload --repository testpypi dist/*

# 2) production upload (API token recommended)
$env:TWINE_USERNAME = "__token__"
$env:TWINE_PASSWORD = "pypi-<your-token>"
python -m twine upload dist/*
```

Then anyone can run:

```bash
python -m pip install acps-academic-writer
academic-writer demo
```

---

## Project layout

```
acps-academic-writer/
├── pyproject.toml
├── README.md
├── LICENSE
├── examples/
│   ├── sample_draft.txt
│   └── sample_references.txt
├── src/academic_writer/
│   ├── agents/          # structure / citation / tone AIP agents
│   ├── engine.py        # deterministic editorial knowledge
│   ├── identity.py      # AIC + ACS builders
│   ├── leader.py        # ADP discovery + parallel AIP orchestration
│   ├── mesh.py          # local three-agent mesh
│   ├── runtime.py       # AIP RPC server + payload helpers
│   └── cli.py           # demo / review commands
└── tests/
```

## Design notes

The engine is deliberately deterministic: no external LLM is called, so scores
and evidence are reproducible in CI. To plug in an LLM, keep the ACPs wiring and
replace `AcademicWriterEngine.review_structure` / `review_citations` /
`review_tone` with model-backed implementations that return the same pydantic
models.

## License

MIT
