archsutra-ai 0.1.4 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -6
- package/README.md +84 -12
- package/dist/audit.js +125 -44
- package/dist/cli.js +184 -96
- package/dist/drift.js +29 -15
- package/dist/fsutil.js +117 -20
- package/dist/history.js +40 -0
- package/dist/html.js +10 -8
- package/dist/map.js +26 -5
- package/dist/mcp.js +70 -55
- package/dist/redact.js +24 -11
- package/dist/report.js +69 -19
- package/dist/rules-extra.js +59 -0
- package/dist/secret-patterns.js +69 -0
- package/dist/suppress.js +31 -19
- package/dist/verify.js +2 -2
- package/dist/write.js +71 -0
- package/docs/architecture/overview.html +29 -12
- package/docs/architecture/overview.md +2 -2
- package/docs/architecture/threat-model.html +28 -11
- package/docs/assets/charts/coverage-dark.svg +11 -0
- package/docs/assets/charts/coverage.svg +11 -0
- package/docs/assets/charts/finding-anatomy-dark.svg +20 -0
- package/docs/assets/charts/finding-anatomy.svg +20 -0
- package/docs/assets/charts/pipeline-dark.svg +13 -0
- package/docs/assets/charts/pipeline.svg +13 -0
- package/docs/assets/charts/precision-by-batch-dark.svg +12 -0
- package/docs/assets/charts/precision-by-batch.svg +12 -0
- package/docs/assets/charts/precision-by-rule-dark.svg +12 -0
- package/docs/assets/charts/precision-by-rule.svg +12 -0
- package/docs/assets/charts/sample-findings-by-severity-dark.svg +11 -0
- package/docs/assets/charts/sample-findings-by-severity.svg +11 -0
- package/docs/assets/charts/scan-time-dark.svg +11 -0
- package/docs/assets/charts/scan-time.svg +11 -0
- package/docs/assets/site.css +259 -138
- package/docs/assets/site.js +92 -6
- package/docs/community/good-first-issues.html +28 -11
- package/docs/compatibility/matrix.html +28 -11
- package/docs/compatibility/smoke-tests/index.html +28 -11
- package/docs/decisions/ADR-0001-deterministic-cli-plus-ide-skills.html +28 -11
- package/docs/guides/cheat-sheet.html +100 -0
- package/docs/guides/cheat-sheet.md +146 -0
- package/docs/guides/ci-recipes.html +170 -0
- package/docs/guides/ci-recipes.md +176 -0
- package/docs/guides/evidence-at-a-glance.html +93 -0
- package/docs/guides/evidence-at-a-glance.md +65 -0
- package/docs/guides/getting-started.html +151 -0
- package/docs/guides/getting-started.md +160 -0
- package/docs/guides/how-it-works.html +161 -0
- package/docs/guides/how-it-works.md +148 -0
- package/docs/guides/mcp-server.html +99 -0
- package/docs/guides/mcp-server.md +81 -0
- package/docs/guides/reading-a-report.html +119 -0
- package/docs/guides/reading-a-report.md +111 -0
- package/docs/guides/real-world-scenarios.html +287 -0
- package/docs/guides/real-world-scenarios.md +377 -0
- package/docs/handbook/01-executive-summary.html +30 -13
- package/docs/handbook/01-executive-summary.md +2 -2
- package/docs/handbook/02-functional-specification.html +30 -13
- package/docs/handbook/02-functional-specification.md +3 -3
- package/docs/handbook/03-technical-specification.html +31 -14
- package/docs/handbook/03-technical-specification.md +3 -3
- package/docs/handbook/04-architecture.html +29 -12
- package/docs/handbook/04-architecture.md +1 -1
- package/docs/handbook/05-user-guide.html +33 -15
- package/docs/handbook/05-user-guide.md +5 -4
- package/docs/handbook/06-cli-reference.html +52 -16
- package/docs/handbook/06-cli-reference.md +47 -4
- package/docs/handbook/07-security-privacy-legal.html +31 -12
- package/docs/handbook/07-security-privacy-legal.md +4 -0
- package/docs/handbook/08-testing-and-proof.html +32 -15
- package/docs/handbook/08-testing-and-proof.md +4 -4
- package/docs/handbook/09-compatibility-and-roadmap.html +29 -12
- package/docs/handbook/09-compatibility-and-roadmap.md +3 -2
- package/docs/handbook/10-contributor-guide.html +29 -12
- package/docs/handbook/10-contributor-guide.md +1 -1
- package/docs/handbook/11-glossary-and-faq.html +34 -13
- package/docs/handbook/11-glossary-and-faq.md +7 -1
- package/docs/handbook/12-rule-catalog.html +59 -19
- package/docs/handbook/12-rule-catalog.md +62 -5
- package/docs/handbook/13-trust-and-assurance.html +29 -12
- package/docs/handbook/13-trust-and-assurance.md +1 -1
- package/docs/handbook/14-real-world-evaluation.html +28 -11
- package/docs/handbook/15-supply-chain-and-release.html +28 -11
- package/docs/handbook/16-performance-and-quality-metrics.html +28 -11
- package/docs/handbook/16-performance-and-quality-metrics.md +1 -1
- package/docs/handbook/README.md +4 -2
- package/docs/handbook/index.html +31 -13
- package/docs/index.html +101 -51
- package/docs/legal/legal-review-brief.html +28 -11
- package/docs/legal/trademark-and-name-clearance.html +28 -11
- package/docs/proof/accessibility.html +28 -11
- package/docs/proof/benchmarks.json +9 -9
- package/docs/proof/benchmarks.md +4 -4
- package/docs/proof/test-results.txt +56 -40
- package/docs/rfc/0001-archsutra-v0.1.html +28 -11
- package/docs/sample-report/architecture-register.json +46 -0
- package/docs/sample-report/audit-report.html +123 -0
- package/docs/sample-report/audit-report.md +314 -0
- package/docs/sample-report/current-state.html +77 -0
- package/docs/sample-report/current-state.md +51 -0
- package/docs/sample-report/findings.json +478 -0
- package/docs/sample-report/findings.sarif +754 -0
- package/docs/sample-report/index.html +57 -0
- package/docs/sample-report/overview.md +11 -0
- package/docs/search-index.json +1 -0
- package/docs/sitemap.xml +39 -28
- package/llms.txt +11 -2
- package/package.json +3 -2
- package/schemas/findings.schema.json +4 -3
- package/skills/architecture-audit/SKILL.md +2 -2
- package/skills/architecture-audit/references/report-template.md +1 -1
- package/skills/architecture-verification/references/fitness-functions.md +1 -1
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# Get started in 5 minutes
|
|
2
|
+
|
|
3
|
+
<!-- summary: From zero to a readable architecture report in five minutes: pick your path, run one command, open the report, then bring in your AI IDE and CI. -->
|
|
4
|
+
|
|
5
|
+
By the end of this page you will have an **audit report you can open in a browser**, you will know what each part means, and you will know the next step for your situation. You do not need an account, an API key or network access for the first four steps.
|
|
6
|
+
|
|
7
|
+
> **Tip.** Short on time? Run step 1 and step 2, then read [Reading a report](reading-a-report.md). That alone is a useful 3 minutes.
|
|
8
|
+
|
|
9
|
+
## Pick your path
|
|
10
|
+
|
|
11
|
+
Start from what you want, not from the tool.
|
|
12
|
+
|
|
13
|
+
```mermaid
|
|
14
|
+
flowchart TD
|
|
15
|
+
start(["What do you want?"]) --> q1{"Do you already<br/>have code?"}
|
|
16
|
+
q1 -- "Yes, I need to understand it" --> audit["Run: archsutra audit .<br/>then open the HTML report"]
|
|
17
|
+
q1 -- "No, I am designing something new" --> design["Install the skills,<br/>ask Prime to design it"]
|
|
18
|
+
audit --> q2{"What next?"}
|
|
19
|
+
q2 -- "Stop it getting worse" --> ci["Add the CI gate<br/>(step 5)"]
|
|
20
|
+
q2 -- "Fix the big problems" --> mod["Ask Prime for a<br/>phased roadmap"]
|
|
21
|
+
q2 -- "Is this part safe?" --> tm["Use the threat-modeling skill"]
|
|
22
|
+
design --> adr["You get options, an ADR,<br/>diagrams and a thin-slice plan"]
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Step 1. Run your first audit
|
|
26
|
+
|
|
27
|
+
You need Node.js 20 or newer. From the root of any project:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx archsutra-ai audit .
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
On Windows `npx archsutra-ai` works from version 0.1.3. The command reads your files, never runs them, never uses the network, and prints a report. Here is the **real output** for the small sample project in this repository:
|
|
34
|
+
|
|
35
|
+
> **Real output.** Trimmed from `archsutra audit fixtures/brownfield-monolith`.
|
|
36
|
+
|
|
37
|
+
```text
|
|
38
|
+
# Architecture Audit Report
|
|
39
|
+
|
|
40
|
+
## Summary
|
|
41
|
+
- Files scanned: 7
|
|
42
|
+
- Stack observed: TypeScript, Node.js
|
|
43
|
+
- Findings: 12 (critical 0, high 3, medium 7, low 2, info 0)
|
|
44
|
+
|
|
45
|
+
## Scorecard
|
|
46
|
+
| Category | Rating |
|
|
47
|
+
|-----------------|--------------|
|
|
48
|
+
| Security | weak |
|
|
49
|
+
| Maintainability | adequate |
|
|
50
|
+
| Operability | adequate |
|
|
51
|
+
| Supply chain | adequate |
|
|
52
|
+
| Reliability | not assessed |
|
|
53
|
+
| Performance | not assessed |
|
|
54
|
+
| Cost | not assessed |
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
> **Why it matters.** Notice `not assessed`. A static scan cannot see traffic, incidents or your cloud bill, so it says so instead of guessing. A tool that scores everything is a tool that makes things up.
|
|
58
|
+
|
|
59
|
+
## Step 2. Open the report as a web page
|
|
60
|
+
|
|
61
|
+
Reports that people can open are reports that get read. Write the full set, Markdown and HTML:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npx archsutra-ai audit . --output arch-report
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
```text
|
|
68
|
+
index.html
|
|
69
|
+
current-state.md
|
|
70
|
+
current-state.html
|
|
71
|
+
audit-report.md
|
|
72
|
+
audit-report.html
|
|
73
|
+
findings.json
|
|
74
|
+
findings.sarif
|
|
75
|
+
architecture-register.json
|
|
76
|
+
Open index.html in a browser. Each report also has a Markdown file beside it.
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Open `arch-report/index.html`. You get severity cards, a filter by severity, and collapsible findings. Use the Markdown files in pull requests, the JSON in scripts, and the SARIF in GitHub code scanning.
|
|
80
|
+
|
|
81
|
+
```mermaid
|
|
82
|
+
flowchart LR
|
|
83
|
+
A["archsutra audit . --output arch-report"] --> H["audit-report.html<br/>for people"]
|
|
84
|
+
A --> M["audit-report.md<br/>for pull requests"]
|
|
85
|
+
A --> J["findings.json<br/>for scripts"]
|
|
86
|
+
A --> S["findings.sarif<br/>for code scanning"]
|
|
87
|
+
A --> C["current-state.html and .md<br/>maps and diagrams"]
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
> **Note.** `--output` must stay inside the project folder. That is a safety rule: the tool will not write outside the project you pointed it at.
|
|
91
|
+
|
|
92
|
+
## Step 3. Understand what you are looking at
|
|
93
|
+
|
|
94
|
+
Every finding has the same shape, so you can learn it once.
|
|
95
|
+
|
|
96
|
+

