Skip to content

Commit bf57e4d

Browse files
authored
Merge pull request #10 from akhundMurad/chore/README-focus
docs: refresh README and getting started with architecture snapshot/h…
2 parents 5699b38 + 70818e9 commit bf57e4d

2 files changed

Lines changed: 159 additions & 215 deletions

File tree

README.md

Lines changed: 17 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
</p>
44

55
<p align="center">
6-
<strong>Architecture Governance & Architecture-as-Code</strong>
6+
<strong>Architecture Insights, Governance & Versioned Design</strong>
77
</p>
88

99
<p align="center">
@@ -22,7 +22,7 @@
2222

2323
> **Warning:** Experimental. Expect breaking changes until release 0.1.0
2424
25-
Pacta is an architecture governance tool that helps teams define architectural intent, gain insights through metrics and historical trends, detect architectural drift, and evolve codebases safely without blocking delivery.
25+
Pacta turns software architecture into versioned, queryable data — so teams can see, compare, and reason about architectural change over time, not just block violations.
2626

2727
```bash
2828
pip install pacta
@@ -45,86 +45,23 @@ Codebases rot. Architecture degrades through small changes no one tracks. Pacta
4545

4646
## What it does
4747

48-
- **Static analysis** — parses Python AST, builds a system graph
49-
- **Layer enforcement** — domain can't import from infra, etc.
50-
- **Snapshots** — version your architecture like code
51-
- **Baseline mode** — fail only on *new* violations, not legacy debt
52-
- **History tracking** — view architecture evolution over time
53-
- **Trend analysis** — track violations, nodes, edges over time with charts
54-
55-
## Quick example
56-
57-
> This is a minimal example. See the docs for advanced rules, baselines, and history.
58-
59-
Define your layers in `architecture.yml`:
60-
61-
```yaml
62-
version: 1
63-
system:
64-
id: myapp
65-
name: My App
66-
67-
containers:
68-
backend:
69-
code:
70-
roots: [src]
71-
layers:
72-
domain:
73-
patterns: [src/domain/**]
74-
infra:
75-
patterns: [src/infra/**]
76-
```
48+
- **Architecture snapshots** — version your architecture like code
49+
- **History & trends** — track how dependencies, coupling, and violations evolve over time
50+
- **Diffs** — compare architectural states like Git commits
51+
- **Metrics & insights** — nodes, edges, layers, instability, drift
52+
- **Rules & governance** — express architectural intent and enforce it incrementally
53+
- **Baseline mode** — govern change without being blocked by legacy debt
7754

78-
Add rules in `rules.pacta.yml`:
79-
80-
```yaml
81-
rule:
82-
id: no_domain_to_infra
83-
name: Domain cannot depend on Infrastructure
84-
severity: error
85-
target: dependency
86-
when:
87-
all:
88-
- from.layer == domain
89-
- to.layer == infra
90-
action: forbid
91-
message: Domain layer must not import from Infrastructure
92-
```
55+
## Think of Pacta like Git for architecture
9356

94-
Run it:
57+
| Git | Pacta |
58+
|-----|-------|
59+
| `git commit` | `pacta scan` — capture an architectural snapshot |
60+
| `git log` | `pacta history` — timeline and trends of architectural states |
61+
| `git diff` | `pacta diff` — compare two snapshots |
62+
| branch protection | `rules.pacta.yml` — governance that prevents drift |
9563

96-
```bash
97-
$ pacta scan . --model architecture.yml --rules rules.pacta.yml
98-
99-
✗ 2 violations (2 error) [2 new]
100-
✗ ERROR [no_domain_to_infra] Domain cannot depend on Infrastructure @ src/domain/user.py:3:1
101-
status: new
102-
Domain layer must not import from Infrastructure
103-
```
104-
105-
### Baseline workflow
106-
107-
Got legacy violations? Save a baseline and only fail on new ones:
108-
109-
```bash
110-
# Save current state
111-
pacta scan . --model architecture.yml --rules rules.pacta.yml --save-ref baseline
112-
113-
# Later, in CI — fail only on new violations
114-
pacta scan . --model architecture.yml --rules rules.pacta.yml --baseline baseline
115-
```
116-
117-
### History tracking
118-
119-
Every scan creates a content-addressed snapshot. Inspect how your architecture evolves over time:
120-
121-
```bash
122-
# View timeline
123-
$ pacta history show --last 5
124-
125-
# View trends over time (violations, nodes, edges, coupling)
126-
$ pacta history trends .
127-
```
64+
See the [Getting Started](https://akhundmurad.github.io/pacta/getting-started/) guide for a full walkthrough.
12865

12966
## Docs
13067

@@ -139,7 +76,7 @@ $ pacta history trends .
13976
- [x] Trend analysis with chart export
14077
- [ ] Architecture visualization (Mermaid, D2)
14178
- [ ] Health metrics (drift score, instability)
142-
- [ ] Optional hosted service (future):
79+
- [ ] Future: Architecture Intelligence Layer:
14380
- Cross-repository insights
14481
- Historical trend analysis
14582
- Team-level governance and reporting

0 commit comments

Comments
 (0)