archivision 0.0.0-stage → 0.4.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 +62 -0
- package/LICENSE +21 -0
- package/NOTICE +9 -0
- package/README.md +187 -2
- package/assets/ISO-GLOW-LICENSE +22 -0
- package/assets/figure.js +1253 -0
- package/assets/shell-3d.html +2976 -0
- package/bin/archivision.js +151 -0
- package/examples/shop/architecture.md +85 -0
- package/examples/shop/shop.arch.json +1273 -0
- package/lib/arch/ai.js +110 -0
- package/lib/arch/inputs.js +107 -0
- package/lib/arch/model.js +152 -0
- package/lib/arch/prompt.js +29 -0
- package/lib/arch/schema.js +80 -0
- package/lib/index.js +13 -0
- package/lib/layout.js +117 -0
- package/lib/page.js +35 -0
- package/lib/repo/automap.js +352 -0
- package/lib/repo/build.js +347 -0
- package/lib/repo/facts.js +160 -0
- package/lib/repo/roots.js +18 -0
- package/lib/repo/scan/compare.js +93 -0
- package/lib/repo/scan/discover.js +221 -0
- package/lib/repo/scan/git.js +61 -0
- package/lib/repo/scan/go.js +157 -0
- package/lib/repo/scan/index.js +124 -0
- package/lib/repo/scan/lambda.js +93 -0
- package/lib/repo/scan/manifests.js +338 -0
- package/lib/repo/scan/next.js +46 -0
- package/lib/repo/scan/playwright.js +20 -0
- package/lib/repo/scan/prisma.js +81 -0
- package/lib/repo/scan/python.js +188 -0
- package/lib/repo/scan/ripwire.js +231 -0
- package/lib/repo/scan/tsc.js +381 -0
- package/lib/scan-schema.js +106 -0
- package/package.json +25 -4
- package/python/scan.py +2047 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and versions are `major.minor` (0.1, 0.2, …; package.json holds them as 0.1.0, 0.2.0).
|
|
7
|
+
|
|
8
|
+
## [0.4] - 2026-10-16
|
|
9
|
+
|
|
10
|
+
The README shows what a map looks like, with an animated tour and screenshots, and a bigger example, the Corner Shop monorepo, is there to try repo mode on.
|
|
11
|
+
|
|
12
|
+
### Highlights
|
|
13
|
+
|
|
14
|
+
- The README, on GitHub and on npm, shows what a map looks like: an animated tour, and pictures of the three levels, a walkthrough, the branch view and an architecture.
|
|
15
|
+
- A bigger example to try repo mode on, `examples/corner-shop`: an invented shop monorepo with a Next.js storefront and back office, TypeScript packages over Prisma, and two Python Lambda services on DynamoDB and S3, with two branches to compare. From a clone: `node bin/archivision.js repo examples/corner-shop --open`.
|
|
16
|
+
|
|
17
|
+
### For contributors
|
|
18
|
+
|
|
19
|
+
- `node scripts/readme-media.mjs` makes the README pictures again from the examples, in a headless Chrome (needs Google Chrome and ffmpeg).
|
|
20
|
+
|
|
21
|
+
## [0.3] - 2026-10-16
|
|
22
|
+
|
|
23
|
+
archivision is on npm: npm install -g archivision.
|
|
24
|
+
|
|
25
|
+
### Highlights
|
|
26
|
+
|
|
27
|
+
- `npm install -g archivision` installs it from npm: `archivision` (and `birdview`, the old name) go on your PATH. The package holds only what runs (about 240 KB), with TypeScript as its one dependency.
|
|
28
|
+
|
|
29
|
+
## [0.2] - 2026-10-16
|
|
30
|
+
|
|
31
|
+
birdview is now archivision, and open source under the MIT licence. Everything you had keeps working under the old names.
|
|
32
|
+
|
|
33
|
+
### Highlights
|
|
34
|
+
|
|
35
|
+
- archivision is open source under the MIT licence, at github.com/Giamme/archivision. Every page it writes carries its licences (archivision's and iso-glow's) in a comment in its head.
|
|
36
|
+
- birdview is now **archivision**: the command is `archivision repo|arch|render`, pages are written as `<name>.archivision.html`, and `ARCHIVISION_RIPWIRE` names ripwire for Go. The old names keep working: `birdview` runs the same commands, `BIRDVIEW_RIPWIRE` is still read, and a map saved next to an old page (`<repo>.birdview.map.json`) carries over with its edits on the first run.
|
|
37
|
+
|
|
38
|
+
### Fixed
|
|
39
|
+
|
|
40
|
+
- `archivision render x.birdview.arch.json` writes `x.archivision.html`; it used to write `x.birdview.birdview.html`.
|
|
41
|
+
- With a `python3` older than 3.10, the page now says that is why the Python files were not read; it used to say only that python3 failed. archivision needs Python 3.10 or later for Python repos.
|
|
42
|
+
|
|
43
|
+
## [0.1] - 2026-10-15
|
|
44
|
+
|
|
45
|
+
The first version: a 3D isometric map of a codebase, read with no AI and linked to its exact lines, or of an architecture, drawn from documents and diagrams through the AI CLIs you already use. Reads TypeScript, JavaScript, Python and, with ripwire, Go.
|
|
46
|
+
|
|
47
|
+
### Highlights
|
|
48
|
+
|
|
49
|
+
- `birdview repo <path>` maps a TypeScript repo into one self-contained 3D isometric page with no AI: Next.js App Router routes, Prisma models and their uses, Vitest and Playwright tests, grouped into blocks and parts by fixed rules, with walkthroughs that follow real calls down to a data write. Every block, part, function and walkthrough step links to its exact lines on GitHub (at the scanned commit) or in VS Code or Cursor. The grouping is saved to `<page>.map.json`, so renames and regrouping by hand survive the next run (`--remap` starts over). Press **b** on the page to see what a branch changes (`--bases`, `--compare base..head`; nothing is fetched unless you pass `--fetch`).
|
|
50
|
+
- `birdview arch <docs>` turns architecture documents and diagrams (Markdown, Mermaid, draw.io, images, PDFs) into the same kind of map, through the Claude Code or Codex CLI you are already logged in to: no API key is ever asked for. `--ai auto` tries Claude Code, then Codex. The model is checked against a strict schema, repaired where it can be, and saved as `.arch.json` to edit by hand; `birdview render` redraws it.
|
|
51
|
+
|
|
52
|
+
### Added
|
|
53
|
+
|
|
54
|
+
- Monorepos and JavaScript: each workspace package (`package.json` workspaces, `pnpm-workspace.yaml`, `apps/*`, `packages/*`) is read with its own `tsconfig.json` or `jsconfig.json`, calls across packages resolve, and JavaScript and CommonJS go through the same compiler pass. `--src` picks the code roots by hand. A **Coverage** section on the page counts the files mapped per language and those left out, and where, plus the calls not followed.
|
|
55
|
+
- Repos and packages without app routes (libraries, API-only services) are grouped by their folders, and walkthroughs start from any entry point when a repo has fewer than three pages: route handlers, server actions, middleware.
|
|
56
|
+
- Cables say **calls** when code on one side calls the other and **uses** when it only uses a value from it (a constant, a client, a function passed on), and their links go to every call site. Calls include `new`, tagged templates, decorators, JSX elements and same-file calls; a call to a method a subclass overrides is inferred.
|
|
57
|
+
- The page says how sure it is: a cable that is not exact is dashed, and a walkthrough says when it is inferred or not traced. Only exact references feed walkthroughs and the blast radius. For developers, `lib/scan-schema.js` is the written scan contract (version 2): every fact carries the adapter that found it and a status (`exact`, `inferred`, `ambiguous`, `unresolved`).
|
|
58
|
+
- Python: `.py` files are read with Python's own `ast` (the `python3` on your PATH, run isolated, never importing the scanned code): symbols, calls with how sure each is, imports, pytest and unittest files. Data access is mapped too: boto3 DynamoDB, S3 and SQS, SQL tables named by DB-API cursors, SQLAlchemy and Django models.
|
|
59
|
+
- Deployments: `serverless.yml` (with `${file(…)}` includes), SAM templates and Dockerfile `CMD`s give Lambda handlers and their triggers (routes, schedules, events), and the environment variables that name buckets and tables. What the reader cannot follow is listed in the Coverage section.
|
|
60
|
+
- Go: with ripwire 0.6.7 installed (`--ripwire <binary>`, `BIRDVIEW_RIPWIRE` or the PATH), `.go` files give functions, types, interfaces, methods on their types, constants and variables, each checked against birdview's own reading of the text. There are no calls between them yet, and the page says so. Without ripwire the Go files are counted, not read.
|
|
61
|
+
- Mapping a repo never changes it, not even git's index, and its own git configuration cannot make the scan run anything (hooks, filters, external diff drivers, textconv, fsmonitor, lazy fetch). Symlinks that leave the repo are not followed.
|
|
62
|
+
- `npm run check -- page.html` clicks through any page offline (every block, part, walkthrough and branch) and checks every code link against the file and line it points to.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Giamme
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
archivision is MIT-licensed (see LICENSE). It includes or loads third-party work:
|
|
2
|
+
|
|
3
|
+
- assets/shell-3d.html and the drawing style of assets/figure.js come from iso-glow
|
|
4
|
+
(MIT; Copyright (c) 2026 April Zhu, and Tolga Cohce for iso-figure on which it is based).
|
|
5
|
+
The full licence is in assets/ISO-GLOW-LICENSE. Every page archivision writes carries both
|
|
6
|
+
licences in a comment in its head.
|
|
7
|
+
- The pages load three.js 0.160.0 (MIT, Copyright (c) 2010-2023 three.js authors) from cdn.jsdelivr.net.
|
|
8
|
+
- lib/repo/scan/tsc.js uses the TypeScript compiler API (TypeScript 5.9.3, Apache-2.0, Microsoft),
|
|
9
|
+
installed as an npm dependency, not bundled.
|
package/README.md
CHANGED
|
@@ -1,3 +1,188 @@
|
|
|
1
|
-
#
|
|
1
|
+
# archivision
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A 3D isometric map you can open, in the iso-glow style, of a codebase or of an architecture. It works two ways:
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- **`archivision repo`** reads a TypeScript, JavaScript, Python or Go repo and maps it **with no AI**. Parsers find the files, functions, calls, data stores (Prisma tables; DynamoDB tables, S3 buckets, SQS queues and SQL tables from Python), Lambda handlers, tests and branch changes. A fixed set of rules groups them into blocks and parts. Every block, part, function, cable and walkthrough step links to the exact lines on GitHub (at the scanned commit) or in VS Code or Cursor.
|
|
9
|
+
- **`archivision arch`** reads architecture documents and diagrams (Markdown, Mermaid, draw.io, images, PDFs…) and has a model turn them into the same kind of map. The model runs through the AI CLIs you are already logged in to (Claude Code or Codex); archivision never asks for an API key. It has no code links, but keeps the blocks, parts, pieces, cables, an optional numbered bus and walkthroughs.
|
|
10
|
+
|
|
11
|
+
Each run writes one HTML page, with everything inline except three.js, which it loads from a CDN. Open it in a browser: click a block to open it, click a part to go one level deeper, press space to play a walkthrough. On repo pages, press **b** to see what a branch changes.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g archivision
|
|
15
|
+
archivision repo path/to/a/repo --open
|
|
16
|
+
archivision arch docs/ --name "My system" --open
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The first maps a repo of yours; the second has an AI CLI draw an architecture from the documents and diagrams in `docs/`. The project was first called birdview, and `birdview` still runs the same commands.
|
|
20
|
+
|
|
21
|
+
From a clone, with the example architecture:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
git clone https://github.com/Giamme/archivision.git && cd archivision
|
|
25
|
+
npm install
|
|
26
|
+
node bin/archivision.js render examples/shop/shop.arch.json --open
|
|
27
|
+
node bin/archivision.js arch examples/shop/architecture.md --name "Corner Shop" --open
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`render` draws the example model as it is; `arch` has the AI draw it again from its source document. `node bin/archivision.js repo examples/corner-shop --open` maps the same shop's code: an invented monorepo with a Next.js storefront and back office, TypeScript packages over Prisma, and two Python Lambda services. `npm link` puts `archivision` on your PATH.
|
|
31
|
+
|
|
32
|
+
**Needs** Node 20 or later and git. Optional: Python 3.10 or later (`python3`) for Python repos, ripwire 0.6.7 for Go, the `claude` (Claude Code) or `codex` CLI, logged in, for architecture mode, and `pdftotext` for PDFs.
|
|
33
|
+
|
|
34
|
+
## What a map shows
|
|
35
|
+
|
|
36
|
+
All of these are the Corner Shop example (`examples/corner-shop` and `examples/shop`).
|
|
37
|
+
|
|
38
|
+
**Three levels.** The whole repo is a plate of blocks. Open a block to see its parts inside it, and a part to see its functions, files and tests, each linked to its lines.
|
|
39
|
+
|
|
40
|
+

