@seemseam/architec 0.2.10 → 0.2.11

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 CHANGED
@@ -8,89 +8,58 @@
8
8
 
9
9
  [English](README.md) | [中文](README.zh-CN.md)
10
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:
11
+ Architec is an advisory architecture analysis CLI. It helps answer one
12
+ practical question:
17
13
 
18
14
  > Will this change make the codebase harder to maintain?
19
15
 
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. |
16
+ It reviews current changes by default, asks an LLM to interpret compact
17
+ selected-scope evidence, and reports architecture risks such as duplicated
18
+ logic, shadow implementations, unclear boundaries, stale structure, topology
19
+ pressure, and risky hotspots.
33
20
 
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`.
21
+ Architec does not make merge decisions and does not edit code. It gives
22
+ structured advice for humans and coding agents to review.
38
23
 
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.
24
+ ## Why Architec
42
25
 
43
- ## Install
26
+ LLM-assisted development can move quickly, but architecture can drift quietly.
27
+ Architec is designed to catch the kinds of issues that accumulate over time:
44
28
 
45
- Architec requires Python 3.11 or newer.
29
+ - repeated implementations and "same idea twice" code;
30
+ - compatibility paths that blur into canonical implementations;
31
+ - changed files crossing intended module boundaries;
32
+ - stale cleanup/archive candidates;
33
+ - high-risk work landing in churn-heavy areas;
34
+ - full-project topology pressure that is easy to miss during local edits.
46
35
 
47
- Local development install from this checkout:
36
+ The default workflow is incremental-first:
48
37
 
49
38
  ```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
39
+ archi
63
40
  ```
64
41
 
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:
42
+ Use full review when you want the whole-project baseline:
70
43
 
71
44
  ```bash
72
- npm install -g @seemseam/architec
45
+ archi --full
73
46
  ```
74
47
 
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
48
  ## How It Fits Together
80
49
 
81
- Architec is the architecture review layer. It uses two companion components:
50
+ Architec is the review layer. It uses two companion components:
82
51
 
83
52
  | Component | Command / package | Role |
84
53
  | --- | --- | --- |
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. |
54
+ | **Architec** | `archi` / `architec` | Runs architecture review, calls the LLM through llmgateway, writes advisory results under `.architec/`. |
55
+ | **Hippos** | `hippos` / `seemseam-hippos` | Builds structural project snapshots under `.hippos/`: file manifests, code signatures, repository indexes, structure prompts, and metrics. |
87
56
  | **llmgateway** | `llmgateway` | Owns provider credentials, base URLs, API style, model names, and strong/weak model routing. |
88
57
 
89
58
  ```text
90
59
  source tree + git changes
91
60
  |
92
61
  v
93
- Hippo structural snapshot -> .hippocampus/
62
+ Hippos structural snapshot -> .hippos/
94
63
  |
95
64
  v
96
65
  Architec evidence builder -> selected-scope or full-project context
@@ -102,37 +71,93 @@ llmgateway LLM call -> strong / weak model tiers
102
71
  Architec review output -> .architec/
