@seemseam/architec 0.2.10 → 0.2.12
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/README.md +6 -297
- package/bin/archi.js +9 -131
- package/package.json +9 -11
- package/README.zh-CN.md +0 -255
- package/docs/npm-release.md +0 -65
package/README.md
CHANGED
|
@@ -1,303 +1,12 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @seemseam/architec
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Compatibility shim for the renamed `@seemseam/archi` package.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
[](#quick-start)
|
|
7
|
-
[](#no-login-required)
|
|
8
|
-
|
|
9
|
-
[English](README.md) | [中文](README.zh-CN.md)
|
|
10
|
-
|
|
11
|
-
Architec is a Python 3.11+ command-line tool that reviews architecture risk in
|
|
12
|
-
code changes. It builds compact evidence from the repository, asks the
|
|
13
|
-
configured LLM to interpret that evidence, and writes advisory reports for
|
|
14
|
-
humans and coding agents.
|
|
15
|
-
|
|
16
|
-
The practical question it helps answer is:
|
|
17
|
-
|
|
18
|
-
> Will this change make the codebase harder to maintain?
|
|
19
|
-
|
|
20
|
-
Architec does not edit code, approve merges, or prove runtime correctness. It
|
|
21
|
-
reports risks worth checking: duplicated logic, shadow implementations, unclear
|
|
22
|
-
module boundaries, stale structure, cleanup candidates, hotspots, and topology
|
|
23
|
-
pressure.
|
|
24
|
-
|
|
25
|
-
## Package Status
|
|
26
|
-
|
|
27
|
-
This checkout is prepared for Python packaging and has a draft npm launcher:
|
|
28
|
-
|
|
29
|
-
| Registry | Package name | CLI command | Status in this checkout |
|
|
30
|
-
| --- | --- | --- | --- |
|
|
31
|
-
| PyPI | `architec` | `archi` | Metadata, README, license, and wheel/sdist contents are configured. Do not publish until companion dependencies are available on the target index and a new release version/tag is chosen. |
|
|
32
|
-
| npm | `@seemseam/architec` | `archi` | Scoped launcher package is configured, but the scope ownership, Trusted Publishing setup, and Python dependency chain still need release validation. |
|
|
33
|
-
|
|
34
|
-
The unscoped npm package name `architec` is already occupied by an unrelated
|
|
35
|
-
package, so npm publishing should use a scope you control. The Python
|
|
36
|
-
distribution name and command name are intentionally different: the
|
|
37
|
-
distribution is `architec`, while the installed console command is `archi`.
|
|
38
|
-
|
|
39
|
-
Use registry install commands only after the relevant package page shows the
|
|
40
|
-
intended version. As of this audit, the existing `v0.2.10` tag points to an
|
|
41
|
-
older commit, so a future registry release should use a new version and tag.
|
|
42
|
-
|
|
43
|
-
## Install
|
|
44
|
-
|
|
45
|
-
Architec requires Python 3.11 or newer.
|
|
46
|
-
|
|
47
|
-
Local development install from this checkout:
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
python3 -m pip install -e .
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
The package declares registry-style dependencies on `llmgateway>=0.1.1` and
|
|
54
|
-
`hippocampus>=0.1.7` for PyPI compatibility. If those companion versions are
|
|
55
|
-
not available from your configured package index yet, install the companion
|
|
56
|
-
projects from source first, or wait for their registry releases before using
|
|
57
|
-
normal dependency resolution.
|
|
58
|
-
|
|
59
|
-
After a verified PyPI release, the expected install form is:
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
python3 -m pip install --user architec
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Do not add that command to automation until the PyPI project page shows the
|
|
66
|
-
intended version.
|
|
67
|
-
|
|
68
|
-
npm distribution is prepared as a thin launcher package. After a verified npm
|
|
69
|
-
release, the expected install form is:
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
npm install -g @seemseam/architec
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
That package exposes the same `archi` command, then creates a user-cache Python
|
|
76
|
-
virtual environment on first run and installs the matching Architec GitHub tag.
|
|
77
|
-
It requires Node.js, Python 3.11+, git, and network access on first run.
|
|
78
|
-
|
|
79
|
-
## How It Fits Together
|
|
80
|
-
|
|
81
|
-
Architec is the architecture review layer. It uses two companion components:
|
|
82
|
-
|
|
83
|
-
| Component | Command / package | Role |
|
|
84
|
-
| --- | --- | --- |
|
|
85
|
-
| **Architec** | `archi` / `architec` | Runs architecture review, calls the LLM through llmgateway, and writes results under `.architec/`. |
|
|
86
|
-
| **Hippo** | `hippo` / `hippocampus` | Builds structural project snapshots under `.hippocampus/`: file manifests, code signatures, repository indexes, structure prompts, and metrics. |
|
|
87
|
-
| **llmgateway** | `llmgateway` | Owns provider credentials, base URLs, API style, model names, and strong/weak model routing. |
|
|
88
|
-
|
|
89
|
-
```text
|
|
90
|
-
source tree + git changes
|
|
91
|
-
|
|
|
92
|
-
v
|
|
93
|
-
Hippo structural snapshot -> .hippocampus/
|
|
94
|
-
|
|
|
95
|
-
v
|
|
96
|
-
Architec evidence builder -> selected-scope or full-project context
|
|
97
|
-
|
|
|
98
|
-
v
|
|
99
|
-
llmgateway LLM call -> strong / weak model tiers
|
|
100
|
-
|
|
|
101
|
-
v
|
|
102
|
-
Architec review output -> .architec/
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Day-to-day `archi` runs use the LLM, but they do not refresh the full Hippo
|
|
106
|
-
snapshot unless needed. `archi --full` reviews the whole project. Use
|
|
107
|
-
`archi --refresh-from-hippo --full` when you want to refresh structural inputs
|
|
108
|
-
before a full review.
|
|
109
|
-
|
|
110
|
-
## Configure LLM Access
|
|
111
|
-
|
|
112
|
-
Architec gets LLM access through **llmgateway**. Configure provider credentials,
|
|
113
|
-
base URL, API style, and model tiers in:
|
|
114
|
-
|
|
115
|
-
```text
|
|
116
|
-
~/.llmgateway/config.yaml
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
Minimal shape:
|
|
120
|
-
|
|
121
|
-
```yaml
|
|
122
|
-
version: 1
|
|
123
|
-
provider:
|
|
124
|
-
provider_type: openai
|
|
125
|
-
api_style: openai_responses
|
|
126
|
-
base_url: https://your-llm-endpoint.example/v1
|
|
127
|
-
api_key: <set-locally>
|
|
128
|
-
settings:
|
|
129
|
-
strong_model: your-strong-model
|
|
130
|
-
weak_model: your-fast-model
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
Keep this file local and do not commit it. Architec does not store LLM provider
|
|
134
|
-
credentials in `.architec/`; llmgateway owns provider configuration and request
|
|
135
|
-
routing.
|
|
136
|
-
|
|
137
|
-
Check the installation and LLM route:
|
|
138
|
-
|
|
139
|
-
```bash
|
|
140
|
-
archi --check .
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
If the check reports missing LLM configuration, update
|
|
144
|
-
`~/.llmgateway/config.yaml`.
|
|
145
|
-
|
|
146
|
-
## Quick Start
|
|
147
|
-
|
|
148
|
-
Review the current git changes in the current directory:
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
archi
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
Review another project path:
|
|
155
|
-
|
|
156
|
-
```bash
|
|
157
|
-
archi /path/to/project
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
Run whole-project architecture review:
|
|
161
|
-
|
|
162
|
-
```bash
|
|
163
|
-
archi --full
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
Refresh Hippo inputs before whole-project review:
|
|
167
|
-
|
|
168
|
-
```bash
|
|
169
|
-
archi --refresh-from-hippo --full
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
Save JSON output:
|
|
173
|
-
|
|
174
|
-
```bash
|
|
175
|
-
archi --out review.json
|
|
176
|
-
archi --full --out full-review.json
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
## CLI Command Summary
|
|
180
|
-
|
|
181
|
-
| Command | Purpose |
|
|
182
|
-
| --- | --- |
|
|
183
|
-
| `archi` | Incremental LLM architecture review for current git changes. |
|
|
184
|
-
| `archi <path>` | Incremental review for another project root. |
|
|
185
|
-
| `archi --full` | Full-project LLM architecture review. |
|
|
186
|
-
| `archi --refresh-from-hippo --full` | Refresh Hippo structural inputs, then run full review. |
|
|
187
|
-
| `archi --check .` | Validate Hippo bundle state and llmgateway configuration. |
|
|
188
|
-
| `archi --out review.json` | Save incremental review JSON. |
|
|
189
|
-
| `archi --version` | Show the installed CLI version and latest release status when available. |
|
|
190
|
-
| `archi update` | Reinstall the latest public Architec build through the configured installer. |
|
|
191
|
-
| `archi uninstall --yes` | Remove the installed launcher, managed assets, configs, and dependencies. |
|
|
192
|
-
|
|
193
|
-
Some compatibility commands and hidden flags remain for older automation, such
|
|
194
|
-
as `archi code-review --full .`, `archi code-review --diff .`, `archi
|
|
195
|
-
plan-review`, `archi status --snapshot`, and `archi fix-advice --review
|
|
196
|
-
review.json`. New users should start with the top-level commands above and
|
|
197
|
-
inspect the installed binary with:
|
|
198
|
-
|
|
199
|
-
```bash
|
|
200
|
-
archi --help
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
## What Architec Reports
|
|
204
|
-
|
|
205
|
-
Architec reports advisory concerns and signals, including:
|
|
206
|
-
|
|
207
|
-
- **Duplication**: repeated logic and suspicious near-duplicates.
|
|
208
|
-
- **Shadow implementations**: second implementations of similar behavior.
|
|
209
|
-
- **Architecture contracts**: import-boundary or dependency-direction pressure.
|
|
210
|
-
- **Cleanup/archive candidates**: stale or legacy-looking code and docs.
|
|
211
|
-
- **Hotspots**: churn-heavy or structurally risky areas.
|
|
212
|
-
- **Topology pressure**: flat or confusing project structure.
|
|
213
|
-
- **Snapshot freshness**: missing, stale, or unknown Hippo context.
|
|
214
|
-
- **Risk context**: optional external facts attached to existing concerns.
|
|
215
|
-
|
|
216
|
-
The output is advice, not a pass/fail gate.
|
|
217
|
-
|
|
218
|
-
## Outputs
|
|
219
|
-
|
|
220
|
-
Architec writes generated files under `.architec/`:
|
|
221
|
-
|
|
222
|
-
```text
|
|
223
|
-
.architec/
|
|
224
|
-
architec-analysis.json
|
|
225
|
-
architec-summary.md
|
|
226
|
-
architec-viz.html
|
|
227
|
-
code-review-concerns.json
|
|
228
|
-
code-review-discovery.json
|
|
229
|
-
review-events.jsonl
|
|
230
|
-
cache/
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
Hippo writes structural inputs under `.hippocampus/`.
|
|
234
|
-
|
|
235
|
-
Start with `.architec/architec-summary.md` for the human-readable report. Use
|
|
236
|
-
`.architec/architec-analysis.json` for exact scores, concerns, signals, and
|
|
237
|
-
artifact paths. Both `.architec/` and `.hippocampus/` are generated local
|
|
238
|
-
project state and are normally not package payload.
|
|
239
|
-
|
|
240
|
-
## Dependencies
|
|
241
|
-
|
|
242
|
-
The Python package declares:
|
|
243
|
-
|
|
244
|
-
- `llmgateway>=0.1.1`;
|
|
245
|
-
- `hippocampus>=0.1.7`;
|
|
246
|
-
- `PyYAML`, `certifi`, and `cryptography` from Python package indexes.
|
|
247
|
-
|
|
248
|
-
Before a PyPI release, maintainers must confirm that the companion package
|
|
249
|
-
versions are available from the intended registry. Before an npm release,
|
|
250
|
-
maintainers must confirm the npm scope, Git tag, and Python install target that
|
|
251
|
-
the launcher will use.
|
|
252
|
-
|
|
253
|
-
## No Login Required
|
|
254
|
-
|
|
255
|
-
Architecture analysis commands do not require `archi login`.
|
|
256
|
-
|
|
257
|
-
Architec sends selected architecture evidence only to the LLM provider
|
|
258
|
-
configured in llmgateway. Review your provider configuration before running
|
|
259
|
-
analysis on private code. Do not commit local provider credentials,
|
|
260
|
-
`.llmgateway/` config, or generated `.architec/` and `.hippocampus/` outputs
|
|
261
|
-
unless you intentionally want to share them.
|
|
262
|
-
|
|
263
|
-
Account-related commands may exist in the source tree for diagnostics or future
|
|
264
|
-
commercial workflows, but they are not required for the GitHub/local analysis
|
|
265
|
-
workflow described here.
|
|
266
|
-
|
|
267
|
-
## Development
|
|
268
|
-
|
|
269
|
-
Run tests:
|
|
270
|
-
|
|
271
|
-
```bash
|
|
272
|
-
PYTHONPATH=src python3 -m pytest -q
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
Run Architec from this checkout:
|
|
5
|
+
Install the primary package for new setups:
|
|
276
6
|
|
|
277
7
|
```bash
|
|
278
|
-
|
|
279
|
-
PYTHONPATH=src python3 -m architec
|
|
280
|
-
PYTHONPATH=src python3 -m architec --full
|
|
8
|
+
npm install -g @seemseam/archi
|
|
281
9
|
```
|
|
282
10
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
- `pyproject.toml`, `package.json`, and `src/architec/_version.py` currently
|
|
286
|
-
declare version `0.2.10`.
|
|
287
|
-
- The existing `v0.2.10` tag points to an older commit. Do not reuse or move it
|
|
288
|
-
for a different release state.
|
|
289
|
-
- Use a new `vX.Y.Z` git tag only after the version, package metadata, README,
|
|
290
|
-
and dependency strategy are final.
|
|
291
|
-
- Do not publish from a dirty worktree unless that dirty state is explicitly
|
|
292
|
-
accepted for the release.
|
|
293
|
-
- PyPI publishing should verify the `architec` project name, target version,
|
|
294
|
-
wheel/sdist contents, dependency resolution, and long description rendering.
|
|
295
|
-
- npm publishing should verify the package scope, `bin` entry, files allowlist,
|
|
296
|
-
launcher smoke test, and Trusted Publishing configuration.
|
|
297
|
-
- npm release details live in [docs/npm-release.md](docs/npm-release.md).
|
|
298
|
-
|
|
299
|
-
## More Documentation
|
|
300
|
-
|
|
301
|
-
- [Usage manual](docs/usage-manual.md)
|
|
302
|
-
- [Architecture stability notes](docs/advisory-review/topics/architecture-stability.md)
|
|
303
|
-
- [Evidence model](docs/advisory-review/topics/evidence-model.md)
|
|
11
|
+
This package keeps the historical `@seemseam/architec` name installable and
|
|
12
|
+
forwards the `archi` command to `@seemseam/archi`.
|
package/bin/archi.js
CHANGED
|
@@ -1,135 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
);
|
|
13
|
-
const VERSION = PACKAGE_JSON.version;
|
|
14
|
-
const DEFAULT_SOURCE = `architec @ git+https://github.com/SeemSeam/architec.git@v${VERSION}`;
|
|
15
|
-
const PYTHON_SPEC = process.env.ARCHITEC_NPM_PIP_SPEC || DEFAULT_SOURCE;
|
|
16
|
-
const CACHE_ROOT =
|
|
17
|
-
process.env.ARCHITEC_NPM_CACHE_DIR ||
|
|
18
|
-
path.join(os.homedir(), ".cache", "architec", "npm");
|
|
19
|
-
const VENV_DIR = path.join(CACHE_ROOT, VERSION, "venv");
|
|
20
|
-
const MARKER_PATH = path.join(CACHE_ROOT, VERSION, "install.json");
|
|
21
|
-
|
|
22
|
-
function fail(message, detail) {
|
|
23
|
-
console.error(`archi npm launcher: ${message}`);
|
|
24
|
-
if (detail) {
|
|
25
|
-
console.error(detail);
|
|
26
|
-
}
|
|
27
|
-
process.exit(1);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function run(command, args, options = {}) {
|
|
31
|
-
return spawnSync(command, args, {
|
|
32
|
-
stdio: options.stdio || "pipe",
|
|
33
|
-
encoding: options.encoding === false ? undefined : "utf8",
|
|
34
|
-
env: process.env,
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function commandWorks(command) {
|
|
39
|
-
const result = run(command, ["--version"]);
|
|
40
|
-
return !result.error && result.status === 0;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function pythonVersion(command) {
|
|
44
|
-
const result = run(command, [
|
|
45
|
-
"-c",
|
|
46
|
-
"import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')",
|
|
47
|
-
]);
|
|
48
|
-
if (result.error || result.status !== 0) {
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
const [major, minor] = String(result.stdout || "").trim().split(".").map(Number);
|
|
52
|
-
if (!Number.isInteger(major) || !Number.isInteger(minor)) {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
return { major, minor };
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function findPython() {
|
|
59
|
-
const configured = process.env.ARCHITEC_NPM_PYTHON;
|
|
60
|
-
const candidates = configured ? [configured] : ["python3", "python"];
|
|
61
|
-
for (const candidate of candidates) {
|
|
62
|
-
if (!commandWorks(candidate)) {
|
|
63
|
-
continue;
|
|
64
|
-
}
|
|
65
|
-
const version = pythonVersion(candidate);
|
|
66
|
-
if (version && (version.major > 3 || (version.major === 3 && version.minor >= 11))) {
|
|
67
|
-
return candidate;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function venvPython() {
|
|
74
|
-
if (process.platform === "win32") {
|
|
75
|
-
return path.join(VENV_DIR, "Scripts", "python.exe");
|
|
76
|
-
}
|
|
77
|
-
return path.join(VENV_DIR, "bin", "python");
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function installedMarkerMatches() {
|
|
81
|
-
try {
|
|
82
|
-
const marker = JSON.parse(fs.readFileSync(MARKER_PATH, "utf8"));
|
|
83
|
-
return marker.version === VERSION && marker.pythonSpec === PYTHON_SPEC;
|
|
84
|
-
} catch {
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function ensureVenv() {
|
|
90
|
-
const targetPython = venvPython();
|
|
91
|
-
if (fs.existsSync(targetPython) && installedMarkerMatches()) {
|
|
92
|
-
return targetPython;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const python = findPython();
|
|
96
|
-
if (!python) {
|
|
97
|
-
fail(
|
|
98
|
-
"Python 3.11+ is required.",
|
|
99
|
-
"Set ARCHITEC_NPM_PYTHON to a Python 3.11+ executable, or install the Python package directly with pip.",
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
fs.mkdirSync(path.dirname(VENV_DIR), { recursive: true });
|
|
104
|
-
let result = run(python, ["-m", "venv", VENV_DIR], { stdio: "inherit" });
|
|
105
|
-
if (result.error || result.status !== 0) {
|
|
106
|
-
fail("failed to create the Python virtual environment");
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
result = run(targetPython, ["-m", "pip", "install", "--upgrade", PYTHON_SPEC], {
|
|
110
|
-
stdio: "inherit",
|
|
4
|
+
const { main } = require("@seemseam/archi/lib/archi-dispatcher");
|
|
5
|
+
|
|
6
|
+
main(process.argv.slice(2))
|
|
7
|
+
.then((status) => {
|
|
8
|
+
process.exit(status === undefined || status === null ? 0 : status);
|
|
9
|
+
})
|
|
10
|
+
.catch((error) => {
|
|
11
|
+
console.error(`archi npm shim: ${error.message}`);
|
|
12
|
+
process.exit(1);
|
|
111
13
|
});
|
|
112
|
-
if (result.error || result.status !== 0) {
|
|
113
|
-
fail(
|
|
114
|
-
"failed to install the Architec Python CLI.",
|
|
115
|
-
`Tried: ${targetPython} -m pip install --upgrade "${PYTHON_SPEC}"`,
|
|
116
|
-
);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
fs.writeFileSync(
|
|
120
|
-
MARKER_PATH,
|
|
121
|
-
`${JSON.stringify({ version: VERSION, pythonSpec: PYTHON_SPEC }, null, 2)}\n`,
|
|
122
|
-
);
|
|
123
|
-
return targetPython;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
const python = ensureVenv();
|
|
127
|
-
const child = spawnSync(python, ["-m", "architec", ...process.argv.slice(2)], {
|
|
128
|
-
stdio: "inherit",
|
|
129
|
-
env: process.env,
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
if (child.error) {
|
|
133
|
-
fail("failed to start the Architec Python CLI", child.error.message);
|
|
134
|
-
}
|
|
135
|
-
process.exit(child.status === null ? 1 : child.status);
|
package/package.json
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seemseam/architec",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "
|
|
5
|
-
"keywords": [
|
|
6
|
-
"architecture",
|
|
7
|
-
"code-review",
|
|
8
|
-
"cli",
|
|
9
|
-
"llm",
|
|
10
|
-
"python"
|
|
11
|
-
],
|
|
3
|
+
"version": "0.2.12",
|
|
4
|
+
"description": "Compatibility shim for the renamed @seemseam/archi package.",
|
|
12
5
|
"homepage": "https://github.com/SeemSeam/architec#readme",
|
|
13
6
|
"author": "SeemSeam",
|
|
14
7
|
"bugs": {
|
|
@@ -16,7 +9,8 @@
|
|
|
16
9
|
},
|
|
17
10
|
"repository": {
|
|
18
11
|
"type": "git",
|
|
19
|
-
"url": "https://github.com/SeemSeam/architec
|
|
12
|
+
"url": "https://github.com/SeemSeam/architec",
|
|
13
|
+
"directory": "npm/architec-shim"
|
|
20
14
|
},
|
|
21
15
|
"license": "MIT",
|
|
22
16
|
"bin": {
|
|
@@ -24,8 +18,12 @@
|
|
|
24
18
|
},
|
|
25
19
|
"files": [
|
|
26
20
|
"bin/",
|
|
27
|
-
"
|
|
21
|
+
"README.md",
|
|
22
|
+
"LICENSE"
|
|
28
23
|
],
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@seemseam/archi": "0.2.12"
|
|
26
|
+
},
|
|
29
27
|
"engines": {
|
|
30
28
|
"node": ">=18"
|
|
31
29
|
},
|
package/README.zh-CN.md
DELETED
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
# Architec
|
|
2
|
-
|
|
3
|
-
**面向 AI 辅助开发代码库的增量架构审查 CLI。**
|
|
4
|
-
|
|
5
|
-
[](https://www.python.org/)
|
|
6
|
-
[](#快速开始)
|
|
7
|
-
[](#无需登录)
|
|
8
|
-
|
|
9
|
-
[English](README.md) | [中文](README.zh-CN.md)
|
|
10
|
-
|
|
11
|
-
Architec 是一个 Python 3.11+ 命令行工具,用来审查代码变更里的架构风险。它会从仓库中构建紧凑证据,交给你配置好的 LLM 解释,然后把建议型报告写给人类 reviewer 或 coding agent。
|
|
12
|
-
|
|
13
|
-
它关注的实际问题是:
|
|
14
|
-
|
|
15
|
-
> 这次改动会不会让项目更难长期维护?
|
|
16
|
-
|
|
17
|
-
Architec 不会自动修改代码,不会替你批准合并,也不能证明运行时正确性。它报告的是值得检查的架构风险,例如重复逻辑、shadow implementation、模块边界不清、结构陈旧、清理候选、热点文件和目录拓扑压力。
|
|
18
|
-
|
|
19
|
-
## 包状态
|
|
20
|
-
|
|
21
|
-
当前 checkout 已经具备 Python 发布配置,并准备了 npm launcher 草案:
|
|
22
|
-
|
|
23
|
-
| Registry | 包名 | CLI 命令 | 当前 checkout 状态 |
|
|
24
|
-
| --- | --- | --- | --- |
|
|
25
|
-
| PyPI | `architec` | `archi` | 包元数据、README、许可证、wheel/sdist 内容已经配置。必须等 companion dependencies 可从目标索引安装,并选择新的 release version/tag 后再发布。 |
|
|
26
|
-
| npm | `@seemseam/architec` | `archi` | scoped launcher 包已经配置,但 scope 所有权、Trusted Publishing 设置和 Python 依赖链仍需发布前验证。 |
|
|
27
|
-
|
|
28
|
-
未加 scope 的 npm 包名 `architec` 已被无关包占用,所以 npm 发布应使用你控制的 scope。Python 侧的发行名和命令名是刻意分开的:发行名是 `architec`,安装后的控制台命令是 `archi`。
|
|
29
|
-
|
|
30
|
-
只有在对应 registry 页面显示目标版本后,才使用 registry 安装命令。根据本次审计,现有 `v0.2.10` tag 指向较旧提交,未来 registry release 应使用新的版本和 tag。
|
|
31
|
-
|
|
32
|
-
## 安装
|
|
33
|
-
|
|
34
|
-
Architec 需要 Python 3.11 或更新版本。
|
|
35
|
-
|
|
36
|
-
从当前 checkout 做本地开发安装:
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
python3 -m pip install -e .
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
为了满足 PyPI 发布兼容性,当前包声明了 registry 形式依赖:`llmgateway>=0.1.1` 和 `hippocampus>=0.1.7`。如果这些 companion 版本还不能从你配置的包索引安装,请先从源码安装 companion projects,或等待它们的 registry release 后再使用普通依赖解析。
|
|
43
|
-
|
|
44
|
-
PyPI 包发布并验证后,预期安装方式是:
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
python3 -m pip install --user architec
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
在 PyPI 项目页显示目标版本之前,不要把这条命令写进自动化流程。
|
|
51
|
-
|
|
52
|
-
npm 分发已按轻量 launcher 包方案准备。npm 包发布并验证后,预期安装方式是:
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
npm install -g @seemseam/architec
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
该 npm 包暴露同一个 `archi` 命令,并在首次运行时创建用户缓存 Python 虚拟环境,安装匹配版本的 Architec GitHub tag。它要求 Node.js、Python 3.11+、git,并且首次运行需要网络访问。
|
|
59
|
-
|
|
60
|
-
## Architec、Hippo 和 llmgateway
|
|
61
|
-
|
|
62
|
-
Architec 是架构审查层,依赖两个运行时组件:
|
|
63
|
-
|
|
64
|
-
| 组件 | 命令 / 包 | 作用 |
|
|
65
|
-
| --- | --- | --- |
|
|
66
|
-
| **Architec** | `archi` / `architec` | 执行架构审查,通过 llmgateway 调用 LLM,并把结果写入 `.architec/`。 |
|
|
67
|
-
| **Hippo** | `hippo` / `hippocampus` | 在 `.hippocampus/` 下生成结构快照,包括文件清单、代码签名、仓库索引、结构 prompt 和指标。 |
|
|
68
|
-
| **llmgateway** | `llmgateway` | 管理 provider 凭据、base URL、API 风格、模型名,以及 strong/weak 模型路由。 |
|
|
69
|
-
|
|
70
|
-
```text
|
|
71
|
-
源码树 + git 变更
|
|
72
|
-
|
|
|
73
|
-
v
|
|
74
|
-
Hippo 结构快照 -> .hippocampus/
|
|
75
|
-
|
|
|
76
|
-
v
|
|
77
|
-
Architec 证据构建 -> 增量范围或全项目上下文
|
|
78
|
-
|
|
|
79
|
-
v
|
|
80
|
-
llmgateway LLM 调用 -> strong / weak 模型
|
|
81
|
-
|
|
|
82
|
-
v
|
|
83
|
-
Architec 审查输出 -> .architec/
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
日常 `archi` 会使用 LLM,但不会默认刷新完整 Hippo 快照。`archi --full` 用于全项目审查。如果希望先刷新结构输入,再做全量审查,可以运行 `archi --refresh-from-hippo --full`。
|
|
87
|
-
|
|
88
|
-
## 配置 LLM
|
|
89
|
-
|
|
90
|
-
Architec 的 LLM 访问全部通过 **llmgateway**。provider 凭据、base URL、API 风格和模型分层写在:
|
|
91
|
-
|
|
92
|
-
```text
|
|
93
|
-
~/.llmgateway/config.yaml
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
最小结构示例:
|
|
97
|
-
|
|
98
|
-
```yaml
|
|
99
|
-
version: 1
|
|
100
|
-
provider:
|
|
101
|
-
provider_type: openai
|
|
102
|
-
api_style: openai_responses
|
|
103
|
-
base_url: https://your-llm-endpoint.example/v1
|
|
104
|
-
api_key: <set-locally>
|
|
105
|
-
settings:
|
|
106
|
-
strong_model: your-strong-model
|
|
107
|
-
weak_model: your-fast-model
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
这个文件应该只保存在本机,不要提交到仓库。Architec 不会把 LLM provider 凭据写入 `.architec/`;provider 配置和请求路由由 llmgateway 负责。
|
|
111
|
-
|
|
112
|
-
检查安装和 LLM 路由:
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
archi --check .
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
如果检查提示缺少 LLM 配置,请更新 `~/.llmgateway/config.yaml`。
|
|
119
|
-
|
|
120
|
-
## 快速开始
|
|
121
|
-
|
|
122
|
-
审查当前目录里的 git 变更:
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
archi
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
审查另一个项目路径:
|
|
129
|
-
|
|
130
|
-
```bash
|
|
131
|
-
archi /path/to/project
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
全项目架构审查:
|
|
135
|
-
|
|
136
|
-
```bash
|
|
137
|
-
archi --full
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
先刷新 Hippo 输入,再做全项目审查:
|
|
141
|
-
|
|
142
|
-
```bash
|
|
143
|
-
archi --refresh-from-hippo --full
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
保存 JSON 输出:
|
|
147
|
-
|
|
148
|
-
```bash
|
|
149
|
-
archi --out review.json
|
|
150
|
-
archi --full --out full-review.json
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
## CLI 命令速查
|
|
154
|
-
|
|
155
|
-
| 命令 | 用途 |
|
|
156
|
-
| --- | --- |
|
|
157
|
-
| `archi` | 对当前 git 变更做增量 LLM 架构审查。 |
|
|
158
|
-
| `archi <path>` | 对另一个项目根目录做增量审查。 |
|
|
159
|
-
| `archi --full` | 对整个项目做 LLM 架构审查。 |
|
|
160
|
-
| `archi --refresh-from-hippo --full` | 刷新 Hippo 结构输入后运行全量审查。 |
|
|
161
|
-
| `archi --check .` | 检查 Hippo bundle 状态和 llmgateway 配置。 |
|
|
162
|
-
| `archi --out review.json` | 保存增量审查 JSON。 |
|
|
163
|
-
| `archi --version` | 显示当前 CLI 版本,并在可用时检查最新发布状态。 |
|
|
164
|
-
| `archi update` | 通过配置的安装器重新安装最新公开构建。 |
|
|
165
|
-
| `archi uninstall --yes` | 移除已安装的 launcher、托管资源、配置和依赖。 |
|
|
166
|
-
|
|
167
|
-
仓库里仍保留一些兼容命令和隐藏参数,供旧自动化使用,例如 `archi code-review --full .`、`archi code-review --diff .`、`archi plan-review`、`archi status --snapshot` 和 `archi fix-advice --review review.json`。新用户应优先使用上面的顶层命令,并用下面的命令检查本机安装版本:
|
|
168
|
-
|
|
169
|
-
```bash
|
|
170
|
-
archi --help
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
## Architec 会报告什么
|
|
174
|
-
|
|
175
|
-
Architec 会输出建议型 concerns 和 signals,包括:
|
|
176
|
-
|
|
177
|
-
- **重复逻辑**:重复实现和可疑近似重复。
|
|
178
|
-
- **Shadow implementation**:相似行为的第二套实现。
|
|
179
|
-
- **架构契约**:import 边界或依赖方向压力。
|
|
180
|
-
- **清理/归档候选**:陈旧代码、历史路径或需要整理的文档。
|
|
181
|
-
- **热点区域**:churn 高、结构风险更大的文件或模块。
|
|
182
|
-
- **拓扑压力**:过平、混乱或难以扩展的目录结构。
|
|
183
|
-
- **快照新鲜度**:Hippo 上下文缺失、陈旧或 freshness 不可判断。
|
|
184
|
-
- **风险上下文**:附加到现有 concerns 的可选外部事实。
|
|
185
|
-
|
|
186
|
-
这些输出是建议,不是 pass/fail gate。
|
|
187
|
-
|
|
188
|
-
## 输出目录
|
|
189
|
-
|
|
190
|
-
Architec 会把生成文件写入 `.architec/`:
|
|
191
|
-
|
|
192
|
-
```text
|
|
193
|
-
.architec/
|
|
194
|
-
architec-analysis.json
|
|
195
|
-
architec-summary.md
|
|
196
|
-
architec-viz.html
|
|
197
|
-
code-review-concerns.json
|
|
198
|
-
code-review-discovery.json
|
|
199
|
-
review-events.jsonl
|
|
200
|
-
cache/
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
Hippo 会把结构输入写入 `.hippocampus/`。
|
|
204
|
-
|
|
205
|
-
建议先读 `.architec/architec-summary.md`。需要精确分数、concern、signal 和 artifact 路径时,再看 `.architec/architec-analysis.json`。`.architec/` 和 `.hippocampus/` 都是本地生成的项目状态,通常不属于包发布内容。
|
|
206
|
-
|
|
207
|
-
## 依赖关系
|
|
208
|
-
|
|
209
|
-
当前 Python 包声明:
|
|
210
|
-
|
|
211
|
-
- `llmgateway>=0.1.1`;
|
|
212
|
-
- `hippocampus>=0.1.7`;
|
|
213
|
-
- 来自 Python 包索引的 `PyYAML`、`certifi` 和 `cryptography`。
|
|
214
|
-
|
|
215
|
-
发布 PyPI 前,维护者必须确认 companion package 版本能从目标 registry 安装。发布 npm 前,维护者必须确认 npm scope、Git tag,以及 launcher 使用的 Python 安装目标。
|
|
216
|
-
|
|
217
|
-
## 无需登录
|
|
218
|
-
|
|
219
|
-
架构分析命令不需要 `archi login`。
|
|
220
|
-
|
|
221
|
-
Architec 只会把选中的架构证据发送给 llmgateway 中配置的 LLM provider。对私有代码运行分析前,请先确认 provider 配置。不要提交本机 provider 凭据、`.llmgateway/` 配置,或生成的 `.architec/`、`.hippocampus/` 输出,除非你明确希望共享它们。
|
|
222
|
-
|
|
223
|
-
源码中可能存在账号相关命令,用于诊断或未来商业工作流;它们不是这里描述的 GitHub/本地分析流程的必要步骤。
|
|
224
|
-
|
|
225
|
-
## 开发
|
|
226
|
-
|
|
227
|
-
运行测试:
|
|
228
|
-
|
|
229
|
-
```bash
|
|
230
|
-
PYTHONPATH=src python3 -m pytest -q
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
从当前 checkout 运行 Architec:
|
|
234
|
-
|
|
235
|
-
```bash
|
|
236
|
-
PYTHONPATH=src python3 -m architec --help
|
|
237
|
-
PYTHONPATH=src python3 -m architec
|
|
238
|
-
PYTHONPATH=src python3 -m architec --full
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
## 发布维护说明
|
|
242
|
-
|
|
243
|
-
- `pyproject.toml`、`package.json` 和 `src/architec/_version.py` 当前声明版本为 `0.2.10`。
|
|
244
|
-
- 现有 `v0.2.10` tag 指向较旧提交。不要为了新的 release state 复用或移动它。
|
|
245
|
-
- 只有在版本、包元数据、README 和依赖策略都确定后,才创建新的 `vX.Y.Z` git tag。
|
|
246
|
-
- 除非明确接受当前 dirty 状态,否则不要从 dirty worktree 发布。
|
|
247
|
-
- PyPI 发布前需要验证 `architec` 项目名、目标版本、wheel/sdist 内容、依赖解析和 long description 渲染。
|
|
248
|
-
- npm 发布前需要验证 package scope、`bin` 入口、files allowlist、launcher smoke test 和 Trusted Publishing 配置。
|
|
249
|
-
- npm 发布细节见 [docs/npm-release.md](docs/npm-release.md)。
|
|
250
|
-
|
|
251
|
-
## 更多文档
|
|
252
|
-
|
|
253
|
-
- [使用手册](docs/usage-manual.md)
|
|
254
|
-
- [架构稳定性说明](docs/advisory-review/topics/architecture-stability.md)
|
|
255
|
-
- [证据模型](docs/advisory-review/topics/evidence-model.md)
|
package/docs/npm-release.md
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
# npm Release Notes
|
|
2
|
-
|
|
3
|
-
This repository is a Python 3.11 CLI. The npm package is intentionally a thin
|
|
4
|
-
launcher, not a Node.js rewrite.
|
|
5
|
-
|
|
6
|
-
## Package Identity
|
|
7
|
-
|
|
8
|
-
- Recommended npm package name: `@seemseam/architec`.
|
|
9
|
-
- The unscoped `architec` package name is already occupied on npm and does not
|
|
10
|
-
belong to this project.
|
|
11
|
-
- CLI command exposed by npm: `archi`.
|
|
12
|
-
- npm package version must match `pyproject.toml` and
|
|
13
|
-
`src/architec/_version.py`.
|
|
14
|
-
|
|
15
|
-
## Runtime Strategy
|
|
16
|
-
|
|
17
|
-
The npm `archi` bin uses Node.js only as a launcher. On first run it:
|
|
18
|
-
|
|
19
|
-
1. finds Python 3.11+;
|
|
20
|
-
2. creates a user-cache virtual environment under
|
|
21
|
-
`~/.cache/architec/npm/<version>/venv`;
|
|
22
|
-
3. installs the matching GitHub tag with pip:
|
|
23
|
-
`architec @ git+https://github.com/SeemSeam/architec.git@v<version>`;
|
|
24
|
-
4. executes `python -m architec` with the original CLI arguments.
|
|
25
|
-
|
|
26
|
-
Environment overrides:
|
|
27
|
-
|
|
28
|
-
- `ARCHITEC_NPM_PYTHON`: Python 3.11+ executable to use.
|
|
29
|
-
- `ARCHITEC_NPM_CACHE_DIR`: cache root for the managed virtual environment.
|
|
30
|
-
- `ARCHITEC_NPM_PIP_SPEC`: alternate pip requirement spec for smoke tests or
|
|
31
|
-
emergency repoints.
|
|
32
|
-
|
|
33
|
-
This strategy requires Node.js, Python 3.11+, git, and network access on first
|
|
34
|
-
run. It keeps npm installation lightweight and avoids postinstall side effects,
|
|
35
|
-
but the npm tarball provenance covers the launcher, not the Python source tree
|
|
36
|
-
installed later by pip.
|
|
37
|
-
|
|
38
|
-
## Publication Preconditions
|
|
39
|
-
|
|
40
|
-
- Own or create the npm scope used by `@seemseam/architec`.
|
|
41
|
-
- Keep `package.json`, `pyproject.toml`, and `src/architec/_version.py` on the
|
|
42
|
-
same SemVer value.
|
|
43
|
-
- Ensure the `vX.Y.Z` Git tag exists and points to the intended release commit
|
|
44
|
-
before publishing that npm version.
|
|
45
|
-
- Do not reuse the existing `v0.2.10` tag for a different release commit.
|
|
46
|
-
- Ensure the Python dependency chain is installable from the launcher target.
|
|
47
|
-
As of this audit, `llmgateway>=0.1.1` and `hippocampus>=0.1.7` still need
|
|
48
|
-
registry-ready releases before Architec can be published cleanly.
|
|
49
|
-
- Run `npm pack --dry-run` and inspect the included files before publishing.
|
|
50
|
-
- Do not publish from a dirty or unreviewed release state.
|
|
51
|
-
|
|
52
|
-
## Trusted Publishing
|
|
53
|
-
|
|
54
|
-
After the first package exists on npm, configure npm Trusted Publishing with:
|
|
55
|
-
|
|
56
|
-
- Provider: GitHub Actions
|
|
57
|
-
- Organization or user: `SeemSeam`
|
|
58
|
-
- Repository: `architec`
|
|
59
|
-
- Workflow filename: `release.yml`
|
|
60
|
-
- Environment: blank unless the npm job uses a GitHub environment
|
|
61
|
-
- Allowed actions: `npm publish`, or `npm stage publish` if staged publishing is
|
|
62
|
-
preferred
|
|
63
|
-
|
|
64
|
-
The GitHub Actions job should use a GitHub-hosted runner, Node 24, npm 11.5.1
|
|
65
|
-
or newer, `permissions: id-token: write`, and no publish token.
|