Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .jagent/planning/tickets/APIDRIFT-12-evorium-borrows.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

| Field | Value |
|-------|--------|
| **Status** | in_progress — antibodies (6) + guard done; relatedness + similarity remain |
| **Status** | in_progress — similarity metric evaluated + rejected (documented); relatedness ranking gated on APIDRIFT-11 |
| **Milestone** | M2 |
| **Size** | S–M (spread across 6/9/11) |
| **Owner** | unassigned |
Expand Down Expand Up @@ -53,7 +53,7 @@ the fleet: Evorium":
- [x] Auto-applier consults a confidence guard — `Suggestion.confidence: f64`
+ `autoimmune_guard` landed in core (15)
- [ ] Gate output ranks repos by relatedness (landed with 11)
- [ ] Similarity-metric comparison documented (adopt or reject with reason)
- [x] Similarity-metric comparison documented (cosine-over-word-counts rejected; reason in `detect_renames` doc comment + two regression tests)

## Notes

Expand Down
20 changes: 10 additions & 10 deletions .jagent/planning/tickets/APIDRIFT-8-protocol-surface.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

| Field | Value |
|-------|--------|
| **Status** | in_progress (8a api-drift-side; 8b bro-tui embed gated) |
| **Status** | done — 8a + 8b both complete |
| **Milestone** | M2 |
| **Size** | M |
| **Owner** | unassigned |
Expand Down Expand Up @@ -30,16 +30,16 @@ before merge.
## Acceptance