103
72
  ```
104
73
 
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.
74
+ Day-to-day `archi` runs still use the LLM, but they avoid refreshing the whole
75
+ Hippos snapshot unless requested. `archi --full` uses the Hippos snapshot more
76
+ heavily, and `archi --refresh-from-hippos --full` refreshes it before review.
77
+
78
+ ## How It Works
79
+
80
+ Architec combines deterministic code signals with LLM interpretation. The
81
+ deterministic layer keeps the review grounded in concrete evidence; the LLM
82
+ layer turns that evidence into readable architecture advice.
83
+
84
+ 1. **Select scope**
85
+ - `archi` reads the current git changes and focuses on changed files.
86
+ - `archi --full` reviews the whole project.
87
+
88
+ 2. **Read structural context**
89
+ - Hippos produces `.hippos/` snapshots: file manifests, code signatures,
90
+ repository indexes, metrics, and structure prompts.
91
+ - Architec checks whether that snapshot is present, stale, or unknown.
92
+
93
+ 3. **Build architecture evidence**
94
+ - Architec runs static scanners for duplicated logic, shadow
95
+ implementations, import-boundary pressure, cleanup/archive candidates,
96
+ hotspots, topology pressure, and snapshot freshness.
97
+ - Incremental review keeps selected-change concerns separate from broader
98
+ project context so small diffs are not drowned by global noise.
99
+
100
+ 4. **Ask the LLM for interpretation**
101
+ - Architec sends compact evidence to llmgateway.
102
+ - llmgateway chooses the configured strong or weak model tier and owns all
103
+ provider credentials.
104
+
105
+ 5. **Write advisory output**
106
+ - Architec ranks concerns, keeps raw artifacts for inspection, and writes
107
+ human-readable plus machine-readable output under `.architec/`.
108
+ - The result is advice, not an automatic merge decision or proof of runtime
109
+ correctness.
110
+
111
+ ## Install
112
+
113
+ Architec requires Python 3.11+.
114
+
115
+ Recommended install from PyPI:
116
+
117
+ ```bash
118
+ python3 -m pip install --user architec
119
+ ```
120
+
121
+ This installs:
122
+
123
+ - `archi`, the Architec CLI;
124
+ - `seemseam-llmgateway`, the package that provides the LLM provider gateway;
125
+ - `seemseam-hippos`, the package that provides Hippos structural snapshots.
126
+
127
+ The runtime imports remain `llmgateway` and `hippos`; no separate package index
128
+ setup is required.
129
+
130
+ Local development from this repository:
131
+
132
+ ```bash
133
+ python3 -m pip install -e .
134
+ ```
109
135
 
110
136
  ## Configure LLM Access
111
137
 
112
- Architec gets LLM access through **llmgateway**. Configure provider credentials,
113
- base URL, API style, and model tiers in:
138
+ Architec gets all LLM access through **llmgateway**. Configure provider
139
+ credentials and model tiers in:
114
140
 
115
141
  ```text
116
142
  ~/.llmgateway/config.yaml
117
143
  ```
118
144
 
119
- Minimal shape:
145
+ Minimal example:
120
146
 
121
147
  ```yaml
122
148
  version: 1
123
149
  provider:
124
150
  provider_type: openai
125
151
  api_style: openai_responses
126
- base_url: https://your-llm-endpoint.example/v1
127
- api_key: <set-locally>
152
+ base_url: https://your-llm-endpoint/v1
153
+ api_key: sk-...
128
154
  settings:
129
155
  strong_model: your-strong-model
130
156
  weak_model: your-fast-model
131
157
  ```
132
158
 
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.
159
+ Architec consumes the configured `strong_model` and `weak_model` tiers. It does
160
+ not store model-provider credentials itself.
136
161
 
137
162
  Check the installation and LLM route:
138
163
 
@@ -145,60 +170,44 @@ If the check reports missing LLM configuration, update
145
170
 
146
171
  ## Quick Start
147
172
 
148
- Review the current git changes in the current directory:
173
+ Review the current selected changes:
149
174
 
150
175
  ```bash
151
176
  archi
152
177
  ```
153
178
 
154
- Review another project path:
155
-
156
- ```bash
157
- archi /path/to/project
158
- ```
159
-
160
179
  Run whole-project architecture review:
161
180
 
162
181
  ```bash
163
182
  archi --full
164
183
  ```
165
184
 
166
- Refresh Hippo inputs before whole-project review:
185
+ Save JSON output:
167
186
 
168
187
  ```bash
169
- archi --refresh-from-hippo --full
188
+ archi --out review.json
189
+ archi --full --out full-review.json
170
190
  ```
171
191
 
172
- Save JSON output:
192
+ Refresh Hippos inputs before full review:
173
193
 
174
194
  ```bash
