Skip to content
Closed
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
3 changes: 2 additions & 1 deletion .cursor/rules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- BEGIN RAC MANAGED BLOCK (digest: 7f693642352f74bd5ca870cc752ced16f41d665303b41779f38bc68d52be5f78) -->
<!-- BEGIN RAC MANAGED BLOCK (digest: 0c499330c6558847fce241383f95b9c92153e44ad9b82e5a75670276155fb02a) -->
<!-- Managed by `rac export --agent-rules`. Edit decisions in rac/, not here; content outside this block is preserved. -->
## Settled decisions (RAC)

Expand Down Expand Up @@ -69,4 +69,5 @@ These decisions are already accepted. Do not re-open or contradict them; ask the
- **RAC-KW6NQ4Y814N7** — ADR-094: Roadmaps Are Identified by Stable Codename, Not a vX.Y.Z Scope-Fence _(Process)_
- **RAC-KW8ZTVEQJ366** — ADR-095: rac-connectors Repackage, PyPI Rename, and Outbound Field Rename _(Architecture)_
- **RAC-KWBJJRZR84PT** — ADR-096: External-Target Verification Edge (`verified_by`) _(Technical)_
- **RAC-KWGKWKEXP1TJ** — ADR-098: Decision Applies-To Scope and Path Lookup _(Technical)_
<!-- END RAC MANAGED BLOCK -->
3 changes: 2 additions & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- BEGIN RAC MANAGED BLOCK (digest: 7f693642352f74bd5ca870cc752ced16f41d665303b41779f38bc68d52be5f78) -->
<!-- BEGIN RAC MANAGED BLOCK (digest: 0c499330c6558847fce241383f95b9c92153e44ad9b82e5a75670276155fb02a) -->
<!-- Managed by `rac export --agent-rules`. Edit decisions in rac/, not here; content outside this block is preserved. -->
## Settled decisions (RAC)

Expand Down Expand Up @@ -69,4 +69,5 @@ These decisions are already accepted. Do not re-open or contradict them; ask the
- **RAC-KW6NQ4Y814N7** — ADR-094: Roadmaps Are Identified by Stable Codename, Not a vX.Y.Z Scope-Fence _(Process)_
- **RAC-KW8ZTVEQJ366** — ADR-095: rac-connectors Repackage, PyPI Rename, and Outbound Field Rename _(Architecture)_
- **RAC-KWBJJRZR84PT** — ADR-096: External-Target Verification Edge (`verified_by`) _(Technical)_
- **RAC-KWGKWKEXP1TJ** — ADR-098: Decision Applies-To Scope and Path Lookup _(Technical)_
<!-- END RAC MANAGED BLOCK -->
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ jobs:
- name: mcp
paths: "tests/test_mcp_server.py tests/test_mcp_tools.py tests/test_mcp_isolation.py tests/test_mcp_telemetry.py tests/test_mcp_ping.py tests/test_mcp_audit.py"
- name: relationships
paths: "tests/test_relationships.py tests/test_relationships_cmd.py tests/test_relationship_validation.py tests/test_relationship_graph.py tests/test_lifecycle_status.py tests/test_rename.py"
paths: "tests/test_relationships.py tests/test_relationships_cmd.py tests/test_relationship_validation.py tests/test_relationship_graph.py tests/test_lifecycle_status.py tests/test_rename.py tests/test_applies_to.py"
- name: resolve
paths: "tests/test_resolve.py tests/test_find_decisions.py tests/test_explain.py"
paths: "tests/test_resolve.py tests/test_find_decisions.py tests/test_explain.py tests/test_decisions_for_path.py"
- name: eval
paths: "tests/test_eval.py"
- name: review
Expand Down
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- BEGIN RAC MANAGED BLOCK (digest: 7f693642352f74bd5ca870cc752ced16f41d665303b41779f38bc68d52be5f78) -->
<!-- BEGIN RAC MANAGED BLOCK (digest: 0c499330c6558847fce241383f95b9c92153e44ad9b82e5a75670276155fb02a) -->
<!-- Managed by `rac export --agent-rules`. Edit decisions in rac/, not here; content outside this block is preserved. -->
## Settled decisions (RAC)

