> ## Documentation Index
> Fetch the complete documentation index at: https://docs.refactron.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Citations & acknowledgments

> Academic foundations and open-source dependencies Refactron stands on.

Refactron is built on decades of academic and open-source work. This page acknowledges the lineage explicitly.

## Academic foundations

### Behavior-preserving refactoring

**Opdyke, W. F. (1992)**. *Refactoring Object-Oriented Frameworks*. PhD thesis, University of Illinois at Urbana-Champaign.

The foundational thesis defining refactoring as a discipline of behavior-preserving transformation. Opdyke's "preconditions" (properties that must hold before a transformation is safe) are the conceptual ancestor of Refactron's `precondition` records: every refusal carries an explicit reason rather than a silent skip.

[PDF (UIUC IDEALS archive)](https://www.ideals.illinois.edu/items/26201)

### Tree-based program analysis

**Brunsfeld, M. (2018)**. *Tree-sitter: a new parsing system for programming tools*. Strange Loop 2018.

The error-tolerant, incremental parser library Refactron uses for its detector layer. Tree-sitter is what makes "fast enough on a 100k-LOC codebase" attainable for the analyze step.

[Talk video](https://www.youtube.com/watch?v=Jes3bD6P0To) · [Project](https://tree-sitter.github.io/)

### Refactoring-aware test selection

**Wang, K., Buse, R. P. L., & Weimer, W. (2018)**. *Towards Refactoring-Aware Regression Test Selection*. ICSE 2018.

The insight that **coverage of the changed surface** (not just any-test-touched-this-file) is the right signal for which tests to re-run after a refactor. Influences Refactron's blast-radius scoring: `affectedTestFiles` contributes 20% to the score and drives whether the test gate runs at all.

[ACM DL](https://dl.acm.org/doi/10.1145/3180155.3180163)

### LLM code-quality baseline

**Pearce, H. et al. (NYU, 2022)**. *Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributions*.

The 89-scenario study of MITRE Top-25 CWEs that found \~40% of Copilot's top suggestions contained an exploitable vulnerability, part of why Refactron pairs a probabilistic proposer with a deterministic verifier rather than trusting a model's own judgment about whether a change is safe. See [Deterministic by design](../concepts/why-no-llm).

[arXiv:2108.09293](https://arxiv.org/abs/2108.09293)

***

## Open-source dependencies (transform foundations)

### LibCST (Instagram Engineering)

The concrete syntax tree library that backs every Python transform sidecar. LibCST preserves whitespace, comments, and formatting exactly, which is why Refactron can rewrite a docstring without disturbing the rest of the file.

* [Project](https://github.com/Instagram/LibCST)
* License: MIT

### ts-morph (David Sherret)

The TypeScript Compiler API wrapper that backs every TypeScript transform. Gives Refactron type-aware refactoring (e.g., `indexof_to_includes` only fires when the LHS is genuinely an array, not a string) without forking the TypeScript compiler.

* [Project](https://github.com/dsherret/ts-morph)
* License: MIT

### Ink (Vadim Demedes)

The React renderer for terminal output used by Refactron's interactive TUI (`refactron analyze`, `run --dry-run`).

* [Project](https://github.com/vadimdemedes/ink)
* License: MIT

### write-file-atomic (npm)

The cross-platform atomic-write primitive Refactron's batch writer wraps. Handles the POSIX `rename(2)` / Windows `MoveFileEx` differences so that every file write is either fully on disk or not at all.

* [Project](https://github.com/npm/write-file-atomic)
* License: ISC

***

## How to cite Refactron

If Refactron contributes to academic work, the suggested citation is:

```bibtex theme={null}
@software{refactron2024,
  title  = {Refactron: the verification layer for AI code change},
  author = {{Refactron}},
  year   = {2024},
  url    = {https://github.com/Refactron-ai/Refactron_Lib_TS},
  note   = {Apache License 2.0}
}
```

For specific design decisions, the ADRs under [`dev-docs/decisions/`](https://github.com/Refactron-ai/Refactron_Lib_TS/tree/main/dev-docs/decisions) are the canonical references.
