@lamentis/naome 1.3.9 → 1.3.10
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/Cargo.lock +2 -2
- package/README.md +5 -0
- package/bin/naome.js +1 -1
- package/crates/naome-cli/Cargo.toml +1 -1
- package/crates/naome-cli/src/architecture_commands.rs +123 -0
- package/crates/naome-cli/src/cli_args.rs +4 -0
- package/crates/naome-cli/src/dispatcher.rs +2 -0
- package/crates/naome-cli/src/main.rs +6 -0
- package/crates/naome-core/Cargo.toml +1 -1
- package/crates/naome-core/src/architecture/config/parser/scalar.rs +26 -0
- package/crates/naome-core/src/architecture/config/parser/sections.rs +137 -0
- package/crates/naome-core/src/architecture/config/parser.rs +96 -0
- package/crates/naome-core/src/architecture/config.rs +114 -0
- package/crates/naome-core/src/architecture/model.rs +80 -0
- package/crates/naome-core/src/architecture/output.rs +178 -0
- package/crates/naome-core/src/architecture/rules.rs +140 -0
- package/crates/naome-core/src/architecture/scan/graph_builder/emit.rs +56 -0
- package/crates/naome-core/src/architecture/scan/graph_builder/facts.rs +88 -0
- package/crates/naome-core/src/architecture/scan/graph_builder.rs +134 -0
- package/crates/naome-core/src/architecture/scan/path_scan.rs +92 -0
- package/crates/naome-core/src/architecture/scan.rs +75 -0
- package/crates/naome-core/src/architecture.rs +31 -0
- package/crates/naome-core/src/install_plan.rs +2 -0
- package/crates/naome-core/src/lib.rs +16 -8
- package/crates/naome-core/tests/architecture.rs +209 -0
- package/crates/naome-core/tests/harness_health.rs +1 -0
- package/installer/harness-files.js +3 -0
- package/native/darwin-arm64/naome +0 -0
- package/native/linux-x64/naome +0 -0
- package/package.json +1 -1
- package/templates/naome-root/.naome/bin/check-harness-health.js +7 -7
- package/templates/naome-root/.naome/bin/check-task-state.js +7 -7
- package/templates/naome-root/.naome/bin/naome.js +2 -2
- package/templates/naome-root/.naome/manifest.json +10 -8
- package/templates/naome-root/.naome/verification.json +15 -1
- package/templates/naome-root/docs/naome/architecture-fitness.md +97 -0
- package/templates/naome-root/docs/naome/index.md +4 -3
- package/templates/naome-root/docs/naome/testing.md +6 -3
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Architecture Fitness
|
|
2
|
+
|
|
3
|
+
NAOME architecture fitness validates repository structure with deterministic
|
|
4
|
+
rules before agent changes are accepted. The rule layer is language-agnostic:
|
|
5
|
+
language-specific extractors feed a normalized graph, and rules evaluate graph
|
|
6
|
+
facts instead of prompt text.
|
|
7
|
+
|
|
8
|
+
## Commands
|
|
9
|
+
|
|
10
|
+
- `naome arch init` writes a starter `naome.arch.yaml`.
|
|
11
|
+
- `naome arch explain` prints inferred layers, contexts, rules, and extractors.
|
|
12
|
+
- `naome arch scan --json` emits the normalized graph.
|
|
13
|
+
- `naome arch scan --write` writes `.naome/architecture-graph.json`.
|
|
14
|
+
- `naome arch validate` runs architecture rules with human output.
|
|
15
|
+
- `naome arch validate --json` emits stable machine-readable output.
|
|
16
|
+
- `naome arch validate --agent-feedback` emits compact repair instructions.
|
|
17
|
+
- `naome arch validate --changed-only` uses changed paths when available and
|
|
18
|
+
safely degrades to a full scan for graph-level soundness.
|
|
19
|
+
|
|
20
|
+
## Graph Model
|
|
21
|
+
|
|
22
|
+
The foundation graph uses stable IDs and normalized node and edge kinds. Nodes
|
|
23
|
+
cover repositories, directories, files, layers, bounded contexts, modules,
|
|
24
|
+
symbols, packages, and external dependencies. Edges cover containment and the
|
|
25
|
+
dependency edge kinds required by later extractor slices.
|
|
26
|
+
|
|
27
|
+
Each node and edge carries path, language, source range when known, confidence,
|
|
28
|
+
extractor name, raw origin data, stable ID, and a human-readable label.
|
|
29
|
+
|
|
30
|
+
## Configuration
|
|
31
|
+
|
|
32
|
+
`naome.arch.yaml` defines layers, bounded contexts, rules, and ignored paths.
|
|
33
|
+
Ignored paths require a reason so agents cannot silently suppress architecture
|
|
34
|
+
ownership.
|
|
35
|
+
|
|
36
|
+
```yaml
|
|
37
|
+
layers:
|
|
38
|
+
domain:
|
|
39
|
+
paths:
|
|
40
|
+
- "src/domain/**"
|
|
41
|
+
infrastructure:
|
|
42
|
+
paths:
|
|
43
|
+
- "src/infrastructure/**"
|
|
44
|
+
|
|
45
|
+
contexts:
|
|
46
|
+
billing:
|
|
47
|
+
paths:
|
|
48
|
+
- "src/billing/**"
|
|
49
|
+
public_api:
|
|
50
|
+
- "src/billing/index.ts"
|
|
51
|
+
|
|
52
|
+
rules:
|
|
53
|
+
max_file_lines:
|
|
54
|
+
enabled: true
|
|
55
|
+
value: 400
|
|
56
|
+
severity: warning
|
|
57
|
+
generated_manual_boundary:
|
|
58
|
+
enabled: true
|
|
59
|
+
severity: error
|
|
60
|
+
|
|
61
|
+
ignore:
|
|
62
|
+
- path: "generated/**"
|
|
63
|
+
reason: "Generated code is not architecture-owned."
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Current Rules
|
|
67
|
+
|
|
68
|
+
- `arch.max_file_lines` enforces the configured file line budget.
|
|
69
|
+
- `arch.generated_manual_boundary` prevents changed files under explicitly
|
|
70
|
+
ignored generated paths from being accepted without regeneration or a config
|
|
71
|
+
change.
|
|
72
|
+
|
|
73
|
+
## Agent Integration
|
|
74
|
+
|
|
75
|
+
Agents should run `naome arch validate --changed-only --json` after changing
|
|
76
|
+
source or template files. JSON output includes status, severity counts,
|
|
77
|
+
violations, concrete suggestions, and `agentFeedback` entries optimized for
|
|
78
|
+
repair loops.
|
|
79
|
+
|
|
80
|
+
## CI Integration
|
|
81
|
+
|
|
82
|
+
Use `node .naome/bin/naome.js arch validate --changed-only` as a fast gate.
|
|
83
|
+
The first foundation release reports warnings for existing file-size debt and
|
|
84
|
+
fails only on configured error rules.
|
|
85
|
+
|
|
86
|
+
## Language Support
|
|
87
|
+
|
|
88
|
+
The v1.3.10 foundation classifies TypeScript, JavaScript, Rust, Python, Go,
|
|
89
|
+
Java, Kotlin, and Swift files by path extension. Import extractors, resolver
|
|
90
|
+
rules, cycle detection, layer dependency rules, and manifest extraction are
|
|
91
|
+
planned follow-up slices before v1.4.0.
|
|
92
|
+
|
|
93
|
+
## Limitations
|
|
94
|
+
|
|
95
|
+
This release intentionally starts with path extraction, graph construction,
|
|
96
|
+
file budgets, generated/manual boundaries, JSON output, human output, and CLI
|
|
97
|
+
integration. It does not yet resolve imports or validate cross-layer imports.
|
|
@@ -22,9 +22,10 @@ for the current step.
|
|
|
22
22
|
15. `testing.md`
|
|
23
23
|
16. `repository-quality.md`, when repository-quality checks or cleanup are relevant
|
|
24
24
|
17. `repository-structure.md`, when path roles or structure cleanup are relevant
|
|
25
|
-
18. `
|
|
26
|
-
19. `
|
|
27
|
-
20. `
|
|
25
|
+
18. `architecture-fitness.md`, when architecture graph or rule feedback matters
|
|
26
|
+
19. `security.md`
|
|
27
|
+
20. `agent-workflow.md`
|
|
28
|
+
21. `decisions.md`, when changing durable project policy
|
|
28
29
|
|
|
29
30
|
## Source Types
|
|
30
31
|
|
|
@@ -26,6 +26,7 @@ and stale-policy issues before the task grows. It does not replace the final
|
|
|
26
26
|
| naome-task-state | `node .naome/bin/check-task-state.js` | `.` | fast | null |
|
|
27
27
|
| repository-quality-check | `node .naome/bin/naome.js quality check --changed` | `.` | fast | null |
|
|
28
28
|
| repository-semantic-check | `node .naome/bin/naome.js semantic check --changed` | `.` | fast | null |
|
|
29
|
+
| architecture-fitness-check | `node .naome/bin/naome.js arch validate --changed-only` | `.` | fast | null |
|
|
29
30
|
|
|
30
31
|
## Verification Phases
|
|
31
32
|
|
|
@@ -52,6 +53,7 @@ phase is failing or missing.
|
|
|
52
53
|
- `.naome/bin/check-harness-health.js`
|
|
53
54
|
- `.naome/bin/check-task-state.js`
|
|
54
55
|
- `.naome/task-contract.schema.json`
|
|
56
|
+
- `docs/naome/architecture-fitness.md`
|
|
55
57
|
|
|
56
58
|
## Rules
|
|
57
59
|
|
|
@@ -66,8 +68,9 @@ phase is failing or missing.
|
|
|
66
68
|
and 12 release gates.
|
|
67
69
|
- Store long command output as a compact summary that preserves command, cwd,
|
|
68
70
|
exit code, relevant lines, affected paths, and artifacts.
|
|
69
|
-
- When intake defines change types, include `repository-quality-check
|
|
70
|
-
`repository-semantic-check` as required
|
|
71
|
-
documentation, harness, template, and CI
|
|
71
|
+
- When intake defines change types, include `repository-quality-check`,
|
|
72
|
+
`repository-semantic-check`, and `architecture-fitness-check` as required
|
|
73
|
+
checks for source, structure, documentation, harness, template, and CI
|
|
74
|
+
changes.
|
|
72
75
|
- Before completion, select proof from the Verification Map when possible.
|
|
73
76
|
- Report exact commands and results. Do not claim proof that did not run.
|