Skip to content
Merged
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
14 changes: 7 additions & 7 deletions .github/ISSUE_TEMPLATE/guide-usage-report.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
name: Guide usage report
name: MCP usage report
description: >-
Share an opt-in Guide telemetry summary. The report contains only tool-call
Share an opt-in MCP usage summary. The report contains only tool-call
counts, outcomes, durations, and timestamps — never tool arguments, queries,
or repository content. Submitting posts it as a public issue.
title: "Guide usage report"
title: "MCP usage report"
labels:
- usage-report
body:
- type: markdown
attributes:
value: >-
Thanks for sharing! This report comes from `rac mcp-stats --share` and
helps decide where Guide investment goes. Review the prefilled summary
Thanks for sharing! This report comes from `decided mcp-stats --share` and
helps decide where MCP investment goes. Review the prefilled summary
below before submitting — it should contain only counts and
timestamps, and it will be publicly visible.
- type: textarea
id: report
attributes:
label: Telemetry summary
description: The JSON summary produced by `rac mcp-stats --share`.
description: The JSON summary produced by `decided mcp-stats --share`.
render: json
validations:
required: true
Expand All @@ -27,7 +27,7 @@ body:
attributes:
label: Anything to add? (optional)
description: >-
How you use Guide, what worked, what didn't — anything that gives the
How you use the MCP server, what worked, what didn't — anything that gives the
numbers context.
validations:
required: false
64 changes: 59 additions & 5 deletions .github/workflows/rust-spike.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ on:
- ".github/workflows/rust-spike.yml"

jobs:
windows-compile:
name: Windows native compile
windows-runtime:
name: Windows native runtime smoke
runs-on: windows-latest
timeout-minutes: 20
timeout-minutes: 25
steps:
- uses: actions/checkout@v4

Expand All @@ -31,9 +31,63 @@ jobs:
with:
workspaces: rust

- name: Check native workspace
- name: Build native release binaries
working-directory: rust
run: cargo build --release --locked

# Keep this bounded: Linux owns the full workspace and inotify matrix;
# Windows proves that the shipped CLI, cache/store, rename transaction,
# and MCP wire contracts execute on the native filesystem.
- name: Native CLI and cache/store smoke
working-directory: rust
run: |
cargo test -p decided --test cli --release
cargo test -p asdecided-core --test index_store_vectors --release
cargo test -p asdecided-core --lib --release rename::tests::successful_transaction_replaces_all_files_and_cleans_backups

- name: MCP contract smoke
working-directory: rust
run: cargo check --workspace --locked
run: |
cargo test -p decided-mcp --test protocol_legacy --release
cargo test -p decided-mcp --test protocol_2026 --release
cargo test -p decided-mcp --test response_budget --release
cargo test -p decided-mcp --test docs_contract --release

macos-runtime:
name: macOS native runtime smoke
runs-on: macos-15
timeout-minutes: 25
steps:
- uses: actions/checkout@v4

- name: Install rust toolchain (pinned by rust/rust-toolchain.toml)
run: rustup show

- uses: Swatinem/rust-cache@v2
with:
workspaces: rust

- name: Build native release binaries
working-directory: rust
run: cargo build --release --locked

# Keep this bounded: macOS proves the shipped CLI, cache/store, rename
# transaction, and MCP contracts without duplicating Linux's watcher
# correctness gate.
- name: Native CLI and cache/store smoke
working-directory: rust
run: |
cargo test -p decided --test cli --release
cargo test -p asdecided-core --test index_store_vectors --release
cargo test -p asdecided-core --lib --release rename::tests::successful_transaction_replaces_all_files_and_cleans_backups

- name: MCP contract smoke
working-directory: rust
run: |
cargo test -p decided-mcp --test protocol_legacy --release
cargo test -p decided-mcp --test protocol_2026 --release
cargo test -p decided-mcp --test response_budget --release
cargo test -p decided-mcp --test docs_contract --release