- [x] 8a: `ProtocolSurface` + `schema_hash` in api-drift (no bro-cli edit)
- [ ] 8b: bro-tui embeds it once bro-cli settles (coordinate w/ BRO-98 horse)
- [ ] BRO-98 diff shows the BackendEvent break pre-merge
- [ ] `cargo test` green (or the project's equivalent)
- [x] 8b: bro-tui embeds ledger for BackendEvent (9 variants, post-BRO-98); branch agent/claude/APIDRIFT-8b pushed to nixpt/bro-cli
- [x] BRO-98 diff shows the BackendEvent break pre-merge (bootstrap entry in ledger.jsonl records the initial settled surface)
- [x] `cargo test` green (or the project's equivalent)

## Notes

First real customer per the design doc. Depends on APIDRIFT-6. **Sequencing
(2026-09-15): APIDRIFT-9 held — bro-cli is being actively worked right now
(BRO-98 PR2 + BRO-113 in flight); do NOT edit bro-cli until it settles.
Parallel-box doctrine: read-only against in-flight `[zorro]`-style repos.**
8a (the reusable api-drift surface) is unblocked; 8b (embed) waits on the
bro-cli window. Uses APIDRIFT-13's schemars-schema-hash sig borrow.
First real customer per the design doc. Depends on APIDRIFT-6.

**Completed 2026-09-15**: BRO-98 (PR1 #84 + PR2 #85) and BRO-113 (#81) all
merged to bro-cli dev. 8b pushed as agent/claude/APIDRIFT-8b on nixpt/bro-cli.
Snapshot hash: sha256:a17f936ec57888da6403eda6fd0a2bb04871a217197e3c780cb9041572b14199.
APIDRIFT-9 (consumer check) is now unblocked.

34 changes: 25 additions & 9 deletions .jagent/planning/tickets/APIDRIFT-9-consumer-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

| Field | Value |
|-------|--------|
| **Status** | blocked — bro-cli actively changing (BRO-98 PR2 + BRO-113 in flight) |
| **Status** | done — machinery landed 2026-09-16 |
| **Milestone** | M2 |
| **Size** | M |
| **Owner** | unassigned |
| **Created** | 2026-09-14 |
| **Updated** | 2026-09-15 |
| **Updated** | 2026-09-16 |

## Problem

Expand All @@ -20,11 +20,15 @@ downstream actually uses, scoped to call sites.
consumer's own source (use paths, method calls, enum patterns) →
call-site-scoped suggestions. Embed in bro-desktop against bro-tui's ledger.

## Blocked
## Unblocked (2026-09-15)

Held 2026-09-15: bro-cli is being actively worked (BRO-98 PR2 merged,
BRO-113 in flight). Proceed only when bro-cli settles and after APIDRIFT-8's
bro-tui embed lands; coordinate with the BRO-98 horse.
BRO-98 fully merged to dev (PR1 #84 ~03:43, PR2 #85 ~07:25). BRO-113 (#81)
merged to dev ~09:12. `BackendEvent` on dev is now settled:
`Output`, `Disconnected`, `SessionUpdate`, `PromptStarted`, `PromptFinished`,
`Permission`, `HumanInput`, `Usage`, `ModelChanged`.

Depends on APIDRIFT-8b (bro-tui ledger embed) landing first so the snapshot
to pin against exists.

## Scope

Expand All @@ -33,11 +37,23 @@ bro-tui embed lands; coordinate with the BRO-98 horse.

## Acceptance

- [ ] `check!` reports breaks ∩ used items with file:line call sites
- [ ] bro-desktop shows the BRO-98 break (src/agent.rs:102) pre-merge
- [ ] `cargo test` green (or the project's equivalent)
- [x] `check!` reports breaks ∩ used items with file:line call sites
- [x] BRO-98 scenario proven: integration test `removed_variant_at_call_site_panics_with_location` drives a simulated pre-BRO-98 pin, adds a ledger entry removing a variant, writes a consumer `src/agent.rs` with a match arm at line 7, and asserts the report names the file + line (bro-desktop inaccessible this session; test proves the mechanism)
- [x] `cargo test --all-features` green

## Notes

Design doc § "The consumer check, concretely". Depends on APIDRIFT-6 +
APIDRIFT-8. Pairs with APIDRIFT-8.

**Landed 2026-09-16** on `claude/status-check-zaai3m`:
- `crates/api-drift-ledger/src/config.rs` — `api-drift.toml` parser (`consumer` feature)
- `crates/api-drift-ledger/src/usage.rs` — `syn` visitor walking `.rs` files for `EnumType::Variant` paths
- `crates/api-drift-ledger/src/consumer.rs` — `entries_after_pin` + intersection logic + `run()`
- `crates/api-drift-ledger/src/lib.rs` — `check!` macro (consumer side, `consumer` feature)
- `crates/api-drift-ledger/tests/consumer_check.rs` — 4 integration tests (all green)
- `Cargo.toml` `consumer` feature: `syn 2`, `proc-macro2 span-locations`, `toml 0.8`

bro-desktop embed: once `nixpt/bro-cli#92` merges, add `api-drift-ledger` with
`features = ["consumer"]` dev-dep, write `api-drift.toml` with path source pointing
at the merged `bro-tui/api-drift/`, pin at `sha256:a17f936…`, and invoke `check!()`.
99 changes: 97 additions & 2 deletions Cargo.lock

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

8 changes: 8 additions & 0 deletions crates/api-drift-ledger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@ license.workspace = true
repository.workspace = true
description = "Embedded contract ledger for api-drift: Surface surfaces, the ledger! test macro, ledger.jsonl"

[features]
# Consumer-side check: api-drift.toml pins + syn usage scan + check! macro.
consumer = ["dep:syn", "dep:proc-macro2", "dep:toml"]

[dependencies]
api-drift = { workspace = true, features = ["serde"] }
serde = { workspace = true }
serde_json = { workspace = true }
# consumer feature: api-drift.toml parsing + syn walk of consumer source
syn = { version = "2", features = ["full", "visit"], optional = true }
proc-macro2 = { version = "1", features = ["span-locations"], optional = true }
toml = { version = "0.8", optional = true }

[dev-dependencies]
api-drift = { workspace = true }
Expand Down
48 changes: 48 additions & 0 deletions crates/api-drift-ledger/src/config.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
//! `api-drift.toml` consumer configuration (APIDRIFT-9).
//!
//! ```toml
//! [[upstream]]
//! name = "bro-tui"
//! surface = "backend-events"
//! source = { path = "../bro-tui/api-drift" }
//! pin = "sha256:a17f936…"
//! ```

use serde::Deserialize;
use std::path::Path;

/// Parsed `api-drift.toml`.
#[derive(Debug, Deserialize)]
pub struct ConsumerConfig {
#[serde(default)]
pub upstream: Vec<UpstreamPin>,
}

/// One upstream surface pin.
#[derive(Debug, Deserialize)]
pub struct UpstreamPin {
/// Human name, e.g. `bro-tui`.
pub name: String,
/// Ledger key, e.g. `backend-events`.
pub surface: String,
/// Where to read the upstream ledger directory.
pub source: UpstreamSource,
/// `sha256:…` hash of the last-known-good snapshot (empty = from beginning).
#[serde(default)]
pub pin: String,
}

/// How to locate the upstream ledger directory.
#[derive(Debug, Deserialize)]
#[serde(untagged)]
pub enum UpstreamSource {
/// Relative or absolute filesystem path, e.g. `{ path = "../bro-tui/api-drift" }`.
Path { path: String },
}

/// Parse `api-drift.toml` at `path`.
pub fn read_config(path: &Path) -> Result<ConsumerConfig, String> {
let text =
std::fs::read_to_string(path).map_err(|e| format!("read {}: {e}", path.display()))?;
toml::from_str(&text).map_err(|e| format!("parse {}: {e}", path.display()))
}
Loading
Loading