# Grokkius Studio deliverable — Docs / README

> Produced entirely by AI agents (Sir Grokkius, an AI). Review before use. No warranty.

# dedupe

Remove duplicate lines from a text file while keeping the original order.

> **Status:** first draft, free test mode. Items marked **default (assumed)** are *not* stated in the brief and are unconfirmed.

## What it does

Reads lines from a text file and writes each unique line once. Under the default (assumed) semantics, lines are kept in the order they **first** appeared, and output goes to **stdout**.

## Usage

```sh
dedupe <input-file>
```

Default (assumed): exactly one required argument; output to stdout.

Example — `fruits.txt`:

```
apple
banana
apple
cherry
banana
```

```sh
$ dedupe fruits.txt
apple
banana
cherry
```

## Behavior

All of the following are **defaults (assumed)**, not stated requirements:

- Keeps the **first** occurrence of each line (last-occurrence dedupe also preserves a notion of order — needs a decision).
- Comparison is exact: case- and whitespace-sensitive.
- Blank lines count as lines (consecutive blanks collapse to one).
- Output ends with a trailing newline; CRLF and encoding handling unconfirmed (UTF-8 assumed).
- Exit codes: `0` on success, `1` on error — convention only, unconfirmed.

## Tests / verification

**Verification done on this draft** (no implementation exists yet to execute):
- Example checked: `apple, banana, apple, cherry, banana` → `apple, banana, cherry` under first-occurrence semantics. ✓
- Independent critique + verifier review: no factual errors, no invented URLs/citations; assumptions flagged.

**Proposed test cases (pending confirmed behavior):**

| # | Input | Expected (default semantics) |
|---|-------|------------------------------|
| 1 | `apple, banana, apple, cherry, banana` | `apple, banana, cherry` |
| 2 | `Apple, apple` | both kept (case-sensitive) |
| 3 | `a, a, (blank), (blank)` | `a, (blank)` |
| 4 | empty file | empty output |
| 5 | missing/unreadable file | error message, exit `1` |

## Install

TODO — not specified in the brief.

## License

TODO.

## Open questions for the customer

1. Output destination: stdout, file, or in-place?
2. First or last occurrence?
3. Case/whitespace sensitivity?
4. Do blank lines count as lines?
5. Behavior with 0 args, multiple files, unreadable file; exit codes?

*Drafted by Grokkius Studio (AI team) — first draft, free test mode. Not human.*

## Limitations

- Order-preserving exact dedupe must store every unique line in memory; may matter for very large files.
- No flags (e.g., `--ignore-case`), stdin support, or multiple-file handling yet; `--` support suggested so filenames starting with `-` aren't parsed as flags.
- No in-place mode; if ever added, it is a data-loss risk and must require explicit opt-in.
- All behavior above is unconfirmed and may change once the customer answers the open questions.