|
|
97
|
+
|
|
98
|
+
Read it top to bottom: **what** (title), **how bad** (severity), **how sure** (confidence), **where** (file and line), **so what** (impact), **now what** (fix), **how do I know** (verify and accept). If you cannot open the cited line and see the problem, treat the finding as wrong and tell us ([false-positive report](https://github.com/shahvatsalofficial/archsutra-ai/issues/new?template=false_positive.md)).
|
|
99
|
+
|
|
100
|
+
## Step 4. Add your AI IDE (optional, where the depth is)
|
|
101
|
+
|
|
102
|
+
The CLI gives evidence. Your IDE's own model adds judgment: why a design is risky, what to change first, what to design next. ArchSutra's skills tell the model how to do that without making things up.
|
|
103
|
+
|
|
104
|
+
Pick **one** host (several hosts read the same folders, so installing more than one duplicates skills):
|
|
105
|
+
|
|
106
|
+
| Your IDE | Command |
|
|
107
|
+
|---|---|
|
|
108
|
+
| Claude Code | `npx archsutra-ai install --host claude --target .` |
|
|
109
|
+
| Cursor | `npx archsutra-ai install --host cursor --target .` |
|
|
110
|
+
| OpenAI Codex | `npx archsutra-ai install --host codex --target .` |
|
|
111
|
+
| GitHub Copilot | `npx archsutra-ai install --host copilot --target .` |
|
|
112
|
+
| Gemini CLI | `npx archsutra-ai install --host gemini --target .` |
|
|
113
|
+
|
|
114
|
+
Preview first with `--dry-run`; undo any time with `uninstall`. Then ask:
|
|
115
|
+
|
|
116
|
+
> ArchSutra Prime: audit this repository's architecture. Establish what the code actually does first, then give findings with file and line evidence, severity and confidence, prioritized fixes and a phased roadmap. Stay read-only and label unknowns.
|
|
117
|
+
|
|
118
|
+
```mermaid
|
|
119
|
+
sequenceDiagram
|
|
120
|
+
participant You
|
|
121
|
+
participant IDE as Your AI IDE
|
|
122
|
+
participant Prime as ArchSutra Prime
|
|
123
|
+
participant CLI as archsutra CLI
|
|
124
|
+
You->>IDE: Ask for an architecture audit
|
|
125
|
+
IDE->>Prime: Loads the architecture-audit skill
|
|
126
|
+
Prime->>CLI: archsutra audit . --json
|
|
127
|
+
CLI-->>Prime: Evidence (offline, read-only)
|
|
128
|
+
Prime->>Prime: Opens each cited file and line, drops what it cannot reproduce
|
|
129
|
+
Prime-->>You: Report with evidence labels, roadmap and open questions
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
> **Warning.** Layouts for all five IDEs follow each vendor's documentation, but a live session in each has not been recorded yet. If a skill does not appear, run `archsutra doctor .` and tell us which IDE and version; we track it in the [smoke test log](../compatibility/smoke-tests/README.md).
|
|
133
|
+
|
|
134
|
+
## Step 5. Stop regressions in CI
|
|
135
|
+
|
|
136
|
+
Add one line to your pipeline so the same problems cannot come back:
|
|
137
|
+
|
|
138
|
+
```yaml
|
|
139
|
+
- run: npx --yes archsutra-ai audit . --fail-on high
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
The step passes when there are no high or critical findings and fails (exit code 1) when there are. On a codebase that already has findings, start with a baseline instead so only *new* problems fail the build; see [CI recipes](ci-recipes.md).
|
|
143
|
+
|
|
144
|
+
## If something goes wrong
|
|
145
|
+
|
|
146
|
+
| What you see | Why | Fix |
|
|
147
|
+
|---|---|---|
|
|
148
|
+
| "archsutra is not recognized" on Windows | Older version of the package | Use `npx archsutra-ai ...` with version 0.1.3 or newer |
|
|
149
|
+
| `--output must stay inside the project directory` | Safety rule | Use a relative folder such as `arch-report` |
|
|
150
|
+
| `Blocked: N conflicting file(s)` on install | A file already exists and was not installed by ArchSutra | Run with `--dry-run`, then `--force` (originals are backed up) |
|
|
151
|
+
| Skill not found in your IDE | Layout or version mismatch | `archsutra doctor .`, then open a smoke-test report |
|
|
152
|
+
| Report says TRUNCATED | Repository is larger than the scan limits | Audit a subfolder, or see [scan limits](../handbook/03-technical-specification.md) |
|
|
153
|
+
|
|
154
|
+
## Where to go next
|
|
155
|
+
|
|
156
|
+
- **New to the report?** [Reading and triaging a report](reading-a-report.md)
|
|
157
|
+
- **Want to see it used?** [Real-world scenarios](real-world-scenarios.md)
|
|
158
|
+
- **Curious how it works?** [How it works, in pictures](how-it-works.md)
|
|
159
|
+
- **Need a quick reference?** [Cheat sheet](cheat-sheet.md)
|
|
160
|
+
- **Do you trust the numbers?** [Evidence at a glance](evidence-at-a-glance.md)
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>How it works, in pictures | ArchSutra AI</title>
|
|
7
|
+
<meta name="description" content="Seven diagrams that explain ArchSutra end to end: the pipeline, the three layers, evidence labels, a scan from the inside, how scores are decided, the install lifecycle and the trust boundaries.">
|
|
8
|
+
<link rel="canonical" href="https://shahvatsalofficial.github.io/archsutra-ai/guides/how-it-works.html">
|
|
9
|
+
<meta name="color-scheme" content="light dark">
|
|
10
|
+
<meta name="theme-color" content="#ffffff">
|
|
11
|
+
<meta property="og:type" content="article">
|
|
12
|
+
<meta property="og:title" content="How it works, in pictures | ArchSutra AI">
|
|
13
|
+
<meta property="og:description" content="Seven diagrams that explain ArchSutra end to end: the pipeline, the three layers, evidence labels, a scan from the inside, how scores are decided, the install lifecycle and the trust boundaries.">
|
|
14
|
+
<meta property="og:url" content="https://shahvatsalofficial.github.io/archsutra-ai/guides/how-it-works.html">
|
|
15
|
+
<meta property="og:site_name" content="ArchSutra AI">
|
|
16
|
+
<meta name="twitter:card" content="summary">
|
|
17
|
+
<meta name="twitter:title" content="How it works, in pictures | ArchSutra AI">
|
|
18
|
+
<meta name="twitter:description" content="Seven diagrams that explain ArchSutra end to end: the pipeline, the three layers, evidence labels, a scan from the inside, how scores are decided, the install lifecycle and the trust boundaries.">
|
|
19
|
+
<meta name="author" content="Vatsal Shah">
|
|
20
|
+
<link rel="icon" href="../assets/favicon.svg" type="image/svg+xml">
|
|
21
|
+
<link rel="stylesheet" href="../assets/site.css">
|
|
22
|
+
<script>try{if(localStorage.getItem('as-theme')==='dark')document.documentElement.setAttribute('data-theme','dark')}catch(e){}</script>
|
|
23
|
+
<script type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"How it works, in pictures","description":"Seven diagrams that explain ArchSutra end to end: the pipeline, the three layers, evidence labels, a scan from the inside, how scores are decided, the install lifecycle and the trust boundaries.","author":{"@type":"Person","name":"Vatsal Shah","url":"https://shahvatsal.com"},"inLanguage":"en","isPartOf":{"@type":"WebSite","name":"ArchSutra AI","url":"https://shahvatsalofficial.github.io/archsutra-ai"}}</script>
|
|
24
|
+
</head>
|
|
25
|
+
<body class="doc" data-root="../">
|
|
26
|
+
<a class="skip" href="#main">Skip to content</a>
|
|
27
|
+
<header class="topbar">
|
|
28
|
+
<div class="topbar-inner">
|
|
29
|
+
<a class="brand" href="../index.html" aria-label="ArchSutra AI home"><svg viewBox="0 0 32 32" aria-hidden="true"><rect width="32" height="32" rx="9" fill="currentColor" opacity=".14"/><path d="M6 24 16 7l10 17M10.5 18h11" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg><span>ArchSutra <b>AI</b></span></a>
|
|
30
|
+
<nav class="top-links" aria-label="Primary"><a href="../guides/getting-started.html">Get started</a><a href="../guides/real-world-scenarios.html">Scenarios</a><a href="../handbook/index.html">Handbook</a><a href="../guides/evidence-at-a-glance.html">Proof</a></nav>
|
|
31
|
+
<span class="spacer"></span>
|
|
32
|
+
<div class="search" role="search"><label class="sr-only" for="q">Search the documentation</label><input id="q" type="search" placeholder="Search docs ( / )" autocomplete="off" aria-controls="results" aria-expanded="false"><ul id="results" class="results" role="listbox" hidden></ul></div>
|
|
33
|
+
<a class="gh-btn" href="https://github.com/shahvatsalofficial/archsutra-ai" rel="noopener"><svg class="icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M9 19c-4.3 1.4-4.3-2.5-6-3m12 5v-3.5c0-1 .1-1.4-.5-2 2.8-.3 5.5-1.4 5.5-6a4.6 4.6 0 0 0-1.3-3.2 4.2 4.2 0 0 0-.1-3.2s-1.1-.3-3.5 1.3a12 12 0 0 0-6.2 0C6.5 2.8 5.4 3.1 5.4 3.1a4.2 4.2 0 0 0-.1 3.2A4.6 4.6 0 0 0 4 9.5c0 4.6 2.7 5.7 5.5 6-.6.6-.6 1.2-.5 2V21"/></svg><span>GitHub</span></a>
|
|
34
|
+
<button class="icon-btn theme-btn" type="button" aria-label="Switch between light and dark theme"><span class="sun"><svg class="icon" viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg></span><span class="moon"><svg class="icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/></svg></span></button>
|
|
35
|
+
<button class="icon-btn menu-btn" type="button" aria-label="Open menu" aria-expanded="false" aria-controls="drawer"><svg class="icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M4 7h16M4 12h16M4 17h16"/></svg></button>
|
|
36
|
+
</div>
|
|
37
|
+
</header>
|
|
38
|
+
<div id="drawer" class="drawer" aria-hidden="true">
|
|
39
|
+
<div class="drawer-scrim" data-close></div>
|
|
40
|
+
<div class="drawer-panel" role="dialog" aria-label="Menu">
|
|
41
|
+
<div class="drawer-head"><a class="brand" href="../index.html"><svg viewBox="0 0 32 32" aria-hidden="true"><rect width="32" height="32" rx="9" fill="currentColor" opacity=".14"/><path d="M6 24 16 7l10 17M10.5 18h11" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg><span>ArchSutra <b>AI</b></span></a><button class="icon-btn" type="button" data-close aria-label="Close menu"><svg class="icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M6 6l12 12M18 6 6 18"/></svg></button></div>
|
|
42
|
+
<div class="primary-links"><a href="../index.html">Home</a><a href="../guides/getting-started.html">Get started</a><a href="../guides/real-world-scenarios.html">Scenarios</a><a href="../handbook/index.html">Handbook</a><a href="../guides/evidence-at-a-glance.html">Proof</a><a href="https://github.com/shahvatsalofficial/archsutra-ai" rel="noopener">GitHub</a></div>
|
|
43
|
+
<div class="nav-group"><p class="nav-title">Start here</p><ul><li><a href="../guides/getting-started.html">Get started in 5 minutes</a></li><li><a href="../guides/real-world-scenarios.html">Real-world scenarios</a></li><li><a href="../guides/how-it-works.html" aria-current="page">How it works, in pictures</a></li><li><a href="../guides/reading-a-report.html">Reading and triaging a report</a></li><li><a href="../guides/ci-recipes.html">CI recipes</a></li><li><a href="../guides/mcp-server.html">Use ArchSutra as an MCP server</a></li><li><a href="../guides/cheat-sheet.html">Cheat sheet</a></li><li><a href="../guides/evidence-at-a-glance.html">Evidence at a glance</a></li></ul></div><div class="nav-group"><p class="nav-title">Handbook</p><ul><li><a href="../handbook/index.html">Overview</a></li><li><a href="../handbook/01-executive-summary.html">Executive summary</a></li><li><a href="../handbook/02-functional-specification.html">Functional specification</a></li><li><a href="../handbook/03-technical-specification.html">Technical specification</a></li><li><a href="../handbook/04-architecture.html">Architecture</a></li><li><a href="../handbook/05-user-guide.html">User guide</a></li><li><a href="../handbook/06-cli-reference.html">CLI reference</a></li><li><a href="../handbook/07-security-privacy-legal.html">Security, privacy and legal</a></li><li><a href="../handbook/08-testing-and-proof.html">Testing and proof</a></li><li><a href="../handbook/09-compatibility-and-roadmap.html">Compatibility and roadmap</a></li><li><a href="../handbook/10-contributor-guide.html">Contributor guide</a></li><li><a href="../handbook/11-glossary-and-faq.html">Glossary and FAQ</a></li><li><a href="../handbook/12-rule-catalog.html">Audit rule catalog</a></li><li><a href="../handbook/13-trust-and-assurance.html">Trust and assurance</a></li><li><a href="../handbook/14-real-world-evaluation.html">Real-world evaluation</a></li><li><a href="../handbook/15-supply-chain-and-release.html">Supply chain and release</a></li><li><a href="../handbook/16-performance-and-quality-metrics.html">Performance and quality metrics</a></li></ul></div><div class="nav-group"><p class="nav-title">Reference</p><ul><li><a href="../architecture/overview.html">Architecture overview</a></li><li><a href="../architecture/threat-model.html">Threat model (ArchSutra CLI and skills)</a></li><li><a href="../compatibility/matrix.html">Compatibility matrix</a></li><li><a href="../rfc/0001-archsutra-v0.1.html">RFC 0001: ArchSutra AI v0.1</a></li><li><a href="../decisions/ADR-0001-deterministic-cli-plus-ide-skills.html">ADR-0001: Deterministic CLI plus IDE-native skills</a></li><li><a href="../compatibility/smoke-tests/index.html">Live smoke tests</a></li><li><a href="../community/good-first-issues.html">Good first issues (ready to file)</a></li><li><a href="../legal/trademark-and-name-clearance.html">Name and trademark clearance</a></li><li><a href="../legal/legal-review-brief.html">Legal review brief</a></li><li><a href="../proof/accessibility.html">Accessibility audit of the documentation site</a></li></ul></div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="layout">
|
|
47
|
+
<aside id="sidebar" class="sidebar" aria-label="Documentation"><div class="nav-group"><p class="nav-title">Start here</p><ul><li><a href="../guides/getting-started.html">Get started in 5 minutes</a></li><li><a href="../guides/real-world-scenarios.html">Real-world scenarios</a></li><li><a href="../guides/how-it-works.html" aria-current="page">How it works, in pictures</a></li><li><a href="../guides/reading-a-report.html">Reading and triaging a report</a></li><li><a href="../guides/ci-recipes.html">CI recipes</a></li><li><a href="../guides/mcp-server.html">Use ArchSutra as an MCP server</a></li><li><a href="../guides/cheat-sheet.html">Cheat sheet</a></li><li><a href="../guides/evidence-at-a-glance.html">Evidence at a glance</a></li></ul></div><div class="nav-group"><p class="nav-title">Handbook</p><ul><li><a href="../handbook/index.html">Overview</a></li><li><a href="../handbook/01-executive-summary.html">Executive summary</a></li><li><a href="../handbook/02-functional-specification.html">Functional specification</a></li><li><a href="../handbook/03-technical-specification.html">Technical specification</a></li><li><a href="../handbook/04-architecture.html">Architecture</a></li><li><a href="../handbook/05-user-guide.html">User guide</a></li><li><a href="../handbook/06-cli-reference.html">CLI reference</a></li><li><a href="../handbook/07-security-privacy-legal.html">Security, privacy and legal</a></li><li><a href="../handbook/08-testing-and-proof.html">Testing and proof</a></li><li><a href="../handbook/09-compatibility-and-roadmap.html">Compatibility and roadmap</a></li><li><a href="../handbook/10-contributor-guide.html">Contributor guide</a></li><li><a href="../handbook/11-glossary-and-faq.html">Glossary and FAQ</a></li><li><a href="../handbook/12-rule-catalog.html">Audit rule catalog</a></li><li><a href="../handbook/13-trust-and-assurance.html">Trust and assurance</a></li><li><a href="../handbook/14-real-world-evaluation.html">Real-world evaluation</a></li><li><a href="../handbook/15-supply-chain-and-release.html">Supply chain and release</a></li><li><a href="../handbook/16-performance-and-quality-metrics.html">Performance and quality metrics</a></li></ul></div><div class="nav-group"><p class="nav-title">Reference</p><ul><li><a href="../architecture/overview.html">Architecture overview</a></li><li><a href="../architecture/threat-model.html">Threat model (ArchSutra CLI and skills)</a></li><li><a href="../compatibility/matrix.html">Compatibility matrix</a></li><li><a href="../rfc/0001-archsutra-v0.1.html">RFC 0001: ArchSutra AI v0.1</a></li><li><a href="../decisions/ADR-0001-deterministic-cli-plus-ide-skills.html">ADR-0001: Deterministic CLI plus IDE-native skills</a></li><li><a href="../compatibility/smoke-tests/index.html">Live smoke tests</a></li><li><a href="../community/good-first-issues.html">Good first issues (ready to file)</a></li><li><a href="../legal/trademark-and-name-clearance.html">Name and trademark clearance</a></li><li><a href="../legal/legal-review-brief.html">Legal review brief</a></li><li><a href="../proof/accessibility.html">Accessibility audit of the documentation site</a></li></ul></div></aside>
|
|
48
|
+
<main id="main" class="content"><article class="prose"><p class="crumbs"><a href="../index.html">ArchSutra AI</a> / Start here</p><h1 id="how-it-works-in-pictures">How it works, in pictures</h1>
|
|
49
|
+
<p class="lede">Seven diagrams that explain ArchSutra end to end: the pipeline, the three layers, evidence labels, a scan from the inside, how scores are decided, the install lifecycle and the trust boundaries.</p><p class="meta">Version 0.2.0 · Source: <a href="https://github.com/shahvatsalofficial/archsutra-ai/blob/main/docs/guides/how-it-works.md" rel="noopener">docs/guides/how-it-works.md</a></p>
|
|
50
|
+
<p>You can use ArchSutra without reading this page. Read it when you want to know <em>why</em> the output looks the way it does and <em>how far to trust it</em>. Each picture answers one question.</p>
|
|
51
|
+
<h2 id="1-the-big-picture-who-does-what">1. The big picture: who does what?<a class="anchor" href="#1-the-big-picture-who-does-what" aria-label="Link to this section">#</a></h2>
|
|
52
|
+
<figure class="figure"><img class="theme-light" src="../assets/charts/pipeline.svg" alt="ArchSutra pipeline: your repository is scanned read-only by the CLI, which produces evidence; your IDE model, guided by ArchSutra skills, verifies the evidence and writes the report" loading="lazy"><img class="theme-dark" src="../assets/charts/pipeline-dark.svg" alt="ArchSutra pipeline: your repository is scanned read-only by the CLI, which produces evidence; your IDE model, guided by ArchSutra skills, verifies the evidence and writes the report" loading="lazy"><figcaption>ArchSutra pipeline: your repository is scanned read-only by the CLI, which produces evidence; your IDE model, guided by ArchSutra skills, verifies the evidence and writes the report</figcaption></figure>
|
|
53
|
+
<p>Two parts, two jobs:</p>
|
|
54
|
+
<ul><li>The <strong>CLI</strong> is a measuring tool. It always gives the same answer for the same input, runs offline and never calls a model. That makes it testable and safe in CI.</li><li>The <strong>skills and agents</strong> are a method for your IDE's model. They stop the model from guessing and make it check its own work.</li></ul>
|
|
55
|
+
<p>Neither needs an ArchSutra account or key.</p>
|
|
56
|
+
<h2 id="2-three-layers-three-kinds-of-trust">2. Three layers, three kinds of trust<a class="anchor" href="#2-three-layers-three-kinds-of-trust" aria-label="Link to this section">#</a></h2>
|
|
57
|
+
<figure class="diagram"><pre class="mermaid">flowchart TB
|
|
58
|
+
subgraph L1["Layer 1: Evidence (deterministic)"]
|
|
59
|
+
direction LR
|
|
60
|
+
w["Walk files<br/>bounded, no symlinks"] --> m["Map modules<br/>and imports"] --> r["Apply 30 rules<br/>with redaction"]
|
|
61
|
+
end
|
|
62
|
+
subgraph L2["Layer 2: Reasoning (your IDE model)"]
|
|
63
|
+
direction LR
|
|
64
|
+
v["Verify each finding<br/>at file and line"] --> j["Judge impact<br/>and trade-offs"] --> p["Plan: roadmap,<br/>ADRs, designs"]
|
|
65
|
+
end
|
|
66
|
+
subgraph L3["Layer 3: Delivery"]
|
|
67
|
+
direction LR
|
|
68
|
+
h["HTML for people"] --- md["Markdown for PRs"] --- js["JSON and SARIF<br/>for tools"]
|
|
69
|
+
end
|
|
70
|
+
L1 --> L2 --> L3</pre><figcaption>Diagram (Mermaid). If it does not render, the source is shown above.</figcaption></figure>
|
|
71
|
+
<p>How much to trust each layer:</p>
|
|
72
|
+
<div class="table-wrap" tabindex="0" role="region" aria-label="Table 1: 2. Three layers, three kinds of trust"><table><thead><tr><th scope="col">Layer</th><th scope="col">Reproducible?</th><th scope="col">Can be wrong?</th><th scope="col">How we limit that</th></tr></thead><tbody><tr><td>1. Evidence</td><td>Yes, byte for byte</td><td>Yes, rules are heuristics</td><td>Measured on real repositories; every finding lists caveats</td></tr><tr><td>2. Reasoning</td><td>No, models vary</td><td>Yes</td><td>Skills require citing evidence and labeling claims</td></tr><tr><td>3. Delivery</td><td>Yes</td><td>Only if layers 1 or 2 were</td><td>Escaped output; sources linked</td></tr></tbody></table></div>
|
|
73
|
+
<h2 id="3-every-claim-wears-a-label">3. Every claim wears a label<a class="anchor" href="#3-every-claim-wears-a-label" aria-label="Link to this section">#</a></h2>
|
|
74
|
+
<figure class="diagram"><pre class="mermaid">flowchart TD
|
|
75
|
+
c(["A claim in a report"]) --> q1{"Did the tool or reviewer<br/>see it in a file?"}
|
|
76
|
+
q1 -- Yes --> obs["observed<br/>cites path and line"]
|
|
77
|
+
q1 -- No --> q2{"Derived from observed facts<br/>by reasoning?"}
|
|
78
|
+
q2 -- Yes --> inf["inferred<br/>says what it was derived from"]
|
|
79
|
+
q2 -- No --> q3{"A recommendation<br/>for the future?"}
|
|
80
|
+
q3 -- Yes --> prop["proposed"]
|
|
81
|
+
q3 -- No --> unk["unknown<br/>and what would settle it"]</pre><figcaption>Diagram (Mermaid). If it does not render, the source is shown above.</figcaption></figure>
|
|
82
|
+
<blockquote class="callout callout-why-it-matters"><strong>Why it matters.</strong> Most bad architecture advice is a guess presented as a fact. Labels let you see the difference at a glance, and they let a reviewer challenge exactly the part that is shaky.</blockquote>
|
|
83
|
+
<h2 id="4-a-scan-from-the-inside">4. A scan from the inside<a class="anchor" href="#4-a-scan-from-the-inside" aria-label="Link to this section">#</a></h2>
|
|
84
|
+
<figure class="diagram"><pre class="mermaid">sequenceDiagram
|
|
85
|
+
participant U as You or CI
|
|
86
|
+
participant C as archsutra CLI
|
|
87
|
+
participant F as File walker
|
|
88
|
+
participant M as Mapper
|
|
89
|
+
participant R as Rules
|
|
90
|
+
participant O as Output
|
|
91
|
+
U->>C: archsutra audit . --output report
|
|
92
|
+
C->>F: Walk with limits (5000 files, 512 KiB each, 120 MiB total)
|
|
93
|
+
F-->>C: Files (symlinks skipped, truncation flagged)
|
|
94
|
+
C->>M: Build module graph from imports
|
|
95
|
+
M-->>C: Modules, edges, cycles
|
|
96
|
+
C->>R: Run 30 rules (comments, tests, vendored code masked)
|
|
97
|
+
R-->>C: Findings with redacted excerpts
|
|
98
|
+
C->>C: Apply .archsutra/suppress.json (needs a reason)
|
|
99
|
+
C->>O: Write HTML, Markdown, JSON, SARIF
|
|
100
|
+
O-->>U: Exit code 0, or 1 if --fail-on is met</pre><figcaption>Diagram (Mermaid). If it does not render, the source is shown above.</figcaption></figure>
|
|
101
|
+
<p>Three details worth knowing:</p>
|
|
102
|
+
<ul><li><strong>Limits are always reported.</strong> If a repository is too big, the report says TRUNCATED. It never silently scans half.</li><li><strong>Noise is filtered before you see it.</strong> Comments, docstrings, test files, vendored libraries, minified bundles and dummy values are ignored. That is what raised measured precision from 50% to 69% and 95% (<a href="evidence-at-a-glance.html">evidence</a>).</li><li><strong>Suppression needs a reason.</strong> A row without a reason in <code>.archsutra/suppress.json</code> is ignored, and expired rows stop applying.</li></ul>
|
|
103
|
+
<h2 id="5-how-a-rating-is-decided">5. How a rating is decided<a class="anchor" href="#5-how-a-rating-is-decided" aria-label="Link to this section">#</a></h2>
|
|
104
|
+
<figure class="diagram"><pre class="mermaid">flowchart TD
|
|
105
|
+
cat(["A scorecard category,<br/>for example Security"]) --> e{"Is there evidence<br/>this tool can see?"}
|
|
106
|
+
e -- No --> na["not assessed"]
|
|
107
|
+
e -- Yes --> c1{"Any critical finding?"}
|
|
108
|
+
c1 -- Yes --> crit["critical"]
|
|
109
|
+
c1 -- No --> c2{"Any high finding?"}
|
|
110
|
+
c2 -- Yes --> weak["weak"]
|
|
111
|
+
c2 -- No --> c3{"Any medium finding?"}
|
|
112
|
+
c3 -- Yes --> adq["adequate"]
|
|
113
|
+
c3 -- No --> strong["no findings<br/>(from the rules we have)"]</pre><figcaption>Diagram (Mermaid). If it does not render, the source is shown above.</figcaption></figure>
|
|
114
|
+
<p>Reliability, performance, scalability, data integrity and cost are <strong>always</strong> <code>not assessed</code> from a static scan: they need traffic, incidents, data volumes or billing. A <code>no findings</code> rating means "no findings from these 30 rules", which is not the same as "no problems".</p>
|
|
115
|
+
<h2 id="6-install-lifecycle-safe-reversible-never-destructive">6. Install lifecycle: safe, reversible, never destructive<a class="anchor" href="#6-install-lifecycle-safe-reversible-never-destructive" aria-label="Link to this section">#</a></h2>
|
|
116
|
+
<figure class="diagram"><pre class="mermaid">stateDiagram-v2
|
|
117
|
+
[*] --> Planned: install --dry-run
|
|
118
|
+
Planned --> Installed: install (writes files and a SHA-256 manifest)
|
|
119
|
+
Planned --> Blocked: a file exists that we did not install
|
|
120
|
+
Blocked --> Installed: install --force (originals backed up)
|
|
121
|
+
Installed --> Modified: you edit an installed file
|
|
122
|
+
Modified --> Installed: install --force (backup kept)
|
|
123
|
+
Installed --> Removed: uninstall
|
|
124
|
+
Modified --> Removed: uninstall (your edited file is kept)
|
|
125
|
+
Removed --> [*]</pre><figcaption>Diagram (Mermaid). If it does not render, the source is shown above.</figcaption></figure>
|
|
126
|
+
<p>The manifest at <code>.archsutra/install-manifest.json</code> records a hash of every file it wrote. <code>uninstall</code> deletes a file only if its hash still matches, so your edits are never lost.</p>
|
|
127
|
+
<h2 id="7-trust-boundaries-what-can-touch-what">7. Trust boundaries: what can touch what<a class="anchor" href="#7-trust-boundaries-what-can-touch-what" aria-label="Link to this section">#</a></h2>
|
|
128
|
+
<figure class="diagram"><pre class="mermaid">flowchart LR
|
|
129
|
+
subgraph U["Untrusted"]
|
|
130
|
+
repo["Your repository content<br/>(code, comments, READMEs)"]
|
|
131
|
+
end
|
|
132
|
+
subgraph T["Trusted and hashed"]
|
|
133
|
+
skills["ArchSutra skills and agents"]
|
|
134
|
+
end
|
|
135
|
+
subgraph P["Local process"]
|
|
136
|
+
cli["archsutra CLI"]
|
|
137
|
+
end
|
|
138
|
+
repo -->|"read only, bounded"| cli
|
|
139
|
+
cli -->|"writes only inside the project"| out["Reports and installed files"]
|
|
140
|
+
skills --> ide["Your IDE model"]
|
|
141
|
+
repo -. "may contain text aimed at an AI" .-> ide
|
|
142
|
+
ide -->|"read-only tools by default"| repo</pre><figcaption>Diagram (Mermaid). If it does not render, the source is shown above.</figcaption></figure>
|
|
143
|
+
<p>The dotted line is the real risk: text inside a repository can try to instruct an AI. ArchSutra's answer is layered: skills declare repository content to be data, agents get read-only tools, and the CLI never executes anything it reads. Residual risk is documented in the <a href="../architecture/threat-model.html">threat model</a>.</p>
|
|
144
|
+
<h2 id="keep-going">Keep going<a class="anchor" href="#keep-going" aria-label="Link to this section">#</a></h2>
|
|
145
|
+
<ul><li>Use it on something real: <a href="real-world-scenarios.html">Real-world scenarios</a></li><li>The full reasoning behind the design: <a href="../handbook/04-architecture.html">Architecture</a></li><li>Every rule: <a href="../handbook/12-rule-catalog.html">Rule catalog</a></li></ul></article><nav class="pn" aria-label="Previous and next page"><a class="prev" href="real-world-scenarios.html"><small>Previous</small><span>Real-world scenarios</span></a><a class="next" href="reading-a-report.html"><small>Next</small><span>Reading and triaging a report</span></a></nav><p class="edit"><a href="https://github.com/shahvatsalofficial/archsutra-ai/edit/main/docs/guides/how-it-works.md" rel="noopener">Edit this page on GitHub</a></p></main>
|
|
146
|
+
<aside class="rail"><nav class="toc" aria-label="On this page"><p class="nav-title">On this page</p><ul><li class="l2"><a href="#1-the-big-picture-who-does-what">1. The big picture: who does what?</a></li><li class="l2"><a href="#2-three-layers-three-kinds-of-trust">2. Three layers, three kinds of trust</a></li><li class="l2"><a href="#3-every-claim-wears-a-label">3. Every claim wears a label</a></li><li class="l2"><a href="#4-a-scan-from-the-inside">4. A scan from the inside</a></li><li class="l2"><a href="#5-how-a-rating-is-decided">5. How a rating is decided</a></li><li class="l2"><a href="#6-install-lifecycle-safe-reversible-never-destructive">6. Install lifecycle: safe, reversible, never destructive</a></li><li class="l2"><a href="#7-trust-boundaries-what-can-touch-what">7. Trust boundaries: what can touch what</a></li><li class="l2"><a href="#keep-going">Keep going</a></li></ul></nav></aside>
|
|
147
|
+
</div>
|
|
148
|
+
<footer class="footer">
|
|
149
|
+
<div class="footer-inner">
|
|
150
|
+
<div class="footer-grid">
|
|
151
|
+
<div class="about-col"><a class="brand" href="../index.html"><svg viewBox="0 0 32 32" aria-hidden="true"><rect width="32" height="32" rx="9" fill="currentColor" opacity=".14"/><path d="M6 24 16 7l10 17M10.5 18h11" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg><span>ArchSutra <b>AI</b></span></a><p class="about">Design. Audit. Evolve. An open-source, evidence-first software architecture agent. Created by <a href="https://shahvatsal.com" rel="noopener">Vatsal Shah</a>. Apache-2.0.</p></div>
|
|
152
|
+
<div><h4>Learn</h4><ul><li><a href="../guides/getting-started.html">Get started</a></li><li><a href="../guides/real-world-scenarios.html">Real-world scenarios</a></li><li><a href="../guides/how-it-works.html">How it works</a></li><li><a href="../guides/cheat-sheet.html">Cheat sheet</a></li></ul></div>
|
|
153
|
+
<div><h4>Trust</h4><ul><li><a href="../guides/evidence-at-a-glance.html">Evidence at a glance</a></li><li><a href="../handbook/13-trust-and-assurance.html">Honesty register</a></li><li><a href="../handbook/07-security-privacy-legal.html">Security and legal</a></li><li><a href="../handbook/15-supply-chain-and-release.html">Supply chain</a></li></ul></div>
|
|
154
|
+
<div><h4>Project</h4><ul><li><a href="https://github.com/shahvatsalofficial/archsutra-ai" rel="noopener">GitHub</a></li><li><a href="https://www.npmjs.com/package/archsutra-ai" rel="noopener">npm</a></li><li><a href="../handbook/10-contributor-guide.html">Contribute</a></li><li><a href="https://github.com/shahvatsalofficial/archsutra-ai/blob/main/CHANGELOG.md" rel="noopener">Changelog</a></li></ul></div>
|
|
155
|
+
</div>
|
|
156
|
+
<p class="fine">v0.2.0. Review aid only. Not a certification, compliance attestation, security guarantee or legal advice. Not affiliated with Anthropic, OpenAI, Cursor, GitHub or Google; product names belong to their owners. <a href="../handbook/07-security-privacy-legal.html">Legal details</a>.</p>
|
|
157
|
+
</div>
|
|
158
|
+
</footer>
|
|
159
|
+
<script src="../assets/site.js" type="module"></script>
|
|
160
|
+
</body>
|
|
161
|
+
</html>
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# How it works, in pictures
|
|
2
|
+
|
|
3
|
+
<!-- summary: Seven diagrams that explain ArchSutra end to end: the pipeline, the three layers, evidence labels, a scan from the inside, how scores are decided, the install lifecycle and the trust boundaries. -->
|
|
4
|
+
|
|
5
|
+
You can use ArchSutra without reading this page. Read it when you want to know *why* the output looks the way it does and *how far to trust it*. Each picture answers one question.
|
|
6
|
+
|
|
7
|
+
## 1. The big picture: who does what?
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
Two parts, two jobs:
|
|
12
|
+
|
|
13
|
+
- The **CLI** is a measuring tool. It always gives the same answer for the same input, runs offline and never calls a model. That makes it testable and safe in CI.
|
|
14
|
+
- The **skills and agents** are a method for your IDE's model. They stop the model from guessing and make it check its own work.
|
|
15
|
+
|
|
16
|
+
Neither needs an ArchSutra account or key.
|
|
17
|
+
|
|
18
|
+
## 2. Three layers, three kinds of trust
|
|
19
|
+
|
|
20
|
+
```mermaid
|
|
21
|
+
flowchart TB
|
|
22
|
+
subgraph L1["Layer 1: Evidence (deterministic)"]
|
|
23
|
+
direction LR
|
|
24
|
+
w["Walk files<br/>bounded, no symlinks"] --> m["Map modules<br/>and imports"] --> r["Apply 30 rules<br/>with redaction"]
|
|
25
|
+
end
|
|
26
|
+
subgraph L2["Layer 2: Reasoning (your IDE model)"]
|
|
27
|
+
direction LR
|
|
28
|
+
v["Verify each finding<br/>at file and line"] --> j["Judge impact<br/>and trade-offs"] --> p["Plan: roadmap,<br/>ADRs, designs"]
|
|
29
|
+
end
|
|
30
|
+
subgraph L3["Layer 3: Delivery"]
|
|
31
|
+
direction LR
|
|
32
|
+
h["HTML for people"] --- md["Markdown for PRs"] --- js["JSON and SARIF<br/>for tools"]
|
|
33
|
+
end
|
|
34
|
+
L1 --> L2 --> L3
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
How much to trust each layer:
|
|
38
|
+
|
|
39
|
+
| Layer | Reproducible? | Can be wrong? | How we limit that |
|
|
40
|
+
|---|---|---|---|
|
|
41
|
+
| 1. Evidence | Yes, byte for byte | Yes, rules are heuristics | Measured on real repositories; every finding lists caveats |
|
|
42
|
+
| 2. Reasoning | No, models vary | Yes | Skills require citing evidence and labeling claims |
|
|
43
|
+
| 3. Delivery | Yes | Only if layers 1 or 2 were | Escaped output; sources linked |
|
|
44
|
+
|
|
45
|
+
## 3. Every claim wears a label
|
|
46
|
+
|
|
47
|
+
```mermaid
|
|
48
|
+
flowchart TD
|
|
49
|
+
c(["A claim in a report"]) --> q1{"Did the tool or reviewer<br/>see it in a file?"}
|
|
50
|
+
q1 -- Yes --> obs["observed<br/>cites path and line"]
|
|
51
|
+
q1 -- No --> q2{"Derived from observed facts<br/>by reasoning?"}
|
|
52
|
+
q2 -- Yes --> inf["inferred<br/>says what it was derived from"]
|
|
53
|
+
q2 -- No --> q3{"A recommendation<br/>for the future?"}
|
|
54
|
+
q3 -- Yes --> prop["proposed"]
|
|
55
|
+
q3 -- No --> unk["unknown<br/>and what would settle it"]
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
> **Why it matters.** Most bad architecture advice is a guess presented as a fact. Labels let you see the difference at a glance, and they let a reviewer challenge exactly the part that is shaky.
|
|
59
|
+
|
|
60
|
+
## 4. A scan from the inside
|
|
61
|
+
|
|
62
|
+
```mermaid
|
|
63
|
+
sequenceDiagram
|
|
64
|
+
participant U as You or CI
|
|
65
|
+
participant C as archsutra CLI
|
|
66
|
+
participant F as File walker
|
|
67
|
+
participant M as Mapper
|
|
68
|
+
participant R as Rules
|
|
69
|
+
participant O as Output
|
|
70
|
+
U->>C: archsutra audit . --output report
|
|
71
|
+
C->>F: Walk with limits (5000 files, 512 KiB each, 120 MiB total)
|
|
72
|
+
F-->>C: Files (symlinks skipped, truncation flagged)
|
|
73
|
+
C->>M: Build module graph from imports
|
|
74
|
+
M-->>C: Modules, edges, cycles
|
|
75
|
+
C->>R: Run 30 rules (comments, tests, vendored code masked)
|
|
76
|
+
R-->>C: Findings with redacted excerpts
|
|
77
|
+
C->>C: Apply .archsutra/suppress.json (needs a reason)
|
|
78
|
+
C->>O: Write HTML, Markdown, JSON, SARIF
|
|
79
|
+
O-->>U: Exit code 0, or 1 if --fail-on is met
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Three details worth knowing:
|
|
83
|
+
|
|
84
|
+
- **Limits are always reported.** If a repository is too big, the report says TRUNCATED. It never silently scans half.
|
|
85
|
+
- **Noise is filtered before you see it.** Comments, docstrings, test files, vendored libraries, minified bundles and dummy values are ignored. That is what raised measured precision from 50% to 69% and 95% ([evidence](evidence-at-a-glance.md)).
|
|
86
|
+
- **Suppression needs a reason.** A row without a reason in `.archsutra/suppress.json` is ignored, and expired rows stop applying.
|
|
87
|
+
|
|
88
|
+
## 5. How a rating is decided
|
|
89
|
+
|
|
90
|
+
```mermaid
|
|
91
|
+
flowchart TD
|
|
92
|
+
cat(["A scorecard category,<br/>for example Security"]) --> e{"Is there evidence<br/>this tool can see?"}
|
|
93
|
+
e -- No --> na["not assessed"]
|
|
94
|
+
e -- Yes --> c1{"Any critical finding?"}
|
|
95
|
+
c1 -- Yes --> crit["critical"]
|
|
96
|
+
c1 -- No --> c2{"Any high finding?"}
|
|
97
|
+
c2 -- Yes --> weak["weak"]
|
|
98
|
+
c2 -- No --> c3{"Any medium finding?"}
|
|
99
|
+
c3 -- Yes --> adq["adequate"]
|
|
100
|
+
c3 -- No --> strong["no findings<br/>(from the rules we have)"]
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Reliability, performance, scalability, data integrity and cost are **always** `not assessed` from a static scan: they need traffic, incidents, data volumes or billing. A `no findings` rating means "no findings from these 30 rules", which is not the same as "no problems".
|
|
104
|
+
|
|
105
|
+
## 6. Install lifecycle: safe, reversible, never destructive
|
|
106
|
+
|
|
107
|
+
```mermaid
|
|
108
|
+
stateDiagram-v2
|
|
109
|
+
[*] --> Planned: install --dry-run
|
|
110
|
+
Planned --> Installed: install (writes files and a SHA-256 manifest)
|
|
111
|
+
Planned --> Blocked: a file exists that we did not install
|
|
112
|
+
Blocked --> Installed: install --force (originals backed up)
|
|
113
|
+
Installed --> Modified: you edit an installed file
|
|
114
|
+
Modified --> Installed: install --force (backup kept)
|
|
115
|
+
Installed --> Removed: uninstall
|
|
116
|
+
Modified --> Removed: uninstall (your edited file is kept)
|
|
117
|
+
Removed --> [*]
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
The manifest at `.archsutra/install-manifest.json` records a hash of every file it wrote. `uninstall` deletes a file only if its hash still matches, so your edits are never lost.
|
|
121
|
+
|
|
122
|
+
## 7. Trust boundaries: what can touch what
|
|
123
|
+
|
|
124
|
+
```mermaid
|
|
125
|
+
flowchart LR
|
|
126
|
+
subgraph U["Untrusted"]
|
|
127
|
+
repo["Your repository content<br/>(code, comments, READMEs)"]
|
|
128
|
+
end
|
|
129
|
+
subgraph T["Trusted and hashed"]
|
|
130
|
+
skills["ArchSutra skills and agents"]
|
|
131
|
+
end
|
|
132
|
+
subgraph P["Local process"]
|
|
133
|
+
cli["archsutra CLI"]
|
|
134
|
+
end
|
|
135
|
+
repo -->|"read only, bounded"| cli
|
|
136
|
+
cli -->|"writes only inside the project"| out["Reports and installed files"]
|
|
137
|
+
skills --> ide["Your IDE model"]
|
|
138
|
+
repo -. "may contain text aimed at an AI" .-> ide
|
|
139
|
+
ide -->|"read-only tools by default"| repo
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
The dotted line is the real risk: text inside a repository can try to instruct an AI. ArchSutra's answer is layered: skills declare repository content to be data, agents get read-only tools, and the CLI never executes anything it reads. Residual risk is documented in the [threat model](../architecture/threat-model.md).
|
|
143
|
+
|
|
144
|
+
## Keep going
|
|
145
|
+
|
|
146
|
+
- Use it on something real: [Real-world scenarios](real-world-scenarios.md)
|
|
147
|
+
- The full reasoning behind the design: [Architecture](../handbook/04-architecture.md)
|
|
148
|
+
- Every rule: [Rule catalog](../handbook/12-rule-catalog.md)
|