|
|
41
|
+
|
|
42
|
+
**Walkthroughs.** Each one follows real calls from a page, an API route or a Lambda handler down to the code that writes the data, one step per call, each step linked to its line.
|
|
43
|
+
|
|
44
|
+

|
|
45
|
+
|
|
46
|
+
**Branches.** Press **b** to compare two branches: the blocks that hold the changes light up, and dashed arcs come from the code that calls what changed.
|
|
47
|
+
|
|
48
|
+

|
|
49
|
+
|
|
50
|
+
**Architecture.** `archivision arch` draws the same kind of map from documents and diagrams: here the Corner Shop's architecture document, with its services, outside providers, event bus and walkthroughs.
|
|
51
|
+
|
|
52
|
+

|
|
53
|
+
|
|
54
|
+
## Repo mode (no AI)
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
archivision repo <path> [--out page.html] [--map map.json] [--remap]
|
|
58
|
+
[--bases dev,main] [--since 60] [--max 24] [--compare base..head,…] [--fetch]
|
|
59
|
+
[--ripwire <binary>]
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**What it reads**
|
|
63
|
+
- TypeScript and JavaScript (`.ts .tsx .mts .cts .js .jsx .mjs .cjs`) in the code roots: `--src` when given; else each workspace package's `src/` (or the package folder, when it has no `src/` with code) and the repo's `src/`; with neither, the whole repo. `tests/`, `test/`, `__tests__/`, `browser-tests/` and `e2e/` next to the repo or a package are test roots. They are read through the TypeScript compiler API, with the nearest `tsconfig.json` or `jsconfig.json` and its paths. A file outside every root that the code imports (a script a test imports) is read too, for its symbols and calls, but not placed on the map; the Coverage section counts it. Next.js App Router routes come from the `app/` folder of each code root, `.well-known/` included; other dot-folders are skipped.
|
|
64
|
+
- `prisma/schema.prisma` and every `prisma.<model>.<op>` call.
|
|
65
|
+
- `.py` files, through Python's own `ast` (`python3` on the PATH, never one inside the repo): symbols, calls with how sure each is, imports, and data access (boto3 DynamoDB, S3 and SQS; DB-API cursors and the tables their SQL names, read as tokens, with each statement's own target written; SQLAlchemy and Django models, known by bases traced through the imports). Libraries are recognised by what the code imports, never by a name alone; a call or a query on a value whose type the scan does not know is counted, not drawn. Python runs isolated (`-I -S -B`, the files sent on stdin, from a folder outside the repo) and never imports the scanned code. Without `python3`, or with one older than 3.10, the Python files are counted as not read, and the page says why.
|
|
66
|
+
- Deployment manifests, read as text: `serverless.yml` (functions, handlers, images, events, environment), SAM templates and Dockerfile `CMD`s. Each Lambda handler is configured (found), conventional (`lambda_handler(event, context)` that no manifest names) or unresolved, with the reason; HTTP events are routes, schedules jobs, the rest events. A bucket or table named by an environment variable takes the value the deployments running that code give it (a function's own value over its provider's) when they agree on a literal, else `$NAME`. CloudFormation tags (`!Ref`, `!Sub`) are never names. `${file(…)}` includes of functions are followed inside the repo; what the reader cannot follow (an alias, a merge key, a flow collection that does not close, a second YAML document, functions given by a tag, an include outside the repo) is listed in the Coverage section.
|
|
67
|
+
- `.go` files, through ripwire's language server when you have it (`--ripwire`, else `ARCHIVISION_RIPWIRE`, else `ripwire` on the PATH; never one inside the repo, only at a version archivision knows, 0.6.7, run from a private temporary folder with its own HOME): functions, types, interfaces, methods on their types, constants and variables, each checked against archivision's own reading of the text. No calls between them yet: ripwire gives none, and archivision invents none. Without ripwire the Go files are counted, not read.
|
|
68
|
+
- Vitest files that import a part; pytest and unittest files and what they import.
|
|
69
|
+
- Playwright specs under `e2e/` that visit a part's pages.
|
|
70
|
+
|
|
71
|
+
The scan changes nothing in the repo it maps, neither its files nor its `.git`. The page and its map are written to the current folder (or to `--out`), so run it from outside the repo, or give `--out`, to keep them out of it. `--fetch` is the one exception: it runs `git fetch --prune`, which updates the repo's remote branches.
|
|
72
|
+
|
|
73
|
+
**How it groups, with no AI**
|
|
74
|
+
- Route segments become blocks; big routes split one level.
|
|
75
|
+
- Name stems and imports attach the other files.
|
|
76
|
+
- Part kinds come from the file types, and zones follow the order a request flows.
|
|
77
|
+
- Each table group belongs to the block that writes it most.
|
|
78
|
+
- Walkthroughs follow real calls from a page, or from an API route or a Lambda handler in repos without pages, down to a data write.
|
|
79
|
+
|
|
80
|
+
**The map file** (`<page>.map.json`, next to the page) holds that grouping: blocks, parts, globs, names, zones, table groups and walkthroughs.
|
|
81
|
+
- The first run writes it; later runs reuse it, so renames and regrouping by hand stick.
|
|
82
|
+
- `--remap` writes it again from the code.
|
|
83
|
+
- `--map other.json` uses a map from somewhere else, for example one an LLM wrote.
|
|
84
|
+
- Every glob and anchor is checked against the parse on each build; anything that no longer matches is reported.
|
|
85
|
+
|
|
86
|
+
**Branches**
|
|
87
|
+
- The scanner compares each base (`--bases`, default `dev,main,master`, local or `origin/`) with every branch active in the last `--since` days, up to `--max` branches. Add more pairs with `--compare`.
|
|
88
|
+
- It never fetches unless you pass `--fetch`.
|
|
89
|
+
- On the page, **b** opens the branch view, with **Base** and **Compare** pickers and a swap button. The view lights the blocks, parts and functions that changed, dashes the callers of the changed code, and links each file to its GitHub diff.
|
|
90
|
+
|
|
91
|
+
**Links**: GitHub at the scanned commit when it is pushed; otherwise VS Code. Viewers can switch to VS Code or Cursor and set their own checkout path; both settings are saved in their browser.
|
|
92
|
+
|
|
93
|
+
## Architecture mode (AI)
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
archivision arch <files or folders…> [--out page.html] [--name "System"] [--ai auto|claude|codex]
|
|
97
|
+
[--model id] [--effort low|medium|high|xhigh|max] [--focus "…"]
|
|
98
|
+
archivision render <model.arch.json> [--out page.html]
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Sources**
|
|
102
|
+
- Text: `.md .txt .mmd .puml .dot .d2 .json .yaml .prisma .graphql .proto`.
|
|
103
|
+
- HTML: tags stripped, Mermaid blocks kept.
|
|
104
|
+
- SVG: text labels.
|
|
105
|
+
- draw.io: boxes, containers and labelled arrows, compressed or not.
|
|
106
|
+
- Images: `.png .jpg .webp .gif`.
|
|
107
|
+
- PDFs.
|
|
108
|
+
|
|
109
|
+
Folders are read recursively, skipping `node_modules`, `.git` and build folders.
|
|
110
|
+
|
|
111
|
+
**Backends**: only CLIs, each with its own login; no API keys. `--ai auto` tries them in this order and skips any that is not installed or not logged in.
|
|
112
|
+
|
|
113
|
+
| Backend | Needs | Default model | Notes |
|
|
114
|
+
|---|---|---|---|
|
|
115
|
+
| `claude` | the `claude` CLI (Claude Code), logged in | `opus` | `claude -p --output-format json --json-schema …`. It cannot run commands, edit, write or browse (`--disallowedTools`); it may read files, which is how it sees image and PDF sources (their folders are added with `--add-dir`). |
|
|
116
|
+
| `codex` | the `codex` CLI, logged in | `gpt-6-astra` | `codex exec -s read-only --output-schema …`; images attached with `--image`. |
|
|
117
|
+
|
|
118
|
+
PDFs go in as text when `pdftotext` is installed; otherwise the CLI reads the file itself.
|
|
119
|
+
|
|
120
|
+
**What comes out**
|
|
121
|
+
- `<page>.arch.json`: the model, checked and repaired.
|
|
122
|
+
- The page.
|
|
123
|
+
|
|
124
|
+
The check fixes what it safely can and lists each repair:
|
|
125
|
+
- ids, kinds and duplicates;
|
|
126
|
+
- links and flows to unknown things;
|
|
127
|
+
- parts outside any zone;
|
|
128
|
+
- port numbers and walkthrough steps.
|
|
129
|
+
|
|
130
|
+
It also prints what the sources left open (`unclear`). Edit the `.arch.json` by hand and run `archivision render` to redraw it without calling a model.
|
|
131
|
+
|
|
132
|
+
**The model** (`lib/arch/schema.js`): `title`, `intro`, `layers`, `modules` (each with `zones`, `parts` with `kind`, `children` (pieces) and `links`), `flows` between blocks, an optional `bus` with numbered `ports` and the blocks on each, `journeys` (steps at blocks, parts or `P<n>` ports) and `unclear`. Parts may also carry `col`, `row`, `cspan` and `rspan` to pin their cell. `examples/shop/architecture.md` is a small source document to try the AI on, and `examples/shop/shop.arch.json` is the model Codex drew from it.
|
|
133
|
+
|
|
134
|
+
## The page
|
|
135
|
+
|
|
136
|
+
- One HTML file. It loads three.js 0.160.0 from jsDelivr the first time it opens; everything else is inline.
|
|
137
|
+
- Controls:
|
|
138
|
+
- **click** opens a block or part;
|
|
139
|
+
- **ⓘ** or **i** explains it;
|
|
140
|
+
- **← →** move between blocks;
|
|
141
|
+
- **enter** opens;
|
|
142
|
+
- **space** plays the next walkthrough;
|
|
143
|
+
- **b** shows branches (repo pages);
|
|
144
|
+
- **esc** goes back.
|
|
145
|
+
- The toolbar has **Iso view** (true isometric), **Revolve**, the light and dark theme, and the accent colour.
|
|
146
|
+
- `?still` opens without the intro camera move; `?branch` opens in the branch view.
|
|
147
|
+
|
|
148
|
+
## Development
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
npm test # repo mode on fixture git repos, the scan contract, goldens, no writes and no hostile git config, architecture mode, the CLI; pages clicked through offline
|
|
152
|
+
npm run check -- page.html # click through any page offline: every block and part, links, branches, walkthroughs
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
The full suite needs Python 3.10 or later. The Go tests that run ripwire itself skip unless ripwire 0.6.7 is on the PATH or named by `ARCHIVISION_RIPWIRE`. `node scripts/readme-media.mjs` makes the pictures above again from the examples, in a headless Chrome (it needs Google Chrome and ffmpeg). `ARCHIVISION_ACCEPT=/path/to/repo,/path/to/other npm test` also checks your own repos: every code root holds exactly the code git lists, and every file is either mapped or counted.
|
|
156
|
+
|
|
157
|
+
`test/check-page.mjs` runs the real page module and three.js in jsdom with WebGL stubbed: no browser, no downloads. On a repo page it also opens every code link's file and line on disk.
|
|
158
|
+
|
|
159
|
+
Layout:
|
|
160
|
+
- `lib/repo/scan/`: the scanner, one adapter per source of facts:
|
|
161
|
+
- `discover` finds the packages and code roots: `--src` when given, else each workspace package's `src/` (or its folder), else `src/`, else the whole repo; and counts every file it leaves out;
|
|
162
|
+
- `tsc` reads TypeScript through the compiler: symbols, the references between files, and every call with every place it is made, same-file calls, `new` and JSX elements included;
|
|
163
|
+
- `next` reads Next.js routes and entry points;
|
|
164
|
+
- `prisma` reads models and their uses;
|
|
165
|
+
- `python` runs `python/scan.py` (Python's `ast`) for Python symbols, calls, imports and data access; `manifests` reads serverless.yml, SAM and Dockerfiles; `lambda` turns them into handlers and triggers;
|
|
166
|
+
- `ripwire` runs ripwire's language server for Go symbols, and `go` reads Go declarations from the text to check them;
|
|
167
|
+
- `playwright` reads e2e visits;
|
|
168
|
+
- `compare` reads branch changes;
|
|
169
|
+
- `git` runs read-only git with argument lists, so the scanned repo's hooks, filters and diff drivers never run.
|
|
170
|
+
- `lib/scan-schema.js`: the scan contract, version 2, as a JSON Schema with its own small validator. Every fact carries its adapter (`prov`) and a status (`exact`, `inferred`, `ambiguous` or `unresolved`).
|
|
171
|
+
- `lib/repo/facts.js`: the only reader of the contract's shape. `automap.js` and `build.js` work from its views.
|
|
172
|
+
- On the page a cable says **calls** when code on one side calls the other, and **uses** when it only uses a value from it: a constant, a schema, a function passed on. Its links go to the calls when there are any.
|
|
173
|
+
- `lib/arch/`: `schema.js`, `prompt.js`, `inputs.js`, `ai.js`, `model.js`.
|
|
174
|
+
- `lib/layout.js`: the plate both modes share.
|
|
175
|
+
- `lib/page.js`: assembles the page.
|
|
176
|
+
- `assets/`: the iso-glow 3D shell and the archivision figure module.
|
|
177
|
+
|
|
178
|
+
## Limits
|
|
179
|
+
|
|
180
|
+
- Repo mode reads TypeScript and JavaScript (`.ts .tsx .mts .cts .js .jsx .mjs .cjs`), Python (`.py`) and, with ripwire, Go (`.go`: symbols, no calls or data yet). Other languages are counted, not mapped: the page's **Coverage** section says how many files of each it left out, and where, and what it could not follow. Walkthroughs need data calls to end at; repos without any get no rail and no walkthroughs.
|
|
181
|
+
- Python: `self.m()` is never exact (an instance can be changed at run time), a call to a decorated function is inferred (unless the decorator is one that returns what it decorates, by its import: `staticmethod`, `typing.final`, …), and a name bound more than once (a def in two branches, an import then an assignment) gives ambiguous calls to each binding. Methods follow Python's C3 order; a call on a Protocol or to an abstract method is counted, not drawn to every implementation, and subclasses outside the repo are not seen. A `sys.path` edit with a literal relative path is relative to where the program runs, which the code does not say: inferred. A boto3 call on a client passed in, or a table name built at run time, is counted, not drawn. No call between a trigger and code is invented: an S3 event names its bucket, not the code that wrote to it.
|
|
182
|
+
- A monorepo's packages are found from `package.json` workspaces, `pnpm-workspace.yaml`, or `apps/*` and `packages/*`. A package without app routes is a district of its own. Several Next.js apps in one repo are not told apart yet.
|
|
183
|
+
- Branch comparisons see only the refs present locally (run with `--fetch`, or fetch yourself).
|
|
184
|
+
- The AI never invents code links: architecture pages have none. A model can still misread a source, so read the repairs and the `unclear` list, and fix the `.arch.json` when needed.
|
|
185
|
+
|
|
186
|
+
## Licence
|
|
187
|
+
|
|
188
|
+
MIT: see `LICENSE`. Credits for the third-party work it includes or loads are in `NOTICE`. What changed in each version is in `CHANGELOG.md`.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 April Zhu (iso-glow: lighting, palettes, gallery shell, examples)
|
|
4
|
+
Copyright (c) 2026 Tolga Cohce (iso-figure, on which iso-glow is based)
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|