rust-contract:
name: Rust contract + live-corpus invariants
Expand Down
55 changes: 31 additions & 24 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -1046,39 +1046,45 @@ Explorer is retired and is not part of the native product.

## mcp

Serve RAC repository knowledge to coding agents over MCP (stdio). The four
read-only tools, client configuration, and team setup are documented in the
[MCP server guide](mcp.md).
Serve AsDecided repository knowledge to coding agents over MCP. The native
server exposes six read-only tools; client configuration, response budgets,
and team setup are documented in the [MCP server guide](mcp.md).

```bash
decided-mcp --root /path/to/repo
decided-mcp --root /path/to/repo --telemetry
decided-mcp --root /path/to/repo \
--transport http --host 127.0.0.1 --port 8000 --path /mcp --budget 10000
```

- **`--root PATH`** — repository root to serve (default: current directory)
- **`--telemetry`** — record tool-call counts and metadata (never arguments
or content) to a local log under `$XDG_STATE_HOME/decisions/` (default
`~/.local/state/decisions/guide-telemetry.jsonl`); off by default, announced on
stderr when on
- **`--transport {stdio,http}`** — MCP transport (default: `stdio`)
- **`--host HOST`** — HTTP bind host (default: `127.0.0.1`)
- **`--port PORT`** — HTTP bind port (default: `8000`)
- **`--path PATH`** — HTTP endpoint path (default: `/mcp`)
- **`--budget N`** — maximum response size in characters (minimum `128`)
- **`--allowed-origin ORIGIN`** — allow an HTTP `Origin` header; repeat for
multiple origins
- **`--cache` / `--no-cache`** — enable or disable the derived read-model cache
(cache is enabled by default and output-neutral)
- **Exit codes:** `0` server shutdown on client disconnect · `2` `--root` is
not a directory

---

## mcp-stats

Summarize the local Guide telemetry log: events, sessions, first and last
timestamps, and per-tool calls, errors, truncation, and average duration.
An empty or missing log is a valid answer — telemetry is opt-in and off by
default.
Read a local compatibility MCP usage log, if one exists: events, sessions,
first and last timestamps, and per-tool calls, errors, truncation, and average
duration. The native `decided-mcp` server does not write this log; an empty or
missing log is therefore the normal answer for new installations.

```bash
decided-mcp-stats # human summary
decided-mcp-stats --json # the same summary as JSON (the shareable export)
decided-mcp-stats --share # prefilled GitHub usage-report issue URL
decided mcp-stats # human summary
decided mcp-stats --json # the same summary as JSON (the shareable export)
decided mcp-stats --share # prefilled GitHub usage-report issue URL
```

`--share` prints a URL that opens a prefilled usage-report issue containing
`decided mcp-stats --share` prints a URL that opens a prefilled usage-report issue containing
only counts and timestamps; you review and submit it in your own browser —
RAC sends nothing itself. `--json` and `--share` are mutually exclusive.

Expand All @@ -1089,16 +1095,16 @@ RAC sends nothing itself. `--json` and `--share` are mutually exclusive.

## usage

Summarize recorded **CLI usage** alongside the Guide MCP tools — per-command and
per-tool call counts, errors, session count, and a recent-activity trend. When
sharing consent is recorded (`decided telemetry on`), each completed `rac` command
Summarize recorded **CLI usage** alongside any compatibility MCP log —
per-command and per-tool call counts, errors, session count, and a recent-activity trend. When
sharing consent is recorded (`decided telemetry on`), each completed `decided` command
appends one **content-free** event (subcommand name, outcome, duration — never
argv, paths, or artifact ids) to a local log; `decided usage` reads it back.
`decided-mcp-stats` stays Guide-only for back-compat; `decided usage` covers both logs
`decided mcp-stats` remains a compatibility read-back; `decided usage` covers both logs
(ADR-046).