Expand Down Expand Up @@ -69,4 +69,5 @@ These decisions are already accepted. Do not re-open or contradict them; ask the
- **RAC-KW6NQ4Y814N7** — ADR-094: Roadmaps Are Identified by Stable Codename, Not a vX.Y.Z Scope-Fence _(Process)_
- **RAC-KW8ZTVEQJ366** — ADR-095: rac-connectors Repackage, PyPI Rename, and Outbound Field Rename _(Architecture)_
- **RAC-KWBJJRZR84PT** — ADR-096: External-Target Verification Edge (`verified_by`) _(Technical)_
- **RAC-KWGKWKEXP1TJ** — ADR-098: Decision Applies-To Scope and Path Lookup _(Technical)_
<!-- END RAC MANAGED BLOCK -->
3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ to the corpus artifact and they load through the imports below.
- Previous series: `rac/roadmaps/v0.21.x-editor/` (complete)
- Decisions (ADRs): `rac/decisions/`

<!-- BEGIN RAC MANAGED BLOCK (digest: 7f693642352f74bd5ca870cc752ced16f41d665303b41779f38bc68d52be5f78) -->
<!-- BEGIN RAC MANAGED BLOCK (digest: 0c499330c6558847fce241383f95b9c92153e44ad9b82e5a75670276155fb02a) -->
<!-- Managed by `rac export --agent-rules`. Edit decisions in rac/, not here; content outside this block is preserved. -->
## Settled decisions (RAC)

Expand Down Expand Up @@ -94,4 +94,5 @@ These decisions are already accepted. Do not re-open or contradict them; ask the
- **RAC-KW6NQ4Y814N7** — ADR-094: Roadmaps Are Identified by Stable Codename, Not a vX.Y.Z Scope-Fence _(Process)_
- **RAC-KW8ZTVEQJ366** — ADR-095: rac-connectors Repackage, PyPI Rename, and Outbound Field Rename _(Architecture)_
- **RAC-KWBJJRZR84PT** — ADR-096: External-Target Verification Edge (`verified_by`) _(Technical)_
- **RAC-KWGKWKEXP1TJ** — ADR-098: Decision Applies-To Scope and Path Lookup _(Technical)_
<!-- END RAC MANAGED BLOCK -->
46 changes: 46 additions & 0 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,52 @@ rac find markdown rac/ --explain # show the relevance-score breakdown
```


---

## decisions

The live decisions whose declared `## Applies To` scopes govern a path
(ADR-098) — scoped grounding at the point of work. Given a repository-relative
file or directory, returns the Accepted, non-retired decisions that declare a
path scope matching it, each with its status and the scope(s) that matched.
Bindings and evidence, never a verdict: the lookup tells you which decisions
bind the path; reading and judging them stays with the caller (ADR-067).

- **Input:** `rac decisions <path> [directory]` — directory defaults to the
current directory.
- **Options:** `--json` · `--top-level`
- **Exit codes:** `0` lookup completed (matches or none) · `2` not a
directory, or an empty path

Matching is deterministic and case-sensitive: a directory scope governs its
whole subtree, `*` crosses `/`, and component labels (entries with whitespace
or no separator, like `RAC Core`) never match a path query. An empty result is
a valid outcome, not an error.

```bash
rac decisions src/auth/login.py rac/
rac decisions src/auth/ rac/ --json
```

```json
{
"schema_version": "1",
"path": "src/auth/login.py",
"type": "decision",
"match_count": 1,
"matches": [
{
"id": "RAC-F1XTVREAVTH0",
"type": "decision",
"title": "Auth module boundaries",
"status": "Accepted",
"path": "rac/decisions/auth-boundaries.md",
"scopes": ["src/auth/"]
}
]
}
```

---

## migrate
Expand Down
4 changes: 3 additions & 1 deletion docs/mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,16 @@ and cite the decision ID in its response.
If you are pointing at your own repository, substitute a topic you know
a decision covers.

## 5. The four tools
## 5. The six tools

