Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2914035
Refactor provider dispatch behind a Backend trait
bddap-bot Jun 2, 2026
c781bf3
backend: fix doc comment — function-calling is shared, not Anthropic-…
bddap-bot Jun 2, 2026
d8f16a4
edit: structured-edit engine — replacer chain + apply
bddap-bot Jun 2, 2026
47b38f3
agent: provider-agnostic edit-mode loop + tool set
bddap-bot Jun 2, 2026
509bf23
anthropic: edit-mode agent over the Messages API
bddap-bot Jun 2, 2026
27d0e8c
openai: edit-mode agent + edit-mode system prompt
bddap-bot Jun 2, 2026
2282ba9
refac: wire edit mode end to end
bddap-bot Jun 2, 2026
396638f
review round 1: fix UTF-8 panic, tighten the Model trait, dedup
bddap-bot Jun 2, 2026
2364fe2
review round 2: refresh stale docs after the turn() merge
bddap-bot Jun 2, 2026
fe92b29
Cut rewrite mode — edit mode is the only behavior
bddap-bot Jun 2, 2026
67572cc
Simplify after cutting rewrite mode
bddap-bot Jun 2, 2026
126ec3a
Delete vestigial api.rs Message/Role carrier
bddap-bot Jun 3, 2026
4621f34
Derive tool arg schemas from types instead of hand-writing JSON
bddap-bot Jun 3, 2026
f811ca8
Tool registry, schemars Schema type, leaner prose, sharper prompt
bddap-bot Jun 3, 2026
52f0fd7
Sweep agent.rs comments to the WHY-only bar (per review)
Jun 19, 2026
48f7613
Strong-type the provider wire conversations
Jun 19, 2026
3a09537
Review loop: typed wire schemas, leaner comments, multibyte-safe dedent
Jun 19, 2026
0a96bf3
prompt: drop the (first)/(second) positional cruft
Jun 19, 2026
c743a1b
prompt: apply owner suggestion - lead with sass, make fun of the user
Jun 19, 2026
09cddac
Review round: fix empty-selection regression, edit splatter, HTTP errors
Jun 19, 2026
b315ede
openai: type the assistant message, drop untagged + raw Value
Jun 19, 2026
0f32bef
Carry `selected` via the pre-seeded `view` call, not a user message
Jun 19, 2026
8f19ea1
Comment sweep: cut restatement/narration; add AGENTS.md comment rule
Jun 19, 2026
a29b979
Clear all comments from PR-touched source files
Jun 20, 2026
77fd531
Type provider unions: ToolChoice enum, Assistant fields + flattened e…
Jun 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/target
/tmp
/.cargo-home
33 changes: 33 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# refac — contributor notes

## Comments are code

A comment must **provably earn its place**: it survives only if it carries a
**WHY**, a **gotcha**, or a **constraint** a future reader would otherwise trip
over. Never restate what the code, a signature, or a type already says; never
narrate WHAT the next lines do; never leave development-history trivia ("changed
from…", "the API doesn't infer this"). **When in doubt, delete.** Comment density
is itself a cost — a wall of even-true remarks buries the few that matter and
makes the code harder to read.

Doc comments on crate-internal items get the same bar: keep one only for a
non-obvious WHY or when a macro consumes it (e.g. a `schemars` field doc that
becomes a model-facing schema description).

## Types

Prefer real types over `serde_json::Value` or stringly-typed data for anything
refac constructs or controls. The one sanctioned `Value` is a payload echoed back
to a provider verbatim for byte-fidelity (re-serializing would reorder fields) —
and that exception carries a WHY comment.

## Build & test

The toolchain is pinned via nix, not rustup. From a clone:

```bash
cargo test
cargo clippy --all-targets -- -D warnings # must stay clean
```

Both must pass before requesting review.
88 changes: 64 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@ repository = "https://github.com/bddap/refac"
[dependencies]
anyhow = "1.0.69"
clap = { version = "4.1.8", features = ["derive"] }
itertools = "0.10.5"
reqwest = { version = "0.13", default-features = false, features = [
"rustls",
"blocking",
"json",
] }
rpassword = "7.5.0"
dialoguer = "0.11"
schemars = "1.0"
serde = { version = "1.0.154", features = ["derive"] }
serde_json = "1.0.94"
similar = "2.2.1"
toml = "0.7.3"
tracing = "0.1.37"
tracing-subscriber = "0.3.20"
Expand Down
Loading