# RAC v0.7.3 — Repository Intelligence Summary

## Context

v0.7.0 introduced relationship metadata.

v0.7.1 added relationship inspection.

v0.7.2 added relationship validation.

Together these allow RAC to understand not only individual artifacts, but how product knowledge connects across a repository.

The next step is repository-level intelligence: a single capability that summarizes repository structure, completeness, relationships, and areas requiring attention.

This release prepares RAC for future interfaces such as Explorer by ensuring repository intelligence exists in Core rather than being calculated by consumers.

---

## Goal

Provide a repository-level intelligence summary.

Users and tools should be able to answer:

```text
What exists?

How complete is it?

How connected is it?

What needs attention?
```

without manually combining output from multiple commands.

---

## Principles

### Core Owns Intelligence

Repository intelligence belongs in RAC Core.

Consumers such as:

- CLI
- Explorer
- Future integrations

shall render intelligence, not calculate it.

---

### Deterministic

All scoring and analysis shall be deterministic.

No AI inference.

No hidden heuristics.

---

### Machine Consumable

Repository intelligence shall expose stable structured output suitable for future consumers.

---

# Initiatives

## Initiative 1 — Repository Summary Model

Introduce a repository-level summary model.

The model should include:

```text
RepositorySummary

Artifacts
Relationships
Validation
Completeness
Attention
```

---

Example:

```json
{
  "artifacts": {
    "total": 72,

    "by_type": {
      "requirements": 42,
      "decisions": 15,
      "roadmaps": 5,
      "prompts": 8,
      "designs": 2
    }
  }
}
```

---

## Initiative 2 — Relationship Summary

Aggregate repository relationship health.

Example:

```json
{
  "relationships": {
    "total": 120,
    "valid": 118,
    "broken": 2,
    "orphaned": 4
  }
}
```

Support:

- Total relationships
- Broken references
- Orphaned artifacts
- Relationship coverage

---

## Initiative 3 — Attention Items

Introduce repository-level attention reporting.

Examples:

```text
REQ-041 missing success metrics

ADR-012 references missing artifact

PROMPT-004 incomplete metadata
```

Structured output:

```json
{
  "attention": [
    {
      "artifact": "REQ-041",
      "severity": "warning",
      "message": "Missing success metrics"
    }
  ]
}
```

---

## Initiative 4 — Repository Health Score

Introduce deterministic repository health scoring.

Example:

```json
{
  "health": {
    "score": 87
  }
}
```

The score may consider:

- Artifact validity
- Schema completeness
- Relationship integrity
- Missing recommended sections

The scoring rules must live in Core.

---

## Initiative 5 — CLI Exposure

Expose through:

```bash
rac portfolio
```

or:

```bash
rac summary
```

with:

```bash
rac portfolio --json
```

providing the stable machine contract.

---

# Requirements

## REQ-001 — Core Ownership

Repository intelligence shall be calculated entirely by RAC Core.

Consumers shall not calculate repository health independently.

---

## REQ-002 — Artifact Coverage

Repository summary shall include all supported artifact types:

- Requirement
- Decision
- Roadmap
- Prompt
- Design

---

## REQ-003 — Relationship Awareness

Repository summary shall include relationship health.

---

## REQ-004 — Attention Reporting

Repository summary shall expose actionable repository issues.

---

## REQ-005 — Stable JSON Contract

Repository intelligence shall provide structured output suitable for:

- CLI
- Explorer
- Automation

---

## Non-Goals

### Visualization

No:

- Graph rendering
- Dashboards
- Explorer UI

---

### AI Analysis

No:

- AI scoring
- Generated recommendations
- Semantic analysis

---

### Mutation

No repository changes shall be performed.

v0.7.3 is read-only.

---

# Success Measures

RAC Core can answer:

```text
Tell me about this repository.
```

without requiring consumers to combine multiple command outputs.

Explorer can build its future home screen entirely from this capability.

CLI users gain repository-level insight without leaving the terminal.

Repository intelligence becomes a first-class RAC capability.