| Tool | When the agent calls it |
|---|---|
| `get_summary` | Once at session start — counts artifacts, flags health issues |
| `search_artifacts` | Before designing or implementing anything that a recorded decision might cover |
| `get_artifact` | When an artifact ID appears, or before changing anything a decision covers |
| `get_related` | After retrieving an artifact — finds what else the change could affect |
| `find_decisions` | Before proposing anything a prior decision might have settled — the live (Accepted, non-retired) decisions binding a topic |
| `decisions_for_path` | Before editing code — the live decisions whose declared `## Applies To` scopes govern the file or directory being changed (ADR-098) |

`get_related` takes an optional `depth` (default `1`, capped at `5`): the default
returns immediate neighbours only, while `depth>1` additionally returns a
Expand Down
32 changes: 32 additions & 0 deletions docs/relationships.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,38 @@ In `rac export --graph` an external edge carries `"external": true`,
deliberate ticket link from a dangling in-corpus reference (both are unresolved,
only the external one is marked).

## Applies-to scope (decisions)

`## Applies To` declares the code a decision governs (ADR-098) — the join that
lets `rac decisions <path>` and the MCP `decisions_for_path` tool answer "which
decisions govern the file I am editing?" deterministically. Decisions only, one
entry per line:

```markdown
## Applies To
- src/auth/
- docs/*.md
- the login surface
```

An entry is either a **path glob** (repo-root-relative, POSIX separators — any
entry with a `/` or a glob character) or a **component label** (anything with
whitespace, or a bare name like `rac-core` — recorded for humans, never
resolved). A repository-root file opts into path-hood with `./`
(`./pyproject.toml`). Matching is case-sensitive; a directory scope governs its
whole subtree.

Two checks, deliberately split (ADR-098):

- `rac validate` **format-lints** path entries offline (`malformed-applies-to`:
absolute paths, backslashes, `.`/`..` segments) — blocking, like any
structural error.
- A path scope that **matches nothing in the working tree** is an **advisory**:
`rac relationships --validate` reports it under a separate `advisories` key
(present only when non-empty) and `rac doctor` warns — but neither ever fails.
A moved path is the drift signal the freshness gate consumes, not a merge
blocker.

## Viewing relationships

```bash
Expand Down
5 changes: 4 additions & 1 deletion rac/decisions/adr-018-rac-directory-as-root.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
schema_version: 1
id: RAC-KTQ63DR3G4YG
Expand Down Expand Up @@ -315,4 +315,7 @@
## Review Date

Review at v1.0.0 once external adoption patterns are better understood.
```

## Applies To

- rac/
4 changes: 4 additions & 0 deletions rac/decisions/adr-023-clean-break-internal-refactors.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
schema_version: 1
id: RAC-KTQ63DRPK57V
Expand Down Expand Up @@ -200,3 +200,7 @@

Review before v1.0.0, or if RAC begins publishing a supported Python API (as opposed to
its CLI and JSON contracts), which would warrant a deliberate deprecation policy.

## Applies To

- src/rac/
4 changes: 4 additions & 0 deletions rac/decisions/adr-027-ci-test-topology.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
schema_version: 1
id: RAC-KTQ63DSC8SZW
Expand Down Expand Up @@ -232,3 +232,7 @@
Review before v1.0.0, or sooner if RAC accepts outside contributors who need pre-merge
test feedback — which would warrant re-adding a `pull_request` trigger (rule 1) — or if
the job count from the battery × version grid becomes burdensome.

## Applies To

- .github/workflows/
4 changes: 4 additions & 0 deletions rac/decisions/adr-033-guide-response-budget.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
schema_version: 1
id: RAC-KTW0M81HX5C6
Expand Down Expand Up @@ -155,3 +155,7 @@
## Related Roadmaps

- v0.10.0-guide-foundation

## Applies To

- src/rac/mcp/
5 changes: 5 additions & 0 deletions rac/decisions/adr-035-byo-ai-credentials.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# ADR-035: User-Managed AI Credentials

## Status
Expand Down Expand Up @@ -294,3 +294,8 @@
## Review Date

Review at v1.0.0 or upon introduction of the first AI-assisted capability within RAC Core.

## Applies To

- RAC Core
- open-source extensions
Loading
Loading