```bash
decided usage # human summary of CLI + Guide usage
decided usage # human summary of CLI + MCP compatibility usage
decided usage --json # the same summary as JSON
decided usage --share # prefilled GitHub usage-report issue URL (counts only)
```
Expand All @@ -1113,9 +1119,10 @@ default. `--json` and `--share` are mutually exclusive.
## telemetry

Show or change anonymous usage-sharing consent (ADR-041). With consent on,
`decided-mcp` sends at most one anonymous daily ping — a random install id, the
the native CLI sends at most one anonymous daily ping — a random install id, the
version, and an active-repo count; never paths, queries, or repository
content. Sharing is independent of the local `decided-mcp --telemetry` flag.
content. Sharing is independent of MCP serving; `decided-mcp` never sends
product telemetry.

```bash
decided telemetry # status (default): what is shared, and whether sending is possible
Expand Down Expand Up @@ -1510,7 +1517,7 @@ decided decisions-for rust/Cargo.toml decisions/ --json
```

The same lookup is available to agents over MCP as an additive optional `path`
argument on the `find_decisions` tool (the five-tool surface is unchanged);
argument on the `find_decisions` tool (the six-tool surface is unchanged);
`find_decisions` called with a `topic` is byte-identical to before.

### Herald rendering
Expand Down
2 changes: 1 addition & 1 deletion docs/context-cost.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ compression — payloads stay small because they are *scoped*, not lossily shrun

## 1. The MCP surface is measured and budgeted

The standing cost of the MCP server — the five tool descriptions and their JSON
The standing cost of the MCP server — the six tool descriptions and their JSON
schemas a client loads every session — is measured deterministically and offline
(no model, no network) and held under a budget as a regression check. Today it
measures ~915 tokens against a 1000 budget — roughly 25× under the ~23k figure the
Expand Down
6 changes: 4 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ Point your agent at your repo and ask:

The agent calls AsDecided, finds your soft-delete decision, cites it by ID, and proposes the compliant change — instead of reintroducing the thing you removed on purpose.

The server exposes four read-only tools: `get_artifact`, `search_artifacts`, `get_related`, `get_summary`. It never writes to your repo.
The server exposes six read-only tools: `get_artifact`, `search_artifacts`,
`retrieve_grounding`, `find_decisions`, `get_related`, and `get_summary`. It
never writes to your repo.

▶ **Full walkthrough + runnable example: [examples/guide/](https://github.com/asdecided/core/tree/main/examples/guide)**

Expand Down Expand Up @@ -102,7 +104,7 @@ AsDecided asks you to trust it with your product knowledge, so it holds itself t
- **No AI in the core.** Retrieval is deterministic: the same repo state and the same query always return the same result. The reasoning is your agent's job; AsDecided's job is to hand it the facts.
- **It dogfoods itself.** AsDecided's own planning corpus under [`decisions/`](https://github.com/asdecided/core/tree/main/rac) is validated by RAC in CI — if the tool's rules break the tool's own artifacts, the build fails.
- **Output is a contract.** Golden tests pin CLI and MCP output; any change to what the tools return is reviewed as a product change.
- **Telemetry is opt-in twice over.** Local recording needs an explicit `--telemetry` flag and never includes your arguments or repository content. Remote sharing is a separate, explicit consent (`decided telemetry on`, or one honest question at `decided init`): one anonymous daily ping a random install id, the version, and an active-repo count — never paths, queries, or content. `decided telemetry status` shows exactly what is shared, the network surface is a single readable module, and ADR-041 records the decision.
- **Telemetry is opt-in.** Optional anonymous sharing is configured explicitly with `decided telemetry on` (or one honest question at `decided init`): one daily ping with a random install id, the version, and an active-repo count — never paths, queries, or repository content. `decided telemetry status` shows exactly what is shared, the network surface is a single readable module, and ADR-041 records the decision. The native MCP server itself never sends telemetry.

## Sharing the corpus (the Portal)

Expand Down
Loading
Loading