175
- archi --out review.json
176
- archi --full --out full-review.json
195
+ archi --refresh-from-hippos --full
177
196
  ```
178
197
 
179
- ## CLI Command Summary
198
+ ## Command Summary
180
199
 
181
200
  | Command | Purpose |
182
201
  | --- | --- |
183
- | `archi` | Incremental LLM architecture review for current git changes. |
184
- | `archi <path>` | Incremental review for another project root. |
202
+ | `archi` | Incremental LLM architecture review for current selected changes. |
185
203
  | `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
204
  | `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. |
205
+ | `archi --full --out full-review.json` | Save full-review JSON. |
206
+ | `archi --refresh-from-hippos --full` | Refresh Hippos structural inputs, then run full review. |
207
+ | `archi --check .` | Validate Hippos bundle state and llmgateway configuration. |
192
208
 
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
- ```
209
+ Advanced compatibility flags and older subcommands may still be accepted for
210
+ existing automation, but new usage should prefer the commands above.
202
211
 
203
212
  ## What Architec Reports
204
213
 
@@ -210,10 +219,11 @@ Architec reports advisory concerns and signals, including:
210
219
  - **Cleanup/archive candidates**: stale or legacy-looking code and docs.
211
220
  - **Hotspots**: churn-heavy or structurally risky areas.
212
221
  - **Topology pressure**: flat or confusing project structure.
213
- - **Snapshot freshness**: missing, stale, or unknown Hippo context.
222
+ - **Snapshot freshness**: missing, stale, or unknown Hippos context.
214
223
  - **Risk context**: optional external facts attached to existing concerns.
215
224
 
216
- The output is advice, not a pass/fail gate.
225
+ The output is advisory. It is not a pass/fail result and is not proof of
226
+ runtime correctness.
217
227
 
218
228
  ## Outputs
219
229
 
@@ -230,39 +240,36 @@ Architec writes generated files under `.architec/`:
230
240
  cache/
231
241
  ```
232
242
 
233
- Hippo writes structural inputs under `.hippocampus/`.
243
+ Hippos writes structural inputs under `.hippos/`.
234
244
 
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.
245
+ Start with `.architec/architec-summary.md` for the human-readable report, then
246
+ open `.architec/architec-analysis.json` for exact scores, concerns, signals,
247
+ and artifact paths.
239
248
 
240
- ## Dependencies
249
+ ## Agent Command Compatibility
241
250
 
242
- The Python package declares:
251
+ The commands above describe the current public workflow. Some older installed
252
+ `archi` binaries may still show the previous command shape, where full review
253
+ is `archi .` and incremental review is `archi --diff .`.
243
254
 
244
- - `llmgateway>=0.1.1`;
245
- - `hippocampus>=0.1.7`;
246
- - `PyYAML`, `certifi`, and `cryptography` from Python package indexes.
255
+ Agents and automation should inspect the local binary before choosing commands:
247
256
 
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.
257
+ ```bash
258
+ archi --help
259
+ ```
252
260
 
253
- ## No Login Required
261
+ | Help output | Incremental review | Full review |
262
+ | --- | --- | --- |
263
+ | Includes `--full` | `archi` | `archi --full` |
264
+ | Lacks `--full` but includes `--diff` | `archi --diff .` | `archi .` |
254
265
 
255
- Architecture analysis commands do not require `archi login`.
266
+ ## No Login Required
256
267
 
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.
268
+ Architecture analysis does not require `archi login`.
262
269
 
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.
270
+ Account commands such as `archi login`, `archi whoami --json`, and
271
+ `archi devices --json` may exist for diagnostics, but they are not part of
272
+ normal Architec analysis.
266
273
 
267
274
  ## Development
268
275
 
@@ -275,27 +282,10 @@ PYTHONPATH=src python3 -m pytest -q
275
282
  Run Architec from this checkout:
276
283
 
277
284
  ```bash
278
- PYTHONPATH=src python3 -m architec --help
279
285
  PYTHONPATH=src python3 -m architec
280
286
  PYTHONPATH=src python3 -m architec --full
281
287
  ```
282
288
 
283
- ## Release Maintainer Notes
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
289
  ## More Documentation
300
290
 
301
291
  - [Usage manual](docs/usage-manual.md)